#arma3_scripting

1 messages Β· Page 782 of 1

past wagon
#

how would I set their side?

digital rover
#

I'm going to

#

that doesnt help if the vectors themselves are wrong

little raptor
#

how about you show in a video or image what you're trying to do? maybe you're going all wrong about it blobdoggoshruggoogly

little raptor
digital rover
#

images arent allowed in this channel

#

maybe I can post a link

little raptor
#

but if you're willing to you can make your own system

#

assembling and disassembling can be scripted

#

terminals can't but you can just give them terminals of whichever side the UAV belongs to

past wagon
#

I've given the civs the terminal, UAV backpack, and tripod/hmg backpacks

digital rover
#

https://imgur.com/a/fw6knPN

Right, here I want the cargo containers to be connected to the yellow orbs right? except this is when my script looks like

        private _fromTo = _prevPointPos vectorFromTo _nextPointPos;
        // private _fromToCorrected = [_fromTo, 90, 2] call BIS_fnc_rotateVector3D;
        _x setPosWorld _centre;
        _x setVectorDirAndUp [
            _fromTo,
            [0,0,1]
        ];
little raptor
past wagon
#

they are unable to open the terminal (they can assemble the drone), and they are unable to assemble the weapon

#

ok

digital rover
#

When I change my script to

        private _fromTo = _prevPointPos vectorFromTo _nextPointPos;
        private _fromToCorrected = [_fromTo, 90, 2] call BIS_fnc_rotateVector3D;
        _x setPosWorld _centre;
        _x setVectorDirAndUp [
            _fromToCorrected,
            [0,0,1]
        ];

This is what I get https://imgur.com/a/7CFWaqY

little raptor
#

your up vector is incorrect

#

that's all

digital rover
#

i know, but I can't find a function

#

that makes it right

little raptor
#

this should

#

but I guess you tried that one blobdoggoshruggoogly

#

did you?

digital rover
#

yeah

#

will send a pic

#

actually, it's exactly the same as I pic I just sent

little raptor
#

yeah I see what you're doing wrong

#

you want the container's right/left to be along _fromTO

#

you can't just rotate it by 90 degrees

#

let me fix it for you

past wagon
little raptor
#
        private _fromTo = _prevPointPos vectorFromTo _nextPointPos;
        private _right = [_fromTo#1, _fromTo#0 * -1, 0];
        private _up = _right vectorCrossProduct _fromTo;
        
        _x setPosWorld _centre;
        _x setVectorDirAndUp [_up vectorCrossProduct _fromTo, _up];
#

try that

digital rover
#

_dir being?

little raptor
#

oh πŸ˜…

#

fixed

#

fixed again (was still using _obj meowsweats)

digital rover
#

that works!

little raptor
#

it only works as long as fromTo doesn't point towards the sky [0,0,1] (or the earth, [0,0,-1]) meowsweats

digital rover
#

what if needs to work for any angle?

little raptor
#

well the problem is if fromTo points to [0,0,1] there is no unique "up" anymore

#

it can rotate freely around [0,0,1]

#

you can just make your own convention
e.g.

if (_dir#0 == 0 && _dir#1 == 0) then {_right = [0,1,0]}
digital rover
#

I mean I could just add a check for that right?

little raptor
#

yes

tough abyss
#

the joys of gimbal lock

digital rover
#

this is one of the things quaternions solves right

little raptor
#

yes

digital rover
#

thats an learning experience for another day

#

for now imma just clamp it manually

little raptor
#

yeah clamping it is the best and fastest way

#

for SQF at least

#

if you make your own quats in SQF it's gonna be slow af and not worth it for per frame applications

tough abyss
#

I should go test the performance of mine, IIRC they're not that bad

little raptor
past wagon
#

how can I enable civilians to open UAV terminals?

tough abyss
#

Is there a way to draw pathfinding so that the units will follow a specific parh

#

instead of trying to accomplish their β€œbest” path

little raptor
#

units no

#

vehicles kinda

#

using setDriveOnPath

digital rover
#

I think you can chain together some doMoves

little raptor
#

yes

#

that's possible

#

but it won't be good

#

the only practical way is using animations

tough abyss
little raptor
#

read the wiki

tough abyss
#

Well how would I get units to move to cover programmatically

little raptor
little raptor
tough abyss
#

they dont deem to use unique animations

little raptor
#

also animations

tough abyss
#

huh

tough abyss
little raptor
#

you just play the movement animation

#

and make the unit face the correct way

tough abyss
#

I see

little raptor
#

and they just move

tough abyss
#

is there a way to smoothly turn them so it doesnt snap

little raptor
#

animations always play smoothly

tough abyss
little raptor
#

setVectorDir

#

every frame

tough abyss
little raptor
#

no

#

they just tell the AI to move

#

like I said there's no way to give AI a path

#

you should trust a guy who's making an AI himself

tough abyss
#

I know but isn’t moveTo moving to a point

#

cant you chain multiple points

little raptor
#

you can

tough abyss
little raptor
#

it does

#

but you can't give it a manual path

tough abyss
little raptor
#

if that's what you mean

#

well then yeah you can just use doMove

tough abyss
#

basically micromanaging the AI

little raptor
#

you can but vanilla pathfinding is aweful

#

you can't just make them "move to cover"

#

they may not move inside the bounding box of the object (unless the object has a path LOD)

#

which is quite a headache

tough abyss
#

Just ran some performance tests

#

quaternions aren't that slow, multiplication averages 0.01ms, "division" 0.02ms, and rotation 0.06ms

tough abyss
little raptor
#

if 10x is not slow I don't know what is blobdoggoshruggoogly

tough abyss
#

I mean yeah but we're talking one operation doing the same thing as a large handful of vector operations

#

and even 0.06ms is a fraction of frame time even at 144fps

little raptor
#

with moveTo/doMove you can't

#

with anims you just do a disableAI "MOVE"

#

and play the anim and the unit moves wherever he's facing. you then make him stop when he's close enough

tough abyss
#

cause whst ur saying is the anims also move the character forward

#

right

little raptor
#

or backward, etc.

#

depends on anim

tough abyss
#

Is there a way for an AI using this system to take orders from waypoints (process them at all)?

little raptor
#

to determine where they should take cover

little raptor
#

you easily go beyond 1 ms

tough abyss
little raptor
tough abyss
#

That's fair, I'm not suggesting that they're ideal for per-frame applications

#

just that they're not horrendously slow

#

main tradeoff being that unlike BIS_fnc_rotateVector3D you can rotate around arbitrary axes

#

(plus, to be honest, my quaternion code could be further optimized)

tough abyss
#

does anyone know the bis for the ace arsenal

little raptor
#

do you mean the function for ACE arsenal?

tough abyss
#

If you just need to open it on the player you can use [player, player, true] call ace_arsenal_fnc_openBox

past wagon
#

why can't I remoteExec cutText?
This works fine: cutText ["", "BLACK OUT", 1];
But this does nothing: ["", "BLACK OUT", 1] remoteExec ["cutText"];

open fractal
#

is remoteExec restrictred in your server or mission config

past wagon
#

no....?

#

not that I know of, what might cause it to be?

open fractal
#

CfgRemoteExec or battleye

#

that'll only be an issue if you're using a template where someone set that stuff up

past wagon
#

no

#

I'm just testing in a singleplayer mission

#

nevermind, I just needed double brackets

tough abyss
#

yup because it takes an array of 3 arguments, not 3 individual arguments

past wagon
#

yup

leaden ibex
#

let's say I have two missionNamespace variables.
tOneDone and tTwoDone
I do the classic

private _tOneDone = missionNamespace getVariable("tOneDone", false);
private _tTwoDone = missionNamespace getVariable("tTwoDone", false);

waitUntil (_tOneDone && _tTwoDone) do {
  ...
};

(Given the docs are down and I don't remember the syntax exactly, consider it rather pseudocode)
Given I [] spawn {}; this,
will this work like I want it to?

Wait until both the variables are true (or negatet, not sure, docs are down sadge), the starts to execute the code that will be inside

TLDR:
Are private references updated when missionNamespace variable get's updated? That's the core of the question.
If no, should I add handlers on them?
I suspect it will be esier on the CPU, but it's only one loop, will be run only on server. (sleep 1 added somewhere in there ofc, docs down sadge)

#

(I'll probably solve it by checking it in the function setting the vars, but I still wonder if the references get updated)

open fractal
#

however

#

it'll just be stuck if the variable returns false

#

since it's not going to go back and check again

leaden ibex
#

So the reference does not get updated once the missionNamespace one does

open fractal
#

if you're running the script in mission context you can just write the global variable

leaden ibex
#

it will be in a file ran by init.sqf

#

but I think I'll go with the one time check once on of the variables is being set (they are simple toogle from false to true)

tough abyss
#

You would need to pull the variable each time to get the latest value, also don't forget to put sleeps in waitUntil conditions since otherwise they will hog the scheduler by trying to check the condition constantly

leaden ibex
#

So, it's a not. The private reference is not a reference, but a copy.
Copy that, thank you!

open fractal
#
waitUntil {!(isNil "tOneDone") && !(isNil "tTwoDone")};
``` will effectively suspend the code until both variables are defined
tough abyss
#

For your reference, everything in sqf is copy-by-value except for arrays which are copy-by-reference

#

which is why arrays have an explicit + operator for copying by value instead of reference

leaden ibex
#

Got it. I just love switching languages, where all this changes. Lazy evaluation, left to right, right to left HAha Who's supposed to remember it all dogeKek

tough abyss
#

Speaking of lazy evaluation, are you aware of how to do so in SQF?

#

&& and || are not lazy-evaluated by default

leaden ibex
#

No, I am not.
That was just one of the things that came up to my mind when thinking about language differences.

How does it work in SQF? Like it's gonna help something, but I am a optimisation freak

tough abyss
#

Basic idea is that SQF only lazy-evaluates booleans if one of the conditions is code, for whatever reason

open fractal
#

you're not gonna like the answer

tough abyss
#

hence to lazy evaluate if (cond1 || cond2)

#

you actually need

#

if (cond1 || {cond2})

open fractal
#
if (a && { b && { c } }) then {};
tough abyss
#

then it will lazy-eval

#

yup and if you have more conditions

#

you need to nest concurrent ones in more code

leaden ibex
#

alright, fuck it, I am going back to ASM

open fractal
#

i lvoe sqf me and sqf are homies

hallow mortar
#

It's like this because lazy evaluation didn't exist at all until Arma 3 1.62, so it had to be added as an alternate syntax

leaden ibex
#

Alright, thanks for the lecture!
(goes away with tears and dreams about C++)

tough abyss
#

Meh seems like a sorry excuse considering I know of hardly any modern code that doesn't benefit from lazy-eval

open fractal
#

you could still do nested if statements before 1.62 and those are very cool and fun

hallow mortar
#

That was an explanation, not an excuse

tough abyss
#

I'm not saying it's an excuse from you

leaden ibex
tough abyss
#

rather an excuse in general avoiding just making it the standard

leaden ibex
#

iirc that is not supported by sqf, right? HAha

hallow mortar
#

Correct

open fractal
#

you already know the answer

tough abyss
#

you know what else isn't supported πŸ™‚

leaden ibex
#

so my spaghetti code to decide who won... is not wrong

tough abyss
#

+= -= *= /= ++ --

#

^ none of those

leaden ibex
#

I miss those guys. I really do

tough abyss
#

have fun writing i = i+1

open fractal
#

i was devastated when i learned that switch statements are also not lazy eval

tough abyss
#

switch statements in interpreted languages are always trash

leaden ibex
#

Guys, there's hope on the horizon peepoHappy

tough abyss
#

main benefit of switch statements comes from the way they're compiled differently which obviously doesn't apply for non-compiled langs

leaden ibex
#

switch HAha I forgot my break and it... worked? KEKW I was expecting everything to break and it... didn't? KEKW

tough abyss
#

guess fall-through is allowed

#

Oh and not to mention the not-so-subtle but important differences between

#

Any/ObjNull/Null/nil/Empty/etc.

leaden ibex
#

I am a simple man. Creating fun mission for TvT events and I want them to be different than what we usually play, so I script some things into it (mainly new objective types).
I hope I'll never deal with these

tough abyss
#

generally just knowing where to put isNull and isNil is sufficient for avoiding disaster

leaden ibex
#

No idea.
Got simple cheatsheet?

open fractal
leaden ibex
#

oh, obj vs var, got it

tough abyss
#

yup

leaden ibex
winter rose
leaden ibex
#

It's alright, keeping up with XY message conversation is a tough task.

Thanks for these links, but managed to find them before. They answered my question. Obj vs Var. Simple as that.

Now that the docs work again, I can calmly continue my journey to insanity

winter rose
#

Now that the docs work again
how were they broken before πŸ‘€

leaden ibex
winter rose
#

augh
thanks for the report, glad it solved itself

leaden ibex
#

KKomrade sure thing

worthy igloo
#

for sector control logic i cant change the marker type with the marker type cmd do i have to do it with set variable?

tough abyss
#

How are you trying to do it? @worthy igloo

worthy igloo
# tough abyss How are you trying to do it? <@414068936557199361>
    "ModuleSector_F" createUnit [ rumb_hp, createGroup sideLogic, "
        
        this setVariable[ 'DefaultOwner', '0' ];
        this setVariable[ 'OnOwnerChange', '' ];
        this setVariable[ 'OwnerLimit', '0' ];
        this setVariable[ 'ScoreReward', '0' ];
        this setVariable[ 'TaskOwner', '3' ];
        this setVariable[ 'sides', [ east, west ] ];
        this setVariable[ 'Name', '' ];    
        
        
        this setVariable[ 'BIS_fnc_initModules_disableAutoActivation', false, true ];
        
        _nul = [ this ] spawn {
            params[ '_logic' ];
            
            waitUntil {
                !isNil { _logic getVariable [ 'finalized', nil ] } &&
                { !( _logic getVariable [ 'finalized', true ] ) }
            };

            private _trgSize = 200;
            _logic setVariable [ 'size', _trgSize ];
            [ _logic, [], true, 'area' ] call BIS_fnc_moduleSector;

            private _trg = ( _logic getVariable 'areas' ) select 0;
            private _mrk = ( _trg getVariable 'markers' ) select 0;
            _mrk setMarkerSize [200, 200];
            _mrk setMarkerDir 30;
        };
    " ];
tough abyss
#

Yeah that needs some cleaning

#

regardless, how were you trying to do it with setMarkerType?

little raptor
#
    "ModuleSector_F" createUnit [ rumb_hp, createGroup sideLogic, toString {
        
        this setVariable[ 'DefaultOwner', '0' ];
        this setVariable[ 'OnOwnerChange', '' ];
        this setVariable[ 'OwnerLimit', '0' ];
        this setVariable[ 'ScoreReward', '0' ];
        this setVariable[ 'TaskOwner', '3' ];
        this setVariable[ 'sides', [ east, west ] ];
        this setVariable[ 'Name', '' ];    
        
        
        this setVariable[ 'BIS_fnc_initModules_disableAutoActivation', false, true ];
        
        _nul = [ this ] spawn {
            params[ '_logic' ];
            
            waitUntil {
                !isNil { _logic getVariable [ 'finalized', nil ] } &&
                { !( _logic getVariable [ 'finalized', true ] ) }
            };

            private _trgSize = 200;
            _logic setVariable [ 'size', _trgSize ];
            [ _logic, [], true, 'area' ] call BIS_fnc_moduleSector;

            private _trg = ( _logic getVariable 'areas' ) select 0;
            private _mrk = ( _trg getVariable 'markers' ) select 0;
            _mrk setMarkerSize [200, 200];
            _mrk setMarkerDir 30;
        };
    } ];
tough abyss
#

^

worthy igloo
tough abyss
#

also you're going to want to put a sleep in that waitUntil unless you want to torture the scheduler

#

yes but I'm asking how you were trying to do it because it should've worked

winter rose
tough abyss
#
Unfortunately the server hosting SQFBin is offline after the host migrated it.


I am awaiting their response for SQFBin's return 😒


~ Imthatguyhere
#

@winter rose

worthy igloo
winter rose
#

@finite dirge good luck w/ them 😬

opal zephyr
#

Anyone know if its possible to extract an array of the whitelisted items from an arsenal or ace arsenal?
Or even just get the list of all items

little raptor
#

Just read the function. If it has a whitelist you should be able to "extract it" (if it's a variable)

#

And if not you should be able to recreate it yourself

opal zephyr
#

Im looking at the BIS_fnc_arsenal page and it has a param call "allItems", but its a boolean. It makes all items available in the arsenal. I want to know where it gets its list from

#

And the ace arsenals page only mentions the ability to copy it manually via the editor, not where that list is stored after the arsenal is created

little raptor
#

Well I didn't say read the wikis. I said read the functions themselves

#

Their contents

opal zephyr
#

Ok, ill try and find the vanilla one

shut reef
past wagon
#

does anyone know why this might not be working? It's being executed on the server, but it is only putting the server host into the vehicle when there are 2 players:

{
    _x moveInCargo [_plane, _forEachIndex + 2];
} forEach allPlayers;
open fractal
#

it takes a local attribute

#

you have to remoteExec it or run the script on both machines

#
{
    [_x, [_plane, _forEachIndex + 2]] remoteExec ["moveInCargo",_x];
} forEach allPlayers;

try this

snow shadow
#

Can someone tell me why the following gives me an Error Generic error in expression when I have the following set as the Condition for a trigger?

trg == 1

#

It doesn't go away until it's called

open fractal
#

is trg defined

snow shadow
#

It works when I call it, which is the vexing thing

snow shadow
open fractal
#

is it undefined before it is 1

snow shadow
#

How would I tell? I have kludged together a working script from three separate forum pages, including the community wiki. I do not know what I am doing.

#

Should a bit of script say that trg = 0 on mission start?

#

Well, doing that makes the error go away in two seconds instead of staying there forever, so that's my interim solution

open fractal
#

try this

#

!isNil "trg"

#

in your condition

#

it will activate the trigger when trg exists

#

however i suspect it might be activating triggers sequentially based on the trg value

#

which, tbh, kind of weird and pointless

snow shadow
#

That activates the trigger instantly

open fractal
#

a lot of code from random forum pages is a bit shit, you can go to pastebin and send a link here if you want someone to look at it

open fractal
#

ugh

#

why

#

what does the trigger do

snow shadow
#

Complete a player objective

open fractal
#

thats a little goofy

#

here

snow shadow
#

It is activated by a Hold Action, which was a much larger pain in the ass

open fractal
#

write trg = -1

#

if it's a server only trigger put it at the top of initServer.sqf
otherwise put it in init.sqf

snow shadow
#

That's part of the mission file, isn't it?

open fractal
#

if you arent sure go with init.sqf

#

yeah next to mission.sqm

#

make a file called init.sqf

#

make sure it's init.sqf and not init.sqf.txt

#

if the file is already there then make a line at the top

snow shadow
#

No file there, need to make it

#

Anything else it should include, or will trg = -1 at the top suffice?

open fractal
#

it'll fix the issue of the variable being undefined

#

i highly encourage you to send a pastebin link to that code, it smells funny

snow shadow
#
targ1, 
"Sabotage Comms Array", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
"_this distance _target < 7", 
"_caller distance _target < 7", 
{}, 
{}, 
{trg = 1}, 
{}, 
[], 
30, 
0, 
true, 
false 
] remoteExec ["BIS_fnc_holdActionAdd", 0, targ1];```
#

targ1 is the object Variable Name

snow shadow
#

Everything else is triggers, modules, and syncing things together

past wagon
#

can someone explain to me why this code in onPlayerKilled.sqf isn't working? It's supposed to give the killer a notification that they killed an enemy. Nothing shows up....

params ["_player", "_killer"];

if (_killer in allPlayers) then {
    [name _player + " was killed by " + name _killer + "!"] remoteExec ["systemChat"];
    [[
        parseText ("<t font='PuristaBold' size='1.3' color='#ff0000'>Enemy Killed:<br/><t font='PuristaBold' size='1.3' color='ffffff'>" + name _player),
        [1, 0.5, 1, 1],
        nil,
        7,
        0.7,
        0
    ]] remoteExec ["BIS_fnc_textTiles", _killer];
} else {
    [name _player + " was killed!"] remoteExec ["systemChat"];
};
warm hedge
#

systemChat takes a string not an array

open fractal
#

you should define a function for that

past wagon
open fractal
snow shadow
#

Like I said, most is from the wiki, the forum posts got me to know the difference between = and ==

past wagon
open fractal
# past wagon why?

it's already compiled and ready to go from config if you define it in description.ext

snow shadow
#

I'd have used the wiki exclusively but it's terrible at explaining things to absolute scripting noobs

open fractal
#

on every machine

#

then you only have to use remoteExec once to have the target player call your function

past wagon
#

ok

open fractal
snow shadow
#

Trouble is, it assumes you know what it's going on about

open fractal
#

wdym

snow shadow
#

If I want to drop in this one thing, I have to go through this whole course. The page is not self-contained for a noob

open fractal
#

can you name specifics

snow shadow
#

... wait, that was the other wiki

open fractal
#

there are a few people in here daily who will take the time to explain it in detail if you signal that you're willing to learn

snow shadow
#

I'm willing, but I don't have the time is the problem. Two years ago I would have had plenty of time

#

I just want to do the one thing when I need it, knowing everything about the scripting language feels superfluous for that need

warm hedge
past wagon
snow shadow
#

Or, more of an overinvestment

#

That's a better word

#

Learning a lot to do very little

open fractal
#

one day you might get that itch to do something no one's done before, that's why I fell down the rabbit hole

snow shadow
#

I just want my friends to have fun, without kludging things in the moment with Zeus quite as much

#

I've done one mission that works without a Zeus, and it took sooooooooooo much longer to make

#

It also doesn't work for anyone other than me because the music breaks for some reason

#

So I'd have to rescore it for anyone to actually play the blasted thing

open fractal
#

zeusing is my personal hell

snow shadow
#

I love it man, watching people in the moment react to things is wonderful

#

So much catharsis when they hit your traps

#

My current style is a blend of editor and Zeus in concert, with everything placed in advance while the Zeus adjusts things that I didn't expect

#

Also, making sure the AI pulls their punches more by RCing them and deliberately missing

open fractal
#

I like having control over everything in the editor to balance the mission out and not feel guilty about removing respawns entirely

snow shadow
#

My players are far too bad at the game for that to work lol

past wagon
#
{
    _x moveInCargo [_plane, _forEachIndex + 2];
} forEach allPlayers;
```If this code is executed on the server, will it move all players into the vehicle? Because it isn't working for me.... only the server host gets put in. The plane is a Blackfish and has like 30 cargo seats. The first two are turret seats in the back, which I want to skip when putting players in...
snow shadow
#

I'll let you get back to it

open fractal
open fractal
#

if you check the wiki page it says local argument***

#

which means you have to run it on each player's machine

#

like the example I wrote

past wagon
open fractal
#

yw

snow shadow
#

Before I go to sleep, I just want to say that I am very grateful for the help

#

I'm just frustrated that this took me two hours, when if the object could have been blown up I could have made the objective in twelve minutes

#

But I keep telling myself I want each mission to contain something new, in terms of how it was created, so getting a Hold Action to work was part of that

#

Thanks

balmy raven
#

G'day scripters.
I"m looking to use the respawn loadout menu in my next mission to allow players to select different loadouts depending on what role they chose.
However I do not want all players to be able to see the same loadouts.

For example. Unit A is a rifleman, I want to give him 4 loadouts to chose from within the loadout menu = Easy enough.
Unit B is a sniper, I want him to only have his own, seperate sets of loadouts separate from the ones available to Unit A.
I don't want them to be able to see each others loadouts or be able to select each others loadouts.

Is this something that someone could lend some assistance with?
Cheers,

when you reply can you use the reply function or @ me

tough abyss
#

The actual code involved is simple but you'll want to familiarize yourself with those

#

In order to have distinct loadout menus on an individual basis, you'll need to either make separate roles for each individual and limit the number of players in each role to 1, or create a manual role selection system that shows/hides loadouts

still forum
copper raven
marsh trench
#

i have a trigger and in its onActivate event, i have the following :

["INTERN_fnc_onActiv", thisTrigger] call (missionNamespace getVariable "mission_arsenal_core");
hint "Activated";

mission_arsenal_core is script, that gets compiled and stored :

//init.sqf
missionNamespace setVariable ["mission_arsenal_core", compile preprocessFileLineNumbers "scripts\arsenal.sqf"];

now my problem is, the first time you enter this trigger, the call function doesn't do anything. but when you go out of the trigger, and re-enter it, it works. its like you need to call it atleast once to get it to work. how can i fix this? i think it has something to do with the way i'm compiling and storing the script.

little raptor
#

or maybe "ref-counted value" thonk

little raptor
#

second of all,

the call function doesn't do anything
do you mean the hint is displayed correctly?

#

if so it means your function is not defined. or it has an error somewhere

copper raven
modern agate
#

For some reason this single trigger out of about 12 doesn't work
D3 switchMove "Acts_Peering_Back";

The ai's variable name is D3 and no matter what i do it wont work

modern agate
#

this

little raptor
#

also when you do switchmove, always use playMoveNow afterwards

#
D3 switchMove "Acts_Peering_Back";
D3 playMoveNow "Acts_Peering_Back";
#

like that

still forum
still forum
little raptor
little raptor
#

what I mean is that assigning refs changes the value but with pointers it doesn't
which is why I say calling SQF values "references" can be a bit confusing

balmy raven
copper raven
#

for example reference in C# has pretty much the same meaning as SQF reference

little raptor
#

never done C# so blobdoggoshruggoogly

winter rose
#

this discussion is pointless then

#

see what I did ☝️ ← here? a pointer joke's pointer joke!

spiral zealot
#

Hello lads, I've got a question for you all. I hope you can help me.
https://www.youtube.com/watch?v=JoJU4GwKpLY
I found this amazing video which shows obtainable loadouts from the interaction menu, I love the concept and would love to implement this into my server, but with so many files, so much scripting, im just lost as i've never done this before.
Is there perhaps an easier way to do this? I know you can Export loadouts and get a long line of code which is correlated to that loadout, any way to just give that a title, plop that text and simply say if you select this, you get that long line of code put into you?

little raptor
#

yes. with addAction

spiral zealot
#

if you got some spare time to explain that I'd love to learn how to do it)

little raptor
#
this addAction ["Give Loadout 1", {
  params ["", "_caller"];
  _caller setUnitLoadout [
    ... //loadout you copied from Arsenal
  ];
}];
#

put that in the init field of some object

#

e.g. a crate

#

if you want this for multiple objects or multiple loadouts just make a script file to save yourself some copy paste

spiral zealot
#

right, and I rename "loadout 1" with a loadout from my saved loadouts?

little raptor
#

it's just a name, so yes

spiral zealot
#

so i have a loadout in my saved loadouts called "rifleman", therefor i'd do

this addAction ["Give Rifleman", {
params ["", "_caller"];
_caller setUnitLoadout [
... //loadout you copied from Arsenal
];
}];

little raptor
#

actually wait I noticed that the loadout you get from Arsenal is something else meowsweats

spiral zealot
#

do you mind if we do this in dm's? I cant send screenshots here for some reason

little raptor
#

it gives you a full code itself

little raptor
spiral zealot
#

of course

#

sent all

little raptor
# spiral zealot so i have a loadout in my saved loadouts called "rifleman", therefor i'd do >...

so to make it easier and more readable, just do it this way:

  1. create a folder in your mission folder called loadouts
  2. in the folder make some text files, change their names to loadoutName.sqf (e.g. rifleman.sqf)
  3. in each file put this:
params ["", "_caller"];
_caller setUnitLoadout ...

instead of the 3 dots just paste the loadout from ACE Arsenal

  1. in the box's init, add:
this addAction ["Rifleman Kit", "loadouts\rifleman.sqf"];
this addAction ["AT Kit", "loadouts\AT.sqf"];
```etc.
#

just copy each line like that and make sure they're ended with ;

spiral zealot
#

that looks too simple to work πŸ˜„ if it works i'll be SO HAPPY, im gonna try it and get back to you. Thanks a million!

little raptor
spiral zealot
#

all done, thank you very much ❀️

little raptor
#

that makes it red for example

#

if you want to make your own color, just type: rgb to hex in google

#

it gives you a tool to create hex colors

#

@spiral zealot

spiral zealot
#

perfect, thank you very much

little raptor
#

edited the code

tough abyss
#

I've used both C and C++ rather extensively and I get the difference between shared pointers and references, but sometimes it's simply easier to say that everything aside from arrays are pass-by-value in SQF given that the behavior is almost indistinguishable from if they were

#

And getting into the concept of pointers in a language that doesn't explicitly use them for the sake of semantics seems a bit moot

still forum
#

I don't want people to belive that assigning a variable or calling functions has to be expensive because every value is copied.
Everything is by ref and I don't see why one would want to state the opposite of whats true because its simply easier?

tough abyss
#

That's perfectly fair and I'm perfectly willing to not explain it that way in the future, just explaining why I did so

marsh trench
# little raptor if so it means your function is not defined. or it has an error somewhere

this is the arsenal.sqf script file :

params["_internal", ["_argument", nil]];

private _debugMode = missionNamespace getVariable "mission_debug_mode";

switch (_internal) do {
    case "INTERN_fnc_onActiv": { [_argument] call INTERN_fnc_onActiv };
    case "INTERN_fnc_onDeAct": { [_argument] call INTERN_fnc_onDeact };
    case "INTERN_fnc_debug"     : { [_argument] call INTERN_fnc_debug     };
    default { };
};

INTERN_fnc_debug = {
    params["_text"];
    if (_debugMode) then { systemChat ("[SYS-DEBUG] " + _text); }
};



INTERN_fnc_onActiv = {
    params ["_thisTrigger"];
        hint "Inside onActive";
    for "_i" from 0 to 2 do {
          private _light = missionNamespace getVariable ("arsenal_lamp" + str _i);
        if !(isNil "_light") then {
            _light switchLight "ON";
            [format ["Arsenal lamp %1 activated!", _i]] call INTERN_fnc_debug;
        };
        
    };

    _ahm = createHashMap;

    for "_i" from 0 to 2 do {
        private _obj = missionNamespace getVariable ("arsenal_obj" + str _i);
        if !(isNil "_obj") then {
            private _actionIndex = _obj addAction["<t color='#FF0061' size='4'>Open Arsenal</t>", "['open', [true]] call BIS_fnc_arsenal",nil, 6, true];
            _ahm set [str _obj, _actionIndex];
               [format ["[DEBUG-ArsenalT] Arsenal added to obj %1, ahm value set!", _i]] call INTERN_fnc_debug;
        };
    
    };

    _thisTrigger setVariable ["ahm", _ahm];
};

...

if it had any errors, it would've failed the second time i called it too.
what i mean is first time i call it, the hint in onActiv won't work, meaning the function is not actually called (or something is failing it)
P.S the hint in triggers onActivate event works fine evertime.

#

also, how can i know if players have continued the briefing part in multiplayer?
(briefing part, meaning the part when you go into the game, and the game shows you the map until you hit continue)

tough abyss
#

If unit A picks a loadout under a role that's limited to one person, no further units will be able to select loadouts under that role

#

obviously that means that the loadouts won't be "hidden" until someone has chosen that loadout, so if that doesn't fit what you desire, you require an alternative way to actually set who gets what loadout

tough abyss
marsh trench
#

yes, i dont

#

nothing inside that function excutes

exotic flax
#

@balmy raven
You can add custom loadouts with BIS_fnc_addRespawnInventory by setting the target parameter to the specific unit.

Although you still have to figure out which player gets which loadout(s)

tough abyss
#

@marsh trench The issue is that INTERN_fnc_onActiv and the other functions defined in that file aren't actually defined until the first time the function is run. Just compiling the code doesn't actually cause those functions to be defined.

#

One way you could fix that is by either defining the functions separately or just defining them before the switch statement, but note that the latter will be having them be re-defined every time the function is run.

#

Overall the issue here relates to how you're trying to do things, it'd be cleaner and cause less issues like this to just define the functions separately or with a function library rather than having them all in a file together being called by a switch statement.

little raptor
little raptor
tough abyss
#

Is there any particular reason that AFAIK we can't work with the model of held weapons? Would be great to be able to work with weapon memory points and such via SQF.

#

Or, if there is a way to do so, it certainly seems to have evaded me

exotic flax
#

depends on what you want to do

#

with namedProperties, selectionNames and selectionPosition you should be able to find the named properties of a model and get the position of each property to be used in SQF

tough abyss
#

Yeah I know you can approximate weapon positions with the player's selection positions, but that's the closest you can get AFAIK

#

I mean getting selectionPositions of memory points on the actual gun model which I don't see how to do

#

this is something I've wanted to be able to do for a long time so if it's doable and I just didn't realize how to do it I'm going to be awed

exotic flax
#

currentWeapon returns the name of the weapon, and unless you create a new object it's not possible to get the actual weapon object.
Perhaps you could try nearestObject, but I'm not sure how weapons behave to that πŸ€”

tough abyss
#

As far as I've seen the weapons held by the player basically don't exist in the world as far as SQF is concerned

#

no command to get them as an object or anything similar

sharp sable
#

How do I know the name of the ammunition that the artillery shoots to record in the script?

granite sky
#

You can look them up in config or use a Fired event handler.

sharp sable
little raptor
#

they're proxies

#

as for how, you have to create a simple object using the weapon model

sharp sable
granite sky
#

honestly that's pretty hard work. What exactly is your use case here?

#

If you just want to know magazines for specific artillery as a one-off, just spawn one and do magazines _vehicle

tough abyss
#

I don't suppose there's any clean way to overlay a simple object of the weapon over the proxied one so it doesn't really help the situation

little raptor
#

there is

#

just move it every frame meowsweats

tough abyss
#

lol well yeah that's where the clean part becomes a problem

#

not to mention I'd suppose you'd need attachTo with bone rotation which is already janky when it comes to players

little raptor
#

well attachTo works to some extend as well

little raptor
tough abyss
#

yeah so I've noticed

#

it's understandable if it's not something you're intended to be able to do, would just be nice

#

seems like a strange limitation

little raptor
#

well if it followed the res lod's bone axis instead of the mem point it would work

#

but I guess the reason they don't do that is that res lods, as the name suggests, change (depending on distance)

tough abyss
#

yeah

little raptor
tough abyss
#

yeah I've set up models to follow weapon movement smoothly, and it works well enough for some things

#

just annoying that I can't just use weapon model mempoints

#

for reference, my present use case is that my portal gun needs to have some different changing things on it

#

I already have some UVanimated energy beams that "attach" to the front of the gun when you pick something up, and that works decently enough where I don't much mind

#

but I also am trying to have a light source which changes color in the top of the gun which is a pain to pull off with just attaching and such

#

either way, will find a way to do it, just wanted to make sure I wasn't missing something

little raptor
#

I'm just gonna put this here (again)

tough abyss
#

Thanks, I'll see about applying it

#

One workaround we've found is using weapon attachments, which works decently well for the portal gun seeing as it has no need for scopes, flashlights, etc.

#

Which will probably still be necessary since per-frame updates aren't really gonna fly well especially in MP

sharp sable
vital bough
#

On public servers, I have some compositions with ambient animations set in the init values, and whether they work or not seem kind of hit or miss depending on which server I'm on. Only 4 servers allow scripts like ZAM (in the US anyway, numbers 02, 02e, 02w and 04). which ones allow compositions with custom init values for things like ambient animations or vehicle color?

shadow canopy
#

Is there away to get the locked on target for like a jet or like the cwis? afaik there isnt any EH or a command to get that

#

I guess missileTarget might work, but not for bullets for cwis I guess

modern agate
#

Trying to make a vehicle move about 5m forward out of a tree line for a ambush via a trigger, it refuses to do so, ive tried disableAI"Move" enableAI"Move" stuff and skipping hold way points after trigger activation to move but it wont just go forward a few meters

granite sky
#

Yeah, that's really something that you need to do with the hacky fine-control mechanisms. setVelocity, setVelocityTransformation or those direct command-movement controls that I can't remember how to find.

open fractal
#

doMove?

#
driver _vehicle doMove (_vehicle getRelPos [5,0]);
granite sky
#

doMove has basically the same behaviour as waypoints IME

#

so a 5m one is probably just gonna complete. Depends on the vehicle type though.

modern agate
#

cant get it to work, the offroad just refuses

open fractal
#

have you considered moving it further out

#

or BIS_fnc_unitPlay

modern agate
#

ill try, guessing its just too short to work

past wagon
#

can anyone tell me why my quadbikes might be spawning in with a random color even though I set their texture with this script?

private _civCars = [
    ["C_Hatchback_01_F", ["a3\soft_f_gamma\hatchback_01\data\hatchback_01_ext_base09_co.paa"]], 2,
    ["C_Hatchback_01_sport_F", ["a3\soft_f_gamma\hatchback_01\data\hatchback_01_ext_sport05_co.paa"]], 1,
    ["C_Offroad_01_F", ["a3\soft_f_enoch\offroad_01\data\offroad_01_ext_grn_co.paa", "a3\soft_f_enoch\offroad_01\data\offroad_01_ext_grn_co.paa"]], 2,
    ["C_Offroad_01_covered_F", []], 1,
    ["I_C_Offroad_02_unarmed_F", []], 2,
    ["C_Quadbike_01_F", ["a3\soft_f_beta\quadbike_01\data\quadbike_01_civ_black_co.paa", "a3\soft_f_beta\quadbike_01\data\quadbike_01_wheel_civblack_co.paa"]], 2
];

private _carTypeArray = selectRandomWeighted _civCars;
_carTypeArray params ["_carType", "_textures"];
private _car =  createVehicle [_carType, _location];
_car setDir _direction;
{
    _car setObjectTextureGlobal [_forEachIndex, _x];
} forEach _textures;
``` Setting the textures is working fine for the hatchbacks and offroads, but not for the quad bikes...
#

I got these textures by doing getObjectTextures on the vehicles with the paint jobs I wanted, so it should be exactly correct.

warm hedge
#
_car setVariable ["BIS_disableRandomization",true]``` will do IIRC
past wagon
#

ok

#

thanks

past wagon
#

also, I still need to get it set to a specific texture. it's working fine for the other vehicles, but not quadbikes for some reason

warm hedge
#

After the randomized will do but in order to do that you'll need a bit of spawn

stable siren
#

what do i do to make units renegade BESIDES shooting them? I want to make it so that we will be attacked by all 3 factions rather than just 2. i say this because we are an indfor group but some of our enemy units are on indfor as well (bandits, zombies, etc.). but since we are both indfor we cant attack each other.

i have been surfing the wiki for the script combo, but i cant seem to get it to work. I tried addRating followed by -2000 but im still indfor. can anyone help me? simply reply to this message so i get pinged

warm hedge
#

Seems like -2000 is not enough

#

-5000 did work

stable siren
warm hedge
#

Lieutenant you mean?

stable siren
#

yes

warm hedge
#

It does not even matter

stable siren
#

so even when renegade, my player name when aimed at will still be Lt.?

#

like Lt. Jackson

warm hedge
#

Ey, why it does matter? A nameplate won't be changed

#

And it turns out -2001 does work

stable siren
#

well, the name playe tells my friends not to shoot at me

#

logically speaking, if all player units are renegades, we are on the same side

#

we will still keep our group right?

warm hedge
#

I just tested. Everyone shoots each other so no problem

stable siren
#

even my own player controlled units?

warm hedge
#

Why? A player won't shoot by the character itself, you shoot someone

stable siren
#

sorry im just trying to understand this side of scripting

#

it will open up my mind to new ideas

warm hedge
#

sideEnemy already is enemy, even for sideEnemy itself

stable siren
#

if i could, i'd show you a screenshot of what i have set up

warm hedge
#

DM me so I can post it

#

I meant you should just post the picture not the question. I only answer it here... and what exactly is your goal? You want to make it so this group will behave like an alternative side alongside with BLUFOR, OPFOR and Independent?

stable siren
#

no my goal here is to make it so that ALL playable units (as shown), that are grouped together (as shown), will be attacked by fellow indfor units instead of just red and blue

#

yes

#

alternate side

warm hedge
#

What

stable siren
#

well, when a unit is set to renegade its attacked by everyone

#

all 3 factions

warm hedge
#

Perhaps you can make the groups civilian and make civilian hostile so possible to make, if civilian doesn't present on your mission

stable siren
#

thats my goal here. to make those grouped units attackable by all factions

#

oh

#

but wont making civilians hostile mean that they will attack us?

warm hedge
#

I meant, civilian is you

#

So BLUFOR, OPFOR and Independent can attack you at the same time

stable siren
#

ok that makes sense, but i have tried it and nobody attacks us (cause we are civilian, regardless if armed or not) so they dont consider us an enemy

#

so what youre saying is, if i set us to civilian, drop our rating, we will be shot at by all 3 factions?

#

including armed AI civilians?

warm hedge
#

Oh wait disregard, I just tested and looks they're forced not to shoot civilians even if I use setFriend command, unless do addRating

stable siren
#

yeah thats what i was thinking

#

the arma campaign works like that. the geurilla group Kerry joins in East Wind are against opfor, blufor, and indfor

warm hedge
#

When it does?

stable siren
#

thats essentially what im aiming for. kerry is still grouped up with geurilla fighters against all 3 factions. given this logic, i am assuming that all those groups shown are all lead by a "Kerry"

warm hedge
#

I don't even remember The East Wind does that

stable siren
#

yes it does

warm hedge
#

In Game Over?

stable siren
#

no, the whole east wind campaign

#

from the moment kerry lands on the beach

#

to him meeting with that geurilla leader stravos

warm hedge
#

A faction is not a side

stable siren
#

then if thats the case, then BI must have made the AAF redfor, or blufor for them to attack kerry and the rebels

warm hedge
#

A faction, like CTRG, FIA, Gendarmerie, NATO are in side BLUFOR. They are not meant to shoot each other

stable siren
#

yes i know that

#

but you arent getting what im saying here

warm hedge
#

No I don't

stable siren
#

in the campaign "east wind" kerry joins a band of anti-AAF rebels, lead by stravos

warm hedge
#

I know the lore

stable siren
#

yes, so what im essentially trying to do here is recreate that kind of logic. a group of player against all 3 factions. i will try with your civilian idea and see where that goes

#

it MAY work based on my past experiments

warm hedge
#

Again I don't even remember when FIA got attacked by BLUFOR, OPFOR and Independent at the same time in The East Wind

stable siren
#

well the FIA were/are classified as greenfor. AAF is greenfor. how were they able to shoot each other

#

thats the million dollar question here

#

i hacked the mission using a zeus mod (so i can zeus the units around), and noticed that the AAF units are greenfor, and so are the FIA

warm hedge
#

FIA in The East Wind is BLUFOR, therefore

#

I got the million

stable siren
#

clever bastards

warm hedge
#

More like FIA was existed as BLUFOR for all the time

#

...In Arma 3 I meant and IIRC as well

stable siren
#

i dont actually recall the east wind campaign prior to game over having blufor units

#

it was you against red and green

warm hedge
#

Attacked by both you mean?

stable siren
#

yes

#

because apparently CSAT and AAF were buddies

warm hedge
#

It is always possible, I don't recall if Game Over does that

stable siren
#

no it doesnt

#

game over is you against everyone

#

which is another thing im trying to make

warm hedge
#

But Game Over has some buddies

stable siren
#

yeah but they are recruited and join your side, whatever your side may be

#

so when they join you, their side may be changing to renegade

#

because "kerry" in game over is considered renegade

#

i feel like civilian would probably be my best course of action in this whole scenario. i mean, they are a neutral/configurable faction. they can be armed civilians against everyone, or passive civilians that just stand idle or roam around

warm hedge
#

No, Kerry in Game Over is BLUFOR

stable siren
#

to be fair, in all that drama, i dont even recall who was shooting me. i just ran for the ocean lol

warm hedge
#

Apparently I got shot both by OPFOR and Independent, not BLUFOR

stable siren
#

ok so my whole "kerry" logic is voided. so that means my only option, to reach my end goal here of making all playable characters enemies of all factions, is to set them to civilian with a negative rating, or keep them indfor, but still give them a negative rating

#

those 2 options are all what i have understood from this

warm hedge
#

Well, I guess be attacked by all three sides but keep your group organized still is impossible it seems

stable siren
#

so all group members when set to renegade, will disband and become their own individual unit?

#

i guess that works too

warm hedge
#

Won't disband, but still renegaded, group members can shoot the renegaded, regardless of if the shooter is renegade already or not

stable siren
#

so a whole group can be renegade?

warm hedge
#

Yes, but the whole group can shoot the group members

stable siren
#

ok that makes sense

#

so i dont have to set them to civilian

#

im trying to keep civilian strictly to passive AI

warm hedge
#

Well if the players never meant to be an AI, this is your choice

stable siren
#

ok so my options still stand. i can either make all players civilian renegades, or indfor renegades.

#

im leaning more towards renegade indfor, so we can have an excuse to attack armed civilian AI, in addition to OPFOR, BLUFOR, and other INDFOR ai units

#

ill just test both of these logics, see which one matches my goal here

warm hedge
#

Well, good luck anyways

stable siren
#

thanks

#

if i stumble uppon any pebbles along the way, ill post here soon

#

i hope in arma 4 they will add the ability to create a custom side and set its parameters to attack all factions (except civilians)

stable siren
warm hedge
#

I hate the game engine that from 20th Century 😩

stable siren
#

and my name plate and rank are still kept as if im still a friendly

warm hedge
#

Good

stable siren
#

i can work with this twisted logic

#

yeah i run a group/unit, and we play as a PMC working for the highest bidder. so that means we need to be an enemy of all factions, including civilians.

#

anyways, thanks for the help!

warm hedge
#

I actually hope if Dedmen can add a few more sides to play with... πŸ‘€

stable siren
#

but there are only 4 sides in war

#

nato, pact, third worlds, and civilians

warm hedge
#

The Good, The Bad, The Ugly πŸ˜‹

stable siren
#

essentially

#

also i dont know if this is possible, but out of my own laziness, can i set a group to renegade instead of giving every player unit a rating script?

warm hedge
#
{_x addRating -10000} forEach units <put the group>```
stable siren
#

<group variable> right?

warm hedge
#

Ayup. Without the <> of course

stable siren
#

btw does the negative level of the renegade matter?

#

like those less renegade wont be prioritized

winter rose
#

nope afaik

stable siren
#

good to know

marsh trench
#

how can i find A3\music_f\Music\ folder? or see its content..

warm hedge
#

In Arma 3\addons\music_f_music.pbo

marsh trench
#

how can i know if players have continued the briefing part in multiplayer?
(briefing part, meaning the part when you go into the game, and the game shows you the map until you hit continue)

marsh trench
#

thankyou

#

why doesn't fadeMusic work here?

playMusic "vn_another_life";

waitUntil {scriptDone _script1}; // music must be played until _script1 is done

5 fadeMusic 0; // slowly fade out.
sleep 5; // wait until the fade is completed
playMusic ""; // reset music.
#

it just stops without fading. just suddenly stops.
i removed the playMusic "" to see if any kind of fade is happening, but no, the music continues to be played without it. no fade, no stop.

little raptor
#

waitUntil {scriptDone _script1};
that's a bad way to do things

#

waiting in a scheduled envm for another script to finish is never right

#

but anyway I have no idea why fadeMusic doesn't work for you

#

maybe it's broken

ocean folio
#

looking for some insight onto this error

#
11:37:37 Bad conversion: array
11:37:37 Error in expression <rName = "marker" + str _forEachIndex;        
createMarker [_markerName, _unit];                        >
11:37:37   Error position: <createMarker [_markerName, _unit];                        >
11:37:37   Error 0 elements provided, 3 expected
11:37:37 File AJ_Cache2\functions\fn_moduleNuke.sqf..., line 13
#

line 13 is:

private _markerName = "marker" + str _forEachIndex;    // gets the index of the current unit
#

in my head that makes sense as "marker0, marker1, marker2, etc." but apparently thats not what's happening

little raptor
#

but you provided 0

#

or _unit is not defined

ocean folio
#

is that actually referring to line 13 then?

copper raven
#

it's line 14

ocean folio
#

no, that would be the createMarker line

#

yeah

#

I see it now

copper raven
#

it's usually +1 on the line, unless you use bytecode and properly provide positional info

#

arma's parser indexes lines from 0

ocean folio
#

+1 on what line?

copper raven
#

anyway, you're passing _unit, you actually want position

copper raven
little raptor
#

wiki says object is ok. so that means _unit is not defined

ocean folio
#

I thought you could (as of 2.1) just do that

ocean folio
#

ohhhh I see what you mean, kinda like everything else I've debugged in C++

#

exception always throws just after

little raptor
#

in here it would be "before" tho thonk

#

not after

ocean folio
#

sigh yeah you are right, I'm thinking about it too much πŸ˜†

#

I think the source of my issue is getting the units sync'd to the module, I'll have to do some reading and figure that out

#

thanks for the help!

copper raven
#

your issue is _unit being undefined, as Leo said

ocean folio
#

_unit is derived from _units at _x

copper raven
#

can you send entire code with the loop?

ocean folio
#

I absolutely would if I didn’t just get pulled away to deal with some other stuff. I’ll send it when I get back

worthy igloo
#

how can i convert a hpp gui to sqf if the converter thing doesnt work

tough abyss
#

To get an AI to move without vanilla systems I need to:

  1. Orient the AI in the movement direction

  2. Start a movement animation

  3. Stop the movement animation when the objective is reached

Correct?

marsh trench
#

there is an animation in the animation viewer, that shows the name of driver_boat01 and its file is \A3\cargoposes_F\Anim\driver_boat_01_mocap.rtm. how can i set a units animation to this?

this animate ["driver_boat01", 1];

doesn't work on the unit. is the name wrong, or am i doing it wrong?

past wagon
#
{
    [_x, [_plane, _forEachIndex + 2]] remoteExec ["moveInCargo", _x];
} forEach allPlayers;

This is only putting the server host into the plane. Why isn't it working for all players?

little raptor
past wagon
#

yes

#

it has 30 seats

tough abyss
#

when should I use call vs execVM

past wagon
little raptor
#

generally speaking you should NEVER use execVM

little raptor
#

the code is correct

little raptor
#

look in config viewer

#

also when do you execute that?

#

are you sure all players are present?

tough abyss
#

In init.sqf:


myVariable = 0;
_myLocalVariable = 3;

null = [_myLocalVariable] execVM "test.sqf";

in test.sqf

_myArgument = {_this select 0};

hint str _myArgument;

And yet it is printing "_this select 0"

#

What am I missing

past wagon
little raptor
#

so you get the code itself

tough abyss
#

Oh, use ()

little raptor
#

there is no ()

#

you call the code

#
hint str call _myArgument
tough abyss
#

() works perfectly

tough abyss
tough abyss
little raptor
little raptor
#

I thought you're just testing things

tough abyss
#

I accidentally wrapped them in {}

past wagon
#

what does "local argument" mean for moveInCargo?

#
unit moveInCargo vehicle
open fractal
little raptor
#

I said generally speaking

past wagon
little raptor
#

but might be vehicle local blobdoggoshruggoogly

#

try both

past wagon
#

ok

#

sooo

#

what does it mean if its vehicle local?

little raptor
#

it means change the remoteExec target to the vehicle

#

instead of unit

past wagon
#

ohh

#

got it

#

ok

#

I have another question. Does initPlayerLocal run locally for the server host when they start the mission?

open fractal
#

yes

past wagon
#

ok....

#

it seems like it isnt working for me, I'll have to check again

tough abyss
#

Can you make a FSM for civilian faction?

#

I want that to be a project I do in a few months, as a intro to AI

marsh trench
#

is it possible to rotate a Leaflets picture?

#

the picture i took is horizontal and the leaflet is showing it vertically and stretched.

little raptor
#

FSMs don't have specific sides on their own

#

but you can run the FSM for only civilians yourself

tough abyss
#

How do I set up an FSM for a mission

winter rose
#

properly

little raptor
marsh trench
#

i've created a task using the Create Task module (ModuleTaskCreate_F), and given it a variable name of mission_task_talk.
when i try to set its state using setTaskState in a holdAction, it gives me an error saying mission_task_talk in an object type and not a task type. what must i do?

mission_task_talk setTaskState "Assigned";
#
tough abyss
#

What is the easiest way to get a random location that is not blocked by an obstacle

tough abyss
#
// forever
while {true} do {
    a = nearestObjects [p, ["house"], 200];
    b = 0;
    {
        _marker = createMarker[(str (b + 1)), _x];
        _marker setMarkerShape "ELLIPSE";
        _marker setMarkerSize [3, 3];
        
        sleep 2;
    } forEach a;
};

This stops at the first building marked, why is that?

warm hedge
#

You didn't redefined b after

tough abyss
#

Oh hey thanks

#

I'm curious why is it not changing the marker every time then

#

since wouldn't it just override it

warm hedge
#

But you don't even need b at this context, _forEachIndex is enough

tough abyss
warm hedge
#

Yes

#

But whatsoever, what's your intention on this script?

tough abyss
#

I am curious though it is marking stuff other than building positions with ellipses

#

Along the splines of power lines it seems and some tree areas

warm hedge
#

Mm. Any static thing can be a house, like a fusebox or...

tough abyss
#

I se

#

if buildings are made up of multiple positions

warm hedge
#

How's your code?

tough abyss
#
// forever
while {true} do {
    a = nearestObjects [p, ["house"], 200];
    {
        _marker = createMarker[str _forEachIndex, _x];
        _marker setMarkerShape "ELLIPSE";
        _marker setMarkerSize [3, 3];
        
        sleep 2;
    } forEach a;
};
#

Am I missing something

warm hedge
#

Where is buildingPos?

tough abyss
#

I forgot ☠️

#

can I do forEach a buildingPos

#

Does this work

warm hedge
#

Since a is an array you can't. But buildingPos _x

#

You can nest forEach as many as you want

tough abyss
#

How do I get each building position since a building has multiple?

#

I need to do building buildingPosition index

little raptor
ocean folio
# copper raven can you send entire code with the loop?
_units = param [1, [], [[]]];

//// init stuff
// private _unitMap = createHashMap;
private _markers = [];

{
    // Current result is saved in variable _x
    private _unit = _x;                                 // gets the current unit
    private _markerName = "marker" + str _forEachIndex;    // gets the index of the current unit
    _newMarker = createMarker [_markerName, _unit];        // create marker for current unit            //UNIT IS UNDEFINED, FOR SOME REASON ITS NOT DETECTING SYNC'D UNITS!!!
    _markerName setMarkerType "b_inf";

    _markers pushBack _newMarker;
} forEach _units;
#

sorry for the delay

copper raven
#

print _units before the loop, maybe it has some nil values

ocean folio
#

_units is what I think it is right? units sync'd to the module?

#

I was afraid that I had a major misunderstanding in what that was

copper raven
#

well i don't know what arguments callee passes to this

little raptor
tough abyss
#

The script works now, but for some reason its stopped after like 20 markers

#

and it wont mark this other building

#
// forever
while {true} do {
    // get the nearest objects
    a = nearestObjects [p, ["house", "building"], 200];

    // for each object
    {
        apos = _x buildingPos -1;
        // for each building position
        {
            // create a marker
            _marker = createMarker[str _forEachIndex, _x];
            _marker setMarkerShape "ELLIPSE";
            _marker setMarkerSize [3, 3];
            sleep 2;
        } forEach apos;
         
    } forEach a;

    
};
#

here is the code

little raptor
warm hedge
#

You can't reuse marker name

little raptor
#

duplicate marker names are not allowed

tough abyss
#

dang

#

guess I'll have to make a iterator variable

ocean folio
#
        class Attributes: AttributesBase
        {
            // Arguments shared by specific module type (have to be mentioned in order to be present)
            //THIS IS THE "Applies to: groups of synced objects" thing
            class Units: Units
            {
                property = "myTag_ModuleNuke_Units";
            };
            // Module specific arguments


            class ModuleDescription: ModuleDescription{}; // Module description should be shown last
        };
#

this was from my CfgVehicles.hpp

copper raven
tough abyss
#

It has a 2 secnd suspension

little raptor
#

it doesn't. that suspension is in the forEach loop

warm hedge
tough abyss
ocean folio
copper raven
#

yes, inside the foreach, if there is a case where nearestObjects returns an empty array, it will just keep on going

little raptor
little raptor
tough abyss
#

I got it

#
// forever
while {true} do {
    // get the nearest objects
    a = nearestObjects [p, ["house", "building"], 200];

    // for each object
    {
        apos = _x buildingPos -1;
        // for each building position
        {
            // create a marker
            _marker = createMarker[str _x, _x];
            _marker setMarkerShape "ELLIPSE";
            _marker setMarkerSize [3, 3];
        } forEach apos;
         
    } forEach a;

    sleep 2;
};
#

Just named it the position itselfl ol

copper raven
#

see what you get

ocean folio
#

that works lmao

tough abyss
#

Do I need to use buildingPos for moving AI units through buildings?

#

does the engine know how to path between buildingPos

ocean folio
copper raven
#

yes

little raptor
past wagon
#

I am having some problems when my friend hosts a mission for me.

  1. This code still doesn't work: (it only puts the server host in the plane, not other players)```sqf
    {
    [_x, [_plane, _forEachIndex + 2]] remoteExec ["moveInCargo", _plane];
    } forEach allPlayers;
I this is the third revision of the code I have tried, and it worked for me in the editor (replacing allPlayers with allUnits. But for SOME reason, it STILL will not work with multiple players. I am at my wit's end here.

2)initPlayerLocal.sqf is not running for all players. Sometimes it doesn't run for the server host, and sometimes it doesn't run for me. Here is the code:```sqf
waitUntil { !isnull player };

waitUntil { !isNull findDisplay 46 };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
    params ["", "_key"];
    if ( _key == 60 ) then {
        if ( soundVolume == 1 ) then {
            0.1 fadeSound 0.1;
            hintSilent "Earplugs in";
        } else {
            0.1 fadeSound 1;
            hintSilent "Earplugs out"
        };
    };
}];

player addEventHandler ["InventoryOpened", {
    if (typeOf vehicle player == "B_T_VTOL_01_infantry_F" || player distance aircraftCarrier < 1000) then {
        true
    };
}];

player addHeadGear selectRandom [ //THIS CODE IS NOT ALWAYS RUNNING FOR EVERY PLAYER
    "H_Cap_red",
    "H_Cap_blu",
    "H_Cap_oli",
    "H_Cap_tan",
    "H_Cap_blk",
    "H_Cap_grn",
    "H_Cap_brn_SPECOPS",
    "H_Cap_tan_specops_US",
    "H_Cap_blk_Raven",
    "H_Cap_grn_BI",
    "H_Cap_khaki_specops_UK",
    "H_Cap_usblack",
    "H_Cap_blk_CMMG",
    "H_Cap_surfer",
    "H_Cap_police"
];```
I can immediately tell that the script did not run correctly because either me or my friend do not have the random hat at the start of the mission.... What could be causing it to fail?
little raptor
#

how many players did it move before?

past wagon
#

so 1

little raptor
#

and still 1?

past wagon
#

yep

#

but it worked in the editor

#

with AI

#

but it still wont put me in the damn plane when my friend hosts the mission

little raptor
#

well AI have the same locality as the host, so no surprise there

past wagon
#

oh, nevermind then

#

I guess it still doesnt work

copper raven
past wagon
#

well I have tried remoteExec'ing it both for the plane and for the player

#

there has to be a way to move every player in the mission into a plane lmfao

#

right?

little raptor
past wagon
#

well

#

I know for a fact it isn't always making it to the part where I randomly assign hats

#

I marked it in the code. sometimes I dont have a hat, and somtimes my friend (the host) doesnt have a hat....

#

I'm also pretty sure its not just the hats

little raptor
past wagon
#

ok...

#

what should I do instead?

copper raven
past wagon
#

doesn't player return the player that is local on the connected client?

ocean folio
# copper raven i think the easiest would be to just print the array, `diag_log [_units, _units ...

Done this, it's weird it seems like something ends up in there. Bravo 2-2, but it is in there 4 times?

19:38:40 [[L Bravo 2-2:1],["OBJECT"]]
19:38:46 [[L Bravo 2-2:1],["OBJECT"]]
19:38:46 [[L Bravo 2-2:1],["OBJECT"]]
19:38:49 [[L Bravo 2-2:1],["OBJECT"]]
19:38:50 Starting mission:
19:38:50  Mission file: tempMissionSP
19:38:50  Mission world: Stratis
19:38:50  Mission directory: C:\Users\Aj\Documents\Arma 3 - Other Profiles\Ajdj100\missions\tempMissionSP.Stratis\
19:38:52 "BIS_fnc_log: [preInit] ""DeltaTime computation started"""
19:38:52 Speaker ACE_NoVoice not found in CfgVoiceTypes
19:38:52 [[L Alpha 1-2:1,true,false],["OBJECT","BOOL","BOOL"]]
19:38:52 Bad conversion: array
19:38:52 Error in expression <ker" + str _forEachIndex;    
_newMarker = createMarker [_markerName, _unit];        
_ma>
19:38:52   Error position: <createMarker [_markerName, _unit];        
_ma>
19:38:52   Error 0 elements provided, 3 expected
19:38:52 File AJ_Cache2\functions\fn_moduleNuke.sqf..., line 17
19:38:52 Bad conversion: array
19:38:52 Error in expression <ker" + str _forEachIndex;    
_newMarker = createMarker [_markerName, _unit];        
_ma>
19:38:52   Error position: <createMarker [_markerName, _unit];        
_ma>
19:38:52   Error 0 elements provided, 3 expected
19:38:52 File AJ_Cache2\functions\fn_moduleNuke.sqf..., line 17
past wagon
little raptor
past wagon
#

there is no respawn

#

and this is all happening at the start of the mission

ocean folio
#

yeah I just noticed that, Alpha 1-2 "object","bool",'bool"

little raptor
past wagon
#

I already do ```sqf
waitUntil { !isnull player };

waitUntil { !isNull findDisplay 46 };

ocean folio
#

I dont really know enough about this log to know where those bool's are coming from. The only place I could think would be that I am misusing the Units paramater

little raptor
copper raven
past wagon
#

where? just at the start?

little raptor
#

before the set head gear

ocean folio
little raptor
#

what temp variable?

ocean folio
#

_x

little raptor
#

I don't understand the question

ocean folio
#

magic variable, temp is the wrong word I guess

little raptor
copper raven
#

that's not the issue, i think you missread meowsweats

little raptor
#

oh you diag_logged the whole units array meowsweats

copper raven
#

πŸ˜„

little raptor
#

then yeah that won't help

copper raven
#

@ocean folio you should fix the parameter stuff to work properly

little raptor
#

so the "units" array is 1 unit + 2 bools which I have no idea what they do...

copper raven
#

what i sent is an ugly fix

ocean folio
#

I will have to do some reading on how the sync'd units get passed through to a module

#

its a pain that the documentation for the module framework is.... a bit light

past wagon
#

Can I get some help writing a script that moves all players into the cargo space of a vehicle?

little raptor
ocean folio
#

lol even with sharp's fix I get the map marker at the module's position and not on the sync'd units. There's definitely something bigger in here that I'm doing wrong. Time for the wiki deep dive

#

albeit no errors this time

little raptor
#

there's no other explanation here

past wagon
#

hmmm

#

why would it be blocking moveInCargo?

#

and how?

little raptor
#

does only the caller get moved in?

past wagon
past wagon
little raptor
#

the point was to test it

past wagon
#

I cant test it rn

little raptor
past wagon
little raptor
#

google

past wagon
copper raven
little raptor
#

just google cfgRemoteExec meowsweats

ocean folio
#

woulda been nice to know about earlier lol

copper raven
#

yeah but what i sent should give you the units iirc

ocean folio
#

assuming the units param is doing what I think it is

little raptor
past wagon
#

and how do I unblock it?

little raptor
#

as I said if the server is executing the command there's no limit and it's not blocked

past wagon
#

yeah

ocean folio
# copper raven try doing `diag_log (_units select 0 getVariable ["myTag_ModuleNuke_Units", []])...

empty

19:59:13 Loading movesType CfgMovesMaleSdr
19:59:13 Reading cached action map data
19:59:13 Warning: looped for animation: a3\anims_f_epa\data\anim\sdr\cts\hubcleaned\briefing\hubbriefing_loop.rtm differs (looped now 0)! MoveName: hubbriefing_ext
19:59:13 Warning: looped for animation: a3\anims_f_epa\data\anim\sdr\cts\hubcleaned\spectator\hubspectator_stand.rtm differs (looped now 1)! MoveName: hubspectator_stand_contact
19:59:13 MovesType CfgMovesMaleSdr load time 920.0 ms
19:59:18 No more slot to add connection at 033057 (3386.8,5735.4)
19:59:20 Strange convex component145 in a3\plants_f\tree\t_pinuss2s_b_f.p3d:geometryView
19:59:20 Strange convex component149 in a3\plants_f\tree\t_pinuss2s_b_f.p3d:geometryView
19:59:22 Fresnel k must be >0, given n=2.51,k=0
19:59:29 []
19:59:33 []
19:59:33 []
19:59:33 []
19:59:34 Starting mission:
19:59:34  Mission file: tempMissionSP
19:59:34  Mission world: Stratis
19:59:34  Mission directory: C:\Users\Aj\Documents\Arma 3 - Other Profiles\Ajdj100\missions\tempMissionSP.Stratis\
19:59:36 "BIS_fnc_log: [preInit] ""DeltaTime computation started"""
19:59:36 Speaker ACE_NoVoice not found in CfgVoiceTypes
19:59:36 []
19:59:37  Mission id: 4326a3297ab0517ea578bca66aba34f9d63c7b7d
19:59:39 Loading movesType CfgMovesSnakes_F
19:59:39 Reading cached action map data
past wagon
#

has no one else ever tried to move multiple players into the cargo space of a vehicle before?

copper raven
#

but those property var fields have something in common with that

little raptor
#

there has been a change since some updates ago
looks like it was update 2.08...

past wagon
#

ok

#

is it legitimately impossible?

ocean folio
#

oh right uhhhh.... my module logic also throws an error lmao

#

I just commented it out and ignored it but I probably will need that

#
_logic = param [0, objNull, [objNull]];
#

it throws something about expecting a string but getting objNull, or the opposite

little raptor
copper raven
#

[[_plane, _forEachIndex + 2], { player moveInCargo _this }] remoteExec ["call", _x] also try something like that

ocean folio
little raptor
#

so I guess it is kinda broken

#

and it's known thonk

copper raven
#

that's for AI i think, no?

little raptor
#

it looks like it

#

but apparently does the same thing as moveInCargo with index thonk

#

@past wagon ~~try this one too just for fun 😬 ~~

{
    [[_x, _plane, 2 + _forEachIndex], {
        params ["_unit", "_plane", "_index"];
        _unit assignAsCargoIndex [_plane, _index]; _unit moveInCargo _plane;
    }] remoteExec ["call", _x];
} forEach allPlayers;
copper raven
#

with the config you sent previously

little raptor
ocean folio
#
20:13:30 Error in expression <\functions\fn_moduleNuke.sqf"

_logic = param [0, objNull, [objNull]];

_units =>
20:13:30   Error position: <param [0, objNull, [objNull]];

_units =>
20:13:30   Error Type String, expected Object
#

good god this wiki code is borked lmao

little raptor
#

@past wagon I just confirmed it is broken

#

it's not your fault

copper raven
#

does the call work?

#

as in wrapping the moveInCargo call

little raptor
#

nvm it's not broken

#

I was using plane as target

#

like his code

#

but it should've been _x, as I guessed

copper raven
#

but he said he tried it and it still didn't work

#

atleast i hope he meant the remoteExec target not the command meowsweats

copper raven
little raptor
#

so I guess the cargo index is invalid for him then
I told him to look at config to confirm but I guess he didn't

copper raven
#

if you have is3den set to 1, then args are string and array

past wagon
#

I have tested it out by moving myself into all the different cargo indexes

little raptor
#

so 2 and 3 are valid then?

past wagon
#

I just want to skip 0 and 1. those are turret positions

past wagon
#

its a blackfish. it has like 30 cargo seats

ocean folio
copper raven
bright lagoon
#

I think this is the right channel does anyone know if you can use unit capture to make just a regular person walk a certain path / distance then hop into a vehicle that's already been placed or is that impossible with unit capture?

ocean folio
little raptor
past wagon
#

ok

copper raven
past wagon
#

so what is the code that will successfully put all the players into cargo seats again?

past wagon
#

ok

past wagon
little raptor
#

works fine

copper raven
little raptor
#

just tested

past wagon
little raptor
#

ofc yes meowsweats

past wagon
#

ok....

#

pretty sure it didnt work when I did it

little raptor
#

maybe you didn't update the code properly on the server

past wagon
#

I did

#

my friend was the one hosting it. I sent him the mission file

copper raven
past wagon
#

yes

#

when that didnt work, I tried _plane as the target

little raptor
past wagon
#

pretty sure I had him double check the code

#

guess I'll wait until hes back to test it again

copper raven
#

just start two clients

past wagon
#

wait

#

I can do that?

#

how?

little raptor
#

start Arma twice...

past wagon
#

doesnt steam give you an error?

#

oh

copper raven
#

no

little raptor
#

who even uses Steam...
just use the exe

past wagon
#

from the launcher

#

ok

#

idk if my pc will be able to take this

#

wow

#

it works

#

only took like 2 whole days to put all the players in the damn plane

ocean folio
#

welp now I got another error

#
20:40:50 Error in expression <ll]]; 
_units = _logic getVariable Units;


diag_log [_units, _units apply { typ>
20:40:50   Error position: <;


diag_log [_units, _units apply { typ>
20:40:50   Error Invalid number in expression
20:40:50 File AJ_Cache2\functions\fn_moduleNuke.sqf..., line 8
20:40:50 Error in expression <ll]]; 
_units = _logic getVariable Units;


diag_log [_units, _units apply { typ>
20:40:50   Error position: <;
#

I dont think this is actually coming from the line it says, unless _logic is for some reason a number

#

idk lol

#

learning is fun πŸ˜…

#

currently its pretty bare bones, just getting the params and the debug

#
_mode = param [0,"",[""]];
_input = param [1,[],[[]]];

switch _mode do {

    case "init": {
        _logic = _input param [0,objNull,[objNull]]; //get module logic
        _units = _logic getVariable Units;


        diag_log [_units, _units apply { typename _x }];

    };
};
#

I guess it really was line 8, since commenting it out got rid of the error

#

god this makes me feel silly sometimes. I forgot my quotations

bright lagoon
#

another question for unit capture say you're using a multi crew vehicle like the vanilla arma 3 merkava with unit capture can you unit capture the merkava say driving slow down a road whilst also unit capturing somehow the gunner turning the barrel towards a certain point and firing?

past wagon
#

the following code in initPlayerLocal is only working for the server host, not connected players:

cutRsc ["RscBRHUD", "PLAIN"];
[] spawn {
    while { alive player } do {
      (uiNamespace getVariable ["BRHUD", displayNull]) displayCtrl 1000 ctrlSetText ("Player Health: " + str round ((1 - damage player) * 100) + "%");
      (uiNamespace getVariable ["BRHUD", displayNull]) displayCtrl 1001 ctrlSetText ("Players Remaining: " + str ({ alive _x } count allPlayers));
      sleep 1;
    };
};
#

the GUI is only opening for the server host

#

and this code that is executed on the server is also only working for the server host:

[_zoneMarker] spawn {
    params ["_zoneMarker"];
    PP_wetD = ppEffectCreate ["WetDistortion", 300];
    PP_wetD ppEffectAdjust [3, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.05, 0.01, 0.05, 0.01, 0.1, 0.1, 0.2, 0.2];
    PP_wetD ppEffectCommit 0;
    PP_film = ppEffectCreate ["FilmGrain", 2000];
    PP_film ppEffectAdjust [0.5, 1, 1.5, 0.5, 0.5, true];
    PP_film ppEffectCommit 0;
    while { true } do {
        sleep 1;
        {
            [_zoneMarker, _x] spawn {
                params ["_zoneMarker", "_player"];
                if !(_player inArea _zoneMarker) then {
                    _zoneDamage = if (typeOf vehicle _player in ["B_MRAP_01_F", "O_MRAP_02_F"]) then {
                        3 / (getMarkerSize _zoneMarker select 0)
                    } else {
                        5 / (getMarkerSize _zoneMarker select 0)
                    };
                    [PP_wetD, true] remoteExec ["ppEffectEnable", _player];
                    [PP_film, true] remoteExec ["ppEffectEnable", _player];
                    sleep 1;
                    if !(_player inArea _zoneMarker) then {
                        _player setDamage (damage _player + _zoneDamage);
                    };
                } else {
                    [PP_wetD, false] remoteExec ["ppEffectEnable", _player];
                    [PP_film, false] remoteExec ["ppEffectEnable", _player];
                };
            };
        } forEach allPlayers;
    };
};
#

what am I doing wrong? everything works great when I test it in multiplayer by myself, but nothing works for players other than the host. is there something I'm not considering? I don't see anything wrong with this code

little raptor
little raptor
little raptor
#

just use true

past wagon
#

ok

past wagon
little raptor
#

you need to remoteExec the whole code

past wagon
#

ok...

open fractal
#

shouldn't it just work in initPlayerLocal? So long as while {true} is used

past wagon
#
[_zoneMarker, {
    [_this select 0] spawn {
        params ["_zoneMarker"];
        PP_wetD = ppEffectCreate ["WetDistortion", 300];
        PP_wetD ppEffectAdjust [3, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.05, 0.01, 0.05, 0.01, 0.1, 0.1, 0.2, 0.2];
        PP_wetD ppEffectCommit 0;
        PP_film = ppEffectCreate ["FilmGrain", 2000];
        PP_film ppEffectAdjust [0.5, 1, 1.5, 0.5, 0.5, true];
        PP_film ppEffectCommit 0;
        while { true } do {
            sleep 1;
            {
                [_zoneMarker, _x] spawn {
                    params ["_zoneMarker", "_player"];
                    if !(_player inArea _zoneMarker) then {
                        _zoneDamage = if (typeOf vehicle _player in ["B_MRAP_01_F", "O_MRAP_02_F"]) then {
                            3 / (getMarkerSize _zoneMarker select 0)
                        } else {
                            5 / (getMarkerSize _zoneMarker select 0)
                        };
                        PP_wetD ppEffectEnable true;
                        PP_film ppEffectEnable true;
                        sleep 1;
                        if !(_player inArea _zoneMarker) then {
                            _player setDamage (damage _player + _zoneDamage);
                        };
                    } else {
                        PP_wetD ppEffectEnable false;
                        PP_film ppEffectEnable false;
                    };
                };
            } forEach allPlayers;
        };
    };
}] remoteExec ["call"];
``` Is this better @little raptor ?