#arma3_scripting
1 messages · Page 230 of 1
I'll check rn
those black boxes always hides the main problem
You'll need it to be like this 🙂
-private _type;
+private "_type";
ah'
thanks
so any time I initialize a variable like that without defining it, it should be a string?
private _type = if (condition1) then {
if (condition2) then { "string1" } else { "string2" }
} else { "string3" };
Yea or alternatively if you have multiple in the same scope you could also do it like this:
private ["_var1", "_var2", "_var3"];
All comes down to preference but I typically like to always initialize my variables with a value, even if it's some default like -1 or "" just to ensure error handling wise nothing is ever approached with nil.
A way you could incorporate this if you vibed with it as well could be like this:
private _type = switch true do {
case condition1: {"string1"};
case condition2: {"string2"};
default {"string3"};
};
_veh = createVehicle [_type, _loc, [], 0, "CAN_COLLIDE"];
Again all sorta just comes down to convention though, so whether you wanna adopt that is entirely up to you :)
thanks
private [...] has a noticeable cost, private _thing = ... doesn't
Yea, just wanted to denote alternatives; you're right though. I tend to prefer the latter anyway since it's more clear to the reader, easier to maintain and makes it easier to see the scope of which it's used :P
I was messing with the setUnitTrait function and tried to tweak the staminaDrainCoef value as listed on the wiki (https://community.bistudio.com/wiki/setUnitTrait).
After checking with getAllUnitTraits though I found it just... wasn't there? Anyone else run into this?
This is not on stable yet
*bigger
EVEN BIGGER. make it take up all of the screen.
at this point all I need is to make the text smaller
:)
got a fpv drone scirpt to work 100% hit crash into tanks and uintis vibe codes but hey it works. i got a problem tho the drones in zeus is ai cant do waypoints so cant patrol anyway to fix that?
So I tried to setup respawn with eden, but I'm getting an error: http://pastebin.com/raw/LTvZHh2y
also wondering how I can cut down on "refused a packet" rpt spam
@dawn shell you can use this, you don't have to do anything, units deploy the drones they have automatically
https://steamcommunity.com/sharedfiles/filedetails/?id=3456575967
Oh lol I completely missed that
hey, i am trying to get a lil script to work with the optre odst pod module, it works in eden mp/sp but as soon as it goes onto a server in a mission file it stops working. I am very new to arma scripts so i am unsure where I am going wrong.
this addAction ["Prep Reserves for Launch", {missionNamespace setVariable ["Prep Reserves for Launch", true, true];}]; - Console interact
!isNil "Prep Reserves for Launch" - Trigger linked to module
I am assuming this is the issue? missionNamespace setVariable
The console is set to enable simulation
- Prefix your global variables
- Spaces in variable with setVariable probably causes issues
no way dart is gonna save me again
dart ur actually the realest one ever
sorry im dense could u fix it n send it
i am not sure what u mean
All global variables should have a "prefix" so you don't accidentally conflict with other mods, e.g. AF_...
Second bit is to just remove the spaces in your variable name
remove spaces in "Prep Reserves for Launch" ?
In the setVariable bit yeah, it takes a variable name, the value, and then which machines to set the variable on
!isNil "Prep Reserves for Launch"
Also this isn't actually checking if the variable is set true, it's just checking that it's defined
So if you did missionNamespace setVariable ["...", false] it would still trigger
oh lord
this is what i get for googling and slapping tg lol
can the prefix be anything?
Yeah, just something unique to you / the mission / the mod (depending on whatever you're doing / your preference)
I used AF for "Aluminum Foil" as an example
this addAction ["Prep Reserves for Launch", {missionNamespace setVariable ["AF_PrepReservesforLaunch", true, true];}];
!isNil "PrepReservesforLaunch"
this would be good?
setVariable is a command, you'd add the prefix to variable name, e.g.
missionNamespace setVariable ["AF_PrepReservesforLaunch", true, true]
And then for the trigger, you'd check:
missionNamespace getVariable ["AF_PrepReservesforLaunch", false];
Which uses the value of AF_PrepReservesforLaunch in mission namespace, and defaults to false if the value isn't defined
ok
and final question
Would putting it in a comp affect it at all?
like it wouldnt break from being put in diff missions?
Shouldn't, since you're not using like variable names of objects
ok, thank you as per usual dart you have saved my ass 🫶
Define "it no worky"
How it doesn't work is the question. Error messages, or it simply does not run, or whatever
Hi, i run an event handler on each units init in my mission which reduces damage. is there a way i can modify this so that 1. I can call it from the squad leaders init to run on each individual group, or 2. simply run it through mission init where it can apply to spawned units as well as pre placed?
this addEventHandler ["HandleDamage", {
_unit = _this select 0;
_selection = _this select 1;
_passedDamage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;
_oldDamage = 0;
_damageMultiplier = 0.05;
switch(_selection) do {
case("head") :{_oldDamage = _unit getHitPointDamage "HitHead";};
case("body") :{_oldDamage = _unit getHitPointDamage "HitBody";};
case("hands") :{_oldDamage = _unit getHitPointDamage "HitHands";};
case("legs") :{_oldDamage = _unit getHitPointDamage "HitLegs";};
case("") :{_oldDamage = damage _unit;};
default{};
};
_return = _oldDamage + ((_passedDamage - _oldDamage) *_damageMultiplier);
if (_selection == "legs" && _return > 0.1) then {_return = 0.1};
_return
}];
basically i want to apply it to all BLUFOR infantry
You want every unit including AI ?
You can use allUnits command if you want to take all unit. And use side to get only Bluefor units.
yeah was hoping to set for all blufor but iv no idea how the code syntax should look like
you can use the EntityCreated event handler to detect newly placed units
private RedA_fnc_addHandleDamage =
{
if (side group _this != blufor || _this getVariable ["RedA_HandleDamage_EH", -1] != -1) exitWith {};
private _EH = _this addEventHandler ["HandleDamage", {
_unit = _this select 0;
_selection = _this select 1;
_passedDamage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;
_oldDamage = 0;
_damageMultiplier = 0.05;
switch(_selection) do {
case("head") :{_oldDamage = _unit getHitPointDamage "HitHead";};
case("body") :{_oldDamage = _unit getHitPointDamage "HitBody";};
case("hands") :{_oldDamage = _unit getHitPointDamage "HitHands";};
case("legs") :{_oldDamage = _unit getHitPointDamage "HitLegs";};
case("") :{_oldDamage = damage _unit;};
default{};
};
_return = _oldDamage + ((_passedDamage - _oldDamage) *_damageMultiplier);
if (_selection == "legs" && _return > 0.1) then {_return = 0.1};
_return
}];
_this setVariable ["RedA_HandleDamage_EH", _EH];
};
// new units
addMissionEventHandler ["EntityCreated",
{
params ["_unit"];
if (_unit isKindOf "CAManBase") then {_unit call RedA_fnc_addHandleDamage;};
}];
// existing units
{
_x call RedA_fnc_addHandleDamage;
} forEach units blufor;
allUnits get only the one created at the start ?
Oh. didn't know that. Is that behavior the same for allPlayers ?
yeah. tho not sure if it returns null for players who have not joined yet 
iirc it doesn't return anything for them (so nothing in the array)
Hm. i might need to check one of my script then. I use an allPlayers to get the players that connects in progress but I used the allUnits for testing and it seems to work when a new unit was created. I have to check. I think I used a loop so maybe when used in a loop it updates the array.
thanks Leopard20
if you run it after the unit is created it will work
here the script runs in init only
It's executed in a perFrameEventHandler. So I guess it should work then. Thank for the details ^^.
little off topic, but im in the editor. the flags section , Czech republic is still czech republic, not Czechia. BI Wana keep the old name?
just curious
Czech Republic is the official name
but they officially recognize Czechia as its official name. i prefer Czech republic(as does my ex,a Czech) i lived there for a bit
Anyone have an idea how to force the lcc to backup? Trying scripted waypoints in various increments but no luck.
been away a while from editor but i cant seem to get simulation disabled on units. in picture these AI have enable dynamic simulation ticked , settings is 500 meter (testing) and i the player,and my group are 2km away,there are no enemy nearby either. whats going on?
what am i missing?
i can view them through zeus camera,their simulation is still very much enabled, they should be frozen
Make sure to read and understand https://community.bohemia.net/wiki/Arma_3:_Dynamic_Simulation
You can also use the 3den Enhanced Debug mode for DS to get some more insights
yeah i know the system well, this is how iv always used it. it should be working as i have set it up as i used to always
group box is selected to enable dynamic simulation. no enemy or player with in range,
units are "playable" and have ambient anims running on them. thats all i can think of but it used to work with these settings applied. il test without but other than that i cant understand a reason
ok yes its one of those two things. im guessing "playable"
Are you sure that only wanted units can activate DS
The debug mode shows you who can trigger DS
can confirm now its the fact that the AI units are marked as "playable". i have them as such as im using a revive script that works on playable. if i make them not player/playable they adhere to DS fine. last year im sure it wasnt like this as i used DS successfully on playable marked AI
https://community.bohemia.net/wiki/triggerDynamicSimulation
Might wanna try this on these units.
The error clearly states what the issue is.
This is not just a "no worky" but you clearly got an error message which is helpful to debug
I dont get scripts I am sorry for not knowing what is being said to me
getVariable expects 2 elements in the right array (argument), not 3 like in the first picture
But from what I can see you want to use setVariable in the first bunch of addActions, since the action is not going to perform anything
Calculate how many parameters you pass to the command and compare them with how many are needed for correct work. Then fix it.
So change the addactions to setvariable. n this will still keep it as an interaction in the table?
and i was thinking the 2 trues was strange? i am assuming get rid of one?
That was correct, in the context of getVariable
Not correct for setVariable, it can use three arguments
It's too soon to conclude with a thank you. You are the one to solve the issue and make sure it is
im testing now, i like to say thanks as we go
would the trigger stay as getvariable?
As you might already guessed, setVariable sets a variable, getVariable gets a variable, in this context, true or false, that means correct, you want to use it as is
thought so
Ok it works in SP/MP
uploading to server rn to see if it continues to work
A little tip. Don't put code in that field directly. Instead put it into an sqf file and use execVM from within the field.
That way you can make use of proper syntax highlighting
i have no clue how to do that, is there a specific wiki page? if its not 100% required i would like to avoid overcomplicating things
Not required
once I become more confident I will most likely start looking into optimising
if lets say dificulty is Recruit, how can you disable crosshair via SQF ?
yeah it still works in SP but once it goes on the server it doesn't function. The server doesnt show any errors in console, i don't get any errors in my game. Is there a possibility of a mod causing conflicts or are there any extra steps i should be taking other putting a description.ext in the file then than export mission as multiplayer?
Cursors parameter of showHUD is the answer it seems.
https://community.bistudio.com/wiki/showHUD
Locality is a pain, depending on your script you likely have a locality issue.
sounds like it
What is your current script, and what’s your intended goal.
so this is in a console you interact with
this addAction ["Prep Reserves for Launch", {missionNamespace setVariable ["AF_PrepReservesforLaunch", true, true];}];
this addAction ["Prep Kraken for Launch", {missionNamespace setVariable ["AF_PrepKrakenforLaunch", true, true];}];
this addAction ["Prep Krono for Launch", {missionNamespace setVariable ["AF_PrepKronoforLaunch", true, true];}];
this addAction ["Prep Styx for Launch", {missionNamespace setVariable ["AF_PrepStyxforLaunch", true, true];}];
this addAction ["Prep Dako for Launch", {missionNamespace setVariable ["AF_PrepDakoforLaunch", true, true];}];
this addAction ["Prep Raptor for Launch", {missionNamespace setVariable ["AF_PrepRaptorforLaunch", true, true];}];
this addAction ["Prep Atrocity for Launch", {missionNamespace setVariable ["AF_PrepAtrocityforLaunch", true, true];}];
this addAction ["Prep Kaiju for Launch", {missionNamespace setVariable ["AF_PrepKaijuforLaunch", true, true];}];
And there is one of these for a corresponding trigger linked to a module
missionNamespace getVariable ["AF_Prep<Squad>forLaunch", false];
and when done it should start the optre ODST pod script (I am not using the console as I desire a different effect)
@flint topaz
do you guys have script to remove HE ammo from cannon assets vehicles/statics?
removeMagazineTurret ["magazine_class_name", [0]];
is it this?
also, how the fuck do i find the class names effectively
i mean i know how to find assets class name but not sure about the magazines. *(asset in question SPE_FlaK_30 = its the CDLC 1944 flak)
Incorrect var name -- AF_Prep<Squad>forLaunch.
https://community.bistudio.com/wiki/magazines or
https://community.bistudio.com/wiki/magazinesTurret or
simply take a look at CfgVehicles' config magazines[]
variable name is changing between each trigger
see the <squad>
place holder
for squad name
So you mean AF_PrepAlphaforLaunch AF_PrepBravoforLaunch so fourth?
yur
format ["AF_Prep%1forLaunch",<whatever>]
this addAction ["Prep Reserves for Launch", {missionNamespace setVariable ["AF_PrepReservesforLaunch", true, true];}]
missionNamespace getVariable ["AF_PrepReservesforLaunch", false];
so this is the line in the console and the trigget its linking to
e.g.
So this, what is this
Then something wrong with the module.
Maybe.
Are you sure syncing is needed for activation?
yes they are dependent on a trigger to activate
i have a comp with everything set up
You are saying, you have N amount of actions
Each of them execute a script so corresponded droppod will drop
Am I right?
Technically (or rather, ideally), it is not even required to use this amount of setVariable and triggers even
Current method actually only creates a bit more complicated tackle to do one simple thing
Wasnt clear pipeline
Found a smart way of figuring it out =
Flak in Eden, give it variable name:
flak1
Then run this in debug console:
copyToClipboard str magazinesAllTurrets flak1;
Find the ammo in clipboard = ex.
"SPE_20x_SprGr_FlaK_38"
Thats the HE i want to remove
last step =
directly in the Flak’s init field:
this removeMagazinesTurret ["SPE_20x_SprGr_FlaK_38", [0]];
Badoom, done. Dont have to fish for wiki stuff. Ty fo response tho
its what made sense the most to me
The thing. You may think a trigger can only execute the script. That is wrong, addAction can do the same. Which means, the trigger is not even required
oH?
In fact, {missionNamespace setVariable ["AF_PrepReservesforLaunch", true, true];} is already a script that is executed
so
if i am understanding right
missionNamespace getVariable ["AF_Prep<Squad>forLaunch", false]; could go in the iinit of the module ?
I don't actually know what kind of module is in action
its the OPTRE odst pod module
How it does look in Eden
Totally forgot about it. But middlefinges the wiki is not a good move isn't it
lemme launch my game rq
i do have a composition as well
it got spam protected
lol
Okay, I was actually wrong. I thought you are only executing a trigger to run a script
nah its to run a module
I actually missed some few contexts above, apologies. But what I told is one tip
so this in the module itself?
missionNamespace getVariable ["AF_Prep<Squad>forLaunch", false];
Init of the module likely do nothing about it
Make sure it does even work on the server without any triggers and actions
what u mean sorry
Make sure it will happen without any of your codes and triggers, so you can be sure the module is broky or your code is
Place a module. Maybe. I don't use OPTRE
I would use radio trigger for testing.
Ah, that's a better test
It has been ages since I scripted anything. What are the variables I need to look up to create a DB for a server? To recall items, stats, etc.
Do you mean profileNamespace setVariable ["whatever","whateverYourDataIs"] execute in the server?
Yes! profileNamespace and that system. I don't need my hand held, but a general flow or example would be appreciated.
It is actually up to you/the way it should work
setVariable to set, getVariable to get, and likely you want to distribute the fetched data into clients via remoteExec or such networking commands
Ok, I remember I workshopped some ideas with these variables and some others. Thanks for refreshing me. What is it called or what are the variables to compress the data, or is that really an needed step?
Storing a variable into profileNamespace already is a compress (sort of), is that what you ask?
No, I don't remember the name, but someone was recommending a way to compress the data gathered in game, store it in some new format, and then recall it back to game data. I think it might be overcomplicating things. I had a large RP server and ours never did that. Just seeing if that was needed or not, a person was adamant about it, haha.
HashMap?
Yes, is it really needed for a humble sized server? Lots of items and stats, but that data is not much more than storing class names and some numbers?
Sorry boys, been a long time since I've done anything. Can anyone tell me why this isn't working?
onEachFrame {
(driver v3) action ["LandGear", v3];
};```
Trying to get an AI pilot to deploy their landing gear and retract it on command, but for some reason it just won't do anything.
https://community.bistudio.com/wiki/Arma_3:_Actions#LandGear
From what I've experienced, it is simply bugged. There's nothing too much you can do except report in https://feedback.bistudio.com/
I'd consider that it is rather about using it, not storing it, as you won't really reach any limit or performance issue just with a bunch of string within an array or HashMap, so I'd recommend to use whichever you can use/understand
Thanks, I will keep it simple either way, but will look into both.
I think I would use HashMap for DB usage, as you can just use something like get "OurWeapons" command to fetch a data (datum, heh) you want, instead of DB select 100 or something, which you need to remember what is 100 in this context
That's annoying but oh well, thank you mate 
Thanks that makes perfect sense. Clearer and cleaner with HashMap.
While I am here, would placing an addAction in a vehicle's default scroll list be done with script here, or by config? Just to fire SQF.
FYI: #arma3_scripting message
This is what I've seen
Interesting, I'm trying it with the exact same plane and nothing 
Were you piloting that, or was it AI?
Should be AI, can't remember what I've done exactly though
No worries dude, it was for a stupid bit anyway. I quite literally duct taped two of em together and wanted to sync the landing gear.
v1 addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
[v3, _weapon] call BIS_fnc_fire;
}];```
If you're looking for a database connection- ExtDB3 is the only public addon that exists at the moment and it's notoriously bad at performance. You'll have quicker speed caching in hashmaps on server as POLPOX suggested but if you do that I highly recommend backing up profile data as it can also be prone to corruption.
I think Deadmen was talking about implementing HTTP ability to POST and GET so that would probably be an even better alternative whenever it gets released.
Yeah I used ExtDB3 in the past, and it was an awful mess. I will set up automatic data backup, thanks for the warning.
toJSON/fromJSON might be a useful tool depending on what you're trying to do.
That was also recommended in the past. I want to store a digital economy, scripted items, Bohemia items, and character stats stored and recalled, for each player.
If I want someone to respawn with the kit I gave them when they first started off, how do I do that?
Save it in initPlayerLocal, re-apply it in onPlayerRespawn
What's that? I am new to scripting sorry
File called initPlayerLocal.sqf in your mission folder
I see, and I place a script that GenCoder8 sent me inside there?
I am confused which script do I put in
Yeah, but they didn't actually send you a script.
You save the loadout using one of the functions when they start off (in initPlayerLocal.sqf), and you load it when they spawn (in onPlayerRespawn.sqf).
I see, and which scripts do I place inside each?
Use the save function to save and the load function to load.
Where is the save function, in the editor?
The one GenCoder8 sent #arma3_scripting message.
So the save inventory goes to player local and the load inventory goes to onplayer respawn
right?
Yes
Do I have to change anything in these scripts?
Call them with your desired parameters properly as is shown in the syntax section.
I'm not sure what the delete parameter does.
I assume it deletes the saved loadout of that name instead of saving to it
but then, bis_fnc_deleteInventory exists, so 🤔
Feels like less effort to use getUnitLoadout/setUnitLoadout manually than deal with those functions.
guys anybody bumped into that problem that sometimes when you set #()ui() texture and restart mission and running same script it just dont creates display, so i cant find it by its name defined in #()ui() parameters
code plz
For my unit we use IniDB2 which is can store data on the server without writing it in a database . We use it to store the inventories of players before disconnecting
private _size = missionNamespace getVariable ["CFM_displaySize", 1024];
_monitor setObjectTexture [0, format["#(rgb,%1,%1,1)ui(RscDisplayMainDisplayCFM,%2)", _size, _monitorUid]];
private _waitStart = time;
waitUntil {
!(isNull (findDisplay _monitorUid)) or
{(time - _waitStart) > WAIT_FOR_DISPLAY_TIME}
};
_mainDisplay = findDisplay _monitorUid;
if (isNull _mainDisplay) exitWith {
format["DisplayHandler.setupDisplay: ERROR: can't create main display for monitor: %1", _self] WARN
};
// control that renders picture of r2t display
private _r2tDisplayCtrl = _mainDisplay ctrlCreate ["RscPicture", R2T_DISPLAY_CTRL_ID];
private _r2tDisplayName = _monitorUid + "r2t";
_r2tDisplayCtrl ctrlSetPosition [0, 0, 1, 1];
_r2tDisplayCtrl ctrlSetText (format ["#(rgb,%1,%1,1)ui(RscDisplayR2TDisplayCFM,%2)", _size, _r2tDisplayName]);
_r2tDisplayCtrl ctrlCommit 0;
private _waitStart = time;
waitUntil {
!(isNull (findDisplay _r2tDisplayName)) or
{(time - _waitStart) > WAIT_FOR_DISPLAY_TIME}
};
_r2tDisplay = findDisplay _r2tDisplayName;
if (isNull _r2tDisplay) exitWith {
format["DisplayHandler.setupDisplay: ERROR: can't create r2t display for monitor: %1", _self] WARN
};
_r2tDisplay = findDisplay _r2tDisplayName; cant find it
_r2tDisplayName can be smth like "cfmrenderuiid0r2t"
and _monitorUid can be "cfmrenderuiid0"
it seems your waitUntil is missing or. unless its just me reading it wrong
no, i cant find it even out of script. just running findDisplay "cfmrenderuiid0r2t" dont work
its discord
removed them
oh
|| is eaten by discord formatting (it's used for spoiler tag)
!code
Please use !sqf from now on (!enforcescript soon™)
like once upon 20 times it finaly works but most time just wont. And code is same every time. Just random
so where is _r2tDisplayName created? sorry not good with r2t
and _monitorUid. they both fail?
_monitorUid is generated like "cfmrenderuiid" + str _id;
so it can be:
_monitorUid = "cfmrenderuiid0";
and
_r2tDisplayName = _monitorUid + "r2t";
and again its just looks random because sometime after many restarts it works for once
sometimes starting from editor makes arma remove previously created ctrls. but maybe not with restart
if found on bug tracker same problem before: https://feedback.bistudio.com/T188692#2944359
But this time its with embedded UI texture in UI texture
So bout that back up scripting…. My question got buried instantly. Anyone have experience making a boat back up? Trying to script waypoints to back the lcc out of the lpd. And not having any luck with the ai. Can I turn them off temporarily and just make the boat follow waypoints without a driver?
you could push the boat out with https://community.bistudio.com/wiki/addForce but not sure if that actually works without destroying the boat 🙂
your best option is moving it every frame manually
Animating is working pretty nice compared to the ai waypoints!
Does anyone have a functional AI searchlight script
I need it for a mission for tomorrow
Think we could get a force delete on hash map objects; force all references to be deleted? A total instant destruction?
Is there a way I can get the Arma 3 GM searchlight script used in forcerecon?
and how can I implement it in my own games with my friends
You can find the documentation here.
https://community.bistudio.com/wiki/Global_Mobilization_Script_Snippets#Searchlight_Guard_Towers
but what is the gm_missionhelper object
but most importantly what is the script
that is in it
that allowes me to convert them
I think it's a module or something you place in the editor, IIRC.
The script is in the link I posted.
The helper object can be found in, Logic Entities>Mission Context
Just copy the script into a init.sqf, place your guard towers, place the mission helpers next to the guard towers, and that's it.
Is there a way to return all of the controls in a display? I'm trying to make an items action system like DayZ has (By clicking an item and having an action pop up), but idk the best way to do it.
so I was thinking getSensorTargets would work on missiles, but I guess not, is there a way to get valid targets for a missile within its cone?
More AI slop I made which allows for flexible creation of DrawIcon3D- specifically the new 2.22 syntax available in development build 
-# Although currently still a WIP
What variables do I need to make a vehicle mod fire an sqf when the engine is turned on? It is my mod, I want this to be part of the base deal.
Would it be scripting or config to addAction to a vehicle action to the main scroll wheel? The goal is to add other sqf options that way as well.
You can add user actions in config as well
Thanks, was looking for a config way if I could. Forgot the variables and class names.
but I'm trying to use the already placed ones in the map
and I still couldn't find the helper object, do I just place a helipad with a script?
This couldn't be easier to do, you just copy the script into an init file, put the helper logic next to the towers you want occupied, that's it. I don't know how to explain it any simplier than that.
What is the helper logic is what I have been asking
I have said it 2 times asking specifically what it was and I haven’t gotten any answers from the wiki
Hang on, I'll post a pic
This is the helper logic, Place the helper next to the tower like in the pic.
cutText ["", "BLACK OUT"];[
[
["Flugstation Mike-26,", "<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"],
["Versorgungspunkt", "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"],
["1 Stunde Später ...", "<t align = 'center' shadow = '1' size = '1.0'>%1</t>", 15]
]
] spawn BIS_fnc_typeText; This is my trigger. What do I have to enter so that, after the text has been read aloud, it goes back to the normal image?
cutText ["", "PLAIN"]
You will also want this
cutText ["", "BLACK IN",5];
Try this in your trigger, and see if it does what you want.
[]spawn
{
cutText ["", "BLACK OUT", 3];
sleep 3;
[
[
["Flugstation Mike-26,", "<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"],
["Versorgungspunkt", "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"],
["1 Stunde Später ...", "<t align = 'center' shadow = '1' size = '1.0'>%1</t>", 15]
]
] spawn BIS_fnc_typeText;
sleep 10;
cutText ["", "BLACK IN", 3];
};
yes it works thank you 
what is the problem with Livonia map, its awesome but has much less fps than other maps like Green Sea which is three times bigger?
too much objects, objects very detailed? can I just delete ceratin types of objects and make the map playable? 🤔
trees man, delete them 😉
"Livonia? nicest plains I ever visited!"
Tree density didn't seem that high but maybe there's something very expensive with the models. I haven't tested it though.
Maybe the view models because it felt like it was only bad once you had AIs running around.
in the villages goes from 120 to 40 without any ai, its always mistery for me why is like this ...
Hmm. Give me a spot and I'll check.
I did make a script to delete half of the trees on Weferlingen so tank combat wouldn't be so close range.
Shouldn't be the houses because Cherno with CUP interiors is fine IIRC
IIRC, I do actually get relatively low FPS there too.
most Cherno houses aren't enterable, but Green Sea have the houses enterable and have normal fps, uses CUP assets ...
maybe the textures are less detailed compared to Livonia... I don't know really
I really wish to make Livania playable so players will not have to download 14Gb for CUP Terrains Core
hide houses with command and you know pretty much the lag source
then play without houses jk 🙂
Chernarus 2020 has almost all of the buildings enterable.
Just the metal sheds and a couple of industrial buildings at this point are not enterable (Ch2020)
I am creating fire with module ModuleEffectsFire_F, but there is no fire sound, how to add one to position ( and later delete sound if burning object is deleted )
does anyone have a script for HALO jump? I need to save the character backpack, give him a parachute and give the backpack again on landing. with a map choosing jump.
You might be able to keep the backpack by instead giving the player an action to open the parachute (spawning one in and putting the player in it).
You can look at Liberation´s HALO jump somewhere in: https://github.com/KillahPotatoes/KP-Liberation/tree/v0.96.8
@devout surge I have halo script but without saving the backpack, the player have to take real parachute from arsenal
can you give it to me, i might be able to add it
You can just spawn a parachute directly and move the player into it
yeah, but my group is around 15 people, i need to make them jump easily. i dont think they can manage to jum any other way
What does that have to do with what I said?
You can still spawn a parachute for each unit and move them into it
private _vehicle = createVehicle ["Steerable_Parachute_F", getPosATL player, [], 0, "NONE"];
_vehicle disableCollisionWith player;
_vehicle setDir (getDir player);
player moveInDriver _vehicle;
@devout surge the above does what Dart is saying, this would move them into a parachute while retaining their backpack :)
-# Or at least should, I haven't tested xd
I have this, and needs a flagpole(or another prop), to call this function
// SOLO el jugador abre el mapa
if (!local _unit) exitWith {};
_group = group _unit;
_haloAltitude = 3000;
// --- MAPA ---
openMap true;
mapclick = false;
onMapSingleClick "
clickpos = _pos;
mapclick = true;
onMapSingleClick """";
true;
";
waitUntil {mapclick};
_haloLocation = clickpos;
cutText ["H.A.L.O. in progress...", "BLACK OUT", 1];
sleep 1;
openMap false;
// Ejecutar HALO en TODAS las máquinas (clave)
[
units _group,
_haloLocation,
_haloAltitude
] remoteExec ["halo_fnc_execute", 0];
cutText ["", "BLACK IN", 2];```
this need is not in the script itself btw, you still need addAction 🙂
Hi everyone, do you have any idea why I have this in my logs?
22:04:09 Observer C Bravo 3-5:1 (Arnaud Spirito) REMOTE (civ_18) in cargo of C Bravo 3-5:1 (Arnaud Spirito) REMOTE (civ_18); message was repeated in last 60 sec: 4590```
No you missunderstood how private works.
There is "private" as a keyword, its a modifier for the = variable assignment.
And there is "private" as a command, that takes a string or an array of strings as argument.
The = with private keyword is faster and recommended way to do it.
Instead of an else setting the default value, just set the default value by default.
private _type = "string3";
if (condition1) then {
if (condition2) then {
_type = "string1";
} else {
_type = "string2";
};
};
ExtDB3 is the only public addon
InterceptDB exists, and afaik still works (it worked when I last touched it which was years ago :D)
ctrlWebBrowserActions has a gzip compression function, actual real compression if you care.
But if you just want to dump stuff into profileNamespace, you don't care.
How do you imagine that working 🤣
Why?
You can delete all entries.
You can replace the variable with a new one.
Why do you want it
Oh nice! Not sure I knew that even existed, but sick that people have an alternative!
where documentation tho
https://github.com/intercept/intercept-database/wiki Here too. See right side
But I think the readthedocs page is more current
linux supported ?
Not tried, the latest release doesn't include precompiled linux binary. I don't know if intercept core itself currently works on linux.
Looking through the code, all windows-specific code I can find is wrapped in ifdef's.
So it seems I developed for linux at one point.
The only server I have is linux so it definitely worked there, but you'd have to compile it yourself.
can I limit the speed of vehicle without AI? limitSpeed limits only AI driven vehicles ... 😔
maybe damaging the engine?
I once did an op where a truck had to be captured and evacuated. To make it slower, I increased its mass.
@faint burrow it works perfectly, very useful command 👌
@faint burrow very funny this command limits vehicles forward movement but not backwards, I bet there will be creative player driving backwards to get away from the enemy fast 😆
It's possible to hard-cap them by script (setVelocity) if you need something stricter. Fiddly though, because setVelocity is local.
@warm hedge
To force the landing gear of aircraft down, use a missioneventhandler.
addMissionEventHandler ["EachFrame", { heli1D action ["LandGear",heli1];}];
does anyone have attach IR grenade to player script ? 
If you're going to do this, better to use the eachFrame mission event handler. Mission event handlers are the engine replacement for the old scripted stacked event handler system.
is player score added to side score or they are completely different ? they are ...
they are what
"yes" vibes 😹
hey guys, did you notice a difference when the paramsarray is created in eden? in the init it is undefined. it tried waituntil { !isNil "paramsarray"} but it only worked once and is ignored the next time i preview.
and this is ignored completely in the description.ext respawnTemplates[] = {"MenuPosition", "Menuinventory", "Tickets"};
is it possible to override or add onto another mods function?
I want to add my own check to then run my own script inside of the Improved Melee System's WBK_CreateDamage function (At least I think it is a function)
You basically need to create a mod that places your script in the same path as the original one. You can do that by using the same pboprefix and path
https://github.com/BrettMayson/Arma-AttributesFastLoad/tree/main/addons/main
Here is an example of how it's done.
Contribute to BrettMayson/Arma-AttributesFastLoad development by creating an account on GitHub.
I am not entirely sure what exactly I am looking in there. also will this still cause the original code to run?
You are overwriting the original code.
I see, I am guessing to still have the original code on top of mine I would need to manually copy everything over?
Yes you need to copy the original code into your file and make your additions.
that means if 2 mods try it only 1 will actually count
also I am not sure if this is actually a function or what it is called, it's created inside a preInit.sqf
is there weapon holder the player cant take?
disabling simulation on holder/crate prevents you from taking/putting items into it
ok i can try that but its also attached to player
hmmm i tried ```_weaponModel enableSimulationGlobal false;
I assume you've tried lockInventory
In relation to this, I figured how to override the function however is there a way I can just add my code to before the code that would normally fire? copying the whole thing over is tedious and also it doesn't really allow other mods that do the same thing to actually do it as you would be overriding them with the base code
You can in a kind of janky way
private _originalCode = toString WBK_createDamage;
private _newCode = toString { /* your code */ };
_newCode = compileFinal (_newCode + _originalCode);
Something like that
thanks! this will make me feel better about doing what I am doing.
Also in what way is this janky?
Just because its turning code into a string and concatenating them
is there a limit to how long the string can be?
Probably not one that you'd need to worry about.
Only if you use https://community.bistudio.com/wiki/format, if I'm not mistaken.
"the maximum length of the string is 8,388,608 characters"
Yes, I see, but as I wrote, it seems to only apply to this command I guess.
what should I use when working on .sqf files? notepad works but it's not perfect
notepad++ 😄
VS Code.
nope respawnTemplates[] = {"MenuPosition", "Menuinventory", "Tickets"}; works but in sp just not like is used to in 2d
Notepad++ isn't terrible for editing individual files if you have an SQF extension but VS Code is crack if you're working in a project
Much more convenient searching across all files, etc
You could use https://community.bistudio.com/wiki/allControls @ruby spoke or take a look in the config for the IDC's you need.
does anyone have ideas how to prevent player from taking weapon from weapon holder? i tried lockInventory and disable simulation but neither seems to have any effect because the holder is attached to the player
without attach there isnt this problem
Via quick action? If so, then https://community.bistudio.com/wiki/inGameUISetEventHandler.
Is VS code the best out of the box or is there an arma plugin or anything?
AFAIK, there is no any official Arma plugin.
VS code with hemmt extension for syntax highlighting etc
pretty sure there was also some sqf language extension someone made but not sure which is better at it
I forget where in VS I activated it but there was some kind of generative sqf feature. It didn’t seem very good so I turned it off again, but was wondering if that worked for arma.
I’ll look into the hemmt extension. TY
LLM's/AI still suck at sqf, 95% of it is hallucinated
I’ve learned that the hard way! It has kind of helped me flush out ideas that I was lost on to start with but had to look up ever line pretty much and double check it/rewrite it.
thx with this workaround i cant take the item anylonger. its just that it still leaves the hand icon...
I told ChatGTP to generate some bash script and it was perfect
LLM's/AI still suck at sqf, 95% of it is hallucinated
notice how i didn't say anything about bash and was talking about sqf specifically (and we are also in a channel about sqf)
Not anymore no.
can you create simple object of weapon model and give it weapon attachments and other texture?
VS Code is also the only editor with a SQF debugger extension available.
How do I find that? I didn’t know about it.
someone said setDamage
its solved Lou thx
Thank you 🙏
how did you?
Arma Mods:
https://steamcommunity.com/sharedfiles/filedetails/?id=1585582292
https://steamcommunity.com/workshop/filedetails/?id=1645973522
https://steamcommunity.com/workshop/filedetails/?id=450814997
Visual Studio Code Extension:
https://marketplace.visualstudio.com/items?itemName=billw2011.sqf-debugger
00:00:00 Arma Mods
00:00:38 Visua...
Bookmarked, will watch. Thanks!
it was Schatten's idea to use inGameUISetEventHandler.
but then you still see the action, no?
yeah
try _weaponHolder setDamage 1?
good to know 😅
thx 😄
KK recently changed that you can get weapon directly from the person's body inventory, not the weapon holder on ground
#perf_prof_branch message
I'd assume his code would ignore it being locked or destroyed
But if you only want the action gone, and not actually prevent the player from taking the weapon then it wouldn't matterr
i watched dedmen's video about SQF debugger. i have coded all these years without such thing 🙂 can it show variable values? somehow missed that part in the video
Yes. In missionNamespace and in the current scope
ok 👍
can I put a series of checks I often put in if () inside a function so I do not have to constantly repeat them?
Yeah
if (_someCondition && [...] call fnc_someFunction) then { ... };
Can also be good to put the function call in a lazy eval
if (_x && {_y && _z}) then ...
``` == ```sqf
_function = {_y && _z};
if (_x && _function) then ...
thanks
Also consider macro instead of function
is this how I would do it?
You can just leave what's in parentheses.
You probably want CAManBase, animals inherit from Man
_unit getEntityInfo 0
Something something featherless biped
what do you mean?
I meant exactly what I wrote.
As in the whole file would be the _unit isKindOf "Man" && ...
No need for an if statement
ah, I see, thanks
does init.sqf only fire once and only for the server?
https://community.bistudio.com/wiki/Initialisation_Order
it runs on server and on client
you can check initServer.sqf for server-only init https://community.bistudio.com/wiki/Event_Scripts#initServer.sqf
hmm, what kind of things should I make server only and what things should I make client only?
Currently my code is basically all EventHandlers
it depends.
I am guessing there is no cheat sheet for this.
Does anyone have an OBJ INIT or script that makes a specific part of a vehicle e.g hitengine to be invulnerable?
I like what ACE's Advanced Car Damage does in respect to cars not detonating, but a bug allows mraps and such to be engined/turreted with very little small arms fire (pretty sure this is a bug not a feature), figured i could work around this bug by just making the engine and turret invulnerable to damage. (Id also take a mod that fixes this issue entirely instead of a workaround).
Thanks!
You can use the handle damage event handler and bypass damage for specific parts.
is there a sqf version of sqs' goto ?
thanks
is it known and is there a work around for setmissiletarget not triggering the target vehicles RWR
Any idea what the hell https://community.bistudio.com/wiki/nearObjects use as """"typename"""" argument ? (whoever wrote this page need to be slapped)
Is it possible to reverse this script so that instead of delivering this damage to specific parts it blocks it? (Im not very good at programming and sqf):
_unit addEventHandler ["HandleDamage", {
private _unit = _this select 0;
private _hitSelection = _this select 1;
// If the part is in ["head", "face_hub"], allow damage to it, otherwise return the part's original damage with none in addition
if (!(_hitSelection in ["head", "face_hub"])) then {
_damage = if (_hitSelection isEqualTo "") then {damage _unit} else {_unit getHit _hitSelection};
};
_damage
}];
Taken from this forum post: https://forums.bohemia.net/forums/topic/205515-handledamage-event-handler-explained/
The majority of the information in this thread has been extracted from @celerys original post which can be viewed here: This thread is an updated version of the above post, addressing all outdated information. If anyone notices any incorrect information in this new one or has anything that should...
!sqf
```sqf
// your code here
hint "good!";
```
↓ turns into ↓
// your code here
hint "good!";
_unit addEventHandler ["HandleDamage", {
private _unit = _this select 0;
private _hitSelection = _this select 1;
// If the part is in ["head", "face_hub"], allow damage to it, otherwise return the part's original damage with none in addition
if (!(_hitSelection in ["head", "face_hub"])) then {
_damage = if (_hitSelection isEqualTo "") then {damage _unit} else {_unit getHit _hitSelection};
};
_damage
}];
Apologies, as above
Probably just get rid of the ! after if.
Do you have an idea for reversing it so that the specified areas are the ones not taking damage and everything else does?
That's my idea.
Sorry, Thanks for the help, lol.
classname
you sure ? on other similar commands I see "house" and "building" used :/
oh right forgot that.
Command might not work with streamed objects though. No idea.
no problems, it's for finding some buildings inside a radius.
I might also use it to find radiotowers or stuff like that.
is there a way to make a unit play an animation right after using "setUnconscious" on it?
It seems to prevent any animations from playing for a few seconds
What method to play it are you using?
Engineside anim triggers tend to be a bit rigid
if you mean the method for the unconsciousness it's this:
[ _unit, true ] remoteExec [ "setUnconscious", _unit ];
For the animation it's:
_unit switchMove [_anim, 0, 0, false];
_unit playMoveNow _anim;
hm... try putting a delay to the switchmove, i think the engine's just overriding it
I did already try to put delays and also tried to set the animation multiple times. my logs do say the animation changes however the unit does not actually play any animation. I am assuming that the unconsciousness forces ragdoll for a few seconds (which it does) and the ragdoll prevents animations from playing.
yeah it does
is there a way to forcibly disable the ragdoll so I can play an animation?
not to my knowledge, i tried that before
I'll just have to deal with the delay, or not use the unconsciousness, thanks anyway
if you want you could just wait till the ragdoll is finished to play the animation
I am using the "AnimStateChanged" EventHandler. there always seems to be an animation automatically playing after the ragdoll is finished (might be due to ace, not sure) so it's fine enough
I am attempting to use the setAperture command to turn my scenario extremely dark as part of a held action, in order to mimic the sun of a planet going dark.
I am using the following script: [50, "setAperture"] remoteExec ["call", 0, false];
It does not seem to work, any ideas?
50 remoteExec ["setAperture"];
I'll try this, thanks
call accepts code, not string.
seems to have worked, now I just need to figure out the value. Thanks!
I think I get what you're saying. I haven't messed with scripting too much beyond basic stuff like showing/hiding stuff and setting off bombs to mimic explosions, calling sounds or stuff like that.
Now all I need to figure out is particle effects, is this tricky? I was hoping for some kind of orbital beam, then a swirling portal of some kind.
https://community.bistudio.com/wiki/Arma_3:_Particle_Effects and https://community.bistudio.com/wiki/ParticleTemplates ,
I would do a function of it that is called locally for every, since they are local effects.
say I want to animate multiple vehicle doors at once ie
Ifrit1 animateDoor ['Door_rear', 1];
Ifrit2 animateDoor ['Door_rear', 1];
would it be possible to define Ifrit1 and Ifrit2 under a single variable name for something like..
_Ifritgroup animateDoor ['Door_rear', 1];
Yes, you can use arrays, but then you should use loops.
No, not like that, animateDoor doesn't support that. But you can use forEach and an array of vehicles.
Thanks!
If your server is intended to be open to the public I would review this: #arma3_scripting message
If not then don't worry about it, but just like to toss it out there so people know the potential consequences :)
hey guys, trying to change classnames of starting aircraft in KPLib. I keep getting this error.
15:10:37 Error Missing ]
15:10:37 File C:\Users\seanf\OneDrive\Documents\Arma 3 - Other Profiles\Atlas%203\mpmissions\KPLibNew.pja310\kp_liberation_config.sqf..., line 537
15:10:37 [KPLIB] [PRESETS] ----- Server starts preset initialization -----
15:10:37 [KPLIB] [PRESETS] Not found vehicles listed below are not an issue in general. It just sorts out vehicles from not loaded mods.
15:10:37 [KPLIB] [PRESETS] Only if you e.g. use a CUP preset and you get messages about missing CUP classes, then check your loaded mods.
15:10:37 Error in expression <ESETS"] call KPLIB_fnc_log;
};
switch (KP_liberation_preset_blufor) do {
case >
15:10:37 Error position: <KP_liberation_preset_blufor) do {
case >
15:10:37 Error Undefined variable in expression: kp_liberation_preset_blufor
But everything is uniform and I cant tell why its throwing this error. any ideas?
First, ideally switch to version 0.96.8, which is more up to date (AFAIK, it requires the CBA mod that everyone has though). It is downloaded from https://github.com/KillahPotatoes/KP-Liberation/tree/v0.96.8 (the branch not the release).
After you've done that or decided you won't send the stuff you changed.
I appreciate the reply. Downloaded the .8 version. Without changing anything, its got me spawning in the corner of the map instead of the carrier.
Show a screenshot of your mission folder.
Don't replace files, make a fresh install instead
Into a new mission file?
yes
Strange, that looks right.
Make sure you're playing the right mission, I guess, and maybe try again.
send rpt file
Advanced Sling Loading remove this mod, it's outdated and affects AI
Does anyone know if BIS_fnc_endMissionServer is working as intended still?
I have an array I use to store animation names for animations I want to override. the array is used only inside a function.
Should I set the array once inside the init.sqf or inside the function?
For large arrays it can be better to define them globally, since it's only being created once. It also lets mods add their own animations if needed
so small arrays should be locally created inside the function. the function also adds a eventHandler which is what also uses the array, would I need to create it inside the eventhandler if it was local?
Vanilla eventhandlers dont have access to the scope within which they were created
BIS_fnc_showInventory
☝️ That fnc no longer exists? Or has never existed?
I remember using "[] spawn {sleep 3; [player, cursortarget] call BIS_fnc_showInventory;};" to open up another player's inventory screen but maybe I am just crazy
never existed
action/actionNow can do it, e.g player action ["Gear", vehicle player];
(createGearDialog eventually)
[] spawn {sleep 3; player action ["Gear", cursorTarget];};
Just shows me my own inventory
But kinda works, it mimics the addaction that appears on friendly Ai units (I can only interact with the content of their backpack basically)
I swear I was able to fully access another's Inventory exactly like if it was mine... but maybe it was using a mod
or used action on a group member perhaps
try cursorObject action ["Gear", cursorObject];?
Thats the one!
You are a godsend!
Wonder how well it works in MP on another player (I am trying to make an ACE Medical like menu right into the inventory screen)
is it possible to have a dialog that stays open in the background when the player opens the pause menu? if not, is this the correct pattern to mimic it?
(findDisplay 46) displayAddEventHandler ["KeyDown", {
if (inputAction "ingamePause" > 0) then {
if (myDialogIsOpen) then {
[] spawn {
//wait for pause menu to open and then close
waitUntil { !(isNull findDisplay 49) };
waitUntil { isNull findDisplay 49 };
//reopen dialog
call TRI_fnc_openMyDialog;
};
};
};
}];
this looks somewhat modded 
Ohh it will be far better very soon 😉
thanks
Is that inventory something you are making? It looks interesting.
Isn't it ARMStalker?
Indeed, I am redoing everything from scratch thou
The Stalker one is bugged out and it doesn't show the uniform slot nor the weapons slots for the handgun and the launcher... The launcher can't even add scopes with the default Armstalker Inv.
Pistols (and probably launchers) can also have secondary mags
The vanilla inventory doesn't give you slots for secondary mags for pistols and launchers I believe
Also, I don't think there are bipods for handguns and launchers yet the vanilla inventory has slots for them, I removed them because I need as much space as possible
Moving stuff around is already complicated, can't imagine creating working slots from scratch 😅
I mean, would it not just be:
Dragged over event handler thing -> addWeaponItem
I don't even know where to start in order to get dragging items into the quick slots working 😂
But I will figure it out
Yeah, a friend of mine fixed that and several other issues for an old STALKER Epoch server (that did not run ArmSTALKER) I ran back in 2018 😉
Nice, he added the uniform back. Still if you look into the new design I worked on it expands a lot besides adding the missing things back
Seem to remember the ArmSTALKER one also had an issue with vests, but I might be misremembering...
Did your friend managed to fixed that one too? I don't wanna carry bugs from Armstalker that I am not aware off 😅
DMed received! Thanks!
Do commands that have global effect also have JIP, or does it only exec to clients currently connected and I have to add JIP myself?
setAmmoCargo for exmaple
Global inventory commands all do JIP.
aight, thx
This can get quite expensive in the JIP queue if you keep adding and removing items :P
nah setAmmoCargo is for how much a bobcat can resupply for exmaple
Oh, that one. Not sure.
I've only tested inventory commands. Supply might be different.
So global effect does not automaticly mean thats its JIP compatible from what I understood
?
There are no good general rules like that in SQF.
Global effect commands usually apply to JIP and if they don't it's probably not intentional. But there are a lot of commands out there.
Aight I see, I guess I'll just go test it then, thanks for the help, appricate it
i just make a script that does my reSupply kinda like my repair truck: so all of the time i use that script on a Ammo box
LA/GE on that one is also quite weird and I wouldn't necessarily trust it.
what's LA/GE
Local argument, global effect. Means you need to execute the command where the vehicle is local but then it applies everywhere.
oh i see
tbh i really most of the time remove all weapons and everything from all vehicles and choppers and stuff
Where that exists though, it generally means that more info is stored locally than globally. Which doesn't make a lot of sense when it's a single number.
Just tested it, apears to be JIP compatible.
(Dedicated Server)
Placed the bobcat, set its supply thingy to 0 and left the server.
Joined back, hopped in a vehicle and tried to RRR, no options showed up
Either way, thank you for the quick response
i also use a resupply station trigger over a heli pad to drive vehicles and choppers on that pad
I simply added own RRR options to a bobcat and wanted to get rid of default ones, was just curious if it was JIP compatible
i see roger that m8
From my experience I've found the best way to think of JIP or whether something tends to be, is if it is registered by newly connected clients. That's obviously pretty "duh" since it's in the name "Join In Progress" but I've found that thinking about it like that can help. For example:
Are house windows of global objects JIP?
Yes, we know that they are because when a new client connects; previously destroyed windows will show as destroyed.
-# The above may be a simplification since it's not the windows themselves but the houses state of damage but FWIW :)
where to find the orbat unit icons?
class Delta
{
id = 1;
idType = "Delta";
size = "Squad";
type = "Infantry";
insignia = "a3\missions_f_epa\data\img\orbat\b_aegis_ca.paa";
colorInsignia[] = { 0, 0, 0, 1 };
commander = "Armstrong";
commanderRank = "Lieutenant";
tags[] = { "BIS", "USArmy", "Kerry", "Hutchison", "Larkin" };
text = "%1 Specops Recon %3";
textShort = "%1 SOF %3";
texture = "a3\ui_f_orange\data\displays\rscdisplayorangechoice\faction_nato_ca.paa"; //<- I want to change this
color = "ColorWest";
description = "Special operation group, combat recon and special tasks";
assets[] = {
{ "B_Heli_Light_01_F", 1 },
{ "B_Heli_Light_01_armed_F", 1}
};
//subordinates[] = {};
};
edit: CfgGroupIcons are working fine -> texture = "\A3\ui_f\data\map\markers\nato\b_recon.paa"; 🙂
Hello everyone... I would like your help in a dynamic mission that I am working on. The general idea is that on mission start, the whole scripts will create the AO (place/teleport the objective(s), spawn enemies, teleport players nearby (according to some mission params etc.). One issue that I have is that in some (edge/extreme) occasions, players and/or AI spawns in a different island than the objective. This creates all kind of problems. So I would like to ask:
"How can I check if there is a sea body or a river between the spawn position and the objective? Or actually how can I check if there is a clear path to the objective from the spawn/teleport position?
Thank you all in advance!
The easiest way is to create no go zones for every map that your spawn logic ignores.
Hmmm... So I will actually blacklist some areas that won't be used for placement in general (objectives, players and AI)?
You might be able to cover like 99% of cases by using something like https://community.bistudio.com/wiki/BIS_fnc_findSafePos and just having it choose a radius from the objective's position, i.e. find a safe position between 1-2km away from objective
That's how I am doing it now but my issue is that even if I find a "safe position" in about 1.5Km away, there might be a sea-body between the objective and the spawn position which actually will make the objective unreachable!
Yes. And if you are making your mission a mod, you can have these locations in a database that can be pulled at mission start depending on map.
hello, supernoob here, just messing with 3d editor.. Anyone able to tell me how to make a soldier sit in a chair?
animation magic
I am trying to add more magazines to 20 mm cannon but they are added to both miniguns 🤔
[_veh, [1, "PylonWeapon_300Rnd_20mm_shells", true]] remoteExec ["setPylonLoadout", _veh];
_veh addMagazineTurret ["PylonWeapon_300Rnd_20mm_shells", [-1]];
_veh addMagazineTurret ["PylonWeapon_300Rnd_20mm_shells", [-1]];
You'll need harry potter for that, mate.
https://forums.bistudio.com/topic/146805-ai-sitting-on-chairs/
Or maybe just google!
Read the question :/
None of these functions care about point-to-point accessibility, and neither does any Arma command. If you want to calculate it in realtime then it will either be expensive or inaccurate.
If you can handle a tolerance of say 100m of water to cross and your typical check is 1.5km then you could reasonably do a grid A*. But 10m tolerance will be >>10x the cost.
@granite sky thank you for your answer mate... I believe that having some expensive/heavy functions running on init is fine since this should be a one time thing or just add some suspension to avoid freezing everything down... But if I may ask, what's your idea of grids? How I should make this work? Should I separate the line that would connect the spawn position with the objective into grids and check if there is a water body in any of these grids?
Depends. If you're ok ruling out any pair of points with significant water directly between them then it's pretty easy. Just check every X metres down the line with surfaceIisWater or the ASL Z value.
If you want to allow points where there's water between but still a valid land route then it's trickier.
I have a custom .paa icon that I want to draw on the map in red, but it's only appearing in gray. Is there a way to edit the image to make it compatible with drawIcon's coloring?
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {
(_this select 0) drawIcon [
getMissionPath "images\player_map_icon.paa",
[1,0,0,1], //TRYING TO MAKE IT RED
player,
40,
40,
getDir player
];
}];
Even when I change the color of the image itself, it appears in gray
When I've seen that, it's because I messed something up on the png side of things with alpha layers/transparency and stuff. Check that first.
what would "messed up" look like?
Could anyone provide an example script for obtaining a unit role in a squad?
a commander role?
if so: ```sqf
team setLeader leader
Driver role
this teleports a unit in a driver place
_soldierOne moveInDriver _tankOne;
this gives him a order to enter a vehicle so he will manually go to vehicle and get in
_soldier1 assignAsDriver _tank;
[_soldier1] orderGetIn true;
Did Dco break the orderGetin command??
I execute script but AI not get in the vehicle but if use teleport it works
Make sure your texture is white
[1,0,0,1] mean you're only using red component of your texture and if you barely had any (texture is green or blue), you'll have no greens and no blues and all the reds (which you had almost none), thus the grey
waypoints```sqf
wp1 = nameofgroup addWaypoint [vehiclename, 0];
unit assignAsDriver vehiclename;
it doesnt work
It works for me.
private _grp = createGroup (side player);
private _bot = _grp createUnit [typeof player,[0,0,0], [], 0, "NONE"];
_bot assignAsDriver _target;
_bot moveInDriver _target;
_grp addVehicle _target;
Would anyone happen to know what the new font is called in the game itself, i know its 'Roboto' but not sure what it is in game?
DW, found them.. encase anyone wanted to know they are... RobotoCondensedLight , RobotoCondensedBold , RobotoCondensed
any way to apply flag patch to the vanilla Enhanced Combat Helmet, it seems it has the needed selection 🤔
something like the clan logo
this setObjectTexture["clan","usp_patches_usa\data\army\sf_oda9616_ca.paa"];
Not with setObjectTexture. Helmets are proxies, not individual objects, and can't be targeted like that.
You could make a new variant and set its config hiddenSelectionsTextures with your new textures, but that requires a mod and isn't done with scripting.
It definitely looks white. I’ve also tried a red version, and they both show up gray
What's the resolution?
Usually if it's all grey like that, it's a bad resolution (not a power of 2 x power of 2)
its 240 x 240
stretch it to 256x256
Not sure how ImageToPaa let you make that, it's not a valid resolution for PAA
If you save as paa on tex2edit or whatever without building, it bypasses those checks.
thanks it worked
this is the "power of two" thing for textures
256x128, 1024x64, 512x512, etc
Why...

I am running script from initPlayerLocal.sqf
// initPlayerLocal.sqf
[ player ] execVM "script.sqf";
how would I run this from initServer.sqf ? assuming keeping locality/JIP
To run from initServer.sqf it'd be the same thing although you might need to modify the path. I'm not sure what you mean though about keeping locality and JIP. Is something not working for you currently?
Also I would suggest using the functions library so you can ditch the usage of execVM and paths as it will make your life much easier :)
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
circumstances allowing me only using initServer.sqf, but yes, essentially that but from initServer.sqf
I am limited by this approach
Then use remoteExec.
example whould be preferrable
How are you limited?
[[player], "script.sqf"] remoteExec ["execVM", 2];
by structure of project, how files are organised and separation of client/server modules. introducing new initialisation of script was denied by project developer
usually I would run it in initPlayerLocal.sqf, but I need to run script from server, but majority of script is local to user
So you need to run it everywhere, so init.sqf?
run on client machine, when he joins mission, or jip to mission
Or better run server part on server and rest of client?
What are you trying to run? It may be easier for us to help if we understand a larger scope of what you're wanting to execute.
I'm a bit lost too 
script execute code run on server, but does require to run AddEventHandler for when player open map ( thus local to client logic ). so I need to add addMissionEventHandler Map for each client that join mission via script that is executed from initServer.sqf
It definitely makes sense to run it in initPlayerLocal.sqf.
Why does add EH script on client have be called from server?
structure of project, limitations
Otherwise, you need to change your scripts to use remoteExecs.
If you need to run code on server prior to having the event handler be added to the client, it would probably be best you utilize remoteExec like Schatten mentioned earlier. A good practice (in my opinion) is to have a singular introduction remoteExec where things can be passed from server to client in one remoteExec to avoid multiple network calls and having to worry about JIP precedence.
For example:
// initPlayerLocal.sqf
["whatever arguments"] remoteExec ["TAG_fnc_requestData", 2];
// fn_requestData.sqf
// do various code stuff on server
["return arguments"] remoteExec ["TAG_fnc_receiveData", remoteExecutedOwner];
// fn_receiveData.sqf
// add your event handlers and whatever else you want on client
I get that, probably my main issue is to figure out, how to run client side logic for player, who joins later in game (jip)
The solution I posted above would account for that, as the event script where you would remoteExec would be upon the player joining the mission, not the mission being started 🙂
[[], "script.sqf"] remoteExec ["execVM", 0, true];, and grab player inside the script, and stop the script if isDedicated is true.
Er actually looks like I did actually type init.sqf and that appears to be on mission started. I guess you would replace that event script with initPlayerLocal.sqf- that's my bad. Dropped an edit on #arma3_scripting message
this would only trigger on clients that started mission with server, it will ignore late joiners
wrong
Boolean - if true, a unique JIP ID is generated and the remoteExec statement is added to the JIP queue from which it will be executed for every JIP
could be I can run with -2, instead of 0, and then I don't need to verify isDedicated
Maybe. I thought of that but I was unsure if -2 will still work for a hosted server.
Or rather for the player on the hosted server
good point
If it is -2 player hosted server won't get it, which can ocasionally cause headaches
My advice is to do something like this for the target
[-2, 0] select hasInterface
Easiest solution would be Muzzleflashes method. If you have other tasks you are planning and are wishing to save network / guarentee order, the advice here would be pretty useful #arma3_scripting message but both will account for JIP
And I also don't recall if the JIP processing might happen for clients before player object is ready on clients. So may or may not need a waitUntil {player} in the script.
Could use a wrapper script that is RE'd, would make it easier to filter headless clients too etc..
A while ago I feel like I remember someone working on TypeScript for CT_WEBBROWSER but I can't find anything about it when I search the Discord. Could I be misremembering and it be some sort of other superset of JS or am I just being dumb and not finding it?
Ah okay found it looks like it was Vue #dev_rc_branch message
For example i have some hashmap variable, and server broadcasts it first time. Later when i change some values in hashmap and broadcast it again does it broadcasts full hashmap (with even unchanged keys) or only the changed/new keys and values? Is it somehow optimised? Im asking because im making my own OOP system and i want to know whats better to use for network optimisation: hashmap or create dummy objects and use set/get variable
Sends the full hashmap, server doesn't/can't know the state of the hashmap on each client
There's no automatic choice there. A down side of setVariable is that each global set is a separate JIP queue entry, IIRC.
I thought setvar will overwrite previous JIP
For the same variable, sure.
But if you're comparing with hashmaps then I assume you're using multiple variables.
We were able to put a large dent in our JIP queue by reducing ~12 public object variables per object to ~2 a few years ago but we also had thousands of objects with said data
You could write function which takes key values pairs in array and sets them in hashmap
Third option, yes. Need to send the server copy manually to JIP clients too.
Need to consider how often you're updating and how many entries you're going to have.
Just publishing mostly-redundant hashmaps is not necessarily the worst option.
Also worthwhile adding when we combined all those variables down to 2, we also stored them as strings which we parsed with parseSimpleArray then accessed by using createHashMapFromArray. I'm not sure I'd recommend this though unless that degree of performance is absolutely imperative as then you'll have to have a function to manage it and is just a bit of a pain.
i think i will stick to dummy objects
That is what I did for a chat app with chat history.
Server stores full history in hashmap. Manual JIP implementation to send relevant chunks of it to joining player.
Anything non-JIP is done via remoteExec's to update the server and client local hashmaps
how to get the magazine classname from launcher ?
there is command only for primary weapon
_magazineClass = currentMagazine player;
Probably this would work https://community.bistudio.com/wiki/secondaryWeaponMagazine
@exotic mesa oh, launchers are secondary items, I got it now 😆
Yeah 😅 also got handgunMagazine because who needs consistency
Entire chat history in hashmap and in missionProfileNamespace I guess? Isn't that potentially very large chunk of data?
Yes. Yes.
I do that as well for Network hashmaps. It's worked well so far.
So idk about the viability, but could we get private/internal methods and member vars for hash map objects? Only internal methods could modify the private vars?
That would be amazing 
I don't think that is viable. Due to how SQF works.
The codeblock that's running the set, doesn't know if its part of the hashmap or not.
And the set, doesn't know which codeblock it came from
Hi ! Is there a way to detect if a vehicle is empty ? I can't find a command for this, and the only way i've come up with detecting this is by doing a forEach on allPlayers and using getCargoIndex, which isn't ideal in my opinion.
Thank you very much !
i have object attached to the player, how can i get the coordinates of the object so that when i want to place the object in world its in same position? it seems simply using getposATL on the object isnt accurate especially with large objects
Maybe player's model space position and covert it to world would be accurate?
I'm thinking maybe objects roration is causing inaccuracy?
actually that is covered.. its the z that is wrong
which commands i should try?
so it has something to do with objects height i guess
_position = _object modelToWorldVisual (_unit getRelPos _object);
detach _object;
_object setPosASL (AGLToASL _position);
?
What height is being returned then?
Quick question
Other than using a CBA event to manually re-add the item, is there any way to stop someone from dropping an item in their inventory?
Or alternatively, adding mass to the player?
honestly i dont know but there is https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Put maybe you can work something out with that and https://community.bistudio.com/wiki/lockInventory as well
Hmm, I'll probably have to go with some kind of EH set up yeah
Basically I've got an air tank (technically a magazine) the player can equip. Problem is for that to work I need to remove it from their inventory and replace it with a dummy version that can't be touched
Yeah what gencoder said - youd have to manually handle removing and adding the item
And make it extra robust so players cant dupe them
Mm
I'll see what I can come up with, thanks
Huh, that was pretty straight forward lol
What if its a storage box 😄
...
Shit lol
You could check if its a weaponholder instead, but then what if its a corpse and not just one spawned by dropping the item
Things to consider
Also technically you wouldnt need to worry about this if you just dont run deleteVehicle 🤷
Instead just removeitem from container
removeItem didn't want to work so I went with delete vehicle
I'll need to play with it a bit more
Ok I think I know the issue
Arma wants a command specific to containers, not the player inventory
But of course, I can't find a command to remove a specific item from a container
https://community.bistudio.com/wiki/Category:Command_Group:_Containers
God I love arma
@arctic bridge maybe this 🤷
https://community.bistudio.com/wiki/clearItemCargoGlobal
That'll empty the whole box, I just need to remove one item
Maaaaybe I could record the contents, clear the box, edit the array, then refill the box?
I really don't want to though lol
use add and -1 as amount
You can do that? huh
Thanks!
Arma is one of the games of all time lol
is it possible that when many (10 for example) scripts that modify some array variable (adding elements) and broadcast it via setvar true runs in scheduled environment on server (they were spawned) can overwrite this array because of intersections in execution of scheduled environment scripts?
You have scripts something like this?
private _array = _object getVariable "myArray";
_array pushBack _value;
_object setVariable ["myArray", _array, true];
This is actually risky code.
actually maybe only risky with _array = _array + [_value]
Yes
Otherwise all your scripts are referencing the same array, oddly enough.
but in general, scheduler can break in the middle of that.
And therefore you might lose information.
Have a separate thread that handles broadcasting so you don't broadcast older array by accident
Wrap any read-modify-write stuff in isNil {} to make it unscheduled is the quick solution.
Honestly not sure. I want to say we've had 1 or 2 rare occasions where we ran into issues though with setVariable not running as fast as intended so data getting wonked, particularly with resize maybe.
Something to keep in mind is setVariable is only as reliable as the rest of Arma network and there's not guarantee a user will receive a specific message. The higher frequency you update, the higher chance a user misses something.
Well, setVariable itself is atomic. But you need those three lines to run without another read-modify-write on the same var running halfway through.
It would be better to update it once, rather than multiple times at almost same time
So like make some update handler that runs in loop? And just pushback elements to update?
Well, another thing is that publishing commands like setVariable true and publicVariable will all send data. It won't compress them to only one send per frame or something like that.
And absolutely do not publish the same variable from multiple machines, because then all bets are off.
You'd have to be more specific about what you're doing really.
I mean for example if you're setting public array on each iteration in loop, then it would be better to do setVariable after the loop, so it happens only for once
Depending on how important the data is, the frequency you intend users to access and how long you want it to take; might even be better to just request it from server via remoteExec like so:
var = -1;
[getPlayerUID player] remoteExec ["TAG_fnc_updateWhatever", 2];
waitUntil {var != -1};
The above uses a number instead of an array and you'd want a timeout likely and maybe a sleep but FWIW.
Yeah, we had some init code that would add a classname to an array and then publish it. Worked ok until someone loaded a mod with 5000 hats in it, and then server would jam for minutes.
instead of the waitUntil just use a callback
Sorry what do you mean by a callback?
I was about to ask, if there is fancier way to do this.
Well publicVariable and setVariable true should be reliable communication. If you can verify that updates are lost over the network without clients dropping, and it not being a concurrency bug in own code, then that should be a bug report.
It is also interesting technical question if you setVariable true on a variable containing an array, but then modify the array, whether what exactly will be sent.. Like whether it does a full copy immediately for network sending, or whether it just grabs it later when the engine prepares packets.
I mean have the server call a function on the client via remoteExec again
// you remote exec this via client, e.g [var] remoteExecCall ["TAG_fnc_askServerForVar", 2]
[_result] remoteExecCall ["TAG_fnc_giveBackResult", remoteExecutedOwner]
Ah oh okay I gotcha. The intention of the waitUntil was to wait for that value from server with the result.
LOL
From my experience it is only as reliable as the client's internet receiving it though. We've experienced a lot of issues where players will lose data due to packet loss. It's not a frequent issue by any means, but no real way to prevent it.
We're talking scripting. I'm like fully in it and suddenly some scam just appears 😅
yeah I know. but the callback is probably safer. also you can follow with a specific execution path for your request
Well there are plenty of game traffic that can be lost, like movement. But if you are losing reliable updates, like that from publicVariable, then that is a bug report. Note bugs can be tricky because user logic might have "expected" it to happen within certain time, etc..
This seems it would require function per variable? Or how does server know which function to call?
Ahhh okay I think I am actually getting you now. That's fair. Instead of resuming the script you're saying just have it handle whatever remaining code in that remoteExec?
you can make a generic function and send a string or number as the request
I mean the updates themselves aren't anymore reliable than anything else right? If I lose an update from setVariable, there's nothing that's naturally gonna check to see if that was missed outside of JIP from rejoining right?
It seems I would have to tell server, which function I want him to call on my machine to update the var and then run local code with it
yeah. but don't send the whole function, only the name or some id. then handle it locally
Yes? Just like TCP is. If reliable data cannot be delivered the connection should be dropped.
I mean Arma is UDP 
Games are UDP, aren't they?
So? Games implement various form of ordered/unordered reliable/unreliable traffic on top
That is like saying IP is unreliable and sinced TCP is built on IP, TCP cannot be reliable
In my experience, when you've got more than a hundred players on at one time; and a lot from different regions with unreliable internet connections, data gets lost. That is all I am saying.
here is project code: https://github.com/VaZaR00/arma3-cfm-system/tree/no-embedded-ui-version
There i have some set functions (fn_setOperator for example) and they create some instances of "class" (my custom system) and in init of this classes there it calls DbHandler for updating Array of instances globaly like in operator class init i call ["addOperator", [_operator]] CALL_CLASS("DbHandler"); .
But fn_setOperator function is always spawned because it has to wait for fn_init function completed (so CFM_init is true).
Contribute to VaZaR00/arma3-cfm-system development by creating an account on GitHub.
I'm thinking I could store var as key in hashmap and code as value. When server remote calls updateVar function, it will call code from hashmap after updating var
yeah that's a good way
it doesn't have to be a var name tho. it can just be a request id (incremental). the goal is simply to know what you asked the server when it responds to you
how can i give a "AnimDone" EventHandler I add, a custom value?
I want to give it a int that the EventHandler will pass onto a function
Are you asking how you pass arguments to the event handler from outside of it's scope?
yes
Gotcha- so while there's no way to pass local arguments to the event handler, you can use getVariable to access variables from other namespaces like missionNamespace. If the data that you're intending to pass is a constant, you can also use preprocessor like #define in the script where you have the event handler 🙂
or setVariable it onto a unit/entity you're slapping and Event Handler onto
alright, thanks
Thinking a bit more about it though, the preprocessor tidbit I gave probably actually doesn't make much sense for it as at that point it could also just as easily be defined in the event handler out right.
Can anyone think of any harm to doing something like this in the mission.sqm?
class Item1615
{
dataType="Marker";
position[]=
{
16009.964, 50.172607, 18160.525
};
name="silver_1";
text="Silver Mine";
type="mil_triangle";
colorName="ColorBrown";
+ wikiPage="https://wiki.domain.com/wiki/Silver";
id=102209;
atlOffset=0.3080368;
};
At the moment I don't intend to actually access this property in-game but we have CICD that parses the mission.sqm and it would be useful if I could add a custom property like the above.
From what I tested map works okay with it, but no idea what would happen if map markers get moved around and the file gets saved; or if there are any other potential edge cases I am not thinking of.
No harm, but would be wary of it getting lost on changes via the editor etc
CICD is totally new to me so cant say much, without explanation (just read about it) 🙂
is this part of a mod?
You can also create a hidden attribute for a marker containing that link. Then it won't get lost etc.
Or the comment entity
The commentity, if you will
did anyone try projectile redirection before? im doing this inside of a unit's Fired EH
private _projectile = _this select 6;
_projectile setVectorUp ((_projectile modelToWorldVisual [0, 0, 0]) vectorFromTo (unitAimPositionVisual CE_CurrentTarget));
_projectile setVelocityModelSpace [0, 0, vectorMagnitude (velocity _projectile)];
where CE_CurrentTarget is the target we're aiming at - but for some odd reason on certain maps the projectile goes way above the target, inconsistently high depending on the current spot in terrain
both unitaimposition and modeltoworldvisual are AGL so this shouldn't be happening, thus i am somewhat confused
it works perfectly fine in VR 
this is technically the second version - my initial version set both vectorDir and vectorUp and threw the bullet towards the target in an identical way, also worked in VR; but didnt work on various maps (this was set up a while ago but as far as i recall i changed to vectorUp only since i think i realized bullets use their up direction)
im not sure if i should be waiting an x number of frames after the projectile is spawned, or if the engine changes its trajectory over time and have to do it every frame
okay converting to ASL worked despite my initial assumptions being that it should just convert normally since both shooter and target are on the same plane (ATL).... uh
yeah adding or subtracting vectors in different coordinate frames is meaningless
which is why you should convert them to ASL
2.22 also has "Futures" script handle things. Which you can use to bind an eventhandler to the result. Essentially the same thing in the end, but you can also waitUntil on it and its more efficient because the waitUntil doesn't actually try to check the condition
vectorFromTo doesn't make sense with AGL coords. Consider what happens if they have different terrain heights underneath them.
yeah i realized my mistake 😂 i was like "Oh they're both gonna be ATL since they're both over terrain and not water so it should work" but i completely forgot what ATL actually implies when both are at different terrain heights
Cheers for all the advice on my mission.sqm thing. Hidden attributes and comment entity are good ideas. I will say although I didn't initially care to have them accessible in-game, would be kinda sick if I did given CT_WEBBROWSER exists. Would be cool to have players be able to quickly and easily open a wiki link where they are if they are inArea or something. Not sure which approach I'll take yet but very helpful 🙂
Webbrowser doesn't open internet pages like wiki.
But you can give them a button to open the steam overlay browser
Are you sure, I thought that's what I used for this? #arma3_scripting message
Or did I maybe use something else there? Been a while and I don't remember 😄
Retail has internet disabled
I am gonna confirm first to make sure I am not trolling you but pretty sure it works in perf in MP 👀
I remember getting really weird results that it wouldn't work on stable and only on perf despite it being released to stable so I used __A3_EXPERIMENTAL__ to feature flag
Tiktok of all things. Shame.
Perf isn't exactly retail :Harold:
Oh haha my bad
This dedmen man doesnt like me anymore 😔
how can I set the position of a unit to move forward like a meter? I tried setPos however that seems to set it using the global position rather then the local one
by move forward I mean actually set it's position and not walk
I'd do:
_unit setPosATL (_unit getPosATL vectorAdd ((vectorNormalized vectorDir _unit) vectorMultiply _distance))
what exactly is _distance ?
The distance you want to move them
I meant as in what type of value, I tried a int, vector2 and vector3, I might also be writing those wrong
The error I am getting is a missing ) which I am not sure is true
Number of meters, like 4
There is a getRelPos syntax that is simple for this
bob addEventHandler ["HitPart", {
_hitpart = _selection select 0;
systemChat str (_hitPart);
}];
its been a while since i used something like this but cant remember how i used to do it, it still returns any.
you should use _this select x (or params)
can you fix that for me, am kinda lost in the sauce
Take a look at this documentation of the event handler:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart_(Entity)
You'll notice in the example and list below it shows all of the arguments that can be accessed.
To access _selection like you are intending, you have to access it from the arrays inside of _this first as otherwise _selection is undefined.
To build off of what Leopard20 mentioned, either select <index> or params will work here because _this is an array of sub-arrays with your selection.
For example:
bob addEventHandler ["HitPart", {
{
_x params [
"_target", "_shooter", "_projectile", "_position", "_velocity",
"_selection", "_ammo", "_vector", "_radius", "_surfaceType",
"_isDirect", "_instigator"
]; // define local varaibles for each item inside of the array
systemChat str _selection; // print the selection in chat
diag_log _selection; // although diag_log would likely be better for your use case here if I had to guess
} forEach _this; // go through each of our sub array of hit parts
}];
Since you don't appear to intend to access any of the other elements you could also do:
- _x params [
- "_target", "_shooter", "_projectile", "_position", "_velocity",
- "_selection", "_ammo", "_vector", "_radius", "_surfaceType",
- "_isDirect", "_instigator"
- ];
+ private _selection = _x select 5;
For more information see:
https://community.bistudio.com/wiki/forEach
https://community.bistudio.com/wiki/params
https://community.bistudio.com/wiki/select
https://community.bistudio.com/wiki/diag_log
how to make some mods to be client only (like JSRS)? is it working with player hosted server or dedicated only? 🤔
if this isnt vehicle creation/config question you can use if(hasInterface) to run code only on clients
is it not possible to put html link to createDiaryRecord?
links not working , thx though
seems forum died completely ... at least on my end
hasnt worked for me for a while, i mean not even read only
interesting hacks, will try this stuff 🙂
well i got to the point there is button in diary now but for some reason cant click it
ctrlSetFocus for the button fixes this but if you click elsewhere then the button stops working again
I am currently on my first ever attempt at making a custom faction and am having an issue, where arma does not seem to recognize my macro:
backpacks.hpp
class UNSC_Rifleman_Backpack : OPTRE_UNSC_Rucksack {
scope = 1; scopeArsenal = 0;
class TransportMagazines {
MAG_XX("OPTRE_32Rnd_762x51_Mag_Tracer_Yellow", 12);
};
};
class UNSC_AA_Backpack : OPTRE_UNSC_Rucksack {
scope = 1; scopeArsenal = 0;
class TransportMagazines {
MAG_XX("OPTRE_32Rnd_762x51_Mag_Tracer_Yellow", 6);
MAG_XX("OPTRE_M41_Twin_HEAT_G_AA", 2);
};
};
macros.hpp
#define MAG_1(a) a
#define MAG_2(a) a, a
#define MAG_3(a) a, a, a
#define MAG_4(a) a, a, a, a
#define MAG_5(a) a, a, a, a, a
#define MAG_6(a) a, a, a, a, a, a
#define MAG_7(a) a, a, a, a, a, a, a
#define MAG_8(a) a, a, a, a, a, a, a, a
#define MAG_9(a) a, a, a, a, a, a, a, a, a
#define MAG_10(a) a, a, a, a, a, a, a, a, a, a
#define MAG_12(a) a, a, a, a, a, a, a, a, a, a, a, a
#define MAG_XX(a,b) class _xx_##a {magazine = a; count = b;}
#define WEAP_XX(a,b) class _xx_##a {weapon = a; count = b;}
#define ITEM_XX(a,b) class _xx_##a {name = a; count = b;}
#define PACK_XX(a,b) class _xx_##a {backpack = a; count = b;}
any help greatly appreciated
am using this guide, for anyone interested:
https://steamcommunity.com/sharedfiles/filedetails/?id=3461066835
nvm you have the ; in there
You should define your mag in macro without quotes,
Like in example.
https://community.bistudio.com/wiki/Arma_3:_Characters_And_Gear_Encoding_Guide#Backpack_Configuration
ah, gotcha, will try that thx
Yes, this is a good tip, I've used it in the passed.
Is there is any way to make forth faction somehow or allow AI in one faction to attack each other but own group?
Like having Alpha 1-1 and Alpha 1-2 that will attack each other as with east setFriend [east, 0]; but soldiers in group will not attack their groupmates
nope
Is a shame though... Would be nice to set a group to ENEMY where every one will attack them but they won't attack each other
how do I check what names mods have when checking for them in "activatedAddons"?
I in the screenshot I am checking if ace medial is on. i originally got this name from the code of the Improved Melee System mod.
Currently I want to do a similar check but for the Improved Melee System mod however I am not sure how I find the necessary name.
CfgPatches addon name, presumably
activatedAddons is weird. If you have multiple CfgPatches entries in a PBO then it seems to only list the last one, alphabetically.
isClass (configFile >> "CfgPatches" >> "whatever") seems to be a much better bet if you're dealing with mods that might add stuff later.
alright, thanks!
Looking for SQF documentation or example scripts to learn Arma 3 modding. Any good PDFs or guides out there?
modding and scripting are bit different things but I take it you want to script missions
Thanks
Hey peeps I need some guidance.
I'm creating a local object to rotate a bit and need to assign that object a varname/ make it editable by another local function but I cant get it to work.
I already tried just assigning a varname and then using that but it didnt work, I also tried assigning a it as a local variable but that didnt do anything either.
Anyone got any helpful pointers for me?
_PieLander = createVehicleLocal ["3as_StaticVehicle_CISLander", _newPos, [""], 0, "CAN_COLLIDE"];
//... other stuff ...
_PieLander setVehicleVarName "Pie_Vio_Object_Lander_Local";
//... other stuff ...
localNamespace setVariable ["Pie_Vio_Object_Lander_Local", _PieLander];
-> all no worky for what I need :(
you can just make it global variable, no need for setVehicleVarName
PieLander = createVehicleLocal
then use PieLander wherever
does global var work if vehicle is local? Interesting
those are two different things.. local vehicle means it only exists in one machine
Global variable in this case is global scope, not network global. It's still only setting the variable on this machine.
Global var != public var.
Aaaaah ok makes sense, thank you smart people 
However, your existing use of localNamespace is basically the same thing, so it should be working provided you're correctly retrieving from localNamespace when you do your getVariable
private _PieLanderLocal = localnamespace getVariable "Pie_Vio_Object_Lander_Local";
is what I was trying earlier
I would expect that to work
Possible investigation angles:
- something else in the script could be failing, causing the variable to not be set or causing the second function to abort for another reason
- are you absolutely sure that the second function is running on the same machine as the object was created on
I'll try out global var variant and go over the script again, still got a good bit of stuff to fix moving over to dedi server locality. The object is created locally on all clients so I can rotate it more fluidly without relying on network transmission so there should be no issues in terms of the 2nd function finding the object methinks
It'll cause an error if you have it set to do so and iirc won't exist on other machines
Greetings, what do onPreloadStarted/onPreloadFinished do? What is the "preload screen"?
NVM, both work for me:
14:57:59 [52075,1954.96,0,"XEH: PreInit started. v2.3.0.160217. MISSIONINIT: missionName=$The_Test$, worldName=VR, isMultiplayer=false, isServer=true, isDedicated=false, hasInterface=true, didJIP=false"]
14:58:00 [52075,1955.6,0,"XEH: PreInit finished."]
14:58:00 "preload started"
14:58:00 [52077,1956.07,0,"XEH: PostInit started."]
14:58:00 [52077,1956.08,0,"CBA_VERSIONING: cba=2.3.0.160217, "]
14:58:00 [52077,1956.09,0,"XEH: PostInit finished."]
14:58:00 "preload finished"
XEH: PreInit is about that point when CfgFunctions preInit = 1 functions are called
XEH: PostInit slightly before CfgFunctions with postInit = 1. (After the player is set)
Pretty interesting
They are executed again when I use Shift Num- FLUSH:
15:00:21 "preload started"
15:00:21 "preload finished"
"preload screen" seems to be the loading screen
Also happens when you change some graphics settings (i.e. textur quality):
15:03:59 "preload started"
15:04:00 "preload finished"
Did I accidentally forward something lol @winter rose
I had my phone in my pocket and seemingly accidentally forwarded a message a bunch lmao
yes, got rid of them ^^
Pretty good ad for YouTube's premium thing lol, sorry
I guess keyboard somehow changed too, I now have "/" where a comma used to be
does the ace mod actually change what the "HandleDamage" Eventhandler passes in it's _selection ?
it seems to and that feels so off. the _selection is so unhelpful without ace loaded
Why would mod change what gets passed into EH as parameter? It sounds like something mod can't change anyway
If it is a case, that'd mean ACE changed config, not code. A Mod cannot change what it would return in SQF
_selection in handleDamage always contains the selection that was hit. ACE doesn't (can't) change how the EH works. That's part of the engine, which is not accessible to mods.
I see, I guess it is slightly different due to the ace armour changes
ACE does some stuff to the default human model config to add more parts for its advanced injuries; these new more detailed selections will be reported when they're damaged. But those selections simply don't exist without ACE loaded, so the EH is not being any more or less "helpful" - it's always just reporting what's actually happening.
that makes sense. is there a way without ace to determine if a human was hit in the right or left arm for example?
Yes, there are hit selections for leftarm, rightarm, leftforearm, and rightforearm
See https://community.bistudio.com/wiki/selectionNames example 3
Note that because of the way damage works in Arma, you may need to do additional filtering to (attempt to) find out whether it was a direct hit to the selection in question. Hits can affect multiple selections, either by projectile penetration or by "splash" damage to adjacent selections.
I'm back as always
I need some more help smart peeps 👉👈
So with your help the local object creation is working and I've been able to build up/re-localise a bunch of stuff based on that but I havent been able to get bis fnc attachToRel working yet.
The goal is to attach a fair few (global) helper objects to the local version of the lander but I havent been able to get it to work yet.
Anyone got any ideas perchance?
My initial try from when it was SP ist just a looping bis fnc attachToRel
private _attachToLanderArray = [Pie_Vio_Object_PlaceSatchel_Helper1,[...],pie_sfx_randomExpl_helper_8,pie_sfx_randomExpl_helper_9];
_attachToLanderArray append (getMissionLayerEntities "pie_sfx_randomExpl_helper" select 0);
{[_x, Pie_Vio_Object_Lander] call BIS_fnc_attachToRelative;} forEach _attachToLanderArray;
I also tried running that inside a waitUntil !isNull Pie_Lander loop to make sure it isnt running before the lander's been created but that didnt get me any further.
Currently trying to use attachTo directly with some setVectorDirAndUp to keep the previous position but not having any luck there either.
Anyone got any ideas what could work/what I'm likely doing wrong? Not done too much stuff like this switching between mixed local/global localities
AttachTo is global I don't think you can attach it to local vehicle (only existing on local machine)
I read that on the wiki a few hours ago but was hoping the hivemind has a workaround lol
I am guessing there is no definitive way of doing that?
I have tried to compare the damages however the _damage is the parts absolute damage which does not help.
Subtract current damage to get damage added by injury
that does make sense, like this?
_actualDamage = _damage - (vehicle _unit getHitIndex _hitPartIndex)
vehicle _unit doesn't make sense. HandleDamage is either added to unit or vehicle, not combination
HandleDamaga also fires for total damage, so it won't always be part
thats what the getHitIndex says to do. the onlt thing I found that could fit
That's just an example, not the only possible way
It says vehicle as left side argument, but really it most likely works for units too
i understand
I am finding the _selections to be odd. when I shoot a unit that is wearing civilian clothes (shorts) in the leg is always gives me leftarm
and if I shoot a unit wearing a CSAT uniform it never gives me anything with right or left in it's name but always the generic arms and legs.
while that is technically most of the way to what I am looking for I would prefer getting the actual side too
It supposed to fire multiple times, since multiple parts get damaged by one hit
hint is not a good enough debug method, systemChat or log print is ^^
Does anyone know why this error is showing up? The code it's responding to is below, it's in the postInit of a unit and it's currently being tested in a singleplayer scenario loaded from the Editor
_this setUnitLoadout (getUnitLoadout (typeOf _this))
_this is most likely an array, like the error says
But _this in the context of a unit eventhandler is an object though isn't it?
I have actually logged all of them in systemChat, there is always like 2 to 3 at a time (plus some without a name) and what I wrote in the message still applies.
changing topics. is there a way to force a unit to change animation but stay at the same spot the last animation ended at.
For instance some Improved Melee System animations end with the character lying in a offset spot. if I change the animation the character will return back to the initial position. I did try setting the character to be unconscious for 0.5 seconds before changing the animation however while it is better then teleporting back it's not perfect.
No, in an EH _this is the array of parameters provided by the EH
The unit is probably the first element in that array, e.g. _unit = _this#0 or params ["_unit"]
So then using (_this select 0) in lieu of _this would solve the problem?
if the unit is the first element in the array. It usually is but it might depend on the EH. Check the EH's documentation to be sure: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
If you're going to use more than one of the EH's parameters, then params is likely to be more efficient than multiple select
Just using the reference to the unit so that should be alright I think
If you're going to use the unit reference more than once in the event, then saving it to a variable is definitely more efficient than doing _this select 0 every time
How much more efficient for using it twice vs using it once?
Negligible (but it will look neater)
Fair
Hey Guys, i need a bit of help with an error here. If have the issue that the PzF3 from the bwmod wont get loaded into my vehicle. This ist my WeaponCargoVar:
[["BWA3_G36KA2_RSAS_pointer","BWA3_MG4_ZO4x30_pointer","BWA3_PzF3_Tandem_Loaded"],[2,1,2]]
then i load the vehicle using this script:
weaponCargoVar = (MissionState getOrDefault [(str _x) + "weaponCargo", (getWeaponCargo _x)]);
if((count (weaponCargoVar select 0)) > 0) then{
clearWeaponCargoGlobal _x;
_vehicle = _x;
//hint str _vehicle;
{
_vehicle addWeaponCargoGlobal [((weaponCargoVar select 0) select _foreachindex), ((weaponCargoVar select 1) select _foreachindex)];
}foreach weaponCargoVar;
};
But the inventory afterwars ist just:
[["BWA3_G36KA2_RSAS_pointer","BWA3_MG4_ZO4x30_pointer"],[2,1]]
The save of the missionstate is working fine. If i take the MG4 out, it wont show up after restart. Anybody got an idea?
Adding the pzf manually via script works fine btw.
{
_vehicle addWeaponCargoGlobal [_x, ((weaponCargoVar select 1) select _forEachIndex)];
} forEach (weaponCargoVar select 0);
@knotty mantle _x is outside of foreach
That is another _x from the vehicles array. Sorry should have made that clear. Thats why i switch it to _vehicles before that for each.
ok 👍
Why is that different? It is clearly cleaner, but i dont understand the difference. You are just moving one select out of the foreach.
weaponCargoVar contains 2 elements -- weapons and counts. And we need to iterate over weapons (or counts).
Yeah that makes perfect sense. Thank you very much. You just ended a longer than i like to admit error hunt 🙂
BTW, you don't need to use global var here.
yeah i know. That was one of the troubleshooting steps so i could access it in the ingame console
I am not sure what the real difference between
player switchMove "anim";
and
[player, "anim"] remoteExec ["switchMove"];
are there specific uses for each or do they do the exact same thing?
as the wiki says
"This command has a global effect when executed locally to the unit and will synchronise properly for JIP. In this case the animation on the executing machine is immediate while on remote machines it will be transitional. In order for the animation to change immediately on every PC in multiplayer, use global remote execution (see Example 2). When the argument is remote, the animation change on the executing PC is only temporary."
in short, it's ideal to always just globally exec it, and use alt syntax
what do you mean by alt syntax?
i mean the alt syntax shown on the wiki
player switchMove ["anim"]
"If the animation you're trying to use with this command has no connection/interpolation to the unit's base animation (usually "AmovPercMstpSrasWrflDnon"), the move might not play using switchMove alone. In such cases you have to do this:
_unit switchMove _move; _unit playMoveNow _move;
This must run in unscheduled environment (see isNil)
Alternatively, just use the second syntax:
_unit switchMove [_move];"
I think I understand.
what does "the animation you're trying to use with this command has no connection/interpolation to the unit's base animation" mean?
is it if the animation I am playing does not naturally flow back into the default animation upon ending?
if you've ever seen those spaghetti nodes called animation state machines it's basically that - every animation in the game has some "path" to another animation, that's how they can transition to each other; for example going from standing to prone, it doesnt immediately switch to prone, there's a path from standing where it first plays the "going prone" animation, and then the prone animation, which is two steps technically - most cinematic animations do not have any path in or out of them so when you brute-force switch to them there's no way out and you get stuck in it, regardless of the inputs you make or what the engine designated as the exit/default
alright, and for those I use remoteExec or the alt syntax?
going solely by the wiki it doesnt seem like alt syntax is any different in terms of its multiplayer rules compared to first syntax, so doing both is still probably ideal
the few times i've used switchMove it always worked just fine
i generally dont like it cause it is stance and pos agnostic but if you're doing cinematic stuff it serves the right purpose
thanks
That note is super interesting. Do you know why? Is it because alternative syntax has a time argument that defaults to 0? 
Also super interesting stuff on isNil being used to run code in unscheduled context. I remember John Jordan saying that here #arma3_scripting message a weekish ago and had never heard of that before. What are the benefits or reasons you would do something like this? Error handling in cases of nil values?
without knowing the internals, presumably because the combination of the two commands (playmove + switch move) or the alt syntax itself (which i guess does the same thing(?)) bypasses interpolation/connection and swaps you to the animation as-is, which is also what makes it risky if you dont know what you're doing
tbf it's the same benefits as using unscheduled vs scheduled are 😄 guaranteed execution order, faster execution time, and unscheduled does not spit an error on nil variables (for example i use nil variables as returns in some cases intentionally, in scheduled it errors out, in unscheduled it does not),
in the 1% occassion i use scheduled in my dozens of thousands of lines of code (that being exclusively just for AI behaviour) i also just use isNil within those scheduled scripts for variable assignments and anything that should be done "on time" and quickly, while running things like checks for enemies and near entities in scheduled for the AI's "thinking"
Ahhhh okay cheers ty. All the development I do is for an MP mission without AI, so that probably explains why I've never needed to do something like that. Although honestly probably tons of uses I could've used that, just never knew the trick existed. Makes sense in context of the command checking nil values, but hell of a hack haha.
Main reason to use unscheduled is to ensure that your code isn't interrupted.
ye scheduled tends to hold your hand, especially with the nil variables part - i have one thing where i just assign a variable to an if statement without an else, which makes it nil if "if" ends up being false, and i then return that from the script, but scheduler freaks out in the false case because it doesnt like nil
Otherwise in an extreme case there could be multiple frames between your playmove & switchmove here, for example.
nil reference behaviour should not be considered a plus for unscheduled :/
actually makes it hard to test code properly because it can appear to be correct when it's not.
that's true, it's a double edged sword
I really want nil references to throw errors in -debug mode.
probably would be nice yeah - its both good and bad; my logic is yeah you could say "just return something, like false, or a 0 or something" but if i have explicit use cases for reading a bool or a scalar it conflicts with that, so being able to return nil and assign a variable to nil and then read it as nil is still for the "risky but you know what you're doing" use case
There are generally alternatives, although sometimes you would rather just copy a nil.
One of the worst bugs I've ever fixed was people trying to load in and all of a sudden getting hung on loading not being able to log out. Ran into a nil after disableUserInput. Which also unfortunately took hour(s) to find due to it also being a race condition that was tangled along spawned scripts from shitty legacy code 🥲
also idk if this is true but i recall the scheduler's frequent checks for the "allotted time" allowed per script is also a significant overhead in large scheduled scripts, which is partly why i dislike it 😂
oh yeah... having errors in init-scripts is very bad
encountered that a few times myself 😢
It freaks out when you read nil variable. If this if was very last statement in script it would return nilwithout any error
ye that's what i meant
How do I use switchMove or playMoveNow on a player and keep it in that animation state preventing players from cancelling it? Like I want to handcuff players and keep them in that state.
(No mods please - pure vanilla)
you can use the AnimStateChanged event handler and reset their anim using switchMove if they change it