#arma3_scripting

1 messages Β· Page 716 of 1

keen trout
#

wait so the add action is fine right?

#

because i have done it in 3den

#

i have named the objects

#

so its not just "markername" in the addaction and then the variable object name will be markername also?

#

because thats what i've done so far

warm hedge
#

What?

#

I'm suggesting that, it's better to use an object for the position reference if you need to use another dimension (Z, height). What you have is markers not objects, you need to place a dummy objects like a prop, and name it, and use it in the code

keen trout
#

so i did place those dummy objects and named it

#

can i leave the code the same?

warm hedge
#

No

keen trout
#

oh okay now i understand what do i have to change

warm hedge
#

You name it, and use the name in the code

keen trout
#

wait ive done all of that

#

I used the name of the object as the same as the code

#

and tested it and

#

and i get the error i sent you

warm hedge
#

No. That's unrelated to what I've suggested. You didn't change the strings

keen trout
#

to the name of the object right?

#

there is definitely a communication barrier here im sorry

warm hedge
#

You need no sorry but help yourself

#

What the code you've now?

keen trout
#

can i send you screenshot in dms

warm hedge
#

And what's the names of the dummies?

keen trout
#

and the codes

warm hedge
#

No

keen trout
#

okay ill tell so the names of the dummies are named seperately, teleport8green,teleport8blue,teleport8red

#

and my code is

#
this addAction["<t color='#ff9900'>RED V BLUE (LONG)[BRIDGE]</t>",{ 
    {_x setPosATL getPosATL call {     
        if (side _x == blufor) exitWith { 
            "teleport8blue" 
        }; 
        if (side _x == opfor) exitWith { 
            "teleport8red" 
        }; 
        if (side _x == independent) exitWith { 
            "teleport8green" 
        }; 
    }} forEach allPlayers; 
}];
#

errorgetposat1 : type string , expected object

warm hedge
#

You named those objects teleport8blue etc?

keen trout
#

yes

#

there names are assigned to civilians

#

should i try a different object?

warm hedge
#

Then get rid of the quotation marks that's what those make strings

keen trout
#

ohhhh

#

okay

#

thank you that worked

#

i didnt know how to change the strings into objects

past wagon
#

(Sorry if that sounded rude, just clarifying)

keen trout
#

its all good now

cosmic cipher
#

Hi, ihave a question mayby someone can help.
Is there a command to adjust whether the gunner's seat is in the vehicle with a display or whether it is located directly on the outside of the gun? Is there a command to adjust whether the gunner's seat is in the vehicle with a display or whether it is located directly on the outside of the gun?
As an example, RHS M1043A2 (M2) shooter sits on the outside of the weapon, for RHS M1151A1 (CROWS / M2) shooter sits inside the vehicle. With the command "isTurnedOut" you can only check the FFV or normal open hatch commands.
Thanks for the help in advance.

desert palm
#

I accidentally removed a folder from a pbo because I was going to edit its contents with A3 tools, now im trying to drag and drop it in the pbo and it wont go in it has a round circle slash thing that means I cant put it it, why is this?

little raptor
desert palm
#

I just draged it out of the pbo and in to my desktop

little raptor
#

I mean what tool?

desert palm
#

pbo manager

little raptor
#

or add

desert palm
little raptor
#

Β―_(ツ)_/Β―

desert palm
#

what should I use instead?

little raptor
#

addon builder

#

or pboProject

desert palm
#

Oh ok thanks ill try it

little raptor
desert palm
#

yeah its a private mod that my friend sent to me and i was just about to recolor the ghillie to a black one

#

the owner says its ok as long as its for personal use and not for distribution

tired delta
#

Hello guys, im trying to lock a door on a modded building with this "bis_disabled_Door_1" but my door class name is door28 and i dont know how to lock it now . "bis_disabled_Door_28" and ""bis_disabled_door28" semm not to work

fresh crater
#

when i modify a10 pylons with zeus it removes the laser on tgp is there a script to fix it

fair drum
#

I really don't like using disableUserInput for scripted animated briefings, etc. Is there a better way in disabling all user input except for using the escape key to pause or exit?

hollow thistle
#

disableSimulation on the player mby? thomp

fair drum
winter rose
#

don't press 3rd person key then πŸ˜„
(iirc it made a black screen, but I might remembe incorrectly)

fair drum
winter rose
#

I, huh, don't know?
I meant it about disableSimulation

fair drum
#

oh okay

hollow thistle
#

findDisplay 46 displayAddEventHandler ["KeyDown", {true}]; + disableSimuation?

#

and exclude the esc DIK

winter rose
#

iirc that's how I did it yeah

#

for some cutscene stuffz

#

yeah, for safety purpose disableUserInput should itself be disabled IMO πŸ˜„

fair drum
oblique vale
#

Does anybody know if the EH "Fired" is triggered for every shot if I add it on the server?
On the wiki it says: Special multiplayer behaviour: When added to a remote unit or vehicle, this EH will only fire if said entity is within range of the camera. That range is determined by the fired ammo's highest visibleFire and audibleFire config value. In case of units, muzzle attachment coefficients are applied too.

tired delta
tired delta
#

no but i got the source

tired delta
#

thx ❀️

dreamy kestrel
#

yeah, good to know, thank you. only concerned vis-a-vis OBJECT in this instance.
also with nuances re: HASHMAP in that keys can be anything almost. more than STRING at any rate, and with deleteAt support.

willow hound
bitter jewel
#

i would like to somehow test if a unit has this particular instance of an item in its inventory

#

but i suspect that is not possible

winter rose
#

so we should not try helping? πŸ˜„

bitter jewel
#

am i right or wrong

#

well

#

i suppose one can always make somekind of workaround

winter rose
#

state your case?

bitter jewel
#

i would like to have different keys for different doors

#

but it seems i can only test if a string is in a array representation of a units inventory

#

i.e. "Keys" in blah

#

it seems i cannot test if this key number 603 is in a units inventory

winter rose
#

yep
therefore, the workaround is to use e.g setVariable
dropping "a" key, there is no way to know if you ditched A or B given they are the exact same type

bitter jewel
#

thanks

#

or maybe i can make an addon which provides 100 items with the names "key no X"

#

haha

upper siren
#

I need help some cause I don't really know what to google.
I've got playable unit with variable name set in the editor.

How do I check its variable name locally? (to run a script thats local on that unit)

#

Ignore for now, I think I found it πŸ™‚ vehicleVarName

bitter jewel
#

cool

#

i didnt even know that existed

winter rose
upper siren
#

thanks!

#

oh and I didn't need the string version, I guess I just worded it unclear. All I want to do is check if I'm local on a unit with a certain variable name.

winter rose
#

okido ^^ I just have a skin reaction every time I hear about vehicleVarName that's it πŸ˜„

upper siren
candid cape
#

Hi, I need help with an EH.

The EH I need help with is the "GetIn". I've been looking at the Event Handlers page and I can't get it to work for me. I need that if a player gets on a certain vehicle, he should be removed from the vehicle.
Some help?

winter rose
#

see GetInMan if added to the player, otherwise GetIn if added to the vehicle itself.

candid cape
#

Yes, I've also tried GetInMan and I can't get it to work either, I don't know where I'm failing.

winter rose
#

I don't know either, your code is written in invisible ink! πŸ€“

candid cape
#
captiveVehicles = "B_Quadbike_01_F";
player addEventHandler ["GetInMan", {
        params["_vehicle","_position","_unit"];
        if (_vehicle in captiveVehicles) then {
            moveout _unit;
            hint "You can't drive this car.";
        };
    }];

candid cape
candid cape
#

?

#

can you explain please?

winter rose
#

if object in string… not a thing

candid cape
#

And how should I do it?

#

Because a car ID is a String

winter rose
#

what is "a car id"?

#

"B_Quadbike_01_F" here is a classname

candid cape
#

Yes, that's what I meant.

winter rose
#

classname you can get from an object with typeOf
in can check if "something" is in "a list of something"

candid cape
#

so...

#
if (typeOf _vehicle _unit == "B_Quadbike_01_F") then { moveout _unit;};
#

That's good?

winter rose
#

uh, no
why did you write _vehicle _unit…?

candid cape
#
if (typeOf vehicle player == "B_Quadbike_01_F") then { moveout _unit;};
candid cape
winter rose
candid cape
#

yep, that's really work

#

thanks

#

but, if I wan't write more than one vehicle?

#

I cant make an array with de typeOf...

winter rose
candid cape
#
if (typeOf vehicle player == "B_Quadbike_01_F" or "B_Truck_01_covered_F") then { moveout player;};

#

that't dont work.

winter rose
#

of course, this is not a list

#

["itemA", "itemB"] is

candid cape
#
if (typeOf vehicle player isEqualTo ["B_Quadbike_01_F","B_Truck_01_covered_F"]) then { moveout player;};


#

This don't work

#

I can do 40 ifs so it sure works 🀣

winter rose
#

read commands doc, please

strange seal
#

This seemed like the most proper place to ask this question even though it's not about a specific script problem, I have spent a lot of time making a mission and scripting but unfortunately my computer fried and I lost my mission files and scripts, I had uploaded an earlier version to the steam workshop and was wondering if there's a way to download the mission file rather than just be subscribed to it

fresh crater
#

hi im new to scripting. i recently downloaded a mod that adds HMD to all air vehicles but it removed the possibility of using the I-TGP from FIR AWS

#

how can i fix it

strange seal
#

omg sorry, I use a separate harddrive for steam and it looks like subscribed stuff is on my main drive and not the steam drive

fair drum
fresh crater
gleaming oriole
#

Heya, I'm trying to spawn AIs on random positions that I've chosen beforehand. Does someone know how to do that? I tried my code below but the RPT says "Error getposatl: Type Array, expected Object"

EnyInfPos = selectRandom [[14648.2,14095.8,1.83308], [14669.5,14118.9,2.12161], [14670.9,14114,2.15523]];
EnyInf = "O_Soldier_F" createUnit (getPosATL EnyInfPos);

Edit: this works

EnyInfPos = selectRandom [[14648.2,14095.8,1.83308], [14669.5,14118.9,2.12161], [14670.9,14114,2.15523]];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
gleaming oriole
#

I looked at that and I don't understand it

copper raven
#

you're trying to get position of a position meowsweats

gleaming oriole
#

Oh

gleaming oriole
copper raven
little raptor
pastel pier
#

How do i create a cube that is a physx object ? I'm trying to attach a non physx object to it to simulate falling. In theory i could take a square car, hide the model and scale it to the size of the object so it doesn't clip through the ground. But i'm looking for different maybe better solutions. Like is it possible to enable physx on a non physx object through scripting ?

pastel pier
#

So that is a no to both questions ?

winter rose
#

How do i create a cube that is a physx object ?
not by scripting, by a mod

Like is it possible to enable physx on a non physx object through scripting ?
no

sharp light
#

would there be a way to check if an object is within a certain distance of another object?

sharp light
#

Thanks!

#

another question;{_this select _target} addAction [... how do I get "_target" from the "_this" array?

copper raven
#
private _target = _this select ...
sharp light
#

params ["_target", "_caller", "_actionId", "_arguments"]; so 0?

copper raven
#

yup

sharp light
#

alright, thanks!

copper raven
#

but if you're gonna be using more than one parameter, you should just use params

#

it's more efficient

#
params ["_target", "_caller", "_actionId", "_arguments"];

is basically equal to doing:

private _target = _this select 0;
private _caller = _this select 1;
private _actionId = _this select 2;
private _arguments = _this select 3;
sharp light
#

it's within a different addaction and I need the _target parameter to add an action to it

#
//code
[_this select _target] addAction ["Give Red Credits",{
//code
}];
}];```
#

and I'm not sure if I'm doing it right

winter rose
#

see the doc if in doubt

copper raven
sharp light
#

_this select 0 seems to work

coarse orchid
#

hey guys, im trying to get a custom ogg sound to play in a mission for a briefing. i have multiple ways to activate it. i have a trigger, a laptop with an add action. i have the sound and the description.ext, but for whatever reason, its not currently working. any pointers?

winter rose
#

I have the sound and the description.ext
how is it declared, how are you calling it, etc etc πŸ™‚

coarse orchid
#

Disregard, I got it working through say3D!

winter rose
#

roger roger, nice to hear! πŸ‘

gleaming oriole
#
EnyInfGrp = createGroup [east, true];
EnyInfGrp deleteGroupWhenEmpty true;
dynamicSimulationEnabled EnyInfGrp;

EnyInfPos = selectRandom [[2862.25,4756.75,0.0952458], [2860.25,4753.75,0.0952454], [2855.84,4757.14,0.0952454], [2857.07,4754.06,0.0952454]];

EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos, [], 0, "CAN_COLLIDE"];

{
    _x disableAI "PATH";
    _x setUnitPos "UP";
} foreach (units EnyInfGrp);
fair drum
#

separate your select random from the infantry pos and just make an array of positions, then in your foreach iteration, make it select random from that array on that instance, then delete it from that array

gleaming oriole
#

Like that?

EnyInfGrp = createGroup [east, true];
EnyInfGrp deleteGroupWhenEmpty true;
dynamicSimulationEnabled EnyInfGrp;

EnyInfPos = [[2862.25,4756.75,0.0952458], [2860.25,4753.75,0.0952454], [2855.84,4757.14,0.0952454], [2857.07,4754.06,0.0952454]];

EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", [0,0], [], 0, "CAN_COLLIDE"];

{
    _x disableAI "PATH";
    _x setUnitPos "UP";
    _x setPosATL selectRandom EnyInfPos; 
    EnyInfPos deleteAt floor random count EnyInfPos;
} foreach (units EnyInfGrp);
frozen canopy
#

new to scripting. any IDE/editor suggestions for syntax highlighting?

#

also, is this valid? player allowDamage = !player isDamageAllowed

winter rose
frozen canopy
#

thanks, just making a simple script rn that handles a spawn zone, combat zone. interesting challenge πŸ™‚

copper raven
# gleaming oriole Like that? ```sqf EnyInfGrp = createGroup [east, true]; EnyInfGrp deleteGroupWh...

dynamicSimulationEnabled EnyInfGrp is useless, you discard the result https://community.bistudio.com/wiki/dynamicSimulationEnabled

https://community.bistudio.com/wiki/ EnyInfPos deleteAt floor random count EnyInfPos acts as a "selectRandom" here, but it also deletes the selected element from the array, what you're doing right now is: selecting a random position from the array(with the selectRandom), then selecting a random position again and deleting it. Also use local variables, https://community.bistudio.com/wiki/Variables#Local_Variables_Scope

gleaming oriole
# copper raven `dynamicSimulationEnabled EnyInfGrp` is useless, you discard the result https://...

Thank you, it works now

(Without local variables yet until I understand that)

EnyInfGrp = createGroup [east, true];
EnyInfGrp deleteGroupWhenEmpty true;
EnyInfGrp enableDynamicSimulation true;

EnyInfPos = [[2862.25,4756.75,0.0952458], [2860.25,4753.75,0.0952454], [2855.84,4757.14,0.0952454], [2857.07,4754.06,0.0952454]];

EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];
EnyInfGrp createUnit ["O_Soldier_F", EnyInfPos deleteAt floor random count EnyInfPos, [], 0, "CAN_COLLIDE"];

{
    _x disableAI "PATH";
    _x setUnitPos "UP";
} foreach (units EnyInfGrp);
copper raven
gleaming oriole
#

πŸ™

copper raven
#

the idea here is to make maintainable code, imagine you wanted to change something for the units, you'd have to go and edit every line of createUnit

#

and it's always worth to sacrifice a bit of runtime for that

gleaming oriole
copper raven
gleaming oriole
#

Ok thank you very much

tidal idol
#

Any ideas why this is only saving four images, even after traversing the entire unit list for the faction?

maxScreenShotFolderSizeMB = 50000; 0 = [nil,"all",[],[],["BNI_NATO_Improved"]] spawn BIS_fnc_exportEditorPreviews;```
warm hedge
tidal idol
#

It worked when I tried it with another faction though, which is why I'm confused. (I tried increasing the folder size but that's the only change)

warm hedge
#

That limits the FULL screenshot folder of the max size so that's why, IIRC. It should have like 1995MB or so right now for you

keen trout
#

hey so i've downloaded this holster script and put it in my mission file is there anything else i need to do with the script?

#

because i still dont get any scroll wheel option

warm hedge
#

And how did you executed that?

low sierra
#

I have one mission that uses extDB3. I want to make a extDB3 free version, what is the best option? Use profile?

winter rose
#

it… depends

#

profileNamespace, missionNamespace for example

#

if you want data to stay after mission restart, profileNamespace indeed @low sierra

low sierra
#

@winter rose thanks. It will be a big work!

bitter jewel
#

so i place a gate down in editor and name it gate1. can i disable the open door -action or hide it from the player

#

this is different from locking the door since locking it allows the player to try the open door -action

winter rose
bitter jewel
#

unfortunately it is not

#

oh well

kindred zephyr
# bitter jewel unfortunately it is not

to remove default actions from items you need to destroy them

_object setDamage [1,false];

the false statement will make it keep its shape or position.

You can also re-enable some item actions setting the damage to 0.

bitter jewel
#

neat

#

i have to test that after im done with hw

elfin robin
#

good evening guys, look i dont know anything about scripting so go easy. i put i field hospital down in my base, now for healing when walking through it what can i put down and this will go in the init field when you double click on a item? never done it in my life before?

little raptor
dusk shadow
#

Hey fellas, anyone know where the default building collapsing sound is located? Trying to use it with playSound3D

little raptor
dusk shadow
#

Still kinda stumped on the building destruction sound... Config files for buidling is just "soundCrash" or "soundLandCrash" or the like... nothing playable using the script commands i tried :/

little raptor
#

DestrHouse1[] = {"A3\Sounds_F\sfx\special_sfx\Building_Destroy_01",6.30957,1,150,0.1,0,0,0};

#

goes up to 9

winter rose
#

in a disabledAI = 1 MP game, how can I "kick" back a player to role selection?
I think of using OnUserSelectedPlayer mission EH, but then I don't know
selectNoPlayer?

dusk shadow
#

Ha just found the DestrHouse and was looking for where it was! Cheers Leo

little raptor
winter rose
#

I fear that deleting the player may destroy the role with it

little raptor
#
Rough multiplayer emulation:
_noPlayer = createGroup sideLogic createUnit [
    "Logic",
    [0,0,1000],
    [],
    0,
    "NONE"
];
selectPlayer _noPlayer;
hint str player; // L Charlie 4-3:1 (KK)
little raptor
winter rose
#

(and never tried)

little raptor
#

me neither meowsweats

winter rose
#

I'll go with failMission "LOSER";, hah

limber panther
#

Hello! can somebody help? I need to combine these together but i have no idea how:
_this setObjectTextureGlobal [0, "zn\A27.jpg"];
screenToWorld [0.5,0.5]
basicall i need to set texture to an object that i'm currently looking at

#

creating this hybrid obviously didn't work: screenToWorld [0.5,0.5] setObjectTextureGlobal [0, "zn\A27.jpg"];

fair drum
limber panther
#

@fair drum thank you but cursor might not be ideal since it can move around, is there a way to use the centre of the screen?

fair drum
#

screenToWorld to get the position, then nearestObject to find the object closest to that position

limber panther
#

Can you write that script for me please? I'm kinda noob in these

fair drum
limber panther
#

Thanks i'll give it a try in a minute, hold on please

little raptor
#

screenToWorld only collides with terrain

fair drum
#

what config entry can I use to pull all classes of facewear?

little raptor
#

cfgGlasses iirc

fair drum
fair drum
little raptor
#

you can hide them but then they no longer see each other

little raptor
#

I didn't understand what you mean. I guess you mean the ui icons in zeus?

limber panther
fair drum
limber panther
fair drum
limber panther
#

i did read it but i just copy and paste that since i don't really understand much of it as i mentioned earlier so i assume i'm supposed rewrite a portion of it

little raptor
#

Then you have to remove them as editable units

limber panther
#

which one?

fair drum
#

"insertTypeClassHere"

#

you have to either leave it as a blank string to pull everything, or use a typeOf value

limber panther
#

ok what is that type class? like what kind object is it supposed to be looking for?

fair drum
#

it shows a config class name for a particular thing

#

so say if you wanted to target just a particular heli, a class name could be "B_Heli_Light_01_armed_F"

limber panther
#

i'm texturing signs, notice boards, billboards etc. do these have a common class?

fair drum
#

okay hold the phone. you want to change textures as you look at them? or just at mission start?

#

like what is your end goal with this

limber panther
#

ok let me explain:

#

i'm creating a role play server and now i'm making traffic signs, the whole point of it is to give police officers an ability to spawn a sign wherever they want at any time during the game and then set a texture to the sign - in mission file i have nearly 300 pictures of various traffic signs, i already have done almost all the other scripting around it, now i'm trying to get working the phase when officer selects a picture and that particular picture appears on just spawned board, while doing this, his camera will be frozen so his screen will remain pointed the the place where the sign got spawned

fair drum
#

_objectHandle = createVehicle [blahblahblah]
_objectHandle = setObjectTextureGlobal [blahblahblah]

limber panther
#

well that's not a thing here, i'm using a dialog window

limber panther
#

by the way when empty it works fine

#

@fair drum

fair drum
limber panther
little raptor
fair drum
limber panther
#

ok thanks, it seems like leave that spot blank is the best option, anyways thanks a lot! you really helped me, do you think i can ask you one more question?

#

@fair drum

fair drum
#

fire away

limber panther
#

if (side player == west) then {_veh = createVehicle ["Land_Noticeboard_F", screenToWorld [0.5,0.5], [], 0, "CAN_COLLIDE"]}; this script spawns the sign but the sign gets spawned always in default north-south direction, how to edit this script to make the spawned sign facing the player?

#

@fair drum

fair drum
limber panther
#

basically the sign that gets spawned should be facing the player and not the north

fair drum
fair drum
limber panther
#

ah i thought it's missing there but i remained silent πŸ˜…

#

by the way i sent you a private message

limber panther
fair drum
#

can change depending on the model so give a few tests

#

then to change the texture, all you do is do a line for the texture change. and do all of the selecting the texture before the creation of the billboard

#

if you want to still for some reason do it in two parts, you can send it to a variable and pull it from there:

player setVariable ["currentBoard", _board];
player getVariable ["currentBoard", objNull];
limber panther
#

Thank you very much once more again. It's 3:48 am here so i'll go to bed now. In the morning i'll assemble all the scripts together and hopefully it will make a working system for traffic signs πŸ™‚

crude escarp
#

Hi guys, wondering if there's a way to get the Eden editor to show setObjectScale changes as you're making the mission? Tried using the debug console to execute it but that didn't work

little raptor
#

you're doing it wrong then

crude escarp
#

Are you sure?

#

It's working once I start the mission, but I can't get it to show the new scale while still in the editor

little raptor
little raptor
crude escarp
#

I know

#

I sent you a DM with what I'm using

#

So I have the variable name of the object set to "dome1" and the script im using is dome1 setObjectScale 10.0;

little raptor
#

that's not what I mean

crude escarp
#

When executing it in the editor debug console it doesn't do anything

little raptor
#

you have to assign them variables using the debug console

#

not Eden

crude escarp
#

Okay, how do you do that?

little raptor
#

select the dome, then exec:

dome1 = get3DENSelected "object" select 0;
crude escarp
#

Oh that worked, thank you so much

little raptor
#

if you just want to set the scale, just do:

(get3DENSelected "object" select 0) setObjectScale 2
#

something like that

crude escarp
#

And I still need to put the stuff in the init field for when i actually run the mission right?

little raptor
#

yes

crude escarp
#

Ok thanks

#

Thank you so much it works :D

#

@little raptor Now, is there any way to give collision to the object once it's been scaled up? Coz it has to be made a simple object to do that.

It could even just be adding invisible barriers but idk how to do that

little raptor
crude escarp
#

ya its ok i figured it out lol

little raptor
#

If the geometry LOD is larger then the size limit, it gets glitchy (collision does not work for example and the object may disappear at certain view angles). The exact value of the limit is not yet known, but it is somewhere around 50-60 meter from the center of origin

little raptor
crude escarp
#

i just did it manually with invisible walls

tired delta
#

Hello, just a quick question. Dose someone know how to define sound files that are in an addon in my descriptoin.ext?

little raptor
#

followed by addon prefix and the rest of the path

#

e.g. :\a3\sounds\bla.ogg

tired delta
#

ok one sek

#

ill try it

#

but i think it didint work like that

#

for me

little raptor
#

according to wiki

tired delta
little raptor
#

no. use @ like wiki said. what I said doesn't work with cfgSounds apparently

tired delta
#

oh

#

so i do i have to define the sound in my config then?

little raptor
#

why do you use an addon anyway?

tired delta
#

to reduce mission file size

little raptor
#

there's nothing wrong with large mission file size thonk

tired delta
#

i tryed tihs " @myAddon\sounds\casino\drill.ogg" but it didnt work

tired delta
little raptor
tired delta
#

no but the prefix is the same as in my file

little raptor
#

do you know what addon prefix is?

tired delta
#

a file with a name in it "$PREFIX$"

#

?

little raptor
#

well yeah

#

so did you put myAddon in it?

#

and what do you use to pack the pbo?

tired delta
#

No the name i put in is DavidsSounds as well as in my descriptin ext so myAddon = DavidsSounds

#

i jsut thought its easier to understand my qestion with myAddon. sorry πŸ˜„

little raptor
tired delta
#

pbo amanger

little raptor
#

use addon builder

tired delta
#

ok will

#

should i delet the prefix file then?

#

will it create a new one?

little raptor
#

you can delete it yeah

tired delta
#

ahh i see

tired delta
#

.paa files get loaded corectly but the .oog seems to be not call able out of an addon

little raptor
#

did you test it in the mission folder before putting it into an addon?

tired delta
#

yes

#

it worked

tired delta
#

yes

#

that worked but i want to make it with say3D

little raptor
#

I know was just wondering

tired delta
#

oh πŸ˜„

#

is there a reason that in this example:
sound[] = { "@a3\Ui_F_Curator\Data\Sound\CfgSound\visionMode", 0.8, 1, 100 };
there is no file ending at the end?

little raptor
tired delta
#

yes

little raptor
tired delta
#

@little raptor this is the error in the config

#

14:21:00 Sound: Error: File: donzo-life\donzo_life_texturen\casino\drill.ogg

#

donzo-life is my addon, donzo-life_texturen is my pbo

#

dose the @Mod folder also need some file to declare it?

tired delta
#

like the mod.cpp

#

or meta.cpp

little raptor
#

@addonprefix\path\to\file.ogg

tired delta
#

@little raptor is addonprefix the name of the pbo? or of the @folder the pbos are in (@MyAddon\addons\thePbo?

little raptor
#

neither

#

it's the addon prefix meowsweats

tired delta
#

so i got it to work. Thank you so much @little raptor for your help and support ❀️ . I miss understood the add-on prefix part but now everything works πŸ˜„

tired delta
#

hello, its me again i got a quick qestiona bout "say3D". When i remotExec it over the server is it hearable to all players or do i need to exec it over all player

winter rose
tired delta
#

Oh so LE = local. So i have to remote exec it to all clients?

tired delta
#

ahh thank you both ❀️

little raptor
humble bough
#

Are there any commands in Arma that can extend the time you can hold your breath for?

humble bough
#

Sorry, should of defined what I meant, like when sniping, holding breath then, not underwater
It has no effect when soldier is not diving

winter rose
#

then no, it's a config entry - you would need a mod

humble bough
#

Thanks, will do it that way

astral meadow
#

When I set up custom classes to use as configuration utility to retrieve values from (i.e. in mission root a file called values.hpp), I try to use #include "values.hpp" in description.ext. But whenever I try to retrieve a value from it by using i.e.
x = getNumber (missionConfigFile >> "Numbers" >> "number1");
it always returns the default value like 0 for getNumber, an empty String for getText and an empty array for getArray.

Does anyone have an idea what I could be doing wrong? Thanks in advance πŸ™‚

little raptor
astral meadow
# little raptor hard to say without looking at the config
    class Lifter {
        class O_Heli_Transport_04_F {
            hooks[] = {
                { 0, .388,-. 59 }
            };
        }
    }

    class Cargo {
        class Land_Pod_Heli_Transport_04_fuel_F {
            class SlingOffsets {
                frontLeft[] = { -.995, 2.065, 1.35 };
                frontRight[] = { .88, 2.065, 1.35 };
                rearLeft[] = { -.995, -1.368, 1.35 };
                rearRight[] = { .879, -1.368, 1.35 };
            }
        }
    }
}

This is the .hpp file in a folder called config, and I have #include "config\file.hpp" in description.ext

little raptor
astral meadow
little raptor
#

restarting won't update the description.ext

astral meadow
#

or re-open the mission?

astral meadow
#

Although this is good to know, it doesn't solve my problem 😦

#

shoudn't the following work in my case?
value = getArray (missionConfigFile >> "Cfg_LogisticsSystem" >> "Lifter" >> "O_Heli_Transport_04_F" >> "hooks");

#

omg...

#

just worked

#

Somehow when copying the classname O_Heli_Transport_04_F and also Cfg_LogisticsSystem the underscores were replaced with spaces in the debug console. Thought it was visual πŸ€¦β€β™‚οΈπŸ€¦β€β™‚οΈπŸ€¦β€β™‚οΈ

Thank you very much πŸ™‚

willow hound
#

On a side note, -. 59 throws an Invalid number in expression error due to the excess whitespace.

astral meadow
#

right, thanks for that πŸ˜„

little raptor
limber panther
#

Hello! A quick question: In the trigger i have after activation this script: createDialog "znacky" but nothing happens (it's a multiplayer game) any suggestion on why it doesn't work?

winter rose
limber panther
#

@winter rose thanks for the tip but i'm an idiot, i just realised my own mistake - i gave it a wrong class name

hallow depot
#
params ["_helirtt", "_heli"];

private _cam = "camera" camCreate [0,0,0];
_cam cameraEffect ["External", "Back", _helirtt];
_cam camSetFov 0.1;

_cam attachTo [_heli, [0,0,0], "_______", true]; //pos codriver dir?

_helirtt setPiPEffect [0];

addMissionEventHandler ["Draw3D", {
    _thisArgs params ["_heli"];
    private _dir = (_heli selectionPosition "_______") vectorFromTo (_heli selectionPosition "_______");
    _cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]];
}, [_heli]];

Can someone help me fill in the blanks? I want this to work for a MH-60L DAP (2 Stores)

winter rose
#

I am highly bothered that you used 8 underscores for the first gap and 7 for the others

tough abyss
#

anyone got a script or mod that allows you to import/export cargo containers like the arsenal

winter rose
tough abyss
#

in zeus and shit

winter rose
#

I don't do 'shit' 😬

tough abyss
#

what about zeus

winter rose
tough abyss
#

was trying to get a persistent save thing set up but they all have armaholic links so importing/exporting crates was the next best thing lol

winter rose
#

persistence = db or profileNamespace + scripting commands

tough abyss
#

hold on

#

may have found a solution

tired delta
#

hello, its me again. I got another quick qestion. Is it possible to let the server remoteExec another script? Description: I let the server remoteExec a file (remoteExec 2) > in the file there is another remoteExec (this time remoteExec -2) that executes a say3D on an object 4 all clients. But the sound dose not apear. The first file gets called an works. The clinet one dose not. Here is it 4 refrence:
{_bohrer say3D "drill";} remoteExec ["call", -2];

winter rose
#
[_bohrer, "drill"] remoteExec ["say3D"];
```would be the way to do it
#

where is _bohrer defined?

#

@tired delta

tired delta
#

yes

tired delta
#

or how dose it work πŸ˜„

winter rose
#

fixeded

tired delta
#

ahhhh

#

[_bohrer, "drill"] remoteExec ["say3D", -2]; would this also work?

winter rose
#

if you use -2, if the server is a player (player-hosted server), he won't get it

tired delta
#

its didicated

winter rose
#

you are making dedicated server specific code here

tired delta
#

yes

winter rose
#

which is… not cool, but now you know

tired delta
#

thank you so much ❀️

#

oh @winter rose can i put the -2 in it?

winter rose
#

where?

tired delta
#

[_bohrer, "drill"] remoteExec ["say3D", -2];

#

@winter rose but its not working 😦

#

could it be that its a problem that i call it over an remoteexeced file?

winter rose
#

no

#

again,

where is _bohrer defined?

tired delta
#

_bohrer is defined in the file the remoteexec is in

#

like this:

#

_bohrer = "uLife_drillrig24" createVehicle [0,0,0];
[_bohrer, "drill"] remoteExec ["say3D", -2];

#

the object gets set on the right possition

winter rose
#

yeah, this works
now, how are you testing that?

winter rose
tired delta
#

yes πŸ˜„

#

I use an item that calls the this after use:
[player] remoteExec ["life_fnc_bohrer", 2];

#

then the file gets executed by the server and sets evrything (it works fine)
and in the file is the remote exec call

digital torrent
#

how can u write a script that test if the crew of a vehicle is alive and if not to move it out?
basically i know it is really wrong but something like this i guess. cant figure how to select the gunner of the fullcrew list

if (!alive fullcrew [_myvehicle, "gunner",false]) then (moveout ???)
digital torrent
digital torrent
little raptor
#

why do you put things randomly together? meowsweats

digital torrent
#

i never really used the select and from the example on the bistudio, i thought it was like that haha

little raptor
#

plus you don't even pay attention to data types

digital torrent
#

i am putting the code in a vehicle that only have 1 seat, so it though it would work...

little raptor
#

it has nothing to do with "having 1 seat". to get a scripting command to even work you must provide the right data types

little raptor
digital torrent
#

what is nular command?

#

i googled and didnt find it

little raptor
#

having no arguments

#

like variables, numbers, etc.

#

unary means having 1 arg, on its right (like the math "negative" (-1))

#

binary means 2 args, one on left, other on right (like summation: 1 + 2)

#

next you have to understand data types.

#

you can't just randomly put things together

#

e.g. :1 + player doesn't work, and doesn't make sense either (and you shouldn't just guess, you should look at the wiki page for the command to know it)

#

1 is a SCALAR (number); player is an object

#

if you look at wiki there is no syntax of + that can sum a number and an object

digital torrent
#

so like this?

[fullcrew [_myvehicle, "gunner",false]] select 1

fullcrew provide the data list. and the select would the the 1st on the list?

little raptor
#

[] means array

#

{} means code

#

() is just parenthesis and is meaningless

digital torrent
#

so it is good no? i used [] on the whole full crew which is the array?

little raptor
#

then you select 1

#

first of all, array indices start at 0

#

not 1

#

second of all, even if the index was correct (0) you'd be selecting fullcrew [_myvehicle, "gunner",false] again

digital torrent
#

but wont the fullcrew provide the list?

little raptor
#

third of all, like I said, don't guess. read the wiki

little raptor
digital torrent
#

ah

little raptor
#

[[]]

digital torrent
#

ok i see thank you

little raptor
#

[[]]
and to be clear I didn't say do that...

digital torrent
cobalt sorrel
#

What would be the best way to add a delay to this script?

I have a RandomSpawn script I've made which moves clients in X groups to X random spot, that all works fine.
This script is the .init of one of our community framework module, Start_in_Parachute, which starts users on a selected side, to a pre-defined height, in an attached non steerable parachute, without interfering with backpacks.
Both work, but problem is, after the user spawns in, the module moves them to the height, attaches a parachute, then the RandomSpawn script moves them, resulting in them being in the air, without a chute, but at the correctly moved location, while my result is, in the air, with a chute, at the randomly picked location.

Looking for this script to run a second or so after map/briefing screen.
https://pastebin.com/SV0kUCPR

#

Ideally JIP compat.

#

Someone mentioned ```CBA_fnc_waitAndExecute

limber panther
#

Hello, is there anyone familiar with arma dialog creator? I need to import the exported script but i have no idea how

keen trout
#

can someone help me install an holster script

winter rose
keen trout
#

theres no instructions

#

:/

#

can i send the script?

#
waitUntil {currentWeapon player == "" or {primaryWeapon player == "" && handgunWeapon player == ""}};```
#

how do i make this into an addaction for a player

winter rose
#

↓ see configClasses and configProperties ↓

quaint oyster
#

Could someone help me correct the syntax of this?? Trying to generate a list of sound files in a mod, essentially.

(("getText( _x >> 'author' ) isEqualto 'Bohemia Interactive'" configClasses (configfile >> "CfgSounds"))) call BIS_fnc_getCfgSubClasses;```

Another way I tried this below, with no success.

```sqf
("getText( _x >> 'author' ) isEqualto 'Bohemia Interactive'" configClasses (configfile >> "CfgSounds")) apply {configName _x};
copper raven
#

syntax is ok

#

the issue is in filtering

#

does cfgSounds even have author?

quaint oyster
#

i suppose it does not

#

name is a variable however, quite a bit different than author :p

copper raven
#

your best bet is filtering by path of the sound file

quaint oyster
#

That would actually be a really good way of doing it

#

but alas i am unaware of such a mechanic

#

all of the sounds in question that i'm after are in their own sub folder of a mod.

copper raven
#

substring is optional, though you might get unwanted collisions

#

like if you were to look for a3, its better to substring first few letters, and then run in, instead of running in on entire path

quaint oyster
#

going to try to piece something together from this m8, ty

cobalt sorrel
warm iris
#

Heyo, I'm looking for some help. I'm working on a mission at the minute and it requires the ability for when a specific unit with a variable name crosses out of an area the mission ends (area marked with markers on map) any advice would be handy

little raptor
#

that would be very slow to do

#

you'll have to reattach the object

#

attaching is slow

#

you're better off just moving the object every frame yourself

#

ok then

#

do you want it to follow the terrain, or surface?

#

then just do:

_obj setVectorUp [0,0,1];
_c = _obj modelToWorldWorld [0,0,0];
_p = getPosASL _c;
_d = _p vectorDiff _c;

_obj setVariable ["landContactDiff", _d];
_obj attachTo [player, [0,0,0]];
onEachFrame {
  _obj = attachedObjects player select 0;
  _d1 = _obj getVariable ["landContactDiff", [0,0,0]];
  _d2 = getPosATL player select 2;
  _obj attachTo [player, [0,0, -_d2] vectorAdd _d1];
};
#

(not tested)

warm iris
#

I've found the hardest thing of arma is finding what variables I need πŸ˜‚

winter rose
#

hah, try naming them

warm iris
#

I'm good thanks πŸ˜‚

bitter jewel
#

that_thing_there

winter rose
#

_stuff1, _lalala

warm iris
#

Essentially there's 4 scripts I'll need to run on this mission
1: End scenario when either a specific player dies or goes into a marker (Should be easy)
2: A loot system (probably can find a premade one)
3: A random teleport thing (Basically teleports a specific unit somewhere in an area)
4: Civilians walking about and driving about (Enigma's will work for this perfectly)

warm iris
#

Got 2 and 4 done, those were easy premade good enough for what I need. Cant figure out how to end scenario with trigger, tried a tutorial, does nothing.

little raptor
#

to detect when someone/something dies you need a killed event handler

warm iris
#

I did I might've broken something myself πŸ˜‚

cosmic lichen
#

Or use the end mission module.

little raptor
warm iris
#

Got the vast majority done so I'm deserving a break now blobcloseenjoy

warm hedge
#

No

copper raven
#

vestContainer and setObjectTexture maybe? blobdoggoshruggoogly

still forum
#

no

little raptor
#

huh. did you guys know that the for variable can be global? thonk

copper raven
#

yeah

little raptor
#

for "bla" from

copper raven
#

but its still local to the scope

little raptor
#

I thought it was private nootlikethis

copper raven
#

just like this in object init

#

not a local ident, but is local variable

little raptor
#

gotta fix it then πŸ˜…

#

looks like it can be practically anything nootlikethis

#

for "#bla"

#

but you can't do anything with it 🀣 (unless you just don't need it)

copper raven
#

unless you use bytecode πŸ˜„

#

though, i wonder if there is any ident sanitization happening when deserializing it

#

time for a quick test

winter rose
little raptor
#

nope

#

it's not in missionNamespace

copper raven
#

yea it works fine with bytecode

copper raven
#

added some "proper" lexer rules meowsweats

*-/475-*/ = damage player;

systemChat str *-/475-*/;

compiled to

0x0001: <CODE> [main] '{#line 1 "C:\Users\sharp\source\repos\sqfmake\output\idk.s...' [9]
        endstatement
        callnular, player
        callunary, damage
        assignto, *-/475-*/
        endstatement
        getvariable, *-/475-*/
        callunary, str
        callunary, systemchat
        endstatement

and runs fine in game πŸ˜„

still forum
#

┬─┬ γƒŽ( γ‚œ-γ‚œγƒŽ)

#

now emoji please

#

Thats my big gripe with Arma's parser, doesn't support emoji variable names pout_kitty

#

Just needs to be UTF-8

winter rose
#

NO.

copper raven
still forum
#

btw compileScript doesn't support getting .sqfc as parameter

#

thats just a bug derp

tough abyss
#

been trying to set up a laptop to lock targets from going down but idk know what im missing or if what im doing is correct

//What I did 
flag_control_targets addAction ["Disable pop-up", {target_1, target_2, target_3 ["noPop", true, true]}];
// Disable the pop-up functionality by setting "noPop" to true globally
flag_control_targets addAction ["Disable pop-up", {missionNamespace setVariable ["noPop", true, true]}];

Can someone guide me what im missing

little raptor
#

noPop is a global variable

#

it already applies to all objects

#

so you don't need specifics like target1, etc

#

(plus that code is just wrong)

#

to prevent targets from going down just disable simulation for them

#

afaik noPop means the target won't pop up? thonk

tough abyss
#

yeah but I'm trying to make the laptop bring them up and down

little raptor
#

use animations to do that

little raptor
#

the animation you need is called "terc"

tough abyss
#

something like this on wiki?

flag_control_targets addAction ["Reset Targets", {[target_0, target_1, target_2] apply {_x animateSource ["terc", 0]}}];
little raptor
#

yeah

#

actually it's animate

#

not animateSouce

tough abyss
#

how would i be able to disable the animation this way?

little raptor
#

just change the code inside apply to:

[_x, false] remoteExec ["enableSimulationGlobal", 2]
tough abyss
#

ugh im terrible with code lol it wasn't working with the

[_x, false]

so I changed it to

{_x, false}

im still trying to see if it works

winter rose
#

{ } is code
[ ] is array (or "list")

don't mix the two

little raptor
tough abyss
#
flag_control_targets addAction ["Reset Targets", {[target_0, target_1, target_2] apply [_x, false] remoteExec ["enableSimulationGlobal", 2]}];

gave me this error

little raptor
#

I meant replace code inside {}

#
[target_0, target_1, target_2] apply {[_x, false] remoteExec ["enableSimulationGlobal", 2]}
little raptor
#

it prevents them from going down

tough abyss
#
flag_control_targets addAction ["Lock Targets", {[target_0, target_1, target_2] apply {[_x, false] remoteExec ["enableSimulationGlobal", 2]}}];
little raptor
#

yeah

dusk shadow
#

Interesting question about the RemainsCollector: Does it work on inanimate objects like sheds or boxes? How about non-destructibles?
What is the requirement to be considered a "wreck"?

dusky pier
#

Hello!

Last time - in random moment - everybody getting kicked from my server. That happens not so often, but still. Mission is getting restarted globally.
I thought - is cheater doing that again and again, but don't sure about it.

Blocked endmission and failmission in CfgRemoteExec, but that's didn't worked.

Could you help me, please?
What can be a reason of that, and is it possible to somehow track/prevent this problem?

Was trying to track it though battleye filters, but didn't worked too, or i doing something wrong :\

Thank you!

winter rose
little raptor
#

It probably only works on mission objects

limber panther
#

Hello! Can someone help me with a little problem please? I've got this script that works fine:

    private _pos = screenToWorld [0.5, 0.5]; 
    private _board = createVehicle ["Land_Noticeboard_F", [0,0,0], [], 0, "CAN_COLLIDE"]; 
    _board setDir (getDir player - 360); 
    _board setPosATL _pos; 
};

if (side player == west) then {createDialog "znacky"};```
The script spawns a sign and opens a dialog but every time a player executes this, a sign spawns in front of every player on the server and of course it also opens the dialog to everyone. How to edit it, so that the sign spawns only once?
#

To explain it a bit more: With this script the sign spawns in front of all players at the same time when only 1 player executed the script. I need the sign to be visible to everyone on the server (just like the script does) but get spawned only 1 sign in front of the player, who executed the script.

bitter jewel
#

how are your players executing the script

#

is it by trigger

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
limber panther
#

@bitter jewel yes

bitter jewel
#

more precisely, is it an area trigger?

#

if so then you can change player to thisList#0

#

which is just the first unit the game chooses from the trigger area

limber panther
bitter jewel
#

ah

#

ok

limber panther
#

Any idea how to solve it?

bitter jewel
#

yes

#

i need to find it first

#

and it may be ugly

limber panther
#

No problem, as long as it works i'll be happy :D

bitter jewel
#

if i remember correctly there is no way to get the executing player in a radio trigger

#

someone else may correct me if im wrong

#

however

#

you can build your own custom menu actions

#

or command menu actions

#

if you look at the example from LaKing

#
["First", [0], "", -5, [["expression", "player sidechat ""First"" "]], "1", "1"],
#

you can find that row in the second array with the commands

#

in between all that mess there is that "player sidechat ""first"" " -string

#

that code will be executed only by the calling player

#

now the problem is that that whole example will only work once

#

im going through my old script and trying to remember what the hell is it doing

#

it seems i found out that you can overwrite an array and arma will happily update your comm menu accordingly

#

yeah

#

you can forget the showCommandingMenu link

#

just do

  _menu_name = "User menu";
  _focus = true;

  // init it
  BIS_fnc_addCommMenuItem_menu = [[_menu_name, _focus]];

  _rowname = "Teleport";
  _exe = "call fn_menuOne";

  BIS_fnc_addCommMenuItem_menu pushback (call fn_mk_menu_row);
#

and put your script in a function named fn_menuOne

#

there is a caveat in this solution

#

it will overwrite your comm menu

#

meaning if you have vanilla artillery or support modules or something else that uses the comm menu this will overwrite it

#

oh what am i saying

#

this is missing the fn_mk_menu_row

#
fn_mk_menu_row = {
  _cmd_sep = -1;
  _cmd_non = -2;
  _cmd_hid = -3;
  _cmd_bak = -4;
  _cmd_exe = -5;

  _cond_visib = "1";
  _cond_active = "1";
  _key_none = 0;
  _submenu_none = "";


  _key = (count bis_fnc_addcommmenuitem_menu) + 1;
  _submenu = if (isnil "_submenu") then {_submenu_none} else {_submenu};
  _visible = if (isnil "_visible") then {_cond_visib} else {_visible};
  _active = if (isnil "_active") then {_cond_active} else {_active};

  _rownum = _rownum + 1;
  _arr = [_rowname, [_key], _submenu, _cmd_exe, [["expression", _exe]], _visible, _active];
  _arr;
};
#

you need that function before you can run the code i posted above

#

if you dont want to overwrite the comms menu then you can use addaction

#

it is less ugly to implement

#

the players will then execute your script from the scroll wheel menu

torpid quartz
#

so I'm trying to get vehicles pylons to be set to certain things when they respawn using the vehicle respawn module

There's some code on the wiki

private _pylons = PASTEHERE;
private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
{ _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle;
{ _vehicle setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;

I've set it to this, but i'm getting an error saying it expected an object, not an array.
Replacing _this select 1 with O_Heli_Attack_02_dynamicLoadout_F didn't work too ( unidentified variable in expression)

private _pylons = ["PylonRack_1Rnd_Missile_AA_03_F","PylonRack_1Rnd_Missile_AA_03_F","PylonRack_1Rnd_Missile_AA_03_F","PylonRack_1Rnd_Missile_AA_03_F"];
private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _this select 1 >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
{_this select 1 removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _this select 1;
{_this select 1 setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;

Any ideas on how to get this to work?

cosmic lichen
#

_this select 1 in brackets

#

Also

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
cosmic lichen
#

@torpid quartz

torpid quartz
#

@cosmic lichen
getting error zero divisor

#

hang on let me make it _this select 0

#

yup that did it all goo

#

thanks a ton R3vo

cosmic lichen
#

Yw

dusky pier
copper raven
#

that would also fix all the locality issues

copper raven
limber panther
#

@bitter jewel thanks for your time

runic quest
#

Is there any major update to ARMA3 recently?

little raptor
runic quest
#

My script is written in life_server, but it is not possible to CALL in the client, it was possible before

little raptor
#

it probably has nothing to do with Arma updates then

runic quest
#

ok bro

royal siren
#

Hi guys, i have a problem

For exemple " Objective 1 : Kill target1

trigger : when target1 is dead, activate complete objective

Objective 1 : validated

thats how it supposed to be

But when i kill target1, there is like 1 minute before the objective is validated
but in SP, its directly

#

the problem is only in Multiplayer

cosmic lichen
#

How is it set up?

royal siren
dusky pier
#

Hello, is it possible - mission restart itself - because of any script / config / mod error?
Has anyone had this problem, maybe?

astral meadow
#

Is using exitWith the correct way - if a certain condition is met - to print an error message and after that exit the whole script ? If so, please explain how to use it, I don't understand the explenation on the wiki. πŸ˜•

willow hound
#
//Stuff
if (/*Condition*/) exitWith {
  ["Some error message"] call BIS_fnc_error;
};
//Stuff
little raptor
#

I mean not necessarily

#

exitWith exits the current code (scope), not script

astral meadow
little raptor
#

yes:

if (bla) then {
  if (blabla) exitWith {}; //only exits the above 'then'
};
willow hound
little raptor
#

you must name the scope too

astral meadow
#

What I'm trying to do is print an error message and exit the whole script, if a provided parameter in a function is null.

cosmic lichen
little raptor
astral meadow
#

And If not, I guess I'd have to check multiple times to exit one if after another?

little raptor
#
/*
  my_function.sqf
*/
params ["_blabla"];
if (isNil "_blabla") exitWith {};
astral meadow
#

I.e. when using nested ifs

little raptor
#

I still don't understand what you mean

#

(I mean I understand what nested ifs means, but not what you want)

astral meadow
#

I can't really remember what I meant, so I guess just forget about it D:

#

I'll try to get exitWith to work now, thanks for your help πŸ™‚

cosmic lichen
#
if (something) then
{ 
  if (something2) exitWith {};
};```
#

this is what he means

willow hound
astral meadow
# cosmic lichen this is what he means

I think what I meant was if I were to use nested If's and wanted to exit the whole script if a "deeply nested If" was false, I'd have to use exitWith multiple times, to first exit the If's and finally the script, but I guess that's not the case, is it?

little raptor
cosmic lichen
#

ALT + F4 πŸ˜„

little raptor
#
if (_bla && {
  _blabla && {
    _blablabla
  }
}) exitWith {

};
limber panther
#

hi everyone! i've got a weird problem - i wanted to add some custom functions for the self interaction menu. So i've created a script and placed it in the init field of the unit that is supposed to have access to that function. In single player it works fine. On dedicated server it doesn't appear in the self interaction menu at all. However if executed in console, it gets in there. So how to make it so that those functions are available for the player on the dedicated server since he joins the game? Thank you.

myaction = ["sign_spawn","Spawn traffic sign","", {hint "Please select a sign"},{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["notice_board","Notice board","", {_handle = [] execvm "znace\notice_board.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["sign_small","Sign - small","", {_handle = [] execvm "znace\sign_small.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["sign_medium","Sign - medium","", {_handle = [] execvm "znace\sign_medium.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
#
myaction = ["sign_large","Sign - large","", {_handle = [] execvm "znace\sign_large.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["map_board","Map board","", {_handle = [] execvm "znace\map_board.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["billboard_small","Billboard - small","", {_handle = [] execvm "znace\billboard_small.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
myaction = ["billboard_large","Billboard - large","", {_handle = [] execvm "znace\billboard_large.sqf"; },{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "sign_spawn"], myaction] call ace_interact_menu_fnc_addActionToObject;
cosmic lichen
#

add them via initPlayerLocal.sqf

#

check the biki

limber panther
cosmic lichen
#

Add a side check

limber panther
cosmic lichen
#

yes

limber panther
#

by the way i can just paste the script as it is into that sqf with no changes, right?

astral meadow
limber panther
#

@cosmic lichen tested it and it really works, thank you, can i ask one more question?

finite sail
#

is it "when is arma4"?

limber panther
finite sail
#

hehe

cosmic lichen
#

Sure

limber panther
#

@cosmic lichen this is one out of several nearly identical scripts that are supposed to spawn a sign and i would like to give that spawned sign an add action that will make the sign get deleted when necessary, so i've created this but it doesn't work:

if (side group player isEqualTo west) then {  
    private _pos = screenToWorld [0.5, 0.5];  
    private _board = createVehicle ["Land_Billboard_F", [0,0,0], [], 0, "CAN_COLLIDE"];  
    _board setDir (getDir player - 360);  
    _board setPosATL _pos;  
}; 
 
if (side player == west) then {createDialog "znacky"};

_board addAction ["Delete", { params ["_target", "_caller", "_actionId", "_arguments"]; deletevehicle _target; }];

Any idea how to fix it?

cosmic lichen
#

First thing. What happens if side of player's group is NOT west?

limber panther
#

nothing, script does not get executed

#

i mean the sign won't spawn

#

and dialog won't open

cosmic lichen
#

but the action will be assigned to the board that does not exist

limber panther
#

well nothing will be assigned since the board will never be there, also even the action can be under condition to appear there if the player is side west

#

or at least that's how i understand it

cosmic lichen
#

The issue is that you set board to be private inside the if statement

#
if (side group player isEqualTo west) then {  
    private _pos = screenToWorld [0.5, 0.5];  
    private _board = createVehicle ["Land_Billboard_F", [0,0,0], [], 0, "CAN_COLLIDE"];  
    _board setDir (getDir player - 360);  
    _board setPosATL _pos;
    createDialog "znacky";
    _board addAction ["Delete", { params ["_target", "_caller", "_actionId", "_arguments"]; deletevehicle _target; }];
}; ```
limber panther
pale ridge
#
["CAManBase", "AnimChanged",{
  params ["_unit", "_anim"]; 
    if (    _anim == "AsdvPercMsprSnonWnonDf") 
    then {
        [_unit] spawn {
            while { underwater _unit && alive _unit } do {
                if ( getOxygenRemaining _unit < 0.3 ) then {_unit setOxygenRemaining 1};
                _unit globalChat "not drowning";
                    sleep 10;
            };
        };    
    };
}] call CBA_fnc_addClassEventHandler;

if i do this, is it going to spawn multiple same "spawn" on _unit everytime they enter the animation? such that i am going to have the same script running multiple times?

little raptor
proven charm
#

does _man addEventHandler ["FiredMan",{}]; work in dedi if set for player or player's AI?

limber panther
limber panther
little raptor
proven charm
little raptor
#

I don't know why you would want to exec it on server anyway

#

Β―_(ツ)_/Β―

#

too many codes on the server == terrible performance for everyone

proven charm
#

probably true but I need a way to check if group is firing to enemies

little raptor
proven charm
little raptor
#

no

#

maybe it works on dedi

#

Β―_(ツ)_/Β―

proven charm
#

k

#

thx

valid abyss
#

Hello, is there any way to get the name of a specific agent through a foreach loop?

warm hedge
#

What is the array? Contains agents?

valid abyss
#

i got every agent in the scenario and put them into an array with the agents command

warm hedge
#

name agent _x;?

valid abyss
#

tried that

warm hedge
#

And?

#

Not entirely sure what is the context

valid abyss
#

hold on i think i havent tried it, it didnt throw an error this time

#

Ah that fixed it, thank you very much this has been giving me a migraine!

tidal ferry
#

Hey, quick, I need scripting help with something

#

Anyone know what command I should use to have a turret fire continuously for a set amount of time?

#

Unmanned turret

#

Taking me a while to read the Biki to find the right commands, and I'm on a bit of a clock

little raptor
tidal ferry
little raptor
#

yes. unmanned objects cannot fire

#

you can put an invisible AI in them

tidal ferry
#

Hmmm okay

proven charm
#

FiredMan triggers for player in dedi...

tidal ferry
little raptor
#

just fire the projectiles yourself

pale ridge
#
["CAManBase", "AnimChanged",{
  params ["_unit", "_anim"]; 
  _Adrowning =[_unit] spawn {
            params ["_unit"];
            while { underwater _unit && alive _unit } do {
                if ( getOxygenRemaining _unit < 0.3 ) then {_unit setOxygenRemaining 1};
                _unit globalChat "not drowning";
                    sleep 10;
            };
        };
    if (    _anim == "AsdvPercMsprSnonWnonDf") 
    then {    terminate _Adrowning;
    call _Adrowning;
    };
}] call CBA_fnc_addClassEventHandler;

so this should be better right?

little raptor
#

no

pale ridge
#

😦 i also think i have to put the sleep outside do

#

i am getting bullied notlikemeow

#

πŸ™‚

little raptor
# pale ridge ```sqf ["CAManBase", "AnimChanged",{ params ["_unit", "_anim"]; _Adrowning ...
["CAManBase", "AnimChanged",{
    params ["_unit", "_anim"];
    if (_anim == "AsdvPercMsprSnonWnonDf" && {scriptDone (_unit getVariable ["WaterCheckHandle", scriptNull])}) then {
        _handle = [_unit] spawn {
            params ["_unit"];
            while { underwater _unit && alive _unit } do {
                if ( getOxygenRemaining _unit < 0.3 ) then {_unit setOxygenRemaining 1};
                _unit globalChat "not drowning";
                sleep 10;
            };
        };
        _unit setVariable ["WaterCheckHandle", _handle];
    };
    
}] call CBA_fnc_addClassEventHandler;
pale ridge
#

scriptdone be praised

little raptor
#

fixed again meowsweats

#

typing code on discord is hard notlikemeow

pale ridge
#

esp with my code writing

winter rose
#

disappears in a smoke of cloud after his moderation deed

wind hedge
#
 
if (animationState player == "afalpercmstpsnonwnondnon") then {
    private _pos = [];
    _pos = [getPosWorld player, 2, 10, 2, 1, 60, 0] call BIS_fnc_findSafePos;
    if (_pos isNotEqualTo []) then {player setPosATL _pos;} else {
        _pos = [[[position player, 10]],[]] call BIS_fnc_randomPos;
        player setPos _pos;
    };
};
#

I am running that on a 4 second loop in the player units but perhaps "AnimChanged" or other EH is a better solution...

#

The insidious animation is: afalpercmstpsnonwnondnon

little raptor
#

plus I'm pretty sure it returns a 2D pos

#

yep:

_this select [0, 2] breakOut "main";

wind hedge
little raptor
#

AnimStateChanged

#

not animChanged

little raptor
#

why move him?

#

and if you want to move him just use setVehiclePosition

#

it's the engine solution

wind hedge
little raptor
wind hedge
#

I am sure you have experienced players and Ai units getting stuck on that animation too right? It happens to me on every other mission, specially using Steam Downloaded custom compositions...

wind hedge
little raptor
#

it should solve the issue

wind hedge
little raptor
#

Β―_(ツ)_/Β―

wind hedge
#

Also, the animation can happen on rocks and on walls that are turned upside down or on their sides on the ground (many custom compositions do this "for the looks")

wind hedge
little raptor
#

when you turn an object upside down the ROADWAY lod is no longer touching the player's feet

#

it's a rookie mistake

#

soliders need the roadway lod to walk properly

#

without it they'll use the GEOM lod which is too complex

#

and problematic

#

and not just soldiers

#

vehicles too

wind hedge
#

It was funny and also kinda sad, on the last "The Splendid Squad" mission, players got stuck on that animation right at the beginning of the mission

little raptor
wind hedge
little raptor
#

I know. I mean the surface

#

that's the problem in arma too

wind hedge
#

It causes so many issues and weird "glitchy" situations

little raptor
#

which causes misaligned roadway lods

#

it happens with multipart objects too

#

like carriers

wind hedge
#

Exactly... well any solution that "unstucks" the players, be it engine or scripted would've been nice from BI since it can totally break the experience

little raptor
#

well the scripted solution is simple. I might have an idea

wind hedge
#

Not all can afford to have a Zeus master 24/7 to fix these issues

slim spire
#

is there info somewhere listing and explaining the differences between all the weapon holders?

dreamy kestrel
#

Hello, Q: I am trying to model the fire particle example.
https://community.bistudio.com/wiki/Particles_Tutorial#Fire
I want to attach it to a building and appear like it is engulfing the building.
I have the bounding box dimensions of the building, but the fire itself is emitting particles like a 'spot fire'.

little raptor
#

google

little raptor
#

why do you want to attach it?

#

attaching is slow

dreamy kestrel
#

or to a position... point is I want the appearance to be the building engulfed by the licking flames. not just a spot fire.

#

although the effect would be the same regardless of the target object, movable or not.

slim spire
#

I'll try searching in the forums itself but google didn't really yield any results

fair drum
dreamy kestrel
little raptor
#

in visiblity terms I mean

fair drum
#

I remember seeing something on the forums about it's deletion time. Need to try and find it.

dreamy kestrel
#

But you have to really see it animated to appreciate it.

strange seal
#

is there a way to identify the specific player that activates a trigger? I'm using some radio calls with scripts in them to do custom helicopter supports but I'm having trouble porting the script for multiplayer use

cold mica
#

I wrote my first function. It is supposed to draw a line between two markers and color it red/OPFOR, green/INDFOR, or black/Default. In the current implementation, it draws no line between any markers.
SESO_fnc_checkMarkerColor.sqf

params ["_rootMarker","_leafMarker"];

if (markerColor "_rootMarker" == "ColorEAST") then {_this select 0 drawLine [(getMarkerPos "_rootMarker"), (getMarkerPos "_leafMarker"), [1,0,0,1]];};
if (markerColor "_rootMarker" == "ColorGUER") then {_this select 0 drawLine [(getMarkerPos "_rootMarker"), (getMarkerPos "_leafMarker"), [0,1,0,1]];};
if (markerColor "_rootMarker" == "Default") then {_this select 0 drawLine [(getMarkerPos "_rootMarker"), (getMarkerPos "_leafMarker"), [0,0,0,1]];};

Here is how I call it in initPlayerLocal.sqf
initPlayerLocal.sqf

SESO_fnc_checkMarkerColor = loadFile "SESO_fnc_checkMarkerColor.sqf";
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
    ["marker_1","marker_2"] call SESO_fnc_checkMarkerColor;
} ];

Please roast my code. Also, please critique it.

willow hound
#

Except for the params statement, remove all quotes around _rootMarker and _leafMarker.

cold mica
#

Sounds good, testing it now

#

Tested it. There was an error that the input was a String, expected code on the line ["marker_1","marker_2"] call SESO_fnc_checkMarkerColor;

#

So I changed it to [marker_1,marker_2] call SESO_fnc_checkMarkerColor;

#

Error is no longer appearing. Though, no line appears marker 1 and marker 2

willow hound
#

loadFile gives you a string, but call expects code. If you really want to declare your function like that, try SESO_fnc_checkMarkerColor = compile loadFile "SESO_fnc_checkMarkerColor.sqf";.

strange seal
cold mica
#

I don't know what is the best way to call a function. There seems to be multiple ways to do it.

spark sun
#

Array format [variableName, defaultValue, expectedDataTypes, expectedArrayCount]:

variableName: String - name of a private variable (must begin with underscore _, e.g. "_myVar")

spark sun
bitter jewel
cold mica
#

Should I declare my function in description.ext to use it in initPlayerLocal.sqf?

spark sun
#

it is fine the way you did it, just use compile preprocessFileLineNumbers

#

but markerColor "_rootMarker" is wrong you want markerColor _rootMarker

cold mica
spark sun
#

_rootMarker is a variable containing "marker_1"

#

If you quote it, it become a string

cold mica
#

Here is the updated version:
SESO_fnc_checkMarkerColor.sqf

params ["_rootMarker","_leafMarker"];

if (markerColor _rootMarker == "ColorEAST") then {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [1,0,0,1]];};
if (markerColor _rootMarker == "ColorGUER") then {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,1,0,1]];};
if (markerColor _rootMarker == "Default") then {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,0,0,1]];};

initPlayerLocal.sqf

SESO_fnc_checkMarkerColor = preprocessFileLineNumbers "SESO_fnc_checkMarkerColor.sqf";

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
    // TODO Implement checkMarkerColor as a function/macro so you could repeat it for several markers. This also gets around the issue
    // of the function not working within ctrlAddEventHandler
    // King's Men Root
    [marker_1,marker_2] call SESO_fnc_checkMarkerColor;
} ];
willow hound
spark sun
#

compile preprocessFileLineNumber

cold mica
#

This throws no error. Yet, it does not draw the line.

buoyant rock
#

My game isn't loading, It'll let me go into Zeus, but once I try and actually play, it says it failed to load the Character, its also doing that on Multi player Servers. it also says its something to do with a Scripted Event. After I closed out of Arma, now it wont even load with Steam so. Does anyone know how to fix this issue?

willow hound
strange seal
buoyant rock
little raptor
cold mica
#

Best not cross post then. Sometimes, you just have to wait.

cold mica
# spark sun `compile preprocessFileLineNumber`

I wrote the line like this:

SESO_fnc_checkMarkerColor = compile preprocessFileLineNumber "SESO_fnc_checkMarkerColor.sqf";

It throws an error "unidentified variable." I think I wrote this wrong.

willow hound
spark sun
#

preprocessFileLineNumbers

cold mica
bitter jewel
#
lider groupRadio  "SentUnitPosUp"

results in lider saying "on your feet" in the radio. Can this be done so that lider says "2 - on your feet"?

spark sun
cold mica
#

My fault for not catching your mistake in my work.

#

Anyways, your suggestions are in. There are no more errors. There is no line drawn either.

cold mica
#

Maybe it's a logical issue regarding the if-statement. I will put in an else clause.

spark sun
#

it is up to you to provide the correct variable to your fnc now

bitter jewel
little raptor
bitter jewel
#

ok

little raptor
#

you have to use kbTell

#

and make your own conversation

cold mica
#

Is there such thing as ifelse in sqf? Or do I need to do nested else statements?

little raptor
#

no

spark sun
#

put systemChat str marker_1 or others variable to check if everything is defined correctly

cold mica
#

Whoa, there are cases in SQF. I can do that instead.

little raptor
#

or do lazy eval if applicable

cold mica
#

exitWith
lazy eval
That's two articles to read about. I'll try them all out

cold mica
#

Thanks for the links. I didn't mean to trouble you with getting the articles, I was already reading them. notlikemeow

little raptor
cold mica
#

I decided to do use exitWiths.

It looks like this now:
SESO_fnc_checkMarkerColor.sqf

params ["_rootMarker","_leafMarker"];

call {
    if (markerColor _rootMarker == "ColorEAST") exitWith {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [1,0,0,1]];};
    if (markerColor _rootMarker == "ColorGUER") exitWith {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,1,0,1]];};
    if (true)                                   exitWith {_this select 0 drawLine [(getMarkerPos _rootMarker), (getMarkerPos _leafMarker), [0,0,0,1]];};
}
#

The idea is it will color the lines if the marker is EAST or GUER. Otherwise, it leaves it colored black/Default.

willow hound
#

_this select 0 resolves to the same data as your _rootMarker variable. But the left parameter of the drawLine command is not a marker name, it's a map control.

cold mica
little raptor
#

wat?

willow hound
#

What's stopping you from passing the map control to the function? πŸ™‚

cold mica
#

Macros, like the ones you use in config.cpp

little raptor
#

I know what a macro is

#

I mean how do you think that's gonna solve your problem

cold mica
little raptor
#

if (true) exitWith
meowsweats

little raptor
#

if you're using the vanilla map it's already known

little raptor
#

if you want to just draw a line you can use polyline markers

cold mica
#

That's what I'm thinking about now. Would it be any different if I had many markers? I only provided you with one line between marker_1 and marker_2. But I have markers up to 100.

cold mica
#

Read about polylines. The example did not work for my mission.

little raptor
cold mica
#

copying and pasting into the init.sqf

#

Let me try ansin's suggestion before I delve into a completely different framework for this.

little raptor
#

also by "how" I meant what code

cold mica
#
"marker_A" setMarkerShape "polyline";
private _return = [] ;

for "_i" from 0 to 100 step 0.1 do {
    _return pushBack (_i + getPos player#0);
    _return pushBack ((sin (_i*10))*10 + getPos player#1);
} ;

"marker_A" setMarkerPolyline _return;

This is the one provided in https://community.bistudio.com/wiki/setMarkerPolyline

little raptor
#

have you created marker_a?

cold mica
#

oh, for some reason I thought setMarkerShape would also make the marker meowfacepalm

little raptor
#

so it might draw the marker at the bottom left corner of the map for you

#

getPos
πŸ™„

cold mica