#arma3_scripting
1 messages · Page 596 of 1
yeah, i use it pretty much everywhere
yep, i jsut didnt know that you can unintentionally overwrite from outside the function
it's nicely explained there thanks to recent changes by our awesome wiki contributors.
why you're doing that action btw, can't backpacks of the bodies be accessed already? 
ummm
not in this inventory: image attached below:
https://i.imgur.com/DKjNGvR.jpg
back in the day you used to have the open bag action
and i just like it
now i'll make "take bag" action
You're remaking A2 inventory? 😄
I see, nice.
i'll make it into a mod and release it to the workshop as open source if anyone is interested
there's a lot of quirks
and some things which i cannot repeat in arma 3
for example, i'll have to reconfig all the item-weights
from the weight-value to the slot-value
well, not "all"
but those which need to
like rockets, mg mags etc
OpenBag is maybe better for me
over gear
yep
far better
on the simulation level, i still prefer A2 to A3
i don't know why, but it makes you feel more like a real soldier, a sensation that i don't get in A3
in A3 it gives me the vibe of a simulation while A2 gave me the endangered sensation of a ground troop
you can make arma 3 have the same feeling
it's hard to explain
but as vanillöa, not really
i know the feeling
arma 3 fits better with desert-warfare
arma 2 fits in forests
it's just down to the visuals
A2 had most of the scenarios in desert
yea when i started playing it online it was A2OA
i know what you mean
But it sucked
the deserts in arma 2 felt bleached
arma 3 is way better in that aspect
maybe because the main terrains ARE semi-arid
it's just down to the filters and color corrections,. though
but it contributed to the idea of a simulator more than a game maybe?
i have with my group like 50 mods and it still doesn't feel "right" (?)
so im trying to write and unload crate script and i could use some help. Im trying to set the pos of the crate once unloaded to always be at the back/rear of the vehicle. The script can be used on all vehicles so i dont know how to calculate where the rear of the vehicle is reliably. Can someone point me in the right direction.
Hallo!
Little syntax question ...
s1 say3D ["gunfire", 1000, 1];
If i wanted this to 'sleep 45;' where would I put it?
Cant figure the brackets for the life of me
Ideally just wanna make that sound loop eternally until another trigger calls it to stop
The sound is 45 seconds long
how long is the track?
oh
yourScriptHandle = s1 spawn {
while true {
_this say3D ["gunfire", 1000, 1];
sleep 45;
}
};```
then jsut delete yourScriptHandle to make it stop
wait i forgot the while loop
this wont stop the sound immediately
to stop the sound immediately, delete s1
Gotcha, will give it a go 🙂 Thank you!
if someone sees obvious mistakes, let them be known
Would that be applicable inside a trigger?
Awesome 🙂
remember that say3D is local to the machine it is executed on
so if this is for a multiplayer-mission, you will need to execute the script on each client
triggers fire client-side so it should sort it out itself
if you place it inside a trigger
in the activation field
while true {
_this say3D ["gunfire", 1000, 1];
sleep 45;
}
};```
Will that go inside a trigger? There is no external script being called so missed out the 'yourscripthandle' part ... Is that right? haha, sorry im still learning
no...
the script handle is the handle to the script that youre adding to the scheduler
it's like the address for the script
you need it to delete the script in a sensible way
terminate yourScriptHandle to terminate it
give it some reasonable name aswell
this is just an example name
Its telling me theres a ';' missing?
hgold on
@exotic tinsel getRelPos is what you need.
https://community.bistudio.com/wiki/getRelPos
crate setPosATL (myVehicle getRelPos [5,180]);
The distance needed for each vehicle type will vary; could use something like boundingBoxReal to get a distance on the fly (see example 1).
https://community.bistudio.com/wiki/boundingBoxReal
yourScriptHandle = s1 spawn {
while {true} do {
_this say3D ["gunfire", 1000, 1, false];
sleep 45;
}
};```
try that?
@gloomy aspen
now again
forgot while-loops need a code as input
Same error 😦
missing do
Thanks will test now 🙂
@crude needle thanks mate!
is there a way to add functions that are allowed to the cfgRemoteExec on the fly as in, while the server is running?
in other words, adding commands to the whitelist even if only temporary
probably not because cfgremoteexec is declared in the description, which is a config
i guessed so aswell, but asking never hurts

tbh, would make the whole config useless then

you would also typically define any functions in pre init as well, so why would you need to add them on the fly ?>
well, i m working on some scripts (admintool) and its easier to declare functions and stuff in the debug console while you are on the server, then closing the server, editing a sqf file, packing the whole mission into a pbo, putting the pbo into the mpmission folder, and then starting the server and reconnect after it runs
guess my best practice here would be to define like 10 or so functions in the cfgRemoteExec to be whitelisted, so that i have some spare functions that are usable on the fly
so dont run cfgremoteexec restrictions in the dev environment until your happy with the scripts and the best way to test is to use excvm as this can be edited while the mission is running and rerun with the new code,, using maybe an addaction test.sqf
hm
that ofcourse also sounds like a good idea
but i know my stupid a** brain, and i know for a fact that i will forget to reimpliment it later, plus, i want to see if any restrictions are in place while i code, as i dont want to have to recode everything later due to a restriction that i didnt see
thanks anyways

so create your function, then call your function as you need to and instead of your function having the code have the code in a test.sqf, and [some params]execvm "test.sqf"; from within your function.... then when youve finished testing editing test.sqf remove the excmvm code from your function and copy in the contents of test.sqf. thats how i normally develop something like that. it allows you to set up your structure before hand

if(!(_pdGate getVariable["locked", true]) || !(_pdGate getVariable["bis_disabled_Door_1", 1, true])) exitWith{hint localize "STR_House_Raid_DoorUnlocked";};
Any ideas why this wouldnt be working? linter isnt giving me any errors
no errors
(_pdGate getVariable["bis_disabled_Door_1", 1]) != 1```
oh you can do != in sqf?
if(_pdGate getVariable["locked", true] != true && _pdGate getVariable["bis_disabled_Door_1", true] != 1) exitWith{hint localize "STR_House_Raid_DoorUnlocked";};
``` there
anyone know a simple delete script? cuz i sure as hell dont
delete script?
just for something to be removed
worked like a charm, thanks
@warm venture
if(!(_pdGate getVariable["locked",true]) || _pdGate getVariable["bis_disabled_Door_1", 1] != 1) exitWith{hint localize "STR_House_Raid_DoorUnlocked";};```
_pdGate getVariable "bis_disabled_Door_1"``` returns 1 or 0
yeah
and there is no need to check for BOOL != true
well, if its not locked then I dont want them to be able to interact with it
dont need people lockpicking already open doors
Why not? realism
Nothing that a 40mm can't open 🤣
are you sure about that
With enough 40mm everything will open, at some point in time
Especially doors of houses and police departmenta 😉
@warm venture
oh you can do != in sqf?
== and != dont take bool. you can compare bools with isEqualTo but it is completely pointless (in any language really) because checking if a bool var is true/false is the same as just returning the bool var. only time comparing two bools is justifiable is if they are both bool vars that need to be the same or opposite value.
I got it working
theres gotta be a better way than copy pasting the same code over and over right??
could pass variables into a function but
How can I have a vehicle have the effect of being blown up with fire and all that, but not cause damage to anything around it?
if(position player distance _pdGate <= 5 || position player distance _pdHolding1 <= 5 || position player distance _pdHolding2 <=5 || position player distance _backPDGate <= 5) exitWith {
``` cause I gotta do checks for all of these, get the closest one, then run code on that specific object
i finally did it, a function that gets variable values from player 2 and gives them back to player 1
https://prnt.sc/t2cjeo
thanks guys for the awesome help
most optimized another way would be
([_pdGate,_pdHolding1,_pdHolding2,_backPDGate] findIf {player distance _x <= 5}) > -1
is a little less repetition
@spare mauve In 3den and Zeus there are several modules available to render smoke and fire effects which can be placed near a vehicle.
It's also possible to script that with the particle functions (don't know them out of my head, but the wiki has a lot of info about that)
So how would I take the closest one out of the list and assign it to a variable?
so I could just replace that with ```sqf
if(([_pdGate,_pdHolding1,_pdHolding2,_backPDGate] findIf {player distance _x <= 5}) > -1) exitWith {
yea
for selecting the closest object something like this would probably work.
private _objects = [_pdGate,_pdHolding1,_pdHolding2,_backPDGate] apply {[player distance _x,_x]};
_objects sort true;
private _object = _objects#0#1;
though I imagine there is a better way
What does the #0#1 mean
if you only want to select from objects within 5 meters
private _objects = [_pdGate,_pdHolding1,_pdHolding2,_backPDGate] select {player distance _x <= 5} apply {[player distance _x,_x]};
_objects sort true;
private _object = _objects param [0,[0,objNull]] # 1;
in this case # is shorthand for array select index
im modifying a life script for bolt cutters, so if they're within distance of one of these gates, I want it to run this section of code, but if they arent I want it to run the normal code for houses
if that makes sense
mmhm. if you use that second one the if condition could simply be if (!isNull _object) exitWith {.
private _gates = [_pdGate,_pdHolding1,_pdHolding2,_backPDGate] select {player distance _x <= 5} apply {[player distance _x,_x]};
_gates sort true;
_bank = missionNamespace getVariable "offices";
private _gate = _gates param[0,[0,objNull]] # 1;
if(player distance _gate <= 5) exitWith {
something like that
well yes, but no
you dont need to check the distance in the if statement because it is already checked when creating the _gates array
sort the objects by distance, if they are within 5m of the cloest object, run the code on that object?
[_pdGate,_pdHolding1,_pdHolding2,_backPDGate] select {player distance _x <= 5}
returns an array of objects within 5 meters from the array of objects provided
I know that ACE bolt cutters work by having the action tied to all fence/gate objects (through configs), and only shows when someone with a boltcutter is close to them
you could remove select {player distance _x <= 5} and keep the distance check in the if statement if you like. might be faster
private _gates = [_pdGate,_pdHolding1,_pdHolding2,_backPDGate] apply {[player distance _x,_x]};
_gates sort true;
private _gate = _gates param[0,[0,objNull]] # 1;
if(!objNull _gate && player distance _gate <= 5) exitWith {
then could run a switch on the _gate and if its 1, run some code, another run other..
(!isNull _gate && {player distance _gate <= 5})
wouldnt (!(isNull _gate) && (player distance _gate <= 5)) also work
{} is for lazy eval though
so it wont check the second condition unless the first is true
is isNull and isNil the same?
weird..
different from what im used to.
if(!isNull _gate && {player distance _gate <= 5}) exitWith {
if(!(_gate getVariable["locked", true]) && (_gate getVariable["bis_disabled_Door_1", true]) isEqualTo 0) exitWith{hint localize "STR_House_Raid_DoorUnlocked";};
Then I could just use _gate cause it gets the closest of all them
yes
so if I wanted to check if _gate was _pdGate , I could just do isEqualTo?
yes
sick
lets try this
18:38:24 Error in expression <= _gates param[0,[0,objNull]] # 1;
if(!isNull _gate && {player distance _gate <>
18:38:24 Error position: <isNull _gate && {player distance _gate <>
18:38:24 Error isnull: Type Array, expected Object,Group,Script,Config entry,Display (dialog),Control,Network Object,Task,Location
18:38:24 File core\items\fn_boltcutter.sqf [life_fnc_boltcutter]..., line 83
18:38:26 Unknown attribute style
18:38:27 Error in expression <= _gates param[0,[0,objNull]] # 1;
probably needed to be in (). you can just switch it back to _gates#0#1 because you removed the select from the _gates definition
back to private _gate = _gates#0#1;
yes
alright lets try this..
private _object = _objects param [0,[0,objNull]] # 1;
what exactly # selects here @robust hollow ?
i was intending for it to select from the result of _objects param [0,[0,objNull]] but i guess it selected from [0,[0,objNull]]
but result is an object
_objects param [0,[0,objNull]] would have returned an array like [0,objNull] but with proper results.
yea, i didnt think about the order of precedence.
it was guaranteed to have two elements in the returned array so a second param wasnt really necessary. the person it was for settled on a slightly different method in the end so only # was needed 👌
is there a way to dissallow ai to engage you after a certain distance?
like, i want a carrier to only engage you when you are at 800m distance to it
and stop when you are outside of that radius
okay, i found a way that works halfways
by executing setViewDistance 300 on the server, i allow the missile turrets to only engage me on 300 meters
BUUUUT
the minigun turrets dont give a flip about that
forgetTarget maaaybe?
i mean, i m fine with the rockets staying locked on you even if you leave the 300 meter radius
but i dont want the turrets to be able to see me further than 300 meters
so they dont start shooting me at a 5km distance
@slender schooner Could use a repeatable trigger with enableAI and disableAI in the activation and deactivation fields respectively; "WEAPONAIM" works on the turrets. You'd need to disable the "WEAPONAIM" initially on the turret still (e.g. this disableAI "WEAPONAIM" inside its init field).
On Activation:
myTurret enableAI "WEAPONAIM";
On Deactivation
myTurret disableAI "WEAPONAIM";
https://community.bistudio.com/wiki/disableAI
https://community.bistudio.com/wiki/enableAI
i see, that sounds like a reasonable way of doing it
15:59:28 Error in expression <& (_pdGate getVariable["locked", true]) && (_pdGate getVariable["bis_disabled_Do>
15:59:28 Error position: <&& (_pdGate getVariable["bis_disabled_Do>
15:59:28 Error &&: Type Number, expected Bool,code
15:59:28 File core\items\fn_boltcutter.sqf [life_fnc_boltcutter]..., line 85
if(!(_gate isEqualTo _pdGate) && (_pdGate getVariable["locked", true]) && (_pdGate getVariable["bis_disabled_Door_1", true])) exitWith{hint format [localize "STR_ISTR_PD_Exploit"]};
if(west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops_pd"))) exitWith{hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))]};
if(!(_gate getVariable["locked", true]) && (_gate getVariable["bis_disabled_Door_1", true]) isEqualTo 0) exitWith{hint localize "STR_House_Raid_DoorUnlocked";};
see anything wrong there?
I saw that part but i dont see where its at
(_gate getVariable["bis_disabled_Door_1", true]) isEqualTo 0) that should give a 0 or 1 if its locked or not
Error position: <&& (_pdGate getVariable["bis_disabled_Do
also you have one round bracket too much, no?
isEqualTo 0)```
i dont think so
if(!(_gate getVariable["locked", true]) && (_gate getVariable["bis_disabled_Door_1", true]) isEqualTo 0) exitWith{hint localize "STR_House_Raid_DoorUnlocked";};
thats the whole line
&& maybe has higher priority than isEqualTo
^
why use a bool as default value, when you expect that variable to be a number 
^ 😄
isnt that how that variable works
default value should be the same type as the expected variable, don't you think?
also, indentation
_building setVariable [format ["bis_disabled_door_%1", _door], 0, true]; thats what im using everywhere else
so instead of isEqualTo
just ==?
NO
(_gate getVariable["bis_disabled_Door_1", true]) isEqualTo 0
->
((_gate getVariable["bis_disabled_Door_1", 1]) isEqualTo 0)
if (_gate != _pdGate && _pdGate getVariable["locked", true] && (_pdGate getVariable ["bis_disabled_Door_1", 0] == 0)) exitWith
{
hint format [localize "STR_ISTR_PD_Exploit"];
};
if (west countSide playableUnits < (LIFE_SETTINGS(getNumber, "minimum_cops_pd"))) exitWith
{
hint format [localize "STR_Civ_NotEnoughCops", LIFE_SETTINGS(getNumber,"minimum_cops")];
};
if (!(_gate getVariable["locked", true]) && (_gate getVariable ["BIS_disabled_Door_1", 0] == 0)) exitWith
{
hint localize "STR_House_Raid_DoorUnlocked";
};
shhh I missed one
so disabled_door can either be 1/2 or true/false then
cause I have it working as true/false in other places
but since it was set to true on that door and i was checking if it was 1
it should be only one type
it wasnt working
anyway, you have your error! 🥳
this is so confusing
all the scripts im running have _building setVariable [format ["bis_disabled_Door_%1",_door],0,true]; //Unlock the door. everywhere so whats the right way??
at least thats what I found on the forums
get the variable (without default variable), get the value type,???, profit
@warm venture the true in setVariable is to broadcast the value on the network
https://community.bistudio.com/wiki/setVariable
it has nothing to do with the default value of getVariable
https://community.bistudio.com/wiki/getVariable
is there a way to fix it when a player is stuck making injured sounds even after being healed? I can not find anything useful doing a google search.
I have an action on the player called "Stuck" it fixes alot of things like missing uniform, stuck in animation, and about 12 other things. I would really like to add a fix to this Feature for the injured sound bug.
@exotic tinsel do you have any mods or scripts which modify/handle injuries/healing?
Hello, is it possible to have accurate player damage?
I tried player setDamage 0.30;
but I it gives me 67HP instead of 70hp
setDamage will simply add damage to an unit, where as damage will return the current damage.
And Arma doesn't have a "Health Points" system, so I guess that's something modded/scripted
Yeah life system
im checking player damage, and if its above 65 it will not heal
If its under 65 it will heal to 65
well, in vanilla this should give the correct values:
systemChat format ["Health: %1%2", (1 - damage player) * 100, "%"]; // should give 'Health: 100%'
player setDamage 0.3;
systemChat format ["Health: %1%2", (1 - damage player) * 100, "%"]; // should give 'Health: 70%'
thanks
just the problem i have is that 0.3 is 67hp not 70, I think i figured it out not sure
perhaps you'll need ceil around the calculation to get a more stable number (instead of 79.99999999996%)
So I have
if (damage player <= 0.32) exitWith hint "You can't apply a bandage";
and then when the player apply a bandage
player setDamage 0.32;
but then the player can still apply a bandage with 0.32 as damage
which the if (damage player <= 0.32) should stop the player to right
but... if you do player setDamage 0.32; you'll add more damage to the player 🤔
ah wait.. set, not add
although if player setDamage 0.32 than damage player <= 0.32 always returns true
No because the player have to be under 0.32 dmg to use the item
What I want is that the player have to be under 0.32 dmg to be able to use the item which will do player setdamage 0.32 and then the player will not be able to use the item because he will have 0.32 dmg
ill try that thanks
but technically
if the player damage is equal to 0.32 he should get the hint saying he can't
I just set my damage to 0.32;
and the if (damage player < 0.32) with the exit doesnt work
You most like want something like this:
// don't apply bandage when health is above 68%
if (damage player < 0.32) exitWith hint "You can't apply a bandage";
// apply bandage, add 10% health
player setDamage (damage player - 0.1);
meaning; if you would use player setDamage 0.32 you can't apply the bandage
everything higher and you can (till it's over 68% again)
does player setDamage (damage player - 0.1);
heal the player to like 68 hp if he have 67?
it takes the current damage and removes 0.1 (which equals 10%)
btw... you might need to use if ((damage player) < 0.32) exitWith hint "You can't apply a bandage"; so it runs in the proper order
changed it thanks, i'll try everything you sent me thank you 🙂
Can anybody point me to a good tutorial on how to create a function mod? I.e. adding a button through the CBA framework to introduce a button that performs an action
Do forEach loops inherit variables from control structures above it?
If you want, you can Sorry I think misread your post
That's a no by default, if I read your post correctly
To clear up any confusion.. e.g:
_myArray = ["xxdad", "345fdds", "dddnj3"];
_operation = "test";
switch (_operation) do {
case "test": {
_myVar = "hello!";
};
};
{
diag_log _x;
hint _myVar;
} forEach myArray;
_myVar would never make it into the loop, correct?
The forEach, no, and you're correct
Ta.. next question, anyway to be able to pass _myVar to that forEach loop?
Use private
https://community.bistudio.com/wiki/Variables#Local_Variables_Scope
Good example's here
🤦🏽♂️ yeah.. you're right..
{[_x, true] remoteExec ["hideObjectGlobal", 0]} forEach thisList;
Im trying to hide a lot of objects within a trigger zone, but this has no effect. any ideas?
I'm trying to test a customized ACEx fortify build list but in order to activate it i need to issue the #ace-fortify blufor myMissionObjects command in chat but i cant get it to work
@ornate prairie you dont need to remoteexec hideObjectGlobal to everyone. it has a global effect on its own, hence hideObjectGlobal. The only reason you would remoteexec it is if you were using target 2 to send the command to the server. if it is a client script that all clients run, you can just use hideObject.
i understand that its redundant, that was just a result of plugging most commands into remote exec to make sure everything worked in multiplayer
regardless, i still need to know if its possible to hide all objects within a trigger area
yes it is
Hi guys, is there a way i can effect the ability of a C-130 to stay airborne, like decreasing the lift it has? I have tryed the setmass command but it seems to have no effect...
@ornate prairie this is a modified version of what the hideterrainobjects module does. i havent tested but something like this is what you'd be after:
#define MAP_TYPES_BUILDING ["BUILDING","HOUSE","CHURCH","CHAPEL","FUELSTATION","HOSPITAL","RUIN","BUNKER"]
#define MAP_TYPES_VEGETATION ["TREE","SMALL TREE","BUSH"]
#define MAP_TYPES_WALL ["WALL","FENCE"]
#define MAP_TYPES_MISC ["ROCK","ROCKS","FOREST BORDER","FOREST TRIANGLE","FOREST SQUARE","CROSS","FORTRESS","FOUNTAIN","VIEW-TOWER","LIGHTHOUSE","QUAY","HIDE","BUSSTOP","ROAD","FOREST","TRANSMITTER","STACK","TOURISM","WATERTOWER","TRACK","MAIN ROAD","POWER LINES","RAILWAY","POWERSOLAR","POWERWAVE","POWERWIND","SHIPWRECK","TRAIL"]
#define CATEGORY_COMP MAP_TYPES_BUILDING + MAP_TYPES_WALL + MAP_TYPES_VEGETATION + MAP_TYPES_MISC
params ["_trigger"];
triggerArea _trigger params ["_a","_b"];
private _radius = (_a max _b) * 1.42;
private _found = nearestTerrainObjects [_trigger,CATEGORY_COMP,_radius,false,true];
{_x hideObject true;} forEach (_found inAreaArray _trigger);
unless there is already a function for it, im not sure if there is.
Hey guys. Is it possible to make an AI not an AI. I just kinda want him to be an object I can use to call Arsenal from
It might be worth pointing out I did ‘this disableAI move’
So, like “Mr. Arsenal” guy?
Depends what level you need. Easiest way is just sqf this disableAI "ALL"
I thought that. Will try but I assume that will also disable ambient animation?
If you want animations, some kind of disabling is enough... one sec
{
this disableAI _x
} forEach ["MOVE","TARGET","AUTOTARGET"];```Just an example
Ok thanks. I think I will struggle to remove the ace interactions too. Maybe I’ll just stick to a whiteboard 🤣
I don't use and know about ACE things so ¯_(ツ)_/¯
No problem. Thanks for your help as always. 👍
Hey so I've got this empty truck, and I want a trigger to activate when it enters it regardless of who is driving it.
The truck has a variable name of OBJ1, what would i write in the condition of the trigger?
Fires when the truck enters to the trigger area?
Your sentence has a lot of its so hard to understand IMO
yeah oops lol
was looking for this && OBJ1 in thisList all good just got it working. bit rusty atm
Why put this? sqf OBJ1 inArea thisTrigger This is the easiest way IMO
that works for me haha, thanks.
is there a way to fix it when a player is stuck making injured sounds even after being healed? I can not find anything useful doing a google search.
I have an action on the player called "Stuck" it fixes alot of things like missing uniform, stuck in animation, and about 12 other things. I would really like to add a fix to this Feature for the injured sound bug.
Yes we have mods that effect damage and change revive.
please mention me if someone has a solution
In that case it's most likely a problem with those scripts, because I've never seen that issue in vanilla Arma
In ACE yes, although that was due to external scripts as well
yes its common. i wrote our scripts for damage so i can change them if you can point me in the direction of the potential cause.
most likely due to vanilla damage being bad while your script think the unit is healthy
ok... so anything i can do about that?
I don't know your scripts, so I can't judge that...
so, how about a way to fix it after it happens? not the scripts themselves.
that depends on how the scripts works...
do i need to remoteExec something on all players so the sounds stops? if so any ideas?
there is no magical fix to resolve all problems... especially when those problems are caused by unknown scripts
The correct answer is to fix the issue in whatever script causes that issue to happen which is impossible without knowing what the scripts do tbh
it doesn't happen all the time on our server, just every now and then. Further more, its common on many servers with custom handeldamage or revive. so having said that it feels like a propagation issue. similar to when your uniform disappears. I have a fix in the stuck action for the uniform disappear issue.
So i dont think the issue is with my script, ACE, Invade & Annex, and Life Servers. we are all doing it differently and the issue still remains. so.
Any ideas on how to come up with a bandaid fix like the uniform issues?
I also never have seen issues with uniforms (other than people not having the correct mods installed)...
and I always play with ACE, and have played a lot of I&A
ok well google it. its a thing. sometimes a player has no uniform on and its because arma didnt send it to all the clients.
again; the problem is in your scripts, and we can't help you without knowing what's in the scripts 
ok so when im playing with my milsim mates who are using ACE and i dont own the server, what could i do in the debug console to fix the problem?
on my client
eg. https://feedback.bistudio.com/T85234
All people complaining about uniforms here are using Life, Exile or other mods/scripts which affect the uniforms... And no one is able to reproduce the problem in vanilla Arma since the issue doesn't exist there.
and I don't know what to type in the console, because I don't know what is happening beforehand
ok mate.
if you have a problem with a script (which this channel is for), than post your script so we take a look at it.
we're not wizards who know exactly what you're doing and have a solution for all problems
ok the channel as is for scripting help in general. Not debugging exclusively.
Furthermore common sense is if you CAN help with something then say something, if you cant then dont.
This may be my fault, i should reframe the request for help.
I have a script called Stuck that is a client side addon for people to fix common issues across alot of other frameworks.
I would like to include in this addon the ability to fix it when a player near you is making the injured sounds even though they have full health. Do you have any ideas on how to do that?
Furthermore common sense is if you CAN help with something then say something, if you cant then dont.
I want to help you, but without any information there's nothing I (or anyone else) can do...
That's why I ask for the exact conditions (and therefor scripts, since we're in #arma3_scripting) so we CAN help you with your problem.
I can help.
Not possible.
End.
if it is as you describe that is. aka it being caused by vanilla
So I'm trying to make a simple event handler which allows a helicopter to still receive damage w/o it ever "Blowing up". Basically, I'm trying to make a survivable crash landing script. I've tried using the "HandleDamage" EH however, it still seems to allow damage to occur to destroy the helicopter even though I have it setup as follows:
_helo addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (toLower _hitPoint == "hull") exitWith {0.9 min _damage};
_damage
}];```
_damage is the given amount of damage as I recall, not current amount of damage. Or maybe not? Not sure any more.
Take a look at this reddit post, which is trying to do something similar: https://www.reddit.com/r/armadev/comments/2baq0u/preventing_cars_from_exploding_by_scripting/
In short, it's far from a "simple" script 😉
And _damage is the amount of damage given to _unit, and the return value is the modified value used by following EH's.
Besides that; _selection returns the part which for hit (for part specific damage), or is an empty string meaning overall damage. If either one is 1.0 (depending on object and part) it will be destroyed.
So you really need to handle a lot of different cases inside that EH.
Hi all,is there any way to place an item weapon with attachments in it?!
afaik not with scripts
you should be able to make a config with the weapon including attachments, and then spawn that in-game
Maybe with addWeaponWithAttachmentsCargoGlobal?
that will just put it in a container (like box or vehicle)
🤔
although might work with a weapon placeholder 🤔 but I have no idea how that would work
thats what he wants I think
Yeah, that's what I also thought
And if not, he can use https://community.bistudio.com/wiki/addWeaponItem no? (+ addWeapon)
but that doesn't work with props, if that's what he wants (because I can't tell by the question)
But props are weaponHolders iirc (weapons ones atleast)
I used the addweaponwithattachmentscargoglobal and ias @exotic flax says, it works as a container, not visual
can you explain what you want to do
I just want to place a weapon with visible tactical attachments (sight, silencer, flashlight) for the player to pick it up.
so something like this should do the trick:
_weapon = createVehicle ["groundWeaponHolder", [0,0,0]]; // [0,0,0] is position
_weapon addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 1];
edit: fixed 😉
i need help, ive followed the TedHo instructions but i can't seen to get the capture going.
so something like this should do the trick:
_weapon = createVehicle ["groundWeaponHolder", [0,0,0]]; // [0,0,0] is position _weapon addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 1];edit: fixed 😉
@exotic flax
Great, I'try it later.
Thank u so much!
The Assault Boat seems to have an animation vehicletransported_engine which lifts the outboard motor when it's a ViV cargo. I can't seem to control that animation via _target animate ["vehicletransported_engine", 1]. Anyone have success with this?
how do I get these waypoints as an array rather than a string. breakpoint is at "_x setWaypoint..." saying its finding a string when it wants an array. still working on trying to become more efficient at the scripting so I don't have to apply it to every single little thing. this is what I have so far
[] spawn {
sleep 1;
baseGroup1 addWaypoint [[18037.8,8932.67,0],0,1,"baseGroup1_waypoint1"];
baseGroup2 addWaypoint [[18037.8,8932.67,0],0,1,"baseGroup2_waypoint1"];
_baseWaypoints = ["baseGroup1_waypoint1", "baseGroup2_waypoint1"];
{
_x setWaypointSpeed "FULL";
_x setWaypointType "SAD";
_x setWaypointBehaviour "AWARE";
_x setWaypointFormation "WEDGE";
} forEach _baseWaypoints
}
https://community.bistudio.com/wiki/setWaypointType takes array, waypoint
https://community.bistudio.com/wiki/Waypoint
addWaypoint returns array, waypoint.
https://community.bistudio.com/wiki/addWaypoint
so... this:
[] spawn {
sleep 1;
baseGroup1 addWaypoint [[18037.8,8932.67,0],0,1];
baseGroup2 addWaypoint [[18037.8,8932.67,0],0,1];
private _baseWaypoints = [[baseGroup1, 1], [baseGroup2, 1]];
{
_x setWaypointSpeed "FULL";
_x setWaypointType "SAD";
_x setWaypointBehaviour "AWARE";
_x setWaypointFormation "WEDGE";
} forEach _baseWaypoints
}
no
that will only work if the groups have no waypoints before you added yours
build an array, put the return value of addWaypoint into there
well I'm going to be use Lambs Reset to get them out of a previous garrison so there will be no waypoints when I create them so in total, it will look like this.
[] spawn {
//Local Variables
private _leaderg1 = leader baseGroup1;
private _leaderg2 = leader baseGroup2;
private _groups = [baseGroup1, baseGroup2];
//Reset all waypoints and creates new group to disable Lambs
{
_x call lambs_wp_fnc_taskReset;
} forEach _groups;
//Delay so Lambs Task Reset can run
sleep 1;
//Create Waypoints
(group _leaderg1) addWaypoint [[18037.8,8932.67,0],0,1];
(group _leaderg2) addWaypoint [[18037.8,8932.67,0],0,1];
private _baseWaypoints = [[baseGroup1, 1], [baseGroup2, 1]];
//Modify Waypoints
{
_x setWaypointSpeed "FULL";
_x setWaypointType "SAD";
_x setWaypointBehaviour "AWARE";
_x setWaypointFormation "WEDGE";
} forEach _baseWaypoints;
};
build an array, put the return value of addWaypoint into there
something tells me I'm going in the wrong direction... I'm not too amazing at scripting lol
[] spawn {
//Local Variables
private _leaderg1 = leader baseGroup1;
private _leaderg2 = leader baseGroup2;
private _groups = [baseGroup1, baseGroup2];
//Reset all waypoints and creates new group to disable Lambs
{
_x call lambs_wp_fnc_taskReset;
} forEach _groups;
//Delay so Lambs Task Reset can run
sleep 1;
//Get Previous Waypoints into Array
private _wpArray1 = waypoints (group _leaderg1);
private _wpArray2 = waypoints (group _leaderg2);
//Create Waypoints
private _sdWaypoint1 = (group _leaderg1) addWaypoint [[18037.8,8932.67,0],0];
private _sdWaypoint2 = (group _leaderg2) addWaypoint [[18037.8,8932.67,0],0];
private _sdWaypoints = [_sdWaypoint1, _sdWaypoint2];
//Add waypoints to Array
_wpArray1 pushback _sdWaypoint1;
_wpArray2 pushback _sdWaypoint2;
//Modify Waypoints
{
_x setWaypointSpeed "FULL";
_x setWaypointType "SAD";
_x setWaypointBehaviour "AWARE";
_x setWaypointFormation "WEDGE";
} forEach _sdWaypoints;
};
not bad, just
private _wpArray1 = waypoints (group leaderg1);```why use `group leaderg1` (btw, missing underscore here) and not baseGroup1/baseGroup2 directly?
the lambs reset causes the group to be recreated in order to disable its previous orders. So I have to grab the leader because the group variable gets deleted when the lambs reset is run
OK then - you're good to go sir 👮
ye heh heh heh essss. it works. finally. And yeah it first threw an error saying that _wpArray1 wasn't defined when I swore it was. Came down to that missing underscore.
so would you do a
group _leaderg1 setCurrentWaypoint _wpArray1 select ((count _wpArray1) - 1)
?
How would you get a specific marker by name? missionNamespace getVariable..?
markers are referred to as their name stringed. eg "marker_0".
Trying to get a marker from the map and change its text.
does the script already have the marker name or does it need to find the closest marker or something?
Hey guys, can I use Say3D to make a loudspeaker play a sound when a pop-up target is hit, this would need to work on a dedicated server
Thought about using advice I had from @ebon citrus a week or so ago for 'HandleDamage' but I wouldnt have thought handledamage would work on a popup?
Searched the BIKI, no such luck 😦
@robust hollow No. The script is completely independent.. I need to get the marker from the map and change the name of it with a function
so cops can open/close areas.
you're probably best to either use the specific marker name as a function argument for each zone, or write the names of all markers that could be modified by this function into it and select the closest (if thats how it works).
@gloomy aspen you can
the markers have variables set already
the markers text will sometimes be North Checkpoint - OPEN and sometimes be North Checkpoint - CLOSED
gotta change the color too.
I am currently not home, but i have the exact script youre thinking of
ok... so you just use the marker name with setMarkerText and setMarkerColor
I think i used "Hit" EH
but how does it know the name of the marker to set
@gloomy aspen use
_target addEventHandler [
"HitPart",
{
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
// your code
}
];
its the name you gave it when creating the marker
eg. I use the following script to add "red pencils" at the location where someone hitted the target:
_target addEventHandler [
"HitPart",
{
_marker = createVehicle ["Land_PencilRed_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_marker setDir 180;
_marker enableSimulation false;
_marker setPosASL (_this select 0 select 3);
}
];
so if you try to find one and its named different.. then it will return null
Awesome @exotic flax thank you!
marker names dont change for as long as they exist. do you delete and create new markers for this?
and it goes by variable name?
true, although I foresee that it will be the next question on how to see where someone hitted the target 🤣
i have no idea what you're on about. paste ur code so i can see what you're doing.
True
The name is the variable name
"north_checkpoint" is the marker name
Text is just the text the control displays
@ebon citrus wouldnt I have issue making "Hit" work globally though? Is "HitPart" local too?
Both are, yes
But on the server
Since the pop-target is local on the server
It cannot be playable by a client
So then just remoteExec on all clients
Hit is local, HitPart is global (arguments are, not effects)
Ahh, I still need to read up on locality, forgive me! Thanks guys 🙂
Yeah, effects are local
But the pop-target is local on the server
Hitpart generates extra traffic to clients
So Hit is better if you dont need parts
Very minimal traffic, though
Well, depending on the code
only the event goes over network, not the code itself (that is always executed locally)

The arguments?
They get sent over network, right?
And so does rhe code
Yeah idk
I'd say stick to Hit
While you can add "HitPart" handler to a remote unit, the respective addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well. The event will not fire if the shooter is not local, even if the target itself is local. Additionally, if the unit gets damaged by any means other than ammunition or explosions, such as fall damage and burning, "HitPart" will not fire. Because of this, this event handler is most suitable for when the shooter needs feedback on his shooting, such as target practicing or hitmarker creation.
Hit can be added on server side
Because the target is serverside
hitPart is not good for this purpose
As it fires locally where the shooter is local
I dont know what the global arguments in this case mean
As it seems to have no effect
But, again. Use "Hit"
LOCAL are not broadcasted over the network and remain local to the client the command is executed on.
a local effect means that the effect will only happen on the machine where the command is executedGLOBAL: are broadcasted over the network and happen on every computer in the network
a global effect means that all the computers will receive it
But it onviously doesnt in this case
in short, it doesn't really matter and depends on the usecase
Hmm .. sorry guys this doesnt seem to be working, undoubetly my own error somewhere
"HitPart",
{
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
t1 say3D ["hostagehit", 1000, 1, false];
}
];```
Some evenhandlers can be added remotely
ah might be that i didnt change ' _target'
Also, this audio will only play where the "_shooter" is local @gloomy aspen
Please, use "Hit" @gloomy aspen
Far less headache
imma take that as a yes
If yoy intend to use this in MP
cause if it was wrong yall would be all over me like white on rice
to open all gates in my array of gates
_gates = ["nc_out_1", "nc_out_2", "nc_out_3", "nc_out_4"];
they're bar gates
You need the specific animation name for the gates
animate expects an Object, not a string
That aswell
No quotes
1s
Remove the quotes from the array
"String"
Object
No quotes for objects unless specificly requested
{
_x = missionNamespace getVariable[_x];
_x animate ["Door_1_rot", 1];
} forEach _gates;
eh..?
{
private _var = missionNamespace getVariable[_x];
_var animate ["Door_1_rot", 1];
} forEach _gates;```
thats the same thing, just prettier lmao
it's NOT the same
Array

MyGates = [gate_1, gate_2, gate_3...]
they are already existing objects in the mission
_gates = [nc_out_1, nc_out_2, nc_out_3, nc_out_4];
that
thats what im doing
So now theyre NOT strings?
_gates = ["nc_out_1", "nc_out_2", "nc_out_3", "nc_out_4"];
@warm venture that is what you told us...
{
_x animate ["Door_1_rot", 1];
} forEach _gates;
This
No need to getVariable
Also, im still skeptical as to if "Door_1_rot" is applicable for bargates
I use it on all bar gates
move is for side to side gates
rot is for swivel gates/bar gates
you sure you dont want params["_openOrClose"]; instead?
I did have that
this addAction["<t color='#3FFF33'>Open North Checkpoint</t>",{remoteExec['[true] life_fnc_northCheckpoint', player]},"",0,false,false,"",'playerSide == west'];
And that to trigger my function.
thats not how you use remoteexec
[true] remoteExec ['life_fnc_northCheckpoint', player] is correct. also why are you remote executing to yourself?
oof i copied it in there wrong.
and no idea.
cause I needed it somewhere else and copied it in here
what goes in place of player? nothing?
depends who are you wanting to remoteexec to
does it need to remoteexec?
Yes
to everyone?
Yes
including the server?
no
-2
👌
when would something need to do it on server
one example would be when executing a server only command
in the case of life servers you would remoteexec to the server for db queries
mmhm. i cant quite hate on it so much because its where i started 😛
w0w i got help today and didnt even get told to off myself this time
so what do you play now
i dont play
i dev stuff
for?
myself and others?
oh, i have some small mods and game modes posted. dont want to advertise here, not in this channel anyway.
params[_openOrClose];
_openText = "North Check>
0:11:48 Error position: <_openOrClose];
_openText = "North Check>
0:11:48 Error Undefined variable in expression: _openorclose
0:11:48 File core\cop\fn_northCheckpoint.sqf [life_fnc_northCheckpoint]..., line 65
REEE
yes thought that was making fun of me for doing it with "" earlier
nooo
ty sir
just trying to figure out why running ["North Checkpoint","North Checkpoint is now open for pass-through!"] remoteExec ["UPM_fnc_showNotification", 2]; in infistar admin console as server works fine, but it doesnt do anything through the script
As long as we don't know what UPM_fnc_showNotification is, nothing we can do
well was trying to figure out why it works fine running as server in game but doesnt work running as server in a script.
its the same thing
ill figure it out
why it works fine running as server in game but doesnt work running as server in a script.
I don't understand?
if I run it ingame in the Admin Console (infistar) and execute it on "Server" it works. But if I remoteExec it to 2 (also server), it doesnt
2 means only in server
so I need 0
Maybe -2. Don't know the function so IDK
Hi. Is there anything I can do about say/say2D/say3D breaking when .lip files are present or is this an engine bug? :)
Never heard of that... precisely? What's the situation?
as soon as I add the .lip files the sound plays in like 1 second instead of the 20s it's supposed to.removing the .lip file makes the sound play, but then lips don't move
like it's super sped up
does sqf work like python in that index -1 equals the last element in the array? or do I have to do
select ((count array) -1)
I don't think there's a way to do it unless you do like that. Or maybe
_array = [1,2,3,4,5];
reverse _array;
_array select 0;//5
reverse _array;```but you know, this is... pointless
just have an array that I potentially have no idea how big it is or what the values are individually when working with waypoints and AI mods
and just want to select the last waypoint in an array of waypoint returns
Also DasCapschen, surely looks an engine-side issue/feature. Don't know say things have capable with .lip files so kinda ¯_(ツ)_/¯ for me
hmm, alright. guess I'll have to upgrade to kbTell :p
Or BIS_fnc_kbTell? I'm really dumb at these commands so...
@fair drum yes, selecting count -1 is how you do it, don’t reverse array
Is there a way to rotate texture? Maybe I need to post this issue in ace
https://www.youtube.com/watch?v=JxcWHGQa0RU
//initPlayerLocal.sqf
["ace_TAG_slovakia", "Slovakia", "ACE_SpraypaintBlack", ["\A3\UI_F\Data\Map\Markers\Flags\slovakia_ca.paa"], "\A3\UI_F\Data\Map\Markers\Flags\slovakia_ca.paa", [], "UserTexture1m_F"] call ace_tagging_fnc_addCustomTag;
player addBackpack "B_AssaultPack_blk";
player addItemToBackpack "ACE_SpraypaintBlack";
@tough abyss the question should perhaps be "why would another client know about this information"?
set/getVariable could be faster, be sure to use the local EH then
What is the situation that needs this?
Oh, there was a script like this from bakerman I believe
but is that really time critical?
how far does the rocket move within 1 ms
I suppose before the projectile hits 😄
oh - you can get the "parent" from the projectile
you can then remoteExec?
(or maybe directly remoteExec from the projectile, too)
\o/
and you cannot setVariable on an ammunition (stated on its wiki page)
Hey is there anyway to have objects move via script?
So like i could keep the players stuck in within an area until something is triggered via prop blocking or something else?
so like have big VR blocks around the players so they can leave, and when a trigger happens the blocks sink into the ground
there is some macro thing you can use, https://forums.bohemia.net/forums/topic/211621-oop-object-oriented-programming-sqf-scripting-and-compiling/
seems cool, thank you ! are you using it ?
no
When you use addaction, is there a way to use the addaction on the unit that is committing the action instead of the unit the action is on?
EG, I want to be able to put addaction on a box, and when used, add an item to the inventory of the person who used the action
the code runs on the machine on which you ran addAction
_target will be the box, _caller will be the unit
the code runs on the machine on which you ran addAction
I wanted to say that you can just useplayer🤔
the code runs on the machine on which you ran addAction
this ^ means the bit of code will run on/from the player's machine
Is player not always the server host?
no
player is "the unit controlled by this computer's IRL player" - can be objNull
generally you must do it like this (inconvenient but it is what it is):
add action to object via remoteExecCall with a JIP tag so that newly joined players have the action
therefore the code will run on the machine of the player which activated the action, always
see documentation for remoteExecCall
Got it, thank you
@cunning oriole why not just have one event handler, and handle both cases with like a switch or something?
@cunning oriole these event handler must return something which might override other event handlers of same kind
check ctrladdEventHandler docs
also compile your scripts, and call or spawn them accordingly, rather than recompiling them every call with execVM, _nul = is gibberish and not needed, you never use the handle afterwards anyway
Thanks for the SetPos command, everything works!
in this case _nul= might be doing something,
because keyDown is supposed to return a bool I think?
...am I doing this right? _rack = this; [player, _rack] remoteExec ["Gruntclothes.sqf",0,true];
no
remoteExec doesn't take a script filename
it takes a script function (variable name) or a command
...ah
...is it possible to run an execvm through a remoteExec, or is it not possible to run files at all on a clientside level on a server
remoteExec ["execVM",...
Thats what I thought, yea. I jtus wanted to make sure I wans't talking nonsense
_rack = _this; [{_rack execvm "Gruntclothes.sqf"}] remoteExec ["call",0,true];
now what exactly am I doing wrong with this one
[left argument, right argument] remoteExec ["binarycommand", targets] = leftargument binarycommand rightargument, [[player, _rack], "gruntclothes.sqf"] remoteExec ["execVM", 0, true];
also _rack is undefined
you set _rack
but then you reference a different, undefined _rack variable in your code piece
https://community.bistudio.com/wiki/switch @cunning oriole
I am trying to make a convoy out of a bunch of vehicles incluting Zamak Transports full of people that should remain in there unless there's a threat which is when they should disembark and defend the convoy. My problem is that the convoy's commander is ordering a bunch of people to disembark a few seconds after the mission starts (no hostiles within a 10+km radius). Is there any way a can prevent that initial disembark order from being issued so that the people stay inside as long as there no threat to encounter?
they… shouldn't
must be a mod thing?
Put them on Safe, and have the Formation in File/Collum
@winter rose They shouldn't what? Disembark? But they do and I do not have any mods... I think the officer just doesn't like 100% full vehicles because know that I have removed some the problem is nearly gone...
@thin owl Guess what their settings currently are: Safe, formation: File. (PS: also tired collum)
Are you running any AI mods?
@thin owl
[...] and I do not have any mods... [...]
@thin owl No because then they would act like total morons. The convoy is meant to be an unexpected challenge for the players when they encounter it because it travels on a completly randomized patrol route which is randomly generated on each mission start. If I would set them to careless they wouldn't even be worth a sidenote but in their current from they pose a real threat.
Which channel has the groups that are recruiting
@winter rose Yeah, I guess they are just really into social distancing. Now that I removed one more (after only one guy got ordered to disembark) no-one disembarks anymore so it must be the full vehicles that caused this...
dunno, I admit - very weird behaviour here ¯\_(ツ)_/¯
can anyone explain why this would fail to unhide the relevant object on a dedicated server? Because I'm 100% stumped. Executed from the on completion of a holdaction.
[obj_setup1,false] remoteExec ["hideObjectGlobal",2,true];```
why jip? shouldn't be any need for jip
just to be safe
I don't see why that would cause it to fail completely, in any case
there is something that comes after this in the script, which does obviously succeed, so I don't think there's an error in the command as such (otherwise it would stop)
please, think of the network
Hey y'all, I'm trying to terminate an Ambient Animation from a script that executes when a trigger is entered. I tried using call BIS_fnc_ambientAnim__terminate but I'm receiving an undefined variable error. Using switchmove "" isn't working either. What am I doing wrong?
@uncut trout Did you pass the unit animated as an argument to BIS_fnc_ambientAnim__terminate?
Yes I just left that part out of my snippet lmao
Aha I figured out. I was using the UI for running ambient animations (I think that's a 3den enhanced thing) instead of calling the function myself. I guess that doesn't define the terminate function for whatever reason.
Hello, anyone has time to show me how can I edit mass values for specific vehicles for a mission? I have checked out this link https://community.bistudio.com/wiki/setMass but don't understand how to execute this properly.
Thanks in advance!
give the vehicle a variable name in the editor. Then, in...init.sqf, I guess, put
whatever_variable_name_you_used setMass 5;``` (where `5` is whatever mass value you want to give the vehicle)
@hallow mortar wouldn't it be enough to add this setMass 5 to the vehicle's init in the editor? No?
init field is evil
I see
Why is the init field evil? I tell people not to use it cause I heared someone say it was evil, but I never questioned why it was evil
I've never had problems with it
Onoy thing i can see is init-order
Init-fields come before init.sqf
So if your init-field relies on anything done in init.sqf, things will get wild
But for setting a vehicle propperty, i dont see why it's bad
I regularly use init to set object, unit and vehicle properties if they are unique
Apparently it's because the init field is ran EVERY TIME a player joins, so you ought to be careful with what you place there
Set mass random 500 + random 500 on init fiel will make game interesting.
@ebon citrus @surreal peak @peak bridge
https://community.bistudio.com/wiki/Multiplayer_Scripting#Join_In_Progress ← red warning box
it is indeed
because the init field is ran EVERY TIME a player joins
It also depends on what is happening. Say a setDamage 1, which outright kills a unit, doesn't really matter
no, but a this setDamage 0.5 to start the mission injured…
no this addDamage 0.5 will kill you after the second person joining 🤣
addDamage does nutt exizzz :U 🔨
imagine, you heal yourself, "oh btw, sorry I'm late" guy connects, bim, one FAK wasted 😁
(or, you're about to die and someone disconnects/reconnects)
https://community.bistudio.com/wiki/Arma_3_Old_Man_Systems isn't this the old man documentation everyone was hoping for?
yes it is
I've not played oldman, is there anything major it added?
Old Man itself is
I've only watched Rimmy play it. I had some GTA vibes..?
GTA vibes? 🤔
Sort of open world with a main story and many side objectives and a "criminal" main character
Again, I haven't played it myself
I'm setting up a race, and was wondering how you would teleport the first player and vehicle to activate the trigger to a specific location
If it's only the first person crossing the line; simply make a trigger which only triggers once.
With 3 players (first 3 I assume);
- have trigger at finish line which will store the order of people crossing the line
- when all racers have crossed the line, take the first 3 in the list and move them to the 3 positions you want
Please note that this is not a "please write my scripts for me"-channel
We'll be happy to help you with problems and give suggestions, but not write out complete scripts
👍
in pseudo-code, would your idea be
- create a list
- add unit entering the trigger to the list
- when the list is 3 or more, place them somewhere
```?
Yes
https://community.bistudio.com/wiki/Array
https://community.bistudio.com/wiki/pushBack
https://community.bistudio.com/wiki/count
may help you then 😉
tell us if help is needed 🙂
Thanks
heyy guys im new to this whole scripting scene, but anyways, i am trying to make a script that allows your squadmates to climb/descend ladders. Unfortunately, the main element, "LadderUp" command seems to not be working as stated on the wiki, or im doing something wrong, can someone pitch some advice?
@winter rose thanks for the hint! I never noticed that box. Well, i never used any scripts in Init that wouldve changed anything
You want to allow or disallow mates to climb up/down ladders?
Allow
Then just command your mates to climb up
like through the hud on vanilla? i never knew that was an option lol
This is the command I'm using, basically what happens is the ai does a grabbing animation then stops and doesn't do anything after
soldierOne action ["ladderUp", (position soldierOne nearestObject 452221), 0, 1];
is there an easy way to add mods to a mission? I assume not because i can't find anything doing googles but might as well ask.
I just want to stick a remove stamina mod and enhanced movement to a mission so when my friends or randoms join in online and play they don't have to download them / have them enabled.
nope, mods are mods and have to be downloaded
the "remove stamina" can be scripted though
right wasn't sure on that one, thought i'd been on some servers that had mods built into missions but was probably just scripting, thanks!
is there a way to say that if a player JIP he goes to the respawn menu, but players on the mission start do not?
i have it at -1, but it does not take care of JIP people
i basically have a small part that works as intro with an heli that moves people, then people move a humvee that is a mobile respawn, so when the mission start people who are inside should be able to see and do the transport part, people who join after however should just spawn on the vehicle
-1 will simply never run, set to 0 to run on respawn, not at join.
although it will only take care of the respawn menu (show or not), and doesn't do anything else
afaik you can't make a difference between "on mission start" and "during mission"
maybe i should run the respawn script and selectively choose where people respawn, ie add the respawn on the heli and after that part is done do the respawn on the humvee?
that would make the most sense
eg. when I make larger missions (with multiple spawn points) I always start with just one spawn point at the base, and after mission start I remove it and add a spawn point where needed (on vehicle, cleared areas, etc.)
yep that would make most sense but also break all the workarounds i have made for the flyinheigh not working as expected and the let unit fastrope bug of ACE or the AI not behaving correctly when on the USS Freedom aircraft carrier
Hello there fellow scripters!
Is there anyone that knows how to make a box (any of them) open the ace arsenal? I've been trying with ["AmmoboxInit",[this,true]] call ace_fnc_arsenal; and [this, player, true] call ace_arsenal_fnc_openBox but it doesn't seem to work
if there's something i'm missing out please tell me lol
so you want the player to open the ace arsenal via script? like the BIS_fnc_arsenal ?
I'll try with these, cheers
ace_arsenal_fnc_initBox will add ACE Arsenal to an object, which can than be accessed through the interaction menu
yup i still have to figure out how to add items to the ace menu via script for a later mission
the interaction with points is cool so no reason to not use it (unless it's a headace to use it, that is)
the documentation of ACE features is great IMHO, so their website is all you need
in code lies the truth
https://community.bistudio.com/wiki/sideChat does the "remotexec" part still apply? last test the sidechat was flooded with the same message for every player that was connected
Where did you place said sideChat? Trigger, init?
it was inside a trigger
basically it says "prepare to fastrope" when the heli with player is near the dropout zone
(so it's a player presence trigger)
Do you have the "Server only" ticked?
whoops i forgot to tick it, it may explain why it was flooded
If not, it might trigger for every player, and so every player will remoteExec sideChat, that's why you have the repetition
that makes sense, my bad
Still can't seem to open an ace arsenal via action with a box I'm using [_box, true] call ace_arsenal_fnc_initBox but it does nothing, i'm also trying other scripts on the ace page and they don't work as well
Why not just tick the Ace Arsenal box in the editor?
do you use Ace Interactions? Or the regular mouse wheel stuff?
regular mouse thing
use Ace Interaction on the box, and you'll get an option to open it 🤔
ace interaction is opened by holding a key right? I also did that
and nothing shows up
Hold CTRL and move the red circle on the white point which is at the center of the box/crate/whatever...
i only have "Interactions-Open"
do you have some weird version of ACE, or other mods/scripts which might interfere with ACE?
i have ace no medical
that shouldn't be an issue, unless it's broken...
I'll check the version
still shouldn't matter... ACE Interaction = ACE Interaction...
I'm 100% sure the code works, and I know that it hasn't changed for years in ACE itself...
why do i always have to struggle with scripting lol
so either you're using the code wrong, or you don't know how to use ACE correctly 😉
i guess
it says "Please note that at least one virtual item needs to be added otherwise ACE Arsenal will not open."
but then again, all virtual items are set to infinite
nvm i got it to work, it was using [this, true] call ace_arsenal_fnc_initBox;, i changed _box to this
quick question: do you know what private variables are and how they work?
not saying that to be mean, but it would make your life alot easier if you do
does someone know an out of the box solution for having a ton more of dust spaned by vehicles, explosions etc? i always feel like desert maps dont have nearly enough dust in the air
there is BIS_fnc_sandstorm for the "environmental" sandstorm, as for the rest there is no "off-the-shelf" solution except maybe someone who would have already scripted something like that
Maybe a snowstorm script (M13 mission on thirsk winter) can be changed to a sandy looking dust particly thing
i think i saw a function for that
can't figure out a ai ladder script for the life of me... seems like LadderOnUp action is either buggy or me just filling wrong parameters
Did you read https://community.bistudio.com/wiki/Arma_3_Actions#LadderUp ?
hello, there is a way to save values in a file with a script, i mean, you cant "print" information in .rpt... but that is quite annoying to read, i just want a .txt with my position every 3 seconds in the entire mission for example
no can do without extension
you can still copyToClipboard (in SP or as server in MP)
@open hollow take a look at the extension which is used in
https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/
It allows you write to a file with scripts, but (obviously) isn't allowed with BE enabled.
Or have a look at my extension 
https://steamcommunity.com/sharedfiles/filedetails/?id=1729548898&searchtext=ofstream
Also @barren magnet have same kind of extension with similar functionality, forgot the link
We don’t use BE 😄 then you! I’ll try both!
🤔 that's actually good to know. How is it called?
Also, as a side comment, having an extension which can dump logs into different files has become very crucial in development.
Good practice I've found is to separate log files depending on topic, and have the errors from all modules dumped into a common file with errors.
If ace has one it will be awesome
You may also find https://community.bistudio.com/wiki/BIS_fnc_UnitCaptureSimple useful
Unit capture doesn't store data to a custom file... Just to clipboard...
Yes, it does indeed say that on the page I linked
it may still be useful in combination with an extension to save output to a file, or if "to file" isn't the most important part of the requirement
There are also server-side mission recording utilities such as R3 that could be useful on a larger scale, but I don't know how to use those
@exotic flax Yeah I read up on that, only issue is, I don't know what a ladder number is and it doesn't really go into detail about it, im sure im doing something wrong but, can't put my finger on it.
@astral dawn https://github.com/Arkensor/A3LOG
Yes! Thanks!
got it to work 😄 syntax error... lol
Which one of the three? nvm I thought you refered to the file extension
What does the link contain?
!purgeban @tough abyss 0 posting gore
*PewPewPew!!*
RIP @hearty scaffold
That was fast
Welp, i got spared the trouble
same on dayz discord a minute ago
Thanks Ded
Is there any way to force the AI to play a stance, let's say i want to make it to stay up all the time
i've tried setbehaviour but it doesn't do what i want
playMove, playMoveNow and switchMove
this playMove "STAND"; right?
how do you define a global variable...?
TAG_myVar = value
@tough abyss https://community.bistudio.com/wiki/setUnitPos
that easy huh
@warm venture yes
isNil ncp_cooldown
do remember; Global variable != Public variable
So I can do this to check if it exists or not
sometimes
as long as the variable has not been used before
ummm...
that's not the best way to doing it
what is?
isNil ncp_cooldown
wrong usage ofisNil, ""
☝️
yeah but..whats the best way of doing it?
a timer
set a delay to make it not spammable
preferably server-side
but on client, if you really need it to be
like add sleep?
errr..
putting a sleep at the end of the code is useless isnt it?
cause if you execute it again, it just goes through again
ask vague questions, get vague answers
I need a 5 minute cooldown.
through a remoteExec
an addaction
Cheers @hallow mortar
when you run the action, set condition to false
sleep 5 minutes
set condition to true
VERY SIMPLEST way of doing it
condition as in a variable..?
whatever you like
just put a variable on the infostand itself
Anyone know what causes this error? Its during rapid spawning of units (testing performance)
21:27:26 Number of joints in scene after release: 30
21:27:26 Number of actors in scene after release: 32
21:27:26 EPE manager release (30|32|0)```
My guess is something to do with it getting clogged up trying to create units
I need to make my server restart automatically every 4 hours..is there like an rcon command or something to restart the server?
windows only
What does the EPE stuff mean?
im on linux
then add linux to the search squallz
i..have
EPE is physics stuff.. kinda.
all the sights are just for hosts
Oh right so its just telling me about that, I#'m testing HC stuff and when it locks up, it'll tell me where it gets up then spurts this for like a hundred lines, wasn't sure if its something to worry about, cheers
sites* wow
what about this squallz https://www.armaholic.com/page.php?id=29626
wish there was a better explanation on how it works


