#arma3_scripting
1 messages · Page 507 of 1
Any handgun/pistol, shouldnt matter what handgun..
well it apparently does not work with Rifles nor pistols either
hmm
Im not sure if "Handgun" is what you need
try HandGun
With HandGun you mean Pistols, right?
yes
well there is no Handgun Class
Pistols inherit from Pistol_Base_F, Pistol, PistolCore and Default
so I guess we gotta use Pistol or Pistol_Base_F instead
and it works with "Pistol"
oh
https://community.bistudio.com/wiki/CfgWeapons_Config_Reference I am pretty sure I saw handgun? but if Pistol works thats good enough
well I just looked in the ingame config browers at the hguns
and its only Parents are the ones I listed
though there is a HandGunBase
but that one is not inherited so...
¯_(ツ)_/¯
so What should I use? lol
Thanks!
^^
And also is there a way to disable votekick and voteadmin?
I tried allowedVoteCmds[] = {}; in description.ext but one of my admins reported that it didn't work and they could still votekick
hmmm
@mint kraken currentWeapon _source == handgunWeapon _source no?
I thought about that afterwards, Which one is efficient/fastest though?
Quick question... If I create a function like anexamplefunc = {}; Can that only be accessed in the file that declares the func or is it global?
Erm, test it with code performance button in debug console?
global
Thanks
if you want it to be local to the scope or script or whatever then you can just name it
private _myFnc = {};```
variable name starts with _
there are thousands of global functions in Arma 3 framework already adding a few more wont make any difference
Okay thank you
Is there a way to check if the player has the rebreather mask set on his face ? It is automatically set, and I initially thought it was triggered when surfaceIsWater switch to true. But I was wrong : if you stand on an object above water, surfaceIsWater return true whereas the rebreather mask is not visible. And the underwater command is not right either : the mask is visible way before the underwater command says true
Im not sure. But you could do a workaround with checking the z-value of getPosASL (ASL = Above Sea Level).
Check at which value it is visible and then you can just check if the player is at that height or below and then do whatever you wanna do
oh you think it is linked to the altitude of the player above water. Good idea, it might be true. Indeed, when you are just above water, let's say standing on a very low bridge, when the wave is low the mask does not appear, whereas when the wave rises, the mask sets itself briefly. So it might be ASLW more than ASL, but definitely related
It seems that mask is appearing when Z value of ASLW position is below 0.5. This does not looks like a random value to me !
Anyone know if the playableUnits command returns units in a specific way e.g who joined first?
If I remember well, the array is in the order of placement in the editor. But do not take this sentence as an eternal truth. I had a similar question a while ago, and I think I ended up with this answer. Worth a check.
Hello, I am currently starting the sqf but I have no idea of small script easy to do, you have any idea?
I'm sorry 😃
@tough abyss hint "Hello World"; this should get you started
It's fairly easy to pick up, but if you're coming from another language, get ready to be absolutely destroyed by syntaxial differences that look right to you.
I may or may not have fought missing a "then" after an if statement for 30 minutes when i first wrote some sqf. Looked right to my C#,CG,java,and js brain
It isn't an elegant language, nor a particular expressive one.
Can someone teach me how to add scripts to missions/scenarios
I'm having alot of trouble trying to get it to work
Sorry my bad
I've been trying to install an auto-medic mod on a mission but it doesn't seem to be working
does the mod have any explanation on how to isntall it?
you probably want to call something in your init.sqf
"Installation / Usage:
This line should go to the init field of the medic unit.
_null = [<unit>,<side>,<hq marker(optional)>] execVM "Medic.sqf";
Medic will heal all nearby units:
_null = [This,"All"] execVM "Medic.sqf";
Medic will heal only west side and create a medical outpost marker:
_null = [This,"West","HQ_Marker"] execVM "Medic.sqf";
Remark:
Be gentle with the '_maxSearchUnitDistance' and '_maxSearchVehDistance' variables,
greater then ~1000 is costly for your game performance."
That's all it says
Okey. You don't know what init field is?
Yes
Double click a unit in 3DEN or go to it's attributes
there is a big script text box that should say init script
I ended up getting an error
what might that mysterious error be
there is more to that error than that
"Invalid number in expression"
what did you copy paste
_null = [<unit>,<side>,<hq marker(optional)>] execVM "Medic.sqf";
yeah that's invalid
that's telling you "put a unit here" "put a side here"
You need to fill it out
Oh wow
Or use one of the other examples that are already filled out
I can't find an example, so could you give me one? I'm trying to place this on a NATO medic.
Oh okay
@still forum thank you dude my dumbass was struggling with this all afternoon
Is there a way to lengthen the amount of time BIS_fnc_typeText is displayed? There's no reference to duration on the wiki page
Then there is none, unfortunately
@winter rose kind of janky but adding blocks of empty text seem to prolong the display. Guess that'll do
that's the way!
alternative functions exist, if you prefer
like https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_SITREP
lol thanks, I'll take a look
Hey so can someone explain to me what's invalid about this line of script
dummy = [this, units (group player)] execVM "scripts\automedic.sqf";
the parenthesis are not needed
don't see anything wrong
the dummy is nonsense but doesn't break it ¯_(ツ)_/¯
For new years, I want to allow the TOCC to have drone and helmet cam and satellite feeds, how can I do this without using another mod?
@vapid drift thats because it reads the text like HTML
It depends on whether you have done programming before or not
@lean aurora could you be more specific?
ahh yes, the car script
You know, the car script, man
couldn't you just port it over from the tank script?
quick question, should I replace all BIS_fnc_param to param or params? Or it doesn't matter?
@mint kraken yes, yes and yes, ditch this func! 😉
Will do now, thanks! 😃
Hey guys. I'm trying to remove terrain objects from the map with HideObjectGlobal. I'm using helipads to mark where I want them to remove objects. _newObject = createVehicle ['Land_HelipadEmpty_F', [20599.4,20119.5,0.835995], [], 0, 'CAN_COLLIDE']; _newObject setPosWorld [20599.4,20119.5,52.7491]; [_newObject, [[8.89026e-006,1,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject]; _newObject enableSimulationGlobal true; [_newObject, { waitUntil {!isNull _this}; { _x hideObjectGlobal true } foreach (nearestTerrainObjects [_this,["HOUSE","BUILDING","FENCE","WALL","VIEW-TOWER"],50]); }] remoteExec ["spawn", -2];
Doesn't seem to work though, what am I doing wrong? Any help would be greatly appreciated.
Why dont you just use the module in the eden editor? its way easier
Yeah thing is this cant be made it in the editor, trying to remove it with the console.
making it into hideObject instead of HideObjectGlobal seemed to work
though that might cause issues later on...
Anyone knows why the server skips waitUntil? publicLoadout = "empty"; ["DB_loadLoadout",[(getPlayerUID player),(clientOwner),(str playerSide)]] call CBA_fnc_serverEvent; waitUntil { !(publicLoadout isEqualTo "empty") }; the cba function makes the server fetch information from a database, the variable gets sent to the client later, the variable arrives the client my debug console says
the code after "waitUntil" gets executed instantly, the system is not waiting until the variable changed
the variable contains an array later, thats why i am using "isEqualTo" instead of "=="
@empty wren why not [] and isEqualTo for example?
Also, you maybe don't need it to be a public variable?
i already tried publicLoadout=[] and then isEqualTo, but it should work with both string and array
the serverside script that gets executed does _clientOwner publicVariableClient "publicLoadout"; so the variable should be public
if i type the code into the debug console everything is fine
@winter rose https://pastebin.com/HbddSbVq
any error message?
something with vehicle empty, wait a minute
i think because the variable is still "empty" and not an array, so player setUnitLoadout publicLoadout; doesnt work
waitUntil isEqualType [] then?
i can try this, but isEqualTo normally can compare strings and arrays
yes, so I think the error is from somewhere else. did you activate -showScriptErrors flag?
of course not
isEqualTo can compare everything
hmm
i got other database scripts that fetch things like e.g. the rank and everythings works fine
the scripts work the same way
@winter rose 'Bad vehicle type empty' was the message
if i type publicLoadout into the debug console, the current value is [["SMG_05_F","","","",["30Rnd_9x21_Mag_SMG_02",30],[],""],[],["hgun_Pistol_01_F","","","",["10Rnd_9x21_Mag",10],[],""],["U_B_GEN_Commander_F",[["30Rnd_9x21_Mag_SMG_02",3,30]]],["V_TacVest_gen_F",[["ACE_fieldDressing",3],["ACE_packingBandage",3],["ACE_morphine",3],["ACE_tourniquet",3],["30Rnd_9x21_Mag_SMG_02",7,30],["10Rnd_9x21_Mag",1,10]]],[],"H_Beret_gen_F","G_Aviator",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152_2","ItemCompass","ItemWatch",""]]
so the client tries to apply the loadout which is still the "empty"-string , and after that the server gets the information from the database
i even added globalChat / remoteExec globalChat after every command too see what gets executed, first the whole client script gets executed, then the severside script gets executed, or the remoteExec has a delay
try to systemChat before the set loadout , and if it works then the issue is somewhere else
'Bad vehicle type empty' was the message
Did you try to createVehicle that?
your variable is missing it's tag
all global variables should have tags. Otherwise you randomly overwrite the variables from other retards who also don't have a tag
marcel_publicLoadout or something like that
the server has publicVariable and overrides the variable on my client but not on every client (_clientOwner publicVariableClient "publicLoadout")
its not necessary
And you are 100% sure your client will never run badly written scripts?
the other scripts work perfectly
I don't see the difference tbh. Still broken. One client vs all clients isn't that much of a difference
i dont understand what you mean, the variable on the server has the value of the last query, the the variable gets send to my client, and if another player uses the DB, the server gets the equipment from the database and send it to the other player
and the variable DB_arbeitet (database is currently working) makes that i dont get you gear if the both trigger the query at the same time
another mod or script might use the same variable name
"publicLoadout"
and you are breaking it
And 'Bad vehicle type empty' tells me that might be happening
the variable is only used for that one DB equipment script
you mean that i just should rename that variable
?
yes
And yes I know that YOU only use it for that
but you cannot know about ALL other scripts or mods that anyone might use
That's why every global variable needs to have a tag
DB_publicLoadout = "asdf"; then that happened bad vehicle type asdf
what are you doing with that variable?
giving it a random value, that is not important, could also say DB_publicLoadout = 0;
waitUntil { DB_publicLoadout isEqualType [] }; still doesnt work
it just skips waitUntil thats the only problem
the script get executed via scroll menu (addAction)
Are you fetching loadout array from database and then sending it to client? Don’t do this, equip player from the server
@tough abyss why? i want that you can save your customized gear normally there is no problem with that
Because sending arrays over network is not good
the loadout array is saved in the variable that works perfectly but the system doesnt wait with player setUnitLoadout publicLoadout; until the string is an array
Then ppl complain why there is desync
it just skips waitUntil thats the only problem unscheduled?
yes
you can't suspend in unscheduled
your RPT should be telling you that
or showScriptErrors too
RPT? What is that 😂
You can use CBA. Or a public variable eventhandler instead
so i just use []execVM instead of []exec so it should work?
lol
exec is for SQS scripts
wut? i always execute scripts like []execVM "someFile.sqf";
yeah. execVM is correct
unless you use that to execute the same script multiple times
then you should use CfgFunctions. To not load,preprocess,compile the script file before every execution
yeah i currently see that in the wiki
Some part of that process is cached @still forum
the compiling yes
doesn't really matter tho
you are constantly redoing stuff. Even though you could just do it once and store it
Caching in the engine doesn't make that less dumb
@empty wren so did you use execVM here or exec?
execVM is scheduled
I wonder if it caches based on the file name
i tried execVM again, I changed to exec after it didnt worked
And for all CBA based mods. preproc takes way longer than compile. But with a CBA based mod you are using proper PREP or CfgFunctions anyway.
but now everything is working, thank you all
Exec is for sqs code
yeah it works perfectly like it should, thank you
👍
it has @ , hehe, "old times"
@still forum does it use the whole file content to make a hash or only part of it?
whole
only using a part is impossible
as you wouldn't detect changes in the other part, causing wrong results
True but this means big files will take longer too look up?
yeah
depends on CPU cache and ram speed. Shouldn't make that much of a difference if it fits into cache, and windows doesn't suspend the thread (which it probably does unless you have priority set to realtime and a exclusive cpu core for main thread)
So basically if you need to load file it better contains only a few lines calling compiled function
optimally you'd only load any file once and use CfgFunctions
Yeah but some shit like particle scripts you have no choice
Or something very fancy like "load and compile on first call, and then store in variable after that"
Hi guys. How can I make my camera look at the player a little to the right?
In view mode from 3rd shift the camera to the right
there is an addon that does it I think but what I remember it did not work in all situations
on thread was on BIforums
no "easyway" to do it though
And you do not remember the name of the addon?
@young current Thanks
Hello guys i making an admin menu and i need help i do not know how to make the lbAdd can any one helps me please this my RscListbox
{
idc = 1500;
x = -0.2;
y = 0.22;
w = 0.3375;
h = 0.64;
};```
how do u do it
i did that but is there a way to make it eaiser
can execute the script from the action directly
though.. not sure if that even works
what are you trying to do?
iam trying to have an option to customize npc loadouts
you can just open Arsenal for yourself and change the center I think
Not trivial though
Hello guys i making an admin menu and i need help i do not know how to make the lbAdd can any one helps me please this my RscListbox
class Rsc_list: RscListbox { idc = 1500; x = -0.2; y = 0.22; w = 0.3375; h = 0.64; };
@prime horizon what is that spam supposed to help?
Just made me want to help you less now.
@prime horizon add onLoad EH and populate from there
{
idc = 1500;
x = -0.2;
y = 0.22;
w = 0.3375;
h = 0.64;
onLoad =
};```
you mean like this ?
@tough abyss
can you talk to me in private message
PM disabled sorry
whatever you want
then add. Sorry gotta go
Dont be needy. If someone knows how to help you they see your questions already and will answer when they are online.
Just an advice how to behave on this server.
For example. I could help now. But I simply won't because of the spam and pushing.
You're not making friends with that behaviour.
this when i write that i need help but you was writing with your friend so my request been up then you say spam
because spamming a screenshot of a copy-pasted text is better than copy-pasting the text again 🤦
do you want to cry because i write my request again ?
I can't find a way to make the camera shift to the right when the 3rd is active.
it is not possible by default @fleet hazel . only way is to script a second custom camera like the mod I told you about earlier
it's fine, it weighs 3 kilo, you are now the happy father of a healthy sqf file!
it's because I do not know how to send sqf files here
ok
pastebin for example
look at how while is to be used
also = set's a variable
also you cannot define a variable with the same name as a command. Like you are trying to do with sleep there
wait, you can !wiki -command-?
Yes. I can. You can't
muh :' (
Secret sauce 😄
something baaaaaad
@tough abyss
while { map > 20 } do
{
(…)
};
and use Allman's indentation, medammit
ok
also, then { (…) } , not parenthesis
ok, now that the command line work
🤢
how do I execute this loop, if I have nothing to be > 20
…do you have any idea about what you want to achieve?
give map to ai units
use cba
@tough abyss Do you want to add only 20 maps for units?
You only want this to happen once?
no
so you have 120 ai units. What you want to do with them?
wait , stop. Konoha, say precisely and in one sentence what you want to do.
I send him over here, he has a little trouble explaining in english. What he wants to do is edit units that are dynamically spawned in (via module of the arma commander mod) so that they always have maps after they spawned.
^^^^
Do you use a script, that spawns units for you? Or you mean units, that spawned by Zeus?
It's a module of a mod that is kind of a mission framework. You pretty much just place down a few modules to make it work. If what you want do is edit the script that spawns them in, i don't think that is possible without changing files of the arma commander mod itself. So he probably has to do it after spawning the units.
@sturdy sage using CBA?
ok. how do I use CBA for this. And what does it do?
["CAManBase", "Init", {
_this addItem "ItemMap";
_this assignItem "ItemMap"
}, true, [], true] call CBA_fnc_addClassEventHandler;
easy as that ☝🏻
Don't know what your "while" and "map=" were supposed to be doing
so where do I write it?
init.sqf I guess?
Ah.
the famous "error"
aka (tell me the actual error or I cannot help you at all because just guessing one of the dozens of possible errors isn't useful)
I'll upload a screenshot on imgur
how to set target for destroy wp?
I was looking at that command a week ago. Gimme a minute to find it
@waxen tendon https://community.bistudio.com/wiki/waypointAttachVehicle
https://community.bistudio.com/wiki/waypointAttachObject one of these I think
Thanks!
isn't _this an array? 🤔
oops sorry
Apparently it is
["CAManBase", "Init", {
params ["_unit"];
_unit addItem "ItemMap";
_unit assignItem "ItemMap"
}, true, [], true] call CBA_fnc_addClassEventHandler;
The cba wiki page could use a little more clearness on what is actually _this
yea
IT WORKS
THANK YOU SO MUCH,
omg I've been looking to a way to fix it
and there it is
I'll put your names on my mission
I should really start learning arma 3 scripting, i always just edit scripts a bit to make them fit my needs or trial and error. It would probably be easier to just learn things myself and stop wasting time like that. And i could help people with this kind of stuff.
it does open up new possibilites to do stuff in Arma
A bit too late to start now when the game is on its last leg, no?
How is it on its last leg?
Look at the change logs, used to be every day, now almost once a month, what does it tell you?
dev branch builds only every second week. Development has been turned down alot. Most devs moved to other projects.
Declared end of life phase.
pff
Don't expect Arma 4 too soon 😄
The game is basically done, thats why many people of the dev team have been moved
done = all DLC's made by BI done
But if you don't know programming at all. Then do it. It will help you learn other languages. Or learn other languages first, and then SQF
Now is one of the best times to start scripting since most stuff wont change I guess
That’s a good point
I know the basics. I can read and understand most scripts (which is why i can edit them to fit my needs).
I played arma 2 back in the day, before dayZ and back then the game was still alive and active even though it wasn't a "blockbuster" title.
And as long as i see the community active, making stuff and playing the game the game is very much alive for me.
hey its me again
19:26, 7 November 2018 killzone_kid (talk | contribs) . . (2,642 bytes) (+10) . . (attaches vehicle to waypoint not other way round)
waypointAttachVehicle attaches the vehicle to the waypoint
not the waypoint to the vehicle
i need to set the target for the waypoint
yes...
exactly.
Attach vehicle to waypoint.
sets waypoints target to vehicle
you want to attach the vehicle to the waypoint
i.e wp1 waypointAttachVehicle target; should work
thanks so much
@tough abyss can you help me please ?
guys i have a RscListbox i want to add the text's in the list Onload = http://prntscr.com/m1ylhl RscListbox http://prntscr.com/m1ylkj
i made the sqf for the lbAdd can any one give me the step's to make the list ?
@prime horizon Put this in debug console and execute ```sqf
_ctrl = finddisplay 46 ctrlCreate ["RscListBox", -2]; _ctrl lbAdd "Line 1"; _ctrl lbAdd "Line 2"; _ctrl lbAdd "Line 3";
or if you want to put this in David_David:
```sqf
David_David = {disableSerialization; params ["_ctrl"]; _ctrl lbAdd "Line 1"; _ctrl lbAdd "Line 2"; _ctrl lbAdd "Line 3";};
Or just add this onLoad to your control
onLoad = "_this select 0 lbAdd ""Line 1""; _this select 0 lbAdd ""Line 2""; _this select 0 lbAdd ""Line 3""";
Also try to find yourself a GUI tutorial as you seem to be lacking quite a lot of basics
Bit of a weird question here but here goes... (probably stupid question) If I spawn a function and then inside that function i make a call will the call be in a scheduled or unscheduled environment?
Scheduled
Okay very instesting, Meaning I can sleep etc inside of this call?
You can always check if you can use sleep with canSuspend command
But yes you will be able to sleep in that call
Awesome, thank you very much. Its basically so i can make a kinda callback from mission to server
does anyone have a script for resetting the ai when it gets stuck? I know dynamic recon ops has one, it resets the ai and teleports them 10 metres away
how would i display how many vehicles that got counted within 'nearestObjects'
because i think im doing it wrong
_count = nearestObjects [player, ["Car"], 10];
if (_count >= 1) then {
hint ["Vehicle found!"];
} else {
hint ["No vehicles found"];
};
};
am i ment to use count nearestObjects there?
Okay, I fixed it. Nevermind..
private["_count"];
_count = count nearestObjects [player, ["Car"], 10];
if (_count >= 1) then {
hint format["Vehicle found! %1",_count];
} else {
hint format["No vehicles found! %1",_count];
};
};
call LJ_Garage;```
Ok what stupid mistake am I making? I have the following in my baseGuard init
this setCombatMode "BLUE";
this addeventhandler ["FiredNear", {(_this select 0) execVM "scripts\baseGuards.sqf"}];```
and the the script is simply
```sqf
private["_unit", "_enemy"];
_unit = _this select 0;
_enemy = _this select 1;
if (_unit = _enemy) exitwith {};
_unit setCombatMode "RED";
_unit suppressFor 5;
sleep 2;
_unit setCombatMode "BLUE";```
But my guard never fires
I'm basically trying to make it so my base guards only ever return fire, never instigate combat
@leaden summit you could basically just set the unit on CombatMode "GREEN"
https://community.bistudio.com/wiki/Combat_Modes
https://community.bistudio.com/wiki/Suppressive_Fire
"soldiers provide suppressive fire only when ordered or when current unit position is suitable (unit in cover)"
https://community.bistudio.com/wiki/suppressFor
Force suppressive fire from the unit.
That should work shouldn't it?
no, 'cause suppressive fire only works if the unit is at the moment in cover. A guard (maybe sitting outside) is probably not in cover
The wiki link you posted says they should fire when ordered
read the sentence i wrote
Can you try this one pls
params ["_unit", "_enemy"];
_unit fireAtTarget [_enemy, currentWeapon _unit];
Yeah it says when ordered OR when current unit poosition is suitable
Even if I comment out that suppression line and just setCombatMode "RED" the guard just tracks the enemy but never fires
did you try my code?
Yeah, no different. I'm just going to test with the guard out in the open rather than this bunker
i tried this and it worked for me
I think I know what I hadn't even stopped to think about
The guard is in a turret so technically in a vehicle
the eventhandler wasn't even triggering
...
then do the thing that i wrote before
params ["_unit", "_enemy"];
private _vehicle = vehicle _unit;
_vehicle fireAtTarget [_enemy, currentWeapon _vehicle];
Thanks, I think I've got it sorted now, stupid mistakes 🤦
It worked for me
Yeah thanks, like I say, just the dumb mistake of not remembering turrets = vehicles
just a question. Why do you go for a execVM. You can set the script as a function or even write the script in the eventhandler.
Honestly just bad habit, I will probably just add it to the EH
this addEventHandler ["FiredNear", {
params ["_unit", "", "", "", "", "", "", "_gunner"];
if (_unit isEqualTo _gunner) exitwith {};
private _vehicle = vehicle _unit;
_vehicle fireAtTarget [_gunner, currentWeapon _vehicle];
}];
Using the gunner would be more useful^^
Yeah I do want them to go back to combatmode blue after as well so they don't engage on their own. Thanks you've put me on the right path now 😃
if (_unit = _enemy)... dude, assignment = is not comparison ==
How can I fire a "submit" event on a RscEdit text box?
Will a onKeyUp eventhandler fire on Enter key? Is there a easier way?
Why key up and not key down?
because I want the action to happen when the human completed his undertaking
nope just want to apply when pressing enter. no care bout human
Not familiar with TFAR but still wondering why key up is a human thing to do and key down isn’t
both are things humans do
but when they press down. they are starting a action. When the key goes back up, they finished that action
I want things to happen when they completed an action (pressing a button) not when they are about to do it
Well there is a reason why click activates on mouse up but console enter normally activates on key down, not sure where you go with that, can you activate it on key up instead? Honestly never tried
I wanna be special okey?!
I wanted to try out if keyUp works.. But turns out Arma is too dumb to load the config. And I apparently broke armake.. soo.. I'm fixing that now first. See ya in an hour
I mixed up two variables. I hate dis. I want cookies. Someone gimme cookies.
Why am I still getting results like 37.2 when using toFixed 2?
Shouldn't it make it 37.20
Do you have example?
_number toFixed 2
or
toFixed 2
str _number
?
Oh dear
parse number parses a number and returns a number
it will be a number
numbers don't have useless 0's.. cuz.. that's how numbers work
don't know how to really explain that
You want string representation to have 0 yet you convert it back to number? Numbers don’t care about trailing 0s in fractional part it makes no difference to the math
Yeah I just had an if condition that required _number but then I have a hint which displays the number
I just moved the parseNumber to the if condition itself, and kept it as a string for the hint
if you want to display the number with a specific number of conditionals.. use toFixed
that's what it's for
decimals* not conditionals
So really the question was why do I get 37.2 when I use parseNumber on "37.20"
Yeah it makes sense that it drops the 0, I just had to move the toFixed to the hint itself
A well formed question contains 99% of the answer
And here I am packing addons in debug mode and it takes ages. I just want to test that onKeyUp stuff
Why do you need to pack addon if you can just do it in debug console in 30 seconds?
So what’s the verdict?
still waiting on it
When you benchmark the speed of a script, is the result the total time for all 10,000 iterations combined, or time per each
each
What's the best way to have a script only run every half second performance wise?
sleep
Just a while(true) with a sleep?
ye
just use scheduled with sleep
there are many other methods. Some might be better.. But you really should not jump into advanced stuff when you don't know what you are really doing
Depends on what you need to calculate, what's the nature of it. You might put it into an on each frame handler (not directly, but through one of CBA functions). Or you can do as Dedmen said but then your calculation can be torn apart by scheduler. Only you can tell how much it is important for you 🤷
i could use some help with my addaction condition. I have this in the condition attribute but its not working.
lifeState _target == ""INCAPACITATED""
Depends on how you define performance. Does higher performance mean less latency, or more throughput, or less impact on the game itself by your heavy load?
@chrome fiber "lifeState _target == 'INCAPACITATED'"??
You might put it into an on each frame handler That's the stuff I meant when I said "But you really should not jump into advanced stuff when you don't know what you are really doing"
For 0.5 sec execution I would use a trigger
Basically this is my script
[Beacon01,44.6] spawn {
params ["_Target", "_TargetFrequency"];
while {(currentWeapon player) == "ACE_VMM3"} do {
If ((alive player) && (call TFAR_fnc_haveLRRadio)) then
{
private _headingDifference = 180 - abs(180 - (player getRelDir _Target));
private _distance = player distance _target;
private _activeLRRadio = (call TFAR_fnc_activeLrRadio);
private _sourceChannel = _activeLRRadio call TFAR_fnc_getLrChannel;
private _sourceAltChannel = _activeLRRadio call TFAR_fnc_getAdditionalLrChannel;
private _sourceSettings = _activeLRRadio call TFAR_fnc_getLrSettings;
private _sourceChannelSettings = (_sourceSettings select 2);
private _sourceFreq = parseNumber (_sourceChannelSettings select _sourceChannel);
private _sourceAltFreq = if (_sourceAltChannel == -1) then {_sourceFreq} else {parseNumber (_sourceChannelSettings select _sourceAltChannel)};
private _SourceAltFreq = If (_SourceAltChannel == -1) then {_SourceFreq} else {parseNumber ((_SourceSettings select 2) select _SourceAltChannel);};
If (_targetFrequency in [_sourceFreq, _sourceAltFreq]) then
{
_HeadingCoef = (0.75^(_HeadingDifference));
_DistanceCoef = ((((log 20) * _Distance) + ((log 20) * 31.8)) / 200);
_CombinedCoef = _DistanceCoef / _HeadingCoef;
_Jitter = 1 - ((Random 200) - 100) / 16000;
_SignalLevel = (37 - _CombinedCoef) * _Jitter;
_SignalLevelPercent = ((_SignalLevel + 96.6) / 133.6) * 100;
If ((_SignalLevelPercent >= 1)) then
{
hint format["Signal Strength: %1%2",(_SignalLevelPercent toFixed 2),"%"]
}
else {hint "Signal Strength: 0.00%"};
}
else {};
};
Sleep 0.5;
};
};
*Edited to include your suggestions
I think the while do should suffice
I remember seeing that exact script before
and I also remember making a alot more optimized version of that and posting it here
that's not it
I think the one I posted before was just a small chunk of it, I've been tweaking it a bit interface wise
I think it was you who said something about the _HeadingDifference = 180 - abs(180 - abs(_SourceDir - _SourceDirTo)); though
https://discordapp.com/channels/105462288051380224/105462984087728128/523845596671508484 here is the old conversation
Hacked source code, EULA violations , Goodbye @chrome fiber
My direction thing actually gets the difference in direction, getRelDir gets the direction relative to the model. So if the target is 10 degrees anti-clockwise, my thing will return 10, getrelDir will return 350
You can just negate the result of reldir and be done with it. 350 will become -350 which is the same as 10
so just (player getRelDir _Target) * -1?
I don't think that'd work though
Because I raise a number to the power of the _headingdifference
If I was using it to later set a direction then I believe -350 would work fine
No just -(player getRelDir _target)
And I don’t understand raising number to the power bit, what you do _number ^ reldir?
For what purpose?
Fixed it! I can finally try out the onKeyUp
@radiant needle Didn't really check your maths but I guess this might be useful for you:
https://www.everythingrf.com/rf-calculators/friis-transmission-calculator
Also you might consider calculating everything in decibels
Just 3 hours or so.. Because a config entry that starts with a number cannot be a string right?
x = 0.5 * safezoneW; that's a number right? Totally not a string :U
@astral dawn I originally had it in dBm but apparently players found it too confusing
Although maybe if I tell them that 37dBm = Full strength and -96 dBm = barely any signal it'd help.
@still forum what happened?
So that thing is a unquoted string. in config. As you can see.
Armake has a check to prevent numbers being detected as unquoted string.
Such that x = 0.5; don't get stringified and throw a warning.
So the check sees 0.5 * safezoneW and says! Yeah! that's totally a number! it has some crap characters at the end, but I don't care. I can see the number, that's all I care about.
And armake like "yeah, dis a number. Okey, let's continue parsing this"
* safezoneW wat? WTF is dis? There should be a semicolon here..
Well Arma crashed when trying to grab the radio. Sooo.. That's a thing
is it possible to use the BIS Revive system somehow with AI?
There's an option in a unit's attributes to enable this, yes.
The AI themselves will not revive anyone, however. They will just be revivable.
@radiant needle I'd convert your power to signal-to-noise ratio (in decibels) and display that... 🤔
What are you doing actually? Some jammer?
With that FRIIS formula, how does that work if the receiving antenna gain is 0?
How can gain be 0? Or do you mean zero decibels?
0 dbi
In that calculator you linked I put in 23w, 2, 0, 6.8, 1 and got the result of 40 dBm
but in my script where I tried to implement that, I'm just getting 0
this is my formula
_SignalLevel = (23 * 2 * 0 * (6.8^2)) / ((4 * 3.14159 * 1)^2);
Antenna gain has no dimension, IIRC it's a ratio of how much it's better than a omnidirectional antenna. So 0 dB means it's an omnidirectional antenna(no gain).
Yes, but why am I getting different result between my calculation, and the webiste
If you are doing your calculations in decibels entirely, you just sum them up
Let me have a look...
The formula they show, I assumed it was multiplication
Yes but you can convert everything to decibels and replace multiplications with sums
What units is their calculator using though
so... they use decibels for antenna gain
but you can't directly put db into the formula, you have to convert it into non-decibels first
and in the end you will get... not decibels as well, but just power (Watts)
Okay well here's the question then. Pt = 44dBm, Gt = 3 dBi, Gr = 8 dBi, λ = 6.8m, R = 1m
According to their calculator that should equal 49.67 dBm
Yes that's what it gives. You can't replicate it?
No
Wait a moment... let me unpack my matlab
>> Pt_dbm=44;
// Convert transmitted power from decibell-milliwatts to Watts
>> Pt_W=10^(Pt_dbm/10)/1000
Pt_W =
25.1189
>> Gt_dB=3;
>> Gr_dB=8;
// Convert antenna gains from dB to plain ratios
>> Gt=10^(Gt_dB/10); // Returned 1.99
>> Gr=10^(Gr_dB/10); // Returned 6.3
>> Lambda_m=6.8;
>> R_m=1;
// Calculate received power in Watts
>> Pr=Pt_W*Gt*Gr*(Lambda_m^2)/((4*pi*R_m)^2)
Pr =
92.5973
// Convert watts to dBm:
>> Pr_dbm = 10*log10(Pr)+30
Pr_dbm =
49.6660
So what's that as a formula
... gives the power received by an antenna from another antenna that is transmitting a known amount of power at a distance under ideal conditions.
That's what it gives. And what do you need to simulate?
k, so
SignalLevel = 10 * (log (25*10^(3/10)*10^(8/10)*(6.8^2)/((4*3.14159*1)^2))) + 30;
seems to work
I'm basically trying to kind of simulate direction finding of a radio beacon
That's pretty cool. I guess you could omit the signal loss due to distance then? Or is it also important?
Having your radio 'beep' when you point it at the beacon would be enough I mean?
I think it's important, gives players a rough estimate of how far away a target is
Basically in this mission the foxhunters are dedicated roles, so figure add some "skill" of interpreting raw dBm values
Oh yeah then it is important 👍
Well this seems to be working
[44.6] spawn {
params ["_targetFrequency"];
while {true} do {
If ((currentWeapon player) == "ACE_VMM3") then {
If ((alive player) && (call TFAR_fnc_haveLRRadio)) then
{
private _Target = Beacon01;
private _headingDifference = 180 - abs(180 - (player getRelDir _Target));
private _distance = player distance _target;
private _activeLRRadio = (call TFAR_fnc_activeLrRadio);
private _sourceChannel = _activeLRRadio call TFAR_fnc_getLrChannel;
private _sourceAltChannel = _activeLRRadio call TFAR_fnc_getAdditionalLrChannel;
private _sourceSettings = _activeLRRadio call TFAR_fnc_getLrSettings;
private _sourceChannelSettings = (_sourceSettings select 2);
private _sourceFreq = parseNumber (_sourceChannelSettings select _sourceChannel);
private _sourceAltFreq = if (_sourceAltChannel == -1) then {_sourceFreq} else {parseNumber (_sourceChannelSettings select _sourceAltChannel)};
If (_targetFrequency in [_sourceFreq, _sourceAltFreq]) then
{
_HeadingDifference = 180 - abs(180 - abs(player getRelDir _Target));
_Gain = 7 - _HeadingDifference;
_Jitter = 1 - ((Random 200) - 100) / 24000;
_SignalLevel = (10 * (log (25*10^(0/10)*10^(_Gain/10)*(6.8^2)/((4*3.14159*_Distance)^2))) + 30) * _Jitter;
If ((_SignalLevel >= -44)) then
{
hint format["Signal Strength: %1 dBm",(_SignalLevel toFixed 2)];
}
else {hint "Signal Strength: No Signal"};
}
else {};
};
};
Sleep 0.5;
};
};
Added some of Dedmens tweaks
you got _SourceAltFreq duplicated
Fixed
Hi This is my first post noon dischord, so please be patient. i have the following code which runs fine, '''....................{
_vehicles = ["Vehicle1","Vehicle2","Vehicle3","Vehicle4"];
{vehicle1 setpos [_a+((_foreachindex+1)*5+5),_b+((_foreachindex+1)*5+5),_c];}foreach _vehicles;
}....................'''
that runs fine?
it only moves a single vehicle.. 4 times
Doesn't seem logical to me.
but this one does not
....................{
_vehicles = ["Vehicle1","Vehicle2","Vehicle3","Vehicle4"];
{_x setpos [_a+((_foreachindex+1)*5+5),_b+((_foreachindex+1)*5+5),_c];}foreach _vehicles;
}....................
I noticed that when i diag_log(_x) i get the elements with "" around them. Is this the issue?
yep, just used the first one to debug.
Yeah
you can't setpos a string
you probably want the object
aka take away the quotes
also you can use
```sqf
```
for proper syntax highlight replacing the dots thing you did there
cheers for the quick response. This is great. (can't even do a CR here yet!).... So should i parse the qoutes out to get the object, or is there an easier way?
Are Vehicle1, Vehicle2, etc the names you have assigned in the editor?
or is there an easier way just.. not write down the quotes?
they are the variable names I assigned to the objects in the mission editor..
Then you should do as Dedmen said
is there some reliable way to check if an unit is on bridge?
or just some combination of surfaceIsWater, getPos-getPosATL-getPosASL relations or check for nearby model
yeah the wood for the trees...... .
too used to coding with other languages. and strings.
You could do missionNamespace getVariable "Vehicle1" as well but there is no use for it because Vehicle1, Vehicle2, ... are already assigned when you create the array.
cheers all, just going to try remove the qoutes from the array.
done and working. thanks
....................{
_vehicles = [vehicle1,vehicle2,vehicle3,vehicle4];
{_x setpos [_a+((_foreachindex+1)*5+5),_b+((_foreachindex+1)*5+5),_c];}foreach _vehicles;
}....................
```
@velvet merlin Is this question actual for you? (Maybe you try use lineIntersectsSurfaces)
I have a server side function running every 5 mins to relocate an objective, this function changes a publicvariable that is then used by the client. Can I use addPublicVariableEventHandler client side to detect when the variable value changes and execute some code on the client side? not sure if i understand addPublicVariableEventHandler correctly
@lost copper would still need some model whitelist, right?
Yep. Bad variant for you, @velvet merlin ?
Could try something like this:
Get the road segment's position, _roadPos
Make a line going straight down from _roadPos
Check which objects it intersects with something like https://community.bistudio.com/wiki/lineIntersectsObjs
If there is anything besides the original road segment, it must be a bridge
Could do some more filtering by checking the types of found objects to exclude snakes, rabbits, long range radios lying on the road, humans, etc
@lost iris thats correct
@lost copper something to avoid for compatibility reasons and such
How would I find what vehicle the player is choosing from the list to spawn it?
LJ_fnc_Adminvics = {
private["_control","_display","_selected"];
disableSerialization;
createDialog "Dialog_AdminVeh";
_display = findDisplay 69;
_control = lbAdd [1500,"C_Offroad_01_repair_F"];
_selected = lbCurSel _control;
(_display displayCtrl 1600) buttonSetAction "_veh = _selected createVehicle position player;[_veh, true, true, true] call bis_fnc_initVehicle;";
};
[] call LJ_fnc_Adminvics```
use format with lbText
I re-wrote it as it didn't make much sense, but its winging about how the _class is undefined
_class = configName _entry;
(_display displayCtrl 1600) buttonSetAction "_class createVehicle _pos";
ButtonSetAction creates a new scope which does not inherit anything from current scope, so yeah it will be undefined
_vehicle = lbText format[_class];
I'm doing this wrong
i dont quite understand how it works
_pos will be undefined too
So I have to define everything i want to use after button set action?
You can embed those values in the string you pass to buttonSetAction
...buttonSetAction format ["%1 createVehicle %2", str _class, _pos]...
Also the code it expects is SQS
Oh wow, that works perfectly. Thank you! It's somewhat working now, it only spawns one class though
is there another way for buttonsetaction?
I saw that on the wiki
So why not use onclick event handler instead
can you direct me in the way of the wiki for that? never seen it
Nevermind I found it
Case:
a trigger is "monitoring" sector owner changes and when the owner of the sector changes a marker gets 'placed' on the map only for the players on the side that captured the sector.
Currently I'm creating the needed markers for every player via initPlayerLocal.sqf and setting every marker's alpha to 0 to make them invisible at the mission start.
The trigger that does the sector monitoring turns eligible marker(s) visible only to the side that captured the sector via the trigger's On Activation field.
This works well enough but (who guessed it) not for JIP players.
Any suggestions how to make markers show up for JIP players with what I have now? Or some other way to achieve JIP compatible markers with this trigger that monitors sector owner changes?
@still forum Just checked, x = 0.5 * safezoneW; is definitely treated as a string by Arma parser
if the property has special meaning to the engine like if the x is part of control position, the expression will be converted to float otherwise it will be left as a string
Is there a way to get the current terraim map Cfg texture?
what do you mean?
Get the CFG of the map on current terrain im playing,.
Still not sure, you want ```sqf
configFile >> "CfgWorlds" >> worldName
the MAP like the one we press M to see
it is drawn as you open it, there is no texture. You can export it into the image though separately
Type Shift + minus then TOPOGRAPHY to have a tiff created in the game's directory iirc
@astral tendon ?
Well, not atually what I need, nevermind.
Well it's a control, not a texture
@tough abyss Could you help me out with this? I don't understand AddEventHandlers at all..
_vehClass = this addEventHandler ["ButtonClick",["%1 createVehicle %2", str _class,_pos]];
@mortal nacelle second part should be code ({ }), not array ([ ])
Like this? _vehClass = this addEventHandler ["ButtonClick",{"%1 createVehicle %2", str _class,_pos}];
Yes, but the inside code wouldn't work.
Yeah I figured that 😦
Try { call compile format [(…)] }
No wait
(on mobile, so hard to type and to think properly)
@mortal nacelle you forgot format
_vehClass = this ctrlAddEventHandler ["ButtonClick", format ["%1 createVehicle %2", str _class,_pos]];
but this wont work
it has to be assigned to control
unless this is control it will error
I am guessing you are putting it in init field
no its a function im just running in debug
its opening up a list box with all the vehicle class names
and im trying to spawn it by selecting one and then pressing the button
@forest ore
One way would be to only make the markers invisible that belong to deactivated triggers in the initPlayerLocal.sqf. Considering it's scheduled, you should probably put the code inside isNil {} to make it unscheduled to prevent a race condition between your check for a trigger's state and a change of a trigger's state.
what coding language does arma use for scripting? (sorry for scrub question)
sqf
is that related to c/c++?
It related to everything. It's a big mixture
ah okay, thank you R3vo 😃
It does not have c/c++ static typed nature, so it's gonna be different.
I believe it uses syntax from java and c+ and also other languages. Probably depends on what the programmer preferred
there are resources in Bi Wiki that explain how SQF works
@worthy lintel https://community.bistudio.com/wiki/SQF_syntax
Doesn anyone know a better tool than Tabler for working with stringtable.xml files?
RHS also provides a tool, but dunno how it compares.
It's nice, but it doesn't support chinese language
Hey, how can I find out how big one of those grid squares on the map is?
I once saw that Insurgents has like red grid markers for every grid an insurgent is in
@cosmic lichen I tried to make many, but I have yet to find a good UI actually 😕
You failed at the Ui?
@delicate lotus
Not sure what you want to get. The grids are clearly defined like 100m, 1km, ...
Anyone have a reset ai script?
@languid tundra oh... well thats good
@cosmic lichen I don't really know yet how to have a proper UI, should I have language side by side to remember what the original text is, or just a plain text box with two listboxes for entry / language, etc
I planned to go back to it but forgot and let it sleep in a corner of my drive
Do you have a working prototype?
It would be fine if it looks like an excel sheet.
But it should be sortable, and searchable. Grouping keys into containers would be nice too.
I can still restart from scratch hahaha
Excel sheet, I wouldn't go this way as it would make many languages side by side
I recently had a look at Intercept. Its implementation is an incredible piece of art and shows yet again how powerful extensions can be.
However, I'm now wondering where does BI EULA draw the line when it comes to playing around with engine stuff with extensions?
@languid tundra https://community.bistudio.com/wiki/Extensions
If nothing is written there, there is probably no line to draw. Except for malicious stuff of course.
Yeah, malicious stuff and possible instability are about the only things that are warned about there.
Still the page discusses about the original intended way to use extensions only. Taking an approach like Intercept is a totally different entry point.
Maybe you should talk to @still forum he contributed to Intercept. He can probably tell you alot more about extensions and what you can and cannot do.
True
@languid tundra
Thanks for the suggestion. A bit before your reply I was able to get the markers to show up and turn invisible when needed, also for JIP players. No idea how my "implementation" will work with more players than three but I guess that remains to be seen
fuck sake @cosmic lichen @winter rose
that Tabler tool looks and feels horrible Oo
just downloaded it quickly to give it a try
you have to create a bloody stringtable.xml first to make it work annoyed me already
what? which one x)
At least someone put an effort to write such a tool^^
Tabler
It's probabably fine for a stringtable.xml with 3 entries, but for 4000 it's slow as fuck
pff @languid tundra
created like a shitton of tools already
gimme UI , I have the whole backoffice ready
ok, actually ^^
Please do it. I want a proper stringtable tool
And please make it remember and reopen the last edited one 😂
should be done in roughly 2 hours
if somebody provides me with the languages, i even can add a full selection of languages to it
@tough abyss https://discordapp.com/channels/105462288051380224/105462984087728128/530047667699449856 yeah I know 😄 That's why armake is broken.
@winter rose https://discordapp.com/channels/105462288051380224/105462984087728128/530074836261928984 How can you dare! 🔨
@languid tundra Well BI didn't say anything bad about it yet.
you havent done anything naughty with it yet 😜
How does it look on BE side? I somehow doubt you could ever get them to whitelist DLLs for a client side add-on that is using intercept.
@still forum I dare, watching you in the eyes 👀
Didn't ask them yet
but the BE auto whitelisting should just let it through automatically if enough people try launching Arma with it
Didn't know there is such a thing.
They once auto whitelisted my debugger.. That was fun
Did I just read: stringtable.xml generator?
#arma3_tools @delicate lotus
already kinda finished it
lacks a lil bit of polish
and features though
but only 2 hours of work
@delicate lotus https://github.com/X39/StringtableEditor
also, #arma3_tools or https://discord.gg/cgAQqhy 😉
hey all im having an issue with a drag animation .
_player playActionNow "grabdrag";
works fine. but when i want to stop the animation this doenst work and the player stays stuck in drag animation.
_player playActionNow "stopdrag";
Is there an action called stopdrag?
Not on here https://community.bistudio.com/wiki/playAction/actions but maybe list is incomplete
try _player playMove "amovpknlmstpsraswrfldnon"
Btw. this reminds me that you should use forceWalk true when you use "grabdrag" for players. Otherwise they can't walk in certain cases.
thx @languid tundra
@tough abyss there are no bipod animations listed so yea it's incomplete
Those are actions not animations though. What is missing?
I know very little of what arma has so just disregard me i guess
Btw that keyUp stuff turned out working exactly like I imagined.
Just took me like 4 hours of work yesterday and 8 hours today to get armake fixed so I could pack it and test it ¯_(ツ)_/¯
Would anyone know of a relatively simple way that I could have units dropped in by Zeus be re-geared with a gear function once they are dropped in?
Get the loadout export and modify it to work on curatorSelected # 0 # 0 @shadow sapphire
Can you return a module from inside a UI eventhandler from within its attributes >> controls?
I am trying to query a config value of another attribute inside the UI handler onLBSelChanged
can you query config values from a ctrlParentControlsGroup ctrlParentControlsGroup (_returnedCtrlCombo) group or do you need to use configfile >> 'cfgVehicles' >> _moduleName >> 'Attributes'?
Is there something I'm missing here? The conditional statement doesn't seem to be running properly. I wasn't sure if you could use format in that way or not.
[_terminal,
[
"Enter Code",
{
["toggleDevice", [(_this select 3)]] execVM "activateNuke.sqf";
hint "You don't know the code to activate this device";
[(_this select 0),0] call BIS_fnc_dataTerminalAnimate;
sleep 8;
hint "";
},
_device,
1.5,
false,
false,
"",
format["%1 && TFR_receivedCodes", _self]
]
] remoteExec ["addAction", 0, true];```
_self is defined previously
Hello, chaps. I wonder if any of you can help me with this? I'm trying to script an AI squad to get inside a helo when the player decides. It's more for my own practice than anything.
The AI squad is called "Splashdown" and the helo is called "chariot_Helo".
Now a normal get in waypoint placed in the editor makes the squad get into the helicopter, but I really want to try scripting this.
My current script is being run from a trigger, activated from Radio Alpha.
Inside the script is the following:
_waypoint0 = splashdown addWaypoint [getPos chariot_helo, 0];
_waypoint0 setWaypointType "GETIN NEAREST";
@digital hollow, thanks! Will try.
Now playing from the AI squad leader's position shows a GET IN NEAREST waypoint created for a split second and then nothing. Playing it from the helicopter pilot's position shows that the squad runs to a point some 10 meters away from the helicopter without getting in.
Any thoughts, gents?
moveTo + waitUntil + moveInCargo
I'll give that a try now then. Cheers.
🤔
"Generic error is expression." It's flagging it before "group splashdown;};"
There's got to be something obvious that I'm missing.
splashdown is group leader
group returns group reference
units returns an array of units belonging to that group
So if I was to change it to "forEach group splashdown"...?
Nope...
Is there any reason that the "setWaypointType "GETIN"" method didn't work?
Or at least, any reason we can fathom?
Perhaps I should give some more background to the scenario I've created for myself:
I'm trying to do this via waypoints so I can apply them as required in the future.
The idea is that the player gets into the helo and then radios for a squad to get in as well. This allows me to have a foundation to script extactions with.
Once the player gets to a suitable location over water, they can release a sling loaded boat, Splashdown will then jump out of the helo, swim to the boat, and proceed on their own little mission.
So in an ideal situation, my solution would involve learning more about scripting waypoints.
Wouldn’t the waypoint with index 0 be default waypoint for a group? Don’t think overwriting it does any good
So you're suggesting I change it to _waypoint1 and refernce it as "[splashdown,WP1] setWaypointType "GETIN""?
Understood. I never realised that. I'll give that a shot now.
If editor placed wp works for you why not to look up its properties with script?
How would I go about that? I've not done that before.
Ok, so I've found "_wPosArray = waypoints splashdown" but how would I actually get that information?
Hint str waypoints splashdown;
I've only ever put information INTO the game via scripting, never got anything OUT of it.
roger. Give me 2 moments.
You never used debug console?
Honestly, no. That's why I'm trying to do a bit of scripting now to get my eye in.
Even just executing waypoints splashdown should show resulting array where you can see all waypoints for the group
So the return I get is "[[B splashdown,0],[B splashdown,1]]"
I apologise that I'm very novice at this. It's really very kind of you to give me a hand with all this.
Yeah so the waypoint you are after has index 1
Got it. So that's the one to edit.
Give me some time to try and figure some things out and see if I can fix this myself with what little knowledge I have and I'll let you know what I try and how it goes.
So try waypointType (waypoints splashdown select 1) https://community.bistudio.com/wiki/waypointType
Then make scripted waypoint of the same type and index
Ok, frustratingly, index 1 is indeed a GETIN waypoint. I just can't fathom why the squad doesn't...
So creating another waypoint in the chain improves things, but doesn't fix them.
splashdown addWaypoint [getPos chariot_helo,1];
[splashdown,1] setWaypointType "MOVE";
splashdown addWaypoint [getPos chariot_helo,2];
[splashdown,2] setWaypointType "GETIN";
This gets the squad to run 10 meters away, and then back towards the helo. Still, however, they don't get in...
is the helo assigned as their vehicle?
Assigned as their vehicle? I'm not sure what you mean. The player and his squad of pilots are in the helo - variable "chariot_Helo", group variable "chariot". The AI squad is variable "splashdown" and they're separate to the helo.
How would I use that in conjunction with scripted waypoints? Would you mind spelling it out for me? I'm still rather rusty with this stuff.
im not even sure if its needed. But since the vehicle is "owned" by other group already it might be
not exactly sure how you would use it with waypoints though
Ok, well I'll give it a try. Nothing ventured, and all that. The odd thing in that if I manually place a waypoint in the EDEN editor for splashdown to get in then they do.
It's just if I try scripting it that it all goes to pot...
Try this:
splashdown addWaypoint [getPos chariot_helo,1];
[splashdown,1] setWaypointType "MOVE";
_wp = splashdown addWaypoint [getPos chariot_helo,2];
[splashdown,2] setWaypointType "GETIN";
_wp waypointAttachVehicle chariot_helo;
though you dont need extra move waypoint in between unless you want to have some sort of deviation in the approach
They got in! Fantastic! Cheers mate! My guess is that the script I was using was only creating a waypoint at the vehicle's position, rather than it being attached to the vehicle like in the editor. That little line of code has been bugging me for far too long.
In the unlikely event that we meet,I owe you a beer.
I'm trying to make a trigger which requires the presence of all players in a scenario before it activates, can anyone help me out with that?
I've only just started learning to use the editor at all and have never done any scripting
You are looking for sychronised & groups of synchronised objects I think. Not 100% sure. But will have to sync the units to the trigger that you want it to activate
hmmm
so if I set the trigger to activate on player presence
and then sync it to each player?
that will make it activate only when they're all there?
What do you mean by all players present, present in area?
yes
like the area designated by the trigger
This probably isn't super necessary for what I'm trying to do. I'm really just trying to put together a good work-around for the issues with AI helicopters unloading human, or partly-human groups.
As long as the team leader gets off when it lands, any AI team members should dismount automatically.
But if somebody decides they want to play as one of the team members with an AI team instead of as the team leader (which would be stupid, but I'm positive somebody will try), then they'll get off and then the helicopter will take off with the rest of their team still on it.
So by all players you mean all human players or all units including AIs?
Or if just one human player isn't paying attention they'll still be on the helicopter and it will just take off with them, and then they'll have no way to get off.
I mean all playable characters, whether they're controlled by humans at the time or not.
So four specific characters, in this case.
What I was going to do is set the helicopter to land with a waypoint, then tell the players via a task to regroup nearby, and doing that would complete the land waypoint, sending the helicopter on its way. This way the helicopter would be prevented from leaving with anyone still aboard.
You can just check that no playable unit is inside the helicopter
how do I do that?
I mean that's basically what I'm trying to do, it sounds like you just have a more direct way of doing it
which I would appreciate
if (playableUnits findIf {_x in _heli} < 0) then {...can takeoff...}
shouldn't that be = 0? or < 1? not < 0?
So if no playable unit is inside helicopter the expression will return -1
!(playableUnits findIf {_x in _heli} isEqualto -1) in a waypoint condition should work
You could also do it the other way, searching whether any of the crew units of the vehicle are in playableunits.
okay great
thanks
I'm confused at why it would be -1 and not 0 but I'll trust you that's right
oh okay
so would that go in the land waypoint to make it complete, or the move waypoint after it?
Try which works the best
okay
is commy still around?
https://www.reddit.com/r/armadev/comments/abc6j6/tips_for_learning_sqf_coming_from_c_etc/
3. I've never seen a good tutorial for SQF. The only way to learn is to practice.
why are there no good tutorials?
yeah he is
because no one made good tutorials yet
"why are there no good tutorials?" is like asking "why did noone rebuild the great pyramids out of clay"
because noone did it yet. Is the answer
do you think that's because people are lazy, or because SQF is so bad that nobody wants to stick their neck out and say "this is how to do it"
The professionals either don't care because they already know, or know that they would be bad at explaining/teaching
apparently BI don't even teach SQF internally to their employees
according to someone on glassdoor
SQF isn't really that hard..
its true tho... trial and error is a great way to learn
If you know programming and have a good brain, it's quick to get into
is it? i bet none of you would agree on the correct way to do X
that's why this channel is/was so funny
SQF is not difficult, just some weird proprietary things. And that is true for many languages
yeah.. That's because there are probably multiple correct ways to do things
some are easier to read, some are faster, some are just utterly retarded.
Can you imagine if SQF had whitespace interpretation
🤢
yeah no doubt there's a correct way
i would love to see 5 of you agree on what it is though :D
ask a simple question on stackoverflow and you have the same problem
typically many ways to accomplish something
theres only 1 way to sqf 😉
RECKLESSLY
Yeah, with good old goto 😂
with arma it is even more open ended because you are rarely looking for compatibility with other functions/components... script accomplishes thing in game? success! Doesn't? failure!
i just find it interesting how much disagreement there is over SQF
even BI's built in functions and modules - people say they're shit but they say that about everyone's SQF generally, bar the ACE team
Unless you are talking about people with little experience, most of the disagreement is over ignorance of newly added commands or useful functions
simple example. Get the position of the player
abc = getPos player
Make it readable you idiot
playerPosition = getPos player
Use tags on global variables you idiot
tag_playerPosition = getPos player
Why do you even need a global variable you idiot
true, i guess there's only so much you can do
ACE code is also not perfect. Mostly the 3+ years old stuff.
but then general things like "your game runs badly because you have too many bad scripts" get said
Many scripts are way too intensive. It doesn't help that the engine is old and inefficient with a cpu cycle
badly made scripts can be the difference between 40fps and 12fps
surely it also doesn't help that there's no good tutorials :D
Well why don't you make some then? 😄
i would love to but real life fucked me and i'm rusty with SQF and was never great when i wasn't rusty
again arma scripting is always written with an objective in mind, say making AI do this, or giving an action to do this. So most of the "tutorials" follow this structure
do enough of these small tasks and you start to understand the language as a whole
I started the SQF blog thing so we can have open-source'd collaboratively made tutorials. That way we can get the same crowd-sourced quality as ACE has
but noone really cared soo ¯_(ツ)_/¯
yeah that's sad, i want to get involved, and hopefully will one day, just real life
arma's dev community is simultaneously really good and helpful, but also elitist and kind of impenetrable
imagine being a total SQF noob and someone saying "there are no good tutorials"
it probably took everyone in this channel 2 years to get to grips with it
not really
There are people in here that need things explained dozens of times and still don't understand anything. They are pulling down the average
maybe if you never learned a language before
Also people come here to ask for help because they don't know what to do
true, enjoying games is very different from being good at scripting
So of course there are mostly beginners/noobs here 😄
you'd think BI would've written a guide 10 years ago
they seem to just rely on the community to brute-force it and then apply for a job
Which.. business wise is a good idea
already filters out the idiots
You only get the diligent self learners who have already prooved that they are worth it
yeah it would make sense, like if you want to learn C++ you can buy a bjarne stroustrup book and get going right away
if you want to learn SQF you are on your own lol
everyone can read a book. In a programming job you don't want someone who once read a book and can reproduce the stuff that was explained in said book
you want someone who can quickly come up with his own solutions, and can figure out things on his own
true, but you need reference material
Because in the end.. That's how programming works
a community wiki with contradictions in the comments section isn't a great reference
I totally agree with the references and wiki
Personally my experiance before sqf was about a year of python... ive spent weeks searching through forums to find nothing..
the wiki is a mess for many commands and BI functions
Then asked 1 question here for it to be explained
I like it when noobs ask qurstoons
Because they can learn
the explanation depends on who's online when you ask the question though
Like i did
It's a community wiki. If it's bad, feel free to make it better
Fair enough, luckily we have people like dedmen who is on consistently
Its like a live version of stackoverflow
There is stackoverflow SQF btw. But not many SQF professionals frequent that
yeah it would be practically useless if the community hadn't done what they have so far
Wait, really?
haha what I never heard of sqf stackoverflow
Do u have a link?
it must be a real swell place
SQF professionals basically == BISIM contractors and VBS users though right?
Aaaand bookmarked
and they never seem to be as forthcoming with help or reliable as arma community members
SQF professionals such as ACE/CBA devs
imagine if BI wrote an SQF book mmmm
actually the book would probably be buggy wouldn't it
Can we force a https://community.bistudio.com/wiki/BIS_fnc_guiMessage in 3den? display 46 is null
shouldn't matter. it creates it's own display
all i get is an 3den unable to display message box error, no rpt on it
perfect finddisplay (313) worked.
Anyone know of a way to script changing firemode for players? Making a silly arcade game mode where I want to start players on full auto
Tried glancing around the "actions" wiki page, SwitchWeapon seems like it could work, but it doesn't
No matter what I change the muzzle index value to, it seems to select primary weapon, semi-auto
😉
ooo, that'll work great, thanks @frozen knoll
anyone one for the challenge to find an algorithm how to place clutter around the player and fade in and out while he is moving
or has some ideas how to approach that
@rancid ruin #community_wiki if you see any contradictions or things that shouldn’t be on wiki, no point whining about lack of maintenance of community run resource if you don’t contribute
@velvet merlin how you figure this should work, createSimpleObject? It will make one big mess in MP as everyone will be creating own global grass around them. You will need createVehicleLocal and proper class config, but then everyone will have own local grass around them, dunno how useful that is.
@tough abyss its for a clutter tweaking tool - not for playing
Then I misunderstood what you meant by fading it in out
Assumed you wanted dynamic creation and deletion around player
Ignore me then
@tough abyss can I ignore you as well?
any chance i can speak to a BI dev, urgently regarding a big exploit within the game
@lost iris #arma3_feedback_tracker go to the feedback tracker site and create a security ticket. They are hidden to the public and only readable by devs
@frigid raven as well? I am not ignoring you...Oh I see, yeh go ahead
When was the last patch @tough abyss i tested last night and it worked so
A month ago or so
which link is it?
channel description
added, hope they patch it quick
thanks @still forum
@still forum There is no option to create an arma 3 security ticket?
It's called "Arma 3 private bug report"
ok, thats the one i did. Wasnt sure if only the devs could see it
@tough abyss done ignoring
o7 duders. I've got a question involving Ace3 (maybe?) that someone might be able to answer. Not super new to arma, but pretty new to arma scripting and its a good chance that I just missed something super obvious.
Ask and someone will have an answer.
thanks! So, context. I've got a toxic barrel that I've used ace to make both able to be picked up and cargo, and a vehicle to hold it. So you pick up a toxic barrel and load it onto a truck. easy enough. Now, Im trying to make a trigger that activates when its loaded into the truck. Im coming into a pretty basick issue of trigger not activating when cargo is loaded. I've used an !alive check on the trigger but thats not working and Im trying to figure out if thats due to the barrel not being deleted/functioning differently becuase its an Ace command. I've considerend trying an Event Handler but I though I'd ask people much smarter than I about it first.
EH is probably your best bet https://ace3mod.com/wiki/framework/events-framework.html#24-cargo-ace_cargo
aighty, that'll be the next attempt. I was banging my head against a wall for a while trying to get something that seemed simple to work, lol. Still learning the syntax and interatcions between things has been...something. thanks for giving me a direction to go in.
Good luck!
Alright... what am I missing here?
[_terminal,
[
"Enter Code",
{
["toggleDevice", [(_this select 3)]] execVM "activateNuke.sqf";
hint "You don't know the code to activate this device";
[(_this select 0),0] call BIS_fnc_dataTerminalAnimate;
sleep 8;
hint "";
},
_device,
1.5,
false,
false,
"",
format["%1 && !TFR_receivedCodes", _self]
]
] remoteExec ["addAction", 0, true];```
The exact error I'm getting:
' |#|&& !TFR_receivedCodes'
Error Invalid number in expression```
I get the same thing if I swap out !TFR_receivedCodes with TFR_receivedCodes == false
I assume it's something with the ampersands? I'm at a standstill until I can figure this one out. It's breaking everything
format["%1 && !TFR_receivedCodes", _self] I do not understand why you create a boolean expression as a string here by format? Never saw this before
I would assume you want to have something like _self && !TFR_receivedCodes ?
Or is it because it expects code as STRING for this parameter position?
@frigid raven Yeah, it requires code as String
Under condition: https://community.bistudio.com/wiki/addAction
What is _self and where it is defined?
@tough abyss disregard, I figured it out. It was _self that was the issue. An object reference instead of a string was being passed at one part in the code
{
if (_forEachindex < count _attributeValues - 1) then
{
_export = _export + str _x + "," + endl;
}
else
{
_export = _export + str _x;
};
} forEach _attributeValues;
copyToClipboard _export;///str _attributeValues;```
Guys, is there a more efficient way to remove the comma and linebreak at the end when export an array to the clipboard?
could someone explain me file patching? I alreadyhave set it up so it loads unpacked files, but only when i restart arma. Is there a way to reload the files during run time?