#arma3_scripting
1 messages Β· Page 716 of 1
because i have done it in 3den
i have named the objects
so its not just "markername" in the addaction and then the variable object name will be markername also?
because thats what i've done so far
What?
I'm suggesting that, it's better to use an object for the position reference if you need to use another dimension (Z, height). What you have is markers not objects, you need to place a dummy objects like a prop, and name it, and use it in the code
No
oh okay now i understand what do i have to change
You name it, and use the name in the code
wait ive done all of that
I used the name of the object as the same as the code
and tested it and
and i get the error i sent you
No. That's unrelated to what I've suggested. You didn't change the strings
to the name of the object right?
there is definitely a communication barrier here im sorry
can i send you screenshot in dms
And what's the names of the dummies?
and the codes
No
okay ill tell so the names of the dummies are named seperately, teleport8green,teleport8blue,teleport8red
and my code is
this addAction["<t color='#ff9900'>RED V BLUE (LONG)[BRIDGE]</t>",{
{_x setPosATL getPosATL call {
if (side _x == blufor) exitWith {
"teleport8blue"
};
if (side _x == opfor) exitWith {
"teleport8red"
};
if (side _x == independent) exitWith {
"teleport8green"
};
}} forEach allPlayers;
}];
errorgetposat1 : type string , expected object
You named those objects teleport8blue etc?
Then get rid of the quotation marks that's what those make strings
ohhhh
okay
thank you that worked
i didnt know how to change the strings into objects
You just wrote it wrong. An object is just a plain variable name, and a string is text in quotation marks. Completely different things.
(Sorry if that sounded rude, just clarifying)
yeah I realized, I just don't know the language very well and I was struggling to communicate my problem
its all good now
Hi, ihave a question mayby someone can help.
Is there a command to adjust whether the gunner's seat is in the vehicle with a display or whether it is located directly on the outside of the gun? Is there a command to adjust whether the gunner's seat is in the vehicle with a display or whether it is located directly on the outside of the gun?
As an example, RHS M1043A2 (M2) shooter sits on the outside of the weapon, for RHS M1151A1 (CROWS / M2) shooter sits inside the vehicle. With the command "isTurnedOut" you can only check the FFV or normal open hatch commands.
Thanks for the help in advance.
use lineIntersectsSurfaces
I accidentally removed a folder from a pbo because I was going to edit its contents with A3 tools, now im trying to drag and drop it in the pbo and it wont go in it has a round circle slash thing that means I cant put it it, why is this?
what did you use to remove it?
I just draged it out of the pbo and in to my desktop
I mean what tool?
pbo manager
afaik you can't even remove anything from the pbo using pbo manager
or add
how do i fix it is it possible? Here's what i did
https://imgur.com/a/ga7MD8H
don't use PBO maganger
Β―_(γ)_/Β―
what should I use instead?
Oh ok thanks ill try it
also now that I noticed you're trying to modify someone else's mod. this is illegal without their permission
yeah its a private mod that my friend sent to me and i was just about to recolor the ghillie to a black one
the owner says its ok as long as its for personal use and not for distribution
Hello guys, im trying to lock a door on a modded building with this "bis_disabled_Door_1" but my door class name is door28 and i dont know how to lock it now . "bis_disabled_Door_28" and ""bis_disabled_door28" semm not to work
when i modify a10 pylons with zeus it removes the laser on tgp is there a script to fix it
I really don't like using disableUserInput for scripted animated briefings, etc. Is there a better way in disabling all user input except for using the escape key to pause or exit?
using UI EH maybe?
disableSimulation on the player mby? 
doesn't stop you from accessing inventory and stuff
don't press 3rd person key then π
(iirc it made a black screen, but I might remembe incorrectly)
you mean this in reference to instantly closing any created displays with a EH?
I, huh, don't know?
I meant it about disableSimulation
oh okay
findDisplay 46 displayAddEventHandler ["KeyDown", {true}]; + disableSimuation?
and exclude the esc DIK
iirc that's how I did it yeah
for some cutscene stuffz
yeah, for safety purpose disableUserInput should itself be disabled IMO π
so with vanilla buildings, they have config entries for locking doors under animationSources. Some modded buildings do not have these which possibly means they didn't include the option to lock the doors
I'll try this one out thx
Does anybody know if the EH "Fired" is triggered for every shot if I add it on the server?
On the wiki it says: Special multiplayer behaviour: When added to a remote unit or vehicle, this EH will only fire if said entity is within range of the camera. That range is determined by the fired ammo's highest visibleFire and audibleFire config value. In case of units, muzzle attachment coefficients are applied too.
thank you for your awnser <3. what do i need to add in to the config.cpp for it to work?
Did you create this building?
no but i got the source
thx β€οΈ
yeah, good to know, thank you. only concerned vis-a-vis OBJECT in this instance.
also with nuances re: HASHMAP in that keys can be anything almost. more than STRING at any rate, and with deleteAt support.
Only if the unit / vehicle is local to the server.
i would like to somehow test if a unit has this particular instance of an item in its inventory
but i suspect that is not possible
so we should not try helping? π
state your case?
i would like to have different keys for different doors
but it seems i can only test if a string is in a array representation of a units inventory
i.e. "Keys" in blah
it seems i cannot test if this key number 603 is in a units inventory
yep
therefore, the workaround is to use e.g setVariable
dropping "a" key, there is no way to know if you ditched A or B given they are the exact same type
thanks
or maybe i can make an addon which provides 100 items with the names "key no X"
haha
I need help some cause I don't really know what to google.
I've got playable unit with variable name set in the editor.
How do I check its variable name locally? (to run a script thats local on that unit)
Ignore for now, I think I found it π vehicleVarName
How do I check its variable name locally?
why would you need the string version?
if (local theNamedUnit) then { /* ... */ },
thanks!
oh and I didn't need the string version, I guess I just worded it unclear. All I want to do is check if I'm local on a unit with a certain variable name.
okido ^^ I just have a skin reaction every time I hear about vehicleVarName that's it π
π I was reading through this https://forums.bohemia.net/forums/topic/217079-set-unit-variable-name/ trying to figure what that variable field actually means. Turns out its just that... a variable π
Hi, I need help with an EH.
The EH I need help with is the "GetIn". I've been looking at the Event Handlers page and I can't get it to work for me. I need that if a player gets on a certain vehicle, he should be removed from the vehicle.
Some help?
see GetInMan if added to the player, otherwise GetIn if added to the vehicle itself.
Yes, I've also tried GetInMan and I can't get it to work either, I don't know where I'm failing.
I don't know either, your code is written in invisible ink! π€
captiveVehicles = "B_Quadbike_01_F";
player addEventHandler ["GetInMan", {
params["_vehicle","_position","_unit"];
if (_vehicle in captiveVehicles) then {
moveout _unit;
hint "You can't drive this car.";
};
}];
I just wrote it with a blue pen π
_vehicle in captiveVehicles
if object in string⦠not a thing
Yes, that's what I meant.
classname you can get from an object with typeOf
in can check if "something" is in "a list of something"
so...
if (typeOf _vehicle _unit == "B_Quadbike_01_F") then { moveout _unit;};
That's good?
uh, no
why did you write _vehicle _unit�
if (typeOf vehicle player == "B_Quadbike_01_F") then { moveout _unit;};
for the EH
makes no sense to change that, especially all of a sudden
yep, that's really work
thanks
but, if I wan't write more than one vehicle?
I cant make an array with de typeOf...
why not?
if (typeOf vehicle player == "B_Quadbike_01_F" or "B_Truck_01_covered_F") then { moveout player;};
that't dont work.
if (typeOf vehicle player isEqualTo ["B_Quadbike_01_F","B_Truck_01_covered_F"]) then { moveout player;};
This don't work
I can do 40 ifs so it sure works π€£
read commands doc, please
use in instead of isequalto
This seemed like the most proper place to ask this question even though it's not about a specific script problem, I have spent a lot of time making a mission and scripting but unfortunately my computer fried and I lost my mission files and scripts, I had uploaded an earlier version to the steam workshop and was wondering if there's a way to download the mission file rather than just be subscribed to it
hi im new to scripting. i recently downloaded a mod that adds HMD to all air vehicles but it removed the possibility of using the I-TGP from FIR AWS
how can i fix it
omg sorry, I use a separate harddrive for steam and it looks like subscribed stuff is on my main drive and not the steam drive
you're asking us how to fix a mod, have you messaged the creator?
yes but he doesnt respond and the mod hasnt been updated since 2018
Heya, I'm trying to spawn AIs on random positions that I've chosen beforehand. Does someone know how to do that? I tried my code below but the RPT says "Error getposatl: Type Array, expected Object"
EnyInfPos = selectRandom [[14648.2,14095.8,1.83308], [14669.5,14118.9,2.12161], [14670.9,14114,2.15523]];
EnyInf = "O_Soldier_F" createUnit (getPosATL EnyInfPos);
Edit: this works
EnyInfPos = selectRandom [[14648.2,14095.8,1.83308], [14669.5,14118.9,2.12161], [14670.9,14114,2.15523]];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
I looked at that and I don't understand it
you're trying to get position of a position 
Oh
And if I want to place multiple units like this, how would I prevent them from getting the same random position?
I've found this but I don't know how to adapt that to my script: https://www.reddit.com/r/armadev/comments/1hwmgi/selecting_multiple_objects_randomly_from_an_array/
you can do something like _positions deleteAt floor random count _positions
So I guess your problem is solved then?
How do i create a cube that is a physx object ? I'm trying to attach a non physx object to it to simulate falling. In theory i could take a square car, hide the model and scale it to the size of the object so it doesn't clip through the ground. But i'm looking for different maybe better solutions. Like is it possible to enable physx on a non physx object through scripting ?
no
So that is a no to both questions ?
yes
How do i create a cube that is a physx object ?
not by scripting, by a mod
Like is it possible to enable physx on a non physx object through scripting ?
no
would there be a way to check if an object is within a certain distance of another object?
yes, distance
https://community.bistudio.com/wiki/distance
Thanks!
another question;{_this select _target} addAction [... how do I get "_target" from the "_this" array?
you need to know the index of it
private _target = _this select ...
params ["_target", "_caller", "_actionId", "_arguments"]; so 0?
yup
alright, thanks!
but if you're gonna be using more than one parameter, you should just use params
it's more efficient
params ["_target", "_caller", "_actionId", "_arguments"];
is basically equal to doing:
private _target = _this select 0;
private _caller = _this select 1;
private _actionId = _this select 2;
private _arguments = _this select 3;
it's within a different addaction and I need the _target parameter to add an action to it
//code
[_this select _target] addAction ["Give Red Credits",{
//code
}];
}];```
and I'm not sure if I'm doing it right
see the doc if in doubt
so 0?
you know the index, but you're still doing the_this select _targetnonsense,_targetis undefined
and also addAction doesn't take array on the left, https://community.bistudio.com/wiki/addAction
_this select 0 seems to work
hey guys, im trying to get a custom ogg sound to play in a mission for a briefing. i have multiple ways to activate it. i have a trigger, a laptop with an add action. i have the sound and the description.ext, but for whatever reason, its not currently working. any pointers?
yes
something is wrong
I have the sound and the description.ext
how is it declared, how are you calling it, etc etc π
Disregard, I got it working through say3D!
roger roger, nice to hear! π
I don't know where to put that π
EnyInfGrp = createGroup [east, true];
EnyInfGrp deleteGroupWhenEmpty true;
dynamicSimulationEnabled EnyInfGrp;
EnyInfPos = selectRandom [[2862.25,4756.75,0.0952458], [2860.25,4753.75,0.0952454], [2855.84,4757.14,0.0952454], [2857.07,4754.06,0.0952454]];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
{
_x disableAI "PATH";
_x setUnitPos "UP";
} foreach (units EnyInfGrp);
separate your select random from the infantry pos and just make an array of positions, then in your foreach iteration, make it select random from that array on that instance, then delete it from that array
Like that?
EnyInfGrp = createGroup [east, true];
EnyInfGrp deleteGroupWhenEmpty true;
dynamicSimulationEnabled EnyInfGrp;
EnyInfPos = [[2862.25,4756.75,0.0952458], [2860.25,4753.75,0.0952454], [2855.84,4757.14,0.0952454], [2857.07,4754.06,0.0952454]];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
{
_x disableAI "PATH";
_x setUnitPos "UP";
_x setPosATL selectRandom EnyInfPos;
EnyInfPos deleteAt floor random count EnyInfPos;
} foreach (units EnyInfGrp);
new to scripting. any IDE/editor suggestions for syntax highlighting?
also, is this valid? player allowDamage = !player isDamageAllowed
Visual Studio Code + SQF plugin π
see also https://community.bistudio.com/wiki/Category:Community_Tools#Code_Edition
not, not valid
player allowDamage !(isDamageAllowed player);
thanks, just making a simple script rn that handles a spawn zone, combat zone. interesting challenge π
awesome!
dynamicSimulationEnabled EnyInfGrp is useless, you discard the result https://community.bistudio.com/wiki/dynamicSimulationEnabled
https://community.bistudio.com/wiki/ EnyInfPos deleteAt floor random count EnyInfPos acts as a "selectRandom" here, but it also deletes the selected element from the array, what you're doing right now is: selecting a random position from the array(with the selectRandom), then selecting a random position again and deleting it. Also use local variables, https://community.bistudio.com/wiki/Variables#Local_Variables_Scope
Thank you, it works now
(Without local variables yet until I understand that)
EnyInfGrp = createGroup [east, true];
EnyInfGrp deleteGroupWhenEmpty true;
EnyInfGrp enableDynamicSimulation true;
EnyInfPos = [[2862.25,4756.75,0.0952458], [2860.25,4753.75,0.0952454], [2855.84,4757.14,0.0952454], [2857.07,4754.06,0.0952454]];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
{
_x disableAI "PATH";
_x setUnitPos "UP";
} foreach (units EnyInfGrp);
now you've added even more boilerplate code
π
you could use a https://community.bistudio.com/wiki/for loop
the idea here is to make maintainable code, imagine you wanted to change something for the units, you'd have to go and edit every line of createUnit
and it's always worth to sacrifice a bit of runtime for that
That seems a lot better than whatever I did before π
for "_i" from 1 to 4 do { EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"]; };
yeah but i assume you still have the forEach loop, you should store the result of createUnit to say, _unit, and run whatever you were running in the forEach
Ok thank you very much
Any ideas why this is only saving four images, even after traversing the entire unit list for the faction?
maxScreenShotFolderSizeMB = 50000; 0 = [nil,"all",[],[],["BNI_NATO_Improved"]] spawn BIS_fnc_exportEditorPreviews;```
That's not how to set the parameter.
https://community.bistudio.com/wiki/screenshot
It worked when I tried it with another faction though, which is why I'm confused. (I tried increasing the folder size but that's the only change)
That limits the FULL screenshot folder of the max size so that's why, IIRC. It should have like 1995MB or so right now for you
hey so i've downloaded this holster script and put it in my mission file is there anything else i need to do with the script?
because i still dont get any scroll wheel option
And how did you executed that?
I have one mission that uses extDB3. I want to make a extDB3 free version, what is the best option? Use profile?
it⦠depends
profileNamespace, missionNamespace for example
if you want data to stay after mission restart, profileNamespace indeed @low sierra
@winter rose thanks. It will be a big work!
so i place a gate down in editor and name it gate1. can i disable the open door -action or hide it from the player
this is different from locking the door since locking it allows the player to try the open door -action
if you make it a simple object (if the option is there)
to remove default actions from items you need to destroy them
_object setDamage [1,false];
the false statement will make it keep its shape or position.
You can also re-enable some item actions setting the damage to 0.
good evening guys, look i dont know anything about scripting so go easy. i put i field hospital down in my base, now for healing when walking through it what can i put down and this will go in the init field when you double click on a item? never done it in my life before?
something like this:
if (isServer) then {
[this] spawn {
params ["_hospital"];
while {alive _hospital} do {
{
if (_x distance _hospital < 10) then {
_x setDamage (damage _x - 0.1);
};
} forEach units west;
sleep 5;
};
};
};
Hey fellas, anyone know where the default building collapsing sound is located? Trying to use it with playSound3D
one of the building's soundBlaBlas in config 
Still kinda stumped on the building destruction sound... Config files for buidling is just "soundCrash" or "soundLandCrash" or the like... nothing playable using the script commands i tried :/
did you try these?
configFile >> "CfgSFX" >> "DestrHouse"
DestrHouse1[] = {"A3\Sounds_F\sfx\special_sfx\Building_Destroy_01",6.30957,1,150,0.1,0,0,0};
goes up to 9
in a disabledAI = 1 MP game, how can I "kick" back a player to role selection?
I think of using OnUserSelectedPlayer mission EH, but then I don't know
selectNoPlayer?
Ha just found the DestrHouse and was looking for where it was! Cheers Leo
selectNoPlayer
Does not work in multiplayer.
selectPlayer objNull then :D
I fear that deleting the player may destroy the role with it
Rough multiplayer emulation:
_noPlayer = createGroup sideLogic createUnit [
"Logic",
[0,0,1000],
[],
0,
"NONE"
];
selectPlayer _noPlayer;
hint str player; // L Charlie 4-3:1 (KK)
you don't read the wiki yourself do you?! π€£
I write, I don't read :p
I never knew the behaviour of deleteVehicle on disabledAI = 1 missions
(and never tried)
me neither 
Hello! can somebody help? I need to combine these together but i have no idea how:
_this setObjectTextureGlobal [0, "zn\A27.jpg"];
screenToWorld [0.5,0.5]
basicall i need to set texture to an object that i'm currently looking at
creating this hybrid obviously didn't work: screenToWorld [0.5,0.5] setObjectTextureGlobal [0, "zn\A27.jpg"];
cursorObject setObjectTextureGlobal [0, "zn\A27.jpg"];
@fair drum thank you but cursor might not be ideal since it can move around, is there a way to use the centre of the screen?
use your screenToWorld and nearestObject then
screenToWorld to get the position, then nearestObject to find the object closest to that position
Can you write that script for me please? I'm kinda noob in these
if in top down view looking at terrain
private _pos = screenToWorld [0.5, 0.5];
private _object = nearestObject [_pos, "insertTypeClassHere"];
_object setObjectTextureGlobal [0, "zn\A27.jpg"];
Thanks i'll give it a try in a minute, hold on please
your _pos is just passing thru the object
screenToWorld only collides with terrain
what config entry can I use to pull all classes of facewear?
cfgGlasses iirc
yup that works
idk why but my brain defaulted to like a top down view in zeus. yeah if hes running around, cursorobject should be fine or the alternative cursor getter w/e that was cursorTarget
you can hide them but then they no longer see each other
cursorTarget is kinda broken
I didn't understand what you mean. I guess you mean the ui icons in zeus?
that doesn't work at all (cursor works fine)
that's cause leo corrected me on 3d space and screenToWorld. just use the original idea with cursor object if you are going to be running around
that's right but by the time i execute the script, the mouse cursor is somewhere around the object so it doesn't work, as such it needs to be the screen to world , let's say i can and i will look on the ground right to the coordinates where the object is located so the screen to world will collide with terrain right under the object
then my thing will work then in a top down view. did you change the class for the nearObjects filter?
i did read it but i just copy and paste that since i don't really understand much of it as i mentioned earlier so i assume i'm supposed rewrite a portion of it
Then you have to remove them as editable units
which one?
"insertTypeClassHere"
you have to either leave it as a blank string to pull everything, or use a typeOf value
ok what is that type class? like what kind object is it supposed to be looking for?
it shows a config class name for a particular thing
so say if you wanted to target just a particular heli, a class name could be "B_Heli_Light_01_armed_F"
i'm texturing signs, notice boards, billboards etc. do these have a common class?
okay hold the phone. you want to change textures as you look at them? or just at mission start?
like what is your end goal with this
ok let me explain:
i'm creating a role play server and now i'm making traffic signs, the whole point of it is to give police officers an ability to spawn a sign wherever they want at any time during the game and then set a texture to the sign - in mission file i have nearly 300 pictures of various traffic signs, i already have done almost all the other scripting around it, now i'm trying to get working the phase when officer selects a picture and that particular picture appears on just spawned board, while doing this, his camera will be frozen so his screen will remain pointed the the place where the sign got spawned
if he is creating a sign with your script, then you already have the handle of the object as it is created and you can directly change the texture at that moment
_objectHandle = createVehicle [blahblahblah]
_objectHandle = setObjectTextureGlobal [blahblahblah]
well that's not a thing here, i'm using a dialog window
anyways, back to the previous question, do those signs have any common class or is it the best just to leave it empty?
by the way when empty it works fine
@fair drum
let me look for the parent class, one sec
sure, thanks
signs should use house_f iirc
here is your hierarchy
["All","Static","Building","NonStrategic","HouseBase","House","House_F"]
ok thanks, it seems like leave that spot blank is the best option, anyways thanks a lot! you really helped me, do you think i can ask you one more question?
@fair drum
fire away
if (side player == west) then {_veh = createVehicle ["Land_Noticeboard_F", screenToWorld [0.5,0.5], [], 0, "CAN_COLLIDE"]}; this script spawns the sign but the sign gets spawned always in default north-south direction, how to edit this script to make the spawned sign facing the player?
@fair drum
spawn the sign at [0,0,0], set the direction of the sign, then change its position to where you want it
well someone suggested me using a vector, is there a way to do it with vectors?
basically the sign that gets spawned should be facing the player and not the north
this is how I would do it:
if (side group player isEqualTo west) then {
private _pos = screenToWorld [0.5, 0.5]; //must target terrain
private _board = createVehicle ["Land_Noticeboard_F", [0,0,0], [], 0, "NONE"];
_board setDir (getDir player - 180);
_board setPosATL _pos;
};
arma returns error
fixed forgot the createVehicle
ah i thought it's missing there but i remained silent π
by the way i sent you a private message
now it works, the sign just faces away from the player but i assume that i can just change 180 to 360, right?
yeah you just change the value depending on what the default direction the model is
can change depending on the model so give a few tests
then to change the texture, all you do is do a line for the texture change. and do all of the selecting the texture before the creation of the billboard
if you want to still for some reason do it in two parts, you can send it to a variable and pull it from there:
player setVariable ["currentBoard", _board];
player getVariable ["currentBoard", objNull];
you helped me a lot and so far i have a complete list of working scripts for my signs, i don't see a use for these
Thank you very much once more again. It's 3:48 am here so i'll go to bed now. In the morning i'll assemble all the scripts together and hopefully it will make a working system for traffic signs π
Hi guys, wondering if there's a way to get the Eden editor to show setObjectScale changes as you're making the mission? Tried using the debug console to execute it but that didn't work
it should work
you're doing it wrong then
Are you sure?
It's working once I start the mission, but I can't get it to show the new scale while still in the editor
yes...
but to get it to work you have to assign variable names manually to the objects
I know
I sent you a DM with what I'm using
So I have the variable name of the object set to "dome1" and the script im using is dome1 setObjectScale 10.0;
that's not what I mean
When executing it in the editor debug console it doesn't do anything
Okay, how do you do that?
select the dome, then exec:
dome1 = get3DENSelected "object" select 0;
Oh that worked, thank you so much
if you just want to set the scale, just do:
(get3DENSelected "object" select 0) setObjectScale 2
something like that
And I still need to put the stuff in the init field for when i actually run the mission right?
yes
Ok thanks
Thank you so much it works :D
@little raptor Now, is there any way to give collision to the object once it's been scaled up? Coz it has to be made a simple object to do that.
It could even just be adding invisible barriers but idk how to do that
you can't just make an object super big and expect the collision to work
ya its ok i figured it out lol
If the geometry LOD is larger then the size limit, it gets glitchy (collision does not work for example and the object may disappear at certain view angles). The exact value of the limit is not yet known, but it is somewhere around 50-60 meter from the center of origin
It could even just be adding invisible barriers but idk how to do that
if it's a spherical object such as your dome you can create invisible barriers and use spherical coordinates to place them around the dome
i just did it manually with invisible walls
Hello, just a quick question. Dose someone know how to define sound files that are in an addon in my descriptoin.ext?
try \ at the start of the path
followed by addon prefix and the rest of the path
e.g. :\a3\sounds\bla.ogg
Since Arma 3 v1.50 it is possible to define AddOn sounds in mission config. In order to make engine look for the sound in AddOn, the sound path must start with @ (instead of \) for example:
according to wiki
but get it right. do i need to do it like this: \myAddon\sounds\casino\drill.ogg
no. use @ like wiki said. what I said doesn't work with cfgSounds apparently
why do you use an addon anyway?
to reduce mission file size
there's nothing wrong with large mission file size 
i tryed tihs " @myAddon\sounds\casino\drill.ogg" but it didnt work
yah but i hate to waite until 100k byts had been downloaded
is myAddon your addon prefix?
no but the prefix is the same as in my file
do you know what addon prefix is?
No the name i put in is DavidsSounds as well as in my descriptin ext so myAddon = DavidsSounds
i jsut thought its easier to understand my qestion with myAddon. sorry π
well what do you pack it with?
pbo amanger
you can set the prefix using pbo options in Addon Builder
you can delete it yeah
ahh i see
so i did it with the addon builder but it didnt work
.paa files get loaded corectly but the .oog seems to be not call able out of an addon
does the sound file even work?
did you test it in the mission folder before putting it into an addon?
did you try playSound3D?
I know was just wondering
oh π
is there a reason that in this example:
sound[] = { "@a3\Ui_F_Curator\Data\Sound\CfgSound\visionMode", 0.8, 1, 100 };
there is no file ending at the end?
there is no space in the path like this right?
" @myAddon\sounds\casino\drill.ogg"
yes
Β―_(γ)_/Β―
@little raptor this is the error in the config
14:21:00 Sound: Error: File: donzo-life\donzo_life_texturen\casino\drill.ogg
donzo-life is my addon, donzo-life_texturen is my pbo
dose the @Mod folder also need some file to declare it?
wat?
I have no idea what you mean. this is all you need
@addonprefix\path\to\file.ogg
@little raptor is addonprefix the name of the pbo? or of the @folder the pbos are in (@MyAddon\addons\thePbo?
so i got it to work. Thank you so much @little raptor for your help and support β€οΈ . I miss understood the add-on prefix part but now everything works π
hello, its me again i got a quick qestiona bout "say3D". When i remotExec it over the server is it hearable to all players or do i need to exec it over all player
LE
le quoi ? le Big Mac ?
Oh so LE = local. So i have to remote exec it to all clients?
ahh thank you both β€οΈ
oui πΌ
Are there any commands in Arma that can extend the time you can hold your breath for?
setOxygenRemaining
Sorry, should of defined what I meant, like when sniping, holding breath then, not underwater
It has no effect when soldier is not diving
then no, it's a config entry - you would need a mod
Thanks, will do it that way
When I set up custom classes to use as configuration utility to retrieve values from (i.e. in mission root a file called values.hpp), I try to use #include "values.hpp" in description.ext. But whenever I try to retrieve a value from it by using i.e.
x = getNumber (missionConfigFile >> "Numbers" >> "number1");
it always returns the default value like 0 for getNumber, an empty String for getText and an empty array for getArray.
Does anyone have an idea what I could be doing wrong? Thanks in advance π
hard to say without looking at the config
class Lifter {
class O_Heli_Transport_04_F {
hooks[] = {
{ 0, .388,-. 59 }
};
}
}
class Cargo {
class Land_Pod_Heli_Transport_04_fuel_F {
class SlingOffsets {
frontLeft[] = { -.995, 2.065, 1.35 };
frontRight[] = { .88, 2.065, 1.35 };
rearLeft[] = { -.995, -1.368, 1.35 };
rearRight[] = { .879, -1.368, 1.35 };
}
}
}
}
This is the .hpp file in a folder called config, and I have #include "config\file.hpp" in description.ext
did you exit the mission or just restart?
restart
so back to editor and after that start the mission?
or re-open the mission?
this
Although this is good to know, it doesn't solve my problem π¦
shoudn't the following work in my case?
value = getArray (missionConfigFile >> "Cfg_LogisticsSystem" >> "Lifter" >> "O_Heli_Transport_04_F" >> "hooks");
omg...
just worked
Somehow when copying the classname O_Heli_Transport_04_F and also Cfg_LogisticsSystem the underscores were replaced with spaces in the debug console. Thought it was visual π€¦ββοΈπ€¦ββοΈπ€¦ββοΈ
Thank you very much π
On a side note, -. 59 throws an Invalid number in expression error due to the excess whitespace.
right, thanks for that π
Hello! A quick question: In the trigger i have after activation this script: createDialog "znacky" but nothing happens (it's a multiplayer game) any suggestion on why it doesn't work?
if it works when used somewhere else, the trigger might be wrong
if it doesn't work when used somewhere else, the dialog is wrong
@winter rose thanks for the tip but i'm an idiot, i just realised my own mistake - i gave it a wrong class name
params ["_helirtt", "_heli"];
private _cam = "camera" camCreate [0,0,0];
_cam cameraEffect ["External", "Back", _helirtt];
_cam camSetFov 0.1;
_cam attachTo [_heli, [0,0,0], "_______", true]; //pos codriver dir?
_helirtt setPiPEffect [0];
addMissionEventHandler ["Draw3D", {
_thisArgs params ["_heli"];
private _dir = (_heli selectionPosition "_______") vectorFromTo (_heli selectionPosition "_______");
_cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]];
}, [_heli]];
Can someone help me fill in the blanks? I want this to work for a MH-60L DAP (2 Stores)
I am highly bothered that you used 8 underscores for the first gap and 7 for the others
changed π
anyone got a script or mod that allows you to import/export cargo containers like the arsenal
other than engine commands you mean?
in zeus and shit
I don't do 'shit' π¬
what about zeus
I don't do Zeus either, but that might be a composition and custom composition in Zeus are coming with v2.06
was trying to get a persistent save thing set up but they all have armaholic links so importing/exporting crates was the next best thing lol
persistence = db or profileNamespace + scripting commands
hello, its me again. I got another quick qestion. Is it possible to let the server remoteExec another script? Description: I let the server remoteExec a file (remoteExec 2) > in the file there is another remoteExec (this time remoteExec -2) that executes a say3D on an object 4 all clients. But the sound dose not apear. The first file gets called an works. The clinet one dose not. Here is it 4 refrence:
{_bohrer say3D "drill";} remoteExec ["call", -2];
[_bohrer, "drill"] remoteExec ["say3D"];
```would be the way to do it
where is _bohrer defined?
@tired delta
yes
is the say3d missing?
or how dose it work π
fixeded
if you use -2, if the server is a player (player-hosted server), he won't get it
its didicated
you are making dedicated server specific code here
yes
which is⦠not cool, but now you know
where?
[_bohrer, "drill"] remoteExec ["say3D", -2];
@winter rose but its not working π¦
could it be that its a problem that i call it over an remoteexeced file?
_bohrer is defined in the file the remoteexec is in
like this:
_bohrer = "uLife_drillrig24" createVehicle [0,0,0];
[_bohrer, "drill"] remoteExec ["say3D", -2];
the object gets set on the right possition
yeah, this works
now, how are you testing that?
before speaking I hope
yes π
I use an item that calls the this after use:
[player] remoteExec ["life_fnc_bohrer", 2];
then the file gets executed by the server and sets evrything (it works fine)
and in the file is the remote exec call
how can u write a script that test if the crew of a vehicle is alive and if not to move it out?
basically i know it is really wrong but something like this i guess. cant figure how to select the gunner of the fullcrew list
if (!alive fullcrew [_myvehicle, "gunner",false]) then (moveout ???)
use a forEach loop
do you mean for the moveout part? or do you mean for the alive part? i wasnt sure if i wrote the first part good or not...
for all of it
and how would i select the crew of each?
like this?
select player in (crew _myvehicle);
why do you put things randomly together? 
i never really used the select and from the example on the bistudio, i thought it was like that haha
wat? select is a binary command. where in wiki did you even see it used as a unary command like that?
plus you don't even pay attention to data types
i am putting the code in a vehicle that only have 1 seat, so it though it would work...
it has nothing to do with "having 1 seat". to get a scripting command to even work you must provide the right data types
to make it simpler for you to understand, think of scripting commands as math operators. like + -
array select index -> 1 + 2
that's a binary command
alive player -> - 1
unary command
player -> 1
nular command
having no arguments
like variables, numbers, etc.
unary means having 1 arg, on its right (like the math "negative" (-1))
binary means 2 args, one on left, other on right (like summation: 1 + 2)
next you have to understand data types.
you can't just randomly put things together
e.g. :1 + player doesn't work, and doesn't make sense either (and you shouldn't just guess, you should look at the wiki page for the command to know it)
1 is a SCALAR (number); player is an object
if you look at wiki there is no syntax of + that can sum a number and an object
so like this?
[fullcrew [_myvehicle, "gunner",false]] select 1
fullcrew provide the data list. and the select would the the 1st on the list?
so it is good no? i used [] on the whole full crew which is the array?
what you're doing here is:
tell the game to make an array ([]) and put fullcrew [_myvehicle, "gunner",false] in it
then you select 1
first of all, array indices start at 0
not 1
second of all, even if the index was correct (0) you'd be selecting fullcrew [_myvehicle, "gunner",false] again
but wont the fullcrew provide the list?
third of all, like I said, don't guess. read the wiki
you're putting an array into an array
ah
[[]]
ok i see thank you
[[]]
and to be clear I didn't say do that...
yes ik. that was a misconception i had that [] and () do the same thing
What would be the best way to add a delay to this script?
I have a RandomSpawn script I've made which moves clients in X groups to X random spot, that all works fine.
This script is the .init of one of our community framework module, Start_in_Parachute, which starts users on a selected side, to a pre-defined height, in an attached non steerable parachute, without interfering with backpacks.
Both work, but problem is, after the user spawns in, the module moves them to the height, attaches a parachute, then the RandomSpawn script moves them, resulting in them being in the air, without a chute, but at the correctly moved location, while my result is, in the air, with a chute, at the randomly picked location.
Looking for this script to run a second or so after map/briefing screen.
https://pastebin.com/SV0kUCPR
Ideally JIP compat.
Someone mentioned ```CBA_fnc_waitAndExecute
Hello, is there anyone familiar with arma dialog creator? I need to import the exported script but i have no idea how
yes, you can use that, see https://cbateam.github.io/CBA_A3/docs/files/common/fnc_waitAndExecute-sqf.html
can someone help me install an holster script
it should come with instructions
everytime i install one i fail to do so
theres no instructions
:/
can i send the script?
waitUntil {currentWeapon player == "" or {primaryWeapon player == "" && handgunWeapon player == ""}};```
how do i make this into an addaction for a player
following https://community.bistudio.com/wiki/addAction,
unit addAction ["action title", {
// action code
}];
β see configClasses and configProperties β
Could someone help me correct the syntax of this?? Trying to generate a list of sound files in a mod, essentially.
(("getText( _x >> 'author' ) isEqualto 'Bohemia Interactive'" configClasses (configfile >> "CfgSounds"))) call BIS_fnc_getCfgSubClasses;```
Another way I tried this below, with no success.
```sqf
("getText( _x >> 'author' ) isEqualto 'Bohemia Interactive'" configClasses (configfile >> "CfgSounds")) apply {configName _x};
i suppose it does not
name is a variable however, quite a bit different than author :p
your best bet is filtering by path of the sound file
That would actually be a really good way of doing it
but alas i am unaware of such a mechanic
all of the sounds in question that i'm after are in their own sub folder of a mod.
private _path = getArray (_x >> "sound") select 0;
you can get the path that way from what i can see in the doc
then you can use https://community.bistudio.com/wiki/select to get substring, and then use https://community.bistudio.com/wiki/in
substring is optional, though you might get unwanted collisions
like if you were to look for a3, its better to substring first few letters, and then run in, instead of running in on entire path
andd, you probably want that too: https://community.bistudio.com/wiki/toLowerANSI
going to try to piece something together from this m8, ty
I maanged to get it all working :)
Heyo, I'm looking for some help. I'm working on a mission at the minute and it requires the ability for when a specific unit with a variable name crosses out of an area the mission ends (area marked with markers on map) any advice would be handy
you can use a trigger or a loop
that would be very slow to do
you'll have to reattach the object
attaching is slow
you're better off just moving the object every frame yourself
ok then
do you want it to follow the terrain, or surface?
then just do:
_obj setVectorUp [0,0,1];
_c = _obj modelToWorldWorld [0,0,0];
_p = getPosASL _c;
_d = _p vectorDiff _c;
_obj setVariable ["landContactDiff", _d];
_obj attachTo [player, [0,0,0]];
onEachFrame {
_obj = attachedObjects player select 0;
_d1 = _obj getVariable ["landContactDiff", [0,0,0]];
_d2 = getPosATL player select 2;
_obj attachTo [player, [0,0, -_d2] vectorAdd _d1];
};
(not tested)
I've found the hardest thing of arma is finding what variables I need π
hah, try naming them
I'm good thanks π
that_thing_there
_stuff1, _lalala
Essentially there's 4 scripts I'll need to run on this mission
1: End scenario when either a specific player dies or goes into a marker (Should be easy)
2: A loot system (probably can find a premade one)
3: A random teleport thing (Basically teleports a specific unit somewhere in an area)
4: Civilians walking about and driving about (Enigma's will work for this perfectly)
Got 2 and 4 done, those were easy premade good enough for what I need. Cant figure out how to end scenario with trigger, tried a tutorial, does nothing.
as I said, for 1 use a trigger. set its type to END
to detect when someone/something dies you need a killed event handler
I did I might've broken something myself π
and for 3, depending on the type of area (circular/rectangular) you can use polar or cartesian coordinates and randomize the coordinate parameters
Got the vast majority done so I'm deserving a break now 
No
vestContainer and setObjectTexture maybe? 
no
yeah
for "bla" from
but its still local to the scope
I thought it was private 
gotta fix it then π
looks like it can be practically anything 
for "#bla"
but you can't do anything with it π€£ (unless you just don't need it)
unless you use bytecode π
though, i wonder if there is any ident sanitization happening when deserializing it
time for a quick test
maybe a missionNamespace getVariable "#bla"?
yea it works fine with bytecode
added some "proper" lexer rules 
*-/475-*/ = damage player;
systemChat str *-/475-*/;
compiled to
0x0001: <CODE> [main] '{#line 1 "C:\Users\sharp\source\repos\sqfmake\output\idk.s...' [9]
endstatement
callnular, player
callunary, damage
assignto, *-/475-*/
endstatement
getvariable, *-/475-*/
callunary, str
callunary, systemchat
endstatement
and runs fine in game π
β¬ββ¬ γ( γ-γγ)
now emoji please
Thats my big gripe with Arma's parser, doesn't support emoji variable names 
Just needs to be UTF-8
NO.

been trying to set up a laptop to lock targets from going down but idk know what im missing or if what im doing is correct
//What I did
flag_control_targets addAction ["Disable pop-up", {target_1, target_2, target_3 ["noPop", true, true]}];
// Disable the pop-up functionality by setting "noPop" to true globally
flag_control_targets addAction ["Disable pop-up", {missionNamespace setVariable ["noPop", true, true]}];
Can someone guide me what im missing
Can someone guide me what im missing
many things
noPop is a global variable
it already applies to all objects
so you don't need specifics like target1, etc
(plus that code is just wrong)
to prevent targets from going down just disable simulation for them
afaik noPop means the target won't pop up? 
yeah but I'm trying to make the laptop bring them up and down
use animations to do that
see this code. might help you out:
#arma3_scripting message
the animation you need is called "terc"
something like this on wiki?
flag_control_targets addAction ["Reset Targets", {[target_0, target_1, target_2] apply {_x animateSource ["terc", 0]}}];
how would i be able to disable the animation this way?
just change the code inside apply to:
[_x, false] remoteExec ["enableSimulationGlobal", 2]
ugh im terrible with code lol it wasn't working with the
[_x, false]
so I changed it to
{_x, false}
im still trying to see if it works
β¦don't do that
{ } is code
[ ] is array (or "list")
don't mix the two
it wasn't working
what's not working?
post the code
flag_control_targets addAction ["Reset Targets", {[target_0, target_1, target_2] apply [_x, false] remoteExec ["enableSimulationGlobal", 2]}];
gave me this error
I meant replace code inside {}
[target_0, target_1, target_2] apply {[_x, false] remoteExec ["enableSimulationGlobal", 2]}
also this doesn't "Reset Targets"
it prevents them from going down
flag_control_targets addAction ["Lock Targets", {[target_0, target_1, target_2] apply {[_x, false] remoteExec ["enableSimulationGlobal", 2]}}];
yeah
Interesting question about the RemainsCollector: Does it work on inanimate objects like sheds or boxes? How about non-destructibles?
What is the requirement to be considered a "wreck"?
Hello!
Last time - in random moment - everybody getting kicked from my server. That happens not so often, but still. Mission is getting restarted globally.
I thought - is cheater doing that again and again, but don't sure about it.
Blocked endmission and failmission in CfgRemoteExec, but that's didn't worked.
Could you help me, please?
What can be a reason of that, and is it possible to somehow track/prevent this problem?
Was trying to track it though battleye filters, but didn't worked too, or i doing something wrong :\
Thank you!
server logs may help you
try blocking remote execution of serverCommand, too
Probably not 
It probably only works on mission objects
Hello! Can someone help me with a little problem please? I've got this script that works fine:
private _pos = screenToWorld [0.5, 0.5];
private _board = createVehicle ["Land_Noticeboard_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_board setDir (getDir player - 360);
_board setPosATL _pos;
};
if (side player == west) then {createDialog "znacky"};```
The script spawns a sign and opens a dialog but every time a player executes this, a sign spawns in front of every player on the server and of course it also opens the dialog to everyone. How to edit it, so that the sign spawns only once?
To explain it a bit more: With this script the sign spawns in front of all players at the same time when only 1 player executed the script. I need the sign to be visible to everyone on the server (just like the script does) but get spawned only 1 sign in front of the player, who executed the script.
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
@bitter jewel yes
more precisely, is it an area trigger?
if so then you can change player to thisList#0
which is just the first unit the game chooses from the trigger area
No, it's radio alpha, radio beta, etc...
Any idea how to solve it?
No problem, as long as it works i'll be happy :D
if i remember correctly there is no way to get the executing player in a radio trigger
someone else may correct me if im wrong
however
you can build your own custom menu actions
or command menu actions
if you look at the example from LaKing
["First", [0], "", -5, [["expression", "player sidechat ""First"" "]], "1", "1"],
you can find that row in the second array with the commands
in between all that mess there is that "player sidechat ""first"" " -string
that code will be executed only by the calling player
now the problem is that that whole example will only work once
im going through my old script and trying to remember what the hell is it doing
it seems i found out that you can overwrite an array and arma will happily update your comm menu accordingly
yeah
you can forget the showCommandingMenu link
just do
_menu_name = "User menu";
_focus = true;
// init it
BIS_fnc_addCommMenuItem_menu = [[_menu_name, _focus]];
_rowname = "Teleport";
_exe = "call fn_menuOne";
BIS_fnc_addCommMenuItem_menu pushback (call fn_mk_menu_row);
and put your script in a function named fn_menuOne
there is a caveat in this solution
it will overwrite your comm menu
meaning if you have vanilla artillery or support modules or something else that uses the comm menu this will overwrite it
oh what am i saying
this is missing the fn_mk_menu_row
fn_mk_menu_row = {
_cmd_sep = -1;
_cmd_non = -2;
_cmd_hid = -3;
_cmd_bak = -4;
_cmd_exe = -5;
_cond_visib = "1";
_cond_active = "1";
_key_none = 0;
_submenu_none = "";
_key = (count bis_fnc_addcommmenuitem_menu) + 1;
_submenu = if (isnil "_submenu") then {_submenu_none} else {_submenu};
_visible = if (isnil "_visible") then {_cond_visib} else {_visible};
_active = if (isnil "_active") then {_cond_active} else {_active};
_rownum = _rownum + 1;
_arr = [_rowname, [_key], _submenu, _cmd_exe, [["expression", _exe]], _visible, _active];
_arr;
};
you need that function before you can run the code i posted above
if you dont want to overwrite the comms menu then you can use addaction
it is less ugly to implement
the players will then execute your script from the scroll wheel menu
so I'm trying to get vehicles pylons to be set to certain things when they respawn using the vehicle respawn module
There's some code on the wiki
private _pylons = PASTEHERE;
private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
{ _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle;
{ _vehicle setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;
I've set it to this, but i'm getting an error saying it expected an object, not an array.
Replacing _this select 1 with O_Heli_Attack_02_dynamicLoadout_F didn't work too ( unidentified variable in expression)
private _pylons = ["PylonRack_1Rnd_Missile_AA_03_F","PylonRack_1Rnd_Missile_AA_03_F","PylonRack_1Rnd_Missile_AA_03_F","PylonRack_1Rnd_Missile_AA_03_F"];
private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _this select 1 >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
{_this select 1 removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _this select 1;
{_this select 1 setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;
Any ideas on how to get this to work?
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
@torpid quartz
@cosmic lichen
getting error zero divisor
hang on let me make it _this select 0
yup that did it all goo
thanks a ton R3vo
Yw
hm, i already blocked it in CfgRemoteExec, but somehow is still restart mission :
that i find in server logs ( after player disconnect messages )
19:16:52 Game finished.
class Session
{
...
and later - list of all players on server like in mission.sqm
you don't need to do any of that, all you need to do is just make a config entry inCfgCommunicationMenu and use that with https://community.bistudio.com/wiki/BIS_fnc_addCommMenuItem
that would also fix all the locality issues
and btw this wouldn't fix the issue, then you'd end up with a board for each player, but only at the position of one player
@bitter jewel thanks for your time
Is there any major update to ARMA3 recently?
why? what does it have to do with scripting?
My script is written in life_server, but it is not possible to CALL in the client, it was possible before
it probably has nothing to do with Arma updates then
ok bro
Hi guys, i have a problem
For exemple " Objective 1 : Kill target1
trigger : when target1 is dead, activate complete objective
Objective 1 : validated
thats how it supposed to be
But when i kill target1, there is like 1 minute before the objective is validated
but in SP, its directly
the problem is only in Multiplayer
How is it set up?
what u mean
Hello, is it possible - mission restart itself - because of any script / config / mod error?
Has anyone had this problem, maybe?
Is using exitWith the correct way - if a certain condition is met - to print an error message and after that exit the whole script ? If so, please explain how to use it, I don't understand the explenation on the wiki. π
//Stuff
if (/*Condition*/) exitWith {
["Some error message"] call BIS_fnc_error;
};
//Stuff
no
I mean not necessarily
exitWith exits the current code (scope), not script
so for example just the current if?
yes:
if (bla) then {
if (blabla) exitWith {}; //only exits the above 'then'
};
This method is often used to validate the parameters passed to the script, for example in this random ACE function: https://github.com/acemod/ACE3/blob/master/addons/medical_treatment/functions/fnc_fullHealLocal.sqf (no error message in this example)
to exit the whole script, use breakOut
you must name the scope too
What I'm trying to do is print an error message and exit the whole script, if a provided parameter in a function is null.
https://community.bistudio.com/wiki/terminate might work as well
if you check that inside the main function body, exitWith will work just fine
And If not, I guess I'd have to check multiple times to exit one if after another?
/*
my_function.sqf
*/
params ["_blabla"];
if (isNil "_blabla") exitWith {};
wdym?
I.e. when using nested ifs
I still don't understand what you mean
(I mean I understand what nested ifs means, but not what you want)
I can't really remember what I meant, so I guess just forget about it D:
I'll try to get exitWith to work now, thanks for your help π
params ["_object"];
if (isNull _object) exitWith {
["Invalid object (objNull)."] call BIS_fnc_error;
};
I think what I meant was if I were to use nested If's and wanted to exit the whole script if a "deeply nested If" was false, I'd have to use exitWith multiple times, to first exit the If's and finally the script, but I guess that's not the case, is it?
you can use lazy eval or breakOut, as I said
ALT + F4 π
http://killzonekid.com/arma-scripting-tutorials-scopes/ This might also be interesting
if (_bla && {
_blabla && {
_blablabla
}
}) exitWith {
};
hi everyone! i've got a weird problem - i wanted to add some custom functions for the self interaction menu. So i've created a script and placed it in the init field of the unit that is supposed to have access to that function. In single player it works fine. On dedicated server it doesn't appear in the self interaction menu at all. However if executed in console, it gets in there. So how to make it so that those functions are available for the player on the dedicated server since he joins the game? Thank you.
myaction = ["sign_spawn","Spawn traffic sign","", {hint "Please select a sign"},{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["notice_board","Notice board","", {_handle = [] execvm "znace\notice_board.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["sign_small","Sign - small","", {_handle = [] execvm "znace\sign_small.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["sign_medium","Sign - medium","", {_handle = [] execvm "znace\sign_medium.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["sign_large","Sign - large","", {_handle = [] execvm "znace\sign_large.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["map_board","Map board","", {_handle = [] execvm "znace\map_board.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["billboard_small","Billboard - small","", {_handle = [] execvm "znace\billboard_small.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["billboard_large","Billboard - large","", {_handle = [] execvm "znace\billboard_large.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
it's a multiplayer game with multiple factions but this script should be available to NATO only
Add a side check
already did that, are you sure that initPlayerLocal.sqf will solve the issue?
yes
allright i'll see what i can do
by the way i can just paste the script as it is into that sqf with no changes, right?
got the whole script to work perfectly, thank you guys for helping me understand ππ
It should work.
thanks, i'll try it
@cosmic lichen tested it and it really works, thank you, can i ask one more question?
is it "when is arma4"?
π
hehe
Sure
@cosmic lichen this is one out of several nearly identical scripts that are supposed to spawn a sign and i would like to give that spawned sign an add action that will make the sign get deleted when necessary, so i've created this but it doesn't work:
if (side group player isEqualTo west) then {
private _pos = screenToWorld [0.5, 0.5];
private _board = createVehicle ["Land_Billboard_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_board setDir (getDir player - 360);
_board setPosATL _pos;
};
if (side player == west) then {createDialog "znacky"};
_board addAction ["Delete", { params ["_target", "_caller", "_actionId", "_arguments"]; deletevehicle _target; }];
Any idea how to fix it?
First thing. What happens if side of player's group is NOT west?
nothing, script does not get executed
i mean the sign won't spawn
and dialog won't open
but the action will be assigned to the board that does not exist
well nothing will be assigned since the board will never be there, also even the action can be under condition to appear there if the player is side west
or at least that's how i understand it
The issue is that you set board to be private inside the if statement
if (side group player isEqualTo west) then {
private _pos = screenToWorld [0.5, 0.5];
private _board = createVehicle ["Land_Billboard_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_board setDir (getDir player - 360);
_board setPosATL _pos;
createDialog "znacky";
_board addAction ["Delete", { params ["_target", "_caller", "_actionId", "_arguments"]; deletevehicle _target; }];
}; ```
ok so i assume that you've just placed it under one west side check condition but is it going to solve the problem with the delete function?
["CAManBase", "AnimChanged",{
params ["_unit", "_anim"];
if ( _anim == "AsdvPercMsprSnonWnonDf")
then {
[_unit] spawn {
while { underwater _unit && alive _unit } do {
if ( getOxygenRemaining _unit < 0.3 ) then {_unit setOxygenRemaining 1};
_unit globalChat "not drowning";
sleep 10;
};
};
};
}] call CBA_fnc_addClassEventHandler;
if i do this, is it going to spawn multiple same "spawn" on _unit everytime they enter the animation? such that i am going to have the same script running multiple times?
yes
also _unit is not defined in your spawn
does _man addEventHandler ["FiredMan",{}]; work in dedi if set for player or player's AI?
Yes, it works now
thanks, i'm just about to test it
yes it works! that's so awesome! thank you π
the wiki already explains everything about that EH
yeah but it talks about being in range of a camera for remote objects. so I'm unsure what is the case for dedi
then better not use it on dedicated server
I don't know why you would want to exec it on server anyway
Β―_(γ)_/Β―
too many codes on the server == terrible performance for everyone
probably true but I need a way to check if group is firing to enemies
just add it wherever the group is local
no other EH or script command I could use?
Hello, is there any way to get the name of a specific agent through a foreach loop?
What is the array? Contains agents?
i got every agent in the scenario and put them into an array with the agents command
name agent _x;?
tried that
hold on i think i havent tried it, it didnt throw an error this time
Ah that fixed it, thank you very much this has been giving me a migraine!
Hey, quick, I need scripting help with something
Anyone know what command I should use to have a turret fire continuously for a set amount of time?
Unmanned turret
Taking me a while to read the Biki to find the right commands, and I'm on a bit of a clock
not possible
Really? Hrm
Hmmm okay
FiredMan triggers for player in dedi...
Any way to like, create a phantom gun that can fire projectiles like a normal turret would, but only in one direction?
just fire the projectiles yourself
["CAManBase", "AnimChanged",{
params ["_unit", "_anim"];
_Adrowning =[_unit] spawn {
params ["_unit"];
while { underwater _unit && alive _unit } do {
if ( getOxygenRemaining _unit < 0.3 ) then {_unit setOxygenRemaining 1};
_unit globalChat "not drowning";
sleep 10;
};
};
if ( _anim == "AsdvPercMsprSnonWnonDf")
then { terminate _Adrowning;
call _Adrowning;
};
}] call CBA_fnc_addClassEventHandler;
so this should be better right?
no
["CAManBase", "AnimChanged",{
params ["_unit", "_anim"];
if (_anim == "AsdvPercMsprSnonWnonDf" && {scriptDone (_unit getVariable ["WaterCheckHandle", scriptNull])}) then {
_handle = [_unit] spawn {
params ["_unit"];
while { underwater _unit && alive _unit } do {
if ( getOxygenRemaining _unit < 0.3 ) then {_unit setOxygenRemaining 1};
_unit globalChat "not drowning";
sleep 10;
};
};
_unit setVariable ["WaterCheckHandle", _handle];
};
}] call CBA_fnc_addClassEventHandler;
scriptdone be praised
fixed a couple of issues
fixed again 
typing code on discord is hard 
esp with my code writing
disappears in a smoke of cloud after his moderation deed
Can we get one to prevent players stuck on the infamous "skydiving" pose when they get stuck on buildings high in the air or oven close to the ground too sometimes. I was thinking something along these lines:
if (animationState player == "afalpercmstpsnonwnondnon") then {
private _pos = [];
_pos = [getPosWorld player, 2, 10, 2, 1, 60, 0] call BIS_fnc_findSafePos;
if (_pos isNotEqualTo []) then {player setPosATL _pos;} else {
_pos = [[[position player, 10]],[]] call BIS_fnc_randomPos;
player setPos _pos;
};
};
I am running that on a 4 second loop in the player units but perhaps "AnimChanged" or other EH is a better solution...
The insidious animation is: afalpercmstpsnonwnondnon
why do you use findSafePos? 
plus I'm pretty sure it returns a 2D pos
yep:
_this select [0, 2] breakOut "main";
So we avoid a position where the player could be SetPos to a position that has an object, or inside a Rock etc etc
ofc it is
AnimStateChanged
not animChanged
if the player is stuck in the pose just make him stop
why move him?
and if you want to move him just use setVehiclePosition
it's the engine solution
If you make it stop via player switchMove "" for example, it just starts doing the animation again
just make him stick to the ground:
private _height = getPos player select 2;
if (_height > 10) exitWith {};
player switchMove "";
player setPosASL (getPosASL player vectorDiff [0,0,_height]);
I am sure you have experienced players and Ai units getting stuck on that animation too right? It happens to me on every other mission, specially using Steam Downloaded custom compositions...
try that code ^
The animation happens mostly on some poorly designed building rooftops... even some by BI
it should solve the issue
Well, wouldn't the unit just get stuck inside a building with no interior under that roof?
Β―_(γ)_/Β―
use setVehiclePosition then
Also, the animation can happen on rocks and on walls that are turned upside down or on their sides on the ground (many custom compositions do this "for the looks")
I will use that! thanks
well that's the problem
when you turn an object upside down the ROADWAY lod is no longer touching the player's feet
it's a rookie mistake
soliders need the roadway lod to walk properly
without it they'll use the GEOM lod which is too complex
and problematic
and not just soldiers
vehicles too
I wander how other games fix this? Perhaps if the unit "tries" to use a GEOM lod it just goes into ragdoll until he is on a ROADWAY lod again... that is how GTA does it I believe... rather than sticking the player on that animation!
It was funny and also kinda sad, on the last "The Splendid Squad" mission, players got stuck on that animation right at the beginning of the mission
use a GEOM lod it just goes into ragdoll until he is on a ROADWAY lod again
the roadway lod must be above the geom lod, otherwise that'll never happen
Well, if you ragdol "falling" to the sides you will eventually fall from the object you were on and land on "REAL LAND" again
Hope they completely change that in A4
It causes so many issues and weird "glitchy" situations
well another problem with compositions is that their objects are not perfectly aligned
which causes misaligned roadway lods
it happens with multipart objects too
like carriers
Exactly... well any solution that "unstucks" the players, be it engine or scripted would've been nice from BI since it can totally break the experience
well the scripted solution is simple. I might have an idea
Please do share if you find an optimal scripted way to fix this, would do wanders for my missions π
Not all can afford to have a Zeus master 24/7 to fix these issues
is there info somewhere listing and explaining the differences between all the weapon holders?
Hello, Q: I am trying to model the fire particle example.
https://community.bistudio.com/wiki/Particles_Tutorial#Fire
I want to attach it to a building and appear like it is engulfing the building.
I have the bounding box dimensions of the building, but the fire itself is emitting particles like a 'spot fire'.
I saw something on the forums a long time ago
a building never moves
why do you want to attach it?
attaching is slow
or to a position... point is I want the appearance to be the building engulfed by the licking flames. not just a spot fire.
although the effect would be the same regardless of the target object, movable or not.
this is what I have based on the example thus far... I want to widen that berth so that it appears the building itself is ablaze...
https://pasteboard.co/fSeCTZvsAlMF.png
I'll try searching in the forums itself but google didn't really yield any results
the difference is that one of them gets immediately deleted if all items are removed from the weapon holder while the other stays for I think 5 min
I think it must be a position or size component, but I'm not sure which.
For setParticleParams seems like that has to do with the particles themselves over their lifetime.
I'm not sure maybe the setParticleRandom components might influence 'where' particles are dropped, i.e. to engulf a building.
A little insight there would be helpful, thank you.
I don't know about that. but one difference I know is how objects are placed
in visiblity terms I mean
I remember seeing something on the forums about it's deletion time. Need to try and find it.
After tinkering a bit, this is starting to look good.
https://pasteboard.co/kJH3S5A4m6Pl.png
But you have to really see it animated to appreciate it.
is there a way to identify the specific player that activates a trigger? I'm using some radio calls with scripts in them to do custom helicopter supports but I'm having trouble porting the script for multiplayer use
what does thisListreturn?
I wrote my first function. It is supposed to draw a line between two markers and color it red/OPFOR, green/INDFOR, or black/Default. In the current implementation, it draws no line between any markers.
SESO_fnc_checkMarkerColor.sqf
params ["_rootMarker","_leafMarker"];
if (markerColor "_rootMarker" == "ColorEAST") then {_this select 0 drawLine [(getMarkerPos "_rootMarker"), (getMarkerPos "_leafMarker"), [1,0,0,1]];};
if (markerColor "_rootMarker" == "ColorGUER") then {_this select 0 drawLine [(getMarkerPos "_rootMarker"), (getMarkerPos "_leafMarker"), [0,1,0,1]];};
if (markerColor "_rootMarker" == "Default") then {_this select 0 drawLine [(getMarkerPos "_rootMarker"), (getMarkerPos "_leafMarker"), [0,0,0,1]];};
Here is how I call it in initPlayerLocal.sqf
initPlayerLocal.sqf
SESO_fnc_checkMarkerColor = loadFile "SESO_fnc_checkMarkerColor.sqf";
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
["marker_1","marker_2"] call SESO_fnc_checkMarkerColor;
} ];
Please roast my code. Also, please critique it.
Except for the params statement, remove all quotes around _rootMarker and _leafMarker.
Sounds good, testing it now
Tested it. There was an error that the input was a String, expected code on the line ["marker_1","marker_2"] call SESO_fnc_checkMarkerColor;
So I changed it to [marker_1,marker_2] call SESO_fnc_checkMarkerColor;
Error is no longer appearing. Though, no line appears marker 1 and marker 2
loadFile gives you a string, but call expects code. If you really want to declare your function like that, try SESO_fnc_checkMarkerColor = compile loadFile "SESO_fnc_checkMarkerColor.sqf";.
every method I've tried just returns an empty array, since it's a radio call it doesn't have an area or anything to list units from
But the best way to declare functions is this: https://community.bistudio.com/wiki/Arma_3:_Functions_Library
I don't know what is the best way to call a function. There seems to be multiple ways to do it.
Array format [variableName, defaultValue, expectedDataTypes, expectedArrayCount]:
variableName: String - name of a private variable (must begin with underscore _, e.g. "_myVar")
https://community.bistudio.com/wiki/loadFile
be aware that the file should not contain comments or compile will throw an error. If there are comments, use preprocessFile/preprocessFileLineNumbers instead.
they only meant that you need to tell arma to interpret the string that loadFile returned into code so you can call the code
Should I declare my function in description.ext to use it in initPlayerLocal.sqf?
it is fine the way you did it, just use compile preprocessFileLineNumbers
but markerColor "_rootMarker" is wrong you want markerColor _rootMarker
Sounds good. I just tried it out.
Here is the updated version:
SESO_fnc_checkMarkerColor.sqf
params ["_rootMarker","_leafMarker"];
if (markerColor _rootMarker == "ColorEAST") then {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [1,0,0,1]];};
if (markerColor _rootMarker == "ColorGUER") then {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,1,0,1]];};
if (markerColor _rootMarker == "Default") then {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,0,0,1]];};
initPlayerLocal.sqf
SESO_fnc_checkMarkerColor = preprocessFileLineNumbers "SESO_fnc_checkMarkerColor.sqf";
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
// TODO Implement checkMarkerColor as a function/macro so you could repeat it for several markers. This also gets around the issue
// of the function not working within ctrlAddEventHandler
// King's Men Root
[marker_1,marker_2] call SESO_fnc_checkMarkerColor;
} ];
Triggers are local, every machine has its own version of each trigger. If player A activates his Radio Alpha trigger, the same Radio Alpha trigger of player B is not activated (as far as I know). Additionally, the On Activation code is executed locally on whatever machine the trigger was activated on, so you should be able to obtain the player by simply using player.
compile preprocessFileLineNumber
This throws no error. Yet, it does not draw the line.
My game isn't loading, It'll let me go into Zeus, but once I try and actually play, it says it failed to load the Character, its also doing that on Multi player Servers. it also says its something to do with a Scripted Event. After I closed out of Arma, now it wont even load with Steam so. Does anyone know how to fix this issue?
Try with ["marker_1", "marker_2"] call SESO_fnc_checkMarkerColor; π
Might be best to use #arma3_troubleshooting for this
that's good to know, it does seem to work but things like pulling up the map happen on all clients and the hints I have for debugging showing the UID's etc are showing each clients local info
No reply there.
it's not related to this channel. and crossposting is against the #rules
Best not cross post then. Sometimes, you just have to wait.
I wrote the line like this:
SESO_fnc_checkMarkerColor = compile preprocessFileLineNumber "SESO_fnc_checkMarkerColor.sqf";
It throws an error "unidentified variable." I think I wrote this wrong.
That behaviour is probably caused by the code you execute upon trigger activation, but without having seen it, I can only guess.
preprocessFileLineNumbers

lider groupRadio "SentUnitPosUp"
results in lider saying "on your feet" in the radio. Can this be done so that lider says "2 - on your feet"?
I wrote it wrong π΅βπ«
My fault for not catching your mistake in my work.
Anyways, your suggestions are in. There are no more errors. There is no line drawn either.
out a two before it? 
Maybe it's a logical issue regarding the if-statement. I will put in an else clause.
it is up to you to provide the correct variable to your fnc now
i cant find "two"
but no. you can't do it the way you think using that
ok
Is there such thing as ifelse in sqf? Or do I need to do nested else statements?
no
put systemChat str marker_1 or others variable to check if everything is defined correctly
use call with exitWith
Whoa, there are cases in SQF. I can do that instead.
or do lazy eval if applicable
exitWith
lazy eval
That's two articles to read about. I'll try them all out
Thanks for the links. I didn't mean to trouble you with getting the articles, I was already reading them. 
I already had that page bookmarked 
I decided to do use exitWiths.
It looks like this now:
SESO_fnc_checkMarkerColor.sqf
params ["_rootMarker","_leafMarker"];
call {
if (markerColor _rootMarker == "ColorEAST") exitWith {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [1,0,0,1]];};
if (markerColor _rootMarker == "ColorGUER") exitWith {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,1,0,1]];};
if (true) exitWith {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,0,0,1]];};
}
The idea is it will color the lines if the marker is EAST or GUER. Otherwise, it leaves it colored black/Default.
_this select 0 resolves to the same data as your _rootMarker variable. But the left parameter of the drawLine command is not a marker name, it's a map control.
I was worried this would be the case. Maybe a function isn't the best for this. What about macros, are they a thing in SQF?
wat?
What's stopping you from passing the map control to the function? π
Macros, like the ones you use in config.cpp
now that you point it out, I don't know
if (true) exitWith
as ansin said just pass the map control to the code
if you're using the vanilla map it's already known
also drawLine needs a per frame event handler
if you want to just draw a line you can use polyline markers
That's what I'm thinking about now. Would it be any different if I had many markers? I only provided you with one line between marker_1 and marker_2. But I have markers up to 100.
First time I'm hearing about this, I'll read about it now
Read about polylines. The example did not work for my mission.
and how are you trying it?
copying and pasting into the init.sqf
Let me try ansin's suggestion before I delve into a completely different framework for this.
there's a thing called debug console 
also by "how" I meant what code
"marker_A" setMarkerShape "polyline";
private _return = [] ;
for "_i" from 0 to 100 step 0.1 do {
_return pushBack (_i + getPos player#0);
_return pushBack ((sin (_i*10))*10 + getPos player#1);
} ;
"marker_A" setMarkerPolyline _return;
This is the one provided in https://community.bistudio.com/wiki/setMarkerPolyline
have you created marker_a?
oh, for some reason I thought setMarkerShape would also make the marker 
also at init the player may not even exist yet
so it might draw the marker at the bottom left corner of the map for you
getPos
π
do you have wiki access? I presume you could change the example.


