#arma3_scripting

1 messages · Page 581 of 1

winter rose
#

I believe so
Also, Arma* 3

#

but no \x\

#

wait, disregard - idk, check the addon's structure

verbal rivet
#

What should I be looking for? PboPrefix.txt seems to specify x\alive\addons\mil_ied

winter rose
#

Then try and thy shalt see!

loud python
#

thou*

verbal rivet
#

That didn't quite work for me previous time I tried it, but I shall certainly try again 😆 Thanks for advice

winter rose
#

@loud python would "thy" stand for "yours" then?

loud python
#

thy is the possessive form of thou

winter rose
#

I was positive I saw it as replacement of thou too, but until further verification I shalt be corrected

loud python
#

idk, people these days use them interchangeably if they want to sound fancy

winter rose
#

I want to speak a proper Old English :p

loud python
#

there's a chart with all the personal pronouns

#

but we're getting offtopic here 😄

real tartan
#
_ctrl = (findDisplay 46) ctrlCreate ["RscStructuredText", -1];
_ctrl ctrlSetStructuredText parseText format ["<t align = 'right'>%1</t>", 1000000];

For large number it return 1e+006. How can I format it to be 1000000 ?

winter rose
#

(did isLocalized work?)

#

@real tartan see toFixed

real tartan
#

(did isLocalized work?)
@winter rose I want to get list of string keys from game in first place to check if it localized, e.g. "STR_BIS_key1", "STR_BIS_key2"

eager stump
#

Is it possible to find the classname of the chosen role listed in CfgRespawnInventory? typeOf player returns the classname defined in the mission.

#
{ 
    class OPFOR_1
    {        
        vehicle = "O_soldierU_AR_F";
    };    
};
``` ... I'm looking for the vehicle info.
winter rose
#

@real tartan you cannot

real tartan
#

@real tartan see toFixed
@winter rose works, thank you

real tartan
#

BIS_fnc_numberText works too

still forum
#

Hey so, bohemia made a new engine, right?
partly, if you mean enfusion
does that still use SQF?
no if you mean enfusion
Is there any info in whether they will ditch SQF?
They already did
does enforce have no GC or what?
Enforce? Thats a different engine. Enscript has no GC no, refcounting.
BIS can we get Lua please?
What does BIS have to do with this? Enfusion is a BI engine.

@loud python

Is there a way to list all "string_names" from Stringtable.xml in game?
No, but here https://synixebrett.github.io/stringtables/
@real tartan

loud python
#

What does BIS have to do with this? Enfusion is a BI engine
BIS probably stands for bohemia interactive simulations, right? I'm just so used to writing that from function names that I typed the S without thinking 😄

still forum
#

Yes

loud python
#

Enforce? Thats a different engine. Enscript has no GC no, refcounting.
huh? if there's also an unrelated engine called enforce, then I don't mean that;
from the wiki:
Enforce Script is the language that is used by the Enfusion engine
That's what I was talking about

still forum
#

Enforce is a Engine, RV is a Engine. Enfusion is Enforce + RV + New Stuff

#

Enforce was made by Black Element Software

loud python
#

hmmm... well, as long as it runs better than arma 3 I don't care much about the engine itself

#

for me the relevant part is really just the scripting language

#

and from what I've seen, enforce script is... Let's just say it really makes me wonder what the thought process was

vague geode
#

Is it possible to get real random weather? I mean can I disable the weather and weather forecast and instead make random weather by script?

robust hollow
#

yea

vague geode
#

@robust hollow How about you give me a hind of how to achieve it?

loud python
#

totally random weather would be easy, but if you want it to be realistic, you'd have to add some more logic for that

vague geode
#

@loud python Yeah, that's obviously the case. My problem is that I have no idea how I can set a random overcast forcast and random weather change times...

loud python
#

as in... you don't know which commands do that? if so, R3vo posted a link to the wiki page

#

you can just decide on the next weather parameters and how long the change should take, then call all the commands like _time setRain _rain, etc.

robust hollow
#

i have an oldish script that may or may not work

spark turret
#

hey, is there a way to read a trigger object synched to another object?
i tried using _objects = synchronizedObjects _logic;
but that doesnt return the trigger, and synchronizedTriggers wants a waypoint as parameter, but i only have an objcet.

robust hollow
lapis ivy
#

Hi, everybody. I use the Zone Restriction module to restrict the game zone. I have three such modules:
First: it restricts all players from going outside of combat.
Second: restricts EAST to enter the territory of WEST
Third: restricts WEST from entering the territory of EAST.

But the problem: after killing the player and his respawn, the second and third stop working! And the restriction on leaving the combat zone continues its work perfectly. What is the problem and why can this be?

vague geode
#

@robust hollow Do I understand the part in your script right that if you do a forced weather change the forecasted weather is executed after which you can add your own weather?

robust hollow
#

it forces clear weather when the script starts running, then it does smooth weather changes over the defined transition time

vague geode
#

@loud python Isn't it true that if you only use overcast it autometically edits rain etc. realistically?

#

@robust hollow So how did you get rid of the forcasted weather and the default first weather change time that enforces said weather forecast?

robust hollow
#

there are settings in the 3den editor to disable weather options i think

#

idk, that script was written back in 2017 i think, so cant say what the whole setup was at the time.

vague geode
#

@robust hollow Ok, still thanks for the help.

loud python
#

iirc changing overcast should change the other parameters too, but that can be turned off

#

I haven't scripted weather much, so I don't remember how exactly that works

#

might be a separate command, or a parameter or something

winter rose
#

overcast, fog, rain, rainbow, lightning, wind
these are the settings you can edit

#

only one weather change at a time can happen, iirc

spark turret
#

if all members of a group are killed, will the group return null or sth and cause an error when trying to be called?

winter rose
#

e.g if you 3600 setOvercast 1 and 3600 setFog 1, only the fog will apply
this info may be wrong/outdated though

spark turret
#

what safety measures do i use to prevent an errror when calling a dead group

winter rose
#

@spark turret groups get auto-deleted after the death of the last members - not always immediately

you can check if the group isNull

spark turret
#

thanks lou

stark granite
#

Anyone able to point me towards a random side mission script? Found a few options but non of them really work, Ideally id use a version of Jigsor's side mission script, however, the Fnc's used are all over the place and super hard to understand xD

ebon ridge
#

BIS_fnc_ambientAnim just doesn't work on MP, even following the guide in the comments. I don't see any reason why either really, but running via editor MP the server side client looks fine, another client connected has no animation on the units at all.

spark turret
#

what is _radius = waypointLoiterRadius [groupOne, 1];
used for? do the units move around in that radius while waiting for its completion?

winter rose
#

@spark turret same as the loiter waypoint in Eden

spark turret
#

yeah just found out that type exists, gotta look into it

#

any way to increase the search radius for a "seek and destroy" WP for infantry? read in a forum its 50m standard, would like to increase to maybe 100

lapis ivy
#

Hi. How do I use the "hint format" for each player separately? I only need to show the message for the player who is out of the zone.
I have:
Condition in the trigger: "this"
At activation:

hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!", player];

The message is shown to all players, and I only need to show it to the person who logged in to the trigger.

winter rose
#

@lapis ivy make it "not server-side", and in condition set !(player in thislist)

lapis ivy
#

@winter rose
I added a trigger to the condition
vehicle player in thisList
And it worked. But I don't know if it will work if the player is in the car.

winter rose
#

it will

#

vehicle player == player when on foot

lapis ivy
#

Thanks.

lapis ivy
#

@winter rose
How can I correctly add a function to a trigger call BIS_fnc_neutralizeUnit ?
I need to kill a player if they don't leave the zone within 8 seconds.
I wouldn't want to do two triggers, but do everything in one.

#
hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!", player];
sleep 8;
call BIS_fnc_neutralizeUnit;

My understanding is that if a player returns to a safe zone, they will still be killed.

winter rose
#

ideally, don't use triggers 😁

lapis ivy
#

I would use the forbidden zone module, but my bots are deleted after the briefing, and the module is not active for new players who entered the game after the start, since the module is synchronized with each unit.

winter rose
#
[thisTrigger, player] spawn {
  params ["_trigger", "_unit"];
  private _timer = time + 8;
  waitUntil { !(_unit in list _trigger) || _timer > time };
if (_unit in list _trigger) then { _unit call BIS_fnc_neutralizeUnit; };
};
lapis ivy
#

code

hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!", player];
[thisTrigger, player] spawn {
  params ["_trigger", "_unit"];
  private _timer = time + 8;
  waitUntil { !(_unit in list _trigger) || _timer > time };
if (_unit in list _trigger) then { _unit call BIS_fnc_neutralizeUnit; };
};

Is this correct?

winter rose
#

seems fine

still forum
#

, player
Whats that supposed to do in the format?

#

you don't have any placeholders in the text, that won't do anything

#

Any specific reason why you pass player as arguments, instead of just using player inside the function?

lapis ivy
#

Oh, I fixed that already, I just forgot to get it out of here. Thanks.

#
hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!"];
[thisTrigger, player] spawn {
  params ["_trigger", "_unit"];
  private _timer = time + 8;
  waitUntil { !(_unit in list _trigger) || _timer > time };
if (_unit in list _trigger) then { _unit call BIS_fnc_neutralizeUnit; };
};
#

@winter rose
The trigger fires, but the timer does not. Kills right away.

winter rose
#

woopsie, invert _timer >_timer <

#

@lapis ivy ^

lapis ivy
#

Hm...

#

Okay.

still forum
#

old one looks correct to me tho

winter rose
#

nope, I wait until current time goes beyond _time

still forum
#

Yes. correct

#

🤔

#

ah yes

#

yes yes indeed yes

winter rose
#

…you did sleep today, did you…?

still forum
#

don't remember

slate cypress
#
if (lockedVehicle this) then
{
    this lockDriver false;
}
else
{
    this lockDriver true;
};
#

i'm getting an error saying im missing a )

#

but i don't see any open brackets

still forum
#

Look at the syntax highlight

#

lockedVehicle doesn't exist

winter rose
still forum
#

or lockedDriver?

ebon ridge
#

On this page: https://community.bistudio.com/wiki/switchMove
It says:

This command has global effect when executed locally to the unit and will sync for JIP. In this case the animation on the executing machine is immediate while on remote machines it will be transitional.
What does "transitional" mean? As far as I can tell it just doesn't work at all non-locally.

wheat island
#
// addAction parameters
params ["_target"];

// clearXGlobal means to clear X from something, for everyone on the server.
clearBackpackCargoGlobal _target;
clearWeaponCargoGlobal _target;
clearItemCargoGlobal _target;
clearMagazineCargoGlobal _target;

// Remove the addaction so it can't be run by several players.
[_target] remoteExec ["removeAllActions", 0];

// Spawn a sleep and addaction, so that after 10 seconds, the action is readded to the vehicle.
["_target"] spawn {
    sleep 10;
    _target addAction [
        "<t color='#ff0000' font='EtelkaMonospacePro' size='1.2'>Clear Vehicle Inventory</t>",
        "scripts\client\clearInventory.sqf",
        [],
        1,
        true,
        true,
        "",
        "driver vehicle player == player"            
    ];
};```

this gives me :
https://gyazo.com/dd8cb4953b6c96ce7abde9709d206de7

Any advice?
unique sundial
#

It means if you switch move prone while standing up, locally unit will just drop into prone immediately while on remote machine unit will crouch then prone @ebon ridge

ruby breach
#

_target is undefined within your inner spawn

#

Also, [_target] spawn {

wheat island
#

hmm

#

I tried your suggestion fist and it didn't work either

ruby breach
#

Because _target would still be undefined within the inner spawn

unique sundial
#

You need to define _target

ebon ridge
#

It means if you switch move prone while standing up, locally unit will just drop into prone immediately while on remote machine unit will crouch then prone @ebon ridge
@unique sundial Thanks but I don't understand how this can apply to arbitrary animations like are used in ambientAnim (which is what I am looking at). There is no transitional positions surely?

wheat island
#

hmm

ruby breach
#
[_target] spawn {
params ["_target"];
wheat island
#

hmm

ebon ridge
#

well I had to remoteExec 0 on it to get it to apply on client machines

unique sundial
#

@ebon ridge if it doesn’t work use global remoteExec

ebon ridge
#

yeah i am, so docs are just wrong?

unique sundial
#

No

ebon ridge
#

Well I'm seeing the evidence that they are, so what is the explanation?

unique sundial
#

You have repro?

ebon ridge
#

yes

#

But you said "if it doesn't work use global remoteExec". Why would it not work?

unique sundial
#

You said it doesn’t work

wheat island
#

yo, it worked

#

thanks @ruby breach and @unique sundial you guys are legends

#

could I add an if statement, like ```sqf
if {driver player = player} then {
addAction [stuff]
} else {removeAction [stuff]}
};

#

or would that not work

winter rose
#

« add or do not add - there is not try »

#

use the condition parameter in addAction @wheat island

light moat
#

Hey! Is there a script to get rid of the NVG slot in the inventory? The EMP script i am using wont perform such an action no matter how hard i try so im wondering if there is another way

young current
#

you can not disable inventory slots

#

you could possibly switch the nvg to a broken one

#

Contact addon added some of those

light moat
#

no, not like that, more specifically like remove the item in the inventory slot @young current

real tartan
#

how can I prevent taking item from container ?

player addEventHandler ["Take", {
    params ["_unit", "_container", "_item"];
    if (faction _unit in ["OPF_F"] ) then 
    {
        // prevent taking item from inventory
    };
}];
surreal peak
#

@light moat _Unit unassignItem "NVGoggles";

#

_unit removeItem "NVGoggles"

light moat
#

Awesome, can i just run this in global?

surreal peak
#

{ _x unassignItem "NVGoggles"; _x removeItem "NVGoggles"} foreach allUnits;

#

should work

light moat
#

solid, ill try em, thanks!

#

No luck in an MP environment @surreal peak

surreal peak
#

do you want to remove AI or players stuff?

light moat
#

players

surreal peak
#

above will work for AI

#

ahhh

light moat
#

ah

surreal peak
#

{ _x unassignItem "NVGoggles"; _x removeItem "NVGoggles"} foreach playableUnits;

light moat
#

gonna try it out

surreal peak
#

MB, thought u wanted to remove AI stuff

light moat
#

nah u g

#

hm still doesnt work,

#

maybe because

#

Modded nvgs?

surreal peak
#

ah

light moat
#

I will need the custom class name in that case right?

surreal peak
#

I believe so

light moat
#

ok, could i replace it where "NVGoggles"

#

is?

surreal peak
#

Yeah

light moat
#

okey, thanks for the help!

unique sundial
#

Use hmd command

light moat
#

hmd?

#

@unique sundial

surreal peak
#

{ _x unassignItem hmd _x; } foreach playableUnits; might work

#

dont think you can delete the item after though

light moat
#

I get this error which says there is an undefined variable in playableunit?

surreal peak
#

will probably say that cause there is someone without a NV goggle

unique sundial
#

It is plural, units and there is a link to biki just above don’t just copy paste blindly

surreal peak
#

ahhhh

light moat
#

oke, i try again

surreal peak
#

that is a 4head moment for me

#

MB

light moat
#

HA

#

IT WORKED

surreal peak
#

sweet!

light moat
#

IVE BEEN AT THIS FOR LIKE LITERAL HOURS

#

LMAO

#

thank you

surreal peak
#

do a check if there is no NVG

#

make sure it wont break

#

like, test the script with people without NVG

light moat
#

got it

#

works in an mp environment!

surreal peak
#

will save you hours later on

light moat
#

ah, yeah I probably should've, thought my crude knowledge of the scripts would get me there

#

XD

#

thank you!

surreal peak
#

😄 NP

jagged elbow
#

is it at all possible to count how many sectors a side has (from the sectors module) and store this value as a vairable?

surreal peak
slate cypress
#

this is what I was using lou

#

and dedmen

#

i only want to lock the driver seat, nothing else

#

ohhh disregard

#

i see

#

thanks

#

Now I'm getting an undefined variable this error

#

Does it not recognise this in a .sqf file?

winter rose
#

this works in init field

slate cypress
#

oh

winter rose
#

(and in triggers, etc)
how do you call your sqf?

slate cypress
#

addAction

winter rose
#

then use (_this select 0) for the object it is attached to, (_this select 1) for the one using the action

slate cypress
#

thanks

slate cypress
#
this addAction["Toggle vehicle lock", "toggleVehicleLock.sqf", nil, true, true, "", (vehicleVarName _this in allowedPlayers), 5];
#

Error type number, expected string

#

specifically looking at this part

#
(vehicleVarName _this in allowedPlayers)
#

It must return "true" for the action to be added.

#

this is in init field

twilit nymph
#

Hi would this work in a multiplayer setting, or am I misunderstanding task locality here?

pow = {["task_pow", "SUCCEEDED"] call BIS_fnc_taskSetState;};```
jagged elbow
#

how would i go about checking the side of a player, i currently have this:

if (playerSide !resistance) exitWith {
 hint "You Are Not A Member Of The Cause!";
};

I want to make sure the player is independant, but this currently doesnt work.

winter rose
#

of course it doesn't, because you do not respect the commands' syntax!

#

let's see the wiki 😉

#

@jagged elbow ^

alpine ledge
#

you want either !(playerSide == resistance) or (playerSide != resistance)

still forum
#

nor the ! syntax

jagged elbow
#

you want either !(playerSide == resistance) or (playerSide != resistance)
@alpine ledge Thanks that worked

jagged elbow
#

Sorry another question, i have a cash variable, im trying to display this cash variable in a hint, i have this part working however i want a cash symbol, in this case £, to display along side it so far i have this:

player addAction ["hint cash", {hint "£"+str(cash)}];

But this only displays a £ sign.

wraith cloud
#
player addAction ["hint cash", {hint format ["£%1", cash]}];
jagged elbow
#

Thanks that worked, would you mind explaining what the %1 part means?

winter rose
#

%1 means "replace this with the first parameter"

#

you could also do hint ("£" + str cash)
parenthesis are needed here (because hint takes precedence on +)

jagged elbow
#

i see, thanks for the explanation

high silo
#

I can spawn in text, but how do I get it to fade out? ```sqf
_layer = cutText ["<t color='#4169E1' size='5'>Objective Updated!</t><br/>Capture the HVT in Vyshnoye.", "PLAIN", 5, true, true];

#

I tried adding cutFadeOut 5; on the end, but doesnt work.

#

Nevermind I worked it out.

tiny wadi
#

Hola, I'm working on a server function and need to find who called it. I found the command remoteExecutedOwner but I have yet to find a way to get the object reference to that player. This is what i've tried but now I see it wont work because remoteExecutedOwner returns the client owner id and not a network id.

private _playerID = remoteExecutedOwner;
private _player = _playerID call BIS_fnc_objectFromNetId;
if (_playerID isEqualTo 0) exitWith { diag_log "Invalid remoteexec owner."; }; //invalid
if (_player isEqualTo objNull) exitWith { diag_log "Unable to find player object from netid"; }; //unable to find player```
#

I did alot of searching on the scripting commands list but was unable to find something to go from an owner id to an object or network id

#

I would pass the player variable when calling it from the client but I would assume that is unsecure and can be changed by giving a different object reference

#

Should i add an eventhandler to the server that stores a players object and srt the index equal to the owner id? Or is there a cleaner solution

robust hollow
#

I would assume that is unsecure and can be changed by giving a different object reference
well yea, i guess. but if you only use it correctly it should be fine? i think in the past i've had to use a server function to find an object with matching clientOwner id.

tiny wadi
#

Its not me im worried about using it incorrectly. I was mainly worried about hackers manipulating it

robust hollow
#

you in a situation where thats a common problem? i reckon if they have gone to the effort to target your code specifically, they could probably find a way to route their "attacks" through another player to use their remoteExecutedOwner anyway.

#

i think your best option is to make a server function to find the unit associated with remoteExecutedOwner.

#

i dont think there is a command or function for that already?

tiny wadi
#

Yeah nah there isnt a function for it

#

But I just had an idea for the player to pass their netID, but then the server double checks that the owner of the object associated with that net id is equal to remoteExecutedOwner

#

if its not then we know its false and they aren't the owner

#

I think with remoteExecutedOwner and routing attacks through the person directly, if the remote execute config is setup correctly then clients are only allowed to run functions through the server and not set the target for anyone else

#

Actually above wont work because anyone can get the netid of anything

#

If i disable the command netId for everyone except the server I believe that'll do the trick

robust hollow
#

how would the player pass their netid if it is disabled?

tiny wadi
#

I changed it to their object reference

#

should have mentioned that

#
private _playerID = remoteExecutedOwner;
if (_playerID isEqualTo 0) exitWith { diag_log "Invalid remoteexec owner."; }; //invalid

private _objectFromMachineID = (netId _player) call BIS_fnc_objectFromNetId;
if (!((owner _objectFromMachineID) isEqualTo _playerID)) exitWith {}; //spoofed```
robust hollow
#

that is completely pointless though?

#

it just uses the netid of the object to get the object you just got the netid from?

#

which is the same object.

tiny wadi
#

That is assuming that the given object is the correct one

#

in which case yes its pointless

#

but if someone were to give it a different persons player object then it would return a different object other than the remoteExecutedOwner

robust hollow
#

right, but you dont need to use its netid at all

tiny wadi
#

ohhh

#

yeah

robust hollow
#

just compare owner _player to _playerID

tiny wadi
#

that was stupid

#
params [["_player", objNull]];

private _playerID = remoteExecutedOwner;
if (_playerID isEqualTo 0) exitWith { diag_log "Invalid remoteexec owner."; }; //invalid

if !((owner _player) isEqualTo _playerID) exitWith {}; //spoofed```
robust hollow
#

👍

#

could get away with one less set of parenthesis but thats not important.

tiny wadi
#

now its pretty 😉

#

Thanks for the help

robust hollow
#

👏

signal kite
#

Good morning! As I'm pretty new to scripting, I would appreciate any constuctive criticism on this code, which spawns random Groups every 10 minutes on my server.

spawnwest = [{
//check if an actual player is present
private _allHCs = entities "HeadlessClient_F";
private _humanPlayers = allPlayers - _allHCs;
_humanPlayers = count _humanPlayers; 
if (_humanPlayers > 0) then {
//select random group
_groups = []; 
{ 
 _faction = _x; 
 { 
  _type = _x; 
  { 
   _groups pushBack _x; 
  } forEach ("true" configClasses _type); 
 } forEach ("true" configClasses _faction); 
} forEach ("true" configClasses (configFile >> "CfgGroups" >> "West")); 
_grp = selectRandom _groups;
 //spawn group 
private _vfgrm = [27000, 24200]; 
private _marschziel = [27000, 23200];
private _side = West; 
_gruppe = [_vfgrm, _side, _grp] call BIS_fnc_spawnGroup; 
_gruppe addWaypoint [_marschziel, 100]; 
_gruppe deleteGroupWhenEmpty true; 
diag_log format ["%1 spawned at %2. Will move to %3.", _gruppe, _vfgrm, _marschziel];
} else {
diag_log "No players present - spawn cancelled";
};
}, 600] call CBA_fnc_addPerFrameHandler;
cosmic lichen
#

Looks fine so far. You could consider to cache all available groups when it runs for the first time.

signal kite
#

@cosmic lichen by using grp instead of _grp and then just skipping the "select random group" part, if grp is already defined?

still forum
#

No

#

Store the _groups array, instead of doing very slow repeated config lookups that always return that same result

smoky verge
#

Anyone knows if there is a script to disable sprinting?

winter rose
#

@smoky verge like, allowSprint?

smoky verge
#

huh that was easier than I though

#

@winter rose assuming I want to use it only on the players in the trigger what should I use in the syntax?
something like forEach player intislist?

winter rose
#

is the trigger players only?
if so, you could to a { _x allowSprint false } forEach thislist

smoky verge
#

the trigger is player presence so it should work

#

also is there an allowJog?

#

or generally something to slow down to walk speed
I would edit stamina but with ace it may just explode the universe

smoky verge
#

oh didn't know about that first page
thats actually awesome
thanks

signal kite
#

Is there a command similar to "diag_log" that outputs to the dedicated server console?

spark turret
#

im writing a script where a roadblock gets reinforced when under attack. I want to be able to distinguish between transport vehicles and vehicles then can fight, i.e. a truck should be used to move there and then left near the road while a jeep with an MG shouldnt be abandoned. ANyone know a smart way of doing that by script?

winter rose
#

simple way: check if your vehicle is a truck
advanced way: check that vehicle weapons are something else than "horn"

spark turret
#

check for truck isnt enough, ill go with the horn way

#

or im going lazy and call anything truck a taxi in editor and just read the name.. we ll see

winter rose
#

truck0, truck1, truck2

private _trucks = [];
for "_i" from 0 to 2 do
{
  _trucks pushBack (missionNameSpace getVariable format ["truck%1", _i]);
};
#

or just ```sqf
private _trucks = [truck0, truck1, truck2];

spark turret
#

how about using this:
_list = fullCrew [vehicle player, "turret"];
and if (count _list == 0) //no turret -> taxi?

winter rose
#

check if vehicle has a gunner, should be enough?

spark turret
#

wont work on empty cars, altough generally they shouldnt be emtpy if they have a gunner

#

yeah i guess gunner check is enoguh

#

i still have to use fullcrew get type cargo to distignuish between pure taxi and apc. bc apcs have a gunner but als ferry passengers.

winter rose
#

heh, then you have taxi, gun, and taxi+gun yes
therefore, two checks

spark turret
#

yup

#

it will declare trucks with an MG as guntaxi, so i might also look into "damageRestistance"

still forum
#

maybe check ammo of the vehicle?

spark turret
#

wont help for getting a difference between an APC with a .50 and a truck with a .50

#

gotta get some kind of armour value, found "damageResistance" in the configs.

winter rose
#

you are adding more criteria to the distinction you are looking for

I thought you only wanted to know

  • if the vehicle has a gun
  • if the vehicle transports people
    (can be one, the other or both)
spark turret
#

well i want the QRF which reinforces the attacked roadblock to act logically. APCs and tanks and MG-jeeps will keep their crew boarded, while trucks, no matter if mg or not will only be used to ferry. they have no use in direct attacks

winter rose
#

then checking for weapons is "useless", you simply want to check if the vehicle is one of the trucks

#

name them (easiest solution), or check isKindOf with the truck's parent class

spark turret
#

yeah i guess naming is really the easiest way. not elegant, but to cover every single case of vehicle to work is probably more error prone

#

MRAPs are also "just trucks" but do pack a punch. so lets elave it to the mission maker what to use as taxi and what as gun.

winter rose
#

if you are making a framework, it is a good thing to have a very strong check for such cases.
if you are "only" making a mission, make the function for you first, the rest is not important.

passing an array of "vehicles that should continue their road" may also be more beneficial to the script's modularity, given you might want to micromanage who stops and who doesn't (e.g an important officer/prisoner in a BMP, etc)

spark turret
#

array will have mod dependency though

#

but you re right of course.

winter rose
#

of course I'm right! :p

spark turret
#

dont know what to look for, i wanna change the groups sign shown in zeus to motorised, mechanised, armoured etc. what kind of field do i need to manipulate for that?

winter rose
#

is it ORBAT High Command?

spark turret
#

yeah orbat was correct
i just noticed that its not displayed in zeus but only high command so its useless for my purpose

winter rose
slate cypress
#

does anyone have a solution to my problem

fathom pawn
#

Why does addaction scripts only appear locally ? Is there a good way to make an item interactable on the scroll wheel for the entire server?

meager granite
#

Thinking what would be a good way to restore object's hidden selection materials?
Sadly setObjectMaterial [0, ""] doesn't work.

#

Config doesn't have materials in hiddenSelections either in most cases

#

Currently thinking going as far as digging into models to get their original materials and re-apply them.

winter rose
#

@fathom pawn remoteExec yes

fathom pawn
#

Ah Ty

winter rose
#

@meager granite you can get them with getObjectMaterials

#

(store them before changing them, I suppose)

meager granite
#

Nope, it returns empty strings

winter rose
slate cypress
#

I've checked the docs

#

and yes, it should return true for the action to show

#

I believe that statement does return true

#

but it is somehow getting a number

winter rose
#
     object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]
``````sqf
this addAction["Toggle vehicle lock", "toggleVehicleLock.sqf", nil, true, true, "", (vehicleVarName _this in allowedPlayers), 5];
slate cypress
#

According to the docs, _this points to the target player who it shows up for

#

in script code

winter rose
#

title = "toggle vehicle lock"
script = "toggleVehicleLock.sqf"
arguments = nil
priority = true → should be a number
showWindow = true
hideOnUse = ""

there is an offset

#

also, the condition is a String - not a Boolean

slate cypress
#

ah how did I not see that priority is a number 🤦‍♂️

#

so if it is a string,

#

I'd use an if statement and return "true"?

winter rose
#

I think you only missed priority, the rest is only offset by one

no, you would simply wrap your statement in quotes

#

this string will then be compiled and called by the engine

slate cypress
#

ohh

#
"vehicleVarName _this in allowedPlayers"
#

so this essentially

winter rose
#

yes

slate cypress
#

ok thanks

slate cypress
#

what can I use to check if thisTrigger inside a trigger object is a vehicle (car, apc, tank, heli)

winter rose
#

if the trigger is … in a trigger?

#

@slate cypress didn't get your question, do you mean "check if the triggering unit is a vehicle"?

slate cypress
#

yes

#

i'm making a maintenance area

#

currently looking at this function

#

getting an error "missing ;"

#
_objectType = thisTrigger call BIS_fnc_objectType;
if (_objectType select 0 == "Vehicle / VehicleAutonomous") then {return true;};
winter rose
#

thisTrigger is the trigger itself
also, return doesn't exist in SQF

slate cypress
#

ah

#

but thisTrigger would be the object that enters the trigger area

#
_objectType = thisTrigger call BIS_fnc_objectType;
_objectType select 0 == "Vehicle / VehicleAutonomous";
#

this is the condition

ruby breach
#
thisTrigger
Refers to the trigger object itself.
slate cypress
#

oh

#

given that the player is driving the vehicle,

#

there'd be two objects in thisList

#

how do I know which one is the vehicle

#

if it is a vehicle

ruby breach
#

It's been a while since I've messed with triggers, but pretty sure the only object in thisList would be the vehicle, which you'd then have to use the crew command to get the occupants of.

slate cypress
#

this is what i've done for the condition

#
_object = thisList select 0;
_objectType = _object call BIS_fnc_objectType;
_objectType select 0 == "Vehicle / VehicleAutonomous";
#

but it isn't activating the trigger

#

does ```sqf
_objectType select 0 == "Vehicle / VehicleAutonomous";

ruby breach
#

It's not "Vehicle / VehicleAutonomous", it's one of ```
Car
Helicopter
Motorcycle
Plane
Ship
StaticWeapon
Submarine
TrackedAPC
Tank
WheeledAPC

slate cypress
#

isn't "Vehicle / VehicleAutonomous" the category though

#

it returns an array

#

[category, type]

ruby breach
#

Just output BIS_fnc_objectType and see what it actually is

#

My guess would be ["Vehicle","Car"] or ["VehicleAutonomous","Car"], but not really sure tbh

slate cypress
#

The condition works now.

#

I'm getting a "generic error in expression" error for the actual activation code

#

this is the activation code:

#
thisTrigger setFuel 0;
thisTrigger vehicleChat "Repairing...";
#

oh wait

#

i didnt update it

#

nvm

winter rose
#

(again, thisTrigger is the trigger itself yes)

slate cypress
#

yep xD

#

still getting the same error for it but with the updated version

#

the vehicleChat statement works

#

but it skips the setFuel and errors

winter rose
#

*magic*

#

can't tell without the whole code 😉

slate cypress
#
_object = thisList select 0;
_object setFuel 0;
_object vehicleChat "Repairing...";
sleep 2;
_object setDamage 0;
_object vehicleChat "Rearming...";
sleep 2;
_object setVehicleAmmo 1;
_object vehicleChat "Refueling...";
sleep 2;
_object setFuel 1;
_object vehicleChat "Maintenance completed!";
#

It manages to do all the chats.

#

Ignores sleep statement

winter rose
#

no sleep in activation, unscheduled

slate cypress
#

how do I pause it so that I can get a little wait time

winter rose
#
(thisList select 0) spawn {
  params ["_object"];
  /* your code here */
};
slate cypress
#
_object = thisList select 0;
#

why can't I do this

winter rose
#

you can, but spawning won't care about it since it is a new scope

slate cypress
#

oh

#

and what about the sleep statement?

winter rose
#

sleep works in a spawn

slate cypress
#

ah ok

#

undefined variable _object error

#
(thisList select 0) spawn {  
 params ["_object"];  
 _object = thisList select 0; 
 _object setFuel 0; 
 _object vehicleChat "Repairing..."; 
 sleep 2; 
 _object setDamage 0; 
 _object vehicleChat "Rearming..."; 
 sleep 2; 
 _object setVehicleAmmo 1; 
 _object vehicleChat "Refueling..."; 
 sleep 2; 
 _object setFuel 1; 
 _object vehicleChat "Maintenance completed!";  
};
winter rose
#

of course, thislist doesn't exist in the spawn
I passed thislist select 0 as argument, and assigned it to _object with params ["_object"]

#

delete the line _object = thisList select 0; and everything will be fine 👌

slate cypress
#

oof i must be half asleep today

#

works

#

thank you for your help lou and gnashes :)

spiral fractal
#

how to skip iteration in foreach? can I use exitWIth?

winter rose
#

nope, this exits the whole forEach
there is no "continue" in SQF

wrap with if () then {}

spiral fractal
#

oh and I was looking for continue command and never found one :|
Thank you!

#

I just prefer to check for negative and exit instead of wrapping code (in C#)

winter rose
#

I feel you…

#

"funnel" coding

spiral fractal
#

yes 😄

still forum
#

would a continue really be worth it? 🤔

#

I don't think it would be that hard

winter rose
#

for readability, yes

for both for, forEach and while maybe

spark rose
#

okay, so this only happens on a dedicated environ - I force eject the players from the aircraft - and all the human players live, while the AI dies on ejection, even though damage is disabled on them.

#
//define players
_players = [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];

//make sure players have no damage
"no damage..." remoteExec ["hint"];
{_x setDamage 0} forEach _players;

//eject players from aircraft
"ejecting..." remoteExec ["hint"];
{moveOut _x} forEach _players;
sleep 6;

//make players vulnerable
"players becoming vulnerable..." remoteExec ["hint"];
{_x allowDamage true} forEach _players;
fishyradar enableVehicleSensor ["ActiveRadarSensorComponent",false];

//make a marker at the crash site//
waitUntil {(visiblePosition fishy) select 2 < 1};
"making crash site..." remoteExec ["hint"];
createMarker ["Respawn_West", getPos fishy];
"Respawn_West" setMarkerType "mil_triangle";
"Respawn_West" setMarkerText "Crash Site";
"Respawn_West" setMarkerColor "ColorOrange";

//make sure all players are still in the same group
sleep 20;
"regrouping..." remoteExec ["hint"];
_players join playgroup;
leader playgroup == player_1;
winter rose
#

@spark rose allowDamage needs a local argument

#

also, leader playgroup == player_1; will do nothing (only returns a boolean)

spark rose
#

Lou, can you explain further about the local arg for allowDamage?

#

understood about leader

winter rose
#

you should remoteExec allowDamage, else it will not be dealt with

#
{ [_x, false] remoteExec ["allowDamage", _x] } forEach _units;
spark rose
#

gotcha, it has to be run local to the players machine

winter rose
#

exactly

spark rose
#

i had first attempted that but had problems with syntax... 😦

#

but why are AI killed on moveOut command?

winter rose
#

maybe because they are all ejected at once, therefore colliding - I don't really know though.

#

try spacing them ```sqf
"ejecting..." remoteExec ["hint"];
{ moveOut _x; sleep 1; } forEach _players;
sleep 5;

#

@spark rose ^

spark rose
#

i'll give it a try

#

🙂

spiral fractal
#

is there command to disable ACE fatigue that happens after player get injured? I use ace_medical_treatment_fnc_fullHeal but it not removing the fatigue

exotic flax
#

player setFatigue 0; ?

spiral fractal
#

I did, but I think ACE using different fatigue

exotic flax
#

Well, check the ACE documentation and code, of it exists it should be there

spark rose
#

@winter rose They still all are dead upon exiting (maybe before i can't tell), but only in a dedicated environ

#

even though damage is not allowed until well after ejection

#

and their damage is set to 0 beforehand

#

???

winter rose
#

*magic*

try eject action?

spark rose
#

haha it is magic!

#

it makes no sense!

exotic flax
#

all magic is just unknown science

winter rose
#

I strongly believe in an Arma 3 DLL deity and you can't prove me wrong

spark rose
#

LOL

#

i need to print that and put it on my wall @winter rose

spiral fractal
#

you use setDamage instead of allowDamage false

#

maybe:{_x setDamage 0; _x allowDamage false;} forEach _players;

spark rose
#

@spiral fractal I use allowDamage false in the initServer.sqf

spiral fractal
#

try it

spark rose
#
{ [_x, false] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];
high silo
#

So I have a script that spawns units in:

_HVT010 = [[6550.99,6086.35,0], EAST, ["rhs_msv_emr_officer"], [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;

I then run a separate script to wait for that unit to be killed: ```sqf
execVM "\scripts\Meeting1\HVTS1.sqf";


All thats inside the script is.

```sqf
waitUntil { not alive _HVT010 };

_layer2 = cutText ["<t color='#4169E1' size='5'>Mission Update!</t><br/>HVT has been killed...", "PLAIN", 0.5, false, true];```

However it doesn't work anyone know why?
winter rose
#

because _HVT010 is a local variable, and it doesn't exist in the execVM scope

high silo
#

How would I change it to a global variable, I tried "setVehicleVarName" but didnt work when I tested it.

winter rose
#

what you could do is

_HVT010 execVM "\scripts\Meeting1\HVTS1.sqf";
```and in the HVTS1.sqf, have```sqf
params ["_vehicle"];
waitUntil { not alive _vehicle };
(...)
high silo
#

Will try that

#

Doesnt work

winter rose
#

are the execVM and the BIS_fnc_spawnGroup in the same file…?

high silo
#

Yes

winter rose
#

show me what you got!

high silo
#

Will do

winter rose
#

Exactly ^ what I had in mind 😄

spark rose
#

@winter rose nailed it. I put a trigger on the start location activated by any player present with sqf { [_x, false] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];

winter rose
#

@high silo params variable names must be prefixed with an underscore!

spark rose
#

now they live

winter rose
#

nice! we got it working take that, A3 gods!!1! ⛈️

high silo
#
params ["_HVT010"];
waitUntil { not alive _HVT010 };
#

Like that

winter rose
#

yyyup

high silo
#

Will save and test.

winter rose
#

but if this is the only code you have in that file, no need for an execVM, you could simply spawn it

high silo
#

The scripts also gonna call in QRF and shizzel, so thought it would be more simple for my little brain

winter rose
#

okido, no problem

high silo
#

Still doesnt work

winter rose
#

what have you done this time

high silo
#

She started it

wise mulch
#

Hey, can I get some help with a quick script ?

winter rose
#

depends on your script!

whole plinth
#

What's the spawn code for the spawning of say a rhs ammo box???

winter rose
#

less interrogation marks, more classnames please!
use createVehicle @whole plinth

whole plinth
#

For example heres the code for spawning a arsenal---- spawn BIS_fnc_arsenal;

winter rose
#

no.

wise mulch
#

I'm playing "Old Man" and I have a bugged Task which can not be completed anymore, is there a script which I can type in the console to just "complete" the task ?

spark rose
#

okay Lou, last thing. If anyone on the team accidentally teamkills, they are removed from the squad. I don't want that to happen. There's got to be just an option for it somewhere right?

winter rose
#

@wise mulch I don't think so, many scripts must be intertwined in this scenario - it is unfortunate, but you might have to take an earlier save

wise mulch
#

I've found this Install_Virus setTaskState "Succeeded"; online but it doesn't work ... Also, on the same site it was something about weather (I wanted to turn off the rain) and it worked, but only for like 1-2 seconds then the rain came back

winter rose
#

@spark rose well, technically they are -not- removed from the squad, but they are removed as a leader (if they were) and get shot

you could try playing with addRating - e.g from the very beginning, player addRating 10e10 and you will have plenty of TeamKill licences :p

wise mulch
#

Well ... I was trying to do the task and I had a save right before completing it, and every time I would try to complete it, it wouldn't work

spark rose
#

got it

#

thanks Lou

wise mulch
#

And then I had a lot of fighting to do, and then moved onto a few other things and I do not have a previous save ...

twin robin
#

guys, quick question, i copied the bis sector init script and made a few modifications, but when i want to stop de module default initialization via "_sector setVariable ['BIS_fnc_initModules_disableAutoActivation', true, true];" it doesnt give a damn about that and simply uses the default init script instead of mine

wise mulch
#

@winter rose I was thinking, maybe I'm not writing the name of the task properly ...

whole plinth
#

_signal = "SmokeShellGreen" createVehicle (position _this); _signal attachTo [_this, [0,0,0]]; 0 = ["AmmoboxInit", [_this, true]] spawn Box_NATO_Wps_F; (Does this look right?)

winter rose
#

no.

exotic flax
#

If I understand it correctly you want to spawn an ammo box, attach a green smoke to it and make it an Arsenal, correct?

whole plinth
#

Almost correct.

#

No arsenal just a rhs ammo mags box. But this is being used in the supply drop module the a3 has by default.

#

The thing keeping me from doing it is the classname which I think I got? But not for sure if i got the right classname. Still got to test the code of above and see if the new class name is the right one.As I got no real idea what it's.As there is no clear way I know of where to find side classname.

exotic flax
#

rhsusf_mags_crate is the correct classname for the "RHSUSF Ammo Crate"

#

so something like should work:

_crate = "rhsusf_mags_crate" createVehicle (position _this);
_signal = "SmokeShellGreen" createVehicle [0,0,0];
_signal attachTo [_crate, [0, 0, 0]];
whole plinth
#

I'll give that code a try.

winter rose
#

createVehicle you say 🤔

exotic flax
#

Ammo crates are also in CfgVehicle afaik

winter rose
whole plinth
#

U happy now @winter rose

winter rose
#

it's not me you should satisfy really, it's the Arma gods!

exotic flax
#

all hail daddy Lou

whole plinth
#

Well k,The code work kind of we have two ammo boxes ones nomal supply drop then the RHS one attacted to the parachute spawned. umm Well I quess a3 gonna be a3.

#

nvm

eager mesa
#
class ListBoxMembers: OrgSplitter_RscListBox
        {
              idc = 102524;
            x = 0.4195 * safezoneW + safezoneX;
            y = 0.400 * safezoneH + safezoneY;
            w = 0.155 * safezoneW;
            h = 0.18 * safezoneH; 
            style = LB_TEXTURES + LB_MULTI;
            onLbSelChanged = "[] call menuUpdate;";
        };

Using LB_MULTI to select multiple items in a list box. 'onLBSelChanged' is only called when you left click, but to select multiple items you need to either Ctrl + Click or Shift + Click

#

anyone got any ideas?

twin robin
#

im not too good with GUI but have you tried onLBListSelChanged ?

eager mesa
#

will try now

#

doesn't call it at all with onLBListSelChanged

still latch
#

Hello. At which step mission modules initialize in multiplayer?
preInit, Init, postInit?
Is it safe to check at postInit that module exist and initialized on mission?

still forum
#

between preInit and init

#

yes, postINit all is done

still latch
#

nice. thx

twin robin
#

@still forum In my case i want to force the module to call my init script instead of the default one. but even after adding "_sector setVariable ['BIS_fnc_initModules_disableAutoActivation', true, true];" it uses the default one

still forum
#

dunno

twin robin
#

shiieeet....

winter rose
#

@twin robin question:
why do you need the module if you are not going to use it? you could use a "normal" Game Logic?

twin robin
#

if i use the normal game logic with BI script, it doesnt work.

#

i only want to use custom icons for the sectors depending on some variables, nothing else

#

😆

#

the whole thing exectures in preinit without issues

#

but i cant stop the initialization with the default script

jagged elbow
#

im trying to create an if statement that checks if a task is complete, ive had a look at the wiki and to my knowledge it seems correct syntax wise but it throws an error.
This is the code:

if (taskState task1 == "SUCCEEDED")then {
     hint "Completed";
   };
#

the hint part will be changed for something else once i know the is statement works

hollow thistle
#

what's in task1 variable?

#

throws an error without an error from rpt is not that much helpful.

#

Try to paste it here or smth.

jagged elbow
#

the task1 is the task id

hollow thistle
#

as in string?

#

taskState gets Task type

#

you should use BI Tasks framework.

spark turret
#

im using waypoint type "GETIN" to make a group board a truck, but the waypoint position isnt precise enough for the group to recognize the truck as the target, so they dont get in. can i attach a waypoin to a truck?

or how do i realiably order a group to board a vehicle by script?

tiny wadi
#

Is there a way to check the animations of a class before I create it? What I want to do is I have a list of objects I need to create, but if it has no animations I'd rather create it as a simple object instead of a normal createVehicle

#

animationNames requires an object reference

winter rose
#

maybe you can get them from the object's config

tiny wadi
#

Yeah I am looking into that now, seems like I can just get all of the subclasses of the animations class from the config and just do a count check

radiant spindle
#

Hey guys, I need some help with a script I'm making, this one https://pastebin.com/3ZSLetDm
For some context, what this does is it creates an enemy at a set distance (200 in this case) of the unit "TeamLead01" , in a random direction, who then stalks a target group (in this case, "alpha").
Now my goal is to check this enemy's position so it NEVER spawns close to another player, but I don't know how to approach it. Some help would be appreciated, thanks guys!

spark turret
#

get distance to all players, if one is smaller than 200m, get new random position, repeat until condition is met. easiest and dirties approach 🙂

vagrant urchin
#

Hey, I'm trying to get some objects inside one of the vehicle of RHS.
I'm using attachTo and it works when looking from the outside, but from the inside the object is just not there.

#

Is there anything that can be done to fix this?

winter rose
#

nope, from a first-person POV your vehicle always goes above everything else (why you can see your feet when walking on somebody)

vagrant urchin
#

so there's nothing to do? :/

#

that sux

winter rose
#

languaaage 👀

spiral fractal
winter rose
#

that's apparently it - but you can use your own

spiral fractal
#

Thank you!

woeful mirage
#

anyone knows why i cant createRope doing with two balloons? Land_Balloon_01_air_F I try before balloon2 enableRopeAttach true; and balloon1 enableRopeAttach true;

winter rose
#

how do you create ropes?

woeful mirage
#

yeah but i want createrope with player and balloon or balloon and balloon. i can only attach vehicle and balloon... i dont know why

winter rose
#

…see my message

#

From must be a transport vehicle

woeful mirage
winter rose
#

see the comments

spiral fractal
#

how can I check if object is wheeled?

#

I know there is isKindOf command but I dont know what classes there are and I cant find the full class hierarchy list

#

oh I think I found it

woeful mirage
#

idk.

light moat
#

Heya! i want a custom sound file to originate from a radio and i have looked on forums to no avail

#

Im pretty new to scripting so can anyone tell me what im doing wrong

#
class CfgSounds
{
    class BBCRadio4
    {
        name = "BBCRadio4"; // Name for mission editor
        sound[] = {\Sound\BBCRadio4.ogg, 0.8, 1.0};
        titles[] = {0, ""};
    };
};```
#

this is the line i have for the Radio file itself

#

This is the line i have in the radio objects init
_soundSource = createSoundSource ["BBCRadio4", position player, [], 0]

lapis ivy
#

Hey. I need to apply the post processing effect to all players in multiplayer. Here is what I have:

PPeffect_colorC = ppEffectCreate ["ColorCorrections",1500];
PPeffect_colorC ppEffectAdjust [1.01,1.15,0,[0,0.38,0.67,-0.03],[1,1,1,1.1],[0,0,1.04,0]];
PPeffect_colorC ppEffectEnable true;
PPeffect_colorC ppEffectCommit 0;
PPeffect_grain = ppEffectCreate ["FilmGrain",1550];
PPeffect_grain ppEffectAdjust [0.00543673,0,1,1,0];
PPeffect_grain ppEffectEnable true;
PPeffect_grain ppEffectCommit 0;```

Do I need to create a class `CfgPostprocessTemplates` in the Description.ext file?
I just don’t quite understand how I should do it right.
winter rose
#

@lapis ivy you could either use a class, indeed, or remoteExec a script (or put it in initPlayerLocal.sqf)

lapis ivy
#

@winter rose
If a player is killed and respawn, will this work?

winter rose
#

@lapis ivy yes afaik

light moat
#

ah ok

#

thanks

still latch
#

is there any way to check existence of file in addons. Icons/textures/audio?

robust hollow
#

not sure if this works with those types of files but you can give it a go. I dont believe there is a proper way.
http://killzonekid.com/arma-scripting-tutorials-kk_fnc_fileexists/

KK_fnc_fileExists = {
    private ["_ctrl", "_fileExists"];
    disableSerialization;
    _ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1];
    _ctrl htmlLoad _this;
    _fileExists = ctrlHTMLLoaded _ctrl;
    ctrlDelete _ctrl;
    _fileExists
};
radiant spindle
#

I managed to setup a script that makes what I described earlier, here: https://pastebin.com/wkjd01zh
The AI spawns and stalks the group named "alpha". My question now is: how can I change it so the enemy AI stops spawning after everyone in alpha is dead? even if the script runs again.

radiant spindle
#

Ok, simply using an alive count and exitWith did the trick!

sage flume
#

so I have a Campsite composition, oh maybe 6 or 7 items like a couple of tents, fireplace, boxes, etc and I want it to spawn in the woods given the smallest clearing. I'm thinking that for the clearing maybe 30 to 50 feet. I have tried every combination I can think of with this code but I want to ask if anyone can give an idea.

#

_fe = _pos0 isFlatEmpty [10,200,0.25,3,0,false,objNull];

#

This is what I started out with, not what I ended up trying.

spiral fractal
#

how can I execute plain code on server (without function)?

spring lodge
#

init.sqf?

spiral fractal
#

I want to execute in in addaction

#

or is it possible to make file with all the functions that server will know about?

#

when I test my code in debug console I create function and then use remoteExec to call it and press local exec, nothing happens, wehn I press global exec it works and then if I press local exec it also works. like if server stores the function somewhere

#

for example: reset_veh = {.. code .. }; [] remoteExec ["reset_veh", 0];

#

oh ok I think I understand now

robust hollow
#
reset_veh = {.. code .. };
[[],reset_veh] remoteExec ["call",-2];

the game cant execute a function if it isnt defined, so if it is only defined on the server you would need to remotexec the function content in a call.

spiral fractal
#

why -2?

robust hollow
#

0 executes on everyone and the server. -2 executes on everyone but the server.
use whichever depending on where the code is supposed to execute.

spiral fractal
#

ok Thank you! I will try it now

#

it works!blobcloseenjoy

light moat
#

I keep getting an end of line syntax error

#

but idk why
My lines should be fine

class CfgSounds
{
    class BBCRadio4
    {
        name = "BBCRadio4"; // Name for mission editor
        sound[] = {\Sound\BBCRadio4.ogg, 0.8, 1.0};
        titles[] = {0, ""};
    };
};```

im trying to have a sound originate from an object, in this case, a radio object


```nul = [thisTrigger] spawn {while {true} do {(_this select 0) say3D ["BBCRadio4", 500, 1]; sleep 57;};};```
#

what am I doing wrong?

robust hollow
#

can you paste the error? does it give a line number or something

light moat
#

I will check

#

@robust hollow just says config : some input after EndofFile

robust hollow
#

my only issue with ur snippet is the sound file path isnt in a string, but i think that usually fixes itself.

#

try using a tool to find the error. or dm me ur config if u want, ill try to find it.

light moat
#

@robust hollow attempting to dm

smoky verge
#

is there a way to animate a large amount of units with the same animation?

light moat
#

heya! my custom audio file wont play, does anyone here possibly know why?

#

im trying to have a sound originate from an object, in this case, a radio object

null = [thisTrigger] spawn {while {true} do {(_this select 0) say3D ["BBCRadio4", 500, 1]; sleep 57;};};

light moat
#

nvm worked!

celest ferry
#

yo guys, can anyone help me out with my basic.cfg? can't figure what to put in it even though I've got all my dedicated server specs right there;(

light moat
#

@celest ferry the cfg for the server?

celest ferry
#

@light moat yeah

light moat
#

sure thing, what are you trying to do?

celest ferry
#

putting customs entries for MaxMsgSend, MaxSizeGuaranteed, MaxSizeNonguaranteed etc that fits with my dedicated server specs

robust hollow
#

not quite the channel for it. try reading the recent conversation in #server_admins for some guidance.

winter rose
#

0 executes on everyone and the server. -2 executes on everyone but the server.
@robust hollow @spiral fractal beware, as not all servers are dedicated but sometimes player-hosted

tough abyss
#

hey anyone now how to make a trigger to smoke grenade effect plus looping/auto when player comes back to the radius . thxs im a noob with this

austere sentinel
#

the distance testing should be pretty trivial (look into distance on the wiki, its a simple comparison to figure out if they're within range)

tough abyss
#

thxs my friend o> @austere sentinel

austere sentinel
#

Theorycrafting here (i.e. I haven't tested yet, don't want to waste the time if someone else already knows the answer)

1: Does putting global vars in a function library class with preInit=1 make them available to the rest of the function lib?
2: Is this considered bad practice/unsafe?

queen cargo
#

At best you only have one init function

#

And put init stuff in there

austere sentinel
#

yeah that was the plan

stark granite
#

Anyone know if I can temporarily disable simulation on all objects for the first few seconds of the mission? Seems like vehicles are spawning before the 'hide terrain object' module, causing one hell of a fuster cluck at the spawn base, any ideas?

winter rose
#

nice language workaround 😁
all objects as in mission objects?

// server-side
private _stuff = allUnits + vehicles;
{ _x enableSimulationGlobal false } forEach _stuff;
sleep 3;
{ _x enableSimulationGlobal true } forEach _stuff;
stark granite
#

Perfect!

daring pawn
#

Vanilla arma doesn't seem to have any way to see if a particular limb is injured on "Arms" or "Legs" with any of the event handlers I can see or the getHit command.

ACE seems to be able to detect damage for their system on particular limbs and I've been trawling their code to see how they do it but i'm at a loss?

Is anyone aware of how ACE detects damage on a particular limb or if there is infact a vanilla solution?

spark rose
#
hideObject bridge; 
#

doesn't work on dedicated

#

remoteExec?

daring pawn
#

the hide terrain object does work in multiplayer

spark rose
#

that's true, this is called from an sqf which isn't working at the moment in dedicated, but does work in a player hosted environ

daring pawn
#

call that on the server

spark rose
#

aha

stark granite
#

@winter rose will that cover obects too? Such as buildings placed where there would otherwise be a terrain vehicle

winter rose
#

I think so yes

stark granite
#

Sweet, thank you 🙂

daring pawn
#

idk if my question is more a #arma3_config thing to see if its easy enough to do. I'm making changes to the vanilla medical system for use in my group so that, using ace_interaction, individual limbs need to be healed rather than just a global body heal based on damage. I'm trying to find damage values of each limb but i've come a bit stuck with only hitHead,hitChesthitLegs,hithands being available

winter rose
#

there is no left/right arm distinction afaik

slate cypress
#

is there any module for spawning waves of AI where the number of AI increase every wave?

#

or do i script this

winter rose
#

script

slate cypress
#

ok thanks

daring pawn
#

Yea that's what I was referencing. I'm having a look at how ACE Adds defined hitpoints and it appears in
https://github.com/acemod/ACE3/blob/5a4487f1eae7173d9551d2df9eff7f0ca675aca4/addons/medical_engine/CfgVehicles.hpp here and
https://github.com/acemod/ACE3/blob/16ed2a82c2d3b743da83dc0455c1f56f1837ff76/addons/medical_engine/script_macros_config.hpp here

They seem to add an extra 4 hitpoints to different base classes as class HitPoints but the wiki for ArmA Config reference for hitpoint is moot

#

But I'd need to add a hitpoint to the LOD it seems? Which is what confuses me about ACE's method

#

I am creating this content in a mod as well btw

lapis ivy
#

Hey. I want to make a periodic random air strike. I put the module "Air Support", but the value "radius of placement" is always reset to 0 after saving and loading the mission. Perhaps there is some kind of script, so that at the start of the game this module randomly selects its location within a radius of 300 meters?

winter rose
#
if (isServer) then { this setPos (this getPos [(sqrt random 1) * 300, random 360]); };
#

@lapis ivy ^

lapis ivy
#

Thanks!

austere sentinel
#

Is there a way to make attached objects not interact with players
i.e. I attach a crate to a player for them to move, but don't want them to be able to kill others with it

lapis ivy
#

Is it possible to include two different audio recordings through "playmusic"? Or is it better to use "playsound"?

winter rose
#

@austere sentinel try disableCollisionWith perhaps

#

@lapis ivy one music at a time, one sound at a time

lapis ivy
#

I need to start one track at the start and loop it until the end of the game, and after the briefing turn on another one. It is necessary for the atmosphere. Will they start and play two tracks at the same time?

#

And did I make the loop right? Will this work for everyone in multiplayer?

while {warbackground} do {
   playmusic "war_background";
   sleep 155;
};
winter rose
#

one music at a time
if you playMusic another one, the previous one will stop.

ornate marsh
#
[doubletap, true] remoteExec ["hideObjectGlobal", 2]; 
doubletap addAction   
[  
    "Get Double-Tap",   
    {  
        params ["_target", "_caller", "_actionId", "_arguments"];  
 timeFiring = -1;  
 idPerson = _this select 1;  
 _sus = [] spawn {  
 doubletap say3D "open";  
 sleep 0.8;  
 doubletap say3D "swallow";  
 sleep 0.8;  
 doubletap say3D "break";  
 sleep 0.8;  
 doubletap say3D "belch";  
 idPerson addEventHandler ["FiredMan",{  
 params ["","_weapon","_muzzle"];  
 typeWeapon = _weapon call BIS_fnc_itemType;  
 switch (typeWeapon select 1) do {  
  case 'SniperRifle' : {timeFiring = 0.5};   
  case 'AssaultRifle' : {timeFiring = 0.5};  
  case 'Handgun' : {timeFiring = 0.5};  
  case 'Rifle' : {timeFiring = 0.5};  
  case 'SubmachineGun' : {timeFiring = 0.5};  
  case 'MachineGun' : {timeFiring = 0.5};  
  case 'Mortar' : {};  
  case 'GrenadeLauncher' : {timeFiring = 0.5};   
  case 'BombLauncher' : {};   
  case 'MissileLauncher' : {timeFiring = 0.5};   
  case 'RocketLauncher' : {timeFiring = 0.5};   
  case 'Cannon' : {};   
  case 'Throw' : {};   
 };  
 if (timeFiring isEqualTo -1) exitWith {};  
 (vehicle idPerson) setWeaponReloadingTime [(vehicle idPerson), _muzzle, timeFiring];  
 }];  
 };  
 if (timeFiring isEqualTo -1) exitWith {};  
    },  
    [],  
    1.5,   
    true,   
    true,   
    "",  
    "true",  
    5,  
    false,  
    "",  
    ""  
];

this script is working in singleplayer, but isn't working on dedicated. I'm thinking it's something to do with the event handler. I'm essentially wanting people to click on a vending machine, and it then doubles the person's fire rate.

wispy cave
coarse sedge
#

Hello,

If you can please help a noob finish his first mission...

I have a trigger which activates on civilian presence.
It activates as soon as one civilian is inside it.
I need it to activate after 7 civies are inside.

I got this bit from the internet and placed it in condition:

count ({(alive x) && (side _unit == civilian)} forEach units group thisList) > 6;

What i got is a ''generic error in expression''

winter rose
#
count (
  {
    (alive x) && (side _unit == civilian)
  } forEach units group thisList
) > 6;
```~~yes, you have one too many parenthesis~~
#

wrong count syntax 🙃

#
{ alive _x && side _x == civilian } count thislist > 6
```@coarse sedge
#

(also, undefined _unit, wrong usage of group on thislist that is an array)

coarse sedge
#

@winter rose well, the error msg is gone, but still the trigger does not activate

winter rose
#

what do you expect it to do?

#

in human words

cold pebble
#

@daring pawn the normal man should have more then head, chest, legs and hands. Are you using a modded unit by chance?

surreal peak
#

@ornate marsh idPerson should be a private variable, same with typeWeapon and timeFiring

coarse sedge
#

@winter rose
I have a trigger which activates on civilian presence.
It activates the following :

[leader_BLUEFOR,BLUrequester,BLUprovider_ARTY] call BIS_fnc_addSupportLink;

As you can see, it makes the arty support available as soon as there is 1 civilian inside the trigger (tested).
I need it to activate after 7 civies are inside. The plan is the get the civilians to safety and then have artillery support available

surreal peak
#

also what is ```sqf
if (timeFiring isEqualTo -1) exitWith {};
(vehicle idPerson) setWeaponReloadingTime [(vehicle idPerson), _muzzle, timeFiring];
}];
};
if (timeFiring isEqualTo -1) exitWith {};
},
[],
1.5,
true,
true,
"",
"true",
5,
false,
"",
""
];

ornate marsh
#

Did that Fred, didnt work

#

regarding the private var

surreal peak
#

yeah im not suprised it didnt work, would have fixed a prob which would have arrised otherwise

ornate marsh
#

the setReloading thing is whats actually doubling fire rate

surreal peak
#

why are they both checking for isEqualTo -1

ornate marsh
winter rose
#

@coarse sedge the code should work, maybe add this && before it

surreal peak
#

@ornate marsh u in TS? Dont wana clog up chat with Qs

ornate marsh
#

ill jump in

coarse sedge
#

@winter rose yep, it works! it did not register their presence, i think it's becouse they were inside a vehicle with an indipendent driver

winter rose
#

ah yes, vehicles are not counting crew

coarse sedge
#

thank you very much, you just put an end to 12h of torture 🙂

winter rose
#

pleasure!

daring pawn
#

@daring pawn the normal man should have more then head, chest, legs and hands. Are you using a modded unit by chance?
@cold pebble

It does not no. In regards to things modifiable by any engine code, its only hitHead, hitBody, HitHands, hitLegs - https://community.bistudio.com/wiki/setHitPointDamage
https://community.bistudio.com/wiki/getAllHitPointsDamage

"hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"
Theres a few others but they're not specific left or right arm/leg.

I looked at it in config viewer, thats all there is.

cold pebble
#

Ah yes thats what I expect

daring pawn
#

So thats part of my issue atm. May have to work in the method ace uses but i'm still figure it out. Theres very little intel about class hitpoints

silver linden
#

I'm trying to see if something is possible but I don't exactly know how or where to start.

A mission end script activated by a trigger which causes your screen to fade to black and the mission to end without the standard "MISSION COMPLETED" in the screen with the digital noises.

This is how far I've gotten so far:

        "<t color='#800000' size='5' shadow='0'></t>",       
        "BLACK FADED",       
        5,       
        true,       
        true       
    ];  
};```
#

I got the black screen working haha

winter rose
#

do you happen to want the "classic" ending, though?

silver linden
#

Just a black screen fading in and then after a few seconds have it boot you out of the mission back to the slot selection screen

#

it's for MP

#

It's my first time trying to do this stuff.

winter rose
#

oh wait, without the "mission completed"

silver linden
#

Yes

winter rose
#

well, either

["myEnding", true, 5, false, true] call BIS_fnc_endMission;
```or```sqf
cutText ["","BLACK OUT", 5];
sleep 5;
endMission;
silver linden
#

["myEnding", true, 5, false, true] call BIS_fnc_endMission;
Works!
Thank you!

stable badger
#

Hi Everybody.
I want to create a whitelist with a text file.
With a preprocess for get the array on the txt file. It's for i can add a PlayerUID without need to restart the mission

tough abyss
#

Hi, I'm trying to add an action to all players which would run a function.

The function should check if the player is either: looking at obj1 and the distance between them is < 500 OR the same check with obj2.

This code snippet is located in initPlayerLocal.sqf.

I'm getting the following error: Missing ; at the line "systemChat "No Match..." at the end of test_fnc_scan. What might be causing this?

test_fnc_scan = {
params [["_scanner",objNull]];
    _scanner = this select 0;
    _callerCursorTarget = cursortarget;
    systemChat "Uploading picture to server..";
    sleep 2;
    if (((_callerCursorTarget == obj1) AND ((_scanner distance obj1) < 500)) OR ((_callerCursorTarget == obj2) AND ((_scanner distance obj2) < 500))) then
    {
        systemChat "Target confirmed.";
    };
    else
    {
        systemChat "No match. Either wrong vehicle or too far <500 m";
    };
};
    
//add scan action to object
player addAction [
    "Scan for target",
    {
    params [_target, _caller, _actionId, _arguments];
    _scanCaller = _caller
    _scan = [_scanCaller] spawn test_fnc_scan;
    },
    [],
    0,
    false,
    true,
    "",
    "true",
    -1
];
stable badger
#

replace :

 };
    else
    {

by

 }
  else
 {
#

Don't close the first scope if {} when you have an else !

warm swallow
#

hey huys!

#

guys!

#

Im trying to make a custom airfield, but the amount of grass cutters i have to place down lags the game out, even when using a script to do it. Is there any other method or change I can make to the script to make it not lag out? Thanks for any suggestions.

tough abyss
#

Thanks! It seems that the code now runs, but I get an error for undefined variables _scanner and this in the test_fnc_scan. Is the _scanner variable not passing correctly to the function or what might it be?

stable badger
#

Try like that :

test_fnc_scan = {
params [["_scanner",objNull]];
    _scanner = this select 0; //Here is the caller on your addAction.
    _callerCursorTarget = cursortarget;
    systemChat "Uploading picture to server..";
    sleep 2;
    if (((_callerCursorTarget isEqualTo obj1) || ((_scanner distance obj1) < 500)) OR ((_callerCursorTarget == obj2) AND ((_scanner distance obj2) < 500))) then
    { systemChat "Target confirmed.";
    } else {
      systemChat "No match. Either wrong vehicle or too far < 500 m";
    };
};
    
//add scan action to object
player addAction [
    "Scan for target",
    {
    params [_target, _caller, _actionId, _arguments];
    _scanCaller = _this select 1;
    _scan = [_scanCaller] spawn test_fnc_scan;
    },
    [],
    0,
    false,
    true,
    "",
    "true",
    -1
];
#

@tough abyss

real tartan
#

I am trying to find _ctrl or _display for tooltip when you hover over some item in inventory. Anybody got idea how to find it? I want to add something there. here is picture what I mean. https://i.imgur.com/ZDURrmP.png

stable badger
#

On a modded item or on the arma 3 item ?

real tartan
#

arma 3 item

stable badger
#

Huuum i look that for you

#

Look with that :
lbSetTooltip [101, 1, "tooltip"];

cunning crown
#

Hi Everybody.
I want to create a whitelist with a text file.
With a preprocess for get the array on the txt file. It's for i can add a PlayerUID without need to restart the mission
@stable badger With loadFile / preprocessFile, launch Arma with the -filePatching parameters and place your whitelist.txt in Arma 3 root directory and then you can just use private _ids = call compile loadFile "whitelist.txt" to fetch all the ids. Keep in mind that it's sqf so you need to enter valid code in there (i.e: an array of ids) or write an Arma Extension https://community.bistudio.com/wiki/Extensions (shouldn't be to hard, regardless of the language you chose) and then juste parseSimpleArray the output and do whatever you want with it (it has to be done from the server, there is no way to do that from the client afaik).

real tartan
#

is there a command to get all child controls of _display ?

stable badger
#

Inventory display ?
IDD is 602 and child are 633, 638 and 619.

Now you can use the selectedIndex 😄

#

with this you can do something 😄
addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
}];

real tartan
#

how do you get those specific numbers, show me the way master 😄

cunning crown
stable badger
#

Heyoxe faster than me 😄

cunning crown
#

And if you want more, you can search in the config (either the AiO or directly in-game), there are also a bunch of lists with most utilized idds/idcs and the internet

real tartan
#

when I put allControls (findDisplay 602) in debug console, it shows me empty array

cunning crown
#

Do you have your inventory opened?

real tartan
#

can't, ESC will close inventory

stable badger
#

For help you. Go to the config in game and search RscInventoryDiary (something like that) and you can see all IDD and IDC

cunning crown
#

Some are missing. I usually use:
https://docs.google.com/spreadsheets/d/1mfvetmBp2iC44rOzQwNnvlSzQyXAYbkOEw2vhFLLJGg/edit#gid=0 (Spreadsheet with Arma 3 IDDs)
https://dbmst.blogspot.com/2013/05/arma-configfile-display-idd-list.html (Korean website with IDDs and images of the coresponding display)
And if I do not find what I want or enough details: https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/ with any decent editor it should be easy (or do as Bastien said, it works too)

winter rose
distant oyster
cunning crown
#

It still works, mostly never had to dig trough the config, unless I was doing some weird stuff with the defaults displays 😄

finite sail
#

I use that too @cunning crown , not that I really understand the stuff that use IDCs

#

is it still usefully indated?

#

Oh, it was @slim verge , replying, not you

#

apologies 🙂

cunning crown
#

Np ^^

finite sail
#

Ugh.. @distant oyster

#

im making such a mess of this, completely sober

cunning crown
#

But I can ansewer anyways; IDDs are for display (think of it like a page), and IDCs are for each individual element of that page. And yeah, it's still usefull, I don't think BI changed the IDDs along the way (and it would be a bad if the every did it)

surreal peak
#

That's your mistake, 99% of the best programming is done drunk @finite sail

finite sail
#

I'm well aware of that, lol

#

the fact that its monday isnt going to put me off

#

TUESDAY

#

ffs

urban tiger
#

I'm likely completely overlooking something so simple. Is there a way to have drawicon3d display a name for a single unit

winter rose
#

yes…?

#

the text property

#

@urban tiger ^

urban tiger
#

Yep, I'm an idiot 😂 completely overlooked that param

winter rose
#

Glad to be of some help 😁

urban tiger
#

complex sure. something so simple.. ^

winter rose
#

blease add description to link kthxbai

spiral fractal
#

why I cant getVariable from server? missionNamespace getVariable "var"; in console works only when I press server exec, tried remoteExec also didn't worked

robust hollow
#

if it only exists on the server, then only the server can get it like that.

spiral fractal
#

how can I make server show it to all users?

robust hollow
#

publicvariable “var”; after it is set

spiral fractal
#

with CBA_fnc_notify

robust hollow
#

idk, never used cba

spiral fractal
#

but I think its not updated

#

when I set it publicvariable “var”;

#

if it changes later

robust hollow
#

you publicvariable it again then. as long as it doesnt broadcast too frequently and the data size isnt too big it should be fine.

finite sail
#

you have to publicvariable something when you change it

spiral fractal
#

can I call publicvariable before I want to show it instead?

finite sail
#

yes

#

and each time the variable changes

#

good for getting the variable from the server as opposed to the server sending it to clients

spiral fractal
#

call BIS_fnc_getServerVariable; will work from client or I have to use remoteExec?

#

I have trouble understanding the client/server in arma

finite sail
#

it works from client

#

it 'fetches' the data from the server. as long as the data is a nonlocal (ie global) variable on the server, it works fine

spiral fractal
#

when I execute this command using local exec I get nothing, then I press global exec and get the value, then when I press local exec again I get the value, why?

finite sail
#

if you press global, you've grabbed the variable to every client and server

#

then if you press local, its' already local

spiral fractal
#

when I use local exec I have to press it twice

finite sail
#

are you using missionnamespace as the name space in the function?

spiral fractal
#

yes

finite sail
#

sometimes, it's a little slow, though ive never known it take more than acouple of ms

#

are you using the BIS debug to do this?

spiral fractal
#

I am in debug console, connected to dedicated server on my PC

finite sail
#

the dedicated server, tis a different machine?

#

somwhere else?

spiral fractal
#

no

#

I run the arma3server.exe

finite sail
#

right. and where is the client that you are running the getservervariable function from

spiral fractal
#

on the same PC, I run arma and connect to the server

finite sail
#

the same pc?

spiral fractal
#

yes

finite sail
#

the server and te client are the same pc?

spiral fractal
#

yes

finite sail
#

ok, and you are running the server exe and the game client as two seperate processes

spiral fractal
#

yes

finite sail
#

that should work as expected. the server and the client should be different instances.

#

ok, let me test here because ive never had the behaviour you describe

#

ok, im not seeing the issue you are

spiral fractal
#

I will add sleep

finite sail
#

mm yeah, probably not the issue, especially if the 2 instances are on the same box

#

they will have 0 ping

spiral fractal
#

I manage to get 12 ping 😄

finite sail
#

thats 12 ms, its still almost instant

#

so, let me get this right

#

you have a global variable on the server?

spiral fractal
#

I think its global because it is used everywhere

finite sail
#

does it start with an underscore?

spiral fractal
#

no

finite sail
#

its global, whats it called?

winter rose
#

this function should be called from a scheduled environment, which the debug console is not

finite sail
#

it still works in practice

spiral fractal
#

its set inside mission.sqf inside if (isServer) then {

winter rose
#

it should freeze the game until the result arrives, I believe - unless it is spawned

#

but dismiss what I say, it's imprecise (and late).

finite sail
#

the mission is actually running?

spiral fractal
#

yes

finite sail
#

you are right, lou, it should be scheduled, but in practice, unless the server is mullered, it works within a couple of cycles

#

i dunno, @spiral fractal , it's working for me

#

how are you launnching the srrver?

winter rose
#

definitely too late, I can't read code 🤣

finite sail
#

🙂

winter rose
#

I'm off 👋 be nice to each other

finite sail
#

ttfn

#

keep it clean

#

@spiral fractal , are you using a server launcher?

spiral fractal
#

I use TADST

finite sail
#

can you get other variables from the server using the function?

#

other known variables

spiral fractal
#

only on 2nd local exec

finite sail
#

is battleye running?

spiral fractal
#

first click I get the default value

#

no BE

finite sail
#

this might be an artifact of the console like lou suggests, though its working for me on first press

#

also, i use other debug consoles and they show the same

#

it might actually be that it is working,

#

are scripts that rely on the variable failing with undefined variable?

spiral fractal
#

no, everything works fine, I am editing existing mission

finite sail
#

unless there's a compelling reason to use getservervariable to 'fetch' the varoable, id be using publicvariable tbh

#

as long as you aren't doing more than once in a few seconds and you aren't sending massive strings

spiral fractal
#

I dont want to edit every script that changes it to add public "var"

finite sail
#

i can imagine

#

what is the variable name?

#

not that it matters 🙂

spiral fractal
#

"btc_global_reputation"

finite sail
#

oh yeah, hearts and minds

spiral fractal
#

I want to add admin only command so he will be able to check rep

#

so making so many changes just for it is not worth it...

finite sail
#

yes, this would be a good usecase for getservervariable

#

im wondering if the variable isn't in missionnamespace, has the author tucked it away on the servers profilenamespace, or similar?

spiral fractal
#

it is set in mission.sqf in if (isServer) then {

finite sail
#

so its global

spiral fractal
#

yes

finite sail
#

in the BIS debug

#

type the server name into the top box,

#

and press server xexec

#

exec

spiral fractal
#

BIS debug is the ingame console?

finite sail
#

yes

spiral fractal
#

server name? the title? I did and nothing happen

finite sail
#

on the client machine, you are logged in as admin?

#

/# login password

spiral fractal
#

yes

finite sail
#

press escape and the BIS debug console comes up?

spiral fractal
#

yes

finite sail
#

in the box under debug, type the variable name and press server exec

#

in the line between the box and the server exec button, the value of the variable should show

spiral fractal
#

it does but updates only after I execute 2nd time

finite sail
#

dunno mate, i gonna give up.. bedtime for me

#

oh.. instead

#

instead of the variable name in that box

#

type diag_fps and press server exec

#

and tell me what the number that comes back is

spiral fractal
#

53

finite sail
#

ok, so the server isn't being killed by the mission

spiral fractal
#

no

#

I will try to use mission code that show rep when ask civ, I will try to make it work without civ

finite sail
#

ok, good luck, i gotta sleep

spiral fractal
#

Thank you! good night

eager mesa
#

This works:

_action = [
    format["Are you sure you would like to upgrade your security for: £%1", [_cost] call RR_fnc_numberText],
    "Upgrade Security",
    "Yes",
    "No"
] call BIS_fnc_guiMessage;

This throws this script error: https://i.imgur.com/qxRKkXi.png

_action = [
    format["Are you sure you would like to split £%1 of your funds? Each member selected will recieve £%2.",[_fundsToSplit] call RR_fnc_numberText,[_fundsPerMember] call RR_fnc_numberText],
    "Split Funds",
    "Yes",
    "No"
] call BIS_fnc_guiMessage;
#

need some help with this one

exotic flax
#

aka put a spawn block around it

eager mesa
#

thank you will try'

#

works thank you

grim wing
#

how would I grab the pbo name of a cursorTarget

spiral fractal
#

typeOf?

grim wing
#

thats class name

light moat
#

Hello! im looking to find a script that will enable me to make an object an intel item in eden, ive searched forums to no avail, any help?

light moat
#

sick

#

lmao

light moat
#

Tried those, they were meh, hoping for something simpler ig

#

I dont think those wormk @spring lodge

tough abyss
#

any one know how to get this to work 'Mortar1 commandArtilleryFire [getPosATL[thislist select 0], "8Rnd_82mm_Mo_shells", 6];' its in a trigger and im getting an error saying type array expected object

spring lodge
#

Mortar1 commandArtilleryFire [getPosATL(thislist select 0), "8Rnd_82mm_Mo_shells", 6];

#

the getPosATL requires an object, by putting thisList select 0 in [] you are making it an array

tough abyss
#

ah yeah working off a photo the brakets look similar

#

thanks

spring lodge
#
[this] call BIS_fnc_initIntelObject;
this setVariable ["RscAttributeDiaryRecord_texture",  "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",true]; //Picture
[this,"RscAttributeDiaryRecord",["Top Secret Docs","These Docs outline the enemies defenses"]] call BIS_fnc_setServerVariable; //Title, Description
this setVariable ["recipients", west, true]; //The sides that the diary entry is shared with
this setVariable ["RscAttributeOwners", [west], true]; //Sides that can interact with the intel
light moat
#

@spring lodge I have, to no avail mayve im doin somethin wrong?

tough abyss
#

hmmm ok thats a problem then that mortar fire scrip will drop shells exactly where the player is rather than where they where when the percived call was put in

#

Little help with this bit of code plz Mortar1 commandArtilleryFire [getPosATL(mortar1 getHideFrom (thislist select 0)), "8Rnd_82mm_Mo_shells", 6];

fading barn
#

For my own sanity: Mortar1 commandArtilleryFire [getPosATL(mortar1 getHideFrom (thislist select 0)), "8Rnd_82mm_Mo_shells", 6];

tough abyss
#

sorry i dont know what key you talking about

#

there im an idiot

#

would it be

#

Mortar1 commandArtilleryFire [(mortar1 getHideFrom (thislist select 0), "8Rnd_82mm_Mo_shells", 6];

#

well its not throwing up an error when i close the trigger

fading barn
#

That will try to find object 'mortar1' and drop 6 mortar rounds on it. So essentially, its own position.

#

The first argument of getHideFrom is the thing you want to find, the second is which enemy should be looking for it. If it doesn't find one, it will return [0,0,0] which will just try to fire at a corner of the map.

tough abyss
#

soooo Mortar1 commandArtilleryFire [((thislist select 0) getHideFrom mortar1), "8Rnd_82mm_Mo_shells", 6];

fading barn
#

I have flipped the order of getHideFrom, sorry. Assuming they're within a trigger area, and you have it set to 'players inside area' it will select one and try to fire 6 mortar rounds at it. The prerequisite being that the 'Mortar1' knows where they were/are, or it will return [0,0,0] and try to fire at the corner of the map.Mortar1 commandArtilleryFire [(Mortar1 getHideFrom (thisList select 0), "8Rnd_82mm_Mo_shells", 6];

#

If you don't care whether the mortar knows or not, and you just want them to fire use Mortar1 commandArtilleryFire [(aimPos (thisList select 0)), "8Rnd_82mm_Mo_shells", 6];

light moat
#

making a piece of intel

#
if (isServer) then {
    
    comment "Diary picture";
    this setVariable [
        "RscAttributeDiaryRecord_texture",
    comment "Path to picture";
        "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",
        true
    ];
     comment "Diary Title and Description";
    [
        this,
        "RscAttributeDiaryRecord",
        comment "[ Title, Description]";
        ["Top Secret Docs","These Docs outline the enemies defenses"]
    ] call BIS_fnc_setServerVariable;
    
    comment "Diary entry shared with.. follows BIS_fnc_MP target rules";
    this setVariable ["recipients", west, true];
    
    comment "Sides that can interact with intelObject";
    this setVariable ["RscAttributeOwners", [west], true];

};```
#

says im missing a bracket somewhere

#

any help?

robust hollow
#

those comments inside of arrays cant be doing you any favours

light moat
#

what do you suggest?

robust hollow
#

move them out of the arrays or dont have them

light moat
#

hm

#

ok

fading barn
#

In general, comments should make something easier to read.

light moat
#

so something like this then?

if (isServer) then {
    
    
    this setVariable [
        "RscAttributeDiaryRecord_texture",
 
        "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",
        true
    ];
  
    [
        this,
        "RscAttributeDiaryRecord",
        
        ["Top Secret Docs","These Docs outline the enemies defenses"]
    ] call BIS_fnc_setServerVariable;
    
   
    this setVariable ["recipients", west, true];
    
    
    this setVariable ["RscAttributeOwners", [west], true];

};```
robust hollow
#

missed the first one

light moat
#

right

robust hollow
#

specifically the comment inside the first setVariable and the BIS_fnc_setServerVariable call are the issue

#

comment "Path to picture";
and
comment "[ Title, Description]";

light moat
#

so then without the comments my bracket issue may be gone?

robust hollow
#

yea

#

give it a go

light moat
#

okay one more question, i dont want the picture file path, should i just remove that whole line in

        "RscAttributeDiaryRecord_texture",
 
        "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",
        true```
#

@robust hollow

robust hollow
#

replace it with an empty string ""

light moat
#

gotcha

#

so

robust hollow
#

or just dont set the variable, probably a better idea

light moat
#
if (isServer) then {
    
    
     
    [
        this,
        "RscAttributeDiaryRecord",
        
        ["Top Secret Docs","These Docs outline the enemies defenses"]
    ] call BIS_fnc_setServerVariable;
    
   
    this setVariable ["recipients", west, true];
    
    
    this setVariable ["RscAttributeOwners", [west], true];

};```
robust hollow
#

yea

spiral fractal
#

if I create sqf file with function in it and then in init_server I add: [] execVM "scripts"; can I later call function from that file like this: [player] remoteExec ["my_fnc_doAction", 0];

light moat
#

like a charm

#

thank you~

robust hollow
#

if my_fnc_doAction is also defined on the target, yes

spiral fractal
#

target is the player?

fading barn
#

In this case, yes.

robust hollow
#

in ur example, it is every player and the server

spiral fractal
#

if I set to 2?

robust hollow
#

yea, that will specifically send to the server

spiral fractal
#

this function will teleport player into heli cargo, if I send the player as param it should work no?

fading barn
#

Rather depends on your function, I think.

tough abyss
#

thanks @fading barn any way to make mortar1 know about the person who triggered the trigger

fading barn
#

Yes.

tough abyss
#

mortar1 knowsabout (thislist select 0)==4

fading barn
#

Mortar1 reveal [(thisList select 0), <some number from 0 to 4, 4 being maximum knowledge>];

tough abyss
#

ahh ok

fading barn
#

Would probably be better.

#

But like I said before, you can just use the second example if you don't care whether the mortar actually knows what it's firing at. E.g. unless you'd like them to potentially warn other units, or continue to fire after the trigger ends.

tough abyss
#

basicly i have the code in a repeating blufor detected by Indi trigger and every time they are spotted a short time later the mortar fires on that last position

spiral fractal
#

when I run remoteExec it will execute the code on server, so it will have access to all the server variables and missionNamespace right?
and inside that code I can use commands that are AL, AG without additional remoteExec?

robust hollow
#

yes

fading barn
#

If it's repeated, maybe turn down the number of rounds fired from 6? They're firing to hit the player's position directly, unless they're bookin' it pretty fast they're gonna get wrecked. ~15 seconds to ~45 seconds at the longest to be out of the splash range or they're in a lot of trouble.

spiral fractal
#

when I pass function name into remoteExec server will find the function and execute?

robust hollow
#

just to be clear though, missionNameSpace is "Server variables". every game instance has its own missionNameSpace where global variables are stored.

tough abyss
#

i got it firing every 2 min

robust hollow
#

if it is defined on the server, it should work, yes.

real tartan
#

Don't know why tooltip is not working, tooltip is not set

player addEventHandler ["InventoryOpened", 
{
    params ["_unit", "_container"];

    _unit spawn 
    {
        waituntil { !(isNull (findDisplay 602)) };

        {
            _x ctrlAddEventHandler ["LBSelChanged", 
            {
                params ["_control", "_selectedIndex"];
                diag_log format ["LBSelChanged | _control: %1 | _selectedIndex: %2", _control, _selectedIndex];

                _control lbSetTooltip [_selectedIndex, "my tooltip"];
                lbSetTooltip [ctrlIDC _control, _selectedIndex, "my tooltip"];
            }];

        } 
        forEach (allControls (findDisplay 602));
    };
}];

@cunning crown @stable badger @distant oyster @finite sail

fading barn
#

Yeah, but you've got it firing 6 rounds every 2 minutes. That's a lot of mortar rounds.

tough abyss
#

its mainly for exfil under fire scenario

fading barn
#

It's your script, I was just giving you a heads up in case you didn't know.

tough abyss
#

also im ironing out the creases i might drop the rounds

#

any way to increase dispersion or rounds

fading barn
#

Yes.

spiral fractal
#

my code works in SP and MP, not on dedicated server 😐