https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onMouseButtonDown
a) "onMouseButtonDown Use on: Display, Control", createAgent doesn't create neither Display nor Control
b) "When using the event names via GUI scripting commands (e.g ctrlAddEventHandler, displayAddEventHandler), the prefix "on" in the name must be removed! (e.g. ButtonDown instead of onButtonDown)" notification in the bottom of the screen 🤷♂️
so this EH should be used either as _control ctrlAddEventHandler ["MouseButtonDown", {code}]; or as _display displayAddEventHandler ["MouseButtonDown", {code}];
#arma3_scripting
1 messages · Page 26 of 1
why does test normal work and test remoteExec not? - ive tried in singleplayer and multiplayer, there are no errors in the rpt
//this should set 0,0,0, to 10m ASL
player addaction ["test normal",{
setTerrainHeight [[[0,0,10],[1,1,10]], false];
}];
//this should set 0,0,0 to 0m ASL
player addaction ["test remotexec",{
[[[0,0,20],[1,1,20]], false] remoteExec ["setTerrainHeight",2];
}];
nevermind, I needed an extra set of square brackets around the arguments
so I have this:
hyp_artifact_light = "#lightreflector" createVehicleLocal [17656.6,13966,18];
hyp_artifact_light setLightIntensity 3000;
hyp_artifact_light setLightAmbient [1,0,0];
hyp_artifact_light setLightColor [1,0,0];
hyp_artifact_light setLightConePars [45, 10, 0.5];
hyp_artifact_light setVectorDirAndUp [[1,0,0], [0,0,0]];
but I am unable to rotate the light cone downwards to point at the ground from above. no matter what numbers I put in setVectorDirAndUp, the light cone does not move. Is this command compatible with a light cone?
Your vectorUp is invalid
oh boogers. one sec
fixed
hyp_artifact_light = "#lightreflector" createVehicleLocal [17656.6,13966,18];
hyp_artifact_light setLightIntensity 3000;
hyp_artifact_light setLightAmbient [1,0,0];
hyp_artifact_light setLightColor [1,0,0];
hyp_artifact_light setLightConePars [45, 10, 0.5];
hyp_artifact_light setVectorDirAndUp [[0,0,-1], [0,1,0]];
working now, thx
Is there any information available if the AnimateSource command to animate turrets/guns of vehicles is partially broken or just meant to work with "createVehicle" made UGVs?
so the example works as intended but if same commands are added to say editor created UGV they dont work and if the UGV in the example is replaced with some other vanilla vehicle that should be using same MainTurret/MainGun sources it does not work
those animationsources exist in the config of the UGV? i know some vehicles don't have them
yup looks like they do
Trying to launch .sqf script from mission path:
_Alpha = createGroup resistance;
_peh = "I_survivor_F" createUnit [getMarkerPos "Alpha", _Alpha, "this setVariable ["dzn_gear", "kit_HIDF_SL"]", 1, "SERGEANT"];
Have this error:
17:09:50 Error in expression <s "Alpha", _Alpha, "this setVariable ["dzn_gear", "kit_HIDF_SL"]", 1, "SERGEAN>
17:09:50 Error position: <dzn_gear", "kit_HIDF_SL"]", 1, "SERGEAN>
17:09:50 Error missing ]
anyone can help?
You have quotes inside quotes. You can alternate ' and " but the cleanest method is probably:
_Alpha = createGroup resistance;
_peh = "I_survivor_F" createUnit [getMarkerPos "Alpha", _Alpha, toString {this setVariable ["dzn_gear", "kit_HIDF_SL"]}, 1, "SERGEANT"];
@granite sky the error is gone, unit spawned. But function this setVariable ["dzn_gear", "kit_HIDF_SL"] doesn't work. (It working from unit's init ingame)
ok, thank you anyway
execute script ingame
Is it possible to use the Livonia ambient sounds on other maps? Using scripts?
no
well you can play sounds sure
but not same way as configured ambient sounds work
those are defined in the terrain config
Hello, is there any line or script to make a building undestructible but that the glass can be damage so you can shot thru it?
Thanks
If you are willing, you could create Environmental Sound "Sources" that play random sounds with scripting, using https://community.bistudio.com/wiki/createSoundSource . You would need to find the config references to specific Livonia sounds. I've done it to add Livonia wind noises when players climbed to the top of a tall composition.
Q: when you createTrigger following an OBJECT, does the position of that trigger also follow the object, i.e. if it moves for any reason? I'm not clear on that bit from the docs.
https://community.bistudio.com/wiki/createTrigger
When commands accept objects for their position argument, it's almost always just "use the position of this object". If it's going to be attached in some way, it will be specified (e.g. described as "source" or "object to attach to" rather than "position"), and usually it won't also accept a position in the same argument.
However, since triggers are objects, you can use attachTo on them if you want the trigger to be attached to something.
Interesting, so, if we want the trigger to follow the 'source object' (loosely called, given the docs, etc), then that would follow the object?
Although the docs are silent on position as well...
"Attached triggers only follow the direction of the object to which they are attached, not pitch or roll."
Direction, yes, position, does not say.
https://community.bistudio.com/wiki/attachTo#Description
Trying to figure out a couple of things. First, possibly to delete or dispose of a trigger? Using deleteVehicle? Otherwise, if I can create it once and it follows the object. Although the objects in question are not created in perpetuity, so I need to GC triggers from time to time.
Triggers that are attached to an object, using attachTo, follow its position. Otherwise there would be almost no point - that's the basic function of the attachTo command.
Since triggers are objects, they can be deleted with deleteVehicle.
In principle I would agree, however, IDK that for a fact, given BIS wiki policies i.e. if it is in there it is. not in there, does not tell me anything.
Next question, re: activation. I am trying to detect objects leaving a particular zone.
private repeating = true;
_trigger setTriggerActivation ["any", "not present", _repeating];
Any meaning how many? All sides, vehicles, etc?
Not present, self explanatory.
Repeating, how repeating?
Attached triggers only follow the direction of the object to which they are attached, not pitch or roll.
This is specifically calling out aspects of the attached trigger's directional facing, and it means that out of the 3 directional axes, the trigger only respects flat 2D rotation. It is not excluding position by omission, position is simply not part of what it's talking about in that example. That entire infobox relates only to the direction of attached objects.
Triggers follow the position of the object they're attached to. If they didn't, this would be a notable exception to the command's functionality, and would be mentioned.
The argument you have there as "any" is the same as the "Type" dropdown in the trigger's Editor attributes. "Any" means any object, without side or playability restrictions, can satisfy the condition (insofar as the trigger uses its set conditions and not a custom condition expression).
The "repeating" argument is the same as the "Repeatable" checkbox in the trigger's Editor attributes. It controls whether the trigger can activate again after it's deactivated.
how would I go about locking driver seat for player's AI teammates? for now I have a trigger checking whether any of the teammates are driver and the kicked out, but I would like to make them only take passenger seat or any free seat other than driver
When I was playing some missions with AI I noticed that somehow first AI selected will always take the driver seat if it's empty, but there were moments where they automatically go for passenger seat until I specifically told them to take that driver seat, so I'm not sure if this is some FSM I could copy or just a bug
and I need to lock driver seat for AI as it can cause dynamic simulation to break when player is a passenger, I need to somehow force the player to always take the driver seat or not take the vehicle at all
thanks for the info. not sure I was barking up the wrong tree with that, but thanks.
With
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetInMan
And getIn EHs?
Move unit to passanger if
not isPlayer and move to driver if isPlayer and driver seat is empty?
attachTo surprisingly attaches, yes
🤦♂️ I get that... with specifically one case mentioned, but the other case crickets... given the wiki policy, I loathe a default ass-umption being made there.
why would you want to attach a trigger to something?
as an area detection for a moving target maybe, but I think there is a dozen of better and easier solutions for it
ad-hoc dynamic simulation. On-vehicle mines. Whatever
you can do it with static trigger referring to an attached marker or distance tho, probs
hello everybody its me
is there a way to make only certain players be able to use an addaction or see an addaction in the first place
Yes, the Condition argument of addAction
theres a condition argument?
Or maybe only add the action on their clients 😛
oh so there is
Only if you want the detection radius to be a sphere. The benefit of a trigger (aside from Editor visibility) is being able to do rectangles and ovals
that would be the optimal route but if ((getPlayerUID player) in [//your steam id]) then { doesnt seem to add it
and yes I am testing in local hosted mp
SQLS_Beacon = {
[] spawn {
titleText["<t color='#fcca03' size='1.2'>Respawn beacon placed.</t>", "PLAIN", 0.4, true, true];
private __sqlRB_base = "Land_PortableWeatherStation_01_sand_F" createVehicle screenToWorld getMousePosition;
_sqlRB_base setDir random 360;
_sqlRB_base allowDamage false;
_sqlRB_base enableSimulationGlobal false;
_sqlRB_base = [missionNamespace, getPosATL _sqlRB_base,"Respawn Beacon"] call BIS_fnc_addRespawnPosition;
removeAllActions player;
sleep 2;
hint "Respawn Beacon is on cooldown for 5 minutes.";
sleep 10;
deleteVehicle _sqlRB_base;
hint "New Respawn Beacon is available for placement, the old one was removed.";
player addAction["<t color='#41e310'>Respawn Beacon</t>", "[]spawn SQLS_Beacon"];
};
};
player addAction["<t color='#41e310'>Respawn Beacon</t>", "[]spawn SQLS_Beacon"];
``` why does the deleteVehicle get array error when I try to run
_sqlRB_base = [missionNamespace, getPosATL _sqlRB_base,"Respawn Beacon"] call BIS_fnc_addRespawnPosition; this line
is no longer the vehicle because you overwrite it
works from debug console. Doesn't work directly from Init field of an object. Works from the code block spawned from the Init field of an object even without any sleep in it. https://community.bistudio.com/wiki/Initialization_Order mentions player becoming available at all after the Init fields are run 🤷♂️
does syncing have its counterpart in normal scripting? I mean I have few unsynced mission modules that I would like to assign to strategic map module during the scenario
and if not, how could I inject a mission to BIS_fnc_strategicMapOpen?
this isn't available inside the spawned code if you don't pass it as an argument 🤷♂️
https://community.bistudio.com/wiki/synchronizeObjectsAdd
No guarantee the map module will update mid-mission though, it might only do its thing at the beginning
if ((getPlayerUID ace_player) in [1234556789]) then {``` inside an addaction should only continue if players id is in the array, right..?
want to make sure im not going insane
array of strings
if (!hasInterface) exitWith {};
this spawn {
waitUntil {sleep 1; getPlayerUID player != ""};
if !((getPlayerUID player) in ["UIDs", "here"]) exitWith {};
_this addAction ["works?", {hint "yes"}];
};``` werks on my machine (TM)
that would be unfortunate, I really like the strategic map looks and how you can select missions, and making a 1:1 GUI to add tasks on fly is way too difficult for me
I know I can successfully remove modules from strategic map and these missions are gone from it then
I mean you can try it, I don't know whether it will work. Just something to watch out for.
and then you jury-rig some code to add the freshly synced modules to the already running strategic map. And then you decide to completely rewrite it.
if i change its var name _sqlRB_base says undefined
you what?
probably
in response to mariban
serves me right for not reading the wiki r.e whats actually returned
thought they were numbers 😭
You're saving a reference to the vehicle as _sqlRB_base. Then, a bit later, you're saving a reference to the respawn position as _sqlRB_base - and then trying to refer to _sqlRB_base as if it were a vehicle, even though it now contains the respawn position.
You need to change it so that either the vehicle or the respawn position is saved to a variable with a different name. Which one is up to you.
Remember to account for the change if the variable is used elsewhere in your code.
if !((getPlayerUID player) in ["UIDs", "here"]) exitWith {};
if it's a large array, you might want to use a hashmap
its an array of like 5 ids tops most likely
well, for me the arrangement of "make it work in console first, test in Init, fix possible issues" tends to work the best
this is working now however it seems to have broken something else which really should not break
it works! thanks
so now it doesnt seem to be updating a global variable instead however it is updating the global variable
@worthy igloo You have 2 underscores at the start of the variable when you create the vehicle. The first one is indicating that it's a local variable; the second one is being treated as part of the variable name, making it different from every other time you refer to it.
There's no need to DM me, this channel is for solving problems like this.
"updates global variable instead of updating a global variable"?
what happens in the action is determined by a global variable it updates, that bit works fine
however external reading the variable (debug console and trigger conditions) dont seem to work now
any chance to see the actual code (or reproduction)?
yes once second trying to figure out what the actual issue is atm because it seems to briefly update to true sometimes but i cannot tell with an oneachframe of the variable systemchat
aha never mind it was to do with where i had placed the check
weird funkiness that im too stupid to be able to explain but its working now :)
Hello all, I just discovered that I could do bravo2 setGroupID ["B-2"]; to set the group's callsign in the init, in this case to "B-2" instead of doing it manually.
My question is, how would I also set the group marker's color in this manner?
I'd love to show you but I can't upload an image of it, how can I?
I'm talking about the group marker (icon/text) that shows on the map
Is Example 2 not working?
https://community.bistudio.com/wiki/setGroupId
No that makes it say the word Red, not actually make the color of the marker Red
I see.
This might not be what you want or need, but I may have found a workaround.
https://community.bistudio.com/wiki/assignTeam
I appreciate the try! Sadly it has to be the group icon color that changes (map visible), not the team color (changes player name color)
Ach! I'm sorry.
Are you're playing with the High Command stuff?
No worries!
Not using High Command specifically. My goal is just to separate our player squads on the map by color. I know it's possible somehow but I sure can't find it
Have you tried https://community.bistudio.com/wiki/setMarkerColor ?
I half joke!
Got an MP issue
this addAction [
"Toggle Object",
{if Six12th_ObjStatus exitWith {
Six12th_Obj hideObjectGlobal true; Six12th_ObjStatus = false};
Six12th_Obj hideObjectGlobal false; Six12th_ObjStatus = true;}]; ``` seems to do nothing, ~~effect is however only visible upon rejoining I think...~~
works fine in SP (hides object, changes status)
Lmao I'm not sure if that'll be able to do it but I'll see if it can
I doubt also.
WTF is Six12th_ObjStatus?
Even typing it out freaks me out!
What do you need your script to do?
it is a global variable
it tells me if the object is showing or not (needed in other script where there is more than one variable, kill 2 birds with one stone)
hideObjectGlobal must be executed only on the server
ah so i presume im just remoteExec there?
No, if you think really hard the server will pick up your brainwaves and know what command you want it to do
that'll be why it wasnt working my brainwaves couldnt even power a clock
make a function, and remoteExecCall it server side
you want to keep Six12th_ObjStatus server side
else you will have different values on clients
roger i think i understand
or simply get rid of the variable and use https://community.bistudio.com/wiki/isObjectHidden
needs to flip between two objects in other actions :p
wait i can just
use one as the "variable"
jfc
thank you for the help
Are you certain that these group markers are a vanilla function? I'm doubtful. You may have a mod or script running that's generating these markers, in which case you'll need to find out how that works in order to change the colour.
Cheers.
Is there something similar to drawIcon3D but that has occlusion with objects rather than showing through them?
oof
is it possible to make a user texture prop that would always turn to face the player?
There are some dedicated user texture props in the game...somewhere, I forget what they're called ("User Texture" probably). Slap your texture on one of those, then use an EachFrame event handler, vectorFromTo, and setVectorDir to make it always face the player
how can i pass private local var from if statement for deleteVehicle
Sounds good.
are you deleting something for local to a client or the whole server? also to transfer local stuff around calling functions with params is one way to do it.
if (true) then {
private _localvar = 21;
private _localvar2 = 63;
[_localvar1,_localvar2] call TAG_fnc_MyFnc;
};
//in Tag_fnc_MyFnc
params ["_passedvar1", "_passedvar2"];
the names in params are used in that function and just represent the passed data. You can name those what you need to keep track of things
declare it in the upper scope
Expansion: variables created in an if scope are destroyed when it ends. But if it existed before the if scope, it won't be destroyed, and any changes made in the if scope will be saved.
private _localvar = someobject;
if (true) then {
deleteVehicle _localvar;
};
something like this would probably be better in your case.
123 = {
[] spawn {
if (side player == west) then
{
private _cmLight = "Chemlight_blue" createVehicle getPos _sqlRB_base;
};
if (side player == east) then
{
private _cmLight = "Chemlight_red" createVehicle getPos _sqlRB_base;
};
if (side player == resistance) then
{
private _cmLight = "Chemlight_green" createVehicle getPos _sqlRB_base;
};
deleteVehicle _cmLight;
};
};
Before the if starts, just put private _cmLight = objNull;
Then the variable is created outside the if scope and won't be destroyed when it ends
Try removing private from the definitions inside the ifs (not the one right at the start)
wrkd
alright it moves to face the player on one axis, but if the player is above or below the target how can I rotate based on the player's elevation from the target?
nvm it seems to be moving to adjust to the player, when I move close to the target it shifts up more obviously. On that note it always has an odd slant at a normal distance. not sure what its counting for though
yo bros how do i spawn a smoke grenade but not have it pop smoke? (i.e a smoke grenade with the safety pin on)
Create its model as a simple object
can this still be manipulated?
You can try playing around with the various vector direction commands to get it to do what you want. It'll be down to maths, which I hate, so good luck
To the extent that a simple object can. You can do positioning script commands on it, attach it, etc., but it won't be a physics object and can't be picked up
- by not a physics object I mean it won't fall or get bumped. It will still have collision.
If you do need it to do physics you can fake it by attaching it to an invisible tin of beans or something
so create a simple object and then attach it to the invisible object?
im trying to figure out how ace does it with their advanced throwing mode
does what?
the "preview" animation?
I'm pretty sure ACE is on GitHub so you can just look at how they do it
yes
they seem to only spawn it with createvehiclelocal and disabled simulation
_activeThrowable = _throwableType createVehicleLocal [0, 0, 0];
_activeThrowable enableSimulation false;
it still explodes for me
i disabled its sim then attached it, could the attach enable simulation back?
i notice the ACE one didnt use any attach
Yes, it inherits simulation from what it's attached to
attachto does force simulation iirc
oooof so thats why
(this causes some fun effects if you attach animated things to objects with very low simulation frequency)
then i guess ace continously sets its position to a certain point in relation to the player?
thanks, i think its really important to figure out how things are done especially by other people
will try now
it works nicely with createSimpleObject and attachTo. Thanks guys!
you might want to use the magazine model rather than the cfgammo as cfgammo generally will have the pin removed
if that's what you want anyway
thank you
Heyy, does someone has a idea how to convert magazinesAmmoCargo to a shorter format, which includes duplicates with the same amount of bullet ([_Magazine,CountOfMagazine,BulletCount]) ?
use a hashmap
Good Morning all. i'm trying to figure out why this isen't working properly.
When i first upload the mission it works fine and disables all side chat channels, but randomly on mission restarts or reloads it will fail sometimes and work sometimes.
Any ideas?
//--- Control Chat - Format: {channelID<number>, disableChat<bool>, disableVoice<bool>}
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, true, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, false}, //--- Group Chat
{4, false, false}, //--- Vehicle Chat
{5, false, false}, //--- Direct Chat
{6, true, true} //--- System Chat
};
How about replace true to 1 false to 0? A config won't take true/false
Bool is how it's documented on the wiki
But it is not how it is whatsoever, yeah I agree we need to fix the BIKI tho
#define true 1
#define false 0
I believe Description.ext has that already defined, can anyone confirm?
no
it just gets stringified
i have always used true/false in configs
you can only have arrays, strings and numbers in a config
if it's none of the above, whatever value it is it just gets stringified
In description.ext it seems to work otherwise my scripts were broken
seems to work what?
true/false
what attribute?
my own classes etc
So, is it a good/bad idea to put functions into a script file?
multiple into 1*
// into a single file, called "functions.sqf";
somefunction = {};
somefunction2 = {};
bad
ah. horray 😅
use cfgfunctions
oh riiiight
thanks :P
how do I store values between script/function calls?
_times_called=1;
ELEVATOR_RegisterShaft = {
_times_called=_times_called+1;
}
so like this. '_times_called' is only for the file it's in, but it's not reset everytime you call the function.
basically, I am used to other coding languages, so this confuses me 😅
Used to having all stuff in a single file.
Make a global variable and give it a unique name e.g.
ratchet_functionName_timesCalled = ratchet_functionName_timesCalled + 1;```
where would I define the global?
Or, well, to account for the first time when it's not defined:
ratchet_functionName_timesCalled = (missionNamespace getVariable ["ratchet_functionName_timesCalled",0]) + 1;```
The variable can contain anything, but if you want to use it as an iteration counter, a number is all you need
Yea. Hmm- if I wanted to store multiple things, would it be better to get seperate variables or an array with the stuff I need?
So say I wanted these two to be kept between calls:
ELEVATORS_Shafts = [];
last_id=1;
Would having a public variable with an array with the first position being a number for last_id, 2nd position being the shaft's array, or global variables for shafts and a seperate global for id?
also thank you btw 😅
_detTrigger setTriggerStatements [toString {call{this && (local player) && (vehicle player in thisList)}},
"
""Players have arrived at crash site and the self destruct has been started."" remoteExec [""hint"", 0];
[] spawn {
sleep 60;
private _pos = getpos (objectFromNetId '"+netID _UH60Wreck +"');
private _DestroyWreck = createvehicle [ 'ammo_Missile_Cruise_01',"+str(getPos _UH60Wreck)+",[], 0, 'can_Collide'];
sleep 0.5;
deleteMarker '"+_marker+"';
deleteVehicle objectFromNetId '"+netID _UH60Wreck +"';
deleteVehicle objectFromNetId '"+netID _fireObj +"';
deleteVehicle objectFromNetId '"+netID _Holder1 +"';
deleteVehicle objectFromNetId '"+netID _Holder2 +"';
deleteVehicle objectFromNetId '"+netID _Holder3 +"';
deleteVehicle objectFromNetId '"+netID _Holder4 +"';
deleteVehicle objectFromNetId '"+netID _Holder5 +"';
deleteVehicle objectFromNetId '"+netID _Holder6 +"';
};
",
""
];
``` does anyone know why this wouldn't delete anything except the marker
why would you delete this way e_e
won't work in singleplayer
see BIS_fnc_netId/BIS_fnc_objectFromNetId
ratchet_elevatorHandlingData_lastId = (missionNamespace getVariable ["ratchet_elevatorHandlingData_lastId",1]);
so from then on, ratchet_elevatorHandlingData_lastId = 2 and similar would set the missionNamespace varaible right?
or-
or would I need to do setVariable for the missionNamespace getVariable to return something other then 1?
ratchet_elevatorHandlingData_lastId = 2;
// same as
missionNamespace setVariable ["ratchet_elevatorHandlingData_lastId", 2];
```(given you are not in UI context)
Well see, I have a value I want to keep between function/script_file calls.
oh no wait im dumb
You were saying yes to me basically xD
Arma and SQF is confusing xD
Not sure if that's a good or bad thing tho ;P
I don't think I need it to be syncronized- atleast not yet.
I wanna mention this b/c- idk- maybe you can give me shortcuts or something xD
then just use val = 0; val = 1
and if isNil "val" then { val = 0 };
see https://community.bistudio.com/wiki/Variables for info 🙂
https://community.bistudio.com/wiki/Variables#Scopes especially
It won't network synchronise this way either unless you use the third parameter for setVariable :P
wait, reallyyy?
indeed ;-)
Oh, hang on, I misread that. Forget I mentioned it
is it ok if I write a text wall about what I am intending to do, by chance? 😅
...does SetVectorUp not work on objects made from createVehicleLocal? I can't seem to get some light refractors I made actually rotate from the script that makes them.
I got them to rotate in the console when I was debugging the initial code but now that they're in an .SQF it seems like its just ignoring the entire line no matter how I do it.
No reason it wouldn't.
Are you attaching them to anything? Keep in mind that their orientation will be reset if you use attachTo, so make sure to do your setVectors after that
I am not attaching them to anything
🦀 give code 🦀
_TLight1 = "#lightreflector" createVehicleLocal [17245.8,13335.9,7.82];
_TLight2 = "#lightreflector" createVehicleLocal [17253.1,13363.2,7.24];
_TLight3 = "#lightreflector" createVehicleLocal [17260.4,13390,6.9];
_TLight4 = "#lightreflector" createVehicleLocal [17268.4,13418.1,6.35];
_Tunnellights = [_TLight1,_TLight2,_TLight3,_TLight4];
{
_x setVectorUp [0,-1,0];
_x setLightIntensity 4000;
_x setLightAmbient [1.0, 1.0, 1.0];
_x setLightColor [1.0, 1.0, 1.0];
_x setLightAttenuation [2, 2, 2, 4, 1, 100];
_x setLightConePars [120, 45, 0.75];
} foreach _Tunnellights;```
tabs - use them
I haven't yet gotten to the cleanup yet this is still in a very rough state... but it should work
I don't see any apparent flaws in that. I assume you've tried it with different vectorUp values?
I have, nothing seems to change the light direction.
if I run that in the debug console it works fine.
but trying to run it from an .SQF just makes it ignore SetVectorUp
Weird.
If there was a problem that could be caused by that, you'd expect it to also screw up the light properties commands.
Well, I'm out of ideas. Hopefully someone else will have better insight.
So what I'm trying to do is make it so there's doors and pads. Door will teleport you to any pad it can access.
Plan right now is to have a game logic syncronized to all the doors and pads. Doors will have "door" in their vehicleVarName, and floors 'floor'
I am thinking I have an 'init' function get called by the game logic and it runs through and gets all the doors it's sync'd to and gives them an action. Action runs through the sync'd items finding all floors. Once all floors are gotten, it then gives a window and it lets you select the floor. I am thinking the floor can be sorted via 'ELEV_FLOOR_#' but for naming it uses the floor order. Basically Floor_2, Floor_4, Floor_5 would become Floor 1, Floor 2, Floor 3. Then you click on the floor you want and it teleports your character there.
is your number of doors and pads fixed & given before mission start ?
Yes, I think- unless I'm forgetting something xD
I have a similar thing running in my mission and we're using addactions. In the initPlayerLocal.sqf you add your
door1 addAction ["foor1","scripts\floor1.sqf",["foor1"],1.5,true,true,"","true",5];
door1 addAction ["foor2","scripts\floor2.sqf",["foor2"],1.5,true,true,"","true",5];
door2 addAction ["foor1","scripts\floor1.sqf",["foor1"],1.5,true,true,"","true",5];
door2 addAction ["foor3","scripts\floor3.sqf",["foor3"],1.5,true,true,"","true",5];
// add any number of lines to match all possibilities
in each floor#.sqf you put
_tele = _this select 0;
_caller = _this select 1;
_caller setPos (getpos floor#);
not sure if this is the sexiest way to do it but it should get you what you want !
O(n^2) by hand 
Oh yea, no, I thought ya meant will it change after mission start.
I want a system that requires minimal modification to if I want to make another elevator 'shaft' and/or add floors. :P
Hello, is there anyway to make a player respawn with his starting loadout? Not with the loadout that he had before he die.
How do I switch vars from sqf missionProfileNamespace to another profile ?
I was reading that you can transfer mission saves between profiles
I found it. I found it and I dont know how I found it or WHY it works like this... but this is how it works.
You have to do a _x setVectorUp [0,-1,-1];
Then follow that line with a _x setVectorUp [0,-1,0];
In order to make it actually move.
the second alone does not move the light, the first does not move the light. But the second following the first does.
¯_(ツ)_/¯
Arma things
so player setface "AsianHead_A3_04_sick"; player setHit ["Head",0.5] adds a malaria-infected head to player, how can I make the malaria rvmat to show on whole body? Are there certain uniforms that have this enabled? changing setHit to full body or just applying damage shows malaria head + normal bloodied body
google didn't help at all, most results about "sick units" or "infected units" are about toxic A3 groups 
I think there's a set of special base unit classes you have to use
I remember there was a mod that enabled these by default, as I need them for scenario purposes i'd prefer using that mod instead of making my own redundant patch, perhaps you know that mod's name?
i think i might be running into an issue-
if((vehicleVarName _x) find "DOOR" > -1)then{
_x setVariable ["ELEVATOR",ratchet_elevatorHandlingData_lastId,true];
_x addAction ["Elevator",
{
params ["_target","_caller"];
if isNull _target then {hint "Target Null";}else{
hint "Target Not Null";
};
_str=str(_caller);
diag_log "[ELEVATOR_DIAG] HINT: "+ _str;
}
];
};
addAction shows that the params are not null, but when told to send them out as a string, it's blank, just ''
I can't think of a reason why _target would ever be null. It's the object the action is attached to, if that object was null you wouldn't be able to do the action. So that check shouldn't be necessary.
_caller also shouldn't ever be null because if there is no caller, you didn't do the action
well no, it's not null.
if (isNull _target) then {};
idk what it is
diag_log "[ELEVATOR_DIAG] HINT: "+ _str; works like (diag_log "[ELEVATOR_DIAG] HINT: ")+ _str;
//code
diag_log "[ELEVATOR_DIAG] HINT: "+ _str;
diag_log ("[ELEVATOR_DIAG2] HINT: "+ _str);
//log
17:21:15 "[ELEVATOR_DIAG] HINT: "
17:21:15 "[ELEVATOR_DIAG2] HINT: B Alpha 1-1:1 (artemoz)"```
i think the easy way its just, copy and paste the vars in profile
oh- the '' wasn't an empty string, it was the end of the log 😅
ok, now, addaction. If I do "AddAction" on server, will it add actions for the players? or?
@open hollow thats what I thought, it would have been cool to have a command to access the vars from another not active profile
"LE" on its page https://community.bistudio.com/wiki/addAction means "Local Effect", so the action only gets added on the server (where no player exists :P)
wait also, would it add actions for all players
addAction is local. so you need to remoteExec the action if you are writing it for the server. Otherwise, you have to write it locally.
ok so I'd need to- uh- how would I tell it to execute on the connected clients and the newly connecting clients? 😅
do you want this action to exist at mission start? then write it in initPlayerLocal.sqf or in init.sqf with a if (hasInterface) then {} filter
if you want the server to send it out you use:
[_object, [/*action array here*/]] remoteExec ["addAction"];
The server gets objects, then it should make those objects have add action for players.
what?
_so = synchronizedObjects _logic;
diag_log "[ELEVATOR_DIAG] SO: "+str(_so);
{
diag_log "[ELEVATOR_DIAG] DOOR:"+str((vehicleVarName _x) find "DOOR");
if((vehicleVarName _x) find "DOOR" > -1)then{
_x setVariable ["ELEVATOR",ratchet_elevatorHandlingData_lastId,true];
_x addAction ["Elevator",
nvm then
I want to have addaction be done on current connected clients and any clients that connect later. But the add action isn't ready when the mission starts.
ok, then you need to to the remoteExec way but add a 3rd argument in there that allows it to exist for JIP
https://community.bistudio.com/wiki/remoteExec
take a look at the syntax
network stuff really confuses me, sorry 😅
option a: leave your code in the Logic's init, it gets executed everywhere
option b: only execute your code on the server, let it use remoteExec with the 3rd argument set, so the server makes every client execute the code
🤷♂️
ohhh ok
oh i didn't realize you were using an init box?
init box is directing it to a function file
doesn't really matter. Everybody execute Init box when mission starts for them
so ```sqf
[_x,["Elevator",
{
params ["_target","_caller"];
_str=str(_target getVariable "ELEVATOR");
diag_log ("[ELEVATOR_DIAG] HINT: "+ _str);
}
]] remoteExec ["addAction",0,true];
should be it?
_x is from a foreach loop
oh yay :P
params ["_target","_caller"];
diag_log format ["[ELEVATOR_DIAG] HINT: %1", _target getVariable "ELEVATOR"];
setVariable public , will the value be right for new connecting clients too or?
yes
https://gyazo.com/eef1880b2f59c2cbb5f7e2ed2bb50f5d Yay :D
I mean I still need to make the menu that shows up and formats the floor names, then the thing that teleports you when you select one... BUT STILL Heh :P
is there a way to get all of the objects that are attachTod a vehicle?
trying to get their positions
will this also give me the objects relative attachedTo cords perhaps?
Return Value:
Array of Objects attached to the given object
So, no
gotcha, any idea how I would go about that?
I am trying this but it keeps saying im missing a semi-colon ;
private array = [];
{
// Current result is saved in variable _x
array append [getPos _x];
} forEach (attachedObjects _this);
copyToClipboard str array;
getPosASL -> ASLtoAGL -> worldToModel
so like so?
private array = [];
{
// Current result is saved in variable _x
array append [_x worldToModel ASLToAGL getPosASL _this];
} forEach (attachedObjects _this);
copyToClipboard str array;
and any idea what the missing semi-colon is about? wont stop throwing the error
nvm, guess I fixed it by removing private
Any way to make this script range limited?
radius
https://community.bistudio.com/wiki/addAction
this addAction
[
"title", // title
{
params ["_target", "_caller", "_actionId", "_arguments"]; // script
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // shortcut
"true", // condition
50, // radius
false, // unconscious
"", // selection
"" // memoryPoint
];
So like this?
I believe so yes, those quotes may cause errors though not sure how arma handles it
I have a function that I'm trying to get it to return an array but I'm running into an issue where it says it's expecting code. Anyone know how to do this?
You haven't really given enough details to work out what you're trying to do, what the problem is, and how to solve it. A good starting point would be which function you're trying to use, and what code you're using to do it.
Those quotes will almost certainly cause errors. Just use standard ones ".
.....That looks like auto-formatted quotes. Please tell me you're not using Word or something to write code.
This would be because you can't have private global variables
It's my own function where I'm getting something like ```sqf
[1,2,3] // The returned array
```sqf
_array = [] call someFunction;
hint str _array;
Well, there doesn't appear to be anything wrong with how you're calling it, so the problem must be with something inside the function
when I do this it works but if I try and return it as an array it throws an error saying code expected ```sqf
// Inside someFunction
_someArray = [1,2,3];
{_someArray};
If your function literally only contains
_someArray = [1,2,3];
_someArray;
Then that should work. There is nothing in there that expects code, and the last return in the function is what it returns, with no requirement about what type it is.
This leads me to suspect that the function actually contains different code. From my point of view, that different code could be literally anything, so I can't troubleshoot it.
if you actually put {_someArray}; at the end of your function when you're just trying to return an array then you're doing it wrong.
maybe a misunderstanding about what {} brackets do.
I did that to turn it into code to get around the expected code error. I did it this way before _someArray;
The use of phrases such as "something like" when posting the code really makes me think that this is not the actual code, the actual code is doing something critically different, and that's what's broken
I found this issue. The array was messed up because I compiled the function incorrectly
Thanks for the help
Is there any way to reset/manipulate building doors? I got the class name of the building, but kinda lost on where to go from here. "Land_i_Barracks_V1_F"
Q: how do I clear the animation move I have a unit in?
I believe its unit switchMove "";
I second that motion, was just looking that up in the docs
okay it 'works' basically; I may need to couple that with some random waypoints or something, but the fundamentals are working
To control door opening: https://community.bistudio.com/wiki/BIS_fnc_door
To lock doors: https://forums.bohemia.net/forums/topic/146824-locking-doors/?tab=comments#comment-2347647
To find the nearest terrain building with that classname: https://community.bistudio.com/wiki/nearestObject (if it's Editor-placed no command to find it is needed, just give it a variable name)
Appreciate that thorough response
I have gone ahead and setup my mission to start with loading up in a CH-47F and performing a paradrop at a move marker some distance from main base. I've scripted it, so at the move waypoint you paradrop at, you automatically replace your backpack with a parachute upon ejecting. How would I go about setting it up so after landing you receive your backpack with all the gear in it from at the start of the mission? Any help is much appreciated.
Before you replace the backpack, save backpack _unit and backpackItems _unit as variables. Then waitUntil {isTouchingGround _unit} and use addBackpack and addItemToBackpack to give them back their stuff
or create parachute as a vehicle and move player to its driver position without changing the backpack. Or drop backpack somewhere with an action and then move it back. Or...
Creating the parachute as a vehicle only really works if you don't want the player to control when they open their chute
i would also use a timeout in the waituntil, or a velocity check, not just “istouchingground”
to handle edge cases
This would probably be a case where the z component of getPos is actually useful 🤔
or objectParent :3 After a person had a parachute parent and then has none - they're no longer hanging from it
I'd be inclined to avoid that because if they never pull their chute (maybe if they're invincible from a safety system, or if they're just an idiot and go splat) it will never trigger, which is a little untidy
apologies for the ping would you happen to know how I can insert an array in a string like this? Basically what I am trying to achieve is this
_doorString = format ["bis_disabled_Door_%1",_x];```
Hey all, quick question. When we use player object as a parameter for a remoteExec on the server (or, anytime an object is sent over the network) is it just a reference to the object we're sending or is it more than that? Basically, is it worth only sending a netID across and getting the player object from that on the server side to trim network traffic?
"ref", don't worry the game deals with it smartly
OK great! I figured as much but wanted to make sure I wasn't wasting the network traffic
Sidenote, I've been thinking about headless clients a lot lately and their impact on a server like Exile with tons of different AI mods, loot, etc. I'm curious, if we offload these systems to headless clients and rotate the headless clients in and out of the server throughout a session, could we theoretically extend the reasonable length (until server performance dips low enough to need a restart) by a substantial amount since we'd be able to handle a lot of the cleanup that requires server restarts without actually restarting the server. Basically, we'd just have headless clients that run each system join, do their work for say 1 hour, then have another queued to join, hand over ownership to the newly joined HC, and leave and restart the first one, then rinse and repeat.
Does this seem like something that sounds viable/anyone's attempted before?
Is there a way to tell that target is firing countermeasures?
ive had issues where paradropped objects get stuck in trees above ground. i figure a velocity check would weed out issues along with istouchingground for the 95% non edge cases
hey, what's the easiest up to date way of saving output of a script to a txt file?
Yes, I was referring to the objectParent method mentioned by artemoz
I cant make a UI with sqf right?
you can
A window with a few buttons?
https://community.bistudio.com/wiki/ctrlCreate has some nice examples
https://media.discordapp.net/attachments/822033292080447540/1006300084624949319/unknown.png pure SQF/no config for example 🤷♂️
Ooooo. Yay :3
Config is definitely the easier way to do it though. It doesn't have to be a mod, you can include it in mission description.ext
Where should I ask about the config ui stuff
#arma3_gui or #arma3_config probably.
It's easier than you might think, there are tools you can use to build your GUI visually and autogenerate the config
Hello, is there another way to get last five rounds of magazine to tracers than config magazine?
sane ones: no
insane one: "Fired" EH that checks for weapon/magazine class and remaining bullets, and replaces the bullet with another one
Yeah, that was what i build but I think there is no any sense do via that
hey sorry, hadnt checked the script until now, is it supposed to go into forEach? I am kinda confused ngl, is it a standalone script and if so what's doorstring?
It goes inside the forEach (hence the reference to the magic variable _x), before the setVariable. _doorString contains the final combined string, which you then plug into the setVariable
Just a info, maybe some people know it already. You can use setVariable on Backpack/Vest/Uniform , which is also getting saved when you put it inside a container and pick it up again, because the Vest for example has a object connected to the item.
Howdy folkes! Would love a hand figuring something out,
I'm currently using an event handler for BIS_fnc_respawnBackpack functionality via WeaponAssembled with a isKindOf "Camping_base_F" locking it together.
I'd like to know if its possible to share the new respawn point across a group or side? Currently the functionality works for the player who placed it or those nearby, currently using a larger map so makes reinserting a tad difficult. I'm already using some code to act as a timer to remove the tent after a set period.
Handles respawn camps functionality. Whoever "assembles" a camp from backpack it will receive a new respawn position. When backpack object has 'respawnNearbyPlayers' attribute set to 1, nearby players will receive the respawn position as well.
Is there a way to pull the appropriate respawn point from the event handler and share it across?
Thanks in advance for any help!
edit:
private _nearPlayers = [[[],[player]] select (typeOf player != "VirtualCurator_F"), playableUnits select { isPlayer _x && { _x distance _campObject < 50 } }] select isMultiplayer;
Seems to currently only detect players within 50m, ideally it would detect all players
for sqf ctrl, how do I determine what is infront and what is behind?
oh wait, that doesn't solve my issue 😅
remoteExec can work from client to Server right?
yes
Do I have to manually pass the client who's calling it?
A referance to the client.
also trying to think of how to make this secure xD
[player,<object>] remoteExec [rathcet_fnc_elevatorTeleport,2];
This needs to be made more secure I think, but would this work? Sends the player object on the client and the object the player wants to teleport to.
Again, it needs more security but still x3
oop
10:20:31 "[ELEV_TELE]: B Alpha 1-1:1 (CT-4474 Lost) _ ELEV_FLOOR_8"
yay
horray!!
i mean, like I said, horribly insecure, but eh. It's a good start I feel :D
I sure hope you use quotes around rathcet_fnc_elevatorTeleport
whats the best stringtable editor out there for arma 3, that will easily allow me to add strings to an existing table?
there's like 4 listed on the wiki
the one you like most
well dedmen's one crashes every time I try to add a key lol. let me try a different one
Any idea if _rallyPoint setVariable [BIS_fnc_respawnBackpack_users, allPlayers]; would work to simply add all players to the players array for the bag?
_rallyPoint setVariable [BIS_fnc_respawnBackpack_users, allPlayers]; // wrong?
_rallyPoint setVariable ["BIS_fnc_respawnBackpack_users", allPlayers]; // right?
I'll give it a go!
Before I do
{
default { [] };
case 1: { ( units group _campMaster ) -_campUsers };
case 2: { ( allPlayers -_campUsers ) select { [side group _x, _campSide] call BIS_fnc_areFriendly } };
//case 3: { ( allPlayers -_campUsers ) };
};
I have no idea how the system works, I just wanted to point out you were not using quotes
This suggests different mods for the tents? one of them already allowing everyone by the looks
any idea how to change the modes?
or if different tents have different modes already?
I will have a play! Cheers!
4 tents, 3 modes.. testing time...
B_Patrol_Respawn_bag_F
B_Respawn_TentDome_F
B_Respawn_Sleeping_bag_F
B_Respawn_TentA_F
Does anybody know how i can get position and title via script of the Eden Comment ? https://community.bistudio.com/wiki/Eden_Editor:_Comment
you won't get it in mission, you know that?
Is it possible at least to get the position of a comment and title in mission or nah ?
the page itself says "it only exists in the editor"
i see ty.
if you are after "creating stuff from invisible other stuff" use invisible markers
this a valid macro?
#define STRTAB(STRING) format [localize STRING, "<br/>"]
don't want to have to keep typing format [localize "mySTR", "<br/>"]
I'd say "no" because of the quote signs
oh for the argument?
looking for algorithm design ideas for efficient mortar/arty target decision making
like a threat map essentially
however needs to be efficient as checking all units/groups to determine if known&suitable can be easily quite costly with ~50-100 groups and up to 150 active targets
there is https://community.bistudio.com/wiki/targetsQuery but its knowAbout instead of beingKnowBy
similar with https://community.bistudio.com/wiki/targetKnowledge
I know that but i was thinking about createing a script witch will get all the comments position and title and then show it in zeus interface. So they could be like small hints for zeus or mission maker on this place do that and so on.
I was wondering if I could get some help with a little project, I'm using the Alive system to create some units and I wanted to know if I could get some help adding Uniform, helmet, and gun randomization to the units?
Create a array for each type you want to randomize. Then use selectRandom to get back a random entry of that array and use it to set the loadout
_this params [
["_unit",objNull,[objNull]]
];
if ((isNull _unit) || !(alive _unit)) exitWith {
["<UNIT> was passed as <NULL> or <UNIT> is not alive! Function Terminated!"] call BIS_fnc_error;
}
// Remove units weapon
removeAllWeapons _unit;
// A list of all possible weapons to give & Their ammo
_weaponList = [["arifle_Katiba_GL_ARCO_pointer_F","30Rnd_65x39_caseless_green"],["arifle_MX_GL_ACO_pointer_F","30Rnd_65x39_caseless_mag"]];
// Select a random weapon
_weaponAndAmmoSelected = (selectRandom _weaponList);
// Give Selected weapon
_unit addWeapon (_weaponAndAmmoSelected select 0);
// Add 5 Magazines to the unit
_unit addMagazines [(_weaponAndAmmoSelected select 1),5]; ```
thank you, ill try to put this to use.
Is there a trigger condition that is activated by a drone moving in it?
?
Should add magazines 1st so then unit doenst need reload weapon
Good point didn't actually test don't usually play with ai
is it possible to spawn a prop at the site of a bullet hit?
@pseudo hemlockI'm trying to create a service pad for drones
Service pad?
// Example _mytrigger setTriggerStatements ["driver vehicle player == player && (vehicle player) distance myairpad < 15 && (vehicle player iskindOf 'Air') && ((speed vehicle player) < 10)", "","
@pseudo hemlock yes
You want them to rearm and fuel?
I want it to set off a trigger so I can use it to call a function
in my testing trigger with "ANY" activation does react when UAV gets inside it. So probably thisList findIf {unitIsUAV _x} > -1 in the condition should be enough
@south swan Thanks!
trigger condition that is activated by a drone moving in it?
@south swan does (vehicle player) return the drone when you control it?
What's the correct syntax for forceWeatherChange?
it's a nular, it takes no arguments, so simply forceWeatherChange
hmm Wasn't doing anything
vehicle player will never return a drone, you cannot "drive" a drone like a normal enterable vehicle
what weather settings are you changing?
so I have an object so I therefore have it's vectorDir, vectorUp and getDir (So I know it's yaw), but I want to have the pitch and roll so I can manipulate it and then save it.
essentially I want to do the exact opposite of example one from this:
https://community.bistudio.com/wiki/setVectorDirAndUp
Server was peasoup fog and rainy and seemed stuck.
tried to change those with setFog and setRain, but it reverted back within a second.
you running ace?
neg. It's on a KP LIb server
that was initially what I was looking at but I can never get it to give me the right results
Server Execution
To prevent the engine from overwriting custom weather settings, enable the Manual Control settings in Eden Editor's intel section.
@https://community.bistudio.com/wiki/forceWeatherChange
two possible failure points: executing not on server and mission not having "Manual Control" enabled 🤷♂️
define "right", and how does what you get differ from that?
That might be it. Thank you.
or maybe get vectorDir and vectorUp to use with their combined set? :3
https://imgur.com/a/PGjOK77 (The ones sticking up are the ones this code is generating) the ones that look right are the ones I'm trying to get the data from
.. (Code before that creates the _object)
(_x is the original)
private _dir = getDir _x;
private _pitchBank = _x call BIS_fnc_getPitchBank;
private _pitch = _pitchBank select 0;
private _roll = _pitchBank select 1;
_object set3DENAttribute ["Rotation", [_pitch,_roll,_dir]];
get3DENAttribute then, if everything happens in the editor?
my imgur isn't working wait one
It's empty in this scenario
I have all the other data just not that
so I have vectorDir and vectorUp
and whatever else I want
imgur still doesn't show a thing
and does setting 3DENAttribute when the scenario is running even do anything? I'm confused
if you're trying to create an object with the same rotations in editor - you set the "Rotation" on both to the same values.
If you're trying to do that in a running mission - then setting setVectorDirAndUp is the only necessary rotation command. Example: https://cdn.discordapp.com/attachments/737175675818999898/1033124888787034182/unknown.png
Hey! For anyone who may stumble across this looking for a fix in the future!
Within an event handler for "WeaponAssembled"
if !(_rallyPoint isKindOf "Camping_base_F") exitWith {_this};
and then
_units = allPlayers;
_objectName = str _rallyPoint;
[[_rallyPoint,"createmarker",_objectName,_player],"BIS_fnc_initRespawnBackpack",_units] call bis_fnc_mp;
Cheers for the help guys! 🙂
dont use bis_fnc_mp
Tried that first but couldn't get it right! 😂
Should be a drop-in replacement, like this:
[_rallyPoint,"createmarker",_objectName,_player] remoteExec ["BIS_fnc_initRespawnBackpack",_units];
Ty 🙂
Is there a way to turn on the Decon Shower's Sprinklers using a script?
"DeconShower_01_F"; Here's the classname, I wasn't able to find anything specific about turning on the shower in the CFG
[deconheal,1.5,9] spawn bin_fnc_deconShowerAnim;
Found out how to enable it, but how can I disable it?
store the handle returned by the spawn and terminate it, maybe.
How may I store something returned by Spawn?
However you store anything else really. I don't know what the conditions you're changing state on.
setVariable on the object seems reasonable if it's separate chunks of UI.
basically when a trigger gets deactivated, then the shower stops
and the trigger is set to activate when any player is in it
Could setVariable on the trigger instead then.
If there's only one shower then either is fine.
aight ill look into it ty
is there any diag command that serves the purpose of checking broadcast size of variables?
Im doing a heavy variable transfer every once in a while that causes some heavy lag but idk how to diagnose properly, would it be better if i divide the variable value in chunks and broadcast them instead? Or is it better to do the whole value transfer and be done with it even if it means a couple of minutes of lag?
im not that network savvy sadly
Arma has to divide those into chunks anyway, because it's UDP. How efficiently it does that, I don't know.
What are you transferring that causes "a couple of minutes of lag"?
remember the very long ass array i mentioned a couple of days ago?
the operation time and the time in which a slight desync occurs when the ransfer is happening is "acceptable" but I would like to minimize that last one
its either that or to find a proper way to seed a random selector so i can transfer that parameter instead of the result :p
and since selectRandom doesnt take seeds, well, i guess its better to optimize the size
You can use the seeded random forms to do a selectRandom. Just need to be a bit careful about the top of the range.
but this sounds like you're making clients grind through nearestTerrainObjects for two minutes on connection :P
its being handled by server and clients are just using the array to do stuff
but the array is really big
I remember way back 8 or 9 years ago we needed to remove all the event handlers and variables on an object because deleteVehicle left them taking up memory. Is this still the case or has it been updated to cleanup properly?
Not sure how you'd tell. Arma is just a mass of memory leaks :P
I'd be amazed if it didn't leak something if you repeatedly created and deleted vehicles.
Fair point lol, but still I'd like to do what I can to keep it as clean as possible
I know for sure the variables and event handlers around the game's release needed to be manually removed in conjuction with deleteVehicle but I'm not sure if that's still the case
Seems like a pretty obvious fix candidate if anyone knew about it.
I've only been working with Arma for a couple of years and I haven't heard of this.
OK cool. It's likely been fixed then if it's not still being talked about. Like I said, this was wayyyy back in like 2013, 2014 so things have changed a ton since then
You can see here in the Exile Garbage Collector (from that era) that you needed to much more than just delete the vehicle
/**
* ExileServer_system_garbageCollector_deleteObject
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_object", "_fliesSound", "_fliesParticles"];
_object = _this;
if (_object getVariable ["ExileIsSimulationMonitored", false]) then
{
_object call ExileServer_system_simulationMonitor_removeVehicle;
};
_object removeAllMPEventHandlers "MPKilled";
_object removeAllEventHandlers "Dammaged";
_object removeAllEventHandlers "GetIn";
_object removeAllEventHandlers "GetOut";
removeAllActions _object;
clearBackpackCargoGlobal _object;
clearWeaponCargoGlobal _object;
clearItemCargoGlobal _object;
clearMagazineCargoGlobal _object;
removeAllContainers _object;
if !(isNull (attachedTo _object)) then
{
detach _object;
};
_fliesSound = _object getVariable ["ExileFliesSound", objNull];
if !(isNull _fliesSound) then
{
deleteVehicle _fliesSound;
};
_fliesParticles = _object getVariable ["ExileFliesParticles", objNull];
if !(isNull _fliesParticles) then
{
_fliesParticles setDamage 999;
};
{
_x call ExileServer_system_garbageCollector_deleteObject;
}
forEach (attachedObjects _object);
deleteVehicle _object;
That smells like a lot of "just being careful" though. weapons/items/magazines have no existence outside of a container.
Attached objects do persist (often left floating in mid-air). Backpacks are a bit more interesting.
agreed about the weapons/items/magazines part
but the rest was standard practice back then
can anyone confirm that a unit needs to be readded to a custom radio channel after they respawn? Cause it seems like it is the case, but it is not documented.
i don't recall such behavior
could've been misinformation I suppose, but I remember it being spread around fairly frequently
for "_i" from 0 to 1 step 0 do {
if (isNull _UH60Wreck) then {
[] spawn {
sleep 30;
[] spawn DTRP_CreateUH60Crash;
};
};
};
``` why would this cause my game to crash
What is DTRP_CreateUH60Crash?
spawns a a wreck and some stuff in a random location
Not the summary but code please
Oh well now I get it
for "_i" from 0 to 1 step 0 do {
if (isNull _UH60Wreck) then {
[] spawn {
sleep 30;
[] spawn DTRP_CreateUH60Crash;
};
};
};````step 0` here causes it
thx
Sorry to disturb guys,
is there any cheap way to make “spawn Ai” so they automatically go waypoint?
big plus if it is possible without scripts.
pre-place them with waypoint and use hide module with trigger to show them again when needed, unit hidden with module will have disabled simulation so they won't move
i found a dude who made Exelent tutorial how to achive what i was looking for.
This is the second of three videos where we use the Spawn AI modules to set multiple spawn points and then they will automatically move to take the sectors they don't own.
No scripting!
"This video was created using content of Bohemia Interactive a.s."
"Copyright © 2017 Bohemia Interactive a.s. All rights reserved."
"See www.bistudio.com for m...
i have manage to get everything to work, i can now make my dream game.
random script i found: https://github.com/Gamer-Dad/warlordsredux.altis/blob/master-altis/init.sqf#L3-L101 well that's certainly a good way of not wanting to use CfgFunctions 
inc stands for include or something, most likely it is just do nothing but to be included into some file else
Hi, if you can add setFlyingHeight to plane, is there reverse command to get flying height of vehicle?
`vs_fnc_spawnReinforcements = {
if (time < missionNamespace getVariable ["vs_supportCoolDown", 0]) exitWith {
[side player, "Base"] sideChat "Support not available";
};
vs_supportCoolDown = time + 900;
[side player, "Base"] sideChat "Reinforcements inbound";
_pos = screenToWorld [0.5, 0.5];
_spawnPos = _pos getPos [4000, random 360];
_spawnPos set [2, 300];
_dir = _spawnPos getDir _pos;
_heli = createVehicle ["gm_ge_army_ch53g", _spawnPos, [], 0, "FLY"];
_heli setDir _dir;
_heli setVelocityModelSpace [0,50,0];
_heliGrp = createVehicleCrew _heli;
_wp1 = _heliGrp addWaypoint [_pos, -1];
_wp2 = _heliGrp addWaypoint [_spawnPos, -1];
_wp1 setWaypointStatements ["true", toString {
_veh = vehicle leader this;
fullCrew [_veh, "cargo"] apply {
_unit = _x#0;
group _unit leaveVehicle _veh;
unassignVehicle _unit;
doGetOut _unit;
};
}];
_wp2 setWaypointStatements ["true", toString {_veh = vehicle leader this; deleteVehicleCrew _veh; deleteVehicle _veh;}];
_freeSeats = {!alive (_x#0)} count fullCrew [_heli, "cargo", true];
_freeSeats = _freeSeats min 3;
_group = createGroup side _heliGrp;
for "_i" from 1 to _freeSeats do {
_soldier = _group createUnit ["gm_ge_army_rifleman_g3a3_parka_80_ols", [0,0,0], [], 0, "NONE"];
_soldier moveInCargo _heli;
};
};`
Hello guys! Sorry for disturbing you but I would like to ask you how can I tell AI, after they jump off the helicopter, to join my squad. I tried to add _soldier join (group player); after _soldier moveInCargo _heli; but it didn't work. Thanks in advance for the answer!
is it possible to disable an inputAction with addUserActionEventHandler?
i want to disable the personView action.
not sure , try https://community.bistudio.com/wiki/inGameUISetEventHandler
@quartz blade join takes array so it should be: ```sqf
[_soldier] join player;
any tutorials out there how to make a Arsenal Garage for my map?
Should I put it after _soldier moveincargo _heli;?
unfortunatly it dident work but this works:
waitUntil {!isNull findDisplay 46};
(findDisplay 46) displayAddEventHandler ["keyDown",
{
if (inputAction "PersonView" > 0) then
{
true
};
}];
shouldn't matter...
by including it in the mission/mod?
https://community.bistudio.com/wiki/remoteExec and https://community.bistudio.com/wiki/Multiplayer_Scripting in general then 🤷♂️
directly - no. If you code it - yes 🤷♂️
you provide remoteExec a target - it calls the code on said target 🤷♂️
if you give single machine as a target - it would be executed only on that machine
Other number: the order will be executed on the machine where clientOwner matches the given number
https://community.bistudio.com/wiki/clientOwner
Object - The order will be executed where the given object is local
okay thank you!
@proven charm Hey sorry for disturbing you but I tried with the array and basically it makes spawn just one soldier
don't know about that, did u change anything else?
Hello, obviously it is possible to display formatted text, tooltips, over objects, taking unit labels, for instance, for example...
Q: is this... in the mod I am working on, I would like to format a similar thing, I call them tooltips, but not sure if that is the same verbiage.
I have a Zeus style 'build' mode, as I am placing objects, in true client locality, would like to display resource debits (pre-build) and/or recycle credits (post-build) that may be inspected as cursor flies over that object in the camera view.
Key is, tooltips on mouse flying over the object?
Thanks...
Nope
_freeSeat = _freeSeats min 3; should regulate the quantity of soldiers
Is this the correct stuff for C# backend? Especially the _RVExtension@12 puzzles me since there are no notes on BIKI about what's for Arma 3 and what's not. (Note: Arma 2: OA!)
namespace xxxxxxxxx
{
public static class RetrievePlayerSkill
{
[DllExport("_RVExtension@12", CallingConvention = CallingConvention.Winapi)]
public static string Retrieve(string args)
{
_RVExtension@12 is already mentioned at biki in April 2012 revision of "Extensions" page, so it's very likely to be Arma 2: OA compatible 🤔
But when checking 3 available examples of Arma extensions (and i believe they're dated in A3 era) i see 3 different versions of defining the exports 
The thing i'm most sure about (and that "most" isn't very sure) is that you can't change the arguments list of the function that's provided in the example
and according to https://community.bistudio.com/wiki/callExtension pre A3-1.67 RVExtension is the only function/endpoint/whatchamacallit that can be called by game 🤔
that signature is 32bit
does A2:OA even have 64bit binaries?
is it possible to find how zoomed in/out is player in map? I was thinking about adding markers that are visible in certain zoom "types" or make them semitransparent the more zoomed in player is
there is that BIS_fnc_isInZoom function but I have no idea what intervals are and what's the max
Pinging @copper raven too: No, A2:OA doesn't have 64-bit binaries. So I guess RVExtension is the way to go? Like this: ```csharp
namespace xxxxxxxxxxxxxxx
{
public static class RetrievePlayerSkill
{
[DllExport("RVExtension", CallingConvention = CallingConvention.Winapi)]
public static string Retrieve(string args)
{
you can't change the arguments list of the function that's provided in the example
public static void RvExtension(StringBuilder output, int outputSize,
[MarshalAs(UnmanagedType.LPStr)] string function) {``` 
Hi, is there faster way than || (OR) to check if _key is actionKeys
if (_key in (actionKeys 'ShowMap') || _key in (actionKeys 'nightVision')) then {};
Ah, forgot that 😄 Thanks!!
Any ideas? Bottom line, want to display a tooltip when the mouse hovers over an object. Asset not necessarily player or NPC unit. Thanks...
https://community.bistudio.com/wiki/curatorMouseOver + "EachFrame" mission EH + a lot of trial, error and swearing, i guess?
that's if you use curator/Zeus and its mouse operator can be used
appreciate that, yes. pretty sure there is a mouse in play, EH, etc. thanks, will check that one out.
hmm well I wonder if this is a "simple" thing I could at at a mouse event at the mouse cursor, display a tooltip at the mouse location?
question a. Which mouse cursor?
so I've got a UI in which there are class controlsBackground {} mouse event handlers. that mouse cursor. maybe more of a GUI question, I will admit, but all I want to do is display a tooltip.
🤷♂️
I know that images are being display, vehicle boxes, and so forth. I just want for one of those elements to be a tooltip as well, if possible.
if the question is "i have a custom GUI and i want to know what object happens to be below the mouse cursor", then my best guess would be https://community.bistudio.com/wiki/lineIntersectsObjs from camera position to screenToWorld/positionCameraToWorld or something. And performance would need further testing.
that's not the question, I know how to arrive at those objects. what I want to do is display a tooltip.
....make a GUI class that's just a small black rectangle with a text field, and display that when you want it?
huh that's an idea... and that can be positioned at the mouse cursor location I suppose.
Hey quick question, for sending arrays over networking using missionNameSpace, is it more efficient to have the array as a string eg: “[gang, gang2, gang4]” then parse the array when getting the data or is it more efficient to have it as a standard array eg: [gang, gang2, gang4]
So I am very unfamiliar with how setVariable would work, atleast in a situation like this, could someone help me out with that?
so I understand that I need to terminate the spawn script somehow but unsure on how to go about it, everything I tried so far didnt work out
if (count _Crew > 0) then { // If there are passengers within the vehicle (excluding crew) then continue the script
{
// if passenger
if (assignedVehicleRole _x == "cargo") then {} else { if (_x == count _Crew) then exitWith {};};
}
foreach _Crew;
};
Hey guys how would I exit a for loop?
exitWith
and the rest of the code doesn't seem right
also, this is a forEach loop
Oh okay, I assumed exitWith only exited the script, how would I make it exit the script?
exitWith
I mean within the foreach loop, because it'll only exit the foreach loop and not the script
exitWith out of the loop
at script's root level
Okay thanks
but i still don't understand how assignedVehicleRole _x == "cargo" and _x == count _Crew should work on the same _x
yep, ^ please recheck your code / activate script errors display in A3 Launcher
then {} else ugh
then exitWith UGH
i put 'then {}' because I was trying to find out how to exit the foreach loop
also, hey, nice gotos SQF has there with https://community.bistudio.com/wiki/breakTo/https://community.bistudio.com/wiki/breakOut 
we don't talk about that
although I do like the idea to break out of multiple loops, one of the rare cases where (I can't believe I say that) a goto could be justified
if (count _Crew > 0) then { // If there are passengers within the vehicle (excluding crew) then continue the script
{
if (assignedVehicleRole _x == "cargo") then exitwith{} else { if (_x == count _Crew) then exitWith {_EXIT = true;};};
}
foreach _Crew;
if (_EXIT) then {
exitWith {};
};
};
would this work?
right
Solved ✅
To stop the shower animation, you use [this] call BIN_fnc_deconShowerAnimStop;
what exactly are you trying to do… I believe you can do all this in one condition really
says it in the comment
also still then exitWith
also _EXIT is not defined in the upper scope so no
i defined it
not in the upper scope
private _EXIT = false;
yeah that
that's not present in what you posted (unless I'm blind)
sorry i only posted a section of the script
params["_Vehicle"];
// Variables
private HidePos = _Vehicle getVariable ["HidePos", []];
private _Crew = (_Vehicle getVariable "crew");
private _Driver = (driver _Vehicle);
private _EXIT = false;
// Code
if (isNil "_Driver") exitWith {}; // If there is no driver, exit the script.
if (isNil "_Crew") exitWith {}; // If there is no crew, exit the script.
if (count _Crew > 0) then { // If there are passengers within the vehicle (excluding crew) then continue the script
{
if (assignedVehicleRole _x == "cargo") then exitwith{} else { if (_x == count _Crew) then exitWith {_EXIT = true;};};
}
foreach _Crew;
};
if (_EXIT) then {
exitWith {};
};
SO
since you insist on trying my patience by showing me horrendous script until I am but forced to fix it
here it is
if (_crew findIf { assignedVehicleRole _x == "cargo" } != -1) exitWith {};
yeah well i'm clearly not experienced
i assumed it was the whole crew
O_o
_Vehicle getVariable "crew"
```is not defined by the game itself
crew myVehicle is a command call, see
https://community.bistudio.com/wiki/crew
https://community.bistudio.com/wiki/fullCrew
Is there any way to set the lighting distance of a #lightreflector object ?
@runic charm
if (fullCrew [_vehicle, "cargo", false] isNotEqualTo []) exitWith {}; // only checks for cargo, not FFV turrets though
(if you want to invert the check, use isEqualTo)
ok thank you
i just read this tutorial and it's not talking about lights lighting distance
apparently i did understand wrong the hadcoded limit. Thanks for your answer 🙂
waituntil {isnull player};```
is the best way to wait until someone leaves, right?
Trying to make player spawned vehicles delete when they leave.
I want to make a module that can be used in the editor and apparently I must create a addon for that. Is there a way to load the addon while it is still just folders and files so I don't need to create a .pbo every time i make a change?
@quaint oyster player is only valid locally, and local scripts stop running when the local player disconnected, so I don't see how that's going to do anything useful.
And in general, player objects change through respawns, so you wouldn't normally want to tie something like that to the player object.
If you want to do something on the server when players disconnect then the PlayerDisconnected mission event handler is usually the way to go.
Save the player's UID as a variable to each vehicle they create, when they create it, and use a player disconnected event handler to have the server delete all vehicles associated with that UID when they leave
Also avoid using sleepless waituntils in general.
(alternatively, add the vehicles to an array associated with the UID, and delete all vehicles in the array. This saves having to iterate over vehicles and check the variables on each one, but may have difficulty with vehicles that have already been destroyed and cleaned up by the trash collector.)
Is allUnits still suffering from the bug where it starts to work only after like 10 minutes from the mission start? I think I had this bug in 2013... 😄 (Edit: Arma 2 OA v1.64 though)
If it is, is there any workaround?
howdy folks. not to familiar with the sql scripting but is there a way to get nearby vehicles and load them via the VIV system? I have a flatbed truck that id like the driver to be able to drive up to nearby objects and load them if possible via script
I've not encountered that bug, and I cannot test it due to storage restrictions.
Does allUnits work for you now?
It isn't working, but I have also other stuff that might cause extra issues. Debugging it atm
How. 🤚
Have you checked out the following links yet?
https://community.bistudio.com/wiki/Category:Command_Group:_Vehicle_in_Vehicle_Transport
You may need https://community.bistudio.com/wiki/addAction also.
I think i glanced at the top link, but not the bottom. Will go take a look
Nice. Let me know how you get on.
I may be persuaded to make space for Arma 2 OA v1.64 for a day or two.
Would it be better to use nearSupplies or a simple check if an object is in CfgVehicles for loading? Idek if you can do a check for anything in cfgvehicles
nearEntities over nearSupplies I'd say.
probably a better option yeah. As id like it to grab vehicles or supply boxes
suppose nearestObjects could also work
Of course you can.
It's faster to use nearEntities though.
You can't load a wall or house into a vehicle... Can you? 🤔
deployable bunker mod when?
now i just need to sort out how to combine the entities search to the setVehicleCargo function
yay coding
actually. could you do a get NearEntities?
im probably not gonna want to do a forEach
Build a bunker fortress from the air...
It maaaaay be scattered over several hundred metres and look like shit, but the Army saves money by firing moooost of its engineers, whom only complain anyway.
huh. nearEntities doesnt sort by distance. good to know
No. But if sorting is important, then use nearestObjects.
You can use the same search params.
god i hate learning new programming languages sometimes
idk if im doing this right.
It doesn't have to look right, it just has to work.
Get it working then make it better and faster.
Premature optimization is the root of all evil.
- Donald Knuth, 1974
idk if its working right lol
i dont normally work with sql
Test in Arma.
Share your code and how you're using it here when you get stuck.
People will try to help you.
I have noooo idea what to do with SQL or how I would use it.
imo i wish they would have put a loadCargo script with the VIV update like they did with the unload cargo feature
I did a quick search in the All-In-One config but I didn't find a BIS function.
I may have missed it, but I doubt it.
yeah it doenst exist from what i could tell
although now im stumped. as to why this setVehicleCargo nearEntities 25; returns as missing a ; in my debug console and vehicle init when i just do a quick n dirty code
this setVehicleCargo a1; works with an object with a1 as its variable name just fine
its possible im just trying to use the array incorrectly.
I'm sure SQL has a Bible.
The BIKI is our Bible.
Look at the required params / args.
https://community.bistudio.com/wiki/nearEntities
Link command used as an example; You can search and use what command you need.
EDIT:
Post all of your code. Don't be ashamed.
It will let others see what you did wrong, and / or what you're trying to do.
_list = this nearEntities 25;
this setVehicleCargo _list;
first part is accepted and seems to clear the debug console, second part works if _list is changed to a variable name. put together it returns Error setVehicleCargo: Type Any, expected Object
hm. adding a count to _list seems to be accepted but doesnt load the nearest object
So i suppose i lied about this. there is a Load Vehicle option if your the driver of another vehicle behind a vehicle with VIV setup for it. but theres nothing for objects
okay now im very confused. nearSupply can grab empty vehicles? I got it to work, sorta. nearEntities didnt load the quad bike, but nearSupply did. Same with the darter drones
This is because setVehicleCargo requires a reference to a single object and you're trying to give it an array of objects
yeah i worked that part out. needed it to tell it to grab the first array item before loading
Arma 2: OA! What am I doing wrong now? I'm trying to create a lightweight database extension 😄 ```csharp
public static class RetrievePlayerSkill
{
[DllExport("RVExtension", CallingConvention = CallingConvention.Winapi)]
public static void RvExtension(StringBuilder output, int outputSize,
[MarshalAs(UnmanagedType.LPStr)] string args)
{
Beware of doing this without any further filtering. A lot of things can be "entities" and the return from nearEntities is not sorted by distance. You could get the object you want or you could get a random box at the very edge of the detection range on the other side of a wall.
i have it set to only look at 25m on request from the driver
right now im just trying to get the damn thing to work consistently
Yes, and a lot of unexpected things can be within 25m is my point. Let's say you park near 2 boxes; which one you get is up to luck. One of your friends is standing nearby? They are also a potential target
just headdesking as to why nearSupplies will pick up an empty quad bike but nearEntities wont. And neither of them will pick up a supply crate
just (╯°□°)╯︵ ┻━┻
confuses the hell out of me
both of those work for both, normally.
Is it not detecting the bike entirely or is it just not the first element in the array?
hang on. let me share my semi working code. its possible im missing a selection for if theres only 1 item in the array
private _distance = 25;
//search for nearest objects, entities etc.
private _list = this nearSupplies _distance;
if (count _list > 0) then {_object = _list select 0; this setVehicleCargo _object; hint "Loaded";};
this? Is this object init?
this is the vehicle yes. trigger via useraction
i can get it to fire consistently as well
oh huh
Okay, so you're just picking the first element and hoping for the best. That doesn't mean it's not picking up the bike, it just means it's picking up something else too and you're not getting lucky
this doesnt like being run via userAction
normally, youd be correct. but theres only the bike nearby
I don't know what you mean by userAction
Probably addAction
im on an empty VR map with the flatbed and the object im attempting to load
class UserActions
{
class LoadCargo
{
userActionID = 6;
displayName = "Load Object";
displayNameDefault = "Load Vehicle";
textToolTip = "Load Vehicle";
position = "pilotview";
showWindow = 0;
radius = 5;
priority = 1;
onlyForPlayer = 0;
condition = "((speed this < 5) AND (player == currentPilot vehicle player))";
statement = "0 = [this] spawn DSA_Argon_fnc_LoadNearby;";
};
};
set in the vehicle config
And that code is in DSA_Argon_fnc_loadNearby?
correct
apparently, i lied and it does not like running via that option and spits out an error about this
Then you need to use _this select 0 there.
in the script instead of private _list = this nearSupplies _distance; itd be private _list = this select 0 nearSupplies _distance;?
or in the statement
this is allowed in userActions config but not in the function
Arguments passed to the function are an array contained in special variable _this
(It's an array here because you passed an array. You don't strictly have to)
0 spawn fncName => _this = 0
[0] spawn fncName => _this = [0]
[0,1] spawn fncName => _this = [0,1]
If you use params ["_myParam"] it has a special case for _this not being an array.
and then you don't have to worry about it :P
which is the more recommend way? its gonna be used on VIV only vehicles, so its not gonna be in constant use
params is generally the recommended way.
so params ["this"];? or can whats in the "" be whatever, then id just replace this with the param name
You can put whatever as the name, but it needs to be local, so with an initial underscore.
The name you give a param is just what you want the local variable it generates to be called. (Has to be local, so underscore, don't use _this it'll conflict)
Params are created in the order the arguments are passed
params ["_box"]
private _distance = 25;
//search for nearest objects, entities etc.
private _list = this nearSupplies _distance;
if (count _list > 0) then {_object = _list select 0; this setVehicleCargo _object; hint "Loaded";};
```?
;
No
Isn't the parameter the triggering player?
and then you need to actually use it in the code :P
(it's still this everywhere)
The argument you're passing into the function, and retrieving with params, is whatever this returns in userActions, the vehicle itself I think
Variable this references object to which action is attached to.
yeah fair enough, maybe it is a box :P
lol
but i think i get it. i dont really use sql in anything i do so this is my first "internal" script if you will
most of what ive used/seen is cobbled together
And you still don't use SQL in anything, because here in Arma, we use SQF
Actually you could use SQL if you were making a database for an extension or something
well, now its not complaining about this anymore, runs the code. somewhat.
doenst load anything now
i think i got it. ended up outputing the whole _list array as a string to see what was going on. i did a dumb when i was telling it to grab the first item in my array, which was the driver lmao. so the script was going "hey hes loaded. job done"
does nearEntities return classes inherited from the values in the array? IE "Tank"?
It's isKindOf filtering, so yes.
thanks all. things worked out
make it a global variable hashmap. then you can add to it from every server file but not from clients
PreStart CfgFunctions in a mod
Is there a way to get the civilians to not be startled by every sound (shot, explosion, etc.) they go into "panic" and stop all movement, I have a script that turns the civilian side into the enemySide (opfor) and takes the target from the closest player, but when someone else shoots or an explosive detonates nearby, they stop all movement and raise their hands above their heads. Is there a command or setting to override this feature on units that switch sides?
sounds like you are using a mod... disable the mod 🙂
Well, i must test wo alive, only mod what i used (just for spawn to civilian current areas), but if those modules (Alive and bis civilian module) use some "panic" functions, is there possiblity to get variables and disable that effect?
idk, delete the module?
Seems so, is there possibly to get change to that or do i just need delete civilian and spawn opfor soldier with civilian clothes
setting their group to CARELESS does prevent them from being scared, though
I will test that out, with _unit setBehaviour "CARELESS" doens't affect at all
as in: i have here in redactor a careless civilian, an aware civilian and a red survivor joined to civilian side. Aware civilians flees-or-hides when i fire, other two don't 🤷♂️
and when i run cursorObject setBehaviour "AWARE" on a careless civilian - he gets scared as well 🤷♂️
and after cursorObject setBehaviour "CARELESS" in the debug console previously aware civilian stops getting scared
hmm
How can I have multiple entry points for callExtension in a single DLL?
(Or is it possible at all)
Is there any way to make a vehicloe not lockable by aircraft IR weapons like macer?
hi is there a way to make 2 pilots land a heli then leave the vehicle and go somwhere else
_units = units group (leader grpName); _units apply { _x leaveVehicle (assignedVehicle _x) };
I don't think so but why you need this? the function argument passed to callExtension should let you determine what to do when the extension is called
Yeah, I noticed it quite late and I'm too tired to refactor the project at this moment. The extension is almost complete, everything else is tested and working but Windows Server prevents me from writing to a custom folder despite of setting all the possible permissions for it for all users via command line and built-in UI...
isn't the rights needed for the arma.exe to be able to write files? sorry Idk , never tried windows server, just client windows
Yes, and the process runs as an user or some other entity. The permission are derived from it. That's how I think it works at least 😄
maybe you need admin rights
hmm strange
Ok, wow. Microsoft has blacklisted older .NET frameworks from being used in Visual Studio 2022, and they just fail silently without throwing any errors apparently if they're project dependencies 😄
The build fails visibly only if you're trying to build the dependency itself from source 
And the info is hidden on some random Microsoft web page. Maybe this will help someone else fighting against an overflow of weird bugs... 😄

Yup, I got it working now. Still some bugs left but they're by me this time 😄
good I use VS 2019. thx Ezcoo, good to know!
question, is there a way to do the action "DropWeapon" without it dropping Magazines? Working on sling script but when you do "DropWeapon" it also drops the magazine which is by design, I understand, just wondering if someone has found a way to just drop the weapon only?
Take a look at this. Though it is reported to have many recent bugs. It still does what you're after.
https://steamcommunity.com/sharedfiles/filedetails/?id=1317053909
Also pretty sure ACE has a sling weapon option
[[],{
profileNamespace setVariable ["VariableToBeSavedOnServer", true];
saveProfileNamespace;
}]remoteExec ['spawn',2];
if I execute this, does the server create a file with the variable in it?
No, the profile file already exists and will be also be saved when the game is closed. The command saveProfileNamespace just commits changes now instead of waiting for the ordinary save. (https://community.bistudio.com/wiki/saveProfileNamespace)
It will happen on the server though.
Anyone got a decent Idea on how to set markers visible to players of a specific side?
I tried making local markers only, but they do not update on dedicated
then I tried setting the alpha to different values locally on public markers
which also failed
so If anyone got a script or something lying around Id be very grateful
send your code
Does anyone know if we can load mods exclusively on headless clients (serverMod equivalent)? Or, maybe as a workround, load a mod as a custom client mod on the HCs, add the key to the server, then just don't distribute it anywhere?
what do you mean by do not update?
Anyone able to help me change this from an addAction to a selectable ACE interaction.
this addAction ["-BOARD SUB: -- H.M.S PROTEUS-", "[player] execVM 'zdz_frogs\System\Boarding\teleport_sub_interior.sqf'; "];
And you should do function ( https://community.bistudio.com/wiki/Arma_3:_Functions_Library ) or compile file ( https://community.bistudio.com/wiki/compileScript ) so it's better than execVM sqf
Does anyone have some Fun scripts for zeusing or somecolor scripts?
Local creation or property changing should work. I recommend trying to troubleshoot it a bit more.
If you really want a different solution, try creating them in side channel with the owner set to a unit of the desired side.
Hey guys, I have been trying to sort out an issue with the VVS (create vehicle scripts).
Its on a Lan so imy issue is with Mp
I am trying to execute the vvs scripts on my pc but in the script i am trying to moveincargo ai that is local to another pc
I have been trying this code [copilot moveInTurret [h1,[0]]] remoteExec ["call", -2];
from my pc via VVS scripts.
Works in SP but not in mp.Not dedi or one pc to another
Any help would be great
- why remoteExec call instead of remoteExecing
moveInTurretdirectly? - why target
-2? If the AI is local to the server then this will cause nothing to happen sincemoveInCargois Local Argument. Better to target the machine where the AI is definitely local.
[copilot,[h1,[0]]] remoteExec ["moveInTurret",copilot];```
Thanks
will try now
Its a bit over my head this complex stuff.
gonna try that now
it is because in this example you ran the code directly, you didn't provide it (wrapped in {})
wow. simple as that...i was close.:)
Thanks
i giveyou/Lou shout out in my mission release last time you helped me.:)
{[copilot moveInTurret [h1,[0]]] remoteExec ["call", -2]}; didnt work for host or client.:(
yes, don't do that ^^
do what NikkoJT told you 🙂
tring that now.:)
yeah i think that got it.I gotta try it on the dedi server app on my host laptop.but i reckon it will work fine.
Thank you very much guys!!
is there a list of good extensions for a3 visual studio i just switched from np++
yes! use VSCode search with "SQF", this should bring up a couple of good ones already
see https://community.bistudio.com/wiki/Category:Community_Tools#Code_Edition (this category should be renamed too)
_isArray = false;
_uid = if (typeName _parameters == "ARRAY") >
2022/10/24, 6:26:01 Error position: <= if (typeName _parameters == "ARRAY") >
2022/10/24, 6:26:01 Error Generic error in expression```
Calling code:
```sqf
_result = ["STORE", [getPlayerUID _x, _playerScoreDiff]] call WFBE_SE_FNC_CallDatabase;
``` The code itself:
```sqf
// Call to database
private ["_procedureName","_procedureCode","_parameters","_uid","_score","_response","_responseCode","_responseTotalScore","_responseTicks","_playerSkill","_responseStats","_isArray","_parametersTemp","_isArray"];
_procedureName = _this select 0;
_parameters = _this select 1;
_isArray = false;
_uid = if (typeName _parameters == "ARRAY") then {_parameters select 0; _isArray = true;} else {_parameters};
_score = if (typeName _parameters == "ARRAY") then {_parameters select 1} else {0};
_parametersTemp = "";
// We need to change the data type from 'ARRAY' to 'STRING' before sending the data to database
if (_isArray) then {
{
_parametersTemp = _uid + "," + str _parameters select 1;
} forEach _parameters;
_parameters = _parametersTemp;
};
_response = {};
_procedureCode = "";
Wat do? 
(Arma 2 OA still, I guess)
(Just noticed that "_isArray" is 2 x in private, dunno if it causes that). And yeah @winter rose 😄
you can use local _var as one uses private _var in A2OA
Hmm, I see. Thanks for the tip 🙂
+ str _parameters select 1;
+ str (_parameters select 1);
True. I usually use a lot of brackets but they were WIP this time 😄
that's why you use format
also, you can define _isArray with one typeName _parameters == "ARRAY" check and not do it a second time
True that as well
aaalso
forEach _parameters;
you overwrite your temp value as many times there are parameters, not good
Ffs, just realized that I've deleted the preceding part that contained the _parametersTemp = _parametersTemp + ... 😄
Thanks for spotting it!
It should be like this, fixed it now:
// We need to change the data type from 'ARRAY' to 'STRING' before sending the data to database
if (_isArray) then {
_parameters = _uid + "," + str (_parameters select 1);
};
I still don't know why it throws a generic error in expression like in the log file copypasta above
private ["_responseCode", "_responseTotalScore", "_responseTicks", "_playerSkill", "_responseStats"];
local _procedureName = _this select 0;
local _parameters = _this select 1;
local _isArray = typeName _parameters == "ARRAY";
local _uid = if (_isArray) then { _parameters select 0 } else { _parameters };
local _score = if (_isArray) then { _parameters select 1 } else { 0 };
// we need to change the data type from 'ARRAY' to 'STRING' before sending the data to database
if (_isArray) then
{
local _parametersTemp = "";
{
_parametersTemp = _parametersTemp + format ["%1,%2", _uid, _score];
} forEach _parameters;
_parameters = _parametersTemp;
};
// unused?
local _response = {};
local _procedureCode = "";
the if (_isArray) is stupid in that case (as the 0 score is therefore not used)
Thanks! I got it to work now, your code helped me to refactor it 🙂
would there be a way to get part of string like core\123\456.paa getting the last bit 456.paa?
@winter rose also
_fffg1 = (preprocessFile "core\123\456.paa");
``` getting that last 456 bit without retyping the path? anywhere
same answer
ok thx
im not smart enough to understand this wiki
i just want to make the last bit of it return something like
_fffg1_tt = "456.paa";
``` so I can make it a tooltip for a gui bit without having to retype any of the path anywhere else except for the original `_fffg1`
how do you get this path btw? written in a file?
mission file
this is how you use variables
private _filePath = "core\123\456.paa";
private _filename = _filePath splitString "\"; // ["core", "123", "456.paa"]
_filename = _filename select (count _filename -1); // select the last item, "456.paa"
private _fileContent = preprocessFile _filePath;
hint format ["My file at %1 is named %2", _filePath, _filename];
works exactly how i want it to thx a lot
hey, i have a trigger:
activation: any player
condition: {side _x == west && !(_x getVariable ['injured',true])} count thisList == 1
on activation:
player setPosATL (getPosATL locker1 vectorAdd [0,0,0]);
player setdir (getdir locker1);
[player, "Acts_JetsCrewaidL_idle"] remoteExec ["switchMove", 0];
player switchCamera "INTERNAL";
Now the problem is when a player fulfills the trigger condition,
every player will be teleported into that locker,
how would I teleport only the player who met the trigger condition?
option a: make it server-only and in activation code use 'remoteExec' to only send commands to the affected player
option b: leave the trigger running on all machines, but run _affectedTrigger triggerAttachVehicle [player] on it on mission start (or whenever), so the local copy of trigger only triggers on local player and only sends him to the locker
also {code} count thisList == 1 looks like it would break in case of 2 players being injured inside the trigger
anyone know if the killed event handler is bugged?
it seems to be getting triggered even if the unit's general damage is < 1
and is still alive...
I am running also a handledamage evh that caps maximum damage to 0.9...
but the incapacitated hitpoint is always taking damage regardless...
Leaving it running on all machines and changing the condition to this should also solve it nicely
(player in thisList) && {side player == west && !(player getVariable ['injured',true])}
Actually if you change it to activation BLUFOR you can skip the side check as well
ok thank you both! but if I want only one player to activate the trigger at a time, shouldn't i add this:
count thisList == 1
Just for side question to this, can you do like trigger where is condition any player, and activation to triggerAttachVehicle via that forEach player, so its not have to be all local start from mission? Would use that one on my own
wut
Let me try ask again.
If i do trigger at start, let's say middle of mission , and when some1 active (player) this trigger it will spawn local trigger for all, is this better than do them at start of mission
it changes the list of units that trigger checks for. And only does that on the machine where triggerAttachVehicle was executed.
u French?
Near, little bit more north from Finland.
approximately, "ANYONE" check is allUnits inAreaArray [trigger], "ANY PLAYER" - allPlayer inAreaArray [trigger], after_trigger triggerAttachVehicle [whatever,is,here] was executed - [whatever,is,here] inAreaArray [trigger] 🤷♂️
PERRRK dang
Thanks for this info
@little raptor Hey friend, is Intercept BattleEye verified? Or will it raise trouble with anticheat
how do I detonate an arbitrary bomb with sqf? I tried _bomb setDamage 1 but this is not exploding it
it is, but your plugins would need to be too
Why isn't https://community.bistudio.com/wiki/setParticleFire working when i try to reduce the core distance ?
Is there any math wizzards that can lend a hand understanding how vectorFromTo can be used with setVectorDirAndUp?
Doing what was suggested awhile ago to use with making a prop rotate and face the player, but it has a weird tilt based on distance from the target.
probably is because the Z components of the positions are different
_PosObj = getPosWorld _Obj;
_PosMan = getPosWorld player;
_PosObj set [2,0];
_PosMan set [2,0];
_vDir = _PosObj vectorFromTo _PosMan;
_Obj setVectorDirAndUp [_vDir, [0,0,1]];
with getPosWorld you get the position ofthe object's center in ASL format
set both _PosObj and _PosObj Z components to 0 to assure they're leveled
using [0,0,1] as vector Up should suffice
_vDir = _PosObj vectorFromTo _PosMan;
will make the object's +Y axis (vector dir) face the player
_vDir = _PosMan vectorFromTo _PosObj ;
will face in opposite direction
if you want the vector Up to be other than [0,0,1]
you'll need to use the vector cross product to get the +X axis
Thank you that does resolve the odd tilting and I understand the explanation and def have copied it to my notes.
Although is it possible to adjust the vectors to control tilt of the prop based on elevation from the other target? I assume it has to do with the z leveling as setting to 0 removes the unintentional tilting from my original script.
nvm seems like playing with the numbers with this new understanding is answering my question
Any tips on how to make a repeatable trigger have a cooldown?
//on activation
thisTrigger setVariable ["TAG_cooldown", true];
thisTrigger spawn {
sleep 30;
_this setVariable ["TAG_cooldown", false];
};
//condition
<your existing condition> && !(thisTrigger getVariable ["TAG_cooldown", false])
you can just set a variable like this and have it reset after some time with sleep
there may be an easier way with triggers but this is generally how you set up cooldowns with a variable
Where would I add a code when the progress bar is at 100%?
if i wanted for example to place a bomb.
["Hold that key!", 10, {alive player}, [], false] spawn BIS_fnc_keyHold;
probably in https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd :3
hmm, so is this just a light version of BIS_fnc_holdActionAdd?
🤷♂️
i also see this comment in BIS_fnc_keyHold code i've found in the unpacked data
Returns: True if the action was successful, false if it was interrupted.
although how is it supposed to return after being spawn-ed - i'm not very sure 🤔
call from scheduled
so, something like this, i guess sqf [] spawn { private _success = ["Hold that key!", 10, {alive player && time < 40}, [], false] call BIS_fnc_keyHold; if (_success) then {hint "KABOOM"} else {hint "NOPENOPE"}; }
On the civilian population spawner module for vanilla Arma 3. Is it possible to set the unit count through script instead???
additional notes.... ["bis_fnc_moduleinit_function","#ondeleted","#oncreated","bis_fnc_moduleexecute_activate","modulecivilianpresencesafespot_f","bis_fnc_moduleinit_iscuratorplaced","#unitcount","#useagents","bis_fnc_moduleinit_status","#usepanicmode","bis_fnc_initmodules_activate","#unitpreset","bis_fnc_initmodules_priroty","cba_xeh_isprocessed","objectarea","#area","cba_xeh_isinitialized","modulecivilianpresenceunit_f","#debug"]
yeah this is what I use: ```sqf
_m = civModGroup createUnit ["ModuleCivilianPresence_F", _pos, [], 0, "NONE"];
_m setVariable ["#area",[_pos,CIV_AREA_SIZE,CIV_AREA_SIZE,0,false,-1]];
_m setVariable ["#debug",DEBUG_CIVILIANS];
_m setVariable ["#useagents",true];
_m setVariable ["#usepanicmode",true];
_m setVariable ["#unitcount", 10 ]; // <----------- this
If i name the spawner "M" instead and then... M setVariable ["#unitcount", 10 ];
would that work?
sure
ty
np
Is there any way to visualize trigger area in-game? Im attaching a triggerfield to a plane and its hard to see which way it is pointing and what my adjustments do if the field is invisible.(when it snaps the field to attached object)
is there a tool that does the opposite of bankrev like packs a bunch of pbos not only does it one at a time
im trying to make it so at the start of my mission the player is walking towards a helo with a team and then when they get close they get in it. how would i go about doing this?
you can manually set markers that update with the trigger but beyond something like that no
zeus style maybe
drawLine3D is one option
Why does player object become null when publicVariable'd to server? (Arma 2: OA)
I get RPT spam (like expected): ```"[WFBE (WARNING)] [frameno:2.88931e+006 | ticktime:118412 | fps:114.286] Init_Client.sqf: [WEST] Client [Ezcoo] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted."
"[WFBE (WARNING)] [frameno:2.88964e+006 | ticktime:118415 | fps:101.911] Init_Client.sqf: [WEST] Client [Ezcoo] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted."
"[WFBE (WARNING)] [frameno:2.88996e+006 | ticktime:118418 | fps:96.9697] Init_Client.sqf: [WEST] Client [Ezcoo] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted."
Calling code: ```sqf
Private ["_hasConnectedAtLaunchACK","_timelaps"];
_timelaps = 0;
WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH = player;
publicVariableServer "WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH";
while {true} do {
sleep 0.1;
_hasConnectedAtLaunchACK = missionNamespace getVariable 'WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK';
if !(isNil '_hasConnectedAtLaunchACK') exitWith {["INITIALIZATION", Format["Init_Client.sqf: [%1] Client [%2], Can join? [%3]",sideJoined,name player,_hasConnectedAtLaunchACK]] Call WFBE_CO_FNC_LogContent};
_timelaps = _timelaps + 0.1;
if (_timelaps > 3) then {
_timelaps = 0;
["WARNING", Format["Init_Client.sqf: [%1] Client [%2] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted.",sideJoined,name player]] Call WFBE_CO_FNC_LogContent;
WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH = player;
publicVariableServer "WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH";
};
};
Server PVEH: ```sqf
"WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH" addPublicVariableEventHandler {
private ["_uid","_player"];
_player = _this;
_uid = getPlayedUID _player;
diag_log format ["(Supposed) UID: %1", _uid];
if (!(isNil "_uid")) then {
missionNamespace setVariable [format ["WFBE_PLAYER_%1_CONNECTED_AT_LAUNCH", _uid], true];
WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK = true;
(owner _player) publicVariableClient "WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK";
};
};
Server RPT:
diag_log format ["(Supposed) U>
2022/10/25, 21:38:35 Error Missing ;
??
Example at pveh page suggests that it gets ["_varname", "_newvalue"] array as its input
And not just a new value as your code seems to expect?
On which page? Trying to find it atm. https://community.bistudio.com/wiki/addPublicVariableEventHandler only lists varName addPublicVariableEventHandler code compatible with Arma 2: OA
See Example 1 there?
SQLS_AddAction = {
if !(isNil {SQLS_action}) then {
player removeAction SQLS_action;
SQLS_action = nil;
};
_condition = "(time >= SQLS_PlacementCooldown_Time) && (leader (group player) == player)";
SQLS_action = player addAction
["<t color='#41e310'>Respawn Beacon</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
[] spawn (SQLS_PublicArray#1);
}, nil,1.5,true,true,"",_condition,0,false,"",""];
};
``` how do I only give the addAction to the player no on the player lol
True! Missed it completely 
The error didn't change though: ```2022/10/25, 22:30:06 Error in expression <r = _this select 1;
_uid = getPlayedUID _player;
diag_log format ["(Supposed) U>
2022/10/25, 22:30:06 Error position: <_player;
diag_log format ["(Supposed) U>
2022/10/25, 22:30:06 Error Missing ;
Code: ```sqf
"WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH" addPublicVariableEventHandler {
private ["_uid","_player"];
_player = _this select 1;
_uid = getPlayedUID _player;
diag_log format ["(Supposed) UID: %1", _uid];
some code above that is wrongly formatted most likely
This is the beginning of the file, hmm
Here's the whole SQF file:
"WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH" addPublicVariableEventHandler {
private ["_uid","_player"];
_player = _this select 1;
_uid = getPlayedUID _player;
diag_log format ["(Supposed) UID: %1", _uid];
if (!(isNil "_uid")) then {
missionNamespace setVariable [format ["WFBE_PLAYER_%1_CONNECTED_AT_LAUNCH", _uid], true];
WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK = true;
(owner _player) publicVariableClient "WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK";
};
};
getPlayedUID
lol yeah
... lol
Goes quietly back to corner
I also learned the hard way that format doesn't throw an error if you mistype e.g. %1 as % only 😅
Anyone else experienced problems loading loading units into named roles in the V-44X Blackfish infantry variant? Specifically, I am trying to load units into "cargo" role positions, but the unit is being loaded into an aft seated "turret" position instead. By contrast, the CH-67 Huron and all 14 of its "cargo" role positions load correctly, and can subsequently be unloaded. ALL FOURTEEN OF THEM! Probably a bug, just thought I should mention; not going to worry about it at this point, but might be worth looking into.
For most vanilla vehicles I was testing, as long as they have a "cargo" position, can be loaded properly. Just the Blackfish was the black sheep, had some problems doing that.
Is it possible to create a variable dynamically?
hmm, actually I think yes at least via executing a string as a script
What do you mean by "dynamically"?
NikkoJT like publicVariable "P_UserName1"; P_UserName=p1;
Like this example
TAG_BossName = "EvilBigBoss";
publicVariable TAG_BossName; // wrong - will try to publicVariable "EvilBigBoss" variable, that does not exist
publicVariable "TAG_BossName"; // correct - important, do not forget the QUOTES
But I actually do want EvilBigBoss to be the publicVariable instead of TAG_BossName
What do you want the variable EvilBigBoss to contain?
of course. does not matter what the variable was or its name or how you formatted it. just needs to be a valid variable name.
@dreamy kestrel that's the point, I assume based on the example that that errors since I haven't initialised such a variable anywhere
But I want to dynamically create a variablename
well, the variable should 'exist' first; before you can make it public.
should, or must?
EvilBigBoss = ""; // Create a variable containing an empty string
publicVariable "EvilBigBoss"; // Make it public!```
your logs will tell you how you did.
@hallow mortar no. I want to create the variable name dynamically
Ie in this case I want to create variables that have the names of each player
the variable name is just a name... missionNamespace setVariable [_myDynamicVariableName, ...]; publicVariable _myDynamicVariableName;
⏬
_varString = format ["emil_var_%1",name _unit];
missionNamespace setVariable [_varString,"your data here",true];```
⏫
I think he wants to create the variable name as something which is dependent on the result of a previous command
like that
whether you have something on the other end of that equation to do something with that variable is another question.
@dreamy kestrel @hallow mortar thanks, that's exactly it
it's just a name, format it, set the variable in the appropriate namespace, probably missionNamespace, and make it public; no big deal.
It's "no big deal" for us, but they didn't know where to start on doing that, and a clear explanation of the basic method was needed
Tip: you can also use getVariable to assume a default value if the variable isn't defined yet
anyway i have a question of my own -- is there any way to create an overlay of a unit/object that is visible through walls? trying to search anything as such only returns things like glasses overlays and such
fair enough; opens the door to some interesting use cases.
in the interest of not knowing what we do not know... HTH 🍻
Thank you. I do agree that this is a stupid way to do things but I have grown accustomed to using the admin console to fix issues during gameplay