#arma3_scripting

1 messages · Page 144 of 1

meager granite
#

Add lots of logging to see what's going on

fair drum
# meager granite Add lots of logging to see what's going on

Disabled all filtering and just logging beginning of EHs

FiredMan - No Detonation Yet

12:52:00 [CARRIERSTRIKE] (Mission) LOG: Fired Man
12:52:00 [CARRIERSTRIKE] (Mission) LOG: Projectile: 627389: c4_charge_small.p3d
12:52:00 [CARRIERSTRIKE] (Mission) LOG: Ammo: DemoCharge_Remote_Ammo
12:52:00 [CARRIERSTRIKE] (Mission) LOG: Simulation: shotmine
12:52:00 [CARRIERSTRIKE] (Mission) LOG: Adding event handlers to projectile: 627389: c4_charge_small.p3d
12:52:00 [CARRIERSTRIKE] (Mission) LOG: Explosion EH Successful: 627389: c4_charge_small.p3d
12:52:00 [CARRIERSTRIKE] (Mission) LOG: HitPart EH Successful: 627389: c4_charge_small.p3d
12:52:00 [CARRIERSTRIKE] (Mission) LOG: Submunition EH Successful: 627389: c4_charge_small.p3d

HitExplosion && HitPart - Detonated

// no response

Generic HandleDamage is picking up the projectile/hit though

meager granite
#

What object are you blowing up?

fair drum
#

"Land_Device_disassembled_F" wonder if that object just doesn't track? I'll try other objects.

#

On a helicopter (ghosthawk)

FiredMan

12:51:06 [CARRIERSTRIKE] (Mission) LOG: Fired Man
12:51:06 [CARRIERSTRIKE] (Mission) LOG: Projectile: 627276: c4_charge_small.p3d
12:51:06 [CARRIERSTRIKE] (Mission) LOG: Ammo: DemoCharge_Remote_Ammo
12:51:06 [CARRIERSTRIKE] (Mission) LOG: Simulation: shotmine
12:51:06 [CARRIERSTRIKE] (Mission) LOG: Adding event handlers to projectile: 627276: c4_charge_small.p3d
12:51:06 [CARRIERSTRIKE] (Mission) LOG: Explosion EH Successful: 627276: c4_charge_small.p3d
12:51:06 [CARRIERSTRIKE] (Mission) LOG: HitPart EH Successful: 627276: c4_charge_small.p3d
12:51:06 [CARRIERSTRIKE] (Mission) LOG: Submunition EH Successful: 627276: c4_charge_small.p3d

Hit Explosion

12:51:15 [CARRIERSTRIKE] (Mission) LOG: Hit Explosion
12:51:15 [CARRIERSTRIKE] (Mission) LOG: Projectile: 627276: c4_charge_small.p3d
12:51:15 [CARRIERSTRIKE] (Mission) LOG: Ammo: any
12:51:15 [CARRIERSTRIKE] (Mission) LOG: Simulation: shotmine
12:51:15 [CARRIERSTRIKE] (Mission) LOG: Hit Entity: 2cab770c080# 627205: heli_light_03_unarmed_f.p3d
meager granite
#

Huh, it doesn't register for me either

#

Looks like there are some model requirements for these events to register

fair drum
#

I wonder which one, so I can just change the object to something different

edit: none of the device alternatives work either

haughty sand
#

is anyone able to help me with extdb3 for amra 3 server database? i have it set and running but is saves data locally to .vars not to a db on my server. Somthing has caused my server to imprint a bad local db save to the players .vars file causing the scripts on my server to not run for select players. I know it is in the .vars because when i told them to delete it, it worked. A few joins later the server re-imprints on their profile making the scripts no longer run again for select players out of random. what do i do

meager granite
#

Looks like an oversight that these events don't even trigger to be honest

fair drum
#

Worth a ticket? Or would it be a pain in the backend too?

#

Its weird though, since shotbullet and shotrocket work find

#

maybe I could do a explode projectile event handler and just do a distance check instead for the satchels

edit: yes i think this is the answer. I'll pull the explosion radius from the config and do a distance check

outer bay
#

I am writing a script that does something akin to garrisoning units, but basically it just copies a single unit's loadout and creates new units in the places of pink helper arrows.

      {
        _unitLoadout = getUnitLoadout _entity;
        _unitGoggles = goggles _entity;
        _grp = createGroup east;
        if (side _entity == west) then {
          _grp = createGroup west;
        };
        if (side _entity == resistance) then {
          _grp = createGroup resistance;
        };
        if (side _entity == civilian) then {
          _grp = createGroup civilian;
        };
        _count = _count + 1;
        _unit = _grp createUnit ["B_Survivor_F", getPosATL _x, [], 0, "NONE"];
        _unit setPosWorld (getPosWorld _x);
        [_unit] joinSilent _grp;
        _unit setUnitLoadout [_unitLoadout,true];
        removeGoggles _unit;
        _unit addGoggles _unitGoggles;
        if (_randomizeRotation) then {
          _unit setDir random 360;
        };
        {_x addCuratorEditableObjects [[_unit],true];} count allCurators;

        if (_deleteArrows) then {
          deleteVehicle _x;
        };
      } forEach nearestObjects [_entity, ["Sign_Arrow_Pink_F"], _radius];

Everything works totally fine here, except for the fact that the goggles slot is not populated by the getUnitLoadout and setUnitLoadout combination. Everything else is copied except for the facewear, and I even tried manually getting the goggles, removing the new unit's goggles, then assigning the saved classname via addGoggles with no success. Every time the units spawn, they either have no facewear, tactical glasses, or the combat goggles and it seems pretty random.

#

My first assumption was that the getUnitLoadout doesn't save facewear, but the _unit addGoggles _unitGoggles; line isn't doing anything either so now I'm just stuck

meager granite
#

Worth a ticket*

south swan
#

inb4 character randomization

fair drum
south swan
#

yeah

fair drum
sullen sigil
#

have you tried cba_fnc_getloadout and cba_fnc_setloadout

outer bay
#

I thought maybe it had to do with the unit I was using as the base when creating the unit since the B_Survivor_F always randomly picks between no facewear, tac glasses, or combat goggles, and the B_RangeMaster_F always has the tac glasses

sullen sigil
#

yep artemoz called it

sullen sigil
#

hello again btw artemoz nice to see you're back

south swan
#

yeah, hello, i guess 8 months of no arma is enough to fix my arma/life balance after averaging like 6 hours per day 🤣

sullen sigil
#

your daily inb4s were missed

granite sky
#

hmm. B_Survivor_F does not appear to have an init event handler.

#

@outer bay Are you running with any mods?

outer bay
outer bay
#

I'm developing with pub zeus in mind

#
{
        _unitLoadout = getUnitLoadout _entity;
        _unitGoggles = goggles _entity;
        _grp = createGroup east;
        if (side _entity == west) then {
          _grp = createGroup west;
        };
        if (side _entity == resistance) then {
          _grp = createGroup resistance;
        };
        if (side _entity == civilian) then {
          _grp = createGroup civilian;
        };
        _count = _count + 1;
        _unit = _grp createUnit ["B_Survivor_F", getPosATL _x, [], 0, "NONE"];
+        _unit setVariable ["BIS_enableRandomization", false];
        _unit setPosWorld (getPosWorld _x);
        [_unit] joinSilent _grp;
        _unit setUnitLoadout [_unitLoadout,true];
        removeGoggles _unit;
        _unit addGoggles _unitGoggles;
        if (_randomizeRotation) then {
          _unit setDir random 360;
        };
        {_x addCuratorEditableObjects [[_unit],true];} count allCurators;

        if (_deleteArrows) then {
          deleteVehicle _x;
        };
      } forEach nearestObjects [_entity, ["Sign_Arrow_Pink_F"], _radius];

Yeah this is what I tried, but I guess if the config for the survivor unit doesn't have the handler, I'll need to find one that does

granite sky
#

I guess the goggles are from the identity, not the headgear randomization.

outer bay
#

So maybe I'd have to find the identity that has those goggles and use setIdentity

granite sky
#

You'd kinda expect the identity to be set locally on unit creation anyway...

#

The headgear randomization thing at least has the excuse for a delay.

south swan
#

right when i was typing my half-joke about spawning a separate thread

fair drum
#

oh look at that, a diff syntax. wonder if you can combine it with other syntaxes

sullen sigil
#

how on earth do you do that

outer bay
#

diff

#

yikes

fair drum
#

```diff
stuff

outer bay
#

```diff

south swan
#

looks flashmob-y

sullen sigil
#

oh

granite sky
#

@outer bay What's your testing context here btw?

outer bay
#

```diff

  • diff remove
  • diff add
    nothing changed
    ```
south swan
#

eyyy, markdown strikes again notlikemeow

outer bay
granite sky
#

In general terms.

#

Like you can replicate this behaviour in SP?

outer bay
#

I am currently in single player

granite sky
#

ok

outer bay
#

yeah the script properly creates and loads loadouts on both SP and MP, but both do not have correct facewear

#

one other piece of context is that I am using the EZM framework to make this a module, so that's where the execution occurs

granite sky
#

Confirmed, this generates mismatches in SP:

_grp = group player;
_unit = _grp createUnit ["B_Survivor_F", getPosATL player, [], 0, "NONE"];
_goggles = goggles _unit;
[_unit, _goggles] spawn {
    params ["_unit", "_goggles"];
    sleep 2;
    hint format ["Old goggles %1, new goggles %2", _goggles, goggles _unit];
    deleteVehicle _unit;
};
south swan
#

CBA running? With its separatly stored XEHs? blobdoggoshruggoogly

granite sky
#

nothing except ADT

south swan
#

fun stuff. As always.

granite sky
#

Engine adding frame delay for some goddamned reason

south swan
#

inb4 head spawns a frame later than body

granite sky
#

inb4 dedmen tries to fix it and everything breaks

south swan
#

yaay for reason to finally dive Reforger?

granite sky
#

hah

outer bay
#

so what I'm getting from this is that it is a real limitation

#

not a lot I can do for a workaround under my current implementation

granite sky
#

You'd need to add a delay before setting the loadout.

outer bay
#

any delay at all? sleep 0.01 would suffice or is there a number to be safe

#

or will I have to experiment

granite sky
#

Trying to figure that out atm.

south swan
outer bay
#

though I do wonder if that would be different on an MP server

#

0.05 worked as well, I think I'll just leave it at that so at least the script doesn't accidentally spawn 1000 units all at once if it was given the chance to

granite sky
#

one frame seems normal. Given that it's engine it shouldn't be variable.

#

fun fact, if you add an each frame handler it runs in the same frame you added it, and the goggles aren't there at that point either.

#

Kinda the wrong test given that we care when they're added relative to when scripts execute :P

fair drum
#

try CBA_fnc_execNextFrame

granite sky
#

wtf is with you people and CBA. CBA is just script.

fair drum
#

cause all of the lovely math is already done for you in these cases. frame comparisons, delays, etc

granite sky
#

CBA execNextFrame uses eachframe addMissionEventHandler, so same problem. This works for scheduled code anyway:

_grp = group player;
_unit = _grp createUnit ["B_Survivor_F", getPosATL player, [], 0, "NONE"];
diag_log format ["Start frame %1 goggles %2", diag_frameno, goggles _unit];

[_unit, diag_frameno] spawn {
    params ["_unit", "_start"];
    while {true} do {
        diag_log format ["Frame %1 goggles %2", diag_frameno, goggles _unit];
        if (diag_frameno > _start + 10) exitWith {};
        uisleep 0.001;
    };
    deleteVehicle _unit;
};
#

So confirmed next frame works for both scheduled and unscheduled code.

south swan
#

face _unit starts as "Default" and changes next frame as well 🍿

granite sky
#

Did you check the name?

south swan
#

nah, only face and goggles for now

granite sky
#

confirmed name has same issue.

#

Newly spawned units have blank name.

south swan
#

workaround with unclear sideeffects: lockIdentity _unit; right after spawning the unit. Facewear set by setUnitLoadout getUnitLoadout doesn't get changed 🤣

granite sky
#

nice

south swan
#

side effect 1: unit doesn't get a name 🤣

sullen sigil
south swan
#

i mean, CBA exists in that grey area between language core library and NPM's leftPad package

opal zephyr
#

Is there any way to force a specific lod to load for a vehicle? Like the cargo lod even if you arent inside the vehicle? Google isnt giving anything.
I'm also good with being able to create an object with that lod, like a simpleObject

sullen sigil
#

no

stuck palm
#

Solved.

In fn_endMission:

"NUP_endSequence.sqf" remoteExec ["execVM", 0]; 

then in NUP_EndSequence.sqf

private _playerSide = side player;
if (_playerSide == Winner) then {
    // Display win message with typewriter effect
    [
        [WinMessage, "<t align='center' shadow='1' size='1.0'>%1</t><br/>"]
    ] spawn BIS_endText;

    playMusic ["LeadTrack01_F_Bootcamp", 132];
    0 fadeMusic 2;
} else {
    // Display lose message with typewriter effect
    [
        [LoseMessage, "<t align='center' shadow='1' size='1.0'>%1</t><br/>"]

    ] spawn BIS_endText;

    playMusic "BackgroundTrack03_F_EPC";
    0 fadeMusic 2;
};
//camera script here
waitUntil { diag_tickTime - _start >= 25 };
 5 fadeMusic 0;
waitUntil { camCommitted _camera };
endMission "end";

Thanks for the help attempts!

meager granite
#

Btw boundingBox's boundingSphereRadius does change for each segment and it shows almost perfect segment size ONLY if segment is bigger than base model. So its always more than 0.3.

#

Thought its a perfect way to get segment length fast but no

#

So far the fastest way to get segment length is vectorMagnitude vectorUpVisual _seg * 0.3

#

0.3 is model height for RopeSegment from bounding box

meager granite
#

Well I'm not sure if it was worth it 🤔

#

Military simulation indeed

hallow mortar
last tapir
#

this must be a repeating topic here but.... is there a good workaround for seting night time to a specific player? (setAperture wont work in this case because i want players to be capable of using flashlights and nvgs.)

the idea is, players can enter a bunker and i want it to be very dark, forcing players to use nvgs and fleshlights

#

i know that time in arma is set globaly but would it work to run a
[] spawn {while (playerInsideBunker) do{setdate[2024,1,1,0,0];}; };

or something like that? or is setdate a server onl command?

#

i am thinking of forcing the player to update frequently to night time before server syncs in

#

dont know... just an idea

meager granite
#

Updating time regularly might not work very well because changing date causes micro freeze

#

Won't be a smooth experience

#

Sadly this forced sync ruined a lot of stuff in A3

ornate whale
meager granite
#

Compared to attaching rope to a unit

#

Also tilts the unit by rope orientation

ornate whale
#

It works fine, this is a good addition, will stick with dev build for now.

#

There are some new angular velocity commands in dev build, could it be of any use for your Nautilus?

little raptor
#

Also the flashlights can be scripted directional lights attached to the weapon (with very large intensity to cancel the effect of setAperture)

sullen sigil
#

leopard spent so long trying to help me with it lol

cyan dust
#

Good day. I'm trying to spawn a ModuleHideTerrainObjects_F module. And facing a strange issue - if there is a player object nearby it will work in most cases. If there is no one nearby - it will not work at all. I suppose it has something to do with dynamic simulation? Did anyone face the same issue before? Is there a workaround/fix?

UPD: it's even wierder than that - it seems like it has something to do with how much time has elapsed since the start of the mission

fair drum
#

They really only work correctly at mission start. If you want to hide terrain objects mid mission, use nearest terrain objects and hide them through script.

stoic flame
#

Selam alekum

#

Türk varmı

cyan dust
finite bone
#

Is there a way to check if a script / function is clogging the network in a multiplayer environment?

granite sky
#

Usually easiest to read it :P

#

Like if you know which function might be problematic. If not then there's profiling, but you can't get complete information there.

cyan dust
# cyan dust Good day. I'm trying to spawn a `ModuleHideTerrainObjects_F` module. And facing ...

Jesus Christ I swear this game works in mysterious ways sometimes.
Just in case anyone will face the same issue spawning a module mid-game that seems not to work. What you got to do is to save mission with module in it, so save -> export -> sqf -> copy. And follow exactly as in copied code:

  1. Spawn module with createUnit
  2. Setup variables
  3. Setup setVariable ["BIS_fnc_initModules_disableAutoActivation",true]
  4. ... continue spawning other objects
  5. And right after you placed everything else, get back to the module and setvariable ["BIS_fnc_initModules_activate",true]

There. It works now. pepe_smoke

ornate whale
#

Why is this code so slow (~0.2ms)? I have rewritten in differently, and it takes like 33 times less to finish. I don´t get it.

private _eyeDirVec = vectorNormalized (eyeDirection opf1); 
private _targetVec = (getPos opf1) vectorFromTo (getPos player); 
private _dotProduct = _eyeDirVec vectorDotProduct _targetVec; 
private _horizontalAngle = acos _dotProduct;
hallow mortar
#

getPos is relatively slow, use one of the specific format commands if possible

south swan
cyan dust
stable dune
#

You could do that without module.
Just some dot or some other marker, and hideObjectGlobal nearest objectsm

south swan
#

they have a massive-ish mission that dynamically spawns submissions. I suppose the problem surfaces at that point

#

and submissions are created by different people, exported to SQF and stored in the main mission as plain pieces of code to run. At least that's what i remember of it. Having to manually add code to run may be inconvenient in the workflow or something.

#

huh, unintended pun of "submission" here

fair drum
cyan dust
#

But I'll keep both options in mind just in case. Thanks

cyan dust
south swan
half sapphire
#

hi guys. quick question. is there a cleaner/better way to check admin status both in dedi and listen other than this:

((admin parsenumber getplayeruid player == 1) or (admin parsenumber getplayeruid player == 2) or (owner player == 2))

its mostly for addactions so _caller would be used instead of player.

#

im not sure if owner player always returns 2 for the host in a listen server tho.

half sapphire
#

... i guess "local player" would only be true for the host, all the time...

half sapphire
#

... or "isServer" lol.

drowsy geyser
#

Is it possible to attach tracer model to a bullet without changing regular ammunition?

#

this model a3\weapons_f\data\bullettracer\tracer_red.p3d attach it to the projectile with fired eventhandler?

queen cargo
#

@native hemlock

  1. use tripple ` for code blocks
  2. your code lacks support for different keyboards and non-default settings thus actionKeys should be used
native hemlock
#

This is true, I was just trying to show a quick and dirty example

queen cargo
#

just wanted to note
and 1. is a hint

drowsy geyser
#

nvm, solved it by using createSimpleObject and attaching it to the projectile

split ruin
#

is it worth two headless clients on same pc, or better only one ? thonk

abstract bay
#

Game lags after 10+ hours of playing, I start the mission with hasInterface in singleplayer, I play in Zeus, I have the mod Alive. I checked the FPS and it's very good but the game still freezes. I don't know what the cause is? I closed Chrome, turned off some applications, turned off the Internet, nothing helps

native hemlock
#

Thanks, I didn't even know that triple ` existed

tough abyss
#

You can still vault with that code by spam clicking V

#

even when using input action. There is no way to prevent vaulting without changing configs

#

And you could bind vaulting to a mouse button, so keydown doesn't prevent that either.

#

Using an animChanged eventhandler doesn't work either. I've tried that before.

#

It causes you to float forward, no matter if you use playMove, switchMove etc.

winter rose
#

when is scripting involved?

astral saddle
#

Hey there gents, Im looking for an Ambient flyby script for a mission. Ive looked on the bohemia site though it has left me confused. I could jsut be slow

stuck palm
stuck palm
#

[startPos, endPos, altitude, speedMode, classname, side] call BIS_fnc_ambientFlyby;

So one way to do this is use a couple of markers, give them a name (pointA and pointB), then something like

// DAP_simpleFlyby.sqf

// Get positions of the points
_startPos = getMarkerPos "PointA";
_endPos = getMarkerPos "PointB";

// Define other parameters
_altitude = 300; //default is 100
_speedMode = "NORMAL"; //default
_className = "B_Heli_Light_01_F"; //default
_side = west; //default

// Call the function to perform the flyby
[_startPos, _endPos, _altitude, _speedMode, _className, _side] call BIS_fnc_ambientFlyby;

Then in your mission init:
execVM "DAP_simpleFlyby.sqf";

@astral saddle

astral saddle
#

That is brilliant thankyou

stuck palm
#

untested

knotty gyro
#

So, problem: I need a civ bus to travel a route. I need the bus to stop at a busstop if the player is standing there and waiting. Then the player needs to "ping" the bus to stop at the next bus stop.
Is this doable simply, with some effort, or a shitload of work? I have a vauge idea about using load/ unload waypoints for the bus, and triggers, but is there a neat and tidy way to accomplish this?

knotty gyro
stuck palm
knotty gyro
#

Ah. Ok. Thanks

little raptor
halcyon creek
#

Hello, trying to get this script working propperly, its telling me im missing a ) but I cannot for the life of me see it:

// Result
if (YESgun=true) then {
Obj2 setTaskState "SUCCEEDED";
["TaskSucceeded", ["", "Get NVGs"]] call BIS_fnc_showNotification;

Specop say "niceshooting";
titletext ["Nice shooting, the NVGs are your's, Im sure you'll put them to good use."];
sleep 5;
player addItemToBackpack "optic_tws";
player addItem "UK3CB_BAF_HMNVS";

Obj3 setTaskState "ASSIGNED";
["TaskAssigned", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
};

else {Obj2 setTaskState "FAILED";
["TaskFailed", ["", "Get NVGs"]] call BIS_fnc_showNotification;
sleep 3;
Obj3 setTaskState "ASSIGNED";
["TaskAssigned", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
};

#

(Yes this is an attempt to port over 100 Days from A2 - A3)

little raptor
# halcyon creek Hello, trying to get this script working propperly, its telling me im missing a ...

You have 2 errors:

  1. if (YESgun = true)
  2. ; before else
// Result
if (YESgun==true) then {
    Obj2 setTaskState "SUCCEEDED"; 
    ["TaskSucceeded", ["", "Get NVGs"]] call BIS_fnc_showNotification;
    
    Specop say "niceshooting"; 
    titletext ["Nice shooting, the NVGs are your's, Im sure you'll put them to good use."]; 
    sleep 5;
    player addItemToBackpack "optic_tws";
    player addItem "UK3CB_BAF_HMNVS";
    
    Obj3 setTaskState "ASSIGNED"; 
    ["TaskAssigned", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
}
else {
    Obj2 setTaskState "FAILED"; 
    ["TaskFailed", ["", "Get NVGs"]] call BIS_fnc_showNotification;
    sleep 3;
    Obj3 setTaskState "ASSIGNED"; 
    ["TaskAssigned", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
};
#

Also if you're using this directly in a trigger code or something you should remove the comments

halcyon creek
#

not in a trigger in a separate SQF

little raptor
halcyon creek
#

Its an incredible campaign from A2 - Dont think the guy has been active since about 2014, but Its more for me than with the intent of releasing it

hallow mortar
#

You can replace (yesgun == true) with just yesgun. You don't need to do a check that returns true/false if the variable is true/false, just use the variable itself.

halcyon creek
#

Cheers to the both of you!

#

One last one, is it possible to addItemToBackpack and addItem to Multiple units by using the squads variable name or will it not like that?

#

or just add a variable name to each unit and add multiple entries?

hallow mortar
#

You can't use the group reference directly, those commands only accept units. But you can use it indirectly:

{
  _x addItemToBackpack "someClassName";
} forEach units _group;```
halcyon creek
#

So with my code above it would be

// Result
if (YESgun==true) then {
    Obj2 setTaskState "SUCCEEDED"; 
    ["TaskSucceeded", ["", "Get NVGs"]] call BIS_fnc_showNotification;
    
    Specop say "niceshooting"; 
    titletext ["Nice shooting, the NVGs are your's, Im sure you'll put them to good use."]; 
    sleep 5;
{
  pfsquad addItemToBackpack "optic_tws";
  pfsquad addItem "UK3CB_BAF_HMNVS";
} forEach units _group;
    
    Obj3 setTaskState "ASSIGNED"; 
    ["TaskAssigned", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
}
else {
    Obj2 setTaskState "FAILED"; 
    ["TaskFailed", ["", "Get NVGs"]] call BIS_fnc_showNotification;
    sleep 3;
    Obj3 setTaskState "ASSIGNED"; 
    ["TaskAssigned", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
};```
hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
hallow mortar
#

And no, that's not quite right

#

https://community.bistudio.com/wiki/forEach
_x is a magic variable that represents the current item that the forEach is operating on. Don't replace that, it's important.
If your group is named pfsquad, then that's the reference you need to use to get the list of units, which the forEach is applied to.

{
  _x addItemToBackpack "optic_tws";
  _x addItem "UK3CB_BAF_HMNVS";
} forEach units pfsquad;```
halcyon creek
#

Gotcha!

#

im taking it that I cant just drop that in the middle of the code though as the "{}" brackets will throw off the other code?

hallow mortar
#

It's safe to put it exactly where you put it in the code you posted a minute ago (although you should give it one extra indentation to make it visually clear what scope it's in)

#

The { } don't throw anything off, they're just the start and end of a piece of code; they can be put inside other pieces of code as long as they're a correct matching pair.

#

They don't work the same as the "" used for strings. You have to be careful doing this with strings because they use the same character for start and end, so nesting them can confuse the game. With {} the game can tell whether it's a start or end and find its correct counterpart.

halcyon creek
#

I think im following you there

#

it doesn't seem to be liking something however, It says one element produced and 6 expected

sweet vine
#

Making a simple restricted arsenal, however I can't seem to be able to add items to the arsenal for whatever reason, what am I doing wrong?

Weapons, Mags & Backpacks work, problem is only with Items....

// works - i don't want to do this
// add everything
[player, ["%ALL"]] call BIS_fnc_addVirtualItemCargo;


// does not work
// all items excluding weareables
_itemsAll = "(  getText (_x >> 'vehicleClass') isEqualTo 'Items' )" configClasses (configFile >> "CfgVehicles") apply {configName _x};
[player, _itemsAll] call BIS_fnc_addVirtualItemCargo;
// grasping at straws, do not work either
[player, _itemsAll, false, false] call BIS_fnc_addVirtualItemCargo;
[player, _itemsAll, true, true] call BIS_fnc_addVirtualItemCargo;


// does not work
// basic test items 
_itemsAll = ["Item_Rangefinder","Item_NVGoggles","Item_NVGoggles_OPFOR","Item_NVGoggles_INDEP"];
[player, _itemsAll] call BIS_fnc_addVirtualItemCargo;
hallow mortar
exotic flame
#

I know a dll can return a maximum of 10240 octets, but is there a limit to the size of passed arguments ?

vapid ledge
#

Gents, question for you. How do I find the variable name of weapons and ammo for modded vehicles (specifically the RHS Mi-24V)? I want the Hind's gun to place on a vehicle using the addWeapon and addMagazine scripts.

hallow mortar
#

Do you mean the classname?
Exactly the same way as you would with a vanilla vehicle - look it up in the Config Viewer.
The vehicle's weapons are either in its first-level config under weapons (for driver-controlled weapons) or in its Turrets >> whicheverTurret subclass under weapons, for weapons controlled by other crew members.

winter rose
winter rose
#

damn, Extensions and their scattered doc

exotic flame
#

My bad, i didn't even see the page says there is no limit to how much data you can pass to the extension

halcyon creek
#

Im curious, anyone have a quick and dirty way of making the scripts trigger for all playable units no matter who triggers it?

#

So for example if the script currently says

player setPos [getPos tent select 0, getPos tent select 1, 1];

Could this be changed to

allPlayers setPos [getPos tent select 0, getPos tent select 1, 1];

And when one unit triggers the action it will happen for all playable units? or is this wishful thinking?

halcyon creek
#

So say putting this one one script rather than just a small snippet would this work?

{
    Obj3 setTaskState "SUCCEEDED";
    ["TaskSucceeded", ["", "Return to Camp Manchester"]] call BIS_fnc_showNotification;
    leed removeAction 0;

    player say "gotNVG";
    titletext ["Good News Sir, I have the NVGs","plain down"];
    sleep 4;
    leed say "GotNVGr";
    titletext ["You have them, excellent! Ill hand them out, keep one for yourself. Get some sleep, its going to be busy soon.","plain down"];

    sleep 12;
    nul=[] execVM "nightfall.sqf"; 
    leed addItem "UK3CB_BAF_HMNVS";
    leed assignItem "UK3CB_BAF_HMNVS";
} forEach units player;
#

or would it have to be broken down for multiple secions with the forEach?

stable dune
hallow mortar
#

You don't need the nul= for execVM. That's an old thing that was a) only for Editor code fields and b) fixed

halcyon creek
#

Alright, but in theory if I used the code posted above but changed the middle and put it over the scripts it would work for all playable clients right? or would it have to be broken down

fair drum
halcyon creek
#

Didnt even know you could do that

fair drum
#

Gotta start learning to test MP stuff. It's much faster feedback than constantly coming back and going, "will this work?". Now all you have to come back with is, "well I got this error here, now what do I do?"

hallow mortar
#

Is there a way to find the file size of a mission by script? I feel like probably not because it wouldn't be very useful, but I'm curious

abstract bay
hallow mortar
#

It's really hard to say if that would be a script problem, or a mod problem, or just your PC sharting itself...after 10 hours(!) of playing I wouldn't be completely surprised if something self-annihilates even without specifically doing something wrong

abstract bay
#

yeah but how

ornate whale
#

Is it possible to use class CfgUserActions in a mission scenario? Or to invoke a custom function on keypress other than with an event handler?

winter rose
# abstract bay yeah but how

remove all mods, run a vanilla game for 10h
if it does not slow down, it's a mod or a script

there is unfortunately no magic way to find out

winter rose
ornate whale
winter rose
ornate whale
#

Could do it with cycling, but that is an undesirable burden for CPU.

winter rose
#

add a UI event handler for when the displayed weapon name changes

faint oasis
#

Hi, is there a way to order the AI to look at a specific direction with a vector or something like that and order it to fire with the "forceWeaponFire" command ? Because i tried the command lookAt but it's just a simple direction and the weapon is in "Low Ready" position so it can't shoot the front target, it will shoot the ground instead.

spiral trench
#

@tough abyss Wouldn't using

#

_this select 1 in actionKeys "StepOver"

#

catch it every time?

ornate whale
faint oasis
#

I think i can place a gamelogic and target it, i'm not sure if that will work but i will try, btw thank you for your answers 😄

winter rose
hallow mortar
ornate whale
hallow mortar
#

Yes, it was added to dev branch in the 15/5 update

#

slotItemChanged was added....before that...so is also available on dev

#

Keep in mind that if you use it, other people will also need to be on dev to use whatever system you made with it, until it releases to stable

ornate whale
hallow mortar
spiral trench
#

action name is actually "getOver"

ornate whale
#

I am having a problem with my scripts, they are running fine in SP, hosted MP, but when I launch it on a dedicated server (current dev build), everything seems to be broken. I am trying to figure out what is causing this problem, but with no luck. It seems like that the server does not initialize all my scripts properly. When I do it manually from the debug console, it works.
This is my init.sqf

if (isServer) then {
    call STMOD_fnc_initSettings;
    call STMOD_fnc_processSettings;
    opfor call STMOD_fnc_setupEnemy;
    pl1 call STMOD_fnc_setupPlayer;
};

Do you have any tips?

thin fox
#

Hello.
I'm doing a PVP scenario that involves 1) Briefing time 2) make halo jumping for a group avaliable only in a specific location, 3) the leader of this group when isTouchingGround can call to paradrop a off a box to 4) set up a respawn point for this group.
All of this by addAction, all of them only the leader of the group can see it.
The main mechanism for this I got it working nicely.
Now i'm looking for "safety measures" about the MP environment. Like, if some leader of these groups disconnects in the middle of these 4 steps above and get back to the game.
Is there a nice way to "inform" the player that connects later, in what stage of those steps the game is? In specific, in what stage of the player group itself is (if they've already halo, if they've already called paradrop, if they've already set up a respawn point).
I've tried using (group player) setVariable and (group player) getVariable, I got something, but I can't go around it when the player connects, it resets those variables of course.

last tapir
# little raptor Also the flashlights can be scripted directional lights attached to the weapon (...

got any code examples on both of these solutions? i tried nvgs with setAperture but it got very bright anyways because the lighting was high anyways. and about the flashlights seems like a good solution but i have no idea on how would i be able to script that with a player only inside the selected location, I do have a variable called "isPlayerInsideBunker" that could be used to trigger that. but if you got examples that would be very helpful. But thanks in advance 🙂

native hemlock
#

Yeah I don't know what you can really do about mouse buttons

bleak gulch
native hemlock
#

I haven't been able to vault using this no matter how hard I spammed (findDisplay 46) displayAddEventHandler ["KeyDown", { if(_this select 1 in actionKeys "getOver") then { true; } else { false; }; }];

#

But using middle mouse or another button gets around it

still forum
meager granite
#

Still wish there were more handy commands to deal with ropes

still forum
#

#arma3_scripting message
Uh that source view works with current arma script profiler version?
I have not seen that before

#

probably only works when the script file has the absolute path, and not with internal relative paths. Like what all mods would have.. Which is why I never see it.
Dang that would be so nice to have, if only I had time to improve ASP 😄

little raptor
# last tapir got any code examples on both of these solutions? i tried nvgs with setAperture ...

Here's something to begin with.
You must call it globally for every client using remoteExec, like this:

[true] remoteExecCall ["My_fnc_isInsideBunker, 0]

And use false once outside

To test it locally, you can just manually set _isInside=true or _isInside=false instead of the params

params ["_isInside"];
TAG_isInsideBunker = _isInside;
TAG_isLightOn = false;
if (_isInside) then
{
    setAperture 200;
    {
        deleteVehicle (_x getVariable ["#flashlightObj", objNull]);
        _light = "#lightreflector" createVehicleLocal [0,0,0];
        _light setLightDayLight true;
        _light setLightIntensity 0;
        _light setLightAmbient [1, 1, 1];
        _light setLightColor [1, 1, 1];
        _light setLightConePars [45, 10, 0];
        _light attachTo [_x, [0.05,0.1,-0.05], "proxy:\a3\characters_f\proxies\weapon.001", true];
        _x setVariable ["#flashlightObj", _light];   
    } forEach allPlayers;
}
else
{
    setAperture -1;
    {
        deleteVehicle (_x getVariable ["#flashlightObj", objNull])
    } forEach allPlayers;
};

if (missionNamespace getVariable ["TAG_lightKeyEvent", -1] >= 0) exitWith {};

TAG_lightKeyEvent = addUserActionEventHandler ["headlights", "Activate", {
    if (TAG_isInsideBunker) then 
    {
        TAG_isLightOn = !TAG_isLightOn;
        (player getVariable ["#flashlightObj", objNull]) setLightIntensity ([0, 3e6] select TAG_isLightOn)
    }
}]
#

It assumes all players enter/leave the bunker together

#

It also makes the flashlight key (default: L) toggle the custom flashlight obj

ornate whale
# fair drum any errors?

@bleak gulch @fair drum #arma3_scripting message
I got this error.

 2:33:21 Mission stmod.Stratis: Missing 'description.ext::Header'
 2:33:23 Error in expression <tings;
opfor call STMOD_fnc_setupEnemy;
pl1 call STMOD_fnc_setupPlayer;
};

if (>
 2:33:23   Error position: <pl1 call STMOD_fnc_setupPlayer;
};

if (>
 2:33:23   Error Undefined variable in expression: pl1
 2:33:23 File mpmissions\__cur_mp.Stratis\init.sqf..., line 7```
pl1 is a variable name assigned to player's unit in Eden.
little raptor
#

MP init order is a bit different from SP

#

In dedicated, pl1 is only defined once that player joins and claims that spot afaik

little raptor
serene sentinel
#

Hi, can someone give me a hint?

params ["_unit", "_container"];

private _weaponsConfig = configFile >> "CfgWeapons";
private _unitRifle = primaryWeapon _unit;
private _ARifle = ("toLowerANSI getText (_x / 'cursor') in ['arifle'] && {getNumber (_x /'type') in [1]} && {getNumber (_x /'scope') == 2}" configClasses (configFile /"cfgWeapons")) apply {configName _x};
private _ARifleselect = (weaponcargo _container) select { _x in _Arifle};
private _ARifleinbox = selectrandom _ARifleselect;
private _compatibleMags = compatibleMagazines [_unitRifle, "this"];
private _compatibleMagsinbox = (magazineCargo _container) arrayIntersect _compatibleMags;
private _compatibleMagsArifleinbox = compatibleMagazines [_ARifleinbox, "this"];
private _compatibleMagsforArifleinbox = (magazineCargo _container) arrayIntersect _compatibleMagsArifleinbox;
private _rifleLoaded = count (primaryWeaponMagazine _unit) > 0;
private _amountofmags = {_x in _compatibleMags} count (magazines _unit + primaryWeaponMagazine _unit);

if ((_unitrifle == _ARifle) and (_amountofmags < 4) and ((count _compatibleMagsinbox) < 4) and ((count _ARifleinbox) > 0) and ((count _compatibleMagsforArifleinbox) > 4)) then {
    } else {
};

_unitrifle == _ARifle is not correct . How can i check that _unitrifle have the same params like in _ARifle ?

little raptor
#

_ARifle is a bool and _unitrifle is a string

#

Nvm _ARifle was an array, missed the config classes (I'm on mobile)

serene sentinel
#

What classes?

little raptor
#

I meant configClasses

serene sentinel
#

Sorry, i don't understand, what i need to do?

little raptor
serene sentinel
#

Ok

ornate whale
glass nest
serene sentinel
#

@glass nest seems it is the right way. Thanks

vast horizon
#

Hello, I want to create a low chance of spawning IEDs in certain places of the map, and I came to that doing so in a scripted file would be better than try to put a lot of triggers and stuff on editor for each place I want a chance of explosives.
Can anyone point me at a simple code to kick it off, for a chance to spawn an IED or mine object in a very specific position?

Would try work for my intentions:
_ied1 = createVehicle ["IEDItem", POSITION, [], 0, "NONE"];

I would still need a way to create a randomized number or a % chance of triggering this

ornate whale
glass nest
kindred zephyr
ornate whale
kindred zephyr
#

you can always operate using MODulo

ornate whale
kindred zephyr
#

do you though?
anything that is not zero is false, using selectRandom [0,1] you would always get the 2 absolute values without rounding so you save command realstate

#

well, many possible solutions

granite sky
#

random 1 doesn't roll 1 anymore, so random 1 >= 0.5 should be unbiased, if that really matters :P

kindred zephyr
#

but at that point you might aswell do selectRandom [true,false] for a 50% roll

last tapir
#

or do this commands like setLightAmbient, setLightDayLight and setLightColor affects all server? or do they run locally?

hallow mortar
#

Lightpoints (the special objects that those commands operate on) only exist as a separate local copy on each client - note the use of createVehicleLocal. So those commands will only affect the local copy that they're used on.

proven charm
#

is there a reason why this code would not work so that JIP message is not removed from queue ? ```sqf
updateJipId = format["%1%2",[_place] call getPlaceStr, _targetSide];

remoteExec ["", _updateJipId]; // Clear previous update call

little raptor
#

That was one way of adjusting it for your case

#

You need to remoteExe it for everyone because lights are local
Of course before all this, test the code I posted locally to make sure it does what you need

fair drum
#

I don't have any explicit absolute paths though

#

But I guess the mission does it itself

ornate whale
#

I am clueles, I have been trying to find a way how to initialize EHs for a joining player or an AI controlled unit in MP game all day, but I can not make it work. I need some EHs to be added on the server and some on a client for each flagged unit. Since units in MP are not instantiated right from the start, I can not use init.sqf. I use a variable as a flag to mark those units which should be setup upon creation, but I struggle to find any reliable way to catch the event of player or AI unit joining/spawning/respawning.
onPlayerRespawn.sqf kinda works for players, but not for AI units.
Event handlers like EntityRespawned, MPRespawn, does not fire on the initial spawn, only on respawn. EntityCreated is fired even before the object's init field is executed, so I can not even read the flag in the namespace of that object. I am really tired of this trial and error and still nothing works. Do you have any tips how to solve this? Thanks.

proven charm
#

initPlayerLocal.sqf & initPlayerServer.sqf could be useful to you

meager granite
#

Check if player is in vault animation and reset it with switchMove ""?

little raptor
#

So I just checked. The game does allow empty strings for fnc
But if you're trying to remove something from JIP queue, use a custom JIP string. Yours looks like the vanilla JIP style which causes the game to do things differently (it tries to get the netID of the JIP string, and then tries to find the remote object, and only then attempts to remove the JIP queue)

little raptor
#

What remoteExec returns by default

proven charm
#

hmm idk if it makes difference if you use the return value or string you created

little raptor
#

That's not what I mean

#

I mean create your own custom JIP ID

proven charm
#

I am

little raptor
#

Not in the "x_y" format

proven charm
#

why not?

little raptor
#

I'm not 100% sure if that's the problem but just try it blobdoggoshruggoogly

proven charm
#

you mean like netId over string?

last tapir
proven charm
little raptor
#

Are you sure what you generate manually is the same as the generated JIP ID by the game? (If you're referring to the first case)

#

In any case, just create a different JIP ID like I said

#

e.g "x??y"

#

Instead of that "x_y"

proven charm
little raptor
#

Are you testing in MP?

proven charm
#

oh I wasnt, used editor MP now and it gives back "2_192"

little raptor
#

Well yeah. Like I said if your custom JIP is also in that format the game does things differently

#

It thinks it's a JIP ID generated by the game itself

proven charm
#

didnt know that

little raptor
#

So create your own format that looks nothing like that

proven charm
#

but in wiki the example also has "MY_JIP_ID"

little raptor
#

Well I'm reading the game source code. Who do you choose to believe?! blobdoggoshruggoogly

proven charm
#

wiki or you 😄

#

maybe this is not accurate then (from wiki): if the string is in format "Number:Number" (e.g. "0:0"), it is interpreted as a netId (see below)
else the string is treated as a custom JIP ID and the remoteExec statement is added to the JIP queue, replacing statements that have the same JIP ID

little raptor
#

That's also correct thonk

little raptor
little raptor
#

My bad

little raptor
#

i.e. the JIP ID you generate when clearing the queue is not the same as what you passed to remoteExec?

proven charm
#

im pretty sure it is (correct one)

#

i think my problem was that the message is already sent over network so it doesnt help to remove it from queue at that point

little raptor
#

Just in case, try logging it

little raptor
proven charm
#

yep and im using same variable "_updateJipId" for those remoteExec calls

#

it wasnt actually JIP issue even I play with that but I needed to send two remexec messages after each other and thats where it got problematic. had to create a workaround

#

the later was supposed to cancel the first one

#

anyways thx for the help Leo, appreciate it

fair drum
rich bramble
#

Are there any SQF UI frameworks/libraries? I'm ideally looking for something high-level like DialogBox("Do you like ice-cream?", ["Yes","No"]) , but anything that abstracts away some of the UI-complications would be appreciated :)

opal zephyr
#

Does anyone know how the arsenal creates the camera that allows you to rotate and pan around the player? I'm trying to replicate it

opal zephyr
#

I think I've found it and it appears incredibly complex and ingrained into the arsenal code

vast horizon
#

this code spawns the IED, but it doesnt denotate by approach as it should, nor is detected by mine detector, as also should

_ied1 = "ACE_IEDLandBig_Range" createVehicle [11650.5,14997.3,0];

Do I need to write something else to "arm" the ied?

warm hedge
vast horizon
high tendon
#

trying to play a schizo poem for my arma 3 mission and i put this in the activation box in my trigger

``class CfgMusic
{
sounds[] = {"sound/boots.ogg"}; // Ensure the path to the audio file is correctly specified within quotes

class boots 
{  
    name = "boots";
    sound[] = {"sound\boots.ogg", db+10, 1.0}; 
    titles[] = {0, ""};
}; 

}; // Added semicolon to close the CfgMusic class definition
``

warm hedge
#

And?

#

Your code doesn't even look legit for Description.ext either, but where is your question

fair drum
#

i detect chat gpt

warm hedge
#

Could be

ornate whale
# fair drum If you still need help I'll message you later tonight.

I have progressed a little bit. Found this solution, but it is buggy. It somehow works on a dedicated server, but it freezes a hosted server after some time of messing around. I suspect that the change in locality when rejoining, dying and respawning breaks something. Here is the code: https://pastebin.com/t9whNEg0

fair drum
ornate whale
high tendon
#

@warm hedge @fair drum I was following a youtube tutorial and I cant figure out why it wasnt working. It says it missing a semi colon and Ive tried fixing it myself before coming here

fair drum
#

what you posted, goes into the description.ext file, not in a trigger

warm hedge
#

Sounds like you haven't followed the tut

fair drum
#

you then call your sound using

playSound "boots";

in the trigger

high tendon
#

copy, ill try that.

#

ive tried that and i dont understand why it isnt working. Im trying to learn but all these tutorials say the same stuff and i need to have this done pretty soon.

fair drum
brisk valley
#

I need some help getting the respawn system to work properly. I have it set up so that my players can respawn, but I want to disable the function where the scenario automatically ends if they all die. I tried unchecking the setting in the attributes menu, but it still ends when everyone dies at the same time.

Is there something I can put into the description.ext to force this setting?

fair drum
brisk valley
#

``#include "VVS\menu.h"

class CfgFunctions
{
#include "VVS\Functions.h"
};``

fair drum
#

that's it? are you adding respawns via the editor attributes or something?

brisk valley
#

Yes, I added respawns via the editor attributes and the editor respawn position module. I've gotten it to work as far as getting to respawn, but as soon as I respawn, a Mission Failed screen comes up

fair drum
#

show me what you have ticked in the editor

#

(btw, description.ext overrides the editor so I can just force it but I'd rather show you)

#

also, are you making sure to preview in multiplayer, not singleplayer?

brisk valley
#

I am previewing in Multiplayer

fair drum
#

scroll down in the rulesets menu

#

and see if there is anything about tickets selected

brisk valley
#

Okay, I wasn't aware that could be empty. I thought it was required to define one.

fair drum
#

yup its the last on you have ticked

brisk valley
#

I had that selected because I thought it was an issue of the game thinking that there was no more tickets left.

fair drum
#

so it was happening before you selected it then?

brisk valley
#

Yes, it was.

fair drum
#

must be something you accidentally enabled in 3den enhanced, and even if you disabled it, it didn't save.

force it via:

respawnTemplates[] = {"MenuPosition", "Counter"};

brisk valley
#

I would prefer to not have respawn tickets at all

fair drum
#

the above removes the ticket system by not defining it

fair drum
#

all 3den enhanced is doing is applying these templates to your mission.sqm instead of the description file

brisk valley
#

I tried the first thing you mentioned, it did not work. I am testing the respawnTemplates[] = {"MenuPosition", "Counter"};

fair drum
#

then lets see whats in VVS\Menu then as well

brisk valley
#

That's a vehicle spawner menu

fair drum
brisk valley
#

I am still getting the same result with MenuPosition and Counter.

fair drum
#

are you in a IDE/text editor? like vscode?

#

something you can search through all files

brisk valley
#

Notepad++

fair drum
#

search all files for BIS_fnc_endMission or endMission

brisk valley
#

No results for either

fair drum
#

something is messed up somewhere. what mods you running

#

if its minimal, i can run through your files in my own editor. if its a bunch, then you're out of luck

brisk valley
#

It's a lot, but the only ones I can think of off the top of my head that would do something like this is ACE and Drongo's Map Population.

fair drum
#

Try remaking a simple version of your mission using vanilla.

ornate whale
# fair drum And? which ones which?

FiredMan and AnimStateChanged on server needs to be re-added every respawn, but not if it's a hosted game (probably applies only to units local to the server). And other EHs, like WeaponChanged, ItemSlotChanged can be added only on clients, these are added just once per join.

brisk valley
thin fox
#

Hello.
I'm trying to run a function by remoteExec targeting a specific "side", but seems like some commands inside the function doesn't work with this type of targeting but it works when the target is 0.
The function is getting variables from sectors and altering its markers, etc.
I can't understand why it's not working by targeting sides

brisk valley
fair drum
fair drum
fair drum
slender turtle
#

Does anyone know of a way to do a trigger that will detect if vehicles of a specific class name? I’m trying to make a trigger where if air vehicle my unit uses enters a specific zone it will destroy their engine and all control surfaces .

#

I know damage was this

v1 setHitPointDamage["hitengine",1];v1 setHitPointDamage["hitrtrack",1];v1 setHitPointDamage["hitturret",1];

But I’m stuck on the class name detection.

fair drum
# slender turtle Does anyone know of a way to do a trigger that will detect if vehicles of a spe...

probably better to use a loop since you don't know if anyone is going to go through the trigger as its already activated and waiting to deactivate for the repeat.

one example:

private _classname = "vehicleclassname";
private _trigger = myTrigger_1;

while {sleep 0.5; !(missionNamespace getVariable ["PLATZ_TriggerDamageArea", false])} do {
    private _vehiclesInArea = entities _classname inAreaArray _trigger;
    _vehiclesInArea = _vehiclesInArea select {!(_x getVariable ["PLATZ_DamagedByTrigger", false])};

    if (_vehiclesInArea isEqualTo []) then {continue};

    _vehiclesInArea apply {
        _x setHitPointDamage["hitengine",1];
        _x setHitPointDamage["hitrtrack",1];
        _x setHitPointDamage["hitturret",1];

        _x setVariable ["PLATZ_DamagedByTrigger", true];
    };
};
slender turtle
#

that

fair drum
#
private _currentDamage = _x getHitPointDamage "hitengine";
_x setHitPointDamage ["hitengine", _currentDamage + 0.5];
slender turtle
#

that makes sense

slender turtle
fair drum
#

first off, you know this isn't going to be placed in a trigger right? this is to be placed in say, initServer.sqf with a [] spawn {/*code};

slender turtle
#

I know I know, only bit in a trigger directly is the variable name

slender turtle
fair drum
#

standby

slender turtle
# fair drum standby

Hey man! Sorry if I don't get back to ya later. Just realized it's past midnight for me and I got work tmr lol.

fair drum
# slender turtle the issue I can kinda forsee is they likely wont allow me to put the code on the...
/* PLATZ_DamageVehicleInArea.sqf */

params [
    ["_triggerArray", [], [[], objNull]],
    ["_classname", "", [""]],
    ["_rate", 0, [-1]]
];

if !(isServer) exitWith {};
if !(canSuspend) exitWith {
    _this execVM "pathTo\PLATZ_DamageVehicleInArea.sqf";    // Edit this line
};

if (_triggerArray isEqualType objNull) then {_triggerArray = [_triggerArray]};
if (_classname == "") exitWith {};
if (_rate < 0) then {_rate = abs _rate};

while {sleep 0.5; !(missionNamespace getVariable ["PLATZ_TriggerDamageArea", false])} do {
    
    private _vehiclesInAreas = [];
    {
        private _vehicles = entities _classname inAreaArray _x;
        _vehiclesInAreas insert [-1, _vehicles];
    } forEach _triggerArray;

    _vehiclesInAreas = _vehiclesInAreas select {alive _x};

    if (_vehiclesInAreas isEqualTo []) then {continue};

    _vehiclesInAreas apply {
        private _engineDamage = _x getHitPointDamage "hitengine";
        _x setHitPointDamage["hitengine", _engineDamage + _rate];

        private _rtrackDamage = _x getHitPointDamage "hitrtrack";
        _x setHitPointDamage["hitrtrack", _rtrackDamage + _rate];

        private _turretDamage = _x getHitPointDamage "hitturret";
        _x setHitPointDamage["hitturret", _turretDamage + _rate];
    };
};
// init.sqf
[trigger_1, "myVehicleClassname", 0.5] execVM "PLATZ_DamageVehicleInArea.sqf";
[trigger_2, "myVehicleClassname", 0.5] execVM "PLATZ_DamageVehicleInArea.sqf";
spiral trench
#

A simplistic function for creating a simple message dialog with 'Yes' and 'No' options is BIS_fnc_GUImessage, not really a 'UI framework/library' @rich bramble , but its something...

proven charm
#

@split vigil I changed _crew moveInCargo _seat; to _crew moveInCargo _helicopter; and it works

thin fox
# fair drum lets see your remoteExec so far

InitServer.sqf:

currentWestSectors = [ sectorA ];
westAttackSector = currentWestSectors select 0; // First sector west side
[ westAttackSector ] remoteExec [ "PIG_fnc_updateAttackMarker", west, "JIPwest"];

fn_updateAttackMarker.sqf:

params ["_sector"];
// get a reference to the trigger of this area
private _trig = _sector getVariable "areas" select 0;
// get the marker for this trigger
private _trigMarkers = _trig getVariable "markers";
private _markerIcon = _trigMarkers select 1; // select 0 - markerArea (grid), select 1 - markerIcon (middle icon), select 2 - iconText (sector's name)
// change type and color of the icon marker
_markerIcon setMarkerType "o_unknown";
_markerIcon setMarkerText "Attack";
_markerIcon setMarkerColor "colorOrange";
// Make marker area visible
_trigMarkerArea = (_trig getVariable "markers") select 0;
_trigMarkerArea setMarkerAlpha 1;
// Change the brush
_trigMarkerArea setMarkerBrush "Border";
_trigMarkerArea setMarkerColor defaultMarkerAreaColor;

Seems like it's mandatory to have to remoteExec this function ^ with the server, but well, every client will see the change, and I want only one side to be able to see it.
Using clientOwner also works.

queen junco
#

Hey, I am trying to create an area-marker (ellipse or rectangle) via script. But it seems like you can't do that with createMarker as the CfgMarkers doesn't include the areas. Any ideas?

south swan
queen junco
ornate whale
fair drum
#

Check to see if the event exists by saving the handle. If it doesn't, then readd

rich bramble
#

@spiral trench Thanks, that's a start :)

hallow mortar
#

With the normal (global) versions, any use of the command broadcasts the whole marker to everyone. Use the local versions to restrict changes (and therefore the marker) to the client where the command is executed.

thin fox
# hallow mortar Use the `local` versions of the marker commands

Thank you for the response. Well, it didn't change anything, I think it's because I'm getting those variables from modules (sectors).
I got it working by calling the function in the init.sqf.
But why is not working with remoting exec side? 😭 It's weird because it's working using clientOwner lol

south swan
#

inb4 init.sqf on client tries to access variables before they're transmitted from the server 🤷‍♂️

queen cargo
#

@rich bramble most of that stuff would require ObjectOriented systems
and those are not rly used widely yet

but feel free to start writing your own using eg. OOS :)

restive hinge
#

I'm kinda lost. It seems I incorrectly passed the variables _doorConsole and _blastDoor into ace_common_fnc_progressBar function.
Maybe anyone could hint me on what exactly I'm doing wrong?

params ["_doorConsole", "_blastDoor", "_unit"];

_hackDoor = ["HackDoor","Hack Door","\A3\ui_f_orange\data\cfgmarkers\civildefense.paa",
    {
        params ["_target", "_unit", "_params"];
        _params params ["_doorConsole", "_blastDoor"];
        _unit playActionNow "Gear";
        systemChat "ACTION";
        systemChat str _doorConsole;
        systemChat str _blastDoor;
        [2, [_doorConsole, _blastDoor],
        {
            // hint "Success!";
            params ["_doorConsole", "_blastDoor"];
            systemChat "BAR";
            systemChat str _doorConsole;
            systemChat str _blastDoor;
            playSound3D ["@A3\Sounds_F\sfx\alarm_independent.wss", _doorConsole];
            // _blastDoor setVariable [format ["bis_disabled_door_%1", _door], 0, true];
            // _blastDoor setVariable ["bis_disabled_Door_1", 0, true];
        }, 
        {
            // hint "Failure!";
        }, "Hacking Door"] call ace_common_fnc_progressBar;
    },
    {
        true
    },{},[_doorConsole, _blastDoor]
] call ace_interact_menu_fnc_createAction;
[_doorConsole, 0, ["ACE_MainActions"], _hackDoor] call ace_interact_menu_fnc_addActionToObject;

The output I get is on the screenshot

iron goblet
#

I would like to create a mod or script that changes the controls for mods that use CBA_A3.

The idea is to give my friends the same controls as me without having to change everything manually and so they don't have to download a copy of my profile.

I'm thinking the solution lies in the profileNamespace
https://community.bistudio.com/wiki/profileNamespace

What are your thoughts on making this happen? If you're not sure, where should I look to start educating myself on modding this?

ornate whale
iron goblet
ornate whale
ornate whale
iron goblet
# ornate whale It was a long time ago, he just proposed an idea to create something like this, ...

Regarding YT, this video is the closest thing after a quick search.
https://www.youtube.com/watch?v=g8z0uPD43sc

Let me take a look at those wiki pages

This Video will show you how to keep your profile settings when creating a new Profile on Arma 3. This includes custom controls such as joysticks as well as Recent and Favourite Servers.

"This video was created using content of Bohemia Interactive a.s."
"Copyright © 2017 Bohemia Interactive a.s. All rights reserved."
"See www.bistudio.com for m...

▶ Play video
iron goblet
#

ChatGPT gave this example:
// customKeybindings.sqf
if (isServer) then {
// Define your custom keybinding
["Jump", "your_custom_key_here"] call CBA_fnc_addKeybind;
};

hallow mortar
#

The syntax it gave for the CBA function call is outright wrong, and using an isServer check for this would be very silly, because custom keybinds by nature are used by each client separately.

iron goblet
#

Yeah, isServer seemed undesirable.

Anyhow, it answered the question of how to possibly edit a CBA keybind of an existing mod via script

#

Any thoughts on the big picture @hallow mortar ?

hallow mortar
#

That addKeybind function appears to be for a mod to add a control in the CBA controls list. It's not the right choice for changing the key an existing control is bound to.

iron goblet
hallow mortar
#

Probably it could but that's a very non-ideal way of approaching this

#

I'm pretty sure the CBA keybindings are stored in variables/a variable in the profile namespace, so in theory it would be possible to getVariable -> copy, send to friend -> setVariable, in order to overwrite their saved keybinds with yours

#

But I don't know enough about how this system works to say exactly how it's stored. The code is fairly complex. The information is in there but I don't want to get into it.

iron goblet
lone steeple
#

[READY] Create and Delete AI gunners to attack and support helicopters

edgy dune
#

In my adventure of submunition stuff, is it not possible for

Explode
Deleted
HitExplosion
HitPart

from https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Projectile_Event_Handlers
not able to use triggerAmmo? I have a simple test script and if I say trigger 1 second after firing the submunitions deploy, but if I have it on any of the above EH the submunition doesnt deploy. This is my script

test_fnc = {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
     //This works
     //sleep 1;
     //triggerAmmo _projectile;
    
    //These dont work
    _projectile addEventHandler ["Explode", {
        params ["_projectile", "_pos", "_velocity"];
        triggerAmmo _projectile;
    }];
    _projectile addEventHandler ["Deleted", {
        params ["_projectile"];
        triggerAmmo _projectile;
    }];
    _projectile addEventHandler ["HitExplosion", {
        params ["_projectile", "_hitEntity", "_projectileOwner", "_hitSelections", "_instigator"];
        triggerAmmo _projectile;
    }];
    _projectile addEventHandler ["HitPart", {
        params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius" ,"_surfaceType", "_instigator"];
        triggerAmmo _projectile;
    }];
};


ace_player addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _this spawn test_fnc;
}];
sullen sigil
#

no, the projectile is deleted next frame after for most of those EHs

edgy dune
slender turtle
#

is there a way to create fog only inside a specific trigger area? Like I have the vehicle damage script I was looking for but I realized I should have some kind of visual effect on it. Read the documentation on particles (https://community.bistudio.com/wiki/Particles_Tutorial) but im not sure how use them to do this.

Critically I need to be able to raise the base of the trigger off the ground and have the base of the fog be visable from below.

warm hedge
#

If you use particle and call it a fog, definitely yes. You can try some of examples by copy n paste to see the ideas of particle

slender turtle
# warm hedge If you use particle and call it a fog, definitely yes. You can try some of examp...

found this online https://www.youtube.com/watch?v=7neNE8EFQks so that might help me figure out how this works

Combined tornado script with a cloud script i made a while ago to see if it can be handled by engine

Arma 3 scripts
https://www.youtube.com/playlist?list=PLod_PhpAOFQhpTRYpoVPwiikPN1aoboFs


[strong]Software used:[/strong]
Drawing: CorelDraw
Animation: FlashMX
Sound processing: Audacity
Video processing: Corel VideoStudio Pro
Video capturing...

▶ Play video
meager granite
#

Wish you could do 12 toFixed -3 to return 012

south swan
#

or 10.3 toFixed [3,4] for 010.3000 🙃

south swan
still forum
cyan dust
hallow mortar
cyan dust
#

Speaking of unreliable: Is there any explanation as to why worldName command returns lowercase in some missions and capital first in others? (e.g.: "stratis" VS "Stratis"). It is somewhat mildly infuriating.

UPD: Even funnier

  • check in my mission: worldName -> "stratis"
  • open my friend's mission: worldName -> "Stratis"
  • open my mission again: worldName -> "Stratis" 🤨
hallow mortar
hallow mortar
cyan dust
hallow mortar
meager granite
#

Renamed the mission name's suffix to AltiS, worldName returns Altis

#

Some mission.sqm value?

#

Mod modifying CfgWorlds config and changing the casing?

cyan dust
cyan dust
#

Just asked my friend, he says '"yeah, this always returned first capital, I even have to do toLower". Which, again, is wild to me as I also use worldName in my mission and it was always lowercase for me.

still forum
#

It takes the name that was passed when the mission was loaded.
So on server what was passed to #mission command, or listed in server config mission rotation.
I would expect for Eden and Server loading, it would just pass the foldername or name of the pbo.

But because filenames being case-insensitive, means they are completely lowercase, a case-insensitive open could pass a lowercased name. Very possible that some places handle it differently.

Also the worldname might only be set on terrain switch.

So first load different terrain, then load mission on that terrain. Could behave differently than loading a mission on a different terrain.

#

Its also different when the file comes from steam.
A workshop mission, it takes the filename from steam, which would probably be uppercase.
A pbo it finds in mpMissions on a server, would come from the case-insensitive filesystem, which would be lowercased.
Eden is windows only, so it doesn't need to care about case-sensitivity, so it might have another way that doesn't use our filesystem that just keeps the case of the mission folder in your documents directory

meager granite
#

A note in the wiki could be useful

#

added

cyan dust
#

👍

restive hinge
timber shore
#

@rich bramble @queen cargo loves his objectoriented coding

ornate whale
# iron goblet Fantastic! Thank you!

@still forum @iron goblet I have looked at the CBA code. I may be mistaken, but my understanding is that it just adds another layer of keybinds on top of the native Arma keybinds. And within this space you can alter the already existing CBA-dependent keybinds. Correct me if I am wrong. For examplpe, if you use W for move forward, you can also use it for triggering an IED explosion event or any other script, but that CBA keybind won´t replace the walking action.

iron goblet
grizzled cliff
#

when i get Intercept done, someone should port Qt to it... :D

#

lmao

#

actually Jaynus already had the basis for a Qt library render in Arma.

ornate whale
# iron goblet Yes. That is how it works. I am hoping to overwrite another mods CBA keybinds th...

Then, this is probably possible, you need to retrieve the mod's existing keybinds from CBA, replace them with your own, there are probably already existing functions for that, then you have to create some script called either through console or some GUI element to ditribute this data over to other clients and invoke a function that will replace their keybinds. You would probably need to implement it as a scenario script or in form of an addon. Look at these folders: CBA_A3\addons\keybinding and CBA_A3\addons\events of the CBA source code. But I bet it will take time and may not pay off in the end.

grizzled cliff
#

but if you learn Qt to just do Arma dialogs something is wrong with you.

iron goblet
#

Yeah. I would prefer it as an Addon..and activate via another keybinds until I can learn to activate via a GUI

polar belfry
#

hello I need help with some code

private _pos = getposasl this;
if ( _pos select 2 > 0) then{
private _dist =(_pos select 2) - 0;
_pos=  this setPos (getPos this vectorAdd [0,0,-distributionRegion]);
};
private _bomb = createvehicle ["pook_SCUD_nuke_spawner", _pos ];
null=[]spawn{
   sleep 3;
   ["cordium_explosion"] remoteExec ["playSound", 0];
};
private _intensity = [1,4] call BIS_fnc_randomInt; 
[_intensity] spawn BIS_fnc_earthquake;
this setDamage 1;```
This runs in a move waypoint of a loitering munition drone
I get the following error
warm hedge
#

_pos is not a valid array

polar belfry
#

I see

#

so doing the getposasl command make a valid array

warm hedge
#

That's not the point

#

It is trying to get the return value of setPos which is nil

polar belfry
#

oh

#

so how can I fix it?

warm hedge
#
_pos = getPos this vectorAdd [0,0,-distributionRegion];```
polar belfry
#

ok thanks

#

I also see instead of -dist it did autofil with its own variable

kindred zephyr
#

Does anyone happen to know the name of the BIS function that handles the squad-mates icons UI rendered on screen above units? (not the static group ones)

ornate whale
#

Does "audibleCoef" unit trait affect also the audibility of gunshots, or just the unit's foosteps alone? Thanks

sullen marsh
#

new game_value when

#

I've found I've actually got nothing to do

#

@timber shore essay?

timber shore
#

huh?

sullen marsh
#

Discord keeps saying you're typing

timber shore
#

weird

sullen marsh
#

for like the past 5 mins

timber shore
#

was typing but not an essay hahaha

#

got a new question for help/assistance, bit more complex than my last. If a player has a weapon in the primaryweapon slot, disallow them to get into a vehicle. if they are in a vehicle with a weapon in the primaryweapon slot disallow them to eject/getout of the vehicle. I'm guessing so far it would be done through EVH's blocking actions of GetInDriver GetInCargo GetOut and Eject if !isNil primaryWeapon player;

fair drum
#

Unit noise, not gunshots

timber shore
#

player addEventHandler["GetIn", {
if (!isNil primaryWeapon player;) then {
player action ["Eject", player];
hint "Store your weapon safely first!"
}
}];

wide wharf
#

hey, what the name of the controller in the middle of screen? I wanna see if the player point of an object

sullen sigil
#

cursorObject

wide wharf
#

thanks you!

haughty sand
#

Does anyone know what causes my arma 3 scripts to not run

#

Ppl can join the server but for a hand full the scripts won’t run.

#

Someone please help me

plush oriole
#

They run for most people?

#

Do they not run for the people who join after the mission begins by any chance?

snow pecan
#

!isNil primaryWeapon player --> primaryWeapon player != ""

haughty sand
fair drum
haughty sand
#

@hallow mortar

jade abyss
#

"... including map objects and trees. "" !

#

No more lineIntersectsObjs :D

analog mulch
#

hi, need help with a script that using a trigger perhaps, rearms the player and AI units to what they originally had at the start of the mission

#

tried using this but it rearms a generic loadout and not the one the unit in the editor

hint "You have been rearmed and healed!";
proven charm
south swan
#

wouldn't replace dropped empty mags, though

analog mulch
#

i have 2 units, p1 (player) and p2 (AI), had the first trigger:

getUnitLoadout p1;
getUnitLoadout p2:
south swan
#

typeof _x returns string

analog mulch
#

didnt get how to rearm them back on rearm trigger

south swan
#

setUnitLoadout <string>; does: When String for class name is supplied, the command will search CfgVehicles for the given class in order to extract the loadout from config.

proven charm
#

so typeof should work?

south swan
#

not if the loadout was changed manually by mission maker or player

proven charm
#

oh right

analog mulch
#

yeah loadout is custom

proven charm
#

id do sqf p1 setVariable ["loadout", getUnitLoadout p1 ]; // Then use that to restore the loadout _x setUnitLoadout (_x getvariable "loadout");

analog mulch
#

in the trigger, right? and it works for AI's loadout?

proven charm
#

the one with _x works with thislist. p1 is for one player only

#

might want to check "loadout" is set for them

south swan
#

first line at some point where the unit still has the full loadout you want to restore to. Mission start, maybe. Or Arsenal closing.

analog mulch
#

mission start wud do

#

put this in the trigger and didnt work:

_x setUnitLoadout (_x getvariable "loadout");
proven charm
#

did you set the "loadout" variable before that?

analog mulch
#

yeah i used this in a separate empty trigger

p1 setVariable ["loadout", getUnitLoadout p1]; 
p2 setVariable ["loadout", getUnitLoadout p2]; 
proven charm
#

ok the timing of that is crucial. idk when the trigger runs. you could use init.sqf file or something

south swan
#

inb4 this setVariable ["loadout", getUnitLoadout this]; in units' init fields

analog mulch
#

didnt work for some reason

#

put this in the unit's init

#

this in the trigger that will rearm them back

#

and this in the mission's init.sqf:

p1 setVariable ["loadout", getUnitLoadout p1]; 
p2 setVariable ["loadout", getUnitLoadout p2]; 
proven charm
#

your missing the "foreach thisList;" loop that you first had

#

{ _x setUnitLoadout (_x getvariable "loadout"); } foreach thisList;

#

put that in the second trigger activation

#

im not good with triggers but i think thats it

south swan
#

and trigger being not repeatable sure adds to confusion :3

analog mulch
#

ty

#

p1 was able to rearm but not p2, trigger set to repeatable

#

p2 is AI

#

p1 is player

#

also is there a way to use this for the entire group, lets say i got like 9-12 AI units in my group, i would like them to rearm their original loadout when we get back to base or something

analog mulch
hallow mortar
#

... forEach units _group

analog mulch
#

and _group has to be my groups variable name, correct?

#

forEach units bravo

analog mulch
#

ty

vapid scarab
thin fox
#

can someone explain how addMissionEventHandler works? I want to show a message using "PlayerConnected" to every client when player enters the mission. Do I put this MEH on initServer or initPlayerLocal?

wide wharf
#

hey, can someone explain what HashMap globally means. The wiki is very understanding but this time I am lost

granite sky
granite sky
twin anvil
#

So, running something on postInit with CFG FUnctions. How do i stop the function from running in the main menu and 3den, (already know how to get it on player client only)?
Google didnt help much. Current guess is checking what UI is currently running. Next step is finding an example via github (no idea where to start) or ask here for the answer🤷

cosmic lichen
#

postInit doesn't run in main menu for Eden, just use if is3DEN exitWith...

twin anvil
#

Weird. Somethings running in menu.
All i got is CBA settings in preinit (to test i disabled this really quick).
and my function in postinit.
thats it. including config.cpp i have 3 files.

what im working with cna adjust saturation so i think its running cuz my menu backdrop (which is a in-game scene if enabled) is black n white.
unless its running postinit for the backdrop but the functions breaking cuz there is no player entity to get info from.

twin anvil
#

Ah
need to do some debugging now.
even with the 3den check its still running in a broken state on 3den first load, but if i play as a character and then back out its fine.

sharp stag
#

Is there a way to check in multiplayer if a specific player is alive but not using his/her name? The player in question has to be set as some sort of "VIP".

granite sky
#

There's steam UID if that's useful.

#

You didn't really describe what you're trying to do, so maybe you wanted the slot instead.

sharp stag
#

Yeah my bad, here is basically what I want to do:

  1. One player has to be the VIP and broadcasted globally, this will be set when that player interacts with an object (got the interact with object already)
  2. Once he is acknowledged by the server as VIP, there is a loop that checks if he is alive and runs something if he dies

What I want to accomplish is making it possible that anyone can be the VIP, without setting it up on mission load

opal zephyr
granite sky
#

If the association isn't supposed to be death-persistent then you can just store the player's object.

meager granite
#

Is velocity part of render state? 🤔

#

Can there be velocityVisual?

sullen sigil
#

in what way

meager granite
#

In the same way as there is simulation state and visual state (getPosWorld vs getPosWorldVisual)

candid sun
#

nice

meager granite
#

I noticed that visual state of segments is very unreliable soon after creation and they get created all the time during rope unwinding. Unreliable in a sense that they zoom from [0,0,0] to their actual position after fraction of a second. Any idea how this could be checked inexpensively?

still forum
#

Mh yeah must be right 🤔

#

🍞

fickle hare
#

how do I make it so the player would spawn inside of a box thats floating in the sky instead of the terrain below

flint topaz
fickle hare
#

yeah a trigger

#

i know what that is

#

yeah..

#

😭

#

(i dont)

#

@flint topaz Could you help me out 🙏

halcyon creek
#

Im sure I have this wrong somewhere, im testing it out, states im missing a ";" on line 4

_players = allPlayers;
{
    titleCut ["", "BLACK IN", 7];
    _x car1 SetPos (getPos) "TP1";
} forEach _Players;```
winter rose
#

also "_x car1"? did chatGPT write that?

halcyon creek
#

Why would it have?

#

I thought you had to add the "magic variable" for all players, maybe you can correct me on that line of thought rather than whatever it was you were trying to do there, please?

halcyon creek
lone steeple
# halcyon creek This also returns the same error too

That's because in such case, "_x" will already act as the object/variable "forEach _Players".
I believe you should keep the _x, but remove the Car1 and use the string from Lou Montana; so try with this:
_x setPosATL getMarkerPos "TP1";
Which means that for every unit/object inside "_players", the script will use "_x" to do the stuff upon every one of them.

#

Oh, by the way, you might not need those "" around TP1, whether it is a variable name...?
_x setPosATL getMarkerPos TP1;

halcyon creek
#

Maybe I should explain what I'm trying to do and see if that works too, I have a vehicle that the players will be driving ("car1"), I would like to make the screen fade to black and then teleport the vehicle with the players from the trigger zone to a designated point ("TP1" which is an empty item with the same variable name)

#

So to confirm:

_players = allPlayers;
{
    titleCut ["", "BLACK IN", 7];
    _x setPosATL (getPos) "TP1";
} forEach _Players;```

But juding by your reaction Im not on the right track here?
lone steeple
#

I think you need to put car1 outside the {}, so every player will have the screen fade out and then the car1 will teleport - bringing all players inside it.
Try this, instead, see if it works as intended:
_players = allPlayers; { _x titleCut ["", "BLACK IN", 7]; } forEach _players; sleep 1; car1 setPosATL getMarkerPos "TP1";

halcyon creek
#

Seems to be doing the trick, however its put me in the middle of nowhere and not on the variable thats TP1

#

but I think thats because its getMarkerPos and not getPos

lone steeple
halcyon creek
#

though I could change the item to a hidden marker and that would work and not have as many assets down?

halcyon creek
lone steeple
# fickle hare chat

That last issue from MrGecko might get exactly what you need.
Try giving that "floating" object a name (like "box1") and disable its simulation, so that it would hang steady on the air.
Then use something like this:
player setPosAtl getPosAtl box1;
As you still haven't got the hang regarding triggers, add the line above on the "init" box of the player, to see how it goes.

lone steeple
fickle hare
lone steeple
fickle hare
#

make it so just the spawn point has an XYZ instead of XY axis

#

right

halcyon creek
#

Another one for tonight whilst I tear my hair out ```sqf
_car1 setFuel 0; obj1 setTaskState "SUCCEEDED";
["TaskSucceeded", ["", "Preparation : Get Transport To Timurkalay"]] call BIS_fnc_showNotification;
player setCurrentTask Obj2;
["TaskAssigned", ["Clear the Way", "Rapier Stage 1 : Clear the way"]] call BIS_fnc_showNotification;

gloomy aspen
halcyon creek
#

Thats how I have it set, as a trigger

#

comes back with, type : string Expected Object

gloomy aspen
#

Can you paste your On Activation text here mate? Ill check it over 🙂

halcyon creek
#
_car1 setFuel 0; obj1 setTaskState "SUCCEEDED";  
["TaskSucceeded", ["", "Preparation : Get Transport To Timurkalay"]] call BIS_fnc_showNotification; 
player setCurrentTask Obj2;  
["TaskAssigned", ["Clear the Way", "Rapier Stage 1 : Clear the way"]] call BIS_fnc_showNotification;
fair drum
# fickle hare I suppose theres no way to uh

You use onPlayerRespawn.sqf, check where the player spawned, if it's within said distance, modify their position with the commands.

I can't help you much as I am in Colorado for the week and don't have my computer

fickle hare
#

alrighty

#

i wish i knew rust

hallow mortar
#

I don't know if that would help given that Arma 3 doesn't use Rust at all

halcyon creek
open hollow
#

well since for some dumb reason i cant use signature check ->#server_linux message

im doing some script to check if more mods are loaded.

Ive tryed to use ace_common module, but ppl is only kicked once the mission starts, i want to warn him before as posible to fix it, ideally when join the server, or at least at role selection... but i cant find a way to do it.

im trying to use bis_fnc_guimesagge, but i cant find a way to execute it in any of this insances

#

ive tryed with a fuction with preinit = 1 , and the displayes aviables are: 11:17:33 "[Display #0,Display #18,Display #70]"

Ive used 70, but it only show when i go out the mission

i can execute this via mod too... but im not finding a way to do it

thin fox
graceful kelp
#

anyone got alot of knowledge on ctab

#

got an issuie where only the side ctab display wont open in our mod heli

raw oyster
#

I saw in a youtube video a bit ago someone was able to have a picture pop up of a person and had executed a audio file of them talking. Trying to find out where to start with creating that.

vapid cloak
#

how can i place a camera thet films me playing

slow brook
#

Heyo.

Anyone know the way to remoteexec a function on a player, then get the data back from it to the server?
The FNC I need to run is, [player] call ace_medical_fnc_serializeState

#

IE


_healthdata = [_player] remoteExecCall ["ace_medical_fnc_serializeState", _pMID];
hallow mortar
#

You need to create a callback, a return remoteExec that sends the requested data back.
e.g.

[_player] remoteExecCall ["my_fnc_aceHealthRetriever",_pMID];
// my_fnc_aceHealthRetriever
params ["_player"];
private _healthData = _player call ace_medical_fnc_serializeState;
[_player,_healthData] remoteExec ["my_fnc_aceHealthCallback",remoteExecutedOwner];```
slow brook
#

so the first one sets up the code to be run, then the second exec sends the data back?

assuming this is done scheduled, how do I get the data to use

hallow mortar
#

What do you mean?

slow brook
#

This function needs to be setup / available on the client side, prior to me calling it, right?

hallow mortar
#

Any function needs to be defined on the machine where it is executed, before it's executed

#

Here's a diagram, hopefully my writing is legible

slow brook
#

So the problem I have here, is that addon is purely Server side. There won't be anything client side to attach to

#

Therefore I need to build this in a way where I can do it all SERVER side.

hallow mortar
#

You can use publicVariable to transmit functions to clients

slow brook
#

I was just looking at using publicVariableServer, to store the data that way

hallow mortar
#

e.g.

my_fnc_healthRetriever = compileFinal { // some code };
publicVariable "my_fnc_healthRetriever";```
slow brook
#

Spawn Wait until ServerVar is notnil
{
Remote exec the code, store output in variable, send it via publicVariableServer
}

#

publicVariable will send it to all clients, which wouldn't be needed here

hallow mortar
#

The point of using publicVariable is to define the function on all clients so that they can be told to execute it later. While it's plausible that not all clients will need to use the function during any given mission, it seems likely that any of them could. Picking and choosing which clients to define the function on is not very important.

slow brook
#

Oh I see what you mean

hallow mortar
#

The reason to use a function is so you can instruct clients to refer to that function, and avoid sending a function's worth of code over the network every time you want to do this task.

slow brook
#

Ok I get that, however this function will only run 1 time in the lifetime of the clients connection. So there's no real gain here 😄

hallow mortar
#

You could use publicVariableServer instead of a function callback, but a function callback is a convenient way to immediately act on that information, rather than relying on a waitUntil or something. It also doesn't require generating unique variable names per player.
Example structure:

// define function and send to clients
my_fnc_healthRetriever = compileFinal {
  private _healthData = "";
  if (alive player) then {
    _healthData = player call ace_medical_fnc_serializeState;
  } else {
    _healthData = "Dead. RIP.";
  };
  [player, _healthData] remoteExec ["my_fnc_healthCallback",remoteExecutedOwner];
};
publicVariable "my_fnc_healthRetriever";
// request info from a particular player
0 remoteExec ["my_fnc_healthRetriever",_targetPlayer];
// my_fnc_healthCallback
params ["_player","_healthData"];
systemChat format ["%1 health info: %2", name _player, _healthData];```
half sapphire
#

hi guys. im kinda having this one issue and im not sure how to solve it. i have some tasks where you have to retrieve an item from a box, or a body. And there is this one instance in which if the "carrier" of the item, or even the item itself, is inside a building and said building turns to rubble, the object gets buried and there is no way to get to it (seems it depends on the type of rubble?). does any of you know of a way to work around this? i've tried playing with checkvisibility in conjunction with other commands but i can't seem to get reliable results.

rigid cedar
#

Hi, I'm looking to make a tweak to the Revive system and was curious how I could change this to setDamage 0.25 instead of 0

#

Also if possible just disable this, I don't want all heals to be full heals

halcyon creek
#

Wee problem, one of you may know, Copied this from the BI wiki and edited just the text that was displayed but its coming back with an error

[
    [
        ["100 Days", "<t align = 'center' shadow = '1' size = '1.0'>%1</t>", 15]
    ]
] spawn BIS_fnc_typeText;
``` the error it comes back with is ```missing [```
#

this is the example ```sqf
[
[
["CAMP ROGAIN,", "<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"],
["RESUPPLY POINT", "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"],
["10 MINUTES LATER ...", "<t align = 'center' shadow = '1' size = '1.0'>%1</t>", 15]
]
] spawn BIS_fnc_typeText;

ornate whale
halcyon creek
#
_camera = "camera" camcreate [0,0,0]
camdestroy _camera;
_camera cameraeffect ["internal", "back"]


;comment "18:02:20";
_camera camPrepareTarget [-17991.63,108614.89,8.34];
_camera camPreparePos [5974.523,11551.71,2.00];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0


~20

titlecut [" ","BLACK out",1]
~1
titlecut [" ","BLACK IN",1]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]


;comment "12:30:21";
_camera camPrepareTarget [66571.51,-71027.65,-10681.14];
_camera camPreparePos [5966.483,11549.305,2];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0



~9
[
    [
        ["100 Days", "<t align = 'center' shadow = '1' size = '1.0'>%1</t>", 15]
    ]
] spawn BIS_fnc_typeText;

~8
endMission "END1";
_camera cameraeffect ["terminate","back"];
camdestroy _camera

enableradio true
showcinemaborder false

exit
warm hedge
#

Excuse me, SQS?

halcyon creek
#

Ah

#

Yeah its an SQS file

winter rose
halcyon creek
#

That will be where im going wrong then, managed a work around with an execVM

thin fox
#

Hello. I'm trying to make a script that kicks the player out of the game using
serverCommand in UI context, but the command isn't working.

_display = ((findDisplay 1133) displayCtrl 1601);
_display ctrlAddEventHandler ["ButtonDown", {
    _player = profileName;
    hint _player; // works
    serverCommand format ["#kick %1",_player];
}];
warm hedge
#

You sure your client has a permission to do it?

half sapphire
#

seems to work 60% of the time, every time. 😛

thin fox
crude flame
#

how do we eject all vehicles from a plane to airdrop

tough abyss
#

@tough abyss That's the great thing about arma, diversity.

#

Has anyone ever fixed the leight opfor pack configs? Configs look really confusing to me. :S

bleak gulch
#

these {} parenthesis....

#

the reason why I use ANSI standard:

{
    {
        {

        }
    }
}

instead of K&R

    {
        {
            {
        }
    }
}

ornate whale
winter rose
bleak gulch
winter rose
crude flame
#

whats the name for ungided 155mm rounds coming from a 2s6

warm hedge
#

You can check in Config Viewer

crude flame
warm hedge
#

?

crude flame
#

so it dosnt work

warm hedge
#

What doesn't work and what have you done then

crude flame
#

"32Rnd_155mm_Mo_shells_0" dosnt work

warm hedge
#

Doesn't work in what sense

crude flame
warm hedge
#

What are you trying to do

crude flame
#

commandArtilleryFire

warm hedge
#

What is your code

crude flame
#

artel1 commandArtilleryFire [getPosATL target,"32Rnd_155mm_Mo_shells_0",32];

warm hedge
#

The class is 32Rnd_155mm_Mo_shells_O and your last character is 0 (zero) not O (alphabet)

last tapir
#

sup every one! is it possible to create and spawn a group that hates every other group? i know that i can create groups on EAST, WEST, INDEPENDENT and CIV

#

but i wanted the possibility to create AI that will engage any other group that it finds

warm hedge
last tapir
warm hedge
#

According to that article, maybe

last tapir
#

awesome! will try! 🙂 thanks

warm hedge
#

Alternatively you can use setFriend

crude flame
knotty gyro
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
knotty gyro
#
// unit inti: [this,rs_mob1] execVM "scripts\rs_mob.sqf";
params ["_p","_rs","_pos","_rsa"];
_p = _this select 0;
_rs = _this select 1;
_pos = position _p;
_p removeaction _rsa;
waituntil {sleep 3;getpos _p select 2 < 2};
sleep 30;
_rsa = _p addaction ["Relocate spawn point",{_rs setpos _pos;[_p, "AinvPknlMstpSnonWnonDnon_medic0"] remoteExec ["switchMove"];[[west, "HQ"], "Mobile respawn relocated"] remoteExec ["sidechat"];}];

I keep getting an error saying _rs is undefined. What am I doing wrong?

#

_p is working just fine...

warm hedge
#

Why you redefine _p _rs _pos etc when you declare them in params

old owl
#

What @warm hedge said. Ideally you'd either use one or the other but params are typically the better way to go imo.

knotty gyro
#

hmm....

old owl
#

params and _this select do the exact same thing (getting arguments from the script scope)

knotty gyro
#

mostly since I'm not used to work with params maybe...

hallow mortar
#

The others are correct about the redundant definitions, but the specific problem is that the addAction code (that gets executed when the action is used) is a separate scope from the script that added the action. So local scope variables from the action-adding scope don't exist in the action code scope.

knotty gyro
#

-.-

old owl
#

As for what you actually asked for help for, is there any chance that rs_mob1 could be null or nil outside of the scope you are feeding it to before your execVM?

gritty parrot
knotty gyro
#

I was just hoping to avoid the 100 small script diseace...

old owl
south swan
#

i mean. Isn't addAction's script the separate scope? How would it see any of private variables here? 🤔

old owl
gritty parrot
#

Add action Code contains:
params ["_target", "_caller", "_actionId", "_arguments"];

#

So _target might be the vehicle for example

warm hedge
#

Ah I see. Last addaction doesn't declare any values

south swan
#

and _arguments isn't passed in what code i see posted

gritty parrot
#

Yeah would have to pass the object either via _target or in _arguments (can but most not necessary be an array)

south swan
#

also, this entire code looks like a mixup of old private <array> syntax with params, tbh 🤔

old owl
south swan
hallow mortar
#

Refined your code and added respawn safety

// unit init: [this,rs_mob1] execVM "scripts\rs_mob.sqf";
params ["_p","_rs"];

_rsa = _p addaction [
    "Relocate spawn point",
    {
        // interpret available arguments
        params ["_target", "_caller", "_actionId", "_arguments"];
        // move the spawn point and do anims etc
        _arguments setposASL (getPosASL _caller);
        [_caller, "AinvPknlMstpSnonWnonDnon_medic0"] remoteExec ["switchMove"];
        [[west, "HQ"], "Mobile respawn relocated"] remoteExec ["sidechat"];
        // start the cooldown
        missionNamespace setVariable ["mrb_var_spawnMoveLast",([time,serverTime] select isMultiplayer),true];
    },
    _rs, // pass the spawn point object as an argument to the action code so we can use it
    1,
    true,
    true,
    "",
    "isTouchingGround _this && {(([time,serverTime] select isMultiplayer) - (missionNamespace getVariable ['mrb_var_spawnMoveLast',0])) > 30}",
    0
];

// respawn handling
_p setVariable ["mrb_spawnMoveAction",_rsa];
_p setVariable ["mrb_associatedMobileSpawn",_rs];

_p addEventHandler ["Respawn",{
    params [_unit,_corpse];
    [_unit, _unit getVariable ["mrb_associatedMobileSpawn",objNull]] execVM "scripts\rs_mob.sqf";
    _corpse removeAction (_corpse getVariable ["mrb_spawnMoveAction",0]);
}];```
#

* not tested in game, beware typos

#

If you find this results in the spawn object being teleported directly into your own body, killing you instantly, replace _arguments setPosASL (getPosASL _caller); with this:

private _posModified = getPosASL _caller vectorAdd (vectorDir _caller vectorMultiply 5);
_arguments setPosASL _posModified;```
south swan
#

eyyy, i'm an official slowpoke (again)

sweet vine
#

Bizarre one, this is one of many scripts that work correctly on a dedicated server running on the same computer as client, however when run on a remote dedicated server, It doesn't work, why would that be?

    // customize ending
    [missionNamespace, "respawnTicketsExhausted", {
        params ["_target"];
    
        systemChat str formatText["RESPAWN TICKETS EXHAUSTED - %2", _target];

        _ticketsWest = [west] call BIS_fnc_respawnTickets;
        _ticketsInd = [independent] call BIS_fnc_respawnTickets;
    
        // override debriefing text - endType setDebriefingText [title, description] - DEBUG: "WINNER" call BIS_fnc_endMission, "LOSER" call BIS_fnc_endMission
        // VICTORY
        ["end1", ["VICTORY", "", str formatText ["NATO have claimed victory over the battle! (%1 - %2)", _ticketsWest, _ticketsInd], "", "\A3\Data_F\Flags\flag_NATO_CO.paa"]]
        remoteExecCall ["setDebriefingText", 0];

        // DEFEAT
        ["SideLost", ["DEFEAT", "", str formatText ["AAF have claimed victory over the battle! (%2 - %1)", _ticketsWest, _ticketsInd], "", "\A3\Data_F\Flags\flag_AAF_CO.paa"]]
        remoteExecCall ["setDebriefingText", 0];

        
        if (!isNil "v_endInvoked") exitWith {};
        v_endInvoked = true;

        // Mission doesn't seem to end properly on server, so end mission manually
        if (_ticketsWest == 0) exitWith {
            // [endName, isVictory, fadeType, playMusic, cancelTasks] call BIS_fnc_endMission
            ["SideLost", false, true, true, true] remoteExecCall ["BIS_fnc_endMission", 0];
        };

        if (_ticketsInd == 0) exitWith {
            // [endName, isVictory, fadeType, playMusic, cancelTasks] call BIS_fnc_endMission
            ["end1", true, true, true, true] remoteExecCall ["BIS_fnc_endMission", 0];
        };
    }] call BIS_fnc_addScriptedEventHandler;
knotty gyro
hallow mortar
#

I'd recommend posting a new message rather than a late edit that contains critical new information :U
That's probably because serverTime returns 0 in SP and I guess you're testing in SP, thanks BI. Previously posted code has been updated.

knotty gyro
#

ok. ty. Will try new code.

halcyon creek
#

Is there availiable an SQF checker that would find errors for you? I remember way back there used to be one

#

like a Syntax checker

granite sky
#

Best bet is to paste it into ADT tbh.

halcyon creek
#

Forgive me ADT?

granite sky
#

Advanced Developer Tools. It's an Arma mod with a better debug console & config viewer. The syntax checking in the debug console is very good.

halcyon creek
#

Sorry just realised what you meant 🤦‍♂️

knotty gyro
sullen trellis
#
["CAManBase", "Killed", { 
 params ["_unit","_killed"]; 
 if (!isPlayer _unit && var_removeMagazinesDead
) then { 
  {_unit removeMagazine _x} count magazines _unit; 
  _unit setAmmo [handgunWeapon _unit, (selectRandom [5,10,15,20,25])]; 
  _unit setAmmo [primaryWeapon _unit, (selectRandom [5,10,15,20,25])]; 
   _unit removeItems "vn_b_item_firstaidkit";
   _unit removeItems "vn_o_item_firstaidkit";
   _unit removeItems "FirstAidKit";
   _unit removeItems "Medikit";
   _unit removeItems "vn_b_item_medikit_01";
 }; 
}, true, [], true] call CBA_fnc_addClassEventHandler;

I want to change the 'CAManBase' to only choose east side units, how can i accomplish that according to the rules of 'CBA_fnc_addClassEventHandler'?
it says ^Can be a base class^ in the website

EDIT: thanks to John and Nikko got it quickly solved
change>>> !isPlayer
with>>> (side group _unit) == east

granite sky
#

I don't think there's any strict side base class. You'd need to add a side check inside the event handler instead.

hallow mortar
#

Don't forget to check the group's side rather than the unit's side, since units become Civilian when dead

thin fox
halcyon creek
#

Okay having a bash at holdActions but cant seem to get it to work correctly, I have a tent placed down with the variable name of tent and its Init has it destroyed this setDamage 1; I'd like to add and action to it to "fix it" so I have created this

[
    _tent,                                                            
    "Construct Tent",                                                
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "_this distance _target < 5",                                    
    "_caller distance _target < 5",                                    
    {},                                                            
    {},                                                                
    {["TentBuilt", true. true];},                                    
    {},                                                                
    [],                                                                
    10,                                                                
    0,                                                                
    true,                                                        
    false                                                            
] remoteExec ["BIS_fnc_holdActionAdd", 0, _tent];        
``` which I have running as an SQF script in the mission folder, It calls the script correctly but states im Missing a ] on line 4?

I also have a trigger placed with  ```
Condition: tent getVariable ['TentBuilt', true];
on Activation: tent SetDamage 0;``` hoping for it to be "built"
#

appologies, the error is on Line10 not 4

hallow mortar
#

Also, the array in the "on completion" code is...just an array. It's not doing anything, just defining an array. I think you might be missing a tent setVariable at the start of it.

#

That said, you don't need to set a variable and then have a trigger waiting for that variable to set the tent's damage. You can just do the setDamage in the action completion code.

halcyon creek
#

Im giving that a try, I think im also missing setting the item tent as a variable so _tent is causing errors

#

hmm, its not throwing errors at me now, hoever there is no action on the item in game

hallow mortar
#

You just need to pass the tent object as an argument when you add the action, by putting it in the custom arguments array (the currently empty array just after the code fields)

#

e.g.

// ...
{},
{ (_arguments select 0) setDamage 0; },
{},
[_tent],
// ...```
#

btw, beware of the "remove on completion" parameter for BIS_fnc_holdActionAdd. It only removes the local copy of the action, so other clients will still have it in MP. If you want to globally remove the action, you need to have each client add it locally so they can save their own action ID, and then when it comes to removing it, you need to have each client remove it locally with BIS_fnc_holdActionRemove and retrieving their own action ID.

halcyon creek
#

it now seems to be having an issue with this line ```sqf
//
] remoteExec ["BIS_fnc_holdActionAdd", 0, _tent];

Error: Type Any exopected Bool, String, Object
halcyon creek
hallow mortar
# halcyon creek it now seems to be having an issue with this line ```sqf // ] remoteExec ["BIS_f...

It seems like _tent isn't defined in the main script. I assumed you had done that :U
If you want this script to be reusable with various different objects, you can pass it into the script as an argument, kind of like we just did with passing it from the script to the action. You'd use params for that. For example:

// calling the script from an init field:
[this] execVM "myscript.sqf";
// or
[this] call my_fnc_tentFunction;
// inside the script, line 1:
params ["_tent"];```
I'd recommend that approach because reusability is good, but if this is just for one specific object, you could hardcode it to refer to the object's global variable name by using that instead of the local variable `_tent`.
hallow mortar
halcyon creek
hallow mortar
#

Yes, though you might want to make it more unique to avoid conflicts with other scripts or mods.

halcyon creek
#

Gotcha

halcyon creek
hallow mortar
# halcyon creek So for example ```sqf params ["_fgtent1"]; [ _fgtent1, ...

Well, that will probably work if you call that script correctly, but...you've done both solutions at the same time. You only need one.
EITHER:
Use params to make the script reusable, passing the object to the script as an argument and using the local variable inside the script
OR:
Hardcode it with the object's global variable name

halcyon creek
#

Ahhh I see I see im following you

#
[
    fgtent1,                                                            
    "Construct Tent",                                                
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "_this distance _target < 5",                                    
    "_caller distance _target < 5",                                    
    {},                                                            
    {},                                                                
    { (_arguments select 0) setDamage 0; },                                    
    {},                                                                
    [fgtent1],                                                                
    10,                                                                
    0,                                                                
    true,                                                        
    false                                                            
] remoteExec ["BIS_fnc_holdActionAdd", 0, fgtent1];        
#

As such?

hallow mortar
#

Yes.

#

I do want to stress again that making a reusable script without hardcoded variable names is usually better, because...it's reusable. If you want to have this script run on several different tents in the same mission, you'd need to have multiple copies of this code with the variable name changed; it'd be better to have a single generic piece of code that you can run multiple times with different arguments.

halcyon creek
#

It is only for the one item for this script, though I had planned on doing a similar one that will be reusable for a different part of the mission

#

This for the one tent and then another for Sangars and Wall defenses

halcyon creek
hallow mortar
#

Is it the same error as before?

stable dune
hallow mortar
#

Also, an array is already being used to pass the argument, so that's not the problem - it's technically a bit of a redundant way of doing it, but it should work.

#

In terms of the actual error, I don't really know what's up with that. If fgtent1 is the object's Editor variable name (and it's spelled right), then that should be fine. No reason it would be undefined, which is what "type Any" really means.

halcyon creek
#

could I change ```sqf
{ (_arguments select 0) setDamage 0; },

```sqf
{ fgtent1 setDamage 0; }, 
hallow mortar
#

Yes, but I'd suggest using _target so that when you copy this code to make your other variants, you don't need to change it.

halcyon creek
#

So add the code supplied by Prisoner on line 1?

#
params ["_target", "_caller", "_actionId", "_arguments"];
[
    fgtent1,                                                            
    "Construct Tent",                                                
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "_this distance _target < 5",                                    
    "_caller distance _target < 5",                                    
    {},                                                            
    {},                                                                
    { _target setDamage 0; },                                    
    {},                                                                
    [fgtent1],                                                                
    10,                                                                
    0,                                                                
    true,                                                        
    false                                                            
] remoteExec ["BIS_fnc_holdActionAdd", 0, fgtent1];  
hallow mortar
#

No.
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
The function provides you with some predefined named variables containing useful references. These variables can be used in the start, progress, completion, and interrupt code fields. _target is one of the predefined variables, and it refers to the object the action is attached to.

#

You can just use it without params (and that params as you've posted would be in the wrong place if you did need it, because that's outside the BIS_fnc_holdActionAdd code)

halcyon creek
#

Ahhhh I see I see

#

Appoligies, Im still learning, I do really appreciate the help though

#

its still triggering an error on that last line, Type Any

hallow mortar
#

Can you post the exact and complete error, please?

#

And if this is in an external file, make sure you've saved the file since making changes

halcyon creek
#

This is an external file, I just post it into ADT for quick checking

#

the script itself is being called in the initPlayerLocal

#
execVM "tentholdaction.sqf"; //Construct Tent
hallow mortar
#

Oh, you're trying to do it in the actual Editor, not the mission preview. That's why. Nothing actually exists yet.

#

The Editor isn't a live scenario, it's all dummy objects. Nothing's actually running and object variables aren't defined.

halcyon creek
#

I have tried doing it by playing the mission, It doesnt appear on the tent

#

by hitting play scenario

hallow mortar
#

Have you tried doing that since making and saving all the changes?

halcyon creek
#

Yes

hallow mortar
#

How big is the tent btw? Distance is measured from the object centre, not its actual shape, so if it's a bigger-than-tiny tent, you may need to increase the distance check in the action conditions.

halcyon creek
#

its the CUP East tent, I shall try but it doesnt even appear when im standing ontop of it in the middle

#

to be fair, adding the script to the item using 3den Enhanced it doesnt show up either

#

Maybe its the item itself that isnt liking it

hallow mortar
#

That exact code works for me

halcyon creek
#

How strange

#

ill try it on a different asset and see if its the tent itself

#

for whatever reason its not showing up for me

#

Maybe I shall just have to do it the old fashioned way with addActions

stable dune
hallow mortar
halcyon creek
#

I dont understand it though, I have had addActions work before and this doesnt seem to be working, It may be conflicting with a mod or something, if its working on your end but the same code isnt working on my end

halcyon creek
#

Right interestingly addAction is also not working

#

Which It was previously

stable dune
# halcyon creek Not sure how to do this

Go to game.
Press ECS
you should be able to see Console
Press + right down corner to get Expression 1 box to show
add on upper box

player distance fgtent1

press Pin button next to text box

halcyon creek
#

Well within range, Im not sure what is causing this to be honst

stable dune
halcyon creek
#

Tried it in a clean mission with just the tent, a player and only that script and it still isnt showing up inside the game

#
[
    fgtent1,                                                            
    "Construct Tent",                                                
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "_this distance _target < 5",                                    
    "_caller distance _target < 5",                                    
    {},                                                            
    {},                                                                
    { _target setDamage 0; },                                    
    {},                                                                
    [fgtent1],                                                                
    7,                                                                
    0,                                                                
    true,                                                        
    false                                                            
] remoteExec ["BIS_fnc_holdActionAdd", 0, fgtent1];  
#
execVM "tentholdaction.sqf"; //Construct Tent
``` Just this in the init.sqf
stable dune
#

You dont need remoteexec when using init.sqf
It wil be called from client so client will get addaction
Try add systemChat to be sure that your .sqf is called

    
systemChat "Holdaction .sqf called";
[ 
    fgtent1,                                     
    "Construct Tent",
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "_this distance _target < 5",                                    
    "_caller distance _target < 5",                                    
    {},                                                            
    {},                                                                
    { _target setDamage 0; },                                    
    {},                                                                
    [fgtent1],                                                                
    7,                                                                
    0,                                                                
    true,                                                        
    false                                                            
] call BIS_fnc_holdActionAdd;
halcyon creek
#

Still nothing. it does say its being called

silent cargo
#

Accidentally asked in reforger

#

Does anybody know the effect or animation thats used to ragdoll a player when theyre hit by a car? It knocks them down then they eventually roll over and get up. Is there a name for this or is it a compilation of different things?

hallow mortar
#

It's just the physics engine

#

You can use addForce to do it yourself (though note that until 2.18, they will be set unconscious if you hit them hard enough to ragdoll them)

silent cargo
hallow mortar
#

The revive system probably uses setUnconscious

silent cargo
#

Its does but it has a weird method which Im trying to change. Basically it just forced them to the agonystart action and I hate watching the players lay down after being shot. I think I will try the add force method into this function

#

Its the AIS revive system but heavily edited

stable dune
# halcyon creek Still nothing. it does say its being called

then.
Start figuring out where the issue.

systemChat "Holdaction .sqf called";
[ 
    fgtent1,                                     
    "Construct Tent",
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\repair_ca.paa",        
    "_this distance _target < 50", //increase showing distance                                        
    "_caller distance _target < 50", //                                    
    {},                                                            
    {},                                                                
    { _target setDamage 0; },                                    
    {},                                                                
    [],                                                                
    7,                                                            
    0,                                                                
    true,                                                        
    false                                                            
] call BIS_fnc_holdActionAdd;
silent cargo
long sparrow
#

hey guys

last tapir
#

actually, i wil ping you on DM

glossy jasper
#

im looking for script that i was used long time ago
it's about Ace arsenal and i have only few clues about this script

in my memories Ace arsenal open with holdaction function (like revieve circle progressbar)
and there is whitelist.sqf in folder

whitelist .sqf was like
//headgears
"rhs_headgear"
"cup_headgear"
.....

//vest
"rhs_vest"
"cup_vest"

I tried to find it for 5 days, but i couldnt .. god please help this nescient and innocent lamb

pale wagon
last tapir
# warm hedge https://community.bistudio.com/wiki/Side_Relations `sideEnemy`?

hey, about this one... i tried running this in editor:

private _grp2 = createGroup sideEnemy;


_unit1 = _grp1 createUnit ["B_G_Sharpshooter_F", position player, [], 0, "NONE"];

_unit2 = _grp2 createUnit ["B_G_Sharpshooter_F", position player, [], 0, "NONE"];

[_unit1] join _grp1;

[_unit2] join _grp2;```

and it just dont spawn anything.... Just to be sure that i did not mess the code i tried:
```private _grp1 = createGroup east;
private _grp2 = createGroup west;


_unit1 = _grp1 createUnit ["B_G_Sharpshooter_F", position player, [], 0, "NONE"];

_unit2 = _grp2 createUnit ["B_G_Sharpshooter_F", position player, [], 0, "NONE"];

[_unit1] join _grp1;

[_unit2] join _grp2;```

this works fine....

the problem seems to be that ```sideEnemy``` is more like a status that have ```rating``` below -2000 it does not seem like i can create groups on side enemy. The result that i want is like (in the terms of arma wiki) to create a group with multiple units that work as a proper group but hates each and every other group. I am using this for a survival exile server, so since exile is going pretty slow this days (not to say dead), i want to give the server more life and combat even with low player count. I want DMS AI from each mission to hate each other, A3XAI that is going pass by DMS missions to engaged and be engaged by DMS AI. zombies, to engage and be engaged. And each and every other group of A3XAI roaming AI to engage other A3XAI groups if they come across each other. but ive been reading through A3 wiki and i could not find a way to make that happen. it seems that i need to stick to GUER, EAST, WEST or CIV.
#

might have somehting with this:

#

i am lost in this one..... do you or anyone know a work around?

thin fox
last tapir
#

Maybe i can use east as a group for every one and start my server with
east setFriend["east", 0];

undone flower
#

is there any mod out there that allows you to breach locked vehicles?

thin fox
undone flower
#

but nothing standalone

#

I could try making it myself but

#

I'd rather not

pale wagon
#

Ask the creator if you can make that specific thing a standalone item, copy it over, troubleshoot, post

last tapir
pale wagon
#

Set a certain group to spawn hostile to everyone?

last tapir
#

yeap. but not to itself hehehe

pale wagon
#

Ahh

#

sideEnemy makes them attack everyone, their own faction included. Useful for scavenger types, otherwise not always useful

last tapir
pale wagon
#

It would cause them to act like an impostor and attack everyone, yeah

#

_this addRating -2000;

#

Does the trick

last tapir
#

everyone like, even the other members in the group?

last tapir
pale wagon
#

Unit

#

Group makes whole group sideEnemy

last tapir
# pale wagon Group makes whole group sideEnemy

this does not seem to work

private _grp2 = createGroup sideEnemy;


_unit1 = _grp1 createUnit ["B_G_Sharpshooter_F", [4050.45,4200.6,0], [], 0, "NONE"];

_unit2 = _grp1 createUnit ["B_G_Sharpshooter_F", [4050.45,4210.6,0], [], 0, "NONE"];

_unit3 = _grp1 createUnit ["B_G_Sharpshooter_F", [4040.45,4200.6,0], [], 0, "NONE"];

_unit4 = _grp1 createUnit ["B_G_Sharpshooter_F", [4040.45,4210.6,0], [], 0, "NONE"];

[_unit1] join _grp1;
[_unit2] join _grp1;
[_unit3] join _grp1;
[_unit4] join _grp1;

[_unit1] joinSilent _grp2;```
#

have no idea why, nobody starts shooting

pale wagon
#

Oh you meant that kinda scripting lol

#

Above my paygrade 😭

#

I think the only way to get onto Enemy is by having a -2000 rating

last tapir
#

yeap, but that way, i think that the units that have -2000 will shoot other -2000 aswell

pale wagon
#

They will. Its unavoidable

#

AFAIK

#

Seems so?

#

Civvy isnt friendly to East. So try that?

#

Or Unknown

last tapir
pale wagon
#

Alright

undone flower
#

any clever way to detect if an object _obj is an ACTUAL driveable/rideable vehicle?

warm hedge
undone flower
#

nice, I was just looking at this command

undone flower
last tapir
#

?

warm hedge
#

I have no time to read full context and do anything

undone flower
formal stirrup
#

do the MLRS rockets just not fired eventhandlers? I've tried explode and hitPart and neither even fire. Anyone got ideas?

#

Nvm looks like I needed to change the eventhandler to submunitionCreated

exotic flame
#

Is there a way to detonate a flying missile ?

#

setDammage 1 doesn't appear to be working

warm hedge
#

triggerAmmo

exotic flame
velvet merlin
#

is there any function from BI to display a center screen warning message? (aka not hint or notification based)

ripe sapphire
#

yo bros is there a command to make the game open a URL?
like in the main menu if you click the sitrep logo it opens up sitrep website

cosmic lichen
#

There is 3denMessage or so

ripe sapphire
#

im trying to make the main menu spotlight open a link but it doesnt seem to support url config token like the other buttons, so will need to open the link via script

velvet merlin
#

@ripe sapphire afaik you have to whitelist custom urls

ripe sapphire
velvet merlin
#

works only with button controls i think

#

spotlights are two or three control types layered ontop of each other

velvet merlin
cosmic lichen
#

Blocking with buttons

mossy dove
#

Hey guys. I`m having some troubles with some Mod Houses. Usually a House has a variable called "numberOfDoors". Unfortunately all the houses from this mod do not have this variable. the script im using is checking for that variable so it can identify all the doors of a certain house and after that the door, the player is standing in front of. My question is, how can i identify all the doors of those mod houses ?

warm hedge
#

Probably by checking animationNames or number of actions

winter rose
#

no

queen junco
# warm hedge Probably by checking `animationNames` or number of actions

Issue is we are trying to lock the doors. However we seem do not be able to refer the doors. Presumably because the mod creator has done some weird stuff to the building cfg.
'''sqf
This setVariable ['BIS_Disabled_Door_0',1,true];
'''
This does not refer the door. Nothing happens. While this:
'''sqf
this animate ["door_0_anim" ,1];
'''
Opens the door just fine.
To my understanding the reference for the door should therefor be door_0. Which makes me not understand why the disable_door doesn't work. Any ideas?

warm hedge
#

To my understanding the reference for the door should therefor be door_0
Not necessary so no

queen junco
#

Do you have an idea how to get the reference?

warm hedge
#

What I suggested are the only thoughts I have

south swan
#

being able to lock the door isn't a given 🤷‍♂️

#

door names following any convention isn't a given

#

you can check config of the building in question (specifically UserActions subclass) for how door opening/closing is coded and what conditions does that include

mossy dove
# south swan you can check config of the building in question (specifically `UserActions` sub...
mod house:

condition = "this animationPhase ""door_0_anim"" > 0.5;
position = "useraction_0";
statement ="this animate [""door_0_anim"" ,0]";

vanilla house:

actionNameSel = "Door_1_action";
condition = "((this animationSourcePhase 'Door_1_sound_source') >= 0.5) && ((this getVariable ['bis_disabled_Door_1', 0]) != 1) && (cameraON isKindOf 'CAManBase')";
position = "Door_1_trigger";
statement = "([this, 1, 0] call BIS_fnc_Door)";```
#

as you can see we found the animation name and useraction but the problem is that doorPhase outputs -1 and the function BIS_disable_Door cant be used since we have no door name

south swan
#

statement doesn't use BIS_fnc_door, condition doesn't have anything to disable it. The door can't be locked 🤷‍♂️

mossy dove
#

sorry that was what im talking about. but there must be a workaround to disable the animation for example or disabling the useraction for the door. lets just say we "fake" a locked door

south swan
#

i don't know any methods of disabling config or engine-defined actions via script

mossy dove
#

thats sad.

winter rose
#

locking a door is possible

south swan
#

by disabling the simulation of the entire house?

winter rose
#

there is that
now regarding the conversation above, I did not scroll high enough

mossy dove
#

not working. enable simulation doesnt effect doors

#

even on vanilla houses

winter rose
#

you will have the actions, but doors won't open

#

but there is the lock door module that animates the door as if it were locked, why not use that

mossy dove
#

nope not correct. place a vanilla house and disable simulation. you still can open and close all doors. about the module: because the mod creator didnt set this up correct, as you may see above. if you place the house there arent even doors you can click on in editor.

#

thats the mod house. no doors at all

warm hedge
#

Indeed disabling simulation doesn't stop it

#

Simple Object does, so that might be the workaround

mossy dove
#

yeah that's true. but my script needs to interact with it. you need to lock and unlock doors during gameplay. simple object doesn't allow that:(

winter rose
#

then you're out of luck for this modded building

coarse sedge
#

Hi im trying to get cargo containers to spawn on the back of a ship, ive come up with this, i dont get any errors but i just cant get it to work any help would be very much appreciated 🙂

terminal addAction ["Request Container",
    {
        _marker = createMarker ["Marker",     CMspawnerPad];
        _markerPos = getMarkerPos _marker;
        _markerPos set [2,100];
        
        hint "Container";
        sleep 1;
        "plp_ct_ContPlainBlack" createVehicle getMarkerPos _marker;
        hint "done!";
    }
];
    
stable dune
coarse sedge
#

the script runs same as b4 but nothing spawns in the air 😦

stable dune
#

If you have a pad. Where you are creating your marker.
You could use position of that pad.
And if that retuns wrong z position, you could use vector add to get spawn position higher.

hallow mortar
#

createMarker is ignored if a marker with the same name already exists, and "Marker" is not a very unique name

#

Unless you actually want a visible marker to appear, it would be better to just skip creating the marker at all. It's not necessary for what you're doing here.

#
private _position = (getPosASL CMspawnerPad) vectorAdd [0,0,100];
private _crate = "plp_ct_contplainblack" createVehicle [0,0,0];
_crate setPosASL _position;```
coarse sedge
#

thanks guys i have it working now absolute legends @stable dune @hallow mortar

exotic gyro
winter rose
#

ye, but not scripting

exotic gyro
#

yeah

#

well, involves scripting in the statement part

mossy dove