#arma3_scripting
1 messages ยท Page 642 of 1
I don't think so. But if you define it as a sound source it will loop by itself:
https://community.bistudio.com/wiki/createSoundSource
it requires modding tho. so you can't use it in missions
Ah well, guess that's not happening
but I recommend say3D instead of playSound3D because you can stop it by killing the source of the sound
Didn't actually think about that. I'll change over then.
but remember that it requires a class defined in CfgSounds. It doesn't accept file paths. (this one doesn't need modding tho)
also, remember that a while loop without sleep keeps executing in the same frame multiple times (until it uses up all of its allowed execution time in the scheduler, which is 3ms). whenever you use time-variable while loops, make sure you add some delay to it (at least sleep 0.001)
you can also consider switching to waitUntil, which has a delay baked in. the difference is that the condition comes at the end:
while {condition} do {
...;
sleep 0.001;
};
//the above loop is pretty much the same as:
waitUntil {
....;
!condition;
};
but to be more precise, the above waitUntil is actually the exact equivalent of this:
while {
...;
condition;
} do {
sleep 0.001;
};
class CfgFunctions {
class spawn {
tag = "spawn";
file = "fnc\spawn";
class planes {
file = "fnc\spawn\fn_planes.sqf";
}
}
}```
i call this as spawn\_fnc\_planes, does not work, how to fix?
a function needs a tag, a category, and finally the function itself.
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Adding_a_Function
example:
class CfgFunctions {
class spawn {
tag = "spawn";
class someCategory {
file = "fnc\spawn";
class planes {};
};
};
};
so all functions have a fixed number of parents
thats not very nice
@little raptor thanks!
doesn't matter that much tho. the important thing is the folder structure of the function files, which is not limited like that
np
@little raptor I not able to make this work and I know it's because I don't know what I'm doing. All I'm essentially trying to do is create a Mortarman role. Just that person is able to shoot mortars no one else. I was going to a mix things up a bit with triggers but at this point if I could just limit mortar usage to that person I would be happy.
That's what Leopard20 said to do.
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
moveOut _unit;
}];
but I can't figure out how to say what player can use it.
well that's not it, that will never let anyone in
player setVariable ["IsMortarMan", true, true];
add this to the init of a vehicle for example
this addEventHandler ["GetIn", {
params ["", "", "_unit", ""];
if !(_unit getVariable ["IsMortarMan", false]) then {
moveOut _unit;
};
}];
that was an example
to get you started to make your own script
Sorry, scripting is not something that comes easy for me!!
With that you say to add the the init of the item what if the item isn't placed on the map. I just want it applied to all "B_T_Mortar_01_F".
do you use CBA?
Yes
@craggy lagoon
["B_T_Mortar_01_F", "GetIn", {
params ["", "", "_unit", ""];
if !(_unit getVariable ["IsMortarMan", false]) then {
moveOut _unit;
};
}] call CBA_fnc_addClassEventHandler;
Thank you so much for this, I will try to reverse engineer it and learn something.
It's late and I just realized I didn't ask where that bit of code goes. Should it be put in the init.sqf file?
I'm not 100% sure. Try initServer.sqf at first. If it doesn't work, then try~~ init.sqf~~ initPlayerLocal.sqf
initPlayerLocal.sqf would be the best
I will give it a shot. Thanks!!
@little raptor @copper raven Thank you both very much it's working, I can now go get some sleep!!!
I am trying to do a rescue function for incapacitated units in water. The AI medic is to drag the incapacitated unit to the shore, then drag him a few meter out of the water. To test it, I set up a scenario in the editor. 3 inf units, one of which is the player. The other two units stand close to one another. I point the cursor to one of the two units, then local execute this:
Swim_it = {
params [["_medic", objNull], ["_victim", objNull]];
diag_log formatText ["%1%2%3%4%5%6", time, "s _medic: ", _medic, ", _victim: ", _victim];
if (isNil "_medic" || isNil "_victim") exitWith {};
_pos = _medic modelToWorld [0, 1, 0];
_victim setPos _pos;
_victim setDir 180;
_victim switchMove "AinjPpneMrunSnonWnonDb";
// _victim attachTo [_medic, [0, 1, 1.2]];
while {player distance _medic > 10} do {
_medic playMove "AswmPercMwlkSnonWnonDb";
_azimuth = player getDir _medic;
_medic setDir _azimuth;
sleep 1;
};
while {player distance _medic > 5} do {
_medic playMoveNow "AcinPknlMwlkSnonWnonDb";
_azimuth = player getDir _medic;
_medic setDir _azimuth;
_pos = _medic modelToWorld [0, -1, 0];
sleep 1;
};
_medic switchMove "";
};
[cursorObject, (cursorObject nearEntities ["CAManBase", 10]) select 1] spawn Swim_it;
It works as intended. The unit homes in to me, switching the animations correctly, and moving correctly.
But when enabling the commented out attachTo row, the unit will still play animations correctly, but it will no longer move, once shifted from first to second animation. I tried all kinds of detach, reattach, switchmove, forcemove things, none of which worked. What am I doing wrong?
disregard last message. Turns out I should record the car rather than the driver's movement
say i create 10 cars, how would I go about assigning them unique variables using the least amount of code?
try _medic disableAI "MOVE"
don't forget to reenable it when the dragging is done
Editor?
and what kind of variables?
there is nothing to stop me from having a function call itself, right?
it only runs once
So I assume you mean you have provided some condition in it to stop it from looping, right?
yeah, it calls itself with different parameter, that cause it to execute other branch
I tried it with setWindDir even via debug console but there was no change in direction. I did a setWind [89.043, 10, true]; however once applied the chopper does not really land (wind seems to strong). unless I move him via ZEUS over the helipad. Weird
https://community.bistudio.com/wiki/tvAdd
Return Value: Number - Index of the added item relative to the branch it was added to
how can the index be negative? Does anyone know?
got it. invalid path
no, using create vehicle and for "_i"
https://community.bistudio.com/wiki/BIS_fnc_objectVar
Would this answer your question? I believe you actually ask how to mass-assign specific variables for later use in a short way?
Without seeing use case, it is hard to understand what optimal solution you seek Im afraid
yeah im just in theory mode right now. I'll probably have something when I get to it during the mission creation
@little raptor ๐ฒ it works.
So next time some unit does not move, I will disable it's movement and - BANG - problem solved
have I ever said anything that doesn't work?! ๐
hmmmm
@little raptor You might not have said it, but logic says..... oh, I'll no longer talk
Due to what inconsider a but, = will copy.
But you can circumvent that by using missionNamespace setVariable. That will do by reference and not cause a copy
store them in an array
switch (_something) do {
case _something1: _fnc1;
case _something2: _fnc2;
case _something3: _fnc3;
};
is the same as:
_fncs = [
_fnc1,
_fnc2,
_fnc3
];
_somethings = [_something1, _something2, _something3];
call (_fncs select (_somethings find _something))
if you store both arrays only once, it can be several times faster than the switch
in fact, if you expect _somethings to be all numbers, you could choose those numbers such that they would correspond to array indices. (so you can simply use: call (_fncs select _something)). this makes it even faster.
guys.. perhaps more a mission design question... AI helos landing on rooftops.. a recipe for disaster and frustration? technically, it's a case of finding a buildingpos on a roof, putting a invisi helipad there nad giving the heli a land wp?
sounds like something that should be 'pre-recorded' rather than being left to the AI to do I'd say
yeah, I dont know if I can do unitcapture because the building is dynamically chosen
might be the gjost hotel, might be the altis airport terminal, might be a barracks, might be office building in georgetown
But ye leaving it to the AI sounds like a recipe for disaster
it does rather, doesnt it lol
Yeah 
ok, well testing the AI landing will only take a few minutes to code up, lets try that first
if i come back grumpy, you'll know it didnt work
good luck
I'm now able to lock down my mortars to where just my mortarmen are able to use them but now the next issue has shown up. When the players pull the tripod and tube bags from the arsenal and then assemble them, they have full ammo. How could this be set zero ammo so they are forced to bring and load ammo?
use this and remove its magazines/ammo
Will that just delete the ammo again if the tube is rebuilt? Or would it just be done the first time it's assembled?
you attach it to the unit
so every time a unit assembles a static weapon, its ammo and magazines will be removed
Ok, thanks let me see what I can do.
Can you tell me if I'm on the right track? I was able to put the removeMagazine command in the init of the weapon and it did pull out the ammo. Just can't get it to go when I assemble the weapon.
player addEventHandler ["WeaponAssembled", {
this removeMagazine "NDS_M_6Rnd_60mm_HE";
this removeMagazine "NDS_M_6Rnd_60mm_HE";
this removeMagazine "NDS_M_6Rnd_60mm_HE_0";
this removeMagazine "NDS_M_6Rnd_60mm_HE_0";
this removeMagazine "NDS_M_6Rnd_60mm_ILLUM";
this removeMagazine "NDS_M_6Rnd_60mm_SMOKE";
this removeMagazine "NDS_M_6Rnd_60mm_SMOKE";
}];
@hollow lantern Setting the Headwind / Hoping Helos land into the headwind (without scripts):
"This is not an exact science though . . . "
This only affects a general headwind at the start of the mission (further 'Forecast' manipulations of the Wind Attribute may change the direction for later in the mission) and not for any individual helipads throughout the mission, for that, you need scripts . . .
1st thing (and this stumped me for quite awhile) : if you are using ACE, the 1st thing is to go into Eden Editor Settings > Addon Options > ACE Weather > and untick the 'Wind Simulation (map based). This 'enabled' appears to override any Environment Attributes wind settings (it is using the 'map's wind', which may be good for variable changing winds for sniper missions, ect).
Now you can go back into your Environment Attributes > Wind and setup the direction you need for your headwind (you do need some amount of wind for the helo to realize the headwind's direction. Setting Zero wind may let the helo land according to its approach vector, but it isn't guaranteed . . . test, test, test).
[ My first 'help answer' to The Community . . . ]
removeMagazines to cover all of them (just in case)
You might wanna review these pages first:
https://community.bistudio.com/wiki/Magic_Variables
https://community.bistudio.com/wiki/params
then look at the event handler again:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WeaponAssembled
Will setDamage on structures sync across the server?
I am unsure of that, because every building is local to the player's machine
Oh, this explains a lot actually
Yea... but there is a problem with people joining after
My bet is to make a list of structures modified and sync them manually
what I did is an initPlayerLocal.sqf that damaged objects by their position yes
but yeah I recently did a test with a friend, I made a building invincible but only on my side (server)
he did bomb it, and I could walk around like a ghost in a destroyed building to him ๐
๐ Here we were repairing destroyed buildings, but people who joined after would'nt see neither de wrecks nor anything, just ghosts doing ghost stuff
Funny enough, small objects are not local to the player
the server does make an effort to sync them
so you mean that the helo somehow reads the headwind on mission start and then saves it and will try to land in the same dir even if it changes afterwards? That's weird but OK I can test the things you wrote
@hollow lantern
No, the helo 'reads' the headwind at the time of landing . . . reread my prior answer, I've edited it.
For testing, I put down a windsock for 'visually' seeing the wind direction and if the sock isn't fluttering, then I don't have enough wind set in the editor . . .
ah
Does anyone has a unit init script were when dead this unit will spawn after some time on that position?
can I turn placed civilian units in editor into agents?
or should I just turn off most of their AI
Agents are more performance friendly than normal AI
But they're dumb
So they won't react to fires and stuff
So disabling the normal AI stuff is probably better
You can disable a couple of their "intelligence", such as, CHECKVISIBILITY, for better performance
@little raptor Ok, I've got it working now thanks. But it's doing exactly what I was afraid of. On the initial build of the mortar it's clearing the ammo (Good thing) this forces the player to load ammo that they've carried over. But if all rounds aren't used up and the mortar is disassembled then reassembled it clears the ammo again. I don't know if it can be done but I just want it to clear the ammo on the initial build of mortar. All other times it can keep what's been loaded into it.
_staticWeapon = NDS_M224_mortar;
this addEventHandler ["WeaponAssembled", {
params ["", "_staticWeapon"];
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_HE";
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_HE";
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_HE_0";
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_HE_0";
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_ILLUM";
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_SMOKE";
_staticWeapon removeMagazine "NDS_M_6Rnd_60mm_SMOKE";
}];
There is the code that I was able to get working.
- When you post code here, please add syntax highlighting. (see the pinned messages)
- No need to use multiple
removeMagazinecommands. The commandremoveMagazinescan remove all magazines of a certain type. - No need to copy paste a command multiple times. Learn how to use
forEach
for example this is your above code after applying the above notes:
this addEventHandler ["WeaponAssembled", {
params ["", "_staticWeapon"];
{
_staticWeapon removeMagazines _x;
} forEach ["NDS_M_6Rnd_60mm_HE", "NDS_M_6Rnd_60mm_HE_0", "NDS_M_6Rnd_60mm_ILLUM", "NDS_M_6Rnd_60mm_SMOKE"];
}];
Now to the actual question:
What you ask is a bit complicated. But I think you might be able to get it working using these:
- a
weaponAssembledEH (which you already use, but needs a bit modification) - a
disassembledEH to detect when the weapon gets disassembled (which you should add to the weapon when it's assembled)
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Disassembled
alternatively, you can useWeaponDisassembled
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WeaponDisassembled - a
takeevent handler to detect when a weapon part is taken from a container: (Which you add to all players)
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take
as for the process:
when the weapon is disassembled, you can detect the container to which the static weapon parts are added.
use a setVariable on the container to store the mags.
when a unit takes one of the parts from this container, transfer this variable to the unit.
and finally, when the weapon gets assembled by the unit, read the variable and add the mags to the static weapon.
I'm sorry about that and I've fixed it.
no worries! ๐
Thank you so much for your help with this. I'll give that a shot.
https://community.bistudio.com/wiki/moveInTurret the unit doesnt need to be local for this ?
I think the vehicle doesn't need to be ๐ค
I'm not sure
I would say no, only the unit
i mean the soldier - he needs to be local, right?
how?
which one should be local?!
I always have to think about how the command works to guess that
for example, you can't put a remote unit in a vehicle
i mean, it could also be a requirement that both are local ^^ which is kind of a happy coincidence if it happens
but you can put a unit in a remote vehicle
that was how I guessed this one at least
that would make it unusable in most situations! ๐
Question regarding this waituntil block. Its returning a nil during usage of a script and I'm curious to know if I can just return true at the end of the loop to stop the error from appearing? (true or false expected)
waitUntil {
//First, handle skipping frames on an interval
if (_interval != 0 && _skippedFrames < _interval) exitWith {_skippedFrames = _skippedFrames + 1; false}; //Check and handle if frame should be skipped
if (_interval != 0) then {_skippedFrames = 0;}; //Reset skipped frame counter on recording a frame
//Next, check if the bullet still exists
if (!alive _projectile) exitWith {true};
//Finally, handle the duration and distance checks
if (_maxDuration != -1 && ((diag_tickTime - _startTime) >= _maxDuration)) exitWith {true}; //Break loop if duration for tracking has been exceeded
if (_maxDistance != -1 && ((_initialPos distance _projectile) >= _maxDistance)) exitWith {true}; //Break loop if distance for tracking has been exceeded
//Now, checks have all been run, so let's do the actual bullet tracking stuff
_positions set [count _positions, [position _projectile, (velocity _projectile) distance [0,0,0]]];
_unit setVariable [format["hyp_var_tracer_projectile_%1", _projIndex], _positions];
};
the waitUntil code must return a bool
waitUntil {...;true} exits the loop after the first iteration
which should be fine fora function being definied in an init.sqf right?
what you're returning is the result of setVariable, which is nothing
init.sqf is scheduled I think, so yes.
but is that loop supposed to run indefinitely?
if so you must return false at the end
its part of a function defined in the init.sqf
the function being spawned during the fired event handler
that doesn't answer my question
but based on your code, you should return false at the end
yeah I think false would work better than true
to answer your question, the loop doesn't run indefinitely
or atleast I don't think it does
true will exit it 
it's not a matter of "better" or "worse"
in other words, your loop won't continure
so you must return false
what I was asking was whether you wanted it to terminate due to a condition
well better meaning working and worse meaning not working
eventually the projectile dies right? so It will return true eventually
is that the AI or unitcapture?
huh, surprisingly good
the landing position was a buildingpos that is outdoors and above 4m, placed a helipad there, told pilot to landat
I mean its a bit slow and I wouldnt want to be in the heli doing that, but could be worse
oh yeah
not all of the roof positions my routine choses were quite so successful, that vid is one run out of 4
but im going to provide a hand picked position on the roof, not far from the one you see there and give that to the pilot
you cant see it there, because that was localhost, but on client machines, the doors open as the aircraft makes its final
Huh nifty
yes, im happy with it, the actual piloting is from an existing script from the mission.. always good to reuse
Yep
getting a "missing ]" error (line10 it says), but i dont see it. Also, does this construct make sense?
private _veh = _this select 0;
private _closeIt = _this select 1;
if (NOT(_veh isEqualType objNull) OR {_veh isEqualTo objNull}) exitWith {false;};
if(!local _veh) exitWith {
if (_isServer) then {
[_veh,_closeIt] remoteExecCall ["k40_fnc_close_ramp", (owner _veh)];
} else {
[_veh,_closeIt] remoteExecCall ["k40_fnc_close_ramp", (clientOwner _veh)];
};
};
clientowner doesnt take a param
isNull _veh
params ["_veh", "_closeIt"]
Where does _isServer variable come from?
Why not just _target = if isServer then owner veh else clientOwner veh.
clientOwner _veh is not a thing even, see wiki.
Lazy eval on your or is bad. As you expect that check to basically always run
The type check you can do with params anyway
And why even remoteExec to owner?
You can just use the vehicle as target. See wiki.
thanks. I think i got stuck with the "owner id" in my head and forgot about the rest
params [["_veh", objNull, [objNull]], "_closeIt"];
if (isNull _veh) exitWith {false};
[_veh,_closeIt] remoteExecCall ["k40_fnc_close_ramp", _veh];
It can be so simple
does remote-exec-ing even if it procuce no overhead vs just doing it locally right away?
the function is calling itself there, so !local is needed (forgot to mention)
or does it not matter if the one where vehicle is local does remoteExec it on himself?
so it doesnt need to bargain with the server first to check if everything is green? ok
No
ok then i might as well just remoteExecCall directly from the userAction statement in config
is there an efficient way to check if a unit's inventory was modified?
Yep would be very nice to see!
For CfgDisabledCommands I want to try and disable certain commands for security purposes, but I'm worried that I might accidently block a command that is used by a default ingame mechanic. Is there a list somewhere of commands that are REQUIRED to be enabled on the client side in order for the game to function?
no such list I am afraid
the only command i recall having issues with blocking was hint. that had some weird side effects. possibly createAgent too. what commands are you wanting to disable?
_HPs = [_path, 0] call BIS_fnc_returnChildren;
I want to get all the names of the subclasses behind _path, but instead it returns the full path to each subclass. Is there a function that does what i want?
_classes apply { configName _x }```
apply*
ah, apply ... i was a bit confused there ๐ thanks
you saw nothing ๐
sqf'ing while tired is dangerous ๐
can I pack a script as an addon?
yea, i was trying to search how to do it, could you point me in some direction?
I'm trying to make it easier to make updates to some friends trough workshop
I think you should define your code in CfgFunctions, but for the addon-making part it would be #arma3_config I think
I... dont know anything about this part.. will ask there, just need a starting point, ty!
here's doc about CfgFunctions ๐
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Are Event Handlers "MP-safe"? Especially only locally executed ones?
I.e. adding a "Killed" EH to a vehicle on all Machines. A Client enters an empty vehicle, making it locally to them instead of the server. The Client loses connection while the vehicle gets destroyed. Does the EH fire anywhere?
it would fire on server
That would be the preferred scenario, yes
Have you tried it?
That they added those super-ineffective "MP Event Handlers" kinda made me suspicious
"The Client loses connection while the vehicle gets destroyed" can't really happen, if that client owns the vehicle, any damage dealt while it's connection is lost wouldn't be done unless it's resumed. If client fully disconnects, ownership is passed to the server, and 0 damage gets done
Mhh, I don't really know anything about Arma's Lag Compensation/DMG handling in MP
Is the Client in control of the DMG values of every local vehicle?
If so, the Server would've to wait for a "kill confirmation" before the Server could update his game status
However you wouldn't want too long of a delay for that because that's obviously very frustrating.
Remembering OFP's clunky position updates, those were easily longer than a whole second
Just to be clear, I'm talking about package loss/disconnection scenario here.
Is the Client in control of the DMG values of every local vehicle?
damage values are calculated on the machine that shot the projectile
So in principle after a timeout the Server fetches the locality over the vehicle from the Client and then updates the game state, especially executing all Event Handlers (locally on the Server)?
yes
e.g x shoots at y vehicle owned by z, z disconnects, x shoots again, y is destroyed, killed eh is fired on server (if it was added)
Ok, kinda sounds unorthodox
Yes, this makes sense, ty
I just hope this also works in case a Client loses a connection i.e. not disconnecting deliberately
If losing connection = disconnecting in "every" aspect, than everything should be fine
if a client loses connection and reconnects without being kicked off due to timeout, everything will just be delayed, damage dealt, etc, everything will still eventually fire on the same client.
Ok nice, thanks, that actually are very important infos and good news
This might be more of a #arma3_gui thing, but since it involves scripting, eh.
I'm looking to set the color of the text on the right side of a ListBox (set using lbSetTextRight).Tried lbSetColorRight, but no joy. Does such a thing as lbSetTextColorRight exist?
you can probably save the color values into parsingNameSpace(best way), then retrieve them in config for example, the values in the array are evaluated when you create the dialog iirc, so it might work. Not at pc to test if it's possible
is a local Area Trigger somehow in anyway better or worse (in terms of performance) than just doing a waitUntil { sleep 0.5 bla nearEntities bla } for the same area ?
afaik they're unscheduled, so i'd stick with them(i don't use them :D)
hmm, I thought they're scheduled as well.
at least according to one of my tests a couple of years ago
I'm not sure atm
ok test completed!
they're not scheduled
and for the noobs - that means what for performance?
Not intending to run heavy calculations per trigger/waitUntil, but there are a bunch being present constantly throughout the session
if what you're doing is a bit intensive for just one frame, you can use the waitUntil instead
Not intending to run heavy calculations per trigger
you can measure the code performance
if the total (for all triggers) is below 1-2 ms, it should be safe enough to use triggers
its not intensive - well guess thats relative... checking for presence of any enemy unit inside maybe 500m radius , with 30of these running or so. To get true performance i would have to first create a realistic scenario with vehicles, units and buildings all over the map - i'm not there yet
. checking for presence of any enemy unit inside maybe 500m radius , with 30of these running or so
depends on the number of units. but probably not that intensive (~0.002 ms per unit)
of course when 30 triggers check this, it could be a bit worse
so roughly ~0.06 ms per unit
i dont need to find all units, the check can stop after the first inside the area
if all triggers run at the same time
I'm not sure if the game does anything to minimize the number of triggers that run at the same time
though i guess i could cycle the triggers on / off periodically per area -
Or move the trigger around like the Eye of sauron ...
ok, then it probably is safe
checking every 0.5s is totally overkill anyway. every 30s per area would be completely fine for example.
that's a bit too high tho! ๐
a plane for example, could pass thru your trigger without ever triggering it
or even a heli
anything that moves faster than 1000/30 m/s (33.3 m/s)
ground units are the important bit. Air units i can put on a constant watch list (there are propably only a hand full present anyway)
everyone who is fast gets spotted by AI quickly. Its the sneaky boys that i have to check for, so they dont sneak into an empty outpost (that only gets filled when somebody is detected)
im planning to let AI do the observing, triggers / equivalent will be only safety net
Anyone has ever made ground vehicles work properky with UnitRecord?
like wheels animating and such
what's unitRecord?!
you mean unitCapture?
if so, it simply records the position, velocity and orientation of the vehicle
it's only useful for air units
I know
hence my question
Did anyone ever make it function for ground vehicles somehow?
probably yes
alright
I think to get the wheels to animate you need the anim source
they are.
but there might be a way to animate them using animateSource or animate
I've never done it so I'm not sure
I don't think you can animate an actual vehicle's (I mean not a Simple Object) engine-driven animations such like suspensions by any means possible
yeah that one is absolutely not possible! ๐
I was hoping there was a way to animate the wheels alone
ok
What, you mean I cant have animate lift on my fancy cars? ๐
engine-driven animations
I don't mean so
just make sure the unit is stopped (doStop _vehicle) before using that command. otherwise they won't follow the path
ok
I've got to say setDriveOnPath works quiet well when you just use a lot of positions in short intervals.
You can navigate through narrow alleys and such
oooo, didnt know that
it's because the leader will give them orders in that case.
but you don't need it for agents
Is there a way to open an AI vehicle inventory with a script command, as we do from Actions - Open inventory menu?
I've tried Gear command in all combinations, but all I could get is the opening my vehicle inventory:
vehicle _unit action ["Gear",vehicle _unit];
you can't do it. the command doesn't support that feature
Sad... Thank.
I can show you another way if you want
Of course
it's not optimal but doable
is there an easy command to get the passenger of a specific cargo seat index (not a turret)?
locked trice over the command page - closes thing i see is fullCrew which i then would have to dissect
See "see also" on cargoIndex page?
If it exists, it probably should be there
@austere hawk getCargoIndex
Is there nothing listed in the see also? Then there probably is no easy way
the search doesnt show me a cargoIndex page

unless you mean getCargoIndex
Yes that.
And yeah there's nothing listed
@unreal scroll
you have to use a helper unit:
params ["_unit"];
private _veh = vehicle _unit;
private _helper = (createGroup [side group _unit, true]) createUnit ["B_Soldier_VR_F", [0,0,0], [], 0, "NONE"];
_helper attachTo [_veh, [0,0,0]];
_helper allowDamage false;
_helper setCaptive true;
_helper hideObjectGlobal true;
_helper disableAI "ALL";
_helper setUnitLoadout getUnitLoadout _unit;
_helper action ["Gear", _veh];
[
"CheckInv", "onEachFrame", {
if (_this findIf {!alive _x} != -1 || {
_disp = uiNamespace getVariable ["RscDisplayInventory", displayNull];
_disp setVariable ["invParams", _this];
_disp displayAddEventHandler ["unload", {
(_this#0 getVariable ["invParams", []]) params ["_unit", "_helper"];
_unit setUnitLoadout getUnitLoadout _helper;
_group = group _helper;
deleteVehicle _helper;
deleteGroup _group;
}];
true
}) exitWith {
["CheckInv", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
}, [_unit, _helper, _veh]
] call BIS_fnc_addStackedEventHandler;
works as it is. just use [_unit] call _that_function
@still forum can you fix that command if I make a feature request? (using action ["Gear" to open the inventory of a crew member)
getting a "missing ;" in line 12 - i dont see it. Maybe something else is wrong?
Want to kick out all cargo units of specific indices
params ["_veh","_ids_cLock"];
private _crew = fullCrew [_veh, "cargo", false];
private _i=-2;
{ // get rid of passengers that occupy any index inside _ids_cLock
_veh lockCargo [_x, false];
_i = _x;
_i = _crew findIf {_i isEqualTo (_x select 2)};
if (_i > -1) then { //cargoindex occupied
_unit = (_crew select _i) _select 0;
if (NOT (isNull _unit)) then {
if ((!alive _unit) OR {lifeState _unit isEqualTo "INCAPACITATED"}) then{
[_veh,_unit,true] remoteExecCall ["k40_fnc_eject",_unit]; //eject unit on client where unit is local
} else {
[_veh,_unit,false] remoteExecCall ["k40_fnc_eject",_unit];
};
};
};
} forEach _ids_cLock;
File scripts\test.sqf..., line 12
Error in expression <> -1) then {
_unit = (_crew select _i) _select 0;
if (NOT (isNull _unit)) then >
Error position: <_select 0;
if (NOT (isNull _unit)) then >
Error Missing ;
File scripts\test.sqf..., line 12
@austere hawk _select
_unit = (_crew select _i) **_select** 0;
๐ฉ thanks
@austere hawk also, I recommend that you review this page, because you use WAY too many parentheses:
https://community.bistudio.com/wiki/Operators#Rules_of_Precedence
propably, though 11 vs 10 vs 9 vs 4 just never gets in my head so i opt to be safe than sorry
_unit addEventHandler ["Fired", {
params ["_unit"];
if (side _unit == civilian) then {
_group = createGroup east;
[_unit] joinSilent _group;
["crime"] remoteExec ["systemChat"];
};
}];
i wanna make civilians become opfor when they shoot
but the civilians become opfor don't shoot bluefor guys even they are in east side.
what is wrong with my code?
As I remember, there is an engine limitation - you can't actually change the side of spawned units.
it is better to recreate them, using the appropriate soldier.
you can just use addRating
it makes them enemy to everyone
that's how you get punished for TK and stuff
Open backpack should be a thing.
You cannot open another units inventory as if that was your own.
That's something completely different
you can
_unit action ["gear", player]
opens the unit's inventory and you can modify it (e.g. give him your backpack)
now you can make it MP safe, if that's your concern
I'm not sure how it behaves in MP
Why do you mix NOT and !
Why do you do a if/else?
Just replace the true/false in the remoteExec by your condition.
The code you posted isn't the code from your error message (I see you edited it to fix it afterwards)
But what's there to fix, if it works?
you can't open a crewman's (vehicle _unit != _unit) inventory and modify it
short answer - it evolved a bit before i got it right
and its executed maybe 2x per mission so ๐คทโโ๏ธ
So it works, just not while sitting in a vehicle?
yes
That might be a bug then
for example I can't use that command to change my gear in a vehicle
simple repro:
get in a vehicle and use:
player action ["gear", vehicle player]
made a ticket
https://feedback.bistudio.com/T155922
Is it bad coding practice to call a function without any arguments?
i.e.
call function;```
if you do that, it uses the arguments from its "parent" function
yes i know but they dont get used
it's not a bad practice
no,
but
call function
is preferred over:
_this call function;
Well for one it's slower.
And also why would you pass invalid parameters to a function?
alright thanks leopard
I would call passing parameters to a function that doesn't take any parameters to be bad practice
yes
guys, if im standing on the roof of a building at the position I want to place a helipad (for a heli to land here later)
provided im actially looking at the buiilding too
cursorObject worldToModel (getpos player)
is that right?
no
how do you plan to create it
I mean what's the point of that worldToModel?
you want to make it compatible with all objects created later?
ok, so im on the roof of the barracks building... and I want to get the best place for the helo to land to work on ALL barracks
ah yesm that will get the roadway lod?
no
it gets the exact position where you are
relative to the model
the other command however was wrong
the pos of the player is at his feet yes?
yes
remember not to use the getPos command if the height matters to you
or just don't use it at all
it's slower too
especially when not standing on the ground....
the only reason you might wanna use it is if you want to get the height to the next roadway LOD that is below a unit
im going to createvehicle an empty helipad there and have the heli land on it
dont know if you saw my vid yesterday... had some success with ai pilots doing that
use setPosASL and modelToWorldWorld
*copy pasting this to my notes
ok, just to clarify
cursorObject worldToModel ASLtoAGL getPosASL player
will give me an [x,y,z]
I then
_myhp setposASL (_mybarracksbuilding modeltoworldworld [x,y,z]);```
createVehicle ["Land_HelipadEmpty_F", [x,y,z], 0,[], "NONE"]
or just [0,0,0]
doesn't much matter either way
also missing a;
also please add syntax highlighting
yes, the semicolon ๐
also, if your code is expected to be scheduled, I recommend an isNil around it
but doesn't matter much for a helipad ๐
there... thats it?
it is sche'd
excellent, thanks mate
merry christmas to ya ๐
thanks,
you mean happy new year?! ๐
how to check if Waypoint is done ?
worldToModel doesn't take just world position?
the helo flew to 000, checking my code now
Leo
we'll gloss over what happened to the guys who got out of the port side of the helo ๐
tested on different barracks.. 6 runs, only 1 ended in fiery OPFOR goodness
which is a better success rate than if I was flying ๐
am testing setting the dir of the helipad to the same as the building... see if that influences the dir the helo comes in at when given the landat
it takes AGL position
world position is a bit ambiguous here.
you might think it's the same as getPosWorld, but it's not
world Pos == AGL pos from a model perspective! ยฏ_(ใ)_/ยฏ
Which is why there's a worldWorld variant for model commands
World pos is usually ASL...
Why does a command that says world not use world reeeeee
IIRC it's the wind direction that makes them change direction when they're lowering the helicopter
what if multiple choppers are landing at the same time?! ๐
modelToWorldVisualWorld :D
share the results if that works great Tankbuster, currently doing a scripted approach of the thing and it is well not ready for Hollywood I can tell you that
I'm currently trying to figure out, if a vehicle weapon in a vehicle is part of the parent class "CannonCore". So far I tried it with BIS_fnc_returnParent but also tried this approach:
private _aircraftWeapons = _aircraft weaponsTurret [0];
{
if ( (_x in ([configFile >> "CfgWeapons" >> "CannonCore", 4] call BIS_fnc_returnChildren)) ) then
{
hint "OK cool 66"
}
} forEach _aircraftWeapons;``` But it seems like I can't get it to work. Is there another way I could try?
rhs_weap_M230 as example would be _x
isKindOf should do the job
๐ that formatting tho
you lost XP in the stat: indent

yeah copied from my test.sqf which is a temp file where sometimes formatting is not present :( You can kill me for that later lmao

and thanks @winter rose the simple solution just cut it again lol
Anyone know of any simple melee scripts? I'm looking for something that can be used when unarmed and is just a simple punch that does low damage. I've looked at other scripts like mocap, largo, and Improved melee system. But I don't want something that is an insta kill. Not finding any very good tutorials either.
zombie stuff (A2 DayZ mod iirc) used the "throw grenade" animation
I saw a forum on that. I also found a list of animations and tried following a tutorial, long story short, it didn't work.
So this will sound pretty vague but does anyone know of any dynamic class restriction scripts? If that makes any sense. Im looking to restrict player arsenal access in an arbitrary way, rather than by what class/slot they choose.
For example I would want equipment for riflemen restricted to people with riflemen permissions, rather than people who are playing the rifleman class.
Maybe you can open different arsenals depending on the guys permission?
I dont know if there's a way to give a certain arsenal a variable name and then open that specific one remotely
Yeah that would be the idea, I have a couple ideas on how to write this myself but I am looking for scripts that may already exist just in case I can save myself the time.
I know ace3 lets you remove virtual items from its arsenal framework, although I dont know if its a local effect or not
My goal here would be to enforce player equipment restrictions in a way that is flexible, and can meet the demands of any tactical situation. Kind of like where a commander can decide how many and what sort of units they want, and then create or assign roles to players. And all live in the mission.
A2 dayz mod doesn't have punch. for melee with weapons (axe, machete, bat, ...) it plays a gesture from Fired entity event handler. the gesture is a custom animation.
I meant the zombie attack, weren't they "throwgrenade" at first?
ah the zombie attack... it's possible that very early on it used grenade throw but it definitely doesn't now. the zombies have custom attack animations as well
is there a way to lift a downed helicopter via chinook ? I don't know if it is hardcoded via config or can be mass of cargo set via script ?
mmh
setMass? ^^
^ if that fancy stuff doesnt work you could also attachTo the heli wreck to a liftable object
@winged basin so, locations locations
@winter rose i cant put pics inside those channels right?
nope, can't
damn okey
1/ grab your location with nearestLocation
2/ delete it with deleteLocation (may not be possible with terrain locations)
Does it work in Eden editor with the debug console ?
it should yes
it shows up an error "invalid number"
i found like the exact loacation of the village name (shouldnt i be able to delete it with that then) ?
2/ delete it with deleteLocation (may not be possible with terrain locations)
doesnt seem likely
https://community.bistudio.com/wiki/deleteLocation
Description:
Deletes scripted location.
also: #arma3_editor message
ah okey
you might be able to "paint" over that tho (with an icon or marker), if you want to remove it so badly
ye i mean it says "This area is currently under construction" and its pretty big tho
i had smth coming up in sidechat :Namecitycapital at 15770,18400(This area is currently under construction)-27.2623m Location Mount at 15570,18560()-259.438m Location Mount at 15280,18310()-500.212m
I guess you have only two options:
- create another map UI and hide all locations. https://community.bistudio.com/wiki/CT_MAP_MAIN
- use markers or one of draw commands to cover that text (not sure if either of these work)
you can look at these for that:
https://community.bistudio.com/wiki/drawIcon (and other links at the bottom)
https://community.bistudio.com/wiki/createMarker
why don't you just use https://community.bistudio.com/wiki/setObjectTextureGlobal
I'm using custom textures made in Photoshop for each panel, wouldn't using that just slap the texture over the whole vehicle weirdly though?
As there is different logo's/icons etc put in certain places
no, it's the same thing
ah alright then i've never tried it before i'll give it a go thanks
@proven vortex also, your question is related to #arma3_config / #arma3_model / #arma3_texture , not this channel.
ah right sorry, I did check before hand but I must have clicked on the wrong channel by mistake my bad
I am trying to slingload cargo (downed helicopter with default mass 10000) via huron (max cargo mass 12000).
canSlingLoad return false. even when I setMass of cargo to 1000. I also tried enableRopeAttach set to true, but not working either
any ideas ?
I believe it also requires a config entry, so maybe it is not possible without a config mod
I even tried to create helper (canSlingLoad return true) and attach cargo to helper, but ropes snaps. how to ignore weight of attached object? disable simulation ?
private _helper = createVehicle ["C_Quadbike_01_F", [0,0,0], [], 0, "NONE"];
_helper allowDamage false;
_helper hideObjectGlobal true;
_helper setMass [0, 0];
// _helper enableSimulationGlobal true;
_helper enableRopeAttach true;
// _helper disableCollisionWith _cargo;
_helper setPos (getPos _cargo);
_cargo attachTo [_helper, [0,0,0]];
if a config entry is needed, helpers are more likely configured not to be sling-loadable
C_Quadbike_01_F is slingloadable, helicopter slings, but when try to pull it breaks rope
without mods?
yes
don't hide it?
This looks like it could work, but perhaps the ropes snap because they intersect with the real cargo? Then again the real cargo is attached to something, it shouldn't have collision...
the ropes must snap because hideObject on a non-attached object disables its simulation afaik
ok, so I get it to work without hideObject, so I need to fiddle with simulation
@real tartan just set the texture to a 0 alpha one. You'll still have a shadow, but meh
You can also bypass the slingloading configs by creating the ropes yourself
I am creating fopes myself
how can I insert a string onto a new line in rscEditMulti?
Do note that whatever youre sling loading has to be physics enabled
this should do it i think
_ctrl ctrlSetText (ctrlText _ctrl + endl + _newString)
im about 80% sure endl is the one you need
Yeah just stumbled upon it myself, ty
saw this example: sqf _ctrl = findDisplay 46 ctrlCreate ["RscTextMulti", -1]; _ctrl ctrlSetPosition [0,0,1,1]; _ctrl ctrlCommit 0; _ctrl ctrlSetText format ["line1%1line2%1line3", endl];
@real tartan the best solution is to create your own helper object (if you're working on a mod and not a mission)
hi guys, i would like know if an altis IDMAP existe. I would like know if its possible too creat a dirt script. in theory, the game knows where the character / vehicle is on the map. therefore it is possible to load a texture when we arrive in a zone if this one is realized as being earth, water or sand thanks to an IDMAP. it is theory of course. it is still necessary that this IDMAP exists. It is possible to load a texture linked to damage, for what not lands?
does saveGame do anything in MP? hosted and dedicated? And does the "Save" option in the escape menu have any effect in hosted MP?
I don't think so
I have other Thiory
Short question: Is it possible to let a vehicle shoot without an unit inside?
No. You need a unit to operate a weapon
i mean you can just spawn an AI in it, and order it to shoot where you want it to
yeah, and the unit must be in the correct seat (e.g. you cant fire the minigun of a littlebird from the copilot seat)
Looking for a fresh perspective on a problem I've been trying to solve through different methods for some time now; on our server we would like to enforce that multi-pilot CAS vehicles require a full crew before they can be operated. The only vehicle this really applies to is the Blackfoot helicopter. The most obvious method, an eachFrame missionEventHandler with a condition that sets engineOn false does not work because the player can simply hold down the shift key to keep the engine on. Any suggestions?
Check every 30 seconds or so (every frame seems a bit excessive) if the requirements are met, if not, remove the fuel. Since this might well crash the aircraft if it is airborne, maybe reset it to its spawnpoint or to a safe-ish position on the ground below.
although I would only do that when within a certain range of the spawn area, so that it won't crash or TP back to base when someone dies or disconnects
Could also just remove all weapon systems when your requirements are not met, allowing people to fly from base to base on their own but not allowing them to engage targets on their own.
do you have command ? this seems to not work
_helper setObjectTextureGlobal [0, "#(rgb,8,8,3)color(0,0,0,1)"];
set the ALPHA to zero
but I think it's better to just remove the texture:
{_helper setObjectTexture [_forEachIndex, ""]} forEach getObjectTextures _helper
(might not work on the stable build due to a recent "bug")
yes, probably. I also tried _helper setObjectTextureGlobal [0, ""]; before I posted here
making a mission
Engine EH? or setFuel if it does not help if somebody holds they key. Also GetIn GetOut EH
I've gone the setfuel route but of course the buggers just wheel a fuel truck up to the chopper.
@worn forge I think removing the weapons when single-crewing is a good balance for our servers.
Except I really don't want them flying solo.
Hi there folks,
I know there is the ACEX fortify framework, but as far as I can read and see this only works based on WEST, EAST, INDEPENDENT and CIVILIAN.
Is there a way to only allow a specific player object f.e. eod1 to place whatever is defined within the classname parameters?
according to the addAction wiki, if I have a simple params in my script that would get the variables from sqf [Vulture21CR, Vulture21VHC, 1200, [1159.28,11927.1,0]] execVM "itsAebian\KI_airSupport.sqf"; Then I assume this code will not work correctly?
this addAction["Scramble [Base] Apache Support","itsAebian\KI_airSupport.sqf", [Vulture21CR, Vulture21VHC, 1200, [1159.28,11927.1,0]]];```
Apparently it seems that the variables will not pass correctly to the script. Hence I get errors.
What would be the best way to do this instead?
@hollow lantern it works
simply, arguments are target, caller, actionId, [arguments]
well apparently my script fails at recognizing the group as group when I call the script via addAction
when calling the script directly everything works
something must be done wrong then
โ with addAction, the first three params are target, caller, actionId then your arguments in an array
so you would need to adapt your script for addAction
hmmm would it be wise to just add this in the init.sqf:
KI_fnc_baseAirSupport = {
[Vulture21CR, Vulture21VHC, 1200, [1159.28,11927.1,0]] execVM "itsAebian\KI_airSupport.sqf";
};``` and then just call the function instead via the addAction?
declare a CfgFunctions then
ok
or directly write this execVM in the addAction? ๐ค why not
well if that would work, I always thought that that would require me to use call instead.
[options] call compile "script.sqf"
instead of just script.sqf. And from my understanding call is unscheduled which should be avoided where possible
nope, nope.
first, it would have to be sqf call compile preprocessFileLineNumbers "file.sqf"; second, call is unscheduled only if the parent scope is unscheduled (addAction scope is scheduled)
if you only want this execVM to happen, use execVM
if you have to do it more than once, it is better to declare a function otherwise the file is read and compiled every execution
that's about it ๐
ah that makes sense, thanks for this lecture.
sorry if it sounds a bit too abrupt ๐ฌ
no worries, I don't need 5000 lines of handbook lol
Hey there, we're currently trying to spawn some animals with the headless client. After joining the server, for some of us the animals are frozen or bugged into the ground. We tried using createAgent and createUnit but nothing really worked for us. Maybe its the headless client? Must it be executed on the server?
how did you create the animals? Or to be exact, where?
Normally you could do something like this:
if (isHC) then
{
// code to be executed on the HC
};```
its in the init script from our HC framework. (its a server-side mod). We disabled the AI using the BIS_fnc_animalBehaviour_disable variable on the agent and various disableAI features except "ANIM" for the moves. Then the animals are commanded with "setDestination" to a random position. But they're totally stuck. Maybe its something with JIP?
ANIM only affects animation. If the units don't move to the desired point, have you maybe disabled PATH too?
No, only FSM and we set the behaviour to CARELESS.
Hmm, then sorry maybe someone else has an Idea,
pretty sure someone had the exact same issue, don't think they found a fix for it
okay, thank you all for your help anyway. mayhaps we get a fix soon :S
I recommend asking that on the ace slack linked in #channel_invites_list
How are you changing their behavior? Agents don't have groups.
Yeah we tried both, agents and units. This was necessary for the createUnit command.
setBehaviour works on them I think
not sure if you're still after ideas on this, maybe force the player out of the driver slot instead with a message saying it needs to be fully manned? https://community.bistudio.com/wiki/moveOut could help here, maybe something like:
_heli addEventHandler ["getIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
moveOut _unit;
hintC "You must have a fully crewed aircraft before flying!";
}];```
Could also look at others like forcing the eject action on the player
Note the getIn Event: "It can be assigned to a remote vehicle but will only fire on the PC where the actual addEventHandler command was executed"
Hi Curious, I've tried that approach as well, but the problem there of course is that how do you get both players into the craft to pass that exception.
I'd have delay
so have a condition that times out after X amount of time
if the condition is not met within say 30 seconds then kick em out
So they can get in, power up, but then get kicked out if another player doesn't get in within the delay.
I think the fuel concept is probably the most consistent. It'd mean tracking the fuel state and saving it separately so that when two players are present, it "regains" its fuel from the saved state, and if crew=1, a perFrameHandler setFuel=0
_heli addEventHandler ["getIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
_fullCrew = false;
_timer = 0;
_vehicle setFuel 0;
[_vehicle] spawn {
if (((driver (vehicle player)) isEqualTo player) and ((gunner (vehicle player)) isEqualTo player)) then { _fullCrew = true } else { _fullCrew = false; };
if ((_timer == 30) or (_fullCrew)) exitWith {_timer};
_timer = _timer + 1; sleep 1;
};
waitUntil {(_timer == 30) or (_fullCrew)};
if (_timer == 30) then {
moveOut _unit;
hintC "You must have a fully crewed aircraft before flying!";
} else {
_vehicle setFuel 1;
};
}];
};
that obvs untested
but something like this might work
that way youre not adding an onEachFrame etc
and the code only starts when it is needed
fullCrew _this select 0 - select 0 is the passed _vehicle argument into the spawn, can't remember if this is passed later in the scope, someone could probably tell you if this is required though
or (fullCrew _vehicle)
https://community.bistudio.com/wiki/fullCrew
returns an Array
spanky spanky
lesson 101, click the wiki don't just search to see if it exists
There is a super dirty fix ๐
anyhow good luck back to my own stuff ๐
My next solution attempt:
fullCrewEH = addMissionEventHandler ["EachFrame", {
if ( (typeOf vehicle player) in fullCrewVehicles ) then
{ if ( playerIsZeus || {count crew vehicle player > 1} ) then
{ if ( fuel vehicle player == 0 ) then
{ [vehicle player, (vehicle player) getVariable ['fuel', 1]] remoteExecCall ["setFuel", vehicle player]; };
}
else
{ if ( isTouchingGround vehicle player && {fuel vehicle player > 0} ) then
{ (vehicle player) setVariable ['fuel', fuel vehicle player, true];
[vehicle player, 0] remoteExecCall ["setFuel", vehicle player];
};
};
};
}];
Even though it's a pfh it shouldn't have much of an impact on performance as the majority of vehicles are not in fullCrewVehicles array, so it'll just get kicked out as false
you really don't need an EachFrame EH here ^^
so:
if someone gets it, start 30s timer
if the crew is full, stop the counter
if someone gets out, restart the timer?
I don't need it, but I don't think it's disadvantageous to use it. In the 30 sec timer, the solo pilot has already spooled up and flown off, or has the fuel truck parked nearby so it's refueled. Meaning the bird will crash. With an eachFrame it's never gonna get the gas it needs to start up.
you can keep the fuel @ zero until everyone is boarded, too
does buttonSetAction not take variables? I know its in SQS format...
_ctrl_init_reset_button buttonSetAction "_ctrl_init_edit ctrlSetText _ctrl_init_edit_text_default;";
all my variables exist
Made sure ๐
but button doesn't set the control _ctrl_init_edit to the text _ctrl_init_edit_text_default
ok
- the code executes somewhere else (in another scope), so
_ctrl_init_editdoesn't exist anymore. - use
ctrlAddEventHandlerandButtonClickinstead
np
okay new problem ๐
_ctrl_init_reset_button ctrlAddEventHandler ["ButtonClick", format ["%1 ctrlSetText %2", _ctrl_init_edit, _ctrl_init_edit_text]];
Getting error saying type any expected control, because the control _ctrl_init_edit (control #1402) is being passed as a string. How to get around this?
don't use format ๐ฌ
but it wont work at all otherwise ๐ค
so you prefer not working and a script error ? wow ๐
it doesn't pick up the variable in the EH
shh ๐
use set/getVariable to set/get the values on the dialog/button itself
but thats another step I gotta do now 
alright will try
what a fun new years im having so far 
_ctrl_initPlayerLocal_reset_button setVariable ["_ctrl_initPlayerLocal_reset_button_Text_Variable", _ctrl_initPlayerLocal_edit_text];
_ctrl_initPlayerLocal_reset_button setVariable ["_ctrl_initPlayerLocal_edit_Variable", _ctrl_initPlayerLocal_edit];
_ctrl_initPlayerLocal_reset_button ctrlAddEventHandler ["ButtonClick", {
params ["_control"];
_editbox = _control getVariable '_ctrl_initPlayerServer_edit_Variable';
_text = _control getVariable '_ctrl_initPlayerServer_reset_button_Text_Variable';
_editbox ctrlSetText _text;
}];
```Like so?
yea. or you can use displayCtrl if those controls use idcs
a little less work, same outcome.
๐
so remember in the first mission in the East Wind campaign where your character walks on rails and all you can do is look around? how did they go about doing that?
Animation
Anyone knows the code to detect if any vehicle (driver probably) of specific side knows about player? knowsabout itself doesnt works for vehicles for me
i need something like " if (any vehicle side west knowsabout player > 0) then {code}
https://community.bistudio.com/wiki/knowsAbout
who: Object, Group or Side
_vehicle = "";
_unit = player;
if (driver _vehicle knowsAbout _unit > 0) then {
// yup, the driver/group knows about the player
};
problem is that a vehicle on it's own has no "knowledge", so you you could loop over all units in a side, check if they are in the crew of a vehicle (driver, commander, gunner) and check if they know about the player
or loop over all groups per side, and check if they are in a vehicle
@lucid junco โ
i see..... I just need to check for all vehicles on the map with as much universal syntax as possible lol. Struggling to figure it out ๐ New year haha
don't drink and code! :p
wish i would be drinking lol ๐
tbf... all AI units will know about players, even when at the other side of the terrain. Although range and visibility will lower the value (and some other variables).
In case you want a global script; I would either do it per vehicle:
- get AI in vehicles, and check for player within specific range
Or check per player: - for each player, check for all AI in vehicles within range
yea, i wont give up I promise. thx guys ๐ and Happy new year
If you ask the right things you'll get the right answers.
And otherwise we'll try to help you out finding it ๐
//I feel bit embarrassed now lol
};
} foreach vehicles;```
private _enemySide = opfor;
private _unit = player;
private _threshold = 2;
if (vehicles findIf {
not isNull driver _x && {
side driver _x == _enemySide &&
driver _x knowsAbout _unit > _threshold
} // no error at all
} != -1) then
{
// _unit setDamage 10e10;
};
that's for any
if any driver knows, the if is true.
you are best! Luv ya muhehe ๐
Is anybody able to explain why the "sleep" command does not always work in the function "func_killed_event". The delay before the body is deleted appears random, and much less than 300 seconds, sometimes as few as 2 or 3 seconds. Later in the game, the delay appears to disappear completely. sqf _unit addMPEventHandler ["MPKilled", {_this spawn func_killed_event;}]; function: ```sqf
func_killed_event = {
private [
"_killed",
"_killer",
"_killed_side",
"_killer_side",
"_funds"
];
_killed = _this select 0;
_killer = _this select 1;
_killed_side = _killed getVariable "MY_SIDE";
_killer_side = _killer getVariable "MY_SIDE";
if (
(!isNil "_killed_side")
&& (!isNil "_killer_side")
)then {
_killed_group = _killed getVariable "MY_GROUP";
_killer_group = _killer getVariable "MY_GROUP";
if (_killed_side != _killer_side) then {
_funds = _killer_group getVariable "FUNDS";
_funds = _funds + 1;
_killer_group setVariable ["FUNDS",_funds];
if (_killer_group == (group player)) then {
player sideChat format["funds: %1",_funds]
};
};
switch (_killed_side) do {
case WEST: { west_losses = west_losses + 1; };
case EAST: { east_losses = east_losses + 1; };
};
hint format["west losses: %1\neast losses %2",west_losses,east_losses];
};
sleep 300;
deleteVehicle _killed;
};```
I don't see how most of the code in that function could be affecting the problem, but I included it just in case.
could it somehow be because I forgot to make "_killed_group" and "_killer_group" private?
see pinned on sqf highlighting ๐
Makes it easier for others to read it
has to be that at the top
you mean the top of the message, or the top fo the code block?
_unit addMPEventHandler ["MPKilled", {_this spawn func_killed_event;}];
func_killed_event = {
private [
"_killed",
"_killer",
"_killed_side",
"_killer_side",
"_funds"
];
_killed = _this select 0;
_killer = _this select 1;
_killed_side = _killed getVariable "MY_SIDE";
_killer_side = _killer getVariable "MY_SIDE";
if (
(!isNil "_killed_side")
&& (!isNil "_killer_side")
)then {
_killed_group = _killed getVariable "MY_GROUP";
_killer_group = _killer getVariable "MY_GROUP";
if (_killed_side != _killer_side) then {
_funds = _killer_group getVariable "FUNDS";
_funds = _funds + 1;
_killer_group setVariable ["FUNDS",_funds];
if (_killer_group == (group player)) then {
player sideChat format["funds: %1",_funds]
};
};
switch (_killed_side) do {
case WEST: { west_losses = west_losses + 1; };
case EAST: { east_losses = east_losses + 1; };
};
hint format["west losses: %1\neast losses %2",west_losses,east_losses];
};
sleep 300;
deleteVehicle _killed;
};
dw
I've done it
right i'll re-read two mins
its your exec
the pinned message is self explanatory
use spawn instead of call
he already does that
I am using spawn
oh so he does missed the top one
I was under the impression that in this context, sleep should always wait at least 300 seconds.
But it is sort of random and sometimes there is no delay at all
are you still making this for A2?!
yes.
your code doesn't throw any errors does it?
no code errors
is there any context in which sleep doesn't work correctly inside of spawned code?
Well if it was arma 3, i'd say do a canSuspend check
but that isn't gonna happen now ๐
it's spawned so no need
just to double check though
its acting like it isn't
if its only 2 or 3 seconds
unless im mistaken, I have just woken up ๐
It might also be an issue where something else is cleaning up the bodies before your code waits the 5 minutes.
sleep may work incorrectly but it can only happen later, not sooner
if you spawn way too many codes, your scheduler can't keep up anymore and the delays will become more and more significant
and everything in between
I'll try to check if anything else is deleting the bodies, by removing my deletevehicle and see if the bodies still disappear
though it'll be about 5 minutes before I'll be sure
But since bodies don't delete in my other missions
I don't think there's interference from anywhere else
I'd suggest adding an output after your sleep to make sure it's this code block executing when the bodies are deleted.
good thinking
does A2OA ever delete bodies automatically?? Without having set up any garbage collectors or anything?
or any other modules
you can reduce the time for your test
Shit, the body still deleted... something else is deleting my bodies.
oh no ๐
I have a hunch it might have been the HAC ai commander mod
even though it shouldn't have been active
been years since I even went on arma2OA, if its default arma 2OA then I think u have to setup the cleanup, or add ur own
might be that then ๐
Thanks for reminding me to check other mods/scripts for the problem
hopefully that was it
hmm... bodies still being deleted. Does enabling respawn in MP cause bodies to be deleted?
in a3 player bodies delete on respawn with certain respawn types i believe. could that possibly apply here?
I'm thinking it is related to that. But why are non-player ai's being deleted as well?
maybe the game has an auto cleanup system of its own. If you spawn a lot of AI I suppose it would make sense. ๐ค
I mean the game probably doesn't want 1000 dead bodies lying around
I'm not sure tho. Maybe try a clean mission see if it is the case
if AI is disabled on the server and a player disconnects while not dead, the server automatically deletes the player unit
nobody is disconnecting
sometimes if the player disconnects very quickly after dying, the server also deletes the body
alright
i think there might have been some cleanup also based on the value of the items on the body
what do you mean
is it possible that just attaching a MPkilled event handler somehow could cause bodies to delete automatically?
I just tested another mission which uses the same kind of respawn, but does NOT use MPkilled event handlers. Bodies are NOT being automatically deleted in that mission.
try giving the bodies the weapon M24 and see if they still disappear
By the way, I noticed that in the problem mission, bodies are being "hidden", rather than just deleted
yeah
But not in the other mission
I can only think that MPkilled has undocumented functionality to delete bodies. But if that's the case, am I really the first one to notice?
no i don't think that has anything to do with it at all
are you saying that's the only difference between the two missions?
I'm switching to using the regular killed event to see if it resolves the problem
but in the meantime, do certain islands possibly auto delete bodies???
well the engine has this cleanup queue where it puts dead bodies on respawn
and also spawning in ai randomly
in the other mission, my body is not deleted after i respawn
in this mission, player and non-player ai bodies are all being deleted
switching to "killed" event did not solve the problem
what sort of gear do these bodies have on them?
all kinds
there is a value calculation done based on the gear, with less valuable bodies being deleted earlier
from basic m16s to m107 m240, etc, etc
the values are a bit unintuitive
why are they being deleted in this mission and not the other one?
M24, bizon, MP5SD, SVD, LeeEnfield have the highest value
you should also try counting the number of bodies that are present at any one time
the max size of the cleanup queue is controlled by a config value
i've seen bodies delete when there are <10 bodies in the world
what current value?
config maxAddedBodies
where is that located?
some ca addon
couldn't say exactly... but i can tell you that you can't change it with just a mission
if you have one mission not deleting any bodies though, it seems like there might be a way to sidestep it
in the mission which doesn't delete any, can you count how many player bodies you're actually seeing at one time?
I've made a lot of mp missions, and as far as I'm aware, this is the only one that has unintended deletion of bodies
Does the game treat ai bodies that are spawned in differently than ones that were placed in the mission editor?
check the settings for the Garbage Collector (either in 3den or description.ext): https://community.bistudio.com/wiki/Description.ext#Corpse_.26_wreck_management
what is 3den?
a3 editor
he's in A2
hah of course there's some scripted garbage collector too...
i don't think it's the garbage collector. 1) I've not put any modules of any kind in this mission. 2) bodies are being deleted from right under my nose, and the wiki says it doesn't if player is within 500 meters.
Unless just turning on respawn in mp creates some super aggressive garbage collector
well the engine does have some dead body garbage collection related to respawn
no idea how Arma 2 handled it... it's been 7 years since I touched it...
Untelo, are you sure? I"m finding absolutely no reference to that online.
Plus units that don't respawn are also being deleted
well you can always go from one working mission to the broken one in incremental steps until it starts breaking and that might allow you to find the thing breaking it
I'm going to try turning off respawn, and see if that stops bodies from being deleted
yes i am sure. it's possible there is some other logic unrelated to respawn as well though
I just remember that A2 was terrible with garbage collection (as in; non-existing) and I always used custom scripts for it to prevent the server from crashing
yeah exactly, so I'm really surprised bodies are being removed unintentionally
sounds like a script/mod which is doing it for you, just in a bad way
it might be that you've just somehow triggered a usually dormant engine gc behaviour
It's not a script, i've searched every script in this mission, and the only reference to deletevehicle or hidebody is one command which is commented out
I don't think it's a mod, because all the mods currently active are ones I always use
and besides i'm not having the problem in the other mission
go step by step from working mission A to broken mission B
once it breaks you'll know which change broke it
I wonder if the problem is that this mission has respawns AND playable ai
could be. try and find out
whereas the other mission did not have playable ai
however, does it make sense that even non-playable ai would also be deleted in this other mission?
anything is possible with this can of spaghetti of an engine
Looks like turning off respawns did stop the bodies being deleted. Now I need to figure out how to turn respawns on and turn garbage collector off
are the bodies changing ownership?
is anyone disconnecting? are you using setOwner ?
no one is disconnectiong. not using setowner
turning off respawns stopped the bodies from being removed
So there must be some undocumented garbage collector that is activated when there are respawns + playable ai
now i've got to figure out how to turn it off
you're not using some headless client or something are you?
what is a headless client
no, but they have virtually every other type of weapon.
yeah well there is a big difference
what, is that the one gun that will stop a body being deleted?
it's one of the 5 guns
you can give them bizon or MP5SD too if you like
the 5 i listed earlier have a value of 1000 which prevents their cleanup entirely
M107 for example by comparison has a value of 4
don't ask me why, but that's how it is
you can check with getNumber (configFile >> "CfgWeapons" >> "M107" >> "value")
i'll try the mp5sd since it's already part of my mission
It appears the mp5sd guy is not being deleted
okay, seems like it's the value based GC then
do you know any way to turn it off?
not using respawn
I'll have to look up how to do mp respawns via script
can someone point me solution how to "map attached objects to source object" and then re-attach them after new source object is created ?
{
// save attached object offset code here
detach _x;
deleteVehicle _x;
}
forEach attachedObjects _source;
deleteVehicle _source;
// create new source and create new attached objects
why the hell does BIS_fnc_markerToTrigger do the opposite it says on the tin? 
the function file seems to do what it says. it moves the marker so that it covers the trigger.
what was the problem?
I didn't understand the question.
goal: if source object have attached objects, after I delete source object and create exact same one, I want to have all attached objects on it again
Maybe something like this:
private _attachedObjs = [];
{
_attachedObjs pushBack (typeOf _x);
detach _x;
deleteVehicle _x;
} forEach (attachedObjects _source);
deleteVehicle _source;
private _newSource = ...;
{
private _a = _x createVehicle [0, 0, 0];
_a attachTo _newSource;
} forEach _attachedObjs;
in the exact position they were? or in relative position?
relative to source object (e.g. with correct offset)
@willow hound you're doing the opposite thing
right @real tartan ?
you want to delete the object to which other objects are attached
not the attached objects?
that is right, I want to replace source and re-attach attached objects
I just modified the code M1keSK had posted ๐คทโโ๏ธ
it's simple:
private _attachedObjs = [];
{
_attachedObjs pushBack [_x, _source worldToModel ASLtoAGL getPosASL _x];
} forEach attachedObjects _source;
deleteVehicle _source;
{
_x#0 attachTo [_newSource, _x#1];
} forEach _attachedObjs;
doesn't he want to reattach the same objects?(without creating new ones)
if you attach the objects yourself you can save the position and the selection
sorry,
I just modified the code M1keSK had posted ๐คทโโ๏ธ
and I copied what ansin11 wrote!
no, recreating them is ok
you said you didn't want them recreated
this part of code says it
detach _x;
deleteVehicle _x;
otherwise what ansin11 wrote was almost ok
also, does the relative position matter?
and do you attach the objects yourself?
yes, they matter, should be same as on source object
what do you mean? as player or by code ?
indeed
code
yes
then save the positions yourself
_x setVariable ["AttachedPos", [_pos, _selection]];
_x attachTo [_source, _pos, _selection];
and use ansin11's code:
private _attachedObjs = [];
{
(_x getVariable ["AttachedPos", []]) params [["_pos", [0,0,0]], ["_selection", ""]];
_attachedObjs pushBack [typeOf _x, _pos, _selection];
detach _x;
deleteVehicle _x;
} forEach attachedObjects _source;
deleteVehicle _source;
private _newSource = ...;
{
_x params ["_type", "_pos", "_selection"];
_x = _type createVehicle [0,0,0];
_x attachTo [_newSource, _pos, _selection];
_x setVariable ["AttachedPos", [_pos, _selection]];
} forEach _attachedObjs;
you might also want to consider making it MP safe
Hey guys, I'm just doing some testing with a small function I'm working on. I have a LaserDesignator equipped and its lasing the target. The function spawns a cruise missile over head, but instead of tracking to the target, it goes to a random point.
_tgt = laserTarget player;
_missile setMissileTarget _tgt;```
Any idea what's causing it to not track my laser?
you need to make sure all the conditions are satisfied before you run that command, e.g making sure target is within missile's cone, etc.
Okay, so I'm lasing it too close then I guess
Or rather I'm spawning the missile too close and its going dumb.
I'm having an issue with... some math? I have an equation made to calculate a velocity, and it works fine when I solve it or calc it from any website, google gives me the answer I'm looking for when I put it in, but Arma is going WAY off target.
Does Arma run calculations differently than normal?
Code?
_firevelocity = [(random [-10, 0, 10]), 500 , ((0.0017141388998353 * (_3DDistance * _3DDistance)) + (5.7972119770232 * (_3DDistance)) + 20399.157846253)
To quote Dedmen:
bla bla when using scalar key bla bla link to wikipedia floating point precision
That might have something to do with it at least.
Floating point precision that is.
looking for filter drivable vehicles from vehicles variable because it also return static objects
what do you mean floating point precision, exactly?
https://community.bistudio.com/wiki/isKindOf
Might help
was thinking more generic filter than "Air", "Sea", "Land", like if you can drive it. or count driver seats
All numbers in A3 are floating point numbers, and because of technological limitations (and the binary system), floating point numbers suffer from gaps and imprecisions.
Can you post an example calculation with correct result vs A3 result?
That I can do
"Tank", "Car", ...?
if i _obj setVariable ["A",1]; deleteVehicle _obj; , then variable A will be deleted and removed from memory automatically, correct?
Hopefully.
Might be possible to test it using an array because those are a reference type, but not sure.
It would be a bit of an oversight if the object varspace didn't die with the object, so I think chances are high that BI took good care of that.
YEP. I found the issue. Was calculating the distance from the distance instead of the speed from the distance. My X and Y were backwards. Oops!
thanks for making me see thato ne
Good, good.
yes, otherwise it would be a source of memory leak
the only reason it might not be deleted is if, as ansin11 said, it contains a reference to another variable (which in your case it doesn't)
good, just wanted to be absolutely sure
_curator addCuratorEditableObjects [allMines, false]; does not work, alternatives ?
how do you guys like to do "version control" for multiple people collabing on a mission with the editor?
GitHub?
Git with editor doesn't really work when people work in parallel
You can only have one person work on the git repo at a time.
In SVN you would "lock" the file to prevent issues.
In git world, you just have to talk to others and make sure they aren't editing while you are editing
It's possible to make a mergable mission.sqm format though with programming stuffz, but I haven't seen anyone do that yet.
Besides me and some others talking about it in discord a year ago
Unless mines behave differently in this context too, this looks like it should work.
Did you execute it on the server?
To throw in an idea, ZEUS + ZEN might actually be usable as a multiplayer editor now ๐
It lets you do all the fancy stuff like create area markers, attach scripts, execute inits,... , and even export the mission to a mission.sqm file
Atleast I think it was Zen
But no 3den attributes
if server does
player setVariable ["myMap", createHashMapFromArray [["a",1], ["b",2], ["c",3]],false];
how would i later make this variable available to a HC that may join at some point?
do i retrieve the hasmpa ref via getvariable and then setvariable again?
[player, ["myMap", player getVariable "myMap"]] remoteExec ["setVariable", HC]
Yes
But keep in mind that it will transfer the whole Hashmap everytime you do that
Btw would be happy if someone can test that out.
I only tested publicVariable to server
transfer as in deep copy and not as reference?
Yes
so if i _myMap set ["z", 4]; on server at some point after that, it wont affect HC
yes, from server
i remember people mentioning sleeping long time is bad for scheduler. Would this do any good? Or would it just add even more bad stuff?
sleep 120;
//vs.
_t = 120;
waitUntil {
sleep 1;
_t = _t-1;
if (_t<= 0) exitWith {true};
false;
};
im asking how to perform long sleep period for loops in scheduled. Cant use unscheduled for endless loops, can you?
yes you can
*with sleep
not ideal / often ugly
if you want to sleep 120s, use sleep 120
call it recursively or use a PFH
Some people don't know what they're talking about. Use the long sleep.
Agree
sleep 120 is all you need. you won't hurt the scheduler this way.
then where does this come from (the "long sleep bad") ? Any validity, or just BS?
seems bs, IDK where you heard it ๐คทโโ๏ธ
It is bad to spawn a code taking longtime because it could never end
if the code needs sleeping, it simply needs to sleep? I don't see what's "bad" in it
i think the argument went that if you have lots of loops and all sleep for long time, then the ones you want to have loop on short cycle somehow everything slowed down. Idk.
a lot of scripts is mostly the issue
yep
the scheduler is "serialized". one code at a time, and each on can only run for 3 ms.
the scheduler can wait, it doesn't hurt it
you can have one script waiting 1000s
but on the other hand, try having 1000 scripts waiting 1sโฆ most of them will wait for more than that
the scheduler can wait, it doesn't hurt it
basically when you "sleep" in a scheduler, the script passes its "turn" over to the next script.
If you don't use sleep and use that other method, the script would still execute and consume some of that 3 ms
yeah, i didnt feel like this was actually in any way efficient - but i was going by what i heard. Glad i dont have to do that (would seem like major optimisation problem if its somehow worked better that way)
indeed ๐
"if you have lots of sleep ing loops, use a HC, call him "waiter" and..."
HCs should be Workers, not Waiters :p
offload all the sleeping to a HC, and run that HC on a phone or smartTV or something
sleeping is not a load really
having multiple scripts is
๐
Tip of the day:
This is something a lot of beginners do:
[] spawn {
_handle = [] spawn SomeFunction;
waitUntil {scriptDone _handle};
...//other stuff
};

I hope you haven't done it yet!
but in case someone does that, here's how you do it properly:
[] spawn {
[] call SomeFunction;
...//other stuff
};
because:
Where code starts scheduled
code executed with call from a scheduled environment
https://community.bistudio.com/wiki/Scheduler
long story short, don't ever mistakenly assume thatcallis unscheduled.
nope
awesome! ๐
waitUntil { sleep 1; scriptDone _handle } of course ๐
you mean, if i create a hasmap on an object, and that object transfers to another client, its not tested if that works correctly?
actually this is my question too. if an object changes locality, do its (local) vars transfer too?
no
that would be cool!
unsure about the "cool" no ๐ฌ
yea could be bad also ^^
then all clients would know that the server calls them names via object variables
It's not.
If you're a noob not really knowing what you're doing. No, terrible idea.
My bad, I consider too much people brilliant
No that's not how the scheduler works. Everyone gets fair share of time
a terrible mistake if you ask me ๐
Don't think I've seen that here more than once or twice in the last couple years.
Where do you encounter that issue? Forums or just random people's code?
random codes
No. I didn't test if transferring it in a remoteExec/setVariable works correctly.
But it should be the same as publicVariable
I noticed it in a couple of popular SW mods too
No, shouldn't.
The owner of the object can be long gone (disconnect, crash) before the server grabs ownership as fallback.
The old owner can't be able to transfer variables of that object, after he's already gone
Would I be able to in-game reset my Zeus? I died and when I try to access Zeus I just get the pings
I don't want to have to restart the mission just to get it back, is there something I could write into the console?
unassign the curator from your dead body and assign it to your new one
I can't access zeus to even assign it.
assign it with code 
Ahh, yeah that would make sense, well I don't know if my "body" still exists to unassign it though as the server does a cleanup
Would th emodule still be there though if the body isn't?
that's what event handlers are for
Because right now the Zeus Module is connected to my SteamID not a body.
@open star see:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPRespawn
to reassing the curator, you have to do something like:
_curator = getAssignedCuratorLogic _corpse;
unassignCurator _curator;
_curator setVariable ["Owner", getPlayerUID _unit, true];
_unit assignCurator _curator;
I'm not that familiar with zeus but I think this will take care of it
just add it to that event handler
apparently both of those commands have to be executed on the server
Aye I can do that, woudl it change if it weren't connected to a body though, like I said it was attached via SteamID
The vanilla thingy is just bugged-ish
@open star that's what getPlayerUID was for:
https://community.bistudio.com/wiki/getPlayerUID
Yeah I usually use the ACE Respawn and it usually keeps the module intact with my ID
You don't need to change the Owner of you assign anyway
And the owner won't have changed anyway
right
I just copied it from one of my codes
it reassigns the curator to a new unit
I'm struggling with fullCrew atm. I want to pull all of the unit variables out of the array of arrays.
params ["_vehicle"];
private _cargo = fullCrew [_vehicle, "cargo", false]; // [[a,b,c],[a,b,c],[a,b,c]] want all a's
private _crew = [];
{
_index = _x select 0;
{
_crew pushBackUnique _x;
} forEach _index;
} forEach _cargo;
should I attempt something different?
Well I'm not pinging Zeus but I can't get Zeus open ahh xd
did you try that on the server?
Yeah, did a Remote Execution.
Don't forEach _index.
_index is already what you want
fullCrew [_vehicle, "cargo", false] apply {_x#0}
Oh, Server Exec from the Console
no I mean what did you execute?
Oh I remove some of your code to get it off the player because the body doesn't exist anymore just unassigned it and reassigned it.
can't you just paste it here?!
Oh yeah that might be a good idea sorry I just woke up mate.
woh... gotta look up operators cause I didn't think of that
unassignCurator player;
_curator setVariable ["Owner", getPlayerUID _unit, true];
_unit assignCurator player;```
I don't know what the code markdown for discord is
```sqf
Yep just clicked pins.
_unit and _curator are not defined
quickest fingers in the west lou coming in
Lou is always watching me.
_unit assignCurator player;
what?!
player is not zeus
player is an infantry object
zeus is a module
Yes and like I said the body or corpse doesn't exist anymore.
Let alone the Module is done with the Owner being my SteamID
It's never connected to anything.
No, it's a module in the world
I might still have the MPMission I hope I can show you, I guess I'm confused at the moment.
@open star try a nearestObjects to find it:
https://community.bistudio.com/wiki/nearestObjects
look for ModuleCurator_F
Oh I know exactly where it's at in the world but there are a total of 5
So I just have to find the one with my owner ID?
yes
I'm going to start keeping variables on my modules.
just don't die :p

