#arma3_scripting

1 messages · Page 549 of 1

surreal peak
#

thanks for help!

astral dawn
#

I might be wrong, but can't you modify the class of the object to trigger some event handler when it's created?

tough abyss
#

init

thorn saffron
#

How do you run a script when CBA setting is changed? I have troubles figuring this one out and the instructions i found aren't all that clear in this regard.

exotic flax
astral tendon
#

Does too many weapon holders can be bad for performace?

finite dirge
#

Too many of any objects will hurt performance.

astral tendon
#

they usually dont have physics, I tough that weapon holders would not be too much of a problem, I was about to do a actually arsenal with allot of weapons and magazines around, but I had to put each individual, it would be good to have only the model as reference.

still forum
#

What is the least resource intensive way to constantly check for a certain simple object being created? Right now im using a FrameHandler from CBA
If you have CBA, you can just use a init eventhandler which fires on any object being spawned.. tho.. I don't know if simple object counts as "any object"
im constantly searching for ace_drop's which are created in the createBlood part of ace 3
Oh that? Just use the eventhandler that fires when a bloodDrop is created... only fires on server tho but don't think that's a problem.
https://github.com/acemod/ACE3/blob/b2f4b8ea20489df05e366683f6ddf34a2eeb1daf/addons/medical_blood/functions/fnc_createBlood.sqf#L29

#

@surreal peak

waxen tendon
#

how to make ammoboxes single use

#

or make them finite and set capacity very low

still forum
#

just put few items into them?

waxen tendon
#

vehicle ammo*

#

sorry very important detail

cosmic lichen
#

Is there a way to return the owner of a waypoint?

winter rose
#

afaik no, as a waypoint is "just" an array

#

@waxen tendon setAmmoCargo

tough abyss
#

your question is quite vague @cosmic lichen who would you consider an owner?

cosmic lichen
#

the group the waypoint was added to.

#

But I fixed my issue differently now. So it's fine.

tough abyss
#

yes you can get the group as waypoint is array consisting of group and index

cosmic lichen
#

Right, thanks

calm bloom
#

Hello, guys, may i have a quick question?

How can i offset a distance from the view direction of a player? I try to combine

_edir = eyeDirection player;
    _cpos = (_edir vectorMultiply PZNhrange);```
with something, but cant find propper script command to that
still forum
#

vectorAdd?

calm bloom
#

the line from a code gives relative position, i need absolute

#

i thought that vectoradd combines two vectors

still forum
#

yes

#

sounds to me that's what you want

calm bloom
#

and how can i get absolute position on world coordinates?

still forum
#

getPosWorld

calm bloom
#

getpos of a vector?

still forum
#

you add relative to absolute

#

you get another absolute

calm bloom
#

oh wow

#

i think i got it

#

so i just use vectoradd to relatively just add numbers from vectormultiply part to a coordinates

still forum
#

yes

calm bloom
#

thank you) I am rather bad at geometry stuff so i was thinking of that vector commands like some magical things

#

Also, may be i can get another advice? I am trying to hide large amount of objects outside of player fov, so would it be apropriate to get them with that command?


_on = pzn_rocksarray inareaarray [_cpos, PZNrange, PZNrange, 45, true];
    _off = pzn_rocksarray - _on;

that feels not very optimized

#

ha ha, it just hangs the arma

still forum
#

inareaarray is very optimized

young current
#

@calm bloom the engine should not be drawing that stuff so you should not need to do that on your own

#

its probably more inefficient to hide/unhide stuff than what you gain if you gain anything from it

calm bloom
#

well, it really helps if i hide the bodies, i wanted to try same trick

winter rose
#

I would say you do not save CPU nor GPU by hiding map objects
bodies though, they have some impact (AI, actions, etc)

calm bloom
#

yea, looks like that is not an option

#

i wanted to optimize that view somehow

winter rose
#

Eye of the Tiger plays in the background

hollow thistle
#

Bodies take a lot of performance, and even disabling simulation does not help much with them.

calm bloom
#

i am just hiding them at some range

#

like 200 meters

#

gives maybe 5 fps for 200 bodies

winter rose
#

Garbage collection dammit!

#

why would you want 200 bodies laying around 😄

hollow thistle
#

We have addon at ArmaForces that converts bodies to simple object / ace body bag at distance. xD

#

"body cache", saves a lot of fps. Also removes them after some time.

#

Looks a bit wonky but works.

#

We could use "dead men" simple object 🙈

winter rose
#

yet no one got my Eye of the Tiger joke 😢

hollow thistle
#

AGC - Advanced Garbage Collector is the name.

calm bloom
#

well, you can get antitank weapon from the fallen at squad for example

#

also, you can see the spot of last gunfight

winter rose
#

200 in the same spot… 't's a lot

calm bloom
#

they are not in the same spot usually

#

anyways, it was an experiment, just like the one we discussed earlier, and it kinda worked

#

when you fight on the battlefield with wrecks and corpses from the day earlier it makes game more immersive

winter rose
#

well in these conditions you have to deal with performance issues and improvements then yeah :D
but good job 👍

calm bloom
#

btw speaking of bodies, you can save them in mission sqm like the vehicles, not like units

#

soldier gets full custom equipment config and have ragdoll animation of dying, but it has no group and all stuff

hollow thistle
#

Yes, it's the same like doing a "createVehicle" with unit class. It's lighter as there is no AI.

tough abyss
#

anyone know some decent inidbi2 example mission or script that works on dedi?

surreal peak
#

Also thanks Dedmen for telling me about the bloodDropCreated server event, didnt think about that!

astral dawn
#

It's a macro definition, if you check includes you will find it in some #define

errant jasper
#

@surreal peak GVAR turns GVAR(bloodDropCreated) into something like CBA_medical_blood_bloodDropCreated and QGVAR turns it into "CBA_medical_blood_bloodDropCreated"

winter rose
#

GlobalVar and QuotedGlobalVar I suppose

#

I am smart, my mom said so

surreal peak
#

ah so by Quoted it means it is a string?

winter rose
#

yup

surreal peak
#

that's sweet, thats gonna make reading the code a heck of a lot easier

still forum
smoky verge
#

I'm trying to set 2 different endings of scenario depending if one of the 2 factions has no alive players
but as soon as I start the game the first ending istantly activates
https://imgur.com/a/4nkTzoe

still forum
#

maybe add time > 20 && to condition

smoky verge
#

I'll try

#

@still forum
it works alone but there is still a chance that even if the faction has alive members the triggers would activate anyway
I'll check it in 2

smoky verge
#

@still forum it always plays the blufor winning scenario, even if there are no blufor alive and indfor players still alive

#

is indfor the right definition for the independants?

still forum
#

If I were you I'd just check the wiki 😄

winter rose
#

(rewriting it soon™)

smoky verge
#

weird I checked on the Biki and I saw Indfor somewhere

winter rose
#

maybe in a comment, but shirley not as a command

smoky verge
#

it seems to work now

tough abyss
#

#define indfor independent

#

I am trying to track down some badly behaved waitUntil errors, is there an easy way to work out which mod/source file is causing the problem?

still forum
#

explain what kind of "error" ?

tough abyss
#

nil return error

still forum
#

RPT shows you line and file doesn't it?

#

as a normal script error

tough abyss
#

Doesn't give where it comes from just the context

still forum
#

if it doesn't print source location then maybe it itself doesn't know where it is

#

could try ArmaDebugEngine's callstack dump, maybe that knows where it is

tough abyss
#

Shall give it a go

#

Intercept core dependency? Not seeing a release of that.

still forum
#

github release has it included. Workshop release has a dependency on it

tough abyss
#

If you create this object "Land_FuelStation_Feed_F" server side, players will not be able to use it. If you create it on client "A" machine, client "A" will be able to use it. Can i make it works server side?

robust brook
#

@tough abyss What are you trying to "use" with that object?

tough abyss
#

@robust brook a vehicle half fueled

green solar
#

detect player exit VA?

#

in initPlayerLocal

young current
#

@tough abyss how do you create it?

cosmic lichen
#

@green solar VA = Virtual Arsenal?

tough abyss
#

@young current i create it with createVehicle.

tough abyss
#

Try setOwner of fuel station to the owner of the player

tough abyss
#

I added a HandleDamage event handler on this object "Land_CanisterFuel_F" to make it explode when shoted... but the EH never triggers! Why?

winter rose
#

@tough abyss try "Hit" EH

tough abyss
#

because it doesnt have andy hitpoints?

#

It is PhysX object you can add EPEContactStart EH

jovial horizon
#

Hey guys, I got 1 question for all of you. Is there a way to disable the vanilla minedetector with scripts?

tough abyss
#

remove it from inventory

tough abyss
#

@winter rose already tried hit 😦

#

@tough abyss but, the bullet impact will trigger this EH?

#

yes but all PhysX related shit in Arma is semi-FUBAR

#

@tough abyss this means this EH can fails sometimes?

#

Why they choose to use PhysX? NVIDIA Inposition?

#

It fires like once per second and the damage value is unusable, shit all around

#

Other PhysX eh can fire just because you threw grenade in any direction and it never hit the object. Total crap.

tough abyss
#

@tough abyss but in this case the _force will be zero (grenade near)?

#

also, seens _object2 is allways objNull

#

Why dont you add this EH and test it, I am sure you will find answers to all your questions

#

i'm doing that

#

i found that _object2 is allways objNull

#

I can't detect what collided

#

@tough abyss btw, thanks for your help.

#

I can't detect what collided
told you, it is shit

tough abyss
#

@tough abyss i just passed with a vehicle near and the EH triggered.

#

I'm using another object, the fuel barrel, for this one the HandleDamage EH works.

vernal jay
#

Hello guys good afternoon, im currently working on a scrip where i have to simulate a train tunnel being demolished, but at first you have to get into the tunnel, so placing the debris just wont work. Ive used the Hide objects module to hide the Debris, the thing is that i want a trigger to disable/change the hide module and make the debris apprear, is that even possible? i think this is pretty easy but im sitting duck here. Anyone got any idea?

#

if theres any other way to achieve this, jsut let me know

thorn saffron
#

is there any way to get if player is using remote control over any unit? getConnectedUAV returns nothing if you are using the remoteControl command. vehicle player returns the original "body" of the player, not the currently controlled unit.

#

I got a dumb idea of checking if player is remotely controlling something by checking the camera postion and the eyePos of the player vehicle. In theory if they are very different the player is controlling something, if so you could take the nearest object to the camera position

thorn saffron
#

Fun fact: eyePos player is not the same as positionCameraToWorld [0,0,0] in first person, the Z is different

tough abyss
#

Obviously in 3rd person it is way back

thorn saffron
#

not that much though, still I was kinda surprised the positions arent almost the same in first person

jovial horizon
#

@tough abyss Of course removing it would be the easiest, however, I got one modded item that "enables" this mine detector screen. So I was wondering if there was a way to disable it.

tough abyss
#

If a vehicle is using dynamic simulation and that vehicle is not being simulated will it not be able to receive an eventhandler?

#

From my perspective it seems like CAManBase is able to take an EH while offline but LandVehicle is not for some reason.

astral dawn
#

I'd approach it like this
Just make sure that the EH is being received by mine at all when it's simulated
Then do _mine enableSimulation false; and test it again

austere copper
#

Hey all, just got a quick question, I have made a security desk and when placed on the map in the editor it will spawn 4 cameras which it does but for some reason I can't move them around in the editor, is there something else I have to add to my script to be able to move it around in the editor. Thanks

winter rose
#

did you create the camera-spawning script?

austere copper
#

Yes i used a event handler in my desk cofig to spawn the security cameras then camcrate then attached it to my cameras, my four cameras are showing the images but I cannot move them in the editor once they are spawned from the desk.

winter rose
#

editor = Zeus?

exotic tinsel
#

if i have the string of a variable name how do i get the variable its self from the string? from the server?

austere copper
#

@winter rose thanks for the help. Its create3denentity comand, create vehicle or crate unit doesn't work if you spawning from a config as far as I can tell

winter rose
#

@exotic tinsel missionNamespace getVariable

exotic tinsel
#

its not working for some reaosn. i have the varrible name/string of an ai but its not giving me the obj of the ai. here is my code

private _ai_varname = _x select 0;
diag_log _ai_varname;
private _ai = missionNamespace getVariable [_ai_varname, objNull];                
#

again im doing this on the server.

tame socket
exotic tinsel
#

nvm i got it.

dreamy kestrel
#

Is there a way to grab the box of a vehicle? I need dimensions, height, length, width, that sort of thing.

tame socket
dreamy kestrel
#

also, is the Contact DLC HEMTT Flatbed an everyman vehicle? i.e. available to all?

#

perfect, thank you.

#

re: boundingBox, what's the difference between that and boundingBoxReal? Is that analog to cropping whitespace around the vehicle to the hard edges?

winter rose
#

boundingBoxReal is closer to the real size yes

dreamy kestrel
#

which brings me to a follow up question, what does the clipping actually do? 0 visual is the only clipping that seems to matter. 1 shadow? 2 geometry? does not really explain.

winter rose
#

I don't know more, it relates to the 3D model

dreamy kestrel
#

to be precise, I am trying to gain a fair estimate, or even actual, dimension, that I could use to establish attachTo points for purposes of loading KP Liberation crates into new transport vehicles. so the more precise, or otherwise predictable, I can determine, the better.

winter rose
#

boundingBoxReal should do, I think that's what is used for A3's vehicle in vehicle feature

dreamy kestrel
#

thanks, appreciate the response. 👍

jolly egret
#

HEY GUYS

#

im making a mission and need a video intro featuring a warlord that is the main objective in the mission. i want it to be a quick little vid of a execution and i want to use the stock arma animations you see in the debug console. how do i script those into the init box in the unit attributes? ive already looked at videos and tuts but they cant help. help pls?

jolly egret
#

check the media - screenshots_arma chat in this server for images if u dont know where im coming from and search for {SCRIPTING REFERENCE}

#

thanks for the help guys

velvet merlin
#

is there a more efficient way to convert BBCode to html tags by going through each character in the string, and in case of special character check the few following for matches of BBCode tag?

blazing sentinel
#

Is there anyway of dumping guns or cars etc classnames for a mod to clipboard?

forest ore
#

@blazing sentinel At one point in time I needed to assign individual costs for units that could be placed by Zeus during a mission. For this I had to create a "custom cost table" of such units and for this there's a scripted function with which it is possible to create a spreadsheet containing all the units be it vanilla A3 or some mod you are using. See: https://community.bistudio.com/wiki/Arma_3_Curator#Using_Cost_Tables

The spreadsheet is created in ODS file type so you need OpenOffice to open the file. Aaand while it is possible to export the data to Excel XLS the formatting gets completely busted during the process so I've personally always exported as ODS and used OpenOffice to open the file.

#

And on to a question: currently I've got this to determine a position for stuff a player can spawn
_def setPosATL ([getPosATL player, 8, direction player] call BIS_fnc_relPos);
How to add some height so that it would then be player position + x meters?

blazing sentinel
#

oh that looks good 👍

summer flax
#
_pos= [getPosATL player, 8, direction player] call BIS_fnc_relPos;
_pos set[2, (_pos select 2) +3]; 
_def setPosATL _pos;
tough abyss
#

You can use getRelPos and vectorAdd

surreal peak
#

how can I add animations to my script which are cancelable if you move? Similar to how ace does it with their medical system

tough abyss
#

There are animations that are cancelable when you move, so add those

forest ore
#

Thank you Chuck BCHF and M242 for showing the way 🙏🏼

surreal peak
#

@tough abyss should I use playMove/switchMove ? Or is there a different command I should use

errant patio
#

Has anyone ever experienced addItemCargoGlobal creating broken items? i'm getting these weird results where I get an item with some of the content present but things like the icon don't work + in this case with weapon attachments they don't.. attach, either

#

i think i must be calling it with some rather broken stuff :(

#

🙈 okay yeah i just checked the logs
weapon bipod_02_F_hex"
seems legit

still forum
#

yes bipod is a weapon. ?

errant patio
#

wait, really? I thought a loose bipod would be an item? well i guess the mystery continues

errant jasper
#

with filePatching can you modify existing file X and inside it call compile new file Y (Y being in the "file system" and not the PBO)?

errant patio
still forum
#

yes a bipod is an item

#

items are weapons

#

@errant jasper no

#

you need to use the pbo path, and have the file in same path in arma directory

errant jasper
#

Hmm, darn.. Is there some non-obtrusive way to write script addons without restarting all the time when adding new files?

winter rose
#

items are weapons
weapons are items*, no?

errant jasper
#

I mean, I can run much via. a mission, but then having to modify the structure for addon would be obtrusive.

still forum
#

weapons are items*, no?
no. items are weapons

#

without restarting all the time when adding new files
afaik it requires the files to ALSO be present in pbo, before it can load it via filePatching, so afaik no

loud python
#

it's so frustrating to see how many garbage scripts are floating around the internet

#

right now I'm trying to fix a script someone else got from the internet for an altis life server and it wasn't even indented

winter rose
#

life

errant jasper
#

Sturgeon's Law

loud python
#

also the script removes the action from the NPC and then creates a new one when it's done, so you have to keep the parameters in sync or the text will change after the first time the action is used

#

how do people upload garbage like this and nobody even tells them to stop?

#

ugh...

winter rose
#

Sturgeon's Law
I didn't realise life servers were 90% of Arma

loud python
#
private["_rip"];
// ...
if (_rip) exitWith { hint "blah blah already being robbed blah blah" };
// ...
_rip = true;

#

I'm questioning my own sanity right now

#

I'm not going crazy, right? that variable does absolutely fuck all, right?

#

I mean, it's script local, so what's the point?

errant jasper
#

Depends on what it is script local to.. The guy attempting to rob someone, then it is "fine".
Or is someone trying to use _rip as a global?

still forum
#

it might be modified by functions that are called from that function

tough abyss
#

if rip is false it will set it to true

#

who knows what is down the script

still forum
#

a very weird instruction pointer you have there :kappa:

lofty spear
#

Hi. Try to get list of supply crates, that on Eden under Supply - Ammo.
If I correctly understand I should iterate classes under configfile >> "CfgVehicles" and check if _x isKindOf "ReammoBox_F") ?

quasi thicket
#

How can i have an addAction only show up for a specific squad/group ?

#

Currently have this:

tp_board addAction ["Teleport to C130",
{
    _pos = getPosATL c130_static;
    player setPosATL [_pos select 0, _pos select 1, (_pos select 2) + 0.5];

}, [], 6, false, true, "", "(_target distance _this <5) && ()"];
forest ore
#

NyteMyre,
would there be a way to wrap it into a IF-statement where you ask if these units are from the specific groups/squads you want them to be and then do the addAction?

quasi thicket
#

i guess 😛

#
"_target distance _this <5 AND groupID _this == reconGroup"];

Something like that

#

Okay already got it

#

groupID should be simply group

lofty spear
#

is it possible to detect, to witch mod belong class?

still forum
#

configSourceMods

#

check wiki

#

@quasi thicket why that distance check? addAction already has a distance parameter?

lofty spear
#

@still forum thank you

quasi thicket
#

on default it was a bit far

still forum
#

Yeah but why not use the "radius" parameter?

forest ore
still forum
#
tp_board addAction ["Teleport to C130",
{
    _pos = getPosATL c130_static;
    player setPosATL [_pos select 0, _pos select 1, (_pos select 2) + 0.5];

}, [], 6, false, true, "", "(condition)", 5];
hearty plover
#
private [
    "_unit"
    ,"_cacheRadius"
    ,"_crewList"
    ,"_crewInventoryList"
    ,"_crewSkillList"
    ,"_crewVarNameList"
    ,"_debug"
    ,"_exitTrigger"
    ,"_firstLoop"
    ,"_gaiaParameter"
    ,"_gaiaZone"
    ,"_infantryList"
    ,"_infantryInventoryList"
    ,"_infantrySkillList"
    ,"_infantryVarNameList"
    ,"_initString"
    ,"_initialDelay"
    ,"_lives"
    ,"_newGroup"
    ,"_newVehicle"
    ,"_pauseRadius"
    ,"_reduceRadius"
    ,"_respawnDelay"
    ,"_respawnDir"
    ,"_respawnMarkers"
    ,"_respawnPos"
    ,"_special"
    ,"_tmpGroup"
    ,"_tmpRespawnPos"
    ,"_tmpZone"
    ,"_trigger"
    ,"_unitGroup"
    ,"_unitSide"
    ,"_unitsInGroup"
    ,"_vehicleHitpointsDamageList"
    ,"_vehicleHealthList"
    ,"_vehicleFuelList"
    ,"_vehicleList"
    ,"_vehiclePositionList"
    ,"_vehicleItemList"
    ,"_vehicleLockedList"
    ,"_vehicleMagazineList"
    ,"_vehiclePylonList"
    ,"_vehicleWeaponList"
    ,"_vehicleBackpackList"
    ,"_vehicleMaterialsList"
    ,"_vehicleTexturesList"
    ,"_vehicleAnimationNames"
    ,"_vehicleAnimationPhases"
    ,"_vehicleVarNameList"
    ,"_waypointList"
    ,"_synchronizedObjectsList"
];
#

Check out this UNHOLY code...

#

D:

#

Who, WHO PUTS the damn , on the LEFT!!!

errant jasper
#

If it is a "configuration list" meant to be edited... For example defining an enemy composition for a mission, then I do.

#

Though that is not mine, since I would indent the first entry to match up

hearty plover
#

This is a list of private vars for a sript.

#

Not a config list

still forum
#

Who, WHO PUTS the damn , on the LEFT!!!
Just easier when you have this many stuff.
Can just ctrl+leftclickdrag to set all commas

dreamy kestrel
#

@hearty plover Actually, I do. It makes great formatting sense when you stop to analyze it. Takes it bit of getting used to, but then you always know that a new list item is coming when you see the comma. Similarly with logical operators on a new line.

still forum
#

Some people just don't understand the crap that they copy paste and continue doing the same nonsense that they saw some other unable developer write

tough abyss
#

then you always know that a new list item is coming when you see the comma
What?

hearty plover
#

It would make it WAY easier to fix a extra trailing comma

dreamy kestrel
#

Unrelated question, I know you can add variables to object instances. Is it possible to add class variables? that is, I want to add variables or properties to the class itself.

hearty plover
#

However. It's still UNHOLY

dreamy kestrel
#

@hearty plover I'm not asking you to adopt that stylistic philosophy.

tough abyss
#

Most languages do support trailing commas

dreamy kestrel
#

@tough abyss Actually, most languages support ignoring the whitespace between the items, punctuation marks, etc. Some tooling enforces trailing commas, but that is a tooling issue, not a language issue.

tough abyss
#

What’s your point?

dreamy kestrel
#

@tough abyss Point is, do whatever floats your boat where stylistic philosophies are concerned.

tough abyss
#

I have difficulty understanding what you are saying

#

You probably never worked in a team if you say shit like that

dreamy kestrel
#

@tough abyss I build and run my own teams, thank you very much.

tough abyss
#

If you allow teams write as they pleased without any coding guidelines, then you are probably a bad manager

#

And no need to tag me every time

dreamy kestrel
#

@tough abyss I did not say that. But then again, I'm not interviewing you, never mind considering your consultation beyond for what it's worth.

#

@tough abyss Really, you call me out publicly, if you have something to say privately, I would be happy to discuss if you want.

tough abyss
#

@floral dew Point is, do whatever floats your boat where stylistic philosophies are concerned. I must have misunderstood you

astral tendon
#

Im using disableAI "AUTOCOMBAT"; but the AI still swich to combat afther gettin shot, whats wrong?

sullen pulsar
#

that's not unholy, that's smart.

hollow quest
#

Hello everyone

#

Okay, I have a model and trying to make it function in arma 3 but don’t know how I start editing the config file

#

Could any one give advice please ?

tough abyss
hollow quest
#

Okay, thank you for fast responding I’ll go there @tough abyss

winter rose
#

the header, the in-code comment, both?

#

Hahaha, ascii art to make your file weight twice

tough abyss
#

Probably intentional, to take attention away from bad code

tame socket
#

or to add more lines to brag about how many lines is in his mission making it seem more complex?

winter rose
#

I don't mind the header to be cool, but come on the big "don't touch"… duh

tough abyss
#

“Don’t look”

velvet snow
#

Was hoping I could get some help cause I'm having a bit of trouble with some code. regarding holdActionAdd getting the action on my object goes fine but I'm having an issue with carrying the arguments over into the script. I get an error for an undefined variable _target when I the code called looks like ```if isServer then {
params ["_target","_caller"];

deletevehicle _target;

};``` I feel like I must be missing something very obvious.

tame socket
#

how are you calling that? it would probably be best to put it in a function to call (only expose the function to the server if you only want the server to run it)

MyFunc =
{
    if (IsServer) then
    {
        Params ["_Target", "_Caller"];
        DeleteVehicle _Target;
    };
};

//call it like so
[_Target, _Caller] Call MyFnc;
velvet snow
#

currently I've called it from the init of a spawned object using [ intelobj000, "Hack Tablet", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {["Scripts\phase000_intel000.sqf"] remoteExec ["execVM",2];}, {}, [], 30, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, intelobj000];

tame socket
#

your not passing in anything to phase000_inteo000.sqf

#

so _Target and _Caller are nothing

#

checkout the ExecVM syntax for arguments. thats where you would put your parameters

#

so something like this

 {[[_this, _Target], "Scripts\phase000_intel000.sqf"] remoteExec ["execVM",2];}, 
still forum
#

```sqf
you can do sqf highlight too
```

tame socket
#

its ugly imo

#

plus im used to being in the UE4 discord so its always C lol

velvet snow
#

ooh I didn't know that was a thing thanks Dedmen

#

so I guess where I got thrown off where is says passed arguments its not an automatic thing you have to add them before calling the script still?

tame socket
#

just looked up HoldActionAdd. so HoldActionAdd has 4 arguments under the CodeCompleted part(where you have your RemoteExec)

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

what we want to do, is take _target and _caller to your phase000_intel000.sqf script so they know what they are. to do that we do this

//first we add the params like so
[ 
    intelobj000,           
    "Hack Tablet",          
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
    "_this distance _target < 3",       
    "_caller distance _target < 3",       
    {},              
    {},              
    {
        //lets store the arguments in some variables in CodeComplete like this
        params ["_target", "_caller", "_actionId", "_arguments"];
    },     
    {},              
    [],              
    30,              
    0,              
    true,             
    false             
] remoteExec ["BIS_fnc_holdActionAdd", 0, intelobj000];
#

then we need to take those params, and pass them to your .sqf file like so

[ 
    intelobj000,           
    "Hack Tablet",          
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
    "_this distance _target < 3",       
    "_caller distance _target < 3",       
    {},              
    {},              
    {
        //lets store the arguments in some variables in CodeComplete like this
        params ["_target", "_caller", "_actionId", "_arguments"];
        //passing _target and _caller to the sqf file
        [[_target, _caller], "Scripts\phase000_intel000.sqf"] remoteExec ["execVM",2];
    },     
    {},              
    [],              
    30,              
    0,              
    true,             
    false             
] remoteExec ["BIS_fnc_holdActionAdd", 0, intelobj000];
#

now phase000_intel000 should know what _target and _caller is

#

also im not 100% sure thats the right syntax for RemoteExec with execVM and passing in arguments, hopefully it is

exotic flax
#

Question:
I would like to run a script when a player spawns/respawns, so I can modify it's gear/insignias/etc. All this is done within a mod (not mission!) and I have CBA available.
I already tried calling the script through Extended_Init_EventHandlers and Extended_PostInit_EventHandlers, but all I get are errors regarding getVariable (although are most likely caused because there is no unit object available)
What is the correct place and method to trigger on spawn/respawn?

velvet snow
#

I think that makes sense to me now. I can reference the wiki on the remoteExec if that doesn't quite work, I appreciate you helping me understand that better @tame socket

tame socket
#

onPlayerRespawn.sqf and initPlayerLocal.sqf should work. is that what your asking?

#

np, goodluck!

exotic flax
#

no, since those are mission specific. I'm looking for event handlers I can use in a mod.

tame socket
#

ah

#

respawn event handler?

exotic flax
#

doesn't seem to do anything at all (both SP and MP)

#

but again, I might do something totally wrong

tame socket
#

is it firing? and is it being assigned to units?

exotic flax
#
class Extended_Respawn_EventHandlers {
    class ADDON {
        init = QUOTE(_this call FUNC(onPlayerRespawn));
    };
};

This should run on everything, but due to limited resources on the wiki it's a bit hard to figure out how the respawn events work...

velvet snow
#

Dedmen would you happen to know how one would go about getting that sqf highlighting onto my own discord?

tame socket
velvet snow
#

that works on any discord?

tame socket
#

just tried it on my friends and it worked

velvet snow
#

oh cool, I figured it was proprietary enough that it wouldn't be out of the box supported, thanks again Cody

tame socket
#

np

#

@exotic flax does this seem right?

class Extended_Respawn_EventHandlers
{
    class ADDON
    {
        class Gear_ADDON_respawn
        {
            init = QUOTE(_this call FUNC(onPlayerRespawn));
            respawn = "_this call SomeFunction";
        }
    };
};
#

derp, scroll down further for a respawn example

class Extended_Init_Eventhandlers
{
    class Man
    {
        class SLX_XEH_RespawnInitMan
        {
            onRespawn = true;                    // Run this even after respawn
            init = "_this call My_Respawn_InitEH";
        };
    };
};
exotic flax
#

"This guide is outdated. Please refer to this guide instead!" at the top of the page 😉

#

but I will try it out

tame socket
#

-_- dangit

exotic flax
#

hmmm... I see that ACE uses

class Extended_Respawn_EventHandlers {
    class CAManBase {
        class ADDON {
            respawn = QUOTE(_this call FUNC(handleRespawn));
        };
    };
};

Might be an idea as well...

tame socket
#

possibly

exotic flax
#

just annoying that both the BIKI and CBA don't have a proper documentation about event handlers... and it takes a lot of time to test small changes when working on a mod...

astral dawn
#

@exotic flax I think there is an ACE addon template on github which lets you develop your addon without reloading the game

#

although I don't remember how they achieve this

exotic flax
#

@astral dawn the ACE addon template can only build PBO's for you (either for development or for release), and ArmA always requires you to reload the game after making changes to the PBO's

astral dawn
#

no... I'm pretty sure I could change configs while the game was running

#

there is some special arma binary which does that

#

plus the file patching command afaik... let me check 🤔

exotic flax
#

I remember something where you could call a mod from the P: folder in Arma2, but I'm not sure how to do that through the Arma Launcher

astral dawn
#

I might be wrong, you might need to remake the pbo and then relaunch the mission though, or maybe not, IDK, totally forgot that 😦

exotic flax
#

hmmm... it seems to load the PBO's correctly, now let's see it also patches the files on the fly

runic quest
#

https://sqfbin.com/abudenegutetafigohiv Excuse me, the first line is the player's display text in the center of the screen after saving money. I want to record it in the database, so the second line is what I wrote, but there is no record in the database. What's wrong?

astral dawn
exotic flax
#

@runic quest well... that depends on what happens in UnionClient_system_numberText and DB_fnc_AdvancedLog.
Do you get any errors in your RTP, or in the DB logs?

mellow obsidian
#

Hey, does anyone know if one can via script open the closest door to the player.
So lets say the house have 10 doors and I would like to open the closest one to the player when the script is executed.
I have the name of all the doors, issue I am having is figuring out if its possible to compare distance to the door themselfs

runic quest
#

@exotic flax Sorry, but the log is delayed. It succeeded. Thank you!

exotic flax
mellow obsidian
#

You know what, that might actually do the trick. Many thanks Grezvany13

tame socket
#

well i dont think theres another way to do it haha. loop through the buildings doors positions and put each of them in an array, then loop through that array to see which one is closest?

tame socket
#

question, is this a reliable way to get the missions path for all clients for loading textures and such? ive had one friend join and the texture had changed properly, but not for another friend. i have it set to print out the path but for my friend that has issues(only he was able to test a bit) it doesnt display a hint. credits to KillZoneKid for the mission path

SetNoShootTextures =
{
    Params ["_Targets"];
    _Root = call 
    {
        private ["_arr"];
        _arr = toArray str missionConfigFile;
        _arr resize (count _arr - 15);
        toString _arr;
    };
    _Path = _Root + "Textures\Target_NoShoot.paa";
    
    hint _Path;
    {
        _x setObjectTexture [0, _Path];
    } ForEach _Targets;
};

heres how im calling it (from the server)

[_NoShoots] RemoteExec ["SetNoShootTextures", 0, true];
finite dirge
#

You shouldn't need absolute paths for textures.

real tartan
#

In CBA we can use Extended_Init_EventHandlers. Is there a vanilla Arma 3 option like that? I'd like to add script to every init of unit via description.ext and not via scripts. Example:

class Extended_Init_EventHandlers 
{
    class CAManBase 
    {
        class EventHandlers 
        {
            init = "diag_log format ['init: %1', _this];";
        };
    };
};
tame socket
#

@finite dirge you are correct, it would have worked the first time with how i had it before but when i tested it i did not export the mission, instead i hosted the editor version which was apparently the problem. thank you!

young current
#

@real tartan no that's not possible through mission files. It would need an addon.

cosmic lichen
#

Can anyone explain to me why I can create a chemlight with createVehicle ["Chemlight_blue",[3701.74,3809.01,50]] but not an IR strobe createVehicle ["B_IR_Grenade",[3701.74,3809.01,50]] Both are classes from CfgMagazines.

winter rose
#

isn't the latter a private class?

#

maybe a B_IR_Grenade_F or something exists

still forum
#

"Both are classes from CfgMagazines." no they arent

#

createVehicle creates a vehicle, vehicles are CfgVehicles or CfgAmmo (projectiles)

#

Chemlight_blue is a CfgAmmo class

#

B_IR_Grenade doesn't exist

#

there is B_IR_Grenade CfgMagazines tho, which has ammo type of B_IRStrobe which you can spawn

cosmic lichen
#

configfile >> "CfgMagazines" >> "B_IR_Grenade" configfile >> "CfgMagazines" >> "Chemlight_blue"

#

So the issue is that Chemlight_blue exists in CfgAmmo and CfgMagazines and can therefore be created, but B_IR_Grenade only exits in CfgMagazines right and that's why createVehicle doesn't work.

still forum
#

you can't spawn magazines

#

that's why it doesn't work

cosmic lichen
#

Yeah right.

#

Kinda a bummer because CfgAmmo does not have a displayName defined so I have to check cfgMagazines to get that.

#

Oh well, I can get the ammo class name from with CfgMagazines and use that to spawn it.

#

Thanks for the clarification.

quartz coyote
#

Yo, Do you guys know if the effect of BIS_fnc_taskSetState is local or global? I'd like to execute it server-side

cosmic lichen
#

It's global

#

It executes BIS_fnc_setTask and this function executes globally by default.

winter rose
#

wikiii

#

we should update the wikiii

cosmic lichen
#

First sentence

#

But I agree. The functions should have locality parameters set.

quartz coyote
#

thx

jaunty ravine
#

Here's a rare one: I want to get rid of custom gear upon being killed/respawning and use the gear assigned at the beginning of the mission. I've already tried unticking "Save loadout" in Multiplayer attributes. Should it be of interest I am running RHS and ACE with 3den Enhanced.

tame socket
#

@jaunty ravine

//initPlayerLocal.sqf
Params ["_Player", "_DidJIP"];

_Gear = GetUnitLoadout _Player;
_Player SetVariable ["SpawnLoadout", _Gear, false];


//onPlayerRespawn.sqf
Params ["_Player", "_Killer", "_RespawnDelay"];
_Gear = _Player GetVariable ["SpawnLoadout", []];
if (Count _Gear > 0) then
{
    _Player SetUnitLoadout _Gear;
};
jaunty ravine
#

Thank you! @tame socket Greatly appreciated!

tame socket
#

np

calm bloom
#

Hi guys! Does anybody know where one can get list of set3DENAttribute's?

vernal venture
#

I've got a couple healing scripts that used to work for ACE medical. Couple weeks ago, they simply stopped working. Anyone experience anything similar?

#
[objNull, this] call ace_medical_fnc_treatmentAdvanced_fullHeal;```
Doesn't heal players in a trigger anymore?
winter rose
#

never has

#

this refers to the trigger

vernal venture
#

Used to work, that's what's bothering me.

still forum
#

It shouldn't have ever worked

#

you need to iterate through thisList

#

and fullHeal also doesn't take array

winter rose
#

funnily enough, I have a memory where it worked in OFP, I may be mistaken though

astral tendon
#

what else makes the AI swich to combat? I already used the disableAI "AUTOCOMBAT" and the AI still swicth it to combat once under fire

astral tendon
#

So I need to also use disableAI "FSM"?

winter rose
#

IDK, maybe

astral tendon
#

seems to work but looks like with out the FSM seens to broke other things to.

winter rose
#

Set them careless?

astral tendon
#

they will not fire

winter rose
#

…yeaaah ?

young current
#

what is it you are trying to achieve

#

because it sounds like something that isnt quite logical

astral tendon
#

The objective here is to make the units still move, when they are in combat they froze in place and just became target pratice to the players

winter rose
#

…don't disable any AI?

astral tendon
#

and they still do it.

young current
#

are they in a group? whats their skill level?

#

what else is happening

astral tendon
#
{
    _x disableAI "AUTOCOMBAT";
    _x disableAI "FSM";
    _x setUnitPos 'UP';
    _x getSpeed "FAST";
    _x setSkill ['aimingAccuracy', 0.1];
    _x setSkill ['aimingShake', 0.1];
    _x setSkill ['aimingSpeed', 0.1];
    _x setSkill ['spotTime', 0.1];
    _x removeAllEventHandlers "Hit";
    _x removeAllEventHandlers "HitPart";
    _x removeAllEventHandlers "HandleDamage";
    _x removeAllEventHandlers "Dammaged";
    _x removeAllEventHandlers "Explosion";
    _x addEventHandler ["Reloaded",{
        _unit = _this select 0 ;
        _mag = _this select 4 select 0 ;
        _unit addMagazine _mag ;
    }] ;
    _x addEventHandler ["Killed", {
        params ["_unit", "_killer", "_instigator", "_useEffects"];
        [] spawn CreateEnemySquad;
    }];
} forEach units _Group;

with this sething they are now doing what is suppouse to do.

winter rose
#

_x getSpeed "FAST"?

astral tendon
#

yup

winter rose
#

GETspeed?

astral tendon
#

yup

winter rose
#

this line does nothing, you can remove it.

astral tendon
#

nah, aready did too many coding with that, not wort the time to remove it in other lines.

winter rose
#

well, good luck ¯_(ツ)_/¯

young current
#

you leave possible errors in your code, you cant be helped.

astral tendon
#

as in any code I made and get no feedback in game.

young current
#

suit yourself then.

astral tendon
#

It does.

winter rose
#

.

astral dawn
#

While you're on it, I think it's worth mentioning that the task framework does fail for JIP players sometimes, cause unknown.

winter rose
#

dang! any repro steps maybe?

astral dawn
#

No... just we had it in the antistasi for lot of time without ever finding ways to fix it.

#

Although it seemed to be used as advertised 🤷

winter rose
#

welp

astral dawn
#

But the page looks nice indeed

#

if you have seen people at this discord "why do my missions auto-fail in antistasi help", yes that's it

winter rose
#

nevah seen it, but maybe will

if it's only antistasi people that mention the issue, it might be mod related 👀

astral dawn
#

IMO it MIGHT be related to having the same mission tag (the unique string or what it's called) and reusing it multiple times
I'd bet on improper cleanup of variables in mission namespace in BI code, but not sure

winter rose
#

oh em gee, of course

#

it has to be unique!

#

IDK if the previous task has been deleted you can create one with the same ID, but I wouldn't risk it

astral dawn
#

So... no way to delete a mission with tag "mytag0" and then create a new one "mytag0" with state "just started" (or how is it called...)

winter rose
#

a task?

#

delete all the missions you want 😛

astral dawn
#

ah yes, task, sorry for using the wrong term

winter rose
#

I don't know; but indeed, it might be that

#

if we can confirm this (would you maybe not mind testing?), I will gladly add a big red warning on the page

astral dawn
#

nah I don't feel like testing it any more, I even looked at BI code and it seemed to work, but also the Antistasi code seemed to use the API as needed, so 🤷

#

As with many other BI's scripted systems, finding fails or unfinished things here and there is a known thing, so I'm not entirely surprised

vernal venture
#

Anybody got an example of a vehicle GetIn event handler working? Was it changed with Contact DLC? I can't get it to fire off at all.

winter rose
#

what is your code @vernal venture ?

vernal venture
#
  [_Vehicle, _Unit] spawn{ 
    private _Veh = _this select 0; 
    private _Man = _this select 1; 
  
    _Man setdamage 0; 
    [objNull, _Man] call ace_medical_fnc_treatmentAdvanced_fullHeal; 
}];```
winter rose
#

try this?sqf this addEventHandler ["GetIn", { hint "It Works!"; }];

vernal venture
#

Let me rephrase. It's another script that used to work, and now doesn't.

  params ["_Vehicle", "_Role", "_Unit", "_Turret"]; 
 
  [_Vehicle, _Unit] spawn{ 
    private _Veh = _this select 0; 
    private _Man = _this select 1; 
  
    private _bExit = false; 
    waitUntil{ 
      if(!(alive    _Man)) exitwith{_bExit = true; true}; 
      if(!(alive    _Veh)) exitwith{_bExit = true; true}; 
      if(!(isEngineOn _Veh)) exitwith{true}; 
      if(!(_Man in (crew _Veh))) exitwith{_bExit = true; true}; 
      false 
    }; 
    if(_bExit) exitwith{}; 

    sleep 30; 
 
    if(!(alive _Man)) exitwith{}; 
    if(!(alive _Veh)) exitwith{}; 
    if(!(_Man in (crew _Veh))) exitwith{}; 
 
    _Man setdamage 0; 
    [objNull, _Man] call ace_medical_fnc_treatmentAdvanced_fullHeal; 
  }; 
}];```
And I've been removing stuff, trying to get it working again.
winter rose
#

so the event itself works

vernal venture
#

Even this addEventHandler ["GetIn", { hint "It Works!"; }]; doesn't work

winter rose
#

then something seems wrong indeed

#

btw, you can use the following for sqf formatting:
```sqf
/* your code */
```

vernal venture
#

Okay

winter rose
#

did you try the event in Vanilla game?

vernal venture
#

No, but now I'm thinking it's the vehicle respawn module causing the problem

winter rose
#

I just tested in the editor and it works fine (even from the init field)

hot kernel
#
hint "now I did it!";
#

ha!

vernal venture
#

It works if I unsync it from the respawner module

winter rose
#

ah, I see what could happen

#

the vehicle respawns on mission start, deleting the EH

hot kernel
#

surely nobody cares but the EH works for me, too

winter rose
#

cool story bro 😄

vernal venture
#

I'll give that a try

#

Nope, that didn't work. I suspect I have to add some code to the module itself.

frigid raven
#

Smart Person, Stupid Question:

configFile >> "CfgFunctions" 

I was expecting something here 😄 where is it

cunning crown
#

Well it's there, it returns:

bin\config.bin/CfgFunctions
frigid raven
#

wtf now it works

#

kk nevermind

winter rose
#

Armagic

exotic flax
#

I have several script running on respawn (through Extended_Respawn_EventHandlers) and I can see in my RPT files that they are running (since I placed diag_log all over the place).
However for unknown reasons the result of the code is not visible in-game (MP mission in 3den).
If I run the functions manually through the debug console everything is executed and also visible in-game.

#

for example I set an insignia with BIS_fnc_setUnitInsignia based on a variable (set/get with _unit setVariable [var_name, var-value], which can be retrieved again (with BIS_fnc_getUnitInsignia), however no insignia is placed on the unit...

queen cargo
#

sounds to me like a locality issue

exotic flax
#

I already placed some stuff to prevent that (because I did notice that the code executed at the wrong places):

if (!local _unit) exitWith {false}; //XEH should only be called on local units
if(!hasInterface) exitWith {false};
if(isDedicated) exitWith {false};
waitUntil {!isNull _unit};
waitUntil {isPlayer _unit};
// rest of script

But still no effect

queen cargo
#

Timing issue maybe?
can only rly do the guessing game here

#

if this solves your problem:

[] spawn { sleep 1; /* whatever */ };```
#

you know, it is indeed a timing issue

tough abyss
#

Bis_fnc_setUnitInsignia is global, you can call it on any unit from anywhere

exotic flax
#

technically it could be possible that the scripts run before the unit is there, which would break it again...

tough abyss
#

You cannot call it in the same frame unit is created though

exotic flax
#

so perhaps it's a timing issue... testing with the example from X39 now

tough abyss
#

It could be possible that they run too early, hence do what X39 suggested. You don’t need sleep, just spawn will do

exotic flax
#

ok... the spawn helped (with a small error which I can fix easily)!

#

thanks for help

exotic tinsel
#

My server isnt kicking players with high ping or desync issues. Is the following code from my server cfg configured properly?

maxdesync = 150; // Max desync value until server kick the user
maxPing= 300; // Max ping value until server kick the user
maxPacketLoss= 50; // Max packetloss value until server kick the user
kickClientsOnSlowNetwork[] = { 0, 0, 0, 0 }; //Defines if {<MaxPing>, <MaxPacketLoss>, <MaxDesync>, <DisconnectTimeout>} will be logged (0) or kicked (1)
kickTimeout[] = { {0, 0}, {1, 0}, {2, 0}, {3, 0} };
winter rose
exotic tinsel
#

i have the option enabled in a bunch of my action menus to show when incapacitated but they dont show up. i have disabled force respawn as well. how do i get the action menu to be visible when incapacitated?

winter rose
#

there is a flag in the arguments, see the wiki

#

they should show up

exotic tinsel
#

i just said i have that enabled

winter rose
#

well there is no magic; either you have mods that f this up, or it's broken

#

vanilla Arma?

exotic tinsel
#

@winter rose sorry was afk. not exactly, we have our own server side addon with lots of features.

#

here is an example of one that is not show up when incapacitated

[_player, 
    [
        "Request Mission", 
        {
            params ["_target", "_caller", "_actionId", "_arguments"];    
            _caller removeAction _actionId;            
            [getPlayerUID _caller] remoteExec ["feature_1_fnc_state_1_apply", 2];
            sleep 10;
            [getPlayerUID _caller] remoteExec ["feature_1_fnc_state_6_apply", 2];
        }, 
        [], 
        -3.1, 
        false, 
        true,
        "",
        "true",
        -1,
        true                
    ]
] remoteExec ["addAction", _player];
winter rose
#

maybe the negative radius? idk, it's a blind try

#

anyway make it work in vanilla first

exotic tinsel
#

rgr

real tartan
#

I try to assign voice to unit.
voice.sqf

params ["_unit"];

if (!local _unit || !(_unit isKindOf "CaManBase")) exitWith {};

_voices = ["male01ger", "male02ger", "male03ger", "male04ger", "male05ger", "male06ger"];

if (isServer) then 
{
    [_unit, selectRandom _voices] remoteExec ["setSpeaker", 0, _unit];
};

initServer.sqf

{ _v = [_x] execVM "voice.sqf"; } forEach allUnits;

but when I am in game, OPFOR still uses farsi language, not my defined (GERman) one

winter rose
#

do you have a German voice addon?

real tartan
#

yes, voices are from IFA

winter rose
#

you are checking on the server that units are local

#

not going to happen

digital jacinth
#

does that happen in sp or only in mp? I also replace units speaking voices. however I do it 0.5 seconds after the unit has been spawned

winter rose
#

everything should be in the initServer.sqf

private _voices = ["male01ger", "male02ger", "male03ger", "male04ger", "male05ger", "male06ger"];
{ [_x, selectRandom _voices] remoteExec ["setSpeaker", 0, _x]; } forEach allUnits;```
still forum
#

not going to happen
AIs might be local to server

winter rose
#

not everywheeere

#

what was wrong:

  • you checked on the server if the unit was local
  • you use execVM for each allUnits which is baaad for performances; at least give it allUnits
still forum
#
  • you checked on the server if the unit was local
    Well that's no problem if they are AI's. And I think he wants to change voice of AIs as humans don't talk that much
winter rose
#

players may be group leaders

digital jacinth
#
{
    if !(isPlayer _x) then {
        [_x, selectRandom _voices] remoteExec ["setSpeaker", 0, _x];
    };
} forEach allUnits;
#

just exclude players

real tartan
#

voices.sqf have more code in it. I am changing there also gear and some behaviour. part of that gear replacement is to change also speaker, so preferable to have it in voices.sqf for individual units (AI's) than set it in initServer.sqf

winter rose
#

give it allUnits, or at the very least preprocessFileLineNumbers it to load it in memory ^^

still forum
#

or at the very least preprocessFileLineNumbers it to load it in memory
execVM stores the file in cache too

#

preproc doesn't change anything on that

winter rose
#

well, if I change the file in the editor it changes the output so I don't think it is?
unless it's based on the file's hash or something

runic quest
#

Excuse me, I want to write a killing reminder, such as a player killing another player or a player killing AI, and display the corresponding text in the upper back corner. How can I do that? Thank you.

still forum
#

well, if I change the file in the editor it changes the output so I don't think it is?
guess you're not a programmer. when you change a file the changedate/size changes

winter rose
#

that's what I meant, does the cache check for only the file name or a checksum 🙄

#

@still forum didn't you say that execVM doesn't cache the code itself, and still process it?

still forum
#

yes

#

currently nothing caches

#

besides the filesystem backend

#

but the scripting cache is maybe coming back soon

winter rose
#

but if you "compile preprocessFile(LineNumbers)", it gets compiled as code and therefore is faster?

still forum
#

huh?

#

execVM also compiles as code

winter rose
#

yes but you said "it caches file's content", a.k.a string

still forum
#

not really

#

the filesystem code does

winter rose
#

if you multi-execVM, it compiles everytime, no?

still forum
#

as it caches every file

#

yes it does

#

execVM is just an alias for "spawn compile preprocessFile"

winter rose
#

so sqf _myCode = compile preprocessFile "myFile.sqf"; then spawning _myCode is still better than sqf execVM "myFile.sqf" (given it's called more than one time)?

still forum
#

no yes as you only compile once

winter rose
#

🤔

real tartan
#

myabe if I try [_unit, selectRandom _faces, selectRandom _voices] call BIS_fnc_setIdentity; but I don't know if function have global or local effect

copper raven
#

Look it up in functions viewer?

winter rose
#

editing this page right away, it mentions BIS_fnc_MP…

real tartan
#

hmm, units respond via "radio" in german, but when they shout for some contact, they use native (farsi) language

winter rose
#

weird. did you remoteExecute it from the server?

real tartan
#

yes

winter rose
#

I have no clue then! it did have an effect, but not a full one.

real tartan
#

I am curious if someone can elaborate more on _unit disableAI "RADIOPROTOCOL";

winter rose
#

about?

#

Stops AI from talking and texting while still being able to issue orders – Available since Arma 3 v1.95

#

meaning: no heard orders, but orders are still given (get in, get out, target etc)

#

@real tartan

quartz pebble
#

Guys, is it possible to insert additional buttons into the ESC menu? Say, intercept the ESC key, find the menu display and insert a button?

still forum
#

yes

winter rose
quartz pebble
#

@winter rose thx; 49 - is what I needed 🙂

winter rose
quartz pebble
#

Oh, didn't know it exists. Thank you again!

hot kernel
#

is it bad practice to pack a bunch of functions into an sqf?

queen cargo
#

uhm ... what?

#

what is a sqf?

#

into a file?

#

and like this:

foo = {...};
bar = {...};```?
hot kernel
#

yeah, like take a couple dozen scripts, convert them to functions and then pack it all into a .sqf-- is that a bad idea?

queen cargo
#

why would you want to do that?

hot kernel
#

so I don't have a bunch of loose script files

queen cargo
#

for SQF it is fine ... your "functions" are just variables that get converted by a script afterall

#

but it is maintance hell to kill of the actual folder structure

hot kernel
#

it seems like a common thing for people to do, consolidate functions, is there a standard practice for this?

queen cargo
#

you do not want to consolidate functions ... but files

#

one file per function is the common practice

#

using CfgFunctions highly recommended

winter rose
#

I'll never forget the dsl.sqf in official ArmA1 missions 😢

#

it was basically a big switch with a lot of scripts inside 😄

still forum
#

answer is, use CfgFunctions.
Then you don't have "loose" script files, but clearly organized script files

hot kernel
#

thanks Dedmen

#

thanks all

#
class CfgFunctions
{
    class myTag
    {
        class myCategory
        {
            file = "myPath";
            class myFunction {};
        };
    };
};

This is probably the one for me? Just add my file path and create a class name?

hot kernel
#

ah

#

thanks

exotic flax
#

in short your example will work without any problems, as long as the path is relative to the root of the mission/addon, and the filename of the function is fn_%classname%.sqf

hot kernel
#

great, thanks Grezvany!

exotic flax
#

and using that, your functions can be executed with myTag_fnc_classname

hot kernel
#

I'm setting it up now, I'll be back to report (likely failure) complete success soon.

#

Seeing a completed example will probably increase my chances of success. Any links?

exotic flax
hot kernel
#

thanks again!

exotic flax
#

although they use a rather complex way for setting up their functions, because it's in a seperate addon

queen cargo
hot kernel
#
class CfgFunctions
{
    class "FTA";
    {
        class "FlyTanoaAir";
        {
            file = "missions\ 0_tanoaAir.tanoa\ features\ fn_FlyTanoaAir.sqf";
            class FlyTanoaAir {};
        };
    };
};

like that?

still forum
#

that filepath is invalid

hot kernel
#

too many directories?

#

or folders

still forum
#

spaces

hot kernel
#

oh, no spaces

#

otherwise?

still forum
#

just like any normal filepath

winter rose
#

if it is in mission's description.ext, it is relative to the mission directory
no need to repeat it

hot kernel
#

okay, so put this in description.ext and don't include the missions\mission folder

#
class CfgFunctions
{
    class "FTA";
    {
        class "FlyTanoaAir";
        {
            file = "\features\fn_FlyTanoaAir.sqf";
            class FlyTanoaAir {};
        };
    };
};

more like this?

#

I appreciate the help. I won't come back asking stupid questions about this same topic. Next time it will be stupid questions about a different topic 😄

hot kernel
#

specifically,
call compile preprocessFile "inlineFunctions.sqf";

#

but now I'm confused as to why one would do one or the other

#

Or even how preprocessFile is different than just loading the .sqf in the init.

tough abyss
#

file = "missions\ 0_tanoaAir.tanoa\ features\ fn_FlyTanoaAir.sqf";
WHY???

#

Why one would possibly want to add spaces after \? Because it looks cool? Because letters are too tight and need some space for comfort? Why?

hot kernel
#

Yup, just so I could see what I was doing

#

ironically because I didn't want to make a mistake 😄

still forum
#

Or even how preprocessFile is different than just loading the .sqf in the init.
what mean by loading

hot kernel
#

Like just execVM the inline functions file

#

which is what I have been doing and I feel it's probably not best practice

#

I have an .sqf file with 30 or so functions, some waitUntils, a while true or two, and trigger creation. All the stuff to run the mission. It seems like that's maybe not the correct way to do it.

tough abyss
#
displayParent ctrlParent (_this select 0)....

HA! Take it SQF!

#

../../control basically

hot kernel
#

I'm sorry, M242 but I have no idea what to make of that

still forum
#

which is what I have been doing and I feel it's probably not best practice
correct. It works. But is not really nice as people don't really know where to find the functions inside that

#

whereas for CfgFunctions you have a file for each

hot kernel
#

oh, well if that's the only reason I built a table of contents in the function library 😄

#

that's fine for Fly Tanoa Air, it's only ever going to be a .pbo anyway-- as long as it doesn't affect performance which is what I'm after. I just want the mission to run efficiently.

#

@still forum you're the reason I'm even here. You said if I'm going to provide examples they should be good examples. I'm trying to determine best practice so that my modules and compositions are quality.

still forum
#

performance isn't affected by from where the code comes

#

just the content of the function affects perf

#

and how you call it. Like execVM is very bad. call/spawn are "on par"

hot kernel
#

that makes sense. So initially loading the library via execVM isn't great but after the functions are loaded they will be as fast as my poor scripting allows.

cool, thanks

lapis ivy
#

Looking to get into scripting anyone know any good resources (other than the wiki) My final goal for this month is to make a airstrike script.

lofty spear
#

hi. need help with UI scripts.
How i can remove all existed values from ComboScrollBar?

heady reef
#

Hello everyone. looking for some help getting extended base mode recipes to be displayed in the xm8, went through and got the mod installed and the hardware traders displays the items. Whats the next step? thanks in advance..

lapis ivy
#

When using nearestLocation will [getPos _player, "NameLocal"] get me airports / airbases or will other stuff be in there also?

still forum
#

other stuff

lapis ivy
#

heck is there any location i can use for just airbases on altis. I know you can use airport on tanoa but think it only works on that map

still forum
#

yeah wiki says airport only works on tanoa

#

why not just hardcode it? altis wont change anymore

lapis ivy
#

Im not too sure how i would do that tbh just started this kind of stuff. Would i just get the coordinates of all the possible places i want it to spawn at and just get the closest of the list?

still forum
#

yeah

#

getting closest is not the easiest thing tho. Gotta have to go now.
Keywords:
sort, distance, getPos

lapis ivy
#

It would probably just be easier to spawn the helicopter at the terminal airport and just get it too fly from there as it is kinda central to the map

#

I also got to find out how to get it to slingload a car and drop it off for the player but thats a challenge for another day

opal ibex
#

Hi, i'm trying to achieve this
https://community.bistudio.com/wiki/Arma_3_Debug_Console
"To whitelist (multiple) users with a mod, if enableDebugConsole has already been defined, use the delete keyword:"
however i'm getting the error ".enableDebugConsole: Member already defined." on game startup. The mod works fine if i remove enableDebugConsole from my mission description.ext and remove the line delete enableDebugConsole; from my mod. Can someone help me please?
My code;
delete enableDebugConsole;
enableDebugConsole[] = {"steamid"};

lapis ivy
#

@still forum if i was to go into a editor session and spawn in at the desired locations entering getPos(player) would give me the correct coords or is it more complicated?

winter rose
#

@opal ibex did you put delete enableDebugConsole in Description.ext or in your mod?

opal ibex
#

@winter rose in my mod, description only has enableDebugConsole = 0;

#

it seems like the delete keyword is just ignored in the code. I tried delete[] and it gave the error "'[' encountered instead of ';'" so it's like delete is not even there and the line is just [] enableDebugConsole;

hot kernel
#

@lapis ivy you don't have to use the player. Put an object helper (arrow) at the point you want co-ordinates.

coordinates=getpos (_object);
systemChat format ["%1", coordinates];

That should do it.

lapis ivy
#

I got the point now and i just got a vehicle to spawn when i use the action menu so im very happy but still alot to do 🙂

#

oh and the crew are in it thats nifty

#

I should prob only allow one to spawn cause now i have a field full of chinooks

hot kernel
#

lol

astral dawn
#

@lofty spear

How i can remove all existed values from ComboScrollBar?
Better ask that in #arma3_gui

lofty spear
#

i already found, lbClear

lapis ivy
#

Anyone know a good way to script a heli slingroping a car? I have no idea where to start on this one

#
  • sling load
#

i know im going to have to use setSlingLoad but not sure how to get it to fly to the right alt above the car

hot kernel
#

remember that object we just got the position of...

lapis ivy
#

yeah

hot kernel
#

could attachto car and use as reference point

#

but maybe slicker to use memory points

#

in the vehicle

lapis ivy
#

sorry im new to all this what is a memory point?

hot kernel
#

memory points with offset

#

the 3D models have named points already

lapis ivy
#

where can i find these points?

hot kernel
#

that's a list from the forum

lapis ivy
#

thank you 🙂

hot kernel
#

I think there's a list per object somewhere, too

astral tendon
#

Some times AI refuses to do the doMove, only two members of the group move to their possitions, the others just stand there doing nothing. that changes trough buildings

#

what else can be?

young current
#

vanilla cars have slingload points defined already

hot kernel
#

yeah, there ya go!

young current
#

you just need to use the correct command

#

do note that not all modded vehicles work with this though if they are poorly configured

lapis ivy
#

so would sling = heli setSlingLoad prowler be correct for getting the heli to load the prowler?

young current
#

try it out

lapis ivy
#

yeah the problem is im still trying to figure out the flying 😄

#

need it to fly over first

#

but for that you said i can just offset the known position of the car i think

young current
#

you can just place stuff in editor and run it

#

to test different commands

#

you dont have to make it complete and fully working the first time

#

test parts

#

then combine

hot kernel
#

ewan on you on the BIS forum?

lapis ivy
#

no i have just been on the wiki

hot kernel
#

join the forum and make a topic, there's an army ready to help with your scripting

lapis ivy
#

i shall in the morning its getting late but want to finish this bit off before i sleep

hot kernel
#

have fun!

astral tendon
#

any other command better than doMove that the AI actually follows? im having troubles with AI not woving at all and they dont want to get inside buildings especially when there is AI already inside it.

hot kernel
#

@astral tendon , what behavior do you have them set to?

astral tendon
#
_wp setWaypointBehaviour "AWARE";

This is their last waypoint

hot kernel
#

if you want them to behave you can set them to CARELESS but expect they won't respond to fire or enemy

#

depends on the situation whether that's appropriate

astral tendon
#

what about safe?

hot kernel
#

they will toggle out of safe anytime they get, uhm, stimulated 😄

#

they won't stay in SAFE but they will stay CARELESS

astral tendon
#

yeah, forcing safe they are just as dumb

obsidian violet
#

hey guys!
trying to put a array of markernames within a variable and cannot get it to work, getting some weird errors.

I have created several markers on the map called klt_aopos klt_aopos_1 klt_aopos_2 etc. all the way to klt_aopos_20

I want to take all the markers with the name klt_aopos and put it into an array but I have no clue why this does not work..

if (combat_readiness > _CombatReadinessLimit) then {
        _MarkerArray = [];
        
        {
            if ("klt_aopos" in _x) then {
                _MarkerArray append _x;
            }
        }foreach allMapMarkers;

Thanks

winter rose
#

Because string in string is not yet in the game

obsidian violet
#

anyway to go around that? ^^

finite dirge
hot kernel
#

oh thanks @finite dirge , I knew about find but I just thought of a cool way to use it!

untold barn
#

How do you check to see if a player has a item in the slot that your watch goes in?

opal ibex
#

So it seems like binarizing the mod got rid of the error on launch however the code does not work and i'm not sure how i can troubleshoot why it doesn't work.
Just to be clear this is my config.cpp

{
    class Mymod 
    {
        name = "Name";
        author = "author";
        version = 1.0;
        requiredVersion = 0.1;
        requiredAddons[] = {};
        units[] = {};
        weapons[] = {};
    };
};
delete enableDebugConsole;
enableDebugConsole[] = {"steamid"};```
And inside the mission .pbo description.ext enableDebugConsole = 0; is set
Edit: I'm running a dedicated server on my machine with the said mission and connect to it.
tough abyss
#

Mission config overrides mod config @opal ibex

opal ibex
#

1.Mission param is checked. If is not defined then...
2.description.ext param enableDebugConsole is checked. If is not defined then...
3.Eden attribute option is checked. If not defined then...
4.Global/mod param enableDebugConsole is checked.

#

it should delete the variable when it's checking mod param, and override description.ext

#

Or maybe it just stops checking at the 2nd step because it found it

#

but then why would it write that in the wiki

tough abyss
#

If mission param not defined then it carries on checking other places including mods. You defined it in the mission so mod config is ignored

opal ibex
#

That still doesn't explain the wiki. It says if you delete it in the mod it should override it

tough abyss
#

Once again, mod config only relevant if you haven’t defined it in mission

#

Deleting is related to mod config

opal ibex
#

Okay, thanks. The wiki is referring to defining between mods it seems like. It is also logical to not allow overriding description.ext since every modder would have access to debug console with their own keys.

lofty spear
#

is it possible from scripts, if player uuid on list that allowed to login as admin without password?

opal ibex
#

Afaik only 1 admin can login at the same time.

tough abyss
#

Yes just #login

lofty spear
#

nope, in sqf

opal ibex
#

However debug console works for everyone inside the param enableDebugConsole

tough abyss
#

If you are whitelisted in the server config

exotic flax
#

Why are numbers at the start of classes allowed (eg. class 123Classname), but not as functions (eg. 123Classname_fnc_functionName)?

#

because after changing the TAG in my mod I get the following errors:

23:37:24 Error in expression <_this call 123Classname_fnc_onPlayerRespawn;>
23:37:24   Error position: <Classname_fnc_onPlayerRespawn;>
23:37:24   Error Missing ;
winter rose
#

classes are configs, variables are varnames

#

you could be forbidden to use numbers for your classes, be happy 😄

austere silo
#

i have one question

#
USbox setPos getMarkerPos "Marker2";```
#

this is my script to move 1 box from A to B. the problem: its not spawning always at my pos, sometimes at friendly player pos.

#

why?

exotic flax
#

why use a marker to set/get the position?

USbox setPos (getPos player);

or even better

USbox setPos ((getPos player) findEmptyPosition [0, 25]);
#

btw... the reason why it sometimes spawns at the wrong place is most likely because the script doesn't know who player is, especially when it's not you who called the script

austere silo
#

yea dude this making sence. iam nooby with that stuff but thx for the quick answer, i will try it out!

#

yea its working. thankyou! may i ask why the parameters 0, 25?

tame socket
#

0, 25 is minimum distance and maximum distance from the players position

austere silo
#

all right-thx

hazy timber
#

Hey I need help setting up a flag teleporter to teleport to a platform 10,000 meters in the sky

#

I find the KK_fnc_setPosAGLS script but I am unsure on how to implement it

tame socket
#
this AddAction ["Teleport",
{
    Params ["_Timer", "_Caller", "_actionId", "_arguments"];
    _Caller SetPos _PositionOfPlatform;
}];
hazy timber
#

okay sorry but how do I use that

#

which are variables sorry new to scripting but I have some programming knowledge

astral dawn
#

do you want to add an action to or flag or what?
in other words, how does one activate the script?

hot kernel
#

@hazy timber you could put an arrow helper on your platform named "exitHere" and use this,

call
{
if (tp1==0) exitwith {
tp1=1;

exitThere= createVehicle ["sign_arrow_blue_F", player getPos[ 0, getDir player ], [], 0, "CAN_COLLIDE" ];
hideObject exitThere;

titleText ["Teleporting", "BLACK FADED", 0.2];
_veh= vehicle player;
_veh setpos (getpos exitHere);
playsound ["Orange_PeriodSwitch_Pre_01", true];
sleep 0.5;
titleCut ["", "BLACK IN", 5];

};

if (tp1==1) exitwith {
tp1=0;

titleText ["Teleporting", "BLACK FADED", 0.2];
_veh= vehicle player;
_veh setpos (getpos exitThere);
playsound ["Orange_PeriodSwitch_Pre_01", true];
sleep 0.5;
titleCut ["", "BLACK IN", 5];
deleteVehicle exitThere;

    };
};

You'll also need to add a line to the init file, or in the mission init properties: tp1=0;

This will allow you to teleport back to wherever you teleported from.
Have fun!

#

@hazy timber , you might want this, too

player addAction ["teleport", "teleport.sqf"];
hazy timber
#

I used the last one @hot kernel however since the platform is in the air did not go there but rather the ground below it I wish their was a way to simply edit that command to include the z axis

hot kernel
#

the last one?

#

no z axis necessary just put a helper arrow named "exitHere" on your platform where you wish to arrive

#

you can use a can of tactical beans if you want just name it and hide it

#

we could save the player position as a variable but this is easier

hazy timber
#

thanks that fixed it

hot kernel
#

karmic balance achieved

jolly egret
#

Hey guys

#

does anybody have a script for paradroping landrovers and troops out of a c-130 ? i know it can all be done manually but i want to start the mission while were already in the air and have the trucks land in one spot and troops further away and run to the trucks once we land for a cool fire fight. can i have the vehicles already loaded and in the air and ready to drop once we hit the drop zone? much appreciated boys

#

i cant do much else on the mission except the paradrop

jolly egret
#

pls help

still forum
#

@opal ibex

it seems like the delete keyword is just ignored in the code.
You need to delete and re-add in multiple mod configs. Afaik can't do in the same.
@obsidian violet
_MarkerArray append _x;
append takes array, not string. You actually want to use select there instead of forEach.
@exotic flax
Why are numbers at the start of classes allowed (eg. class 123Classname), but not as functions (eg. 123Classname_fnc_functionName)?
Because that's how it is. I think numbers at start in classnames is just an afterthought. As in C++ classes which inspired the config syntax, that's not allowed either.

queen cargo
#

In sqf, variables starting with numbers... Are numbers with Text
Aka: tokenizer goes crazy
In Config, there is a special keyword telling that a classname is following

tough abyss
#

You can create function variable that starts with number in sqf

missionNamespace setVariable ["123my_fnc_function", {}];
still forum
#

not access it wouthout getVariable tho

exotic tinsel
#

what would prevent my action menu items from showing up when incapacitated even though i have the parameter in the action menu set to true for unconscious?

tough abyss
#

Condition returning false

jaunty ravine
#

Does anyone have a solution for why this isn't working? (Specifically that the vehicle does not move to the waypoint)

(1_QRF_BTR select 0) setVehicleVarName "Rwy_Bridges_1_QRF_BTR";

_wp1 = 1_QRF_BTR addWaypoint [(getMarkerPos "Rwy_Bridges_1_QRF_WP1"), 0];
Rwy_Bridges_1_QRF_WP1 setWaypointType "MOVE";

1_QRF_BTR deleteGroupWhenEmpty true;```
errant jasper
#

Looks like a couple of issues. Global variables should not start with a number (they can, see discussion above, but is not recommended).

#

Second, you want to add the waypoint to a group, not an array. The group should be in (1_QRF_BTR select 2) according to the docs for bis_fnc_spawnVehicle.

#

Also this variable is not set somewhere, rather it seems to be the name of a marker, Rwy_Bridges_1_QRF_WP1 .. You probably meant _wp1 setWaypointType "MOVE"

jaunty ravine
#

Thank you, @errant jasper, this really helped me on my way, however now I'm getting a different error Error Missing ) for line 2.

errant jasper
#

I don't really know what line 2 is... But try manually counting the parentheses.. Whenever you see a '(' add 1, and when you see a ')' subtract one.. You should end up with 0.

jaunty ravine
#

I figured out the problem, I was being retarded and applying the solution to the wrong problem.

#

Now I just need to fix the infantry spawning into the BTR :p

#

Thanks alot @errant jasper, greatly appreciated!

jaunty ravine
#

I admit defeat. Can anyone explain what I'm doing wrong here? (Intended behaviour is to automatically, without animation, load the squad into the previously mentioned BTR)



Rwy_Bridges_1_QRF_Inf assignAsCargo Rwy_Bridges_1_QRF_BTR_Veh;
Rwy_Bridges_1_QRF_Inf moveInCargo Rwy_Bridges_1_QRF_BTR_Veh;

(Rwy_Bridges_1_QRF_Inf select 2) deleteGroupWhenEmpty true;```
winter rose
#

what's the error @jaunty ravine

jaunty ravine
#

(Rwy_Bridges_1_QRF_In select 2) was just an experiment, not meant to be in the code.

#

If you have the time, could you explain how I solve this problem? I have no idea how to make it work, I've tried a bunch of different things.

#

I'm extremely inexperienced with sqf.

winter rose
#

oh, okay then.

are you familiar withforEach?

jaunty ravine
#

Nope, not in the slightest.

winter rose
#
private _groupUnits = units Rwy_Bridges_1_QRF_Inf;
{
    _x assignAsCargo Rwy_Bridges_1_QRF_BTR_Veh;
    _x moveInCargo Rwy_Bridges_1_QRF_BTR_Veh;
} forEach _groupUnits;```
here ya go 🙂
jaunty ravine
#

Thank you!

#

I'm still getting an error (Undefined variable in expression: rwy_bridges_1_qrf_btr_veh). This is the script as it is right now, I must've messed something up:


private _groupUnits = units Rwy_Bridges_1_QRF_Inf;
{
    _x assignAsCargo Rwy_Bridges_1_QRF_BTR_Veh;
    _x moveInCargo Rwy_Bridges_1_QRF_BTR_Veh;
} forEach _groupUnits;```
winter rose
#

well it seems you don't have any Rwy_Bridges_1_QRF_BTR_Veh vehicle

jaunty ravine
#

That's in a different sqf file

winter rose
#

also,

```sqf
// your code
```

#

your vehicle isn't created early enough then.

jaunty ravine
#

So if I add sleep 5 for example between BTR spawn and Inf spawn it should work?

winter rose
#

how is it called? you can't "sleep and hope for the best"

#

(wow, life advice here 😁)

jaunty ravine
#

Rwy_Bridges_1_QRF_BTR.sqf =

Rwy_Bridges_1_QRF_BTR = [ getMarkerPos "Rwy_Bridges_1_QRF_Spawn", 0, "rhs_btr70_msv", EAST] call BIS_fnc_spawnVehicle;
(Rwy_Bridges_1_QRF_BTR select 0) setVehicleVarName "Rwy_Bridges_1_QRF_BTR_Veh";

_wp1 = (Rwy_Bridges_1_QRF_BTR select 2) addWaypoint [(getMarkerPos "Rwy_Bridges_1_QRF_WP1"), 0];
_wp1 setWaypointType "TR UNLOAD";

(Rwy_Bridges_1_QRF_BTR select 2) deleteGroupWhenEmpty true;```

Rwy_Bridges_1_QRF_Inf.sqf =
```sqf
Rwy_Bridges_1_QRF_Inf = [ getMarkerPos "Rwy_Bridges_1_QRF_Spawn", EAST, (configFile >> "CfgGroups" >> "East" >> "rhs_faction_msv" >> "rhs_group_rus_msv_infantry" >> "rhs_group_rus_msv_infantry_squad")] call BIS_fnc_spawnGroup;

private _groupUnits = units Rwy_Bridges_1_QRF_Inf;
{
    _x assignAsCargo Rwy_Bridges_1_QRF_BTR_Veh;
    _x moveInCargo Rwy_Bridges_1_QRF_BTR_Veh;
} forEach _groupUnits;```
#

I called it from the debug console

#

through execVM

winter rose
#

```sqf
// your code
```

hot kernel
#

A while back I went through a phase experimenting with attaching different kinds of lights to vehicles. Everything I tried lagged behind the vehicle and made the light effect "blink" like crazy. Only object lights, like a construction lamp, seem to update at the same rate (almost/more-or-less/probably dependent on FPS) as the vehicle. But of course this means duct-taping a construction lamp to my jet...

Can I create the construction lamp light without the object model? Or is there something else I missed?

winter rose
#

@jaunty ravine
either put that all in the same file, '''or'''

private _scriptHandle = execVM "createVehicle.sqf";
waitUntil { scriptDone _scriptHandle; };
execVM "createGroupAndPutInVehicle.sqf";```
#

but it seems silly to have these two in two different files 😐

jaunty ravine
#

I'll put them in the same file and get back to you

winter rose
#

👍

jaunty ravine
#
Rwy_Bridges_1_QRF_BTR = [ getMarkerPos "Rwy_Bridges_1_QRF_Spawn", 0, "rhs_btr70_msv", EAST] call BIS_fnc_spawnVehicle;
(Rwy_Bridges_1_QRF_BTR select 0) setVehicleVarName "Rwy_Bridges_1_QRF_BTR_Veh";

_wp1 = (Rwy_Bridges_1_QRF_BTR select 2) addWaypoint [(getMarkerPos "Rwy_Bridges_1_QRF_WP1"), 0];
_wp1 setWaypointType "TR UNLOAD";

(Rwy_Bridges_1_QRF_BTR select 2) deleteGroupWhenEmpty true;

Rwy_Bridges_1_QRF_Inf = [ getMarkerPos "Rwy_Bridges_1_QRF_Spawn", EAST, (configFile >> "CfgGroups" >> "East" >> "rhs_faction_msv" >> "rhs_group_rus_msv_infantry" >> "rhs_group_rus_msv_infantry_squad")] call BIS_fnc_spawnGroup;

private _groupUnits = units Rwy_Bridges_1_QRF_Inf;
{
    _x assignAsCargo Rwy_Bridges_1_QRF_BTR_Veh;
    _x moveInCargo Rwy_Bridges_1_QRF_BTR_Veh;
} forEach _groupUnits;

Rwy_Bridges_1_QRF_Inf delteGroupWhenEmpty true;```
Still doesn't work. Still `Undefined variable in expression: rwy_bridges_1_qrf_btr_veh`
winter rose
#

well, of course
you only did "setVehicleVarName"

this ^ doesn't set the variable pointing to the object; do rwy_bridges_1_qrf_btr_veh = (Rwy_Bridges_1_QRF_BTR select 0)

jaunty ravine
#

Words can't properly express my gratitude, @winter rose, it works now. Thank you a lot.

winter rose
jaunty ravine
#

Thanks!

#

I'll try and read up more on all these things.

winter rose
#

beware, it is the slope of no return 😄

jaunty ravine
#

Haha, lucky I'm starting a programming course soon through school

hot kernel
#

no there's a return, you end up back here...

#

kinda like pacman

winter rose
#

this channel is the first level of SQFHell; the wiki the last one?

hot kernel
#

it's a cycle

dull drum
#

Hi guys. I realize that it could be a kinda stupid question. But why my server doesn't broadcast part of mine global vars pack even for it's internal sqfs? Like I have this sqf script, that contains mainly things like "RK_zombie_hp / RK_launcher_rate_of_fire" and stuff. And this script runs first string from initServer.sqf. My debug console is "on for all" on server so when I put RK_zombie_hp there it just shows nothing. And of course all scripts based on that are ruined. I did a publicVariable stuff to solve it but it does nothing.

winter rose
#

you need to publicVariable on each and every change @dull drum

dull drum
#

These are static.

winter rose
#

you trigger the value's broadcast with this command, but not the auto-sync of it

dull drum
#

It's just a balance stuff, modifiers. I don't change them, only read them.

#

What makes me really angry is that part of them actually works sometimes

wispy cave
#

Does the CuratorObjectPlaced work if assigned to all curators on server or does it need to be assigned to each curator on their own client?

dull drum
#

Each, @wispy cave

winter rose
#

so, in initServer.sqf:

RK_zombie_hp = 666;
publicVariable "RK_zombie_hp";```

and from a connected player:
```sqf
isNil "RK_zombie_hp"; // returns true?```
#

(maybe you forgot quotes around the public'ed variable?)

dull drum
#

Yup, its true

#

Performed locally

#

and globally

#

Nope they all are in quot marks

#

I've also tried

balanceSettings  = [] execVM "server\balanceSettings.sqf";
waitUntil {scriptDone balanceSettings};
#

without any good results

winter rose
#

wait, it's in an execVM?

#

do you unset them somewhere?

dull drum
#

swallows all the bad words yes, it is there

#

unset like what?

#

execVM was a bad idea?

still forum
#

@hot kernel

Can I create the construction lamp light without the object model? Or is there something else I missed?
sure, you can create your own model 😄

winter rose
#

unset such as RK_zombie_hp = nil, in an "unload script" or anywhere else; it might be that the script gets triggered first

yes execVM it means the script is started, but in no way it means it's done

can you show us the publicVariable part?

hot kernel
#

@dedmen, yeah but I don't want the model... I want the light.

dull drum
#

unset such as RK_zombie_hp = nil, in an "unload script" or anywhere else; it might be that the script gets triggered first

No I'm pretty sure that I don't nil them.
Also it works in singleplayer.

verbal saddle
#

There are light cones available in the editor.

hot kernel
#

that's fine though, if that's the answer. I need the construction lamp light attributes as a model without the actual model. If that's the answer, so be it.

dull drum
#

@winter rose

// bullet types and zombie bullet speed

RK_zombie_bullet = "B_127x99_Ball";
RK_demon_bullet = "B_45ACP_Ball_Green";
RK_zombie_bullet_speed = [0, 0, -1000];
RK_pistol_bullet = "B_9x21_Ball";
RK_rifle_bullet = "B_65x39_Caseless";
RK_launcher_rocket = "R_PG32V_F";

publicVariable "RK_zombie_bullet";
publicVariable "RK_demon_bullet";
publicVariable "RK_zombie_bullet_speed";
publicVariable "RK_pistol_bullet";
publicVariable "RK_rifle_bullet";
publicVariable "RK_launcher_rocket";
hot kernel
#

@still forum thanks

still forum
#

@hot kernel maybe you can inherit the lamp in a mod config, and just set the model to something invisible

winter rose
#

looks totally fine;

you shouldn't need to iirc, but you can still waitUntil { not isNil "variable" }; to be sure you receive them at init stage @dull drum

dull drum
#

Yup, that sounds good, I'll try that.
Thanks @winter rose

hot kernel
#

@still forum that's the kind of idea I had. I'll get to researching that type of solution instead of scripting-- if you want a good laugh I'll post my workaround for this 😄

dull drum
#

I will also try to move them to the serverInit just in case

winter rose
#

I was convinced the publicVariables were synchronised for JIP players, seems I was wrong 😶

tough abyss
#

They are

winter rose
#

I mean, before any other things

#

but it seems you have to wait for them

dull drum
#

The strangest moment of all is that the scripts that run on server do not receive these vars. But do if it's a singleplayer, of course. I think I'll beat my kill dedic-save-export to MP-start dedic-join record today

winter rose
#

wha… the server doesn't have its own vars? ><

dull drum
#

Yup

#

Evil sorcery this is.

#

But I'm 666% sure that it's my fault 🙂

verbal saddle
#

@hot kernel
There are light cones in the editor that might be useful in this situation.

tough abyss
#

but it seems you have to wait for them
Dunno what you mean

winter rose
#
waitUntil { not isNil "myPublicVar"; };``` I thought JIP publicvariables were already loaded before evn reaching the init.sqf stage
tough abyss
#

They are

hot kernel
#

@verbal saddle I'm not sure where but yeah, that does sound useful? Where are light cones in the editor?

dull drum
#

Guess what, @winter rose. The waitUntil { not isNil "myPublicVar"; }; just did the job. All wonders of all worlds to you, sir.

tough abyss
#

You can’t make your assumptions on some comments you read here @winter rose

#

People post all sorts of rubbish, only testing it yourself can give you the answer, do not trust anyone, trust the game

dull drum
#

Gentlemen, I think the issue was based on the standalone sqf file that was run from initServer and the scripts just need to be waited for. If it was just the init file everything could go better from the beginning.

winter rose
#

@tough abyss I try to never assume anything, thanks
I think I read that on the biki though. And that's bad.

verbal saddle
#

@hot kernel search 'cone' in the empty side

#

They were added in contact dlc to base game

tough abyss
#

Only 100% repro otherwise ignore

hot kernel
#

@verbal saddle okay, I thought I knew every object in there!

verbal saddle
#

You can then attach them to your vehicle and it shouldn't stutter

winter rose
#

of course, everytime I read something I repro it first before anything else --'

nuh-huh.

hot kernel
#

@verbal saddle thanks!

verbal saddle
#

👍

tough abyss
#

I was convinced the publicVariables were synchronised for JIP players, seems I was wrong 😶
You were not but this is what I’m talking about

winter rose
#

oh wait - you meant "I shouldn't be wrong before someone states something here"

#

my bad then.

tough abyss
#

I mean don’t throw away things you know because someone told you so without any proof

winter rose
#

yes yes, I got it the other way "don't believe what you read on the biki" x)

tough abyss
#

publicVariables have to sync before everything just like functions have to exist before everything

astral tendon
winter rose
#

@tough abyss

```sqf
/* your code */
```

still forum
#

@tough abyss
```sqf
code
```

#

dang ninjas

tough abyss
#
_mark2 = _this select 1;
_mark3 = _this select 2;


grp = CreateGroup West; //Indepentent 
unit = grp createUnit ["VTN_USMC_MARW_XO",getMarkerpos _mark1,[],0,"CAN_COLLIDE"]; 
sleep 2;


_moveWP = grp addWaypoint [getMarkerPos _mark2,0,1];
_moveWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE";

_moveWP = grp addWaypoint [getMarkerPos _mark3,0,1]; 
_moveWP setWaypointType "MOVE"; 
_moveWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE"; 

unit addEventhandler ["Killed",{if (alive(_this select 1))then {["mark1","mark2","mark3"]execVM"patrolAi.sqf"} spawn AIunitRespawn;}];
sleep 10;
while {true} do {

{
deleteVehicle _x;
sleep 0.01;
} forEach allDeadMen;

sleep 10;

};````
winter rose
#
_mark1 = _this select 0;
_mark2 = _this select 1;
_mark3 = _this select 2;


grp = CreateGroup West; //Indepentent 
unit = grp createUnit ["VTN_USMC_MARW_XO",getMarkerpos _mark1,[],0,"CAN_COLLIDE"]; 
sleep 2;


_moveWP = grp addWaypoint [getMarkerPos _mark2,0,1];
_moveWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE";

_moveWP = grp addWaypoint [getMarkerPos _mark3,0,1]; 
_moveWP setWaypointType "MOVE"; 
_moveWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE"; 

unit addEventhandler ["Killed",{if (alive(_this select 1))then {["mark1","mark2","mark3"]execVM"patrolAi.sqf"} spawn AIunitRespawn;}];
sleep 10;
while {true} do {

{
deleteVehicle _x;
sleep 0.01;
} forEach allDeadMen;

sleep 10;

};```
tough abyss
#

How can i repeate the waypoints?

#

When the AI arrives the last marker, that they go back to the first one!

winter rose
#

a "CYCLE" waypoint is the answer

#

it should be close to the first one though

tough abyss
#

I need only change "_ moveWP" to "_cycleWP"? _cycleWP = grp addWaypoint [getMarkerPos _mark2,0,1]; _cycleWP setWaypointCompletionRadius (1); [grp,1] setWaypointTimeout [0,0,0]; [grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"]; [grp,1] setWaypointSpeed "LIMITED"; [grp,1] setWaypointCombatMode "RED"; [grp,1] setWaypointBehaviour "SAFE";

winter rose
#

no. create a new "CYCLE" waypoint.

tough abyss
#

Yes, mean it so!

#
_mark2 = _this select 1;
_mark3 = _this select 2;


grp = CreateGroup West; //Indepentent 
unit = grp createUnit ["VTN_USMC_MARW_XO",getMarkerpos _mark1,[],0,"CAN_COLLIDE"]; 
sleep 2;


_moveWP = grp addWaypoint [getMarkerPos _mark2,0,1];
_moveWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE";

_moveWP = grp addWaypoint [getMarkerPos _mark3,0,1]; 
_moveWP setWaypointType "MOVE"; 
_moveWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE"; 

 _cycleWP = grp addWaypoint [getMarkerPos _mark2,0,1];
_cycleWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE";

unit addEventhandler ["Killed",{if (alive(_this select 1))then {["mark1","mark2","mark3"]execVM"patrolAi.sqf"} spawn AIunitRespawn;}];
sleep 10;
while {true} do {

{
deleteVehicle _x;
sleep 0.01;
} forEach allDeadMen;

sleep 10;

};````
winter rose
#

again, it's

```sqf
code
```

tough abyss
#

Sorry

winter rose
#

and, no, just changing the variable name will not change the waypoint type. see setWaypointType

tough abyss
#
 _cycleWP = grp addWaypoint [getMarkerPos _mark3,0,1]; 
_cycleWP setWaypointType "CYCLE"; 
_cycleWP setWaypointCompletionRadius (1);
[grp,1] setWaypointTimeout [0,0,0];
[grp,1] setWaypointStatements ["unit == this;", "grp setCurrentWaypoint[grp,1]"];
[grp,1] setWaypointSpeed "LIMITED";
[grp,1] setWaypointCombatMode "RED";
[grp,1] setWaypointBehaviour "SAFE"; 
#

Sorry again for the wrong posting, i had do it how you had write! And thanks for the advice!

astral tendon
#

groups are considered objects?

tough abyss
#

No they are groups

spiral compass
#

Does anyone know how to whitelist individual slots to specific UIDs?

unborn ether
#

group is a type in arma

finite dirge
#

@spiral compass In the init you can just kick them or end the mission if they don't match the UID you are looking for.

spiral compass
#

I want it to be automatic. Where they can't use a specific slot, unless it is their slot. That removes the possibility of trolling, if/when server is empty

finite dirge
#

Right, so do what I said then? Add a CfgDebriefing for what end you want and https://community.bistudio.com/wiki/BIS_fnc_endMission them if they don't match the UID.

spiral compass
#

I guess I misunderstood. I thought you were telling me to just kick ppl who aren't in the correct spot. But I'm not 100% on how to do all of that

finite dirge
#

Gimmie a Sec and I'll write something up for you.

#

Description.ext:

class CfgDebriefing {
    class NotWhitelisted {
        title = "Not Whitelisted";
        subtitle = "You aren't Whitelisted";
        description = "You are not Whitelisted to use this slot.";
        pictureBackground = "";
        picture = "";
        pictureColor[] = {0,0.3,0.6,1};
    };
};

initPlayerLocal.sqf:

waitUntil {!(isNull (findDisplay 46))};

private _uidArray = [["slot_name1", "76561197960287930"], ["slot_name2", "76561197960287931"]];

private _notWhitelisted = true;

{
    if (str(player) isEqualTo _x select 0 && {getPlayerUID isEqualTo _x select 1}) then { _notWhitelisted = false; };
    true;
} count _uidArray;

if (_notWhitelisted) exitWith {
    ["NotWhitelisted", false, true] call BIS_fnc_endMission;
    sleep 40;
    (findDisplay 46) closeDisplay 0;
};

Not tested, but that should work.

tough abyss
#

I'm really new to scripting and I've tried a hundred ways to do this today. I just want to pass a couple variables to a function scope that's inside of [] spawn. Specifically _newDistance and _unitOpf.

        
            _unitOpf = "O_Soldier_F" createVehicleLocal position player;  
            
            _newDistance = 10;
            
            _COMmouse = findDisplay 46 displayAddEventHandler ["MouseZchanged","[_this,['_unitOpf','_newDistance']] call COMScrollWheel"];
            
    COMScrollWheel = {
    private ["_toggle","_r","_f"] ;
    
                _r = false ;

                _f = true ;

                _toggle = (_this select 1);
                

        if (_toggle > 0) then { 
                
                _newDistance = ((this select 1) + 10); 
                _unitOpf setPos (player getRelPos [_newDistance, 0]);
                _unitOpf setVectorUp surfaceNormal position _unitOpf; 
                _r = true;

        };

        if (_toggle < 0 ) then {

                _newDistance = (_newDistance - 10);
                _unitOpf setPos (player getRelPos [_newDistance, 0]);
                _unitOpf setVectorUp surfaceNormal position _unitOpf; 
                _r = true;
                
                };

        };
        
            
        
};```
#
[_newDistance, _unitOpf] spawn {        
        params ["_newDistance","_unitOpf"];
finite dirge
#

```sqf
code
```
To format scripts properly.

tough abyss
#

After doing that as the pass in you just move the code for determining those values above the spawn line.

rotund otter
#

ok, its that time where i need help again.

#

i want that whenever a unit is spawned or initialized, to execute a code on said instance.

#
{
_unit addEventHandler ["Init", {
_unit additem "itemwhatever";
systemchat format ["unit init'ed"];
}];
} forEach allUnits;
#

i dont know what's wrong.
is it my code or my testing that im fucking up?

gleaming cedar
#

Does anyone know how to start a keyframe with trigger?

#

Or just start it in delay

tough abyss
#

@rotund otter Try this


["CAManBase", "Init", { 
    _unit additem "itemwhatever";
    systemchat format ["unit init'ed"];
}] call CBA_fnc_addClassEventHandler; 


rotund otter
#

@tough abyss thank you 100%
edit: if anyone tries to search for my question, you will need CBA (the mod)

#

-so, it works, it will systemchat, but it will not add the item.
i have tried changing _unit to _x and _this but it leaves a "generic error expression" error
player works though.

tough abyss
#

which item are you adding

rotund otter
#

NVGoggles

tough abyss
#
if (!hasinterface) then {{if (side _x == resistance) then
{if (_x IsKindof "Man") then
        {
        _items = assigneditems _x;
        if !("potato_fakeNVG" in _items) then 
            {
                _x assignitem "potato_fakeNVG";_x linkitem "potato_fakeNVG";
            };
        };
};
} forEach allUnits;

#

You can adapt that. I'm sure there is a way to do it with an evh though

high marsh
#

assignItem will do the linking already.

rotund otter
#

i dont care if its assigned or not. i just want a proof that every time a unit is initialized, i can have a snippet of code that will only affect that single unit, and only that unit.
im not great at scripting so adding an item using additem is an easy way to test for me

tough abyss
#

assignItem will do the linking already.
It is other way round

#

Linking includes assignment

rotund otter
#

i got this

#
["CAManBase", "Init", { 
    (_this select 0) addItemToVest "whatever";
    systemchat format ["unit init'ed"];
}, true, [], true] call CBA_fnc_addClassEventHandler; 
#

it works , but the player gets init'ed twice

high marsh
#

do you know what format does?

tough abyss
#

Okay so I've been trying a few things here and none have worked yet.

            _unitOpf = "O_Soldier_F" createVehicleLocal position player;  
            
            _newDistance = 10;

[_newDistance, _unitOpf] spawn {        
        
              params ["_newDistance","_unitOpf"];
              _newDistance = (_this select 1);
              _unitOpf = (_this select 2);
            _COMmouse = findDisplay 46 displayAddEventHandler ["MouseZchanged","[_this,["_newDistance","_unitOpf"]] call COMScrollWheel"];
            
    COMScrollWheel = {
                _r = false ;

                _f = true ;

                _toggle = 1;
                

        if (_toggle > 0) then { 
                
                _newDistance = (_newDistance + 10); 
                _unitOpf setPos (player getRelPos [_newDistance, 0]);
                _unitOpf setVectorUp surfaceNormal position _unitOpf; 
                _r = true;

        };

        if (_toggle < 0 ) then {

                _newDistance = (_newDistance - 10);
                _unitOpf setPos (player getRelPos [_newDistance, 0]);
                _unitOpf setVectorUp surfaceNormal position _unitOpf; 
                _r = true;
                
                };

        };
        
            
        
};

I'm not sure I'm using


[_this,["_newDistance","_unitOpf"]] call COMScrollWheel"];

```  correctly 

Still getting #getrelpos expected number from _newDistance
#

you need to escape those " with a \ more than likely as its meant to be a string. So something like (please don't butcher this!)

"[_this,[\"_newDistance\",\"_unitOpf\"]] call COMScrollWheel"
high marsh
#

butchered

tough abyss
#

There is no escape with \ in sqf

#

Oh really? ' work maybe?

high marsh
#

No

tough abyss
#

Quotes are escaped with quotes

#

TIL

high marsh
#

"Blah" ""Blah Blah"" or "Blah 'Blah Blah'"

tough abyss
#

"string ""escaped"""

high marsh
#

It's not escaping anything if it's already ended?

tough abyss
#

"Blah" ""Blah Blah""
🤦

high marsh
#

Explain

tough abyss
#

Put it in debug console

high marsh
#

"BLAH"
"BLAH 'BLAH' "

#

Works fine.

tough abyss
#

This is not valid string "Blah" ""Blah Blah""

high marsh
#

Of course not

#

seperate examples

#

with the inclusion of spaces inbetween.

tough abyss
#

Huh? It looks like one example and after or there is second example

#

Ah okay I'll try that

high marsh
#

You can either
a)
Double quote to escape,
b)
Single quote to escape

tough abyss
#

So something like this?


["MouseZchanged","[_this,[""_newDistance"",""_unitOpf""]] call COMScrollWheel"]; 

#

Or use {} code not a string

high marsh
#

That'll work but code works too

tough abyss
#

Damn still not passing the var.

high marsh
#

iirc all the UI EH's accept code

tough abyss
#

Banging my head on the table at this point

high marsh
#

format the string

tough abyss
#

Undefined vars apart from _this

high marsh
#

That's the entire snippet??

#

Needs to exist

tough abyss
#

Wait what?

#

Your variables do not exist inside event handler, only _this

#

And global function variable

#

Okay I got it. So if I want to pass the var's that are not defined to the function can I do [var1,va2] myfunction = {yadadada }; or can I just do params and then select?

#

That's my problem so far. I really don't understand how _vars get passed down to other scopes.

#

[_var,_var1] spawn and then params makes sense to me. But why is the child scope not seeing it?

#

Depends what scope. If it is child scope they get inherited if it is new scope they don’t get passed. Spawn and call can take params and pass arguments in _this, event handlers don’t take params (apart from one, but it irrelevant here)

#

Spawn makes new scope

#

Event handlers make new scope

#

Okay so ComScrollWheel is not a child scope, it's a new scope then which is why it's not picking up the prior variables.

#

Bingo

spiral compass
#

@finite dirge sorry. Been extremely busy. Thank you. I will test it out, as soon as I can

exotic tinsel
#

i have a map icons script that shows all bluefor stuff on the map. it works greate, however it doesnt show Incapacitated players. can some one please take a look at it and tell me what im doing wrong?
https://pastebin.com/d3nWNMbi

rancid ruin
#

i am shit at scripting

astral dawn
#

Maybe bad words embedded in code don't count, just don't make many syntax errors; #⃣

verbal saddle
#

@exotic tinsel
Incapacitated players will most likely be on the 'civilian' side
Use "side group _x" to get around the issue.

#

It looks like your also missing some brackets around your array on line 45

runic quest
#

Hello, excuse me, I want to show a player's savings in the upper right corner by remoteExecCall, but there is no display and no RPT error found. I hope I can get help. Thank you!

errant patio
#

What's the easiest way to make a unit look in the opposite direction to something? I'm spawning units just outside a building and want them to face outwards

#

obviously i can make them look at the building with lookAt but that's not much good :/

tough abyss
#

getDir setFormDir setDir

errant patio
#

👍

exotic tinsel
#

OMG ARMA! so allplayers on the server contains all players, incapacitated, dead, and alive. but on the client it does not contain incapacitated! someone please put that on the wiki!

#

it does show you if your incapacitated but not other players

winter rose
#

In player hosted game, the complete array of allPlayers may get delayed at the start. Use BIS_fnc_listPlayers if you need it earlier? or is it something completely different

#

me is biki worky boi, me can fixy

exotic tinsel
#

hosted server. and no i waited 60 seconds.

winter rose
#

wait maybe for 5 mikes, it might be that

I need a full detailed behaviour before changing the biki (pretty please)

exotic tinsel
#

arg scratch that im a tart. lol

winter rose
#

what? why?

exotic tinsel
#

my test code was bad.

winter rose
#

… :3

#

bad LifeSnatcher, bad

exotic tinsel
#

been up 36 hours.