#arma3_scripting
1 messages ยท Page 161 of 1
You have to get it then increase it then set it
And there is no easier way? seems like a lot for simply increasing a value by one
_map set ["var", (_map get "var")+1]
Ah thanks! I was worried I would have to do it outside of the set command due to limitations
SQF numbers cannot be increased by reference so no
You could make a macro too
#define INCR(hmap, x) (hmap set [x, (hmap get (x)) + 1])
INCR(_map, "var")
well I dont use it enough for that to be fair, it only happens I think 4 times in the entirety of the file so its fine
Im just using it to count the groups assigned to each Headless client and then subtracting from a counter to see where I need to assign more groups dynamically
It feels very rudamentary to have to iterate through all groups just to sort by owner, do you by chance know of a command or function that already does it?
private _unassignedgroups = [];
private _assignedgroups = [];
{switch (_x owner) do {
case (!player && !((_x owner) in _allhcs)) : {
_unassignedgroups pushBack _x;
};
case(!player && ((_x owner) in _allhcs)) : {
_assignedgroups pushBack _x;
_allhcs set [(_x owner), (_allhcs get _x)+1];
};
};
}forEach allGroups;```
Yes!
cause this is my way rn but it feels very suboptimal
this is wrong tho
Syntactically
Im realtively new to sqf syntax, whats wrong with it?
_x owner => owner _x
!player => !isPlayer _x
At first sight
Could I perhaps dm you about this? I can show you my code and the website from which it needs to fetch the data.
No DMs. Also it is not possible to fetch an online data anyways via scripts (AFAIK)
Just as a tiny tutorial:
SQF commands are either nular (no args), unary (one arg) or binary (2 args)
unary is like -1 in math (first operator then operand), so it's owner _x
And binary is leftArg operator rightArg like 1+2 or _map set [...]
Ah okay thats fair
Yeah I messed it up when I read it on the wiki
but do you think this code will work in principle?
Oh, yeah thats fair
So how would you suggest that I could filter it into these cases?
It's only possible via extensions (dll)
Is the boolean in the begiining and the cases would be smt like switch(owner _x != player, owner _x in _allhcs) and then case(true, true) and case(false, false)?
Would that be possible?
No
Could I shoot you a dm rq? This chat is really messy to look through:/
boolean = boolean and boolean not boolean = (boolean, boolean)
You can make a thread
But would it be alright if the switch is: (boolean,boolean) And the cases are different combinations of (true, false)?
There is no syntax of (boolean, boolean)
Okay so how would I implement this then? Just use if statements instead?
I was just interested in how switch cases work, I would love to know how to properly use them
switch 0 do {
case 0: {hint "works"};
case 1: {hint "I don't think it works"};
};```
```sqf
0 call {
if (_this == 0) exitWith {hint "works"};
if (_this == 1) exitWith {hint "I don't think it works"};
};```
Idea is basically same
Okay but tbh that just looks like I could just use two if statements and be shorter off
I guess switches are not useful when comparing multiple booleans like this?
First you need to get the headless clients, then assign the groups to them:
_hcclients = createHashmap;
{
private _info = getUserInfo _x;
if (_info param [7, false]) then {_hcclients set [_info#1, []]};
} forEach allUsers;
{
(_hcclients getOrDefault [groupOwner _x, []]) pushBack _x;
} forEach allGroups;
diag_log _hcclients; // shows an hashmap of headless clients and which groups are assigned to them as arrays;
...Comparing multiple booleans is simply not a thing. Just use and
I was told by someone else I could get the hcs via entities "HeadlessCLient_F", would that work aswell?
but thanks that definetly is easier then what I had planned
What I wrote is more reliable and does everything you wanted, but I guess so
Also just keep in mind that you have to run it on the server
It won't work anywhere else
Yeah ofc
ah wait wait
you cant store the group objs in hashmaps, right?
I thought only a very limited amount of things can be stored in there
yeah it says objects falls under unsupported
but is it fine when putting objs into an array?
You can store them as values, just not as keys
Ahhhh
Thank you for that clarification ^^
//gets all hcs clients into the Hashmap
private _allhcs = createHashMap;
{_allhcs set [(groupOwner _x), []];
} foreach entities "HeadlessCLient_F";
//calls all groups excluding player owned ones and pushes the groups either to the HC into an unassigned grouparray
private _unassignedgroups = [];
private _assignedgroups = 0;
{ if(!player _x && !((groupOwner _x) in _allhcs)) do {
_unassignedgroups pushBack _x;
};
if(!player _x && ((groupOwner _x) in _allhcs)) do {
_assignedgroups +1;
(_allhcs getOrDefault [(groupOwner _x), []]) pushBack _x;
};
} forEach allGroups;```
Did it like this now, I think it should work?
fuck its then
mb mb mb
//gets all hcs clients into the Hashmap
private _allhcs = createHashMap;
{_allhcs set [(groupOwner _x), []];
} foreach entities "HeadlessCLient_F";
//calls all groups excluding player owned ones and pushes the groups either to the HC into an unassigned grouparray
private _unassignedgroups = [];
private _assignedgroups = 0;
{ if(!player _x && !((groupOwner _x) in _allhcs)) then {
_unassignedgroups pushBack _x;
};
if(!player _x && ((groupOwner _x) in _allhcs)) then {
_assignedgroups = _assignedgroups + 1;
(_allhcs getOrDefault [(groupOwner _x), []]) pushBack _x;
};
} forEach allGroups;
//average expected number of groups per hc
private _expectedgroups = floor (((count _unassignedgroups) + _assignedgroups) / count _allhcs);
//freeing up the HCs with extra slots
{
if(count _y > _expectedgroups) then {
for "_i" 1 to (count _y - _expectedgroups) do {
private _freedgrouparray = (_allhcs get _x);
(_freedgrouparray select 1) setGroupOwner 2;
_unassignedgroups pushBack (_freedgrouparray select 1);
_freedgrouparray deleteAt 0;
_allhcs set [_x,_freedgrouparray];
}
}
}foreach _allhcs;
//reassigning the freed groups to HCs with no or little groups
{if (count _y < _expectedgroups) then {
for "_i" 1 to (_expectedgroups - _y) do {
["transfer",[(_unassignedgroups select 0), _x]] spawn SOEM_FNC_OWNER;
_unassignedgroups deleteAt 0;
}
}
}foreach _allhcs;```
Did I at least get the syntax right? :D
anything else?
idk, test run it
I will tommorow
its 4Am for me :D
im just glad there arent any more obvious mistakes in the code
its a start I guess :D
ti love GOLF as much as Arma 3
like the sport?
yes ofc
yeah I dont play golf
im glad u called it a sport
I mean I call chess a sport dont take it as a compliment
lol
:D
i like chess tho
gn yall thanks for the help <3
can i use a if then else inside a Eventhandler
Yes, why wouldn't you be able to?
ok cool
i ask 1st then i act
thx mate
man i cant w8 to play GOLF tomarrow im going to shoot like 3 under
and win all the money ofc
then when i get home its Arma 3 all day WooHoo
Good night all love you Guys and girls CU
How about to... actually stop to spam your offtopic Scotty?
just curios does contact when loaded under the launcher dlc tab work when in multiplayer or does it break most things?
Maybe maybe not. Just try. Not a #arma3_scripting related though
surprisingly, I don't mind ^^ ๐
yeah ok i'm a bad person shees 4 lines is spam ok
It definitely is much more than 4 lines and offtopic. I hope you can understand us
yes i can
and i will do so
im just a happy guy thats all sry mate
i still love you
thxs you Valen for the server info
ok m8s i'm off for you know what, C U
how can I retrieve an objects exact pitch bank and yaw?
specifically the values useful for the "rotation" attribute in the editor
Like this
what is _v?
An object (it was probably _vehicle)
that is so close. slight elevation difference but the rotation looks perfect
thank you lol
vector math is my weakness
Which command do you use for setting position?
it's the command used for retrieving it that would be the problem, the position is set via set3DENAttributes [[[_ent], "Rotation", [_pitchBankYaw select 0,_pitchBankYaw select 1,_pitchBankYaw select 2]], [[_ent], "Position", _pos]];
where _pos is defined: _pos = getPosATL _source;
eden position is 0 at terrain level so ATL made sense but I'm not sure if that's exactly what it uses or not
wiki says it's ATL so 
You can try rotating first then setting position (or the other way around)
I'll try that. I would guess though that setting the attributes together like that ensures one doesn't modify the other
If you're getting the position of a terrain object, they sometimes are super simple object so their land contact is sometimes different that ordinary objects
In Arma it does matter whether you rotate first or set position first (at least if you use anything except setPosWorld/getPosWorld)
I know. I'm testing on a regular model that doesn't have any land contact or autocenter settings
sure, but the command I am using simply sets the number values used by eden to display the object, and both simultaneously through a single command. It isn't actually "setting" the rotation or position
splitting the commands and doing them in different orders had no effect
I'll test whether the actual position value is wrong
again though 3den attributes are akin to variables in the way they are set and retrieved, including the transformation values
you can actually rotate the 3d model for the entity independent of the entity itself if you wanted to do that for some reason (but that doesn't change the attribute values)
Then it probably uses the center for setting position
In which case maybe you should try getting the position like this: ASLtoATL getPosWorld obj instead of getPosATL
Well, it's different. It isn't quite correct though
the icon for the eden objects are centered, and at the point where the model touches the surface by the looks of it
might need to find that offset by messing with the bounding box somehow
getPosWorld seems like a step in the right direction though
in fact I believe there are config values for how eden objects should be aligned
looking at tanoa and livonia, the powerline placement for the smaller lines is perfect. even at angles. Looks like they even scale the wire to get it to line up.
what I have is sort of almost close to that quality, but I don't know how to improve it further
to my knowledge the power lines adapt automatically when you place them in the terrain builder, might be tricky to get the same thing with scripts
same with skewed walls on uneven terrain.
ah alright
What is the difference between BIS_fnc_unitCaptureSimple and BIS_fnc_unitCapture? The wiki for both is almost identical
disregard, I see the data format is just in a different spot that I missed on my first look
I'd assume since it's logging less information, the simple version would be more performant for both capture and play?
well there is a difference mentioned in the respective wiki pages. First one logs [frameTime, unitPosition, unitDirection] for each frame, second [frameTime, unitPosition, unitDirectionVector, unitUpVector, unitVelocity]
so simple one does not count the vectors, only direction and position in 3D
doubtful there performance impact is that different between them, if anything the data is smaller
I've got epic help with this script that works, haha well, some of the time BUT when it works its so damn perfect!
Reaching out for a last call for help, is there a possibility to add so the infantry that spawns goes in under my command?
since the group positions are remembered by the game when someone dies (so a 1, 2, 3, 4 squad will turn to 1, 3, 4 for example), can I move group members to "free" a position? so a group 1, 2, 3, 4 would become 1, 3, 4, 5 and I can joinAs a unit into the slot 2 then
Try to remove units from group, then joinAs them.
ok so no other way then
kinda works
can connect any (configured) power pole to another
as long as they are spaced correctly, it works
sometimes there are gaps, and sometimes wires double up. and of course manual correction by scaling is necessary for any strong turns or larger/smaller spacing
Definitely not as good as BI terrains but good enough for me tbh
Wait you wrote a script to connect power lines placed in Eden editor?
is there any way to make addForce work on players? this is my code, basically just launches objects and units by applying a force to them with addForce:
player addAction [
"<t color='#FF0000'>Launch</t>",
{
params ["_target", "_caller", "_id", "_args"];
_viewDirection = eyeDirection _caller;
_speed = 80000;
_force = _viewDirection vectorMultiply _speed;
systemChat format ["Force applied: %1", _force];
systemChat format ["Object Launched: %1", (name targetLaunch)];
systemChat format ["PhysX Mass: %1", (getMass targetLaunch)];
targetLaunch = cursorObject;
targetLaunch addForce [_force, targetLaunch selectionPosition "rightfoot", false];
},
[],
1.5,
true,
false,
"",
"",
0,
false,
"",
""
];```
ive tried a bunch of stuff and it works fine on NPCs but i cant get it to work on players for some reason...
I did indeed
it is technically functional
You have to remoteExec it
im having trouble using setUnitLoadout
im storing the loadout, exportet from ace arsenal, in a file - lets call it rifle.sqf, in a loadouts folder inside my mission folder.
in my onPlayerRespawn.sqf im doing
private _loadoutSQF = ["loadouts\", (player getVariable ["loadout", "rifle"]), ".sqf"] joinString "";
to get the path of the file and then:
player setUnitLoadout preprocessFileLineNumbers _loadoutSQF;
but it just failes withouth error.
if i remove the preprocessFileLineNumbers I get the error "Bad Vehicle Type loadouts\rifle.sqf".
Any scripts that would ban a player for certain amount of time on death?
Doing it without preprocessFileLineNumbers doesn't work because then you're just doing player setUnitLoadout "loadouts\rifle.sqf", which can't work because setUnitLoadout doesn't accept file paths. If you give it a string like that, it expects the string to contain the CfgVehicles classname of a unit (see: https://community.bistudio.com/wiki/setUnitLoadout).
Doing it with preprocessFileLineNumbers doesn't work because preprocessFileLineNumbers doesn't return the results of the code in the file being executed - it returns a string containing the file contents, plus debug markers for the line numbers. So you're once again giving setUnitLoadout a string containing information it doesn't expect.
If you want to do things this way, you'll need to:
- preprocess the file
compilethe returned string into a Code data typecallthe code to return the array it contains.
private _loadout = call compile preprocessFileLineNumbers "loadouts\rifle.sqf";```
This is a really clunky way of doing it though, and there are better ways.
For example, you can define your loadouts as configs in description.ext (as described on the setUnitLoadout page, and retrieve the information there. Or, you can define your loadouts as global variables, in init.sqf or a preinit function.
e.g.
my_loadout_rifle =
#include "loadouts\rifle.sqf"
player setUnitLoadout my_loadout_rifle;```
I'll try that thx!
... Can I compensate you with Steam badges for the Git ?
(NB meant to be humorous)
Thanks!
Hey guys! For things like setObjectTexture/setObjectTextureGlobal I've had bad luck with them on the dedicated server. Do they need to be called with RemoteExec?
what is your usage?
Currently I'm trying to make a vehicle invisible but still have a hitbox. The script is run through initPlayerLocal - I'm not sure if that would be a problem - but I assume it might cause some issues in MP.
Ahh alright, it's rather long so I'll do my best to condense it. When a player moves over a certain speed or talks using TFAR, it adds to their detection meter. When a player's detection meter goes over 10, they're targeted. It causes an invisible car to slam into them and make the body go flying - essentially just having fun with a concept like the monsters from A Quiet Place, and learning a lot along the way.
I've got the detection down fully, which took a little while - but due to the update process I've decided to go with, it executes from initPlayerLocal to avoid having to store every player's volume and speech on the server in one massive lookup table.
The actual code for "attacking" the player is pretty simple:
sleep (random 7)+5;
private _monster = createVehicle ["B_Quadbike_01_F", player getRelPos [10, 90], [], 0, "CAN_COLLIDE"];
_monster setObjectTextureGlobal [1, ""];
_azimuth = _monster getDir player;
_monster setDir _azimuth;
_monster setVelocityModelSpace [0, 200, 0];```
I'm not sure if I should be calling this function from a different script, or if this is acceptable, but it works in my local MP testing.
How you could be sure it is not working on dedicated?
Ah I forgot to mention, right now it's not actually hiding the texture and I'm not sure if that's something that I'm doing wrong. Sorry.
Also I can't believe I never noticed this. Lou is your profile picture Hugh Laurie?
https://community.bistudio.com/wiki/setObjectTexture
How about to have BIS_enableRandomization like example 4?
I'll try adding it in, I think you might have it though because sometimes it works, sometimes it doesn't 
most importantly, such ragdoll thing exists as BIS_fnc
and you can script it now ๐
You can? Oh damn that would save me a huge headache
I was wondering how I'd go about getting it to work around forests, terrain, etc
Oh yeah true. It's addForce
Nop
old way:```sqf
_unit setUnconscious true;
_unit setPosATL (getPosATL _unit vectorAdd [0, 0, 0.05]);
_unit setVelocity [0, 0, 50];
new way:```sqf
_unit addForce [[0, 0, 50], [0, 0, 1], true];
this one is not available to vanilla game iirc (but you can copy code and use it in vanilla still)
Ahh gotcha
And so vector is the force and direction the character gets thrown in, but what does Position represent here? At first I thought it'd be the origin point of the force, but that's under the vector
addForce?
it's
- force vector
- object's relative position
- true or false for unconsciousness
https://community.bistudio.com/wiki/addForce
Yeah, sorry I looked it up but I'm not too sure on what the relative position is - if it's not the origin of the force, is it to do with where the force impacts the object?
it's not on a git it's in a text file on my desktop lmao
yes it is that ๐ "where the force is applied"
force vector = "direction + strength", relPos = "force application point"
Alright - thank you mate, legend as always 
hey all, im trying to rename items from a couple mods.
ive got pretty much everything worked out except for the cfgweapons classes.
Im not sure how i should be structuring it to actually rename an item rather than make one.
For instance i am trying to rename the ACE Epinephrine autoinjector to Adrenaline,
displayName = "Adrenaline Pen";
};```
If anyone could tell me how stupid i am that would be great.
in my patches for this im only mentioning "ace_medical_tretement" do i need to mention "ace_main" aswell?
Hi! That's not scripting, that's #arma3_config ๐
sorry about that lol
np, good luck with it ^^
hay mates how do i get the BIS TaskPatrol to work on spawned in enemy this dont work here
[group this, getPos this, 150] call BIS_fnc_TaskPatrol;
i use _grp to ID the enemy group
[_grp this, getPos this, 150] call BIS_fnc_TaskPatrol; dont work eathier
[_grp this, getmarkerpos "HQ", 150] call BIS_fnc_TaskPatrol; dont work eathier
_grp is not a command.
What is this?
ummm its a var
Yes. Then what's this: _grp this? Var + var?
yes umm _grp = _grp in my script
Doesn't make sense.
you just gave me an idea
thx m8
i see now what im missing
_grp = createGroup east;
_grp = _grp;
The last line doesn't make sense.
oh no ok darnit
ah ok cool
thx m8s i love u guys
it works awsome
woohoo Arma 3 hell yeah
thx for your help mates
is there a way to prevent ai from glitching through vehicle when setcaptive is set to true? they stand up from inside the passenger seat of car making their heads appear on the rooftp of car
Update their animation when they get put in a vehicle
Here's an example from ace
https://github.com/acemod/ACE3/blob/master/addons/captives/functions/fnc_handleGetIn.sqf
In a preInit XEH from CBA I have this little event handler to be able to log players for easy export. But it never updates or run when on a dedicated server. It runs Eden MP it update the mission namespace, but does not run on the dedicated. Am I running it wrong?
if (!isServer) exitWith {};
[QEGVAR(log,player), {
params ["_guid","_name"];
private _unit = [_guid] call BIS_fnc_getUnitByUID;
private _playerLog = GETMVAR(EGVAR(log,players),createHashMap);
INFO_3("PlayerLog","Connected %1 [%2] (GUID: %3)",_name,_unit,_guid);
if (!isNil{_playerLog get _guid}) then {
INFO_1("PlayerLog","Updating Log Entry [%1]", isNil{_playerLog get _guid});
private _data = _playerLog get _guid;
/* SNIP magic */
};
SETMVAR(EGVAR(log,players),_playerLog);
}] call CBA_fnc_addEventHandler;
addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
[QEGVAR(log,player), [_uid, _name]] call CBA_fnc_serverEvent;
}];
Looks fine, is your event raised at all?
Can't check right now, but is !isNil{_playerLog get _guid} your intention?
Yes there is else there that creates or appends depending on if it exists already or not.
Here is the full code:
https://github.com/7Cav/cScripts/blob/main/cScripts/functions/init/fn_init_eventHandlers.sqf#L42-L76
It seems to create the namespace but that's it.
Yeah I was just meaning wrapping it in a code block
I have _caller as a param in the code portion of an addAction. How would I pass that to a .sqf that gets remoteExec'd in the same addAction?
You mean you are executing a file, then later you want to pass that arg to that file? Why do you want to do that instead of just passing it in the original?
Post what you got so far so I can see what you want in the end.
I want to _caller to go to that RadioHQ.sqf. Below is the hold action code.
params ["_target", "_caller", "_actionID", "_args"]; //needed for finding player that made the action
missionNamespace setVariable ["ActionCallHQ", false, true];
["scripts\RadioHQ.sqf"] remoteExec ["execVM", 0];
So that in that .sqf I can do this:
[_caller, ["wait1",100]] remoteExec ["say3D"]; // prolly dont need to remoteexec this if its in the .sqf
I haven't tested it but I assume that the .sqf isn't going to know who is the _caller unless it is defined in the sqf or somehow passed?
[[_caller],"scripts\RadioHQ.sqf"] remoteExec ["execVM"];
// then in the script:
params ["_caller"];
Correct.
execVM normally looks like this:
_arguments execVM "filePath";```
So you convert it to `remoteExec` like this:
```sqf
[_arguments,"filePath"] remoteExec ["execVM"];```
Awesome, I will test this now. If I have multiple arguments would they simply be separated by commas within the square brackets?
Yes. [] indicate an array; you are passing an array of arguments; , is the element separator in an array.
[[_argument1, _argument2],"filePath"] remoteExec ["execVM"];```
If you're using target 0 with remoteExec, you don't need to specify that because it is the default
* unless you want to use another non-default parameter that comes after it
execVM? 
Custom Chat Help
Using a trigger, how can I make all map objects in the area invulnerable?
I am having an annoying issue where a map maker left all these cool props in an area, but they are possible to destroy, making them fall into the ground, leaving objects floating or exposing bare terrain. The issue is there's so much stuff here that I can't get every object reliably using the "Edit Terrain Object" module.
I've also had issues with that module just not working in multiplayer. So I'm after another solution.
I used an eventhandler so that say if a hut was destroyed it would delete everything in it. This way there was no floating stuff or physics objects on the ground.
Well in this case I don't want the object to be destroyed. If the props get blown up that kind of ruins this location.
The map maker should have made the objects invulnerable but didn't for some reason.
And there are a lot of objects.
Ah my mistake. I dont know that one.
I mean I can still use that block of code in other scenarios!
So leave it! :P
Still helpful, just not the use case I need currently.
myBuilding = ((nearestObjects [getpos chair1,["Land_vn_hut_02"],20])#0);
addMissionEventHandler ["BuildingChanged", {
params ["_from", "_to", "_isRuin"];
if (_from isEqualTo myBuilding) then
{
deleteVehicle chair1;
deleteVehicle desk1;
deleteVehicle radio_hut1;
deleteVehicle hut_cup1;
hint "hut 1 deleted"; // put your deleteVehicle commands here
};```
Pretty sure enableDamage works on terrain objects
I don't see why it wouldn't
ModuleEditTerrainObject_F frequently fails to sync with all clients in my experience.
That's what I was talking about.
I'm trying to check if a vehicle is nearby.
But I can't figure out how to have the script check the returned vehicles list, to make an exception where if vehicles nearby are part of "allowed vehicle" array, then it continues - but if the vehicles are not in the allowed array, then exit there with a hint
private _vehicles = nearestObjects [_position, _allowedTypes, _radius];
if (_vehicles isEqualTo []) exitWith {
...
};
nearestObjects supports multiple base classes, nearObjects only supports a single one per-lookup
Yeah, someone else had a similar issue with destroying terrain objects. Which is why I was saying to just disable the damage yourself
Thanks
ive failed epically lol
i guess is not just download the code and compile it
this has been fixed in Arma 3.18
2.18* ๐
3.18 sounds an update from 2035
lol, don't know. Worked for me last time I fumbled with it
But its possible that I never built "Release" but only "Debug"
Lets talk triggers for a second, for i am bamboozled...
If trigger is set to any player present, server only, and only this in condition, it will activate when any player enters it, then deactivate when all players leave, right? Dandy.
However if condition for same activation is set to this && MY_VAR, where my var is true, it will activate if any player enters, cool so far.
However, if MY_VAR is later set false, with players still in the trigger, condition will evaluate false and trigger should deactivate, yet it remains active, why?
On same note, why does non repeatable trigger continue to evaluate condition, even after its been "used up"?
HI guys, have you ever edited max zoom in vehicle?
my idea is:
edit how far/max zoom for vehicle gunner can be done - how much can gunner zoom. I want to limit it to like 4x for example
When a non-repeatable trigger activates, that's it - it does not deactivate, it just remains activated. That's just how it works.
Because BI coded it that way ๐คท
I think it's technically a bug, but the chances of it being fixed are probably not very high.
This requires changes to the turret camera's config. #arma3_config
Just don't use triggers.
@still forum , what says you about fixing activated triggers that still check condition?
also: https://community.bistudio.com/wiki/Description.ext#allowProfileGlasses may we have allowProfileFace for 2.20? :3
Ah so deactivation is only when repeatable. It would be grand if wiki mentioned it.
For example, trigger plays SFX and it says that "it plays sfx as long as trigger is active", which it never will stop playing in that case
To remedy this and above, i just delete trigger after its done doing whats its supposed to do. Fixes my problem, but i was just wondering why i had to do that.
For my linear missions i do prefer using them as opposed to scripting and FSM.
Also its much easier than doing own area detections etc.
And if game provides "wheel", why reinvent it?
Well...the game provides tractor wheels. Normally that's fine, but sometimes you're trying to run the Nurburgring, and then it is not fine :P
Imean as ive said, for what i need it to do, it works fine. Just that i will have to delete triggers once their use has been, well, used.
Also, some performance improvements if bi fixed condition bug
Could fix it with deleting the trigger itself after it's tripped?
one line ish
Oh lol, I did not read far enough down
one thing is that steam SDK is missing in the repo
ive passed from 100 errors to 24 ๐
oh
well adding #include <string> in webbrowsercontrol.hpp solve it
ngl chatgpt suggested that
ticket and repro
โ @hallow mortar Cc @stark fjord
It's probably better to add a new parameter. If you "fix" this some missions might break 
Imean what mission would rely on condition evaluation past tripping (if non repeatable)
Ill make a ticket
Could a notice on wiki for https://community.bistudio.com/wiki/Eden_Editor:_Trigger
For On Deactivation be added that it wont fire for non repeatable triggers?
@winter rose
sure thing
Added, thanks ๐ป
Got a question.
So for context Iโm absolutely rubbish at anything scripting related and need even the most basic stuff that isnโt a module spelled out for me,
What I want is a script or something whereby you go into a plane hanger and walk up to a laptop and it opens the virtual garage (like the one in the virtual arsenal scenario) with (ideally) just aircraft from one modded factionโฆ is something like that possible?
Iโve looked at some YouTube tutorials but they keep saying stuff about opening mission files and it just looses me at that point
to answer your question: yes, something like that is possible.
so you want the labtop to create aircraft is this correct
sounds easy enough
is this for DeD server or no
would this be correct
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
ill try again
you can edit your message, just add before code
```sqf
and end of
```
copy
for some reason ever since the update, the "ok" button for some of our modules just refuses to work so we cant make any changes, our unit relys heavily on simplex support services for our vehicles and equipment spawners, but since the update we cant change enything since the button refuses to work unless the code is removed, anyone else having this issue?
if i copy the spawners directly they work perfectly fine, i just cant make any changes unless the code is removed, so i know the code is not the issue since it works otherwise and was working fine before the update...
the code in question:
private _posASL = getPosASL Car_1 vectorAdd ((getPosASL Car_2 vectorDiff getPosASL Car_1) vectorMultiply 0.5); _posASL set [2,_posASL # 2 + 7.4]; { if (_x != _this) then {deleteVehicle _x}; } forEach nearestObjects [ASLToAGL _posASL,["Car", "Armored"],5]; _this setPosASL _posASL; _this setDir (Car_1 getDir Car_2);
more specifically when this exact part of the code is entered it refuses to work:
_this setPosASL _posASL; _this setDir (Car_1 getDir Car_2);
if (hasInterface && !isServer && !isDedicated) Exitwith {false};
this part wont work if you call your .C1_Green.sqf on client.
its local event, and it have interface, it is not server, it is not dedicated.
so you need
"Scripts\C1_Green.sqf" remoteExec ["execVM",2]; //will be executed on server
Sleep 1;
Exit;
is part what you dont need there
Is there any reason the following should fail?
waitUntil {speed _leader > (_maxSpeed/4)};
Presuming the variables are appropriately defined. I suppose there could be a zero divisor error with _maxSpeed but that shouldn't happen in my use case.
The variables are defined properly, so there shouldn't be a problem there. Nevertheless I get Error Undefined behavior: waitUntil returned nil. True or false expected. on execution
Are you 100% sure that the variables are defined properly? If so, then try to use parentheses.
No, because of a syntax error. Read this: https://community.bistudio.com/wiki/addAction
does anyone knows a version of this CBA_fnc_addBISEventHandler but for Group EH?
hhmmm thats funny my script works and no errs and the chopper spawns on the server and it work good hmmm
how do you use drawIcon3D with format?
nvm. Just define a string with a variable inside the event handler
so i changed the code as requested, now its just the issue of it finding the two markers and spawning on them correctly, those being Tank_1 and Tank_2, it knows what its looking for as its spawning in the rough area, just in the wrong spot and direction, and ideas?
updated script:
private _posASL = getPosASL Tank_1 vectorAdd ((getPosASL Tank_2 vectorDiff getPosASL Tank_1) vectorMultiply 0.5); _posASL set [2,_posASL # 2 + 7.4]; { if (_x != _this) then {deleteVehicle _x}; } forEach nearestObjects [ASLToAGL _posASL,["Car", "Armored"],5]; this setPosASL _posASL; this setDir (Tank_1 getDir Tank_2);
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
So what exactly are you trying to do ?
basically we use the mod simplex support services to have spawners for all our vehcles, supplies, assets, all sorts, the code was working totally fine origionally before the arma update a few days ago, now....it still works, but i cant make any changes unless i get rid of the following part of the code: this setPosASL _posASL; this setDir (Tank_1 getDir Tank_2);
so the spawners work, but we cant make any changes because it stops the "ok" button or the enter key from saving any changes and just leaves you in the module, but if you take the code out, it works totally fine, but its not giving any errors or anything, and we know it clearly works because the current spawners are working...
we only found out about this because we need to make some changes to it but now we cant, i have no idea at all whats wrong with it and we heavily depend on these working
iv also tried contacting the dev for simplex and even they have no idea, but a few other have had the same issue
I have one particular unit that doesn't want to listen to limitSpeed. Any ideas why this might be the case?
Did you try to run the code with only simplex ace and cba myb there is a mod conflict and that might be happening ?
yep, same issue
What version of the mod are you guys using ?
Dev or main ?
dev
just for clarification, as shown in the code, we are using two invisible parachute markers to identify where to spawn and what direction to face by referencing them, tied running absolute minimal mods again, still no success, genuinely ran out of ideas on what the hell is wrong with it now
where are you putting this code in module ?
in the item init list, in the logistics station module
question bout setObjectScale is it JIP compatible or should i remoteExec it on where object is local, whenever someone joins?
Should be JIP compat.
As long as it doesn't move and is unsimulated. Simple object preferred.
its attached and simulation disabled, thanks
are limitSpeed and forceSpeed broken now?
any luck on your end?
nah IDK honesly.
iv exhausted every possibillity i can think of, i have no clue whats going on, it was working totally fine before the game updated, they work sure but i cant change anything about them, it wont give me any errors or anything...
Anyone else have any ideas by chance?
What's the full context. Show everything.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
woohoo Arma 3 woohoo yeah it works thx all that helped me
i freeking love you guys woohoo
What kind of values are we looking at < 5kmh or >
Wiki doesnt specify, but i imagine these commands need to be ran where unit is local.
Side note, unrelated to issue, you can do _parameters params ["_minSpeed", "_maxSpeed", "_minDistance", "_maxDistance"]
Ok don't chase me with pitchforks and fire now, but, how good is ChatGPT to use for getting scripts?
Not good for sqf
Oh, ok
is it needed to broadcast variable with jip = true ( 3rd param ) when it is used with missionNamespace ?
missionNamespace setVariable [ "TAG_variable", 0, true ];
No.
Depends,, mission namespace is more or less same as just setting a global variable.
Why you wanted to do it, is the question
my usual usecase is to store some state, that I want later to read from player PC, regardless if he is JIP or not
If you do it only at the start of the mission, during init, then no.
If it changes later via some script, then yes
got my answer, thx
Also if you set it later on one machine and need to sync across all machines
i have this following script;
(not made by me, but using it)
player setvariable ["Soccer_Hit",false,true];
MY_KEYDOWN_FNCDCGETIN =
{
switch (_this) do {
case 29:
{
if (player getVariable "Soccer_Hit") then
{
player setvariable ["Soccer_Hit",false,true];
hint "Low kick.";
}
else
{
player setvariable ["Soccer_Hit",true,true];
hint "High kick.";
};
};
};
};
VCOMKEYBINDINGDCGET = (findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 spawn MY_KEYDOWN_FNCDCGETIN;false;"];```
However this script wont work on server for some reason, only on singleplayer. I'm newish to this stuff so don't know what to do.
(It is in a .sqf file thats executed via init.sqf execVM, tried putting it in different init-.sqf files)
whats its supposed to do, show hints?
changes(?) a variable to do thing x or y, but the hints show which one is active
ok where is it run from? that script wont work in server because of player/hints/keyDown need to be client side
what do you mean where its run from?
like which script file
ah, but as i wrote there, its in an .sqf, thats being run from init.sqf
oh sorry missed that. just wrap it inside hasInterface command to run it only for clients
if(hasInterface) then { code here };
cheers, thanks!
HI guys, have you ever edited max zoom in vehicle?
my idea is:
edit how far/max zoom for vehicle gunner can be done - how much can gunner zoom. I want to limit it to like 4x for example
how do i limit the distance of this from the flagpole on DED server ```sqf
this addAction ["<t color='#FF0000'>Teleport To BlackHawk</t>", {_this spawn compile preprocessFileLineNumbers "Big_Chopper\TeleportToChopper.sqf"}];
i want it to be < 5
https://community.bistudio.com/wiki/addAction
9th parameter
Am I being stupid or is there no difference between _weapon and _muzzle in the Fired EH
Is there still no answer on how to ignore/suppress 'no entry' popup?
I have this
player addEventHandler ["Fired", {
// params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
systemChat format ["Unit = %1", _this select 0];
systemChat format ["Weapon = %1", _this select 1];
systemChat format ["Muzzle = %1", _this select 2];
systemChat format ["Fire Mode = %1", _this select 3];
}];``` But Weapon and Muzzle are returning the same value.
My unit just installed this
https://steamcommunity.com/sharedfiles/filedetails/?id=3085697583&searchtext=suppress
Hasn't failed yet
wow
NOTE: Use the -nologs command line parameter instead if you are not a developer. This mod is helpful for those who would like a faster development experience without their game being suspended by verbose warning messages that present themselves as logs anyway.
does -nologs delete that window?
Never used it, but most of us keep logs on because we work on shit anyway 
Will give it a try. Thanks pal
A weapon's primary muzzle is often (although not always) just referred to by the name of the weapon class. Its properties come from the top level of the class and it is not separately defined.
You'll notice a different name if the weapon has multiple muzzles and one of the alternate ones was used, or if the weapon is configured so all its muzzles have unique names.
fuck yeah this is the what I wanted
Thank you
I'll force this mod in our server
Keep in mind that if you suppress all errors, you will also miss errors that actually matter. It's usually better to fix the error rather than ignore it.
You need
waitUntil {!isNull findDisplay 46};
waitUntil {alive player};
```at the beginning of `init.sqf`
I guess there's no fix where I want to delete specific item from player and it gives me error.
{
_bannedItemClassname = _x;
player removePrimaryWeaponItem _bannedItemClassname;
player removeMagazines _bannedItemClassname;
player removeItems _bannedItemClassname;
}foreach GRLIB_blacklisted_from_arsenal;
In this simple script... Why would one give me no entry error???
I wanted to remove doomsday shell and so on
Post exact error here
Fun part is that the error popup and script works fine..
wait a moment..
You're not supposed to use magazines with items commands and other way around
I dont understand..
{
_bannedItemClassname = _x;
player removePrimaryWeaponItem _bannedItemClassname;
if(isClass(configFile >> "CfgWeapons" >> _bannedItemClassname)) then {
player removeItems _bannedItemClassname;
};
if(isClass(configFile >> "CfgMagazines" >> _bannedItemClassname)) then {
player removeMagazines _bannedItemClassname;
};
}foreach GRLIB_blacklisted_from_arsenal;
player addWeapon "rhs_weap_M590_8RD";
player addPrimaryWeaponItem "rhsusf_5Rnd_doomsday_Buck";
for "_i" from 1 to 13 do {player addItem "rhsusf_5Rnd_doomsday_Buck";};
You're trying to remove your magazine with removeItems command
magazines and items are different and have their own command
Because the mags and backpacks are mixed in GRLIB_blacklisted_from_arsenal
Well, you'll need to add a case for backpacks too then
check whats in that array and use proper command
backpacks are vehicles btw
Then if I just mixup items and mags,
Am I good to go without class check? I thought removeItems is safe function which does not give you error when you type in wrong classname or mags.
Maybe that was the cause which popup no entry window...
Thank you!
What is the sqf equivalent command for telling a selected unit to Advance? Via vanilla controls, you hit tilde to bring up commands then 1 for Move commands, then 2 for Advance. He then moves forward until you stop him. Is this simply a doMove to some distant point in direction of player?
Think its like that
It's an engine feature that is not exposed via SQF
It's not a doMove. It's more like a formation command
What values for which part?
speedwise?
you mean the input speeds?
recent test was [15,55,16,50]
Got improved results by using a different value for each vehicle in a convoy + using the separation command.
The minimum speed being too low can cause instances (ones where the unit/vehicle in question is actually obeying the command) where the vehicle moves at min speed right at the max distance. I have ways to remedy this in mind but I can't do that if the AI units won't all consistently obey the limitSpeed and forceSpeed commands
I know there are scripts that use velocity to force a vehicle speed limit with players, but I don't want to adapt something like that for AI since it could mess up their behaviour and overall just look far less elegant.
the problem I am facing is that some of the units in my convoy seem to ignore the speed limit being applied to them. Most obey, but there is always at least one that doesn't
hey there. I'm using this _fuelTruck = createVehicle ["O_Truck_02_fuel_F", _selectedFuelTruckPosition, [], 0, "NONE"]; to place my fueltruck. I'm using random 3d locations and finding the truck is sometimes wrecked on spawn. I'm I missing something that would assist in this not happening. I thought the "NONE" was to check for collision.. If I change 0 for centre readius, how large a number can I choose and would this help? I was thinking 10?
The placement radius is in metres. I don't know if there is a limit; if there is it's certainly more than 10. However, the radius is a randomisation radius, so it doesn't really help; if the collision protection isn't perfect, it could still choose an unsafe position, just further from the centre point.
One thing to try would be using vectorAdd to add a little bit of height (say 0.5 to 1 metre). This would help avoid small objects and terrain irregularities, while being a short enough drop to not damage the vehicle.
You can also try BIS_fnc_findSafePos
thank you, will jump on it now
I'm interested in a script that make artillery and mortars (Spearhead units) shoot at a specific location, having unlimited ammo and only stops if I blow it up/kill the units.
Would be amazing if anyone could help me, since my knowledge in scripting is equal to zero haha
its a great oportunity to learn!
my first script was an zu23 shoting to the air just for ambience ๐
It certainly is haha but I need a BIG push forward otherwise it's gonna turn out to shit, or I'm trying to use chatGPT for help haha
dont use chatGPT, there is no enought SQF code to make things even usable
Haha yeah I heard it shit for scripts,
Do you by any chance have the script for the Ambient firing?
https://github.com/Flyingtarta/AntiAirRandomFire/blob/master/randomFire.sqf
[this] execvm "randomFire"; on the init, and it works
its awful, but it was my first one 
I prefer awful instead of no script at all haha
start with the commands doArtilleryFire and getArtilleryAmmo, also you can add "Fired" EH for unlimited ammo
Is it better to call in scripts like this sqf [_object_ap, _anti_device, _killrange] execvm "\Metho\scripts\antid\aob_remove.sqf"; or is it better to make it a function and spawn it as a function?
I have this old script from genesic for football;
if (isServer) then
{
SoccerBallArray = [];
Soccerball = "Land_Football_01_F" createvehicle getpos SoccerSpawnPoint;
SoccerBallArray pushback Soccerball;
sleep 5;
while {alive Soccerball} do
{
_Closestplayer = [allPlayers,Soccerball] call BIS_fnc_NearestPosition;
if (_Closestplayer distance Soccerball <= 0.5) then
{
[[SoccerBall,"Kick1"],"PlaySoundEverywhere"] call BIS_fnc_MP;
_GetVelocity = velocity _Closestplayer;
_playervelocityX = _GetVelocity select 0;
_playervelocityY = _GetVelocity select 1;
_playervelocityZ = _GetVelocity select 2;
_boostX = _playervelocityX * 3;
_boostY = _playervelocityY * 3;
_boostZ = _playervelocityZ * 3;
_Punt = _Closestplayer getVariable ["Soccer_Hit",false];
_Boost = 0.5;
if (_Punt) then {_Boost = 3;};
Soccerball setVelocity [_boostX,_boostY,_boostZ + _Boost];
};
sleep 0.01;
};
if (!(isNil "Dis_ResourceMapDone")) exitWith {deleteVehicle Soccerball;};
};```
Problem is, when the ball is "kicked" it moves very laggily for anyone else for anyone else than the host/singleplayer or when on dedicated server it obviously. For the host or on singleplayer the ball moves smoothly, with correct "physics" and no lagginess/floating.
Is there anyway to basically "sync" it for everyone so it behaves the "singleplayer" way and not in the "laggy" way
if this script is called multiple times, it's recommended that you make a function instead
The script would only be executed one or two times but internally it has multiple while / for / waituntil loops
and some remote execs (within the while loop post condition checking)
As some kind of rule of thumb, if it gets executed more than once, it's usually a good idea to make it a compiled function
Ugh, I can't read ๐
Question are CBA event handlers and ACE
["ace_captiveStatusChanged",
{
params["_unit", "_state", "_reason"];
}] call CBA_fnc_addEventHandler;```
Where would souch event handler be executed? globally, only on "handcuffer" or "handcuffee"?
@thin fox and @tender fossil how will you make it a 'compiled' function? Do I just put function name and add the code in it and call it in or does it require any other additional work to be done?
depends on how the event is called
CBA_fnc_globalEvent, CBA_fnc_targetEvent, CBA_fnc_localEvent
read the docs
well ace docs dont state much, ill have to look into how its created on github
gotcha, so global event
How can I look up the voice line sound for a unit type? I want my script to get the unit for cursorObject and then say the sound file for "Sniper" or "AT Soldier", etc. The sound file for sniper is here:
a3\dubbing_radio_f\data\eng\male01eng\radioprotocoleng\normalcontact\010_vehicles\veh_infantry_sniper_s.ogg
But I want to be able to look that up dynamically based on type of unit.
Let me rephrase my question, is the setVariable unique for each object is set to? i.e. Can I have multiple setVariable to multiple targets with different values? Example: sqf _dummy1 setVariable ["DUMMY_variable", 0]; _dummy2 setVariable ["DUMMY_variable", 2]; Would _dummy1 and _dummy2 have different variables set?
Yes, absolutely. You can use the same variable name to assign to different units. Each unit will have it's own different value in the var.
Oh thats cool thanks!
Btw, if you use the compileScript (e.g. instead of CfgFunctions), remember to save the return value of the command into a variable. You probably need to store it in global variable so that you can access and run the compiled function from anywhere in code
Follow up question ๐ - How do I check the value of the "DUMMY_variable" of two dummies?
_temp = _dummy1 getVariable ["DUMMY_variable"];
```?
Basically I want to get the values of the ``DUMMY_variable`` and then increment it by 2 in the eventHandler "Hit" on multiple units. Hence the whole question
I think you need to have reference to the dummy objects (like you have the _dummy1 there), then just use setVariable on them?
Wait I think I figured it out(?)
_demon setVariable ["demon_dmg_total", 0];
_demon removeAllEventHandlers "Hit";
_demon removeAllEventHandlers "HandleDamage";
_demon addEventHandler ["HandleDamage", {
_unit = _this select 0;
_current_damage = _unit getVariable ["demon_dmg_total"];
_current_damage = _current_damage + (1/100);
if (_current_damage > 4) then
{
_unit setDamage 1
};
_unit setDamage 0;
_unit setVariable ["demon_dmg_total", _current_damage];
}];```
Yea it does thanks ๐
Can I not put them in mod_functions.hpp and use #include to call it via another sqf/script? Would it be the same?
Oh, you're making a mod. I've never made a mod myself (just mission scripts), so I guess it's better to let someone else respond ๐
You could just do this:
_deamon addEventHandler ["HandleDamage", {
params ["_unit", "", "_damage"];
private _reduction = 0.7;//will reduce dmg by 30 % the lower the number more bullets to kill.
_damage * _reduction;
}];
I tried that but for some reason, it does not work in our modded server consistently.
are you using ace ?
Yes
my bet would be becouse of that.
Yea I think so too - Hence the elaborate method.
afaik just make it a function, it's easier
weird stuff happening with ace and CBA if I add EH "UnitKilled" to a group and kills a unit in this group
such a simple question but I can't find it anywhere
what is the syntax for "self"
ie if !alive self then { stuff; };
There's no self command
Probably
sucks
Can't say without knowing what you're doing obviously
well I'm making an ambulance that has a siren playing for as long as it is alive and I want to make it a composistion so I can drop it anywhere in Zeus
if it has a variable though
means only that one ambulance I place down will work
cant have multiple
In object init fields, the magic variable this refers to the specific object in question.
Beat me to it
perfect
i tried searching for that term too but couldn't find shit lol
such a generic term
thanks bro
Other notes:
ifis a one-time check. If you're writing this as part of a repeating loop, then great. If not, you need to, or usewaitUntil.- object init fields are Unscheduled, meaning any suspension (
sleeporwaitUntil) cannot be used. You'll need tospawna new Scheduled thread. - if you
spawna new scheduled thread, you'll need to pass itthisas an argument since it is a new scope wherethisdoes not exist. - when placed in Zeus, object init fields only execute on the machine that placed the object, rather than on all machines as when placed in the Editor.
yeah the example above as just a example but the other insights are great!
So if I were to place the ambulance as zeus it will only play the sound for me and not anyone else?
Depends on the command you use, some of them are Global Effect and play on all machines.
If you're using a Local Effect command, use remoteExec to broadcast it to other machines.
Got it, thanks!
Does anyone know of a way to filter items that have collision (with player and or bullets)? Right now I can do most player collisions by checking the mass value of an object with getModelInfo. However some objects, like the vanilla ied's collide with the player still despite their mass being 0 (wiki says 10 is required for collision). Also some objects with geo and components in their list can stop bullets and some cant, possible based on armor property or maybe rvmat/thickness?
Also note that an object's init code runs locally on the server and for each player who joins.
So if you have some code with a mission on a (dedicated) server and two players, it would run three times.
If a third player joined halfway through, it would also run again.
If you only want something to run once, you could check if the object is local, since it would only be local to a single machine, or set a custom variable on the object and then set it once it runs.
I.e.
if !(local this) exitWith {};
Or
if (this getVariable ["TAG_initialized", false]) exitWith {};
this setVariable ["TAG_initialized", true, true];
*Editor-placed objects only
I'm asking this again, as my first question got buried in another discussion above.
How can I look up the voice line sound for a unit type? I want my script to get the unit for cursorObject and then say the sound file for "Sniper" or "AT Soldier", etc. The sound file for sniper is here:
a3\dubbing_radio_f\data\eng\male01eng\radioprotocoleng\normalcontact\010_vehicles\veh_infantry_sniper_s.ogg
But I want to be able to look that up dynamically based on type of unit.
nameSound I recall
bump just in case
I do believe the answer is just "no"
I had a similar concept yeeears ago, and I used a workaround by switching the local user upon somebody kick the ball
I really don't understand where to place all those texts
aww, thats what i feared, but thanks for answering
Even if you change locality, (that ussualy takes a few seconds) it will only look good for player that kicks it. Rest will just see ball lagging around
What you could do, is create ball locally for each client, then whenever player kicks the ball, it would apply same velocity on all balls across all clients.
And every 500 ms synchronize position and velocity across all
And have the ball on server as "source of truth"
hmm, how would i do this?
Create ball with createVehicleLocal, have two functions, one for setting velocity (on kick) other for synchronizing position, direction, velocity and angular velocity across cliens
Eg setVelocity sqf params["_vel"]; if (!isNil "my_fine_ball") then { my_fine_ball setVelocity _vel; }; }
my_fine_ball would be global variable pointing to each of the clients local ball
You would remoteExecCall that function to each client and server when ball is kicked in your event handler.
For synchronization youd get posASL, vectorDir, vectorUp, velocity and angular velocity from hosts ball periodically, then and remoteExec it to all clients except host every <arbitrary but not too often> seconds
Func "ball_fnc_syncer"```sqf
params["_posasl", "_up","_dir","_vel","_ang"];
If (isNil "my_fine_ball") exitWith {hint "muh balls missing"};
my_fine_ball setVectorDirAndUp [_dir, _up];
my_fine_ball setPosAsl _posasl;
my_fine_ball setAngularVelocity _ang;
And init script:
```sqf
my_fine_ball = //createVehicleLocal;
my_fine_ball setPos somewhere //it should sync anyways
If (hasInterface) then
{
//attach your event handler here, with remoteExec'ed set velocity function mentioned above
};
If (!isserver) exitWith {};
[] spawn {
while (alive my_fine_ball) do
{
[getPosASL my_fine_ball, vectorUp my_fine_ball, vectorDir my_fine_ball, angularVelocity my_fine_ball] remoteExec ["ball_fnc_syncer", -2];
sleep 1; //adjust to avoid jittering/teleportation
};
}```
Mind you there will always be some teleportation involved. Physics dont always behave same on all clients
_group addEventHandler ["UnitKilled", {
params ["_group", "_unit", "_killer", "_instigator", "_useEffects"];
}];```
from <https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#UnitKilled> vs your `params ["_unit"];` 
ill see if i can make it to a working script with my skills
but thanks for all of this!!
Also, before kicking the ball, kick all players with high ping first ๐ they will cause it to be all over the place
You could also add some interpolation to sync function to make transition smoother
Fixedsys 
there is nothing wrong with the EH, I've setup it correctly, it's a mod error
Question, I am getting undefined variable error skyhook_aircraft_1
Before Executing the script I spawn an aircraft with variable skyhook_aircraft_1
Code:
https://pastebin.com/KqDNjEih
Issue is that it executes everything up until line 76. It gives errors for lines 76 and 80, but still executes 77.
skyhook_aircaft_1 + r
@south swan that was your catch too? ^^
ja
huh?
you typo'ed variable name a whole bunch of times in lines 76 and below
Can you test it out? I'm about to submit this issue in the ace git page lol
or someone else
3DEN, one player unit, one group with grp variable name, play scenario, following code in the debug menu, shoot some guy. "ace_medical_death" gets called wtih grp as argument once ๐คทโโ๏ธ
["ace_medical_death", 0] call CBA_fnc_removeEventHandler;
grp addEventHandler ["UnitKilled", {systemChat str ["Group's UnitKilled",_this, _this apply {typeName _x}]}];
["ace_medical_death", { systemChat str ["ace_medical_death",_this, _this apply {typeName _x}]; }] call CBA_fnc_addEventHandler;```
can I upload your comment?
sure
thanks
with no ["ace_medical_death", 0] call CBA_fnc_removeEventHandler; i still get the error popup, but my "ace_medical_death" EH doesn't get called even once i don't get that single call of "ace_medical_death" with GROUP as agrument. That's some bizarre behavior
fun stuff
question, I am trying to move people from cargo of one vehicle, into another
[crew _mfap1] moveInAny skyhook_aircraft_1;
I am getting error: Type array, expected object.
is there another way of doing what I need?
moveInAny only accepts objectas parameter. crewcommand returns an array with units [ ], besides that, you are putting them inside another array.
try
{
_x moveInAny skyhook_aircraft_1;
}forEach crew _mfap1;
Okay, that worked
thx
If that was a possible syntax, you would also be passing an array of an array.
I.e. [[_unit1, _unit2]]
What is (In |#|Seconds) Error Missing )
Probably weirdly made script
!rpt
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://pastebin.com/ (Set expiry time to 1 week or less) to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
Someone has tried to write "(in seconds)" in a script, as a comment or as a string to use in the UI. But they've done it wrong and it's being interpreted as active code...only it doesn't make sense as active code and the game is getting confused when trying to run it.
I have this action on player, it works in editor, editor MP, but not on dedicated server
// initPlayerLocal.sqf
[
player,
"action",
"",
"",
"( typeOf cursorObject ) in [ 'Land_Atm_01_F', 'Land_Atm_02_F' ] && { ( player distance cursorObject ) < 5 }",
"true",
{},
{},
{ /* do stuff */ },
{},
[],
0.5,
1000,
false,
false,
true
] call BIS_fnc_holdActionAdd;
You'd need to explain what "doesn't work"
action does not show up on screen, when I point it at object ( ATM )
Check if player is null. Or use passed parameter.
Haven't used hold actions in years, does the condition run on the server?
I assume it would be local though
I tried with _this distance cursorObject < 5
If it does run on the server, cursorObject would be null
condition run on player, hence initPlayerLocal.sqf
Have you tried replacing player with this?
tried with _this, based on wiki
Try logging cursorObject's return in the condition
_this is different from this
// Sample Add Action to Enter/Exit from a location
this addAction [
"Enter Inside", {
1 cutText [
"", "BLACK OUT", 1
];
sleep 2;
player setPosASL (getPosASL shipint_exit);
player setDir 180;
sleep 0.5;
1 cutText [
"", "BLACK IN", 1
];
},
nil, 1.5, true, true, "", "true", 5, false, "", ""
];``` I usually put this inside the ``init`` section of the object/player and it works fine even in dedicated server
https://community.bistudio.com/wiki/Event_Scripts#initPlayerLocal.sqf
try replacing player with _this select 0
why add addaction on a player and not on a object ?
Because sometimes it's better to add action to player.
Condition runs once every frame(?) for an individual player, rather than it running once for each object on each frame
Also small optimization, just save the return from cursorObject and then use that
can anyone point me to some simple zeus curator addon (in workshop or github) that I can learn from and properly create one myself?
no complex like macro pleae as trying to decrypt it is a big pain all together
what are you trying to create ?
i want to create a module for zeus curator that when i place it down it will 'create' aa barrage to simulate ww2 feeling - i will then customize the lenght, duration and damage from it
"hintSilent str cursorObject; true"
but nothing showing up, tried also systemChat
Try checking isDedicated
Because if it runs local (and you're looking at an object) it should definitely show something
Just ues ZEN modules its really easy to make that with Zeus Enhanced:
Mod:https://steamcommunity.com/workshop/filedetails/?id=1779063631
DOC:https://zen-mod.github.io/ZEN/#/
Simple Example:
//InitPLayerLocal.sqf
["[ Legions Stuff ]", "- Dialog Talking", {
params [["_pos",[0,0,0]],["_object",objNull]];
if (!isNull _object) exitWith {
["You dont place this on object.", []] call zen_common_fnc_showMessage;
};
_color = [
"COLOR",
["Input Color", "What type of color would you like your big text to be:"],
[1, 1, 1, 1],
true
];
_editBox = [
"EDIT",
["Who is talking","Type in who is talking this will be big bald letters"],
[
"Enter Text Here",
{ params ["_inputText"]; _inputText; },
5
],
true
];
_editBox2 = [
"EDIT:MULTI",
["Input Text:","Type in what i am talking"],
[
"",
{ params ["_inputText"]; _inputText; },
5
],
true
];
//craete dialog
[
"Create Dialog Talking",
[_color,_editBox,_editBox2],
{
params ["_dialogValues","_args"];
_dialogValues params ["_color","_bigText","_mainText"];
_args params ["_arg1"];
private _hexColor = _color call BIS_fnc_colorRGBAtoHTML;
private _text = format ["<t align = 'center' shadow = '2' color='%1' size='2' font='PuristaMedium' >%2</t><br /><t color='#ffffff' size='1.5' font='PuristaMedium' shadow = '0.5' >%3</t>",_hexColor,_bigText,_mainText];
[2,[_text,"PLAIN DOWN", 2, true, true]] remoteExec ["cutText",[0,-2] select isDedicated];
},
{},
[]
] call zen_dialog_fnc_create;
},"a3\ui_f\data\igui\cfg\actions\talk_ca.paa"] call zen_custom_modules_fnc_register;
@real tartan I would suggest also doing a few second sleep and then running a test systemChat in your initPlayerLocal to make sure that the script is actually running. I've had issues in the past with those files not automatically running on dedicated servers
hello devs, the parameter _unit in this EH is actually returning the _killer
I'm currently trying to set up an object so that it has a hold action on it that adds a diary record to all players. I also want the object to not be deleted once this is performed.
IE, a radio antenna. Players performs the hold action of rebooting it. Upon completion of the hold action, it adds an intel entry to all players "Radio rebooted" or something along those lines. Antenna object itself is not deleted afterwards.
show your code ?
turns out, that I was referencing _unit (execVM script) variable passed from player ( initPlayerLocal.sqf), and missions was running respawn on start
TL;DR;
respawnOnStart = -1; fixed issue, correclty passing player variable into BIS_addAction
In group init:
this addEventHandler ["UnitKilled", {
params ["_group", "_unit", "_killer", "_instigator", "_useEffects"];
[str _unit] remoteExec ["systemChat"];
}];
Ok will read through this thanks!
this addEventHandler ["UnitKilled", {
params ["_group", "_unit", "_killer", "_instigator", "_useEffects"];
systemChat format ["Unit: %1 Killer: %2 Instigator: %3",_unit,_killer,_instigator];
}];
``` try this.
instigator is returning a bool? lol
I'm running ace and CBA, let me check without them
same result without any mods
Effectively, I want to adapt this https://community.bistudio.com/wiki/BIS_fnc_initIntelObject, specifically example 2, to work as a hold action, but am unsure what I should do to make it function as such.
maybe this explain these error https://github.com/acemod/ACE3/issues/10433
Try something like this add this in init of a object:
[
this,
"Collect Intel",
"", "",
"true", "true",
{},
{},
{
params ["_target", "_caller", "_actionId", "_arguments"];
[_caller,["my_intel","Intel"]] remoteExec ["createDiarySubject", [0,-2] select isDedicated, true];
[_caller,["my_intel", ["Intel", "Lisen to audio Log <execute expression='hint ""my Log""'>LOG 1</execute>"]]] remoteExec ["createDiaryRecord", [0,-2] select isDedicated, true];
private _text = format ["Player %1 has collected intel", name _caller];
[_text] remoteExec ["hint",[0,-2] select isDedicated];
},
{},
[], 10, nil, true, false
] call BIS_fnc_holdActionAdd;
Thanks, much appreciated.
seems like the _unit == _killer; _killer == _instigator; _instigator == _useEffects;
Just to make sure, which sections are those which I can replace with the desired text?
"Collect Intel"
"Intel" for both instances
"Listen to..."
yea
Thanks.
btw does it work i havent tested it
Don't know, I'll have to test it, which I'm currently doing.
Someone help me convert this unholy if to select - my brain is friend from overthinking
((headgear _this == detect_smug) or (goggles _this ==detect_smug) or (uniform _this ==detect_smug) or (vest _this ==detect_smug) or (backpack _this ==detect_smug) or (detect_smug in (assignedItems _this + items _this )))```
[_this, detect_smug] call BIS_fnc_hasItem;```
wait does it also check the equipped items?
Yes
damn i missed this completely
thanks ๐๐ป
Keep in mind the note that it's too slow for per-frame execution, which includes e.g. action conditions. If you "need" to check the whole inventory that frequently, consider taking an approach where you actually don't (for example, allowing the action to be used regardless, and only doing the check when it's actually attempted)
It wont be per frame - just a while loop when a player is in a controlled area. Doesnt get triggered after the player leaves.
while loops can be (more than) per frame :U
oh boy
By default, a while loop will run as fast as it possibly can, and will happily eat all of the per-frame time budget for scheduled scripts. If you need to run one continuously, you should include a sleep in it to limit how often it can iterate.
Yea luckily ive added a 5 second sleep so it should be fine
Quick question though - how'd I return false without using extra variables with this? something like this? sqf if ([_this, detect_smug] call BIS_fnc_hasItem) then {true} else {false};
if !([_this, detect_smug] call BIS_fnc_hasItem) then { ... };```
!, alias not, reverses whatever bool you give it
Yea but I want to pass both (true/false based on that function) to the next set of operation so was looking to a one-liner.
It would probably be cleanest to just save the result.
private _hasItem = [_this, detect_smug] call BIS_fnc_hasItem;
if _hasItem then {
// ...
};
_hasItem```
The way you mentioned before would also work, but I'd prefer to do it this way because it's neater.
Hello, i have a question for my problem, i use TFAR the latest version .335 my code is :
private _pluginCommand = format [
"TANGENT PRESSED %1%2 %3 %4 %5",
call TFAR_fnc_currentSWFrequency,
_radio call TFAR_fnc_getSwRadioCode,
([_radio, "tf_range", 0] call TFAR_fnc_getWeaponConfigProperty) * (call TFAR_fnc_getTransmittingDistanceMultiplicator),
([_radio, "tf_subtype", "digital"] call TFAR_fnc_getWeaponConfigProperty),
_radio
];
["", _pluginCommand, 0] call TFAR_fnc_processTangent;```
Its the same code in the source of TFAR but the call not working, let me explain, I've been testing fixes and other things for weeks but nothing works, when I run this command I want the radio to be a continuous activation, but nothing happens, I've changed to test the TFAR_fnc_processTangent source code with a variable, the activation doesn't start but if I press the radio it starts and stays continuous, so I don't understand why the TANGENT PRESSED doesn't work from the start. any ideas?
Thanks for helping !
Let me ping you as you are the creator of TFAR @still forum sry & thanks
how do i make this visible in zeus modules tab? i have my function fn_skyexplozion.sqf (this contain zen register module) inside the folder functions and a simple config.cpp file (i follow hemtt) and its not showing up for me
I would recommend you to download PBO Explorer:
https://github.com/jetelain/PboExplorer
And download a mod like Weather Plus:
https://steamcommunity.com/sharedfiles/filedetails/?id=2735613231&searchtext=weather%2B
And with PboExplorer you can check pbo and see what it contains with out unpacking the content of pbo and check how its made.
But you also dont have to make a mod you can for example put that code i gave you as a example and put it in InitPlayerLocal.sqf in your mission file and it will work the same.
Does velocity on local vehicle always return 0,0,0 (on dedicated server that is) local vehicle exists on server.
I'm looking at gettings items to spawn on just random objects by name, Does anyone know what function i need to utilise to get coords of random objects
essentially using it for random item spawns
Not sure what "random objects by name" means.
You have a bunch of objects with var names assigned in the editor?
Might mean by classname
Either way the command to get an object's position is the same, regardless of how you acquired the reference to the object: getPosASL or getPosATL. You'll probably also need forEach to deal with a list of objects, and perhaps select along with entities, nearObjects, or nearestTerrainObjects to generate that list if you did mean by classname.
Sorry i mean random world objects, Essentially id like to have an array of strings that are objects in the world by default (tables, shelves, etc)
If objectName in list, spawn item on said world object
nearestTerrainObject it is, then. It can be very slow to execute if you're running on a big/dense terrain
yup seems like it, thanks folks
Is it possible to override the path finding for AI? The problem is AI are following the road but the map in particular has bridges and the calulatePath is not going over the bridge It's bypassing it and when AI is placed on that, road it does nothing.
What pathfinding
https://community.bistudio.com/wiki/setDriveOnPath
Probably this
If this doesn't work, I don't think anything does
Wish we had the ability to define Navmeshes.
Hope it works I might have to set triggers at the ends of the bridge to disable that drive on path at the end. Using enough points of sampling helps the accuracy of the interpolation.
It works now I just need to get it working with groups of vehicles.
Depends on the simulation type of the vehicle. Generally speaking no
Also if it's local only, other machines won't see it so it's null to them (which does give [0,0,0] for velocity)
I'm trying to use BIS_fnc_hasItem & removeItems so i can make sure my players have explosives and it takes said explosives away from them on a helper COD style. issue is im running into an error. this is my init.
[
Helper_1,
"Plant Bomb",
"\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\destroy_ca.paa",
"\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\destroy_ca.paa",
"_this distance _target < 3",
"[_caller,"TIOW_melta_bomb_placeable_Mag"] call BIS_fnc_hasItem",
{},
{},
{_caller removeItems "TIOW_melta_bomb_placeable_Mag"},
{},
[],
15,
1,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, Helper_1];```
and this is the error
plz help
You have " inside "
"[_caller,"TIOW_melta_bomb_placeable_Mag"] call BIS_fnc_hasItem",
=>
"[_caller,""TIOW_melta_bomb_placeable_Mag""] call BIS_fnc_hasItem",
or
"[_caller,'TIOW_melta_bomb_placeable_Mag'] call BIS_fnc_hasItem",
I've come to the conclusions that i need an external database for my script, but I'm making a singleplayer mission, will EXTDB3 or equivalent solutions work for singleplayer scenarios also? I've never used it before and would appreciate some guidance on how to use it
if you want something simple you can just use missionProfileNamespace to save your stuff
Yeah, I thought about it, but I need to potentially have a lot of entries, i don't know how much storage i can use in the missionProfileNamespace
If I could write to a file that would also be great
Storage is virtually unlimited
But there is a big drawback, it won't save just changes but serialize and overwrite the entire contents each time
so how much are you saving?
Currently trying to troubleshoot someone having a PBO issue and their C:\Users\Username\AppData\Local\Arma 3\MPMissionsCache appears to be empty. He speaks a different language and I think may even have Arma in a different language. Is there any chance that this directory could be somewhere else?
Ok, thats good to know
If you don't have much data and time your saves right (during loading, UI, waiting parts of gameplay), its not a problem
Saving large amount of data during gameplay is a bad idea as it will do a micro freeze which is very annoying to the player
As they have enough micro freezes from the game itself already
It might be a lot, around 10.000 rows, potentially,
whats in each row?
Not a lot of data, just an identifier and some cordinates
hmmm well you could test how arma handles saving / loading that
private _mydata = createHashMap;
for "_i" from 1 to 10000 do {
_mydata set [_i, [1,2,3,4,5,6]];
};
missionProfileNamespace setVariable ["mydata", _mydata];
diag_codePerformance [{saveMissionProfileNamespace}];
replace 1,2,3,4,... with data closer to yours
This is persistent only within game install though
profile lifetime in my documents even
its also per player profile
Ok, that's sound perfect:)
Is it possible to read the data inside missionProfileNamespace somewhere so i can have a look whats stored in there?
Anywhere you want if you have same tag in description.ext
missionProfileNamespace getVariable "mydata" get 100
``` for example
File on the disc is never touched on these reads, entire namespace is in your memory all the time
Only on mission load and when you do saveMissionProfileNamespace
So you can read from the namespace as much and whenever you like
Ok, perfect, is it possible to edit the data from an outside application as well? Say i want to manually change it on the disk outside duoing edits using sqf?
Not easily, you'll need to deserialize the data, edit it and serialize back
Ok, thank you so much for your help @meager granite and @proven charm , I feel like I have a better intuition on how to solve this propblem now!
I will try to find some resources on how to deserialize the data
Much appriciated!
DeRap and Binarize by Mikero
https://community.bistudio.com/wiki/Mikero_Tools
Instead of messing with the files I'd just recommand editing your data through a console
Hmm, ๐ค
Can I create hashMap of hashmaps.
Like
private _myHashMap =
createHashMapFromArray [
["a", createHashMapFromArray [["aa", 11], ["ab", 12], ["ac", 13]]],
["b", createHashMapFromArray [["ba", 21], ["bb", 22], ["bc", 23]]],
["c", createHashMapFromArray [["ca", 31], ["cb", 32], ["cc", 33]]]
];
private _key = (_myHashMap get "a") get "aa";
_key = 11;
?
missionProfileNamespace getVariable "mydata" get 100 => [1,2,3,4,5,6]
missionProfileNamespace getVariable "mydata" get 100 set [0,100];
saveMissionProfileNamespace;
missionProfileNamespace getVariable "mydata" get 100 => [100,2,3,4,5,6]
Of course
I use it all the time
Ok, thank you, my main concern is extracting the data being saved out so that i may use it in another program., not necessarily sqf.
Anyone know the answer to this :)?
It should be exactly in %localappdata%\Arma 3\MPMissionsCache
I guess his problem is that his mission download fails, its a known issue in current 2.18 stable, just tell him to restart his PC
Restarting the game didn't fix it for me personally
That might very well be it- thank you was losing my mind trying to figure it out haha. Looks like the PBO was straight not writing to that location and he had write privileges so was super confused ๐
It could be corrupt download so writing access is not an issue. Restarting the PC is a voodoo solution too really, what we need is a fix in the game itself.
Awesome, thanks ๐
That could be added to wiki example.
The funny thing is just recently we also had a really bad issues from a map designer doing something really dumb so I'd just assumed a the majority of this was because people were downloading corrupted PBOs. Really horrible timing lol. I've since been instructing people to delete their PBO within that directory and that has resolved a majority of players issues but this is the first time I've heard of it not working and the guy did mention that it was happening on every other server too. Very strange.
Do you have an example of how you get data/ use that?
Same as you did, get get get
data get "a" get "b" get "c"
Awesome ๐
I used this method sometimes. Sometimes it gets confusing anyways... just don't overthink it
_x set ["lasers_assists", _x get "lasers" apply {_x getVariable "laser_hashmap" get "unit" call server_func_ehs_getAssist}];

Get, get, get, gitgud
_unit getVariable "server_ehs_damage_parent_hitparts" get _scored_hash get _scored_hash;
```This must be the worst, same variable used with `get` twice in a row
Maybe macro'ing is a workaround/headache killer
It would stop making sense the next day just the same, I think
if(_y get "has_playable_variant" && !(_y get "is_repeated") && (!_same_world || (_y get "mission" get "world" == worldName))) then {
```Hate this one too
lmao
What's the best about these condition is that if you have any undefined, entire if then block gets ignored
Its a feature you can utilise, but sometimes it gets annoying to debug
im stuck.
Just example
private _type = getModelInfo _vehicle select 0;
private _pos = [0.002, 1.325, -0.53];
private _dir = [1, 0.003, -0.002];
private _up = [0.002, 0, 1];
private _displayName = "User1";
[_type, _pos, _dir, _up, _displayName] call PSR_fnc_hashMap;
PSR_fnc_hashMap = {
params ["_type", "_pos", "_dir", "_up", "_displayName"];`
private _data = createHashMapFromArray [
[_type, createHashMapFromArray [
[_displayName, createHashMapFromArray [
["pos", _pos], ["dir", _dir], ["up", _up]
]]
]]
];
// dont know how to create HashMap (
if (isNil "PSR_userDefined") then {
PSR_userDefined = .. createHashmap?
} else {
// how to set if not exist type?
// how to set if type exist but not displayname
// how to set if _type exist, and displayname exist -> re set pos dir up
};
};
You're calling the function before defining it
if(isNil"PSR_userDefined") then {PSR_userDefined = createHashMap};
if!(_type in PSR_userDefined) then {PSR_userDefined set [_type, createHashMap]};
private _type_hashmap = PSR_userDefined get _type;
if!(_displayName in _type_hashmap) then {_type_hashmap set [_displayName, createHashMap]};
private _display_hashmap = _type_hashmap get _displayName;
_display_hashmap set ["pos", _pos];
...
Pro mode:
PSR_userDefined getOrDefaultCall [_type, {createHashMap}, true] getOrDefaultCall [_displayName, {createHashMap}, true] merge [createHashMapFromArray [
["pos", _pos]
,["dir", _dir]
,...
], true];
First define PSR_userDefined outside of the function for this
Fixed pro mode*
otherwise private it to do several sets later instead of one merge
I hate true in getOrDefaultCall and merge ๐ก
Damn, you make my weekend.
It's working.
[
["someModel_2.p3d",[
["User3",[["pos",[3,3,3]],["up",[3,3,3]],["dir",[3,3,3]]]],
["User2",[["pos",[2.3,21,-1]],["up",[1.2,2,2]],["dir",[1.2,2,-12]]]],
["User1",[["pos",[1.3,1.1,-1]],["up",[1.1,3,2]],["dir",[1.1,3,-1.1]]]]]],
["someModel_1.p3d",[
["User3",[["pos",[3.3,1.3,-5]],["up",[3.1,3,2]],["dir",[3.1,3,-1.4]]]],
["User2",[["pos",[2.3,1.3,-5]],["up",[2.1,3,2]],["dir",[2.1,3,-1.4]]]],
["User1",[["pos",[1.3,1.3,-5]],["up",[1.1,3,2]],["dir",[1.1,3,-1.4]]]]]]
]
PSR_userDefined get "someModel_2.p3d" get "User1" get "pos" // [1.3,1.1,-1]
Thanks, I don't know how long I would have struggled with this without your help
Hey, is it possible to make a single big object from multiple small objects?
So for example create a house with interior, then export it from eden as a composition and have it become a single united object?
To optimise for performance?
Not possible
You can script the tricks like hiding interior stuff at certain camera angles/distances etc but no guarantee it will give you much or any performance gain
Okay, can I ask why it wouldnt be possible?
If I create a small bunker via eden, then save that as a composition, why cant i turn that composition into a singular united object?
Instead of having multiple small objects, why wouldnt that save on performance?
Because they are objects, not an object
Because composition is just a list of individual objects
Dynamically edit P3D is not possible too
Okay, but say I want to have three chairs in a circle. I could place down three chairs, creating three objects. But I would like to create a new asset that is just three chairs combined as a singular object. How would I do that?
You'll need a new model (p3d) with all these 3 chairs (or proxies to these chairs)
Which still is not possible via a script
Yes, exactly. Is there a tool or mod that allows me to create a new model based on existing compositions?
No such tool, you'll need to learn A3 modelling to do that
Okay but technically when i export a compositon
it includes positional data aswell as the actual object names?
Yes
So in theory everything is there to create a new asset, I would just have to create a tool, transcribing the values
In theory. But still not really sure why it is a big concern to you
Well a friend of mine created a custom map with game realistic map studios. he built a bunch of custom houses on it via eden then exported that back into the programm which then made it part of the map
However due to the high level of customisation it is not very performant
So my idea was to combine some of the assets
like a big custom house into a single asset
Well, if you're after a terrain creation, it is really optimized already. Which, there really is no big point to make a new P3D to optimize. Maybe only cons too
Well I dont exactly understand how it works, but the map is essentially made with the placed down objects. However the objects act independent from each other. So for example the circle of lawnchairs each has physics and can be destroyed individually. I dont like that functionallity as I am sure it taxes the server performance. I would just like a singular simplified object that looks like a circle of lawnchairs but doesnt calculate as such
Does while-do loop and waitUntil loop have performance difference?
And do we have a Code Optimisation channel? i think im addicted to it
This channel is a great fit for code optimization stuff
I'd say waitUntil should be a bit more performant because while-do creates different scope for the condition check while waitUntil checks return of the code itself
But it could depend on how you script it, just measure it
You may know about this already but if you don't I think you'll really like this :)
Its a wrapper to diag_codePerformance command
Trying to use diag_tickTime to measure it,
[] spawn { // Suspending not allowed in Debug Console
_tempLoop = 0;
_startTime = diag_tickTime; // Start timer
waitUntil {
_tempLoop = _tempLoop + 1;
_tempLoop > 100;
};
_endTime = diag_tickTime; // End timer
hint format ["waitUntil loop execution time: %1 seconds", _endTime - _startTime];
};
It takes 1.7 seconds while while-do takes less than 0.0001
[] spawn {
_tempLoop = 0;
_startTime = diag_tickTime; // Start timer
while {_tempLoop <= 10000} do {
_tempLoop = _tempLoop + 1;
};
_endTime = diag_tickTime; // End timer
hint format ["while-do loop execution time: %1 seconds", _endTime - _startTime];
};
Hello, i have a question for my problem, i use TFAR the latest version .335 my code is :
private _pluginCommand = format [
"TANGENT PRESSED %1%2 %3 %4 %5",
call TFAR_fnc_currentSWFrequency,
_radio call TFAR_fnc_getSwRadioCode,
([_radio, "tf_range", 0] call TFAR_fnc_getWeaponConfigProperty) * (call TFAR_fnc_getTransmittingDistanceMultiplicator),
([_radio, "tf_subtype", "digital"] call TFAR_fnc_getWeaponConfigProperty),
_radio
];
["", _pluginCommand, 0] call TFAR_fnc_processTangent;```
Its the same code in the source of TFAR but the call not working, let me explain, I've been testing fixes and other things for weeks but nothing works, when I run this command I want the radio to be a continuous activation, but nothing happens, I've changed to test the TFAR_fnc_processTangent source code with a variable, the activation doesn't start but if I press the radio it starts and stays continuous, so I don't understand why the TANGENT PRESSED doesn't work from the start. any ideas?
Thanks for helping !
Use diag_codePerformance
Its a ball and it rolls around. Position is changing, velocityModelSpace is changing, but velocity is 0.
Server is sending those values. Im not checking velocity on null object.
~~Go figure its a mod causing it... ~~
BALLTest = {
if (isNil "ABCDEF" || {isNull ABCDEF}) then
{
ABCDEF = "Land_Football_01_F" createvehicleLocal ((getPosASL (allPlayers # 0)) vectorAdd [0,0,3]);
if (hasInterface) then
{
systemChat "Client creating ball";
} else {
["Server creating ball"] remoteExec ["systemChat", -2];
};
};
ABCDEF setVelocity [0,0,10];
if (hasInterface) then
{
systemChat format ["Client applied velocity %1", velocity ABCDEF];
} else {
[format ["Server applied velocity %1", velocity ABCDEF]] remoteExec ["systemChat", -2];
};
[ABCDEF] spawn {
params[["_ball", objNull]];
if (isNil "_ball" || {isNull _ball}) exitWith
{
if (hasInterface) then
{
systemChat format ["Client ball nil/Null? %1 %1", isNil "_ball", isNull _ball];
} else {
[format ["Server ball nil/Null? %1 %1", isNil "_ball", isNull _ball]] remoteExec ["systemChat", -2];
};
};
sleep 0.5;
if (hasInterface) then
{
systemChat format ["Client velocity %1", velocity _ball];
} else {
[format ["Server velocity %1", velocity _ball]] remoteExec ["systemChat", -2];
};
};
};
call BALLTest;
[] spawn {
sleep 10;
call BALLTest;
};```
@south swan https://feedback.bistudio.com/T185567
Actually i stand corrected, velocity return [0,0,0] after some time on both client and server
First output is:
Client creating ball
Client applied velocity [0,0,10]
Server creating ball
Server applied velocity [0,0,10]
Client velocity [0,0,5.1]
Server velocity [0,0,5.0833]
~~10 seconds later~~
Client applied velocity [0,0,10]
Server applied velocity [0,0,10]
Client velocity [0,0,0]
Server velocity [0,0,0]
OR am i doing something wrong here? Tested on DS ofc code ran globally in debug console, no mods
Also ball does jump as observed on client, and changes position on server. Which means velocity sure does its thing, but returns 0
Is there still some A2/A2OA scripting going on or a subdivision for this, here in Disc?
(((Yeah yeah, I know it's old)))
For "i" from 0 to 12 step 7 do { systemChat str(i) }
gives, in the latest version of A2OA, 0, 7, 14 ...
Hmm maybe it first checks if _i > 12 then adds _i+=7 right before it runs code?
Heya all,
I am trying to reactivate the marked symbol to "find yourself on the map", unluckly I dont rly know why its gone.
Is it a ACE "Feature"?
does repro in current steam A2 (no OA) with 0 to 12 step 7, doesn't repro with 0 to 12 step 8. Fun stuff ๐คฃ
Yeah, no idea what's going on, tbh. Interestingly, I iterate over an array. This even happens to empty lists. But only in certain cases a script error is raised.
Better abandon that ship!
Yeah, I mean, I can't even remember whether BIS even bothered updating only A2's Source at that time
for "_I" from 0 to 3 do { systemChat str _I }; // errors in A2 (OA is fine), as capital var is not "found"
like, it's case-sensitive where variables were not ๐
just to entertain the idea, did you try making i a local variable? like use _i instead of i in your for loop?
Could anyone verify this on their own before i make a bug report? Just to check if im doing something wrong here or its actual bug
In my scripts ofc it was declared as a local variable, yes.
Just fyi, it doesn't make any differences in this case. The index variable is one of those "magic variables" (iirc). Even though declared like a global one, the variable name exists only within the scope.
Im havingSuspending not allowed in this context error when running
diag_codePerformance [{
_tempLoop = 0;
waitUntil {
_tempLoop = _tempLoop + 1;
_tempLoop > 100;
};
}]
Wiki says diag_codePerformance runs in in unscheduled environment, and waitUntil should be used inside non-scheduled environment, and I have no idea to use [] spawn {} in it
waitUntil
Description:
Suspends execution of scheduled script until the given condition satisfied.
waitUntil suspends until next frame. If you have 60 FPS when testing - 100 frames is roughly 1.7s ๐คทโโ๏ธ
"iterate non-stop until X is true" vs "check every frame until X is true" isn't a performance difference, i'd say. It's more of semantic/meaning one ๐คทโโ๏ธ
waitUntilsuspends until next frame
I don't think so? (I may be mistaken sure)
Yeah I got it now.
All scheduled scripts can run for a maximum of 3ms in a frame.
This cause 'waitUntil' slow.
A while loop without any suspension will run multiple times per frame and consumes the 3 ms per frame scheduler execution limit.
This explains why 'while-do' is fast
This cause 'waitUntil' slow.
no, it doesn't.waitUntilis roughly equivalent towhile {_tempLoop < 100} do {_tempLoop = _tempLoop + 1; sleep 0.016;}๐คทโโ๏ธ It's not "until 3 ms limit is reached". It's literally "single check per frame". 100 checks = 100 frames = 1.7s@60FPS
What happens in waitUntil if the condition is so absurdly complex that a single iteration exceeds the 3ms limit? Frame extended, or check doesn't complete on that frame?
i read the page as "it suspends unless the condition is TRUE at the very first run, making it not error out in non-scheduled in that very specific case" ๐คทโโ๏ธ
Yes I really need to describe questions more accurately and find some real performance test for it.
if the code is executed at most once per frame - i'd say you only care for the performance of a single run so you should diag_codePerformance the insides of waitUntil 
you know what, I might be wrong and mixing it up with while yes
sounds plausible
in my (crude) testing it suspends the insides of waitUntil (as in: waitUntil's code is run scheduled) ๐คทโโ๏ธ 100k random 10 calls make a single iteration of waitUntil take 9-ish frames on my machine
Thank you guys I'll continue figuring it out tomorrow cuz now I need to have some performance test of
waitUntil {sleep 60;12PM_on_Sunday};
doWakeUp;
cya
I have returned to attempt my burning-a-place-down idea again for a mission.
- The goal: I want to set fire to an area in a multiplayer mission using the Wildfire module. I already know how to intensify the fire.
- The problem: I need to detect if a player is looking at the right spot with the right weapon (probably something like
if (currentWeapon player == "ClassNameOfFlamethrower")) before I activate the trigger, since I don't think it's possible to detect a particular kind of projectiles in an area. If it is possible, I don't know how to do that even with normal bullets.
Does anyone know how to make it so looking at a trigger area and doing something (such as firing your gun) will activate said trigger? I need to check things like how close the player is to the trigger when they shoot at it, and what weapon is in their hand when they fire.
My planned use is, when a player shoots while pointing at the desired spot with the desired weapon in their hand, each time they shoot will intensify the fire of a wildfire module. If they don't have the right gun, nothing will happen.
Later I also plan to figure out how to detect if certain types of grenades have exploded in the area (such as molotovs from SOG or ACE incendiary grenades) but that idea will come later.
Personally I would likely just do a Fired EH on the player that checks the fired weapon and whether they're inside the trigger area. Inside but looking outwards? eh, good enough, no one will notice
Do not underestimate the stupidity of my players. 
You could try using an EH on the projectile, hitPart for example, to see where it ends up. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Projectile_Event_Handlers
Not sure which projectile EHs work on flamethrower juice.
How can I make zamak MLR rockets refill after set duration?
Yeah that's the problem I've encountered so far. I don't know how to detect what projectiles are coming out of the flamethrower because I don't know what the flamethrower's projectiles actually are.
So I'm trying for a more clunky solution of check-if-player-is-looking-at-trigger-area and working from there.
Honestly this same kind of script could be helpful later in a recon mission context.
Use a Fired EH on the player. It includes a reference to the fired projectile. You can then use that to add EHs to the projectile.
Well, does a trigger even respect hitPart?
Since otherwise the projectiles might just hit the leaves and vanish.
And I'm not going to set a hit event for every individual bush I'll shoot myself and probably so will ArmA
I was thinking of adding a feature to my mission that would render a cicle around a vehicle to show the approx. possible distance it can reach before going null fuel. Thing is I am not really sure how to convert the vehicle's maximum speed and the fuel amount (lowered by the fuel coef) to meters in straight line. Any ideas how to approach and if it's even possible?
The trigger doesn't have to do anything except exist as an area
You do not have to. The EHs are on the player and the projectile, not the bushes.
https://steamcommunity.com/sharedfiles/filedetails/?id=2818705108 I don't know how helpful this is but maybe if you tear apart this script you might learn something to help. What you're asking sounds similar.
I guess I'm just not really understanding. I am still very much a novice with scripting in ArmA. What you're saying sounds like it should make sense but there's a gap between what you're explaining to me and how the solution is supposed to look in the end.
player addEventHandler ["Fired",{
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_ammo == "flameThrowerProjectileClass") then {
_projectile addEventHandler ["HitPart",{
params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius" ,"_surfaceType", "_instigator"];
if (_pos inArea my_trigger) then {
systemChat "aeiou";
};
}];
};
}];```
might need to use an intermediate `submunitionCreated` EH depending on how flamethrowers actually work
Well the first big problem is I don't know how to get this flameThrowerProjectileClass to begin with.
modules enhanced has a vehicle rearm module that you can have set on a timer
possibly need to use a different projectile EH, Exploded or Deflected maybe, it depends on which events work with flamethrowers and which give you reliable detection
find the flamethrower magazine in CfgMagazines and see what it's got inside
Gimme a second then
Ammo appears to be Flamethrower_Fuel
Let me actually pull open the config tho if that's not what you mean
Actually, I'll figure that out later. Let's just fuck around with a proof of concept for now using like, 5.56 ammo or something from vanilla.
I still think my more reliable solution is just going to be "check if a player is looking at a certain spot and has fired a certain gun from a certain distance" but whatever. This is actually closer to the original solution I wanted but Webknight made it sound like that wasn't possible.
I'll just start from the top.
When some_specific_kind_of_projectile_class goes into that area, trigger gets activated. How do I do that?
I wouldn't do it this way. what is the use case?
The goal is I want it so when a player shoots a Webknights flamethrower at a particular spot, it sets fire to the spot by using a wildfire module.
A previous "solution" that I also didn't know how to do was check if the player is just looking at the right spot, and is the right distance, and has fired the right kind of gun.
If I can figure this out I might later expand it to other types of flamethrowers like SOG flamethrowers but I'm not even to the point of making anything happen yet.
The problem right now is I have not even the faintest idea on how to determine that the player is even shooting at the correct spot, much less with the correct gun. I can't just bullshit it and check if the player has fired inside a trigger area; what if they are looking in the opposite direction that I want them to?
check if they fired and if the weapon orientation (or even just body orientation) is more or less acceptable
My experience/knowledge is very poor, so I wouldn't know how to do that either other than brute force. I am hoping there is some way to determine that the player is pointing at the spot I want them to when they shoot. I don't know how to check what direction they are looking. https://community.bistudio.com/wiki/cursorObject sounds like something important to this but I'm very not sure.
If I can figure out how to know if the player is looking at the right spot, I can then figure out how to check what gun they have, how far away they are, then check if they fire. Maybe a little delay after their shot to account for travel time.
I did this for helicopters a few years ago, but I did it based on how much fuel it had consumed over the last 60 seconds and got its approximate time left of fuel. Could probably get the distance too, but it would be hard without tha initial reading
A Fired event handler is the best way to detect when the player fires their gun. The EH also gives information about which gun they fired, and you can use the event to trigger your check of where they're looking - or where the projectile actually ends up.
"Where is the player looking" is actually a fairly complex check in Arma. What if, for example, they are looking "through" the target area? Their actual sightline passes over the ground, and between any objects, so the position their cursor is over ends up being somewhere in the distance. But because of gravity, the projectiles actually end up in the target area. It's harder than you think. This is why I am trying to tell you to use event handlers on the projectile. When a projectile event happens, the EH tells us exactly where that projectile is at that moment. We know its position, we can then easily check if it is inside the target area.
It's really not a complex chain of logic, and it's not difficult to implement.
- The Fired EH activates when the player fires.
- If the projectile is of the correct type, the Fired EH adds a new EH to the projectile.
- The projectile EH activates when the projectile hits something.
- If the position of the projectile when it hits something is inside the target area, <something happens>
Did a script for interactive intel: https://www.youtube.com/watch?v=keq_PWKWQsc (works on dedicated multiplayer). Sharing it here since git is in the comment of the video and this might help people making their own version of the script, etc.
Feel free to remove this message if not compliant with the channel description ๐
Short video showcasing my new script adding intel document on killed units. Works on dedicated server !
For installation and how to use, see documentation & implementation on Git: https://github.com/gerard-sog/arma3-macvsog-columbia-scripts
Arma 3 Vietnam unit: https://discord.gg/dyeUNXHFqS
Couldn't find a recent answer anywhere else, and my question is pretty specific, so I'm asking here.
Is there a way to use scripts to hide the hull/chassis and treads of, say, a tank, and leave the turret intact? That way the turret can be slapped onto a blank hull in the 3DEN editor to make a kitbashed vehicle?
no
some models you can hide the turret, but none can hide the hull/treads
Is this an SQF question or config question
Well, regards to that, it is not that "linear". If, let's say put the pedal to the metal, it consumes much more. Or if you increase throttle
currentFuel = 1;
onEachFrame {
systemChat str (currentFuel - fuel vehicle player);
currentFuel = fuel vehicle player;
};```sidenote, you can see how it is not linear
I really don't think it really does that complex thing
But I also am sure not much documents are there to explain anything about it
I said about influences
I guessed similar
Ah well, I think I misunderstood what you really meant by linear. But this really is the assumption/guess, I really have never seen a detailed explanation about fuel at least
I know what linear is. I thought you meant fuel consumption is never influenced by anything but just engine on/off, so it linearly consumes the fuel tank
Yeah I get your point
Still interesting, actually it might infact be modelled using a ODE very simple ODE.
And * setFuelConsumptionCoef, but it should never be a very complex and simulation
Well removing near to entire your post will never make any sense ยฏ_(ใ)_/ยฏ
lol
@meager granite Thank you for all the support yesterday! In the end I found it easier to just write my own extension for writing to a file, that way i dont have to go through the trouble of deserializing. I made it a public repo wich can be found here for those interested: https://github.com/MayAllBeForgiven/Arma3FileWriter
Question,
private _vehicle = "C_UAV_06_F" createVehicle position player;
spawn the uav at the ground level. That means if player is standing on a building, UAV will spawn well, way below. How do I make it spawn at the same altutide as the player?
getPosATL
can I just replace "position" or do I need to do playerpos = getposatl player; or smth
Yes and no need to
what's the purpose of setSide? As in, when does it matter if location has its side set to some faction? Is it to provide compatibility for some gamemode frameworks or something?
Hmm, that doesnt seem to work, still ground level
I recall Warfare has the responsible
A2's, yes
You can always setPosATL it afterwards
Try using alt syntax and position ATL.
Hi, im using triggers to spawn subtitles like this;
[
["Shadow 1", "Quite silent...", 0],
["Shadow 2", "Don't Jinx it...", 3],
["Seal 1", "Shadow 1 this is Seal 1, ive started frying the AO", 6],
["Shadow 1", "Affirmative", 10]
] spawn BIS_fnc_EXP_camp_playSubtitles;
In singleplayer, the subtitles work as intended, but on dedicated servers they dont appear.
The trigger is set to serverOnly
How can I get these subtitles to appear for all players?
Should the trigger stay serverOnly or Local?
Depends on the condition.
I'd like to show to all players, at the same time, the same subtitles
im guessing server only for this use case
since i dont want each player to trigger the subtitles everytime they enter the arae
You're talking about what should happen when the trigger is activated, I'm talking about the activation condition. Again, it depends on the condition.
I would you server trigger.
Does anyone here uses typesqf and knows what could be a cause for it not launching? It worked for me for years and recently it just stopped launching. I tried using admin priviliges, added exception to firewall, reinstalled, changed installation path, even upgraded to damn win11 xD, but it just does not launch and I literally did nothing, it just sopped working out of blue.
Like there is a process in taskmanager for split second and it dissappears
nope, try #arma3_tools eventually but that's about it
Hi, Is there any way to disable date synchronization between server and client?
I want to have a underground location that upon entrance player get a setDate to night, but it should not apply for all units because some of them might be on surface.
Any suggestions or alternative ways to solve this problem is appreciated.
by other units you mean AI? setDate has local effect so it should be called for all players to have same effect
love it, any plans for linux support?
No, players, I was thinking of that as well but then I saw this.
ah sorry
I'll have a look so see if its easy to add Linux support when I find time to look at the other issue with the spaces in file path and file data as well:)
Fair enough thats what I did.
However new issue now, after a few seconds I want to spawn a few other vehicles on drones location. If I do it in a regular way. Than they still spawn on ground level, if I do setposatl they spawn in the drone and blows it up
Well then you're going to have to either move the drone or spawn the new vehicles somewhere else
Hi can I have some help? trying to make a arti piece fire are dots in a seprate layer, here is the obj init I'm trying to work with.
[this] spawn { params ["_this"];
private _targets = (getMissionLayerEntities "Anthrakia_Targets") select 0;
{ _this doArtilleryFire [getPos _x,((getArtilleryAmmo [_this]) select 0), 1 + (random 3)]}forEach _targets;
}
I have an idea
Markers your targets or units?
markers I use for the position on map.
why are there 2 functions for the same thing Q_Q
well it still doesn't work...
[this] spawn { params ["_this"];
private _targets = (getMissionLayerEntities "Anthrakia_Targets") select 0;
{ _this doArtilleryFire [getMarkerPos _x,((getArtilleryAmmo [_this]) select 0), 2]}forEach _targets;}
Is artillery unit local to server?
cause getMissionLayerEntities can only be run on server and doArtilleryFire can only be run where artillery unit is local
Also markers are retrieved from getMissionLayerEntities "layer" by selecting 1 eg:
private _targets = (getMissionLayerEntities "Anthrakia_Targets") select 1;
0 returns objects, but you said you store markers in there
local
and local as in server?
singleplayer?
in singleplayer you are both server and client which is fine.
But you inted to run this multiplayer at some point you need to be carefulings
At some point I would want this to be co-op mission. but that's in the far future
Anyhow try this ```sqf
[this] spawn
{
params ["_this"];
getMissionLayerEntities "Anthrakia_Targets" params [["_objects", []], ["_markers", []], ["_groups", []]];
{
_this doArtilleryFire [getMarkerPos _x,((getArtilleryAmmo [_this]) select 0), 2]
waitUntil {sleep 1; unitReady _this}; //Wait until gun is done firing before giving it next target
} forEach _markers;
};
this works PERFECTLY:
[this] spawn { params ["_this"];
private _targets = (getMissionLayerEntities "Anthrakia_Targets") select 1;
{ _this doArtilleryFire [getMarkerPos _x,((getArtilleryAmmo [_this]) select 0), 2]; waitUntil {sleep 1, unitReady _this}; }forEach _targets;}
yep private _targets = (getMissionLayerEntities "Anthrakia_Targets") select 1; and getMissionLayerEntities "Anthrakia_Targets" params [["_objects", []], ["_markers", []], ["_groups", []]]; return same thing anyhow
thats your next problem to solve
one example is just adding _this setVehicleAmmo 1; after its done firing salvo to magically replenish units ammo
If you want hard, load ace, enable advanced artillery, and script an AI to reload each shell manually
wait I think it just partially reloaded...
hmm... i think what is happenign is that when the ammo runs out it overrides the doarrtiliary thing and cancles that mission.
I wounder how I can check if the ammo is empty before giving the artiliary mission to let it reload somehow
๐ค
it's in my code this part lol
you simply add arty setVehicleAmmo 1 after the waitUntil
Hi, dumb question but does lbData have a default? According to the wiki it looks like lbCurSel does but couldn't find anything about lbData.
but I want it to still dynamically load, not just have maigcally reload
like I said early, step by step, google it, I'm sure there's some code in bohemia forum
but y tho?
Is anyone going to be monitoring the ammo state of this artillery piece closely enough to notice?
Artillery working with magazines is an Arma abstraction btw. In reality an artillery crew would notice their ready ammo getting low and top it up between fire missions - they don't need to completely expend their ready ammo before getting more.
IRL an artillery piece doesnt have a magazine (bar mlrs system). They would load each shell manually followed by charge.
There is still a limited amount of ammunition on the vehicle/near the gun, which is what the Arma magazine system is an abstraction of
I'm making it to also be reusable, and as seamless as possible.
Keeping base game behaviour makes it more seamless
I don't see why "magic" reloading prevents the script from being reusable - and I really doubt anyone will ever notice the "seams". There's a good chance no one will ever even look at the artillery while it's firing, given it's likely to be several kilometres from the action.
Just make a layer with targets, and put its name in the script. Boom you have a natural feeling artillery
why complicate this
If it magically reloaded it would make the logistics aspect mute. Which is important.
then as PIG13BR said, step by step and google until you achieve what you want.
I think i did
grand
Check ammo count, if it's 0 waitUntil ammo is full.
Needs to find how to do it and if the ai will still reload on waitUntil
so, what is your general idea for this? do you want like a delay?
well, if you looked at my code that I sent to you, there I put a command that counts ammo lol
AI will reload as soon as they get ammo. But gun may have other ammo types in magazine (smoke/flare) and if they run out of HE, they will switch to smoke flare
it seems like you also ignored that, awesome
In the future maybe players will figure out that if they can disable the logistics of the track reloading... It would make their life easier.
No actually, i just didn't have time to test it yet...
really, okay
Good point... But I'm saving the all thing as is, i don't think Zamak MLR have other rocket types?
dunno check
to get ammo count you can use magazinesAmmo. The MLRS that you are using returns just one array (just one type of magazine), so it's okay. Just do like
_rounds = (((magazinesAmmo arty) select 0) select 1);
if (_rounds == 0) then {
// Do something here
};
Will _rounds dynamically update?

