#arma3_scripting

1 messages ยท Page 166 of 1

tulip ridge
#

You're missing a semicolon somewhere most likely, post your whole init

obsidian hornet
#

Sorry to clarify i meant that

instead of placing
"hint/message goes here" remoteExec ["Hint", 0] in the script,

hint ["message"] would do

#

but i think the hint ["message"] would just appear locally afik

tulip ridge
#

hint is local, meaning the hint would only be displayed on the machine where it was run

south swan
#

remoteExec'ing stuff in Init? Are you totally sure it's needed there? Init field does get executed on each and every client by default already

obsidian hornet
#

honestly don't know

tulip ridge
#

You don't

#

That would add the action n^2 times

Because the first player would join and run the init, the action would be added to all machines.
The second player would join and run the init, the action would be added to all machines.
Etc. etc.

tender fossil
#

Try this: ```sqf
[
this,
"ACTION GOES HERE",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 2",
"_caller distance _target < 2",
{},
{},
{ "hint goes here" remoteExec ["Hint", 0, true];},
{},
[],
12,
0,
True,
False
] call BIS_fnc_holdActionAdd;

obsidian hornet
#

thank you!

tulip ridge
#

There's a trailing comma there

tender fossil
tender fossil
tulip ridge
#

No

#

You can just run it in an object init

tender fossil
worldly kite
#

hi, i'd like to increase some turret gun's rate of fire

i've found these 2 codes but i'm not sure how to use them

_success = _vehicle setWeaponReloadingTime [gunner vehicle player, currentMuzzle gunner vehicle player, 0.5];

unit addEventHandler ["Fired", {
_this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
}];

i've asked chatGPT but did not worked

tulip ridge
#

i've asked chatGPT but did not worked
A shocker

Don't use ChatGPT, it's never going to give anything that works well, or works at all.

worldly kite
tulip ridge
#

You'd be better off just changing the firerate via config, rather than trying to script it

worldly kite
#

config? i am listening ๐Ÿ“

tulip ridge
#

Config is where you define classes to be used in-game

Config changes would require you to make a mod, rather than being able to do it in a mission though

pallid palm
#

when Dart text's i'm on the edge of my seat ready to learn

#

imo hes the Best

#

others are good , But Dart, woowee hes awsome

tough abyss
#

It's a newer command so it almost certainly has global effects.

#

And it should not require the turret or vehicle to be local.

fringe granite
#

Hey, i have a bunch of mods installed and i would really like to list out all the vehicle names and in what base category they belong to (tank, armour, car etc.). Is there an easy way to do this?

#

and by vehicle names i mean actual vehicles in the game and their classname

#

I found a way to get all vehicles from the cfgVehicles, but categorizing them in a meaningfull way was very dificult

hallow mortar
#

There aren't really any guaranteed properties you can look for to determine what a thing actually is - the game doesn't specifically distinguish between a civilian car, a Humvee, and an APC for example. You can try to hope the Editor subcategory is set to something reasonable, but that's up to the mod maker and not guaranteed. You can go broad and just sort by base class, e.g. TankX, PlaneX etc, but that is broad.

fringe granite
#

ok, thank you very much Nikko

#

I will try to sort them by the editorSubcategory

hallow mortar
#

Oh, don't forget to filter out classes with scope = 0, these are private classes used only for config inheritance purposes and can't be spawned

glossy raft
#

kk

#

ty Mr. @tough abyss

tough abyss
#

now hurry and finish your CBA PR

glossy raft
#

๐Ÿ˜ƒ

tough abyss
#

August

glossy raft
#

I know

#

I'm getting back into things

#

it's on my high priority list

abstract bay
#

where is it located? I dig a lot, I didn't find it

true frigate
#

Is there a way to call BIS_fnc_guiMessage; inside of a mission EH? It seems that when I try, it says that suspending isn't allowed in this context.

It's being called with execVM, but I have a feeling that this won't work with MP anyway.

Full code for anyone interested.

_markerbb = createMarker ["BlueBase", position player];
_markerbb setMarkerType "mil_flag";
_markerbb setMarkerColor "ColorBlue";

addMissionEventHandler ["MapSingleClick", { 
params ["_units", "_pos", "_alt", "_shift"]; 
bbPos = _this select 1;
"BlueBase" setMarkerPos bbPos;
    if (_this select 3) then {
        private _result = ["Place your flag here?", "Training", "Yes", "No"] call BIS_fnc_guiMessage; 
        if (_result) then { 
                _markerbb setMarkerAlpha 0.0;
            };
    };
}];```
warm hedge
#

Try spawn BIS_fnc_guiMessage instead of call it

true frigate
#

I tried doing 0 spawn {private _result = ["Place your flag here?", "Training", "Yes", "No"] call BIS_fnc_guiMessage;}; and it really didn't like that, but for some reason just spawning the function instead seems to work. Thanks ๐Ÿ™‚

warm hedge
#

Not sure how your last pic or sentence is relared to your issue

true frigate
#

Oh sorry, I just thought the error message was funny.

tulip ridge
#

That function returns a script handle, not a bool

warm hedge
#

Well I read your code carefully. You need to wrap it with spawn entirely, including your last if statement etc too

tulip ridge
#

Also doing if (_someBoolean == true) is unnecessary, you can just do if (_someBoolean)

true frigate
#

Man I'm stupid. I was wondering why this _markerbb setMarkerAlpha 0.0; kept breaking. I tried to pass it as a parameter and then realised it takes a marker name.

tulip ridge
#

Most code is run unscheduled, meaning commands like sleep will fail since they require a scheduled environment

fair drum
mental vine
#

Would it be possible to add the zeus lightning strike to a guns init field? i.e. on bullet impact there is a lightning strike?

fair drum
#

either create it a custom way, or use the module lightning bolt function

true frigate
# mental vine Would it be possible to add the zeus lightning strike to a guns init field? i.e....
this addeventhandler ["Fired",   
{ 
 _this spawn 
 { 
  _bullet = _this select 6; 
  _pos = getPosATL _bullet; 
  while {alive _bullet} do {_pos = getPosATL _bullet; sleep 0.01;}; 
  private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", _pos]; 
  [_tempTarget, nil, true] spawn BIS_fnc_moduleLightning; 
 }; 
}];```

It's certainly not the best solution but it's working on my end. Put this in the Unit's init field or execute it through the debug menu
mental badger
#

hi everyone, i have a question how to change a music to sound? i mean in ZEUS you have a object sound where you can play some sound with 3d function. Im using a Zeus Music Mod Generator and how can i change in config from music to sound?

tulip ridge
#

That would create a ton of objects and then never remove them. Just use an event handler on the projectile itself

mental badger
mental vine
tulip ridge
true frigate
#

๐Ÿ™‚

tulip ridge
#

That's a really odd design choice

#

I guess maybe just to delete the module itself?

#

In any case, there's not much reason to run that scheduled. Just add a HitPart event handler and use the bullet itself as the target for the module

true frigate
#

I honestly could not tell you myself, just found it online and thought it'd be really useful. Although, like you say - it's probably to avoid spawning hundreds of objects.

mental vine
#

I tried restricting it to just the gun itself but it didn't seem to wokr

#

ideally once the ammo is used up no more lightning powers.

tulip ridge
#

You can remove the event handler after it's fired

fair drum
#

there is a reason both dart and I recommended hitPart projectile event handler lol

true frigate
#

If you want it used with a certain gun, you can add an if statement to check the weapon, but I'd be lying if I said that wouldn't be horrendously unoptimized. Dart's idea is better here.

tulip ridge
#

A single if statement is not horribly unoptimized

true frigate
#

I assume people are gonna be full autoing it, to be fair lulw

#

Can I ask, doesn't the HitPart EH need to be used on an object that you're shooting at?

mental vine
#

Nah i wanna restrict it to just a mosin nagant or something.

#

Im using cursortarget setdamage 1

tulip ridge
fair drum
true frigate
#

Ah I completely missed that

#

So you take the projectile data from fired, and use it here?

tulip ridge
#

Yeah

true frigate
#

Alright, that's pretty neat

#

Learn something new every day haha

mental vine
tulip ridge
#
this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "", "", "", "", "_projectile"];
    if (_weapon != "TheSpecialWeaponClass") exitWith {};

    _projectile addEventHandler ["HitPart", {
        params ["_projectile"];
        [_projectile, nil, true] spawn BIS_fnc_moduleLightning;
    }];
    _unit removeEventHandler [_thisEvent, _thisEventHandler];
}];
#

Something like that should do the same thing

#

You'd just change "TheSpecialWeaponClass" to the class name that you want to limit it to

fair drum
#

you can also use this on created submunitions as well for things like cluster munitions, explosives (each fragment) etc

#

chaos

true frigate
#

Can you create submunitions from submuntions? eyesshake

fair drum
#

yes you can lol

#

you can make it as deep as you want

true frigate
tulip ridge
#

Yeah you can

true frigate
#

Yeah Punisher use Dart's, it's much better kek

tulip ridge
#

Realized I called the module instead of spawn, fixed that

mental vine
#

Hmm Dart's isn't workign on my end. Im probably doing something wrong

tulip ridge
#

You'll want to change this to whatever unit you want to add it to

true frigate
#

And the weapon classname

tulip ridge
#

Yeah you mentioned wanting to limit to a certain weapon.

If you no longer want that, just remove that whole line

mental vine
#

whoops left out the last bit

#

of the video anyway

tulip ridge
# mental vine

Weapon_ indicates that it's a ground holder for that weapon, not the weapon itself

quiet geyser
#

Trying to set up an object to have multiple hold actions on it, but keep getting a syntax error and can't lock down where it's coming from. See below script:

What am I doing wrong here?

#

Allegedly (according to TypeSQF) I'm missing a ] but I cannot for the life of me see where.

tulip ridge
#

I.e. after [player,"Barklem","male07eng"] call BIS_fnc_setIdentity; }

quiet geyser
#

You're a gun hey, thanks

tulip ridge
# mental vine

You can remove the Weapon_ part from the class name
If it doesn't work after that, start the mission and do:

copyToClipboard (currentWeapon player)

That'll copy the class name of the weapon you're holding to your clipboard

magic dust
#

Im trying to predict rocket projectile trace, the prediction accuracy drops when distance rise, and the accuracy on RPG-42 drops more than MAAWS, what could be wrong?
(red line is [player, 2] call BIS_fnc_traceBullets;, green line is prediction)

the code: ~~https://pastebin.com/W3AYX6nC~~ (too long to post here because i dont have Nitro)
EDIT: the code with Syntax Highlighting: https://pastebin.com/7n4HC2WU

meager granite
#

Hmm, maybe air friction is ignored during thrust or other way around?

#

Probably gonna need some engine insight

#

There is also sideAirFriction, no idea how it works though

#

MAAWS:

["thrust", "thrustTime", "sideAirFriction"] apply {getNumber(configFile >> "CfgAmmo" >> getText(configFile >> "CfgMagazines" >> "MRAWS_HEAT_F" >> "ammo") >> _x)}
``` => `[0.1,0.1,0]`
RPG42:
```sqf
["thrust", "thrustTime", "sideAirFriction"] apply {getNumber(configFile >> "CfgAmmo" >> getText(configFile >> "CfgMagazines" >> "RPG32_F" >> "ammo") >> _x)}
``` => `[500,0.1,0.075]`
#

There are probably some hardcoded intricacies to the way thrust works that aren't accounted in your script

#

0.1s of 0.1 thrust on MAAWS produces tiny deviation, while 0.1s of 500 thrust on RPG42 end up with large deviation

#

Best bet would be nagging the devs to have an insight into the engine to do 1:1

#

Maybe RHS or ACE has it figured out already, try checking there

#
#

Haven't checked how much it differs from your script

#

Also you can figure out exact ammo starting point by spawning the weapon with createSimpleObject and getting muzzle positions from there

#

Do that with some caching and local objects

magic dust
meager granite
#

Maybe there is some old CCIP for the jets/helis there?

magic dust
meager granite
#

@still forum Could you please share the sacred knowledge of how the engine does missile/rocket thrust and what is sideAirFriction and how its different from airFriction?

meager granite
magic dust
meager granite
#

Try making a test addon and play around with thrust, thrustTime and airFriction to see what really happens

#

IIRC air friction is ignored for shotBullet maybe its also ignored here during some engine stages?

south swan
#

bullets do lose the speed while they travel, though

meager granite
#

Maybe its ignored for something else then

#

shells?

#

I don't remember, I just know its ignored for something and could be ignored here as well

tall barn
#

Anyone got any tools or software or etc that they use to create stringtable.xmls?

I would really like to get in contact with you

#

@young current

I have seen some that when you click on them, they open up in microsoft edge.

How do you reconcile that with making it in notepad?

young current
#

what windows is set to open things by default does not mean the files are made there

tall barn
#

thats true yes

young current
tall barn
#

so my understanding of it would be that basically you call a file "stringtable.xml" and fill it with whatever you want inside and thats it?

#

I have the acompanying files, I am only concerned about removing text from a stringtable

young current
#

its just a text file

tall barn
#

ok thank you, I will see what I can do

young current
#

what stringtable you have?

#

why do you edit it

tall barn
#

its an older version and needs an update

young current
little raptor
meager granite
little raptor
meager granite
#

oh, makes sense

#

Should be added to CfgAmmo wiki

little raptor
#

Also for some reason the drag is cubic, not quadratic blobdoggoshruggoogly

broken pivot
#

Guys?

#

Can I just text in what my problem is or how does this work?

little raptor
#

Yes

meager granite
little raptor
#

Not for drag

broken pivot
#

Allright so...

I want to spawn AI in groups with custom cloths.
Thats what I achieved so far:

call{_tgp1 = [getPos ens1, east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup; _tgp1 deleteGroupWhenEmpty true;

{
_x setUnitLoadout [[],[],[],["U_B_GEN_Soldier_F",[["ACE_EarPlugs",1]]],[],[],"H_Beret_gen_F","",[],["","","","","",""]]
}
forEach units _tgp1;
_wp1 = _tgp1 addWaypoint [position twp1 , 0];
_wp2 = _tgp1 addWaypoint [position twp2 , 0];
_wp2 setWayPointType "SAD";
hint "Gegner marschieren auf";}

But they all have the same clothings...

little raptor
meager granite
#

Linear?

#

@magic dust Here's your answer

little raptor
#

Yes

#

Also you need to take into account the mass

#

Thrust is acceleration. The game applies it by mass to make it a force
Then it adds it to drag and gravity. Then it divides by mass to get final acceleration

meager granite
broken pivot
#

I know that this dont work like this. Thats my problem haha
Ive texted with a person and he sent me this:

call{_tgp1 = [getPos ens1, east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup; _tgp1 deleteGroupWhenEmpty true;

(units _tgp1 select 0) setUnitLoadout .... // First Unit
(units _tgp1 select 1) setUnitLoadout .... //Second Unit

_wp1 = _tgp1 addWaypoint [position twp1 , 0];
_wp2 = _tgp1 addWaypoint [position twp2 , 0];
_wp2 setWayPointType "SAD";
hint "Gegner marschieren auf";}

But this wont work. I dont know if Im not able to fill in the blanks or if the code dont work

meager granite
#

What do you want to do anyways?

#

What is "custom clothes"?

#

Random from a list?

broken pivot
#

Yes and No

#

To controle difficutly i would need a few lists than.

So one with easy weapons like pistols and weak armor
and another with Spec Ops or some

#

But if this is possible: Lets fucking do it

meager granite
#

read how this works, if you want to only change something, you need to get loadout first and then set it back after modifications

broken pivot
#

exact

#

Like this:

{
_x setUnitLoadout [[],[],[],["U_B_GEN_Soldier_F",[["ACE_EarPlugs",1]]],[],[],"H_Beret_gen_F","",[],["","","","","",""]]
}
forEach units _tgp1

Just that I dont know how to select a single unit

meager granite
#

You already do, forEach goes through each unit and has them as _x

broken pivot
#

... im not that good

meager granite
#
call {
    _tgp1 = [getPos ens1, east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup; _tgp1 deleteGroupWhenEmpty true;

    {
        private _loadout = getUnitLoadout _x;
        _loadout select 3 set [0, selectRandom ["U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F"]];
        _x setUnitLoadout _loadout;
    } forEach units _tgp1;
    _wp1 = _tgp1 addWaypoint [position twp1 , 0];
    _wp2 = _tgp1 addWaypoint [position twp2 , 0];
    _wp2 setWayPointType "SAD"; 
    hint "Gegner marschieren auf";
};
#

Change classnames to whatever you want

broken pivot
#

Am I allowed to ask like a child?

#

I dont know what call does

#

Is "private" just for local clients or what is the private thing on it?

#

why is there a underline infront of _loadout

meager granite
#

Read through this to get the basics

broken pivot
#

I DIIIIIID

#

The fuck

#

I dont understand

#

Im asking because I need another explanation

meager granite
broken pivot
#

You can see in the screenshot ive sent to you that this is opened in my browser

meager granite
broken pivot
#

I understood Scope haha so it give it his name, right? And everything insight the Brackits is the scope than, right?
Thats why the trigger condition is call{this}, right? I feel so lost

#

(please)

meager granite
#

You will need to figure out the basics yourself, there are official docs as well as lots of tutorial videos explaining it

broken pivot
#

I try since 6 years

meager granite
broken pivot
#

Six

#

Years

#

silence

little raptor
# broken pivot I dont know what call does

"Call" executes a "code". A code is something wrapped in {} (also known as scopes). Without call it won't do anything.
_ behind a var name makes it local to the scope it was first created in. When the scope exits (after }), the variable won't be seen in outer scopes
private forces a variable name to be local to the current scope (it prevents overwriting variable with same name in outer scopes)

broken pivot
#

THAAANKS

#

oh my god Such a good explanation
I think Ive read something like this. Now the puzzle is puzzled

Copy Pasted this into my ArmA Brain folder...

And now I understood that the Brackits define the scopes (i gues a good step)

Am I right that the underline infront and "private" does quite the same?

little raptor
#

Same what?

broken pivot
#

They both define a variable in a local scope {}

little raptor
#

they're both local because of the _ behind them

#

private makes it local to the current scope

magic dust
broken pivot
#

Perfect. So I understood

#

Im back on track now. Lets continue learning

little raptor
# broken pivot They both define a variable in a local scope {}

So say you have something like this:

_myVar = 1;
call {
 _myVar = 2;
};
// Here myVar is 2

It changes myVar to value 2
But:

_myVar = 1;
call {
 private _myVar = 2;
};
// Here myVar is still 1

In other words you can think of private as if it defines a completely new variable in a scope, even if the name is duplicate in an outer scope

broken pivot
#

That was unexpected

#

Thanks for saving my learing haha

#

// [Credits: Sa-Matra]

    private _loadout = getUnitLoadout _x;
    _loadout select 3 set [0, selectRandom ["U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F"]];
    _x setUnitLoadout _loadout;

this isnt clear to me at all

#

What is unit _x?

little raptor
#

So SaMatra wrote forEach units _grp. Units _grp returns an array of units (soldiers) belonging to said group
So _x is each one of those soldiers

broken pivot
#

private _loadout = getUnitLoadout _x;
Here he does a local variable with "private" that only is defined in the current scope {}

Than he gives it the Value _x

Am I right so far?

little raptor
#

He gives it the loadout of _x (so the var _loadout contains the loadout)

#

getUnitLoadout _x means get loadout of _x

broken pivot
#

But who is _x?

little raptor
#

Current item in loop

faint burrow
#

In a collection.

broken pivot
#

Danke รคh thanks

#

Is it normal to feel stupid as fuck?

broken pivot
#

Ouuuuuuu ahhhhhh. Some are defined by engine

still forum
little raptor
broken pivot
meager granite
#

Unit is first created as predefined one in CfgGroups, then you modify it through script

broken pivot
#

through what script? I feel like the zero and your the one haha please excuse my not knowledge

open hollow
junior moat
#

hey i have the following code ran in initServer.sqf but i keep getting the issue of _sectorOwner not defined. any help?

{
    _sectorOwner = nearestObject [getMarkerPos _x, "PortableFlagPole_01_F"] getVariable "OwnedBy";
    _x setMarkerColor format ["color%1", _sectorOwner];
} forEach _sectorPoints;
faint burrow
#

That means either nearestObject returns null or getVariable returns nil.

junior moat
#

oh interesting, strange.

junior moat
#

this is all the code in the document:

/*
init locations 
*/

_allMarkers = allMapMarkers;
_sectorPoints = _allMarkers select {markerShape _x == "ELLIPSE"};
_Flagpoles = nearestObjects [[worldSize / 2, worldSize / 2], ["PortableFlagPole_01_F"], worldSize, false];

{
    _x setVariable ["OwnedBy", resistance];
} forEach _Flagpoles;

{
    _sectorOwner = nearestObject [getMarkerPos _x, "PortableFlagPole_01_F"];
    hint str(_sectorOwner);
    _x setMarkerColor format ["color%1", _sectorOwner];
} forEach _sectorPoints;
faint burrow
#

Try using parentheses.

#

Or use variables.

tulip ridge
junior moat
hallow mortar
#

It isn't a strict requirement, it will work without it, but prefixes reduce the chances of variables getting overwritten by other mods and scripts using the same name

faint burrow
junior moat
tulip ridge
#

Variables saved to an object's namespace are still global variables

hallow mortar
#

Well, it's less likely that another mod will be doing that with an object specific to your script, but it can still happen.

junior moat
#

Fair enough, ill add a tag to it ๐Ÿ‘

junior moat
#

yea im gonna need more help with this. im completely lost on why it wont get the values from the variables despite the variables being 100% absolutely having the correct values

#
/*
init locations 
*/

_allMarkers = allMapMarkers;
_sectorPoints = _allMarkers select {markerShape _x == "ELLIPSE"};
_Flagpoles = nearestObjects [[worldSize / 2, worldSize / 2], ["PortableFlagPole_01_F"], worldSize, false];

{
    _x setVariable ["SPD_OwnedBy", resistance];
} forEach _Flagpoles;

{
    _sectorOwner = (nearestObject [getMarkerPos _x, "PortableFlagPole_01_F"]) getVariable "SPD_OwnedBy";
    _x setMarkerColor format ["color%1", _sectorOwner];
} forEach _sectorPoints;
#

heres all the code as of right now.

#

im lost. no clue why it wont work in the slightest

#

been trying to figure it out for hours now :(

#

heres proof that the variable exists and has a value

#

its just strange to me how the camp rogain marker is being coloured fine but the rest arent??

stable dune
junior moat
#

fffffffffffuck i missed that on the wiki

stable dune
junior moat
#

welp, ima use nearestObjects and sort by distance then

granite sky
#

Couldn't you place the marker more accurately? :P

#

I guess the markers are dual-purpose.

faint burrow
#

Store marker names in flagpoles, then:

{
    _marker = _x getVariable "SPD_Marker";
    _sectorOwner = _x getVariable "SPD_OwnedBy";

    _marker setMarkerColor (format ["color%1", _sectorOwner]);
} forEach _Flagpoles;
junior moat
open fractal
#

forgive me if this is a silly question, but why does this execVM work in debug console but not a trigger? systemChat goes through and running that same execVM line in debug also works, but the script does not run from the trigger

warm hedge
#

This code won't run from Debug Console either. You miss a ;

open fractal
#

ahh

#

too much python

#

thank you ๐Ÿ‘

graceful stone
faint burrow
#

No, they're global. The 3rd param can be used to make them public.

sullen sigil
#

Public = network broadcast
Global = readable from anywhere on the client during the session (basically)

remote cobalt
#

Hey folks, I need help understanding Namespaces better. I know, I read the Wiki but I still have a question:

If I set a Variable in a namespace for example

houseObjekt setNameSpace ["_adress","Funny Street 23"];

Can I call this variable from any other namespace and machine in MP by:

_houseAdress = houseObjekt getVariable "_adress";

Is this how it works, or would I have to make the variable public when I set it?

proven charm
sharp grotto
remote cobalt
tulip ridge
#

Correct, it's just the name of the variable

#

"Public" also implies that the variable is synced across the network, so that all machines get the variable updated

remote cobalt
#

Okay, but if I would not use the public parameter could I still get the Variable with getVariable when I know the namespace?

//On Server
houseObject setVariable ["Adress","Funny Street 1"];

//On Client
_houseAdress = houseObjekt getVariable "Adress";
tulip ridge
#

No, because the value would be undefined on the client

remote cobalt
# tulip ridge No, because the value would be undefined on the client

Okay, got it. Sorry for when I seem fussy, but I really want to know for sure.

Another example:

//On Server
houseObject_1 setVariable ["Adress","Funny Street 1",true];

houseObject_2 setVariable ["Adress","Funny Street 2",true];

//On Client
_houseAdress = houseObjekt_1 getVariable "Adress";

This would give me "Funny Street 1" and it wouldn't overwrite even if the variable is the same name?

tulip ridge
#

No, it would be Funny Street 2, because you updated the variable and synced it across the network

remote cobalt
#

Damn

tulip ridge
#

I misread, those are different objects

#

Yes that would give you Funny Street 1

remote cobalt
#

Okay, that is great. So I can use Namespaces to attach Variables to objects and they can use the same variableNames.

thin fox
#

setVariable and getVariable are my new friends

remote cobalt
remote cobalt
tulip ridge
#

You can also only update a variable on a certain machine, but that's not as useful for most people

For example:

missionNamespace setVariable ["TAG_someVar", 1, 2];

Would only update the variable on the server

tulip ridge
remote cobalt
tulip ridge
#
_obj getVariable "TAG_someVar"; // returns value if defined 
deleteVehicle _obj;

_obj getVariable "TAG_someVar"; // returns nil
_obj getVariable ["TAG_someVar", false]; // returns false, since variable is undefined
sharp grotto
tulip ridge
#

He's referring to specifically objects

remote cobalt
junior moat
#

hey so, i see in some missions like Liberation and Antistasi that they use the task framework to use as kind of like a notification at the top middle of the screen. do they do this by creating a single task and just changing the title, description icon etc or is a new task created every time a notification pops up?

remote cobalt
#

@tulip ridge @sharp grotto Thank you guys, that was really helpful and clarified a lot for me.

tulip ridge
#

Yeah no problem

junior moat
#

got it

#

thanks o7

broken pivot
#

I dont get this anymore

{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
} forEach _GRUPPE;

Why doesent this work...

He says something is missing between "forEach" and "_GRUPPE"
If anyone wanna look at it I would be happy...

broken pivot
#

Im into

tulip ridge
#

forEach doesn't work with groups

hallow mortar
#

That would cause a "type group expected array", not a "missing x" error, though

#

I've got a feeling there's something missing from the previous line (a ;, for example) and this is just where it's getting picked up

broken pivot
# hallow mortar I've got a feeling there's something missing from the previous line (a `;`, for ...

Thats the whole code:

call{
_GRUPPE = createGroup independend;
_SPAWNPUNKT = [5555.778, 440.678, 0];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
(units _GRUPPE select 0)
setUnitLoadout [["arifle_AKS_F","","","",["30Rnd_545x39_Mag_F",30],[],""],[],[],["U_OrestesBody",[["ACE_EarPlugs",1],["30Rnd_545x39_Mag_F",2,30]]],[],[],"","G_Sport_Red",[],["","","","","",""]];
(units _GRUPPE select 1)
setUnitLoadout [[],[],["hgun_Pistol_heavy_02_F","muzzle_snds_L","acc_flashlight_pistol","optic_Yorris",["6Rnd_45ACP_Cylinder",6],[],""],["U_BG_Guerilla3_1",[["ACE_EarPlugs",1],["6Rnd_45ACP_Cylinder",3,6]]],[],[],"","G_Respirator_white_F",[],["","","","","",""]];
(units _GRUPPE select 2)
setUnitLoadout [["srifle_DMR_06_hunter_F","","","optic_MRCO",["10Rnd_Mk14_762x51_Mag",10],[],""],[],[],["U_O_R_Gorka_01_brown_F",[["ACE_EarPlugs",1],["10Rnd_Mk14_762x51_Mag",3,10]]],[],[],"","G_Tactical_Clear",[],["","","","","",""]];
(units _GRUPPE select 3)
setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",17],[],""],["U_I_E_Uniform_01_tanktop_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"","G_Bandanna_oli",[],["","","","","",""]];

{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
} forEach unit _GRUPPE;

_WEGPUNKT = [5501.956, 544.822, 0];
forEach unit _GRUPPE;
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];
_WEGPUNKT setWayPointType "SAD";}

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

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

units _GRUPPE, not unit _GRUPPE

warm hedge
#

independend
what

hallow mortar
#

Exact spelling is important, the computer is not a human and will not figure out what you actually meant

broken pivot
#

He decided not to forgive me... nothing changed

warm hedge
#

What decided not to forgive what and what was not changed

broken pivot
#

The misstake with unit and units

#

It changed nothing at all

warm hedge
#

independent not independend

thin fox
broken pivot
#

I couldnt try at all cause this other error

#

So what to do now? I have no idea

thin fox
broken pivot
#

what is rpt?

broken pivot
#

coming4U

#

there it is haha

warm hedge
#

The RPT is flooded with an error that is unrelated with the code you posted

broken pivot
#

I saw

#

Its the intro cam fucking my ear

#

So why ive sent this to you?

#

Ouuuu I think I shall switch language to english for you ...

warm hedge
#

It doesn't matter

remote cobalt
# broken pivot So why ive sent this to you?

So we could see the Error that is happening in the code you sent us.

Sadly, the logfile is flodded with other errors unrelated to the code you posted.

This means you have a lot of errors happening long before the code you posted is executed.

I would suggest looking into the log file and trying to figure out the Errors happening before and then continue with the unit spawn.

broken pivot
#

Im into fixing

#

Its an Intro Cam Template with 3 Cam Shots. I wanted more and got fucked

broken pivot
warm hedge
#

Fix your issue one by one

#

Not everything at once

broken pivot
#

Thank you really

#

This is a big mistake a do from time to time

#

removed it

#

creates error in a not existing file

odd kite
#

hey guys im making a wasteland server for me and my buddies to enjoy, ive chosen tanoa as my map and using GTX servers as they offer a wasteland server already setup ready to change to my liking. my problem is i have very heavy fog in the server and cant find a way to change it. usually there would be a "setviewdistance" but on these servers theres no such thing as far as i can see

jade acorn
#

you're paying GTX for their servers so you should ask them tbh

broken pivot
#

Please explain my failure:

{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
}
forEach units _GRUPPE;

Im close to bang my head into the wall

tulip ridge
#

Well what error are you getting

broken pivot
#

Missing sign Line 28 ";"

#

Line 28 is that one:

forEach units _GRUPPE;

tulip ridge
#

I don't remember if having a forEach (or similar command) on a new line causes an error, I assume it would

warm hedge
#

It won't

#

Line break/space won't really do anything with compiler

broken pivot
tulip ridge
#

That was to my question

warm hedge
#

I am not referencing to your point, Dart's

meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
tulip ridge
warm hedge
#

Your issue is skipping the basic things and trying to fix your entire project in the same time

broken pivot
#

Here it is:

{
_GRUPPE = createGroup independent;
_SPAWNPUNKT = [5555.778, 440.678, 0];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
(units _GRUPPE select 0)
setUnitLoadout [["arifle_AKS_F","","","",["30Rnd_545x39_Mag_F",30],[],""],[],[],["U_OrestesBody",[["ACE_EarPlugs",1],["30Rnd_545x39_Mag_F",2,30]]],[],[],"","G_Sport_Red",[],["","","","","",""]];
(units _GRUPPE select 1)
setUnitLoadout [[],[],["hgun_Pistol_heavy_02_F","muzzle_snds_L","acc_flashlight_pistol","optic_Yorris",["6Rnd_45ACP_Cylinder",6],[],""],["U_BG_Guerilla3_1",[["ACE_EarPlugs",1],["6Rnd_45ACP_Cylinder",3,6]]],[],[],"","G_Respirator_white_F",[],["","","","","",""]];
(units _GRUPPE select 2)
setUnitLoadout [["srifle_DMR_06_hunter_F","","","optic_MRCO",["10Rnd_Mk14_762x51_Mag",10],[],""],[],[],["U_O_R_Gorka_01_brown_F",[["ACE_EarPlugs",1],["10Rnd_Mk14_762x51_Mag",3,10]]],[],[],"","G_Tactical_Clear",[],["","","","","",""]];
(units _GRUPPE select 3)
setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",17],[],""],["U_I_E_Uniform_01_tanktop_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"","G_Bandanna_oli",[],["","","","","",""]];

{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
}
forEach units _GRUPPE;

_WEGPUNKT = [5501.956, 544.822, 0];
forEach units _GRUPPE;
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];
_WEGPUNKT setWayPointType "SAD";}

south swan
tulip ridge
#

Your error is from the second forEach units _GRUPPE;

#

forEach expects code on the left, but you gave it nothing
It's likely a copy/paste mistake if I had to guess

broken pivot
#

What you wanted to say?

warm hedge
#

wot = what

south swan
broken pivot
#

Bro Im a beginner HELP MEEEE

#

Dont lough at me. HELP ME

#

Explain me. Educate me. PLEASE

warm hedge
#

Then take a rest

broken pivot
#

wot

tulip ridge
# broken pivot Explain me. Educate me. PLEASE

I told you what was wrong

Your error is from the second forEach units _GRUPPE;
forEach expects code on the left, but you gave it nothing
It's likely a copy/paste mistake if I had to guess

#

You can just delete the second forEach units _GRUPPE;

broken pivot
#

Cause their allready selected by the first (?)

warm hedge
#

I don't really know how you've done your code, but it doesn't make sense to start from that amount of code without having much clue. Take a rest, forget the idea and start from the small step first

broken pivot
#

Of course I do

warm hedge
#

No thanks

broken pivot
#

Bro Ive 9 Days left. Theres a Deadline

#

But thats not the point

#

Im here for solutions

broken pivot
warm hedge
#

My point is already told

broken pivot
#

I dont wanna anger you but if you dont wanna help me. Please stop sending new msg in who pushs the topic away. You dont need to.

tulip ridge
#

And gift 400โ‚ฌ Ill get for the Mission

It's not a gift if you're giving something in return, and that's also (legally) a transaction

#

So you have legal issues there

broken pivot
#

loosing faith in humanity

tulip ridge
#

I have told you what is wrong twice now

#

If you're not going to read it twice, a third time isn't going to help

broken pivot
broken pivot
#

And now anwser my question to this @warm hedge I gues you wanna help if you text again

Why?

warm hedge
#

?

broken pivot
#

Why can I remove it. What was my mistake. What is the learning I can take from it

warm hedge
#

Because that chunk of code does not fit into the syntax that compiler can understand

broken pivot
#

What is a chunk of code?

warm hedge
#
_WEGPUNKT =  [5501.956, 544.822, 0]; 
forEach units _GRUPPE;// this line
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];```
broken pivot
#

So a part of .sqf is a chunk. Are there more characteristics to define and recognize a chunk or is everything a chunk? Wait I think Ive got it
Blablablabla; <- This is an chunk
didididiidi; <- This too

am I right?

crimson lion
#

I think chunk is a colloquialism for a part of your code, not an official term.

broken pivot
#

Thats why Im asking. Thank you very much. I really wanna learn this.

#

So lets go on with your message: @warm hedge

Because that chunk of code [since here all clear]

does not fit into the syntax [Syntax is the form of sequence my command is formed](not 100% sure)

that compiler can understand [I have no clue]

south swan
#

le sigh

#

is this your code?

broken pivot
#

You mean me?

south swan
#

yes, you

south swan
broken pivot
#

Its a the german word for WAYPOINT and defines the kords of the local waypoint "_WAYPOINT"

Than I wanted to add the Waypoint to the units

south swan
#

_WEGPUNKT = [5501.956, 544.822, 0]; this line puts array of 3 numbers into a variable _WEGPUNKT

#

_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0]; this line creates a waypoint and puts it into variable of the same name

#

forEach units _GRUPPE;// this line what does this line do?

broken pivot
#

@warm hedge
Your called <@&105621371547045888> and I wonder if you know for what a "help" Channel is for. Im a newbie I even told. I have questions to everything. I gues you had a well better start. Maybe because there were people not like you who really wanted to help you. If you want pros: Please set conditions on this channel. Otherwhise react never again to my messages if you dont really want to help.
Fine? Yeah? Thanks

broken pivot
#

I wanted to connect it with the next line

_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];

so that a Waypoint will be created forEach units of _GROUP

#

You feel my point? How can I do this?

south swan
broken pivot
#

5.5k hours and I never noticed that if I do a waypoint from a group member it appears from the group leader

ouchhhh

#

So I add the Waypoint to my group and have my solution, right?

broken pivot
#

Like you said haha
With the diffrent: Ive learned why

#

Thank you!!!

#

Thats why Im here. give me your paypal so i can gift you a dollar as sign for my thankfulness haha

tardy osprey
#

I have a question. When scripting chatter that shows up in "side channel" how do i make the text show up with slight delays in between,
So person 1 says some things, and due to the length of the chatter, maybe i need 6 seconds of delay before the next line fires -
And then person 2 replies.

Like typical chatter in any bohemia made mission

broken pivot
tardy osprey
broken pivot
#

Yeah your right ๐Ÿ˜„

#

I really have to say Im no profi. But if I think about I would do it somehow with a If Cause

tardy osprey
#

Hmm so how would that work script wise i wonder. maybe like this? lol

class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
name = "";
sound[] = {"\sounds\hillbilly.ogg", db-10, 1.0};
title = "You are a hillbilly";

sleep 2.5
class RadioMsg2
{
name = "";
sound[] = {"\sounds\huh??.ogg", db-10, 1.0};
title = "Excuse me..?";

    };
};

};

broken pivot
#

Yes but I dont know if Sleeps delay is accepted in decimal

tardy osprey
#

only one way to find out i guess.

broken pivot
#

In germany we call it ZUGRIFF (engage)

tardy osprey
broken pivot
#

Finally ๐Ÿ˜„ Thank you again for the explanation @south swan

broken pivot
hallow mortar
hallow mortar
#

All that config stuff, CfgSounds etc., is meant to go in your mission's description.ext. It creates classes which you then reference with script commands like say3D.

tardy osprey
# hallow mortar All that config stuff, CfgSounds etc., is meant to go in your mission's descript...

That's fair, All i know right now, is how to make the text work along with a soundfile(see example below). It's the "sleep" to then follow up with the next line of text that i'm trying to understand, i'm not quite sure where in the script it will go ๐Ÿค”

class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
name = "";
sound[] = {"\sounds\hillbilly.ogg", db-10, 1.0};
title = "You are a hillbilly";
};
};

#

two seconds, i just spotted that 2nd radio msg in your link

#

didnt see it at first

hallow mortar
#

CfgRadio is a config thing. Your sleep doesn't go anywhere near it.
Config is like a structured database the game can look at to find information. It's parsed during mission loading, and can't be changed. It's not active code.
You will need this CfgRadio to create your radio message classes, but it is not, in itself, the code to play those messages.
Your CfgRadio goes in description.ext, and then your script, which is separate, will refer to those classes by their names.

tardy osprey
#

Does the game then just automatically know when it needs to play the next file?

hallow mortar
#

No, you need to do that in your script.

tardy osprey
#

Okay, i was wondering if i could have a say 4 minute file with voice, and then have the text follow appropriately, or is it more covenient to chop it up, and have each Line be said individually

so it keeps going radiomsg2-3-4-5 etc?

#

because thats where i originally thought if i could use sleep, to then let the game know, hey, i want you to not show the next line of text until the voice file actually is there.

fair drum
#

I like to have a large conversation switch file that you use recursively when needed. BI does this as well for the campaigns.

hallow mortar
#

It doesn't look like CfgRadio supports multi-part subtitles like CfgSounds does, so breaking it up into smaller lines is probably necessary, unless you want to manually script the subtitles.

tardy osprey
# hallow mortar It doesn't look like `CfgRadio` supports multi-part subtitles like `CfgSounds` d...

I see, so if we do the script like this, as shown on the wiki link you sent me.
class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
name = "";
sound[] = { "\sound\filename1.ogg", db - 100, 1.0 };
title = "I am ready for your orders.";
};

class RadioMsg2
{
    name    = "";
    sound[]    = { "\sound\filename2", db - 100, 1.0 }; // .wss implied
    title    = "$STR_RADIO_2";
};

};

Would the radio messages overlap or would radiomsg2 naturally wait for Radiomsg1 to be completed, before firing?

hallow mortar
#

Again, that's not script. It's config. It looks correct, for config, but it does not cause the messages to be played. This is just setting up the classes - resources - which you will then call on with your script, using commands like sideRadio. It's your script that decides how the messages are played. The config classes are separate from each other and don't have any inherent connection.

tardy osprey
#

Well yeah i know its just one half, i dont have the game booted yet.

hallow mortar
#

So you put all that in your description.ext, and then in your script you would do something like this:

_unit1 sideRadio "RadioMsg1";
sleep 5;
_unit2 sideRadio "RadioMsg2";```
Generally things happen at the moment the script command is executed.
The only case where the game overrules your script, in terms of timing, is in cases where a source can only do one thing at a time. Like, with `say3D`, if you use the same unit as a source for multiple sounds, it will wait until that unit finishes playing the first one before doing the next. But that's about _that unit_ only having one mouth, it's not decided by the config stuff. Radio commands _might_ work like this too, you'll have to test, but obviously if you're using different units for each message then it won't matter.
hallow mortar
#

* Don't forget to make sure the unit you use for testing actually has a radio item on it. Not all BI default loadouts have one, and they are required for radio commands to work.

tardy osprey
hallow mortar
#

Sound is played like the object is making the noise, like a speaker or a person talking normally: say3D, playSound3D, CfgSounds
Sound is played like the person is talking on the specified radio channel: sideRadio, groupRadio etc., CfgRadio
Sound is played by magic in your head: playSound, CfgSounds, playSoundUI

broken pivot
#

Are you talking about some or can I post a question to execVM in?

tardy osprey
hallow mortar
#

I don't know much about how BIS_fnc_playVideo handles audio.
It's possible (but I don't know) that when you use the video-on-object-texture method described in example 3 (https://community.bistudio.com/wiki/BIS_fnc_playVideo), then the audio is also associated with the object.
If that isn't the case, then you would have to split the video and audio into separate files, and just play the sound with say3D or playSound3D at the same time as starting the video.

tardy osprey
opal zephyr
#

Does anyone remember the command to export a functions content to the clipboard?

hallow mortar
#

I'd assume copyToClipboard str my_fnc_functionName would do it

#

You can also open functions in the Functions Viewer and see their contents, provided they're CfgFunctions registered

opal zephyr
#

That works, I thought there was a dedicated command for it though. Either way, thanks

fast igloo
#

anyone know how i can make an ai unit do a bombing run, trying to make a ww2 scenario where the bomber plane comes in and bombs a German base and flies away.

junior moat
#

hey! anyone know why this doesnt work? ๐Ÿ˜…

_captureText = parseText "<t size='2.0'>A zone has been captured!</t>";
[west, ["captureNotification",""], ["",_captureText,""], [0,0,0], "CREATED"] call BIS_fnc_taskCreate;
stable dune
#

What it says, nothing or wrong format?

untold copper
little raptor
junior moat
hallow mortar
#

I'm pretty sure doing str on structured text is the same as not having made it structured text in the first place, which is pointless

next gust
#

what could be a reason for a vehicle not showing up in zeus, but in the editor. It has scopeCurator= 2 ;

hallow mortar
little raptor
#

Or the addon not being added to curator addons

next gust
#

ye it had a slightly differnt name in the units[], thanks!

#

follow up question: the units[] only need new Items/Vehicles what ever, right?

junior moat
abstract bay
graceful dew
#

I have a fired event handler that calls my script. As fps drops fire rate decreases which affects what my script does. Is there anyway to calculate maximum fire rate based on fps?

untold copper
graceful dew
#
params ["_unit"];

private _phase = (_unit animationSourcePhase "muzzle_flash");
if (_phase == 0 || _phase == 3 ) then
{
    if (_phase == 3) then
    {
        _unit animateSource ["muzzle_flash", 0, true];
    };
    _unit animateSource ["muzzle_flash", 1];
};

if (_phase == 1) then
{
    _unit animateSource ["muzzle_flash", 2];
};

if (_phase == 2) then
{
    _unit animateSource ["muzzle_flash", 3];
};

Essentially, a three barreled turret where muzzle flashes are individually animated

tulip ridge
#

If your code is only supposed to run on X type of ammo, then that should be the first bit of code in your function

flint topaz
#

Maths is cheap, loops/heavy repetition is expensive

hallow mortar
# graceful dew I have a fired event handler that calls my script. As fps drops fire rate decrea...

You can use diag_fps to find the current frame rate. Then it's reasonably simple maths to work out the theoretical maximum rate of fire based on that. (FPS x 60 = maximum RPM). You can also compare that to the weapon's mechanical rate of fire by looking it up in the firemode config. (To save performance, try to look this up once per weapon, not every event, and store it somewhere for quick retrieval - or if you know you're only dealing with one firemode for one weapon, manually look it up and then hardcode the number)

warm hedge
#

I'd say RPM that depends on the FPS is not a normal behavior so I'll tackle it

#

Not by making EHs

exotic gyro
#

This sounds like a better spot for a model cfg solution

odd kite
#

im starting a wasteland server for me and my buddies to enjoy and have just got it running but i have a problem with visibility, the fog on the server is so extreme and i cant work out how to change it. usually you would just go to arma3.config and set the script but it seems wasteland overrides that file. does anyone have an idea of how to do it? the server does have CHVD but im not sure how to go about changing that

exotic gyro
#

Does this weapon have a variable ammo count, or a set one?

exotic gyro
#

(ie, does it have more than one count of belts)

odd kite
#

yeah sure is

warm hedge
exotic gyro
#

This person is trying to solve it with scripting

tulip ridge
exotic gyro
#

I think model cfg would be better

warm hedge
#

Okay, it seemed the context was jumped enough

exotic gyro
#

I am a silly woman, you see

#

Uhhhh @graceful dew

warm hedge
#

Nobody is sane here, so don't worry

exotic gyro
#

there we go now they know I'm talking to them

warm hedge
#

Anyways. Having that kind of EH won't restore the RPM. It still is unknown why FPS can affect that much

hallow mortar
warm hedge
#

That kinda makes sense

untold copper
# odd kite yeah sure is

Arghahahaha! I knew it.
I've played many different missions across servers on Tanoa and had encounters with the fog every time.
It's not a mission or server setting. It is the terrain.
I'm afraid I don't have a solution. setFog on the server seemed to reset after a few minutes, back to the mysterious fog.

odd kite
untold copper
odd kite
#

okay i will give it a go! where would you reccomend i put that in?

untold copper
odd kite
pallid palm
#

lol

#

@odd kite

graceful dew
#

ideally you could have selectionFireAnim[] if memoryPointGun[] is used but I guess its too limited of a use case

flint topaz
tulip ridge
#

All code is just loops

flint topaz
#

All code is a set of instructions typically followed in a structured way, unless you go for the joke languages that break that idea and do things in random order

tulip ridge
#

Yeah it's just a loop that only runs once

#

Also if it wasn't obvious, it was just sarcasm

broken pivot
#

Anyone there?

#

I want to create a smoke Module by command

old owl
#

Is there any easier way of deferring whether an item is clothing, a weapon, an item, etc then by utilizing it's config? By the looks isKindOf supports "Weapon" but couldn't find if there way anything for anything else like clothing or anything like that.

#

I returned all the parents of cfgVehicles but there was a crap load of stuff and honestly couldn't find much to hint to clothing.

warm hedge
#

type or iteminfo config

old owl
tulip ridge
old owl
#

Hi!

I have pasted my SQF code and a rough depiction of the config I am working with but right now I am struggling with indexing a config for a value while also keeping what I am doing optimized. Given how many nested forEach I have, certainly there is a better way to do what I am doing. I did define a scopeName and used a breakTo to prevent it from continuing to iterate when a value is found. That obviously significantly increased performance with the screenshots I've got below.

Essentially I am just looking to find a a class name that is equal to what I am looking for while also being able to do a getNumber to get it's value. Apologies if I am butchering my terminology there as I do not typically deal with configs.

Would anyone have any suggestions of how I could speed this up and remove the nested forEach garbage I am currently doing :)?

scopeName "main";
private _return = 0;
{
    {
        {
            if (_this isEqualTo configName _x) then {
                _ret = getNumber (_x >> "value");
                breakTo "main";
            };
        } forEach configProperties [_x];
    } forEach configProperties [_x];
} forEach configProperties [missionConfigFile >> "CfgStuff"];

(_return)
class CfgStuff {
  class BLUFOR {
    class Backpack {
      class B_Kitbag_tan {
    value = 100;
      };
      class B_Kitbag_mcamo {
    value = 50;
      };
    };
  };
  class OPFOR {
   class Helmet {
...
old owl
#

Okay got BIS_fnc_codePerformance to 0.07 now by replacing the inner most forEach with a findIf but still feels gross haha

little raptor
little raptor
old owl
#

Haha was just trying to see if I could fix that myself- didn't wanna bother you before I tried first :D

#

I can tell difference is gonna be huge already though. Did not know about isClass that is great ๐Ÿ™‚

little raptor
#

Anyway, if you want the best performance just cache the config into a hashmap (you have to read everything in your cfgStuff once tho)

old owl
# little raptor Anyway, if you want the best performance just cache the config into a hashmap (y...

I think I am gonna give a shot at adding an extra loop just because I am curious the performance increase but you are probably right about the hashmap. I would really only be using it with one thing but it is gonna be running semi-frequently on server so probably just makes sense I just create it on init or something.

I'll modify the current example you sent though and send the performance resulst though in-case you are interested :)

little raptor
#

Well if you do it right hashmap will be miles faster, but sure, feel free to ping me with your results ๐Ÿ˜…

broken pivot
#

Hey people. Im into adding modules by script and I need help.
Ive found this on Wiki:

_moduleGroup = createGroup sideLogic;
"ModuleSmokeWhite_F" createUnit [
getPosATL player,
_moduleGroup,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];

I do fully understand whats happening. Until _disableAutoActivation, false, true];"
I mean I can read that its task is to activate the module. But I dont know how I could create something like this by my own. Like to configurate the smokes density. All I can find to a topic like this, was this: https://community.bistudio.com/wiki/BIS_fnc_initModules

Can maybe someone help me with that?

odd kite
#

is there a way to remove weapon sway in the PBO files?

warm hedge
#

Do you mean via a Mod?

odd kite
#

so im setting up a wasteland server and currently the weapon sway is just ridiculous. i pulled the mission file from the server and im currently looking for the place to turn sway off but havnt found it yet

warm hedge
#

I am not sure you're saying yes or no

odd kite
#

i would prefer not to have to use a mod to remove it, i know there is a mod called remove sway or fatigue but i was hoping maybe there was a way to do it in the files

warm hedge
#

I recall there is a script command

odd kite
#

do you know where the command would go into? im sure i can probably find the command online but i dunno where to put it

odd kite
#

parameter aimPrecisionSpeedCoef).

i might give this a go, where would i put this script?

warm hedge
#

That's not what I suggested

odd kite
#

oh this one then? player setCustomAimCoef 3;

warm hedge
#

It makes the sway bigger 3 times, but that's the command

odd kite
#

okay so if i set 1 or 0 it should be less then?

#

do you know where i run that command to?

faint burrow
#

This needs to be run where argument is local.

sharp grotto
odd kite
#

oh okay, im running the server through GTX so im still trying to work out where everything is

broken pivot
#

Hey guys, I gues Ive a problem with a variable. Everything works but he says that _dichterRauch is an undefined variable.

Here is the code. I cant get the failure:

// Erstellung der entsprechenden Gruppe
_modulGruppe = createGroup sideLogic;

// Definierung der entsprechenden Art
_dichterRauch = "ModuleEffectsSmoke_F" createUnit [getPosATL player, _modulGruppe, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]"];

// Konfiguration
_dichterRauch setVariable ["effectRadius", 50, true];
_dichterRauch setVariable ["effectIntensity", 5, true];
hint "rauchscript lรคuft";

warm hedge
broken pivot
#

this time Ill try to make you proud. Not like the last one.

warm hedge
#

I'm not here to be proud

broken pivot
#

Ive chosen this Syntax now:

group createUnit [type, position, markers, placement, special]

So I filled in the blanks

_modulGruppe = createGroup sideLogic;
_dichterRauch = sideLogic createUnit ["ModuleEffectsSmoke_F", getPosATL player]

He says I did something wrong with the Syntax. I dont see it.

south swan
#

[type, position, markers, placement, special] is 5 things. ["ModuleEffectsSmoke_F", getPosATL player] is two things blobdoggoshruggoogly

#

none of the 5 are marked as optional, all 5 should be provided

broken pivot
#

So like this:
_dichterRauch = sideLogic createUnit ["ModuleEffectsSmoke_F", getPosATL player, [], 0, "NONE"]

warm hedge
#

Should do

broken pivot
#

Still something is creating issues. Im into reading wiki first.

#

Ok ive read about the Factions and found now out that sideLogic is an own faction for modules and game logics.

The error says something about the group went wrong.
Do I also have to name it? I dont get it...

#

.
//Creating group sideLogic
_modulGruppe = createGroup sideLogic;

// executing createUnit
_dichterRauch = sideLogic createUnit ["ModuleEffectsSmoke_F", getPosATL player, [], 0, "NONE"]

south swan
#

sideLogic isn't a group, though

broken pivot
#

.
Your right. Its a side. Such as BLUFOR.
So im adding the Modul to the side "sideLogic"

But where is the failure

warm hedge
#
_modulGruppe = createGroup sideLogic;
_dichterRauch = sideLogic /*you are not using _modulGruppe here*/ createUnit ["ModuleEffectsSmoke_F", getPosATL player]```
south swan
broken pivot
#

So its the wrong parameter in the syntax... got it

winter rose
#

you have Sides (west/blufor, east/opfor etc)
these Sides have Groups (Alpha 1:1, etc)
you create Units in Groups (David Armstrong, etc)

broken pivot
#

Circle closed

warm hedge
#

You did

broken pivot
#

Ouuu. So if I got you right. I have to use my var "_modulGruppe" because of it contains the command and the factions side.

warm hedge
#

sideLogic is a side. createGroup sideLogic makes a group. sideLogic still is a side, not a group

#

So yes

broken pivot
#

Confusing. But it makes fun. Thank you a lot since now ๐Ÿ˜„

#

Wooooooooooo it worked !!!!!!!

Next step will be the configuration.
But first eating meanwhile I watch Cinematic ...
https://youtu.be/y_SfeLDR3fg

It has to look something like this:

// Konfiguration
_dichterRauch setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_dichterRauch setVariable ["effectRadius", 50, true];
_dichterRauch setVariable ["effectIntensity", 5, true];

dry nexus
#

any command or trick to check if mission is in intro phase or scenario phase?

broken pivot
#

I really dont know. But Ive two questions to the experienced.
//First Question
Ive got the tip in the past to start building missions backwards and finish with the intro. Would the expierenced say that this is sencefull?

//Second Question
I was able to enter a configuration to my smoke (yayy) But I want more than just the effectSize.
So my question will be if there is a list of these: _dichterRauch setVariable ["effectSize", 50, true];
Some like effectIntensity you know?

winter rose
warm hedge
#

...Actually, do we miss that command for these two decades straight?

winter rose
#

. . . noooooo?

#

(yes)

#

hence why no intro was used after ArmA, iirc

warm hedge
#

This game is Ded, for sure

winter rose
#

@still forum : getScenarioStage/getScenarioPhase or something alike, would it be possible? if yes, I tikit it

warm hedge
#

Looks BI is not really good at brainstorm

still forum
#

There is a gamemode "intro", but don't know how thats related to initIntro

winter rose
#

intro, outroWin, outroLo(o)se

broken pivot
still forum
#

Mh eden is creating seperate displays?

Mission runs in DisplayMission, Intro in Intro, Outro in Outro
When they are different displays, with different IDD's you can probably find them that way

#

RscDisplayMission
RscDisplayIntro
RscDisplayOutro

warm hedge
#
_colorRed = _logic getVariable ["ColorRed",0.5];
_colorGreen = _logic getVariable ["ColorGreen",0.5];
_colorBlue = _logic getVariable ["ColorBlue",0.5];
_colorAlpha = _logic getVariable ["ColorAlpha",0.5];
_timeout = _logic getVariable ["Timeout",0];
_particleLifeTime = _logic getVariable ["ParticleLifeTime",50];
_particleDensity = _logic getVariable ["ParticleDensity",10];
_particleSize = _logic getVariable ["ParticleSize",1];
_particleSpeed = _logic getVariable ["ParticleSpeed",1];
_particleLifting = _logic getVariable ["ParticleLifting",1];
_windEffect = _logic getVariable ["WindEffect",1];
_effectSize = _logic getVariable ["EffectSize",1];
_expansion = _logic getVariable ["Expansion",1];```According to BIS_fnc_moduleEffectsSmoke
winter rose
still forum
#

Don't know, might need the idd

broken pivot
#

Thank you both alot. These are many things to learn. In germany we call it ZUGRIFF (engage)

btw. @still forum I love your work. Thank you for your service to the ArmA Community. Im a fan ๐Ÿ˜„

tidal spire
#

im working on a very simple little thing but i dont know much about scripting,

i just have a VR Area circle grey that turns VR Area circle yellow when standing on it and it gets ordinance fired (repeatable)

i got the trigger all sorted with
the grey circle called targetsafe and the other targetunsafe and a hideobject true and false on activation and deactivation but the targetunsafe is still able to be seen before activating the trigger but when it is activated it works proper

the init of the VR Area circle yellow

this hideObject true;

this setObjectScale 2;

and another thing i couldn't get working is repeatable ordinance, i was using a module synced up to trigger

dry nexus
winter rose
#

yes - are you doing that in a mod?

dry nexus
#

yep, but, regardless, it was something I was curious about, as yesterday I didn't find anything

bold rivet
#

is it possible to just spawn a normal rocket that isnt fired?
private _rpg7 = createSimpleObject ["A3\Weapons_F_Exp\Launchers\RPG7\rocket_rpg7.p3d", position _drone];
_rpg7 attachTo [_drone, [0, 0, 1]];
_rpg7 enableSimulation false;
if i spawn it like that its fired already

winter rose
bold rivet
#

is that possible just in the innit box of the drone?

winter rose
#

you have to use the _rpg7 variable you have here

bold rivet
#

whats the command for it called? _rpg7 animate [""]?

meager granite
#

There is magazine model "\A3\Weapons_F_Exp\Launchers\RPG7\rocket_rpg7_item.p3d" maybe its a better fit

bold rivet
#

oh that worked, thx mate. where do i find these names? i havent found it in config viewer yet. Just put _item behind it?

south swan
#

in "CfgMagazines" >> "RPG7_F" >> "model" (or "modelSpecial"), probably ๐Ÿคทโ€โ™‚๏ธ

bold rivet
#

oh i looked in CfgAmmo

#

maybe that was the problem

bold rivet
#

thx

fast igloo
little raptor
true frigate
#

I want to use addForce to apply a southwards force to the player. From what I understand the input for the force origin is in PositionRelative and to do that I need to either attach an invisible object to the player or somehow get a north facing output to apply the force from.
My question is, should I try and write a script that attaches an invisible helipad to always face north from the player, to get the start position for addForce - which is then deleted
Or is there a way to get a specific bearing around the player in PositionRelative?

true frigate
#

I was reading the alternative syntax the whole time, wasn't I.

winter rose
#

ah, no
it is that

  • force is world value
  • pos is relative value
#

if you apply to [0,0,0] it will be fine anyway ^-^

true frigate
#

Alright, thank you mate FeelsThumbsUpMan

hallow mortar
#

The position for addForce isn't the force origin, it's the point on the object to which the force will be directly applied.
Setting the position to the top of the object doesn't mean the force will come from above, it means the force will move in the vector direction and "hit" the specified position. Like, if you apply sideways force to the back of a car, it will spin.

#

If you do need to convert between relative and world positions or vectors, you don't need to faff around with attaching helipads and stuff. Use commands like worldToModel, modelToWorld, and their vector counterparts

true frigate
#

Thanks for the explanation, I've realised my mistake as I was actually looking at the wrong bloody wiki page aha
I'm now using (getPosASL forceStart) vectorFromTo (getPosASL player)

hallow mortar
#

Also, if you want to always use a given compass direction, you don't necessarily need to do any sort of conversion or directionfinding at all. In world space, X is west-to-east and Y is south-to-north, so if you want to always apply southwards force, you know you just need a negative Y value.

tardy osprey
#

So one of the zeuses in this clan that im in, has this error that repeats itself 5 million times in the log files (not an exaggeration). It says "Warning Message: mpmissions__cur_mp.lsb_terrain_mimban\mission.sqm/Mission/Entities/Item1/Entities/Item5/Entities/Item10/Entities/Item85.type: Vehicle class 3AS_Prop_Baseplate_20_GAR no longer exists"

trying to host this on a dedicated server is whats giving this issue. Any clues?

winter rose
#

missing mods

broken pivot
tardy osprey
# winter rose missing mods

Problem is its pretty hard to find out what mods are missing, because he doesnt have anything that pops up when loading in the mission, saying: "this mod had not been loaded, either enable or force load the mission"

winter rose
#

yep

hallow mortar
#

It's either a missing mod, or the mod was updated to remove the object class (horrible practice but people still do it)

#

Judging by the classname it's a 3AS mod

tardy osprey
hallow mortar
#

I don't know, maybe. It looks like it's part of the mission.sqm, though, so Editor-placed, not something Zeus placed during the course of the mission.

tardy osprey
broken pivot
#

Guys Ive several questions to the picture Ive posted:

Why does the script create the car including the smoke but not the fire?
Ive tested both codes (smoke/fire) separate and both worked. But if I combine them it stops working.

This is my code:

// Erstellung der entsprechenden Gruppe-
_modulGruppe = createGroup sideLogic;

//Autowrack spawnen
_HMMW_Wrack = "Land_Wreck_HMMWV_F" createVehicle [3015.43, 2350.629, 0];

// Definierung der entsprechenden Module
_FeuerAutoBrand = _modulGruppe createUnit ["ModuleEffectsFire_F", [3015.43, 2350.629, 0], [], 0, "NONE"];
_RauchAutoBrand = _modulGruppe createUnit ["ModuleEffectsSmoke_F", [3015.43, 2350.629, 0], [], 0, "NONE"];

// Konfiguration Feuer
_FeuerAutoBrand setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_FeuerAutoBrand setVariable ["effectSize", 5, true];
_FeuerAutoBrand setVariable ["ParticleDensity",50];
_FeuerAutoBrand setVariable ["ParticleLifting",1.5];
_FeuerAutoBrand setVariable ["ParticleLifeTime",100];
_FeuerAutoBrand setVariable ["Expansion",1];

// Konfiguration Rauch
_RauchAutoBrand setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_RauchAutoBrand setVariable ["effectSize", 5, true];
_RauchAutoBrand setVariable ["ParticleDensity",50];
_RauchAutoBrand setVariable ["ParticleLifting",1.5];
_RauchAutoBrand setVariable ["ParticleLifeTime",100];
_RauchAutoBrand setVariable ["Expansion",1];

And how can I fix the problem that smoke and wreck arent in the really same position? Something like noclip that the game agrees to place 2 object in the same position.

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

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

Use "CAN_COLLIDE" instead of "NONE" for createUnit

broken pivot
#

copy

#

Oh wow fixed all issues so i gues the fire had no air to burn ๐Ÿ˜„

tulip ridge
#

Why they deleted them and not just deprecate them, no clue

broken pivot
#

Ive two more questions:

  1. How can I add the rotation kord to the createVehicle position? solved (setDir)
  2. How can I randomize the rotation then? solved (random 360)
tardy osprey
tulip ridge
#

They got plenty of hate for it

tardy osprey
#

it really sucks cause i wanted to make some cool CW missions

broken pivot
#

Why does this not work:

_bumm = "HandGranade" createVehicle getPos player;
_bumm setDamage 100;

I want the granade to explode

thin fox
#

I think this is not the way to spawn it

broken pivot
#

I spawned a SatchelCharge meanwhile. It worked. I gues the faiure is somewhere in the variable
So that "getDamage" couldnt reach the explosive

exotic gyro
#

Granade

#

Spelling class is important

#

also, triggerAmmo

exotic gyro
#

less time at the mirror more time at the dictionary

exotic gyro
broken pivot
#

Now it works ๐Ÿ˜„ oh my god

thin fox
#

you should try it

broken pivot
#

I asked chatgpt after grenade classname ...

thin fox
#

oh ma gad

exotic gyro
#

Like, in general

#

Not even just for Arma

#

Unfortunately, you can't actually just make a computer chat bot think for you

thin fox
broken pivot
#

He said classname: "HandGranade"

exotic gyro
#

That's definitely a thing chat gpt made up to tell you

rapid eagle
exotic gyro
#

Or just, don't use gpt

thin fox
exotic gyro
#

It's a much less useful tool than just, your brain

broken pivot
#

If I do counter +1 +2
Will he do +3 or will he do +1 or +2

exotic gyro
#

Gpt isn't even a good search engine

rapid eagle
exotic gyro
thin fox
#

oh ma ga

rapid eagle
exotic gyro
#

Second part

rapid eagle
#

thatd be your 1/10

exotic gyro
#

It's just worse search engine

#

It's way tf more often than that lmao

rapid eagle
#

yea im not claiming ive got stats lol

#

but you get the point im tryna make

exotic gyro
#

Just don't use it, it's shitty tech propped up by companies trying desperately to eventually be profitable

rapid eagle
#

๐Ÿ‘

broken pivot
#

Is there a way to get a list of all Module Specifications? Like to configurate them?

thin fox
broken pivot
#

For what am I looking there then?

#

I went threw all registers. Am I doing something wrong?

still forum
#

function viewer, not config

thin fox
#

ops

broken pivot
# still forum function viewer, not config

Ive never entered this one. flashbanged

Theres alot of input inside but I cant find ModuleTracers_F
Is there a way to navigate in a more efficent way than searching by alphabet?

#

Typical... everythings there but not what Im looking for haha. Where is ModuleTracer gone?

little raptor
broken pivot
#

Allright lets goo

little raptor
#

What are you trying to do again? Do you want to modify the function?

broken pivot
#

Yeah I want a Intro scene and spawn the modules in and out

#

So I need to modify them into running mission

#

Same with GenericRadio. But there I dont know where to find the Sentence names

ancient kayak
#

Guys do you have experience with say3D?

little raptor
#

Sure why?

ancient kayak
#

I have encountered an anomaly ๐Ÿ˜„ ๐Ÿ˜„ For unknown reasons its not working how its supposed to work. When played from trigger. It fast forward part of audio, like old tape and continues the rest of audio in normal speed.

little raptor
#

It's wss right? What did you use to encode the wss?
Or is it ogg?

ancient kayak
#

It happens in multiple occasions ( we have more characters talking like briefing, AI chit chat in hallways etc)

#

Give me second I will ask friend. But it some times lag, some times it doesnt. Like in 2 cases from 5 test runs it runs smoothly.

#

He says "I used audacity to encode it from mp3 to 48000hz mono ogg"

#

ogg

little raptor
#

You should convert it to wss/wav

winter rose
#

I had that happen to me when using sideRadio with a logic without setIdentity (but the whole sound was fast or slow, not just a part)

ancient kayak
winter rose
#

sideRadio or kbTell though, I don't remember now

#

most likely kbTell now that I think of it

little raptor
#

If it does but you don't like its size, compress it to wss using WavToWss from A3 Tools

ancient kayak
#

We will try it, thank you ๐Ÿ™‚

cunning spire
#

stupid question, if i assign a player unit a variable name and that player respawns, do they keep that variable name tagged?

broken pivot
#

yes

#

beacuse they respawn as the same modell

ancient kayak
#

"wav" doing the same shit ๐Ÿ˜ข @little raptor

little raptor
silent cargo
#

Hi if anyone has a mission file or script for some custom radios theyve added on a server I could see as a reference I would greatly appreciate it

Having a hard time understanding it on the wiki hmmyes

west portal
#
{
    if ((side _x == west) and (_x isKindOf "Car" || _x isKindOf "Tank" || _x isKindOf "Helicopter" || _x isKindOf "Plane")) then 
    {
        _x addEventHandler ["Killed", 
        {
            params ["_unit","_killer"];
            systemChat format ["%1 has been killed by %2.", _unit, _killer];
        }];
    };
}forEach allUnits;

Could anyone explain why this doesn't work? I can't seem to get a killed eventhandler applying to any vehicle on the western side.

hallow mortar
#

allUnits is for units - things with brains - not vehicles.

#

While units and vehicles are sort of the same in some contexts, they aren't completely the same.

#

Try vehicles instead.

west portal
#

I'll test this out

silent cargo
west portal
west portal
placid spear
#

I'm having an issue with ACE CSW. I'm using the RHS m252 as a base, so same rounds and magazines, but loading rounds into the tube isn't working

    class hab_fuze_rhsusf_m252_d: RHS_M252_D {
        displayname = "M252 VT Fuze";
        scopeCurator = 2;
        class ACE_CSW {
            enabled=1;
            proxyWeapon = "habfuze_mortar_81mm_proxy";
            ammoLoadTime = 3;
            ammoUnloadTime = 3;
            desiredAmmo = 1;
            disassembleTurret = "habfuze_M252_Bipod_Bag";
            disassembleWeapon = "habfuze_M252_Gun_Bag";
        };
        class assembleInfo {
            primary = 0;
            base = "";
            assembleTo = "";
            dissasembleTo[] = {"habfuze_M252_Bipod_Bag", "habfuze_M252_Gun_Bag"};
            displayName = "";
        };
        class EventHandlers {
            init = "_this call HAB_FUZE_fnc_init_m252_fuzes"
        };
        class Turrets: Turrets {
            class MainTurret: MainTurret {
                weapons[] = {"habfuze_mortar_81mm"};
                magazines[] = {"rhs_12Rnd_m821_HE", "habfuze_81mm_12Rnd_WP"};
    };
    };
    };
west portal
hallow mortar
#

Standard EHs are attached to specific objects and only fire for events related to those objects.
Mission EHs are attached to the mission as a whole and can fire for events regardless of which objects are involved, as well as for events that don't necessarily involve a specific object.
Standard EH: fire when this object is killed
Mission EH: fire when any object is killed.

#

The idea is that instead of finding all objects of a certain class and adding a Killed EH to them, you add a single mission EntityKilled EH, and filter by class when it fires.
The advantage is that you don't have to make a way to catch newly-created objects and add an EH to them.

tulip ridge
tulip ridge
#

If RHS follows convention, you can use:

magazineLocation = "_target selectionPosition 'usti hlavne'";

That would put it at the end of the barrel

west portal
#
addMissionEventHandler ["EntityKilled", 
{
    params ["_killed", "_killer", "_instigator"];
    if ( (side _killed == west) and (_killed isKindOf "Car" || _killed isKindOf "Tank" || _killed isKindOf "Helicopter" || _killed isKindOf "Plane") ) then 
    {
        var_usdestroy = var_usdestroy + 1;
        hint "friendly destroyed";
    };
}];

So, I've tried switching to addMissionEventHandler, but I can't seem to get it to trigger now. I've tried using the iskindof checks by themselves, and they seem to work. But, it seems like the side check doesn't work. What am I missing?

hallow mortar
#

The side probably changes to civilian once it's dead

#

You could look up the object's config side rather than checking its current side, or try using its faction instead.

west portal
#

gotcha thanks

tulip ridge
#

I can't verify it, but you could simplify those last two checks to check isKindOf "Air"

hallow mortar
#

Btw, you can use the lazy evaluation syntax for and and or, or sequential exitWiths, to reduce the number of checks that have to be made per firing.
Your current version checks all those conditions, even if a broad one is already satisfied, which is inefficient. You could instead check something that eliminates most possibilities first, and then only do the remaining checks on things that pass the first check.

#

Examples:

// other checks are only run when the object is side west
if ((side _killed == west) && { _killed isKindOf "Car" ... }) then { ... };
// same result, different method
if (side _killed != west) exitWith {};
if !(_killed isKindOf "Car") exitWith {};
...```
\* not saying go back to using `side` check, just using what's already there to illustrate the concept
native roost
#

So I've looked everywhere, is there a script I can use on a crate to spawn randomized guns in it for a pvp night with the boys?

tulip ridge
#

You could just put that in an object's init and it'll add some weapons to it

Just put the weapon class names in _weapons and change the count to your liking

native roost
tulip ridge
#

SQF (arma's scripting language) isn't too bad to learn I would say

There are definitely some things that will trip people up, but the overall language isn't super difficult to read

gleaming forge
#

Hey guys, I am having a hard time getting my head around creating a module to turn a script system into an addon.
Currently we have a specialised respawn system set up via script in a mission. The current layout in the mission folder is like below:

MyMission.Altis
โ”œโ”€โ”€ functions
โ”‚   โ”œโ”€โ”€ function1.sqf
โ”‚   โ”œโ”€โ”€ function2.sqf
โ”‚   โ””โ”€โ”€ function3.sqf
โ”œโ”€โ”€ description.ext
โ”œโ”€โ”€ mission.sqm
โ””โ”€โ”€ initPlayerLocal.sqf```

The issue I'm having is figuring out how to convert this into the module format, as we want to be able to share the respawn system as a mod without the hassle of implementing scripts in the mission folder.
Hoping someone may be able to shed some light, or at least tell me I'm a fool and it's actually there in the wiki. (I am brand new to SQF scripting in arma but have my head around config)

Thanks!
fair drum
#

There is a full page on how to make modules on the wiki. If you need to see examples or more in depth tricks and processes, I can help you tomorrow.

#

You can also look at my code in modules enhanced GitHub if you want to look at examples in the meantime. Though I am refactoring for 1.0 soon.

cyan dust
#

Good day. Did anyone face the problem where getUnitLoadout returns empty array [] ? Why?

faint burrow
#

You provided wrong arg I guess.

cyan dust
#

I provided bunch of AI units, check that arg IsKindOf "Man", check that it is not Null and alive.
Still, for some units, usually for several of the same group, getUnitLoadout returns []

meager granite
#

Post code

faint burrow
cyan dust
#

F*ck me ๐Ÿ˜† After adding more logs I found the problem - it happens with AI animals, Dogs, for example. Have no idea why doggies passed the IsKindOf "Man" check though blobdoggoshruggoogly

faint burrow
#

Because Man includes animals.

meager granite
#

Arma'd

cyan dust
#

Anyway, thanks for your response, guys

meager granite
#

Wish there was a quick way to check entity type similar to getEntityInfo, its so useful

faint burrow
#

_object getEntityInfo 0?

meager granite
#

Other simulation kinds too

#

tankx, helicopterrtd, etc.

#

Yes I know its a matter of getText(configOf _x >> "simulation") == "tankx" check and you can even cache it in hashmap by class name but checking such essential entity info could've been a dedicated command

#

And SimpleVM won't work with this many commands

#

_array select {isTank _x} vs _array select {getText(configOf _x >> "simulation") == "tankx"}

#

Guess I'm like 15 years late

tough geode
#

Yeah would be nice. And while we are at it a easy command to check for armed/unarmed for example ^^

bitter palm
#

hello, i will that the ai shoot at an marker with the artillery a simple script to put in the init line

#

an example but it dont work when i put it in the init line

#

opform5 doArtilleryFire [getmarkerpos "opform5_target", "8Rnd_82mm_Mo_shells", 32];

#

this is an script from arma 2 with the game logic arty [M1, getmarkerpos "M1FM1", ["IMMEDIATE", "HE", 0, 30]] call BIS_ARTY_F_ExecuteTemplateMission;

#

is there an example for arma 3

#

i don't always want to add an sqf file but simply pack it into the unit and leave

thin fox
#

make sure that the marker name exists and if doesn't work, maybe the artillery unit has no ammo for some reason or is out of range

bitter palm
#

okay and how is it with an area to shoot is that also possible?

#

maybe a line of more markers

thin fox
#

but starts with getting the basic working first

bitter palm
#

okay

vagrant rain
#

Hi!
I'm working on an AWACS systems mod, and i'm having to quite often reload the game, since i do updates to the code frequently. But since i've been ArmaScripting for only 3 days now, it's unknown to me about what kind of methods there are to reduce the testing times of script mods.
Any help would be appreciated!

thin fox
warm hedge
#

Or test in your SQF in a mission

vagrant rain
thin fox
vagrant rain
warm hedge
#

Cannot really tell anything other than the idea because I don't know specifics of your script

vagrant rain
#

it uses ACE and CBA

warm hedge
#

This does not really tell anything

#

How and what is happening is the question

vagrant rain
#

well, to put it simply, it's adding ACE menu options to the player, when they're in a specific aircraft. There is a scanning option, which progressively scans for units in a range, and marks them both on the map, and 3D.

#

shares the info to other players as well

#

server-side features

flint topaz
#

Okay, So whatโ€™s wrong?

vagrant rain
#

nothing's wrong. i'm just looking for a way of testing the mod quicker.

#

cuz currently i'm having to restart the game every time

warm hedge
#

Well, still don't know how it is working so can't say but make your debug environment in a mission and try it within, is my goto

vagrant rain
#

i'll look into it, thanks.

quaint ivy
#

Does anyone have some strong experience with Zeus scripting? I'm making a script for FOB/defense fortification building and im using zeus for it. The players get an object with an action. The first player to use the action is granted temporary access to a limited zeus with limited assets, resources, editing and camera area around the initial object.
I got it working perfectly on client/local server but I'm really struggling with making everything work on dedicated.

#

Almost all scripting commands in regards to Zeus have to be executed on the server but for some reason i'm not getting consistent results, idk if it's due to scheduling or variable localization

#

This is my function fn_fortMaker which spawns the box with the action

params ["_spawnPos","_radius"];


_box = createVehicle ["Land_Cargo20_red_F",_spawnpos,[],20,"NONE"];
_box allowDamage false;
_box setVariable ["fortRadius",_radius,true];

[_box,
["Fortify Area", 
{
    params ["_target","_caller"];
    [_target, _caller, _target getVariable ["fortRadius",100]]  remoteExec ["CO_fnc_startFortification",2];
    _target setVariable ["zeusAvailable",false,true];
},
nil,
6,
true,
true,
"",
"_target getVariable ['zeusAvailable',true]"
]] remoteExec ["addAction",0,true];
_box;
#

CO_fnc_startFortification is my function that Creates a Zeus module object, here's how it looks

quaint ivy
#

Here's where I'm at currently at on dedicated: The Zeus is created properly with the correct addons, editing area, camera area and ceiling. However the zeus doesn't have the event handler nor the correct action coefficients.

quaint ivy
#

Ooooooooooh I think i figured out the cause of the problem. The zeus got it's locality changed from Server to Client

#

Does anyone know how I could avoid this change of locality, or work around it

proven charm
#

can you script armbads?

brave mountain
#

Hi, since I need to record a cinematic scene , is there a script I could use to make AI die with less ammo instead of me unloading a full magazine on 'em before they die? ๐Ÿฅฒ Thanks!

proven charm
#

but might get bloody

brave mountain
quaint ivy
brave mountain
#

u can also do that by decreasing the health bar on attributes its the same

proven charm
#

if you know how to script ๐Ÿ˜‰

granite sky
unborn lynx
#

Hello everyone !!!
I took a year break off of arma 3 ๐Ÿ˜ and it feels Great to come back to this community with all the wise advices and great personalities!!
Im trying to get back up to speed with the community and the game all over again .
Can anyone tell what this error code it pops up ever time I deceased a bad guy
i wanna post i picture but i forgot how to post with this message

granite sky
hallow mortar
#

You can post pictures here if you accept the #rules

meager granite
broken pivot
#

Good evening people ^^

Ive a simple question.
I want to use a Variable from another .sqf file.
I read that I can use them after loading the .sqf file via "execVM".
I did this but somehow it doesent work...

#

Or am I doing something wrong? Like "_Intro_GRUPPE_I_1" isnt my group variable

tender fossil
#

It's not the only possible way to handle the variable, but you can try that approach at first

broken pivot
#

Ohhhhhh your right
I remember. But arent variables in Scope {} local too?
So do I have to delete call{} too?

#

I removed the unterdline. Nothing changed

tender fossil
broken pivot
#

Same error

"non defined var"

granite sky
#

So you're trying to create the group in one function and delete it in another?

broken pivot
#

The group is only used in Intro. So Ive did a template of creating units.
Than I execVM in the intro file to the tmplate. And in the end I want to delete everything from the intro with the last line in the intro script

I will show

#

Intro script

#

.
Group template. So this is "Intro_Gruppe_I_T1_4_1.sqf"
I changed _Intro_Gruppe_I_1 to local again after nothing changed.
I also dont think that this is the problem because the local vars
of Group Template are getting loaded by execVM, or not?

granite sky
#

No, the global variable is correct. Local variables only exist within the current scope (and children).

#

But you'd need to change every instance of the variable to global. There's no automatic conversion.

broken pivot
granite sky
#

Either that or do Intro_GRUPPE_I_1 = _Intro_GRUPPE_I_1 at the end of it.

#

Well, if Arma says that the variable is undefined then it's undefined.

broken pivot
#

How many times I wanted to speak to ArmA in person and show him _Intro_GRUPPE_I_1 = createGroup independent; THERE IT IS

granite sky
#

Not after the closing bracket it's not.

#

Oh wait

broken pivot
#

Now we have

granite sky
#

You're using execVM, so the deleteGroup runs before the creation happens.

broken pivot
#

Im ready to learn.

granite sky
#

execVM is like spawn. It means "run this code at some point in the near future".

#

And then execution of the current function continues immediately.

broken pivot
#

The script does not execute immediately upon running execVM command but with some delay depending on the VM's scripts queue and engine load.

(wiki to "execVM")
Maybe newbie question but what is VMs scripts?

granite sky
#

Arma maintains a queue of scheduled scripts that it needs to run.

#

Every time you use spawn or execVM you're adding an entry to that.

broken pivot
#

If I learned right, it is allways the first non active script in the scheduler if I use execVM?

granite sky
#

It's the script that's been asleep for longest.

#

If that's not distinguishing, the behaviour is undefined.

#

I may be misinterpreting your question.

broken pivot
#

I need a cigarrete. So much input... btw, im in Voice if you wanna talk

#

.
Ive got the issue I think. Its the opposit. Were to slow.

So intro.sqf is running to the point where execVM is reached. Than scheduler gets Intro_Gruppe_I_T1_4_1 in que. (But doesent exec)
So that intro.sqf script goes on and does deleteGroup "...".

After finishing intro.sqf scheduler goes on and launches Intro_Gruppe_I_T1_4_1 .sqf

(thats the theory)

granite sky
#

Yes, that's what I said.

broken pivot
#

Oh wow I understod that were to fast... so if I use exec instead execVM, it should work

#

[Anything] exec "Scripts\Gruppen\Intro\Intro_Gruppe_I_T1_4_1.sqf";

I think I do it not in the correct way

granite sky
#

exec is an old thing from before SQF.

#

You should use the function library. See the other link I pasted.

#

And then you can just call the function.

broken pivot
#

I was thinking about fsm and say that all faults lead into deleting. Im so in desparation haha.

Now I grab my laptop. Open Your link. Turn a cig and take a break. See you in 5 Minutes

thin fox
#

or call compile?

granite sky
#

Dude, that thing takes more than 5 minutes to read.

#

Oh yeah, I forgot that call compile exists

#

that's the easier way if you don't want to learn how to do things properly.

broken pivot
sharp grotto
#

You can also be lazy and still do it "properly".
Inside initplayerlocal.sqf / init.sqf / initsever.sqf / mod pre-init etc.

// Define functions
{
    missionNamespace setVariable [(_x #0), compileScript [_x #1]];
} forEach
[
    ["XYZ_fnc_ABC","Code\XYZ_fnc_ABC.sqf"],
    ["XYZ_fnc_DEF","Code\XYZ_fnc_DEF.sqf"]
];

https://community.bistudio.com/wiki/compileScript

broken pivot
#

I remember this.

I did my difficulty like this. Am I right that Ive to rename the file himself then into fn_Intro_Gruppe_I_T1_4_1.sqf so it becomes readable to the function.
And on the way I define the path with class Category (Category can be replaced by the folder name, right?)
And there are diffrents to build the functions pending where I define it. (description.ext | config.cpp -> dont even know this...)
So if Im defining Functions in desciption.ext I need to create a new Folder in main, named "Functions", right?

(I will ask now many question if I understand something right/wrong)

#

My understanding:

I need to give it 2 Names. One first Name (the classname)
And a Second name (the subclass)

Its just like an ID of a person.
Theres the Classname=Forename
And the Subclass=Surname

Thats all about the TAG, right?

#

Are you still there @granite sky ?

blissful current
#

So, the outer while loop is always running, correct? Since I just need this for a small portion of my mission, would it negatively impact performance for the rest of the mission?

hallow mortar
#

Not substantially. While the toggle variable is false, all the outer loop does is check that variable every 5 seconds. The performance impact of this is miniscule.
However, if you really do only need this for a very small time, then it might be better to use the other method I mentioned - making the loop a function and just spawning it again when you need to start the loop again. The always-running monitor loop is better for when the loop is likely to be turned off and on quite frequently and you just want to be able to set-and-forget the system.

broken pivot
winter rose
#

sure

broken pivot
#

Oh my god thanks

I really starting to aks myself what Im doing wrong. I slowly thought Im a bad human and thats the reason theres no help for me like alltime.

winter rose
#

the two are unrelated, you may very well still be a bad human, who knows ๐Ÿ˜›
so what's the matter ^^

broken pivot
#

In the beginning

What is the task of funcions?

Ive got it like their are transforming paths and orders together in this 2 splitted function name that I can use as result to do the order with the selected path.

winter rose
#

a function is just a named bunch of code to be executed.

#

they are preloaded, so there is no disk reading when calling the script (even multiple times)

broken pivot
#

Copy this. I understood it to 99% right. Theres no way to misunderstand this.

#

They are like vars just with more code. In easy words

#

Ok, so far so good.

Next step is to know and fully understand how theyre created.
We need an example... wait...

#

Lets start with Tag value

#

The first word called "TAG" is the functions name, with that I can control it later, together with the subclass name.

winter rose
#

as shown in https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Function_Declaration :

  • in a scenario, create a Functions\MyCategory\fn_myFunction.sqf file
  • in it, write
hint format ["It works! Passed arguments: %1", _this];
  • in description.ext, declare this function with
class CfgFunctions
{
    // a tag is used to avoid possible community conflicts
    // e.g BIS_fnc_setDamage, ACE_fnc_setDamage, etc
    class EBER // the BIS_fnc prefix, here it will be EBER_fnc
    {
        class MyCategory // named like the directory
        {
            class myFunction {};    // named like the file, minus the fn_ part
                                    // will end up as EBER_fnc_myFunction
        };
    };
};
  • save the scenario
  • use your function, e.g here [player, 42] call EBER_fnc_myFunction;
blissful current
# hallow mortar Not substantially. While the toggle variable is `false`, all the outer loop does...

So in my mission, it would need to start being turned off. So if I'm understanding correctly I need to make a function to turn it on. Which I can do with the waitUntil command. But since my function's purpose is to remoteExec something, should I also have a way to turn it off when it isn't needed anymore (for networking performance)?

But the way you worded this > "just spawning it again when you need to start the loop again"
doesn't work that way with waitUntil right?

broken pivot
#

So let me explain by my own and say "You dumb fggt" or "Good student" hahaha

ยดยดยด
class CfgFunctions | General command to start everything
{
class TAG | Name of everthing (the Name ive to run later in script? Like TAG_fnc_Intro_Gruppe_I_T1_4_1.sqf)
{
class Category | Home folder (what to do if more folders to cross like Templates\Groups...?)
{
class myFunction {}; | Here ive to insert the script. But in these brackits or do Ive to replace "myFunction" with Intro_Gruppe_I_T1_4_1.sqf?
};
ยดยดยด

winter rose
#

class CfgFunctions = general class to define functions yes
class TAG = function prefix (TAG_fnc_something)
what to do if more folders = use file = to eventually determine deeper directories, but in 99.99% cases you won't need that
"here I have to insert the script" = no, not at all! just the class myFunction {}; alone, the script will be written in the sqf file as detailed before ๐Ÿ™‚

hallow mortar
broken pivot
#

I read this the 20. time now...

"here I have to insert the script" = no, not at all! just the class myFunction {}; alone, the script will be written in the sqf file as detailed before

I gues you misunderstood my hard broken englishgerman because I think that your saying what I wanted to say haha
Ive found the issue. Im to dumb to conversation. I ment the scripts file name. Not the Script itself

example:

class CfgFunctions | General command to start everything
{
class TAG | Name of everthing (the Name ive to run later in script? Like TAG_fnc_Intro_Gruppe_I_T1_4_1.sqf)
{
class Category | Home folder (what to do if more folders to cross like Templates\Groups...?)
{
class Intro_Gruppe_I_T1_4_1.sqf {};
};

winter rose
broken pivot
#

https://youtu.be/0p4yBeW_3DM

My head is thinking about what is sencefull now to learn.

First step will be to smoke a cig.
Second step will be to ask if this was all because im still confused by the wikis examples haha. There is so much more text...
Third step is to bring alltogether (WOOOOOOO)

#

Second: Yes this was all... lol

I thought this will take hours more.

For third step Ill try to reach the goal. If something goes wrong Ill ask the Fourth question haha

Since here Im so thankfull to you. Youre such a good person and helped me with problems you would say cute to haha
Just a lot of thanks โค๏ธ

Im so exited rn that Ive told my Ma everything haha. Even the ArmA Lore and the case of spy on Limnos with greek law.
Next holliday target set ahahahaha.

So now practice the knowledge

lyric pasture
#

Good evening everyone. I am wondering, why do I end up getting actionObj undefined when hinting it? I appreciate your time.

toggleAction = {
    params ["_actionObj"];
    hint ( _actionObj);

};



addEnableAction = {
    params ["_actionObj"];
    if (!isNil "_actionID") then { player removeAction _actionID; };

    _actionID = player addAction ["TogglAction", { [_actionObj] call toggleAction; }];

};
private _actionObj = 1;
[_actionObj] call addEnableAction;

winter rose
#

pass it as a parameter or add it as an object variable, etc

fair drum
lyric pasture
#

I see now thanks a lot I couldnโ€™t see why it was working in the first function & not there. Cheers ๐Ÿ˜Š

blissful current
#

As I understand it leader can change to a different unit if leader dies. However, when I kill the group leader to test this no sound is played (because the unit is dead). Do I need to have a sleep or something to let the leader pass to another unit first? It doesn't seem instantaneous.

[(leader _group), ["flarelaunch", 400]] remoteExec ["say3D"];
broken pivot
#

Im back ๐Ÿ™‚
I gues its simple but I cant get behind it. Im really trying.
My script and everything is pined to the message.

Ive placed CfgFunctions down to description.ext
He says that theres an undefined variable on line 50 "call Intro_Gruppe_I_1_fnc_Pfad;"

Am I running the function the wrong way?

thin fox
broken pivot
blissful current
#

And I call it like this [playersspotted1, [player]] call FoxClub_fnc_Conversation;
And the file is called fn_conversation.sqf

broken pivot
#

I had it in a way like this. Felt right. But than I remembered about something called sublass that Ive to give. Im kinda clear kinda confused about the topic.

But your message helps

blissful current
#

You could try to copy/paste your names onto mine and see if it works.

broken pivot
#

.
FoxClub is TAG (so the name)
fnc is the Category (so the location if "file =" isnt used)
Conversation is the function you wanna run (Is it right that the file format like .sqf is missing?)

broken pivot
blissful current
broken pivot
#

Allright thank you alto since here. Im gonna try this out.

So Ive to delete the file ending ".sqf"
Bring in "file =" in the right position
And form the right execute command to combine it with call

ZUGRIFF (engage)

blissful current
#

Here is what someone told me:

2.) add your function file with the prefix fn ie: fn_conversation.sqf into functions folder
3.) add CfgFunctions to description.ext:
#

So looks like you need a functions folder too.

broken pivot
#

WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

#

IT WORKS. WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thanks to @granite sky even if you left me in confusion.
A really really big thanks and hug to @winter rose
And @blissful current youve helped me finishing all together. Feel huged too please
Oh ma gad finally!

thin fox
fair drum
#

yeah you need to leave time to learn. learning to debug and troubleshoot is probably the most important part of learning this stuff.

#

don't rely on others to test your code

blissful current
#

I'm not sure if this is standard practice but I basically test after each little thing I do. That way it's way easier to narrow down what I actually did to cause an error.

jolly sierra
#

question: how is it possible, that certain feature works when I test it locally (play -> multiplayer) in editor, but when it's on live server, it doesnt' work? On our server we have a tool called bulldozer, which just removes/hides trees, bushes, buildings from area you select. It worked for like 7 years iirc, but it suddenly stopped working. What's interesting is, that locally it works perfectly fine, but when I join a hosted multiplayer server, the bulldozer menu is just not in it's sub menu, and also other scripts which rely on that feature stopped working too.

fair drum
#

When was the last time you used it? A lot has changed in 7 years.

jolly sierra
#

well I know, but it worked like a week ago

#

looking at script commits, we didn't touch a thing related to it

#

also the server is running on profiling Arma build

#

it's just a general question, like what could potentially go wrong

fair drum
#

Mostly locality and JIP issues. Something not firing where it should.

#

Did you run your server on release branch the last time it worked?

jolly sierra
#

JIP?

warm hedge
#

Join in Progress. Joining into the game during a game

jolly sierra
#

ah

fair drum
#

Post the GitHub if you have it

jolly sierra
#

I can't, it's access restricted

#

and I'm not a admin chief or something

fair drum
#

Alright, it's on you then ๐Ÿ™‚

#

Try on release build

jolly sierra
#

yeah Ill ask the main devs to maybe revert some commits, test it on server, and if it's not working, to switch to release build

#

thanks!

blissful current
#
_unitsInArea = (switchableUnits + playableUnits) select {  
    (_x inArea generatorArea) && (alive _x)  
}; 

private ["_selectedUnit"];
if (count _unitsInArea > 0) then { 
    _selectedUnit = selectRandom _unitsInArea;
};

["idea", [_selectedUnit]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance generator <= 50}];
#

Is it not possible to use _selectedUnit in the array for a function?

warm hedge
#

Because the private makes _selectedUnit lasts only within the scope of if

#

Therefore outside of if it is nil