#arma3_scripting
1 messages · Page 180 of 1
Saved to files. Hopefully I remember Ive got this note. Thats really good explained brother. Thank you
BUT if Im checking with !isNull Im checking for: Is there something with not the value "0" or "null" or "nothing".
So in other words: Is there something existing with the var hinterhalt_sascha_tgr. Right?
If my knowledge is correct so far I can be sure that the trigger
got created and something about the activation or area code is wrong
I don't have game running to test it, but isNull likely expects defined variables
Dont I define it in here with the " = " letter?
hinterhalt_sascha_tgr = createTrigger ["EmptyDetector", [18471.7,14284.1,0], true];
Or is "defining" something diffrent again?
So those first three lines work without error?
Ok, so it must be defined otherwise setTriggerArea and setTriggerActivation would complain
There are more ways to define then just do _localVar = definedNow?
Look what Ive found. Maybe this is helpful even if I think I got it right
So you're not getting hint "Someones there!" ?
Nope. Im getting crazy. That seems so simple and takes so long haha
I think I know why
Im excited and about to turn a cigarete 😄
Command triggerActivated as I understand it, returns true if trigger have been activated before. But at the time of running that code, trigger have not been activated yet
Interesting idea. It could be true. Im gonna check for triggerActivated manually in debug now.
Yes walk into the area and try that in debug console
Genie!
Ok lets go on 😄
You was right professor! Its because the script isnt running consistantly
I thought the system is always running the if cause and checks if something changed.
Ive now implemented a sleep 3; to implement delay and avoid the engine to otherwrite the hint.
It worked. It worked also 30 mins ago haha. I just wasnt able to read it.
Yes men! Im really happy. Yesterday Ive failed the 500th time to understand how to
create and edit the existing modules with only script.
But today I achieved the createTrigger thing and I understood how to create returns
with nil and null and also the if-causes are now available in my skill set so I can teach
my people 😄
To-Do: Learn modules by script. Learn how to script great createTask things 😄
I want to use the moment to say "thank you" to everybody who brought me here ❤️ Your great people
@winter rose, @hushed turtle, @pallid palm, @hallow mortar, @open hollow (sorry if I missed someone)
So question for you, I have a script running but it seems to duplicate for every player rather than just running once, each is activated by a trigger "Player Present"
fnc_fiacontactend = {
[] spawn {
fiaphone say3D "ringtone";
sleep 6;
fiaphone say3D "ringtone";
sleep 6;
fiaphone say3D "ringtone";
[0, "black", 5, 1] spawn BIS_fnc_fadeEffect;
sleep 5;
"EveryoneWon" call BIS_fnc_endMissionServer;
};
};
[fnc_fiacontactend] remoteExec ["call", 0];
``` This is an example of one of the triggers, there are many others but they all follow the same basic structure of creating a function then using ```sqf
[fnc_myfunction] remoteExec ["call",0];
``` is there a way to stop these for being duplicated?
First player activates then it plays ringtone for everyone?
That part works, however it plays im quck succession twice, as in the code itself plays twice overlapping
Are those tiggers repeatable?
Negative
That code creates a function, and then executes it on all machines. If you don't have the trigger set to "Server Only" each player will have their own trigger that they can activate
You also really shouldn't send code over the network, you should define the function on each player's machine, and then just remoteExec the name of the function.
E.g. defining the function with a https://community.bistudio.com/wiki/Arma_3:_Functions_Library
And then just doing:
[] remoteExec ["TAG_fnc_fiaContactEnd"];
Is there a downside to defining the function via a trigger over defining it in a .ext? It was just a quick and dirty way of doing it origionally but Im curious to hear the process behind it
The function would be defined each the time trigger is run, that part doesn't matter as much here because the mission is ending after it runs but its something to know. The main thing is sending code over the network, which isn't good for network reasons.
Sending just the name of the function is also a lot less traffic than the entire code block
I see, good to know
Hey people, Ive did a quick breake and went back with new energy
Im coming back with the same old questions Im hanging on since years.
How to create existing modules by script and fill in their blanks
What I want to do:
I wanna be able to use every existing module (like hidingTerrainObject, like createTask, like createSmokeShell etc.)
and edit it. For example, using a smoke shell module in a script and change the color
Or for another example create a "createTask" module and use it fully.
Please help me, Im really trying this hard other the years @tulip ridge, I think you could help me with this. Now its not 5.30 am...
This is uh, an incredibly broad question
How do I start?
By figuring out just one thing you want to do
it finally worked 😄
Im back. Dont wanted to ghost you.
I want to translate my modules ive placed into code.
Nothing more. And nothing less. And in case I want to use other modules I want to achieve the skill with all modules
_vorona = createVehicle ["M_Vorona_HEAT", _drone, [], 0, "CAN_COLLIDE"];
_vorona setPosASL getPosASL _drone;
_vorona setDamage 1;
someone knows how to make the vorona rocket immidently explode after spawning in?
because currently the setDamage 1; doesnt make it explode on spot.
triggerAmmo
https://community.bistudio.com/wiki/triggerAmmo
thanks
Good day everyone, is there any other way to remove grass from a map and keeping the maximum terrain detail other than setTerrainGrid 50;
setTerrainGrid 50; this works flawlessly in terms of removing the grass but the objects in my view distance gets removed or distorted
You can mess with the grass models instead, I think. I used a CUP low grass mod that probably did that.
@granite sky I'll give that a try but doesnt this only works for cup mods
setTerrainGrid is a command to set the overall terrain quality, not just grass. If you just want grasses be gone, use a Mod
hello a bit GUI related, but I was looking at https://community.bistudio.com/wiki/ctrlMapScreenToWorld and the last example about printing where u clicked, I was wondering how could I have it where it centers on the position I click? I thought it would be ctrlMapSetPosition but thats the position of the GUI elements
Am trying to make a mini mission where you look for a boat and call it in through an addAction. Am trying to get it where once your in a trigger it checks if you are looking at the boat by a combo of worldToScreen and checkVisibility but I keep getting an Error Suspending not allowed in this context. Am wondering if am doing this right or if I should go about it other way.
You cannot use sleep or waitUntil etc in addAction
its not in the addAction its before that. am calling the waitUnitl to change a bool variable to call a If statement to add the addAction or not
So do you mean you ran this code in a trigger? Still invalid
Search by Scheduler or Scheduled Environment in wiki
should I move this code to its own sqf file and have the trigger call the file then?
spawn will do
thank you the error is gone
Hello guys. Can someone tell me if there is any way to check which surfaceType is on the road the player is on? I've tried different ways. But I did not find the necessary functionality for this
getRoadInfo?
Unfortunately, getRoadInfo does not return a surfaceType
And surfaceType position player returns surfaceType of terrain beneath player, not road
hmm, what's in the material parameter of getRoadInfo then?
path to .rvmat file
I'm not a modeller but I'm kinda surprised that none of these things are related :P
If I need to post code to get help, what service should I use to do so?
You can fetch rvmat as config and call it a day
codeshare, pastebin, hastebin, gist, github?
Let me rephrase: Is there a preferred service?
no
Ok, great. Thanks.
- get rvmat path
- load config using https://community.bistudio.com/wiki/loadConfig
- get the variable you want to get
- profit
I'm trying to set a spawned AA vehicle's direction equal to the direction of the marker it is spawned on, but I can't seem to get it to do so. Code here: https://codeshare.io/46KxT
You can modify the terrain config but again that'll only work with the terrains you modified
Ok, I'm confused on something. Why does this works perfectly fine to lower the landing gear of my first aircraft but does not work on the second aircraft
Pilot_1 action ["flapsDown", FA18_1];
FA18_1 action ["Land", FA18_1];```
`second:`
```Pilot_2 action ["LandGear", FA18_2];
Pilot_2 action ["flapsDown", FA18_2];
FA18_2 action ["Land", FA18_2];```
You may have some undefined variable
Ok i tried this just now [FA18_2,["LandGear"]] remoteExec ['action',0,FA18_2]; and it works but only through the debug console and not in a script
Debug Console executes a script. So you are running a script
You need to specify more info
LandGear
Description Lowers the landing gear of an aircraft. In the case of AI-controlled aircraft, it has to be used in an each-frame loop to override the AI behavior (otherwise they'll raise the landing gear when they take off).
🤔 https://community.bistudio.com/wiki/Arma_3:_Actions#LandGear
fun stuff
yes sorry i failed to mention it before you replid as i ws typing it
You failed to do what
I didnt say it was in a script
All you do is script
It did work without me using OnEachFrame but only on the first airplane
So you are saying FA18_2 is an AI plane?
yes same as FA18_1
Both are?
alright gonna check again
`0 spawn {
sleep 1;
[FA18_1, HLF_moveData_FA18_1_RTB] spawn BIS_fnc_UnitPlay;
[FA18_2, HLF_moveData_FA18_2_RTB] spawn BIS_fnc_UnitPlay;
sleep 1170; // time it take for the first airplane to make final approach to land
hint "Lower Landing Gear";
Pilot_1 action ["LandGear", FA18_1];
Pilot_1 action ["flapsDown", FA18_1];
FA18_1 action ["Land", FA18_1];
sleep 150; // second airplane approaching runway to land
hint "Lower Landing Gear";
Pilot_2 action ["LandGear", FA18_2];
Pilot_2 action ["flapsDown", FA18_2];
FA18_2 action ["Land", FA18_2];
};`
AndI tried remoteExec as well [FA18_SH_2,["LandGear"]] remoteExec ['action',0,FA18_SH_2]; but only in the console
I did and i lowered the time to 60 seconds to see if anything changes but it was the same result
Also FA18_SH_2 is not FA18_2
And can you confirm they actually exist? show your code to spawn them (or call the variable name in debug and see if they actually return something)
@atomic niche Sorry just saw this but I don’t understand your question
I get 0 script errors, so I know it's probably just my code.
I also I placed a trigger at the beginning of the runway with this:
condition: FA18_2 inArea thisTrigger;
On Activation: [FA18_2,["LandGear"]] remoteExec ['action',0,FA18_2];
this seems to work on the trigger but i dont know why not in the script
one thing i immediately want to tell you about is _forEachIndex
Is that the one that returns a pos in the array?
the current index number, yes
We are asking to check FA18_2 is the actually the name of the object
You sure? Not FA18_SH_2?
Yea that was the original variable name i had before i asked for help but i started the scenario from scratch and changed the Vname
And do you mean that is FA18_SH_2, not FA18_2?
Ok.
also try logging all the variables with diag_log _myVar and see if you have any wierd results
There is no FA18_SH_2
oh think i see the error that was made now
i have different names in the script than whats in the editor
The actual error is probably in this
You also only have 1 pilot no?
I am sure I will. It's got to be a var value that's off.
_AA setDir ( markerDir "_x"
(only 1 pilot that matches the search query)
ah i see
but that pilot probably still has the wrong name then, hence we asked to check if they existed
it will look for a marker called "_x"
I swear I checked each like and I didn’t find anything but in the editor there was a mismatch because I started over and used different names
This game is gonna drive me crazy
should just be _x?
for next time, just running
Pilot_2
in the debug console should return the unit, if it doesn't then it isn't properly defined/created
This is not about the game, about how the programing anywhere works
no quotes?
the best way to not get crazy because of mess - don't create a mess in the first place 
Thank you all for your help I just pulled an all nighter to fix working on this but I have to go to work y’all have a good one
I'm sure that was a result of my desperation. I don't think it had quotes originally.
if you need to turn a variable into a string look into format
That one, I'm familiar with.
It's just been a long time lol
So where would you recommend using _forEachIndex?
FOR_obj1Tgts select ( count FOR_obj1Tgts - 1 )
you shouldnt actually need it
and I'm really confused by what you were tring there
Trying to get the vehicle of the current array element and set its direction
I put examples of what the arrays look like
Whats the best way to remoteExec Nvm, go it working i guess.switchLight with (63 allObjects 0)? I can't for the love of god get it working.
That's what I got when I put them in the editor console
yea but FOR_obj1Tgts select ( count FOR_obj1Tgts - 1 ) should always be equal to _forEachIndex in this case
Well, that's handy 😄
also the first time youll be selecting the -1 index
on a 0 length array
im pretty sure arma doesnt like that either
I could see that...
other than that, diag_log _x and diag_log _AA
because trivially,_AA setDir (markerDir _x) should work if _AA is an object and _x a marker
yes since markers arent objects
Try the trivial solution again
ok
oh nice
Basically replaces what I had. I like it
Hmm, they still aren't rotating.
diag_log (markerDir _X)
diag_log is supposed to report to the RPT, right?
yes
I'm gonna be so pissed if I find out I am working in the wrong file...
😄 wouldnt be the first time i saw that happening
Crashes the game 
And rvmat doesn't contain surfaceType parameter, that's why I can't get it from there.
I think surfaceType of the road is only somewhere in Terrain Builder, idk
What you really done
private _cfg = loadConfig "a3\roads_f\roads_ae\data\surf_roadtarmac_highway.rvmat";
In any case, rvmat won't help me here in any way, because it doesn't contain information about surfaceType
of the .rpt file?
"information about surfaceType" to do what? From what i see on the wiki surfaceType doesn't seem to have any meaning outside of terrain context or something 
%APPDATA%/local/arma 3/somethingwithdateandtime.rpt
To change the maxSpeedCoef parameter
alternatively try systemChat str _myVar for more direct results
how to remove stones and trees?
game logic with:
call{{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],200])}
not work on this part.
note : deformer mod applyed on this part maybe it overwrite !?
game logic with:
call{{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],200])}
this work on another part of map!
I have the rpt up. Sorry, I meant the folder for the in game editor mission files.
~:\Documents\Arma 3 - Other Profiles\username\missions
That one?
yes
make sure the script line is called, add: ```sqf
hint format ["Running! %1", this];
ah if you already exported your mission to .pbo once i remember it having some issues
Yeah
and its logging to rpt?
In my script, you can see what _obj1Mkrs equals
So I put that same value in the watch field in the editor console to make sure it returned a value
Then I pasted those values as comments in codeshare
but _vars are local
I know
you cant watch them
anyway
[_obj1Name,FOR_mapMarkers] call FOR_fnc_findMarkers returns ["obj1AA","obj1AA_1","obj1AA_2","obj1AA_3"]
if you placed a diag_log
and its not logging
then your script isnt running
or you run with -noLogs as a parameter
I know it's running because the AA is getting spawned
I don't have noLogs as far as I know
Only params I set were no land and showscripterrors
But that's the same script that creates the vehicles
diag_log doesnt fail
lol It's failing
Lemme try reloading in editor again
Hint doesn't appear during init afaik
but really, diag_log will only fail if it encounters nil
and that would throw an error
No errors and no diag_log
then its not running
hmm diag_log then
I promise I'm not just trying to be difficult ;P
But that doesn't make sense to me. The same script places the vehicles, and they are spawned.
at least, not the version with the diag_log in it
I reloaded it in the editor with the saved version
Notepad++ goes from red disk icon to blue disk icon on save.
So that's for sure.
The file thing, maybe, but I posted you the directory and you said it was correct.
So I don't know
Lemme try something...
If this fixes it, I will rage.
I'm sorry but I really cant say what is going on if you make a change to the script but the changes dont show up 😛
I've got a gut feeling that this is a Windows problem.
sorry for the long wait, but the link seems to go in the opposite direction
CfgSurfaces classes show what materials they affect https://community.bistudio.com/wiki/Arma_3:_CfgSurfaces_Config_Reference#files
So check it out
I heard somewhere that there is a process where you can "record" a vehicles movement then play it back. This might be a solution for me because a boat crewed by enemy AI in my mission keeps beaching itself on the river it's supposed to travel down.
What is the process called? Is there any documentation on it? Can the enemy AI still shoot back or is it a static object that can't be destroyed?
https://community.bistudio.com/wiki/BIS_fnc_unitCapture and whatever is listed in its "See Also"
My computer decided that I should use ~:\Documents\Arma 3\missions instead.
Neat, huh?
Ahh dang. It says you can record weapons too which makes me think it's entirely scripted. I need the AI to function minus the path they travel.
I've been up since 7am
It's now 2pm
I just found I've been working in the wrong file.
#getrekt #retired
So youre on your default profile atm
My windows is all messed up for some reason
other profiles is only fpor when youre on the non default profile
Ok good
I also changed my Arma profile name
Which apparently meant creating a new profile
If youre using the system default it will be in Arma 3 \ missions
prertty sure under peramaters for unitcapture the firing bool is set to false by default
any other profile (name) and itll end up under other profiles
"firing: Boolean - (Optional, default false) if set to true, will record the input unit's weapon fire data as well"
so as long as you dont toggle that i imagine the AI will still handle shooting
Good point. Guess there's one way to find out. Thanks!
Guess I'm using the default then
Cool, so now, rotating AA
Thanks for the help btw
congratz on finding another reason someone is editing the wrong file 😄
I'm trying to call the ModuleHideTerrainObjects_F via script in sqm file. When the mission starts I see the module in zeus but it is not hiding any terrain objects. Any ideas why or how to do this properly?
At this point, Arma has folders in like 6 different locations on my PC
I can only count to 3, so this is a challenge.
how are you setting the module parameters?
But the subfolders, man...
and a bit more details on "script in sqm file" if possible :3
There's like 2 in each location
I'm using cursor ai to help me try and figure it out. But I'm guessing the module parameter is what is not correct.
private _allBaseMarkers = ["base_1", "base_2", "base_3", "base_4", "base_5", "base_6"];
// Create a copy to select from
private _availableBases = +_allBaseMarkers;
private _selectedBases = [];
// Create logic center for modules
private _logicCenter = createCenter sideLogic;
private _logicGroup = createGroup _logicCenter;
// Select 3 random bases
for "_i" from 1 to 3 do {
private _selectedBase = selectRandom _availableBases;
_selectedBases pushBack _selectedBase;
_availableBases deleteAt (_availableBases find _selectedBase);
// Wait 5 seconds before placing module
sleep 5;
// Create Hide Terrain Objects module at the base position
private _pos = getMarkerPos _selectedBase;
private _hideModule = _logicGroup createUnit ["ModuleHideTerrainObjects_F", _pos, [], 0, "CAN_COLLIDE"];
// Initialize the module
_hideModule synchronizeObjectsAdd [_hideModule];
_hideModule setVariable ["Hide", 1, true];
_hideModule setVariable ["Size", 100, true];
_hideModule setVariable ["Filter", -1, true];
};
// Make the selected bases available globally
missionNamespace setVariable ["activeBaseMarkers", _selectedBases, true];```
3DEN will actually support subfolders for the mission folders too
thats gonna be nice
congratz man
AI 👀
try adding # to the setVariables not sure but I think you need that
_hideModule setVariable ["#Size", 100, true];
Thanks I'll try that.
haha ya AI, my only coding experience is a QBasic class back in high school so I need the assistance lol
also you dont need to create centers in arma 3, just have : ```sqf
private _logicGroup = createGroup civilian;
hahah
and lastly the code is synchronizing to itself ;D
Don't worry. I'm sure I'll be back with 1,000 more questions.
Modules should be sideLogic, not civilian
You guys want a hard one?
Not sure wher to ask this. But I have a bunch of invisible objects I wanna place in eden, Is there a way for me to add a texture to them in Eden? So I could see exactly how and where I am placing everything?
good point but I wonder if its actually matters which side is used?
Not necessarily to the module.
I recall the BIS tasks system creating logic objects on various sides and breaking our spawning code.
ive been using civilian 😬
It's not a troubleshooting question this time ;P
I need to create a function that creates smooth AI flight paths for paradrops. Helis will fly in, drop paratroopers at the drop zone, and return to base. What's the best way to go about creating the paths if I have the heli spawn marker and the drop zone marker?
How much time do yall spend in the eden editor vs VScode when you make a mission? I've been finding myself wanted to write as much code as possible out of the editor because it makes it easier to track down later.
Is it possible to do near 100% outside the editor?
yea, most of the time i only restart the mission to test the changes
you can even use execvm to test stuff in the middle of the mission, with out even restart
advanced developer tools its quite usefull too, usually i start the scripts there before moving to vc
The keyboard navigation conventions in ADT's console are kinda painful so I usually write code elsewhere and then paste it in to test.
where is the error /s
its painfull... but usable to be fair
Waypoints or scripted paths?
Is there a reliable way to make a unit not die when inside a vehicle that explodes?
I have a "HandleDamage" event handler that manages player's damage intake and makes it uncounscious as needed, never dying, so others can come and heal. All my tests were succesful while on foot, but while passenger in a vehicle that explodes I cannot, for the life of me, make the player not die! It seems as the game has this behavior hardcoded.
I'd like some insight, maybe examples, anything...
Thank you for your time!
Hmm, a plain {0} handleDamage works for me.
Get kicked out of the vehicle though, so I guess you'd need to override something else to prevent that.
Guessing that you're making assumptions in your HandelDamage.
MP or SP?
Multiplayer
So right now, we're attempting to do it with waypoints.
You don't think it will work?
We're starting them as pilots
Players are separate
Paratroopers are for an objective
then waypoints is the best way to try and get it to work
Anyone seen this error code?
It pops up on mission start. I'm not sure what I did to get it to pop up. It may have been there for a while and I just noticed it.
0 enemies on map; AI panics under pressure. GG>
I don't understand it at all
Maybe the AI is so advanced, we're actually watching them learn to fly a helicopter right as soon as they are spawned inside the pilot's seat...
Watching my huge fleet of choppers swarm toward an objective base is like watching a bunch of sperm swarm toward an egg.
If you are just flying players in at the start of the mission, you can use sleep then eject them after a set timer(which you time by testing the flight path of the ai)
Only one survives. Sometimes 2.
hey 😃 i have a quick question. does anybody know why e.g. ctrlSetText [1400, str (date select 3)]; ctrlSetText [1401, str (date select 4)]; does not add anything to a editbox. but strangly it does when i exec it in the debug window o.O same goes with listboxes. the script gets launches "onload" of the dialog
@nimble hill but if the flight paths are unreliable, that might not work
too many variables
Hmmm I just checked github for changes to my description.ext but the last changes were yesterday. Im pretty sure this error is from today.
hey guys new here i need some help with arma 3 scripting, I'm trying to make a large scale air bombardment with the flying legends b-17 and its ai only. is there a way?
depends on the scale
Scale is huge.
the general movement of going in and waving off to a side, yes
nail an exact flight path, no
Unfortunate.
has anyone found a way to detect when a player friendly fires? im trying the entityKilled eventhandler however the side of the dead unit will be civvie no matter what, there must be a way to find whether it was friendly or not
if anyone else has this problem:
player addEventHandler ["HandleRating", {
params ["_unit", "_rating"];
if(_rating < 0) then {insert code here}
}];
although someone with more time will have to find a way of distinguishing between civvie kills and friendly kills. Until then NATO will work but AAF or CSAT will randomly break whenever somebody kills an innocent
A (not perfect) workaround would be something something like getNumber (configOf _victim >> "side")
by the time that you've killed someone they get marked off as a Civvie no? would the config not be affected by the civswitch?
Config is not SQF command and will not be altered ingame/dynamically, it will return 1 if you kill B_Soldier_F
And always 1
so with the entityKilled eventhandler you could use configOf _killed >> "side" to return the side the unit had while it was alive?
Technically (it is tldr why it is not the comprehensive way, but 99% of situation there is no much issue)
i'll look into it further on the wiki then
Legend mate
Convert 0, 1, 2, 3 to side is BIS_fnc_numberToSide or some similar name
side group _killedUnit?
All the missions I end up working on, I write most functionality in script and use editor layers to target the entities I want to use. And of course debug engine to debug the scripts.
I wouldn't bother placing units and waypoints and triggers in script though 🤣
Whenever I try BIS_fnc_attachToRelative - it resets the orientation of the scaled simple object. Any idea how I can fix it?
scaled is not supported, try re-scaling it afterwards (but not guaranteed)
as you can see in https://community.bistudio.com/wiki/setObjectScale,
Changing the direction of the object (e.g. using setDir, setVectorDir, etc.) will reset the object back to its original size (probably because the engine normalises the directions, thus the scale in the transformation matrix becomes 1), so those commands should be run before resizing the object.
I've set the default orientation via the editor and then used BIS_fnc_attachToRelative and finally scale it to 2x. It does not take the orientation. Do you mean I should scale it and then attachit?
I mean that object scaling is definitely not helping and not well supported, so you may have to do things manually
Oof ok then thanks 👍
Heres another question: How would you execute while against a variable being true? I tried while { _variable == true } and it says, type bool expected code
whie is not a valid keyword
sorry a typo in here - this is the codeim using while {_objectStared == true} do { /* code here */ }
basically i want the code inside the do {} to run until the variable _objectStarted is set to false by another function
while { _objectStared } do
{
// I hope you change _objectStared in here
};
```is very valid
the variable _objectStarted is set to false by another function
HAH here's your issue
how do you want to change a local variable with another function
get used to it
😄
["Gefreiter", "U_SPE_GER_Soldier_M40_Boots_Rolled"],
["Unteroffizier", "U_SPE_GER_Soldier_M40_uffz"]
];
{
private _rang = _x select 0;
private _uniform = _x select 1;
this addAction [
format ["<t color='#00FF00'>%1</t>", _rang],
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _uniform = _arguments select 0;
_target forceAddUniform _uniform;
systemChat format ["Uniform %1 wurde angezogen.", _uniform];
},
_uniform
];
} forEach _uniformen;
systemChat "Uniform-Aktionen wurden hinzugefugt.";```
I have a error for whatever reason
it just says something about the *"error generic error in expression"*
What i wanna achive:
- Go over to an NPC, scroolwheel over his body, select the rank (i.e. "Gefreiter") and his Uniform changes to that. Bc i wanna show off the different rang insignias to my players without going into an arsenal.
i use ace, the SPE cdlc etc
Hopefully somebody can help me.
Is _arguments rally array? It looks like it should be string
meaning private _uniform = _arguments;
_argument params ["_uniform"]; if in doubt 😛
I'm going to try to tackle this error again tonight when I get home from work. I checked the rpt and didn't see anything that stood out, though I admit I don't really know what I'm looking for. I'm just going to remove .sqf files from my project until the error goes away, and hopefully, that will narrow it down some. Has anyone else seen an error like this? Usually, the errors I see will at least give you a line number...
Never thought about params command like that. Never realised it can take any array. Nice to know thanks

[1,2,[3,4]] call {
params ["_one", "_two", "_this"];
params ["_three", "_four"];
[_one, _two, _three, _four]
} // => [1,2,3,4]``` also works, but please don't do it 🤣
@lethal fern what!, you mean flying legends has a b-17 ?
how I make bombcar?
hey , anybody can help me to add action for RuggedTerminal_02_communications_F ?
No problem on addaction
Just need animation order
And list
@fair turtle tell us about what you need we have no idea what you want when you say bombcar
yes you can make a car into a bomb,, but when and how do you want to use it
bomb="Bo_GBU12_LGB" createVehicle getPosATL car1;
//or
bomb="M_Mo_82mm_AT" createVehicle [(getPos car1 select 0),(getPos car1 select 1),0];
getPos not good, should use getPosATL 🙂
What kind?
It explodes when player near or something?
remote
still need more info m8 @fair turtle
you can put a trigger around the car is that what you mean
or do you want to script the hole thing
I wanted to know if it's possible to place bombs like dynamite on the car.
oh
yeah you can place any bomb on a car in the game
if you have it in your inventory
well, you cannot attach a satchel charge without scripting in Arma 3
and btw hello Lou
how did u know he wanted to use attachTo
i must of missed that some how
place bombs like dynamite on the car
I assume they mean placing the bomb anywhere on the car
How can I get this bad boi to target a friendly unit and continuously keep tracking it until I want it to stop.
I did try dotarget & dowatch but it did nothing
Side note I did get this one to look at a static object (a sphere) with dowatch but wanted to see if i can do it with the unit rather than attaching a sphere or another small object to said unit
Dynamic Patrols Script Problems
I'm trying to make a patrol script that will every 60 seconds, it finds every WEST squad leader and spawns a patrol 200 meters directly in front of them. The script will add all of the LAMBS functions to the patrols, Then patrols are dynamically deleted when they get more than 500 meters away from any player.
My problem that I have had so far is that the patrols do not delete properly. It get the point where there are 30 to 40 patrols on the map if left untamed.
Does anyone know of any way to keep track of what units have been spawned in by the script?
Add this to the init of the car
_bomb="Bo_GBU12_LGB_MI10" createVehicle (getPos (_this select 0));
_bomb="Bo_GBU12_LGB_MI10" createVehicle (getPos (_this select 0));
deletevehicle (_this select 0);
}];```
It'll make the explosion bigger when if blows
Post the code, you can use code highlighting btw
This is kinda what I have so far
// By Too Many Cooks
if (!isServer) exitWith {};
// CONFIGURATION PARAMETERS
private _patrolDistance = 200; // Distance in front of squad leaders to spawn patrols
private _despawnDistance = 500; // Distance at which patrols despawn
private _patrolInterval = 60; // Time between patrol spawns
private _patrolRadius = 100; // LAMBS patrol area
private _patrolSize = 6; // Number of units per patrol
// List of enemy unit types
private _enemyTypes = [
"UK3CB_ION_O_Woodland_SL",
"UK3CB_ION_O_Woodland_TL",
"UK3CB_ION_O_Woodland_MD",
"UK3CB_ION_O_Woodland_RIF_1",
"UK3CB_ION_O_Woodland_LAT",
"UK3CB_ION_O_Woodland_ENG",
"UK3CB_ION_O_Woodland_DEM"
];
// Main Loop
while {true} do {
// Get all WEST squad leaders
private _leaders = allPlayers select {side _x == west && (rank _x == "SERGEANT" || rank _x == "LIEUTENANT")};
{
private _leader = _x;
private _spawnPos = getPos _leader getPos [200, getDir _leader];
private _group = createGroup east;
{
private _unit = _group createUnit [_x, _spawnPos, [], 0, "FORM"];
_unit setSkill ["general", 0.5];
} forEach (_enemyTypes select [_patrolSize]);
private _leaderUnit = leader _group;
_leaderUnit setVariable ["lambs_danger_dangerRadio", true];
_leaderUnit setVariable ["patrolZone", "DynamicPatrol"];
[_leaderUnit, _leader] call lambs_danger_fnc_tactics;
[_leaderUnit, _leader] call lambs_danger_fnc_tacticsReinforce;
// Assign LAMBS Patrol Task
[_group, getPos _leaderUnit, _patrolRadius, 4, [], true, true, false] call lambs_wp_fnc_taskPatrol;
// Store patrol for despawn check
missionNamespace setVariable [format ["ActivePatrol_%1", _group], _group];
} forEach _leaders;
// Despawn patrols if out of range
private _allPatrols = missionNamespace getVariable "ActivePatrols";
{
private _group = _x;
private _playersNearby = allPlayers select {side _x == west && (group _x) distance (group _group) < _despawnDistance};
if (count _playersNearby == 0) then {
{ deleteVehicle _x; } forEach units _group;
deleteGroup _group;
missionNamespace setVariable [format ["ActivePatrol_%1", _group], nil];
};
} forEach _allPatrols;
sleep _patrolInterval;
};
with "ActivePatrols" variable being set where?
You could try lockCameraTo.
Note that this is a camera lock, not a weapons lock; if you force it to launch a missile it will not pursue the target.
} forEach (_enemyTypes select [_patrolSize]); that's not looking very good, tbh 
not to sound like a quick gun... but was any ai/llm/whatever involved in writing that? sus
I'm still learning some of these more complex things, but yes unfortunately that's one of the few resources I have to learn from, no Armaholic any more to help me lol
Yeah I've read that
well, the problem with AI/LLM is: you don't want to ask it to write any code you can't debug (and fully rewrite with some effort) 🤣 And the problem with "Introduction to Arma Scripting" article is it's not really finished 🤣
Just do what facebook did - Train a local LLM usiki BIKI and open source github projects -> EZ 
well, github projects are guaranteed to be better code source than forum questions in form of "here's my code, why isn't it working?!" 🤣
Yeah I'm still working on the "knowing how to debug" part lol, what it gave me at first was hot garbage, and I've cleaned it up a bunch already.
The question I am asking is what do I need to read up on to know how to make sure the script will keep track of what it has spawned in already
well, let the spam begin:
point 1: sqf private _group = createGroup east; { private _unit = _group createUnit [_x, _spawnPos, [], 0, "FORM"]; _unit setSkill ["general", 0.5]; } forEach (_enemyTypes select [_patrolSize]);
should be replaced with, say, for "_i" from 0 to _patrolSize do {//code here}; for it to actually spawn requested amount of enemies
Yeah this is what I mean lol, at this point I'd be going back and figuring out why "_i" is different than calling on the parameters in the first few lines
Thanks i'll give it a try
point 2: storing the stuff in a single ActivePatrols array is a sane and good idea. Except for it to work you need to:
- in the beginning declare/define it with
ActivePatrols = [];before starting the loop - right after the code from "point 1" add the newly created group with
ActivePatrols pushBackUnique _group; - remove deleted groups from it (you can, say, replace
forEach _allPatrols;near the end withforEachReversed _allPatrols;and do_allPatrols deleteAt _forEachIndex;inside the loop. Should work
)
point 3: all the lines that mention format ["ActivePatrol_%1" (getVariable/setVariable equally) don't really have any valid use, so i'd say they can be safely removed
Kind of like this?
(this was from the last time I tried to wrap my head around this, but it was zone based with triggers)
kinda but not really. for "_i" from 0 to 6 do {//code}; is "execute code 6 times".
{//code} forEach _enemyTypes; is "execute code once for each value inside "_enemyTypes" array".
Both are useful, but for different things 
so when your usecase is "I want to spawn 6 doods" - for-loop is your friend
7 
but when your usecase is "here i have an array of AI groups, i need to check every one of them" - you reach for forEach
3 biggest problems of programming:
- naming variables
- errors by 1
Oh okay so it would kind of be lookin like this?
for "_i" from 0 to 6 do {
spawn stuff;
do stuff;
more stuff;
};```
ja, kinda like sqf private _group = createGroup east; for "_i" from 0 to 5 do { private _unit = _group createUnit [selectRandom _enemyTypes, _spawnPos, [], 0, "FORM"]; _unit setSkill ["general", 0.5]; }; ActivePatrols pushBackUnique _group; or something.
(also, notice the selectRandom _enemyTypes to select (duh) the random unit to spawn in the createUnit invocation).
Bang, you have a group of 6 (hopefully, thanks, NikkoJT) doods spawned and accounted for.
orner cases causing issues alway
I think the easiet way to do this would be have it trigger activated with execFSM dynamicPatrol.sqf in the On Activation box and just while the .sqf is running it just loops, until the ending trigger tells it to. would all of this still work like that?
well, that's another set of points 🙃
oh boy
aw, too much words, but too much lazy
a) execFSM isn't really used for SQF. execVM "dynamicPatrol.sqf"; or call TMC_dynamicPatrol; (or spawn), or something would be needed. Wiki, while not being all-encompassing does provide almost full documentation on all language commands and good enough "See Also" recommendations. (Or maybe my mind is too deformed to think any other way).
b) running an SQF that runs loops inside a trigger sounds... excessive and overcomplicated, tbh
trigger is, essentially, a Place, and a Loopthat's given a Condition to run periodically, On Activation code to run when Condition goes from false to true, and On Deactivation code to run when Condition goes from true to false. Not really much more.
wouldn't add anything extra to your usecase 
Wait I've been doing that wrong this whole time? In my defense I learned that off of a BI forum, not AI lol
i'm rambling. I'd move to a thread, if you're not opposed to that
This code and Triggers and AI and General Scripting Advices
@hallow mortar I did this mk29_1 lockCameraTo [FA18_SH_2, [0,0]]; but ntn happed as well or did i miss smt
https://community.bistudio.com/wiki/lockCameraTo
As the note at the top says, you need to use the second syntax for most turrets.
Is it possible to for a video being played via BIS_fnc_playVideo be displayed to a player connecting via JIP without needing to reset?
Try side group _unit instead of side _killedUnit, will result with the intended side
even when the unit is in a group alone? (just the SL with no squadmates) the group won't instantly become civvie?
Just try it, you'll see
side _unit won't always report what you expect. For example:
- side of a renegade soldier is sideEnemy
- side of an empty vehicle is civilian
- side of a crewed vehicle is, if present, commander's > gunner's > driver's or > cargo's side, in this order
- side of a captive or dead unit is civilian.
An unit forms a group, a group can have one unit. What we suggested already is what we have as workaround anyways
Note that side group _unit doesn't work universally for dead units because they eventually get switched to grpNull, but it works at the point when they die.
I'm sure I'm doing some really simple shit wrong here but I cannot get either of these actions to show for the player with the variable Knight_1 on the dedicated server. Had it working fine using normal addaction, but I'm missing something on getting it working on the dedi and when a player respawns (the code is in the respawn eventhandler for the unit at least)
{wagontarget setPosASL AGLToASL screenToWorld [0.5, 0.5]; wagonend setPosASL AGLToASL screenToWorld [0.5, 0.5]; wagonreservespawn setPosASL AGLToASL screenToWorld [0.5, 0.5]}] remoteExec ["addAction",0,true];
[knight_1, "Light of Sigmar", {_pos = player ModelToWorld [0,0,20], _light = createVehicle ["F_40mm_red", _pos, [],0,"NONE"];}] remoteExec ["addAction",0,true];```
What the hell do I need to look at/change to get these actions to show for the designated player every time they respawn?
what sort of respawn event handler?
The easiest way to give actions to players is to do it on the client side. initPlayerLocal for example.
Your remoteExec is pretty busted though. Left side should always have two parameters (left, right) at most. An addAction remoteExec would look like this:
[_target, ["title", {code}]] remoteExec ["addAction", _target];
Question, u know how sometimes if u hit smth with your main rotor of a heli, rotor breaks and dissapears?
Any way to do it with a script?
I tried setting 100% damage on it in zeus enhanced and that didnt work. I think
Problem: Script in trigger won't work in dedicated MP (probl. locality problem)
Hey, I was wondering how triggers work with locality and dedicated servers. I have a custom chat that is created via a game logic init at the begin of the mission and saves the IDs in a mission var so other scripts can grab the ID. Now I have a trigger in my Amory that when trigger should add the user that triggers it to the custom chat (and set the current channel to that). When the user leaves it should remove them from the chat. Now to the funny part as always with locality
. When I use player in the trigger and host it localy everything works, but if on the server it does not add the user to the chat (the setchannel command still works tho). So I thought lets use the thisList var from triggers but funny thing, this var is not available on the deactivation section so I could add units but not remove them. Another thing I tried (on the screenshot) was using remoteexec to sync it to all machines but still not working in dedicated MP. IDK what to do now cause nothing seems to work. Before someone asks, the chat is created correctly, I can add myself via the console.
Triggers unless marked as serverOnly will trigger local to the machine that triggered them for example if you setup a player in thisList one; that will trigger for the player who enters it. Do players have access to that variable? And I haven’t checked; but make sure all your commands are running in the right scope aswell. I’d help more but I’m on my phone
I’d make sure your trigger condition is correct and is triggering/detriggering as you expect first by hinting or systemChat responding it
already did all of that, everything works as it should (otherwise it wouldn't work on local MP). Thing is I can't use ´thisList` cause arma dosen't have a equivalent in the deac section.
Just for a sanity check show me your trigger
I mean I have a other trigger that opens the Ace arsenal that uses player as well or a other trigger that auto opens a door, these work. But now those more advanced ones don't.
As local multiplier is still different to dedicated in that regard
I just want to be able to rule it out
Well what do you want to see / know
the condition line and if it’s just this then the part above
I have arma closed currently, but yes, the condition is only this.
and it is set to trigger if any player is inside
I recommend to use
player in thisList
Unless you want it so when one person enters it triggers for everyone
here is the script from the sqm:
items=2;
class Item0
{
dataType="Trigger";
position[]={1042.311,6,1173.098};
angle=6.2668309;
class Attributes
{
onActivation="private _customChatID_Armory = missionNamespace getVariable ""customChatID_Armory"";" \n "" \n "[_customChatID_Armory, [player]] remoteExec [""radioChannelAdd"", 0, true];" \n "" \n "[{ " \n " params [""_customChatID_Armory""]; " \n " setCurrentChannel (_customChatID_Armory + 5);" \n "}, [_customChatID_Armory], 1] call CBA_fnc_waitAndExecute;" \n "";
onDeactivation="private _customChatID_Armory = missionNamespace getVariable ""customChatID_Armory"";" \n "" \n "_customChatID_Armory radioChannelRemove [player]; " \n "setCurrentChannel 5;";
sizeA=5.4660001;
sizeB=12.693;
sizeC=5;
repeatable=1;
activationBy="ANYPLAYER";
isRectangle=1;
triggerInterval=1;
};
id=65776;
type="EmptyDetector";
class CustomAttributes
{
class Attribute0
{
property="KJW_Radiate_Core_countRate";
expression="_this setVariable ['KJW_Radiate_Core_countRate',_value, true];";
class Value
{
class data
{
singleType="SCALAR";
value=0;
};
};
};
nAttributes=1;
};
};
Nah I want it like you did. But how would I be able to remove this person when they exit cause thisList does not exist in deactivation?
Add player in thisList into the condition?
From what I see your trigger will trigger for every player in the network as soon as any player steps into the trigger
And it will cause all players to be added to the channel
Any player stepping out then will caused all players to be removed
funny thing is, no one is getting added to that channel
Oh @flint topaz already said that, as usual I didn't read the whole thing
Also radioChannelAdd is global by itself but as usual with Arma its wonky and its often better to execute global stuff on server if possible
From what I tested with triggers is they run locally and execute stuff locally until there is a var or script that shares stuff between clients.
I have a trigger that if you enter the zone opens the arsenal that uses player to open it. If it would execute on every machine that would open the arsenal for everyone but it dosn't atm. (maybe I am wrong tho and I didn't 100% tested that with multiple people on the server)
Lets say I get that first part with actvation done. Grab the correct object and add the player to that channel. How would I remove them tho? Cause thisList is not a var in deactivation.
like this is the main problem that I am facing
player would be fine as your reference
I refered from using thisList due to the deac not having it
As player is a local variable you can use
Are you sure it’s the player part that isn’t working?
Did you hint all of the variables you are using?
jep, It works in SP but not on DMP
player still works in DMP if used in the right context
From what I concluted is that somehow due to the server now hosting the mission player or the init does not get passed correctly and so player is not a local var anymore.
I believe your issue will be getting of the channelId might be objNull
But hinting or displaying this will confirm or deny it
player is a scripting command returning currently controlled unit, it should just return null on server and it will be fine
It works on other triggers but not for the radio add command. Let me start arma and make a vid so you guys can see it better
Sure _customChatID_Armory is properly available on clients?
^
here is the script from the game logic init that creates this channel
WKBob is a var name of a AI unit
radioChannelCreate can only be used on server, then you'll need to broadcast resulted channel ID to players
if(isServer) then {
private _channelID = radioChannelCreate [[0.66, 0.7, 0.5, 1], "A. Fortenbachers Büro", "%UNIT_NAME", [WKBob3]];
private _channelID1 = radioChannelCreate [[0.66, 0.7, 0.5, 1], "Waffenkammer", "%UNIT_NAME", [WKBob1, WKBob2, WKBob3]];
missionNamespace setVariable ["customChatID_Office", _channelID, true];
missionNamespace setVariable ["customChatID_Armory", _channelID1, true];
};
If the channel was not created correctly how would I be able to join it via a command then
Added true at the end of setVariable
If you have that code in init field it fails radioChannelCreate on clients and saves the ID as 0
That is not needed cause it is executed in a init and inits are JIP and global
And then you ask server to add you to custom channel 0 which is invalid
give me a sec I send a vid
You're having your clients do radioChannelCreate which they cannot and it returns 0
Hmm now I see where you are going with this, cause they fail to create they save a wrong value to the missionvar
Yes, use my change it will only create on server and then broadcast the resulting ID
local MP works, now uploading to server. Lets have a look. 
Make sure to have that player in thisList condition
otherwise any player entering the trigger will have every client execute "On activation"
Well gotta say, I didn't expect this to work
still one problem consist, how do I remove them in the deac section? Cause yea I can use player in thisList in the activation section to only get the player but in deac it would remove all players from that channel.
Hmm, good point
Actually no, you don't need thisList in deactivation, only in condition
Trigger wont even activate to worry about deactivation
So it will be fine
Make sure its in Condition field
u mean player in thisList
Yes
kk
Well that works so far, thanks a lot @flint topaz & @meager granite. You guys where a great help.

#arma3_scripting message this might be helpful.
lockCameraTo but I did it in a loop
Is there any reason to use https://community.bistudio.com/wiki/BIS_fnc_addStackedEventHandler over using https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers
😊
nostalgia
yeah I saw that part, and then I saw it was used in SOG for I think the boats so I was thinking surely they must have a reason (cause they are better at scripting then I so)

probably just an old script
understandable o7 will use the mission event handler
Is it possible to put weapon into cargo with completely custom set of attachments? There are classes with predefined attachments, but I would like to have my own in mission. In editor or using scripting of course.
Thank you
That's potentially a lot of network traffic. What if I remote exec function calling local version of command on every machine instead, will JIP clients get the change as well based on current cargo on server?
Don't do that. Inventory desync is bad.
can you attach variables to a map object?
whats a map object?
terrain object*
ah thought you meant that
I am once again asking for help in this.
Some you can, some you can't
Of those you can, I think they might get streamed so you'll lose your var anyway
An alternative solution is using a hashmap, using terrain object id as key
problem is im updating var up to 10 times per object and i dont think i can get this too optimized from my knowledge unless there is something more advanced i can do for performance (i am packing this into a mod if that opens up more)
Hashmaps are fast. It won't be much different than setVariable
Or are you talking about broadcasting vars over network?
yeah variable needs to be modified by every player and modified
In that case you can just broadcast the change
i suppose hashmaps could allow me to keep it serverside until i need to check if said object is in that hashmap
youd need to use remotexec see pinned tutorial and https://community.bistudio.com/wiki/remoteExec
Yea but it does not play the video where it was left off from my testing.
i have a few ideas for this thanks leopard ill have a look and see if i can get the script to stop lagging a bunch
Like, a player joins in the middle of an active remoteExec'd BIS_fnc_playVideo can only hear the audio but not the video. Seems kinda strange.
wait is this like an intro video?
nope
whats your use case?
Its displayed on a billboard (more specifically the briefing room screen)
here's an example:
// fn_setVariable.sqf
params ["_objID", "_name", "_value"];
if (isNil "TAG_objectsHashmap") then { TAG_objectsHashmap = createHashmap };
TAG_objectsHashmap getOrDefault [_objID, createHashmap, true] set [toLowerANSI _name, _value];
// fn_getVariable.sqf
params ["_objID", "_name", "_default"];
if (isNil "TAG_objectsHashmap") exitWith { _default; };
private _varsHashmap = TAG_objectsHashmap get _objID;
if (isNil "_varsHashmap ") exitWith { _default; };
_varsHashmap getOrDefault [toLowerANSI _name, _default];
and to setvar, you just remoteExec that function:
[getObjectID _someTerrainObj, "myVar", 1] remoteExec ["MY_fnc_setVariable", 0];//instead of _someTerrainObj setVariable ["myVar", 1, true]
tysm was in the middle of writing that out myself lol
if you make sure ObjectHashmap is initialized at init (e.g. putting it in a fnc with preInit=1), you can get rid of the first isNil check to make things faster
you can make a feature request.
to do this properly, videos must support playing from an offset
in that case you can just play the video locally (if you register when it started playing in server time, you can get the offset easily)
if the sound is broken too, that can be fixed easily because playSoundXXX commands do support playing from an offset
Sorry to always be asking questions lads, I really hope I can reach the point where I can help one day...
Until then;
- I want a unit to be able to place his Banner (which is a melee weapon) and pick it back up through a scrollwheel action
- I can get this to happen perfectly ONCE through various means
- I CANNOT work out how to make it so that once the flag is picked back up, the cycle can start all over again
- I've tried OBJ INIT modules from NF_EXTRA, I've tried passing an action ID and running it
- I've tried adding on deletion event handlers etc etc
Anyone got any ideas?
_unit = _this#0;
_unitarray = _this;
_unit removeWeapon "Roger_Sigma_Banner_Weapon_1";
_pos = player ModelToWorld [0,0,20];
_banner = createVehicle ["BannerS", _pos, [], 0, "NONE"];
_banner setPosASL AGLToASL screenToWorld [0.5, 0.5];
_this#0 removeAction (_this select 2);
_banner addAction ["Pick up Banner", {player addWeapon "Roger_Sigma_Banner_Weapon_1"; deleteVehicle _this#0;}];
}];``` This is an example of the code and its basic "put down, pick up"
```_this#0 addEventHandler ["Deleted", {player addAction ["Stand your ground!", {
_unit = _this#0;
_unit removeWeapon "Roger_Sigma_Banner_Weapon_1";
_pos = player ModelToWorld [0,0,20];
_banner = createVehicle ["BannerS", _pos, [], 0, "NONE"];
_banner setPosASL AGLToASL screenToWorld [0.5, 0.5];
_this#0 removeAction (_this select 2);
_banner addAction ["Pick up Banner", {player addWeapon "Roger_Sigma_Banner_Weapon_1"; deleteVehicle _this#0;}]}]}];``` This is an example of me trying to use NF_Extras OBJ Init setter to add eventhandlers to all instances of the banner ever made, and is the only solution I have tried that I have to hand.
Any ideas lads? I'm really trying to flesh out WH Fantasy for my unit so it stops being so shit, and basic mechanics like this are things I'm surprised aren't in some of these mods yet (I'll probably try and find/build a drinking script too soon 😂 )
you should make functions so that you can recursively call stuff
for example, the script that adds the banner is one function. let's call it "TAG_fnc_addDropAction"
the part where you do addWeapon, you can just call that function to add the action back:
_banner addAction ["Pick up Banner", {
params ["_banner", "_player"];
_player addWeapon "Roger_Sigma_Banner_Weapon_1";
_player call TAG_fnc_addDropAction;
deleteVehicle _banner;
...
}...
Yeah I was honestly reaching the point where I think I just need to get over my fear of learning sqfs and in turn packaging functions into a mod 😂
A quick follow up, one I'm going to need a lot I feel - what's the best way to determine the one player I want to add the actions to?
Say I turn this into sqfs and have the flag out and want to pick it up. Flag has an action on it that calls "pickup.sqf" and in that sqf it needs to give an action to the player. Will addaction player pick up only the interacting player?
How would you play it from an offset? Its not mentioned in the wiki.
Tbh, its the first time I'm hearing a video can be played from offet 😅
which is why I said make a feature request
Ah makes sense. Ty
yes. the action code runs locally. player means local player.
To make the action visible to everyone, you must execute addAction for each client (an easy way to do that is object init or initPlayerLocal.sqf), but the action code runs locally for each of them separately (as they interact with the action)
however, in action code you should use the _caller (just like the way I did _player), not player. because in Arma you can remote control other units but they're not the "player". so if you use player in actions and a remote controlled unit interacts with something, you'll end up applying the script to player not the unit who performed the action
Yeah this stuff is all local to the player who picks up and puts down the banner, one blokes responsibility so _caller sounds like it to be on the safe side
Track your localities and remote exec destinations. I once made a mistake causing a recursive loop from server to client and each client to server and repeat on accident.
Hi, I was looking to lock the "Zeus" player in the air similar to how the Zeus 16+2 or 48+2 game master modes are set up. Whenever I create a Zeus module and a player joins it, their camera view is directly on the floor and they have to hit their toggle zeus key
Just testing the code now (was late when we were talking), but when I try to pick up the banner using the FNC it won't keep the capitolisation and won't find the function at all, any ideas?
Im trying to have a unit do a scriped landing and taxi in a plane, but he will not put his landing gear down, any ideas?
_pilot = _this select 0;
_plane = _this select 1;
wp1 =;
onEachFrame {
_plane action ["LandGear", _plane];
_pilot action ["LandGear", _plane];
};
sleep 1;
[_plane, wp1] spawn BIS_fnc_Unitplay;
This is my script, called by a trigger,
rec = [pilot1, plane1] spawn wp1;
Note, I removed the waypoint data to let discord paste it, the unitcapture works its just the AI refuses to use the landing gear
Can I add waypoints to grpNull?
wp1 =;
invalid
They said they removed the recording data
the waypoint was too long for discord so I just removed it, only the landing gear part needs work
I forget if onEachFrame is a new scope or not, check if _plane is defined in it
I'm not the best at all this, but the wiki page says local variables defined outside onEachFrame aren't inherited, so that section has no idea what _pilot and _plane means
Yeah it's a new scope then
Not sure if you can params [_pilot, _plane]; in it, but give that a go, otherwise change it to global variables as per this example;
You can't, because there's nothing passed to the onEachFrame block
Then global variables it is
Yeah you probably just need to make it a global variable, make sure you prefix it
Love that I can help other issues but can't work out my own, oh well back to error screens 😂
addRopAction
I would guess you meant rope
Nah it's Add Drop Action
Anyone got a quick script for having a tank turret face a direction?
How's the function defined then?
Sorry I'm learning how to actually make sqfs etc so I'm in the middle of remaking it entirely, let me test and then post what I have if it doesn't work
What I need;
- Player goes to crate and gets assigned gear set, this gear set includes banner. While getting gear set, crate also gives an addaction to plant that banner and removing it from his hands
- I have had the pickup and putdown work once EACH (1 full cycle of put down/pick up) but was attempting to do it purely through object inits so could not get it to loop or be recursive
- Another user suggested I need to learn how to do sqfs properly to do this, so I'm underway but can find no information on what might be going wrong here
this,
"Page",
[["aequip_NOL_horn_F","","","",["NOL_Horn_Magazine",9999],[],""],[],["Roger_Sigma_Banner_Weapon_1","","","",[],[],""],["EoO_Fant_Uni_14",[]],["EoO_Fant_Vest_16",[]],["1715_haversack_black",[["NOL_Horn_Magazine",10,9999]]],"EoO_Fant_Milita_Hat_4","",[],["","","","","",""]],
[],
"true",
{player call FAN_fnc_addBannerDropAction;}
] spawn Wbk_AddKit;``` This is the gear set, anything in that last {} gets executed. Addactions with player here work, but calls don't seem to be or I'm not understanding something.
**FAN_fnc_addBannerDropAction**
```player addAction ["Stand your ground!", {
params ["_fan_fnc_adddropaction"];
_pos = player ModelToWorld [0,0,20];
_banner = createVehicle ["BannerS", _pos, [], 0, "NONE"];
_banner setPosASL AGLToASL screenToWorld [0.5, 0.5];
player removeAction (_this select 2);
_banner addAction ["Pick up Banner", {_banner call FAN_fnc_addBannerPickupAction}];
}];``` This code drops the banner and in previous iterations would add the pickup action to the banner itself, but would never recur.
**FAN_fnc_addBannerPickupAction**
```params [_banner];
_banner addAction ["Pick up Banner", {
params ["_banner", "_player"];
_player addWeapon "Roger_Sigma_Banner_Weapon_1";
_player call FAN_fnc_addBannerDropAction;
deleteVehicle _banner;
}];``` and this is the code that should delete the placed banner, add the weapon back to the player, and give them the option to plant it again.
Can't for the life of me work this shit out
I didn't read much of this, but this won't work because _banner doesn't exist when the action code is executed.
_banner addAction ["Pick up Banner", {_banner call FAN_fnc_addBannerPickupAction}];
There's some inception shit going on here too though. Like why does the addAction do an addAction with the same name...
having an issue with a eventhandler that hopefully somebody can figure out whats happening
_medListBox ctrlAddEventHandler ["LBSelChanged", {
params ["_control", "_selectedIndex"];
if (_selectedIndex >= 0) then {
private _medItem = _control lbData _selectedIndex;
systemChat format ["Selected _medItem: %1", _medItem];
private _doseListBox = findDisplay 38580 displayCtrl 71307;
if (isNull _doseListBox) exitWith { systemChat "ERROR: _doseListBox is NULL in event!"; };
systemChat "Scheduled dose list population...";
private _capturedMedItem = _medItem;
[{
params ["_doseListBox", "_capturedMedItem"];
if (isNil "_capturedMedItem" || {_capturedMedItem == ""}) exitWith {
systemChat "ERROR: Delayed _medItem is EMPTY!";
};
if (isNull _doseListBox) exitWith {
systemChat "ERROR: Delayed _doseListBox is NULL!";
};
systemChat "Executing dose list population...";
lbClear _doseListBox;
private _medParts = _capturedMedItem splitString "_";
private _medBaseName = _medParts select (count _medParts - 1);
systemChat format ["Computed _medBaseName: %1", _medBaseName];
private _doseLevels = [1, 2, 3]; ```
{
private _stringtableKey = format ["STR_KAT_Pharma_%1_Dose%2", _medBaseName, _x];
private _localizedText = localize _stringtableKey;
systemChat format ["Checking Key: %1, Result: %2", _stringtableKey, _localizedText];
if (_localizedText != _stringtableKey && {_localizedText != ""}) then {
private _index = _doseListBox lbAdd _localizedText;
_doseListBox lbSetValue [_index, _x];
systemChat format ["Added Dose: %1", _localizedText];
};
} forEach _doseLevels;
}, [_doseListBox, _capturedMedItem], 0.05] call CBA_fnc_waitAndExecute;
};
}];```
(split into 2 bc no nitro
when it first gets created it works fine, it populates the listbox with what it should, however after a progressbar and a reopening of the ace medical menu it breaks, and needs a manual close and reopen of the GUI
Maybe expand on "it breaks"
it no longer populates the list box as it should
welp, apparently all i needed was a WAE
Apparently you know da wae
where there's a will, there is a WAE
I wanna remove the main rotor from a helicopter (like they do when rotor breaks).
I looked into selections.
Apparently I can do:
myheli hideselection "main rotor"; (for that specific helo)
BUT hideselection only works on simple objects. So how does it work ingame than when helicopters crash? How do I do it manually with a script than?
Use the breakrotor parameter for setHit or setHitPointDamage
How did you define the function?
Idk if its the right chat but I could use some help with creating a simple script/mod that replaces main menu arma 3 logo into a button that connects user into a server automatically.
I've read some tutorials on forums and watched a few of creating/retexturing some models but I still don't know shit. It's like I was reading/watching a very profound chain of gibberish that was meant to discourage me from starting rather than actually helping me out.
Im studying IT but creating mods instead of being the consumer is something very alien and a hard territory for me. Like what does a minimal required structure of the mod looks in order for it to even work? Where do I find resources like what classes does the arma menu have or what its code even look like? You know its stuff like that, that I actually need and not some yet another tutorial video telling me to download arma 3 tools. and a while later suddenly bro opens up a whole ready generated or handmade (i dont even know) config.cpp out of his ass without explaining anything with a ready skeleton/outline (if i can call it that) of his mod config file.
If anyone could point me to a good/easy learning material that explains it or maybe explain a bit I would be very grateful since now Im just stuck in a hopeless situation, deciding if it's even worth all the hassle and just give up.
.
I tried changing the (now deprecated) "spotlight" into a button, made config.cpp, formatted a logo into .paa, threw it all into .pbo file, placed it in arma 3 directory and created a startup parameter to launch the mod... All i got was a fog/bright background image/scene in the menu and that was it :/
If you mean you made a Mod that somehow isn't working well, post your entire config in #arma3_config
Right, okay, I've taken my dumb ass back to boot camp on this to see if I can cultivate some shred of understanding 😂
All this work I've done making those SQF's doesn't mean shit because I haven't done this -> https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Adding_a_Function step with them right? Defining them and pointing to the file with the cfgfunctions section, then that file having the instructions?
And how does your config look like?
Isn't for a mod, just for a mission
Well description.ext is still a config
Well....I MIGHT turn it into a mod if I can ever work it out, I'm just trying to flesh out the fantasy side of things a little
Yeah okay then atm non-existent, although I realise that's where this cfgfunctions section is meant to go now that I've seen that page
hello everybody!
could some one can explain to me what this message mean ?
15:39:18 Observer B Bad Irony:1 (pSiKO) REMOTE (bis_o2_10715) in cargo of B Bad Irony:1 (pSiKO) REMOTE (bis_o2_10715); message was repeated in last 60 sec: 1239
13:27:35 Observer B Bravo 2-1:1 ([TF22]C.le.RamWar) REMOTE (bis_o2_15045) in cargo of B Bravo 2-1:1 ([TF22]C.le.RamWar) REMOTE (bis_o2_15045); message was repeated in last 60 sec: 6267
this message appear from time to time, but only on HC
setup: Main server linux, headless windows
"Bad Irony" is the group name
Please correct me if I'm talking out of my ass btw! Happy to take the lesson from those that are better 😂
Well yeah you need a description.ext to define a function in cfgFunctions
Yeah just had not the foggiest, have never moved beyond some addaction and object inits
Any here versed in waypoints? I have the following code for a helicopter to land that works in SP but not when executed from the client in MP. Maybe I need to remoteexec some of this code? When I check waypoints with ADT it returns the correct number of waypoints which makes me think it's not a locality issue though. But I can also use ADT to run this code on the server and it works, which makes me think it is a locality issue. But I have to run the code twice for it to work.
EDIT: I decided to play this in a .sqf and remoteExec it. It works this way, just wish I understood why.
_group = ExtractHeliGroup;
_markerName = "moveToLZ";
_waypointPosition = getMarkerPos _markerName;
_waypoint = _group addWaypoint [_waypointPosition, 0];
_waypoint setWaypointType "MOVE";
_group setCurrentWaypoint [_group, 2];
[ExtractHeliGroup, [8584.56,8187.52,0], ExtractHeli] spawn BIS_fnc_wpLand;
wat does that mean getting "streamed"
Some unnecessary data removed from memory (for terrain objects that are no longer needed) and only loaded on demand
oh streamed as in streamlined not like websocket streaming?
I probably could have worded that better
Streamed. Loaded dynamically. Loaded on demand. Arma doesn't keep the whole map in memory.
No not streamlined. Pretty similar to "websocket streaming" as you said it
Streaming means loading something little by little not all at once
Quick question, would: "3:04:55 Mission operation_phantoms_fall.rhspkl: Missing 'description.ext::Header'" prevent a mission from booting?
It shouldn't. As far as I know, it's not required (I've never put it in a single one of my description.exts). The information contained in the description.ext header class is also provided in the mission.sqm by the Editor, anyway.
I'm not sure If I'm articulating this properly, However say I have 3 triggers (Trigger1-3) for 3 helipads. I want to create a repair/refueling area but say I have 3 helicopter (helo1-3).
In each trigger i want the following outcome:
the helicopter is repositioned to the helipads precise location.
disable simulation for the driver of the vehicle or disable control for certain amount of time.
But what puzzling me is, what if i want the trigger to be activated by any on the helicopter, meaning helo1 can activate trigger 3, helo2 can activate trigger 1 - basically any helicopter can land on any helipad and do the following. Again I'm really sorry if I cant articulate what I'm trying to say any better.
Do you mean heli1 only should trigger trigger1, not others, same for 2 and 2, 3 and 3?
I was thinking about that but what if helo1 lands on the helipad with triggger2 that means nothing would happen, i guess I'd like to add some randomness to each helipad
I feel like there should be some event that triggers when a heli lands, but apparently not.
I guess you could create three tiny triggers with a limited z axis.
The actions aren't difficult. You can use disableAI to turn off the pilot. setPosATL to the pad's position should work for the reposition.
If you delay the actions with a spawn for a few seconds then that should allow the heli to finish landing first.
I could try that, but instead of having a variable name for the helicopters can i just use the class name
So instead of giving every helo a name i can have multiple class variants
Doesn't need either really. You can just check for a heli that's actually on/near the pad.
How do i go about doing that?
Could probably use thisList in the trigger activation.
Down side of triggers is that if another matching object enters the trigger area and remains there, then it won't detect a heli landing.
I see, so what if I set the condition with all the vehicles I want to activate the trigger
I think the only option you get is "VEHICLE"
oh, I guess there is the trigger condition. I'm not sure how that interacts with the non-scripted parts.
Ok thank you, I’ll see what I can conjure up much appreciated
https://community.bistudio.com/wiki/targetKnowledge
I've noticed that the position returned from this command is in "Position" format whilst all the other commands i know require PositionAGL or PositionASL
Does anybody know how to convert them? when i try to use Position it just throws out errors about receiving type: Any, expected: number
Doesn't matter. Only difference between these are Z-axis handling, and I know your context where you need to mess around with markers, it essentially never be an issue
It either returns AGL or ASL position. You can easily check which one it is. If the height of a ground target is near 0 it's AGL, otherwise it's ASL. (iirc it was ASL for this command)
What you say about "using position throws error" makes no sense. As POLPOX said it's still a position (3D vector) and only its Z might be different, so you're doing something wrong yourself
is there a way to make collision work for attached objects? I mean for Soldiers the collision works, but not for Vehicles anymore. Example
A attachTo B
A has lost collision
B has also lost collision
possible to let A or B have collision again while being attached?
You can move it manually every frame
Also if you attach A to B, B should still have collision
it has but only for Soldiers.. dont know why not for vehicles anymore
Are you on perf or dev branch?
because im trying to make a static MG not being moveable by vehicles crashing into it and ive attached the MG to a invisible MG defined as a house.. it works its attached and AI is able to use and fire the MG but i can drive trough
profiling branch atm
Maybe the recent multithreading changes broke it?
Can you test stable?
ill try 👍 will give feedback
I can't reproduce this on dev. I attached an MG to an invisible wall (which is a house) and the wall still has collision
with a tank?
hmm
here's a script to try:
_w = "Land_InvisibleBarrier_F" createVehicle [0,0,0];
_mg = "B_HMG_01_high_F" createVehicle [0,0,0];
_w setVectorDirAndUp [[0,1,0], [1,0,0]];
_w setPosASL (player modelToWorldWorld [0,5,0]);
_mg attachTo [_w, [-2,0,0.7]];
_mg setVectorDirAndUp [[0,1,0],[-1,0,0]]
invisible MG
do you use hideObject?
or have you actually created an invisible model?
i did a invisible model
i got fixed it, ive forgot to add GeometryPhys, only did Geometry LOD 
red one is the invisible one later
but if you don't have a physx lod, the game should use geometry instead 
doesnt look like
for infantry yes
im doing invisible doubles for staticMG classes (defense turrets) so they cant be moved by tanks, cars amd other bigger vehicles
because even if you set the Mass up in the model you still can move it while drive into it
thanks a lot Leopard20 👍
@little raptor hay m8 you missed End of Block up there last line 🙂
it's not needed
private _rang = _x select 0;
private _uniform = _x select 1;
private _headgear = _x select 2;
private _farbe = _x select 3;
this addAction [
format ["<t color='%1'>%2</t>", _farbe, _rang],
{
params ["_target", "_caller", "_actionId", "_arguments"];
_target forceAddUniform (_arguments select 0);
_target addHeadgear (_arguments select 1);
},
[_uniform, _headgear]
];
} forEach [
["Rekrut", "U_23pzd_inf_gren_m43_02_oc_gb", "H_23pzd_mann_ehfm_01_feldgrau", "#FFFFFF"],
["Pzobgren", "U_23pzd_inf_obgren_m43_01_oc_gb", "H_23pzd_mann_ehfm_02_feldgrau", "#FFFFFF"],
["Gefreiter", "U_23pzd_inf_gefr_m43_03_oc_gb", "H_23pzd_pin_mann_ehfm_03_feldgrau", "#FFFFFF"],
["Obergefreiter", "U_23pzd_inf_obgefr_m43_04_oc_gb", "H_23pzd_pin_mann_m38_01_feldgrau", "#FFFFFF"],
["Obergefr6", "U_23pzd_inf_obgefr6_m36_02_oc_gb", "H_23pzd_pin_mann_ehfm_04_feldgrau", "#FFFFFF"],
["Stabsgefr", "U_23pzd_inf_stgefr_m36_07_oc_gb", "H_23pzd_pin_mann_ehfm_05_feldgrau", "#FFFFFF"],
["UA", "U_23pzd_zeiser_m43_01_oc_gb", "H_23pzd_pin_mann_m38_01_feldgrau", "#FFFFFF"],
["Unteroffizier", "U_23pzd_inf_uffz_m36_03_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_02", "#00FF00"],
["Unterfeldwebel", "U_23pzd_inf_ufw_m36_04_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_02", "#00FF00"],
["Feldwebel", "U_23pzd_inf_fw_m36_08_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_01", "#00FF00"],
["Oberfeldwebel", "U_23pzd_inf_ofw_m36_07_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_02", "#00FF00"],
["Hauptfeldwebel", "U_23pzd_inf_hptfw_m36_06_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_0", "#00FF00"],
["Leutnant", "U_23pzd_inf_lt_m40_01_rb", "H_23pzd_pin_inf_schirm_01", "#FF0000"],
["Oberleutnant", "U_23pzd_berg_m40_01_rb", "H_23pzd_pin_pzgren_schirm_01", "#FF0000"],
["Hauptmann", "U_23pzd_keppler_m40_01_rb", "H_23pzd_pin_pzgren_schirm_01",
];
systemChat "Uniform- und Mützenaktionen wurden hinzugefügt.";```
So it works ... on paper, in singleplayer etc
However issue now i am having is that on the main server the uniform swaps kinda dont work. They either just delete everything on that AI or randomly sometimes for a second select at least a uniform from one of the ranks.... no consistancy.
Should i try to put it into a sqf.? bc rn i have it in in the init field ingame on that AI
missing part of the last array ("Hauptmann" one) as posted 
Sry i had to cut out a bit
this is the full script:
private _rang = _x select 0;
private _uniform = _x select 1;
private _headgear = _x select 2;
private _farbe = _x select 3;
this addAction [
format ["<t color='%1'>%2</t>", _farbe, _rang],
{
params ["_target", "_caller", "_actionId", "_arguments"];
_target forceAddUniform (_arguments select 0);
_target addHeadgear (_arguments select 1);
},
[_uniform, _headgear]
];
} forEach [
["Rekrut", "U_23pzd_inf_gren_m43_02_oc_gb", "H_23pzd_mann_ehfm_01_feldgrau", "#FFFFFF"],
["Pzobgren", "U_23pzd_inf_obgren_m43_01_oc_gb", "H_23pzd_mann_ehfm_02_feldgrau", "#FFFFFF"],
["Gefreiter", "U_23pzd_inf_gefr_m43_03_oc_gb", "H_23pzd_pin_mann_ehfm_03_feldgrau", "#FFFFFF"],
["Obergefreiter", "U_23pzd_inf_obgefr_m43_04_oc_gb", "H_23pzd_pin_mann_m38_01_feldgrau", "#FFFFFF"],
["Obergefr6", "U_23pzd_inf_obgefr6_m36_02_oc_gb", "H_23pzd_pin_mann_ehfm_04_feldgrau", "#FFFFFF"],
["Stabsgefr", "U_23pzd_inf_stgefr_m36_07_oc_gb", "H_23pzd_pin_mann_ehfm_05_feldgrau", "#FFFFFF"],
["UA", "U_23pzd_zeiser_m43_01_oc_gb", "H_23pzd_pin_mann_m38_01_feldgrau", "#FFFFFF"],
["Unteroffizier", "U_23pzd_inf_uffz_m36_03_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_02", "#00FF00"],
["Unterfeldwebel", "U_23pzd_inf_ufw_m36_04_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_02", "#00FF00"],
["Feldwebel", "U_23pzd_inf_fw_m36_08_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_01", "#00FF00"],
["Oberfeldwebel", "U_23pzd_inf_ofw_m36_07_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_02", "#00FF00"],
["Hauptfeldwebel", "U_23pzd_inf_hptfw_m36_06_cc_jb", "H_23_pzd_pin_inf_uffz_schirm_0", "#00FF00"],
["Leutnant", "U_23pzd_inf_lt_m40_01_rb", "H_23pzd_pin_inf_schirm_01", "#FF0000"],
["Oberleutnant", "U_23pzd_berg_m40_01_rb", "H_23pzd_pin_pzgren_schirm_01", "#FF0000"],
["Hauptmann", "U_23pzd_keppler_m40_01_rb", "H_23pzd_pin_pzgren_schirm_01", "#FF0000"],```
["Panzermann", "U_23pzd_hoffmann_jb_aufkl", "H_23pzd_pin_mann_ehfm_03_panzer", "#FF69B4"],
["Panzergren", "U_23pzd_pzgren_pzobgren_m43_01_va_cc_jb", "H_23pzd_pin_mann_ehfm_04_feldgrau", "#90EE90"],
["Aufklärer", "U_23pzd_aufkl_gefr_m43_04_va_oc_gb", "H_23pzd_pin_mann_ehfm_05_feldgrau", "#FFA500"],
["Sanitäter", "U_23pzd_richter_m43_01_oc_gb", "SPE_m42_stahlhelm_Sani", "#00008B"],
["Artillerist", "U_23pzd_stug_pzgren_wrap_07_pka_va_gb", "H_23pzd_mann_ehfm_01_panzer", "#8B0000"]
];
systemChat "Uniform- und Mützenaktionen wurden hinzugefügt.";```
and if so: can you explain to me where or what i did wrong? I am fairly new to this whole thing and have no idea what i am doing tbh xD
nothing looks obviously wrong
Well but something must be wrong... Bc it just doesnt work correctly xD
works alright in MP, though
(the only changes i've made were vanilla uniform/headgear classes)
what you mean? Like for example "U_23pzd_aufkl_gefr_m43_04_va_oc_gb" ??
with Hauptmann being ["Hauptmann", "U_C_Poloshirt_salmon", "H_HelmetB_plain_blk", "#FF0000"] 
well i use inhouse mods and the SPE-stuff
left window hosts from 3DEN, right is client
those uniforms and headgear is from our arsenal
code as posted looks correct. Code as posted works correctly on my machine. I can't see anything that can go wrong from what's available here 
yeah ... for me as well
It works when i post it in editor, test in MP
But when i put it into our actual server and launch the mission its fucked
or maybe it is bc of lag? bc we have quite a few things placed down to accomendate our 100+ players in spawn
Hi all. There are some questions about scripts in Arma 3.
I just started to learn the development of this game and I met in Workshop a Dynamic Recon/Combat Operations in a deep past. But the there is the problem, that you can't use the Zeus while playing it and there is a fair question: Can we decompile the maps and edit it.
I think that it is possible because of there are lots of addons, which refer to other mods.
And can we decompile pbo-files?
Can we decompile the maps and edit it
no. you can add or remove (hide) map objects via scripts tho
you can open pbo files using something like PBO Manager or PBO Explorer or other tools
thank you
"//" is used to comment something or it has another meaning in syntaxis
It's a comment
So the same as at C#. Ok.
if you use syntax highlighting it's easy to say what's what
The active code here is literally a forceAddUniform and an addHeadgear, executed client-local. So at least simplify the code to two lines that don't work and then figure it out from there.
Exist some extension for Arma 3 to work in more comfort conditions?
VSCode:
https://marketplace.visualstudio.com/items?itemName=SQF-VM.sqf-vm-language-server
Notepad++: (there are others too; this is mine)
https://github.com/Leopard20/NPP-SQF-UDL
Game mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168
Thanks
it works
it was literally server-lag bc there were bugged out vehicles that took way too many server ressources
so thanks tho ^^
the latest language server is hemtt, but it doesn't lint yet
Does init.sqf execute for JIP players too?
Yes init.sqf runs for every machine once when they load in or “initialise”
I'm testing coop mission and I'm calling createDiaryRecord in init.sqf to create briefing, but client didn't have any briefing.
My setup is running 2 game instances on same PC, one is listen server and second one client.
Maybe init.sqf didn't run cause of this setup?
inb4 it's run after if !(isServer) exitWith {}; line
Tried again, but this time I selected new mission from editor in mp lobby and loaded it from editor rather then selecting mission previously exported and client is getting briefing now. It's kinda weird, but whatever 
i think the player may not be always set on time
so you could do waituntil { sleep 0.1; !isnull player };
had this problem once
Hey, Guys, does somebody know, where are located pbo-files of addons
Client didn't have any briefing even when joined in progress when I was testing it on exported mission
Workshop?
Yeah
I want check the scripts of one zombie mod
But I can't find the folder with it
STEAM_LIBRARY/steamapps/workshop/content/107410/<id>
Steam library, the one where Arma 3 is installed and you can get mod id from it's workshop link
https://steamcommunity.com/sharedfiles/filedetails/?id=2789152015&searchtext=WBK+Zombie by example here: It`s number is 2789152015?
Yes
Thank you very much
How would I make a filter that would single out variables that aren't already active? The way I have written this unfortunately it is possible to set a variable that is already active. I thought about if else but I have 3 variables, so I think that wouldn't work.
if (_randomRoll < _chance) then {
private _tasks = ["cacheTask", "gunboatTask", "samsiteTask"];
private _selectedTask = selectRandom _tasks;
missionNamespace setVariable [_selectedTask, true, true];
Wanna check if you already set variable from _tasks using setVarible?
I think so. Then remove that variable from the pool of _tasks
I'm not sure how to go about it. I've seen isNotEqualTo before. Maybe there's a way to use that to filter out the ones already true?
Why not to use getVariable to check if variable returns nil?
I'm not against that, I just don't know I would go about it? Like, do I put that in the condition of an if statement?
if (_randomRoll < _chance) then {
private _tasks = ["cacheTask", "gunboatTask", "samsiteTask"];
private _selectedTask = selectRandom _tasks;
if (_tasks == nil) then {
private _selectedTask = selectRandom _tasks;
};
missionNamespace setVariable [_selectedTask, true, true];
Maybe this?
_tasks arent nil because you define that before check.
if (isNil { missionNamespace getVariable _selectedTask }) then {
missionNamespace setVariable [_selectedTask, true, true];
};
Hmmm, I just though of something. isNil might not work. Because I have a trigger condition for each of these that checks for the variable missionNamespace getVariable [cacheTask, false]; for example. So as the trigger condition is evaluated then the variable will go from Nil to false, correct?
So how about this?
if (!{ missionNamespace getVariable _selectedTask }) then {
missionNamespace setVariable [_selectedTask, true, true];
};
if (!(missionNamespace getVariable [_selectedTask, false])) then {
missionNamespace setVariable [_selectedTask, true, true];
};
you can do the same
So this says "If the variable is already true then select another one at random." But then the code stops there, right? So it could happen that it selected that same true variable twice. I want it to reiterate until it chooses once that hasn't been made true already.
if you want this part?
private _tasks = ["cacheTask", "gunboatTask", "samsiteTask"] select {missionNamespace getVariable _x};
if (_tasks isNotEqualTo []) then {
private _selectedTask = selectRandom _tasks;
};
or just remove from your array (make it global) when used.
This may work. Im reading the biki to understand it's function.
True, you could make _tasks global array and remove task from it after task gets selected
I don't understand what the brackets are empty though.
I'm not sure which path to take. As you can gather I am a novice at this. The isNotEqualTo route seems to make the most sense to me so far.
So, you want to have tasks, which you want them to be selected in random order?
Each task only once?
Yeah, okay so I give you the big picture. I have 10 objects with hold action "search for intel". There is a 10 percent chance after the action is complete that it will run the code I posted. But it can only select one of the random variables because that triggers a task for the players. If it was to select the same variable twice it wouldn't make sense narritively for the game to say "you found intel!" but not proc a task because it has already been activated. Sorry if that is confusing.
So that is why I'm looking to remove a variable from the pool. So the random pool of variables will go from 3 to 2 to 1.
You could make _tasks global:
tasks = ["cacheTask", "gunboatTask", "samsiteTask"];
And then, when you want to select task you gonna remove it from array as well:
if (_randomRoll < _chance) then {
private _selectedTask = selectRandom tasks;
missionNamespace setVariable [_selectedTask, true, true];
tasks = tasks - [_selectedTask];
};
Ahhh, so by pulling the tasks code out of the holdAction code block. It ensures that it wont get run again, thus re-adding it to the array.
So functionally both ways produce the same result, right?
private _tasks = ["cacheTask", "gunboatTask", "samsiteTask"] select {!(missionNamespace getVariable [_x, false])};
if (_tasks isNotEqualTo []) then {
private _selectedTask = selectRandom _tasks;
missionNamespace setVariable [_selectedTask, true, true];
};
no, functionaly it won't be same
firstly you are recreating _tasks again and that select is gonna select first or second element and never third
select CODE is not select BOOL
I think I just got this error when I tried the above one.
was looking at {} and thought it might bad
The difference is that yours is worse for performance, because it re-calculates the not-yet active tasks every time.
While the global variable version, just remembers which one are not yet active.
But the impact is super small and doesn't matter for this
Something set your task variable, and put an object into it?
You have an object in one of your task variables.
It looked like your code would only be "true" in the variable
Last time this happened you had a trigger with that variable name or something :P
need more tagging
So in this verison is there a typo? Shouldn't tasks be _tasks?
the idea was to make task global, define it for example at intServer.sqf and then remove elements from it when you will be selecting tasks
but no re-creating of that array
It gets created once and that's how it is gonna remember what was removed
if you gonna create it again with original elements, then you goona lost what you've removed from it
This is working great, tyvm! I get an error once the array is empty (after the 3rd time) so I need to find a way to remove all holdactions once that happens. BIS_fnc_holdActionRemove is what I'll try to start with.
initServer.sqf:
tasks = ["cacheTask", "gunboatTask", "samsiteTask"];
initPlayerLocal.sqf:
// Define objects
private _objects = [obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10];
// Counter for attempts and successful hints
missionNamespace setVariable ["holdActionAttemptCount", 0];
{
private _object = _x;
[
_object,
"<t color='#FFFF00'>Search for Intel</t>",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa", //idle icon
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa", //progress icon
"_this distance _target < 3", //condition
"true", //condition progress
{}, //code on start
{}, // code every tick
{
params ["_target", "_caller", "_actionId", "_arguments"];
// Increase attempt count
private _attemptCount = missionNamespace getVariable ["holdActionAttemptCount", 0];
_attemptCount = _attemptCount + 1;
missionNamespace setVariable ["holdActionAttemptCount", _attemptCount];
// Calculate chance (10% per attempt, guaranteed at the 10th)
private _chance = _attemptCount * 10;
private _randomRoll = random 100;
// Creates task for player by using setVariable
if (_randomRoll < _chance) then {
private _selectedTask = selectRandom tasks;
missionNamespace setVariable [_selectedTask, true, true];
tasks = tasks - [_selectedTask];
};
}, // code on finish
{}, // code on interuption
[], //arguements
1, //duration
8, //order from top
true, //remove on finish
false, //show if unconcious
false //show in middle of screen
] call BIS_fnc_holdActionAdd;
} forEach _objects;
So I probobly should place the BIS_fnc_holdActionRemove after tasks maybe in an if statement. Could I use _objects here? I'm not sure what to place in the ID index though. Like this:
if (_randomRoll < _chance) then {
//stuff
private _selectedTask = selectRandom tasks;
missionNamespace setVariable [_selectedTask, true, true];
tasks = tasks - [_selectedTask];
if (tasks isEqualTo []) then {
[_objects, ID] call BIS_fnc_holdActionRemove
};
Guess I need to find a way to pass _objects to within the code block. And probably need to remoteExec this as well for MP.
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
This says I can use the arguments section to pass. But [_objects], //arguements gave me the same error. What am I doing wrong here?
_objects isn't defined in your script; doesn't seem to be an issue with the bohemia function
I have it defined here. I just can't figure out how to pass it into the holdAction. I tried this instead. Just redefining within the if statement:
if (tasks isEqualTo []) then {
private _objects = [obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10];
{ [_x] call BIS_fnc_holdActionRemove; } forEach _objects; };
I dont get an error message this way. But it doesn't remove the actions. I think I need to put an action ID but I dont understand what to put there.
To remove them, take a look at the params under the codeCompleted param.
You can remove the action via _target, _actionID parameters
https://i.imgur.com/i5hNC2m.png
What is _actionID?
Thats the actionID that is added with holdActionAdd I would assume
So do I need to figure out what it's value is or just write _actionID somewhere in my code?
You already have the parameters defined in the codeCompleted section in your code. Basically just switch your
[_objects, ID] call BIS_fnc_holdActionRemove
To
[_target, _actionId] call BIS_fnc_holdActionRemove
Hmm that's what I tried at first. Lemme try again.
Yeah the error is for undefined variable _object
This work's though. However I need to test what happens if one of these object's doesn't exist. Might throw and error.
if (tasks isEqualTo []) then {
private _objects = [obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10];
{ [_x, _actionId] call BIS_fnc_holdActionRemove; } forEach _objects; };
It did not throw an error. Okay... I'll take it.
Now to test in MP.
Hmm, it seems when the client executes the hold action the variable isn't sent to the server.
missionNamespace setVariable [_selectedTask, true, true];
This should send it over the network correct?
Yes.
That's what I thought too. But when I check with ADT the variable isn't defined yet.
Oh this might be it.
private _selectedTask = selectRandom tasks;
tasks is defined in initServer and my holdAction code is in initPlayerLocal
Yeah, its defined on one machine and used on the other
Hmmm so what is stopping it from getting the variable from the server then?
Because if you only define tasks in initServer, then it isn't defiend on the client
Ah Okay that's what I was getting at but didn't articulate well probably. So should I place that in initPlayerLocal instead?
I think it might not work that way because if a JIP player comes then the variable will be rewritten because it's an array of a possible 1-3 variables.
Bouncing these vars back and forth from the server is not a good idea anyway and it sounds like you should redesign.
Like have your holdAction call a function on the server instead.
Dang. That might be above my skill level at the moment. I'm not sure what that means.
It means use remoteExec from the holdAction code (executed on client) to the server
Oh that doesn't sound too bad, but probably another days work for me. I just got a few more minutes before I go to bed so I decided to go back to my original method that was said to be less performant.
Well I think it's working so far. Thank you everyone for the help and ideas! Goodnight!
funny i never use any Tasks, i just put what must be done in the briefing, (this would force you to read the briefing) So i guess if you can't read then you would not know what to do
Hello Awsome people: what would be a good reason, to use Layers, ?
Organisationen and the possibility to enable/disable or show/hide entire groups of entities.
ok thx m8 i understand
so if i'm Exstreamly Organised and i spawn every thing in as the mission progress, then i don't need Layers would that be fair to say
arent layers just for organization purpose (and for toggling on/off). if you create everything via script i dont see point in layers
I put a composition on the workshop a while ago that ran a script on every object within a certain layer so that it was drag and drop for the end user
But I suppose that's not creating everything via script on the end user side
is there some kind of performance gain if we use Layers or No
seems to me there would be a performance drop if we use Layers
There is no performance drop with layers.
Depends on exactly how you're creating things by script.
If, say, you want to have Editor-placed reference points to spawn things from, then you could group them into layers for later access with getMissionLayerEntities. e.g. we've moved into phase B so start creating patrols from all the spawn points in layer 3
Good day. Is there a Get function for setVehicleAmmoDef ? 🤔 Or is there an option to get at least approx. value? I'm trying magazinesDetail but parsing strings doesn't seem ideal.
Are there many resources on creating ACE compatability patches for weapons? I wanted to get a weapon working with ACE and though it would be a case of re-assigning magazines and ammo, but am not having much luck. Don't want to mooch of my betters but I can't seem to find many resources on the topic. Any leads?
It's alright, but doesn't return 'max ammo', although it kinda could be got from ammo classname. Anyway, thanks for giving it a thought.
when using "setAperture" command, making a pretty bright moonshine night, is there any workaround to make the AI see better so they engage you
setSkill
Ask in ACE discord server
See #channel_invites_list
Huh. I kinda like this. I could see some player getting confusing or thinking something is bugged if it doesn't go to their expectations but on the other hand it's way less video gamey and hand holdy.
I read on the forums a while ago that the AI uses something like "camouflage coefficient" to detect you. If that's true maybe there's a way to raise the value of the players to make you more visible?
Actually you have to lower it
Default is 1. So you set it to a number between 0 and 1
The wiki says lower camouflageCoef makes it harder to spot the unit 🤔
How many hours does it take you all to make a mission that is say 1 hour in playtime length?
I assume the more you make missions and the more you understand SQF coding the faster it becomes.
It depends hugely on what kind of mission you're making and how big it is. Not all missions require complex scripted systems; adding more players usually requires more work to account for the increased scale.
it goes to the point where you no longer have anything to code because you code so fast 😛
but may take time to reach that though
Some missions I make use only standard systems from my group's framework. I have very little coding to do. All my time is spent on laying out the mission space itself in the Editor.
For other missions I introduce entirely new scripted gameplay mechanics. In those cases, it can take a few days of iteration and testing to get the result I want - not only to get the code working, but also to get it working in a way that's fun and balanced to play with.
Hello! I'm getting this error on my function:
Error in expression <.11];
private _cameraObject = camCreate _cameraPosition;
_cameraObject cameraEf>
Error position: <_cameraPosition;
_cameraObject cameraEf>
Error Missing ;
But I don't know what's wrong, I don't see anything wrong:
case "setupCamera":
{
private _cameraPosition = [186.15, 16295.2, 1.11];
private _cameraObject = camCreate _cameraPosition;
_cameraObject cameraEffect["INTERNAL", "FRONT"];
_cameraObject camSetTarget [186.15, 16297.3, 1.11];
_cameraObject camCommit 0;
Villas_Camera = _cameraObject;
};
https://community.bistudio.com/wiki/camCreate
missing left argument (camera type)
What does "groups framework" mean? I imagine this means you make missions in a collaborative effort with a group. That must involve added complexity to make sure everyone is on the same page about what needs to be done?
It means we have a framework of scripted systems that serve as the basic starting point for every mission. Loadout assignment scripts, force tracking markers, medical system etc. Common mission features don't have to be rebuilt every time; they're in the framework.
I'm using the camera tutorial on the Biki at https://community.bistudio.com/wiki/Camera_Tutorial
to test camera objects, which works great. I have a camera set up in the editor (a Camera_F object from the Timeline category) but when I switch to it in game with the command in the tutorial (_camera cameraEffect ["internal", "back"]; it switches for about a second and then switches back to my player camera. Are there additional commands needed to make it stick on that camera?
How would I make something happen when a certain control is pressed, like the laser rangefind key.
You have some options depending on the behaviour you want.
addUserActionEventHandler - safe against changing keybinds, but cannot block the action it detects
displayAddEventHandler with KeyDown - can block inputs but requires special handling to be safe for changing keybinds; detects inputs rather than actions so can be more complicated
addAction with a shortcut set - can block some actions but not all; requires an addAction to be available
Thank you
I read it backwards
I thought they wanted to make it harder to spot players
Is this the correct chat for mod development questions? I'm trying to get a better understanding of how the CfgVehicles class is defined, but I'm unsure if this is the right channel.
Apologies - just recognized that Arma3_config is the proper channel.
Using hashmaps on the perFramehandler of CBA instead of arrays wouldnt be faster ? Im curious https://github.com/CBATeam/CBA_A3/blob/2182e35655c2919f09a6db074912087bd33495a8/addons/common/init_perFrameHandler.sqf#L7
I mean for waitAndExecArray and waitUntilAndExecArray, could skip the part of marking for delete etc
and for perFrameHandlerArray would be better I think, would reduce the logic to remove a perframehandler
needing to make an array out of the values probably would be slower in general i expect
so i expect removal and addition could be faster or but normal loop time is probably slower
so the part that is done Often is worse probably so it would not really make sense
hi all! I feel like I'm missing something obvious here:
// This line works in SP
_vehicle addMagazineTurret [_magType, _path, _ammoCount];
// This line does not work in SP
[_vehicle, _magType, _path, _ammoCount] remoteExec ["addMagazineTurret", _vehicle];
Since I'm currently testing in singleplayer shouldn't remoteExec go straight back to my machine and be equivalent to the first line? why wouldn't it work?
Because the remoteExec isn't formatted correctly. It wouldn't work in MP either.
The right-side argument for addMagazineTurret is an array. When it's turned into a remoteExec, it needs to stay as an array, within the [left, right] array of arguments. You're flattening it.
ohh I see, that worked, thank you!
[_vehicle, [_magType, _path, _ammoCount]] remoteExec ["addMagazineTurret", _vehicle];
is it possible to give a trigger or a object health and make it take damage ?
https://github.com/CBATeam/CBA_A3/blob/2182e35655c2919f09a6db074912087bd33495a8/addons/common/fnc_removePerFrameHandler.sqf#L36 uhm, wot? "If array is empty - iterate over it"?
If there's already a handler to remove then it's already going to run that code in the next frame.
Ah, next frame, ye. "Only add removal handler once, add the target to list for removal" 
All entities have damage and dead state but if you mean natual damage from say explosions then it depends on entity simulation type
So no its not possible unless they already have that. You'll need to script simulate damage taking
What do you imagine the hashmap keys to be?
The ID of the handler? That doesn't work because hashmaps are unordered. And mods might depend on PFH's executing in the order they were added.
And you cannot do that when the hashmap might be randomly shuffled at any time.
You could take all elements out and sort them to keep order, at every execution, but that is much worse.
If you wanted to "simplify" the deletion logic here https://github.com/CBATeam/CBA_A3/blob/2182e35655c2919f09a6db074912087bd33495a8/addons/common/fnc_removePerFrameHandler.sqf#L39
You could do that, https://community.bistudio.com/wiki/deleteAt in 2.18 added a new syntax to supply array of indices.
So ```sqf
{
GVAR(perFrameHandlerArray) set [_x, objNull];
} forEach GVAR(perFrameHandlersToRemove);
GVAR(perFrameHandlerArray) = GVAR(perFrameHandlerArray) - [objNull];
Can besqf
GVAR(perFrameHandlerArray) deleteAt GVAR(perFrameHandlersToRemove);
You can do the same kinda thing with waitAndExecArray too.
https://github.com/CBATeam/CBA_A3/blob/2182e35655c2919f09a6db074912087bd33495a8/addons/common/init_perFrameHandler.sqf#L54
It always iterates the first N elements, until it finds one who's time has not come yet.
Remember the index of the last element that is executed (can just use `breakWith _forEachIndex` instead of the exitWith), and then use deleteRange to remove the first N elements.
You could also use findIf to find the index of the last element to be executed.
both select and deleteRange can handle 0/-1 properly.
then just
```sqf
{(_x select 2) call (_x select 1);} forEach (GVAR(waitAndExecArray) select [0, N]);
GVAR(waitAndExecArray) deleteRange [0, N];
The findIf will be so simple that SimpleVM optimization will trigger, but I'm not sure if it will actually be faster, because the number of iterations will be very low.
hi all!
I need to generate random vehicleVarNames for vehicles spawned via script or by zeus. I am a bit concerned about setVehicleVarName locality.
I plead to the gurus of sqf to please look at this method and tell me if this looks safe in the context of MP/JIP 🙃
fnc_assignRandomVarName = {
params ["_vehicle", ["_prefix", ""]];
_varName = "";
while { true } do {
_suffix = call fnc_getRandomSuffix;
_varName = _prefix + _suffix;
// Make sure the name is unique
_existingVar = missionNamespace getVariable [_varName, objNull];
if (isNull _existingVar) exitWith {};
};
[_vehicle, _varName] remoteExec ["setVehicleVarName", 0];
missionNamespace setVariable [_varName, _vehicle, true];
};
Should I set the JIP parameter of remoteExec to true?
(why do you want to set the vehicle var name?)
I'm building a persistent save system and I need to have unique identifiers on vehicles so I could serialize their data and deserialize it back later.
it works fine with vehicles added in 3den because I can set the variable name manually, but with the ones spawned by zeus it's more of an issue.
You don't need to generate var names for that
But anyway to answer your question, you shouldn't generate them randomly. You should use a global number that you increment each time you generate a new number:
// fn_generateUniqueID.sqf
if (isNil "TAG_lastID") then {TAG_lastID = -0xFFFFFF;};
private _ret = TAG_lastID;
TAG_lastID = TAG_lastID + 1;
_ret
It also returns negative numbers to give you more numbers.
But if you don't want that set its initial value to 0
You should also serialize that number btw
I was thinking about an incremental counter but I think it would break in this edge case:
- 10 vehicles are spawned, each with unique number
- Vehicle X is spawned next, gets the index 10
- First 10 vehicles are removed
- Server is shut down, vehicle X is serialized with 10 in its name
- Server is restarted, the TAG_lastID is reset to 0
- After 10 more vehicles are spawned there will be tag collision with vehicle X from the previous server run
You should also serialize that number btw
I mean yeah, that's one of the solutions I guess.
Either way unique tag is a smaller issue here and it can be solved in different ways
Your random number is far more likely to break than an incremental approach.
It's a pseudo random number generator. It just repeats a pattern (how soon it breaks depends on how good it is tho, iirc A3's isn't good)
I don't see why you're sending them to the clients if it's just for serialization?
I want my loading system to work like this (pseudocode)
condition A = vehicle with ID N exists at mission start
if (A) {
apply loaded settings to the existing vehicle
}
else if vehicle with ID N exists only in the database {
spawn new vehicle and apply loaded settings to it
}
that is a very good question tbh 😄
Ok, thanks for the detailed response 
I think I would still like to sync the varname to at least be able to check it during the mission through console commands while playing as a connected client.
But it is true that only the server truly NEEDS to have the varname. Everyone else might experience slight inconvenience at worst, it shouldn't be gamebreaking
are you trying to serialize everything btw?
and what do you serialize to? (mission)ProfileNamespace? or a database?
my current data looks like this:
_vehicleData = [
_className,
_position,
_rotation,
_fuel,
_plate,
_flatAnimSources,
_textures,
_damageStructural,
_damageHitPoints,
_cargo,
_turretMagazines,
_pylons
];
For storage I use this https://steamcommunity.com/workshop/filedetails/?id=1768992669
Not really, my current plan is:
- Predefined objects from a list manually set up in 3Den or in a script
- Additionally, based on mission makers preferences either one of these:
a. Every vehicle or prop that zeus spawns
b. Vehicles that zeus manually chooses to save during the game
also regarding this part:
[_vehicle, _varName] remoteExec ["setVehicleVarName", 0];
missionNamespace setVariable [_varName, _vehicle, true];
it's better to send one message imo:
// fn_setVar.sqf
params ["_vehicle", "_varName"];
_vehicle setVehicleVarName _varName;
missionNamespace setVariable [_varName, _vehicle];
so instead you now do this:
[_vehicle, _varName] remoteExec ["TAG_fnc_setVar", 0];
hmm fair, thanks!
Hello, I am working on a script in which the wind direction and speed updates as a player passes down through altitude blocks. It is an attempt to easily enter real world wind values to be used during HAHO jumps within the game. I have a half working script, but am running into issues with it pulling the data I want it to from an easily editable array. The script is large. Would anyone be willing to give me a hand?
Post the script
// Wind Updater Script: Updates wind when "lead jumper" crosses 1000-ft altitude blocks
// Define wind profile (altitude in feet ASL, direction in degrees "from", speed in knots)
wind_profile = [
[30000, 270, 10],
[29000, 270, 10],
[28000, 270, 10],
[27000, 270, 10],
[26000, 270, 10],
[25000, 270, 10],
[24000, 270, 10],
[23000, 270, 10],
[22000, 270, 10],
[21000, 270, 10],
[20000, 270, 10],
[19000, 270, 10],
[18000, 270, 10],
[17000, 270, 10],
[16000, 270, 10],
[15000, 270, 10],
[14000, 270, 10],
[13000, 256, 49],
[12000, 256, 44],
[11000, 257, 41],
[10000, 258, 37],
[9000, 259, 34],
[8000, 259, 31],
[7000, 260, 27],
[6000, 266, 22],
[5000, 277, 16],
[4000, 297, 16],
[3000, 309, 16],
[2000, 309, 16],
[1000, 310, 17],
[0, 308, 10]
];
// Function to process wind profile into usable format
fnc_processWindProfile = {
params ["_profile"];
if (isNil "_profile" || {typeName _profile != "ARRAY"} || {count _profile == 0}) exitWith {
hint format ["Error: wind_profile invalid - Type: %1, Count: %2", typeName _profile, if (isNil "_profile") then {"N/A"} else {count _profile}];
[];
};
private _processed = [];
{
private _alt_ft = _x select 0; // Altitude in feet ASL
private _dir_from = _x select 1; // Direction wind is coming from
private _speed_knots = _x select 2; // Speed in knots
private _alt_m = _alt_ft * 0.3048; // Convert to meters for Arma
private _dir_to = (_dir_from + 180) % 360; // Convert "from" to "to"
private _speed_ms = _speed_knots * 0.514444; // Convert knots to m/s
_processed pushBack [_alt_m, _dir_to, _speed_ms];
} forEach _profile;
_processed sort true; // Sort by altitude (ascending)
hint format ["Processed profile: %1 entries", count _processed];
_processed
};```
fnc_getWindAtAltitudeBlock = {
params ["_altitude_ft", "_processedProfile"];
if (isNil "_processedProfile" || {count _processedProfile < 1}) exitWith {
hint "Error: Processed wind profile is empty";
[0, 0]
};
private _altitude_m = _altitude_ft * 0.3048; // Convert block altitude to meters
hint format ["Checking block: %1 ft (%2 m)", _altitude_ft, _altitude_m];
{
private _alt_m = _x select 0; // Altitude in meters
private _dir_to = _x select 1; // Direction wind is going to
private _speed_ms = _x select 2; // Speed in m/s
if (_alt_m == _altitude_m) exitWith {
hint format ["Matched block: %1 m - Speed %2 m/s, Dir %3°", _alt_m, _speed_ms, _dir_to];
[_speed_ms, _dir_to] // Return speed and direction directly
};
} forEach _processedProfile;
hint "No exact match, using nearest lower block";
// Fallback: Find the closest lower block if no exact match
private _windSpeed = 0;
private _windDir = 0;
{
private _alt_m = _x select 0; // Altitude in meters
private _dir_to = _x select 1; // Direction wind is going to
private _speed_ms = _x select 2; // Speed in m/s
if (_altitude_m >= _alt_m) then {
_windSpeed = _speed_ms;
_windDir = _dir_to;
} else {
exitWith {};
};
} forEach _processedProfile;
[_windSpeed, _windDir]
};```
[] spawn {
waitUntil {!isNil "leadJumper" && {!isNull leadJumper}};
hint format ["Wind updater running for 'lead jumper'. wind_profile count: %1", count wind_profile];
private _processed = wind_profile call fnc_processWindProfile;
private _lastBlock = -1; // Track the last 1000-ft block to detect changes
while {true} do {
if (alive leadJumper) then {
private _altitude_m = getPosASL leadJumper select 2;
private _altitude_ft = _altitude_m / 0.3048; // Convert meters to feet
private _currentBlock = floor (_altitude_ft / 1000) * 1000; // Nearest lower 1000-ft block
if (_currentBlock != _lastBlock) then { // Only update if block changes
private _wind = [_currentBlock, _processed] call fnc_getWindAtAltitudeBlock;
private _speed = _wind select 0;
private _direction = _wind select 1;
private _dirRad = _direction * pi / 180;
private _windX = _speed * sin(_dirRad);
private _windY = _speed * cos(_dirRad);
setWind [_windX, _windY, true];
hint format ["Wind updated for block %1 ft: Speed %2 m/s, Dir %3°", _currentBlock, _speed, _direction];
_lastBlock = _currentBlock;
};
} else {
setWind [0, 0, true];
hint "Lead jumper dead, wind reset. Waiting for respawn.";
waitUntil {alive leadJumper};
hint "Lead jumper respawned, wind updates resumed.";
_lastBlock = -1; // Reset block to force update on respawn
};
sleep 1; // Check every 1 second
};
};```
can this be used in server?
https://community.bistudio.com/wiki/insideBuilding
i mean, from the server, know if a player is in a building
Should do. sound controllers still exist on the server.
hence stuff like selectBestPlaces still works.
nice
If it dosent you can always use lineintersectSurfaces
there is even example code from killzone_kid:
https://community.bistudio.com/wiki/lineIntersectsSurfaces
yea... but insideBuilding is much better at performance
question, is source code for functions like these available anywhere? Or is it a black box? it's the only function that seems to be doing what I need but it causes noticeable framedrop T_T
https://community.bistudio.com/wiki/BIS_fnc_saveVehicle
All functions can be inspected in the in-game Functions Viewer, available from the Editor Tools menu or from the debug console menu. (Leopard20's Advanced Developer Tools recommended for an improved UI)
I've been using eden enhanced functions viewer and could not find it here, I will try the Advanced tools now
look for "saveVehicle"
ohhh I see, I was searching for BIS_fnc and was not getting anything
but I'm getting now, thanks!
yup
btw the tools look awesome 🤩
Sorry I forgot to look back here.
So what's the issue again?
Can i make the AI ignore or pretend an object is infront of it
yes
I have good luck with the script detecting the "leadJumper" altitude. It won't populate the values in the array where I have the wind data stored
Ok, ignore that, I used AI disableCollisionWith and i got the desired result, the question is how do I write a script to disable 10 objects instead of individually write them in one by one in the objects Init
I read about an effort to increase the performance via CPU multi-threading in Arma 3. Where can I track this feature's progress as it develops?
You would need to specify what your 10 objects have in common.
They’re all just a Cargo platform to simulate an elevated helipad
Could use nearestObjects if you don't want to give them all a variable name.
I tried this:
_platform = [plat_1, plat_2, plat_3, ….etc]
{_x [AI disableCollisionWith] } forEach [_platform]
