#arma3_scripting
1 messages Β· Page 696 of 1
https://cloud.taktischerspeck.me/s/KBcYMkntXYqSDtr/preview
https://cloud.taktischerspeck.me/s/nWM6wJAe5feNaCy/preview
Only thing worked for me is to lower brightness to 90 and increse contrast to 110
so
_Radarrange = getnumber (configFile >> "CfgVehicles" >> _unit >> "components" >> "SensorsManagerComponent" >> "Components" >> "ActiveRadarSensorComponent" >> "AirTarget">> "maxRange");
works in dubug but not in script saying it dosent like the variable
unexspected string to be precise
Maybe the complete error message?
Keep in mind you are getting an number from the config
I'm guessing unit is an object
so you must change it to: typeOf _unit
_unit is class names like "Radar_System_02_base_F"
which when placed in that code in debug works
unexspected string
well there's no such error. post the full error from the rpt
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
hey guys, Im trying to add a simple add action to allow civilian interaction to raise civilian rep using ration handouts. I think my conditions or variable may be used wrong? anyone spot anything obvious?
// civilianobjectinit
_conditions = "(_target getVariable 'CivilianHelped') = nil";
_this addaction ["Give Ration",
{
params ["_target","_caller","_actionId","_arguments"];
if ([_caller, "ACE_Humanitarian_Ration"] call bis_fnc_hasItem) then {
_caller removeitem "ACE_Humanitarian_Ration";
_randomAnswers = ["Thank you!","PizzaStrem?","This is great!","Oh great, Thanks.","This will have to do"];
_target customChat [5, selectRandom _randomAnswers];
_target setVariable ["CivilianHelped", 1, true];
[0.005] call F_cr_changeCR;
} else {hint "you don't have any rations"};
},
nil, 1.5, true, true, "", _conditions
]
Right now the action isn't added at all, I think its either the use of _target in the conditions, or failing to initially set a variable to check for, confusled
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
_conditions = "(_target getVariable 'CivilianHelped') = nil";
wrong in every way
_this addaction
there's no_thisin object init
@stark granite it's the tilde ~ key (next to 1 on most keyboards)
Sorry about that
Thank you sir!
I use _this for all my other object inits and its fine?
np. if you make the first line
```sqf
you'll also get syntax highlighting
Its being called from the KP liberation Object init
Which should just add it directly to the init each civilian placed
I thought you meant Eden object init
anyway
this
_conditions = "(_target getVariable 'CivilianHelped') = nil";
is wrong
Okay, is that because of how im using the _target there?
or the nil
or just all of it xD
change the one in the code to:
_target setVariable ["CivilianHelped", true, true];
and the one in the condition to:
!(_target getVariable ["CivilianHelped", false])
in other words:
"!(_target getVariable ['CivilianHelped', false])"
it's wrong because:
- you're using assignment, not comparison (= vs ==)
- you can't compare anything to nil
So in total, in the object init
[
["civilians"],
{
_conditions = "!(_target getVariable ['CivilianHelped', false])";
_this addaction ["Give Ration",
{
params ["_target","_caller","_actionId","_arguments"];
if ([_caller, "ACE_Humanitarian_Ration"] call bis_fnc_hasItem) then {
_caller removeitem "ACE_Humanitarian_Ration";
_randomAnswers = ["Thank you!","PizzaStrem?","This is great!","Oh great, Thanks.","This will have to do"];
_target customChat [5, selectRandom _randomAnswers];
_target setVariable ["CivilianHelped", true, true];
[0.005] call F_cr_changeCR;
} else {hint "you don't have any rations"};
},
nil, 1.5, true, true, "", _conditions
]
}
],
Looks more viable?
yeah it looks fine
I think
I didn't read the whole thing
but the part I said is correct
Great, Ill give it a test and see what happens π
Thanks for your help leopard, very kind of you!
Do you guys have any idea how I can make a batch file run a .exe on multiple files?
Ah okay will do lol Ill head over there
well, when you use a boolean you can do the condition check immediately. no need for ==.
_target getVariable ["CivilianHelped", false] tries to get the variable CivilianHelped from the _target's var space. if it doesn't exist, it defaults to false
can I define an array from another array like:
array_used-in_mod = [ MYARRAYVARIABLEHERE ]
?
probably a dumb question, Am i able to limit a teleporter to just someones steam ID?
or to a specific squad?
current teleporter i use is
this addAction ["Teleport", {player setPos (getPos Kavala2)}]
for example
not sure what you mean?
yes
mind pointing me in the right direction?
is this teleport function pre-defined?
as in, set once
and never changes during the mission?
you can put something like this in initPlayerLocal.sqf:
params ["_player"];
_allowedSteamIDs = ["12345", "56789", ...];
if (getPlayerUID _player in _allowedSteamIDs) then {
_player addAction ["Teleport", {_this#1 setPos (getPos Kavala2)}]
};
alright thanks
How can I have a task be set to completed when something is taken out of a supply box (or any other box)?
And by something I mean literally anything, not a certain item.
Hey guys
any idea why this is working properly
params ["_unit"];
_whitelist = ["sf_mc"];
(headGear _unit in _whitelist)
but this isnt
params ["_unit"];
_whitelist = ["sf_mc_ComtacIII","sf_nf_mc_ComtacIII"];
(headGear _unit in _whitelist)
Script wise they match up perfectly, but _whitelist seems to be very intermittent :/
@little raptor a mod is using an array, I want to define array contents from outside the mod, doing something like mod_array = [ my_array ]. just not needing to pack every time I change it.
if it's a global variable you can. otherwise you cant
in compares values 1:1 it doesn't compare substrings like you are thinking (for the any in array)
(also this mod_array = [ my_array ] is wrong)
@copper raven What would be the right thing to use here?
you need findIf for that
^ that
Ah ok, will look into that, thanks guys π
params ["_unit", "_container", "_item"];
What do I put instead of "_item"?
Like I said, I want it to activate when any item is taken out, not a certain one.
_item is the item that unit took from the _container
you need to check if _container is the one you want, and then set task state, preferably remove this event handler aswell
How could I check the length of a player's weapon?
- Find the right shoulder position from selections (whatever the name is)
- Create a temporary Fired EH , shoot the weapon with fireAtTarget command, give the precious bullet back (or you can do this on a copied unit with same loadout), get projectile position relative to model space upon firedEH triggered
- Take difference of these positions.
Bonus) Dont hate me if there is a simpler way. π
Funnily enough I was thinking of a similar solution π
Is there any way to check whether or not someone is still being held hostage? (i got a soldier with the "set hostage" checked and I want the task to be set to completed once I untie him)
If you are using 3den enhanced there is. It is acquired with getVariable though I canβt recall the name.
Found it:
unit0 getVariable βEnh_isHostageβ;
you can do it in many ways without Eden Enhanced as well. e.g.:
!captive _unit
or just use your own variable
thanks, will try it out later
is there a way to prevent player looting on uniforms, vests, helmets but not backpacks in multiplayer?
Or restrict items to HAVE to be held in certain storage items? Like you cannot put item x in your bag but you can place it in your uniform?
I basically want to prevent a few things:
- prevent players from stripping modded uniforms and leaving naked base vanilla models all over the place
- Prevent players from looting armor from other factions breaking the immersion of the faction vs faction aspect of my mission
you can compare uniforms and stuff on inventory close, see if player has an unwanted one, if it does, remove it and replace it with the old one(you can save it into some variable)
you can also do the same thing with take eh, if you want the effect to be instant, rather than needing the player to close the inventory first
Is there a way to place a marker down in side, group, etc. remotely?
I want to place down a marker down as a Virtual Zeus in e.g BLUFOR side chat, but when I remote control a BLUFOR unit it still places it in the logic side.
Setting the curator entity to BLUFOR allows me to place a marker in the wanted side when remote controlling a unit, but I was wondering if there was another way.
i think you could use https://community.bistudio.com/wiki/createMarkerLocal
to create only local markers and execute it with https://community.bistudio.com/wiki/remoteExecCall
As target you can just say west Side - The function / command will be executed on machines where the player is on the specified side.
Use the eventhandlers to make it so that if someone pulls enemy uniform a sniper shoots them.
hey, i was trying to find a way to set the probability of presence for a group of people and objects so if one of them is there all of them are there
right now im using an invisible helipad that has the probability set on it and then in the init of every object/unit that i want to spawn i have put !(isnull helipad_1)
strangely this seems to work for spawning the units but not the objects
any ideas?
(sorry if this should be in the #arma3_editor channel)
you can just try passing a random blufor unit to createMarker
if that doesn't work, then the second best option is what TaktischerSpeck said
Question:
- I had two large "unclear" functions, that return nothing - only doing some not time-critical things.
One uses Take EH, the second with CBA PerFrameHandler (3 seconds).
Can I improve performance with spawn?
Like, to place a spawn command inside the EH
_unit addEventHandler ["Take", {
params ["_me","_container","_item"];
[_me, _container, _item] spawn {
params ["_me","_container","_item"];
, and replace CBA PFH with spawn + while loop?
that's probably the worst decision you can make π
unless you run something that would make a noticeable game freeze(not caused by a single command call)
I read before, that using scheduled environment (spawn) won't hit the performance as unscheduled for non-critical scripts when doing large calculations.
What are the cons I could encounter?
well if your scheduler is already full of shit, you will instantly feel a delay of the effect(whatever your take event handler does)
when doing large calculations
like i said you have to be doing something REALLY large for you to have a need to go scheduled for things like that
and even then if its something like a nearestObjects making the game freeze, in scheduled the exact same thing will happen
Ok, thanks.
generally speaking just stay in unscheduled whenever you can, a scheduled script will almost never make things better
Hey how do I find the vic the unit is in?
vic?
vehicle
vehicle, in, objectParent
how to stop a script without terminating the while condition ?
im using a condtion to play a code when the player is in the vehicle but when he get out the code will continue to play
terminate the whole script, or use break in the while
the whole block will run
So make a new thread, and when the player is out, terminate that
quick help if my script activation is execVM "spawnbaddies.sqf"; what will be my termination
terminate "spawnbaddies.sqf"; ?
you need the script handle
some_script_handle = execVM "spawnbaddies.sqf";
terminate some_script_handle
trying to import dialog into the gui editor and i get this errorhttps://gyazo.com/9ebd6399a1d9818ec037d83b93bc37b1
How do i lock vehicles per role?
use getin event handler, and check for role
i have no idea how script anything, so idk what that means lol
Hola, I have a getMarkerPos issue that hopefully someone can help me with. I type this in the debug console for an existing marker -
_mPos1 = getMarkerPos "themarker";
_mPos1```
...and it keeps returning coords 0,0,0 EXCEPT for one time, when it returned real coords. I rebooted, stripped out the CBA function library, and still can't get it to work. Am I doing something wrong?
(i can move the marker, set the color and alpha, etc, just can't get the pos)
ty both, yes, pretty much my take away's as well, ty. @unique sundial
is there a way to control an object's rotation relative to its model space instead of the world space?
@drifting portal The object's model space is linked with the object itself, so it rotates with it too, is it?
You mean like this?
_unit setDir (getDir _unit + 20) //turn 20 degrees clockwise
That code looks fine to me. Check if it's in allMapMarkers.
can you run
getMarkerColor "themarker"
```? that will check if the marker exists as it returns "" otherwise
no
I meant rotation across all axis
X,Y,Z
the third one through setDir
or if you like vectors:
https://community.bistudio.com/wiki/setVectorDirAndUp
yes
@distant oyster How interesting, it returns "". But the marker is placed, not sure how it doesn't exist.
This is going to drive me batty
I was running PPL Markers a few days ago, can a mod permanently change something in Arma?
.. and @robust tiger allMapMarkers returns [] even though I can see all the markers on the map in the editor
iirc there was a bug with Eden markers that was fixed
Recently?
i'm on stable
ok, so I guess I should look up the bug and see when an update is coming? This seems kind of big I would think
if you don't mind a few GB of download you can switch to dev and see
Ok I'll look into that thx..
Yeah, I just wrote a quick script, it returns correctly for allMapMarkers but returns 0,0,0 for marker pos... I'll look into that bug
so I found this command on the wiki:
isUniformAllowed
Description: Check whether given uniform can be dressed by target soldier.
So could i set that so the entire faction checks for this? For example I want my Blufor players to be unable to wear a list of uniforms
_canUse = _unit isUniformAllowed "U_B_CombatUniform_mcam";
Where would be the best place to put this on a dedicated server? and how do i define an entire faction?
The command just checks if a uniform is allowed to be worn, it doesnt change whether or not it is allowed, all uniforms are defined to be used by one or multiple sides in config, this is basically an easy way to check it..
Ok thanks.
So what about forceAddUniform?
Create a new uniform and hard link it into slot (without any restrictions).
hard link? as in it cannot be removed?
It can be removed, the command ignores whether or not a uniform is allowed or not and makes unit wear it
crap lol
Im trying to research a solution to prevent factions from taking uniforms off other factions
if you want to prevent some uniforms from being worn, you need to setup event handlers and check uniform s for that.
That is already done (considering the uniform you use is configured to do so)
and exit with a message like "you cannot wear this" or something
Ok, well im going to have uniform progression i want leveling using MCC, I want to prevent noob players getting higher end uniforms
so event handler?
yes
i need to learn about those a bit more
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take
Check this out , this is one of the cases you need to handle.
Depending on your mission(arsenal etc), you need to handle everything of course
For starters, it is easy to just prevent said uniforms from being taken hence I linked "Take" event , if you want to struggle a bit more, you can always detect manipulations when inventory is opened and check if unit is attempting to change their uniform
ok, few questions.
1: Where do i put this event handler to execute all the time on my server? in descriptions.ext for th mission? or maybe in the server specific config files?
2: can i define player as the "object"
this addEventHandler ["Take", {
params ["_unit", "_container", "_item"];
}];
and would i just make a massive list of uniforms as an array within the EH?
for the "_item"
Is there any way to script an AT unit to hold fire with launcher but still allow him to fire his primary/secondary?
i'm getting an error in my code with "waitUntil {repair_truck inArea[_this, 20, 20, 0, false]};"
it goes "waitUntil {repair_truck |#|inArea[_this, 20, 20, 0, false]}; error 0 elements provided, 3 expected"
waitUntil {repair_truck inArea[_this, 20, 20, 0, false]};
hint "blah";
deleteVehicle _this;
fennek1 = createVehicle ["I_MRAP_03_F", [8590.843, 18453.182], [], 0, "CAN_COLLIDE"];
fennek1 setDir 66.029;
};```
By calling [] spawn you send inArea[[], 20,20,0,false]
Variable _this refers to the thing you sent to function. Empty array in this case. In other words, use your real area center instead of _this.
Morning to you all, I have a simple syntax question, I'm trying to break out of a foreach loop using exitWith, It says that I'm missing a parenthesis ")" . I can't quite put my finger on it, does anyone see the mistake? I wrote it the same way in the wiki examples.
if (_smokeThrown= true) exitWith{ _smokeThrown= false};
ah thankyou
= is to define, not to compare. To compare, ==
Omg, Why am I like this? thanks Polpox
You can use break instead of exitWith now π
Can someone explain me to the correct way to make a patch mod.
or how to setup an environment to edit files and test them?
==
Hello guys, I got a theory question. I made a script that I want to be triggered once per let's just say 1 min. the event that triggers to run my script is a simple "Fired". Currently I have a generic Error since I'm creating an event handler in loop. Does anybody have any ideas on how to approach this?
triggeredL = false;
while {triggeredL= false} do
{
triggeredL= true;
player addEventHandler [
"Fired",
{
_this spawn
{
systemChat "fire!";
_smokeScript = call compile preprocessFileLineNumbers "SmokeCalc.sqf";
_timeBreak= time +60;
waitUntil { time >= _timeBreak };
systemChat "60 seconds passed!";
triggeredL = false;
}
}
];
};
- Why create EH in a loop?
- #arma3_scripting message
I told you!
What part of this code is the script that you want triggered once per minute?
yeah I know its a bad Idea, I just don't know a better way to have something activate my script
_smokeScript = call compile preprocessFileLineNumbers "SmokeCalc.sqf";
Is your intention to run SmokeCalc.sqf when these two conditions are met: The player fires and the last time SmokeCalc.sqf ran was at least a minute ago?
My intention is run my script everytime an enemy fires the first time, I don't want my script to run for every single bullet but with a cooldown. e.g enemy fired, cooldown is now on. the script can't be called again for 1 min
Unit addEventHandler ["Fired", {
params ["_unit"];
private _targetTime = _unit getVariable ["SFW_targetTime", 0];
if (time > _targetTime) then {
execVM "SmokeCalc.sqf";
_unit setVariable ["SFW_targetTime", time + 60];
};
}];
```Something like this perhaps?
Woah,it works perfectly. Honestly, Thanks a lot. You really saved me a lot of time there
If you want something to happen only under a certain condition, use an if-statement π
if you're talking about js === or something similar, https://community.bistudio.com/wiki/isEqualTo is really close
yo bros in MP if a client does createVehicle, is th created vehicle local to the client?
coz i wanna setvectordirandup it
yes
thank you
how do I setup an environment to edit files and test them?
for a mod
I don't want to corrupt anything in arma.
I don't know where to start answering
Maybe some resources I can use?
Making a Mod is completely different thing than a scripting
A Mod can contain some scripts but Mod itself doesn't use any of scripting knowledge
Scripts aren't Mods
Depends on the situation
I'm trying to edit code to change values inside the game.
Without causing errors
or corrupting files.
And what is the goal?
The end goal?
Your goal
Is it possible to detect a specific dropped inventory item near a player?
Zeus Subcategory is missing.
I'm trying to create it.
and put the units that belong to it inside.
Then that's a #arma3_config work, not a script
I see ..
look for weapon holders, and check their cargo
but it's not a config?
What?
Maybe it is.
??
Sweet thanks
nearObjects, weaponholder
Would that apply to IFAKS or none weapons as well?
yes
all items on ground are inside a weapon holder
except backpacks in some weird special cases sometimes if I remember right
Hello. I make OFP missions. How do I make a trigger that detects if the player or a specific object is in the area of the trigger?
An example would be a stolen tank.
sync the trigger with the tank.
Alternatively, give the tank a variable name and set the trigger's condition to myTank in thisList
I don't know if FWatch allows me to sync triggers with units.
I know triggers can be synced with waypoints. I've done that many times
I'll try that I guess.
ello, im trying to replicate the chemlight lamps seen in the contact dlc, but im having problems disabling the mine
currently im attachting a mine to a pole to get the lil peg coming out the top, then the chemlights to that peg to make the effect
but my problem is that the mine is renabling its simulation upon being attached to the pole, so when you run close to the pole, it explodes
i literally cant find anything on this on the web at all on how to have a disabled mine
and im completely stumped
Hi guys still cant seem to figure it out, found a dynamic ai spawning script on yt and ppl here been helping to make it work, it works but it spawn ai via time ques i am wanting to change this to by ai spawned ex. 50 ai in 10 ai waves and spawns in if only 4 are left alive, or the spawning will stop when the trigger is deactivated ex. when players are outside the trigger zone.
yo bros is there a way to change group names in MP lobby?
like change from Alpha 1-2 to something else
With CBA yes
You have to GROUP it with the object not SYNC it π
Oh ok.
if ((player in crew (_tank)) && (group player == "combatbehaviour")
then {
while {vehicle player != player} do {vehicle player engineOn true}
};
it says missing ) in the last line
is there a typo
Yes, there is a missing ) :P
you do not terminate the very beginning (
if ((player in crew (_tank)) && (group player == "combatbehaviour")) <---- this very last one is missing.
oh my they kept me dizzy all day thanks :p
if you aren't using an environment, I'd suggest visual studio code with the .sqf extension. Will pick up and highlight errors like that.
i use notepad ++ and there were syntax highlighter for sqf in armaholic but sadly the website got shut down
Is this the sqf syntax highlighter you were talking about?
Looks like it is (but it's super old)
Janez uploaded them on GDrive iirc. Check the forums
Put this in the Role Description field for each squad leader in EDEN.
Army@MARSOC
This will work in vanilla.
isnt that a CBA feature
there a way to force a keystroke?
no 
lol i guess that's for the best haha
How could some data in profilenamespace be changed after game restart?
I have a save system, that stores save data in profile.
So, on saving it does something like this
profileNameSpace setVariable [Save name,_data];
saveProfileNamespace;
On saving I check the data, and it is ok.
But after load I have some field corrupted - like some of data filed were overwritten after saving.
Is it possible? Maybe I missed something, saving in Profile namespace?
This script above wont save any data in profileNamespace since the variable name is not valid.
Meaning instead of using
profileNameSpace setVariable [Save name,_data];
You need to use something like this:
profileNameSpace setVariable ["saveName",_data];
what is the script if i want to change the group of a squad relation to independent?
setFriend
You can't use it to a group but a side to side (BLUFOR, OPFOR, Independent)
is it possible to set the blufor group to independent via script?
Not directly
https://community.bistudio.com/wiki/setSide
See the bottom note, this command itself is not for it
See the bottom note, this command itself is not for it
Related, what is the point of setting a location's side? As in, how does that affect gameplay?
It does affect something back when 2006? IDK...
Like the Guard waypoints?
Maybe it did in like some CTI, Superpowers or such? Well but I don't think there's a point nowadays
Ah. Weird.
I mean, i suppose its useful for keeping track of a CTI script, but other than that...
@grim coyote It is valid, it is just for example. As I said, it is a working system.
Are you saving any variables of type Object or Array?
Of course, objects not saved. And yes, it is an array of arrays of arrays etc π
Try saving the copy of arrays:
profileNamespace setVariable ["stuff",+_arr];
Is there any reason to do it, taking in account that everything in that data structure generates automatically on save?
You mean that there could be a mutable array? Seems like there are no one, the corrupted list is based on array copy already.
At least I don't see it, but as the problem exists, I'm doing something wrong obviously π
I just thought the issue might be in the fact, that arrays are reference types. So you would be passing a reference to the array and not the contents themselves.
Might be wrong Β―_(γ)_/Β―
Here is the working part of the save:
private _recruits = server getVariable ["recruits",[]] apply { // The server variable that stores recruits data - it can contain obejcts
private _d = +_x; // make copy of the element, element is the array
if (count _d == 6 && {(_d#2) isEqualType objNull}) then {
_d pushBack 0;
private _unit = _d#2;
if !(isNull _unit) then {
_d set [4,getUnitLoadout _unit];
_d set [2,getPosATL _unit];
_d set [6,[_unit getVariable ["OT_xp",0],_unit getVariable ["OT_from","Oreokastro"]]];
};
if !(isNull objectParent _unit) then {
_unit remoteexeccall ["OT_fnc_assignedVehicleRole",_unit];
waituntil {count (_unit getvariable ["OT_assignedVehicleRole",[]]) > 0};
private _role = _unit getvariable ["OT_assignedVehicleRole",["cargo"]];
_d pushback [typeof objectParent _unit,_role];
_unit setvariable ["OT_assignedVehicleRole",nil,true];
};
};
_d
};
_data pushback ["recruits",_recruits];
When created, _data is saved in profilenamespace
Recruit array element format formatted for save should be like:
server variable for active recruits keeps soldier objects instead of coordinates.
So, during a save process it should be replaced with coords - and in the most of cases it does. But there is a 8-10% chance that the saved array will be corrupted. I still can't catch when it happens exactly.
Hm... The coords are the array. Can it be the cause? Like _d variable, that comes to the save, keeps a mutable object from server variable, and once it changes, the data in profilenamespace changes too?
if the profile namespace is like other namespaces then sure
even if you unary +, it still is a reference because everything is passed by reference. You might want to deep copy an array like you did, if for example the value of it got modified(via set or so) before the serialization happened, though if the saving doesn't happen super often, you can just call saveProfileNameSpace right after you setVariable.
You mean that the referenced data could be changed before saving profilenamespace variables? Maybe, the save process is about 15-30 seconds.
Ok, thanks, at least I know where the cause π
if you save multiple times it could also be mutated before the next save
just make a copy of the mutable array
just explicitly call saveprofilenamespace right after you set the variables, unless you're saving this frequently, then deep copy
that may not solve the problem
"if you save multiple times it could also be mutated before the next save"
Of course it will. It is supposed that it will mutate.
The recruits list for saving created on each save from that mutable list.
The problem most likely the server variable with objects can be changed during the save.
are you doing this in scheduled
oh you are
this whole thing seems rotten then
there will be all sorts of race conditions i'm sure
I doubt it can be called "race conditions" exactly.
The save process could take a long time, but it just reads data, and it does nothing with obejcts.
you made it sound like someone else might be mutating that array at the same time
Yup, this is what I think.
Another question: what spec should I read from the vehicle config (not vanilla) to check if it can attack aircrafts? radarTarget? Or should I read some params from weapon/ammo?
that's exactly what a race condition is: unsynchronised concurrent mutation of the same data
Absolutely, but it is the unwanted effect, that is not supposed to be there π So I'm trying to fix it.
Beside it, there should be no such situations.
so find all the mutations to those arrays in your project and synchronise with them
or alternatively deep copy this server getVariable ["recruits",[]] before you start iterating over it
Is there a command with the ability change the "style" value of a GUI textbox? I want to have a text box in a vehicle RSc that is only surrounded by a frame (style = 162;) under certain circumstances. Seems it would be more efficient to change the style of a single text box element between styles 2 and 162, rather than overlay a framed box element over the top of the text and show/hide that second element
Style is static
Unary + is already a deep copy
yes i know
In what way is the data corrupted? Can you post the comparison here?
Yeah, I worded that poorly. I meant "take a snapshot" of the array.
@robust tiger Null-objects instead of coordinates.
Does _unit return objNull in the corrupted cases? I feel like some of
the units in recruits in the server namespace are set to objNull.
Hi, i need some help. I'm using EdenEnhanced to allow the respawn with fresh loadout after death. Unfortunately, it loads and restores the default class form the unit ignoring any customization i made in the eden arsenal. Does anybody knows how to achieve this?
@robust tiger We already figured out the issue, thanks.
"I feel like some of
the units in recruits in the server namespace are set to objNull"
Depends on the script. Actually, no, it doesn't contain objNull, but it doesn't matter. Just need to be very careful with mutable objects, like lists.
yo bros any idea why this works
playSound ["chimera1_1",true]
but remoteexec doesnt
["chimera1_1", true] remoteExec ["playSound"];
Hi how do i attach a trigger to a unit so that it work even when the unit ride a vehicle cause as of now the trigger only work when the unit isn't in a vehicle ?
vehicle MyUnit in thisList
anyone know how to get the Arma Script Profile to work again?
ask in Dedmen's server
ah ok got it thank you
How does one edit a mod that was download from the workshop onto a server? I'm trying to add a file to a mod then repack and reupload the changed file but that isn't working.
I know absolutely nothing about BI coding. I've tried looking around but there isn't much that isn't outdated.
anyone knowledgeable with arma scripts able to help me with a simple one? I'd just like a script to display the current damage value of a house/structure when I shoot it (for testing purposes)
yes
cursorObject addEventhandler ["handleDamage", {
params ["_object"];
systemchat format["Current damage value: %1", damage _object];
}];```
or that
ah
I'm struggling to keep AI from swimming from the surface
you mean they go under water?
to the surface*
they're underwater, and I'm trying to keep them there, but they just want to swim up lol
do they have a rebreather?
and goggles, and wetsuit
what about swimInDepth command?
So many commands didn't know that existed. will report results.
Negative they still gradually swim upward
i have an idea
@runic spoke How about waypoints? What is the ASL height of it?
Ah, that's it, I'm using ATL
you should use AGL
?
getPos is AGLS
what do you use?
(as in what command do you give them to move)
waypoint
in Eden?
negative
addWaypoint?
correct
_wp setWPPos [ATLtoASL _pos, -1];
radius is 0
don't use setWPPos
set the radius to -1 in addWaypoint
@runic spoke read
https://community.bistudio.com/wiki/addWaypoint
https://community.bistudio.com/wiki/setWPPos
to know why
Just a question, what is the command to open the Warlords menu as a scripting function? I want to add it to the pause menu as a button. Thanks.
hmmm, still gradually swimming to surface π€
https://community.bistudio.com/wiki/Category:Function_Group:_Warlords
Probably one of those
do you think it could be related to createGuardedPoint
Β―_(γ)_/Β―
good answer
Forgive me I'm completely new and not completely sure how to use this, I tried placing a unit down in the editor and creating a trigger with "this" condition and this script in the on activation (then playing as the unit) and it wasn't triggering
Change cursorTarget to the name of your building
If you want to use it in your trigger
Sweet, they no longer swim to the surface.
Think the only other cause would be if their group leader is on the surface in a boat. π€
yup, rip lol
Thanks Leo, fixed it.
Credited
Hello guys I need a help with a script.
So I found this hacking script on internet which I intend to use in my multiplayer scenario.
It works like this: You come up to a object which gives you option to hack it.
Once you interact with it a silentHint should show up for everyone on the server (players) and it should show everyone progress as it finishes with message "Hacking terminal was succesful".
I added this to the init of the object: this addAction ["Hack Terminal","hacking.sqf"];
But the main problem is that when I use this script in MP scenario it only shows the progress for the player who activates it and it doesnt show any messages to other players at all. How can I make it so it shows those messages to everyone?
Please help me with this problem.
`_unit = _this select 0;
_caller = _this select 1;
_action = _this select 2;
_unit removeAction _action;
hintSilent "Hacking started...";
sleep 1;
hintSilent "Hacking 5% completed.";
sleep 2.5;
hintSilent "Hacking 10% completed..";
sleep 4.5;
hintSilent "Hacking 15% completed...";
sleep 4.5;
hintSilent "Hacking 20% completed.";
sleep 4.5;
hintSilent "Hacking 25% completed..";
sleep 4.5;
hintSilent "Hacking 30% completed...";
sleep 4.5;
hintSilent "Hacking 35% completed.";
sleep 10.5;
hintSilent "Hacking 40% completed..";
sleep 6.5;
hintSilent "Hacking 45% completed...";
sleep 4.5;
hintSilent "Hacking 50% completed.";
sleep 4.5;
hintSilent "Hacking 55% completed..";
sleep 7.5;
hintSilent "Hacking 60% completed...";
sleep 4.5;
hintSilent "Hacking 65% completed.";
sleep 4.5;
hintSilent "Hacking 70% completed..";
sleep 7.5;
hintSilent "Hacking 75% completed...";
sleep 8.5;
hintSilent "Hacking 80% completed.";
sleep 4.5;
hintSilent "Hacking 85% completed..";
sleep 6.5;
hintSilent "Hacking 90% completed...";
sleep 4.5;
hintSilent "Hacking 95% completed.";
sleep 6.5;
hintSilent "hacking 99% completed..";
sleep 8.5;
hintSilent "Hacking 100% completed...";
sleep 4.5;
hintSilent "Hacking finished";
playSound "scoreAdded";
sleep 1;
hintSilent "Hacking terminal was succesful.";`
use remoteExec
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Hi, anyone know how to increase AI damage when using ace?
Speciffically on the Max_Aliens mod if that matters
Can I put a script thats called by initPlayerLocal.sqf and the script itself is a .sqf into a mod?
Like would it work sorta thing if the @mod has a initPlayerLocal.sqf and script.sqf inside
Yo bros is there a way to disable interaction with a fireplace?
Like usually u get the option to turn off fire
Disabling sim removes the fire
Oh.. my bad you want the fire on
Yes want to keep it burning
The code to get it to burn is
this inFlame true;
You could probably add a check to see if it's not burning then make it start back up automatically
If bla inflamed false then bla inflame true? I'm not a wizard in all honesty :(
This might work??
Β [this]ο»Ώο»ΏΒ ο»Ώcall BIS_fnc_replaceWithSimpleObject;
Sorry for format I'm on phone
Prolly you can place particles manually
Ahh yeah i think best way is to make fireplace as simple object then create particle manually
Thanks guys
Welcome!
There's no way to remove. If the condition allows you probably can hide it
Example on hiding?
https://forums.bohemia.net/forums/topic/222357-disable-interactions/
This might be similar I'm not sure
Towards the bottom someone made a script for loot on the ground or something maybe could tweak it
no
use functions
Ok thanks Leo
Any ways to "lock" the infantry within a vehicle? enablesimulationglobal false?
https://community.bistudio.com/wiki/setUnloadInCombat might be close to what you want
they dont bail the moment they come under attack
Oh, thanks
also, they turn out until they come under attack which looks cool
allowCrewInImmobile might help you, depending on what you want to achieve and under what conditions
yes, that too π
"allowCrewInImmobile"
I meant - in undamaged vehicles, mostly apcs.
I have complex AI scripts, and sometimes infantry like to disembark when they shouldn't π
As I couldn't find a response to you question - does anyone know the answer to this?
Can a domain name be used instead of an IPv4 address in connectToServer (I believe those are the right terms, but I'm not sure)?
Hi, I'm still trying to figure out a way to check the length of a player's weapon. So far I've tried measuring the distance between the bullet as it is fired and the player's shoulder but this is quite inconsistent. The bullets don't really originate from where they're supposed to.
Another method I tried was using createSimpleObject to spawn a .p3d model of the weapon, then getting selectionNames from that and checking the position of "muzzle". However it seems that all selections of the model are at [0,0,0]. I also tried this method with createVehicle and groundweaponholder but it is the same issue there.
Starting to run out of ideas really. Getting the "muzzle" from the selections seems promising but all the parts are in the center of the model for some reason.
why exactly do you need the weapon length?
For a wall avoidance thing. You know, making CQB harder with a M200 Intervention π
What is the intent? Just to keep a player from using a heavy rifle in CQB, or something more abstract?
wall avoidance is already built into the game (the rifle collides with walls) so i'm not sure what you want to put on top of that
Granted, while weapon handling and size are supposed to matter, its easier to spray and pray with an LMG than to clear a corner with an SMG, so there is a bit of real-world/gameplay disconnect.
Perhaps this is a little off-topic, I'm just interested if anyone has ideas for checking the length π
show some code what you actually tried. Theres a good chance you just did something wrong when dealing with model positions
Have you had a look at https://community.bistudio.com/wiki/boundingBoxReal and its associates?
(I have no idea if these work with weapons / simple objects)
^use ClipGeometry otherwise it might count the muzzle flash into size calculation...
Not familiar with this one, I'll try it thanks
is it possible to turn an object's reference into a number or string, and back again into an object?
I would like to use objects as keys for a hashmap, but thats not supported
@austere hawk Why not to just turn your object representation into a string?
Like str(_veh).
When checking: if str(_veh) isEqualTo _key
But you can run into name conflicts, so I think object string representation is not enough
how do you turn it back into object is the question?
hm... guess i could just save the object in the data array...
@austere hawk
"hm... guess i could just save the object in the data array..."
I think the best way is to set unique names to your obejcts
There is https://community.bistudio.com/wiki/BIS_fnc_netId, but it uses an SQF Array internally.
What I recently thought of is using https://community.bistudio.com/wiki/vehicleVarName (and setVehicleVarName with a code-generated name in case no var name exists yet), that way the intermediate Array lookup can be avoided since Arma namespaces are based on hashmaps.
netId, getObjectFromNetID lol
use array just in case of SP with the function, or does netID command use array too?
I don't know the answer to that question, only the green people can see inside the engine π
it uses sqf array but only in SP so that you can use netID in sp and it will work just as well in mp, why you brought it up, is there a problem?
it is in fact one of those cases when it is easier to have sqf solution than implement it in engine
i'm going to use it for MP, so using "less optimal" for SP is no problem in this case
We are just wondering what the time complexity of the implementation of the netId command is.
what do you mean?
Consider this lookup process:
_objId = netId MyObj; //Complexity: O(?)
_val = MyHashMap get _objId; //Complexity: O(1)
//Total complexity: O(?) + O(1) = O(?)
```I would like to know whether `netId` is slow enough to significantly increase the overall complexity of that lookup process.
So for instance if netId had a time complexity of O(n) that would mean that the whole lookup process takes O(n), ruining the constant-time key lookup of the HashMap.
This works, thanks a lot π
Can anyone help with weaponDirection? Which of the vector commands should I be using to get an object oriented the same way as the player's weapon?
Can't imagine netId not being constant time. Last I checked all user implemented hash tables used find or the like for performance and that is then O(n) anyway.
What is the use case that one wants to use a object as a key, and still need the data when the object is gone? Because, otherwise, you might as well just store the value directly on the object using setVariable.
https://community.bistudio.com/wiki/HashMap
There is no longer a need for user implementations π
Nice.. Still using the object itself and setVariable means you don't have to worry about clearing the key when the object is gone.
afaik no, but I also didnt try very long
except that in engine complexity basically doesn't matter because no matter how bad it is, its still faster than executing a single script command.
how do i terminate a loop script?
how do I make it stop? the script you edited @willow hound
terminate _scriptHandle;
Czepis is right, you can use terminate (more information on that here: https://community.bistudio.com/wiki/terminate).
However, if you use terminate, the script will not have the opportunity to clean up (delete) the units it created. If you can live with that, use terminate, but if you want the script to clean up after itself we will have to use a different approach.
Say i have a script, that uses some global variables (larger arrays/ hashmaps). When i call a function in that script, is it better/equal/worse to pass the variables i already got via getVariable to the function VS the function pulling the data again via getVariable?
basically same thing
of course though doing
[getVariable "stuff1", getVariable "stuff2"] call function
EVERYTIME you call the function is nonsense
but passing a local variable that you already have is cheaper than letting the function do getVariable again
ok thanks. Thats what i meant, i already have the global variables, because i need the data in the main script anyway, but i also need the data in the function.
you can of course save even more performance by not passing them but still using the 
myFunc= {hint _myVar;}
_myVar = "test";
call myFunc;
but if your code is open source or you expect anyone thats not you to fiddle with it, then probably don't do that π
I'm wondering if it increases the "lookup overhead"?
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
syntax highlighting plz
how do i do it?
look at Hypoxic's message
it does
ph this?
////Local Player Check
if (isNull player) exitWith {};
//Variables
private _bluforMarkers = [
"marker_1",
"marker_2",
"marker_3"
];
private _opforMarkers = [
"marker_4",
"marker_5",
"marker_6"
];
private _guerMarkers = [
"marker_7",
"marker_8",
"marker_9"
];
//Hide All Markers
_bluforMarkers + _opforMarkers + _guerMarkers apply {
_x setMarkerAlphaLocal 0;
};
//Show Markers Depending on Side
switch (side group player) do {
case "west" : {
_bluforMarkers apply {
_x setMarkerAlphaLocal 1;
};
};
case "east" : {
_opforMarkers apply {
_x setMarkerAlphaLocal 1;
};
};
case "independent" : {
_guerMarkers apply {
_x setMarkerAlphaLocal 1;
};
};
default {};
};
would that be correct?
yeah delete the old one
oh its because case needs to be correct case
oh hi hypoxy
thats my bad
fine,what do i do
change those strings of "west", "east", "independent" to west, east, independent without the quotes
switch (side group player) do {
case west : {
_bluforMarkers apply {
_x setMarkerAlphaLocal 1;
};
};
case east : {
_opforMarkers apply {
_x setMarkerAlphaLocal 1;
};
};
case independent : {
_guerMarkers apply {
_x setMarkerAlphaLocal 1;
};
};
default {};
};
the way I had it it would compare "west" to "WEST" which is false
does an addAction script run locally for the player who used the action?
so would there be no need to do this:
_caller = _this select 1;
["Hello"] remoteExec ["hint", _caller];
could I just do this instead:
hint "Hello";
?
thanks
can I not put an object as a key in a hashmap?
no
why not?
idk. ask Dedmen.
is there a way I can get around it?
no
i need the keys for my hashmap to be objects
use arrays then
yo bros is there a getter for ammo count in current magazine ?
i know theres currentmagazinedetail but it returns a whole string of multiple things
how would i isolate only the ammo count
poggers bro thanks
is there a script or a command that can hide the back rotor of a heli?
i tried settexture but it didnt hide the back rotor
no. to hide physical parts of a vehicle, check its animation sources in the config. default arma apc's have a hideTurret animation that you can use. Helis don't have that afaik
Setting some scripted damage perhaps
ok thx both of you!
how do I turn an image into a .paa file?
download arma 3 tools on steam and use the texview application
ok thanks
where can i find that on steam? is it in the workshop?
nvm, i found it
remember your library filters. i don't think tools is automatically selected
so you might not find it when you install it
there is an application called imageToPAA do i want to use it?
or texview?
it just says "Failed to convert 1 file"
how large does an image need to be in order to convert it?
i keep opening the file in texview and saving it as a paa/pac file and it does nothing
its a png file
make sure dimensions are n^2
how come when I convert a solid blue image to .paa it becomes red, and a solid red image becomes blue?
and when I open the image in texview it appears as the color it originally was, but when i apply it as a texture in game, it switches
i dont get it
how can I make the drawIcon3D only appear for a player when they are within a certain range of the text?
drawIcon3D is already local
so just use it locally
is there a alternate to settexture to disable a texture? (making it transparent for the outside armor?
I am doing this rn
this setObjectTexture [0, "\pboname\texture.paa"];
this setObjectTexture [1, "\pboname\texture2.paa"];
But create error in dedicated obviously
even if im doing this in initServer?
addMissionEventHandler ["Draw3D", {
drawIcon3D ["", [1,1,1,1], [14477.2, 6189.25, 1.865], 0, 0, 0, "Text", 1, 0.05, "RobotoCondensed"];
drawIcon3D ["", [1,1,1,1], [14476.9, 6179.86, 1.844999], 0, 0, 0, "Text", 1, 0.05, "RobotoCondensed"];
}];
could I change it to the following?
addMissionEventHandler ["Draw3D", {
if ( player inArea myTrigger ) then {
drawIcon3D ["", [1,1,1,1], [14477.2, 6189.25, 1.865], 0, 0, 0, "Text", 1, 0.05, "RobotoCondensed"];
drawIcon3D ["", [1,1,1,1], [14476.9, 6179.86, 1.844999], 0, 0, 0, "Text", 1, 0.05, "RobotoCondensed"];
};
}];
use initPlayerLocal, not server
ok
and no need for inArea
Majority of vehicles don't support particial transparency so most unlikely
just use distance
then is there another method to make the settexture to not give an error but lost the texture of the vehicle?
bc rn when i put the code, it create a error which prevent to load the rest of the mission in dedicated
Just put "" in setObjectTexture
what do you mean? should I use distance instead?
how can I directly set an object's texture to a solid color without using images?
i tried this:
this setObjectTextureGlobal [0, "#ff0000"];
this setObjectTextureGlobal [1, "#000000"];
but it doesnt seem to be doing anything
to disable a texture, give it an empty string ""
Check out the BIKI https://community.bistudio.com/wiki/setObjectTextureGlobal
Example 2 on that link shows you how to use colour instead of images with setObjectTexture / setObjectTextureGlobal.
The colour code needed is RGB not Hex.
thanks
im confused about how this is what they use for a blue texture. it just doesnt make sense to me. what is the format here?
"#(rgb,8,8,3)color(0,0,1,1)"
thanks
can someone help me get a less harsh red? i cannot figure out what color values to put. ive been trying for like an hour. when I use "#(rgb,8,8,3)color(1,0,0,1)", I get the following color, but if I add small values to the green and blue, it just becomes light pink. I really dont get it.
https://imgur.com/a/v36GINh
How did you do that? How small it is?
I tried this:
this setObjectTextureGlobal [0, "#(rgb,8,8,3)color(0.874,0.102,0.102,1)"];
and i got light pink
And which vehicle? Might the material makes it brighter
its an ifrit
this setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];
but this just makes it standard, bright red
Then try to adjust to make the color to the color you wish? If it is, probably it is what it is
im just kind of trying to understand how this "RGB" format works
it is definitely not the standard rgb format
the first part is creation of the texture itself, then the color which is rgba
#(Texture format)color(color format)
what exactly does (rgb,8,8,3) mean? don't really know. I just know that it is the solid texture format
this uses a scale of 0 - 1 for each color, standard RGB is a scale of 0 - 255
whenever I put a number larger or equal to 1 for every color, it just gives me pure white
0-1 and 0-255 is not even a difference
i know
i used the same proportions and it gave me light pink instead of red which it was supposed to be
#(color format,x-resolution,y-resolution,mipmap resolution) IIRC. So it could be #(rgb,1,1,1)
what would that change?
he's just elaborating on the resolution of the texture. nothing big for most applications
ok
Resolution. But if it is just a color texture which had no info than a single color, 1,1,1 is enough
yeah
but how can I make it give me the color I want?
it really doesnt make any sense to me how this RGB system works
it works more like channels in photoshop
i tried using the standard RBG code, that didnt work. then i tried converting it with proportions, and that didnt work either
ive never worked with PH
do you use 7erra's editing extentions?
idk what that is
he's got a color picker you can use right from the menu
You can test in like very simple object like User Texture if you wonder how it works
where can i find that?
Workshop
But I'm 100% sure if it doesn't seem a right color, it's just a material thing
ok
thanks
also when you did your conversion, did you do something like this?
private _decRGB = [255, 51, 51];
private _binRGB = [];
_decRGB apply {
private _value = linearConversion [0, 255, _x, 0, 1, true];
_binRGB pushBack _value;
};
_binRGB;
because for me, both [255, 51, 51] is the same color as the output in percent that the game uses which I checked on some websites that use decimal RGB as well.
and it also is the correct HTML color code as well
all I did was convert it to a decimal with a calculator. I divided each value by 255 and used that as a decimal
if I did
object setObjectTextureGlobal [0, "#(argb,8,8,3)color(1,0,0,1)"];
object setObjectTextureGlobal [1, "#(argb,8,8,3)color(0,0,0,1)"];
``` and then did
```sqf
getObjectTextures object;
``` would it return `["#(argb,8,8,3)color(1,0,0,1)", "#(argb,8,8,3)color(0,0,0,1)"]`?
nevermind, it definitely doesn't
β¦ _x/255?
private _binRGB = _decRGB apply { _x/255 };
```you use apply instead of forEach, and don't even use its return value!
why do I get Error: local variable in global space when I put this in initServer.sqf?
spawnPos = getPos spawnFlag;
spawnPos params ["spawnPosX", "spawnPosY", "spawnPosZ"];
```I dont understand.
params can't take global variable, which means variable without _ prefix
Yes
added to the paddlin' list
is there a way to get a random number between two numbers? random gives a random number between 0 and a number.
X + random Y
Jup
if I did:
_x setPos [_posX - _spawnRadius + random _spawnRadius * 2, _posX - _spawnRadius + random _spawnRadius * 2, _posZ];
```if `_spawnRadius` was 3, it would not be the same as:
```sqf
_x setPos [_posX - 3 + random 6, _posX - 3 + random 6, _posY];
because it would do random _spawnRadius before it multiplied _spawnRadius by 2, right?
hmm
If in doubt, use the bracket
would the brackets actually change the way the code is run?
or does it just help visualize things?
Former, yes
ok
_x setPos [_posX - _spawnRadius + random ( _spawnRadius * 2 ), _posY - _spawnRadius + random ( _spawnRadius * 2) , _posZ];
what does former mean?
unary always has higher precedence than binary
ok
use netId, BIS_fnc_netId for singleplayer
"I need objects" "use arrays then" ? what?
i figured out a better way to do what im doing, thanks tho
Instead of hashmap 
ah :u
also I could have just put the objects in strings and used missionNameSpace getVariable
_myHashmap = createHashmapFromArray [
[1, "object1"],
[2, "object2"],
[3, "object3"]
];
_objectString = _myHashmap get 1;
_object = missionNameSpace getVariable _objectString;
wat?
If you've already named them just do:
missionNamespace getVariable ["object" + str _id, objNull]
What is the purpose of this?
except if not all objects have a name
if you want objects as keys.. why don't you just store stuff on the object itself?
Each object has a hashmap integrated into itself
Not all objects do 
That was just an example I made, I was just showing that it worked
Hello, is possible to somehow check - if grenade launcher exists on weapon?
And display GL grenades
In MX 3GL example,
configfile >> "CfgWeapons" >> "arifle_MX_GL_F" >> "muzzles" has ["this","GL_3GL_F"] data. But an alternative muzzle doesn't always mean it has a grenade launcher, so you need to check a bit more if GL_3GL_F (in this case) is a grenade launcher like from the magazine?
ye, i think is needed in that context like magazine
Probably the easiest way is to check if it has UGL_40x36 in its magazineWell[]
Thank you @warm hedge, i thought - is possible to use grenade launcher like an accessories π
Gonna try this way just to display grenade launcher magazines π
Odd question for scripting: If I have a relatively big mission but savegames are NOT an option (for a variety of reasons), how would one go about setting up a file to record flags (play this message ONLY the first time the player starts the mission) and a file to record the contents of a container? (Anything stored in this container will remain in the container during the next mission, even if you die and restart.)
profileNamespace is an idea
Thank you, just knowing where to start is half the battle...
Is there any way to have a database that scripts can get data from? I have really chonky arrays and I would like to have them in some kind of file that the scripts can access, just so they don't have to be constantly regenerated and slung around.
Currently I have them in a function, but I declare the chonk arrays first and then have a switch that chooses the right one. Problem is AFAIK it keeps redefining those arrays every time that function is accessed.
Declare them outside the function as global variable instead.
Its a lot of stuff in there, I kinda don't want it hotloaded in the game at all times
If the arrays change rarely move each one into its own file, and load is as either a sqf script that defines the variable or parse it using parseSimpleArray. Then "run" the proper file the first time it is needed
I wonder if I used goTo would it skip the defining of the arrays? Like this
goto "Array2";
#Array1
_stuff = [];
#Array2
_stuff = [];
Would the creation of Array1 be skipped?
goto is an sqs command. are you sure you want to use that?
oops my bad
just store them in global namespace, it will really not matter.
If in doubt compare ram usage 
π€ Yeah, I just remembered I will keep stuff in the local space anyway, so might as well keep all of the stuff
Yeah just init once with global names. Unless you they are like 1,000,000+ in size and you have many there is no need to worry
store them in a hashmap, only "generate" them when they are requested first time
Ok, I think that the biggest one is something like 6.3k in size.
I have a trigger to detect when a blufor ai squad shows up and teiggers a opfor attack. But sometimes the player will trigger it because you have to walk through that relative area. How do I make a trigger that triggers by the presence of the ai sl.
group it with the ai squad, you should get several new options in the trigger's attributes
@robust tiger oh that would explain what set trigger owner is lmao. Thanks
Hello, is possible to somehow convert item description from text format to string?
I mean replace <br /> in description text
Replace with what?
i mean in vanilla arma invenroty in tooltips - i can't find <br /> is just start new string instead it
ctrlSetTooltip command can use string only
i can parse this text via script (replace <br /> with new string, but wanted to ask if somebody knows another way)
Can you give me an example?
sure:
"Π’ΠΈΠΏ: ΠΠ€ Π³ΡΠ°Π½Π°ΡΠ°<br />ΠΠ°Π»ΠΈΠ±Ρ: 40 ΠΌΠΌ<br />ΠΠΎΠ»-Π²ΠΎ: 1<br />ΠΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅: EGLM, 3GL"
^^ this i get from config
this, how looks this text in inventory menu:
Π’ΠΈΠΏ: ΠΠ€ Π³ΡΠ°Π½Π°ΡΠ°
ΠΠ°Π»ΠΈΠ±Ρ: 40 ΠΌΠΌ
ΠΠΎΠ»-Π²ΠΎ: 1
ΠΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅: EGLM, 3GL
Well, there is https://community.bistudio.com/wiki/regexReplace now, but it's not released on A3 Stable yet.
ye, i find that page too, but can't use it until release π¦
so if there is no way how to parse it another way - gonna try to parse with script)
try'd this way:
_desc = [_desc,str (parsetext _desc)] select ("<br />" in _desc);
but is remove <br /> only, but not new lines instead
How do you wanted to use it?
as tooltip on items in menu π
something like short description
So a GUI menu?
https://community.bistudio.com/wiki/BIS_fnc_splitString
Probably this with joinString "\n"
Yea I've arrived at the same solution 
Thank you! π
This way is worked
_desc = [_desc,( ((_desc splitString "<>") - ["br /"]) joinString "\n" )] select ("<br />" in _desc);
You can also parse it I think
you mean - parseText?
Yeah
It returns a structured text, not string
But if you want it for GUI's, maybe that's better
You can still convert it back to string tho
But I think it'll look weird:
_str = str parseText _str
i tryed this way
but is return without new lines, just all in one line π
Yeah 
That's what I meant by "looking weird"
Hi, im wondering if isPlayer can check if an object is a player.
I want to check if an object returned from cursorObject = a player
isPlayer does that actually
Alright thought so, thanks!
Hi all, i wonder if there a better way to count units in a spΓ©cific aera than my actual script:
_unitsEast = unitsEast inAreaArray ["mkr1", "mkr2", "mkr3"];
_unitsEast = count units opfor;
if (_unitsEast >= 1) then{
hint "Unit here";
}else{
hint "No Unit Here";
};
Is there a possibility like count units opfor inAreaArray ... in one line ? I try but still unsuccess π¦ In advence, Thanks for your responses
inAreaArray only takes one area for the right argument
count units opfor inAreaArray ...
That's just wrong. Learn about operator precedence on the wiki. What you wrote executes as(count units opfor) inAreaArray
@gaunt acorn Anyway, what you want is:
count (_units inAreaArray "mrk1") + count (_units inAreaArray "mrk2") + count (_units inAreaArray "mrk3")
if you have too many areas, you can use a forEach loop and a counter
OK i see, thx a lot for your help π save me a lot of time, but iwill read more about operator precedence thx for your time and answere π
np
also in case you didn't notice, you're using wrong and inconsistent stuff here:
_unitsEast = unitsEast inAreaArray ["mkr1", "mkr2", "mkr3"];
_unitsEast = count units opfor;
there's no unitsEast (unless you actually defined that)
And you're just counting all opfor units
Ho ok so _units its the right parameter ? _unitsEast = _units inArea ....
_units is a local variable that should be an array of units
I'm assuming in your code:
_units = units east;
#arma3_config plz
Han ok Now i see why i ave null as response
@little raptor Thanks you so much , need to rewrite every thing but i learn today π
Hello, did you try'ed to get picture of weapon (with attachments - like in inventory)?
so i'm trying the stuff in this video but it isn't working, do any of yall scripting wizards see anything wrong with the stuff in the video? if not then i guess i'll have to check my own side https://www.youtube.com/watch?v=QJRsyaqntw0
yes (?!)
i mean is possible to get this picture (like with default inventory)?
yes
Can you give me a hint? π
getText (configFile >> "CfgWeapons" >> _weaponName >> "picture")
@little raptor i know this way, but there is no primaryWeaponItems - i mean on icon
like was in default inventory
like this http://prntscr.com/1alctxj
hm, can't find it as picture
{diag_log [ctrlIDC _x,ctrlText _x]} forEach (allControls (findDisplay 602));
don't return picture - maybe is something else...
If I got an array with units in it, and set that variable as publicVariable so all other clients can use it. Will I run into trouble as the clients where the units are non-local they would be "remote" compared to the array on the client with local units? Or does "unit objects" somehow automatically get correctly set if remote or local when shared on a list through publicVariable.
guess my actual question is more if references to units can be shared between local and non-local clients?
are the parentheses needed in this condition?
while { ( units west inAreaArray _mapTrigger ) isEqualTo [] } do {
no
still better keep it
yes they can
cheers!
so, UH addaction [ "music on", { adds a scroll wheel option that is visible from very far away, is there any way i can make this only visible from inside the vehicle?
UH addaction [ "music on", { UH say3D ["music1", 1000, 1]; } ];
is the full init
Try:
UH addAction ["music on",{UH say3D ["music1",1000,1]},nil,1.5,true,true,"","_this in _target"];
would this:
"HELLO" splitString "";
```return this:
```sqf
["H", "E", "L", "L", "O"]
?
yes
just tested it
thanks
oh dang that works, thanks!
Time for me to bash my head in again.
If I execute a .sqf file on all computers in a multiplayer setting, beginning with
if (!hasInterface) exitWith {};
before having a line like
if (primaryWeapon Player == "LMG_Mk200_F") then {
Player addPrimaryWeaponItem "bipod_03_F_blk";}
Then only the player(s) with Mk200s would get bipods, correct?
That is, when that chunk of code comes up.
player*, too π
and yeah
Alright, I'm slowly getting the hang of it T_T
Hey don't tell a lie Low Montowana, it's case insensitive!
Because that code is, while executed globally, local to every computer once the server is weeded out with !hasInterface.
Or rather, is always local but won't be duplicated by the server n times.
yet I don't want to see ```sqf
IF (alive Player) THEN { Hint "oH No YoU aRe dEAd" };
Anti-camelCase is not nice. -Barbara Bush
bruh thats an emoji now XD
i love it


I think you can use it as a scarecrow to scare off bots, or make people behave! π€£
Does anyone know a working way to limit the vehicles displayed in the Virtual Garage? I've looked at the wiki and apparently you can use BIS_fnc_garage_data to set the available vehicles, however the example provided doesn't seem to work. Neither does the following code;
BIS_fnc_garage_data = [
//CARS
[
//model
"\a3\soft_f\offroad_01\offroad_01_unarmed_f",
//config paths of classes that use above model
[
[(configFile >> 'cfgVehicles' >> 'C_Offroad_01_F')],
[(configFile >> 'cfgVehicles' >> 'B_G_Offroad_01_F')]
],
"\a3\soft_f\mrap_02\mrap_02_gmg_f",
[
[(configFile >> 'cfgVehicles' >> 'O_MRAP_02_gmg_F')]
]
],
[], //ARMOR
[], //HELIS
[], //PLANES
[], //NAVAL
[] //STATICS
];
["Open"] call BIS_fnc_Garage;
It opens the Virtual Garage like normal with every vehicle.
well your structure is incorrect
That's just using the example provided on the wiki ^
modified*
The version on the wiki doesn't work, and I found that version on a forum post
I'm not quite sure on how they need to be nested, it doesn't really explain it on the wiki
the wiki one wasn't nested. idk. I recommend just reading the function. maybe something's changed
Okay thank you, will do
I've managed to get the default BIS_fnc_garage_data list that gets set when you open the Virtual Garage with every vehicle, which is SQF [ [ // CARS "\a3\soft_f\mrap_01\mrap_01_unarmed_f", [bin\config.bin/CfgVehicles/B_MRAP_01_F,bin\config.bin/CfgVehicles/B_T_MRAP_01_F], "\a3\soft_f\mrap_01\mrap_01_gmg_f", [bin\config.bin/CfgVehicles/B_MRAP_01_gmg_F,bin\config.bin/CfgVehicles/B_T_MRAP_01_gmg_F], "\a3\soft_f\mrap_01\mrap_01_hmg_f", [bin\config.bin/CfgVehicles/B_MRAP_01_hmg_F,bin\config.bin/CfgVehicles/B_T_MRAP_01_hmg_F], "\a3\soft_f\mrap_02\mrap_02_unarmed_f", [bin\config.bin/CfgVehicles/O_MRAP_02_F,bin\config.bin/CfgVehicles/O_T_MRAP_02_ghex_F], .... (The list continues but you get the point) ], [...], // ARMOUR [...], // HELIS [...], // PLANES [...], //NAVAL [...] //STATIC ]; So I've tried to copy a few vehicles from the list (using configFile >> "CfgVehicles" >> "CLASSNAME") and it still doesn't seem to work. So I'm stumped on how to get it working.
The only other way I could possibly think of, which isn't necessarily efficient. Is to manually edit the display's listbox and remove the vehicles I don't want.
What does your version look like?
missionNamespace setVariable ["bis_fnc_garage_data",
[
[ // CARS
"\a3\soft_f\mrap_01\mrap_01_unarmed_f",
[configFile >> "CfgVehicles" >> "B_MRAP_01_F", configFile >> "CfgVehicles" >> "B_T_MRAP_01_F"],
"\a3\soft_f\mrap_01\mrap_01_gmg_f",
[configFile >> "CfgVehicles" >> "B_MRAP_01_gmg_F", configFile >> "CfgVehicles" >> "B_T_MRAP_01_gmg_F"],
"\a3\soft_f\mrap_01\mrap_01_hmg_f",
[configFile >> "CfgVehicles" >> "B_MRAP_01_hmg_F", configFile >> "CfgVehicles" >> "B_T_MRAP_01_hmg_F"],
"\a3\soft_f\mrap_02\mrap_02_unarmed_f",
[configFile >> "CfgVehicles" >> "O_MRAP_02_F", configFile >> "CfgVehicles" >> "O_T_MRAP_02_ghex_F"],
"\a3\soft_f\mrap_02\mrap_02_hmg_f",
[configFile >> "CfgVehicles" >> "O_MRAP_02_hmg_F", configFile >> "CfgVehicles" >> "O_T_MRAP_02_hmg_ghex_F"],
"\a3\soft_f\mrap_02\mrap_02_gmg_f",
[configFile >> "CfgVehicles" >> "O_MRAP_02_gmg_F", configFile >> "CfgVehicles" >> "O_T_MRAP_02_gmg_ghex_F"]
],
[], // ARMOUR
[], // HELIS
[], // PLANES
[], //NAVAL
[] //STATIC
]
];
["Open"] call BIS_fnc_Garage;
sorry that's incorrect
let me fix it
There we go
That's what I'm using
And does BIS_fnc_garage_data keep that value after you run BIS_fnc_Garage?
Yes
Have you tried both ["Open", true] call BIS_fnc_garage; and ["Open", false] call BIS_fnc_garage;, just to be sure?
Yes I have tried both
Even though leaving out the second parameter defaults to false
Hmmm that smells like a broken function 

Well darn, I guess I'll have to manually modify the displays list box to remove vehicles I don't want
Have you gone through the BIS_fnc_garage source code?
Yes
But I don't quite understand how it works, because there is only 2 instances where bis_fnc_garage_data get set and it relates to the actual category buttons IDC numbers in the garage display
I can't seem to wrap my head around it
on how it gets the vehicles data to then use in the list box
I'm trying to simplify my unit creation.
I have a function for a createUnit line, and I pass it three arguments; _group, _pos, and _code.
spawnRifleman = {
if (!isServer) exitWith {};
_group = _this select 0;
_pos = _this select 1;
_code = _this select 2;
Where it falls apart is the code section. I can't seem to formulate it properly.
If I leave it a simple string ala
hint "spawned"
I get an undefined _code error. If I try to wrap it, such as
"this setdammage 1"
I get an unknown enum value on the argument. If I try to encase it, like so
{this enableSimulation false}
I get an error at the createUnit level, complaining about it wanting a string but getting code.
I've tried both methods I could think of to place it;
Rifleman = _group createUnit ["O_Soldier_VR_F",_pos, [], 0,_code];
Rifleman = _group createUnit ["O_Soldier_VR_F",_pos, [], 0, format["%1",_code]];
Neither seem to work.
wat?
that syntax of createUnit doesn't take init
the argument you're messing with can be one of "NONE", "FORM" and "CANCOLLIDE"
I see what I did. I see, and I do not like it.
well you shouldn't be using the other syntax anyway
cuz there's no return value
I mean, that's what drove me to it initially, because that syntax DOES have a return value...
orrrrr I could read the big red shiny note on the wiki that tells you how to get a reference in the actually useful syntax I thought I was using.
Don't drink and code.
just execute the code after you create the unit
_unit = _group createUnit ...;
call _code
Would that work if the code needs to be tagged to a specific unit? Like an event handler?
Ah, so the arguments I'd have to pass would be like [_group,_pos, _unit enableSimulation false] ?
?
the last one has to be a code
Are you saying that I'm just missing syntax, or that my approach is flawed?
I'm saying it has to a code
_unit enableSimulation false is not a code. it's empty (NOTHING)
{_unit enableSimulation false} is a code
what do you mean by that?
to convert some numbers to a letter or so
do you instead need a random id generator?
i will take the playerid and i would like to convert it to something else
like getting some letters in it
getPlayerUID? (that would return Steam's id)
ok sorry i will write in a sec what i mean (its a bit weird formulated from me)
okido ^^
I have simpleObject that I need to destroy with explosives. Some workarounds ? eventHandler, waitUntill ?
what i wanted to do is to replace some of the numbers with some letters, i tought there maybe is an method or something else for stuff like this
i thought about an array of letters and just selecting one is there any better way?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Explosion
you could place an small object or so and give it this evh, when its triggered you could delte the simple object
but there must be a better way than this
there is no "do something"-ready method no π but if you get a precise idea, we can help ^^
@real tartan for that i use a small simulated and damageable object placed nearby to the βdestroyableβ simple object
linked by script variables and a handleDamage event handler
Anyone know how to make an addAction that effects the ACE3 medical class of an unit, tryed this but the init dosen't like it: this addAction ["Become Medic", (setVariable ["ace_medical_medicclass", 1, true])]; any ideas?
Found the issue, player setVariable ["ace_medical_medicclass", 1, true] was what I was needing
that's not the only issue you have in that code
this is just going into an init, works fine
that's not what I mean
{}
yes
Hello. I would be more interested in SQF Bytecode. I have some experience with SQF, C and C++, but I'm not sure where should I start with SQF Bytecode. Would someone be able to point me out to the good direction or provide some material/threads/whatever useful for the first utilisation? Essentialy I'd like to learn how and when to properly utilise SQF Bytecode and then use that knowledge to good use for the community.
ArmaScriptCompiler on github
There isn't much to it, you compile your sqf files to sqfc bytecode and thats basically it
Nice, thank you ππ».
Hmm, I'm trying to write a script to prevent the player from picking up any equipment off dead nato soldiers(but aaf/csat are fine). I have code to delete the corpses inventory, but I'd rather leave the bodies as they are. lockInventory doesn't work with deceased objects. Is there a way I can just disable simulation on the corpse and it's weapon?
is there a way to clear systemChat ?
Heh, not gonna fall for that one again π
The easy way? run systemChat ""; six times...
https://community.bistudio.com/wiki/clearRadio here, clears all chat
lol learned something new...
yeah I learned that one last week π
_unit = (_this select 0) select 0;
sleep 0.5;
_weaponHolders = nearestObjects [_unit,["WeaponHolderSimulated"],5];
waitUntil {
(({(velocity _x) select 0 == 0} count _weaponHolders) == count _weaponHolders) &&
(({(velocity _x) select 1 == 0} count _weaponHolders) == count _weaponHolders) &&
(({(velocity _x) select 2 == 0} count _weaponHolders) == count _weaponHolders)
};
{_x setDamage 1} forEach _weaponHolders;``` I found this code but I can't really understand what it's supposed to do. It keeps giving me this error: ``` 3:37:25 Error in expression <ponHolders"];
_unit = (_this select 0) select 0;
_weaponHolders = nearestObj>
3:37:25 Error position: <select 0;
_weaponHolders = nearestObj>
3:37:25 Error select: Type Object, expected Array,String,Config entry
3:37:25 Error in expression <ponHolders"];
_unit = (_this select 0) select 0;
_weaponHolders = nearestObj>
3:37:25 Error position: <select 0;
_weaponHolders = nearestObj>
3:37:25 Error Generic error in expression```
the error is telling you that you are trying to use select on an object instead of an array. what are you passing to the function (aka what is _this)?
I think it would be the corpse...
oh wait...```addMissionEventHandler ["EntityKilled", {
params ["_killed", "_killer", "_instigator"];```
Do I need to change _this to _killed?
not sure what setDamage does to a weapon holder but you can do this:
addMissionEventHandler ["EntityKilled", {
_this spawn {
params ["_unit", "_killer", "_instigator"];
sleep 0.5;
_weaponHolders = nearestObjects [_unit,["WeaponHolderSimulated"],5];
waitUntil {
(({(velocity _x) select 0 == 0} count _weaponHolders) == count _weaponHolders) &&
(({(velocity _x) select 1 == 0} count _weaponHolders) == count _weaponHolders) &&
(({(velocity _x) select 2 == 0} count _weaponHolders) == count _weaponHolders)
};
{_x setDamage 1} forEach _weaponHolders;
};
};
I've read it leaves the weapon on the ground but makes it impossible to pick up, also useful for creating weapons displays without using simpleObjects...
Cool! I almost got it!
I can still open the inventory but all of the items are unusable...the gun on ground is too.
Is there an EH for entity creation event? If no, how can I catch it?
Now all I need to do is figure out how to disarm the mouseroll "rearm at ____" menu so the character can't take smoke grenades/ammo...
(This doesn't look even remotely easily possible without making a mod, just gonna delete magazines instead...)
not in vanilla but CBA can do that
DOUGH! I just realized if I disable corpses like this It's gonna mess up VCOM's ability to rearm NATO troops...glad I noticed that right away...
@distant oyster Thanks, I gotta rethink this...
i really wish there was an InventoryChanged EH :)
Hmm...maybe I could just do something stupidly simple and only disable simulation if the PLAYER is near the blufor entity?
Maybe βloadout changedβ from CBA? https://cbateam.github.io/CBA_A3/docs/files/events/fnc_addPlayerEventHandler-sqf.html
for performance it would be much nicer to have an inengine solution
Yeah, seems like engine doesnβt provide that many EHβs. Iβm actually curious how expensive CBA EHβs are. Since CBA is adopted as a foundation for many mods, I figured they must do things close to as efficiently as possible given what they have to work with.
In order to keep the player from 'touching' any nato corpses, I've got a script to disable simulation on them but if I wanted that script to only disable simulation WHILE the player was around and turn it back on after the player left, what would be a non-insane way of doing that in the event handler? two waitUntil's and a loop?
What do you mean by touching? You don't want to loot the corpses?
pretty sure theres a setting called "dynamic simulation" which is exactly what youre looking for
Yeah i want the player to NOT be able to take anything NATO...
Sorry yeah, it's the opposite, but I want the player to be able to loot CSAT/IND as normal
It's impossible to stop them to take weapons directly from ground unfortunately, AFAIK. But you can use lockInventory
yeah
I dunno, I think the mission is more fun when you can't use NATO stuff...
lemme see
lockInventory doesn't do anything for corpses
what's the point? 
just leave it disabled.
Well, I think the player running around would mess up VCOM's ability to change weapons/mags
well there are inventory event handlers which you could use
Oh, I was 100% sure it can stop to loot. Nevermind then, I thought I tested it and worked but I think it was on my dream
initServer.sqf:sqf natoSoldiersArray = [natoSoldier1, natoSoldier2, natoSoldier3]; initPlayerLocal.sqf:```sqf
player addEventHandler ["InventoryOpened", {
params ["", "_container"];
if ( _container in natoSoldiersArray ) then {
true
};
}];
maybe this would work?
@past gazelle
natoSoldiersArray doesn't do anything. The matter is what do you do with it... it contains NATO soldiers you have, and if the βcontainerβ is one of those, the inventory action terminates
Then check via getNumber (configFile >> "CfgVehicles" >> typeOf _container >> "side") == 1
Ok, will do. Got another 5-6 hours to work on this tonight.
Cool!
Only 3 nato soldiers had to DIE for me to test this...That's like a record for getting something to work for me...
Hmm, actually it looks like it took care of the rearm command too!
Nope, didn't get the 'rearm' actionMenu command...
params ["","","","_act"];
if ( !(cursorTarget getVariable ['holder',false]) && !(cursorTarget getVariable ['corpse',false]) ) exitWith { false };
if ( _act in ['Rearm','TakeWeapon','Gear','Inventory'] ) then {true} else {false};
"];```
Would this disable those 4 menu actions completely?
Heh maybe I'll just capture the entire rearm command and pop up a hint that says "Rearm...did you mean...Open inventory?"
- use syntax highlighting when you post codes in this channel
- interaction text is localized afaik
if ( _act in ['Rearm','TakeWeapon','Gear','Inventory'] ) then {true} else {false};is the same as_act in ['Rearm','TakeWeapon','Gear','Inventory']
I am doing something wrong when doing if with multiple or-values. The log give me: Error Generic error in expression for this bit:
if (_target == objNull || _frequency == 0) then {continue};
When using equality operators in IFs do I need to put it inside {} or otherwise do it different for multiple expressions? Tried to check Wiki and google, but couldn't find a clear answer. I tried to do:
if ({_target == objNull} || {_frequency == 0}) then {continue};
But still gave the same error.
check the RPT for the actual complete error
not only the on-screen error (that doesn't always show the full problem)
_target == objNull is that even valid?
I think you wanted isNull _target
oh Doh. You are right. I can't compare to ObjNull. I learned that some time ago but I still keep falling into that pitfall from c++. That might be the issue.
The entire log in rpt is here. Although I am not understanding if it actual tells me more specific what the error is.
13:45:02 Error in expression <
if (_target == objNull || _frequency == 0) then {continue};
private _requir>
13:45:02 Error position: <== 0) then {continue};
private _requir>
13:45:02 Error Generic error in expression
13:45:02 File z\crowsEW\addons\spectrum\functions\fnc_spectrumTrackingLocal.sqf..., line 49
The entire log in rpt is here.
are you sure there's not a second error right above that one with more detail?
The error repeats a couple of times with the same as I posted. Pastebin: https://pastebin.com/Y7NPNQik
The first messages are debug diag_log from another function, then it comes with this error and repeats it.
mh.
Why is arma so stupid about logging errors
I can't compare to ObjNull
you can π€· (not with == tho)
but still you should use isNull like Dedmen said
the error is at the frequency == maybe _frequency is not a number?
sorry, bad wording on my part. Yeah I learned I had to use isNull instead of ==. Where I previously had just used == π
well using isEqualTo you can compare to objNull. that's what I mean
ahh alright. fair π
Hmmm. I'll try to print it out to be sure, but I get frequency from.
_x params [["_target",objNull,[objNull]], ["_frequency", 0], ["_scanRange",300], ["_type", "zeus"]];
Right above the error line.
hmm. This might be a race-condition. I just realised. As this happens inside a loop that iterates over an array. While another function might have removed an element of this array. Would fit with the error only shows when something happens that removes an element from the array. Hmmm.
Gonna debug and test some more to see if I can narrow it down.
Do we have mutex's or similar in sqf?
well there is no typecheck on _frequency
Thats true. I'll try to change it to ["_frequency", 0, [Number]]
although not sure if you can use Number as a type like that?
oh, you just give it any type of the type you want. Ah thats handy. Thanks!
I'm trying to add respawn loadouts for diffrent sides, I have BluFor and OpFor working fine, but I can't seem to find the right syntax for Independent
[resistance, ["Grfor2",3]] call BIS_fnc_addRespawnInventory;
any ideas on what to put where I put "resistance" ?
UH addAction ["music on",{UH say3D ["music1",1000,1]},nil,1.5,true,true,"","_this in _target"]; so i recently got help from one of you guys to get this command that allows me to activate a class CfgSounds in my description.ext . so my question, is there any way i could add another addAction that stops this command?
Based on Side https://community.bistudio.com/wiki/Side, it seems like it is known as GUER.
If its the text to side you need. Not sure excatly what respawn function requires
I tried that before and it didnt work, but I think that's actually what I'm looking for and I've broken something else lol. I'll give it another try once I fix whatever went wrong lol
yes. add a nested addAction that kills the sound source
i see
what like UH addAction ["music off",{UH say3D ["music1",1000,1]},nil,1.5,false,false,"","_this in _target"]; ?
You were absolutely right. I changed the debug print status and could see the issue was _frequency was a string. Parsed it to number and it all works. Many thanks for the time and help π
no nest it. as in add it inside the other addAction.
also you're just playing the music again 
oh π

