#arma3_scripting

1 messages Β· Page 134 of 1

sullen marsh
#

@tough abyss the actual operation of lineIntersects is still the same

proven charm
#

I'm having trouble making the AI man some guns, this is the code i use : _unit assignAsGunner _gun; [_unit] orderGetIn true; but for some reason the AI doesnt always go to the gun and man it, sometimes it just moves a little then stops. idk why it doesnt always work, maybe because there is enemy near or something that confuses the AI. any ideas?

#

i tried these too but no luck: ```
_baseGroup setBehaviour "CARELESS";
_baseGroup setCombatMode "BLUE";
_baseGroup enableAttack false;

granite sky
#

Vanilla, SP?

proven charm
granite sky
#

close enough

#

Are these AIs in their own group or what?

proven charm
#

yeah all in one group

granite sky
#

No, I mean are they individuals with their own group, or do they have a leader?

proven charm
#

they have leader (AI leader)

proven charm
bleak mural
#

which static?

proven charm
#

vanilla such as "B_HMG_01_high_F"

bleak mural
#

test with disabling the unit in questions visibility check,then reenable once manned

#

rule out if its enemy thats causing it(actually for whole group)

#

as leader will share contacts

proven charm
#

yeah i was thinking the same. do you have some command in mind that I could try? (already tried something like this)

bleak mural
#

this disableAI "CHECKVISIBLE" in the group init

#

im not certain this checks for vehicles or just enemy though i havent tested. if includes vehicles then might not work UNLESS wp is given right on top of static as that check starts after a meter i think or so of distance

proven charm
#

tried that with all units but no luck

#

two guys ran to man the guns but like 5 just stands there

bleak mural
#

im not sure if its related, but might be a bug and related to this i found the other day

#

as it relates to turrets specifically

proven charm
#

hmm

bleak mural
#

as the behaviour of AI moving then stopping indicates its trying to complete the action, then doesnt,isnt normal unless a pathing issue

#

im sure you ruled out pathing issue right?

winter rose
#

waitUntil _unit distance _turret < 2
_unit moveInGunner _turret

boom πŸ˜„

bleak mural
#

lol

#

was thinking this too but didnt consider the hacky waituntil

#

seemless solution

#

being on a static anyway means youve a short life expectency anyway

proven charm
bleak mural
#

another solution if the function exists would be to set his position,then have him "assemble" a static weapon

hallow mortar
proven charm
#

the weapons are already in the base just waiting to be manned

#

they dont react to domove either...

bleak mural
hallow mortar
#

No.

proven charm
#

nope you can give the move position

hallow mortar
#

doMove has them move to an arbitrary position. If they're not the group leader, they will move back to the leader after completing the move, but they should still do the move to begin with.

bleak mural
#

sorry to derail you, i just noticed my init and playerlocalinit, wasnt working correctly, and realised its because this line was being called:

#
while {true} do
{
if (player != vehicle player) then 
    {
    playmusic format ["RadioAmbient%1",floor (random 31)];
    };
sleep random 60;
};
#

if i move it to bottom of the init everything works ok. why is that?

hallow mortar
#

The while loop never finishes, so everything after that is never executed.

bleak mural
#

wow i didnt know that.

hallow mortar
#

If you want to have the while loop start earlier but not delay everything else until it's finished, you need to spawn it into a separate thread.

bleak mural
#

such as a player init?

hallow mortar
#

Did I say "player init" or did I say spawn?

bleak mural
#

spawn πŸ˜„

#

could you give small example?

#

im not sure how to spawn sth into a seperate thread

hallow mortar
bleak mural
#

thanks

fair drum
#

Did you try working with the music eh yet?

bleak mural
#

ontop of that theres so many errors..errors for days and im tryna understand all

proven charm
#

i found out what the problem was πŸ˜„ the ai got stuck because of those grass cutter objects (Land_ClutterCutter_large_F) which are invisible though

#

now how Im supposed to mow the lawn 😲

winter rose
#

huh, weird that it has any impact on pathfinding!

bleak mural
proven charm
proven charm
#

maybe creating grass cutter only on clients and not server avoids the path finding problem (which im doing right now)

#

but with server and client on same machine it definitely doesnt work

#

then again player's AI probably has the same problem

bleak mural
#

in general i mean

proven charm
#

CTI, using cutters to remove grass from base

hallow mortar
#

It would be cool if there was a command for grass cutting rather than having to rely on objects

drowsy geyser
#

is it possible to use a chat type other than systemChat for the "connected/disconnected" message?

#

or change its position?

flint topaz
drowsy geyser
#

just found out you can disable systemChat with disableChannels via description.ext

#

but there is no channel ID for systemChat does that mean its not possible?

hallow mortar
#

System chat is for system messages, including important ones. You can't disable it.

drowsy geyser
#

cant change its position too?

hallow mortar
#

It's displayed in the normal chat panel. You can change its position to the same extent that you can change the position of the entire chat panel.

drowsy geyser
#

i mean change it by script in mp

hallow mortar
#

The answer is the same. It's still displayed in the normal chat log in the normal chat panel. It's not a separate element. If you can move the chat panel then that will move where system chat is displayed; otherwise no.

#

Well, I linked to handleDisconnect there by accident, just scroll up

drowsy geyser
#

ok thanks a lot,i'll take a look

hallow mortar
#

Please let us know if you find out that 16 really is the channel ID for systemChat. It should be added to other lists of channel IDs if it's true, not hidden away in the handleChatMessage entry.

flint topaz
#

I made something recently that uses handleChatMessage and when I was hinting what params were provided it did say 16 for systemChat messages

hallow mortar
#

That'll be awkward if that ticket for more custom channels ever goes through :U

still forum
#

Disabled channels config, only disables the UI afaik.
It wouldn't hide messages in these channels

sharp grotto
# hallow mortar Please let us know if you find out that 16 really is the channel ID for systemCh...

Channel 16 is indeed for systemChat
I used it to hide connect messages etc.

params ["_channel", "", "", "_text", "_person"];
private _senderUID = getplayerUID _person;
if(_senderUID in ExileCLientMutedPlayers) exitWith{true};
if(_channel == 16) then 
{
    _ltxt = toLower _text;
    {
        if(_ltxt find _x > -1)exitWith{true};
        
    } forEach [
    
        [localize "STR_MP_CONNECTION_LOOSING", " "] call BIS_fnc_splitString select 3,
        [localize "STR_MP_VALIDERROR_2", " "] call BIS_fnc_splitString select 2, 
        [localize "str_mp_connect", " "] call BIS_fnc_splitString select 2,
        [localize "str_mp_connecting", " "] call BIS_fnc_splitString select 2,
        [localize "str_mp_disconnect", " "] call BIS_fnc_splitString select 2,
        "modified",
        "requirements",
        "signed",
        "allowed",
        "query",
        "publicvariable",
        "signature",
        "required",
        "got scared"
    ];
};
candid sun
#

I take it there's no way to apply post-processing to ui controls?

oblique arrow
#

popcorneating playing around with vfx/sfx now, easer to use than I thought it would be although i havent reached the level I want to yet

#

tl;dr of how it works is just a few of these πŸ˜„

_pie_pp_roof_smoke_helper_2_emitter = "#particlesource" createVehicleLocal getPos pie_pp_roof_smoke_helper_2;
_pie_pp_roof_smoke_helper_2_emitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal",16,12,13,0],"","Billboard",1,10,[0,0,0],[0,0,0],1,1.35,1,0.1,[3,6],[[0.5,0.4,0.3,0],[0.4,0.4,0.3,0.1],[0.5,0.4,0.3,0.08],[0.5,0.4,0.3,0.04],[0.5,0.4,0.3,0]],[1000],0.1,0.15,"","","",0,false,0,[[0,0,0,0]]];
_pie_pp_roof_smoke_helper_2_emitter setParticleRandom [4,[1.5,1.5,0.5],[0.9,0.9,0.9],20,1.5,[0,0,0,0],0,0,1,0];
_pie_pp_roof_smoke_helper_2_emitter setParticleCircle [0,[0,0,0]];
_pie_pp_roof_smoke_helper_2_emitter setParticleFire [0,0,0];
_pie_pp_roof_smoke_helper_2_emitter setDropInterval 0.022;
austere granite
#

Correct

candid sun
#

:'(

austere granite
#

PP only works on normal vision, plus in nvgs these days. Doesn't even work if you have thermal sights open

#

Or at least not colorCorrections

candid sun
#

i guess it's the same with 3D control models too?

austere granite
#

Anyone know a way through which I can cancel combat pace? Switching from combat pace to the dragging anim gets you stuck in place

#

@candid sun I think so, not sure

candid sun
#

that's a damn shame

sharp grotto
marsh moat
#

Hey y'all. Trying to make an ACE Arsenal Extended compat mod for a group. However I get an error when I launch it. When I go into the file itself the line it says there's an error on doesn't even have an "A" in it for it to read so I am not sure what to do here. It's breaking the mod but I can't seem to fix it.

#

Here's the associated code lines.

class Rogue_MarineArmour1
{
    options[] = { "Lower Armour", "Pouches", "Upper Armour" }; // Always computed, do not edit
    label = "[150th]";
    class Lower Armour
    {
        label = "Lower Armour";
        alwaysSelectable = 1;
        values[] = { "Green", "Marine", "Mixed", "ODST", "Tan" }; // Always computed, do not edit
    };
    class Pouches
    {
        label = "Pouches";
        alwaysSelectable = 1;
        values[] = { "Grey", "Tan" }; // Always computed, do not edit
    };
    class Upper Armour
    {
        label = "Upper Armour";
        alwaysSelectable = 1;
        values[] = { "Green", "Marine", "Mixed", "ODST", "Tan" }; // Always computed, do not edit
    };
};
granite sky
#

class Lower Armour

#

You can't have spaces in the middle of classnames

brave venture
#

^ classes are one word. So use Lower_armor instead

#

same for upper armor

marsh moat
#

Okay, that's an issue on the way I configured the other app that generated this. It's not clearly labled it's for a classname so I had no idea that's what it was asking for. Much appreciated! I'll fix it and see if it works

granite sky
#

This is really a #arma3_config thing btw, so if you have further issues you should ask there.

marsh moat
#

My bad. I didn't see that at first, noted for the future though! Thanks

brave venture
#

Does anyone know of a way to return the memory points that control a specific selection in an object?

granite sky
#

I don't think there's any way to get all the points. selectionPosition gives you the options of first point, average point or bounding box.

hallow mortar
#

I think there's a 2.18 command that gets you the bones associated with a selection

brave venture
#

yup. getselectionbones. Which is exactly what I need, but I don't want to have to wait, 3, 6, 9 months, a year plus even for it to be added.

#

But it looks like I have to so...

hallow mortar
#

2.18 is expected to be relatively soon; it was reported as being spring-summer 2024

dapper cairn
#

Might be the wrong channel but does anyone know why my inf loadout isnt changing? I exported from the ace arsenal and dont recall what I have to do but I thought I just threw the info into the units init

[[[],[],[],["rhs_uniform_gorka_r_g_gloves",[]],["MBSS_Ranger_v2_1",[]],["TFL_Drybag",[]],"airframe_cover_4_ComtacIII_Arc","clary_avonfm53_black",[],["ItemMap","ItemGPS","TFAR_anprc152","ItemCompass","TFAR_microdagr",""]],[["ace_arsenal_voice","ACE_NoVoice"],["ace_arsenal_face","WhiteHead_11"],["aceax_textureOptions",[]]]]

granite sky
#

If it's a unit loadout array then this setUnitLoadout [array goes here]. I'm not sure if ACE exports normal unit loadout arrays though.

dapper cairn
#

so im trying to figure out a script for mp for when a player goes through a trigger it fades to black and removes their gear then fades back in, I have the fade script figured out (dont know how to do the script boxes yall do) but how would I remove the gear on a trigger?

dapper cairn
#

Getting "missing }" on this block and i have no idea where its supposed to sit at

removeLoadout = {
    _unit = _this select 0; // Get the player entering the trigger
    removeAllItems _unit;   // Remove all items from the player's inventory
    removeAllAssignedItems _unit; // Remove all assigned items (uniform, vest, backpack)
};
oblique arrow
dapper cairn
#

yeah just did and it went through

#

sorry

oblique arrow
#

All good, sometimes it happens πŸ˜„

dapper cairn
#

and still isnt doing what i need fuuck

dapper cairn
sharp grotto
dapper cairn
dapper cairn
#

ok

dapper cairn
dapper cairn
#

no idea what im missing

fleet sand
# dapper cairn no idea what im missing

try something like this note not tested:

{
    if(_x isKindOf "CAManBase" || isPlayer _x) then {
        [_x] spawn {
            params ["_unit"];
             1 fadesound 0;
             private _layer1 = "normal" cutText ["", "BLACK OUT"];
            sleep 1;
            _unit setUnitLoadout (configFile >> "EmptyLoadout");
            2 fadesound 1;
            sleep 1;
            _layer1 = "normal" cutText ["", "BLACK IN", 1];
        };
    };
}foreach thisList;
dapper cairn
proven charm
#

I wish there was a way to known when the grass cutters (Land_ClutterCutter_large_F) have done their job. then you could delete them.

winter rose
#

does it not fix the issue if you create them as simple objects?

proven charm
#

have to try that

meager granite
proven charm
proven charm
meager granite
#
  1. You didn't delete it or had another one.
  2. You wasn't away long enough
little raptor
#

you didn't move far away enough

meager granite
#

Or far enough, yes

winter rose
#

near, far, whereeever you are… 🎡

little raptor
#

the grass cutters don't "cut" the grass. they prevent the clutter generator from generating the clutter there

#

and clutter information is not stored for the entire terrain. only a small area around the camera is stored in cache

#

when you move away the cache gets overwritten

proven charm
#

hmm havent yet been able to repro that. I have the cutters on one side of island (Malden) and teleported to other side

#

ill try altis

#

seems to work. im using deleteVehicle to delete the cutters (simpleObject)

proven charm
#

yep im seeing it now, with enough cutters the grass comes back

#

so i just leave the cutters there 😐

meager granite
#

I wonder if its possible to create own grass cutter model of custom size to use with createSimpleObjects, to avoid creating lots of small ones?

proven charm
#

a very good idea, maybe inherit from one of the existing cutters. no clue what determines the size though

little raptor
meager granite
#
Searching 888 files for "bullshit"
40 matches across 14 files
rich frost
#

anyone worked with hashMapObjects before?
trying to confirm the observation:
_self = nil; doesnt work from inside a hmo's method, right?

little raptor
#

"doesn't work" as in what? it undefines the variable if that's what you're trying to do

rich frost
#

im trying to trigger the #delete deconstructor

little raptor
#

setting something to nil doesn't destroy it

#

it gets destroyed when it's no longer being referenced

rich frost
#

so i would need to remove the reference from the GVAR i referenced it in?

little raptor
#

anywhere it's referenced

rich frost
#

yea

#

would _self call ["#delete",[]]; work?
Or would that just execute the deconstructor while keeping the hmo alive?
And if I remove the remaining references from the #delete, it would re-call the deconstructor?

little raptor
#

_self call ["#delete",[]]; work?
it should. it's just a method

#

Or would that just execute the deconstructor while keeping the hmo alive?
yes

#

if I remove the remaining references from the #delete, it would re-call the deconstructor?
I don't understand what you mean

rich frost
#

sry

i have that HMO inside a gvar, nowhere else.

if i would just manually call #delete,

and inside #delete i do missionNamespace setVariable [GVAR(xyz), nil];
that would call #delete again "by default", right?

little raptor
#

it doesn't call #delete by itself, but it will get called afterwards I think

rich frost
#

Oke, i see what i can achieve.
There isnt much info about hmObjects on the wiki, so thanks alot! πŸ™

little raptor
#

I don't know why you're trying to delete a var like that tho. #delete is meant for cleaning up the resources created by the hmo

#

if you're trying to delete the hmo, just remove its references (like that missionNamespace setVariable [GVAR(xyz), nil];)

knotty gyro
#

What was the preferred method of posting large texts? Dropbox?

little raptor
#

pastebin

rich frost
#

pastebin or github gist would be suitable i guess

rich frost
analog mulch
#

hello,

i have a helicopter "h1" and want it to lift a supply crate "c1", wut do i write in the trigger condition that detects if the cargo has been lifted successfully?

little raptor
#

getSlingLoad h1 == c1

knotty gyro
#

So, if you guru's would have a peek on this and tell me how to make it MP compatible if it isn't good as is already. Much appreciated.
https://pastebin.com/S48s6LhH

fair drum
knotty gyro
#

Because I don't know how to?

#

Look, consider me a total noob. I used to be half decent in A1 and A2, but been out of the game and editing stuff for about 10 years or so....

#

The instructions are basically for others, and a text file is so much easier to share and send about than special files. I like simplicity.. πŸ™‚

fair drum
#

Just something to consider. If you are going to use a bunch of editor objects like that, you could make a composition and write the code in the inits of that composition. Then to share it, they just subscribe to it and they just place it down in the editor.

knotty gyro
#

lol sounds so easy, but it's all new to me.

fair drum
#

The composition also brings over trigger code too

knotty gyro
#

cool

#

I'll have a look at it whenever time allows. This adulting shit is a trap. Don't do it!

fair drum
#

32 y/o in the world of cardiac. I get it lol.

Compositions are meh for sharing with experienced people but great for sharing with laymen.

exotic flame
#

Hum, i think there is a glitch that needs to be reported:

  params ["_entity"];  
 }];```Why does this code return an unknown enum value: EntityDeleted ?
granite sky
#

2.18

exotic flame
knotty gyro
#

Is there anywhere to get more info on BIS_fnc_counter? The biki is woefully lacking

hallow mortar
#

You can open it in the Functions Viewer and see what it actually does. But it looks like it's pretty simple - increment the value of variable x by number y.

#

Hazard a guess it essentially does

private _oldCount = missionNamespace getVariable [_givenVarName, 0];
private _newCount = _oldCount + _givenValue;
missionNamespace setVariable [_givenVarName, _newCount];

Not sure if global but that should be easy to see from looking at the code

knotty gyro
#

well, what I'm looking to achieve is a counter that keeps track of x amount of evidence objectsa collected

#

so basicallay, in a trigger I set the condition !alive ev1 (example)
What I need is te counter to trigger when the ammount of ev has reached say 6 objects (named ev1....ev6)
How would I then configure the onAct of the corresponding trigger?
sqf evicount=[0,1,0] call BIS_fnc_counter; or something else?

hallow mortar
#

The counter is just a variable containing a number. You can call the function to update the number or retrieve its current value. It does not "trigger" at a certain threshold - it's up to you to check the counter's value and detect when it's over the value you want, using maths operators like >=

#

Also, the wiki page does describe the syntax for using the function and it's not close to what you've written there

#

The function is almost certainly literally just a convenience wrapper for getting a variable and adding y to its value, as I showed before. Simply imagine that the text BIS_fnc_counter is replaced with the code example I posted, and you should figure out how to use it.

winter rose
hallow mortar
# winter rose https://community.bistudio.com/wiki/BIS_fnc_counter filled, F5

I've checked the code and it is essentially Local Effect - non-broadcasting syntax of setVariable is used. Probably worth adding.
Also, the modulo value is used after adding the main value:

private _var = (_varSpace getVariable [_varName, 0]) + _add;
if (_mod > 0) then {_var = _var % mod};```
I think it'd be good to describe that more specifically than "counter cycle", but I'm not sure how because I don't really understand what it's meant to be for
winter rose
#

like 0, 1, 2, 3, 4, repeat, 0, 1 etc

#

done, along BIS_fnc_deleteCounter

tribal axle
#

Hello, I'm quite new to Eden, scripting itself and I'm wondering if there would be any sort of script where I'd be able to apply certain attributes to specific slots and from their making them able to access a specific arsenal, different for each slot, I know there's some game modes with this and I'm wondering if there would be any guides/resources or even a script I'd be able to modify myself to achieve this.

knotty gyro
#

Well, I got it working, I am very grateful for your help. I'm using onmap triggers. Superthanks guys!!

ocean folio
#

Is there any way to get data from the existing CCIP calculation for bombs?

#

Specifically getting the impact point coordinates

dapper cairn
#

{ removeAllWeapons _x } forEach thislist;
{ removeAllAssignedItems _x } forEach thislist;
{ removeUniform _x } forEach thislist;
{ removeHeadgear _x } forEach thislist;
{ removeVest _x } forEach thislist;
{ removeBackpack _x } forEach thislist;
{ removeGoggles _x } forEach thislist;

hint "it worked!";

so this works for removing gear from a unit but its only one unit even with repeatable set for the trigger. How would I go about having it do it to each player that passes through?

#

would I have to give each unit a name and list them down or something?

dapper cairn
#

nevermind, just need to space out the timing on the units passing through

woeful sundial
#

can i detect if a zeus is controlling an AI? is there a variable or a function?

manic kettle
leaden summit
#

I'm spawning in 2-4 random items (basically clutter around an IED object) and want them to be as close as they can be to the IED object but obviously without clipping and sending the object to orbit. Spawning them in with "NONE" instead of "CAN_COLLIDE" puts them too far apart I assume due to their bounding box.
I know I can try some shenanigans with the bounding box but I was wondering if anyone has done something similar before
This is basically what I have https://imgur.com/XqKlPFW but I would like everything bunched up a lot more

fair drum
#

that reminds me, I don't think we have an engine command that gets the relative position compared to another object WITHOUT having it attached

vapid spoke
#

anyone know a script to ace interact an object and allows players to restart the server?

oblique arrow
vapid spoke
#

its a close friend group just need a script for when i cant log in

oblique arrow
#

Ah fair

ornate whale
#

Is it possible to catch the event of a bullet hitting a surface/ground and its impact position?
And is it possible to calculate how close the bullet flown by a target? Thanks

ornate whale
little raptor
#

hitpart

ornate whale
#

Is there any other way to work with the ballistic curve other than via suppressed event or doing some heavy computation on every frame?

drifting spire
#

Is it at all possible to find the classnames of all vehicles available to a side?

#

Including modded?

fair drum
leaden summit
#

When you spawn a unit is the name not randomized?
I'm using ```SQF
_groupTarget = createGroup east;
_target = _groupTarget createUnit ["O_Soldier_unarmed_F", _targetHome, [], 0, "FORM"];

astral tendon
#

Does anyone knows how to get a list of all β€œAnimationSources” of any object?

meager granite
meager granite
leaden summit
#

Ok yeah I was just about to say I just saved and reloaded the mission and it changed for the first time in ages.
Is there a way to access the name list for the different races so you can set it yourself?

leaden summit
#

Ok sweet thanks as always

meager granite
#
// Params: Side
// Returns: String
client_func_killFeed_getRandomNameBySide = {
    private _cfg = configFile >> "CfgWorlds" >> "GenericNames" >> (switch(_this) do {
        case blufor: {"NATOMen"};
        case opfor: {"TakistaniMen"};
        case independent: {"GreekMen"};
    });
    format ["%1 %2", getText selectRandom configProperties [_cfg >> "FirstNames", "true"], getText selectRandom configProperties [_cfg >> "LastNames", "true"]]
};
```Here is a simple function I used to quickly generate names for 3 main sides
#

You can get an idea from it

#

I hate this new font for code blocks in Discord 😠

leaden summit
#

Oh awesome, thanks for that, it'll save me some work

manic kettle
#

Anyone have any input on the most reliable way to determine who destroyed a building? Unfortunately it seems entity killed doesn't always trigger

meager granite
#

If you had Killed on alive building and then it got swapped to ruins or damaged version your EHs wont be on it

#

you'll need to add them again on BuildingChanged

manic kettle
meager granite
#

I'm not 100% sure when and hwat triggers but Killed should only trigger on final destruction when building sinks and spawns ruins, I think?

manic kettle
#

Yes i think thats correct

#

at least from my testing

meager granite
#

Alternatively, add HandleDamage and store last source/instigator in a setVariable and then getVariable it when needed

manic kettle
#

well i imagine a simple killed EH would work fine too... maybe? but i hesitate adding EH to several thousand buildings on the map...

#

lmk if i shouldnt be

meager granite
#

Yeah, adding EHs to lots of buildings doesn't sound like a good idea πŸ€”

#

I guess checking lastEntityCausingDamage inside BuildingChanged wouldn't been perfect for you

#

Also there is much less heavy EH Hit which should not trigger for every single little thing

manic kettle
#

i think that should be fine in theory, but i'd have to wait until 2.18 haha. Which if thats the only way so be it.
Other option is if i could run the code from the players end rather than every building

meager granite
#

Still you'll have to add it to all buildings everywhere

#

You want map-placed buildings, right?

manic kettle
#

yeah

meager granite
#

Wild idea, start from shooter side:

#
  1. Add FiredMan to all your units.
  2. Add HitPart and HitExplosion to each fired projectile.
  3. Add SubmunitionCreated to each projectile which also adds HitPart and HitExplosion to each new projectile created.
  4. Then on HitPart and HitExplosion check if target is a building with isKindOf, getObjectType, etc.
  5. If its a building, add HandleDamage to it (check if its not already there).
  6. Since projectile HitPart and HitExplosion triggers BEFORE HandleDamage, it might also instantly trigger newly added HandleDamage and you can properly determine the shooter (and also setVariable it)
#

With HandleDamage you get much finer control over damage, you'd even able to detect when somebody breaks a single window

#

But also get source/instigator from HandleDamage on BuildingChanged

#

All in this, this method should work, but there are 3 nuances:

#
  1. I did not test step 6, it should work in theory but needs checking if it actually works, can you add HandleDamage from HitPart and have it also instantly trigger?
  2. This HitPart->HandleDamage trick will only work for map-placed objects (getObjectType = 1) becuase they're local to each client at the same time. For editor-placed/spawned objects (getObjectType = 8) you'll need to have HandleDamage added right away for this method to work.
  3. Never change damage of map-placed objects with HandleDamage, make sure event always returns nil, this damage change is not JIP compatible and desyncs the game
#

This method is difficult, but if step 6 works, its doable and will cover damage handling of entire map without having to scan whole island and add shitton of EHs

#

You can trigger FiredMan addition to all units from EntityCreated on server side, check if newly created object is a unit (simulation=man/uavpilot), then broadcast something so all clients and JIPs add their own FiredMan

manic kettle
#

think360 big brain but many parts to this. I'll have to think on it
But thanks for the idea

meager granite
#

(I already do pretty much all this except HandleDamage to buildings btw)

#

Tested step 6, it works

#

With this method you can add HandleDamage to buildings that were ever hit

#

Chat shows FiredMan and subsequent HandleDamage that was added from inside of projectile's HitPart

meager granite
#

Code bit to hint all task icons since wiki page doesn't have all listed:

    _compose = [];
    {
        _compose pushBack (composeText [formatText [if(_forEachIndex % 2 == 0) then {"%2 %1"} else {"%1 %2"}
            ,configName _x
            ,image getText(_x >> "icon")
        ]] setAttributes [
            "align", if(_forEachIndex % 2 == 0) then {"left"} else {"right"}
        ]);
        if(_forEachIndex % 2 == 1) then {_compose pushBack lineBreak};
    } forEach ("true" configClasses (configFile >> "CfgTaskTypes"));
    hint composeText _compose;
winter rose
#

export script?

muted junco
#

I'm trying to create a mod or script that allows you to attach a Map Marker to a person, vehicle, or object and will move the map marker according to the position of that object. My intent for this is such that you can walk up to a vehicle (hostile, friendly, etc), ACE-Interact with said vehicle, and create a marker or attach an item to it, and then edit that marker (either in that menu or on the map after attaching the item) to change its icon, name, and channel.

Does anyone know if this has already been done? If it's possible? And, if so, can anyone help me out or point me in the right direction for how to do something like that?

marsh storm
#

Hey guys, I'm looking for some script to mark on the map the location of a backpack even when it's being worn or in a vehicle

#

Is this something that is possible?

indigo snow
#

not trivially

knotty gyro
hybrid finch
#

anyone know why ragdoll mods conflict with ace

#

i shoot a guy

#

he is stuck in unconcious pose

#

even when dead he spins around and stuff

#

how can i solve this?

sullen sigil
#

yes, dont use ragdoll mods

hybrid finch
sullen sigil
#

i mean yes dont use ragdoll mods

faint oasis
#

Hi, i have a question ? Is it possible to get the group stance ? because i'm not able to find a command that does like what i'm doing inside the zeus. I mean when you change the stance of the group, all the units inside that group will go in the position you said. Maybe it is doing "setunitpos" for all of them but i'm not sure.

indigo snow
#

best way is probably to use the take and put event handlers and save a reference to the carrying player that way

#

or use a unique backpack (unique classname) and keep scanning for that

sudden yacht
#

@faint oasis you could get the group leaders animation instead. That might work.

faint oasis
versed belfry
#

Quick question, I have a feeling the answer is yes.

Is it bad that I'm using this many remoteExecs for a script from the server?

if (AET_inRange) then {
    deleteVehicle CNSL_1;
    CNSL_2 hideObjectGlobal false;

    ["Layer_Elevator_Background", ["", "BLACK OUT", -1, true, false]] remoteExec ["cutText", -2];

    [0, 0] remoteExec ["fadeRadio", -2];
    [0, 0] remoteExec ["fadeSound", -2];

    [] spawn {
        sleep 5;

        ["Layer_Elevator_Text", ["<t size='2'>Demons, Monsters. One way Ticket.</t>", "PLAIN", 5, true, true]] remoteExec ["cutText", -2];
        ["elevator"] remoteExec ["cutText", -2]

        private _tplist = ["P_1", "P_2", "P_3", "P_4", "P_5", "P_6", "P_7", "P_8", "P_9", "P_10"] call HR_fnc_ValidateObjects;
        private _poslist = [PTP_1, PTP_2, PTP_3, PTP_4, PTP_5, PTP_6, PTP_7, PTP_8, PTP_9, PTP_10];
        private _playerCount = count _tplist;
        
        for "_i" from 0 to _playerCount do {
            private _currentPlayer = _tplist select _i;
            private _currentPos = _poslist select _i;
            _currentPlayer setPos (getPos _currentPos vectorAdd [0, 0, 0]);
        };

        sleep 20;

        ["Layer_Elevator_Background", 5] remoteExec ["cutFadeout", -2];
        ["Layer_Elevator_Text", 1] remoteExec ["cutFadeout", -2];

        ["dynamicBlur", true] remoteExec ["ppEffectEnable", -2];
        ["dynamicBlur", [6]] remoteExec ["ppEffectAdjust", -2];
        ["dynamicBlur", 0] remoteExec ["ppEffectCommit", -2];
        ["dynamicBlur", [0.0]] remoteExec ["ppEffectAdjust", -2];
        ["dynamicBlur", 5] remoteExec ["ppEffectCommit", -2];

        [5, 1] remoteExec ["fadeRadio", -2];
        [5, 1] remoteExec ["fadeSound", -2];

        sleep 5;

        [missionNamespace, "AET_ElevatorDone", []] call BIS_fnc_callScriptedEventHandler;
    };
    
    [missionNamespace, "AET_ElevatorDone", {["dynamicBlur", false] remoteExec [ppEffectEnable, -2];}] call BIS_fnc_addScriptedEventHandler;
} else {
    ["All players must be on the elevator!"] remoteExec ["hint", -2];
};
bleak mural
#

Revive mods add their own handling of animation

#

obviously will conflict

marsh storm
#

Yeah, I thought that it wouldn't be a trivial thing :/

hallow mortar
fair drum
versed belfry
marsh storm
#

Hmm.

hallow mortar
#

Just make the teleport operate locally too. No particular reason it has to be server side.
Generate the list of players in the TP zone on the server as before, then use that array as the remoteExec target parameter for the function, instead of -2. Then you can use player in the local function to teleport the appropriate players.

versed belfry
#

1 min

hallow mortar
#

Couple of small items:

  • it's recommended to use the ATL/ASL versions of setPos and getPos, not the "plain" ones. They are faster and have consistent position formats with no loss in translation.
  • you're doing vectorAdd [0, 0, 0] on a position, which is genuinely completely pointless.
versed belfry
# hallow mortar Couple of small items: - it's recommended to use the ATL/ASL versions of setPos ...

If you have a moment to give me your opinion it would be appreciated :D

Initial Script to be called from action

if (AET_inRange) then {
    deleteVehicle CNSL_1;
    CNSL_2 hideObjectGlobal false;

    [] spawn {
        private _tplist = ["P_1", "P_2", "P_3", "P_4", "P_5", "P_6", "P_7", "P_8", "P_9", "P_10"] call HR_fnc_ValidateObjects;
        ["Layer_Elevator_Background", ["", "BLACK OUT", -1, true, false]] remoteExec ["cutText", _tplist];
        sleep 5;
        ["Scripts\elevatorscreen.sqf"] remoteExec ["BIS_fnc_execVM", _tplist];

        private _poslist = [PTP_1, PTP_2, PTP_3, PTP_4, PTP_5, PTP_6, PTP_7, PTP_8, PTP_9, PTP_10];
        private _playerCount = count _tplist;
        
        for "_i" from 0 to (_playerCount - 1) do {
            private _currentPlayer = _tplist select _i;
            private _currentPos = _poslist select _i;
            _currentPlayer setPosATL (getPosATL _currentPos);
        };
    };
    
} else {
    ["All players must be on the elevator!"] remoteExec ["hint", -2];
};

The effects and Transition script:

if (hasInterface) then {
    [] spawn {
        0 fadeRadio 0;
        0 fadeSound 0;
        sleep 5;

        "Layer_Elevator_Text" cutText  ["<t size='2'>Demons, Monsters. One way Ticket.</t>", "PLAIN", 5, true, true];
        playSound "elevator";
                
        sleep 20;

        "Layer_Elevator_Background" cutFadeout 5;
        "Layer_Elevator_Text" cutFadeout 1;

        "dynamicBlur" ppEffectEnable true;
        "dynamicBlur" ppEffectAdjust [6];
        "dynamicBlur" ppEffectCommit 0;
        "dynamicBlur" ppEffectAdjust [0.0];
        "dynamicBlur" ppEffectCommit 5;

        5 fadeSound 1;
        5 fadeRadio 1;

        sleep 5;
        [missionNamespace, "AET_ElevatorDone", []] call BIS_fnc_callScriptedEventHandler;
    };

    [missionNamespace, "AET_ElevatorDone", {"dynamicBlur" ppEffectEnable false;}] call BIS_fnc_addScriptedEventHandler;
};
meager granite
bleak mural
#

is there any possible way that you can add a repair function(exactly like is on the Huron repair container) to any random supply crate/box? in my scenario, iv just discovered the Mowhawk isnt able to sling load the huron repair crate,so i was hoping it could be as simple as adding the hurons repair functionality to a smaller crate in the editor

fair drum
bleak mural
#

il retexture it

#

damn it

#

seems AI of NATO wont use an East side repair pod

#

odd as the player automatically repairs at it

#

i would think thats an oversight by bohemia. why is independant out of options to slingload vital supplies?

winter rose
bleak mural
#

so it seems that resupply crates(NATO vehicle ammo) if having its simulation disabled at mission start/hidden then shown,then simulation enables/shown , looses its ability for AI to rearm at

#

im not sure if this is somehow engine limitation,intentional or actual bug

#

this issue isnt present on repair / resupply vehicles by contrast

fair drum
#

you are disabling the simulation on init?

#

before simulation starts?

spiral trench
#

mod or mission @marsh storm

marsh storm
#

Mission, @spiral trench

bleak mural
# fair drum you are disabling the simulation on init?

pardon me, my head is spinning from the damn AI today. infact,the error i described is innacurate, the actual issue isnt that the ressuply crate doesnt work,its simply that the AI wont recognise it after simulating. im using the show/hide module which visibly hides the object and makes invisible and disables its simulation, so ,at mission start have it hidden,then it shows via a condition,reenabling its simulation. But evidently because it wasnt available at mission start AI doesnt seem to recognise it anymore

#

id still call it a bug, but considering typical AI and AI vehicle behaviour..id say par for the course

fair drum
#

so since its hidden at start due to the module firing before the mission simulation starts, can you try hiding it a frame or two later? then see when you show it again if the AI pick it up?

bleak mural
#

i believe once you hide it,then show it,it cant be hidden again

#

was the case before but good point, il try now

#

ahhh good enough, your right it can work that way

#

few years ago for whatever reason that was not working,but it seems you can now swing back and forth with those modules and conditions

#

general performance question. is using attachto,with triggers heavy on the cpu?

spiral trench
#

Is it just one backpack to be tracked? So say the backpack starts on the ground at mission start, it is shown on the map. If a player were to pick up said backpack the marker would now update as the player moves, again if they were to then place it in a vehicle the marker would update?

bleak mural
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
bleak mural
#

iv got:

#
{if(_x iskindof"car") then {_x setfuel 1; 
_x setvehicleArmor 1; _x setvehicleAmmo 1;};} foreach thislist; 
 
{if(_x iskindof"tank") then {_x setfuel 1;  
_x setvehicleArmor 1; _x setvehicleAmmo 1;};} foreach thislist; 
 
  [west,"HQ"] sidechat "Vic Resupplied" ;
#

and

#
resup3 attachTo [this, [0,0,0]];
#

resup is a crate, il need to have many of them. they have multiple repeating triggers attached to them

#

trigger area 25x25

fair drum
fair drum
bleak mural
# fair drum not sure I'm following what you are doing

i have in the scenario a need to slingload many resupply crates for friendly AI vehicles to use. issue is,the AI behaviour around those crates is bad. normally if they rearm or refuel with a truck,its a two part system where the AI truck/logi driver moves to support,and the vic needing support also moves..well crates have no drivers and i think its what causes AI vehicles needing resupply to bug out with crates... to get around this, iv created a tigger to detect the vehicles within its radius,and as on activation above,set the vics to refuel,repair,rearm.

#

The idea is a player will slingload these crates(with the triggers attached to them) to the vehicles in question. dropping them,making the vic in need be in trigger area,and forcing the on activation(ressuply)

fair drum
#

you are starting to enter the zone of not using triggers and starting to do everything in code.

bleak mural
#

i thought about that but its not a very linear script based scenario, its very dynamic.

fair drum
#

hence why code is better

bleak mural
#

positions,units,all that can be random

bleak mural
# fair drum hence why code is better

iv been looking for weeks now for a coded way to do this: tell me if its possible: player flies helo,activates some kind of add action to pick up the nearest friendly AI group,and has another add action to disembark them without affecting their current waypoint system. stuff like that even possible?

#

believe me iv been reading up alot lately,its so complex,so iv stuck with editor and used scripts as much as im knowledgable in it which isnt much

fair drum
#

addWaypoint allows you to insert a waypoint at a given index of existing waypoints

bleak mural
#

heres a wp systm thats run per zone(AO, which is a marker,which moves as mission progresses) . your saying i could dynamically say through an addaction,when near a group(any group) cause them to enter helo,then exit later on an acction?

#
randomPoint= selectRandom ["AO", "AO"];         
 { deleteWaypoint _x } forEachReversed waypoints Alpha1;        
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];         
_wp setwaypointtype "GETOUT";         
_wp setWaypointSpeed "NORMAL";         
Alpha1 setBehaviour "Aware";         
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];       
_wp setwaypointtype "SAD";   
_wp setWaypointTimeout [60, 90, 120];      
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];       
_wp setwaypointtype "SAD";     
_wp setWaypointTimeout [60, 90, 120];   
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];       
_wp setwaypointtype "SAD";    
_wp setWaypointTimeout [60, 90, 120];      
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];       
_wp setwaypointtype "CYCLE"; 
#

and continue this abov syntax?

fair drum
bleak mural
#

chances are whatever i throw together wont work,usually learning code here is a bit of this and that then trying to combine. actually understanding takes so long. But when u do understand it it really opens up the things you can do

#

thanks for all the examples,if you do manage to write an example id love to read it and go over it in the steps youve mentioned

fair drum
# bleak mural ```sqf randomPoint= selectRandom ["AO", "AO"]; { deleteWaypoint _x } f...

clean this up and make it expandable to any group:

private _buildWaypoints = {
    params ["_group"];

    private _getRandomPointPos = {
        private _randomPoint = selectRandom ["AO1", "AO2"];
        AGLToASL (_randomPoint call BIS_fnc_randomPosTrigger);
    };

    // SAD
    for "_i" from 1 to 3 do {
        private _pos = call _getRandomPointPos;
        private _type = "SAD";
        private _wp = _group addWaypoint [_pos, -1];
        _wp setWaypointType _type;
    };

    // Cycle
    private _pos = call _getRandomPointPos;
    private _wp = _group addWaypoint [_pos, -1];
    _wp setWaypointType "CYCLE";
};

[Alpha1 /*add more groups to this array if you want*/] call _buildWaypoints;
bleak mural
meager granite
#

setMass something

bleak mural
#

didnt try to set the mass though wasnt aware i could

bleak mural
#

sometimes its the simplest way to do things.

#

unfortunately the AI behaviour is terrible with them completing rearming orders on crates,they get stuck for silly reasons if more than one vic goes for same crate.

marsh storm
#

Ideally several backpacks. Backpacks start on ground. So far I have a VM sqf that follows the backpack while worn if the bearer is on foot but any time the wearer gets in a vehicle or puts the bag in a vehicle the marker stops updating. If they get out again, the marker reupdates

#

I want the marker to track the location of the bag regardless of where it is

sullen trellis
#

is there a way to get any inventory classname? conifg viewer doesnt give me all the info i need

warm hedge
#

What inventory classname you mean?

sullen trellis
#

for inventory classnames of mods\addons. example: survival items like beans\water bottles\shovel. items that i can pick to keep in my inventory in game. i need their classnames so i can random spawn them around the map

wicked sparrow
#

Does anyone know how to simply create a array from a string? I know sounds simple but my problem here is that a command like parseSimpleArray does not work due to it requiring to be a type for the elements to work. Here to make it more easy to understand:

I want:
"[Carter, Carter_Tactical], [Medrano, Medrano_Tactical]"

to this:
["Carter", "Carter_Tactical"], ["Medrano", "Medrano_Tactical"]

If I would use parseSimpleArray it puts out a error cause the elements are not in a 'here'. I especially do not want to do that cause it would be more easy for users to mess something up. (it's a edit box in cba) My Idea was it to simply make the string into an array and then for each element use str to make it a string so I can use it in a function without a users need to input ' into the actual entry in settings.
So any Idea how I can simply remove the "" from this string?

sullen trellis
#

Why is it so hard to find an inventory classname, to make it simple, you can easily find weapons classnames when u hover the mouse over them, but doesnt work with inventory items. And the funny thing most of them are not in the config viewer! Then where are they? Somewhere in the void? XD

warm hedge
#

getUnitLoadout is one way

sullen trellis
wicked sparrow
sullen trellis
manic kettle
wicked sparrow
#

it only works if you put the entries in ''

#

In case you where gonna point out that it only works in one big array with sub arrays.

manic kettle
#

Ah I see your issue

#

Why not just search the string for open/close brackets and commas and put in ' as necessary?

#

Every time you find a open bracket [ add a '
If you find a , then make it a ','
Etc

#

People have definitely solved this parsing issue,I recall some mods doing as you want...but I don't know any more sophisticated solutions. Good luck!

tender fossil
wicked sparrow
#

for anyone intrested in thos convo, I figured out a way that works:

private _string = "[Carter, Carter_Tactical], [Medrano, Medrano_Tactical]" ;
private _array = _string call CBA_fnc_removeWhitespace;
//systemChat (str _array);
_array = [_array, "[", "['"] call CBA_fnc_replace;
_array = [_array, ",", "','"] call CBA_fnc_replace;
_array = [_array, "]", "']"] call CBA_fnc_replace;
_array = [_array, "]','[", "],["] call CBA_fnc_replace;
_array = "[" + _array + "]";

//systemChat (str _array);
_array = parseSimpleArray _array;
//systemChat (str _array);
#

@manic kettle @tender fossil Thanks for the help. <3

modern mist
#

Hello,
I'm trying to integrate the functionality of ACE Arsenal into the Supply Drop Module's(virtual) supply box so that players can open ACE Arsenal when calling for support in the game. I've tried the following solutions to put into the Init Box, but it still doesn't work:

_this addAction ["Open ACE Arsenal", {["Open",true] spawn ace_arsenal_fnc_openMenu}];
_this addAction ["Open ACE Arsenal", {["Open",true] spawn ace_arsenal_open}];
_this addAction ["Open ACE Arsenal", {["Open",true] call ace_arsenal_fnc_openBox}];

Does anyone know how I can adjust this? Any tips would be greatly appreciated. Thank you.

little raptor
#

You can also make it more advanced to detect if something is already quoted

little raptor
wicked sparrow
little raptor
little raptor
#

Ah ok. So try replacing _this with this

wicked sparrow
vital silo
#

hello

#

Does anyone know what this error could be?

hallow mortar
#

It could be a lot of things on its own, but I see from your code that you have an array that goes [350, ], which is wrong and probably causing it

vital silo
#

It was my mistake, I managed to resolve it.

hasty current
#

There any way to pass a variable reference to a function?

In my case, I want to be passing a scalar to a function, that then adds one to the scalar, modifying the original value. I feel I'll probably need to pass an object that holds the scalar, but I'm not sure what would be the best one to pass. An array? A hashmap? A vehicle?

little raptor
#

pass a variable reference to a function?
all variables are passed by reference in SQF

#

but you can't modify all types by reference (also depends if the command returns a copy or modifies by ref, e.g. append vs +)

hasty current
#

Huh, weird

granite sky
#

Passing in an array or hashmap is fine.

little raptor
#

one way I was doing it before was using an array

#

(the downside is you always have to use _arr#0 to use your number, but it's the fastest option among hashmap/obj/loc/array)

hasty current
#

Wait, so I can use _arr#0 = _newvalue to set a new value? Or would _arr set [0, _newvalue] be preferable? I was under the impression that select and # just returned a copy of the value, not a reference to it

little raptor
#

set. the former is not valid SQF syntax

#

select and # just returned a copy of the value
they return references

hasty current
#

Right, figured as much, thanks!

fiery gull
#

Any way i can have game master/zeus available in my mission but stop people from using/having the annoying ass zeus ping?

vapid scarab
deft zealot
#

intercept can be easily used for hacking, so why woudn't BI prevent its functionality?

astral tendon
#

Does playMove requires remote exec to work like in switchMove? They have efect global but switchMove need to do remoteexec

hallow mortar
#

Adding more maps is more of a #server_admins question.
You can change AI accuracy through the server-level Skill and Precision difficulty config (https://community.bistudio.com/wiki/server.armaprofile#Arma_3) or by using the setSkill script command to apply more specific values to AI units. (If you're making your own missions, you can also change the skill of the AI units you place in their Editor Attributes.)

meager granite
#

CONFIG select NUMBER produced weird error message

#

To be honest I wish it wasn't producing any, other config commands simply return null config without any errors

#

configFile >> "ThisDoesNotExist" => <NULL-config>

#

Selecting one after last array element ([] select 0) doesn't produce any errors and just returns nil

#

Sure configs are not really arrays, but maybe that error message could be adjusted

sonic onyx
#

Hi, is there a script to enable and disable third person for all players at different times, outside of difficulty?

torpid gate
#

Hello, I would like to ask more experienced people how to do the following:
I would like to implement one thing, but there is only one thing stopping me, when writing cursorObject on terrein objects they give the following limestone_01_02_lc_f.p3d, if you write typeOf before it they give an empty line without object class and I really want to understand how to get the object class knowing its p3d, but I couldn't figure out how to use configFile >> (if of course you need to do it through it), help anyone who is not difficult! (I don't want to do it through nearest, I want to try it this way first).

hallow mortar
# torpid gate Hello, I would like to ask more experienced people how to do the following: I wo...

There is no solution to this.
Not all terrain objects have classes at all. They can be a model that only exists in the terrain and has absolutely no representation in config. And even for objects where there is a class with that model but the terrain object instance doesn't have that info, it's difficult to try to reverse-associate the model to a class, because multiple classes could use that model.

warm hedge
#

Also, what exactly you want to achieve by trying to fetch it?

torpid gate
warm hedge
#

So basically hide the terrain object and spawn one, do something with it?

warm hedge
#

Then you don't need a className anyways. createSimpleObject is the way to go. It is not going to have a physics anyways

meager granite
high vigil
#

looks like LA / GE damit, just wasted time lol

meager granite
#

Code snippet to cut out crap out of object names:

trim(_this regexReplace ["(\[.*\]|\(.*\))", ""] regexReplace ["\s+", " "])

Stack of Planks (Pine, Unfinished) [v2] Blabla => Stack of Planks Blabla

winter rose
#

(if .*? is supported, ofc)

meager granite
winter rose
#

yeah but I meant same with [] πŸ˜„

#

.* -> .*?

meager granite
#

"\((.*?)\)|\[(.*?)\]"?

winter rose
#

yuss

#

your version would kill what's between two parenthese groups I believe

#

e.g in abc (123) mno (456) xyz

(.*? = ungreedy version, stop at first)

sonic onyx
meager granite
sonic onyx
#

Thanks for the variable.

meager granite
meager granite
sonic onyx
meager granite
#
"Stack of Planks (Pine, Unfinished) [ 111 (] 222 [) 333 ] [v2] Blabla" call {trim(_this regexReplace ["(\[.*?\]|\(.*?\))", ""] regexReplace ["\s+", " "])}
``` => `"Stack of Planks 222 Blabla"`
```sqf
"Stack of Planks (Pine, Unfinished) [ 111 (] 222 [) 333 ] [v2] Blabla" call {trim(_this regexReplace ["(\[.*\]|\(.*\))", ""] regexReplace ["\s+", " "])}
``` => `"Stack of Planks 333 ] Blabla"`
winter rose
#

I am even surprised that 333 survives here

#

I would have assumed that it would take from [ 111 to v2], but maybe it is confused due to (] 222 [) inside

gleaming rivet
#

Intercept is supposed to run inside Battleye, and everything that plugs into it will as well

candid sun
#

i'm bad at maths...what would be a good way to make something (in this case, a camera) move in a figure of 8 pattern?

lunar mountain
#

Hey guys. Is there any way to make the AI patrol and on each waypoint completion, they go in into a random near building then move to the next waypoint? Without being stuck, clipping into building and all of the subordinate AI not lagging behind doing this.

So in my current script, they sometimes just stuck in the building, BUT they are completing the patrol waypoints for some reason (they are not even close).

What I do is basically to add the waypoints with the setWaypointStatements, which calling a script on completion which does a commandmove on each unit for a random near building at random building positions.

dry flax
#

Where can I find the list of waypoints other then Waypoints [on bi wiki] I'm looking for something like Get In Nearest.

warm hedge
#

Get In Nearest is a thing all the time...?

dry flax
#

I'm trying to get a spawned group in a helicopter with something like:

{
    _x action ["GetIn", kulen1];


    private _wp = group _x addWaypoint [getPos helipad1, 0];
    _wp setWaypointType "GetIn";
    _wp setWaypointBehaviour "AWARE";
} forEach units _squad1;

hint "Crew coming";

And I can't get this to work

warm hedge
knotty gyro
#

Is it just me, or is there no bus in vanilla Arma?

warm hedge
#

No, Arma 3 has none of such bigger civilian car

knotty gyro
#

sigh

lunar mountain
#

But let me know if I except too much frome the AI :D

#

expect*

deft zealot
#

So Arma gets the same trouble every "big" game has. Memory hooking vs cheat protection. I dont know any cheat protection which wins that battle :(

candid sun
#

how on earth do i play an already existing sound from CfgSounds?

queen cargo
#

@lunar mountain
that is possible but not without scripting

lunar mountain
#

I would need to put in a lot of failsafes, right? :D

vapid dune
#

Hi there, I'm trying to make map markers local only (nobody but marker creator can see it). I found that this can be done with local markers, but to make it work I need to override vanilla marker creation dialog from global marker to local (or create my own). Help me find an entry point to this, please. I'm new to arma scripting and I'm a bit lost in it's structure.

lunar mountain
#

I mean, if I setpos them out of the stuck position, they continue the patrol. The funny thing is that they get stuck in the building even with a simple Seek and destroy WP :D

hallow mortar
#

You could use a markerCreated mission EH and deleteMarkerLocal to intercept markers being created by remote players

junior moat
#

hey, how would i go about fixing this? heres my code:

    class USMC
    {
        id = 0;
        idType = 0;
        side = "West";
        size = "Corps";
        type = "HQ";
        commander = "Armstrong";
        commanderRank = "General";
        text = "United States Marine Corps";
        textShort = "USMC";
        texture = __EVAL(getMissionPath "images\usmc.paa");
    };
#

the image itself looks like this

#

i gotta go out somewhere for about 30 or so mins so ping me and ill reply when im back o7

vapid dune
meager granite
hallow mortar
# vapid dune I tried this way and it doesn't work properly. It either deletes your markers to...

You need to use the information provided by the EH (specifically the _local parameter) to determine where the marker is coming from and act accordingly. If you don't, then yes it will delete all markers.

addMissionEventHandler ["MarkerCreated", {
  params ["_marker", "_channelNumber", "_owner", "_local"];
  if _local exitWith{}; // don't delete your own markers
  if (isNull _owner) exitWith{}; // don't delete script-created markers
  deleteMarkerLocal _marker;
}];```
queen cargo
#

move, buildingPos and a ton of other commands will be your friend on this journey

vapid dune
# meager granite Post your code

I also tired !(isPlayer _owner)

// File: initServer.sqf

addMissionEventHandler ["MarkerCreated",
{
    params ["_marker", "_channelNumber", "_owner", "_local"];
    
    if
    (
        !_local &&
        { isPlayer _owner } &&
        { _channelNumber in [0,1] }
    )
    then
    {
        deleteMarkerLocal _marker;
    };
}];
meager granite
#

Move it into initPlayerLocal or whatever it is called

#

Hmm, I guess this wont work for JIPs

#

Gonna need to walk through existing markers on join and locally delete them

hallow mortar
# vapid dune I also tired `!(isPlayer _owner)` ```sqf // File: initServer.sqf addMissionEve...

initServer.sqf is the wrong place to do this, because all player-created markers will be not local to the server, and also deleteMarkerLocal is then only operating on the server. Server handling is acceptable for global channel filtering (though probably should be handled locally anyway to improve response time) but it doesn't have the information needed to do player-specific filtering.

proven charm
junior moat
meager granite
junior moat
junior moat
meager granite
#

Also make sure your source image is 24bit PNG

#

save it as such if needed

junior moat
#

Will do

vapid dune
hallow mortar
meager granite
hallow mortar
#

It looks quite different to me but 🀷

meager granite
#

Not sure about it being a wrapper, just basing off ImageToPAA mentioning it

junior moat
meager granite
#

use pal2pace

junior moat
meager granite
#

commandline app from arma 3 tools

junior moat
#

so, how do i use that?

meager granite
#

Arma 3 Tools directory, TexView2 and its there

#

C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\TexView2

junior moat
#

ah found it, thanks

junior moat
meager granite
#

Open console, pal2pace "your_file.png"

junior moat
#

got it

meager granite
#

Change directory to where the file is

junior moat
#

it is,

meager granite
#

its your users directory

junior moat
#

yea?

meager granite
#

there is no pal2pace in it, cd to TexView 2 directory

#

Or specify full path to file

junior moat
#

i have no clue what that means

meager granite
#

cd C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\TexView2

junior moat
#

got it

meager granite
#

Oh actually pal2pace works with drag&drop, so you can just do that

junior moat
junior moat
meager granite
#

find where arma 3 tools are and check there

junior moat
#

cd did nothing

#

agh whatever theres too much faffing around for this to be worthwhile lol. ill just have some generic like HQ symbol instead

meager granite
#

That path was my local path, you need to use yours

#

But you can just open TexView2 in file explorer and drag your png into pal2pace

hallow mortar
junior moat
meager granite
junior moat
#

its whatever im just going to use this now

meager granite
#

Make sure your file is 24bit PNG, not 8bit PNG

#

the one you attached it 8bit

junior moat
#

ah, how would i make it 24bit?

meager granite
#

Check save settings with whatever software you save it with

junior moat
meager granite
#

You'll need to re-save it as 24bit PNG

#

MS Paint always saves as 24 bit PNG it seems

tender fossil
#

I was just checking that, neat πŸ˜„

meager granite
#

Honestly your original conversion method will probably now work too

junior moat
#

holy shit it worked

#

lemme test it ingame

meager granite
hallow mortar
junior moat
#

still broken sphere_WHYYY

#

idk why its turning blue

#

but maybe the orbat viewer only allows 1:1?

hallow mortar
#

If you haven't restarted the game since the last time you tried with the original broken file, do that

#

Arma caches assets and won't refresh the loaded copy if you replace it with the same name

grand idol
#

Is there a way to use remoteExecCall or remoteExec using the player's session ID? I have the following on a server-side request, like this:

["BSF_AssetManagement_Dialog"] remoteExecCall ["createDialog", _sessionID];

There's no response in this configuration. The session ID is correct as I use it in the same script to trigger response scripts on the client. So I assume that session IDs can't be used in this way. If I pass the player's netID to the server request, I can use objectFromNetId and send the message like this:

params ["_sessionID", "_data"];
_data params ["_vehObject", "_playerNetID"];

_playerObj = objectFromNetID _playerNetID;
["BSF_AssetManagement_Dialog"] remoteExecCall ["createDialog", _playerObj];

This works fine but is a bit clunky IMO. Can an object or netID be retrieved from the session ID?

junior moat
meager granite
junior moat
meager granite
meager granite
#

Otherwise you can build id-owner hashmap on the server and broadcast it with each client change

junior moat
#

this works better imo. just gotta figure out how to scale it down a little bit now lmao

mortal yoke
junior moat
mortal yoke
#

alright, didnt follow all messages πŸ˜…

knotty gyro
#

is there a simple and nift way to convert a string in a script to a variable? Like, I add pices together with joinString, but I need the result to be used as a variable. Some neat magic here, or is it a 50 line script?

little raptor
#

If you mean global var, you can use setVariable/getVariable

#

But you usually don't need to create var names (reading is ok tho). If you do you're typically going about it wrong

knotty gyro
#

it's more like I'm trying to make flexible scripts....

little raptor
#

I just meant as a rule of thumb. If you know what you're doing it's all good

knotty gyro
#
private _loc = selectRandom [pat1,pat2,pat3,pat4,pat5,pat6];
private _tgt = position _loc;
private _obj = [_loc,"tgt"] joinString "_";

// I want that o be something like 
private _act = selectRandom [1,2,3,4,5,6......etc];
private _loc = ["pat",_act] joinString "";
private _obj = [_loc,"tgt"] joinString "_";
private _tgt = position _obj;
// and so on as needed

I have 3+ points that make up one site, and they're all called the same except the number. pat1, pat1_tgt and they are all referenced to invisible H's on the map. I want the one script to dynamically select one of the sites, and so also get the proper positions, also, this would make the script versatile and easy to adapt to all kinds of maps.
Therefor, I'm thining to bild strings, but then need to convert them into variables.

#

Not sure I make any sense....

#

Or maybe I'm reinventing the wheel?

hallow mortar
#

You can probably do this all with one format in a much more compact way

hallow mortar
knotty gyro
#

Neat! But won't that still be a string?

#

don't i need like a call compile or something?

hallow mortar
#

It will still be a string. You then use getVariable, which takes a string and uses that to look for a variable by that name.

fallow pawn
#

Maybe then check for both conditions using conditional operator "OR" with lazy evaluation.
Put the rarest condition to be evaluated last so that the majority of the time evaluation stops at the first and most common.

#

Something like:

if (!isNull objectParent _shooter || { ((vehicle _shooter) isEqualTo _shooter) }) then {};

#

I know I'm not actually giving you a proper answer but a workaround, which may be not optimal. That's just what I can come up from my phone 🫣

gentle zenith
vapid dune
tough abyss
#

Hello everyone, I would like to modify a mod but I don't know how to do it and I don't have any experience in coding..

hallow mortar
#

That's why my example used isNull to check if it was a script-created marker.

hasty current
#

There any way to, in one line only, get terrain objects based on their model? For example, finding all t_OleaE1s_F.p3d near the player. I know I can just get all objects and filter out ones that have a different model, but I need to do this in a holdAction, so it has to be one line only. Could make a function, I guess.. but do I have to, is the question? Or is there a built-in solution for this?

hasty current
#

Nvm made a function for it

warm hedge
drifting spire
#

Say I synced a couple of units to a game logic. How would I access the units from the game logic?

hallow mortar
#

synchronizedObjects, I think

warm hedge
#

That command somewhat broken (or working intended but) even if you sync in Eden sometimes it doesn't even detect it in game

drifting spire
#

how the hell do modules work if it sometimes doesn't work?

warm hedge
#

Depends on the module and setup

limpid coyote
#

How would one create a map marker that is like Air Control where it displays the supplies at that location. Just the display mechanism for onMapSingleClick resupplyPoint (marker name).

fair drum
#

do we have an engine getter for muzzles?

hallow mortar
limpid coyote
#

thank you!

warm hedge
#

I haven't heard any feedback about it, although it's very made for AC specifically but it can do much than showing something. Let me know if it's good or bad

wind hedge
#

Guys, is there a way to have the "scroll wheel" action menu permanently open (even if it currently has no action to show)?. I don't care if I has on a while loop

#

In other words it should be like if the player is constantly moving his mouse's scroll wheel

formal stirrup
#

Are there any props that have attributes to enter a number and it appear on a screen, Similar to the progress slider on the rugged terminal

bleak mural
#

had a question about "isTouchingGround" . if i have it as a condition for a group,and the group to be touching ground.is embarked in a helo that has landed,are they considered as touching ground therefor satisfying the condition or do they need to get out of the helo and physically touch the ground?

lean magnet
bleak mural
#

embarked as passengers i might add

#

i dont want the helos con to be touching ground though,just the groups

#

description only says :"Returns true if object is touching the ground". i assume the con is satisfied in that case,just wana double check

devout geode
#

Is there a way to have ai target civillian players? I've searched Google and found nothing

lean magnet
#

Hey redarmy

bleak mural
lean magnet
#

Make a small trigger box that will only be satisfied when SIDE is present

#

But make the Z small

#

And that could work

#

If you want to do it fully scripted, idk

devout geode
#

Well looking for something I can use in a AI's int field

bleak mural
#

you want it to happen later right?

#

actually im unsure about set side its something different

fair drum
fair drum
devout geode
fair drum
devout geode
#

Okay, because I couldn't get this to work

resistance setFriend [civilian, 0];
civilian setFriend [resistance, 0];

fair drum
#

@devout geode actually, since I'm going to bed, I'll write you something generic. Just use this and change the value of _makeHostileTo to the side you want the civilian to be an enemy of:

// civilian unit init box
// make a single civilian unit hostile to a given side
if (isServer) then {
    private _makeHostileTo = independent;

    private _hostileSides = (_makeHostileTo call BIS_fnc_enemySides) - [sideEnemy];
    private _group = createGroup [selectRandom _hostileSides, true];
    [this] joinSilent _group;
};
vocal mantle
#

It's using a special library so I don't know if anyone can spot anything obvious here. Even without using <thread> I have issues.

#

Has anyone had that message before when developing extensions?

inland iris
#

a trigger that remote executes for trigger activators and only for the trigger activators any clue how I can go about doing that
it shows a text on screen "Get back to Mission Area"

#

this what Im doing

inland iris
#
_code = {
    private _player = _this select 0; // Get the player who triggered the code
    hint "Get back to Mission Area"; // Display the message to the player
};

_triggers = [border_1, border_2, border_3, border_4]; 
{
    _x addEventHandler ["Activation", {[_this select 0, _code] remoteExec ["call", 0, true];}];
} forEach _triggers;

this is what I did for now in the init.sqf

harsh vine
#

maybe you could simple use condition "this && vehicle player in thisList" rather than your so called ( addEventHandler ["Activation" ) ... unedit your comment πŸ€“

inland iris
#

im a bit lazy pls provide additional context ;-;

#

also hello lou I see you lurking in here

#

also @harsh vine making a zeus template so was hoping this works but its not working I tried diffrent appraoches none worked

#

thus finally here

fleet sand
# inland iris ```sqf _code = { private _player = _this select 0; // Get the player who tri...
  1. _code is a local func so if you are gonna try to call that fnc from a EH it wont work becouse of the scope.
  2. Activation EH dosent exist so i dont know how you got that.
  3. If you are remoteExec then call you can just use remoteExecCall command.
  4. And if you just want to warn player to get back to playable area its been done x amount of times simple google search you could found the resoult but here is one for you:
    https://forums.bohemia.net/forums/topic/202380-solvedmp-if-players-leaves-area-kill-them/?tab=comments#comment-3156787
  5. Dont use ChatGPT for coding.
inland iris
#

also legion thanks for that

bleak mural
#
units _group findIf {alive _x && (_x in _vehicle)} == -1 &&  (triggeractivated auto1 or triggeractivated manual1)
#

basically when either trigger manual1 or auto1 fire, the condition completes as is shown by a hint

#

seemingly ignoring your synatx and my other one

#
units Alpha2 findIf {!isTouchingGround _x} isEqualTo -1 && (triggeractivated auto1 or triggeractivated manual1)
#

does either syntax look correct? im not getting any errors and to best of my knowledge this is how i should use "OR"

#

AND &&

#

pardon me, for what im doing here is quite specific,anytime after auto or manual trigger have been activated,and the group(Alpha2) disembark my helo,i want them to then follow the info on the activation box. After testing at least with my touching ground way,its working as is supposed to and touching ground is actually applying when they leave the chopper even if the chopper is grounded(hence my initial question earlier) its weird however that even though the two conditions above need to be met for the activation to kick in, the triggeractivated condition alone is enough to trigger a hint in the on activation box, which made me think it isnt working

bleak mural
#

correction,touching ground counts even if they are in a helo. il try your method,thanks.

tender fossil
#

Is it possible to detect every (map) object that's partially or completely underwater? I'd need the type and location of stuff like rocks and water plants

oblique arrow
tender fossil
oblique arrow
#

I'm not sure πŸ€”

#

I'd be both surprised and not surprised

#

this is arma after all πŸ˜„

winter rose
#

nearestTerrainObjects?

tender fossil
# winter rose `nearestTerrainObjects`?

There's a mention on biki that terrain rocks and boulders are of type "HIDE" instead of "ROCKS" or "ROCK", I wonder if there are other such special object types?

winter rose
#

try & see

tender fossil
#

Alright, let's see indeed

tender fossil
#

Thanks! It's working well. Lots of data to play with

versed belfry
#

Quick question, is there a way to make a unit invisible but still be able to receive damage through bullets?

warm hedge
#

AFAIK no

versed belfry
# warm hedge AFAIK no

Duck, any scripts or way you think I would be able to achieve that with? Even if it's detecting something else invisible getting hit and then possibly applying damage based on that?

warm hedge
#

Well... what exactly is the goal?

versed belfry
warm hedge
#

Hm πŸ€”

oblique arrow
warm hedge
#

You may want to use setObjectTexture [0,""]

versed belfry
#

So when a unit is hidden the players/AI can still be killed or damaged

versed belfry
versed belfry
warm hedge
#

It should. Or, at least other numbers do

versed belfry
#

Closest I got so far was the ghillie suit, but it still has a tiny bit of arm and the head showing

warm hedge
#

πŸ€” You're out of luck then

granite sky
#

Might help to set textures other than 0

#

but I guess it only touches the customizable textures.

versed belfry
versed belfry
granite sky
#

What if you put a full-cover helmet on them, like that one from Apex?

#

oh, you already tried the viper suit.

versed belfry
#

I don't think you can change vest and helmet textures with commands, only uniforms iirc

primal furnace
#

@wild canyon

wild canyon
vernal adder
#

Hello, I installed the "MarXet" mod and everything works correctly, with the database, ect...

but I have my server on the chernarus_A3 map
The problem is that the trader does not appear, and I use this way:

class CfgTraders
{
#include "TRADERS\CfgTraders.hpp"
};

Does anyone know how to adapt the MarXet trader file to this type of trader that I use?

winter rose
vernal adder
#

I really checked the entire configuration, I have no error, just the trader which is displayed, but without the option

#

and for info I am on chernarus A3

winter rose
delicate hedge
#

Hey guys. I have trouble, im making mp missions, and i got there script for adding medicine into boxes, so i add item via "addItemGlobal" command in sqf script, and call that script in init of the object. The problem is that sometimes it gives medicine ok, but sometimes it can give like few thousand of items. As i understand it executes this script for every player (there like 100 players), and only thing i cant get, is how that happens? As i look in initialisation order in arma 3 documentation, there written that "Object initialisation fields are called" applies for "all" (as i understand for server and clients), and sometimes it does...

winter rose
delicate hedge
winter rose
#

that would be perfect if you have reference to these objects yes πŸ™‚

bleak mural
#

whats the common way around this issue: i have a repeatable trigger that i need called throughout the scenario. problem is one of the 2 conditions. they task complete needs to be counted each time for the condition to be satisfied

#
units Alpha1 findIf {!isTouchingGround _x} isEqualTo -1 && ["1"] call BIS_fnc_taskCompleted
fair drum
delicate hedge
#

And i have one question: does selectRandom works different on each client?

bleak mural
#

the first con(touching ground) works over and over yet the task complete or trigger activated can only be done once in mission yet the condition expects them everytime

bleak mural
#

it didtn work but maybe you misunderstood my goal

fair drum
bleak mural
#

im the pilot(any AI can be actually) A group boards my helo,i land,they get out,and follow code that was on the activation...let me just give you the full on act and con:

delicate hedge
bleak mural
#
units Alpha1 findIf {!isTouchingGround _x} isEqualTo -1 && ["1"] call BIS_fnc_taskCompleted
#
randomPoint= selectRandom ["AO", "AO"];          
 { deleteWaypoint _x } forEachReversed waypoints Alpha1;         
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];          
_wp setwaypointtype "GETOUT";          
_wp setWaypointSpeed "NORMAL";          
Alpha1 setBehaviour "Aware";          
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];        
_wp setwaypointtype "SAD";    
_wp setWaypointTimeout [60, 90, 120];       
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];        
_wp setwaypointtype "SAD";      
_wp setWaypointTimeout [60, 90, 120];    
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];        
_wp setwaypointtype "SAD";     
_wp setWaypointTimeout [60, 90, 120];       
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];        
_wp setwaypointtype "CYCLE"; d
bleak mural
#

and on act is the patrol script executed with a 22 second delay after the group exit the helo

fair drum
delicate hedge
bleak mural
winter rose
bleak mural
#

i use my old messy syntax instead of yours for familiarity for moment too

winter rose
#

"add 10 mags"

one dedicated server + 3 players = 40 mags

bleak mural
#

finally witnessed limitations of triggers

delicate hedge
fair drum
winter rose
#

like it still runs on the client but does nothing

bleak mural
#

is there a way i can make the trigger happy with the task condition being completed just once?

#

or create the trigger after task1 was complete?

delicate hedge
winter rose
#

please provide code

bleak mural
#

i think what i might do is check if group is in the AO and(after drop off) just execute the patrol on them at that point

#

so alpha1 in marker area or something like that

#

run code..

#

is there an alternative way to "in thisList " for markers?

delicate hedge
# winter rose please provide code

I dont have one right now. It was just: this setVariable [name, value]
OR maybe, i forgot, there was call with some arguments.
And when i tried to get this var/args in script which was in description.ext -> cfgFunctions, only server/host was getting it

#

I think it was setVariable

winter rose
#

setVariable works (locally, unless you used this setVariable [name, value, 2] where 2 = server)

delicate hedge
winter rose
#

doesn't matter - if 2 is present, it's not applied locally

bleak mural
#

are any conditions in triggers actually repaetable?

#

iv tried !Alive, ISNUL and so many others. nothing work

winter rose
#

conditions don't repeat, triggers do?

bleak mural
#

iv decided to abandon it and come at it from a totally different angle.

inland iris
#

if you put a condition in a trigger
it will loop itself

bleak mural
inland iris
#

until the condition is met
changing the trigger state

bleak mural
#

iv abandoned the complex way and opted simply to detect if the group is within a trigger area(that encompases the entire AO) and within that trigger area the conditon:

#
units Alpha2 findIf {!isTouchingGround _x} isEqualTo -1 && {_x in thislist} count units Alpha2 == count units Alpha2
#

it meets the needs of what i want,just means il have 9 ugly large repeating triggers for 9 squads encompassing the entire area

#

im open to critisism of the above code though

#

im sure as always theres a better way of doing this.

bleak valley
#

I've been searching for the past 2 hours on every forum thread I could find, but no luck .... my question is so simple I'm kinda ashamed to ask for help here

So
I use a composition that returns "SMINI_password_correct" true when completed
When completed, I want a specific effect to turn off. So I set a trigger. But I can't find what to put in the condition box.
I tried "SMINI_password_correct isEqualTo true" (and many others) but to no avail.

Can please someone help me with this one ? (I've added sound to my trigger so I'm sure it doesn't work, it's not just the activation part that is at fault)

hallow mortar
#

I'm assuming the composition just does SMINI_password_correct = true or something very similar to that.
If that's the case, then your trigger condition should probably be:

missionNamespace getVariable ["SMINI_password_correct",false];```
Because the trigger is evaluating constantly from mission start, you can't just check for `SMINI_password_correct`, because the variable won't exist and the trigger will get confused. You have to use a command that doesn't fail if the variable doesn't exist, which is what `getVariable` is for - it checks whether the variable exists, and returns a default value (in this case, `false`) if it doesn't.
You _don't_ need to do things like `varname isEqualTo true`. That's like "return true if this returns true", which is redundant. The variable is already a true/false boolean, you don't need to add another layer. Just return the value of variable itself.
bleak valley
hallow mortar
#

That would return false if:

  • the variable is not defined (yet), i.e. any time before the composition does its thing
  • the variable exists but its value is set to false
    It would return true if:
  • the variable exists and is set to true
#

Triggers constantly evaluate their condition, so the condition initially returning false is fine and expected. When the condition becomes true, the trigger will notice and activate.

#

If you made the trigger condition missionNamespace getVariable ["SMINI_password_correct",false] and nothing else, and the trigger still isn't activating, then whatever the composition is doing is more complex and it isn't actually setting a global variable with that name to true. More details would be needed to figure that out.

bleak valley
#

I guess it is then (fyi, I'm using this one : https://steamcommunity.com/sharedfiles/filedetails/?id=2961943348&searchtext=switch)

I have another problem, when I set missionNamespace getVariable ["SMINI_password_correct",true] the sound played on mission start but the effect was still there, so the code on activation I use is also wrong (_nObject = [0,0,0] nearestObject 1953; _nObject hideObjectGlobal true;), so I have some work and testing to do, and even more research

oblique arrow
bleak valley
oblique arrow
#

Depends on how the effect is done I guess

bleak valley
fair drum
#

It's been a few years but I can look up the code and see what's going wrong

proper sigil
#

Any idea why this works


    params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
    
    _oldMagazine call DNT_onReload;
    
    }];
    ```

but this throws error?

```_newUnit addEventHandler ["Reloaded", {

    params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
    
    [_oldMagazine] remoteExec ["DNT_onReload",0,false];
    
    }];
    ```

Function that is executed from EH is:

```DNT_onReload = {

    params ["_oldMagazine"];    
    
    private _suppliesStatus = call DNT_readFromDb;
    private _currentAmmoStatus = _suppliesStatus select 0;

    private _oldMagClass = _oldMagazine select 0;
    private _oldMagAmmoLeft = _oldMagazine select 1;
    private _oldMagCapacity = getNumber (configfile >> "CfgMagazines" >> _oldMagClass >> "count");
    private _ammoLeftPercent = round((_oldMagAmmoLeft/_oldMagCapacity) * 100);
        
    if(_ammoLeftPercent<=25) then {
        if(_currentAmmoStatus>0) then {    
            ["ammo", -1] call DNT_writeToDb;
            remoteExec ["DNT_updateSupplyTrackerTasks",0,true];                
        };
    };    
};```
fair drum
#

@bleak valley

winter rose
inland iris
#

yeah thats what I saw too but I wasnt sure so I removed it xD

fair drum
proper sigil
# winter rose `[[_oldMagazine]] remoteExec`?

Okay, that done something, though now I'm having this error. I'm a bit confused what is being passed into the function? Is the _oldMagazine nested array? Seems like those are not assigning correctly

    private _oldMagAmmoLeft = _oldMagazine select 1;
    private _oldMagCapacity = getNumber (configfile >> "CfgMagazines" >> _oldMagClass >> "count");```
bleak valley
# fair drum let me know

result is kinda strange

so I put in my trigger the code you gave !isNil { missionNamespace getVariable "SMINI_password_correct" }; ; replaced the activation code by a simple hint command, and tried 3 times

first time, turn all 4 boxes green, nothing happened
second time, turn the 1st box green, all went green at the same time and the hint showed
third time, same as the first (in both 1st and 3rd try, I manually turned every box green one by one and checked they were all green at the end)

#

I'm using your comp "vanilla", didn't modify anything

fair drum
#

the password is randomized

#

so in your second iteration, you got the password right by switching only one switch

#

first time, you set all green, but all green wasn't the password

#

does that make sense?

bleak valley
#

yeah I get it, I misunderstood your comp, my bad, I'm gonna run more test then

fair drum
#

do I need to change its description at all? you are the first person so far to state an issue (though most people don't even give feedback. i guess no feedback is good feedback)

bleak valley
#

now that I know it, it makes sense
the "To win, players must get the correct amount of switches in the "On" position." says it (the correct number can be not all), I guess I've read it a bit fast

#

I'm gonna change the password so all need to be green, 16 possibilities is a bit much to my taste ^^

but yeah it does work, thanks for your help

hallow mortar
bleak valley
#

@fair drum sorry to bother you again
I'm trying to change the password to all green
according to your last comment in your comp, you need to modify the variable SMINI_password with an array of numbers (four 1s in this case)
I tried with missionNamespace setVariable ["SMINI_password", [1, 1, 1, 1]]; in init.sqf but it doesn't work (and I'd rather ask you before I spend the night on the setVariable and Array pages of the wiki, 1 hour is already enough)
can you help me out (again), please ?

fair drum
# hallow mortar I'm fairly confident that the code I put is correct for a trigger waiting for a ...

no it was good. was just tagging you to continue to conversation between 3 of you. it was actually aimed at @bleak valley

so @bleak valley , that would be correct, just make sure you are changing that variable after the composition creates it. so either wait for SMINI_password to be created by checking for nil first, or wait a couple of seconds after mission start. its probably just being overwritten when the composition script runs

bleak valley
fair drum
bleak valley
formal stirrup
#

Does anyone have any idea on if its possible to attach a circle to a screen then use a line to show a number from 0 to 360?

fair drum
formal stirrup
#

A circle..? Not sure how else to describe it. But like a computer screen.doesnt have to be a texture on it, Could just be a circle object thats close to the screen

#

And on that note, Does the texture on the rugged terminal allow the slider, Or is tied to the object itself

viral birch
#

Anyone know how to find the PBO file path for an item? I know the class name of the item and I know it belongs to CfgMagazines, but I have no idea which PBO it comes from lol. The item is ButaneCanister if anyone has any experience with it already.

warm hedge
#

Why you need to check PBO to see className? You can always rely to a config viewer

viral birch
#

I already know the class name. I want to modify it in my mod

#

but I cannot find where it exists natively so I don't know what to import

warm hedge
#

Still, you don't need anything within PBO

#

Just config viewer and use your config to inherit properly

viral birch
#

I'll try to see if I can find it in config viewer

viral birch
visual epoch
#

I've been trying to use the "CombatModeChanged" event Handler but I can't seem to be able to get it working. Is it deprecated? What sort of alternative should I use?

granite sky
#

It's pretty recent so it won't be deprecated.

#

What are you trying to do with it?

visual epoch
#

From the init.sqf:

mourners addEventHandler ["CombatModeChanged", {params ["_group", "_newMode"],
hint "EH triggered!";
deleteWaypoint [_group, (currentWaypoint _group)];
_group removeEventHandler [_thisEvent, _thisEventHandler];
{_x enableAI "ALL"; _x switchMove "";} forEach units _group;
}];```
visual epoch
# granite sky What are you trying to do with it?

I have two civilians in a group. I assigned the EH to the group. The intent is for them to leave the ambient animation they're in, and skip a hold waypoint to get them to flee when combat starts.

#

I tested the group'S behaviour with the "behaviour" state, and I can confirm it gets switched when shots get fired. However, I can't get the EH to trigger

granite sky
#

what's their original group behaviour?

visual epoch
#

"safe"

#

When they get shot at, it swaps to "danger" or whatever the red state is "COMBAT"

sullen badge
#

Greetings fellow programmers!

I’m trying to ad radios to a couple of vehicles in the game. And since I’m not a programmer I only got a code ”that works, you just have to paste it in the vehicles init field” and pasted it in the vehicles init field.

Testing the mission in Eden it works fine. On the dedicated server it does not. Well it worked once or twice, but not consistently.

Anyway here is the code, how would I get this to work?

    [ 
        { 
            private _vehicle = _this select 0; 
 
            [_vehicle, "ODIN"] call acre_api_fnc_setVehicleRacksPreset; 
            [_vehicle, {}] call acre_api_fnc_initVehicleRacks; 
  
            private _vehicleRacks = [_vehicle] call acre_api_fnc_getVehicleRacks;  
  
            for "_i" from (count _vehicleRacks) - 1 to 0 step -1 do {  
                [_vehicle, _vehicleRacks select _i] call acre_api_fnc_removeRackFromVehicle;  
            };  
  
            [_vehicle, ["ACRE_VRC110", "Upper Dash", "Dash", true, ["inside","external"], [], "", [], []], true] call acre_api_fnc_addRackToVehicle; 
            [_vehicle, ["ACRE_VRC103", "Lower Dash", "Dash", false, ["inside","external"], [], "ACRE_PRC117F", [], []], true] call acre_api_fnc_addRackToVehicle; 
  
            _vehicle setVariable ["Dro_customRacksAdded", true, true];  
        },  
        [this],  
        0.1  
    ] call CBA_fnc_waitAndExecute;  
  
    [  
        {(_this select 0) getVariable ["Dro_customRacksAdded", false]},  
        {[(_this select 0), {}] call acre_api_fnc_initVehicleRacks},  
        [this]  
    ] call CBA_fnc_waitUntilAndExecute;  
};```
meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
sullen badge
#

Sorry

sage wind
#

I have issues with our loadout system we used on first loadin to a mission.
The system we use is rather big and can be found here: https://github.com/7Cav/cScripts/tree/main/cScripts/functions/gear
But i will try to simplify and narrow down and explain the parts that is important to get a grasp.

What we have discoverd is that function calls within the fn_gear_applyLoadout script (https://github.com/7Cav/cScripts/blob/main/cScripts/functions/gear/fn_gear_applyLoadout.sqf) during first loadin never gets executed properly.

The fn_gear_applyLoadout in applied via cfgFunctions preInit = 1 and uses CBA_fnc_addClassEventHandler that is added to the CAManBase class and 3 calsl are done for InitPost, Respawn and Local.

(The entire function can be found here: https://github.com/7Cav/cScripts/blob/main/cScripts/functions/gear/fn_gear_preInit.sqf)

To simplify fn_gear_applyLoadout:

params [
    ["_unit", objNull, [objNull]],
    "_loadout"
];

[_unit, _loadout] call CBA_fnc_setLoadout;

// Nothing inside of this if works
if (hasInterface || {isPlayer player}) then {
    [_unit] call ace_hearing_fnc_putInEarplugs;                        
    ["cScripts_StagingArsenal_SaveWhitelist"] call CBA_fnc_localEvent;
};

We noticed is that ace_hearing_fnc_putInEarplugs and the local event never properly run first time you loadin but if you respawn OR re run fn_gear_applyLoadout the functions. Is there a way to make sure they run more reliable on initial loadin and not just on respawn?

#

We have also removed the player checks but it does not have any effect.

inland iris
sullen badge
foggy spear
#

can you guys tell me the Indonesian flag script to put on the vehicle because I'm a new player

still forum
bleak mural
#

was there a change to this command recently? i used to use this but it doesnt seem to work

#
this removeMagazinesTurret ["4Rnd_Titan_long_missiles",[0]]
#

trying to remove titan missiles on Tigris

#

retyped it thinking maybe theres a hidden character but no,just doesnt do anything in a vehicle init

hallow mortar
#

Nothing's changed about the command.
When you have issues with something involving a classname, always make sure you've got the right classname.

bleak mural
#

non o is NATO i see

winter rose
#

isn't it a 0?

hallow mortar
#

I'm pretty sure it's O for OPFOR

winter rose
#

ok - the font made me question it

bleak mural
#

so im guessing this can work in reverse...i can add ammo to vehicles

hallow mortar
#

Literally the only difference between the two is the display name used on MFDs (not even the game HUD). For the non-O it's MISSILE and for O it's Π—-Π’ Π ΠΠšΠ•Π’Π.

bleak mural
#

yeah iv been staring at that word Raketa for an hour now wondering why the 0 wasnt beside it

#

nice i can fly relatively free now

#

gona try ADD ammo for the stomper drone as it only gets a single belt,such a fun vehicle

hallow mortar
#

Incidentally, you can make a script that doesn't care about which mag type a vehicle comes with by removing the weapon instead

bleak mural
#

im changing the mass of them,and slingloading one in a hot AO as extra undercarriage fire power

bleak mural
#

i heard reports that doing that was causing CTD's when AI tried to use the vehicle

hallow mortar
#

That seems highly unlikely

bleak mural
#

scratch that it was an old Arma2 issue and related to "removeweapon"

granite sky
granite sky
#

Ok, looks like the group and unit behaviour changes are completely separate for civs. If you plonk a CSAT guy in front of them, they'll shout "enemy" and group behaviour switches, but they don't move. If you fire shots near them then they'll scatter but their group behaviour remains on "safe".

solid grove
#

if i used something like

    private _unitType = typeOf _artillery;
    _dummy = _unitType createVehicle _lastPositionX;
    _dummy hideObjectGlobal true;

to create a dummy unit then revealed it to the enemy, will it shows a map marker to them or no, since its been hidden?

foggy spear
#

@inland iris thx you so much

ornate whale
#

Is it possible to defined a variable with code block data type (funciton) as a constant?

granite sky
#

You mean immutable?

ornate whale
#

Yes.

granite sky
#

compileFinal, I guess.

ornate whale
#

I am trying to structure my code, so that I donΒ΄t have so many separate files for every function.

hallow mortar
#

compileFinal is the answer to that, but keep in mind that not using cfgFunctions does affect when the functions become available.

granite sky
#

Separate file per global function is normal. Even if the functions are tiny.

fair drum
#

To add on, if using CBA, their pre post compileFinal (using PREP) system gets around the timing availability.

ornate whale
#

I saw this pattern in some scripts even though I didnΒ΄t like it, it seemed like a pragmatic approach.

hallow mortar
ornate whale
#

Since I already use cfgFunctions for everything, I will probably keep it like that, but I think that people might get lost in my code. πŸ˜„

#

So at least, I will try to name it clearly and separate it in different folders.

hallow mortar
#

Functions that don't have their own file names and don't appear in CfgFunctions are generally more confusing rather than less

ornate whale
#

When I declare a var without the private keyword inside if-then block, will it still be global?

hallow mortar
#

A global variable (no _) will be available to all scripts on the current machine.
A local variable (starts with _) is only available to the current scope and its sub-scopes, and will be destroyed when the scope it was created in ends, regardless of whether it's private or not.

ornate whale
#

Thanks for clarification.

ornate whale
#

I used it for a small function to prevent it being redefined over and over again.

    fnc = 
    {
        .....
    };
};```
solid grove
#

would
_dummy hideObjectGlobal true;
hide a revealed map marker for the unit? ie when showing to the enemy for support calls?

#

im trying to use a dummy unit to create a last known position type thing

visual epoch
granite sky
#

Not exactly. Read the second part.

#

Group behaviour isn't necessarily representative of unit behaviour or triggered in sensible circumstances, so that EH may not be useful.

#

The EH correctly triggers when the group behaviour changes, but the group behaviour change logic is garbage.

solid grove
solid grove
#

Its an antistasi ultimate thing, the enemy can call in support and the enemy commander is given the position of the actual artillery unit if detected, even if you move. Im trying to give it a last known position such that counter battery is less accurate, especially if you move or are moving while firing.

#

and the best I could come up with was a dummy unit xD

#

Its kinda janky tbh.

granite sky
#

Are you sure? Community Antistasi only cares about the original position (plus some added inaccuracy), and I'd be surprised if Ultimate changed that code.

#

I guess with artillery you'd get a delay, because the position is recorded at the point the support call is made, which might be ~40 seconds after you fired.

#

That's easy to work around though. Just don't bother moving until the shells land.

solid grove
#

hmm Ill have to double check, but I think the artillery code was refactored at some point.

#

but yeah that makes sense. Ill look into it again.

dry flax
#

Could someone scrutinize my .sqf and perhaps make some suggestions, it's a a function for a holdaction that is used for AI transport, the variable names are badly configured:

FN_GetCrew = {
    private _helipads = nearestObjects [player, ["Land_HelipadSquare_F"], 50]; 
    private _helipad1 = if (count _helipads > 0) then { _helipads select 0 } else { nil };
    private _player = player;
    private _helicopter = vehicle _player;


    if (!isNil "_helipad1") then {

        private _squad1 = [getMarkerPos "uslessAIflesh", west, ["B_G_Soldier_SL_F", "B_G_Soldier_F", "B_G_Soldier_LAT_F", "B_G_Soldier_M_F", "B_G_Soldier_TL_F","B_G_medic_F"]] call BIS_fnc_SpawnGroup;
        _squad1 setSpeedMode "FULL";

        {
            _x assignAsCargo _helicopter;
            _x action ["GETIN NEAREST", _helicopter];
            private _wp = group _x addWaypoint [getPos _helipad1, 0];
            _wp setWaypointType "GETIN NEAREST";
            _wp setWaypointBehaviour "AWARE";
        } forEach units _squad1;

        hint "Crew coming";
        sleep 35;

        {
            if (!(_x in _helicopter)) then {
                _x moveInCargo _helicopter;
            };
        } forEach units _squad1;
    } else {
        hint "No helipad found";
    };
};

FN_DismountCrew = {
    private _helicopter = vehicle player;

    {
        if (isPlayer _x) then {
            nil
        } else {
            _x action ["EJECT", _helicopter];
            _x enableAI "move";
            _x setUnitPos "auto";
            unassignVehicle _x;
            doGetOut _x;
            private _playerPos = getPos player;
            private _randomPos = [_playerPos, 50,  50, 0] call BIS_fnc_findSafePos;
            _x move _randomPos;
        };
    } forEach Crew _helicopter;
};
gray bramble
#

Not looked at the code, but that message comes when none of the (outputsize) characters are a zero byte aka null terminator. In effect this means that can only return outputsize-1 bytes to the game.

little raptor
# dry flax Could someone scrutinize my .sqf and perhaps make some suggestions, it's a a fun...

if (count _helipads > 0) then { _helipads select 0 } else { nil };
you don't really need to write this
also when something doesn't exist the better practice is to set it to a default value. the default for objects is objNull (checked with isNull)
so at the top you just need:
if (count _helipads > 0) then instead of the isNil check
_x action ["GETIN NEAREST", _helicopter];
there is not such action
_x move _randomPos;
move is for groups not units. instead of issuing move to each unit, just issue the move order to the leader of each group and let the rest follow

tough abyss
#

Is it even possible to return somehow the charater's name? I am talking about the name when you right click the attributes on a player unit and set a Character Name to it.

winter rose
#

only if it is an AI, otherwise it returns profileName

tough abyss
#

No, it's not an AI, it's a playable character

winter rose
#

then if it is at that moment a player, nope

tough abyss
#

dang it 😦

winter rose
#

perhaps you could use in init script if (isServer) then { this setVariable ["MARC_unitName", name this] }; but no guarantee

tough abyss
#

Yeah, nope :/

winter rose
#

you can set it manually and stick to it, no need to depend on name autogeneration?

tough abyss
#

True, I just thought you can get it based on the player Unit's variable easily

indigo snow
#

@candid sun look into lissajous figures for the figure 8 pattern

velvet knoll
#

Anyone know if INCONTINENTIA'S UNDERCOVER script is still functional?

ornate whale
#

How do you deal with a common resource access among parallel executed functions?
I have a function that can be called from different event handlers, and it creates a unique entry in a table for the related unit. But I suspect that the nature of script execution might cause that two functions will blindly write duplicate entries even though I do check few lines before.

#

Shoud I use some kind of semaphores or queues? Or something else entirely.

sharp grotto
ornate whale
#

That means the involvement of WaitUntil or something, in case of Mutex. But this might get out of hand performance wise with events like suppress or hit.

fair drum
#

I don't think you need to go that far in depth. Sqf is great because it's made for the layman, not for actual game development. I think you don't need to worry about this as I think this is covered on the back end for us. Like for 2 event handlers that call the same function, have you tested to see if the conflict you suggest even exists? I bet one event handler always has priority over the other

ornate whale
#

I kinda assumed that they can be executed in parallel (on the back end), and that one can not say if they will be finished in FIFO order. Based on what I read on BIKI.

#

I am just at the prototyping stage, so I did no testing and I think I might not even catch such condition. πŸ˜„

fair drum
#

I think you'll be pleasantly surprised that you won't have problems. But this issue probably is best answered by @still forum

granite sky
#

Nothing gets executed in parallel from an SQF perspective. If your code is called in an EH, Arma will wait until you exit the EH before doing anything else.

#

Scheduled code (eg. spawned threads) can be interrupted though.

ornate whale
#

OK, now I am getting a bit smarter.

granite sky
#

As far as I can tell remoteExecCall gives you a remote FIFO but this isn't documented behaviour.

ornate whale
#

And normal FNC (cfg defined) call in init.sqf is also scheduled?

granite sky
#

In scheduled code you can wrap sections in isNil { } if you need them not to be interrupted.

cedar bay
#

does anyone know how to add flame to an object that will be placed on the map? Is that actually possible to such object to have particles?

winter rose
#

wouldn't some config init scripts work?

cedar bay
#

hmmm will have to try

#

i remember one island / terrain used some shady stuff like loading a config up when the "island started" but cant find it anymore

#

for example I need to add two waterfalls too

warm hedge
#

I would say postInit function and check if it is the desired terrain and do a script

meager granite
#

Thought it also adds actions to it πŸ€”

ivory lake
#

every instance I've seen it done (particles on a map object) required scripted solutions and not nice ones at that

#

(loop iterating through every map object to find the specific ones)

ornate whale
#

Will an EH created on a server detect a client's fired event?

#

It says GA, so I assume it will.

bleak mural
#

i have the following as a wp statement

#
{deleteVehicle _x} forEach thisList
#

and the exact same in a trigger on activation

#

yet they have different results

#

in the wp statement the crew of a vehicle get deleted but not the vehicle

#

in a trigger zone,vehicles and infantry both get deleted

proven charm
ornate whale
proven charm
#

i dont think there's any delay. havent you tested it?

ornate whale
#

Not now, I did some tests long ago, but it was the other way around, EH on a client catching the event and setting some public values (unitTrait), and it was damn slow.
#arma3_scripting message

magic dust
#

can you delete this "lead indicator" in anti airs? ive tried

showHUD [ 
 false, // scriptedHUD 
 false, // info 
 false, // radar 
 false, // compass 
 false, // direction 
 false, // menu 
 false, // group 
 false, // cursors 
 false, // panels 
 false, // kills 
 false  // showIcon3D 
];

and difficuly settings, but doesnt work

ivory lake
#

its not a difficulty setting

#

that AA has radar guided FCS

magic dust
#

yep, after alot search i found this feature is introduced in 1.60, but i couldnt find any code about it yet

ivory lake
ornate whale
magic dust
bleak mural
#

in testing something i also just realised if i set behaviour to careless but speed to gull,it seems to overwrite careless and changes to aware

#

this is concerning a helo. does full speed even apply to helicopters or jets?

#

_wp setWaypointSpeed "FULL"; (for air unit) not seeing a noticable difference but hard to measure

#

ahh wait maybe i saw a behaviour change..as helo came into area he is dropping off troops,he banked higher, than normal,meaning he was probably doing it to bleed air speed.

ornate whale
bleak mural
#
randomPoint= selectRandom ["AO", "AO"];     
     
_wp = HQRF1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];     
_wp setwaypointtype "TR UNLOAD";     
_wp setWaypointSpeed "FULL";     
heliGroup setBehaviour "CARELESS";     
_wp =  HQRF1 addWaypoint [position del, 0];    
_wp setWaypointStatements ["true", "{ deleteVehicle _x} forEach thisList;" ];   
#

but yes for example in high command if i change speed,they need to complete the wp for it to apply. seems different rules for different wp assignement types

ornate whale
bleak mural
#

its started on the ground so hasnt completed the wp which is over a km away

#

current wp perharps?

#

or are you saying the current shown speed is infact not what the vehicle is currently doing?

#

even in above syntax,when i check at execution start, "careless" is automatically changing to aware(maybe BECAUSE speed is higher than limited)

ornate whale
#

You can set speed directly on the vehicle itself - immediate effect, or change it through the WP - effect when WP is reached.

#

Try using setBehaviourStrong for the mode.

still forum
# dry flax Could someone scrutinize my .sqf and perhaps make some suggestions, it's a a fun...
        if (isPlayer _x) then {
            nil
        } else {
            _x action ["EJECT", _helicopter];

Just write

        if (!isPlayer _x) then {
            _x action ["EJECT", _helicopter];

private _player = player; But why. The only reason I can see is performance. But even that doesn't apply here where you only use that variable once.

private _wp = group _x addWaypoint [getPos _helipad1, 0];
That group _x call isn't needed.
You are iterating through units in _squad1 , so the group of every unit will be _squad1
So just add the waypoint to _squad1

Also in general that loop there doesn't really make sense. Waypoints are per-group. So why are you adding the same waypoint for every group member.
The group will end up with a dozen times the same waypoint.

You need to do the assignAsCargo for every unit, but the waypoint only once.

still forum
# ornate whale How do you deal with a common resource access among parallel executed functions?...

There cannot currently be parallel execution in SQF.

The only thing that can happen is for scheduled scripts to be suspended, they then sleep while other scripts run. So that way you could get another script into the middle of your execution.
You would also need to consider that when creating a mutex.

But that is only for scheduled scripts that can suspend (spawn/execVM commands).
Not for unscheduled scripts, such as EventHandlers (unless you implemented your own scripted eventhandling system and call that from a scheduled script)

You can force your code to run unscheduled, by wrapping a isNil{} around it. That way nothing can interrupt it (the game will freeze while it runs).

You can check with the canSuspend script command, if your execution can be suspended.

ornate whale
#

Where does init.sqf run in a multiplayer game? Both server and client? Could not find it on BIKI.

open hollow
#

i have a really dumb question.
onflare.sqs the code need to be in sqs or can be sqf?

little raptor
tender fossil
#

Can I replace the default value with function call in getOrDefault? E.g. sqf private _myValue = _hashMap getOrDefault ["a", ([0, 4, 10] call LEAF_fnc_calculateScore), true];

open hollow
tender fossil
ornate whale
#

Can I track player's projectile from the server, or is it a local argument only? BIKI says Local Argument.
_projectile addEventHandler ["Explode", { ... }; //on server for player's projectile