#arma3_scripting

1 messages Β· Page 42 of 1

meager granite
#

Probably _ctrlName in nil

#

Dump the _ctrlName before it

broken forge
#

how do I do that?

meager granite
#

diag_log ["_ctrlName", _ctrlName];

#

Either you assigned nil to it somehow (some command returned it?) or _ctrlName is not even initialized, check your code scopes and what calls what.

still forum
#

instead of your hint everyone is there thing, run script, spawn or call or execVM whatever is convenient

polar belfry
#

Is there a command to extract a config out of an object

#

I want to make a SOG F4 similar to the F4E AUP

#

maybe mess with a few others

#

tried config viewer but I didn't see the components for the Pylons

kindred zephyr
# polar belfry Is there a command to extract a config out of an object

this is the general way to access the plane config

(configFile >> "CfgVehicles" >> _classname)

for specific entries you can use getText, getArray or getNumber commands before the opening parenthesis and adding another pair of > to the right of classname and then writting the entry name in quotes.

To get each part of the config you can loop and verify which type of entry it is and then get it with the required command. Not much else to do besides that if you are not looking for something specific.

If you need help with config itself you could ask in #arma3_config

sullen sigil
#

Pylons may also be stored in a sub class

graceful kelp
#

i need some help im trying to make use of the Scriptdone func, but the script handle becomes <NULL-script> when the script finished and the scriptdone command gives no return to that value

granite sky
#

scriptDone scriptNull returns true. There is something wrong with your code.

graceful kelp
#

private _FuncHook = [_heli getVariable "fza_audio_FuncHook"];
if (_FuncHook isequalto []) then {
    _FuncHook = [_heli] spawn fza_audioSystem_fnc_audioSystemHandler;
    _heli setVariable ["fza_audio_FuncHook", _FuncHook];
} else {
    if (scriptDone _FuncHook) then {
        _FuncHook = [_heli] spawn fza_audioSystem_fnc_audioSystemHandler;
        _heli setVariable ["fza_audio_FuncHook", _FuncHook];
    };
};

the handle returns

<NULL-script>
granite sky
#

The isEqualTo comparison is bogus, because you're likely comparing [nil] to [] which returns false.

graceful kelp
#

that was to kick start it with the variable init value

granite sky
#

Yes, but it's wrong.

kindred zephyr
#

just default your variable instead of making the comparison

granite sky
#

You want to do something like this:

private _FuncHook = _heli getVariable ["fza_audio_FuncHook", scriptNull];
if (scriptDone _FuncHook) then {
    _FuncHook = [_heli] spawn fza_audioSystem_fnc_audioSystemHandler;
    _heli setVariable ["fza_audio_FuncHook", _FuncHook];
};
kindred zephyr
#

^^

graceful kelp
#

im sure iv tried something similar to that to begin with , but il give it another go thanks

#

and it works thank you, it tried looking for a scriptnull like objnull but couldnt find it earlier so thank you

granite sky
#

For reference this is the slightly messier version that you can do without knowing about scriptNull:

private _FuncHook = _heli getVariable "fza_audio_FuncHook";
if (isNil "_FuncHook" or {scriptDone _FuncHook}) then {
    _FuncHook = [_heli] spawn fza_audioSystem_fnc_audioSystemHandler;
    _heli setVariable ["fza_audio_FuncHook", _FuncHook];
};
graceful kelp
#

i think i found my earlier issuie, evan when i predefine the variable with scriptnull in another place it dosent work
and when it becomes <NULL-script>, the default value you added to the get variable must override that to make it work

granite sky
#

<NULL-script> is just how it prints scriptNull.

graceful kelp
#

thanks

granite sky
#

predefining the var on the heli as scriptNull would also work. If it doesn't then there's probably another issue in your code.

graceful kelp
#

no dont do this to me, i have enough issuies

granite sky
#

cackles

#

Resolve weirdness early. Hurts less in the long run :P

#

Except with AI code, where trying to figure out the weird occasional bugs will drive you insane because Arma AI is a black box full of disaster spaghetti.

open fractal
#

is it just me or did the syntax highlight colors change

winter rose
#

on the 6th of January

open fractal
#

unprecedented

#

it looks friendlier now πŸ™‚

fair drum
# winter rose it did

how did you go about submitting a syntax to discord? since I can use this syntax on every server

kindred zephyr
#

strings and local variable names**share too much of a similar color now imo

_thisIs = "a bit similar imo";
open hollow
south swan
#

doesn't look like it would work well with commands having up to what? 12? syntaxes :3

open hollow
#

at least only the syntax part of it

manic kettle
#

is it possible to make arma read from a csv?

granite sky
#

loadFile?

#

I don't know if there's a CSV parser for SQF around somewhere. Otherwise it's a fair amount of work.

open hollow
#

i think cba has some for json files

manic kettle
#

honestly i think txt would work. Thanks!

open hollow
#

i guess is just this

_sep = ";";
_file = loadfile "test.csv";
_data = _file splitstring "\n";
_data = _data apply {_x splitstring _sep};
winter rose
granite sky
#

Depends. CSV is poorly defined so you have \n vs \n\r and quoted value issues.

winter rose
granite sky
#

If it's your own CSV then you can workaround that.

sullen sigil
#

my condolences

winter rose
#

csv stands for comma-separated values after all πŸ˜„

velvet flicker
#

Question regarding say3D vs playSound3D:
I am using playSound3D to play a sound, but I want to be able to stop the sound while it's active, so I need to use Say3D from what I can tell. However, I cannot seem to get the sound work when I give the parameter as a full path to the sound whilst using say3d. What do I need to put in order to get Say3D to play the sound when I only know it's path?

hallow mortar
velvet flicker
#

Thank you @hallow mortar! Do you also happen to know if there is a way to stop a playSound3D before it's done playing? Or is it true that you need say3D for this?

hallow mortar
#

I don't know of any way to do that. It's possible it creates one of those virtual soundsource objects to play the sound from, in which case deleting that would stop it...but if it does create one, it doesn't return a reference to it, so you'd have to manually find it (huge pain in the ass).
In other words, use say3D :U

velvet flicker
#

Gracias again

stable canyon
#

Hey, for anyone who is able to help. I've set up a cutscene using AL_Intro scripts and it seems to work when I host a server but when I try and use it on a dedicated server

It doesn't work.
Anyone able to help?

shut merlin
#

Does anybody have any scripts regarding Respawn points on vehicles. Like having infantry respawn on a medical helicopter ore medical vehicle in some form

dreamy kestrel
#

Q: first form type createVehicle position takes what, POSITION ASL?

south swan
#

it disregards the Z component of provided position and spawns at 0 height ATL, iirc

dreamy kestrel
#

cool thanks

tulip ridge
#

I seem to be having an odd error when passing a list of variable names to a script

In my mission, I have x objects named foo_bar_x
In a script, I have a list of those variable names, and I want to pass that list to another function that loops over those objects and does something with them. However, I ran into an issue where passing the list of all of the variable names, did not pass it correctly.

_listObjects =
[
  foo_bar_0,
  foo_bar_1,
  ...
];

_this addAction ["1", { ["someValue", _listObjects] execVM "someOtherFile"; }];

However, I then get an error saying that _x is not defined when looping over the objects.
When printing out the stringified version of the array to chat, it simply reads [any].

When passing some of the variable names as an array directly, it works as intended

Fix
_this addAction ["1", { ["someValue", **_this select 3, _listObjects**] execVM "someOtherFile"; }];
(Asterisks are added to spot the correction more easily)

warm hedge
#

In the action _listObjects doesn't exist

tulip ridge
#

Ooooh yep forgot about addAction being like that

tulip ridge
granite sky
#

_unit setUnitPos "UP"

tulip ridge
#

Oh I saw unit pos on the stance page, thought it might have been something else

#

Thanks!

thick merlin
#

The ai doesnt know the vehicle is empty.I assume the vehicle has been abandoned and it hasnt started the mission empty.

lavish canyon
#

Hi guys. Need some help. How to work with RscMapControls? I need to put the cut out map in a frame so that it can be moved. How to do it?

glossy pike
#

hey how would i use a script to spawn a vehicle in a certain direction ive already got it spawning the vehicle but i need it to be facing east instead of north

#

im spawning vehicles via scripts so i can spawn multiple in at the same point for like reinserts and such

digital hollow
#

setDir

glossy pike
#
//spawn vehicle code
"UK3CB_BAF_LandRover_WMIK_GPMG_FFR_green_A" createVehicle getMarkerPos "vs1";
#

where would i put that in that code?

digital hollow
#

separate command after that line

glossy pike
#

and if i just do setDir would i change the direction for all the vehicles spawned with that command?

digital hollow
#
private _vehicle = "UK3CB_BAF_LandRover_WMIK_GPMG_FFR_green_A" createVehicle getMarkerPos "vs1";
_vehicle setDir 90;

// reuse private variable once you're done editing the first one
_vehicle = "class2" createVehicle getMarkerPos "spawn2";
_vehicle setDir 90;

You would need to do setDir for each spawned vehicle.

glossy pike
#

class being the vehicle to spawn?

#

thank you

hallow mortar
#

It's a very easy one to test, but I would expect not, because you don't get into the drone when you control it. Remote control and being in the vehicle are different.

glossy pike
#

is there a way of disabling inventories of an object without setting it to a simple object or stopping it from being able to ace interact

hallow mortar
glossy pike
#

does it work on objects such as crates thoe?

hallow mortar
#

Yes

glossy pike
#

if i did

#
this lockInventory true;
#

would that work

hallow mortar
#

I assume you mean in the object's init field?
Yes, that's how the command works, as described.

glossy pike
#

thanks

kindred zephyr
hallow mortar
#

Prevents it being opened. It's the equivalent of lock. If you want to close it immediately after being opened you'll need some kind of EH.

kindred zephyr
#

yeah, its what im doing with some containers. But this might be even better.

glossy pike
#

ye it straight up doesnt allow you to access the inventory which i like

valid abyss
sullen sigil
#

what about line 269

valid abyss
#

{"rhs_beanie_green",600,"true"},

winter rose
#

and 267?

#

(that's not scripting but config, but hey we're started)

valid abyss
#

{"rhs_6b28_green_bala",1400,"true"},

valid abyss
winter rose
#

well nah, it should be fixed soon\β„’

#

send the file?

valid abyss
#

1 sec

winter rose
#
{ "B_Kitbag_mcamo"6250, "true" },
// ...
{ "rhs_weap_aks74n"4950, "true" },
#

@valid abyss ^

valid abyss
#

what line is that?

winter rose
#

Ctrl+F
286 & 355

#

there is a line offset because the compiler removes comment blocks

valid abyss
#

ahhh

#

thanks ill see if it fixes the problem

#

that fixed it

#

tysm ive been trying to fix this issue for about an hour

royal crow
#

I don't know if this is the right channel but, can someone help me? (its in warlords, i I tried to make
custom faction)

#

(better screen of the error?)

granite sky
#

Well, you probably put a syntax error in a unit array and broke the spawning.

#

Although given that it's doing floor random it's vulnerable to the random N = N bug :P

royal crow
#

uuuh,how do i fix it? (im stupid so don't expect too much from me)

granite sky
#

Write your custom faction without making errors.

#

Check the RPT. There's often an earlier error that tells you where you screwed up.

royal crow
#

oook, Thanks so much :D

royal crow
#

uuh i double checked the description.ext file but everything seems fine, sooo whats the problem?

granite sky
#

Oh, it's config for Warlords?

#

Wrong channel then :P

#

But you'd probably need to find someone who knows Warlords.

royal crow
granite sky
#

(config is not script)

royal crow
royal crow
eager prawn
#

Hey guys, question for you all

I've run a custom range scoring script that I made years ago, and it's been running well for years. The gist of it is I had an event handler on each target that adds to a score when the "Hit" event handler is triggered on the target. All of these targets are invincible, as many of you may know that gunfire destroys pop-up targets in Arma (which seems like an oversight).

target1_1 addEventHandler ["Hit", {lane1score = lane1score+1; publicVariable "lane1score";}];

However, recently the "Hit" event handler no longer goes off if the target has damage disabled. I expect this was likely part of one of the recent Arma updates.

Anyone have a simple way I can make these targets indestructible without requiring enableDamage = False? I have a few potential ways in mind but ideally looking for the simplest way possible, as I have a LOT of targets.

open hollow
#

HandleDamage event handler

#

You can return the value you want as damage

If you set {0} will be the same as invulnerable, and you will detect the hits

eager prawn
#

?

open hollow
#

You will find more info the wiki, I’m at the phone atm so find it it’s quite hard πŸ₯²

eager prawn
#

haha all good, I'm trying it right now here

#

The handleDamage entry on the wiki is kinda barren, so I'm just winging it

edgy dune
#

bit of a conceptual question, Lets say I have a per frame handler for each AI (by a certain criteria) I spawn that does something rather simple. So if I have 5 AI that meets this criteria then I would have 5 PFH running .Would it better have 1 pFH that loops through a list (maybe a hashmap) of these AI instead?

peak pond
#

Not an expert here but I imagine PFH setup should, in theory, have a low overhead. If not, then your list idea sounds good such that you would only use 1 PFH. Most important is probably that the contents of your PFH is "rather simple" like you state.

edgy dune
#

yeah so the most expensive part I can see is just get/setvariable, and accessing hashmap inside my PFH. Nothing that would require spawn so no suspending

#

thats wat I was wondering, cause I say 5 AI, but wat about 100 AI? will teh overhead be significant at that point?

sullen sigil
edgy dune
peak pond
#

Yeah if many AI, probably single PFH

edgy dune
#

out of curiosity really, is there a way to test something like this?

sullen sigil
#

Use code performance test I would presume

edgy dune
sullen sigil
#

Probably better to do 1 pfh if it's on more than like 5 ai ngl

#

if it's just variable juggling the pfh itself will have worse performance hit

edgy dune
#

makes sense, ill try it out. My next worry is how will I add/remove/update the list of AI that the PFH should check over KEK idk if there will be any race conditions

chrome hinge
#

Hey everybody. Anyone have ideas why scroll wheel menu disappears when someone dies in scenario multiplayer and gets teamswitched to other character? The menu works fine if switched normally without death

peak pond
#

PFH should run every frame by definition. Whatever data you need to calculate, do so outside the PFH, eg in a spawn script that updates every so often, and save the results somewhere you can access quickly in the PFH. The PFH handler should ideally just read cached data and display it in the UI.

edgy dune
peak pond
#

For testing, maybe try it with large numbers (ie "stress test") and see how it performs. Check the wiki for diag commands if you want to try timing code and stuff.

sullen sigil
peak pond
#

OIC not familiar with the CBA one. Regardless, still do any expensive calculations outside so you can avoid dropping frames once per second.

edgy dune
sullen sigil
edgy dune
sullen sigil
#

completely forgotten i had done it that way around tbh

edgy dune
#

Ah okay

#

cool thx

#

ill try this out, and if something goes wrong, probably will cry

sullen sigil
#

the natural way of hashmaps

vital dome
#

Hi there. I am messing around with the ORBAT system at the current moment, trying to understand how it works, and I'm wondering if there's any way to remove the markers that the "ORBAT Group" module creates. I be pretty new to this, so don't expect me to understand much though.

peak pond
#

@vital dome The ORBAT Group module markers are meant to stay all mission. If you want to remove them mid mission, it may be possible to iterate through all markers in the mission and remove them manually, but I haven't tried this.

vital dome
#

So far figured that you can add them on the map whenever, but can try and see if that's possible.

vital dome
#

Checked real quick with allMapMarkers, seems the ORBAT markers aren't part of this list at all.

peak pond
#

Damn. Maybe they use GUI elements then, which is black magic to me.

vital dome
#

Ah fair, will just keep digging around then.

velvet flicker
#

Why might this script not work reliably on a server? (Players teams only updated sometimes when it's run)

_players = _this nearEntities ["man", 5];
_list = "Roster: \n";

_players = _players call BIS_fnc_arrayShuffle;

{
    if ( _forEachIndex % 2 == 0) then {
        [_x] join createGroup west;
        _list = _list + (name _x) + ' is Blue\n';
    }else{
        [_x] join createGroup independent;
        _list = _list + (name _x) + ' is Green\n';        
    }
} forEach _players;

hint _list;

#

Ah, never mind, it was not executing on Target machine.

manic kettle
#

Are addactions always handled on the local player?

open fractal
#

you can add actions to any object, but addAction needs to be executed on the machine of whoever is supposed to see the action

manic kettle
#

yes so thats wwhat i mean
in the case that i add an addaction to an object for the player to interact with...Is it considered local to the player? or is it being run on the server inside that object?

#

basically do i need a remoteExec to send stuff to server from an addaction

open fractal
#

if you want an action to tell the server to do something you need to use remoteexec

manic kettle
#

gotcha, thanks πŸ˜„

velvet flicker
#

Suppose I want to replace a unit's uniform and have it keep the inventory from their current uniform, how should I go about that?
I am so far able to do the replace a uniform part of that task, it's the inventory that's giving me problems. I see i can use uniformContainer but I don't see the counterpart to that whereby I put it back into a uniform

pulsar bluff
pulsar bluff
peak pond
#

I'm working on a script to add a long list of items, weapons, magazines, and backpacks to an ammo crate. It must be MP compatible. I see we have addItemCargoGlobal, addWeaponWithAttachmentsCargoGlobal, addMagazineAmmoCargo (global effect), and addBackpackCargoGlobal. Is it wasteful to have this long list of global effect calls? Is there some way to add everything to the ammo crate locally, then do a final network sync at the end? Similar to how the wiki recommends with the map marker mutation local/global effect commands.

#

Also, is there a command to add a backpack containing specific items to an ammo crate?

lavish stream
#

Just run it on the server.

peak pond
#

I am, but I'm wondering if the network updates can be batched.

lavish stream
#

Run it on mission start, no issues.

peak pond
#

Sorry but that doesn't answer my question. It must be supported mid mission in this case, so I'm wondering if batching is possible or even necessary.

pulsar bluff
#

no theres no way to batch the inventory cargo commands

peak pond
#

Ok, thanks.

pulsar bluff
#

if you were OCD you could just run it locally on each machine but ...

#

bite the bullet and use the global command, no one will notice

peak pond
#

Fair enough, will test it out, if issues that sounds like a good Plan B.

pulsar bluff
#

each time a vehicle or unit is spawned, its gear is propagated globally in a similar manner by the engine

#

it would be nice to have control of the network component, but we dont

peak pond
#

Darn. Yeah I'm working on something that will continuously spawn units and vehicles, and want to avoid lag spikes.

pulsar bluff
#

my approach to that was to spawn simple object props that players can convert to vehicles

#

so when the asset is first spawned in its just the model and then later if/when needed it gets simulated with all the bells & whistles

#

i wonder if a vehicle is "enable simulation false" is its inventory state propagated or if thats held back till simulation enabled ... i dont know

peak pond
#

Nice, yeah that sounds like a good balance regarding props.

#

Not sure regarding that last bit.

#

In addition to crates, my script also spawns enemy units/vehicles continuously (with throttling and a max number units), kind of like Invade & Annex. Any general tips to keep good performance?

pulsar bluff
#

well the throttling and max units is a good start ... really depends on the gameplay. ideal is to spread everyone out evenly over the entire terrain to keep high simulation entities (units) away from players ... but that isnt necessarily fun gameplay

#

if you get excited and have a spare week or three to bang your head against a wall, you could create an asset recycler ... imagine those crates dont delete, instead just get moved around/hidden. this vastly reduces the amount of crate filling you'd have to do

#

imagine units/vehicles aren't deleted and then created, but simply repurposed. intercept "deletevehicle" + "createvehicle" with instead an array of "delete soon" objects that are accessible by the "createvehicle" logic for repurpose

velvet flicker
manic kettle
#

ah i didnt suggest that since i thought you wanted to add one by one. But good!

peak pond
#

@pulsar bluff Thanks for the tips. I'll work on getting even unit distribution and avoiding thick clusters. The asset recycler sounds like a good idea too, kind of like how iOS apps recycle table view cells.

#

I'll need to bang my head on the wall a few more times for that one.

south swan
#

inb4 custom damage handlers that just teleport the AI unit to spawn when damage threshold is reached to avoid spawning new units

pulsar bluff
#

to keep good performance obviously monitor "allMissionObjects" to see any unwanted buildup, rule of thumb keep AI under 100 and reduce the evaluation frequency of any scripts to as-infrequent-as-possible while still getting the job done. this is heresy to the "PFH solves everything" crowd however

edgy dune
peak pond
#

Yeah that's what I do usually. Earlier I mistakenly thought you meant you had to display some UI every frame.

pulsar bluff
# edgy dune so since I just need to run every 1 second, just have a while loop and just use ...
0 spawn {
    _sleep = 0.3;
    private _time = diag_tickTime;
    private _everySecond = -1;
    private _everyTenSeconds = -1;
    private _everyMinute = -1;
    
    while {whatever} do {
        uiSleep _sleep;
        _time = diag_tickTime;
        if (_time > _everySecond) then {
            // Do something every second
            
            _everySecond = _time + 1;
        };
        if (_time > _everyTenSeconds) then {
            // Do something every 10 seconds
        
            _everyTenSeconds = _time + 10;
        };
        if (_time > _everyMinute) then {
            // Do something every minute
        
        
            _everyMinute = _time + 60;
        };
    };
};```
edgy dune
edgy dune
pulsar bluff
#

there is some propaganda against the scheduler/while loops in the "varsity team" modding communities

edgy dune
#

"varsity team" KEK

pulsar bluff
#

generally if you're making a mod for others to use, you want to avoid them yes ... if you're making a mission in which you control the end product, then the scheduler should take as much of the workload as you can offload to it

#

while loop without sleep should be avoided, but with sleep its just another tool in the toolbox.... the wrong tool for simulating vehicle movement or GUI (where visual smoothness matters), but the right tool for things which dont need to be evaluated each simulation/render frame

edgy dune
#

fair enough, ill try this out and see how it goes

pliant stream
pulsar bluff
#

if you need to do something once every 10 seconds, with "sleep 1" expiry is evaluated ~10 times ... in PFH at 60 fps thats 600 evaluations ... 10 vs 600

pliant stream
little raptor
#

How many times is typically irrelevant

cold cloak
#

Hey, I'm trying to figure out how to make my intro.sqf to run on the clients only once at mission start, but not after respawn / JIP / Reconnect etc.

addMissionEventHandler ["PlayerConnected", {
    params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
    remoteExec [["scripts/briefing.sqf"],_this,true]
    remoteExec [["scripts/intro.sqf"],_this,true];
}];`

So far got this but no luck. Tried using initPlayerLocal and initServer to init it.

proven charm
#

what was the problem with initPlayerLocal? I don't think your remoteExec is valid syntax

hallow mortar
#

initPlayerLocal is also executed for JIP and they don't want that

#

You can't use remoteExec with raw script files, it only accepts commands and functions. Make a function or remoteExec execVM instead

proven charm
#

you can do (in initPlayerLocal.sqf) ```sqf
if(!_didJIP) then { execVM "scripts/intro.sqf"; };

hallow mortar
#

Also, the format is wrong: you're passing the command (or the script file which should be a command) as an array, when a string is expected, and you're passing _this as the targets argument, which contains...the entire params array. Pass _id for that instead.

proven charm
#

it should

cold cloak
#

Imma try it

if (hasInterface) then {
    0 = [] execVM "scripts\briefing.sqf";
    1 = [] if(!_didJIP) then { execVM "scripts/intro.sqf"; };
};

This is my initPlayerLocal, looks correct?

proven charm
#

the 0 = [] are unnecessary

#

1 = [] is invalid syntax..

cold cloak
#

hmm

#

is this correct?

null = []
proven charm
#

Just try: ```sqf
params ["_player", "_didJIP"];

execVM "scripts\briefing.sqf";
if(!_didJIP) then { execVM "scripts/intro.sqf"; };

#

you dont need hasInterface if this is in initPlayerLocal.sqf

cold cloak
#

Ah, okay

#

Well, now the intro doesn't even fire up

#

Briefing comes up fine

proven charm
#

I forgot you need to add params

#

edited my post ^^^^

cold cloak
#

Aigh, imma try that

#

uuh, still not firing up

#

Does it make a difference, because I'm running a dedicated server?

proven charm
#

I think that should work for client even dedi is running

cold cloak
#

Well, that doesn't seem to be the case. Imma try locally too

#

Nope, just something wrong with the script

proven charm
#

well you can turn script errors on and maybe add small sleep in intro.sqf because sometimes you need that

hallow mortar
#

I assume you have confirmed that intro.sqf actually works in itself

cold cloak
#

Yes, it did work earlier

#
if (hasInterface) then {
    0 = [] execVM "scripts\briefing.sqf";
    1 = [] execVM "scripts\intro.sqf";
};
``` I ran it like this before and worked fine
hallow mortar
#

The 0 = and 1 = are unnecessary. That means you're saving the return of execVM (a script handle) as variables called 0 and 1.
It used to be necessary to do this in the Editor because of a quirk of Editor code fields, but it's never been required in script files and is no longer needed in the Editor. Since you don't use the script handles you don't need to save them.

#

The [] is also unnecessary. This means you're passing an empty array of arguments to the script. execVM doesn't require it if you don't want to pass anything. Leaving it won't break anything but neither will removing it.

#

➑️ It doesn't work because the file path given for intro.sqf has a / when it should have a \ ⬅️

cold cloak
#

Works like a charm now

#

Thanks!

nocturne canopy
#

Afternoon all,

Feel like I'm being gas lit here - I know a variant of the classname exists for SmokeShell however it has an infinite duration. Can't find anything about it but I swear it exists!
Anyone remember what it is?

hallow mortar
#

Units lose their side when they die and become civilian

#

Check the group's side instead, or use the faction

little raptor
#

yes because dead units are removed from their group too
they shouldn't be removed that soon tho

#

they should still be in their group when the killed EH triggers

#

did you actually verify that using a systemChat or hint or something?

stable dune
hallow mortar
#

Β―_(ツ)_/Β―

trim tree
#

Hi, i want to do a zeus module and need to somehow get the units variable that i drop that module onto. Is curatorSelected the correct command here, since i dont have it selected before i drop the module on it.
I tried looking how ACE or ZEN do it, but i am too dumb to see how they achieve it over on their githubs :/

granite sky
#

"drop the module onto"?

#

curatorSelected returns what's selected. No more or less.

trim tree
#

sorry, i meant curatorMouseOver

#

with "drop module onto" i mean like how you do with the suppressive fire module or others which only apply when you drop them onto a unit

fair drum
#

how local is breakTo? do I need to worry about unique scopeName names between files/functions?

little raptor
#

afaik it only cares about the "topmost" (most recent) scope name

cold mica
#

I have an issue regarding scope. I have defined an array as SESO_playerGear to keep track of players' weapons and magazines. However, the innermost scope of SESO_playerGear is not the same as the outermost scope of SESO_playerGear. Any advice on how to make them equal?

Code is here:

params ["_ammoBox"];

// Generate list of ammo
if (isNil "SESO_playerGear") then {
    SESO_playerGear = [];

    {
        SESO_playerGear = SESO_playerGear + magazines _x;
        SESO_playerGear = SESO_playerGear + weapons _x;
    } forEach (playableUnits);
};

count SESO_playerGear; //returns 0, SESO_playerGear is [];
fair drum
little raptor
#

you could be running it on multiple "ammobox"es

#

in schd env

#

I have no idea why you'd exec something like that schd tho

cold mica
#

Indeed, I loop through mutliple ammoBoxes to run this code but I only want to generate the player gear once.

fair drum
#

why are you looping then if you only want it once?

cold mica
#

I guess I could keep the ammo generation in initServer but I want to keep the code clean and have this in the function

fair drum
#

you can still have a function and call it from the init

little raptor
#

what's the point of _ammoBox var then?

cold mica
#

It's used for adding the gear to _ammoBox

// Remove gear from box
clearMagazineCargoGlobal _ammoBox;
clearWeaponCargoGlobal _ammoBox;

// Add items to box until it reaches random maxLoad
while { loadAbs _ammoBox < random (maxLoad _ammoBox) } do {
    if (isNil "SESO_playerGear") exitWith {systemChat "ERROR: No player gear set, ending generateAmmo..."};
    _ammoBox addItemCargoGlobal [selectRandom SESO_playerGear, random [0, 0, 10]];
};
#

both are within the same function

fair drum
#

give us a full picture. post the whole function in sqfbin.com or pastebin as well as what you are doing to call the function and where

cold mica
#

Sure, gimme a bit

#

Layer "Ammo"

Basic Weapons [ACR] (testBox)
Basic Weapons [ACR]
Basic Weapons [ACR]
Basic Weapons [ACR]

initServer.sqf

// Generate Ammo
{
    [_x] call SESO_fnc_generateAmmo;

}forEach ((getMissionLayerEntities "Ammo") select 0);

fn_generateAmmo.sqf

params ["_ammoBox"];

// Generate list of ammo
if (isNil "SESO_playerGear") then {
    SESO_playerGear = [];

    {
        SESO_playerGear = SESO_playerGear + magazines _x;
        SESO_playerGear = SESO_playerGear + weapons _x;
    } forEach (playableUnits);
};

// Remove gear from box
clearMagazineCargoGlobal _ammoBox;
clearWeaponCargoGlobal _ammoBox;

// Add items to box until it reaches random maxLoad
while { loadAbs _ammoBox < random (maxLoad _ammoBox) } do {
    if (isNil "SESO_playerGear") exitWith {systemChat "ERROR: No player gear set, ending generateAmmo..."};
    _ammoBox addItemCargoGlobal [selectRandom SESO_playerGear, random [0, 0, 10]];
};
little raptor
fair drum
#

yeah I was gonna say, something has to be going on with playableUnits

cold mica
#

I'll log playableUnits in the function and see what it says

#

Yep, you are right, playableUnits is empty during the function's execution

fair drum
#

are you testing in multiplayer? playableUnits I think is empty in single player

cold mica
#

I was testing in SP

fair drum
#

do it in MP

little raptor
cold mica
#

Using allPlayers, the function works. The log shows me on the allPlayers array

fair drum
#

just confirmed, playableUnits in singleplayer returns []

hallow mortar
#

The usual solution is to use (playableUnits + switchableUnits) to account for both

cold mica
#

New issue is this: if I use allPlayers, is it reliable for this script? I fear that using allPlayers means when the function executes in initServer, it will run too early before most players would have finished loading into the mission. Any advice for this?

cold mica
#

I see, I'll try that. Thanks!

fair drum
#

might grab double though

cold mica
#

Good note for future scripts. For this function, duplicates are okay.

hallow mortar
#

It won't grab double in SP because playableUnits will be empty. In most conditions in MP it won't grab double because switchableUnits is usually empty:

In Multiplayer, switchableUnits are only available when respawn type is set to SIDE or GROUP, the mission contains units marked playable and player is able to switch to any of those units. On dedicated servers, this command returns an empty array,.

cold mica
#

While ya'll am here, there is another script I would appreciate your advice on.

#

In the mission, the Squad Leader unit is marked as seso_leader within a group called "Bravo". Other playable units are in groups "Bravo Red", "Bravo Blue", "Bravo Green". I want to preconfigure the units' colors and radio channels according to the group they chose to join in the briefing. The following script almost works, excepts for assigning the player to a team. Instead of being in RED, BLUE, or GREEN players who join seso_leader's group remain white. However, the rest of the script, such as presetting their radio channel, runs correctly. Any advice?

initPlayerLocal.sqf

waitUntil {(!isNull player) && (time > 0)};

//Assign Appropriate Color/Team to groups with "Bravo" in name
private _bravoGroupID = groupID (group player);

if (["Bravo", _bravoGroupID, false] call BIS_fnc_inString) then {
    [_bravoGroupID] spawn {
        waitUntil { time > 60 || !isNull seso_leader};
        [player] join (group seso_leader);

            waitUntil { ([] call acre_api_fnc_isInitialized) };
            params ["_bravoGroupID"];
            switch _bravoGroupID do {
                case "Bravo": {player assignTeam "YELLOW";[(["ACRE_PRC343"] call acre_api_fnc_getRadioByType), 6] call acre_api_fnc_setRadioChannel;};
                case "Bravo Red": {player assignTeam "RED";[(["ACRE_PRC343"] call acre_api_fnc_getRadioByType), 1] call acre_api_fnc_setRadioChannel;};
                case "Bravo Blue": {player assignTeam "BLUE";[(["ACRE_PRC343"] call acre_api_fnc_getRadioByType), 2] call acre_api_fnc_setRadioChannel;};
                case "Bravo Green": {player assignTeam "GREEN";[(["ACRE_PRC343"] call acre_api_fnc_getRadioByType), 3] call acre_api_fnc_setRadioChannel;};
            };
    };
};
fair drum
#

try assigning the team after, the acre stuff

#

or removing acre stuff completely and see if it works

cold mica
#

good idea, I'll try that

#

thought it would be odd because YELLOW gets assigned (the only one that is already in seso_leader's group)

hallow mortar
#

Joining might take a little time, and if you set the team colour before joining it won't carry over to the new group. Try adding a small delay between joining and setting the team.

quick peak
#

Hey, is it possible to delete already created particles like smoke or fire? I mean the ones that are in the air. Was trying with #particlesource but, well, didn't work

manic kettle
#

I need some clarification
if i set a variable lets call it "_myVar" then it would be local to a script
if i set a variable "myVar" and use publicVariable "myVar" it will get broadcasted to all clients and be known as a public variable....

if i set a variable "myVar" without broadcasting it, inside an addaction, is it only available to that player?

context: I'm trying to use a keyEventHandler to move an object (Press the key, move the object 1m in x,y or z). How would i access the object to move it?

fair drum
#

when would I want to use the seed syntax of random? what benefit do I get for seeding a random number over just random or gaussian? Not a big math person.

fair drum
tepid vigil
vocal valley
#

Anyone know of any scripts that are multiplayer friendly where you can set up a camp to sleep/skip time?

winter rose
#

see skipTime (to be executed server-side)

vocal valley
#

I’ll fiddle with it tomorrow when I’m back at my pc

#

Ideally I’d like it be a deployable object (tent, fireplace, chair) that you could then use to skip time

manic kettle
#

anyone know if its possible to make key handlers overwrite existing keybinds?

eternal pier
#

does anyone know syntax for addForceGeneratorRTD?

eternal pier
manic kettle
#

Keybinds yeah but I want it for key handlers, so that I can make keys run functions in a script

#

And then remove them after

chilly bronze
#

anyone have experience using this object oriented scripting shell for SQF?
https://forums.bohemia.net/forums/topic/211621-oop-object-oriented-programming-sqf-scripting-and-compiling/

i've been using it and modified it for my own personal use (made everything lowercase, added extra macros for getting vars/setting vars/executing functions because all three were originally 1 macro). I've found it very useful for making complicated scripting much more organized, and having the option to use OOP is really useful in a lot of cases

velvet flicker
#

What is the way to get a list of actually houses/building. When I use things like nearObjects, I get an array of random stuff that is not actually an enterable building like lights, runway_edgelight, etc.

granite sky
#

It's complicated :P

#

You could maybe try nearObjects + nearestBuilding. I don't know if there's a better way to check for path LODs, although I'm not sure every enterable building has a path LOD either.

meager granite
#

Anybody knows what defines amount of flinch when you hit a unit?

#

Is it only affected by projectile impulse amount and nothing else?

fair drum
proven charm
#

can triggers detect wrecks?

plush belfry
#

Is there a way to make it so that the Hint Script, when activated, shows text only on the client that activated it and not server wide?

pulsar bluff
#

its just another wrapper for sqf commands imo

pulsar bluff
proven charm
pliant stream
plush belfry
# proven charm where in your code are you using the hint now?

I don't have code written up right now. But it would be something along the lines of;

Player/Client on Server Interacts with Object using addAction
Only the Client that interacted with certain object gets shown a hint
Other Clients connected to server do not have a hint being displayed.

proven charm
#

well that's easy then because addaction should be run on each client anyways and each client using the addaction will see the hint and no one else

plush belfry
pulsar bluff
golden cargo
pliant stream
pliant stream
ocean orchid
#

Heyo! Dipping my toes into A3 modding and I'm confused about why you need a P drive for it. I keep seeing explanations on how you do it but nothing on why you would need it? Anybody able to help here?

Also apologies if it's the wrong channel, haven't really found one for general modding.

sharp valve
#

Hello, i have a script to make the heli crash inta designated area and works in the mo editor butbon the dedicated server i can't make the heli invincible. The trigger executing the script is set to server Only.

proven charm
stable dune
sharp valve
stable dune
# sharp valve Nope. `allowDamage false`

Okey, just thought If you want make heli invincible (like you ask earlier) , there is command hideObject, which is local. And global one ishideObjectGlobal.
And your command does
Enables / disables an entity's ability to receive damage.

sharp valve
#

Yes?

south swan
#

invincible and invisible are different things

sharp valve
#

Yeah lol

#

I don't have any headless client or anything

#

And thebobject is a vehcile

#

So don't think it would be changing locality?

stable dune
south swan
#

πŸ€·β€β™‚οΈ is it piloted by a player at any point? If yes - it changes locality to pilot's machine.

spark turret
#

is there a way to access map properties?
i want to find the closest forest (ideally border), and also town tile.
"FOREST TRIANGLE" in nearestTerrainObjects doesnt seem to work (on tanoa)

young current
# ocean orchid Heyo! Dipping my toes into A3 modding and I'm confused about why you need a P dr...

P drive simulates the games file structure so a path P:\some\folder\to\file.thing becomes some\folder\to\file.thing in game.

Also all the tools are designed around the P drive existing and being set up right (yes one can make mods without it but usually this means errors get packed in)

In case you do anything more complex and want use mikeros tools for pbo packing with proper debugging, P drive is essential.

torn hemlock
#

Hello scripters!
I'm making addon for manual static/vehicle weapons ammo loading.
The thing is to reammo weapon of vehicle's turret if there is no magazine in it.
Now I've faced with some trouble - how can I count not empty magazines in certain turret of vehicle?
magazinesTurret always returns magazines which were loaded before even if they are empty.
magazineTurretAmmo returns no ammo if magazine is loaded but its not currentMagazineTurret
Using some "workaround" with magazines _veh, but there will be a problem with two different turrets with similar weapons uses same magazines - if even one of this turret is loaded.
Some sample video: https://youtu.be/7TWu07daK7E

sullen sigil
#

until you do modelling or anything beyond just config stuff/scripting you dont really need one

vocal valley
winter rose
winter rose
spark turret
#

ehm so my marker is facing dir south 180, when set to "setMarkerDir 90" ?

proven charm
#

depends on marker

spark turret
#

ah right, the ambush one is point right when oriented 90

#

... smart

sharp valve
#

Yes it will be piloted by a person

#

If i remove the server checks it should be fine right?

kindred zephyr
winter rose
#

I thought it was something around 5s, but like a regular one (so if you skipTime after 3s, the game syncs after 2s)

kindred zephyr
#

i guess it could depend on hardware, for us even doing it OEF would yield some weird results

trim tree
# digital hollow The entity that has the module dropped on it is passed to the module code. <http...

Ok.. So i have gotten a test module to work, but only when i write all the code inside the Arguments (like how its done here in the example https://zen-mod.github.io/ZEN/#/frameworks/custom_modules?id=module-function). However, I would like to have the code in a separate file but when doing so (via a execVM) the _object doesnt get carried over into the script file, which is to be expected, but how do i remedy that?

digital hollow
#

same way you pass arguments to anything
[_object] execVM "yourfile.sqf"

hallow mortar
#

(Don't forget params inside the receiving script to retrieve it)

trim tree
#

alright, gonna try that out later, thanks πŸ™‚

little raptor
sharp valve
#

Hwllo! I am using this script > https://sourceb.in/Usz6bAq3sZ
the heli takes damage and lands fine but ends up exploding when playing on a dedicated server and a person is flying it. i beleive if (local _heli) then{ handles locality? i disabled server only on the trigger

sharp valve
proven charm
#

what script line?

sharp valve
proven charm
sharp valve
#

the script executes and disables damage but heli still blows up

proven charm
sharp valve
#

yes

#

that part is workng fine

proven charm
#

well i dont know if this helps but the script must be run where the heli is local to the PC

#

so you could run it on every PC (including server) it should work from there

proven charm
sullen sigil
kindred zephyr
#

^

sullen sigil
#

only exception was an oneachframe but thats obviously resource intensive

winter rose
#

ah well, okay then ^^

manic kettle
#

anyone know how to get the specific # of items a player has?
For example how can i find out how many ACE_bananas a player has in their inventory?

hallow mortar
#

combine items and count

manic kettle
hallow mortar
#

yes, I know, you can do that

manic kettle
#

it seems items returns just a list, no scalars for how many of each item

hallow mortar
#

If there's more than one of an item it appears more than once in the list

manic kettle
#

ah so it does

hallow mortar
#

And you can count that, or select and then count

#
{_x == "ACE_banana"} count (items _unit)```
manic kettle
#

Yes i got it! Thanks Nikko

velvet flicker
#

How might I get an arrow drawn via BIS_fnc_drawArrow to showup in the zeus map as well?

tough abyss
#

Best way to override a default arma UI element? (via an addon ofcourse)

torn hemlock
#

Change its config?

tough abyss
#

Hm - Didn't think of that.. Clearly I've been up way too long.

torn hemlock
#

Check a3\ui_f\config.cpp for the list of Arma UI controls and its properties

#

Then you can create your own addon with config replacement

velvet flicker
#

Any idea what this might mean?

#

Error GIAS pre stack size violation

granite sky
#

Means your script has broken the SQF parser, I think.

velvet flicker
#

Solved: Last line of function being called was _variable = someData; Correct: last line changed to someData;

nocturne bluff
#

What blender said, just remember some of them are hardcoded ;(

copper raven
tough abyss
#

I'm trying to replace the loading screen - I've gotten the one - but how would I go about doing a config replacement?

tulip ridge
#

I wrote a script to spawn ai based off of a list of object variable names, and I wanted to make it so that the ai face the direction of the object itself, and then to also disable their ability to move (but not look around)

// Spawning logic up here
_unitType createUnit [position _x, _group, "unit = this;"];
unit setUnitPos "UP";          // Force the AI to stand
unit setDir (getDir _x);       // Make AI face the direction of the marker
unit setPosASL (getPosASL _x); // createUnit doesn't accept ASL ; set unit to proper pos
unit disableAI "PATH";         // Disable the AI's ability to move around

Everything works except the setting direction part, when googling this I found that sometimes it requires a position change to re-sync with the client/server, but I already update their position after the direction.

tough abyss
#

inhert it and redefine it?

tulip ridge
#

I even tried moving the line of code further up/down to see if maybe that was affecting it, but I had no change in behavior

#

When printing getDir _x (just with systemChat), it does display the correct direction, the ai is just not set to the correct direction

digital hollow
#

are you sure it's not just turning back afterwards? you can check getDir unit, and try doWatch to keep them facing the way you want

tulip ridge
#

Doing getDir unit returns 0, and doWatch only makes them look at an object, so I'd have to spawn an object in front of them, and then delete it

digital hollow
#

doWatch works with position as well, and i mean getDir unit after the setDir.

tough abyss
#

Sorry - I could probably figure it out on my own, I'm just gonna get some sleep - way too tired for this haha

tulip ridge
#

Doing it afterward does return the correct value, but the ai is still facing the wrong way

nocturne bluff
#

But yes

digital hollow
#

I think they are just turning in place to face the way they want to.

tulip ridge
#

With doWatch I'd still have to find some position in the direction they should be facing and have them look at that

digital hollow
#

yes. use getPos syntax 3

nocturne bluff
#

Well no

#

You override it

#

So you just define RscDisplayLoadingScreen or whatever its called again in your addon

tulip ridge
#

Didn't know getPos had that syntax, but when using it to look at a position 5 meters ahead of them, they just look straight down because doWatch only takes a (2d) position

_faceMe = unit getPos [5, getDir _x];
unit doWatch _faceMe;
digital hollow
#

_faceMe is probably [_x, _y, 0]. set the height before you doWatch

tulip ridge
#

Misread something, yeah it's because the third syntax returns PosAGL

velvet flicker
#

I've been trying to crack the nut of getting a list of road intersections for a while, I think I'm overthinking this. Is there anything out there already that solves this

granite sky
#

You are not overthinking it :P

velvet flicker
#

I suppose that means a ready made solution isn't out there waiting to lift me up

granite sky
#

How precise do you need it to be?

#

Is this like "all the road intersections on the map" or what?

velvet flicker
#

Need is a good question, I'm hoping to lay ground work for multiple tasks, but the reason I set out on this boat in the first place was for the purpose of setting up roadblocks and such

#

In a region, here is a recent test

#

you can see various false positives

granite sky
#

ah yes :P

velvet flicker
#

Overlaps, and short segments at intersections are the key problem generators

granite sky
#

There's a routine in Antistasi that will find the real intersection point of two roads. You could use that and then merge close results.

velvet flicker
#

My current angle is to iterate through every road segment, put a polygon around it, and test for points inside it, returning the one closest to the center of that road

granite sky
#

You know of getRoadInfo?

velvet flicker
#

Yeah, It's key for my polygon routine

granite sky
#

What I do is a 2d line intersection between startA->endA and startB->endB.

tulip ridge
granite sky
#

but then junction filtering is still pretty fuzzy.

#

Didn't really need it for my purposes.

digital hollow
tulip ridge
velvet flicker
granite sky
#

Nope.

velvet flicker
#

Reasons like this is why I didn't initially go for it, that would not intersect

granite sky
#

It's an infinite line intersect. They don't have to actually cross.

velvet flicker
#

Ah

granite sky
#

You figure that they're adjacent from the other info.

tulip ridge
velvet flicker
#

Ill give that a good look and see what wisdom it holds

granite sky
#

This is more for identifying the correct point once you found a junction, so it's only half of your problem.

#

It's used with some slightly crazy code that does an A-star with road objects :P

tough abyss
#

That's what I figured - My only worry is all these damn imports ect - lol

nocturne bluff
#

That's the fun part

tough abyss
#

Hahaha ofcourse it is :D

still forum
still forum
thorny gull
#

I need some assistance, I am trying to create a script that will make a helicopter loose its engine on an action, and I keep getting errors, I am somewhat new to this language, and I have tried some troubleshooting already, but nothing has worked so far

#

this addAction ["<t color='#FF0000'>Engine Failure</t>", {(vehicle player) setHitPointDamage ["hitEngine", 1.0];}; nil, 1.5, true, false, "", "true", 5, false, "", ""];

warm hedge
#

Missing colon between } and nil

#

Also it is good habit to tell us what exactly is the error

thorny gull
#

Ive gotten a few the most recent was missing; ] though I checked with notepad++ and I had all the brackets in place

#

still getting that same error

thorny gull
warm hedge
#

Yes

thorny gull
warm hedge
#

As I said missing colon

this addAction  ["<t color='#FF0000'>Engine Failure</t>", {(vehicle player) setHitPointDamage ["hitEngine", 1.0];}, nil, 1.5, true, false, "", "true", 5, false, "", ""];```
thorny gull
#

thank you

tough abyss
#

So I got it launching, no errors ect - but it's not overwriting the old RscDisplayLoadMission

#

Any idea's

jade abyss
#

cfgPatch <-- ?

tough abyss
#

hmm? What about it

jade abyss
#

Did you add the ui_F to the required Addons?

tough abyss
#

Derp

#

Lemme try that

jade abyss
#

requiredAddons[] = {"A3_UI_F"};

tough abyss
#

forgot to add it xD

#

Yeah - I had an empty required array

jade abyss
#

Congratulations ;)

chrome hinge
#

Hi everyone!. Anyone know how reportremotetarget target sharing works?

tough abyss
#

Haha thanks

#

Lets see if this works...

chrome hinge
#

I have a mission where one greenfor player gets reportremotetarget data fed in from AI on his side showing players of opposing team on map if AI finds them. However this did not work when this greenfor player was as a client, but did work when he was hosting the session. Is side a local entity that can be moved to other client or should the troops (high command troops) be localized to the greenfor player? Any ideas?

jade abyss
#

If it still doesn't work -> *.rpt is your friend

winter rose
chrome hinge
#

oh the setgroupowner part was e trying to fix it

#

thisTrigger setVariable ["TAG_detect", true];
thisTrigger spawn {
{independent reportRemoteTarget [(assignedTarget _x), 15];} forEach units independent;
sleep 7;
{_x doWatch objnull;} forEach units independent; sleep 7;
_this setVariable ["TAG_detect", false];}; This is the actual code

#

And the greenfor player receives this information when he is in a datalinked vehicle

tough abyss
#

Not working, no errors in RPT

torn hemlock
#

class CfgPatches {
class YOUR_AWESOME_ADDON_NAME {
units[]={};
weapons[]={};
requiredAddons[]={ "A3_UI_F" };
requiredVersion = 1.38;
};
};

class CfgLoadingScreens
{
class Screen1
{
text = "\YOUR_ADDON\YOUR_IMAGE.paa";
};
};

tough abyss
#

I do notice, it's loading my @addons before /addons/

winter rose
#

that is weird, it should work, maybe it needs a remote execution on the assignedTarget machine

chrome hinge
#

The target being observed?

torn hemlock
#

and dont forget about $PBOPREFIX$

chrome hinge
#

or the greenfor player?

jade abyss
#

If he is using it.

winter rose
#

ah wait
assignedTarget requires locality πŸ‘€

chrome hinge
#

okay so does it mean the Ai groups have to be local to the greenfor player?

winter rose
#

what
no

#

it means that the server doesn't know the assignedTarget of a remote unit

#

can't really one-line this one

chrome hinge
#

ar ehigh command groups local to the server or client?

torn hemlock
#

He should because of image path

winter rose
#

"high command groups"?

chrome hinge
#

Groups of Ai soldiers under human high command player

jade abyss
#

Of course, but i still know some guys, that just pack the addons (without a prefix)

winter rose
#

they are normal groups, no?

#

if the leader is AI, the server owns them

chrome hinge
#

subordinates to human player

tough abyss
#

Just trying to get it work - I'll add the prefix after :3

winter rose
#

doesn't matter, the group leader is AI, the rest is scripts

chrome hinge
#

Okay

#

The trigger running that script is not set to server only so it should execute on greenfor player too, you have any ideas on what i could do to troubleshoot this?

winter rose
#

you can't one-line this
you would need to have a script running locally that would frequently save/update the assignedTarget to e.g the soldier's Object namespace (setVariable)
and the server-only trigger would collect this info and report remote targets by getting the variable (getVariable)… but all that would be network traffic-heavy

#

ooor something dirty: a remote-exec call

{
  [[_x], { independent remoteRemoteTarget [assignedTarget (_this select 0), 15] }] remoteExec ["call", _x];
} forEach units independent;
chrome hinge
#

is it heavy if there are no targets being seen currently? There are total of 10 targets Ai can observe and it would be very rare for them all to see same target at once.

real tartan
#

I have file.txt file where I load it to variable like private _string = loadFile "file.txt";

tag1 group1 name1 = true;
tag1 group1 name2 = true;
tag2 group2 name3 = false;

is there a way to identify EOL ( end of line ) ? so I can split string by rows ?

tough abyss
#

Sigh - still no luck :S

chrome hinge
#

Or would this have to be mangled trough eventhandler?

real tartan
torn hemlock
#

Are you sure that your addon is loaded?

tough abyss
#

Yeah - It's loading in RPT

#

Also found it in cfgviewer

copper raven
quiet geyser
#

Trying to adapt the below script to use with the Spawn AI module's Expression field, which behaves as follows: "Code executed when group is spawned. Passed arguments are [<group>,<module>,<groupData>]."
The script in its current form, which virtualizes groups with ALiVE's Virtual AI system:

if ((leader (group _unit)) == _unit) then {
    ["NONE", [], false, [group _unit], []] call ALiVE_fnc_createProfilesFromUnits;
};```
#

What would I need to change here, and what would be the best way to get the script to fire? Basically I just need it to virtualize the groups spawned by the module.

real tartan
proven charm
#

great πŸ™‚

real tartan
tough abyss
#

Ahha! I think I got it

winter rose
winter rose
velvet merlin
#

new to CfgRemoteExec - tried to read up on the BIKI, forums, etc but not quite clear to me is the following setup:

  1. mod has CfgRemoteExec. adds a couple of functions with allowedTargets = 0; and jip = 0;
  2. mission has CfgRemoteExec. with mode=1; and jip=1; for functions class itself

now the mission blocks the mod functions. why is that?

winter rose
#

now the mission blocks the mod functions. why is that?
do you mean "the mission setting is not overriding the mod setting"?

velvet merlin
#

no

#

the mod whitelists some functions

#

the mission apparently discards that

#

Scripting function 'XXX' is not allowed to be remotely executed

winter rose
torn hemlock
#

OK. Seems that we've used wrong class

#

Try this:

stable dune
#

Hi
Can I set explosive damage to 0 via script?

velvet merlin
manic kettle
#

Does anyone know how i can add a player animation to an action? For example lets say the addaction fixes a vehicle. How can i add an appropriate animation & end it if the player wants to stop the animation midway?

velvet merlin
winter rose
manic kettle
#

yeah that looks like what i want, thanks!

south swan
#

@mystic shell basically, most of what you've posted in mission_makers does not make sense as an Arma 3 SQF script. πŸ€·β€β™‚οΈ As such: consult the documentation at bohemian wiki, it's good.
https://community.bistudio.com/wiki/addAction doesn't mention anywhere setting a _x magic variable, so it isn't likely to do anything useful. From the context, just using player should be enough
_x inVehicle (player inVehicle) doesn't make sense twice. First, if the command takes one argument - it goes to the right. Second - inVehicle isn't a command. See example 2 at https://community.bistudio.com/wiki/vehicle to check if player is on foot.
vehicle vic1 crew _x == driver - same stuff. Doesn't make sense at every literal turn. vehicle is a command that takes one unit as argument and returns the vehicle it's in. So vehicle vic1 is "vehicle where vic1 sits". If vic1 is a variable name assigned to vehicle - just vic1 is enough to reference it. crew is a command that takes one vehicle as argument and returns all units that are inside it. driver is a command that takes one vehicle as argument and returns its driver. If you want to check if player is the current driver of said vehicle, you need to run player == driver vic1. That's all. Except it doesn't sound like a possible outcome given the "vic1 is somewhere remote and player teleports to it". Maybe assignedDriver would work, never tested that.

mystic shell
hallow mortar
#

Do not use AI generation for scripting. It does not work. It creates things that look like SQF, but it does not understand SQF and cannot be relied on to make good or even functional code.

tough abyss
#

Half the time it can’t even make SQF cause its so esoteric

open fractal
#

one of the first things I did with chatgpt was ask it to write a basic sqf function and it failed miserably

trim tree
digital hollow
#

params syntax is wrong in there

trim tree
#

in what fashion? Im not very good with scripting

digital hollow
#
params ["_argument"];
``` needs to be in quotes
trim tree
#

throws the same error, but now on

hint str _object
digital hollow
#

at [_object] execVM "fec_hctransfer.sqf" _object isn't known.

the parameters passed to the code in zen_custom_modules_fnc_register are Position and Object https://zen-mod.github.io/ZEN/#/frameworks/custom_modules?id=module-function

so at the least you need

["FEC", "Transfer AI to HC", {
params ["_position", "_object"];
[_object] execVM "fec_hctransfer.sqf";
}] call zen_custom_modules_fnc_register;
trim tree
#

ok, that worked. Thank you πŸ™‚

tough abyss
#

Hmm

#

That changes what?

#

I'm trying to overwrite the whole load screen when connecting to a server

#

for example

#

I got it working to a certain point, but it just turns the whole screen black 0.0

torn hemlock
#

That changes startup loading screen :)

tough abyss
#

Figured

#

Yeah, trying to override the server connect scren

#

Yep - screen still stays completely black

#

:/

eager prawn
#

Hey guys, any recommendations for adding an event handler to all units placed by Zeus?

I'm using CuratorObjectPlaced right now, but it does not cover vehicle crew. If I try to call the crew of the vehicle, it seems they're not yet spawned in the vehicle at the time of the event handler firing.

#
   params["_curator"];
   _curator addEventHandler ["CuratorObjectPlaced", {
      params ["_curator", "_entity"];
      systemChat format ["%1 has placed %2", _curator, _entity];

      if (_entity isKindOf "Man") then {
         _entity addEventHandler ["Killed", {
         params ["_unit", "_killer"];
         systemChat format ["%1 has been killed by %2", _unit, _killer];
         }];
      }


   }];
};```

confirm kill is called on the Zeus module init.
pulsar bluff
eager prawn
# eager prawn Hey guys, any recommendations for adding an event handler to all units placed by...

I fixed my issue, apparently the crew not returning was a me issue, not a timing issue πŸ™ƒ if anyone searches for this issue in the future, I'll leave the solution here for posterity

   params["_curator"];
   _curator addEventHandler ["CuratorObjectPlaced", {
      params ["_curator", "_entity"];
      systemChat format ["%1 has placed %2", _curator, _entity];

      if (_entity isKindOf "Man") then {
         _entity addEventHandler ["Killed", {
         params ["_unit", "_killer"];
         systemChat format ["%1 has been killed by %2", _unit, _killer];
         }];
      }
      else {
         if (_entity isKindOf "AllVehicles") then {
            {
               _x addEventHandler ["Killed", {
               params ["_unit", "_killer"];
               systemChat format ["%1 has been killed by %2", _unit, _killer];
               }];
            } forEach (crew _entity);
         };
      };


   }];
};```
#

still don't know if "AllVehicles" is safe to use, but it works for now

tough abyss
#

I wish we could use the debuglog command :(

midnight niche
#

I'm sure this is going to be a easy solve,

But I'm struggling with DrawIcon3D taking a string.
putting name player directly into the EH works fine, but feeding it from a var isn't? Is there a formatting trick?

_label = name player;
addMissionEventHandler ["draw3D", 
{ 
 drawIcon3D 
 [ 
  "\a3\ui_f\data\IGUI\Cfg\Radar\radar_ca.paa", 
  [0,0,1,1], 
  iconPos, 
  5, 
  5, 
  getDirVisual player, 
  _label,
  0, 
  0.3, 
  "PuristaMedium", 
  "center", 
  true 
 ]; 
}];```
distant egret
#

Ie. You define _label in a separate scope that the drawIcon3D command runs in. So it does not exist.

#

Or define _label inside the eventhandler scope.

midnight niche
#

Ta, i need to re-evaluate.

tepid vigil
#

Is _vehicle deleteVehicleCrew _unit functionally identical to moveOut _unit; deleteVehicle _unit, or is there a good reason to prefer deleteVehicleCrew?

sullen sigil
#

Anyone got any stats for how accurate base game performance test is? Not entirely convinced setObjectScale of a unit is 0.0005ms thonk

sage heath
#

so im doing an op where the lads storm an AQ tunnel, but i need some help on a few things, basically first the tunnel entrance, im thinking of doing a holdAction and once the thing is done it plays a little fade in fade out to transition the player teleporting into the tunnels, is this possible?

second, the tunnels itself, i'd like if possible for the tunnels to be dark, even if the outside is bright, eg. SOG tunnels, is this possible?

sullen sigil
sage heath
#

well, i did download fata tunnels, so i already got that covered

sullen sigil
#
this addAction ["YourAction",{
[] spawn 
{ 
titleText ["", "BLACK OUT", 2]; 
sleep 3;  
player setPosATL (getPosATL tplocation);
titleText ["", "BLACK IN", 2]; 
};}];```
sage heath
#

however, its just that, i need a portion of the map to be dark once the players are in it (or maybe perhaps after they enter the entrance?)

sullen sigil
#

that'll fade to black, tp the player, fade back out

sullen sigil
still forum
sullen sigil
sage heath
still forum
#

if scale is unchanged, it might just do nothing inside the command.
So 10k runs only the first one actually does something

sage heath
sullen sigil
still forum
#

i mean inside your performance test run

sullen sigil
sullen sigil
still forum
#

ok bye

sullen sigil
#

roughly same within an oneachframe (within measurement error)

#

Oh right, I understand what you mean now
But has barely any performance increase I would imagine is from the getObjectScale

tepid vigil
#

Also, how come that moveOut doesn't recommend or require the vehicle to be local, unlike every other command with a similar effect. The only other command like this is deleteVehicleCrew, which also recommends being ran locally.

#

Is moveOut just superior or is there something going on that's not documented into the biki?

pliant stream
sullen sigil
#

because i would expect more than 0.0005ms for virtually any command that isnt just changing a simple variable

pliant stream
#

So why do you think it isn't just changing a simple variable?

sullen sigil
#
var = "hi";
var = "hi2";``` has worse performance at 0.0008ms
pliant stream
#

Well that makes a lot of sense.

sullen sigil
#

not really given thats not even running inside an oneachframe either

pliant stream
#

That's doing a lot. Two hash table lookups at the least. Perhaps even allocating memory.

#

That setObjectScale might just mutate some field on the object in question.

#

Just because you see something happening, doesn't mean there's a lot of code being executed in the scope of that native function you're calling.

#

Based on the results you're seeing, it really is probably just updating a float on that entity.

sullen sigil
#

base game has a speedometer for code performance test, im using advanced developer tools where you click the stopwatch

hallow mortar
#
  • in the debug console
sullen sigil
#

yeah advanced developer tools is made by leopard, get it off steam workshop -- will save you tons of time

teal flare
#

How do I get the nearest object of a certain classname, or alternatively the nearest object in a global array?

little raptor
teal flare
velvet flicker
#

Ugh damn I just learned a lesson the hard way

#

should have been using private for so many of my functions

#

how much has this been wrecking me

#

Arma 4 needs a less painful language

peak pond
#

Ouch. But all programming languages are painful.

velvet flicker
#

Not true, SQF needs more respect for scope

#

I do C for a day job

rocky basin
tough abyss
#

So, you can use markdown in this chat, which will help :)

while{true} do {
	diag_log format ["STIME: %1 DTIME: %2",serverTime, diag_tickTime];
	uiSleep 1;
};	
rocky basin
# winter rose why would you need that

i would like to be able to select one of the textures in a eden attribute to assign it to a part of the model that is supposed to mimic the ground. But in order to have a dropdown menu with options i first need to assemble all of the options in a list.

copper raven
slow idol
#

much not C#

granite sky
#

If a player stopped one of their AIs with the command bar stop order, is there any way to undo or at least detect that in script? stopped returns false and stop, doStop and commandFollow have no effect.

#

commandFollow does the same radio chat as "regroup" but it doesn't unstop the unit.

peak pond
#

Pretty sure commandFollow or doFollow should unstop them, but not sure if it works when player used command bar like you mention.

velvet flicker
#

What am I not getting here?

#

Shouldn't that return '4'

gaunt tendon
quasi thicket
#

how?

gaunt tendon
#

Is there a vectorAdd that takes n-sized vectors?

granite sky
#

@peak pond currentCommand works at least. Thanks.

hallow mortar
# gaunt tendon Is there a vectorAdd that takes n-sized vectors?

If it's got more than 3 elements it's not a vector, it's just an array of numbers.
There is no such command, but you could slice up your array into 3-element chunks and do vectorAdd on them, or you could make your own apply-based function that can work on any array size.

hallow mortar
# velvet flicker

That syntax is added in 2.11. 2.11 is the current dev branch, to be released in update 2.12. Current main branch is 2.10; if you're on stable, you don't have this syntax yet.

velvet flicker
#

Oh daang

#

Consider my mind boggled

#

one because I happened to stumble upon something unreleased

#

two because something so useful hasn't been added in what, 11 years?

hallow mortar
#

There are a lot of things like that in SQF.
Honestly, for a large part of that time, there have been bigger fish to fry. That syntax is a nice QoL thing but you can achieve the same result by reversing the array and then doing a normal select on it, so it's not technically necessary.

velvet flicker
#

I suppose if you are building a ladder to the moon you gotta a skip a few pegs

pulsar bluff
#

so we are getting all this cool stuff backloaded onto the game

hallow mortar
#

Pinging them at 5am for a random conversation seems like a great way to receive an orbital strike :U

pulsar bluff
#

im sure im already muted πŸ˜‚

#

also its 3pm

#

check your clock

tough abyss
#

Yeah, I got the language tag wrong

hallow mortar
pulsar bluff
#

yea 2022 was a great year for SQF. i had β€œretired” from arma dev in 2018

#

but the new stuff (and fixes) was enough to make fiddling interesting again

velvet flicker
#

I can't imagine it being worse than this, I've only been at this for a week and It's like pulling a push mower to get things done sometimes

tough abyss
#

works for JS

var s = "JavaScript syntax highlighting";
alert(s);
velvet flicker
#

I guess I picked a good time to get into the scene

pulsar bluff
#

you wont last long then, and therefore should just quit now to save time 🀣

#

what are you working on @velvet flicker

velvet flicker
#

I got started a week ago making small tools for my unit, right now I'm working on walling off outposts using convex hulls

granite sky
#

Honestly the language is the least bad part these days :P

hallow mortar
#

SQF can be challenging to get into. It's probably actually worse if you already know another language - SQF isn't a normal language, it's a user-facing middle layer that then talks to the game's actual language, which is some kind of C, and that means it doesn't behave how you'd expect if you already have good coding habits. But, once you figure out the principles and learn some of the nerdier commands, it can be pretty powerful.

granite sky
#

But then my perspective may be coloured by trying to make AIs do stuff.

velvet flicker
pulsar bluff
#

so vector/centroid/geometry stuff

tough abyss
velvet flicker
#

Yeah, I think i'm pretty close to cracking the nut. I made a method to draw h barriers along a straight segment and now I just need to get outline going

granite sky
#

Note that SQF is very very slow.

tough abyss
velvet flicker
pulsar bluff
#

im wary of procedural stuff like that. do you have good grasp of surface normals and Z adjustments?

velvet flicker
#

Yeah, most of my fight is just figuring out the SQF syntax to do stuff

pulsar bluff
#

i see line intersection tests and bounding boxes in your future

velvet flicker
#

I already did that

pulsar bluff
#

theres a little lake in VR editor, good for making sure your stuff works around slopes and water

velvet flicker
pulsar bluff
#

road intersections

velvet flicker
#

Oh you mean line intersections for the walling off haha

#

Yeah, I have a vague plan for that

pulsar bluff
#

what happens if theres a player driving a tank thru at the same moment the wall is being laid down

velvet flicker
#

Oh this is not for live use

#

This is to facilitate our zeuses in setup

pulsar bluff
#

ah cool

velvet flicker
#

Though I suppose it could be used for such evil...

pulsar bluff
#

like a β€œfortify town” function

velvet flicker
#

Yeah, that's the spirit of what I've been doing

pulsar bluff
#

sounds hard

velvet flicker
#

Tackling it piece meal so if SQF kills it for me they can have the half filled toolbox

#

Got the hostage script working though

pulsar bluff
#

if the result is always the same, could you exec in the editor and then save the result to a file?

velvet flicker
tough abyss
#

Only certain bit work tho..

quasi thicket
#
/*
 * 3/5/13
 * This program will sort the word "typewriter" in alphabetical order.
 *
 */
public class SortingString {
    public static void main(String[] args)
    {

        String s = "typewriter";

        for (int i = 0; i < Integer.MAX_VALUE; i++)
        {
            s = randomSort(s);

            if (s.equals("eeiprrttwy"))
            {
                System.out.println(s);
                break;
            }

            if (i == Integer.MAX_VALUE - 1)
            {
                i = 0;
            }
        }

    }
velvet merlin
#

how to expose sqf commands not yet available in the build/from special branches, so the compiler doesnt bug out parsing the script?

warm hedge
#

I use #define NewCommand (psuedo commands)

meager granite
#

Probably can cause problems if that command is used in some code structures

#

Maybe there is a better way?

#
#define thisCommandDoesNotExist isEqualType
```?
#

I guess it depends on if command is binary, unary or nular

#

And what it returns

still forum
still forum
still forum
meager granite
#

What's with HandleDamage triggering on remote units (and doing nothing of course)?

velvet merlin
#

thanks guys πŸ™‡β€β™‚οΈ

velvet merlin
meager granite
#

Yeah, I'm just confused with all its oddities. It firing for some selections and doing nothing, then firing for same selections again but this time damage applies. Having it on remote units triggers the EH but it does nothing there.

#

Trying to create complex damage tracking system and this mess confuses me

velvet merlin
still forum
#

Mh.
I guess I forgot that πŸ€”

#

you can check game ver min for being 11 or 13 or 15

meager granite
#

No it doesn't

still forum
#

#if has limited operators

#

its not sqf script

#

oof the wiki documentation on #if is actually quite bad

#

// Very basic #if MACRO OPERATOR NUMBER
// <, >, <=, >=, ==, !=

meager granite
#

Guess no way then

still forum
#

Ah game version doesn't work because diag vs normal

#

Fixed.
#ifdef or #if __A3_DIAG__
starting next dev branch

#

Now just someone add that to wiki page, thanku

winter rose
velvet merlin
winter rose
meager granite
#

@still forum Why HandleDamage does false fires on local units?

By false I mean they make no sense and their return also doesn't even apply the damage.

Here is HandleDamage log in table form: https://pastebin.com/raw/t7di9apG (_wanted_damage is _damage from EH) All fires are in single frame, first two fires for head and [TOTAL] overall damage do nothing. Why do these events even trigger?

#

Already raised this topic here a week ago but it still bothers me

still forum
still forum
meager granite
#

Armanormality

#

I guess I'll just have to build my code around these bugs then have it break if its fixed some day

velvet merlin
#

__ARMA__ and __ARMA3__ return 1 if A3 > 2.02 and undefined otherwise?

velvet merlin
meager granite
#

Then it goes through each selection including these false fires and works properly

#

That issue of EH firing on remote unit (and doing nothing) is another part of HandleDamage being wonky

#

_current_damage is actual damage on the moment of EH fire
_wanted_damage is damage from EH array
_new_damage is what EH returns (what it should set damage to)
_saved_damage is script-saved damage, what _new_damage was last time for that selection (or overall)

still forum
meager granite
#

Fire 1: head, doesn't do anything, returned damage is not applied
Fire 2: overall damage, doesn't do anything again
Fire 3+: Goes through all selections and overall and finally works as it should

pulsar bluff
#

i dont have these false fires

#

if u can give a reliable repro ill check it out

#

its unusual to use handledamage on remote units

south swan
#

i do have them on local units πŸ€·β€β™‚οΈ

#

or was that "hitPart", lemme recheck πŸ€”

south swan
#

"HandleDamage" does produce double fires on "" and "Head" selections for me. productVersion is ["Arma 3","Arma3",210,150255,"Stable",false,"Windows","x64"]
Test environment: 3DEN, one playable unit, one AI unit with following Init: sqf this disableAI "ALL"; this addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"]; diag_log ["HandleDamage",diag_frameNo, _this, _hitIndex, _unit getHitIndex _hitIndex]; _damage / 10 }]; part of resulting log corresponding to 2 headshots: https://pastebin.com/in9FZMFr, lines in question: L1 is duplicate of L6, but one frame earlier; 2/3, 10/15, 11/13. The actual hitpoint damage value doesn't seem to be updated after the first instance fires.

winter rose
#

_damage / 10 is not how you divide damage by 10

velvet merlin
# meager granite Fire 1: `head`, doesn't do anything, returned damage is not applied Fire 2: over...

The depends relations may play a role here

            class HitHead: HitNeck
            {
                armor = 1;
                material = -1;
                name = "head";
                passThrough = 0.8;
                radius = 0.2;
                explosionShielding = 0.5;
                minimalHit = 0.01;
                depends = "HitFace max HitNeck";
            };```

Another element is there should be an event for impact (even on deflection) and another for penetration - in the same frame if I am not mistaken.
As such you can see double entries for "".
south swan
velvet merlin
#

best to use the shots diag in combination to see what is happening in terms of penetration/projectile path and what selections may have been triggered as a result

south swan
#

https://pastebin.com/Jz0sHd00 with "HitPart" EH added to player's projectile as well. Lists one impact with target model. Target still fires "HitPart" EH in two separate frames, with projectile hitting the ground surface on the first of them already.

#

also, on the first frame the listed selections are still "head" and "" even when target is shot to the leg πŸ€·β€β™‚οΈ

meager granite
meager granite
#

The damage was from falling btw, no penetration or anything

#

Just falling from few meters

velvet merlin
#

well from what i recall falling damage is special in itself

meager granite
#

The issue is the same for other damages too

#

Grenade self damage

#

Also adds another event trigger on next frame that does 0 damage

#

Idential picture when done on another unit (AI)

#

Shooting a leg of an AI

south swan
#

i still stand by the theory that "bust" and the "body" are separate entities that both count as a target, but "bust" calculations happen one frame early and get dropped :3

meager granite
#

πŸ€”

velvet merlin
#

i am seeing only head twice here on my end

south swan
#

eyyyy, consistency

meager granite
#

should also be double -1 hit_index

#

or overall damage

velvet merlin
south swan
#

dupes both "head" and "" on stable build on my machine as well (["Arma 3","Arma3",210,149954,"Stable",false,"Windows","x64"]). Switching to dev for maximal memeness
dupes on dev as well ["Arma 3","Arma3",211,150223,"Development",false,"Windows","x64"]

meager granite
#

Maybe try non-killing damage?

south swan
#

dupes both even on dead infantry on dev build notlikemeow

velvet merlin
#

HD is only exposing the underlying mechanic - there is zero chance Dedmen would still change anything with that

you can handle double execution yourself (but beware even multiple HD events can happen in one frame upon penetration)

i am pretty sure its also long known only the last HD event in a frame on the given selection gets applied
you can have multiple stacking EH events. yet if those build upon each other in terms of damage or all prior damage adjustments in the same frame get ignored, i dont reacall. Sa-Matra's logging suggests the latter

velvet merlin
#

0: position (for supported types see BIS_fnc_position). Screen center is used by default

#

from what i can see the latter statement is wrong - it takes the first selected object as center, no?

velvet merlin
#

is there a way to easily filter weapons/vehicles for arsenal/garage per side/faction?

#

or is the only practical way to iterate through cfgVehicles and build an inventory of the used weapons/vehicles for the given side/faction

velvet flicker
fervent wolf
#

Good day, could you tell me what variable to use so that when entering the trigger, this or that weapon spawns? I figured out the spawn of vehicle, I use "rhs_m2a2" createVehicle getMarkerPos "marker_26"; , but I can't do it with weapons.

south swan
velvet flicker
#

PROGRESS!

#

Had to share it, small victories

smoky rune
#

By the chance, is there any way to enforce unconscious post effect (grey screen, vignette) by script?🐸

kindred zephyr
austere granite
#
while {true} do { // spam chat }
#

So who is adding SQF highlighting? :)

grizzled cliff
#

Just use SQL

lone glade
#

or C++

quiet geyser
#

How should I set up a command to apply a set of given liveries to a vehicle in the editor? The textures I've found digging through the textureSources section of the vehicle's config entry read:
hiddenSelectionsTextures[] = {"\OPTRE_Vehicles\Warthog\data\M12HogMaav_extupper_co.paa","\OPTRE_Vehicles\Warthog\data\M12HogMaav_extunder_co.paa","\OPTRE_Vehicles\Warthog\data\turrets\m12_turret_co.paa"};

#

How would I apply these from script?

hallow mortar
#

setObjectTexture in the vehicle's init would do it. Note that those are 3 textures that go together at the same time (one for the upper body, index 0, one for the lower body, index 1, one for the turret, index 2) not 3 alternate textures.
Don't forget to check the vehicle's Virtual Garage options via rightclick>Customise - it may be possible to apply alternate textures without needing scripting.

quiet geyser
#

Yeah, the issue is when they respawn, that doesn't persist/come back. Need to write a small script to apply these attributes from the Expression field of the Vehicle Respawn module.

What about things like camo nets?

solar geode
#

So this appeared a week ago on the Wiki: "From Arma 3 v1.53.132890 arrays are limited to maximum of 999999 (sometimes 1000000) elements"
Does anyone have any info why is this changing, as in, is the underlying structure being changed to support something? The only thing that comes to mind is the problems they had with huge arrays stored in profile namespace that were wrecking performance for people.

quiet geyser
#

Just to check by the way, currently calling this as:
_this execVM "vehATHog.sqf";
from expression field, then vehATHog.sqf has:
_vehicle = _this select 0; _vehicle setObjectTexture [0, "OPTRE_Vehicles\Warthog\data\M12HogMaav_extupper_co.paa"]; _vehicle setObjectTexture [1, "OPTRE_Vehicles\Warthog\data\M12HogMaav_extunder_co.paa"]; _vehicle setObjectTexture [2, "OPTRE_Vehicles\Warthog\data\turrets\m12_turret_co.paa"]; clearWeaponCargoGlobal _vehicle; clearMagazineCargoGlobal _vehicle;

lone glade
#

it's probably to avoid hackers and script kiddies to destroy your server

keen stream
#

What about arrays in arrays?

lone glade
#

running a count on an array so big would kill the scheduler

grizzled cliff
#

thats not how count works in Arma

#

or in most languages

#

WELL

#

if you use count as it should be

#

which is with no args

keen stream
#

@lone glade That and maybe it is a limit in unscheduled space? ( wasn't it 10k loops ?)

lone glade
#

10K loops for schedulded yes

grizzled cliff
#

anyone who uses a spawn/execVM is a noob

#

imo

#

;P

lone glade
#

but comparing arrays with such a number of elements, oh boi

solar geode
#

The most hilarious thing about the message is "limited to maximum of 999999 (sometimes 1000000) elements"

#

In true Arma style. "Sometimes". :D

hallow mortar
#

You may need setObjectTextureGlobal, I'm not sure if the module expression is executed globally or server only or what

#

You can use https://community.bistudio.com/wiki/BIS_fnc_initVehicle to apply virtual garage customisations like camo nets. You can use this to do textures in the same function call, but only texture sets that are available as selectable options in the garage, not individual or custom textures.

quiet geyser
jovial aspen
#

Hi. Im trying to rpt log zeus spawns for my server but I cant seem to get it to work. Im trying to use
CuratorObjectPlaced
but because it is local, i cant get it to work to log on the rpt file of the server

keen stream
#

@grizzled cliff but I like execVM. :(

nocturne bluff
#

@grizzled cliff It's all depends on what you wanna do ;)

proven charm
#

then server can log it

jade acorn
jovial aspen
#

my code goes like this

    params ["_curator", "_entity"];
    private _message = format ["%1 has placed: %2", _curator, _entity];
    _message remoteExec ["diag_log", 2];
    "HELLO WORLD" remoteExec ["diag_log", 0];
}];
#

OH WAIT OMFG I FOUND THE PROBLEM

warm hedge
#

^ how we write proper code

modern meteor
#

Hello, I need your help please. I created a custom menu to issue commands to my AI squad. Option 2,3,4 work perfectly fine but for some reason option 5 (Follow me) does not show up in the menu and every time when i open the menu via hotkey it immediately executes "spawn CommandDispatcher".

#include "\a3\editor_f\Data\Scripts\dikCodes.h"

mymod_fnc_showGameHint = {
MENU_COMMS_2 =
[
    ["Submenu", true],
    ["Move", [2], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5], 3] execVM ""\script\CircleStand.sqf"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
    ["Sneak", [3], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5], 3] execVM ""\script\Circle.sqf"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
    ["Waypoint", [4], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5]] execVM ""\script\Waypoint.sqf"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
    ["Follow me", [5], "", -5, [[[player, "vn_handsignal_move_out"] spawn CommandDispatcher]], "1", "1"]

];
showCommandingMenu "#USER:MENU_COMMS_2"
};
#

What am I doing wrong and why does option 5 do not show in the menu

#

?

winter rose
#

your option code is not in a string, it is directly-executed-in-this-scope code πŸ™‚

#

and it is perhaps missing the ["expression"] part too

south swan
#

eyy, Lou saves the day

modern meteor
#

I see

meager granite
#

@velvet merlin Tried removing depends from HitHead and making it armor = 1000, still same picture

modern meteor
#

Still not sure what the correct code is

meager granite
#

I guess the engine is hardcoded to damage "HitHead" all the time or something

modern meteor
#

Tried many things but can't get it working

meager granite
#

First it does that hardcoded damage, then overall damage because of it

#

Then it does normal walk through all hit parts

winter rose
south swan
#

🧠 remove/rename the head hitpoint and check if it still shows for dupe

modern meteor
#

Not sure what I did wrong

winter rose
#

errors being?

modern meteor
#
[player, "vn_handsignal_move_out"] spawn CommandDispatcher;

This works fine one a standalone basis but I did not find a way to copy it correctly into one of the existing lines.

winter rose
#

and how did you try to set it up, aside from the above example?

modern meteor
#
    ["Follow me", [6], "", -5, [["expression", "[player, "vn_handsignal_move_out"], screenToWorld [0.5, 0.5]] spawn CommandDispatcher"]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],

This is what I got

winter rose
#

see the syntax highlight
if you want a " in a string " ", double it " quote "" here"

modern meteor
winter rose
#
    ["Follow me", [6], "", -5, [["expression", "[player, ""vn_handsignal_move_out""], screenToWorld [0.5, 0.5]] spawn CommandDispatcher"]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
```or better```sqf
    ["Follow me", [6], "", -5, [["expression", toString { [player, "vn_handsignal_move_out"], screenToWorld [0.5, 0.5]] spawn CommandDispatcher }]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
shut flower
#

execVM is bullshit

modern meteor
#

I will try the first one but the second code is giving me an error

#

will report back in a min

modern meteor
#

yes

winter rose
#

what is the error?

#

ah yes, a comma

#

right after "vn_handsignal_move_out"], the , should not be there

south swan
#

except it probably should and there should be extra [ before the [player,

#

or screenToWorld [0.5,0.5] should be removed πŸ€”

#

something fishy is going on

#
["Follow me", [5], "", -5, [["expression", toString {[player, "vn_handsignal_move_out"] spawn CommandDispatcher}]], "1", "1"]```
modern meteor
winter rose
modern meteor
queen cargo
#

it is not chris5790
but it is used for every shit most of the time which causes it to be garbage

winter rose
#

what artemoz posted

modern meteor
#

trying it now. 1 sec

queen cargo
#

in theory you do can totally ignore that command

south swan
queen cargo
#

practically, you might want it

#

if you enable filepatching you can use execVM to reload a config for example

lone glade
#

wat

shut flower
#

execVM is obsolete since cfgFunctions is there. For final products it should be nerver used

lone glade
#

you can reload configs one by one, there's a debug tool on the dev branch available

#

or so I've heard

modern meteor
queen cargo
#

@lone glade talking about variable config shit and only as mind-concept

sage heath
queen cargo
#

@shut flower im with ya on that topic, however, we wont get rid of that command thus we should at least teach its only allowed usage correctly

#

because in all other cases ... that command is complete garbage

#

just this lil one edge case

#

saves you a few ms

#

as execVM is one command whilst spawn compile preprocessFileLineNumbers are 3

shut flower
#

SQF configs are crap too

queen cargo
#

actually they are not as they are way faster

#

configBin >> "anything" is WAY slower then a simple variable lookup

shut flower
#

but more dynamic

queen cargo
#

not rly

#

you can also setup your config variable to be as dynamic

#

requires quite some defines etc. but its all possible

shut flower
#

if I have the choice between a arrayception or a binary config I will take the binary

queen cargo
#

thats true

winter rose
queen cargo
#

and i never said you should not

#

just saying, there are needs for sqf configs

modern meteor
winter rose
#

then use that

velvet merlin
#

is there a good way to clean up vehicle crew not deleted by BI garage collector that deleted the vehicle?
(aka the crew remains floating at their vehicle crew position - also naked but thats another issue..)

proven charm
sage sluice
#

Hello everyone, hopefully in the right area here, was torn between this and #arma3_scenario.

I have created a training map in which I would like players to be able to 'Show/Hide' various formations through use of an AddAction on a Laptop. The action will either Show or Hide flags indicating positions.

On the Laptop I have placed the following in it's init:

this addAction ["<t color='##0000FF'>Show All Round Defence Marker</t>", "ambushscripts\showARDmarkers.sqf"];

The 'showARDmarkers.sqf' reads as follows:

ARDMARKER_1 hideObjectGlobal false; ARDMARKER_2 hideObjectGlobal false; ARDMARKER_3 hideObjectGlobal false; ARDMARKER_4 hideObjectGlobal false;

The objects 'ARDMARKER_1' etc, are initially hidden on mission start.

On Single-player this works just fine however not so much on the server itself.

I have utilised Google but found a lot of different options. I was hoping the most suitable could be provided here.

I feel like this is relatively simple but I'm a complete novice so any and all help is appreciated.

winter rose
sage sluice
winter rose
#

hideObjectGlobal is a server-side command; it has to be remote-executed from the client to the server, using remoteExec

#

in singleplayer, the local machine is the server

[ARDMarker_1, false] remoteExec ["hideObjectGlobal", 2]; // target 2 = server
sage sluice
velvet merlin
proven charm
winter rose
#

I dare say no - also we don't have an "EntityDeleted" mission EH (@still forum? ^^ (too expensive EH?))
I dare say that deleting the vehicle itself might bring a memleak too (if deleteVehicle does when deleting a boarded unit vs deleteVehicleCrew), to be confirmed

distant egret
#

Does the "deleted" EH not trigger before actual deletion?
So add it when adding the vehicle to the garbage collector.
Or is the garbage collector adding the items automatically?

proven charm
smoky rune
#

Is there any way to change BIS_fnc_holdKey text message without creating new control? It is Press "KEY" to advance by default

winter rose
smoky rune
#

Hmm, haven't thought about that, guess it's viewable through in-game function viewer?

#

Thanks for advice!