#arma3_scripting

1 messages · Page 18 of 1

pulsar bluff
#

I use a lot of format on sender machine ... thinking of how to pass a key in format

still forum
#

you can send them the format, and the keys

pulsar bluff
#

ah ok, like an extra array

still forum
#

You send ["%1 %2 %3", "$STR_TAG_myText", "test test", "$STR_blaBla"]

then
format (_input apply {_x select [0,1] == "$" then {localize _x} else {_x}})

pulsar bluff
#

interesting

#

damn translation is a bigger task than i thought 😄

#

i mean adding multi language support to comms methods

winter rose
#

just sayin'

pulsar bluff
#

would a default setter for localize be useful?

#

hint localize ['$STR_TAG_myText','my default text'];

winter rose
#

meh?
I see the idea, but "if you use localize, then you at least fill one language" no?
it would also make it harder to spot non-translated strings

#
localize ["STR_myString", "default string"];
```if the result is `MISSING TRANSLATION: default string` why not 😄
meager granite
#

@still forum Does OBJECT getDir OBJECT use render time positions or simulation time positions for angle calculation?

#

I also wonder about same question but for OBJECT distance2d OBJECT

still forum
#

getDirVisual is there if you want render/visual

#

distance2D simulation

meager granite
#

I don't think there is alternative syntax with getDirVisual?

#

Yeah, there is no

#

Alternative syntax to return angle between two objects

still forum
#

Ah looking at the wrong thing
simulation too then

meager granite
#

Thanks

still forum
#

👀 ACE team would probably be interested in that

meager granite
#

How its done: switchMove and attachTo to createVehicleLocal object each frame on the dead body

#

Since helper object is local, attachTo doesn't send any network messages, thus no network spam

granite sky
#

Yeah, insert is a bit quicker than arrayIntersect but it's still clearly O(N^2). 1000 entries is 100x slower than 100 entries. 10k with hashmaps is faster than 1k with either array method.

south swan
#

insert is O(N) if we assume that setting an element of hashmap is O(1). And it well should be, because inserting would be "get a hash of new key, try to insert - get a collision - check if the collision has the same key - update the value", which doesn't go over the whole list at any point 🤷‍♂️

#

or was the 100x slower figure achieved via actual testing and i'm talking from my bottoms?

granite sky
#

actual testing. This is with a pair of equal-size arrays, hence O(N^2) vs O(N) rather than O(N) vs O(1). Note that hashmaps seem to be slightly worse than O(1) insertion in practice.

#

Converting to a hashmap just to insert one element may be a bit too much overhead :P

#

oh yeah, what would be really good is a hashmap method to bulk-delete keys, so you can use them to replace arrayA - arrayB as well.

south swan
#

and i somehow get close to linear results from keys (array createHashMap []) 🤔
0.05 ms for 100 unique elements (numbers from 1 to 100);
0.1 ms for 200 non-unique (double the previous array) - double;
0.68 for 1000 unique (numbers from 1 to 1000) - 14x which is closer to 10 than 100;
1.13 for 2000 non-unique (double the previous array) - 23x which is closer to double the 1000;

#

but that's for deduping one array

granite sky
#

There may be edge cases depending on how it's arranging the hashmap.

#

It probably doesn't use a fixed table size.

south swan
#

well if i go collisions-only with 100 and 1000 length arrays of ones ([1,1,1,...,1]) i get 0.016 ms for a hundred and 0.145 for a thousand. Close to linear again 🤷‍♂️
And for arrayIntersect on those same "unit arrays" i get 0.01 ms for a hundred and 0.58 for a thousand. Which looks closer to quadratic

#

well, not "collisions-only", but "same key only", as collisions should probably be used for hash collisions and i'm for sure not smart enough to get those :3

granite sky
#

oh, I was using mostly-unique arrays.

#

Like floor random (10 * arraysize)

#

arrayIntersect is gonna do pretty well on arrays of ones :P

south swan
#

well, i've tested that and it's ahead by roughly half its runtime on a 100-length and slower by roughly 300% of hashmap runtime on a 1000-length "unit arrays". Which pretty much lines up with a typical usecase proposed above

upper siren
#

can I remove/override an "addAction" thats baked into a mod for a specific vehicle?

steel fox
#

Override the config class and then add your own instead.

upper siren
#

For what I'm trying to do: 3CB WMIK have by default the "raise flag" addAction, that raises the union jack. I'm attaching UN flags to all vics via CBA class EH, but once hidden the UK flag appears.

#

Might just add a second Addaction to all vehicles so players can just choose.

steel fox
#

Use the action EH and override the call to raise flag?

upper siren
#

ah good idea

slim spire
#

Is there a way to move an object (somewhat) smoothly with setPos over MP? When I try to raise an object it just jumps from the starting position to its end after some time

unique sundial
#

just normal parse error

meager granite
#

Will it even work with men?

unique sundial
#

no

meager granite
#

All scripted in my case, lots of lineIntersectsSurfaces and ifs

winter rose
#

SHIFT pressed during game start. No 'GameConfig'.cfg mods will be loaded!
oh, didn't know that 👀

#

d:\bis\source\profile\futura\lib\network\networkserver.cpp ClearNetServer:NOT IMPLEMENTED - briefing! boo

unique sundial
meager granite
#

Interesting, no network messages from setVelocityTransformation on remote entities

#

Gonna keep it in mind

distant belfry
#

Could I just change this line SQF _unit = _this select 0; to SQF _unit = "classnames here";?

little raptor
#

No

distant oyster
distant belfry
#

Could I use a class event handler from cba then? Or is there a better way to convert this script to classnames?

slim spire
distant belfry
#

Could I use SQF ["ghosthawk1blak", "init", {null = [this] execvm "scripts\ghosthawkdoors\ghosthawkdoors.sqf";}, true, [], true] call CBA_fnc_addClassEventHandler;

#

ghosthawkdoors.sqf```SQF
_unit = _this select 0;

_doorstate = false;
while {alive _unit} do {
_alt = getposatl _unit select 2;

// If under 20 altitude and doors are already closed, open them.
if ((_alt <= 20) && !(_doorstate)) then {
    _unit animateDoor ['door_R', 1]; 
    _unit animateDoor ['door_L', 1];
    _doorstate = true;
    };


// If over 20 altitude and doors are open then close them.
if ((_alt > 20) && (_doorstate)) then {
    _unit animateDoor ['door_R', 0]; 
    _unit animateDoor ['door_L', 0]; 
    _doorstate = false;
    };

//Slow the script down some.  This is not a critical loop.
sleep 3;

};``` Doesn't seem to work however

#

I think it's to do with the _unit variable

south swan
#

this isn't defined inside the EH, though?

distant belfry
#

so would null = ["classname"] work?

#

Due to us using a factory script I need this to apply to all ghosthawks that get spawned which means I can't use specific vehicle inits

#

So I basically want to add automatic door opening to any ghosthawk, current or future in the mission

#

Might not be explaining well, for all intents and purposes I want to try and work out how to make _unit = an array of classnames and then have that work in the mission, not sure how to do that, sorry if unclear

steel fox
# distant belfry Might not be explaining well, for all intents and purposes I want to try and wor...

You are already using a CBA classname EH. If you slap that on the baseclass of all Ghosthawks then it will fire.
for all of the Ghosthawks. Probably need the re init parameter to catch Ghosthawks that got placed in Eden.

Also remove the execVM and just put the script in the EH directly it will be faster and save performance. execVM is actually a file operation. So for EVERY time that EH runs, it will load the file from disk -> Parse the file -> Process the file to runnable SQF and then run it. Don't do that.

#

Ah you use a while true loop aswell. Hmm, just wrap it in a spawn instead of the execVM

distant belfry
#
["B_Heli_Transport_01_F", "re init", {null = [this] "scripts\ghosthawkdoors\ghosthawkdoors.sqf";}, true, [], true] call CBA_fnc_addClassEventHandler;```Like this? Sorry I am VERY amateur at this
steel fox
#

That will apply to ALL classes inheriting from transport heli

distant belfry
#

perfect, I have 5 retextures of the ghosthawk so that's fine

steel fox
#

Use the first Ghosthawk class, the one all other Ghosthawks inherit from

distant belfry
#

That is the class my retextures inherit from

steel fox
#

Is that the classname of the Ghosthawk?

distant belfry
#

According to CfgVehicles WEST it's the UH-80 Ghost Hawk

#

Just the plain black OG one

steel fox
#

Huh. Sorry Just haven't looked at a vanilla classname in a while. Pardon me

distant belfry
#

No worries, thanks for help

#

Do I put the above line in my init.sqf?

steel fox
#

No its not right

#

Give me a hot min

#

If you look at that page you can see your function call isn't correct.

#
["B_Heli_Transport_01_F", "init", {
    params ["_vehicle"];
    [_vehicle] execVM "scripts\ghosthawkdoors\ghosthawkdoors.sqf";

}, true, [], true] call CBA_fnc_addClassEventHandler;```
steel fox
# distant belfry No worries, thanks for help

That's should work, and no not just in init. That would mean you add that EH on all machines. So every helicopter gets the loop added server + connected-clients amount of times not good. Better to wrap it in an

if (isServer) then {

};

That way it only gets added once, on the server side!

distant belfry
#

So like ```SQF
if (isServer) then {
["B_Heli_Transport_01_F", "init", {
params ["_vehicle"];
[_vehicle] execVM "scripts\ghosthawkdoors\ghosthawkdoors.sqf";

}, true, [], true] call CBA_fnc_addClassEventHandler;
};```

steel fox
#

ow yeah right, params is an easier way of writing select 0 and such.

#

No

#

Wrap the EH in the If statement, don't put it below it.

#

The { } forms a code block, the if statement only has effect on code inside the block.

#

Ow sorry you did that, yu just forgot to remove the original }; @distant belfry

distant belfry
steel fox
#

Should work, try it out

distant belfry
#

Yeah that worked perfectly, thanks so much!

steel fox
#

No problem. Just get rid of the execVM and it will be pretty good.

Replace the execVM line with [_vehicle] spawn { }; and paste the code from the file in the { } does the same as execVM minus all the bad things execVM does basically.

distant belfry
#

Really appreciate it

mighty bronze
#

Hello
Lets see if anyone can help me
I am useing this:

call{nul = [f10] spawn {while {true} do {(_this select 0) say3D "argentinos"; sleep 80;};};}

To make a vehicle have a music sound. It works fine, but when I get inside the car, I cant hear anything.
If I use say2d I can hear it, but also its hear on the hole map

little raptor
mighty bronze
#

Yes, only first person

#

So, there is no fix?

little raptor
#

afaik no

#

you can try say2D

#

and kill the sound when the player gets out of the vehicle

mighty bronze
#

But say2d plays in the hole map

#

Can say2d not be played in the hole map?

little raptor
#

no

mighty bronze
#

Ho.. well..

#

Not any other way around it?

little raptor
mighty bronze
#

Take it easy, english is not my first lenguage, and this coding is hard eanaph.

wind hedge
#

I am a creating a fnc to make a particular group forget about their targets:

#
params [
    ["_unit", objNull, [objNull]],
    ["_dist",300,[500]]
];

private _nearEnemies = [];
_nearEnemies = _unit nearEntities ["CAManBase", _dist];
if (_nearEnemies isNotEqualTo []) then {
    {
        if (([side group _unit, side group _x] call BIS_fnc_sideIsEnemy)) then {(group _unit) forgetTarget _x;};
    } forEach _nearEnemies;
}; ```
#

But I am guessing that if instead of using nearEntities there could be a command that brings an array of targets that the group knows about so I can just make them forget those it would be more efficient... does such command exists?

#

something like: ```sqf
private _knownEnemies = []; _knownEnemies = (group _unit) knownEnemies;

wind hedge
little raptor
#

if you want enemy targets you should do targets [true]

wind hedge
#

Final product: ```sqf
params [
["_unit", objNull, [objNull]]
];

private _targets = [];
_targets = _unit targets [true];
if (_targets isNotEqualTo []) then {
{
(group _unit) forgetTarget _x;
} forEach _targets;
}; ```

little raptor
#

if (_targets isNotEqualTo []) then {
this check doesn't really do anything

#

iteration over empty array has no cost

#

also idk why you split the assignment

wind hedge
pulsar bluff
#

another way is to clone the group and add the units to the cloned group

wind hedge
pulsar bluff
#

i find forgetTarget works better in theory than in practice

little raptor
#

and the target was reacquired

wind hedge
little raptor
#

maybe

#

if you have trouble making it work give it a try

wind hedge
#

this forget Targets fnc I run when Ai units leave a vehicle with an getOutMan EH, it is meant so that Ai units don't immediately engage enemies after leaving vehicles

#

I guess that since it is called from the EH it is almost as the isNil "hack"

little raptor
#

yes

wind hedge
#

Removing the group's radios might also help making the delay more significant...

mighty horizon
#

So im currently making a Mission for my Unit, im wanting to have something where theres a locked room, but in order to have it unlocked, they have to have a code, is there anyway I could possibly use a trigger for or something?

past wagon
#

my script is crashing the game, with exit code STATUS_ACTION_VIOLATION. Does anyone know what this means?

warm hedge
#

It just means a generic error. The error itself doesn't contain anything useful to solve issue, so you'd need to post the code as well

past wagon
#

I think this is the code causing it... it is only crashing when there is only 1 player:

private _playersList = (allPlayers - [player]);
{
    lbAdd [2001, name _x];
} forEach _playersList;
uiNamespace setVariable ["TRI_duelPlayersList", _playersList];
#

I'm guessing it cant handle forEach []?

warm hedge
#

forEach [] will just skip it

past wagon
#

hmm

#

I'll post everything

warm hedge
#

Are you sure that it caused it?

past wagon
#

not that code there necessarily

#

but it happens when I use a scroll action

warm hedge
#

I see no addAction here, so you'd need to post the entire after all

past wagon
#

called in initServer.sqf:

[duelsAgent, ["<t color='#7f0000'>Initiate Duel", TRI_fnc_duelMenu, nil, 6, true, true, "", "true", 3, false, "", ""]] remoteExec ["addAction"];
#

should have used sqfbin, one sec

warm hedge
#

So you got the crash until the line of uiNamespace setVariable ["TRI_duelPlayersList", _playersList];?

past wagon
#

hmm

#

I'm not really sure

#

the dialog opens, and then the game crashes a few seconds later

warm hedge
#

You need to comment out some part so you'll see what part causes the error

little raptor
past wagon
#

no I havent used the buttons

#

I will do that. I was just checking the rpt file

little raptor
past wagon
#

yes

#

it is only opened through the action

little raptor
#

I don't see anything that can crash the game.
e.g. if you deleted a control or modified a control inside an EH it would be possible
but since you don't interact with it there is nothing that can crash it as far as I see

past wagon
#

ok I figured out when its crashing

#

the buttons and everything are working fine

#

the gui only crashes when I interact with the list box

#

or RscCombo, rather

#
private _playersList = (allPlayers - [player]);
{
    lbAdd [2001, name _x];
} forEach _playersList;
```This is the code for the `RscCombo`. Everything works fine when there are multiple players.
little raptor
past wagon
#

yes

#

is that known to cause a crash?

little raptor
#

no

warm hedge
#

So, let me clarify, if you have the empty combo, and try to click it, will crash?

past wagon
#

yes

warm hedge
#

Never heard of it... 🤔

#

Is there ANY eventhandlers on it?

past wagon
#

not on the combo

little raptor
#

if you can repro the crash report it

past wagon
#

or do you mean with a completely different set of controls?

little raptor
past wagon
#

nope

little raptor
#

then just create it

#

createDialog "blabla"

#

and click on the combo

stable dune
#

Good morning,
Is there object type to "streetLight", i mean if i want shutdown lights from city.
Do i declare all light type in array or is there simpler way to get all type of streetlight etc.

little raptor
past wagon
little raptor
little raptor
stable dune
past wagon
#

if _playerList is empty

#

I think?

little raptor
#

then I don't think it's empty

warm hedge
#

Can you add some debug commands like diag_log or systemChat to make sure it does get executed?

past wagon
#
private _playersList = (allPlayers - [player]);
little raptor
#

e.g. if you have headless clients

warm hedge
#

Like systemChat str _x

past wagon
#

okay, so _playersList is returning [] and the code in the forEach loop is not being executed

#
private _playersList = (allPlayers - [player]);
systemChat ("_playersList: " + str _playersList);

{
    systemChat ("_x: " + str _x);
    lbAdd [2001, name _x];
} forEach _playersList;

Returns:

_playersList: []
warm hedge
#

Yet if you click the combo, still crashes?

past wagon
#

lets see

#

nope

#

not crashing anymore

#

funny how it did it 3 times just to screw with me

warm hedge
#

Hm, I just tried to recreate what you say using your code. No luck, it doesn't even crash

little raptor
past wagon
#

weird

#

thank you though

little raptor
#

you might have a mod

past wagon
#

nah

little raptor
#

or another script elsewhere blobdoggoshruggoogly

past wagon
#

If it happens again I will look into it more

#

thanks for your help, though

past wagon
#

yep it's crashing my game again lol

stable dune
#

Trioxide , are you trying add player to ct_combo list?

// UI control 
onLoad = "uiNamespace setVariable ['_listCtrl',(_this #0)];
params ["_control"];
disableSerialization;
_control = uiNamespace getvariable '_listCtrl'; 
lbClear _control; 
{
    _control lbAdd (name _x); 
    _col =
[0,1,0,1];
    _side = side _x;
        switch (_side) do {
            case (east): {_col = [1,0.6,0,1]};
            case (west): {_col = [0,0.7,1,1]};
            case (independent): {_col = [1,0.7,1,1]};
        };
    _control
lbSetColor [_forEachIndex, _col]; 
    _control lbSetData [_forEachIndex, str _x] 
} forEach allPlayers;

This works for me (using CT_listBox)

winter rose
drifting portal
#

I seem to be having trouble deleting a map object

#

terrain object if you may

#

deletevehicle doesn't do anything to it

warm hedge
#

You can't AFAIK. Just hide it

drifting portal
#

so that it hides for everyone in mulitplayer without issues

warm hedge
#

Guess hideObject ing everyone (not hideObjectGlobal variant) with Global Object Init is a better way?

drifting portal
#

Yeah that's what I thought too

pulsar bluff
#

@drifting portal (<position> nearestObject <building type>) hideObjectGlobal true

#

example to hide that weird bunker in the mountain on Malden

#

([4779.35,5697.9,0.0012207] nearestObject "Land_Bunker_01_HQ_F") hideObjectGlobal true

hallow mortar
#

There is a Hide Terrain Object module (not Edit Terrain Object) which works fine in MP

drifting portal
#

performance issues or?

little raptor
little raptor
warm hedge
#

Object IDs are always not recommended as it could be changed

little raptor
#

nobody updates their mods anymore

#

A3 is pretty much dead

unique sundial
#

that’s why 2.10 has TONNES of changes, because A3 is dead

little raptor
#

99% were scripting features

#

also I'm just stating the facts. I have many terrain mods, none updated during the past year

pulsar bluff
#

a lot of arma mods (terrains, etc) are mostly complete. i doubt there are many large unreleased projects in development, but for mission makers the new stuff is great

#

and indeed for mission players the new stuff is cool

#

Reforger release has put the brakes on a lot of arma 3 mod activity as some of the modders start to move to the new systems

granite sky
#

Asset makers are naturally gonna switch to Reforger faster than mission makers, because mission makers need assets first.

meager granite
#

Is there a way to tell that moveInCargo failed on remote vehicle during a bit of a lag? (because of no seats left for example)

#

You execute player moveInCargo _remote_vehicle, some time passes until server reply arrives, how can I tell that the request was resolved?

#

Positive reply would mean that unit is in the vehicle, but how can I tell that it failed?

unique sundial
#

can it fail?

meager granite
#

Yes, two clients do moveInCargo at once, only one succeeds

#

Not sure how this command works behind the curtains, but it seems that it can fail with original syntax even for empty vehicle

#

I think that both clients see seat 0 empty, whichever's message arrives first gets it, another one doesn't get anything, trying to figure how to tell that it failed

unique sundial
#

what do you mean for empty vehicle

meager granite
#

Lots of cargo seats, all empty

#

two clients do player moveInCargo vehicle at once, both seem to try to get to cargo seat 0, only one succeeds

unique sundial
#

oh so both trying to get into the same seat

meager granite
#

Yes, in case of original syntax without specified cargo seat index

unique sundial
#

moveinany, has this failed before?

#

is this moveincargo specific?

meager granite
#

Didn't try with moveInAny

unique sundial
#

also make a ticket pls

meager granite
#

No, had original syntax, in practice it fails when several players try to get into the vehicle at once, got curious if there is a way to tell that command failed

unique sundial
#

not sure if there is a way to return this information but am going to look

unique sundial
meager granite
#

Gonna have to reproduce real server lag somehow to test

#

But thinking about it, if server selects that "any seat" then it should work fine. If client does, then it will be the same as moveInCargo

unique sundial
#

afaik server has authority in this but maybe it could be improved

past wagon
thick merlin
#

I am using the VVS vehicle spawn script suite on a dedicated server and have modified the spawnvehicle script so that it reads "h1 = _className createVehicle _position;" .

My issue is if i spawn/create a vehicle the newly created vehicle does'nt activate my trigger that uses "h1 in thisList or h2 in thisList;" as the condition.

The vehicle that starts the mission does all this perfectly but not the newly created vehicle.

The newly created vehicle IS being renamed as i have "gunner1 moveingunner h1" in use successfully.

The trigger just wont activate for some reason.This is on dedicated server.Singleplayer and host myself MP works fine.Sounds like a locality issue maybe?

Any ideas?

Thanks.

south swan
#

one idea is: vehicle gets spawned on a client and a trigger runs server-only. And h1 only gets changed on a client 🤷‍♂️

thick merlin
#

yeah, it seems sumthn like that.Any ideas for a work around?Iam not a pro scripter.

south swan
#

if it's that, then inserting publicVariable "h1"; as the next line should help

thick merlin
#

whereabouts? Ive had a go at that but got nowhere..

#

in the create vehicle script?

south swan
#

uhm? "Next line" as in right after the h1 = _className createVehicle _position;, so it becomes sqf h1 = _className createVehicle _position; publicVariable "h1";

#

yes, in the create vehicle script

thick merlin
#

ive tried putting that into that script but in other places.

#

any need to write anything else in an init or anything?

#

ive set up public variables for trigger activations before and had to add them to the init scripts thats all.

#

I'll try that tommorow.Its almost 4 in the morning.Been trying everything...lol

#

Thanks for the help.

south swan
#

well, that's just an unconfirmed theory at this point. Maybe i should take a look at the actual script to understand what's really going on there

thick merlin
#

have the script ready for paste but not know how to add it here

#

"" sumthn like that isnt it?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
south swan
#

thanks

winter rose
#

also:
h1 in thisList or h2 in thisList
if h1 doesn't exist, your trigger should throw an error for undefined variable

#
(not isNil "h1" && { h1 in thislist }) || (not isNil "h2" && { h2 in thislist })
```would be "nicer"
thick merlin
#

yeah its strange.I have co-piolt moved into it upon spawn but the trigger will not fire.Only on spawned vehicle

#

you think that might help?

winter rose
#

🐮 PERHAPS

thick merlin
#

i'll try that too tommorow.Thanks!

#

heres script

south swan
#

which function seems to be spawned by user pressing a button in GUI (literally onButtonClick = "[] spawn VVS_fnc_spawnVehicle";), which is definitely client-side 🤷‍♂️

winter rose
thick merlin
#

k.thnx

#

any idea how to make the server know of its creation?

#

dont know what to do with that sqfbin??

#

loacality issues are a pain in the butt..

winter rose
winter rose
thick merlin
#

cool.thats easy.Thanx

winter rose
south swan
#

also, is the sqfbin URL the same because it was copied, or because the same-content is somehow detected server-side and it gives the same URL when trying to post again?

thick merlin
#

i just copied the url

#

from sqfbin

#

forgive me.its almost sun up here...

thick merlin
#

🙂

#

the post with the link to the full suite is unfixed or has a fix for this issue?

south swan
#

it's where i got what i believe is the starting code without your modifications

thick merlin
#

I'll give those edits a try and get back to you guys tommorow.Thanks again!

winter rose
#

'night!

distant oyster
#

what code are you using?

distant oyster
#

no not what language, what does you code look like?

#

yeah just like you intended, create an array of created vehicles and delete the first entry when a new one is created, so something like

TAG_spawnedVehicles = [];
addMissionEventhandler ["EntityCreated", {
  hint "A vehicle spawned just spawned";
  private _newVehicle = ...; // replace "..." with however you want to create your vehicle
  TAG_spawnedVehicles pushBack _newVehicle;
  if (count TAG_spawnedVehicles > 10) {
    private _vehicleToDelete = TAG_spawnedVehicles deleteAt 0;
    deleteVehicle _vehicleToDelete;
  };
}];
``` todo is add failsafe if a vehicle is not deleteable
south swan
#

well, "EntityCreated" should fire at the point when the new entity is already created, no? So something like this, probably? sqf TAG_spawnedVehicles = []; addMissionEventhandler ["EntityCreated", { params ["_entity"]; if (typeOf _entity != "TargetClassName") exitWith {}; hint "A vehicle spawned just spawned"; //private _newVehicle = ...; // replace "..." with however you want to create your vehicle TAG_spawnedVehicles pushBack _entity; //if (count TAG_spawnedVehicles > 10) { while {count TAG_spawnedVehicles > 10} do { //for the unlikely case of private _vehicleToDelete = TAG_spawnedVehicles deleteAt 0; deleteVehicle _vehicleToDelete; }; }];

south swan
#

it should exit from it, not restart 🤔

#

as in "stop the loop (possibly with value returned from it) and continue with whatever is after it"

#
while {true} do {break;};
hint "Haha, i get executed!";```
#

is there even a return command in SQF? I can't find one

open fractal
#

no

south swan
#

if (true) exitWith {} exits current scope (as in: loop, code block, etc.)

#

continue to stop the current iteration and start the next one. I.e. sqf _x = 0; while {true} do { _x = _x + 1; if (_x == 2) then {continue}; systemChat str _x; if (_x > 10) exitWith {}; }; should print the numbers starting from 1, skip 2 and stop after 1011

#

what? why?

#

why add event handler in the endless loop?

#

absolutely. The code of event handler gets executed once for every new created entity

brazen lagoon
#

@granite haven = instead of ==

#

also i dont think sqf has else if

south swan
#

also, _entity is Object. To check its type you need something like (typeOf _entity == "TargetClassName"). And yes, = is assignment == is comparison. And yes there's probably no else if

#

also, params ["_entity"]; is mandatory to get the _entity as a variable. With no params you'd need to access it like _this#0 notlikemeow

past wagon
#
_duelers remoteExec ["TRI_fnc_duelHUD", _duelers];

fn_duelHUD.sqf:

disableSerialization;

private _duelHUD = (uiNamespace getVariable "DuelHUD");

{
    [_duelHUD displayCtrl 1003, parseText "<t align='left' size='1.5' font='PuristaBold'>0"] remoteExec ["ctrlSetStructuredText", _x];
    [_duelHUD displayCtrl 1004, parseText "<t align='right' size='1.5' font='PuristaBold'>0"] remoteExec ["ctrlSetStructuredText", _x];
    [_duelHUD displayCtrl 1005, parseText "<t align='left' size='1.5'>You"] remoteExec ["ctrlSetStructuredText", _x];
    [_duelHUD displayCtrl 1006, parseText (format ["<t align='right' size='1.5'>%1", name ((_this - [_x])#0)])] remoteExec ["ctrlSetStructuredText", _x];
} forEach _this;

Does anyone know why this display update is only happening for non-server players? _duelers is an array of players.

hallow mortar
#
  • your remoteExec is targeting specifically the players in _duelers so if the server player isn't in that array, they won't receive it
  • you're remoteExec'ing TRI_fnc_duelHUD to all players in _duelers......and then each copy of that function is also remoteExec'ing every command in the function to all the other players in _duelers. That's duplicative and unnecessary, just remoteExec the function to all of them and have it affect only the local player.
ocean folio
#

I've never worked with functions before in a mission file, only in mods. Where would it get the tag from in the case of the mission file?

#
class CfgFunctions 
{
    class CBRN
    {
        class test{};
    };
};

in this case would the tag be CBRN?

#

so CBRN_fnc_test in this case?

#

or wait, I think I need to go one class deeper

compact maple
#

I do have this

class CfgFunctions {
  class Authentification {
  tag = "auth";
  class Functions {
    file = "auth";
    class ask_account {};
    class ask_players {};
    };
  };
};
#

you define your own tag I guess

#

and in my exemple
auth_fnc_ask_account

ocean folio
#

I know you dont need to explicitly define the tag, it gets taken from one of the classes

compact maple
#

oh well maybe

ocean folio
#

from the wiki:

class CfgFunctions
{
    class TAG
    {
        class Category
        {
            class myFunction {};
        };
    };
};
#

yeah I think I was just one level too shallowmeowsweats

#

ima slide over to #arma3_config since this is probably more appropriate there, being a cfg and all

dry cliff
#

Might not be the right place, but I'm new to using the Eden editor and no matter what I try, I can't seem to get the arsenal to work right. Whats the scripting to make an ammobox an arsenal that includes all modded weapons, uniforms, ETC.?

granite sky
#

The mode string is case-sensitive so watch out there.

past wagon
mighty bronze
#

Hello, any simple script or something to make a gun non lethal? Thanks.

open fractal
#

that's more of a config question i think

crude vigil
#

Every question is a scripting question if you are brave enough. meowtrash

wind hedge
mighty bronze
#

Taser gun is what a I need

wind hedge
#

☝️ There you go...

mighty bronze
#

I dont even know what to do with that, sorry, I am noob with scripts

wind hedge
mighty bronze
#

Yea, I guess so.. thanks anyway, appreciated.

wind hedge
wind hedge
#

I am looking to replace our good old sqf waitUntil {behaviour _aiUnit != "COMBAT"}; with one of the new group EH, but it seems that sqf addEventHandler ["CombatModeChanged" won't cut it because it doesn't detect changes in the group's behaviour and only its combat mode which is not changed by the group when it goes into combat. Additionally the enemy detected Eh seems to fire too often, unlike the COMBAT behaviour which changes mostly once every 5 minutes or so....

#

Any new group EH that could mimic what I am looking for?

north agate
#

Would anyone have any ideas on why in a live server this does not work like it does in the editor? I ran debug on it and everything seems to be working but visually the lights freeze for a good 5 to 10 sec. debug info showed it was running thru the code eachframe spitting back updated positions and directions but was not visually updating eachframe. I would use attachTo but the object im using does not accept attachTo so im trying to get these lights to move with this object by eachFrame eventhandler. Also open to any suggestions on other ways to go about doing this.


CATlightpoint2 = createVehicle ["reflector_cone_01_long_white_F", (CATlocalcar modelToWorld [-0.7,+5.89,-0.25]), [], 0, "CAN_COLLIDE"];

    CATLightFrames = addMissionEventHandler ["EachFrame",     {
                private _localCarDir = getDir CATlocalcar;
                                                                CATlightpoint1 setDir _localCarDir;
                                                                CATlightpoint2 setDir _localCarDir;

CATlightpoint1 setPos (CATlocalcar modelToWorld [+0.7,+5.89,-0.25]);
                                                        CATlightpoint2 setPos (CATlocalcar modelToWorld [-0.7,+5.89,-0.25]);
                                                                
                                                            }];
pulsar bluff
#

iirc you need to use “createvehiclelocal” and have every client run that code

tight shoal
#

Hej Folks! hope u are all fine!
I have a question, i'm trying to do that if any player goes to an enemy body and tries to take something from the enemy inventory, that the Inventory goes blocked/closed leaving the player without the posibility to take anything from the dead body.
I have this script, but i have some kind of error that i don't know, could someone give me some help? i would really appreciate it!. Here is the Code:

if !(hasInterface) exitwith{}; player addEventHandler ["InventoryOpened", { if (_this select 1) iskindof "man"; [] spawn { waitUntil {!isnull findDisplay 602}; (finddisplay 602) closedisplay 1; cutText ["No loot", "PLAIN DOWN",0,true,true]; } }];

PD: The error says me that it's Type Object and awaits Bool.
Best regards and thank you in advance!

Semper Fi

warm hedge
#

if (_this select 1) iskindof "man"; what does this supposed to do? Also,

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
hallow mortar
tight shoal
tight shoal
stable dune
#

Hello, still trying find out how to get result 1 object from take EH.
even using condition

if (_blockItem findIf { _x == _item } > -1 && _container == (_unit getVariable 'container')) then {}```
I get result 4 if i have 4 bananas in container.
So is there somekind of workaround to get take eh only effect to 1 object , not all of kind of object which is in container.
So if i take 1 banana, it delete that from player, and from container , but adds 4 back. So after take i have 0 in player invertory and 7 in container
little raptor
#

I'm gonna say it has nothing to do with the EH firing multiple times, but rather you adding multiple EHs

#

you add an EH every time the player opens a container

#

let's say he doesn't pick up anything

#

your Take EH will stay in place

#

now let's say he opens another container

stable dune
little raptor
#

and again just closes inventory

#

you end up with 2 EHs now

stable dune
#

So there is in bad case 10 eh for nothing on player

little raptor
#

or several hundred yeah

stable dune
#

Very good point.
So is there any way to do something what Im trying.
To get player blocked get specific items from containers

little raptor
#

just add 1 EH

#

either use a lock guard, or add the EH outside the ContainerOpened EH

south swan
#

except "Take" EH didn't fire on every item pickup last time i've checked (in 2.08 iirc), only on some

stable dune
stable dune
little raptor
#
this addEventHandler ['ContainerOpened', {   
    params ['_container', '_unit'];
    _unit setVariable
['container',_container];
    if (_unit getVariable ["has_EH", false]) exitWith {};
    _unit setVariable ["has_EH", true];
    _unit addEventHandler ['Take', {   
        params ['_unit', '_container', '_item'];
        private _blockItem = ['ACE_Banana', 'itemMap', 'ACE_morphine','ACE_EarPlug
s'];   
        if (_item in _blockItems  && _container == (_unit getVariable 'container')) then {
            systemChat format ["Player %1 %2 %3",name _unit , 'you are unable to loot',
_item];  
            _unit removeItem _item;
            _container addItemCargo [_item,1];;
            _unit removeEventHandler [_thisEvent, _thisEventHandler];
            _unit setVariable ["has_EH", false];
            (findDisplay 602)
closeDisplay 0;
        };  
    }];  
}];
#

it prevents you from adding more than 1 EH

stable dune
#

Nice

little raptor
#

but like I said just add 1 EH

stable dune
south swan
#

why even bother adding a EH inside another EH at this point? Just move the "Take" EH outside into, like, initPlayerLocal.sqf :3

little raptor
#
this addEventHandler ['ContainerOpened', {   
    params ['_container', '_unit'];
    _unit setVariable ['container',_container];
}];
this addEventHandler ['Take', {   
    params ['_unit', '_container', '_item'];
    private _blockItem = ['ACE_Banana', 'itemMap', 'ACE_morphine','ACE_EarPlug
s'];   
    if (_item in _blockItems  && _container isEqualTo (_unit getVariable ['container', objNull])) then {
        systemChat format ["Player %1 %2 %3",name _unit , 'you are unable to loot', _item];  
        _unit removeItem _item;
        _container addItemCargo [_item,1];;
        (findDisplay 602) closeDisplay 0;
    };  
}];
stable dune
#

Awesome

#

Thanks 🙏

south swan
south swan
#

well, "Rearm at X" action doesn't seem to fire "Take"/"Put" EH

meager granite
#

Apparently setVelocity doesn't update over the network if you apply it to local shotShell shots 🤔

unique sundial
#

aren't shotshell is local?

meager granite
#

Not sure. Aren't they slow enough to be global? deleteVehicle on remote-created shotShell deletes it for everyone at least.

#

Testing with createVehicle-created shotShell

unique sundial
#

which object do you create?

meager granite
#
    class rhs_ammo_3d17_shell: Grenade
    {
        simulation = "shotShell";
#

Went to investigate why RHS's scripted remote smoke shells don't move, that turned out to be the reason

#

Guess they need to change setVelocity to be remoteExec'ed

#

Vanilla vehicle smokes are shotSmokeX so setVelocity updates through the network fine

unique sundial
#

rhs_ammo_3d17_shell what is it?

meager granite
#

Tank smoke shell

unique sundial
#

do you know vanilla equivalent?

#

which is shotShell too?

meager granite
#

Vanilla uses shotSmokeX for smokes

#

But you probably can reproduce it by creating any shotShell projectile

unique sundial
#

why RHS wont use shotShellX?

meager granite
#

I guess because their shell explodes after some time and creates instant smoke vs continuous smoke from the shotShellX

#
private _shell = createVehicle ["Sh_120mm_APFSDS", player modelToWorld [0,5,5], [], 0, "CAN_COLLIDE"];   
_shell setVectorDirAndUp [vectorDir player, vectorUp player];   
_shell setVelocity (vectorDir player vectorMultiply 100);
#

Vanilla asset

#

Shoots forward properly for creator, floats in place for remote clients

#

Talking about possible engine solution would be a proper createVehicle command without ancient marker crap, where you could provide everything that's included in the create message - class, positions, orientation, velocity

#

But this particular issue case can be solved with remoteExec call

#
private _shell = createVehicle ["Sh_120mm_APFSDS", player modelToWorld [0,5,5], [], 0, "CAN_COLLIDE"];
[_shell, [vectorDir player, vectorUp player]] remoteExecCall ["setVectorDirAndUp", 0];
[_shell, vectorDir player vectorMultiply 100] remoteExecCall ["setVelocity", 0];
```is MP compatible
#

OBJECT = createVehicle HASHMAP with parameters that you need in the provided hashmap!

#

A man can dream

#

Thinking about it again, with this many arrays that createHashMapFromArray takes, such command would probably be a lot slower than flat arrays that most commands use right now, so its not that good of an idea.

unique sundial
meager granite
#

Further setVelocity calls don't do anything either

unique sundial
#

Maybe it was meant to be local when engine fires it?

#

Sh_120mm_APFSDS is fast vehicle so it wont have network sync

velvet merlin
#

is nearTargets, targets and targetsQuery basically the same / operating on the same target data - with the nearTargets only providing a distance filter, targets and targetsQuery (no distance - only position) to offer more filters?

#

also targetsQuery has the comment "This command could be CPU intensive." - should be still less than doing filtering in sqf land, right?

delicate lotus
#

how exactly can I make params accept a config entry?
I tried params ["_config", configNull, [configNull]]; but it throws the following error:

12:26:36   Error position: <params ["_config", configNull, [configNu>
12:26:36   Error Type Config entry, expected Array,String
proven charm
#

shouldn't that be params [["_config", configNull, [configNull]]]; added another [] there

delicate lotus
#

oh, right

#

Rookie Mistake 😂

velvet merlin
#

thanks. so the "This command could be CPU intensive." comment is not really correct

#

like it should be rather along the lines "using a combination of filters may extend the execution time considerable"

#

and still kinda doubtful this is true for anything you do via sqf instead

little raptor
#

targetsQuery also gets the targetKnowledge afaik

velvet merlin
#

will do some measuring of the relevant command set and report back

meager granite
#

Any clues what might trigger this bug? Units appear on top of the vehicle in some static animation.

#

Happens in real server all the time, seems to be happening A LOT more with RHS

#

Just had it locally with listen server and client, but couldn't make it happen again. Looks like some kind of lag triggers it (left two clients open for hours doing nothing with one in the tank)

#

Did some experiments when seen this on live server - switchMove on unit does nothing, unit is properly in the vehicle (included in crew, in command returns true)

#

Thought it would be the most competent channel to ask in

#

Big game breaker as you can easily shoot out the crew out like this

#

Also one observation, I constantly seen this happen for units in mortars with vanilla assets. Maybe something config-wise triggers it to happen more often that mortars and RHS assets have

little raptor
#

like doors

#

I've seen that a lot

#

and no clue why it happens

meager granite
#

I seen this happen all the time with mortars in vanilla game in multiplayer

little raptor
#

but I know a workaround for fixing it

meager granite
#

Like 90% times I look at player in mortar, they're in this default animation

#

Been few years ago though, started seeing this all the time again in RHS once started playing and watching it.

meager granite
little raptor
#

just doing a switchAction meowsweats

#

with a getIn event handler...

#

I did that for my AI mod to fix that bug

meager granite
#

🤔

#

Tried switchMove on remote unit bugged like this, nothing happened

little raptor
#

you should use switchAction and supply the correct action

meager granite
#

Lemme try

#

Did switchMove "" on crew side, turned into such animation, but only for them, other clients don't see them like this, even after rejoin

ivory lake
#

probably need to retrieve gunnerAction etc from the config and apply that, i've seen it appear too but have no idea what the cause is

#

i've also seen switching seats in like a vehicle keeping the previous positions animation

little raptor
#

I have a newer one but it's in C++ and useless here

#

it also has a assignAs* part but that's because it's a full code for mounting the AI unit

meager granite
#

animationState returns proper animation name for the unit

little raptor
#

yep

meager granite
#

Yet unit is in broken animation

little raptor
#

I just noticed that in my own code 😅

meager granite
#

Joined live server, checked out random tank -> animations broken

little raptor
#

so the bug was the unit animation, not vehicle animation

#

for some reason it doesn't "jump" (switch) properly

meager granite
#

Must be JIP too as I found bugged unit almost instantly after joining

little raptor
#

so wait, does unit switchMove animationState unit fix it?

meager granite
#

it doesn't

#

but let me try again

little raptor
#

are you local to the unit?

#

iirc switchMove takes local arg

#

yeah

meager granite
#

Speaking of bugs, 5 years later and naked units bug still happening thronking

meager granite
little raptor
ivory lake
#

it behaves a bit differently in vehicles I noticed

#

the global effect for example doesn't seem to work

meager granite
#

switchMove, playMove, playMoveNow => do nothing

meager granite
# little raptor wat?

It gets applied to remote units but reverts once animation update arrives from unit owner

#

So effect is local and temporary, depending on what unit is doing

#

Huh, what's interesting is that I can no longer get this issue again for 10 minutes of trying

#

My bet is that happens due to asset streaming

#

Once all tanks in the round loaded, even rejoining doesn't trigger it again

#

let me try to restart the game and see

#

Maybe it happens because some LODs don't have proxies for all seats?

wind hedge
meager granite
#

If unit happens to render in such LOD, it breaks the animation?

#

Doing guesswork here, I'm a total noob with models

#

Restarted the game and guess what, it happens again

#

Seeing some correlation here

#

This might explain why vanilla mortar had this bug happening all the time, vanilla tanks are mostly okay and RHS tanks are always bugged

#

probably something in model makes it trigger more often

#

Or is it unit animation not being streamed in time? 🤔

#

So, applying "switchMove" does work

#

You just have to apply some another animation first, then proper animation

#

Just seen unit bugged like this in lower LOD for a moment, then it updated to top LOD and unit disappeared into the vehicle

#

Another point towards my LOD theory

#

Maybe some kind of update arrives while unit renders in problematic LOD, then unit stays in such broken animation?

opal zephyr
#

My brains blanked and google isnt helping, what is the line to change one of the values in a position array?
ex. [125,31,4] want to make the 4 a zero

meager granite
#

Sorry for wall of text guys, these long going gameplay and immersion breaking bugs irritate me to no end, I would LOVE for them to get fixed.

opal zephyr
#

ah yes, thankyou

meager granite
#

So yeah, animation can be fixed, you have to set some another and then proper one next frame

#

Having a fix in the engine would've been better of course

fickle hedge
#

is there any way to apply a texture on player in the clan selection? Basically force a squad.xml logo on a unit

#

either by mod config, or a mission script?

hallow mortar
#

An array can contain anything. But if you're giving it to a command as an argument, that particular command may expect it to contain only numbers.

#

Since an array can contain anything, you can pushback anything into it.

open fractal
#

that code doesn't make a lot of sense

#

when an entity is created, if the entity matches that classname the classname string is added to the end of the array, and while the array count exceeds 5 it will remove the first string from the array and then use deleteVehicle with a string?

#

["B_MRAP_01_F","B_MRAP_01_F","B_MRAP_01_F","B_MRAP_01_F","B_MRAP_01_F"] this is what your array will look like

#

why

#

do you mean to delete the object?

#
TAG_spawnedHunters pushBack _entity;
#

did you write this code?

#
TAG_spawnedHunters = [];
addMissionEventhandler ["EntityCreated", {
  //code executed whenever an entity is created
  params ["_entity"]; //defines _entity as the object that was just created
  _hunterClass = "B_MRAP_01_F"; //hunter classname to match with typeOf
  if (typeOf _entity == _hunterClass) then {
    //exits the script and executes this code if the entity type is your defined classname (above condition)
    TAG_spawnedHunters pushBack _entity; //appends hunter to array (will not happen if classname doesn't match)
  };
  while {count TAG_spawnedHunters > 5} do {
     //will only run if the count exceeds 5, will loop if the count still exceeds 5 after execution (seems redundant)
    _hunterToDelete = TAG_spawnedHunters deleteAt 0; //remove first added hunter from array, stores to _hunterToDelete
    deleteVehicle _hunterToDelete; //deletes stored object from previous line
  };
}];
#

@granite haven

#

the while {} do {} can probably just be if () then {} but it'll work anyway

#

wait

#

no you don't want exitWith

#

changed

#

the exitWith will skip the while portion

#

im going to reorganize this real quick

#

and the exitWith

#

also i have a typo with the last local variable. fixed*

#
TAG_spawnedHunters = [];
addMissionEventhandler ["EntityCreated", {
  params ["_entity"];
  if (typeOf _entity != "B_MRAP_01_F") exitWith {}; //exits scope and does not continue script if not hunter 
  TAG_spawnedHunters pushBack _entity;
  if (count TAG_spawnedHunters > 5) then {
    deleteVehicle (TAG_spawnedHunters deleteAt 0); 
  };
}];
#

deleteAt 0 will delete the oldest hunter

#

deleteAt 6 will delete the newest one

#

actually no

#

don't deleteAt 6

#

if the array has six elements the last indexed element will be 5

#

since it starts at 0

#

almost got me there

#

yeah, pushback adds to the end of the array so deleting the last element will be last in first out

fleet lotus
#

yo, everyone a noob here; does anyone have a good tutorial for arma 3 scripting?

opal zephyr
#

Im getting the error "4 elements provided, 5 expected" for the createUnit line, and I can't figure it out for the life of me...
Any help is appreciated!

_grp = createGroup civilian;
_grp createUnit ["B_Soldier_A_F", _town#0, [], 0,"NONE"];
#

nvm its just working now...?

thick merlin
#

Thanks to @south swan and @winter rose for your help.I added the public variable "h1" and it works fine now!!

opal zephyr
#

I've got a question for changing the value in a hashmap. I have a hashmap value that looks like this ["key", [[1,2,3],15,False]]
I want to change just the "False" to "True" but I don't see any examples on the wiki that use set to change something thats nested. Is this possible?

south swan
#

Arrays are accessed by linkreference, so (hashmap get "key") set [2, true] should work.

opal zephyr
#

Thanks! I'll give that a shot

#

It works well, thankyou!
I'm also trying to use getTerrainHeightASL however it ends up being a position very high above the ground... Is there perhaps a more accurate way to get this value when position2d is provided?

#

Hmm, maybe the issue isnt that getTerrainHeightASL isnt working. It could be that createUnit uses a different type of position, like ATL. The wiki doesnt say, I'll try it though

#

^this was in fact the issue, ASLToATL fixed it

winter rose
#

getPosATL could be used instead

granite sky
#

createUnit seems to be claiming that it uses AGLS. Not sure if true.

winter rose
#

no, I am NOT going to recommend getPos

#

Leo lurks around here and there, you know

granite sky
#

huh, if I blow up this particular truck it consistently returns false for isTouchingGround :P

#

Arma

#

oh, doesn't even matter where you put it. HEMTT cargo consistently returns false for isTouchingGround after being destroyed.

copper raven
#

that command is not reliable from my experience

little raptor
#

use getPos 😛

opal zephyr
winter rose
pastel crater
#

Hello 🙂 I'm extremely new to Arma 3 scripting. I'm currently using a chemical warfare mod that has three types of gas, and according to the mods wiki, you can define the type of protection you will need (be it just a mask, or a full CBRN suit). Thing is, I think I need a script for that and I don't really know how to get started.

granite sky
#

Is this for use in a mission you're making yourself?

sharp grotto
#

It's explained there how to do it

pastel crater
#

What I'm looking for is in the ''editing gas types'' section

#

I don't know if it's done the same way.

sharp grotto
#

yea just add them to init.sqf

pastel crater
#

So I'd literally paste

#

gasVX = [150, 1800, 1, 90, false, 0, 2];

pastel crater
#

On a line on init.sqf?

#

And that would be it?

#

lmao

#

Wow, it really was that easy. Thank you!

sharp grotto
#

you see the values there, that gets loaded on mod initialisation
but you can just overwrite it by adding them into init.sqf of your missionfile

spring bison
#

Hey, can someome help me out here?

#

Trying to add actions to objects for Pub Zeus, except...

#

addaction isn't used on the pub servers, according to the wiki?

#

What do

copper raven
spring bison
#

Nothing serverside, unfortunately.

copper raven
#

i suppose you can't execute it on other clients either

#

so, that means it won't work

spring bison
#

Yeah.

#

Like, if I could figure out how

#

the arsenals do it

#

that'd be awesome

#

and I would just... steal that method lol

#

as I type this, I realize that I am stupid

#

and totally cxan

#

*can

copper raven
#
{
  [_x, ["Test Action", { hint "Hello" }]] remoteExec ["addAction", -2];
} forEach curatorSelected # 0;

you can give it a try, but i doubt it will work, select an object and run that code

spring bison
#

Yeah, it seems like it uses remoteExec

#

Is there a way to just... put that into the object?

#

Have that be a part of the object?

copper raven
spring bison
#

I am a little stupid when it comes to scripting sorry

copper raven
#

but no, you can't just have objects have the action by default, that would be a mod

mighty bronze
#

hello, I know that the wiki saids its for editor only, but is there anyway to make the setObjectScale for multiplayer? Thanks

mighty bronze
#

Hoo... yes, sorry. You are correct. So, is laggy. Thanks

ocean folio
#

is there some way to create a marker that is only visible through zeus?

#

I see createMarkerLocal, but I dont think thats what I am looking for

open fractal
#

you can set marker alpha locally

ocean folio
#

are you thinking setting that alpha on curator open and close?

#

that was my first thought when you said that. Idk if thats the best way but it definitely would be a way

open fractal
#

yeah. I dont see event handlers specifically for that though

ocean folio
#

honestly it really doesnt need to show, I just dont have any visualization method for the curator to see the area which the script effects (in this case chemical warfare stuff)

meager granite
#

Dreaming about new commands again:

hashMapCache = createHashMap;

someCachingFunction = {
    private _return = hashMapCache get _this;
    if(!isNil"_return") exitWith {_return};
    _return = call {
        // Some complicated calculation
        123;
    };
    hashMapCache set [_this, _return];
    _return;
};
```How hashmaps help with caching calculation results by key

```sqf
hashMapCache = createHashMap;

someCachingFunction = {
    hashMapCache getOrSet [_this, {
        // Some complicated calculation, executes only if _this key doesn't exist, sets it to hashmap and returns the value
        123;
    }];
};
```How a new command can speed this up.
#
hashMapCache = createHashMap;

someCachingFunction = {
    // exit scope with value if _this key exist
    hashMapCache getAndReturn _this; //Other names: returnIfSet, returnIfGet

    // calculate and set _this key if doesn't
    hashMapCache set [_this, {
        // Some complicated calculation
        123;
    }];
};
```or like this
#

Purpose is to save on these variable initializations, ifs, isNils and exitWiths that are needed for such caching function

#

Move it all to the engine side

south swan
#

as in "lazy getOrDefault"?

meager granite
#

Not just default but also set

#

All in one command

#

get if key exists, if it doesn't execute the code, assign its result as key and return it too

south swan
#

getOrDefault can set since 2.04

meager granite
#

Not lazy though

south swan
#

yep

#

so doesn't really save any code for expensive default calculation. Still pretty useful in some cases

little raptor
north agate
# pulsar bluff iirc you need to use “createvehiclelocal” and have every client run that code

Thank you I was able to get the lights to work with a client side code using remoteExec like you suggested and made it way simpler than I originally had it coded. ```
private _CATlocamotiveCar = missionNameSpace getVariable "_locamotiveCar";

private _CATlocalCar = [_CATlocamotiveCar] call ATRAIN_fnc_getTrainCarLocal;

if ((typeOf _CATlocalCar) isEqualTo "ATS_Trains_Steam_Large") then
{
private _CATlightpoint1 = createVehicle ["reflector_cone_01_long_white_F", (_CATlocalCar modelToWorld [+0.7,+5.89,-0.25]), [], 0, "CAN_COLLIDE"];

private _CATlightpoint2 = createVehicle ["reflector_cone_01_long_white_F", (_CATlocalCar modelToWorld [-0.7,+5.89,-0.25]), [], 0, "CAN_COLLIDE"];

_CATlightpoint1 attachTo [_CATlocalCar, [+0.7,+5.89,-0.25]];
_CATlightpoint2 attachTo [_CATlocalCar, [-0.7,+5.89,-0.25]];

little raptor
#

Well for one thing your array is not closed
For the other, I'm not sure what you're trying to do with that function

warm hedge
#

Also

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
north agate
little raptor
#

No

warm hedge
#

The outermost array is not closed

unique sundial
meager granite
#

Do you mean it already works like this and executes the code if key doesn't exist?

unique sundial
#

no i think it will set it to {} but what i mean you want code execution for default?

south swan
#

conditional/lazy code execution

meager granite
#

Execute code if key doesn't exist, return its result AND assign result to that key

#

All in one command to use hashmaps for value calculation caching

unique sundial
#

getOrDefault ["key", {}, true];? true is treat code as conditional expression

south swan
#

it would assign the code variable to the key, not the result, though

unique sundial
#

that is how it is now

meager granite
#

If such thing is to be implemented, I think it should have a new command name instead of modifying existing one

south swan
#

changing that can break stuff for people if they actually use hashMaps to store code, though

unique sundial
#

no it wont and default is false

meager granite
#

hashmap getOrCall ["key", {}, true/false]:

  1. Return value by key if exists
  2. If doesn't, execute {}, return it
  3. If 3rd argument is true, also save new value in hashmap in that key
south swan
unique sundial
#

3rd arg force update?

meager granite
unique sundial
#

yes

meager granite
#

false - just execute the code and return its value (default?)
true - execute, return and assign value to key

unique sundial
#

so force update existing value

meager granite
#

Not force, it won't even get to that if key already exists

unique sundial
#

force init

meager granite
#
hs = createHashMap;
hs getOrCall ["key", {111}]; // 111
hs getOrCall ["key", {222}, true]; // 222
hs getOrCall ["key", {333}]; // 222
hs getOrCall ["key", {444}, true]; // 222
#

Don't like the command name that much though

#

getOrLazyDefault getOrLazyCall getOrSetCall

#

getOrSet might be bit misleading if somebody would expect code to be set and not executed

#

but you have getOrDefault for that

#

And personally I'd prefer 3rd argument to be true by default as that's why I'm going to use it most of the time, hard to imagine why you won't want something set

south swan
#

or add the 4th argument to getOrDefault for calling the code that's in default 🤷‍♂️

little raptor
#
//fn_someExpensiveFunction
private _resultName = _fnc_scriptName + "_result";
if(!isNil _resultName) exitWith {missionNamespace getVariable _resultName};
// get result
// ...
missionNamespace setVariable [_resultName, _result];
_result
meager granite
#

Less commands called

#

Right now I use these caches to save and get properties for CfgAmmo and other config classes

#

Very useful when you need to check classes for your needed properties very often like in "Fired" event handler

#

instead of getting config values and comparing them against something each time

#

Can be turned into single command with that idea:

private _is_projectile_guided = isProjectileGuidedCache getOrCall [typeOf _projectile, {
   // lotsa configFile >> stuff
}];
#

Yes its all possible right now with isNils and exitWiths but seeing getOrDefault made me wish for a lazy call version of it

#

Not critical, but a QOL and a bit of performance saver feature

#

(And yeah I get the idea of universal function caching through mission namespace)

unique sundial
#

getAndSetIfDefault

#

getAndSetIfNotExist

#

getSet

#

I like the last one

#

hm getSet [“key”, {code}];

#

or getSet and getSetCall

#

one just gets and sets if not exist another does the same but executes code instead if not exist

#

getSet [key, anything]
getSetCall [key, {anything}]

#

though getSetCall is enough

little raptor
#

no need to set anything automatically

#

let the user do it

unique sundial
#

hashMap getOrDefault [key, defaultValue, setDefault]

little raptor
unique sundial
#

getSet then since there is getOrDefault
getSet [key, {anything}]

unique sundial
little raptor
#

what if you want to get and not set?

#

Sa-Matra's use case is too specific

unique sundial
#

what if what if

little raptor
#

but I can see getOrCall being useful

unique sundial
#

his case is what it will be used for mostly

meager granite
#

Why you'd want execute something and not set it?

unique sundial
#

exactly

little raptor
south swan
#

inb4 callWithMRUCache :3

little raptor
#

you don't always want to set

meager granite
unique sundial
little raptor
unique sundial
#

yes

meager granite
#

yesn't

little raptor
#

then use setDefault true for getOrCall

unique sundial
#

always set otherwise you can test if key exists

south swan
#

"if anything expects the key to be there then it probably should" vs "let's try and see" 🤣

little raptor
unique sundial
#

too many options can get confusing unless they are nescessary

little raptor
#

the option is optional blobdoggoshruggoogly

#

and they can skip it

meager granite
#

What should've been default true is flag in merge

unique sundial
#

getSetCall is ok too getSet is my preference

#

but getSetCall is fine

meager granite
#

I think it needs call in the name to show that it will execute the code, not set the code as value

little raptor
#

tic tac toe

unique sundial
#

u looz

little raptor
# unique sundial u looz

getSetCall sounds like: get value, then set value by code. kinda like what A++ does (get value, then increment)

#

getOrCall explains what it does better: get value, if not exists, call code

unique sundial
#

Anyway semantics @meager granite could you make a ticket plz

little raptor
meager granite
#

flag in the argument does for both

unique sundial
#

yeah lets add more sh*tty names

meager granite
#

Nothing can surpass WFSideText aviator

south swan
#

getOrInit. Except it doesn't say "and returns the new value"

little raptor
#

oh. and getSetCall is not sh*tty?

unique sundial
#

setConstuction

meager granite
unique sundial
#

no it actually describes perfectly waht command does

#

it gets and it sets and it calls code

unique sundial
meager granite
#

getOrDefaultCall to be in line with getOrDefault even more

unique sundial
#

if we do getOrDefaultCall i will add 3rd arg and make it consistent with getOrDefault

#

will make leo happy

meager granite
#

I also think it needs 3rd argument

drifting portal
#

I want to create a unit mid-mission and have it selectable in the multiplayer lobby

hallow mortar
#

There is not

#

You could perhaps selectPlayer with a custom UI if you want to e.g. allow dead players/spectators to reslot, but a) it's sketchy in MP and b) it doesn't change the actual slotting screen

drifting portal
#

well in my case, I wanted to make it so that the pilot would transfer to a ground unit for a single task, then when the task is done he can go back to being pilot
I thought there was a way to disable pilot slot and replace it with the ground unit for a bit, but I guess a JIP script that checks if the event is on and if a player is a pilot then switch the pilot as they select the slot will be sufficient enough

ocean folio
#

trying to figure out how the particle drop function works. Trying to get them to spawn the particles on a specific point, but if I try to make the reference object objNull, I just dont see them spawning at all

#
    drop [
        ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 0, 8],
        "", "Billboard", 1, 3, // animationName, type, timerPeriod, lifeTime
        _location, // position relative to referenceObject
        [0, 0, 0], // velocity
        0, 0.005, 0.003925, 0.1, [4, 4], // rotation, weight, volume, rubbing, size
        [[1, 1, 1, 1]], // colors
        [1], // animationPhase
        0, 0, // randomDirectionPeriod, randomDirectionIntensity
        "", "", // onTimer, beforeDestroy
        objNull // referenceObject
    ];
#

this doesnt seem to spawn anything. If I stick with the wiki example of the reference object being the player, and a fixed position for the position paramater, then it works

south swan
#

position relative to referenceObject

objNull
?

ocean folio
#

from the wiki

If this parameter isn't objNull, the particle source will be attached to the object.

#

I guess it doesnt describe what happens if it is objNull, I just assumed it would use the position itself

#

I may just spawn a barrel or something to use as the reference object

little raptor
ocean folio
#

yeah, it does. But as far as I can tell its relative to the reference object, I dont see much info on what it does when there's no reference object

little raptor
#

no I meant a separate position parameter. looks like I was wrong

#

If this parameter isn't objNull, the particle source will be attached to the object.
it seems to suggest that objNull should work as well

ocean folio
#

yeah, thats what I was thinking

south swan
#

5 position Physical Array format Position
which one, though? notlikemeow

ocean folio
#

I wish the actual docs for drop had comments in the example

#

I might look into using a particle emitter instead of drop. My issue with it was making them spawn randomly in a given area, but particleCircle doesnt seem to do that

ocean folio
#

yes, there's some stuff in there that I cant seem to get working

#

specifically using objNull in the reference object spot

little raptor
#

(which ofc doesn't work with drop)

ocean folio
#

oh lmfao that turtle think is cute

ocean folio
#

interesting

proven charm
#

why isnt the dedi server finding any of the DLLs? is it not supposed to? client finds them....

south swan
#

<offtop> turtle is barely modified sofa 🛋️ </offtop>

proven charm
#

disabled BE

little raptor
#

is the dedi hosted on your own PC?

proven charm
#

yes

little raptor
#

and RPT says extension not found?

proven charm
#

yep

little raptor
#

are you sure you've loaded the mod properly?

proven charm
#

not sure =/

#

im using FASTER. I have ticked the mod for client & server in there

ocean folio
#

is there a way to modify the properties of an individual particle after spawning it?

#

I'm hoping to make the particles fade out instead of just popping out of existence

ocean folio
#

would that effect the specific particle? or all of them?

little raptor
#

all

little raptor
ocean folio
#

mmmm. I think what I'm trying to do might be trying to find a way to mask an engine limitation

little raptor
#

e.g color takes an array

ocean folio
#

oh?

little raptor
#

oh

ocean folio
#

my hope is that at the end of the lifetime, its alpha gets set to 0 over a short period of time

little raptor
#

yes you can do that

ocean folio
#

I have no idea how

#

is it a part of particleArray?

#

I'm thinking of the script fields for onTimer and beforeDestroy, that might not be the right way though

little raptor
ocean folio
#

ohhhh the array of arrays

#

it doesnt actually say what the nested arrays do, is it the starting, middle, and end colours?

little raptor
#

it builds a linear profile with those

#

it doesn't have to be 2 or 3

#

it can be more

ocean folio
#

it just divides it up over the duration. I get it now

#

perfect! thank you so much

meager granite
#

Wish there was a way to disable reassignment of setVariable on respawning units, so much headaches from such a "convenience"

#

If it didn't change lately, these variables on respawned units stop being JIP too

#

Thanks Arma, very cool

opal zephyr
#

allPlayers gets you all playable units including any headless clients. You will have to find some trait that will let you narrow it down to just a single character

#

Get rid of the headless clients with _players = allPlayers - (entities "HeadlessClient_F")

south swan
#

"player" or "all players"? Imagine server with 70 players. Is the intent to do something to each of them or only to specific one?

hallow mortar
#

You can't use player on a dedicated server because it refers to the local player. On a DS there is no local player and it has no way of knowing which of the connected players you're talking about. There is no "the player" to get.
Instead, you need to figure out which unit you're actually talking about and pass a reference to that.

#

If this is remoteExec'd from a client (e.g. [] remoteExec ["my_fnc_serversideFunction",2]) then you can do player on the client and pass that as an argument to retrieve on the server

// on client
[player] remoteExec ["my_fnc_serversideFunction",2];

// in my_fnc_serverSideFunction
params ["_unit"];
createVehicle [_className, _unit, [], 0, "NONE"];```
unique sundial
meager granite
#

You mean if such feature existed?

#

Hmm, difficult question since some mods might rely on this behaviour and simply disabling everything might be too problematic.

#

Listing variables that shouldn't be reapplied is very close to simply resetting them on "Respawn" event handler

#

Just double checked, looks like JIP issue is fixed

#

Still, disabling reapplying of all variables even for specific entities is not THAT useful, might as well add Respawn event handler and reset needed variables yourself.

#

Was mostly ranting that I forget again and again that new entity doesn't mean fresh variable namespace and it bites me in the ass

granite sky
#

Antistasi transfers all the vars manually on respawn and I'm leaving it there because I'm worried that it's working around weird bugs :P

velvet merlin
# velvet merlin will do some measuring of the relevant command set and report back
//diag_codePerformance - ms - count
["units west",[0.041],233]
["units independent",[0.005],40]
["units sideLogic",[0.001],4]
["units sideUnknown",[0.001],0]

["switchableUnits",[0.005],24]
["playableUnits",[0.009],0]
["allPlayers",[0.001],1]
["switchableUnits + playableUnits + allPlayers",[0.014],25]

["entities",[0.038]]
["entities CAManBase",[0.042],251]
["entities SoldierWB",[0.049],232]
["entities SoldierGB",[0.027],19]

["allGroups",[0.009],119]
["allUnits",[0.040],275]
["allDead",[0.032],47]
["allDeadMen",[0.026],45]
["agents",[0.018],2]

["vehicles",[0.012],85]
["entities AllVehicles",[0.051],293]
["entities Cars+Tanks",[0.038],13]

["8 allObjects 1 - Normal entities: vehicles etc",[0.036],2]
["8 allObjects 4 - Out vehicles: objects that are not listed anywhere else, holders, etc",[0.161],2]
["8 allObjects 8 - Vehicle map: ordered vehicles.",[0.001],2]

["nearTargets",[0.159],143]
["targets - west",[0.007],6]
["targets - independent",[0.008],8]
["targetsQuery - sideUnknown",[0.020],17]
["targetsQuery - west",[0.024],17]
["targetsQuery - independent",[0.023],17]
#

would you think its worth caching values fetched from config classes? (to missionNamespace)

#

at what point its also worth to cache units set to a GV even within the same frame?

#

isKindOf check probably also worth to cache

spare vector
#

Anyone ever made a "enter code" to teleport script... example...
player walks up to tablet... enters pin number then it teleports them to room (invisable helipad)
if you have care to share?

open fractal
# spare vector Anyone ever made a "enter code" to teleport script... example... player walks u...

you can make a gui like the examples here https://github.com/ConnorAU/A3UserInputMenus
that calls a function to teleport the player if the input matches

GitHub

Multi-purpose user input displays for use in your missions and mods in Arma 3 - GitHub - ConnorAU/A3UserInputMenus: Multi-purpose user input displays for use in your missions and mods in Arma 3

#

and you don't need a physical object like an invisible helipad to do this stuff idk who keeps telling people this

#

you can right click > copy location data

#

under log

#

or make a game logic entity

spare vector
#

that looks way above my knowlefge level

open fractal
#

what do you want then

#

the github user I linked already did the hard part

spare vector
#

i will look it over thanks

spare vector
hallow mortar
open fractal
#

invisible helipads function as a way for ai to identify landing zones, so it can lead to "why is my pilot landing here?" in the future if it becomes a habit. Niche but it can be avoided by just using a game logic entity instead

#

it's not more complicated at all in fact you can probably find a GL entity quicker in the browser

spare vector
#

by the same token if you are worried about heli landing on your invisable helipad... you can also use empty markers as locations... will function the same way... again your way is not the only way to skin this cat

open fractal
#

all I'm saying is there isn't a reason to use an entity intended for a different function. I've seen tutorials specifically telling people to specifically use this object for no reason

pulsar bluff
#

so what is the correct way to use special symbols in text/

#

for instance, format ["%1 progress at 15%",tag_var];

#

%1 is the tag_var, but 15% is the progress

tough abyss
#

Escape the % symbol.

#

In other languages it's usually \

#

Before the character you want to escape.

pulsar bluff
#

ahh like regex

tough abyss
#

More like every single programming language that ever existed.

#

Excluding ASM and a few esoteric languages.

open fractal
#

I think I tried \ and it didn't work

granite sky
#

yeah, that's the only method I tried that worked.

pulsar bluff
#

nice, glad im not the only one encountering issues like that 😄

granite sky
#

Was kinda expecting %% to work, but it doesn't.

tough abyss
#

Pretty silly there is no escape for strings..

pulsar bluff
#

does stringtable/localization work in mission.sqm?

meager granite
#

It does

#
description=$STR_KOH_LobbyPlayer;
#

3DEN replaces it with plain string on save though

#

So you have to fix it afterwards to be localised string again

pulsar bluff
#

nice ty @meager granite am I able to mix using STR and $STR in stringtable?

#

had some issues with description.ext when using $STR, after using mostly STR for everything else

meager granite
#

No, localised string names must start with STR

#

$ is for configs

unique sundial
shadow canopy
#

I am having a recent issue where I run on impact with ground

_pod attachto[_otherThing,[0,0,1]];
``` where `_pod` is falling very fast (like 50 meters/s) causes `_pod` to go [0,0,0] on map. Is that something thats expected to happen if `_pod` is going fast?
little raptor
#

and what kind of object is that _pod?

shadow canopy
little raptor
#

are you sure it goes to [0,0,0]?

shadow canopy
#

yea, that would be the bottom left hand corner of the map

#

cause after it does go to the corner, if I then run the attachto again, it works fine

little raptor
#

well I mean did you actually see it there?

shadow canopy
#

Yes

#

so I was thinking maybe the speed of the pod for some reason makes attachto freak out, cause this only started to happen recently after 2.10

little raptor
#

does _otherThing go under the ground?

shadow canopy
#

no its at ground

little raptor
#

then report the problem

shadow canopy
#

report the problem?

little raptor
#

yes

#

on feedback tracker

shadow canopy
shadow canopy
#

Okay will do once i wake up lol

pulsar bluff
#
In markers and other Eden Editor fields (e.g Mission Name), translation keys should be prefixed with @, without any quotes around - e.g @STR_myMarkerName. Casing does not matter here either.

unique sundial
frank mango
#

How come I cannot get doArtilleryFire to work in multiplayer?
Have a script (which works as everything else in it works), that gets fired with an addaction.
The script and doArtilleryFire works in singleplayer and on local hosted multiplayer.

hallow mortar
#

doArtilleryFire is Local Argument, which means you need to make sure it runs on the machine where the artillery unit is local. Since it's AI, that's most likely the server, but you can target it automatically by passing a reference to the unit as the remoteExec locality parameter.

#

This isn't an issue in SP or local MP (without other players) because everything is local to your machine.

frank mango
#

So I can just remoteExec in the current script, with the remote exec pointing (a separate script) the doArtilleryFire?

hallow mortar
#

Maybe? I don't know, I haven't seen the script. Almost certainly you need to remoteExec the doArtilleryFire command in particular

frank mango
#

addAction points to script, containing:
remoteExec "Scripts\GunSaluteFire.sqf";

That script is this:

Gun1 doArtilleryFire [getMarkerPos "Fire", "RHS_mag_m1_he_12", 8];
Gun2 doArtilleryFire [getMarkerPos "Fire", "RHS_mag_m1_he_12", 8];
Gun3 doArtilleryFire [getMarkerPos "Fire", "RHS_mag_m1_he_12", 8];```
#

which gave me an error in expression

copper raven
frank mango
copper raven
#

also you shouldn't need to execute this on every machine, only where the GunX are local, which i suppose a single machine should be owning all?

copper raven
#

yeah so

frank mango
copper raven
#

"Scripts\GunSaluteFire.sqf" remoteExec ["execVM", 2]

meager granite
#

was issue with 2d editor too iirc

pulsar bluff
#

it still doesnt address the main issue tho ... stringtable.xml is not read until after player proceeds from lobby

#

so translating text visible in lobby (such as role description) doesnt work

#

only after player connects, then if they abort to lobby they can read the translated text

unique sundial
#

custom stringtable for mission or global one?

pulsar bluff
#

for mission

unique sundial
#

if you set it to any globally localised string it works from the first join?

pulsar bluff
#

im guessing it would since the global would be read at game launch

#

find me global for "Select role ingame" 😄

unique sundial
#

i dunno what one can do mission is not loaded in lobby

pulsar bluff
#

nothing need be done, we have made it this far without

#

TBH i dont use lobby at all, i only have it due to instability of the "skipLobby" option. lobby slots can get bugged and leave client stuck on "Receiving Data" screen

#

without the lobby they are forced into the same bugged slot over and over ... with lobby it allows to navigate around the bugged slot

unique sundial
#

but wait, surely client should already know what mission lobby belongs to since you already have mission.sqm read

pulsar bluff
#

there is some info passed thru, and yes mission.sqm is read when player is in lobby ... just stringtable is not

unique sundial
#

maybe this can be fixed

pulsar bluff
#

stringtable is quite late IIRC

#

you can see when it inits in the log

unique sundial
#

it prints something?

pulsar bluff
#

yea there is something about Unsupported language or Context or somethign

unique sundial
#

i’ll have a look if it is just a simple tweak to move it earlier

pulsar bluff
#

its very low priority imo

unique sundial
#

yeah but still if it is simple enough

pulsar bluff
#

i doubt even raised on the tracker at all in all this time 😄

#

I would like to know more about why client might get stuck on "Receiving Data" when joining particular lobby slots

#

and it is slot based. any player entering the slot gets stuck for a little while, until the slot repairs itself (client ID gets recycled?)

#

without that bug i would use skipLobby

#

unfortunately its a "busy MP" bug which doesnt manifest on test servers

#

im certain its some client ID/owner ID issue where the lobby menu shows an empty (joinable) slot while there is a bugged/losing-connection client still in the slot

#

to start debugging it, id have a look at the code where connecting client evaluates the slot as empty and joinable, and relevant sanity checks

velvet merlin
#

is there a way to determine if Eden with editor is launched (vs without or MP hosted from Eden)?

#

there was one newer sqf to get the mission phase one is in, but cant find it - maybe one can determine it that way

unique sundial
velvet merlin
#

[is3DEN,is3DENPreview,is3DENMultiplayer]
SP: [false,true,false]
SP+editor: [false,true,false]
MP: [false,true,true,]

unique sundial
#

???

#

is3DENPreview is true when you launch it from 3den mp or sp

velvet merlin
#

from all three as shown

#

anyhow solution is:
if (is3DENPreview && (isNull (findDisplay 37)))

velvet merlin
#

is there any point in removing EHs from killed units/vehicles?

copper raven
#

highly doubt it

sudden yacht
#

artillery piece is only firing if player is near it... Dynamic Simulation is off. The artillery piece should be being simulated no matter what. Why? Solutions? [artillery1, target1, "2Rnd_155mm_Mo_Cluster", 10, 2, 10] spawn BIS_fnc_fireSupport;

sharp grotto
sudden yacht
velvet merlin
#

well one can still interact with dead bodies or wrecks via PX

#

might be separate to EHs tho

unique sundial
# pulsar bluff I would like to know more about why client might get stuck on "Receiving Data" w...

I think I know what you mean. If you do not set respawn for units in multiplayer options then if unit dies it is removed from roles list. so you are connected to the server but have no unit to spawn into. May spawn into seagull but I think this has to be somehow configured too. If you dont want ingame respawn you can create virtual units as placeholders that never die and transfer player from them into real units

lime frigate
#

Bit of a weird one, trying to implement something similar to this https://www.youtube.com/watch?v=KOD4nvIWvBE, however because it's a multiplayer mission with respawn enabled with a timer value, the cinematic isn't showing until players have to wait and spawn in. Is there a way to call Intro.sqs beforehand? I've tried putting it into the initServer.sqf which doesn't solve it :/

This is an Arma 3 Eden editor tutorial on how to create an Intro.

Below is a link to the Intro.sqs file in my Dropbox:

https://www.dropbox.com/s/3v8nypo3w23uxds/Intro.sqs?dl=0

▶ Play video
gaunt tendon
#

anyone know how to get the duration of a particular animation from configfile?

EVHTMP = player addEventHandler ["AnimDone", {
  params[ "_Unit", "_Anim" ];
  if(_Anim == "AinvPknlMstpSlayWrflDnon_medicOther") then{
    diag_log (time - START_TIME);
    player removeEventHandler ["AnimDone", EVHTMP];
  };
}];

START_TIME = time;
player playMoveNow "AinvPknlMstpSlayWrflDnon_medicOther";

I can always do this, but I would like to get it from the configfile if possible

willow hound
velvet knoll
#

Anyone happen to have a script that models an IED going off and disables the vehincle without injuring crew?

#

Everytime ive tried it i manually i kill/ maim the crew

open fractal
#

allowDamage

velvet knoll
#

So just in the init for vic i would just type "allowDamage" and i should get the desired effect?

#

When it comes to scripting i know almost nothing

open fractal
#

why put it in the init

#

are you using a trigger or anything for the ied?