#arma3_scripting

1 messages · Page 638 of 1

sharp skiff
#

"can target all machines" so it should work already?

little raptor
sharp skiff
#

then that part is right but i still get the error missing " ; "with only that line in "on activation"

little raptor
#

copy paste the exact thing

#

I mean paste it here

sharp skiff
#

uhm i just removed the ; behind it and it works

#

it was ["acdc"] remoteExec ["playMusic"];

#

now ["acdc"] remoteExec ["playMusic"]

#

and im confused as F*** again :-I

little raptor
#

both are correct

#

it probably wasn't ;

#

it was :

sharp skiff
#

cant check that now but i still dont hear the music

little raptor
#

and if you try that in debug console, do you hear it?

sharp skiff
#

sec

#

hm no,no matter were i exec it (server,global,local)

little raptor
#

so your music is not defined

sharp skiff
#

it is! it works fine if use it it with say3d

#
this ;[radio, ["acdc", 100, 1, false, 0]] remoteExec ["say3d"];
winter rose
#

sharp skiff
#

got that working on a radio as u spawn in

little raptor
#

cfgMusic is not cfgSounds

#

you defined it in cfgSounds

sharp skiff
#

damnit

#

ok thx didnt thought about that one

#

ok Radio works , Task works Thx guys

little raptor
#

they do. their velocity is capped

worn forge
little raptor
#

what do you mean?

worn forge
#

if you spawn the flare in the air with the mentioned code, and don't apply setVelocity to it, it will just sit there in the air until it self destructs.

#

if you spawn the flare in the air with the mentioned code, and don't apply setVelocity to it, it will just sit there in the air until it self destructs.

little raptor
#

no it doesnt

worn forge
#

I beg you to try.

little raptor
#

ok, they don't descend

#

that part is correct

#

ok, they don't descend

#

but their velocity is capped

worn forge
#

Maybe next time try it before you come off so... condescending

#

And you are also incorrect on their velocity being capped, if you setVelocity [0,0,-20], it will faceplant into the ground

little raptor
little raptor
#

once it goes off the velocity becomes capped

worn forge
#

Yes. Which is what the OP was observing.

little raptor
#

which you made fun of

#

and they were correct

#

it was never gonna work

worn forge
#

I made fun of what?

#

Leopard20, to put a cap on this, I have tried to solve this guy's problem, and am in DM with him to do so, rather than just making assumptions about what he's trying to do.

manic grail
#

is there a way to add the unit emblem to a vehicle without having it as a squad.xml?

exotic flax
manic grail
#

damn, wanted to have my clans logo appear on a prowler

#

in that case, you know where to find an olive green prowler texture i can edit?

exotic flax
#

Source files of Arma?

#

But is off-topic to this channel, and cross-posting...

manic grail
#

yea ik my bad

exotic tinsel
#

can someone point me in the direction of how i can look up all the ammo for a weapon so i can fill a crate with it.

worn forge
#

currentMagazine? or all the different mags available for the weapon

exotic tinsel
#

all mags available would be great

#

so if i need to fill a crate will all ammo from a titan for example. with out having to specify manually so that i can use it on any weapon.

winter rose
#

ammoWell(s?) in weapon config

#

magazineWell*

worn forge
#

magazines[] is a bit more immediately useful

winter rose
#

yes obsolete now no?

worn forge
#

getArray (configfile >> "CfgWeapons" > typeOf currentWeapon player >> magazines) will give you an array of magazines compatible with your current weapon

exotic tinsel
#

SWEETT!!!!

little raptor
#

there's also magazineWells

worn forge
#

shrug, works immediately with vehicleName addMagazineCargoGlobal [magazineName, count]

#

I'm not familiar with how magazineWells gets interpreted to produce accurate magazine names

little raptor
#

configFile >> "CfgMagazineWells"

worn forge
#

Though a googlin' later and it appears
[currentWeapon player] call BIS_fnc_compatibleMagazines will produce what you need

exotic tinsel
#

sweetttt

lyric eagle
#

I have a code that allows for the AI to rearm at various things, but i cant seem get it so that the AI are able to rearm at a deceased soldier? how do i get it so the AI can just run to the nearest dead AI?

worn forge
#

Not sure I like this approach though as it will return things like the 100-round mags for a regular MX, where as magazines[] I think was intended to be more conservative in what's typically used in the weapon

lyric eagle
#

That works for dead AI? Huh

winter rose
#

maybe, not sure

sharp skiff
#

is createVehicle also used to spawn ordnace for explosions directly on a location? ( for example letting a obj/crate explode on !alive=true

winter rose
#

I am not sure I got the entire question, but yes you can createVehicle live ammunition

fair drum
#

can i convert an existing unit into an agent or do i need to create a new one with createAgent

sharp skiff
#

@winter rose
my idea is to set up a crate that looks very unsuspicious but as soon as the player destroys it (C4,enough dmg etc.) triggers a massive explosion at that location like from a GBU/jdam or there like

winter rose
#

ah sure, well yes doable

spark turret
#

crate needs to have damage tho

fair drum
#

yes, you would use create vehicle for that, spawn the bomb, then set damage to 1 to destroy

spark turret
#

not all do

#

could do hit EHhandler and explosionHit (?) eh for ones that dont

sharp skiff
#

well it would me most associated with ammo crates etc. but i just want a bigger bang then the normal cook off from ace

spark turret
#

infraction incoming, take cover 😄

fair drum
#

lol

#

edit your cook off or the bot will get you

sharp skiff
winter rose
#

who are you calling a bot 🤖 👀

fair drum
#

its not automated?

spark turret
#

doubt it

sharp skiff
#

aw yaw saw it :-II

winter rose
#

normal cock off
cook* off, it's a joke on the typo @sharp skiff

sharp skiff
#

sry english is not my native language

spark turret
#

my bet is on automated detection, mod decides if punish or not

#

they got me multiple times for dumb stuff hours later

winter rose
#

that, or we use the top-right search field, too 😄

little raptor
#

like fake explosion

#

and make it however you like it

sharp skiff
#

yeah but the collateral damage coming with the ordenance would also be nice!

#

and well with the particle effect i would have to fiddle around more then just to spawn a jdam etc.

spark turret
#

If you use it rarely, use real bombs

winter rose
#
waitUntil { sleep 1; not alive crate };
createVehicle ["Bo_GBU12_LGB", getPosATL crate];
#

*boom*

little raptor
spark turret
#

Just dont do it on a loop to create background ambience. Lost of bombs is bad for performance

winter rose
#

waitUntil will rule the world!

sharp skiff
#

@spark turret 3 times over a whole airbase or so , so its not to much

#

@winter rose i didnt even ask for it an u delivery THANK YOUR VERY MUCH!

winter rose
#
{
  _x addEventHandler ["Killed", {
    params ["_crate"];
    createVehicle ["Bo_GBU12_LGB", getPosATL _crate];
  }];
} forEach [crate1, crate2, crate3];
sharp skiff
#

❤️

winter rose
#

better ↑ ^^ previous was only a proof of concept as @little raptor pointed 👀 😄

little raptor
sharp skiff
#

how do stamp them out so quick?

#

XD

winter rose
#

blah blah blah 😛

sharp skiff
#

.sqf then let it run once with a init?

winter rose
#

you can set it in initServer.sqf

sharp skiff
#

ok

little raptor
winter rose
#

be glad you found the body 😄

little raptor
#

I had to use Zeus

#

I only saw him for a fraction of a second

#

flying at the speed of light

winter rose
#

are you CRAZY?!
and I thought that question was sorted already

spark turret
#

lol what size is a gbu 12

#

i can recommend the Mk84 for really nice effects 🤔

#

eh 500 lbs. thats toys

sharp skiff
#

@winter rose @little raptor yeah well i found out u can make nice suiciders with that also, excuse me i need to find new pants and a way to scrap the civi of the runway :-I

spark turret
#

LOL a suicider carrying a 500 pounds bomb

sharp skiff
#

yep

#

i was to lazy to search for a crate i just placed a civi named him crate1, shot his head, ????, Profit!

tough abyss
#

is there any command for me to remove a weapon that was put into a backpack and not in the active slot ?

winter rose
#

yes

sharp skiff
#

i bet there is no sorted version of the cfgMagazine wiki site?

winter rose
#

you mean, clicking on the table headers? ^^

sharp skiff
#

my bad :-I

winter rose
#

you are condemned to write sqf in notepad (not ++) for 2 weeks! 👨‍⚖️

sharp skiff
#

uff

fair drum
#

Id do it with graph paper and colored pencils

sharp skiff
#

pls i dont want to die!

exotic flax
#

Crayons only!

winter rose
#

hmm… grayons

sharp skiff
#

leave them for the mariens

fair drum
#

no the crayons are for when i get hungry

sharp skiff
#

😛

#

"GravityShotgun_01" ah what?

winter rose
#

might be Contact only :3

sharp skiff
#

yeah never ever saw that ingame XD

#

oh and u guys brought me to use Visual studio code wit the sqf addon 🙂

#

or @spark turret did with his mention it to someone else

#

more colours yay

exotic tinsel
#

is there a way to loop through all tasks on the map?I need to get their locations. Im not seeing any functions to do that.

exotic tinsel
#

@winter rose Thanks alot mate!

drifting sky
#

Arma2OA: Is there any way to return a list of rocks or boulders near a position?

exotic tinsel
drifting sky
#

that's A3 only

exotic flax
#

doesn't exist in A2
nearObjects is the closest thing, which only returns objects which are also configured in the game (so some rocks/boulders might, but most won't)

drifting sky
#

I can use nearestObjects to get a list of objects which includes names like rocks and boulders. However, I cannot seem to use those values in any way. If I try to convert the value for a rock into a string, it just says "Null-Object"

#

If I can get those values as strings, I could do a string compare to find rocks

little raptor
#

If I try to convert the value for a rock into a string
?!
If I can get those values as strings, I could do a string compare to find rocks
I'd say you'd have a better luck getting their model

#

if it works in A2 - it doesn't

past tiger
#

Thanks god i'm on Arma 3 and have the new functions

exotic tinsel
#

When i execute this from the server nothing happens. Nor does it do anything when executed on local or global. What do i need to do to make this work?
[west, "HQ"] commandChat "Light Armor is Online.";

robust hollow
#

you're supposed to execute it on the client where you want the message to show. that being said, i have also had issues with some of the chat commands simply not working, so you may not be doing anything wrong.

tribal onyx
#

How can I stop the script and "exitWith" while inside a loop within that script?

robust hollow
#

you can set a variable in the loop when you exit, and then check for it outside the loop. or you can use a combo of scopeName and breakTo/breakOut.

#
private _exit = false;
{
    if (_x == 1) exitWith {_exit = true};
} forEach [0,1,2];
if _exit exitWith {};
#
scopeName "root";
{
    if (_x == 1) exitWith {breakOut "root"};
} forEach [0,1,2];
// Exits before this line
tribal onyx
#

Thanks a lot

#

While I have you; what Discord codeblock syntax is used here?

carmine maple
#

sqf

tribal onyx
#

I didn't know Discord supported that... TIL

exotic flax
queen cargo
#

someone here having arma up and running?

#

and is in editor?

#

if yes, please provide me the result of the following:

#
private _arr = [];
[] call {
    _arr push_back 1;
    [] call {
        _arr push_back 2;
        [] call {
          _arr push_back 3;
          breakOut "foo";
          _arr push_back 3;
        };
      _arr push_back 2;
    };
    _arr push_back 1;
};
systemChat str _arr;```
fair drum
#

@queen cargo your pushbacks have a underscore in them so they won't work. Also generic expression for your breakout

queen cargo
#

argh ... thanks for the headsup (doing c++ right now and push_back and pushBack mixup)
the generic expression error i guess is with those fixes applied?

fair drum
#

yup

#

A breakout B

queen cargo
#

tho ... no
only wrong if he actually did have show script errors set and othewise missleading

fair drum
#

|#| breakOut "foo";
Generic Error

queen cargo
#

maybe something changed blobdoggoshruggoogly

exotic flax
#

hmm... even when fixing pushBack and adding a scopeName I have no results or errors

queen cargo
#

wut

#

script errors off maybe?

fair drum
#

he added a scopeName to the breakout i think

exotic flax
#

nope, errors are enabled and RPT logging enabled

#

and it doesn't matter where I place scopeName "foo";, doesn't do anything

#

also checked with breakTo, also nothing

fair drum
#

i got something in system chat with this

#
private _arr = []; 
[] call { 
    _arr pushback 1; 
    [] call { 
        _arr pushback 2; 
        [] call { 
            scopeName "foo";
          _arr pushback 3; 
          breakOut "foo"; 
          _arr pushback 3; 
        }; 
      _arr pushback 2; 
    }; 
    _arr pushback 1; 
}; 
systemChat str _arr;

returns [1,2,3,2,1] in systemchat

exotic flax
#

... I hate systemChat in the editor... need to exit the debug console to be able to see stuff...

#
scopeName "foo";
private _arr = []; 
[] call { 
    _arr pushBack 1; 
    [] call { 
        _arr pushBack 2; 
        [] call { 
          _arr pushBack 3; 
          breakOut "foo"; 
          _arr pushBack 3; 
        }; 
      _arr pushBack 2; 
    }; 
    _arr pushBack 1; 
}; 
systemChat str _arr;
``` returns nothing
queen cargo
#

ye

#

wat

#

think you got something wrong there grez

#

anyways

#

note is incorrect, that much is a given

exotic flax
#

You talk about the note by alef?

Seems to be incorrect:
nil works and returns [1,2,3,3,2,1]
"" works and returns [1,2,3,2,1]

Incorrect:
"dskfhdsklfh" gives Generic error in expression

robust hollow
#

"" works and returns [1,2,3,2,1]
is that with the last snippet you posted?

exotic flax
#
private _arr = [];  
[] call {  
    _arr pushBack 1;  
    [] call {  
        _arr pushBack 2;  
        [] call {  
          _arr pushBack 3;  
          breakOut "";  
          _arr pushBack 3;  
        };  
      _arr pushBack 2;  
    };  
    _arr pushBack 1;  
};  
systemChat str _arr;
robust hollow
#

ahh

queen cargo
#

true indeed

#

that is wonky

exotic flax
#

so nil ignores it, and "" takes any scope...
I wonder what happens when there are multiple scopes

queen cargo
#

"" just drops out of current scope

robust hollow
#

its not a surprise that nil ignores it. all commands are ignored if nil is given as an argument

queen cargo
#

a fancy exitWith without code

#

Fixed the biki

ember path
#

so uh

#

i have a question

oblique arrow
#

i recommend asking it foxblep

ember path
#
_passengers = [];
_crew = crew introplane;
_dir = direction introplane;
//Get everyone except the crew.
{
    _isCrew = assignedVehicleRole _x;
        if(count _isCrew > 0) then
    {
        if((_isCrew select 0) == "Cargo") then
        {
        _passengers pushback _x
        };
    };
} foreach _crew;
//Now moveout only passengers leaving the crew inside.
{
    _x disableCollisionWith introplane;
    _x allowdamage false;
    unassignvehicle _x;
    moveout _x;
    _x setDir (_dir + 90);// Passengers exit _yourvehicle at right angles.
    sleep 0.6;//space the Passengers out a bit so they're not all bunched up.
    _x allowdamage true;
} forEach _passengers;
sleep 120;
{introplane deleteVehicleCrew _x} forEach crew introplane;
deleteVehicle introplane;
#

i am using this

#

to eject players

#

out of a plane

#

then delete it after 2 min

#

what ends up happening tho is

#

like

#

the plane

#

after it ejects players tries to go rescue them?

#

like it plunges down towards the ground and then lifting and hovering around

#

how do i make it...not do that xd

#

is it just forcing another move waypoint after the eject

true arrow
#

@ember path is the planes crew part of the players group? Maybe the pilots just try to stay in formation with their squadleader, who was just ejected, and therefore they dive down and loiter near the players.

ember path
#

no

#

they are in their own groups

#

hm

#

interesting

#

so

#

when i switched to a position that has the lil like..gun icon

#

not the seat icon

#

it doesnt eject us

proper sail
#

on a sidenote, im not sure you can do allowdamage as that needs to be executed where player is local

ember path
#

i really dont know i copy paste the script.. seemed to work the first time

true arrow
ember path
#

ok..so different issue

#

now

#

UHm...so i have it setup so that when a player crosses a trigger that script executes

true arrow
ember path
#

for some reason....the script doesnt execute if the player is not in one of those...seat icon positions....how do i include those too.. OR even better, how do i make it so only a group ejects

#

i see

winter rose
#

and maybe FFV seats

#

if you have the group's reference, use units saidGroup

ember path
#

the problem rn is i just copy pasted the script i dont really understand it, so idk which parts i need to modify

willow hound
#

Heh

little raptor
#

if you have the group's reference, use units saidGroup
if not, maybe use fullCrew

ember path
willow hound
#

Sorry, I couldn't resist.
You've been around here for a while now though, and that's not very complex code, even commented 🙂

ember path
#

i have i have, and im very thankful that yall are very patient with me, im sorry

winter rose
#

hi sorry, I'm dad!

ember path
#

heck

#

ok

#

ill try

#

just replacing crew...with playerside right.. that should work

#

oh no

#

cuz its.. selecting cargo

little raptor
ember path
#

i dont wanna eject ai flying the plane tho

#

or its gunners

#

hmm lemme think

little raptor
#

or maybe you should listen

ember path
#

i could do that

winter rose
#

(alternative syntax)

willow hound
#

Don't know why the script is so complex, I'd just define an array of either all crewmembers or all people that need ejection and then do my thing based on that.

ember path
#

idk ask arma 3 forum user Beerkan

#

xd

little raptor
#

@winter rose also, the role can be empty "", which will return all roles

ember path
#

ok ok.. sorry ill try to figure it out

little raptor
#

please update the wiki

winter rose
#

if anything but given values, will return everything
even "potato" will return all units 😄

little raptor
#

ok

winter rose
#

(was thinking of adding that info in the type argument description yes… maybe today)

potent coral
#

Would it be possible to make a script that would make there be a 1 in 4 chance that when you loot a weapon from someone, the weapon's iron sights are set to the highest setting? I don't think it is, because the AI doesn't seem to adjust weapon ranging and the default zero is a config from the weapon itself.

winter rose
#

you can only get zeroing by command, not set it

potent coral
#

Darn. Ah well, it would've been for a joke anyways.

winter rose
#

sorry, and one knows I like a good joke 😄

ember path
#

yall i think i goofed up

_dir = direction introplane;

//Now moveout only passengers leaving the crew inside.
{
    _x disableCollisionWith introplane;
    _x allowdamage false;
    unassignvehicle _x;
    moveout _x;
    _x setDir (_dir + 90);// Passengers exit _yourvehicle at right angles.
    sleep 0.6;//space the Passengers out a bit so they're not all bunched up.
    _x allowdamage true;
} forEach fullCrew [vehicle player ""];
sleep 120;
{introplane deleteVehicleCrew _x} forEach crew introplane;
deleteVehicle introplane;
#

i was like

#

i dont need the crew script.. i just want the players to eject so

#

and....at one point i did something... that made again just the cargo ppl eject.. not gunners..but

#

hm

#

my two brain cells cant figure it out...lemme try using group player..

#

no..

#

even using forEach player doesnt work.. i thought it would

#

like just do this script for each player...idk hm

#

oh wait could i..

#

mh

little raptor
ember path
#

i..

#

if that works i will scream

#

doesnt work

#

i tried like

little raptor
#

did you even read the biki about fullCrew params?

ember path
#

yea

little raptor
#

then why is your code wrong?!

#

Return Value:
Array - format [[<Object>unit,<String>role,<Number>cargoIndex (see note in description),<Array>turretPath,<Boolean>personTurret], ...]

ember path
#

OH

#

tehres no

little raptor
#

long story short, the unit is the first element in the array

ember path
#

player......

#

hhhhhhhhhhhhhhhhhhhhhhh

little raptor
#

in other words

ember path
#

wait

#

theres an example

#

on wiki

#

fullCrew [vehicle player, "turret"];

little raptor
#

I'm not sure if that's what you want

#

that'll only eject the turret (aka FFV) units

ember path
#

yeah but im saying....the unit is not....the first element

#

right, in that example

#

? or am.. reading it wrong

#

or is vehicle player a unit

little raptor
#

the first element in each array of seats

#

not the return array

#

also your code ejects everyone

#

so you won't have a pilot anymore

ember path
#

it doesnt eject anyone, actually

#

which is the fun part

little raptor
#

I mean if it worked

#
_dir = direction introplane;

//Now moveout only passengers leaving the crew inside.
{
    _x params ["_unit", "_seat"];
    if (_seat in ["turret", "cargo"]) then {
      _unit disableCollisionWith introplane;
      _unit allowdamage false;
      unassignvehicle _unit;
      moveout _unit;
      _unit setDir (_dir + 90);// Passengers exit _yourvehicle at right angles.
      sleep 0.6;//space the Passengers out a bit so they're not all bunched up.
      _unit allowdamage true;
    };
} forEach fullCrew [vehicle player, ""];
sleep 120;
{introplane deleteVehicleCrew _x} forEach crew introplane;
deleteVehicle introplane;
ember path
#

...dont tell me...the fuckin }; was the issue here d..

#

i wanna turn to ash

little raptor
#

no

#

it was _x

#

_x is an array

#

as I was telling you

#

not the unit

ember path
#

hold on my gears are turning

#

slowly

little raptor
#

this is a sample of what _x looks like:
[<NULL-object>,"cargo",2,[],false]

#

one thing I'm not sure is whether the game returns "turret" or "gunner" for gunner seats

#

so the "gunner" part in my script might be unused

#

or you know, you can simply use:

#

if !(_unit in _crew)
no that won't work

#

apparently cargo units are also part of the crew

ember path
#

i tried like

#

foreach player...and i dont understand why that didnt work

little raptor
#

because player is an object

#

forEach works on arrays

ember path
#

Oh...

winter rose
#

forEach allPlayers might be what you want?

little raptor
#

if all players are in that vehicle

winter rose
#

therefore, maybe not

little raptor
#

otherwise isPlayer _unit

ember path
#

forEach allPlayers was it, its the intro so all of them are in the same plane, cool

#

i...feel like i wanna never look at arma ever again, i just still dont get how or what or.. like what this script is doing, so ig ill have to just....READ

little raptor
#

because you skipped your lessons

spark turret
#

see if you passed a wrong parameter or syntax or sth

little raptor
#

like what does this part do and stuff

ember path
#

i....i am going to die, i...its not working now....wh...it worked like.. a test ago and its not working now....hhh ok, i need to take a break from this

ember path
#

just forEach allPlayers

#

thats it, and it worked...

#

yeah, i need a break from this

little raptor
#

I mean like the full code

ember path
#
_dir = direction introplane;

//Now moveout only passengers leaving the crew inside.
{
    _x disableCollisionWith introplane;
    _x allowdamage false;
    unassignvehicle _x;
    moveout _x;
    _x setDir (_dir + 90);// Passengers exit _yourvehicle at right angles.
    sleep 0.6;//space the Passengers out a bit so they're not all bunched up.
    _x allowdamage true;
    
} forEach allPlayers;
sleep 120;
{introplane deleteVehicleCrew _x} forEach crew introplane;
deleteVehicle introplane;
#

anyhow thanks yall for suffering with me, but ill take a break from this now, gotta clear me head

little raptor
#

it looks fine

spark turret
#

is that normal for forced unboarding planes? making the units invulnerable?

little raptor
#

or maybe even collide with each other (not sure if that's simulated too)

proper sail
#

but locality

little raptor
#

yeah most of them take local arguments

#

_x disableCollisionWith introplane;
_x allowdamage false;
unassignvehicle _x;
_x setDir (_dir + 90);

#

I'd expected that at least moveOut would work

proper sail
#

shouldnt allowdamage be executed on the players pc, this looks like server code

#

because unit is remote on server

little raptor
#

yeah

proper sail
#

ye just confirming my logic here lol

#

as nobody said something about the allowdamage in that function

little raptor
proper sail
#

oh yeah

ember path
#

yeah im just executing the script after a certain triggers conditions have been met, which is probably wrong, but i did also just copy paste the script soo

#

also i dont know what that _x means

#

ive seen it in multiple scripts tho

robust hollow
#

magic variable in foreach, apply, count and findif loops which represents the current element of the array.

ember path
#

`Is your idea necessary?

Will players even notice or use what you want to script? Just because you can doesn’t mean you should. Sometimes less is more!`
#

this line from the wiki

#

mean

#

ofc i needed a script that makes the bar gate whatever its called open when an enemy vic comes near it

#

its very important to me xd

worn forge
#
{  systemChat _x; } forEach ["apple", "banana", "carrot"];
// apple
// banana
// carrot
finite sail
#

pefer ["beer", chocolate", "steak"]

worn forge
#

😛

proper sail
#

@ember path i recommend you spam diag_log or systemchats everywhere and see what is actually happening

#

for your own sake

vale panther
#

question is there a way to make is so that AI do not show up on thermals, I have seen scripts that have made it so that you can only see ai with thermales but cant find anythign the other way around.

little raptor
#

give them CTRG/Viper uniforms! 😛

#

anyway, afaik it depends on the uniform

willow hound
#

I doubt it. You got a link to one of those scripts?

little raptor
#

so you need to mod it (i.e it can't be scripted)

little raptor
#

if that's what you want, just reverse the script

worn forge
#

for vehicles you can use setVehicleTIPars in a loop to remove the signature, but I don't think you can do that with units

winter rose
#

you can use the same script, by inverting the hideObject values true \↔ false

vale panther
#

roger i will try it once i get the chance, I was trying it last night but maybe I was putting it in wrong somewhere.

winter rose
#

that's wha—

spark turret
#

what is persisten global execution?

        // 0 for server only execution, 1 for global execution, 2 for persistent global execution
        isGlobal = 1;
#

like JIP?

#

looking for a way to execute my modules function on JIP too, as it edits map objects which are local to each player (lights)

spark turret
#

is a house object the same across all clients? like, can i select a housereference, call [_myHouseOnServer] remoteExec setDamage 1 on it and it will die on all clients?

proper sail
#

not if each client spawns it local

willow hound
#

Map buildings are local to every host

#

They're special

spark turret
#

so how do i get the map objects between all hosts? like i select a streetlight on the server, and want to kill it on all machines.

willow hound
proper sail
#

isnt it the case that if you destroy a map object with a gun or something that it breaks for everyone

#

i forgot

willow hound
#

Of course

#

But the bullet (or tank shell) also exists on every host, does it not?

proper sail
#

oh yeah

#

spawn a gbu on your streetlight Zpng

willow hound
spark turret
#

i was just wondering if maybe the house reference doesnt work bc map objects are wierd

willow hound
#

One can never be sure until one has tried magic

spark turret
#

do or do not. there is no try. 🐸

#

yeah you re right. i just hoped maybe theres a clear answer before i have to repack my pbo 🙂

spark turret
#

is there a way to find out what class of mapobject im looking at in the editor/zeus?

#

my script misses a certain lamp type on tanoa and i wanna find its classname

willow hound
#
systemChat (typeOf cursorObject);
sharp skiff
#

can anyone point me to the wiki entrance about Zeus module especialy about integrating units (Player AI) on map load? i cant seam to find it!

exotic flax
sharp skiff
#

just that the zeus sees all units on start of the round (u have to add them manuly or they miss the marker/contolablility)

exotic flax
#

in that case you need to go over all objects you want to add and use addCuratorEditableObjects to add them to the curator(s)

fiery orbit
#

when writing a script that creates waypoints for a group is there any way to make a waypoint be skipped if its condition has not been met by a certain elapsed time?

winter rose
#

yes, you can delete it

fiery orbit
#

okay

#

how would I evaluate for the elapsed time?

winter rose
#

well, waitUntil time > x ?

fiery orbit
#

thank you

random loom
#

Is it possible to lock corpses and remove the pickup actions somehow?

lockInventory doesn't seem to work on corpses

exotic flax
#

corpses don't have an inventory, it's a ground holder which contains the items (normally placed under the corpse)

random loom
#

Doesn't appear to work however I twist and turn it

tough abyss
#

Any idea about making an immortal area like how they have it in KOTH ? I'm still wondering if there is any ingame module doing that or I would have to script it from scratch ?

winter rose
random loom
#

That is what I did

exotic flax
#

but lockInventory only works for vehicles and backpacks, not ground holders (afaik)

#

no idea how to lock ground holders though...

#

probably by blocking it through the OpenInventory EH or something

astral tendon
#

how can I round numbers from specific digits? like 1832 to 1800 or 135345 to 135000

robust hollow
#

floor(1832/100)*100

#

floor(135345/1000)*1000

astral tendon
#

wow, clever.

fair drum
#

when would I want to do call compile preprocess vs execVM excluding the need for scheduled environment

robust hollow
#

when you only need to compile/execute a file once. if you need to more than once, you compile preprocessfile into a variable and call that instead

#

another use case is when developing a mission in editor/mod with filepatching enabled. for example, in what im working on right now, the main build uses fnc = compileFinal preprocessFileLineNumbers "filepath.sqf" but the dev build uses fnc = {call compile preprocessFileLineNumbers "filepath.sqf"} so that it recompiles the file on every execution to make testing changes that little bit quicker.

still forum
ember path
#

ok so..i think i figured out why the script doesnt work.. its not the script thats the problem

#

its the trigger

#

and idk why

#

its a really long trigger, that activates when any player comes in contact with it

#

which is weird cuz it did work

#

and now it just doenst

#

doesnt

little raptor
ember path
#

mhm

little raptor
#

maybe it's gone off course
remember that triggers are only checked every 0.5 seconds

#

the minimum width of your trigger depends on how fast the plane is

#

I recommend you use waypoints instead

#

they also have "triggers" (waypoint completion code)

ember path
#

ok thats

#

wait

#

(making the trigger thicker helped)

#

oh you mean the scripted gear icon

fair drum
still forum
#

yes

#

no

little raptor
still forum
#

variable = [] execVM "script.sqf"

variable = [] spawn compile preprocessFile "script.sqf"

fair drum
#

kk

ember path
#

but idk

cosmic lichen
#

yes, but spawn will return a script handle

little raptor
#

which is exactly what you want

ember path
#

OH

#

i can make.. ok i can make multiple..

#

ok

#

thanks

still forum
languid oyster
#

Is it somehow possible to turn off the casing particles coming out of weapons when fired?

umbral nimbus
#

Would it be possible somehow to define a variable on pbo level?

#

use case as follows:

#

In a mission init I define an array for the Arsenal items. But I want that array available in all missions

#

so I want to put it in a pbo, for the mission to ready that array and not having to update the array on a whole series of mission.

exotic flax
#

What do you mean with "on pbo level"?
As in a mod, an addon, or within a mission pbo?

#

because if you create a global variable (properly tagged) you can use it from anywhere

little raptor
#

it will stay in memory until the game closes

#

to define a variable on pbo level?
the only way to "store a variable on a pbo level" is using the config itself. (altho it's not technically a "variable", because it's constant)

#

but that's not what you want anyway

exotic flax
#

I also have arsenal content in a mod which is used in all missions we run, which is a simple array dumped in a file.
Question is; what do you do with that data? In our case the mod also handles setting the arsenal, so no need to be global (which can cause massive problems) or unnecessary stuff in namespaces where it has nothing to do...

still forum
#

I think he just means a preInit inside a pbo.
Using CfgFunctions with preInit.
just set the variable, it will be available in every mission

tough abyss
#

Anyone have any idea how I can make my car "float" via trigger?
so far I've tried "surfaceiswater getpos mycar;
and onAct mycar setPos (getPos mycar vectorAdd [0,0,0.1]);
mycar setMass (0.1); (this decreases the mass but makes the car sink nevertheless, I've also tried using disablesim but that just freezes the car mid-air so no)

Edit: Detach & reattach worked, If anyone has a similar idea, i can help you out.

exotic flax
#

you need to modify the config of a car so it can float, nothing you can do with only a script

tough abyss
#

welp, :(

still forum
#

disable simulation

#

and it won't sink and just stay stati......

#

read slower than type

tough abyss
#

no no, disable sim freezes it, i want it to have simulation and I think i actually nailed it by detaching my pre-attached but hidden boat and re-attaching my car to it

spark turret
#

That would kind of work but you couldnt do much with the car itself

exotic flax
tough abyss
#

yeah, but I'm not making a new mod, I'm making a custom composition.

languid oyster
#

I would like to get the position of the machinegun weapon of e.g. a Karatel. Opened the editor, created the karatel, then

_wpnPos = cursorObject selectionPosition "zasleh_mg";
diag_log formatText ["%1%2%3", time, "s  _wpnPos: ", _wpnPos];

but result is always [0,0,0]
same goes for other selectionNames I tried. What am I doing wrong?

winter rose
#

a karatel… is that vanilla?

languid oyster
#

Yes, I think so

winter rose
#

oh, the Ifrit

still forum
#

have you tested that cursorObject returns what you think it should?

languid oyster
#

Yes, the ifrit

#
_wpnPos = cursorObject selectionPosition "zasleh_mg";
diag_log formatText ["%1%2%3%4%5", time, "s  _wpnPos: ", _wpnPos, ", cursorObject: ", cursorObject];

result
12:49:36 331.513s _wpnPos: [0,0,0], cursorObject: 15e1b154080# 5: mrap_02_hmg_f.p3d
I got the list of the selection names with

{
    diag_log formatText ["%1%2", " _x: ", _x];
} forEach selectionNames cursorObject; 
winter rose
#

not answering, but a formatting tip:```sqf
format ["_wpnPos: %1, cursorObject: %2, time: %3", _wpnPos, typeOf cursorObject, round time];

languid oyster
#

Thanks for advice, will do. But why is this formatting better?

winter rose
#

format is better than formatText for plain text
and you only set the values in %x, not your text - it is more readable

languid oyster
#

I understand. Will do that method in future then.

languid oyster
#

So, as I understand, there is no way of somehow get the model position of a turret or muzzle of a vehicle, right?

little raptor
#

As far as I know:
the turret position, yes
muzzle position, I don't think so

languid oyster
#

Turret would be ok. How would the command look like?

little raptor
languid oyster
#

This is something I can work with. Many thanks Leopard!!

rancid mulch
#

When using selectionNames with and without LOD given, some of the return values are shared, some aren't(shared: glass9, lod exclusive: hit_main_turret_point, no lod exclusive: zasleh_mg). Is there any logic behind it? I assumed there are only the LODs "Memory", "Geometry", "FireGeometry", "LandContact", "HitPoints". If there are more, that might explain it.

ember path
#

Great so now my eject script works fine, i do have to figure out why the plane dips

#

And ive also noticed its going down...not maintaining height i put it at, i even moved the waypoint on the same height thinking maybe that was the issue

#

Only other thing that i can think of is..maybe its too high

#

And i tried doMove after the players eject

#

Doesn't work

true arrow
ember path
#

I did see that.. I'll try that thanks

#

Oh ill try setting its behaviour to careless maybe that wont make it maintain formation idk

#

Im Going to do some googling, but i assume there's a way to make hints show up only for the admin, cuz id like to know while playing the mission if certain things triggered or not

unreal scroll
#

Is there a way to dynamically change the engine power for vehicles (for high load imitation, i.e.)?

winter rose
true arrow
jade abyss
#

Kinda, yes

#

BUT

unreal scroll
#

No, the mass doesn't affect the dynamics in the most of cases.
I already has it in my engine script, and even setting it to 30+ tons doesn't change speed on a horizontal surface.

jade abyss
#

Reducing the weight on helicopter make them LESS agile, while adding more mass to them makes them MORE agile.

unreal scroll
#

I'm speaking about the land vehicles mostly. Helicopter engine script should be MUCH more complex.

weak linden
unreal scroll
#

@weak linden Yup, tried it too. Not an option 🙂

#

@winter rose Ok, thanks.

weak linden
unreal scroll
#

Non-stable motion, performance hit.

weak linden
#

Okay

unreal scroll
#

As I understand, there is no way in A3 to add a constant force, not a single impulse?

winter rose
#

ah, add force yes

unreal scroll
#

It is a single impulse, not a constant one.

#

I'm using it for unflipping script

winter rose
#

repeat it 🤷‍♂️ there is no "always apply that force" afaik

finite sail
#

Luke Skywalker begs to differ 🙂

winter rose
#

it's gonna cost you an arm, maybe not a leg though

finite sail
#

hehe

finite sail
#

yes, that^^^

ember path
#

changing the behaviour to careless, and setting them to be forced to hold fire and not keep formation...did not change anything, plane just really wants to go down

winter rose
#

well, let it be

#

that or use BIS_fnc_unitPlay?

ember path
#

"Plays back input movement data on input unit. " what does that....even mean

true arrow
#

You can use unitCapture to record the movement of a unit, then save this data (e.g. as part of your script) and then play back said movements data on a unit by using unitPlay.

idle jungle
#

Hey guys if I have a sqf with multiple scripts but
Like 8 lines inbetween each script/array could that slow anything down? The reason I do this as its easier to read

#

Wasn't sure if the engine tries to read every line or not

finite sail
#

it has no effect

#

blank lines are ignored

idle jungle
#

Ah thanks

#

Just trying to optimise some code as I'm sensing a little script lag as hints are taking longer to appear sometimes

still forum
#

Unless you're writing SQS (Which i sure hope you don't) it doesn't matter

finite sail
#

stuff that really slows the game down..... spawning units

#

and nested for each loops

idle jungle
#

Yep it spawns in units/props/waypoints/markers the lot

finite sail
#

yeah, probably that

idle jungle
#

Long story short replayable mini events

#

On our training thing

finite sail
#

you can optimise marker spawns, you know about making them local until the last marker command?

idle jungle
#

I'm not really that advanced but would you be okay if I showed you my aicreate.sqf?

finite sail
#

im not that advanced either, but you can show it if you like

#

use sqf tags

idle jungle
#

ok thanks

#

damn too big erm can i upload a file?

#

oh wait pastebin

finite sail
#

too big? wow lol

winter rose
#

> 2000 chars 👀

idle jungle
winter rose
#

it's huuuge (anti "that's what")

#

but well indented, that's nice 🙂

idle jungle
finite sail
#

i wouldnt worry about that script causes lag / warp

#

its doping a lot of network / cpu heavy stuff

idle jungle
#

then it copies this array which i put into another sqf and then another code on a sign lets say addaction to spawn what i placed down on the editor bla bla

#

its quite clever

#

although there is sometimes script lag it works nicely 🙂 just was worried about the hints sometimes taking its time

finite sail
#

some here are calling in assassins because you haven't used camel case consistently, but not me

idle jungle
#

over my head there haha

finite sail
#

allowdamage

#

allowDamage

#

🙂

#

setunitloadout >>>> setUnitLoadOut

idle jungle
#
this addAction ["Start: Athanos Officer MEDIUM",   
{   
 [   
  [],   
  {   
     if (isNil "athanos1") then   
     {  
      athanos1 = [SAS_ATHANOS1] call SAS_fnc_AICreate;    
   athanosradius spawn    
      {  
       waituntil   
       {  
        private _Player = [PlayableUnits,_this,true] call BIS_fnc_nearestPosition;   
        (_Player distance2D _this > 3500)   
       }; 
       [athanos1] call SAS_fnc_AIDelete;   
        athanos1 = nil;  
   
      };  
    comment "ADD CUSTOM CODE AFTER THIS"; 
["Event Started - Athanos Officer MEDIUM"] remoteExec ["hint", 0];       
       sleep 5;
["[Athanos Officer] You must remain 3,500m radius of this event. Enjoy."] remoteExec ["hint", 0];
sleep 10;  
       waituntil   
       {  
        sleep 5;  
        !(alive officer22)   
       };   
       ["HVT has been killed. RTB // Or you have stopped the mission."] remoteExec ["hint", 0];   
    comment "ADD CUSTOM CODE BEFORE THIS";  
     };   
  }   
     
 ] remoteExec ['bis_fnc_Spawn',2];
}, nil, 1.5, true, true, "", "true", 4];```

whats what i have to initiate the spawn per say of what i captured in the editor 
i know someone said why am i using fnc spawn - is there a better way?
#

ps sorry for the indentation thing

idle jungle
#

uh oh lou is gonna tell me off lol

#

be gentle!

finite sail
#

there's nothing in that script that jumps out as horrible

#

ive never used fnc spawn, so can't say

winter rose
#

remoteExec spawn, no?

idle jungle
#

is remoteExec more efficient than bis_fnc_spawn?

finite sail
#

oh yes

#

lots

idle jungle
#

ohhh

#

derpp

#

so the bit where it says ``bis_fnc_spawn'` what would i replace that with?

winter rose
#

spawn

finite sail
#

mmm anyone? as i say, I've never used it

idle jungle
#

oh okay thanks lou

#

still learning the ropes 🙂 nice to have a good community

winter rose
#

don't trust the other channels 👀

finite sail
#

here's how I would do something different to you, may or may not get aggreement from the guys

#

the big switch statements, I'd try to do them differently

#

for example, line 422...

#

something along the lines of _creategroup setformation select ["WEDGE","VEE", "LINE" etc etc]

#

switch has it's place, but IMO, not there

idle jungle
#

oh so instead of sqf switch (_GroupFormation) do { case 0: {_CreateGroup setformation "WEDGE";}; case 1: {_CreateGroup setformation "VEE";}; case 2: {_CreateGroup setformation "LINE";}; case 3: {_CreateGroup setformation "COLUMN";}; case 4: {_CreateGroup setformation "ECH LEFT";}; case 5: {_CreateGroup setformation "STAG COLUMN";}; case 6: {_CreateGroup setformation "ECH LEFT";}; case 7: {_CreateGroup setformation "ECH RIGHT";}; case 8: {_CreateGroup setformation "DIAMOND";}; };

it would more or less (sorry in advance lol) look like

_createGroup setformation select ["WEDGE","VEE","LINE","COLUMN","ECH LEFT","ECH RIGHT","ETC ETC"];```
winter rose
#

ERROR

#
setFormation*```
#

but yeah 😁

idle jungle
#

oh yeh capital F lol

#

ah so i can get rid of switch all together then theoretically?

winter rose
#

this one yeah

cosmic lichen
#

_createGroup setformation (["WEDGE","VEE","LINE","COLUMN","ECH LEFT","ECH RIGHT","ETC ETC"] select _GroupFormation);

idle jungle
#
_GroupWideSettings params ["_GroupCombatMode","_GroupBehavior","_GroupSpeed","_GroupFormation"];``` would i need to remove this index then?
#

ignore me

#

revo referenced it

finite sail
#

ah yes, revo said what I had in mind

#

thanks mate

idle jungle
#

you lot are awesome lol

finite sail
#

you should see us when we're sober

idle jungle
#

hahahaha

finite sail
#

well, not dwarden, obv 🙂

sharp skiff
#

setviewdistance in initserver goes for all player right? or should i better place that in initplayerlocal.sqf /server.sqf?

cosmic lichen
#

@sharp skiff What does the biki page say about locality?

sharp skiff
#

"Client-side max view distance is limited by the server's view distance." On setviewdistance so run it initserver?

#

@cosmic lichen

cosmic lichen
sharp skiff
#

Oh never realised that they have a sort of hint popup! so it Must be initplayerlocal?

#

Thx!

cosmic lichen
#

init.sqf

#

The effect is local. That means it needs to be set on server (otherwise server limits it for clients) and it needs to be set for the clients

sharp skiff
#

ok thank your

#

uhm but does that count if somone jip´s?

finite sail
#

not sure if you're already aware, @sharp skiff , players in multiplayer changing their video settings is ignored

sharp skiff
#

the idea is to force the view to max 3km

finite sail
#

ok cool

#

there are a number of oven ready scripts you can use if you don't want to do it yourself

#

I use one called

#

er

#

CHVD

cosmic lichen
cosmic lichen
finite sail
#

I think the answer is it's JIP safe if you run your code from initplayerlocal

sharp skiff
#

i will do an ac-130 supported mission but that thing has thermal vision which basically can look over half the map! Since it is a small mission i dont want the Infantry to walk/drive the next 10-15km and let the inf know whats goin on in 30km or so cause of that the max view distance is 3km (which is basicly 2times the fire range/distance of the ac-130 in this case)

finite sail
#

^^^^^^ hasnt read the entire convo, as usual, so might be talking poo

sharp skiff
#

na its fine i would says both are better initplayerlocal and init

cosmic lichen
#

if you put in init.sqf you don't have to put it in initPlayer and initServer.sqf

sharp skiff
#

Good to know thx for telling me will do that!

idle jungle
#

Anyone know a way to stop any buildings or structures getting damaged in a session?

winter rose
#

yes, allowDamage

#

be sure to execute it on every computer, otherwise there might be some hovering 😄

idle jungle
#

for normal terrain objects?

#

like houses and stuff on altis

#
_houses = nearestObjects [player, ["house"], 200];
{


_x allowDamage false;


} foreach _houses;``` would that work
cosmic lichen
#

yes

potent depot
#

This is a tpq/idea question. Is there some form of eventhandler within arma for error/scripterrors that can be utilized or monitored in some way? I know its an engine level things ofc and I know the handler doesn't exists technically. Im mostly just wondering about how errors are handled withing the engine and if there is any possibility of making use of it.

cosmic lichen
#

No

#

try catch doesn't really work

fair drum
#

Can anyone spot my screw up? I'm not getting any errors, and it passes everything till it goes to add the items.

if (isServer) then {

    private _medical = [

        ["ACE_fieldDressing",5],
        ["ACE_elasticBandage",5],
        ["ACE_packingBandage",5],
        ["ACE_quikclot",5],
        ["ACE_splint",2],
        ["ACE_tourniquet",2],
        ["ACE_morphine",1],
        ["ACE_epinephrine",1]
    ];
    
    private _units = [];
    
    {
        if (!(isPlayer _x) && (side _x != civilian)) then {
            _units pushBackUnique _x;
        };
    } forEach allUnits;
    
    {
        private _unit = _x;
        {
            _x params ["_item","_count"];
            for "_i" from 1 to _count do {
                _unit addItem _item;
            };
        } forEach _medical;
    } forEach _units;
};
worn forge
#

not sure about this usage _x params ["_item","_count"];

#

but I see that the wiki says it's a thing, so

fair drum
#

I've used it before in a similar manner but only had to apply it to one unit vs a bunch

worn forge
#

so your problem is that the medical items are not being added?

fair drum
#

yes, the error has to be somewhere in the stacked foreach

worn forge
#

nah, I've done that similarly to how you've done it, worked for me

#

you could avoid having to declare a _units variable by just doing
forEach (allUnits select {!(isPlayer _x) && (side _x != civilian)});

#

maybe pop some systemChat's or diag_log's in there to see what's being processed?

fair drum
#

well with systemchats, its pulling all the needed units into _units, it also recognizes the item and the count from the code block so far

worn forge
#

addItem has global effect and scope, so shouldn't be a problem there; if their inventory is full, it won't add though

#

Inventory must have enough space to accomodate new item or command will fail.

fair drum
#

they do, made sure of that.

#

gonna try a diag_log

worn forge
#

perhaps add this before your _unit addItem _item statement;
systemChat format ['%1 addItem %2', _unit, _item]

#

just to see that the command's being parsed correctly?

#

I mean, looks good to me but I'm running out of ideas.

fair drum
#

yup using your system chat, it pulls the correct unit and item through all units

worn forge
#

and if you just straight up run that command through debug, it adds the item correctly? But doesn't, using this code?

fair drum
#

it doesn't add the item still. let me pull a full diag_log and see whats going on

worn forge
#

tbh I'm a bit more specific about where I put stuff, I use commands like addItemToUniform and addItemToVest

fair drum
#

hmmmm let me try that

#

ok well adding the item to the backpack specifically works.

worn forge
#

but the other commands didn't work? strange!

fair drum
#

and now addItem is working and I didnt change anything! I wonder if there is something to do with playableUnits that are controlled by ai that are not being added to the _units array.

#

may have to add another stipulation

worn forge
#

if these are eden-placed units that aren't playable, not side=civilian and not currently a player, should be picked up

fair drum
#

hmmm actually this is interesting. when i enter a units arsenal, it shows its been added, but when I kill them, its not on their body

worn forge
#

so you want the items to be there for player scavenging?

fair drum
#

I might have a conflict with another function I think. gonna eat and think about it after a break

worn forge
#

cos you could just add the items with a Killed eventHandler

fair drum
#

oh I'm just stupid... its like I forgot how to play arma. I was looking at my inventory. guess thats what I get for not playing in a few months

spark dew
#

Hey all. I'm trying to script a way for a play to change their class. I'm using createUnit to make a new unit of a given class, and selectPlayer to turn the unit over to that player, but this leave behind their old... what I'm going to call body, for lack of a better term. The unit they left behind. I want to delete it, but I'm not sure how to get a reference to it for deleteVehicle to put them out of their misery.

_unit = group player createUnit ["GGG_Soldier", position player, [], 0, "FORM"];
selectPlayer _unit;```

every time this runs, the player shifts into the newly created "GGG_Soldier", and leaves behind their old unit. If I run the above a bunch of time, then there will be their original body, and a horde of GGG_Soldiers running around. How can I stop this mad cloning machine?
#

And as a followup, I read somewhere on the wiki that it's best to wait a moment after calling on createUnit before selecting into it, at least, for MP reasons. I'm guessing I should just do the above coe in a spawn block with a sleep 1; in between?

robust hollow
#

tried _oldUnit = player; before changing unit and then deleteVehicle _oldUnit; after?

spark dew
#

Yup, no dice. I'm guessing _oldUnit just stays as a reference to the player no matter what happens in the selectPlayer function.

robust hollow
#

yea. it is what player returns at that moment.

spark dew
#

...

#

Welp tried it again and it worked this time? I probably screwed up saving the change or something notlikemeowcry

mellow obsidian
#

Im having some issues with sliderSetSpeed on CT_XSLIDER, I've set it to
sliderSetSpeed [18002,10,10];
The "line" works just fine but when I try to move the slider without the arrows it doesn't do it in increments of 10. What am I missing? 🙂

robust hollow
#

im not sure that page (the last element in the array) actually works.

mellow obsidian
#

Ah that explains a lot, cheers

tough abyss
#

Anyone know how I can force-eject and my player into another vehicle? doGetOut and moveInDriver doesn't work...

tough abyss
#

It worked, thanks but I'm fascinated how doGetOut messed my entire script...

little raptor
#

they don't have immediate effect

tough abyss
#

oh, that explains it

idle jungle
#

Does startLoadingScreen / endLoadingScreen work mid game to execute a long code

winter rose
#

yes

idle jungle
#

Amazing thank you

#

Is there a way to force duration of it as I think I read you cannot use waituntil or sleep

#

Actually you put that comment in haha

winter rose
#

why do you want to do so?

#

there is also a big red note in the description 🙃

idle jungle
#

Oh thanks bud

umbral nimbus
fallen talon
#

how would you make a usable sign in a server for example like a garage sign to pull cars out

oblique arrow
#

addAction / holdAction @fallen talon

fallen talon
#

cheers

random bramble
#

I need some help i want to set a task state to completed after downloading UAV Data i use eden enhanced for the holdaction function

cosmic lichen
#

In the "Code Complete" field put ["YOURTASK_ID","SUCCEEDED"] call BIS_fnc_taskSetState; @random bramble

#

replace YOURTASK_ID with the name of your task

worn forge
#

@spark dew I have been dealing with this exact situation lately (changing player classes dynamically). There are some considerations;
a) the vehicleVarName doesn't transfer. So if you are moving from an eden-placed unit (which you must be) which has a designated variable name, that variable will stay behind on the previous unit after you use selectPlayer
b) all actions are also left behind on the previous unit.
c) tasked are not sync'd to the unit you just used selectPlayer on.
d) using Vanilla revive system? That's also not sync'd.
... so, just be aware that if you're going this way, you'll want to transfer/rebuild all of a/b/c/d to the new unit you just used selectPlayer on.
as for deleting the old unit, just use

[_oldPlayer] spawn {
  params ["_oldPlayer"];
  waitUntil {!(isPlayer _oldPlayer)};
  deleteVehicle _oldPlayer;
};

... because for a time, both units will share the variable name. I suspect this timeframe is variable in a multiplayer context on a dedicated server, making the waitUntil even more useful.

random bramble
#

i get an error

worn forge
#

wot error?

random bramble
#

i typed this like he said ["task1,"SUCCEEDED"] call BIS_fnc_taskSetState] ;

worn forge
#

no you didn't

random bramble
#

okay i've corrected the error, but the task state doesn't change when the download is complete

worn forge
#

post your holdAction code

random bramble
#

["TASK_1","SUCCEEDED"] call BIS_fnc_taskSetState;

#

this is the code when the action is completed

worn forge
#

no, the whole holdAction

#

also, how are you creating the task

random bramble
#

yes the task is created hold i'm uploading the screenshot

worn forge
#

please read fully what I'm asking if you are looking for help.

#

how are you creating the task

random bramble
#

i put the task modules

worn forge
#

have you named your task "TASK_1" in the module?

random bramble
#

yeah i just corrected my mistakes now thank you ^^

#

now it's working fine

worn forge
#

👍

finite sail
#

if im moving an ai from 1 group to another, do i need to move him to grpNull before moving him to the new group?

little raptor
finite sail
#

lolo did I?

little raptor
#

yup, and I answered!

#

anyway, no

finite sail
#

thanks

#

if im moving an ai from 1 group to another, do i need to move him to grpNull before moving him to the new group?

#

lol

little raptor
#

maybe it was someone else, but I'm 99% sure it was you!

finite sail
#

it is the sort of thing I'd do

little raptor
finite sail
#

yeah, well.... I'm old. It's only going to happen more often

obsidian violet
#

Hello guys, I do have a question regarding setUnitLoadout.

So I have created an action on a object that changes uniform + vest + helmet
However I want to keep the old items in the vest and the uniform.

Action works, However I do loose all gear in vest + uniform.
Any ideas to save the loadouts in the uniform + vest and then add them in again once the new uniform is on?

player setVariable["KilletsSaved_Loadout",getUnitLoadout player];
                player forceAddUniform "LOP_U_TKA_Fatigue_01";
                player addVest "LOP_V_6Sh92_WDL";
                player addHeadgear "LOP_H_SSh68Helmet_TAN";
player setUnitLoadout(player getVariable["KilletsSaved_Loadout",[]]); //but remove the uniform + vest
spark turret
#

im a bit rusty with loadout stuff, but there might be a function that gets the items inside a wearable container

#

if not, i suggest a loop that gets all items, sorts out anything thats a vest/uniform or helmet and readds to the player

obsidian violet
#

Thanks. I was just looking at it.
But how would it be possible to add all items in an array and att to forexample the uniform?

private _stuff = uniformItems player; 
{player addItemToUniform _x} foreach _stuff; 

maybe?

spark turret
#

yeah the general structure is how i would do it

#

but you need to change the uniform inbetween, otherwise you just double the items 😛

#

now that i look at your code, it might be easier to just take the saved loadout and replace the uniform, vest and heargear classnames in it

obsidian violet
#

so this is what I put together. Reading your latest now =)

 private _uniformStuff = uniformItems player; 
        private _vestStuff = vestItems player;  
          player forceAddUniform "LOP_U_TKA_Fatigue_01";
                player addVest "LOP_V_6Sh92_WDL";
                player addHeadgear "LOP_H_SSh68Helmet_TAN";

        Uniformtaken = Uniformtaken + 1;
        publicvariable "Uniformtaken";



{player addItemToUniform _x} foreach _uniformstuff; 
{player addItemToVest _x} foreach _VestStuff; 
spark turret
#

i mean that works as well yeah

#

uniform taken is for what?

obsidian violet
#

Oh sorry. that is for something else 😉 (unrelated to this)

#

The condition for the action
(_this distance _target < 3) && (Uniformtaken < 5)

little raptor
#

Uniformtaken = Uniformtaken + 1;
publicvariable "Uniformtaken";
why do you public this var?

obsidian violet
#

So that it sets for all players on the server even JIP so that only the gear can be changed 5 times on the server

#

HEEY It worked!
THANK YOU ❤️

spark turret
#

5 gearchanges in total for all players?

obsidian violet
#

Yes

spark turret
#

a more performant code is probably to replace the vest, uniform and helmet classnames in the stored loadout array

obsidian violet
#

long story and unrelated to this really.
Players infiltrate an supply depot. they can change 5 sets of uniforms. so they need to choose 5 players.
Then those players will infiltrate a base blah blah blah. main point is that its working 😄

spark turret
#

so getloadout, replace names in it, setLoadout.
use array set [index,value]

obsidian violet
#

Ahright!
Yeah that may be better! Thanks
I take a look into it

spark dew
# worn forge <@!138418981223530497> I have been dealing with this exact situation lately (cha...

Oh man, thanks for all your notes! I just started testing MP stuff and noticed some issues with vanilla revive. Tasks, actions, vehicleVarName (that's a thing? I didn't even know ><) aren't too big of a concern at the moment, but that revive...
How would you go about getting the vanilla revive rebuilt/transferred? I always set up revives and whatnot through the mission attributes or description.ext, I've not looked into doing it win scripting yet.

worn forge
#

That's actually pretty easy, there is an init function you can run, look in the functions for revive

vale panther
#

I'm still having trouble getting AI not to show up on thermals

little raptor
vale panther
brave jungle
#

whats gone wrong here then? while {position player #!= _endPos} do {blah} - _endPos is a valid xyz.

robust hollow
#

you cant compare arrays with !=

#

!(position player isEqualTo _endPos)

brave jungle
#

ah right that explains it, thank you

jade abyss
#

You should also consider using a distance-check, instead of comparing the position.

#

@brave jungle

cold mica
#

I return a week later regarding my issue. I found the source of my crashes: the .ogg files. Mental note: make sure to set the quality of .ogg files to 0 before export.

robust hollow
vale panther
#

Thank you,

cold mica
winter rose
astral tendon
#

In the old man campaign, if we were close to the character speaking we would hear his normal voice, but if we get far from him we would hear from the radio, what command is that that also adds the radio quality effect?

winter rose
#

no crash nor error for any of the below lines:```sqf
playSound3D ["test"]; // should error, no pos given
playSound3D ["test", player];
playSound3D [getMissionPath "test.ogg", player];

spark turret
#

what function do i use to take away a gps from a player?

#

unassign, removeitem etc?

winter rose
winter rose
#

removes the green suit and the rubies from it

cold mica
winter rose
#

I am on perf rn

cold mica
#

vanilla perf then.

winter rose
#

what do you call "dirty"?

cold mica
#

modded to all heck

winter rose
#

ah, well.

spark turret
#

and can i test for a gps in use with searching for the class in the loadout?

winter rose
cold mica
#

Yep, it strangely crashes even on a vanilla virtual reality test

#

where should I send the ticket?

winter rose
#

no crash on my side, on a complete vanilla perf though 🤷‍♂️
check your game files first?

cold mica
#

sure I can do that. i do have to mention that Im on the JEMalloc which is the only difference from "pure" vanilla.

astral tendon
cold mica
winter rose
#

the game uses kbTell, but if you want a different quality between radio and direct, you will need two different declarations and say/sideRadio

astral tendon
#

Yes, but im going to do a huge work with many sounds, so I would like to known if the game already does that

winter rose
#

it does the thing by itself (see the Conversations wiki article, lovely brought to you by Me\®) but if you want more radio effect, it means you will need a file for direct and a file for radio, and manually use the adequate command

astral tendon
#

The effect I want is to reduce even more the quality of the radio, like a bad transmission or interference, my audio file still too clean to hear

winter rose
#

therefore, two files (unless you are certain it has absolutely no chances to be said directly)

spark turret
#

how do i check what machine i am on as code?

#

dedmen says getPlayerUID

#

thx dedmen

spark turret
#

is there a way to make a hint dissapear?

#

like i display the hint "noob" for one second and then kill it?

winter rose
#

hint ""

#

@spark turret

spark turret
#

Ah lol Okay thanks

silk ravine
#

Hi there

#

I am kinda stuck with a task here

#

I want to check if within a specific side (for example east) as group with a specific groupId is existent.
I looked for a CBA function but couldn't find one. Anyone got an idea how to script this?

robust hollow
#

allGroups findIf {side _x == east && groupID _x == "myGroupID"} != -1

silk ravine
#

But isn't findIf extremely load heavy?

robust hollow
#

depends on the condition you use in it

silk ravine
#

well I guess this one isn't too bad

robust hollow
#

it can be faster than other loop options as it exits on the first group to return true

silk ravine
#

oh thats useful if you only search one group

robust hollow
#

so in some cases it might exit on the first group, others the last.

silk ravine
#

thanks Connor 🙂

robust hollow
#

!isNull groupFromNetID "net:id" only if you already know the netid

silk ravine
#

hm... well I basically only want to start a creation of a specific group, if the group is not already existent

#

So no, I do not know the NetId

#

Guess that seals that then

robust hollow
#

if you make a variable at the start of the mission myGroup = grpNull and then assign the group to myGroup when you create it, you could use isNull myGroup checks wherever necessary and that would work before the group is created and after it is deleted (if it does get deleted)

silk ravine
#

Yeah but I want to use the BIS default of Letter groups...

#

Alpha, Bravo and so on

#

oh wait

#
if (isServer) then {Alpha = createGroup [east, false];};```
@robust hollow
robust hollow
#

hmmm?

silk ravine
#

nevermind... I thought I could extract the NetId for east group "Alpha", but NetId only gives the var name to check on

#

if there is resistance and blufor group with Alpha I get a problem

robust hollow
#

netid should give the netid of the group... "owner:id"

silk ravine
#

so on the server something like 2:Alpha 2 for server and ID for Alpha? Or is owner to understand as the groups side i.e. east?

robust hollow
#

2 is the server, because that is where the group was created

#

i think its the server, thats how it is for objects iirc

silk ravine
#

okay so a check for !isNull groupFromNetID "2:Alpha" would return true if there is a group with that name on any side right?

robust hollow
#

no

#

netid references a specific group.

silk ravine
#

argh... I don't get it... whatever xD I will use what you posted first allGroups findIf {side _x == east && groupID _x == "myGroupID"} != -1

#

But thank you @robust hollow

silk ravine
#

@robust hollow You still here?
If finished it and if possible could check for syntax and thought failures?```sqf
params [
"_unit",
"_side",
"_grpName"
];

private _grp = "";

if (allGroups findIf {side _x == _side && groupId _x == _grpName} != -1) then {
_grp = [allGroups, {_this in [side _x == _side && groupId _x == _grpName]}] call CBA_fnc_select;
_unit joinAsSilent [_grp];
} else {
_grp = createGroup [_side, false];
_unit joinAsSilent _grp;
}```

silk ravine
#

I did do so

#

why won't it syntax o,O

robust hollow
#

the != -1 on the end of my snippet needs to be in the condition

silk ravine
#

oh

hollow thistle
#

That params is wrong.

robust hollow
#

cba_fnc_select looks obselete

#
private _grpIndex = allGroups findIf {side _x == _side && groupId _x == _grpName};
if (_grpIndex  != -1) then {
    _grp = allGroups#_grpIndex;
    _unit joinAsSilent [_grp];
} else {
    _grp = createGroup [_side, false];
    _unit joinAsSilent _grp;
};

is what i'd do

silk ravine
#

So I basically did everything wrong... cool 🤣

robust hollow
#

because select condition could return more than one group

silk ravine
#

You should post this in the Biki article for groups or what not. there is basically nothing as a function that would let you do above, w/o reinventing the wheel every time some tries to do this

oblique arrow
silk ravine
#

Yes... I did

#

Its the comments

oblique arrow
#

blobdoggoshruggoogly weird

robust hollow
silk ravine
#

Then maybe post it in joinSilent and joinAsSilent?

#

I fucking bet people search for this all the damn time

robust hollow
#

still not directly related to groups in any way so it would be a little out of scope for a specific command's page.

cerulean cloak
#

Hello again. I'm trying to kick all the AI units out of a vehicle when it enters a trigger and keep them out. I've got this while {true} do{ {moveout _x} foreach units REIN_1; {moveout _x} foreach units REIN_2; sleep 0.1; };
in the activation field of a trigger but when the vehicle enters the trigger there's a lag spike and then it says "Generic Error" can anyone advise me on what to do please?

exotic flax
#

well, you won't need to loop something which only happens once

#

and since the while loop never stops it returns an error

cerulean cloak
#

But they get back in if I just run it once

#

So how do I keep them out?

winter rose
#

unassignVehicle

cerulean cloak
#
{unassignvehicle _x} foreach units REIN_1;
{unassignvehicle _x} foreach units REIN_2;
``` Just that?
exotic flax
#

This should work: ```sqf
{
unassignVehicle _x;
moveOut _x;
} forEach (units REIN_1) + (units REIN_2);

#

although moveOut is not required when all units are AI (since the group leader will order the group to go out with unassignVehicle)

cerulean cloak
#

They still climbed back in after they got kicked out.

#
{ 
   _x leaveVehicle REINH_1; 
   moveOut _x; 
} forEach (units REIN_1) + (units REIN_2);
``` That worked in the end. Thanks for the help. @exotic flax
bright steeple
#

Script to set R-750 Rhea elevation to 90 degrees?

west grove
#

anyone knows if there is some tool that allows to attach objects directly in 3den without try and error?

#

i remember having seen something like that ages ago, but i'm not really sure anymore

#

might have just dreamed it

#

found it. [obj1, obj2] call BIS_fnc_attachToRelative nice

idle jungle
#

Oooo am I right in saying executing multiple separate remoteExec, 0 inside a remoteExec, 2 is bad 😅 i just spotted it in my code thats not the efficient way is it lol i am a TOOL

fossil yew
#

How to make AI keep position and watching direction at mission start? I tried with delayed spawn doStop followed by lookAt and while they keep position, they look at random direction.

little raptor
fossil yew
#

This is a function called on group in group init field.

little raptor
#

How do you expect them to not watch random directions?!

#

and what's the point of sleep 0.5 at the end?

fossil yew
#

getRelPos means look where your mission maker told you in 3den, "Returns position, which is given distance and relative direction away from original object."

#

0.5 is a mistake, it was from some loop and got left behind

#

in SP it works

#

on hosted server it works

#

on dedicated it doesn't

little raptor
little raptor
#

requires local argument

fossil yew
#

this is executed on server in groups init field, it should be local to the server

#

afaik AI units are local to the server unless moved to headless client or created by zeus

fossil yew
#

editor-placed objects and empty vehicles are local to the server

spark turret
#

@fossil yew have you made sure the code executes correctly?

#

if you pass a wrong argument into [spawn] it will not always throw an error

#

also getRelPos [100,0] will get a pos 100m in direction north from each individual unit.

spark turret
#

ah whoops. to its relative north

#

12 o clock on units watch

#

so you tell all units to "look straight ahead" lol not sure thats what you wanted

ruby galleon
#

hey hey ho, so I have a quick question...

using a looping execVM, I've been able to make a blackfish follow a player around by basically repositioning a loiter waypoint onto the player's position every few seconds. All well and good.

My main question now is if its possible to map the weapons on the blackbird to function as support weapons, like mortars/artillery? Be able to call it in to attack a marked position with a requested weapon?

willow hound
spark turret
#

hm a disableAI "move" might be easier ?

spark turret
#

not sure how long a "doWatch" command lasts. maybe leader will give new orders

ruby galleon
#

That would be cool- I'm just not sure how to go about doing it. Mind, I am very much new to the world of ARMA scripting. I only really know enough to be able to format shiz and work off of and learn from example pieces

spark turret
#

you can use "doTarget" to make the heli target (and attack if it can) a crtain enemy

willow hound
ruby galleon
#

actually tried that, but no joy- it only ends up acting like a CAS helo instead

#

which is... funny to watch

#

...maybe if I try the artillery module

#

one moment

spark turret
#

hm if you dont want cas, how is it supposed to behave?

ruby galleon
#

no no, I mean

spark turret
#

i mean, a helo cant be a mortar 😛

ruby galleon
#

like it swoops around like a CAS helicopter

#

but the blackfish should be working more like- orbiting from a far off distance, sending ordinance from up above

willow hound
#

@spark turret Sometimes...

ruby galleon
#

first lemme see if I can get it to work with the arty module

#

if not, I'll look into working with a doTarget

willow hound
#

The orbiting can be achieved using a loiter waypoint.

ruby galleon
#

yeah I've already achieved that part

#

the main thing I'm trying to get is to have it attack on a player's request

#

ahhh no good- while the blackfish will get added into the support list, it's greyed out

spark turret
#

you can use a scrollwheel action to control the helos behaviour

#

set it to hold fire maybe

ruby galleon
#

I think there might be something getting confused here- I'm having the Blackfish behave similarly to an AC-130

#

or rather, that's my goal

spark turret
#

aha

ruby galleon
#

have it orbit from a distance, and use its three weapons, a cannon, a minigun, and a howitzer, fire down upon the ground

spark turret
#

a blackfish has a howitzer? 0.o

#

and the orbiting already works with the "loiter" wp?

willow hound
#

It gets added to the support list? That surprises me. I thought assets that don't work don't even show up on the list when added... But it's been a while since I've tried it.

ruby galleon
#

105 mm cannon, yeah