#arma3_scripting

1 messages · Page 527 of 1

cosmic lichen
#

Downloading VSCode now. That thing drove me nuts until 4.30 am...

tough abyss
#

FFS 😠

cosmic lichen
#

@still forum Which extension do you use for sqf?

still forum
#

SQFLint from SkaceKachna
and SQF Language from Armitxes

cosmic lichen
#

Ah I see, didn't know I can have both

tough abyss
#

how you do it in notepad++?

still forum
#

I use some SQF highlighting thing in N++. But for anything where I'm writing more than just a few quick lines I use VSC now

queen cargo
#

hint the SQF-VM part is the easy one

still forum
#

what?

#

Oh how to do linting in n++?

queen cargo
#

yes

#

it is not even that complicated

#

just that one needs to dig through the documentation of Notepad++ plugin API once ...

#

will look into it more indepth at lunchbreak

#

maybe some SQF support for notepad++ will come out in the end 🤷

winter rose
#

so SQF-VM could be a N++ plugin? ^^

queen cargo
#

SQF-VM could be a plugin for anything

#

one just has to implement that stuff

winter rose
#

press F5 → error on line 33, provided Number, expected String

queen cargo
#

billw already did a nice job with his task stuff

still forum
#

Then we have another proprietary implementation instead of going with a standard language-server approach that can easily be embedded into many IDE's instead of just one specific one.
Which btw is currently also being worked on

queen cargo
#

well ... it is more a "quickNDirty" method then anything else 😄

queen cargo
#

abusing spell checking for linting 😄

astral dawn
#

@daring pawn you can check behaviour of unit. If anyone in a group knows about an enemy unit, the whole group switches behaviour to "COMBAT"

fallow coyote
#

Does anybody here know how to disable the randomization on 3CB Faction Vehicles? I tried it with the module but the Lada 1500 still changes the paintjob.

queen cargo
#

could one please quickly check what the outcome of 1 != "" is?

#

talking about: wether or not there is an error message here

#

or if it just returns false

ruby breach
#

Error Generic error in expression Returns nothing

queen cargo
#

👍

hollow thistle
#

Comparison of different types via ==/!= should always error out afaik.

winter rose
#

@fallow coyote did you try disabling BIS randomisation?

_vehicle setVariable ["BIS_fnc_initVehicle_customization", false, true];```
fallow coyote
#

Yea, didn't work

still forum
#

@hollow thistle he wanted to know if they are implemented as seperate commands, or built into one command.
But they are seperate

queen cargo
#

yup
because somebody (probably me) added ANY != ANY in SQF-VM 😄

#
  • the other variants
hollow thistle
#

what do you mean? Like OBJECT == OBJECT and NUMBER == NUMBER are different commands?

winter rose
#

bool == bool doesn't exist in SQF

hollow thistle
#

whatever, you know what I meant. (edited)

still forum
#

yes

#

they are different commands

#

unlike isEqualTo
which is just one ANY isEqualTo ANY command

astral tendon
digital hollow
#

What did you try?

astral tendon
#

Place a dead unit on a bodybag

#

Used [player, cursorTarget] call ace_medical_treatment_fnc_actionPlaceInBodyBag looking at a dead unit

#

returns nothing

digital hollow
#

Try cursorObject

astral tendon
#

and isNil "ace_medical_treatment_fnc_actionPlaceInBodyBag" is returning true, and already tried cursorObject

still forum
#

That function is new medical system

#

not released yet

astral tendon
#

Rip, any other way or I do have to make the body bag manualy?

digital hollow
#

Just take the code from the function and run it =D

astral tendon
#

there is some commands that does not work like TRACE_2 and QGVAR that I guess is some deep scripting stuff that I dont know.

digital hollow
#

QGVAR(varname) is just `"ace_addonname_varname"'

still forum
#

"Just take the code from the function and run it =D" doesn't work

#

Look up how it was called in the old ace version

digital hollow
#

Sure it won't be fully integrated, but just to replace a body with a bodybag L33-L47 will get it done.

hazy trail
#

Does anyone here know how to kill a sound being generated by a vehicle after simulation has been disabled on the vehicle? I've looked for #soundonvehicle, mission objects, near objects, you name it objects and I can't find anything to kill off.

craggy adder
#

Like the engine running sound?

#

You could just set fuel to 0 to kill the engine maybe?

winter rose
#

(or turn the engine off by script)

hazy trail
#

It's a little more challenging than that. It's the sound of water lapping the side of a boat.

#

If you're near a boat in the water and you turn simulation off on the boat, you'll be forever stuck with the sound of the boat in the water.

winter rose
#

aaah, yes that infamous water sound

#

that happens even when the boat is on land 😄

craggy adder
#

lol

young current
#

any particular reason to disable simulation on the boat?

#

are there so many of them that it matters?

hazy trail
#

Let's assume that there are thousands of them so that we don't have to second guess the motivation behind the technical request.

young current
#

just making sure its a needed feature, not just over optimizing

#

off the top of my head I cant recall anything to stop a sound playing though

#

if its some sort of simulation type tied sound or envrionmental sound theres not script access to those

tough abyss
#

Just put down a few boats on dev , no splashing sound

daring pawn
#
        waitUntil {{{alive _x}count units _x == 0}forEach _activeGroups};

I have 4 Groups Bravo 1-1, Bravo 1-2, Bravo 1-3, Bravo 1-4 that get created by a script and put into an array _activeGroups.

If Bravo 1-4 is all dead, the waitUntil fires as true pre-maturely but if Bravo 1-1,1-2,1-3 all die nothing happens until 1-4 is dead.

Does anyone know why this is?

robust hollow
#

because foreach returns the result of the last iteration

#

something like this might work 🤷

waitUntil {
    ({alive _x}count units _x == 0} count _activeGroups) == count _activeGroups
};
daring pawn
#

Ah no shit, is there an equally condensed way I can do that to make sure all the groups have nobody alive in it?

#

beat me to it

#

I'll give it a spin

modern sand
#

Is there anyway to view/modify the players sound settings by using profileNameSpace, seeming settings are saved to the profile? I'm trying to detect if the players music volume is muted, if so then unmute it. I've tried using musicVolume, however that only detects the musics faded value from fadeMusic.

daring pawn
robust hollow
#

oops.

waitUntil {
    ({{alive _x}count units _x == 0} count _activeGroups) == count _activeGroups
};
daring pawn
#

Yea works a treat. Thanks, didn't know that behaviour for forEach

#

cheers mate

keen bough
#

I googled now a while and since my eyesight isnt the best, fiddling around with the objects to put into boxes isnt too viable to create my lists.

is there a way i can extract from the config files what i need? But the informations to such things are extremely cluttered. I wanted to get magazines with or without magazine sizes. Scopes, Laers, supressors and so on.

Is there a source that shows examples of all that except just weapons, or just vehicles? Because that way i would get the mod stuff too. The config lists on the wiki are only for arma

spice axle
#

is there a command to get always a positive value? Like i give it -10 and get 10 back but then i give it 5 it gives 5 back?

astral dawn
spice axle
#

Thanks. I know it in match science. But the right translation was missing. My bad.

keen bough
#

would this be correct?

if(!((_name in _list1) && (_name in _list2))) then {awesome};
#

Found out (run arma to test ^^ is there a offline tool?) - Correct would be:

if(!(_testname in _list1) && !(_testname in _list2) then { was not found};

For that i can check through all my lists if a item was not found. Because so i can go around an error if i have something not in my lists and the script runs through fine anyways but tells me that an item was not found instead of throwing an error and discontinuing to work

spice axle
#

you could all list to one firstly and then test for it. Just in case you wanna have more then 3 list

keen bough
#

Already did. I put all my lists into one array and checked that ^^

#

forgot that i can do that.

glass frigate
#

I want to use this function:

hint _bluGrp1Hint;
bluGrp1 = [newBlu1Pos, WEST, ["B_Patrol_Soldier_AR_F", "B_Patrol_Soldier_MG_F", "B_Patrol_HeavyGunner_F"]] call BIS_fnc_spawnGroup;
bluWP1 = bluGrp1 addWaypoint [CenterMrkr, 0];
bluWP1 setWaypointType "SAD"; 
};```
but this doesn't work:
```waitUntil {{ alive _x } count units bluGrp1 == 0};
Respawn_BluGrp1;```
modern sand
#

@glass frigate ```SQF
Respawn_bluGrp1 = {
hint _bluGrp1Hint;
bluGrp1 = [newBlu1Pos, WEST, ["B_Patrol_Soldier_AR_F", "B_Patrol_Soldier_MG_F", "B_Patrol_HeavyGunner_F"]] call BIS_fnc_spawnGroup;
bluWP1 = bluGrp1 addWaypoint [CenterMrkr, 0];
bluWP1 setWaypointType "SAD";
};

[] spawn {
waitUntil {{ alive _x } count units bluGrp1 == 0};
[] call Respawn_BluGrp1;
};```

glass frigate
#

@modern sand It didn't work. it never fires off the [] call Respawn_BluGrp1;

modern sand
#

Well then it's to do with your waitUntil condition

velvet merlin
#

how to make use a respawn areas work regardless of the terrain layout (ie possible water below)? like if you want to dynamically generate offmap respawn locations
would you move respawned units to [-10000,-10000,10] and apply local enableSimulation false on all network entities, or different? also is this safe with JIP and players disconnecting?

tough abyss
#

@modern sand what about undefined _bluGrp1Hint, you don’t think this has anything to do with function not working?

#

Why do you need to move units off map, you can hold units from spawning by adjusting respawn time on the fly @velvet merlin

glass frigate
#

question about "waitUntil". If I have multiple "waituntil" does the first one hinder the execution of the ones below? or do they run parallel?

waitUntil {{ alive _x } count units bluGrp1 == 0};
hint _bluGrp1Hint;
bluGrp1 = [newBlu1Pos, WEST, ["B_Patrol_Soldier_AR_F", "B_Patrol_Soldier_MG_F", "B_Patrol_HeavyGunner_F"]] call BIS_fnc_spawnGroup;

waitUntil {{ alive _x } count units bluGrp2 == 0};
hint _bluGrp2Hint;
bluGrp2 = [newBlu2Pos, WEST, ["B_recon_F", "B_Recon_Sharpshooter_F", "B_recon_M_F"]] call BIS_fnc_spawnGroup;

waitUntil {{ alive _x } count units opGrp1 == 0};
hint _opGrp1Hint;
opGrp1 = [newRed1Pos, EAST, ["O_soldierU_F", "O_SoldierU_GL_F", "O_Urban_Sharpshooter_F"]] call BIS_fnc_spawnGroup;

waitUntil {{ alive _x } count units opGrp2 == 0};
hint _opGrp2Hint;
opGrp2 = [newRed2Pos, EAST, ["O_recon_M_F", "O_recon_F", "O_recon_medic_F"]] call BIS_fnc_spawnGroup;```
mortal yoke
#

script stops at every one of them

#

so hinders execution of the following until its Condition is true

#

you would be better off with a loop to check the conditions with a 1-5s sleep depending on your need for accuracy

glass frigate
#

@mortal yoke Thanks I will try that.👍

mortal yoke
#

(to clarify : one loop, not multiple 😄 )

you could also use CBA waituntilandexecute if you use CBA, then formatting would be very close to waituntil but wouldnt hinder following expressions

keen bough
#

alright, shop script is now completely update proof if anyone, arma or 3rd parties add ne equipment in. Sweet sweet.

velvet merlin
#

@tough abyss sorry missed your response. players can be revived - i dont like to hack the old respawn mechanic

still forum
#

👋

velvet merlin
#

any suggestions how to handle offmap playable units to not fall into water, and not be possible to interact with while waiting for getting into the game?

austere hawk
#

whats 'offmap' in that context?

velvet merlin
#

[-10000,-10000,10]

#

to be out of the way

languid tundra
#

Hmm, maybe make them invisible and disable simulation during the init phase.

#

The unit's init line is probably the safest cause, considering the init*.sqf's are in scheduled env.

digital hollow
#

I'm trying to make Vcom and acex HC ignore all uavs. Is unitIsUAV the only way to check for them?

austere hawk
#

put them on a platform 10km in the sky

velvet merlin
#

good idea. is there anything from to use or make a custom one?

winter rose
#

enableSimulation false, no? if they are not players but only playable

#

Else you have concrete blocks and ramps that could do (or a carrier 😄)

austere hawk
#

well... make a 72x72 box in OB with roadway and export...

#

30sec job

#

apply transparency so you cant see it so easily in the distance

velvet merlin
#

well the game mode should be mod free

#

for IFA3 we could add it, but otherwise its bad

cursive whale
#

lord, i remember having to try and conceal a platoon of playable units on the little islands off utes. thought there must surely be a better way (and that you'd have found it for BK).

#

as crew in boats?

winter rose
#

@velvet merlin you may want to go for VR blocks

velvet merlin
#

yeah one per person probably works

#

will do some experiments and report back tomorrow/coming days

winter rose
#

you can also add invisible walls for them not to fall off… or not, depending on how cruel you want to be 😄

ebon ridge
#

Is there any way to non intrusively handle the result of a function even if it is nothing? i.e.

_fn = { private _a = 0 };
private _val = call _fn;
astral dawn
#

I guess not, I just make sure that I return nil in some of my functions that must return a value to comply with framework

ebon ridge
#

yeah I noticed that in a few places :/

still forum
#

Yes there was some way

#

CBA has it soooomewhere

ebon ridge
#

that will be very helpful!

still forum
#

can't find it :U

ebon ridge
#

oh nice thanks!

astral dawn
#

lol

still forum
#

Might aswell just fix that bug.. 🤔

ebon ridge
#

oh wait is the isNil that wraps the call a critical part of that?

#

it would make the entire block an atomic operation wouldn't it?

astral dawn
#

yes but this function calls code unscheduled 🤔

#

actually I don't understand how it works

#

I guess it passed arguments through _this

#

then what is _x ...

still forum
#

no

#

the apply is the key

ebon ridge
#

good okay thanks

astral dawn
#

apply is array apply code, and as the array it gets [_x], where is [_x] define?

ebon ridge
#

i still don't quite understand it in that context though, where is _x coming from?

still forum
#

nowhere

#

doesn't need to come from anywhere

#

just need to have one value in the array

#

whether it's nil doesn't matter

astral dawn
#

I guess we can just do [nil] apply {} then

still forum
#

[1] would be faster probably

astral dawn
#

I mean it can be potentially getting _x from some upper scope

ebon ridge
#

hmm okay i was going to do [_args] apply { _x call fn }

#

I guess it isn't necessary though

#

and misleading as to the real spooky intent

tough abyss
#

if you run that in scheduled gonna get undefined _x

#

not sure why he used _x

ebon ridge
#

private _result = ([0] apply { _this call _fn}) select 0; is working for me

tough abyss
#

you can use param instead of select to give it default value if you want

ebon ridge
#

thanks but nil works fine for me

still forum
#

no need to pass _this manually

ebon ridge
#

oh true thanks

#

although actually, unless there is a downside i think it is probably clearer in the intent, i.e. this is a pass through function

still forum
#

very slight performance maybe

high marsh
#

is checkVisibility broken somehow? I cannot for the life of me to get it to return anything other than 1

#
while{alive player} do {
    _nearMen = (player nearEntities["Man",25]) - [player];
    {
        _canSee = [objNull,"VIEW"] checkVisibility[eyePos _x,eyePos player];
        if(_canSee > 0) then {
            hintSilent parseText format["I've been seen: <br/> %1 <br/> %2",_canSee,_nearMen];
            sleep 1;
        };
    } forEach _nearMen;
};
#

Reserve any comment about quality, I just don't see why this doesn't work

#

even when there is a giant wall between the two

tough abyss
#

I know that checkVisibility does work at longer ranges because I use identical code for ray checks in CF_BAI/detect routines and have successfully tested all parts of that algorithm. But I don't bother checking below the AIs default instant vision point (200-325m dependent on skill) since there is no point.

One thing I did notice was in checking to see how the routine interacted with vehicles I found crew of everything could see targets with this check, which is obviously wrong since many are inside a vehicle with no vision out. So there is definitely some funky behaviour going on that I have seen and given what we have seen the AI do in close quarters I suspect they just see through walls nowadays and this function being broken in this way would explain why.

high marsh
#

perhaps you need to be changing lod filter for vehicles. I wonder if the view geometry is wacked

#

anyways, yeah I don't see any work around for this

#

too low level

tough abyss
#

Another to waste time putting on the tracker? Who am I kidding it has probably been on there for years already.

high marsh
#

Actually, this one might not be

tough abyss
#

@tough abyss if you were tracing from vehicle out then it is expected as the surfaces of vehicle polygons face outward. Try maybe trace from outside to inside of vehicle

chilly scarab
#

TheObject = "test_EmptyObjectForFireBig" createVehicle position this;
TheObject attachTo[this,[0,1.5,-1]];

this setHit ["hithull", 0.95];
this setHit ["hitengine1", 1];
this setHit ["hitengine2", 1];
this setHit ["hitvrotor", 1];
this setHit ["hithrotor", 1];
this setHit ["hithrotor", 1];
this setHit ["hitfuel", 0.95];

this setHit ["hitglass1", 0.95];
this setHit ["hitglass2", 0.95];
this setHit ["hitglass3", 0.95];
this setHit ["hitglass4", 0.95];
this setHit ["hitglass5", 0.95];
this setHit ["hitglass6", 0.95];
this setHit ["hitglass7", 0.95];
this setHit ["hitglass8", 0.95];
this setHit ["hitglass9", 0.95];
this setHit ["hitglass10", 0.95];
this setHit ["hitglass11", 0.95];
this setHit ["hitglass12", 0.95];
this setHit ["hitglass13", 0.95];
this setHit ["hitglass14", 0.95];

this allowDamage false;
sleep 20;
this allowDamage true;
#

Dosen't give the setHits, this is vehicle init, don't judge lol, first script I've ever tried to make.

tough abyss
#

you cant sleep in init

chilly scarab
#

Seems to work?

tough abyss
#

seems

chilly scarab
#

I can crash the heli right down and it won't take damage

#

but if I do it later it explodes

#

soo

tough abyss
#

magic probably. you cannot sleep in init

chilly scarab
#

ok whatever

chilly scarab
#

don't need help anymore, fixed it.

velvet merlin
#

@winter rose are the (invisible) walls/surfaces to use?

winter rose
#

walls yes, surfaces none that I know of

#

@velvet merlin Land_InvisibleBarrier_F

velvet merlin
#

@winter rose tx

vernal mural
#

How am I supposed to understand this condition in ACE ?
{1 == getNumber (configFile >> "CfgVehicles" >> (backpack unit) >> QGVAR(hasWirecutter))}
It looks like it is true when the backpack has ace_logistics_wirecutter_hasWirecutter = 1 in its config. Am I right ? And is there a specific reason to use 1 == blahblah instead of the more common condition shape of blahblah == 1 ? Is it strictly the same thing ?

still forum
#

order doesn't matter

#

One guy is specifically doing that. while every other dev does it the other way around

#

but we have no style rule about that so everyone do as he pleases ¯_(ツ)_/¯

tough abyss
#

{((ɹǝʇʇnɔǝɹᴉMsɐɥ)ɹ∀ΛפQ << (ʇᴉun ʞɔɐdʞɔɐq) << ,,sǝlɔᴉɥǝΛƃɟƆ,, << ǝlᴉℲƃᴉɟuoɔ) ɹǝqɯnNʇǝƃ == Ɩ}
Lucky you dont have upside down guy

cosmic lichen
#

Are map markers supposed to slow down the game even if they have been removed?

#

I had 3k markers placed by script and deleted them. The FPS didn't go back to normal.

astral dawn
#

They should free the resources (in theory)

#

Did you do anything in between or did you just create and remove them instantly?

cosmic lichen
#

I might know what happened. Gonna test that and see if the fps go up again.

tough abyss
#

So what happened @cosmic lichen ?

cosmic lichen
#

Can't say, I am not at home currently 😉

#

But I think it was not caused by the markers.

tough abyss
#

@tough abyss you'd be surprised how much drawXXXX stuff map can take

tough abyss
#

its a map, the game doesnt need to render persons view so there is more power to map drawing

#

I cant say for draw icon or ellipse but drawTriangle can easily draw thousands of them

#

not commands, triangles

#

the call to command is costly not the call to draw

dusky pier
#

how it works? ```
Added: New scripting commands for simple graphs: getGraphValues, decayGraphValues, ctrlSetPositionX, ctrlSetPositionY, ctrlSetPositionW, ctrlSetPositionH, bezierInterpolation

#

from lastest update

still forum
#

The wiki doesn't know, so I assume noone here knows either 😄

dusky pier
#

😄

winter rose
#

in-game autocomplete or F1 press may help you in the meantime

young current
#

uuh beszierInterpolations sounds interesting

astral dawn
#

I wonder why they need plotting functions at all

#

If they didnt need them before

oblique spoke
#

maybe they are plotting something?

astral dawn
#

Well it's a wild assumption!

oblique spoke
#

😆

muted tapir
#

I love the new customWaypointPosition scripting command. It's amazing!

tough abyss
#

CtrlSetPositionX is ctrlSetPosition for single value

#

All those commands were on dev for ages now, you people act like you have seen Santa Claus

high marsh
#

I have his phone number if that counts for anything :)

tough abyss
#

So your parents never told you?

high marsh
#

Told me what??

tough abyss
#

He is not real?

high marsh
#

:D

#

I don't know what you're talking about

umbral oyster
#

Has anyone tried to use calculatePath after the update? For some reason, the game doesn't even know about this command

tough abyss
#

Because it is not in stable?

umbral oyster
still forum
#

Yeah... So what?

tough abyss
#

What am I looking at?

umbral oyster
#

fuck, really on 1.93 lol

still forum
#

You are looking at a changelog that says nothing about calculatePath

umbral oyster
#

ye ye, my mistake

still forum
#

1.92 has been ready for about a month already. The new commands came.. 2 weeks ago?

tough abyss
#

Some were there for quite awhile

wispy cave
#

I'm updating some arsenal restrictions in a mission, anybody happen to know an easy way to get the classnames of all magazines one could use in, for example, a regular MX?

high marsh
#

magazine wells!

ornate marsh
#

Got this problem with helis. If I spawn in a basic Heli and give it move waypoints in the editor it is fine, but as soon as I add scripts to it and give it a Variable Name it only flies straight up and ignores any order. Tried flyInHeight but to no avail

still forum
#

@wispy cave do you have CBA?

wispy cave
#

Yes

still forum
#

CBA_fnc_compatibleMagazines then

wispy cave
#

tnx

dusky drift
#

exitWith inside of an if statement that is inside some code (squiggly brackets) returns from the code not the if statement right?

astral dawn
#

should return from if statement

#

if you need to exit upper scopes, use breakOut or breakTo commands

dusky drift
#

alright

#

what happens if I use it inside an else statement

still forum
#

it will exit that else statement

dusky drift
#

ah

#

I have another question sorry is there a way to test if the classname for something is a mortar vehicle or static mortar that would hopefully work with mods?

spice axle
#

getNumber (_vehicleCfg >> "artilleryScanner") should work

craggy adder
#

Can someone point me in the right direction for replacing the default 'bullet hole' texture that is created when a round strikes the ground?

#

Specifically in the VR map, if that matters. Plz @ me if you have any ideas. Thanks!

cold pebble
#

Hmmm, is switchMove executed globally, I see it changes on the wiki on 20 Oct 18 but I'm not sure whether I trust it :/

still forum
#

@craggy adder might be hardcoded in the surface material, in which case you can't reaaaally change it besides fully replacing some Arma pbo's

craggy adder
#

Aw. Thanks anyway

#

Making a little paintball game and I can easily create little dots on the objects I place, just can't do the ground.

#

Question for optimization - lets say I end up with 5,000 'paintball splats' on the objects. I'm currently just using createVehicle with the yellow sphere class. If I used a custom texture file for more realistic splats would that be crazy hard on the rendering engine?

#

I'm guessing no from what I know about instanced rendering

still forum
#

simple object instead of createVehicle

#

if it's a simple model with a texture with a simple shader, it supports instancing which makes it really cheap
Not sure which shaders support instancing though. Afaik Super shader doesn't

craggy adder
#

That's something I'm unfamiliar with. How do I know which shader a particular model/texture is using?

still forum
#

it's defined in the rvmat of the model..

#

Which.. Is not very helpful I guess

craggy adder
#

I would 100% find a premade model to use

still forum
#

I'd say make your own model. Just a simple two triangle plane

craggy adder
#

if possible

still forum
#

ACE has a tagging system. Spray painting onto things. I think they might use a vanilla model

#

there are some plane models which are just a 2x2m quad

craggy adder
#

Cool. I'll find something

#

thanks

dusky drift
#

I tried getNumber (_vehicleCfg >> "artilleryScanner") == 1 with _vehicleCfg replaced with my classname but it gave me a generic script error

#

nevermind I fixed it

#

I'm trying to get it to only show some blufor units, the sandbag barriers, some modules and hide everything else but it shows everything
nvm I fixed it

ebon ridge
#

sqf functions don't do any kind of closure right? i.e. capturing environment where they are defined. They only inherit the environment where they are executed?

#

e.g.:

private _v = 5;
private _fn = { diag_log _v; }

If I then pass _fn off somewhere else, maybe into a spawned script or something it will have an error because _v isn't defined? Or it will capture _v from where it is defined here?

winter rose
#

error if a _v var doesn't exist where you execute the code

ebon ridge
#

okay thanks

#

and i guess it could be a different _v just same name

winter rose
#

you should use "private" keyword to ensure _v is not used from outside the script

ebon ridge
#

that isn't the issue, I'm just trying to work out if i can do something like closures

tough abyss
#

{} is not evaluated unless you call it spawn it do it then it else it while it or whatever. So you can toss it around like a hot potato, it wont capture shit @ebon ridge

tough abyss
#

scripted. It is the same as onPauseScript, only it is unscheduled and can be stacked

#

scripted

#

[missionNamespace, "onGameInterrupt", {player setdamage 1}] call BIS_fnc_addScriptedEventHandler;

#

press Esc after you added

viscid nimbus
#

Hi all, just looking for a little help. Is there anyway to pass code when a addAction is used? Example is:
When a player uses a addAction, it executes the script (duh) But also runs something along the lines of -
removeAllActions this;

I hope that makes sense?

astral dawn
#

{ 123 call alsoCallThisPlz; 456 call theMainThingIWantedToCall;}

#

Something like this?

#

In the script field of addAction

#

Or you want to attach your code to addAction added by some other addon/script?

viscid nimbus
#

My main problem is, the addAction is attached to a laptop. There will be multiple laptops. All of them executing the same script. The problem is that I want to only be able to hit each one once. The amount of laptops placed is randomly generated.

So I cant just set a variable to each addaction, because they all execute the same script so removing one specifically seems impossible.

I am not great at explaining over text, hopefully what I wrote made sense.

astral dawn
#

just store the array with all notebooks in some global variable

#

then iterate through them and remove all actions from each of them

#

oh wait, I read you wrong

#

well addAction has a parameter 'arguments' (3rd one), you just pass the laptop object to the action

#

then retrieve it inside the action handler

tough abyss
#

The object to which action is attached is already passed as argument to the action code, no need to pass it inside custom argument as well

astral dawn
#

Oh yeah, you are right, my bad :D
Carefully reading the addAction wiki page answers all his questions actually

modern sand
#

How can I force the player (while in first person) to look in a certain direction inside of a vehicle?

winter rose
#

No can do, but you could either disable the mouse with a UI trick, or create a camera and set it in lieu of his head

modern sand
#

Mhmmm, thanks for the reply. Seeming I'm trying to create a cutscene and once the cutscene finishes the player is put inside of a vehicle and is set into first person. However, each time the player is looking in a random direction inside of the vehicle (like at the roof of the vehicle). But I want them to be looking straight forward

tough abyss
#

How do you put player inside the vehicle?

modern sand
#
player moveInCargo _vehicle;
tough abyss
#

What vehicle is it?

modern sand
#

The normal civilian Caesar BTT, not the racing one.*

tough abyss
#

Works fine for me

#

Always facing the same dir

modern sand
#

Even if you start off in third person looking over your shoulder with free look/

#

?*

tough abyss
#

Yes

modern sand
#

Mhmmm

#

Strange

tough abyss
#

It resets look when in

modern sand
#

You're changing the camera to internal view before moving into the vehicle correct?

#

or after?

tough abyss
#

After moveincargo

modern sand
#

Strange

#

seeming I'm doing it the same way

#

Actually I've tried it both ways

tough abyss
#

Even before doesn’t make a difference

modern sand
#

Yeah

#

Sometimes it works and sets the players view direction straight forward, majority of the time it's random.

tough abyss
#

Always look at the seat in front

lavish ocean
queen cargo
#

Just had one of those "WTF did i do" moments
#justprogrammerthings

hazy trail
#

Hey, @pure raptordmen, you've asserted a couple times on the forums that event handlers are recompiled each time they're fired. Can you confirm that? It makes zero sense to me, but if it's true, then I need to rework some code.

#

Hmm. Trying to flag down @still forum again.

still forum
#

yeah that's true

#

they are stored as strings internally, not code

dusky drift
#

if I setSkill a truck with people in it will it set the skill of everyone inside?

hazy trail
#

@still forum , does that apply anywhere else that you know of?

winter rose
#

@dusky drift unsure, but you could use forEach and crew commands

#

Else give it a try in Eden

hazy trail
#

And to be sure I'm clear, if I add a big AnimChanged handler, then it's going to be reprocessed every time the handler fires? Do you have any idea why Bohemia would do it that way? I can't think of any reason to have a late-bound handler like that.

still forum
#

Leftover from SQS where compiled code didn't exist

hazy trail
#

Okay. Thanks a bunch. I'm doing performance work on my mission and this could well be a big bottleneck.

queen cargo
#

just do it like this:
addEventHandler [..., "_this call actual_handler_fnc"]

#

and you will be fine

wispy cave
#

Anybody happen to know of any script (or mod but preferably a script) that spawns smoke that could pass for a gas (as in mustard gas for example) attack?

drowsy axle
#

Where can I find, in ACE3 the function for moving FAK's to medical supplies?

#

I wish to update this, for the DLC, as the new DLC doesn't have the vanilla FAK's

spice axle
#

Any idea how i can get the height of a object? Like a table the surface height or a way better the direct position of a line intersect between the player eyes and a relative position with player getRelPos?

thin pond
#

I know this might have been already discussed but i can't Seem to find an answer to this.... Is there a way to Setup a "Garage" where you can customize your current vehicle Like a Zeus can do with ares/Achilles ? Im not that good at coding/Scripting to do it on my own so is there any Mod/script that has this function and If Not is there someone that has an idea on how to achive this ?

digital hollow
wispy cave
#

I want to spawn a bunch of smoke grenades a bit above the ground and have them fan out in a similar way to how the cluster bombs deploy their little bomblets. For now I've got this:

onMapSingleClick {
    private _newPos = [_pos # 0 - 40, _pos # 1, 100];
    
    for "_i" from 1 to 15 do {
        private _smoke = "SmokeShellGreen" createVehicle _newPos;
        
        _vel = [5 + random 10, -5 + random 10, 0];
        _smoke setVelocity _vel;
        
        [_smoke] spawn {
            params["_smoke"];
            waitUntil {((getPosATL _smoke) select 2) < 0.5};
            _smoke setVelocity [0,0,0];
        };
    };
    
    [_newPos] spawn {
        params ["_newPos"];
        sleep 1;
        "SmallSecondary" createVehicle _newPos;
    };
};```
But now most smokes land pretty close to each other with one or 2 a bit away
#

Anyone know how to fix that?

digital hollow
#

log the velocities and see if they are what you're expecting

thin pond
#

@digital hollow this doesnt realy help as there are not many exampels in how to use it and make it MP/Dedicated compatible. The few Scripts that are out there let you Spawn any vehicle you want everywhere you want... All I'm looking for is a way to customize a already spawned vehicle... I already looked at the code thats used in the Ares/Achilles mod and thats way Out of my League. I was hoping there ist a Mod/Script that already makes it possible to create a "Paint&spray" Style Garage for MP, but thanks anyways

hazy trail
#

I created a script that takes 40ms to compile, but which has an immediate exitWith at the beginning. So it has a large compile time, but a negligible run time. Installing that as a mission "EachFrame" handler added roughly 1ms to each frame. Installing a little snippet that calls that huge script doesn't add anything observable. So while a big handler can slow things down, ARMA doesn't appear to be performing a straight compile of the handler each time it's called. At least, not for "EachFrame".

It looks to me like ARMA stores the compiled form. It'll report errors each time the script is run, which may well be the code stored for a failed compilation (run the script, report the error). Repeatedly compiling an unchanging script just makes no sense

#

I'll add that the real win to making an event handler call a named function is that the named function can be replaced at runtime for testing and debugging purposes. I've found that to be invaluable through the years.

queen cargo
#

The short answer is that it depends @hazy trail
safest bet is that you always just use a global variable and eat the neglectable overhead

hazy trail
#

What does it depend on?

queen cargo
#

on the command

hazy trail
#

Do you know which commands compile every call and which do not? Or are you assuming that some do and some do not?

queen cargo
#

i know for sure that it depends on the command
though ... cannot really remember wich ones compiled and wich ones did not
iirc, it even depended on the event sometimes

hazy trail
#

Until you can provide me with an example of an event that demonstrably recompiles each invocation, I'm going to continue to assume that they don't recompile - because only the worst developer on the face of the planet repeats a heavy calculation needlessly.

astral dawn
#

Oneachframe does and dedmen has demonstrated it very well

#

Search for this issue on the issue tracker

queen cargo
#

do what you have to
but use [] call XYZ instead of putting your code directly into there
and avoid the hazzle of being greeted with useless compilation spam

hazy trail
#

I'll take a look in the issue tracker because that's the very event that I was testing with.

astral dawn
#

There was cache for compiled scripts before, so the time of recompilation was reduced, at the cost of a perpetual memory leak in scripts that used compile format with constantly changing data

#

But this cache is gone for a few months already

hazy trail
#

Well something changed in the last two years because I just ran Dedmen's sample script from his report. My base frame time was 12.5ms. Put in the 1000 'fast' handlers and I get 14.9ms. Put in the 1000 'slow' handlers and I get 17.2ms.

still forum
#

"ARMA doesn't appear to be performing a straight compile of the handler each time it's called" it does
"It looks to me like ARMA stores the compiled form" nope. They did that for a while but they removed it because it caused a memory leak.
"I created a script that takes 40ms to compile" measured how?
" Repeatedly compiling an unchanging script just makes no sense" correct

#

" I'm going to continue to assume that they don't recompile" okey then feel free to just not accept known facts

hazy trail
#

The 40ms compile was by using the debug console. compile 'lots of text' with a performance run.

#

Hey, don't get your nose out of joint. I'm testing and things are matching up with those established facts.

#

(are not matching up)

still forum
#

1.92 or 1.90? Perf/prof branch?

hazy trail
#

1.92 released

still forum
#

There was nothing in the changelogs about any improvements

hazy trail
#

I certainly didn't see anything.

#

I'm sure you've been accepting this as "the way of things" for the last two years. When was the last time this scenario was tested?

#

It may have been changed a year ago and nobody said anything about it. Perhaps the change was even a side effect of other work.

queen cargo
#

hint hint
it was not

still forum
#

"I'm sure you've been accepting this as "the way of things" for the last two years."
no. Because BI fixed it

#

but they had to unfix it because it was terrible

hazy trail
#

Well, I can only report what I've seen in my testing. Your test case was quick and easy to run. Thanks a bunch for that.

still forum
#

They added a compile cache which "fixed" it.
I got them to remove it again, and confirmed that the cache is really gone.
But didn't retest the performance.

hazy trail
#

Yes, I recall the notes on the compile cache.

craggy adder
#

Is there any recommended reading on localization in MP scenarios? Best practices, etc. I've seen the multiplayer scripting page on the wiki but wondering if there are any community favorites outside of that

tough abyss
#

Hi, could someone tell me how to set animations in the config? Also, i would like to make the animation loop (going over and over again). Tnx for the help.

cold pebble
tough abyss
#

Ah

astral dawn
#

@craggy adder just follow common sense, if some object (AI Unit for instance) is being simulated by one computer, it makes sense to control this object from the same computer

#

It also makes sense to do it this way because some properties of this object are not always broadcasted across network to other clients

dusky drift
#

So I'm setting costs for a zeus and using getNumber (configFile >> "CfgVehicles" >> _x >> "side") == 0 is true for opfor vehicles, but when I try to equate it to my argument _mySide (which is 0) like this: getNumber (configFile >> "CfgVehicles" >> _x >> "side") == _mySide (and I can verify that _mySide is 0 using hint), it's never true and I have no clue why

#

This is how I'm calling it: private _handle = [this, 0] execVM "S_CuratorInit.sqf";(inside a game master module)

spice axle
#

is _mySide defined in the S_CuratorInit.sqf?

tough abyss
#

Any update on bis_disabled_door_x working for bargates, even the user action text says "Open Door", pretty annoying

dreamy kestrel
#

hello, I am maintaining a mission against the KP Liberation scripts. neither here nor there as far as this channel is concerned. however, I do have a question re: asset class name evaluation. I have many structure asset class names which I want to verify given their names Land_House_L_1_EP1. obviously in this case it is a house, at least given the name, but I want to look it up and verify that somehow. is it possible?

#

yes, but from an Eden Editor POV?

#

this is scripting channel, perhaps #arma3_editor is a better forum?

craggy adder
#

Does this look syntactically correct for remote executing a script on each client from the server?

[["Times up!"], "scripts\end_round.sqf"] remoteExec ["BIS_fnc_execVM", -2, false];
fleet hazel
#

Guys. Who understands mysql? 😃

tough abyss
#

Would understanding of mysqf do?

fleet hazel
#

@tough abyss SELECT players.*, (SELECT fraction.gear, fraction.level, fraction.gang_id, fraction.vacation, fraction.exit, fraction.insert, fraction.last, fraction.allhours FROM fraction WHERE fraction.pid = playerid) asFraction FROM players WHERE players.playerid=76561198052735230;
my request
don't work(

#

Works only so
SELECT players.*, (SELECT fraction.gear FROM fraction WHERE fraction.pid = playerid) asFraction FROM players WHERE players.playerid=76561198052735230;

#

It does not allow you to select more than 1 item for the second selection

tough abyss
#

you sure asFraction is not actually as Fraction?

main jay
#

I think this may be a scripting thing

#

A touch of help
How do I make the use the AutoFire feature on infantry's M14(RIS)

_unit forceWeaponFire ["m14(RIS)", "FullAuto"];

Doesnt work :/
They have an M14 which has an automatic fire mode however they never use it
Cheers
I dont know what to try

tough abyss
#

yeah it probably fires in full auto only forceWeaponFire == 1 trigger pull and release

#

so it fires 1 round per command

main jay
#

wait so..........

#

what?

#

do i have to change anything to the code?

#

I have the same gun and its automatic

tough abyss
#

put it in a loop

main jay
#

how exactly?

#

_unit forceWeaponFire ["m14(RIS)", "FullAuto", "loop"]; --> I have no idea

tough abyss
#

[] spawn {for "_i" from 0 to _Nrounds do {_unit forceWeaponFire ["m14(RIS)", "FullAuto"]; sleep _fullAutoDelay}}

main jay
#

Past it as is?

#

paste*

#

sorry im so useless

tough abyss
#

Dont think so it is a template for you to fill with own values

main jay
#

i suck even with a template

#

I just have an infantry which i want him to use the automatic fire feature

#

just hit me with the code and ill slap it ingame now

#

plz...

tough abyss
#

i dont have that mod with m14

main jay
#

does it matter?

#

ill just change the gunname

tough abyss
#

obviously it does, you want working code, how am I suppose to give it to you if I dont have the weapon you are using

main jay
#

isnt it 1 variable which changes from gun to gun?

tough abyss
#

give me vanilla weapon I will give you code

main jay
#

its called this "weapon_hlc_rifle_M14_rail"

#

does that help?

tough abyss
#

it is not vanilla

main jay
#

okay use this gun

tough abyss
#

Put a Combat Life Saver for example, call him bob then execute in debug console

[] spawn {for "_i" from 1 to 10 do {bob forceWeaponFire ["arifle_MX_pointer_F", "FullAuto"]; sleep 0.1}}

will fire 10 rounds

main jay
#

MXM 6.5mm (Black)

#

cheers ill test it out

#

hold up...

#

do i have to manually execute this each time?

#

I was planning on mass using this code on squads

#

I can change bob to bob1 bob2 etc

tough abyss
#

No idea

peak plover
#

What is this for @main jay ?

#

                private _weaponState = weaponState _unit;
                _unit setAmmo [_weaponState # 1, 100];
                _unit forceWeaponFire [_weaponState # 1,  _weaponState # 2];
#

I just ran this in a per frame handler and the dude fired full auto

#

I made a suppression script for a cinematic moment in a mission once

#

If you're doing a similar thing I might be able to help

fleet hazel
#

Guys, I can't do the distance display for the tag. My config:

#
{ 
    class Mission_1 
    { 
        template = "Mission.Altis";
        difficulty = "custom";
    }; 
}; ```
#

Administrator.Arma3Profile

{
    class CustomDifficulty
    {
        class Options
        {
            3rdPersonView=1;
            reducedDamage=0;
            groupIndicators=0;
            friendlyTags=0;
            enemyTags=0;
            detectedMines=1;
            commands=0;
            waypoints=2;
            weaponInfo=1;
            stanceIndicator=0;
            staminaBar=0;
            weaponCrosshair=0;
            visionAid=0;
            thirdPersonView=1;
            cameraShake=1;
            scoreTable=0;
            deathMessages=0;
            vonID=1;
            mapContent=0;
            autoReport=0;
            AutoSpot=0;
            HUD=1;
            HUDWp=1;
            HUDWpPerm=1;
            HUDGroupInfo=1;
        };
    };
};
singleVoice=0;
maxSamplesPlayed=96;
getTerrainGrid=50;
setTerrainGrid=50;
sceneComplexity=1000000;
shadowZDistance=100;
viewDistance=5000;
preferredObjectViewDistance=3000;
terrainGrid=50;
volumeCD=10;
volumeFX=10;
volumeSpeech=10;
volumeVoN=10;
vonRecThreshold=0.029999999;
thin pond
#

I'm trying to make this work with a vehicle that is in a specific zone/trigger BIS_fnc_garage_center = CursorTarget; uinamespace setVariable ["bis_fnc_garage_defaultclass", typeof cursorTarget]; ["Open",true] call BIS_fnc_garage; any suggestions

surreal peak
#

BIS_fnc_garage_center is a custom function u making right?

thin pond
#

it works with the cursor but i cant seem to make it work within a specific area.... I tried playing around with nearest object

surreal peak
#

if so I wouldnt recommend the BIS part of it as it might cause some problems if BI create a funciton of the same name further down the line

thin pond
#

also I've seen some guys using it while testing the possibilities of the Virtual Garage.... cant find the post right now

surreal peak
#

fair enough, when I first tried scripting/ modding someone told me to try to avoid using other people's tag's(?) in my own code as it can cause confusion for others

#

for example, when i turn scripts into mods, I use the tag FMODS_

#

I think the word is 'tag' is correct anyway

drowsy axle
#

Is there a command for checking which map/terrain is used?

daring pawn
#

worldName

drowsy axle
#

Thanks @daring pawn 😉

#

Appreciate that will, but it's ironic that I was helping you yesterday 😃

daring pawn
#

aha, what with? I ask so many questions here

#

or you mean on GM?

hazy trail
#

Is it possible to switch the artillery computer to a white map? Unlike the other maps, there doesn't seem to be a button, hidden or otherwise, that will flip the textures off.

high marsh
#

🤷 what would be alternative to it?

winter rose
#

they did then removed it, all in the same dev branch (between patches)

supple vine
#

Hey guys, can you have a glance at this onInit EH script?

#

The while loop doesn't work, I wonder if I made some syntax errors

tough abyss
#

There is no onInit EH afaik

winter rose
#

it's a config-only event, not a scripted one

supple vine
#

yeah, it's added in config

#

the bug was spotted, the !alive should be just alive

tough abyss
#

Which config?

supple vine
#

The unit's config

#

A drone that is supposed to fly at lower attitude than 100m

#

And the idea is to make it avoid obstacles

tough abyss
#

You sure it is called onInit?

supple vine
#
        {
            init = "_this execVM '\40k_tau\Drones\scripts\init_drone_2m.sqf';";
        };```
#

It's init, i stand corrected

winter rose
#

it should be "init" yes

#

@supple vine maybe it's unscheduled too

serene sentinel
velvet merlin
#

can one disable inventory action for ammo crates via sqf?

#

best to hide the action itself (otherwise inventoryOpen EH is probably the only way)

mint vapor
#

scripting is an absolute pain in the ass.
what are some of the tools you all use to help simplify it so its not a hand-eye-mind grind?

wispy cave
#

notepad++ and the wiki, that's about it

craggy adder
#

I've been using powershell to tail log files since I don't have tail on windows 😦

#

that's a helpful addition

#

an SQF syntax highlighting package for the editor helps a lot

#

An in-IDE linter would help a lot but I haven't played with one yet

velvet merlin
#

IDE is at the end

craggy adder
#

Might have to switch to VSC....syntax error highlighting would help a ton. Been using Sublime for SQF forever for a reason I can't recall.

#

I do love VSC though so no big deal switching

still forum
#

@tough abyss compile cache doesn't exist. so no, the syntax doen't exist

hoary mural
#

second syntax, is that outdated?

winter rose
#

bisimulations is for VBS, I guess

young current
#

👆 this

#

u at the wrong wiki @hoary mural

tough abyss
#

LMFAO! 😂

rotund cypress
#

private _jeep = "Jeep" createVehicle position player;

tough abyss
#

You know what VBS don’t have? params

#

With all their fancy shit million and one commands they still do _this select mydick

hoary mural
#

^ obviously not the main arma wiki however was wondering if that second syntax was in arma as well

peak plover
#

vbs doesn't have params?
I guess they can just replace that with a function

still forum
#

if something is in arma, it's on the arma wiki.

#

if it's not, then it isn't

hoary mural
#

many things missing from the arma wiki but ok

still forum
#

example?

random crescent
#

hello

#

i broke the new setpos protection stuff (which i would like to state is beyond useless).

#
player setPosASL [-500000, -500000, -500000];

instant crash. enjoy.

high marsh
#

😮

random crescent
#

i can probably find a couple more of those. is there a bug bounty program?

high marsh
random crescent
#

i think if i post it here it might actually get some attention

high marsh
#

But all the devs can see the tickets on the phab?

random crescent
#

and then happily ignore it Ü

high marsh
#

🤔

#

I am having some troubles though reducing incoming damage by half,
all I do is take the received damage in a handleDamage event handler and half it. So for example 0.7 / 2 = 0.35.
0.35 is taken, but then for some reason it keeps getting lower as damage is taken again and again ( I understand that sometimes it can be triggered twice ) .
But eventually it gets so low to the point where it gets infinitely lower

#

and makes it impossible to kill the player without getting a killshot like a headshot

#

which wouldn't make sense if the event handler was altering received damage? should be 0.5 if 1 for headshot from hitpoint

#
playerRole = player call rpga_fnc_getRole;
damageReduction = getNumber(missionConfigFile >> "CfgRPGARoles" >> playerRole >> "damageReduction");
player addEventHandler["HandleDamage",
{
    params["_unit","","_dmg","_source"];
    _finalDmg = _dmg;
    _role = _unit call rpga_fnc_getRole;
    if(_role isEqualTo "RPGA_TANK") then { 
        _finalDmg = _dmg / damageReduction;
        diag_log format["[RPGA]: Role with TANK recieved reduced damage %1",_finalDmg];
    };
    _finalDmg;
}];
#
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.579494"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.281817"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.505476"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.0639294"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.487794"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.0451219"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.0600815"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.500741"

The last one is actually from a headshot from AI. But it was an instant death. wtf?

#
class CfgRPGARoles {
    class RPGA_TANK {
        roleInit = "call rpga_fnc_roleTank";
        damageReduction = 2;
    };
    class RPGA_DPS {
        roleInit = "call rpga_fnc_roleDps";
        penetrationCoef = 1.5;
    };
};

This is mission config for it

rancid zephyr
#

Try removing the semicolon after _finalDmg @high marsh

high marsh
#

Wouldn't matter.
Either way. Same wacky results:

14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.00740967"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.375936"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.284255"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.316371"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.500712"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.5"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.206556"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.30258"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.414883"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.280293"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.829765"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.50042"
austere hawk
high marsh
#

Oh. Duh

austere hawk
#

made the same mistake a while ago 😄

high marsh
#

😄

peak plover
#

That one cfgVehicles browser is offline now

#

Is there an active one somewhere?

austere hawk
#

yes, ingame (cfgviewer launch from eden or from dev console)

cosmic lichen
craggy adder
#

This code executes on a dedicated server, any idea why I don't see a subtitle on the connected clients?

["", _message] remoteExec ["spawn BIS_fnc_showSubtitle", -2, false];
robust hollow
#

"spawn BIS_fnc_showSubtitle" -> "BIS_fnc_showSubtitle"

#

remoteExec starts the function in a scheduled environment for you, and remoteExecCall starts in an unscheduled environment.

craggy adder
#

Guess I need to read more about scheduled vs unscheduled

still forum
radiant needle
#

Is there a way to retrieve where an arty or mortars rounds will impact?

velvet merlin
#

does worldSize only return the config value or does it compute the size itself?

still forum
cosmic lichen
#

@tough abyss Thanks!

radiant needle
#

ETA returns how long rounds will take to impact

velvet merlin
#

@still forum thats why i am asking. the config value can be anything/faulty

wispy cave
#

quick question as I can't currently test this: can I use underscores in variablenames of stuff that's going to be saved in profilenamespace?

still forum
#

sure

#

you can use everything in setVariable

#

even emojis

wispy cave
#

you know what, I'm gonna use an emoji in it, just because I can 😃

winter rose
#
if (😊 == 🤣) then { 😍 setVariable ["❤", false, true]; };```
#

🤢

unborn ether
#

What's actually going on after 1.92? Signatures failure, even CBA is now out of order.

still forum
#

@winter rose only works in strings. so need to use getVariable to get values

winter rose
#

oh I thought you could do something along private _👍 = 5;

still forum
#

Actually not sure if setting/getting are different.

#

You can set 0 afterall. So emoji might work too

#

I tested it once and found that either setting or getting by just writing emoji doesn't work

tough abyss
#
123 = 456; missionNamespace getVariable "123"

KNEEEEEEEL!

still forum
#

Usually I'm not the one who kneels

keen bough
#

anyone know where the ace interaction parents are? I only know about the shouldertap. Nothin else listed in the interaction framework. A list of some kind would be neat

keen bough
#

oof, thank you dedmen!

keen bough
#
_action = ["endMission","End Mission","",{[narTrans_fnc_missionEnd] remoteExec ["call", 2];},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
[_npc, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;

I have two params. private _npc (the npc) and private _pos (position of the npc). But somehow, no matter what i tried so far, i did not get the params over...

still forum
#

you are not passing the parameters at all

#

also you are doing call [narTrans_fnc_missionEnd]

#

call doesn't take array

keen bough
#

currently not, because i deleted everything again so the action works for now. Where do i have to put in my params? Or how do i write it, because currently i cant see how.

#

i get:
[any,any] ...

still forum
#

params call function

#

left command right -> [left, right] remoteExec ["command"]

#

thus
[params, function] remoteExec ["command"]

#

But remoteExec'ing call is nonsense

#

you can just give remoteExec a function name

keen bough
#

it read that i only can execute functions that are already existing, like bohemia stuff only? Or did i misunderstand that?

#

like [_pa1, pa2] remoteExec ["myFunction", 2];?

still forum
#

Yes. can only execute functions that exist

#

But I assume your function does exist

keen bough
#

well, it does, but i thought with 'exist' it means that what BI made like 'call' and 'spawn' and stuff

still forum
#

BI used CfgFunctions

#

like you should also be doing.

#

call and spawn are commands, not functions

keen bough
#
_action = ["endMission","End Mission","",{[_npc, _rng] remoteExec ["narTrans_fnc_missionEnd", 2];},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;

I receive [any, any] 😦

#

i am kind of near to giving up and using addAction -.-

still forum
#

[parameters] that is just a placeholder right?

#

show me the actual code

keen bough
#

I got it that way, lemme quickly use pastebin

still forum
#

It's a placeholder

#

you need to pass the parameters into there

#

Also you don't need to pass _npc as you have it already

#

pull them out again using params

keen bough
#

i dont understand it. Could you please write an example for me please? Just with the _rng position so i finally could understand it :/ going crazy here

#

because [parameter] i edited it and put [_myVar] in it and it didnt work

still forum
#

i edited it and put [_myVar] in it and it didnt work it should

_action = ["endMission","End Mission","",{
params ["_target","_player","_actionParams"];
//_parameters now contains what you supplied as parameters below ([_rng]) just need to pull it out of array now.
_actionParams params ["_rng"]; 
[_target, _rng] remoteExec ["narTrans_fnc_missionEnd", 2];
},{true},{},[_rng], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
#

I assume you didn't use params correctly to get _myVar out of the array

keen bough
#

ah, i understand now, thank you a lot dedmen.

#

I assume _target and _player are always 'magically' defined? (just to be super mega sure for me)

still forum
#

It's written that they are defined on the ace wiki

#

so.

#

They are not magically defined.
It's right there. params. params pulls them out of _this and sets them

keen bough
#

Can i actually ignore those params and just put in my own? like, when i dont need target and player or are they mandatory?

still forum
#

ughhh

#

params. Pulls elements out of an array.

#

_this by default

#

_this contains 3 values. target, player and your parameters

#

If you just say "I want the first element to be some guy over there now" that won't happen. First value is target. You cannot just say "I want this to be something else now"

keen bough
#

aye, thanksies. That i wanted to know :3

still forum
#

You can just not use _target and _player and pass everything in actionParams

#

But you cannot make target and player go away

#

Without modifying ACE itself and breaking every other interaction in existance

keen bough
#

thought so, finally understood it. Thank you alot! Such an Example would be neat if that would've been there i could've learned it by myself.

rugged tangle
#

How can I retrieve the side of a faction?

random crescent
#

The config mentioned has the side.

rugged tangle
#

Yeah, I get that. But how do I access the config? Not familiar with the config commands

still forum
#

getNumber(configFile >> "class" >> "class" >> "side")
class are placeholders that you need to replace by the proper path

rugged tangle
#

That works, thanks 👍

random crescent
#

@still forum who do i poke about that CTD

#

i want my money

tough abyss
#

SetPos one?

random crescent
#

yes

tough abyss
#

You want it reverted?

still forum
#

He was already poked

random crescent
#

okay

still forum
#

and fix is already on the way

random crescent
#

what a shame.

winter rose
#

no money for you! Internet points for the win

still forum
#

limit to -50km on the negative xy. -5km on negative z and keep the +500km on xy

tough abyss
#

Why not revert it to no limits? It seems that there is no appreciation for BI trying to tackle the problem which existed like always

#

You damned if you do you damned if you don’t

#

If the result is the same the most logical action is inaction

still forum
#

I think you missunderstand

#

the limits don't cause crashes

#

the limits were added to prevent crashing by teleporting to far away, the limits are just not strict enough

tough abyss
#

I understand that limits were not tested properly, and that it is not like they suddenly appeared of nowhere and made the game worse. It half fixed the problem already just need another adjustment on negative side why the fucking drama? Anyone could have tested them on dev before to make sure, no one did.

lone cairn
#

Hello, I have a question regarding BIS_fnc_taskCreate and calling/spawning it through a trigger in a MP scenario.

#

I'm veeeeeeeeery unfamiliar with discord and just joined this one, if I need to ask that in another channel I will obviously

spice axle
#

Just ask please

lone cairn
#

Ok. For my trigger condition I have {_x in truck1} count playableUnits >= 2;

spice axle
#

why are you using playableUnits and not allPlayers?

lone cairn
#

The trucks waypoint is synchronized to this trigger and the truck leaves once enough players are in without fail. however, in the On Act. field, I have _null = [true, [t1, p1], ["name1", "name2"], objNull, true, 1, false] spawn BIS_fnc_taskCreate;

#

I'm using playableUnits because not all players have access to the vehicle

#

Anyways, once the needed number of players are in the vehicle, the truck drives off and does it what it needs to do, but the task isn't assigned to any player.

spice axle
#

You are sure that your trigger is set upped correctly?

still forum
#

Anyone could have tested them on dev before to make sure, no one did. they weren't on dev nor RC. Was a last minute thing

lone cairn
#

It works as far as once the correct number of units are in the vehicle, its move waypoint is activated. Its the taskCreate in the On Act. that is giving me trouble

#

I just went back and put a hint after the taskCreate, and it appeared on screen once loaded into the vehicle

#

just to double check for your question

spice axle
#

Try to call it

lone cairn
#

Still no luck unfortunately

ornate sky
#

For creating a local sound source in MP and have all the players hear the same thing is there anything better than playSound3D?

#

ie. is there anything JIP compatible?

ruby breach
#

they weren't on dev nor RC. Was a last minute thing I've missed most of this discussion, but there should have been some form of protection added for that since mid-2017 (as I reported it and received a response back then).

still forum
#

!purgeban @dapper cairn 140d spamming

lyric schoonerBOT
#

*fires them railguns at @dapper cairn* Ò_Ó

fleet hazel
#

guys. I have image.

#

Taking her out in RscStructuredText

#

_ctrlText ctrlSetStructuredText parseText "<br/><t size='10' align='center'><img image='image\police.paa'/></t>";

#

And my image is all black

#

What am I doing wrong?

lavish ocean
#

[3:06 PM] Dedmen: limit to -50km on the negative xy. -5km on negative z and keep the +500km on xy
-50k is enough for all 3 axis to make it simple

#

my system can easily handle -65.5k but some weaker systems get performance drop beyond 50k and nobody can survive beyond negative 200k

still forum
#

Don't need to care about weak systems having low fps, they have that anyway 😄

lavish ocean
#

well it's more about consistency, negative 50 is sort of easier to remember than negative 65.5k 😉

#

ofcourse it could be x,y negative 50k and then z negative 5k but ... i would take anything what is fixed enough

fleet hazel
#

do you guys have any suggestions?

lavish ocean
#

@random crescent you can blame me later that i didn't forsee the crashing happens with different negative values than positive

fleet hazel
#

I have the entire picture is filled with black

still forum
#

@fleet hazel have you checked RPT for errors yet?

fleet hazel
#

they're not.

still forum
#

where did you find how the img tag should look like?

fleet hazel
still forum
#

Is you image multiples of 2 in size? 256x256 512x512 1024x1024 and so on?

fleet hazel
#

256х256

random crescent
#

@lavish ocean i had different kinds of crashes with different values (0x0000DEAD and one out of memory), but i suppose with a limit it doesn't really matter.

lavish ocean
#

i'm quite sure there are other commands which are missing any ceiling or boundaries

#

you know the sandbox w/o limits argument first then bugfixes eons later 😉

random crescent
#

i tried it with attachTo into out of bounds but that apparently is safe or i didnt try hard enough yet. causes some good glitching though.

lavish ocean
#

ye this was whole group of positional commands (like several dozen)

random crescent
verbal saddle
#

Does setVelocity have a limit?

lavish ocean
#

grins at @verbal saddle try guesss ...

random crescent
#

setVelocity needs local args, too, so it would need to be remote exec'd first.

lavish ocean
#

has list of things he wishes were limited in history long time ago in Arma galaxy

random crescent
#

like a limit on how long the RV engine should be used :kappa:

lavish ocean
#

even local is problem, if you know how abuse it (yay locality hell)

random crescent
#

my current goal is to crash a server through 5 or less commands. i'm sure i can do it.

lavish ocean
#

five ? make it one (two with the trigger of payload)

#

well, wait i can do it with one too, nvm

random crescent
#

clientside only though?

verbal saddle
#

🤔 somehow I have broken setVelocity

#

small values do nothing and anything over about 10 just kills the player

lavish ocean
#

you need to accept that Arma 3 will be only secure as 'much' still it's miles ahead of what was A2OA, lightyears of A1

random crescent
#

aaasuy you need to levitate the player first.

verbal saddle
#

Even for a velocity directly up?

random crescent
#

yes

verbal saddle
#

Ah yes

random crescent
#

oh thats neat

fleet hazel
#

guys)) How to make a colored string?

#

dont work
"<t size='1' color='#0a2624' align='left'>Activ:</t>" + "<t color='#0a2624' text</t>"

still forum
#

@random crescent 0xDEAD means forced crash. And usually game first tells you why it's gonna kill itself now.

tough abyss
#

@fleet hazel missing >

fleet hazel
#

@tough abyss Oh God. I'm stupid. Thanks

tough abyss
#

0xDEDMEN

eager edge
#

Anyone know how to script snow

still forum
#

particle effects

eager edge
#

What I just type in particle effects

young current
#

no

#

its very complex thing

#

and often winter maps change the actual rain effects to look like snow

#

instead of particle effects that can kill your fps

#

but if you want to make it with particle effects you got to look up how they work first

still forum
#

Well I assume editing a map config is too hard

eager edge
#

I think it will be beyond me

still forum
#

but.. why do you even want to script it? There are dozens of snow particle scripts already

eager edge
#

I just want it to snow 😂 I have no idea how to do it scripting or not

eager edge
#

Thank you

lost copper
#

Hi everyone! Where i can find information about map in Arma 3? If i got it right, map opened on "M" button is GUI: https://community.bistudio.com/wiki/Dialog_Control_Map
So how Arma add objects from world to map GUI? BIS function or something else? And can i match map object to control in map GUI?

still forum
#

Map is controlled by engine code

#

not script

lost copper
#

So i can't add my personal controls on map GUI?

still forum
#

you can

#

ACE does it for marker creation and stuff

#

Just adding controls to the config I assume

#

or spawning dialogs with script

lost copper
#

In some missions i hide some buildings and create my own buildings (like creating outpost on the road). I want that players know about that objects, but creating markers on that objects looks awful.
So i have idea: create on map GUI controls for list of buildings, that created in editor and hide controls of objects that hided by hideObject command.

still forum
#

"and hide controls of objects" can't

#

and creating a GUI overlay and trying to place it correctly is a F-load of work

lost copper
#

So it's impossible, @still forum ?

still forum
#

Well I don't know any way

#

and have never seen someone remove them

#

I think the building icons on the map aren't even controls, they are burned into the image

lost copper
#
building icons on the map aren't even controls, they are burned into the image

No, buildings are not parts of map picture. But how they are drawn on the map - it's a big mystery for me 😫

unborn ether
#

AFAIK map is a fully rendered control, all is drawn as actual 2D graphics, I think terrain is also drawn according to terrain type and alpha channel value. That's why It might become sloppy sometimes when you zoom in.

#

When I once failed to create inheritance chain in some of the map controls, the control appeared to be blank white, that's what basically happens when render fails in Arma.

wispy cave
#

Quick question, is there a way to use copyToClipboard to copy something into a clients clipboard on a dedicated server?

tough abyss
wispy cave
#

well I've got a guy complaining about it not working claiming it's somehow possible

#

I've read what the wiki says

ruby breach
#

If it were somehow possible he wouldn't have to complain about it not working, now would he?

dusky pier
#

Graphs is still not working?

still forum
#

But how they are drawn on the map - it's a big mystery for me the engine draws them. They are not scripted nor configured in config- all hardcoded.
@wispy cave not possible. Do you have ACE? ACE has a extension that can do it

#

@dusky pier what is "graphs" supposed to be?

wispy cave
#

no, vanilla server

still forum
#

then not possible

dusky pier
#

@still forum new scripting command from 1.92 update. That was with ctrlSetPositionX, as i understand they add graphs to UI

#

but i can't find more info about it

still forum
#

there are new graph commands. But they don't do anything with controls

#

There are setPosition commands for X,Y,W,H has nothing to do with graphs

dusky pier
#

understand 😦

craggy adder
#

Is there a best practices way to make a player impervious to damage in a multiplayer setting?

#

allowDamage doesn't seem to do anything. I've had mixed luck using different event handlers to just ignore incoming damage.

austere hawk
#

add handledamage eventhandler and return 0

craggy adder
#

I was using this: _player AddEventHandler ["HandleDamage",{false}]; with mixed luck

#

Seems to work sometimes but not others

austere hawk
#

doesnt work for when hes sitting in a vehicle and that goes capoof however

#

false? you should return 0

craggy adder
#

I'm going to correct what I think are some locality issues, and change that to 0

#

thanks

craggy adder
#

Is there a script command to control/prevent blood loss when being shot? I don't want blood splatters if possible.

#

cursory search didn't find anything

austere granite
tough abyss
#

When do you execute allowdamage? @craggy adder

craggy adder
#

@tough abyss I got it working with the HandleDamage EH, thanks though. Don't even remember, that was an older approach. Odds are good I wasn't properly observing locality when using it

tough abyss
#

HandleDamage works until someone adds another HandleDamage EH then it doesn’t

#

Allowdamage should be safer

craggy adder
#

This is a pretty closed scenario so it should be safe, but I'll keep that in mind if it stops working right. Going to do MP testing this weekend with some friends.

#

Or maybe I'll just go ahead and add that too.

#

Currently having an issue where using player hideObjectGlobal false; after having set it to true isn't showing the model, or re-enabling collisions.

fluid wolf
#

Does anyoen know of a way to make a shell go off in mid air? I tried calling the bullet and doing setdamage = 1 but that doesn't seem to work on projectiles

tough abyss
#

true will hide object obviously @craggy adder

craggy adder
#

Right and false should show it again, no?

tough abyss
#

Yes

#

Try triggerAmmo @fluid wolf

fluid wolf
#

...not working

#

I've got this right, correct? this addeventhandler ["fired", {_bullet = (_this select 6); triggerAmmo _bullet;}];

tough abyss
#

What kind of bullet?

fluid wolf
#

35mm HE right now

tough abyss
#

Does it have like charging distance?

fluid wolf
#

not that I know of

#

I can watch the tracer fly off and hit the hill

tough abyss
#

What is it underbarrel grenade?

fluid wolf
#

No, vehicle cannon

#

autocannon

tough abyss
#

You can delete it and create an explosion in its place otherwise it has to hit something, invisible barrier maybe?

fluid wolf
#

I can try that

tough abyss
#

Or create another projectile going in opposite direction in front of the first one, will get double bang if they collide

fluid wolf
#

Projectiles will detonate on collision? I didnt know this

#

I found a solution for the moment this addeventhandler ["fired", {_bullet = (_this select 6); _shell = "Bo_Mk82" createVehicle [(getPos _bullet select 0), (getPos _bullet select 1), (getPos _bullet select 2)]; _shell attachto [_bullet,[0,10,0]]; _shell hideObject true; triggerAmmo _shell;}];

tough abyss
#

If they’re explosive yeah

fluid wolf
#

Need to figure out how to TIME the detonation however

#

which will suck since its local

#

and I cant spawn a trigger with a local variable on it

tough abyss
#

Don’t think you can attach to bullet

fluid wolf
#

Oh ho ho on contrar, you can indeed attachto bullet

#

in fact you can attach ANYTHING to bullet

#

even cars if you're up to see something truly stupid

#

even PEOPLE

tough abyss
#

Interesting, something must have changed

fluid wolf
#

it has been like such for at least a year

tough abyss
#

Yeah there was some tweaking around ammo a year or more back

fluid wolf
#

...hmmmm...

#

now how do I time this... or preferably proxy trigger it

#

without an SQF is the trick...

fluid wolf
#

Hmmmmmmmm

#

Yea still dont have it. Gotta use an SQF

#

...can someone explain why this is Type : Object, expected array, string, config entry on the first line? _warhead = _this select 0;

#

Nevermind, its how I was calling it. Dont forget your brackets kids

slim oyster
#

attachto bullet? oh my

astral dawn
#

Yes you can do a bulletcam or... bulletperson

slim oyster
#

sheep gun

#

rabbit cannon

fluid wolf
#

Grrrr

#

Triggerammo does not appear to work in an SQF for some reason

#

It literally refuses to work under any circumstances in an SQF, but it works fine in an init

#

it doesn't error, it just doesn't fire

craggy adder
#

What does select return if the indicated index doesn't exist in the array?

#

and how do you check for that

#

isNil?

high marsh
#

or

_unitsSelected = allUnits select {alive _x};
if((count _unitsSelected) > 0) then {
    
};
astral dawn
#

count [0, 1, 2] will return the amount of items in the array

high marsh
#

wait a sec

#

are you sure we're not talking about find ?

#
_indexOfEntry = allUnints find "Bob";
if(_indexOfEntry != -1) then {
    hint format["Bob is at index %1 of allUnits",_indexOfEntry];
};
slim oyster
astral dawn
#

So the question by @craggy adder was 'and how do you check that specific index exists in the array', and the answer is, you use the count command ( https://community.bistudio.com/wiki/count ) to get the amount of elements in the array, and obviously don't do array select index if the index is >= than count array. I'm not quite sure why we need find or findIf for that

#

I think if your array has size N and you use array select N, it will return nil, but if you use array select (N+3) SQF will error, but you better check it in the debug console

#

Also there is an alternative to array select index which is the new # operator

zealous silo
#

can someone help me out with the GF cargo airdrop script?
i'm trying to figure out how to get the airdrops to drop onto certain markers i have placed but as of now they drop wherever
i'm new to this and having a hard time figuring scripts out

astral dawn
#

In case noone knows here, ask GF at forum

velvet merlin
#

anyone knows how to make the BI observer mode select the first/any unit by default (or whats the function to do that) and how to force first person view?

wet cobalt
#

Force fpp can be done in server profile iirc

zealous silo
#

how can i force 1 minute of invincibility at game start?

#

i found some posts on making a safe zone but i don't want that

#

i just need at game start for all players to be invincible for 1 minute then it goes away

still forum
#

@craggy adder
"What does select return if the indicated index doesn't exist in the array?" nil, or script error. Most likely script error if you are out of bounds.
Just use param if you expect the element to maybe not be there.

idle obsidian
#

Hi! I am a computer since student and I would like to try using Arma 3 drones to generate data for my ML project. Now the problem is that the original drone view has a lot of "noise". Here's an example (https://imgur.com/gallery/N5vsVsE). Can I get some pointers on how to do get rid of it?

still forum
#

HUD elements can be disabled, in the options there are layout settings where you can move/resize them, could just move them to one corner.
Or load a mod to disable them
Those are only the top 3 though.

idle obsidian
#

Mod sounds like the easiest solution. But I can't seem to find one...

still forum
#

ACE can disable hud elements, but again only the top 3

cursive whale
#

Not sure if it will disable all possible HUD elements.

idle obsidian
#

The top 3 a the least problematic tho

cursive whale
#

Failing that you'd have to patch the drone camera display resource. Doubt you'll find such a thing already made.

idle obsidian
#

Uffff

#

Okay. It's just a never had experience in scripting for arma

#

So that will be fun XD

winter rose
#

or, if you just need a top camera, you can use the Splendid™ Camera script and get your aerial shots

queen cargo
#

can one check what {1+1} isEqualTo {1+1} returns?

#
private _code = {1+1};
_code isEqualTo _code```
spice axle
#

Should return true

queen cargo
#

i do not want to know what it should :P
need to know exactly 100% sure & tested what it returns

astral dawn
#

It returns true

#

both examples

still forum
#

@idle obsidian patching UI's is not scripting. it's config editing and mod making

obsidian violet
#

Hi!
does anyone have a easy way of removeing a specific classname

ex. when a player enters a area all object of typeof "something" will be removed.

something like
if (_x typeOf "Land_InvisibleBarrier_F") then {
deleteVehicle _x;
};
forEach nearestObjects [player, ["All"], 200];

winter rose
#

That's the one yes

#

typeof _x == "class" though

obsidian violet
#

aah, gonna give it a try

winter rose
#

GL!

obsidian violet
#

if (_x typeOf == "Land_InvisibleBarrier_F") then {
deleteVehicle _x;
};
forEach nearestObjects [player, ["All"], 200];

Keep getting error missing ). Have no clue why

winter rose
#

TYPEOF _X

#

^__^

#

@obsidian violet working? 🙂

obsidian violet
#

Figured it out now 😃
haha yeah the typeof _x was a problem but foreach required it all to be within {}

#

{
if (typeOf _x == "Land_InvisibleBarrier_F") then {
deleteVehicle _x;
};
}
forEach nearestObjects [player, ["All"], 200];

#

This works. Thanks alot ❤

winter rose
#

anytime ❤

quartz coyote
#

Hello everyone,
I'm having trouble displaying my icon. The text is correctly displaying but not the picture.

    addMissionEventHandler ["Draw3D", {
    {
        if (side _x isEqualTo side player && {alive _x} && ([objNull, "VIEW"] checkVisibility [eyePos player, eyePos _x]) > 0.9) then
        {
            drawIcon3D
            [
                format ["Images\nt_icons\%1.paa", side _x],
                [1,1,1,1],
                [
                    visiblePosition _x select 0,
                    visiblePosition _x select 1,
                    (visiblePosition _x select 2) +
                    ((_x modelToWorld (
                    _x selectionPosition 'head'
                    )) select 2) + 0.4 + ((player distance _x) / 15) / 1.5
                ],
                1,
                1,
                0,
                name _x,
                2,
                0.03,
                'PuristaBold'
            ];
        };
    } count allUnits - [player];
    }];```
Can anyone find the cause ?
winter rose
#

does it work if you replace side _x with "west", for example?

tough abyss
#

but not the picture
what does it mean?

quartz coyote
#

No it doesn't work @winter rose

winter rose
#

also, forEach, not count

#

how are your files named?

quartz coyote
#

EAST.paa
WEST.paa

winter rose
#

Case sensitive maybe

quartz coyote
#

if you display the path as a string, you'll see that side _x gives you WEST in uppercase so no already done

winter rose
#

Try with the path starting with \

quartz coyote
#

just did

#

didn't change anything

winter rose
#

See KK's note on wiki page

quartz coyote
#

yeah nice

#

redirected to his blog

#

reading

#

thx

winter rose
#

👍 hope you find the issue

quartz coyote
#

had the same problem with playSound3D

winter rose
#

yeah, seems these commands require an "absolute" path

quartz coyote
#

👍🏼

obsidian violet
#

Does anyone know how I can remote execute the playmove in this script?

{

_x addEventHandler ["FiredNear",{

    params ["_unit"];    
        
    if (alive _unit) then {
        
        _unit playMove (selectRandom ["ApanPknlMstpSnonWnonDnon_G01", "ApanPknlMstpSnonWnonDnon_G02", "ApanPknlMstpSnonWnonDnon_G03", "ApanPpneMstpSnonWnonDnon_G01", "ApanPpneMstpSnonWnonDnon_G02", "ApanPpneMstpSnonWnonDnon_G03"]);     

    };
}];

} forEach (allUnits select {(side _x) == CIVILIAN});

Basicly need to make sure it works both for Dedi and JIP. 😃

digital hollow
#

The EH will only fire on the computer that the AI is local to anyways, so no need to remoteExec.

#

You do however need to add the EH on every computer that might own the AI group

obsidian violet
#

I see. better work on a other solution I suppose.
Or would it be enough to simply just run the script from initplayerlocal?

The animations would still not be seen by other players right?

digital hollow
#

You can add it to init.sqf to be extra sure. initServer should be ok.

obsidian violet
#

Thanks 😃

fluid wolf
#

you can use if () then {} in activation of a trigger right?

still forum
#

yes

#

if you return correct value in the end

#

oh wait. no, onActivation doesn't return. So you don't need to return a value

fluid wolf
#

so i can use that to narrow down an array after a trigger fires yea?

still forum
#

I guess so yeah

fluid wolf
#

ok, just checking

dim kernel
#

hi i closed all Voice chats but people sometimes can speak in chat

#

please help

spice axle
#

Enable channel should work

surreal peak
#
["Dog Scrips", "Attack Dog Blu", 
    {
        params ["_pos","_unit"];
        _grp = createGroup WEST;
        _dog = _grp createUnit ["Fin_random_F", _pos, [], 0, "CAN_COLLIDE"];
        _dogNearestEnemy = nil;
        while {true} do {
            if isNil _dogNearestEnemy {
                _closestDogEnemyHandle = [{
                    params["_dogNearestEnemy"];
                    _dogNearestEnemy = _dog findNearestEnemy _dog;
                    if not isNil _dogNearestEnemy then {
                        [_closestDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
                    };
                }, 1, [_dogNearestEnemy]] call CBA_fnc_addPerFrameHandler;
            } else
                {
                _moveToDogEnemyHandle = [{
                    params["_dogNearestEnemy"];
                    _dog moveTo _dogNearestEnemy;
                    if _dog distance _dogNearestEnemy <1 then {
                        [_moveToDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
                        [_dogNearestEnemy, 0.1, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], selectRandom ["stab", "punch"]] call ace_medical_fnc_addDamageToUnit;
                    };
                }, 10, [_dogNearestEnemy]] call CBA_fnc_addPerFrameHandler;
            };
        };
    
    }] call Ares_fnc_RegisterCustomModule;
18:00:29 Error in expression <rue} do { 
   if isNil _dogNearestEnemy { 
    _closestDogEnemyHandle = [{ 
    >
18:00:29   Error position: <{ 
    _closestDogEnemyHandle = [{ 
    >
18:00:29   Error Missing ;
18:00:29 Error in expression <rue} do { 
   if isNil _dogNearestEnemy { 
    _closestDogEnemyHandle = [{ 
    >
18:00:29   Error position: <{ 
    _closestDogEnemyHandle = [{ 
    >
18:00:29   Error Missing ;```
#

im feeling really dumb as I dont know why im getting those errors

still forum
surreal peak
#

I can't see where I've missed semicolons or bracked

still forum
#

You missed a essential part of a if statement

#

also your isNil check is wrong

surreal peak
#

the ()?

still forum
#

that's not how isNil works

#

no

#

also _dog is undefined in your per frame handlers

surreal peak
#

what did I miss out of the if statement?

#

oh, then

fleet hazel
#

Guys what should I use?

BIS_fnc_saveInventory
BIS_fnc_loadInventory
or
getUnitLoadout
setUnitLoadout
random crescent
#

the latter

still forum
#

always prefer engine commands over script functions

fleet hazel
#

@still forum @random crescent I understand correctly, option number 2?

random crescent
#

get/setUnitLoadout, yes

fleet hazel
#

@random crescent @still forum Thank You

random crescent
#

please stop tagging me for every reply, thanks

queen cargo
#

No Problem @random crescent

#

We will no longer Tag you @random crescent

surreal peak
#

...

spice axle
#

😂

random crescent
#

joke's on you, you we're already on my ignore list

queen cargo
#

Something you should not do if you have questions sqf related darling 😘😘

random crescent
#

lmao

#

i don't, thanks.

surreal peak
#
Error in expression <["_dogNearestEnemy","_dog"]; 
     _dog moveTo _dogNearestEnemy; 
     if (_dog >
18:28:03   Error position: <moveTo _dogNearestEnemy; 
     if (_dog >
18:28:03   Error moveto: Type Number, expected Object
18:28:03 Error in expression <["_dogNearestEnemy","_dog"]; 
     _dog moveTo _dogNearestEnemy; 
     if (_dog >
18:28:03   Error position: <moveTo _dogNearestEnemy; 
     if (_dog >
18:28:03   Error Generic error in expression
#
["Dog Scrips", "Attack Dog Blu", 
    {
        params ["_pos","_unit"];
        _grp = createGroup WEST;
        _dog = _grp createUnit ["Fin_random_F", _pos, [], 0, "CAN_COLLIDE"];
        _dogNearestEnemy = "";
        if (isNil _dogNearestEnemy) then
        {
            hint "empty, start";
        };
        while {true} do {
            if (isNil "_dogNearestEnemy") then 
            {
                _closestDogEnemyHandle = [{
                    params["_dogNearestEnemy","_dog"];
                    _dogNearestEnemy = _dog findNearestEnemy _dog;
                    
                    if (isNil _dogNearestEnemy) then {
                        hint "";
                        
                    } else
                    {
                        [_closestDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
                    };
                }, 1, [_dogNearestEnemy,_dog]] call CBA_fnc_addPerFrameHandler;
                
            } else
                {
                _moveToDogEnemyHandle = [{
                    params["_dogNearestEnemy","_dog"];
                    _dog moveTo _dogNearestEnemy;
                    if (_dog distance _dogNearestEnemy <1) then {
                        [_moveToDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
                        [_dogNearestEnemy, 0.1, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], selectRandom ["stab", "punch"]] call ace_medical_fnc_addDamageToUnit;
                    };
                }, 10, [_dogNearestEnemy,_dog]] call CBA_fnc_addPerFrameHandler;
            };
        };
    
    }] call Ares_fnc_RegisterCustomModule;```
#

what is error position?

still forum
#

It tells you right there what it is

#

Error moveto: Type Number, expected Object

surreal peak
#

god damn it. i need to learn how to read

#

Does the < > tell me which part of the code is broken?

still forum
#

also your params is wrong

random crescent
#

(this select 0) params ...

still forum
#

_this is [arguments, handle]
not just arguments like you expect it to

#

yes

surreal peak
#

so does params look like:

#

params[["_dogNearestEnemy","_dog"],"_closestDogEnemyHandle"];?

#

im just getting a little confused

random crescent
#

that's not how params works

surreal peak
#

had a feeling that was the case

#

then how do I do [arguments, handle]

random crescent
#
params ["_args", "_handle"];
_args params ["_dogNearestEnemy","_dog"];
#

that would be one way.

surreal peak
#

ahhhhhh

#

I was wondering if I had to do _args somewhere as a while ago I did something similiar

#

but I couldn't remember

#

now that I think of it... That other time was me attempting the thing im doing now

random crescent
#

😄