#arma3_scripting

1 messages ยท Page 374 of 1

cunning nebula
astral tendon
#

cool, what is the event handle for distance?

cunning nebula
#

but again

#

it would help to know what exactly youre trying to do

tough abyss
#

i'm sorry but there is more to scripting than EHs and triggers

cunning nebula
#

there may be a completely different solution for it

astral tendon
#

i need to detect if a player puts a "m112 x4 charge pack" inside a especific area

cunning nebula
#

yes ive read that

#

but WHY

#

do you want him to blow something up ?

#

or why do you need to detect the placement

astral tendon
#

its need to be played a sound when the charge is in the area

cunning nebula
#

ah

#

a fired eventhandler might work

#

last time i used that with "put" was in A2 i think

astral tendon
#

if (nearestObjects [player, ["m112x4.p3d"], 200];)

#

i cant use that, gives generic error

compact maple
#

m112x4.p3d is not an object

cunning nebula
#

๐Ÿ˜‘

compact maple
#

why the coma at the end?

astral tendon
#

i used nearestObjects [player, [], 1]

#

to get the name

compact maple
#

you need the classname of the object

#

the .p3d is the 3d model

cunning nebula
#
player addEventHandler ["Fired", {
    params ["_unit", "", "", "", "_ammo"];
    if (_ammo isEqualTo "rhsusf_m112x4_ammo") then {
        if ((_unit distance2D yourbombtarget) < 10) then { // withing 10m radius
            // shit is happening
        };
    };
}];
lone glade
#

params pls

cunning nebula
#

bleh to lazy to type the whole list for that ^^

#

otherwise yes

lone glade
#

params ["_unit", "", "", "", "", "_magazine"]

#

now if my keyboard was properly placed in front of me i'd type faster, but my hotas is blocking it ๐Ÿ˜„

little eagle
#

My editor has the params as template for all* addEventHandler as auto complete.

cunning nebula
#

hmm

compact maple
#

@astral tendon Look at your object and do this in the console _obj = cursorObject; copytoclipboard str(_obj);

#

i think u'll get the classname

astral tendon
#

got this: ```2771264: m112x4.p3d````

little eagle
#

Looks like an OBJECT.

compact maple
#

Go to virtual arsenal, found your item, place your mouse on it and wait, the classname will appear @astral tendon

compact maple
#

rofl

little eagle
#

Or just use typeOf cursorObject via debug console.

compact maple
#

think this is it rhsusf_m112x4_ammo_mag

cunning nebula
#

ah right

little eagle
#

That's a magazine if the classname doesn't lie. He's looking for CfgVehicles/CfgAmmo/CfgNonAiVehicle

cunning nebula
#

not really

#

he has no idea what he's looking for

compact maple
#

nop he need the classname to use it with nearestobjects

#

to check if a bomb has been planted near the player

cunning nebula
#

but the EH will work just fine

compact maple
#

(if i understand him correctly)

little eagle
#

nearestObjects etc. only works with those 3 I mentioned.

compact maple
#

yea, but rhsusf_m112x4_ammo_mag is the most logic classname i found x)

little eagle
#

typeOf cursorObject is guaranteed to work though.

cunning nebula
#

though personally I wouldnt limit it to a single kind of explosive

#

_magazine isKindOf "PipeBombBase"

little eagle
#

Depends on the mission I guess.

cunning nebula
#

sure

astral tendon
#

typeOf cursorObject give this
"rhsusf_m112x4_ammo"

cunning nebula
#

or ammo in that case

little eagle
#

Well there you go, Roque. That's your classname.

compact maple
#

thanks commy

little eagle
#

Problem solved. ๐Ÿบ

#

I should just add typeOf cursorObject as a default field somewhere to the debug console.

cunning nebula
#

i have ๐Ÿ˜ƒ

#

always useful

waxen cosmos
#

Could someone who has succesfully returned currentweapon picture/display name in a dialog give me some advice?

little eagle
#

I have typeOf cursorTarget as expression in the config viewer, which can be done by modifying some profile namespace variables ๐Ÿ˜ƒ

#

getText ?

astral tendon
#

yup, all working

    params ["_unit", "", "", "", "_ammo"]; 
    if (_ammo isEqualTo "rhsusf_m112x4_ammo") then { 
        if ((_unit distance2D test) < 10) then { hint "yes"        }; 
    }; 
}];```
little eagle
#
private _weapon = currentWeapon _unit;
private _config = configFile >> "CfgWeapons" >> _weapon;

private _displayName = getText (_config >> "displayName");
private _picture = getText (_config >> "picture");

Something like this?

astral tendon
#

thanks everyone

waxen cosmos
#

Yea Commy - I've got that info and I understand that process. I can put that into a CutRsc but I'm failing to make a dynamic dialog to be called using the above info

little eagle
#

Well, dialog implies buttons to press, something a cutRsc thingy cannot do. You'd need createDialog instead.

#

Do you know how ctrlCreate operates? If so, this is how you create a display you can interact with:

private _display = allDisplays;
createDialog "RscDisplayEmpty";
_display = (allDisplays - _display) select 0;
#

And then just add clickable controls to _display via ctrlCreate. E.g. RscText for displayName, RscPicture for picture, RscButton etc. etc.

dim owl
#

can you add an eventhandler for all displays, which will be open?

little eagle
#

onLoad? Not in vanilla. With CBA you can for most displays.

dim owl
#

Im not using any type of modification

#

any other way?

little eagle
#

No.

waxen cosmos
#

I don't but I have started to work with this area of scripting - that really does help Commy thanks // just clarify I have made a functional GUI - just not dymanically yet ๐Ÿ˜‰

little eagle
#

Good luck, lol!

gray thistle
#

wow i now got to an point where i need a precise number to find the object....
any idea why it still finds it? https://puu.sh/y0vjN.jpg

#

I may think that the object id loses the same precision? Could that be because it is the same nuber and would have the same inaccuracy?

little eagle
#

Do not use these ids to serialize the object. Use BIS_fnc_netId instead.

gray thistle
#

The problem is it changes with every new server start

little eagle
#

Yes, that is how it works.

#

You can't use these stringified object ids anyway, even without restart. They are double internally, but SQF only supports single float. You cannot differentiate between two big ids potentially.

gray thistle
#

Well this... bad if i want to check if an editor object (object with id) is already placed to get the data of my DB instead of create to do a reinitialation

still forum
#

set a variable to every editor placed object

little eagle
#

Or give them a name.

still forum
#

That's what I meant

gray thistle
#

hm can i find an object over a variable in their namespace since i want to keep the normal Variable (Name) Field open

little eagle
#

Why?

gray thistle
#

For mission makers later on :/

#

Thats more a kind of a frame instead of an actual mission

still forum
#

framework*

little eagle
#

Make a script that iterates through all mission placed objects on game start?

#

And give them all names by using BIS_fnc_netId on them.

gray thistle
#

i was not sure if this is the perfect word but yeah at least it seemed to be the right one ๐Ÿ˜„

little eagle
#
//postInit
{
    _x call BIS_fnc_netId;
} forEach vehicles;
#

There. That should be the same every restart as long as you don't edit the mission I guess.

gray thistle
#

Well the edit. Sadly an also important part i put my targets high

austere granite
#

Starts small

#

But i said that before

gray thistle
#

i could probably check for each vehicle if it has the ID and if it has it select it

little eagle
#

Then there's no way to say which object is which. If the mission editor is allowed to move them around, they lose all relation to the previous mission object-

gray thistle
#

this is where the DB comes in handy

#

but well i need the original id ๐Ÿ˜„

#

that was the goal "^^

austere granite
#

in that case you could be create vehicles yourself from the DB information and setting their ID manually

little eagle
#

No, there's no relationship between the objects. Therefore you have no hook for your database to say which object is which.

austere granite
#

not have them in a mission, because then there's no way to know which vehicle belong to which DB entry (if you also allow removing vehicles in the mission)

little eagle
#

Yes. No way to tell, because they are not related.

gray thistle
#

there is an way but only if the floating point inaccuracy would not be there

austere granite
#

... okay

little eagle
#

No, even those ids are "random".

#

They increment after every mission restart.

austere granite
#

They are unique but you can't predict which ID they will have

little eagle
#

Yes.

austere granite
#

Especially if you remove one vehicle and then add another

little eagle
#

They're lost after the mission ends.

still forum
#

@gray thistle use toFixed to turn the number back to string

gray thistle
#

I worked with them many days they did not change

still forum
#

you have more precision than the game shows you

gray thistle
#

also i edited the mission

#

maybe i did not encounter that and yes they autoincrease but only if a new object is placed

#

if you move an edited object the number wil not change

little eagle
#

This is a terrible idea. : P

gray thistle
#

also this is only for the mission start not random this is where i have to say you are right

#

so my _vehs will be created if they are not already gotten from the editor

#

thi is the point where it gets random

little eagle
#

Reminds me of when people used the map ids for objects and then complained after every map update that they were changed.

#

They complained so much that BI removed the ids from 3den or something like that.

gray thistle
#

Not entierly

lone glade
#

it was 2D editor back then

gray thistle
#

but yes map changes can be a problem.

#

this i haven't considered yet

little eagle
#

No, using the ids for things they're not meant to is the problem.

#

Same here.

lone glade
#

I don't know what valid use they have actually

gray thistle
#

how could i make sure that they have their own ids

#

alganthe
Return the object with ID 123456:
_nObject = [0,0,0] nearestObject 123456;

lone glade
#

yeah, no, I said "valid" use

little eagle
#

@lone glade It's all internals shining through. Not meant to be used as API.

austere granite
#

it really was the lazy way to open for example a certain door

#

like if there was a gate somewhere that you wanted to open and you went about it the bad (aka not valid) way then that's what people would use

#

then there would be an arma update and it would break ๐Ÿ˜„

gray thistle
#

Hm i could number the object by X/Y axis there would be the problem i would not be able to change the veh pos

tough abyss
#

Name the object by the Database UniqueID

gray thistle
#

Then i would not have editor compability

#

except i could use that in the editor

#

"Name the object by the Database UniqueID" Also i am doing that already ๐Ÿ˜„

tough abyss
#

Then why bother to number the object by X/Y?

gray thistle
#

Editor compability but this would not help either

tough abyss
#

Editor compability? As in?

gray thistle
#

You can change stuff in the editor and the vehicles would be placed right still if they were moved or changed (ammo dmg destroyed)

tough abyss
#

No clue what you are stuck on to be honest. But i don't use eden editor really
You assign the database unqiue id to the objects via setVariable (when added or loaded from database)
That way if the object is moved / changed you can getVariable to get the database unqiueID and update it in the database.

gray thistle
#

I am not sure if i could do everything over something like ares

#

Btw it's somewhat weird that editor objects don't have their own ID autoincrement diffrenced from the word object id

#

Question can you get some numbers out of the mission SQM itself which you can exactly order to a unit

austere granite
#

no

halcyon crypt
#

anyone got any ideas why the init EH of an unit doesn't fire when createUnited from a dialog?

#

(A3 EH not CBA's XEH)

#

wrapping it with with uiNamespace do {} works

#

still looking for a reason though

#

I'm also guessing that wrapping it in a spawn {} might work

little eagle
#

How did you determine that it doesn't fire?

halcyon crypt
#

well the side effects of the init don't show

little eagle
#

Which are?

halcyon crypt
#

loadout mainly

#

it's generated code btw not written by anyone ^^

little eagle
#

I'm not sure about loadout, but certain commands simply fail at unit init. setVariable public for example does not synch when used inside the unit init. It does work when used in the same frame though.

#

Maybe the same is true for addMPEventHandler.

halcyon crypt
#

it works just fine in the editor and through the debug console, it's just this dialog that's breaking it

little eagle
#

There is no synchronisation in the editor. Dialog?

halcyon crypt
#

trying to troubleshoot some ALiVE ORBAT tool issue

little eagle
#

My guess is that setUnitLoadout doesn't work at init, or there is a race condition with a different loadout script.

halcyon crypt
#

it works just fine in all other cases though

#

that same init

little eagle
#

Now we jumped from unit init to some dialog. I don't see the connection.

halcyon crypt
#

you asked Dialog?, so I gave you the dialog config ^^

little eagle
#

If I run into this problem, I just change init to initPost and it works 99% of the time : P

#

So basically the same as you did.

halcyon crypt
#

that only applies to the actual mission init right?

little eagle
#

initPost is an object init event in XEH

#

Not the mission.

halcyon crypt
#

we don't want a CBA dependency for all the exported group config collection mod thingies :/

little eagle
#

Just keep the spawn then.

#

It's essentially the same for your purpose.

#

Just saying that this issue is known (to me at least).

halcyon crypt
#

I have the feeling we're not on the same page on what the actual problem is but that's probably just me doing a bad job explaining it ๐Ÿ˜

#

thanks anyway

obtuse cosmos
#

Hi, I just came across some kind of double call with function? Anyone know about it and why, etc?

#

Line 27

#

Was just wondering is all ๐Ÿ˜ƒ

robust hollow
#

it uses the return of the first call as the param for the second

obtuse cosmos
#

Oh

#

I see... Thanks.

#

So it's just shorter than something like this: _return = [arguments] call TAG_fnc_something; [_return] call TAG_fnc_blah;

#

If I understood correctly.

ionic orchid
#

@peak plover I figured out my NPC problem - create a unique Group for every unit, set each one to 'enableDynamicSimulation true'
then run a scheduled script to locally hide/unhide the closest ones per-client
that takes care of both the FPS and the network traffic, and lets me keep the 16k view distance

#

not sure how it'll fare with a bunch of players spread around the world, but that's a problem for another time

robust hollow
#

@obtuse cosmos yea thats it

obtuse cosmos
#

Cheers, good to know, learnt something new ๐Ÿ˜‰

peak plover
#

Holy shit @ionic orchid

#

Care to share code?

austere granite
#

Okay so how do i properly do pitchbankyaw without fucking shit up? I wanna get current [pitch, bank, yaw], adjust one of them by X and then set it

#

And have it work

#

Also how do i prevent it from just going up in the sky if I use setPosATL after it (Because that seems completely fucked?

#

@little eagle you like math right? :3

obtuse cosmos
#

Anyone know why this happens:

#

if ((VEHICLE_DAMAGE_PROBABILITY > (ceil (random 100)))) then
{
_vehicle setDamage (VEHICLE_BASE_DAMAGE_MIN + (ceil (random VEHICLE_BASE_DAMAGE_MAX)));
};

#

Those are macros btw (obviously), in my config:

#

// Vehicle damage probability (in percentage %)
vehicleDamageProbability = 60;
// Vehicle base damage amount
vehicleBaseDamageMin = 0.15;
// Vehicle random damage amount
vehicleBaseDamageMax = 0.15;

#

I did a test with hint to see what it is:

#

if ((VEHICLE_DAMAGE_PROBABILITY > (ceil (random 100)))) then
{
_damage = (VEHICLE_BASE_DAMAGE_MIN + (ceil (random VEHICLE_BASE_DAMAGE_MAX)));
_vehicle setDamage _damage;
hintSilent format ["%1", _damage];
};

#

It shows 1.5 ??? lol ???

#

The max it can be is 0.3 - no?

ionic orchid
obtuse cosmos
#

I've confused myself lol

#

Ah

#

Is ceil whole or decimal? Hm

#

Checking

#

Wow.

#

I think I see why.

#

Gonna try removing ceil, not needed

hollow lantern
#

I guess there is no dynamic way to tell a static MG to only cover specific directions? I got a M2HB (M3 AA) located on a Watchtower (https://i.imgur.com/BwD0kaJ.jpg) but for some reason sometimes if a enemy is upfront the M2 Gunner randomly decides to turn himself + the weapon in the opposite direction and either A) he gets killed then or B) the weapon flips and become damaged

obtuse cosmos
#

Fixed! I removed the wrong ceil haha - All good now.

hollow lantern
#

I know that doWatch and doTarget exist but I guess these are not that dynamic and apply only to a certain point hmm?

#

meaning that I would need to manually select a target each time, right?

tough abyss
#

nice share ~ thanks @ionic orchid , have a more perm author link for attribution if i use some bits?

ionic orchid
hollow lantern
#

thanks Quiksilver I will try that

tough abyss
#

@hollow lantern nice tip from kidkillzone at the bottom of the setformdir wiki page too

hollow lantern
#

uh gonna check that out thanks Burnacus

obtuse cosmos
#
// I can do it now!!!
hintSilent "I AM A GENIUS! :P";
#

Took me a while to see I was using the wrong symbol lol ' > `

peak plover
#

Hmm

#

What if when I cache units dynamically I save the variables attached to them via _vars = allVariables _unit;

#

Ohh crap

#

That won't work because there's no way of checking if a varaible should be public

#

And setting public variables for units uncaching is just a bunch of desync

waxen cosmos
#

This is a theorycraft question (to ensure I have an understanding of local/global) - If I have an event handler to happen to all East units within the init.sqf that add's a HoldAddAction - will this addAction be Global to use for everyone? If I then set this addaction to not repeat - would it be single use or would it be a global addaction that everyone could use once?

obtuse cosmos
#

From my CTF project: ```sqf
player addAction ["<t color='#F37C01'>" + (format [(localize "STR_weaponSelection"), objNull]) + "</t>", Haz_fnc_weaponSelection, "", 0, false, false, "", "(_this == _target)"];
// only once in init.sqf (or rather client_init.sqf called from init.sqf) so pretty much the same thing
// They get it everything time, JIP
// the action stays in this case
// (_this == _target) - Only that player can use the action as well as see it

#

The reason why that has format in was because I copied it from something I did use it for, just didn't remove it yet is all.

#

Ah... You mean, say Killed EH with addAction? From init.sqf? You are asking who will see the action? Correct?

#

@waxen cosmos

#

All should see, depending on condition, etc... But I don't think JIP will see it if action was added before they joined. Not by default anyway. Not that specific unit action at least.

quartz coyote
#

@obtuse cosmos what is this you're trying to create ?

#

Have you had a look a our CTF version ? Already running in tournaments and public every week...

#

No need to create anything for CTF lol it's already there ๐Ÿ˜‰

rancid ruin
#

@quartz coyote capture the flag tournaments?

quartz coyote
#

@rancid ruin lol yes haven't you read the SITREP ? We got a shout out for it lol send me a PM I'll give you the information you need

rancid ruin
#

was just curious, i don't really play arma in mp

#

more wondering from a scripting/mission design perspective cos arma still interests me in that aspect

quartz coyote
#

@rancid ruin let's talk in pm so we don't span this Chan lol

little eagle
#

@waxen cosmos What?

still forum
#

And in the end the winners were mods that were already there before. And that would've been made anyway

little eagle
#

I did all this for the closed server milsim.

rancid ruin
#

community MP gamemode good luck getting a whole community to agree on the best way to do something

#

design, scripting, everything...it would take years of work and drama

little eagle
#
Description:
Using setFog with fogParams syntax, e.g 0 setFog [0, 0, 0] on the server will cause a fog sync to all clients.
Using setFog with an integer, e.g 0 setFog 1 will not cause a sync to clients.

lol

austere granite
#

Just play Frontline tbj

#

Totally unbiased obviously

austere granite
#

anyway, big projects have existed since day 1 of arma 3, tacbf was one for example... obviously a lot of it needed serious reworks, however there was always a lot of finger pointiung there

#

everyone saying they want a big pvp mode, everyone saying they could help improve it.....but the amount of people actually helping was extremellllly slim

#

even then, arma pvp is extremely fragmented between private events (that usually run some sort of no-respawn ace), versus more PR like gamemodes...

#

and these there's the competition of games like squad too

waxen jacinth
#

Any ideas how i can hide/delete objects a player is aiming at? hideObjectGlobal cursorObject;``````deleteVehicle cursorObject; doesn't seem to work

simple solstice
#

@waxen jacinth read the wiki!

#

it must be executed on the server

#

SE icon

#

@gusty flume your description is very vague

#

does the server try to load the mission?

still forum
simple solstice
still forum
#

Also I'd suggest stopping to post the same question in multiple channels... People really don't like that

#

Oh

#

Scripts can load stuff?

simple solstice
#

๐Ÿค”

still forum
#

@gusty flume No one will help you if you don't say anything specific about what the actual problem is

#

Uhm..

#

You mean the mission starts just fine and there is 0 issues with the PBO.
But your scripts don't work?

waxen jacinth
#

@simple solstice Cheers. Is it even possible to delete/hide cursorObjects with deleteVehicle or hideObject/Global? Regarding to wiki it only "can be used on all objects with class names"

still forum
#

@h0nkX#7510 "Is it possible to hide Objects with hideObject" What do you think that command does?

lone glade
#

that's a weird note about hideObjectGlobal

still forum
#

If the mission can be loaded then the PBO works. @gusty flume
You made that mission?

waxen jacinth
#

hidingObjects for sure, i'm just confused by that statement "all objects with class names" - some terrainobjects (HIDE) doesn't even have a classname, do they?!

still forum
#

Every object has a class.

simple solstice
#

everything has a classname

still forum
#

except simpleObjects spawned by model path

#

But I think even they can be hidden with hideObject ๐Ÿ˜„

simple solstice
#

What I was doing is hiding the object and then setdamage 1 them

still forum
#

@gusty flume I guess your "just some changes" broke the mission then.

simple solstice
#

And I used nearestobject to select the object

still forum
#

What tool did you use to pack the pbo?

#

is it a mission or a addon pbo?

#

did you fully repack using pbo manager or did you just replace some files?

#

any errors in your or the server RPT?

still forum
#

I would be able to.. Not sure if I want tho

#

Definetly don't want to as I see how you spam your crap everywhere although you've been told that's not liked here

tough abyss
#

Question on the A3 datalink system....Is this turned on by default or do mission makers need to script in true to the following variables:

setVehicleReportOwnPosition
setVehicleReportRemoteTargets
setVehicleReceiveRemoteTargets

#

Please tag me if you know, ty!

hidden field
#

@tough abyss afaik its set by the vehicle config BUT can be changed in editor and via scripts

tough abyss
#

Ty, so if nothing is scripted in, it's on by default?

hidden field
#

depends on the vehicle

#

@tough abyss e.g. some have recieveRemote and reportOwn but not reportRemote; but you can check that via attribute window in editor

tough abyss
#

Rgr, ty!

turbid jolt
#

I think vehicles have it on by default if they have config flags receiveRemoteTargets reportRemoteTargets and reportOwnPosition set to true

astral tendon
#

i have this script
this addEventHandler ["killed",{if (player == (_this select 1)) then {hint "dont shoot civlilians!";};}];

#

i am gonna change to a playsound intead of hint, but i am woried if it may happen that to many sounds will be played at same time

#

like, a guy trow a granade and then 2 civs die and plays 2 sounds at same time

#

that would be anoying, i would like to only play one or one afther another

indigo snow
#

you could track when youve last played a sound, and then only play a new one when its been over (insert amount) seconds

astral tendon
#

thats another thing, i will use selectrandon to chose one of the 3 messages

#

or more

indigo snow
#

thats fine?

little eagle
#

killed eventhandler does only fire on the machine where the object the eventhandler is attached to is local. This will not work in MP.

astral tendon
#

that will work to MP?

cloud thunder
#

aren't all dead units civilian?

astral tendon
#

the sound still plays if the target is a opfour

cloud thunder
#

i have

astral tendon
#

that worked

#

agents?

#

oh, that is to spawn units

#

also, that code does not fire when a opfour kills civilians

#

that is also good.

heavy plover
#

@gusty flume you fixed it?

#

Okay

quartz coyote
#

Hello,

How can I remoteexec a function ?

"ctf_fn_outro" remoteexec ['call', [0,-2] select isDedicated,true]; ?????

#

is this correct ?

little eagle
#

No.

quartz coyote
#

Thanks amaizing help

little eagle
#

Have you read the wiki article of the remoteExec command?

quartz coyote
#

Yes but it is a bit complicated

#

I still need practice and advice

#

that is why I am asking for help

#

I you are not incline to help me annother will I am sure

little eagle
#
Example 6:
    // runs "someFuncWithNoArgs" on each connected client
    remoteExec ["someFuncWithNoArgs"];
#

Can you fill in the blanks here?

quartz coyote
#

remoteexec ["ctf_fn_outro", 'call', [0,-2] select isDedicated,true]; would this be more correct ?

#

of maybe

#

remoteexec ["ctf_fn_outro", [0,-2] select isDedicated,true];

little eagle
#

That looks better, but what's the JIP flag for? Isn't the mission over after the outro? Why would someone else join?

quartz coyote
#

I think
remoteexec ["ctf_fn_outro", [0,-2] select isDedicated,true];
would be more correct no ?

little eagle
#

You re posted the same thing twice if I'm not struck with blindness.

quartz coyote
#

Sorry, I thought I was unclear

#

my original script was
"outro.sqf" remoteexec ['execvm', [0,-2] select isDedicated,true];

little eagle
#

Do you know why you're doing things or are you guessing?

quartz coyote
#

a bit of each.

little eagle
#

[0,-2] select isDedicated is pretty poor design, because while you account for a dedicated server having no interface, the function will still be executed on a headless client. Better to add a hasInterface check at the top of the function.

#

Make the function safe to be executed everywhere.

quartz coyote
#

Oh that sounds good

#

let me write it again

#

waitUntil { hasInterface };
remoteexec ["ctf_fn_outro"];

How does that look ?

little eagle
#

Pretty bad, because hasInterface never changes, so having it in a waitUntil loop is pointless.

#

It either passes first try or is stuck as loop forever checking every frame until the mission ends.

quartz coyote
#

but wait ...
hasinterface : Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client.
My script is executed Server side on a Dedicated server ... how is that going to help me

little eagle
#

I meant to add:

if (!hasInterface) exitWith {};

as first line in ctf_fn_outro, so this function is safe to be executed everywhere and simply does nothing on a machine without interface.

#

And then just use remoteexec ["ctf_fn_outro"]; like you posted.

#

Maybe ctf_fn_outro already is safe, so you don't need to do anything. Idk, I just assumed you do, because you had that isDedicated check.

quartz coyote
#

to be honest the isDedicated check was added by someone else that said it would be good lol I just followed blindly

#

would you have some time to vocal chat so I can explain better ?
Typing is annoying

little eagle
#

It's poor design and I explained why.

#

I have no (working) headset here.

quartz coyote
#

how to you quote script in Discord -_-

little eagle
#

```sqf
code here <<<<
```

quartz coyote
#

blabla

#

ah

#

nice

#

InitServer.sqf :

Sleep (TimeP+30);

// Send End Status to allPlayers
TimeEnd=true;
publicVariable "TimeEnd";

hint parseText format ["Mission over<br/>Final Score : <br/><t color='#0000FF'>BLUE</t> %1<br/><t color='#FF0000'>RED</t> %2<br/><br/>Flag Touch : <br/><t color='#0000FF'>BLUE</t> %3<br/><t color='#FF0000'>RED</t> %4", WScore, EScore, westtouch, easttouch];

remoteexec ["ctf_fn_outro"];```
#

fn_outro.sqf :

scriptName "fn_outro";
// Created By Flash-Ranger - flashrangerarma3@gmail.com (Please respect the time I spent on this system)
// Please do not modify anything in this script without knowing what you are doing.
#define __filename "fn_outro.sqf"

playMusic Music;

waitUntil { !isNull {player} };
Player EnableSimulation False;

["<t color='#FFFFFF' size = '1' shadow='1' align='center' font='PuristaBold'>GAME OVER</t>",-1,-1,8,2,0,3088] spawn bis_fnc_dynamicText;

Sleep 10;

enableRadio false;

#
If (WScore > EScore) then {[format["<t color='#004399' size = '2' shadow='1' align='center' font='PuristaBold'>BLUE</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (EScore > WScore) then {[format["<t color='#7F0000' size = '2' shadow='1' align='center' font='PuristaBold'>RED</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (WScore == EScore and westtouch > easttouch) then {[format["<t color='#004399' size = '2' shadow='1' align='center' font='PuristaBold'>BLUE</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (WScore == EScore and easttouch > westtouch) then {[format["<t color='#7F0000' size = '2' shadow='1' align='center' font='PuristaBold'>RED</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (WScore == EScore and easttouch == westtouch) then {[format["<t color='#FFFFFF' size = '2' shadow='1' align='center' font='PuristaBold'>DRAW Game</t><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
tame portal
#

What is this unformatted aids

quartz coyote
#
_camera="camera" CamCreate [0,0,0];
_camera cameraeffect ["internal", "back"];
_camera CamSetTarget Centre;
_camera CamSetRelPos [30,30,50];
_camera CamCommit 0;

waitUntil { camCommitted _camera; };
sleep 5;

_camera CamSetRelPos [100,100,500];
_camera CamCommit 10;

waitUntil { camCommitted _camera; };

sleep 5;

"end1" call BIS_fnc_endMission;

sleep 5;

_camera cameraEffect ["terminate","back"];
camDestroy _camera;
#

@little eagle does this all seem correct to you ?

little eagle
#

Still needs that

if (!hasInterface) exitWith {};

in outro.sqf like I suggested, otherwise it loops forever for player to not be null on headless machines.

quartz coyote
#

right

little eagle
#
waitUntil { !isNull {player} };

This line is wrong. I think you confused the syntax of isNull with isNil.

#

isNull CODE will just error.

quartz coyote
#

Arrrrghh

#

it was originaly inNil

little eagle
#

That's wrong too, because player will never report nil.

quartz coyote
#

but @still forum told me it was inNull lol

little eagle
#

Well, it's correct syntax, but bogus code.

quartz coyote
#

is*

#

sorry misstyped

little eagle
#

Yes, it is isNull, but not with CODE, but with OBJECT.

#

it should be* is what I mean.

quartz coyote
#

could you explain that last thing ?

#

you lost me

little eagle
#

Okay.

#

player reports an object. The avatar. It reports a null object on headless machines (dedicated server, headless client).

#

OBJECT

#

CODE refers to everything wrapped in curly brackets.

#

{anything} <<< code

quartz coyote
#

Ahhhhhhh

little eagle
#

CODE is a glorified string essentially. Instructions that can be executed but by default are just special strings.

#

Do you know what the problem is now?

quartz coyote
#

Yes !

#

Thaks !

little eagle
#

I can't eagle eye any other obvious mistakes, but I didn't really look at the wall of text one with the format's, because my eyes are tired.

cloud thunder
#

Your mission was featured in a sitrep?

little eagle
#

Who's? Not mine.

quartz coyote
#

@cloud thunder Yes indeed why ?

#

yesterday's one

#

Capture The Flag Gamemode

cloud thunder
#

just wandering if it was you, gonna try it out

quartz coyote
#

Sweet ! Please send me feedback ๐Ÿ˜‰

cloud thunder
#

we have a pvp server

little eagle
#

Oh, I didn't see Music to be defined anywhere. But I assume it's a global variable defined somewhere.

quartz coyote
#

Okay so actually, my original problem was that outro.sqf (wasn't a function before today) and was executed with the remoteexec by a execVM.
Problem was that in outro.sqf... the only thing that was executed was the
"end1" call BIS_fnc_endMission;

#

@little eagle don't bother about Music, i placed that just to cover a big mistake of mine loool

little eagle
#

Well, if Music is undefined, and this runs in >scheduled environment, then it will error and stop executed anything below that.

quartz coyote
#

no, it's playMusic "Music"; lol I just didn't fix my error when I pasted the code

little eagle
#

I see. You're testing me.

quartz coyote
#

Lol no, I'm dumb sometimes ^^

little eagle
#

Me 2.

quartz coyote
#

Right, would you have any idea why the hole script would be forgotten exept for the "end1" call BIS_fnc_endMission;

little eagle
#
scriptName "fn_outro";
// Created By Flash-Ranger - flashrangerarma3@gmail.com (Please respect the time I spent on this system)
// Please do not modify anything in this script without knowing what you are doing.
#define __filename "fn_outro.sqf"

playMusic Music;

waitUntil { !isNull {player} };
Player EnableSimulation False;

["<t color='#FFFFFF' size = '1' shadow='1' align='center' font='PuristaBold'>GAME OVER</t>",-1,-1,8,2,0,3088] spawn bis_fnc_dynamicText;

Sleep 10;

enableRadio false;

This one?

quartz coyote
#

indeed

little eagle
#

Wait, there is no "end1" call BIS_fnc_endMission; in there.

cloud thunder
#

does your mission get around the issue of flag drooping in front of your face?

quartz coyote
#

the script was too long i have to cut it into 3 part

#

look down

#

@cloud thunder Hu... never saw that bug

little eagle
#

Ah. Have you checked the RPT file? There're more undefined things like Centre in there.

cloud thunder
#

intresting

quartz coyote
#

yes Commy, absolutly NO ERROR at all .....

#

@cloud thunder i'm in constent relation with Jakub from the dev team to improove the flag fps but no other error to be seen on my part

little eagle
#

Can you repost with all fixes? Because as of now it errors on like line 2.

quartz coyote
#

Yes sure

#
// Created By Flash-Ranger - flashrangerarma3@gmail.com (Please respect the time I spent on this system)
// Please do not modify anything in this script without knowing what you are doing.
#define __filename "fn_outro.sqf"

if (!hasInterface) exitWith {};

playMusic "Music";

waitUntil { !isNil {player} };
Player EnableSimulation False;

["<t color='#FFFFFF' size = '1' shadow='1' align='center' font='PuristaBold'>GAME OVER</t>",-1,-1,8,2,0,3088] spawn bis_fnc_dynamicText;

Sleep 10;

enableRadio false;```
#
If (EScore > WScore) then {[format["<t color='#7F0000' size = '2' shadow='1' align='center' font='PuristaBold'>RED</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (WScore == EScore and westtouch > easttouch) then {[format["<t color='#004399' size = '2' shadow='1' align='center' font='PuristaBold'>BLUE</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (WScore == EScore and easttouch > westtouch) then {[format["<t color='#7F0000' size = '2' shadow='1' align='center' font='PuristaBold'>RED</t> <t color='#FFFFFF' size = '2'>Team Wins<t/><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
If (WScore == EScore and easttouch == westtouch) then {[format["<t color='#FFFFFF' size = '2' shadow='1' align='center' font='PuristaBold'>DRAW Game</t><br/><t color='#FFFFFF' size = '1'>Blue : Points %1 - Captures %2<br/>Red : Points %3 - Captures %4</t>",(WScore),(westtouch),(EScore),(easttouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
#
_camera="camera" CamCreate [0,0,0];
_camera cameraeffect ["internal", "back"];
_camera CamSetTarget Centre;
_camera CamSetRelPos [30,30,50];
_camera CamCommit 0;

waitUntil { camCommitted _camera; };
sleep 5;

_camera CamSetRelPos [100,100,500];
_camera CamCommit 10;

waitUntil { camCommitted _camera; };

sleep 5;

"end1" call BIS_fnc_endMission;

sleep 5;

_camera cameraEffect ["terminate","back"];
camDestroy _camera;```
dusk sage
#

o.o

quartz coyote
#

@little eagle done

little eagle
#
waitUntil { !isNil {player} };

This does nothing.

#

player is never nil, so this line can just be removed as the code block always reports true.

quartz coyote
#

Right but I need the outro camera to be executed for all players. because there is 1% chance a player dies when Timer hits zero

little eagle
#

So you're waiting for them to respawn?

quartz coyote
#

indeed

#

would a waitUntil { alive player }; be better ?

little eagle
#

You have to use isNull, because isNil will always report false for player, even if player is a <null> object (objNull).

quartz coyote
#

waitUntil { !isNull {player} };
then ?

little eagle
#

I don't think you understand the difference between {player} and player.

quartz coyote
#

No ... at ... all lol

little eagle
#

{player} is never <null> either. It's a piece of CODE.

#

player can be ยด<null>`.

#

{player} is code and never null. I guess it can report null, but isNull cannot execute CODE. isNil can, but not isNull.

still forum
#

@quartz coyote The question is.. Why did you put {} around player ?

little eagle
#

Without executing the CODE, there's no way to get a return value that could be null

#

Dedmen, copy pasted from isNil. Because isNull and isNil have the same name, surely they have the same syntax, right?!.

still forum
#

That would make sense

little eagle
#

Well...

still forum
#

People are often unable to read wiki.

little eagle
#

True.

#

Making too many leaps.

quartz coyote
#

Dedmen I don't know ... so of what I understand :

!isNull player is correct
!isNil {player} is correct

Right ?

little eagle
#

Must be lazyness that get's their guard down. People don't like making mistakes either, but the lazyness seems to be even stronger.

#

!isNil {player} is correct syntax, but has no meaning.

#

It's tautologous to true.

#

Might as well write 1 == 1.

cloud thunder
#

waitUntil {!isNull player};
is what you should use to make sure the player object exists

little eagle
#

Yes.

quartz coyote
#

guys, i'm very far from the scripting world. Understanding the basics of scripting is the key. It's not lazzyness friend, it's about not having the base knowledge.
I'm scripting this shit because no one else would do it. I'm not happy with spending half my fucking nights on scripts ! I doo because if not, our legendary gamemode would DIE
๐Ÿ˜ก ๐Ÿ˜ก

#

CTF

little eagle
#

CTF

#

Damn connection, I was faster.

quartz coyote
#

haha

little eagle
#

-_-

cloud thunder
#

yeah football field size or arena

quartz coyote
#

@tough abyss i'd love to discuss how CTF can be played all sort of ways but i'm here to fix my scripts ๐Ÿ˜‰

#

hahahaha

#

ok lets stop this here ^^

#

@little eagle can we go back to scripts ๐Ÿ˜ƒ

cloud thunder
#

offtopic is not enforced here

little eagle
#

What would a channel be like if offtopic was enforced. ๐Ÿค”

cloud thunder
#

most here would be banned

quartz coyote
#

@little eagle i'll test the script like this and see if it works and report back ! Thanks a lot for your help

little eagle
#

Yes, we infiltrated the moderation...

cloud thunder
#

yeah probably they lead the offtopic charge anyways

#

and use of idiot

little eagle
#

This channel would be boring if it were all on topic.

#

You need a lively discussion once in a while or the channel would be dead as the rest.

cloud thunder
#

still BMR Insurgency , always improving, currently trying to replace IDEs with inhouse script and possible way/interface to imhibit op4 AI for opfor slot like in original A2 version..

#

occational pvp stuff to , mostly just modifying other's missions. Yes play as existing AI.

indigo snow
#

IDAP mission, just cleaning up UXO from fights between AI sides

little eagle
#

Don't add playable units to east for COOP.

indigo snow
#

doing ai vehicle repairs when theyve broken down on the roadside

#

big war going on and the players just going "dont mind me just doing my job"

little eagle
#

That's why you don't zeus remote control in COOP missions.

#

You will always get someone to complain, even if it wasn't the zeus.

#

Just don't do it.

peak plover
#

If you want to jump and frag play Battlefield 2

little eagle
#

COOP and PvP don't mix. Dunno about AI in PvP. Might work if they only guard a base and are stationary.

#

With COOP you can plan to have a 2-6 (lol) hour mission. PvP could be over in 30 minutes.

cloud thunder
#

yes its hard to balance. Insurgency is asymetrical so they don't have all the nice stuff as blufor. no arsenal. very very limited vehicles , kits, no scopes, must scavage weapons from bodys and go back to deployable mhq's crate to save loadout. Theres lobby option to dissable playable opfor and respawn with full loadout if server admin wants it. I anly add 2 playable op4 slots because focus quickly changes for blufor who is in coop mode mostly. Most of the hard core pvp players love the op4 role even as its limited and focus on sabatoging , booby trapping objectives and caches. Op4 players are currently medics by class and engineers by trait.

#

Theres all kinds of roles and special abilites for blu4

#

A week ago our fallujah server ran for a week with no performance loss and over 4000 AI kills, over 50 objectives completed andsome op4 players had come and gone. server auto restarts weekly unless map is finished.

distant egret
#

We do PVP sometimes within our coop public. However only members can be the enemy side with strict rules. Works fine. Also with playercount restriction.

cloud thunder
#

no not by side, thoughit is global lobby option. got a neat code snippet from an old buddy Paxton that hides player objets when a object between their line of sight exists. will probably integrate on next version..

#

yas its not good for pvp. Our pvp server is always 1st person enforced..

#

I've got something similar PVPscene_POV = { // Limit 3rd person view to vehicles only [(_this select 0)] spawn { while {alive (_this select 0)} do { if (cameraView isEqualTo "EXTERNAL" || cameraView isEqualTo "GROUP") then { if (isNull objectParent player) then { player switchCamera "INTERNAL"; }; }; uiSleep 0.1; }; }; };

#

yeah

#

I noticed your InA was about 9.something mb in size is that all code textures or what?

#

how many AI max exist at any time?

#

ok , nice do you integrate any AI behavior modifications?

#

Very nice, I don't find script count in scheduled typically an issue especially if they are mostly sleeping. I do keep mindfull of it though.

#

Notice any degredation in performance over long term?

#

or do you not run mission for days on end?

#

i only notice degredation after total unique players who have come and gone get close to 100 and thats unmodded, but no degredation on our moded server for example that may only have 50 something unique players..

#

thats after a week

little eagle
#

Triggers and waypoints have ruined many missions I played and that since A2.

cloud thunder
#

yes many way points can have impact ive noticed especially in high sequancial numbers. I've not notice significant impact using many triggers that run on server.

devout niche
#

if i wanted to run a hint to the entire west side, would this work? "hello" remoteExec ["hint",west];"

little eagle
#

Yes, Neil.

devout niche
#

Thanks!

cloud thunder
#

i've got both type of medical system as loby option. Usually prefer allow death type and havn't noticed degredation using it allthough its been tweaked alot.

#

There used to be but not anymore thats measurable here.

little eagle
#

Did you delete the ragdolls?

#

I mean with the native respawn.

#

Dead bodies.

#

Ragdolls are really poor for performance. Never checked if that's true for servers too, but for clients if you're just near them and there are enough of them, you notice the fps plummetin.

#

Well, dead bodies stay ragdolls forever.

#

Then not anymore of course.

#

The only other explanation is lots of setVariable public for killed / respawn events.

#

Or generally lots of code in those events.

#

But ragdolls themselves are already really bad.

#

killed?

#

respawn isn't as bad as it never happens to AI.

#

Eh, just with booleans. As long as it's not shitty long arrays as in ace adv medical.

cloud thunder
#

BIS_noCoreConversations must be set again after respawn?

little eagle
#

All variables carry over from the corpse.

#

Well, for soldiers that is. Vehicles completely delete the namespace and don't even trigger init again ...

cloud thunder
#

yeah BIS_noCoreConversations set once on player has worked for me

little eagle
#

Vehicle respawn is one of those abandoned features. At least the SQF command version.

#

Not that I know of.

cloud thunder
#

none that i can remember. I think you have to reconnect after death.

#

strange as copses would be side civilian and terminal should not work for them.

little eagle
#

Post it.

#

Sure, if it's much longer than what Quiksilver just posted, go for pastebin.

cloud thunder
#

maybe benifit to putting all that code into function and call it in EH?

#

nvm

little eagle
#

!(player isKindOf "B_Helipilot_F")

cloud thunder
#

its QS's code so i'll let him chime in

little eagle
#

So the problem is that the pilots are kicked out too?

#

Everyone or just the pilots?

#

Well, the script has 19 opening { and 17 closing }.

#

That can't be right now can it?

still forum
#

Yeah.. Found atleast one missing one

little eagle
#

Why not fix the one he has?

#

/*/ This is a CAS aircraft /*/
Thanks for the eye cancer.

#

I'd say you add the missing closing brackers to your code.

#

just add the missing }
๐Ÿ˜ฆ

#

True.

#

All you had to do was to add two missing } to your original code.

#

Dedmen, reading comprehension

still forum
#

Yeah.. I noticed. But I didn't want to delete my message so I choose to redirect the attention elsewhere

#

๐Ÿช

little eagle
#

aaand you posted in anyway?!

still forum
#

No I already posted it before I noticed

little eagle
#

arrow up, ctrl+a, del, enter

still forum
#

What were we talking about again? My brain is broken today

little eagle
#

We were talking about how you should release TFAR v1.0 already.

#

Tbh, the original is written pretty shitty. Better off starting over, but with knowledge of SQF, that would probably end up worse and take forever.

#

It being twice as long than it has to be is broke in my book.

#

Proven by the fact that it has more { than }.

#

No one can work with this. It will always end up broken if it's written like that. My thinking...

#

"ahoy world"

devout niche
#

if i wanted to have an action remove itself without removing all other actions on the box how would i do so? i have a laptop that adds an action and over time repeatedly adds more of the same exact action, if one was to be clicked, how would i have that one be removed and not the rest?

little eagle
#

Use the condition string of addAction with a global variable instead of removing the action.

devout niche
#

do you think you can give me an example?

little eagle
#

A one time action that disables itself?

devout niche
#

for example, lets say i have intel1, 30 seconds later, a intel1 is once again repeated again and once again added to the laptop

#

i don't want a player repeatedly clicking one of the intel1's, i would like it to simply delete that one action

subtle ore
#

yikes scoobs, hastebin is a super neat tool these days ๐Ÿ˜ƒ

little eagle
#

Like a true professional.

subtle ore
#

/s

little eagle
#

/s /s

#

This is something I should add to my gists I guess.

#

Seems like a common enough question.

subtle ore
#

Yep.

little eagle
#

seatSwitched?

#

And probably twenty from CUP and RHS.

#

Bunch of mediocre A2 ports. ๐Ÿ”ฅ

#

}

#

}

#

This is a great way to do coding.

#

Google the problem, click the first Stackoverflow link, and then copy paste the top answer.

#

The original is decently formatted, so the two missing } that are literally the whole issue are easy to find.

#

Me neither. Don't have it on this machine.

#

Why not ask the game? You don't have to convince us, just it.

subtle ore
#

ewww...where is all the syntax highlighting at?

little eagle
#

/*/ This is a CAS aircraft /*/
This deserves a ban imo.

subtle ore
#

Don't worry about it

#

it's just commy and his german origin

little eagle
#

You managed to make the closing and the opening comment thingies look the same.

cloud thunder
#

not ass efficient as using event handlers but could use something like AllowedPilotTypes=["B_Helipilot_F"]; if ((count AllowedPilotTypes) != 0) then { [] spawn { if ((typeOf player) in AllowedPilotTypes) exitWith {}; private "_veh"; while {true} do { if (vehicle player != player) then { _veh = vehicle player; if ((_veh isKindOf "Plane") || {((_veh isKindOf "Helicopter") && !(_veh isKindOf "ParachuteBase"))}) then { if (driver _veh == player) then { if (isEngineOn _veh) then {_veh engineOn false}; player action ["GetOut", _veh]; hintSilent "Restricted to Pilots"; }; }; }; sleep 1; }; }; };

subtle ore
#

it's okay, ass effeciency is not bad Jigsor.

cloud thunder
#

but code is simpler and since it loops it will always check for driver and work with any aircraft.

little eagle
#

It's not a one liner yet though.

cloud thunder
#

give us the one liner @little eagle

little eagle
#

I don't even have SQF in my editor installed on this machine.

#

I wish that thing was stackable and could remove actions.

#

Unusable for mods.

#

Loved when you could inject code with it on any server.

#

You reported it? You made me look 30 minutes for another way to do the same.

#

Probably still some way to compileFinal some ui functions.

#

How is the mission namespace vulnerable? It gets reset at the start, no way to move something there.

#

Happens when you have AI as squad leader.

lone glade
#

you troll

little eagle
#

Who?

lone glade
#

quick

little eagle
#

But how you'd exploit mission namespace functions not final'd? You have to execute code overwriting them in the first place.

#

And you can only do that with other means. Like via ui namespace.

#

There's no point in fighting it anyway. You can google memory editors and find them on page 1.

cloud thunder
#

pretty sure you could "inject" code with BIS_fnc_addStackedEventHandler or at least carry code over with you to the server you join.

little eagle
#

Probably at some point.

#

Or just have fun adding some controls to certain displays that carry over through all menues.

cloud thunder
#

code here still runs in memory even if not in mission

little eagle
#

addMissionEventHandler

cloud thunder
#

BIS_fnc_addStackedEventHandler oneachFrame for example

little eagle
#

I don't think you can overwrite any variables with this. Maybe I'm overlooking something.

cloud thunder
#

i will not disclose hack methods in public

#

lol

little eagle
#

SQF dick measuring contest. Who has the secretest hacks.

cloud thunder
#

in volume girth or length?

little eagle
#

Yes.

cloud thunder
#

lets see yours first

little eagle
austere granite
#

create a trigger covering the entire map, do a check with getPlayerUID on thislist and see if it matches your own player

#

and that's your player object

peak plover
#

๐Ÿ˜‚

little eagle
#

Not bad, Adanteh.

cloud thunder
#

so (player in player) is pinnicle eye?

little eagle
#

No, but:

player in entities typeOf player

is.

lone glade
#

now add isEqualType in there

cloud thunder
#

will always be true

little eagle
#

False.

#

Well, it will be false when you're inside a vehicle.

cloud thunder
#

true

#

so why does player in player work if player is not array?

little eagle
#

You're clearly not there yet.

cloud thunder
#

wrong answer

little eagle
#

Alternative syntax OBJECT in OBJECT

#

Reports true when rhs is the vehicle of lhs.

#

Which also works on foot.

#

It's the same as 1.) essentially, but somehow never caught on in the eternal copy pasting.

cloud thunder
#

was unaware syntax was updated to support alternative

little eagle
#

"updated". It's as old as in.

cloud thunder
#

Arma 3 1.26: I swear sometimes BIS make changes and many do not get posted in spotrep

#

in is from 2007 or older

little eagle
#

OBJECT in OBJECT is in A2.

cloud thunder
#

oh right, wonder in what case SilentSpike comment holds true

little eagle
#

Reports true when rhs is the vehicle of lhs.

cloud thunder
#

well since this is documented its not really secret

little eagle
#

Secret?

#

The image is just to remind you that if you understand level 3 and 4, you wasted too much of your life on SQF/Arma scriptin.

cloud thunder
#

well it was your challenge

tough abyss
#

@gusty flume there a bazzillion out there. Try digging though this list http://lmgtfy.com/?q=site%3Aarmaholic.com+dynamic+loadouts+script

A lot of stuff you find may be out of date but will get you on the right path (use the wiki and make sure functions arent depriciated etc, enable displaying script errors, read your rpt log if your crashing)... if you do decide to get your hands into scripting.

indigo snow
#

its been a while but do the actions work for empty vehicles? (I'm assuming your heli lights are the static searchlight turrets. Try player action["lightOn",this] in the init box of one.

indigo snow
#

i wasnt aware you could even turn those off

#

dont they start on?

#

switchLight might work

indigo snow
#

GOOD LUCK

little eagle
#

Dark sure has a problem with his capslock key. Even the name is all caps.

indigo snow
#

It adds an element of stress to it. I imagine this is critical to an ongoing situation

#

He only has time to check back in here when the fight with those lamps calms down for a few seconds

simple solstice
#

player in player is faster than isnull objectparent player?

robust hollow
#

dont know if itl work for what ur trying it on

tough abyss
#

Wow, cases can be an array? Cool.

little eagle
#

๐Ÿ’ผ Cases?

cedar kindle
#

@simple solstice thereโ€™s a microsecond diff, objectParent being faster

#

but it had an issue when the object is attached, @little eagle ?

little eagle
#

Yes. You're also taking this way to seriously.

#

Please don't actually use this code. The point af that macro is that the answers become ridiculous towards the end.

timber ridge
#

guys, I remember we had a discussion on why would SQF require prefixing a private var with an underscore while it should just properly use the private keyword without requiring any hacks for the actual var name.
and I guess @still forum mentioned that internally the lookup for private vars is much faster when they're prefixed with an underscore.

#

but... isn't that what the private keyword is for in the first place?? I mean... for lookup purposes, private keyword should automatically prefix a var name with some agreed symbol that'll be used later for search... that's my 2ct

tame portal
#

@timber ridge private is used to make sure you don't overwrite local variables by accident when your code is called for example

#

I mean private could do that automatically internally, but I think that would just overall make it inconsistent since they can still be declared with an underscore

little eagle
#

You equate local variables with "private variables". "private variables" don't exist in SQF. private is a command and keyword used to set the current scope as the home scope of a local variable.

#

Well that's not true. You can ruin FPS and achieve nothing by badly designed code.

#

You too missed the point of the image then.

#

No one / nothing else brought up objectParent.

#

Reading a conversation from the beginning is a virtue.

#

'poorly optimized'
Where's that quote from?

#

Yes and you used quote marks as if you're quoting someone.

#

This effect could make people think you're misquoting someone and arguing against things they haven't said which would make you come off as dishonest.

#

No point in having a conversation with someone dishonest.

cunning nebula
#

really depends where and what you optimize

#

if you have loops that have to be run for a lot of units, it is well worth it.

little eagle
#

But that's wrong.

cunning nebula
#

especially when those loop contain parts that get synced in mp

little eagle
#

These so called "edge cases" are omnipresent.

cunning nebula
#

that shit can quickly get nasty if not written well

little eagle
#

No point in replacing count with forEach though.

#

It was functional before too.

cunning nebula
#

so arma is not badly optimized

#

its not functional ?

#

๐Ÿ˜‰

little eagle
#

It's barely functional due to being poorly optimized?

#

I don't follow.

cunning nebula
#

me neither

little eagle
#

Yes, that is what I said.

cunning nebula
#

hmm

#

what I meant was that badly written, overused loops can cause desync and other problems in mp

#

that doesnt mean theyre not functional

little eagle
#

That's circular.

#

Anything that tanks fps would be "too crazy" by this arbitrary standard.

cedar kindle
#

uh stop quoting me i just answered him
obv the orig image is meant as a joke

little eagle
#

Thanks. I thought it was a widespread enough meme on the interwebs.

#

You haven't unlocked level 4 then.

#

It's weird to me that you project something about performance on this image when it's nowhere implied to be about that.

#

Yes, that is what the conversation is about.

#

You're obsessed with something about performance to the point that you have to inject it into random conversations.

#

That's not healthy.

timber ridge
#

why can't we just ask one of the BIS scripting gurus here about SQF performance? ;DD

little eagle
#

Seems like you were triggered tho tbqhfamalam

timber ridge
#

just tag the guru and we're done

#

done without answers lol

cedar kindle
#

why?

little eagle
#

Yes, you got triggered by this so much that you had to chime in without even reading what it was about.

cedar kindle
#

well you started qs

timber ridge
#

lol you guys are going nowhere with this

#

maybe just stop while it's due

little eagle
#

Never.

timber ridge
#

i admire your honesty, hell, i like you, you could come over my house and f**k my sister

little eagle
#

OK

timber ridge
#

i sincerely hope people got the Full metal jacket ref

#

so i'm not 110% misunderstood

little eagle
#

No, never watched that.

timber ridge
little eagle
#

ZZZZ

#

Guy seems very unlikeable. I might've missed a bullet in his direction at some point.

tough abyss
#

@little eagle ```SQF
switch [_source, _priority] do {
case ["client","server"];
case ["mission","server"]: {
_ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
_ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_server_tooltip);
};
};

little eagle
#

Yes?

little eagle
#

...

still forum
#

@Inlesco#5178 "internally the lookup for private vars is much faster when they're prefixed with an underscore"
Uhm... Yes... But also if they are not prefixed with an underscore they are not private variables.. so that sentence makes no sense at all...
privatized local variables are faster to lookup than non private ones if your scope level is >1
@cuel#9704 "thereโ€™s a microsecond diff, objectParent being faster"
Did you know that calling ANY binary command takes about 1.6 microseconds? That's the time spent to just reach the internal engine function.
So if you have a binary command that does literally nothing. It will still take 1.6microseconds.

#

Great Discord.. Just great.

#

@cedar kindle

#

@timber ridge

#

Ah.. Now.. yes.. Makes sense

timber ridge
#

@still forum i was only implying that, if SQF had a somewhat reasonable design, prefixing a private var with private keyword already defined to it, would not be required as the syntax interpreter, if needed, should be able to detect usage of private and prefix the var name internally as it's needed for lookups.

#

unless I'm not aware of smth else, forgive my ignorance lol

still forum
#

Listen... SQF has two ... two types of variable tables.
The global one. and local one. Each scope has a table of local variables.
If you are saying "just get rid of the _"
How would it know that a variable is local? Ah yes! It would first search through all local variable tables in all scopes (which might be dozens) and if you don't find it search through the huuuge global table.

#

If you add the _ prefix though the engine knows exactly where to look for it

#

and if it's not there it can abort directly

#

And what happens if you do

myVar = 6;
private myVar = 5;

?

#

Two variables that are completly different besides the name.. How would you differentiate?

lone glade
#

generic error in expression ๐Ÿ˜„

little eagle
#

private makes no sense for global variables and therefore errors.

still forum
#

Yes. One is private. But if one uses myVar.. How would you know that guy wanted the private or the global one?

timber ridge
#

ok, seems reasonable I guess, i'm not much of a seasoned SQF user lol...
but why do you need private for _localVar then ?

still forum
#

@little eagle You didn't follow the conversion

lone glade
#

pushing the var to the innermost scopes

still forum
#

You have the exact same thing in C/C++ and other languages

#
_var = 5;
call {_var = 6;}
_var is 6 now... But the function you called didn't intent to modify any variables outside of it.
timber ridge
#

ok, so in this case private prevents any mod of a var outside of its scope?

still forum
#

yes

lone glade
#

yep

little eagle
#

but why the fuck do you need private for _localVar then ?
To set the home scope of the variable, so the game doesn't have to loop through all other scopes in the current script instance to check where to write the variable.

lone glade
#

it's also the biggest pain in the ass to realize ๐Ÿ˜„

#

"why is X acting this way" turns out you used the same var not privatized 5 scopes above.

still forum
#

And.. Because each scope has it's local variable table.
If you private a variable it will be present in the first table the engine checks.
otherwise if you just do _var = 5 The engine would have to check all scopes above you to see if the variable already exists and it has to overwrite it

timber ridge
#

I guess a proper SQF IDE should be able to detect this and mark it for you ๐Ÿ˜„

still forum
#

Which they do..

#

Well.. Arma Studio somewhat

lone glade
#

just privatize all local vars

still forum
#

There is no negative thing to privatizing variables.
Your scripts run faster. And you don't break stuff you don't know about

little eagle
#

... It makes it easier to read, because you immediately see where the variables come from with proper syntax highlighting.

still forum
#

you can also tell your IED to hide the _ from you :d

queen cargo
#

ArmA.Studio yet lacks a proper AST generator which is why no deeper analysis is done beyond plain syntax checking

#

for now i am busy with SQF-VM so that it does not relies on the game itself

#

but as ppl do not rly contribute as much as i hoped, ArmA.Studio is pretty much on hold due to that right now ... can only always focus on a single project

modern snow
#

do you guys know, how I call the clock in-game?

queen cargo
#

the clock?

#

time ?

modern snow
#

ye

lone glade
#

a watch

modern snow
#

I wanna make a phone. I want to show what time it is

#

sorry for my english ๐Ÿ˜„

still forum
#

date

modern snow
still forum
#

yes

modern snow
#

what is the difference if I wanna see the clock?

still forum
#

ยฏ_(ใƒ„)_/ยฏ

#

Just use whatever you want

timber ridge
#

you can also tell your IED to hide the _ from you :d
IED... no wonder this is a military game's scripting channel :d

#

and in this context, I'll assume _ means it's below surface level lol

#

@modern snow date is a better choice in your situation if you want to display HH:MM format only, it'd make for some cleaner code.

tame portal
#

I suggest from now on every single code snippet posted has to have a ms runtime posted with it ๐Ÿ˜‚

#

Performance is still the number one discussion topic here ^^

still forum
#
game_value nothing(game_value, game_value) {
    return nil;
}

0.0016ms

#

Does literally nothing.. Still takes 0.0016ms

queen cargo
#

@tame portal there is a semi-relevant relation that can be seen using SQF-VMs instruction count as that is more or less equal to SQFs

#

aka: when SQF-VM has low instruction count, you also will have less instructions in SQF
or more precise: SQF-VM gives you a proper number instead of just theoretical O(N) algorithm

still forum
#

@queen cargo Do your command calls also take 1.6 microseconds before it get's to the actual function that's being called?

#

My debugger... Hell even... Wait.....

austere granite
#

salt.png

still forum
#

Anyone interested in a instructionCount CODE command? That returns the number of instructions in a piece of code?

tame portal
#

@still forum Yes

still forum
#

For testing I made 3 script commands that do absolutly nothing
nothingN 0.0008ms
nothing 1 0.0008ms
1 nothing 1 0.0009ms
@little eagle The difference between unary and binary is not really there. These still pass the arguments to the engine function. But the engine function returns nil immediatly

Each one of these is between 0.0008-0.0011ms

queen cargo
#

not sure if it also has that delay @still forum
one would have to test (or actually create a performance test function call ๐Ÿ˜„)

still forum
#

I don't think your VM is as dumb as SQF

#

although it is SQF... mh ๐Ÿค”

queen cargo
#

only one way to test
anybody can give me the code for the bis_fnc_perf thingy?

still forum
#

diag_codePerformance

queen cargo
#

y .... the old function based one

#

not yet have such a command implemented :3

still forum
#

The old one? I doubt anyone is still running that old version

queen cargo
#

will have to if i want to test right now ... got some linking problem

still forum
#

Here is the current code

//--- allow function to be spawned
if (canSuspend) then {disableSerialization};

params [
    ["_testCode", "", [""]],
    ["_params", []],
    ["_wantedCycles", 10000, [0]],
    ["_display", [] call BIS_fnc_displayMission, [displayNull]]
];

diag_codePerformance [compile _testCode, _params, _wantedCycles] params ["_result", "_actualCycles"];
#

instructionCount doesn't work like I expected ๐Ÿ˜„

queen cargo
#

๐Ÿคฃ

still forum
#

Well... Actually that is like I expected it. .But i hoped I was wrong

#

Idea scratched I guess... Probably too much work

queen cargo
#

SQF-VM can take over that need ๐Ÿ˜„

cunning nebula
#

sqf-vm even has / had a player now ๐Ÿ˜ƒ

queen cargo
#

not rly
only a variable

cunning nebula
#

not sure if it has respawn ^^

#

i just launched him into oblivion

queen cargo
#

probably will give it a proper command at some point

tough abyss
#

@little eagle - well today I learned you can do that, it's not on the wiki.

still forum
#

@tough abyss passing arrays?

tough abyss
#

Using them in case.

still forum
#

That is on wiki

#
Syntax: case b 
Parameters: b: Anything

An Array is Anything. A object is too. And a string or a number.

tough abyss
#

Oh ๐Ÿคฆ

pliant shell
#

what command should i use to forcibly move one unit from one turret to another when said unit is already inside the vehicle?

#

if i use action "MoveToTurret" it only works when the unit is the commander of the vehicle

#

tried moveInTurret too but it only works when the unit is outside the vehicle

still forum
queen cargo
#

why is the upper 14 and not 7 Oo

pliant shell
#

he just said it ๐Ÿ˜›

queen cargo
#

but the lower is not matching

#

thats why i ask

#

cannot be the semicolon

#

unless the last one gets cut off

#

and the upper also would not match count with semicolons in mind

still forum
#

the last semicolon is added by the compiler

#

Adding it doesn't change the instruction count

queen cargo
#

second one then does not solves correctly

still forum
#

why?

#

does not solve correctly*

#

if, true, then, code, semicolon

#

that's 5

queen cargo
#

so it does not checks deep?

still forum
#

so it does not check depth*

#

no

queen cargo
#

then it is kinda useless ๐Ÿ™ˆ

still forum
#

That last one is a constant containing a variable

small iron
#

Is there a function to add those big X's on ORBAT groups?

little eagle
#

Not surprised that it doesn't count the instructions inside a CODE block. Those are essentially strings. This is from intercept, right? Still don't get why it adds another virtual semi colon though.

#

Just out of curiosity. What happens if you replace all ; with , ?

icy raft
#

A while ago I asked here if select passed by reference or value... Was told it was value. Seems like it doesn't. Someone wasted my time. ๐Ÿ˜ข I feel hurt

little eagle
#

Who told you that?

icy raft
#

I don't remember

#

๐Ÿ˜ฆ

little eagle
#

I can believe no one disagreed with anyone saying it. Maybe you misheard.

dusk sage
#

Could you elaborate @icy raft ?

sour saffron
#

search select reference top right

#

it will remind you who said what

icy raft
#

I did literally ask "Does select pass by value or by reference?". Got that answer

#

They started arguing that it did pass by value, and for getting a reference you would have to make use of count and extract the value from _x inside the count condition

#

Did some test and in fact select does pass as reference

dusk sage
#

As in, Does select pass by value or by reference?, do you mean for example, an array in arr select x?

icy raft
#

Yes

dusk sage
#

Yes then

icy raft
#

Did the following tests with the same result, changing the refered value

#
this_is_an_array = [
    [1, "This is data"],
    [2, "not is data"],
    [3, "wherever are you"]
];

reference = [];

//Here we extract the array at index 1
_counter = 0;
{
    if(_counter == 1) exitWith {
        reference = _x;
    };
    _counter = _counter + 1;
} count this_is_an_array;

_outstr = "";

_outstr = _outstr + "REF:" + (str reference);
_outstr = _outstr + "\nARR: " + (str this_is_an_array);

//Here we modify it
[reference] call BIS_fnc_arrayShift;
[reference, "MODIFIED"] call BIS_fnc_arrayUnShift;

_outstr = _outstr + "\nMOD: " + (str this_is_an_array);

//Modified value shows up
hint str _outstr;
#
this_is_an_array = [
    [1, "This is data"],
    [2, "not is data"],
    [3, "wherever are you"]
];

//Just a select this time
reference = this_is_an_array select 1;

_outstr = "";

_outstr = _outstr + "REF:" + (str reference);
_outstr = _outstr + "\nARR: " + (str this_is_an_array);

//Here we modify it
reference set [0, "MODIFIED"];

_outstr = _outstr + "\nMOD: " + (str this_is_an_array);

//Show the modified value
hint str _outstr;
dusk sage
#

If the element you're changing is an array, yep

#

Effectively:

#
arr select x
->

SQFArray &arr = LHS; //left hand side
return arr[x]
#

I'd imagine

icy raft
#

Hmm... Some times I just whish I could run intercept without BE crying... (clientside)

dusk sage
#

I think they whitelisted an earlier version Dedmen was using ๐Ÿ˜„

icy raft
#

Did they? Which one?

#

It'd be awesome to be able to do some RPC calls clientside

#

One thing I've been trying is to connect to a NodeJS server from the client and run request from there

dusk sage
#

Nvm looking back it seems they whitelisted his engine hook (for the IDE thing)

quartz coyote
#

Hello it's the dummy again !
I need someone to explain Varialbles and publicVariables to me. I do not manage to handle the Wiki explainations...

QUESTION 1
I have a var

WScore=0;

most I put a

player setVariable ["WScore", 0, true];

for it to be known by all players in MP game ? And if not why ?

dusk sage
#

There was a nodeJS RPC somewhere

icy raft
#

Yeah, it was for local server as it was blocking, he didn't implement any async functionality like extDB3

dusk sage
#

WScore is global to the client (not public), in the missionNamespace (presumably). It is not a variable on the player object, like player setVariable would be.

player setVariable ["WScore", 0, true];

Would be public, and known to all clients (on the object)

icy raft
#

@quartz coyote global variables are stored locally and you can access them at any point in the local machine.
Doing a publicVariable "variableName" would propagate the value through all the clients (with the correspoding traffic (lag if overused) )

Doing myVariable = 1 would set the value 1 to myVariable only in the machine it was executed.
But calling publicVariable "myVariable" would set the value myVariable as 1 in every machine (after a delay because of internet delay)

dusk sage
#

Not the best thing to do when everyone has different scores (I imagine)

little eagle
#

I now get what you mean. select CODE does indeed create a new array, but select NUMBER just picks an element.

quartz coyote
#

my score var is initialised on the InitServer.sqf
I has to be the same to all players at all time even to JIP players

dusk sage
#

Ah.

#

So you will want to publicVariable that from the server then, when it changes

quartz coyote
#

yes I understand that @BoGuu#1044 but do I have to do it just after initing it ?

#

I guess yes

#

but i'm not sure

icy raft
#

You have to do it every time you change the value of the variable

#

As every time you do publicVariable it gets the value of the variable and send it to everyone. But only the value it has at that moment.

dusk sage
#

If it needs to be defined on the clients (to 0) initially, yes @quartz coyote

quartz coyote
#

Okay nice

icy raft
#

@little eagle I'll look into it in more detail. I'm currently just looking through BIS code to try to understand some quirks of SQF

quartz coyote
#

and what is the proper way of doing it ?

player setVariable ["WScore", 0, true];

Or

WScore=0;
publicVariable "WScore";
icy raft
#

Second one

dusk sage
#

Or,

missionNamespace setVariable ["WScore", 0, true]
quartz coyote
#

missionNamespace = Returns the global namespace attached to mission.
I don't understand what is that ...

little eagle
#

Akryllax, don't try to think of them as references. It only applies to arrays in SQF, nothing else. Think of that as objects/containers. Most commands about arrays copy them / create new arrays that can then be stored in a variable with potentially the same identifier. Only a few edit existing arrays, set, sort, pushBack(Unique), append.
select NUMBER itself just picks an element from an array. And if that element is itself an array, it's not copied.

icy raft
quartz coyote
#

I will right now

little eagle
#

Local in local variable refers to the variable being only available in the current script instance ...*
Global in global variable refers to the variable being available in every script instance on the local machine.
A public global variable is a global variable available on all machines.

icy raft
#

commy2, that just perfect ๐Ÿ˜„ . I usually work with subarrays to store data so it's incredibly usefull. I used to think that select did in fact copy everything and kinda annoyed me.

dusk sage
#

Well it's key to consider array references, otherwise this wouldn't make sense
And if that element is itself an array, it's not copied.

#

Because naturally we work by value

icy raft
#

And I just found a few BIS_fnc's that work with key pairs so its just perfect

little eagle
#

Maybe you're right. It's not how I got myself to understand this though.

dusk sage
#

I used to think that select did in fact copy everything and kinda annoyed me.
Copy what though ๐Ÿค” ?

icy raft
#

Create a new array

quartz coyote
#

@little eagle awesome i like that perspective !

little eagle
#

Saying that select copies the array isn't wrong though. It's just that there are multiple commands named select that do different things.

#

So it's a mixup most likely. Misunderstanding.

icy raft
#

Yeah

#

Now everything is clear hahaha

little eagle
#

๐Ÿ‘

dusk sage
#

Create a new array in the case that you select an array, from an array, that is?

astral tendon
#

there is a ending that shows ups "Your side lost" when you run out of tickets to spawn, how can i change that?
Also the addMissionEventHandler ["Ended",{hint "check" }]; does not fire with that

little eagle
#

select CODE creates a new array filled with the elements the code block returned true for.

#

The LHS array has nothing to do with the return value array aside from containing some of the same elements.

#

The array itself is new or "a copy". Strictly only + ARRAY copies it, as in makes an equal duplicate.

astral tendon
#

actually, that "Ended" MissionEventHandler does not fire by anyting

dusk sage
#

Do you mean ARRAY select CODE @little eagle ?

little eagle
#

Yes, sorry.

dusk sage
#

Ah

little eagle
#

select ARRAY also copies the array for that matter.

dusk sage
#

If the new array contains arrays, they'll be references to the original array, still

little eagle
#

Yes.

#

The elements remain untouched.

dusk sage
#

But are not copied, more importantly

little eagle
#

The only deep copy command that I know of is + ARRAY.

#

It copies even the sub arrays for some reason.

dusk sage
#

Yep, it recursively duplicates

little eagle
#

[] + ARRAY doesn't deep copy. It's so weird.

dusk sage
#

Yeah, explicit case for +ARRAY

little eagle
#

I still haven't put that detail on the wiki.

icy raft
#

SQF is not consistent at all man...

little eagle
#

CAManBase*

astral tendon
#

were i can find a list of all icons in arma 3? like
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_ca.paa";

robust hollow
#

open that folder and look?

astral tendon
#

what folder? there is no A3 folder

austere granite
#

unpack UI pbo

#

(or all of it if you're feeling happy)

astral tendon
#

PBO manager is not verry happy with huge files

austere granite
#

that's why you get mikero tools

#

Or... do you have Arma 3 tools installed?

astral tendon
#

plus, is not inside ui_f.pbo

austere granite
#

`sure, it's in ui_data_f

#

anyway, with arma 3 tools there's an option to unpack all files

#

that'll just export all PAAs

#

there is no list of all icons

#

if you unpack them, they'll be in a folder \a3\ui_f\data etc etc etc

#

then you can browse through it

astral tendon
#

seems like that gona take some time.

austere granite
#

yes

jovial nebula
indigo snow
#

you cant refer to the wheel of an object

#

you can refer to an object that is a wheel

#

also make sure not to refer to the image for the meaning of counter clockwise rotation

#

or maybe wonder what kind of clock they use over in czechia

jovial nebula
#

Cool

rugged gorge
#

Hey guys, ima kinda new to scripting but if anyone would be able to point me in the direction of where i could find some script that adds a flame and smoke to a moving helicopter after it passes through a trigger, thanks...

candid jay
#

_heli setDamage 0.7

#

unless you want it to irrealistically have flames and smoke but be miraculously undamaged

#

in which case you need to attach a particle generator to it

rugged gorge
#

thanks

hollow bay
#

Hey
Can anyone tell me why
if (side player == west) then {car1 addAction ["Impound Vehicle", {deleteVehicle car1}];};
isnt deleting the vehicle?

little eagle
#

Does the car have the action?

#

@hollow bay ^

hollow bay
#

Yes

#

Sorry no.

#

@little eagle With if (side player == west) it doesnt show the action. But without, it does.

#

I also would like it to do it for all vehicle dynmaically.

subtle ore
#

๐Ÿคฆ

little eagle
#

These init boxes are probably executed before your client has an avatar. player is null and side objNull is sideUnknown not west.

subtle ore
#

There is also, you know. A conidition param for addAction ๐Ÿ™„

hollow bay
#

ah

#

So how do I fix that?

little eagle
#

Eh, try playerSide instead of side player.