#arma3_scripting

1 messages ยท Page 445 of 1

knotty mantle
#

Not sure if default is delete or stay

still forum
#

@lone glade Which is exactly what I said

lone glade
#

well...... DERP

errant jasper
#

@warm gorge As already mentioned, any trigger can easily, and more flexibly, be done using spawn with waiting/sleeping and condition checking. However, triggers run their code unscheduled, so if you need that be sure to wrap the corresponding parts in isNil.

still forum
#

triggers only run the condition in unscheduled

little eagle
#

I know that user actions run condition unscheduled and statement scheduled, but I have no idea if this is the same for triggers actually.

still forum
#

I think I saw somewhere people creating triggers via script so that they can get their code to execute unscheduled

#

Ofcourse we use isNil for that because we have brains...

lone glade
#

OF COURSE

#

NOT OF CAUSE

little eagle
#

offcause

lone glade
#

triggering intensifies

still forum
#

I don't know what you mean

lone glade
#

and add a space

little eagle
#

alganthe went off course.

lone glade
#

I will make you write of course instead of ofcause or ofcourse ded, I will

little eagle
#

Is this your *than or what?

lone glade
#

yes

still forum
#

if you do that than it is bigger then other things

lone glade
#

it's more triggering then the white flag jokes.
and even than, that's kinda fine

#

huehuehuehue

little eagle
#

Did you feel how much writing like this hurt youselves?

lone glade
#

yes

still forum
#

definetly yeah ๐Ÿ˜•

lone glade
#

I felt pain on a metaphysical level, I have regressed as a being

little eagle
#

See? And my superior empathy makes me call you all out every time.

still forum
#

if (getDammage player) than {getDammage leader group player)

lone glade
#

ded, if I had support for saving backpack vars for loadouts, should I add support for other varspaces like vest / uniform?

still forum
#

I think so yeah

lone glade
#

:/

still forum
#

Never seen anyone use these. But I guess they could be useful

#

you could ofcause just argue Never seen anyone use these. And because of that I think they aren't useful

lone glade
#

know what, i'll just add backpack first then add the rest if needed

modest temple
#
while (alive _this) do {timer = timer - 1; sleep 1;};

this is apprently missing a ; but i dont see it

little eagle
#

while CODE do CODE

lone glade
#

I think I puked a bit in my mouth

little eagle
#

alive _this is BOOLEAN, not CODE

still forum
#

Why do you scream these DATATYPES SO LOUDLY

modest temple
#

meaning?

lone glade
#

good point

still forum
#

I didn't see that error even. Maybe because I don't use while ^^

#

You need to use {} instead of ()

little eagle
#

It means while needs a CODE block.

errant jasper
#

Reliable way to detect unscheduled environment?

lone glade
#

ooooh fuuuuuuuuck ded you made me remember something

little eagle
#

canSuspend

still forum
#

@errant jasper canSuspend

errant jasper
#

canSuspend is false for on act of trigger

still forum
#

and condition too?

lone glade
#

maybe that number not being equal to itself but being a number still was because it was a different datatype

still forum
#

there is only one number datatype

#

Well... Except NaN

little eagle
#

There's two.

#

yep

still forum
#

But NaN doesn't store a value

little eagle
#

๐Ÿ˜›

still forum
#

so it cannot be a 8

little eagle
#

Booleans are just retarded numbers.

lone glade
#

never forget:
#define true 1

little eagle
#

NaN sometimes gets serialized in different ways, so I guess that is kind of a value, even though comparison with == as well as isEqualTo always reports true for some reason.

errant jasper
#

canSuspend is false for condition too

modest temple
#

now ```sqf
while {timer = 0} do {

is giving me an error
errant jasper
#

while requires the condition returns a boolean. You perform an assignment '='.

#

Probably meant to write ==

modest temple
#
while {alive _this} do {timer = timer - 1; sleep 1;};

changed () to {}, still missing a ;

still forum
#

maybe the ; is above or below that?

modest temple
#

(this is to a question couple messages above, not the 1 right above

lone glade
#

what's the RPT entry?

little eagle
#

^

modest temple
#

RPT entry? the black error box ingame?

lone glade
#

no, the error that is logged

little eagle
#

%LOCALAPPDATA%\Arma 3

errant jasper
#

Wait, what! We have LOCALAPPDATA now? My days of writing "%appdata%\..\Arma 3" are over

#

though I do have to type two extra letters. Hmmm.....

little eagle
#

This has been a thing for like 20 years dude.

modest temple
#

wich one of the RPT files?

lone glade
#

most recent one

little eagle
#

They're named by the timestamp the session was started.

#

Muzzleflash, if you hold down shift before right clicking a file or folder in the windows explorer, you get the additional context menu entry "copy path".

modest temple
#

14:59:54 File C:\Users\Tuiderru\Documents\Arma 3 - Other Profiles\Spc%2e%20Tuiderru\missions\EFT.chernarus\spawn_shoreline.sqf, line 17
14:59:54 Error in expression <f time";
sleep 5;
_this setDamage 1;
}

while {!alive _this} do {timer = timer ->
14:59:54 Error position: <while {!alive _this} do {timer = timer ->
14:59:54 Error Missing ;

little eagle
#

This blew my mind a few months ago and changed my life.

#

You need a semi colon in the last line before the while.

errant jasper
#

Actually you can just copy a folder CTRL-C and if you paste in a path window it pastes the path

little eagle
#
sleep 5;
_this setDamage 1;
} <<<<<< here

while {!alive _this} do {timer = timer
modest temple
#

it works

#

Thank you so much

velvet merlin
#

planes without physx float at mission start - when there is any interaction, they drop to the ground as expected
the idea would be now to use initEH to force this on mission start - any thoughts what to apply best?

little eagle
#
this setDamage damage this

inside init box?

#

That's how I make detached boxes stop floating.

#

Probably works for planes too... maybe not.

still forum
#

That looks like weird ununderstandable sqf magic

velvet merlin
#

ok will try

warm gorge
#
0 spawn {
    private _worldCenterPos = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
    SR_worldWarehouses = _worldCenterPos nearObjects ["Land_i_Shed_Ind_F", 25000];
    SR_worldWarehouses = SR_worldWarehouses call BIS_fnc_arrayShuffle;
};

Any idea why this script would cause the game to freeze up for a couple of seconds, even know its being scheduled?

winter rose
#

the 25km scan doesn't help, really

still forum
#

scheduler can only pause between instructions

winter rose
#

scheduling won't stop the command from being hungry yup

still forum
#

the extremly slow nearObjects call is a single instruction

queen cargo
#

you can reduce that slow by making multiple calls to nearObjects

warm gorge
#

I can definitely reduce the distance, considering its a radius and this is for the Altis map

lone glade
#

nah, it's the world center config lookup slowing it down ded /s

still forum
#

btw you can also look up worldSize and use that as radius. Instead of blindly using 25k

lone glade
#

honestly you could just do:
[worldSize / 2, worldSize /2, 0]

still forum
#

wow dude

#

leaves

lone glade
#

too bad we don't have the kappa emote here huehuehue

#

he wanted world center ded, he got it heheheheheheheh

lone glade
#

both will ruin your framerate

still forum
#

but the center on a 2D map is not the center of the world. World center is deeeeeeeep down under the ground

lone glade
#

lies ded

still forum
#
private["_i", "_array"];
    _array = [];
for "_i" from 0 to (_mapSize / _gridSize) do

๐Ÿคข

lone glade
#

everyone knows the center of earth is at the surface

still forum
#

how old is that script? 5 years?

#

Oh.. 4 years.. close enough

queen cargo
#

yup

#

kinda funny now looking back onto it how clean it actually looks

#
([] call {private "___tmp___"; ___tmp___ = (_vehicle); ___tmp___ = (___tmp___ getVariable [ "IsInsurgencyObject" , false ]); ___tmp___}) breakOut "_FNCSCOPE_";```
#

beautiful

#

return vehicle.getContext().getBool("IsInsurgencyObject", false); in OOS

still forum
#

or

_vehicle getVariable ["IsInsurgencyObject", false]

without OOS.

queen cargo
#

optimization was never something that was in OOS

still forum
#

The SQF variant is shorter than the OOS variant.

warm gorge
#

Cheers for the help guys. I think im gonna use worldSize / 2 and maybe put it in a preInit function with CfgFunctions rather than on demand

queen cargo
#

the OOS variant is auto-generated without knowing what happens ๐Ÿ˜„

#

due to statement being > getContext it automatically moved into the tmp thingy
getContext just is assigning the variable and getbool then using that with getVariable
could be optimized, yes
but as OOS was just some project nobody ever used besides me, why bother?

peak plover
#

I thought object orientated thingies were all slower

#

Just easier and more logic al

modern sand
#

serverCommand doesn't allow you to use custom messages when kicking correct? Just simply says "You were kicked from the game"?

winter rose
#

no it doesn't, correct

modern sand
#

ok ty

winter rose
modern sand
#

Yer, wasn't sure though if there was something else to it. Seeming I've noticed not all of the commands on the wiki are fully detailed.

winter rose
#

if you have a list of commands to improve, I gladly take it

modern sand
#

I couldn't be bothered creating a list sorry :L

winter rose
#

np, we simply look to improve the wiki and keep it as complete as possible

modern sand
#

๐Ÿ˜ƒ

peak plover
#

tbh

#

For serverCommand you need

#

password

winter rose
#

@peak plover not mandatory.

unborn ether
#

How do you remoteExec addAction properly?

still forum
#

you remoteExec ["addAction"]

#

What do you mean by "properly"

#

it's exactly the same as any other command

unborn ether
#

How to send arguments to client from server, a-like adding action to a server created unit.

still forum
#

what arguments?
Arguments are passed on the left of remoteExec and I know that you know that

unborn ether
#

addAction consist of arguments like object, title, code, conditions... etc. Im asking how do you format that with remoteExec?

still forum
#

[leftArg, rightArg] remoteExec ["addAction"]

#

in that case rightArg is an array

unborn ether
#

Thanks

inland badger
#

Anyone know how I can prevent popup targets from falling down, I'm trying to manage the popup and pop down myself. I've tried

targetToKeepUp removeAllEventHandlers "HIT";

But still no success

still forum
#

disableSImulation

knotty mantle
#

Is in the onPlayerKilled the "old Unit" the dead body or the player who was in said body?

inland badger
#

@still forum sadly didn't do the trick, I tried disabling the damage as well, nothing. :/

unborn ether
#

if you enableSimulation to false it will never ragdoll, either do any physics, event dont calculate dynamic lights, so you've done something wrong

inland badger
#

@unborn ether Not sure how I would do anything wrong, what I did was placing a normal popup target, disabled simulation, shot it, fell over. Or is the enable simulation bugged in the editor?

still forum
#

objects without simulation shouldn't be able to play animations

unborn ether
#

Well if its actually an animation and not some kind of setVectorDirAndUp

inland badger
#

Ikr, let me try and manually disable it again when in-game through the debug.

unborn ether
#

Also, the animation is acutally performed at its 1 frame, so if you switchMove to some animation, you will see the first frame of it. So if the first frame is like its downed already, that might be it.

inland badger
#

Ehm, there is no way to like cancel the animation via a event handler say the hit one for example, as I tried poping it back up once the event handler was fired but that didn't do anything to it.

#

tried it in debug now, still doing the same when I manually disabled it as well.

unborn ether
#

Try removing HandleDamage along with Hit also, as it might be there too.

inland badger
#

Unfortunately it didn't solve it, but thanks ๐Ÿ˜ƒ

winter rose
#

thou hast raised my curiousity, I shall start A3 to try and find

inland badger
#

I can't confirm this yet, but I'm fairly sure it's in hitPart

winter rose
#

so Pop-up Target 1 for example, right?

inland badger
#

Yea, any of them I use TargetP_Inf2_F to be more exact

winter rose
#

enableSimulation and allowDamage didn't do anything indeed
dirty trick: set variable nopop = true then hit the target, then setDamage 1 ๐Ÿ˜„

little eagle
#
        class TargetP_Inf_F: TargetBase //inherits 12 parameters from bin\config.bin/CfgVehicles/TargetBase, sources - ["A3_Structures_F_Training"]
        {
            class EventHandlers //sources - ["A3_Structures_F_Training"]
            {
                hitPart = "_this select 0 execVM '\A3\Structures_F\Training\data\scripts\TargetP_Inf_F_hitPart.sqf';";
            };
        };
#

The script is recompiled for every hit it receives -.-

inland badger
#

Ahh, thanks both of you. I'll look into that and hopefully get it running correctly ๐Ÿ˜„

little eagle
#

There is a protected class called TargetP_Inf_NoPop_F, which is a carbon copy of TargetP_Inf_F, but has this script/eventhandler disabled.

#

Are you using any mods?

inland badger
#

Ahh, but u can still animate that manually?

#

I use a bunch of mods, RHS, ACE, cba, etc

little eagle
#

nice, sec

winter rose
#

popupTarget animate ["terc", 0]; // raises it

little eagle
#

@inland badger You could open the mission.sqm file and mass replace

#

TargetP_Inf_F

#

with

#

TargetP_Inf_NoPop_F

#

Then load again the mission in the editor, and save and export it.

inland badger
#

I currently use this ```sqf
_targets = [range1_9, range1_8, range1_7, range1_6, range1_5, range1_4, range1_3, range1_2, range1_1];

{_x animate ["Terc",0];} forEach _targets;

{
_x addEventHandler ["HIT", {
(_this select 0) animate ["Terc",1];
(_this select 0) RemoveEventHandler ["HIT",0];
}
]} forEach _targets;


but I was thinking more of like adding extra data to it, say u have to double tap some of them before they go down and so on.
#

@little eagle will do, thanks! ๐Ÿ˜ƒ

little eagle
#

Otherwise:

if (isServer) then {
    private _pos = getPosWorld this;
    private _dirAndUp = [vectorDir this, vectorUp this];
    deleteVehicle this;

    private _new = "TargetP_Inf_NoPop_F" createVehicle [0,0,0];
    _new setPosWorld _pos;
    _new setVectorDirAndUp _dirAndUp;
};

This into the objects init box.

thorn saffron
#

How can I get what speed the bullet has when hitting a target?

little eagle
#

track the bullets speed until it hits.

tough abyss
#

wouldnt the equ for impact velocity work on this? Or is arma physics special

little eagle
#

You could estimate it with that I guess, but good luck handling ricochets and bullets that already penetrated an object in front of you.

austere hawk
#

HitPart Eventhandler

#

but it's limited iirc - only works for the one who fired the projectiel if memory serves right

unborn ether
#

Currently there is only one EVH HitPart which is able to detect velocity of the projectile on hit, but that doesn't help much about shooting in the air as its object based.

austere hawk
#

well that much is obvious... no impact, no event to detect impact velocity xD

unborn ether
#

Otherwise you can detect that by speed in Fired* EVH, but you need to have some "hooks" on where and when that happens.

valid dew
#

Stupid question here but how do I check if a parameter exists

#

isnull and isnil both throw generic errors at me

#

doing

#

someVariable = isnull(_this select 0);

#

"18:26:27 Error select: Type Object, expected Array,String,Config entry"

hearty plover
#
// Fire on target.
while {[_targets] call ORMP_fnc_numberAliveInGroup > 0} do {
    ["INFO | ORMP_fnc_sniperFire | Checking target validation"] call ORMP_fnc_log;
    private _targ = selectRandom units _targets; // select rand victim in group
    _sniper reveal [_targ, 4];    

    // If in view, take the shot.
    private _vision = [objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ];
    if (_vision >= 0.2) then {
        [format["INFO | ORMP_fnc_sniperFire | Good shot, %1 vision, needed 0.2", _vision]] call ORMP_fnc_log;
        [format["INFO | ORMP_fnc_sniperFire | Good shot, %1 is primary target.", _targ]] call ORMP_fnc_log;
        ["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
        _sniper doTarget _targ;
        _sniper doFire _targ;
        _sniper forceWeaponFire [primaryWeapon _sniper, "SINGLE"];
        sleep 5;
    } else {
        [format["INFO | ORMP_fnc_sniperFire | No shot, %1 vision, needed 0.2", _vision]] call ORMP_fnc_log;
        _sniper setUnitPos "MIDDLE";
        _sniper forgetTarget _targ;
        sleep 5;
    };
    
    _sniper forgetTarget _targ;
    sleep 3;
};
#

In the above, when all conditions are met, the sniper will not fire.

meager heart
#

lol

hearty plover
#

I know.

#

It makes no sense.

#

It works like 20% of the time.

#

Even when vision is returning 1, which is perfect los I think

#

he won't pull the trigger.

#

Even the forceWeaponFire doesn't work..

#

D:

meager heart
#
0 spawn {
    private _sniper = createGroup east createUnit ["O_sniper_F", player modelToWorld [0,1000,0], [], 0, "NONE"];
    private _units = units group player;
    player allowDamage false;

    while {{alive _x} count _units > 0} do {
        private _targ = selectRandom (_units select {alive _x}); 
        _sniper reveal _targ;  
        _sniper doWatch _targ;

        hintSilent str _targ;

        if (([objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ]) >= 0.5) then {
            _sniper setUnitPos "DOWN";
            _sniper doTarget _targ;
        } else {
            _sniper forgetTarget _targ;
            _sniper setUnitPos "MIDDLE";
            hintSilent "no target";
        };
        sleep 10; 
    };
};
``` in the console ^ 
-1 https://gyazo.com/5e236a43722d71384c209dca5def7d0f
-2 (player in cover lol)  https://gyazo.com/781347d00452f6e195723b0b89edc8c7
player selected https://gyazo.com/248b307a64cc418f0b8b9d8d3ee2c527
the end https://gyazo.com/4d859fd803c8624895e536eb058b2fac
#

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

meager heart
#

also that code ^ is just test example... tried to stay close to what you doing (you will need make better version, kinda bad way), Jay

hearty plover
#

Yeah, go put him out on a hill someplace in stratis

#

and then try it.

#

When there is NO objects at all, it works.

#

When there is anything, it seems to break.

#

My code works on the flat airstrip.

#

But not when I place him someplace more "realistic"

#

But, I think you made me see a few flaws.

#

Let me try this real fast.

#

Yeah, still not shooting.

#

Would it have to do with this.

#
// Set danger level
if (_danger) then {
    ["DEADLY ENABLED -- "] call ORMP_fnc_log;
    _sniper setUnitAbility 0.9;
    _sniper setskill ["aimingAccuracy",0.9];
    _sniper setskill ["aimingShake", 0.9];
    _sniper setskill ["aimingSpeed", 1];
    _sniper setskill ["Endurance", 0.8];
    _sniper setskill ["spotDistance", 1];
    _sniper setskill ["spotTime", 1];
    _sniper setskill ["courage", 1];
    _sniper setskill ["reloadSpeed",0.1];
} else {
    ["DEADLY DISABLED -- "] call ORMP_fnc_log;
    _sniper setUnitAbility 0.9;
    _sniper setskill ["aimingAccuracy", 0.02];
    _sniper setskill ["aimingShake", 0.9];
    _sniper setskill ["aimingSpeed", 1];
    _sniper setskill ["Endurance", 0.8];
    _sniper setskill ["spotDistance", 1];
    _sniper setskill ["spotTime", 1];
    _sniper setskill ["courage", 1];
    _sniper setskill ["reloadSpeed",0.1];
};
#

So, I am wanting to switch the sniper between deadly, and not so deadly.

#

By adjusting the skills.

meager heart
#

wow

#

...

#

first thing what i see endurance < disabled

hearty plover
#

Disabled?!?!

#

Really?

#

_sniper setskill ["Endurance", 0.8];

meager heart
hearty plover
#

Hmm

#

The only skill I care about adjusting, is accuracy really.

meager heart
#

afaik setUnitAbility < also disabled

hearty plover
#

Okay, so removing that.

#

Like I said, my shooter takes the shot in certain areas.

#

I don't think the check vis is working.

#

Even tho it tells us he can see the target, I think he doesn't actually see him.

#

And thus, is not shooting.

#

Target unit will fire the specified unit's position in the target vehicle's (can be the unit itself) weapon mode index

#

BI wiki.

#

wat

meager heart
#

where is it ?

meager heart
#

which range you have there ?

#

try different weapon or move him closer, maybe

hearty plover
#

760~

#

Using a svd

#

Sorry

#

m14

#

Should be more than enough.

#

I don't understand...

#

Is there no functions that let me say, aim at this, shoot at this regardless of range, etc.

#

He won't even fire from force weapon fire..

#

Which makes no sense.

meager heart
#

can you replace your sniper with this O_sniper_F ? ๐Ÿ˜€

little eagle
#

@valid dew Join the right side of history and abbandon all _this select N for params.

winter rose
#

โ˜ Amen, brothers!

still forum
#

@valid dew in your case _this exists. But it's not an array you can select from.
you can try param instead of select. It also gives you a default value

valid dew
#

Okay; I'll have to look at those

#

I've just started on a few projects; but eventually I'd like to make a more up to date version of BECTI

#

Using Zeus rather than the build script thing and arsenal rather than the arbitrary gear menu that's pretty shit

#

Just getting a working knowledge of SQF and I already hate it lol

little eagle
#

Editing Zeus is not entry level, although very possible, and I guess it's nice to aim high.

#

Editing the arsenal on the other hand is pretty intense...

#

I will refuse to call the ACE Arsenal "good" as long as it doesn't have dynamic searchbars.

peak plover
#

๐Ÿค” ๐Ÿค” ๐Ÿค” About cba hashtable

#

How does it work?

still forum
#

Why don't you just look at the code

#

it's not a hashtable. It's CBA_Hash

#

actually has nothing to do with hashing at all

#

["#CBA_HASH#", ["key1", "key2"], ["value1", "value2"]]

little eagle
#

Just use the namespaces. If your keys are objects, use BIS_fnc_netId to serialize them.

peak plover
#

ohh

#

SO it's liek that

#

So cba has means

still forum
#

CBA namespace is just a Location or simpleObject

peak plover
#


private _elementNr = (_keys find _key)
private _value = (_values param [_elementNr,_defaultValue]);
still forum
#

yes

peak plover
#

interdasting

errant jasper
#

But depending on your needs, I would probably go for namespace instead. If all the keys are known, just too cumbersome to use cba_hash

peak plover
#
prviate _value = _myNamespace getVariable [_key,_defaultValue];
#

is faster amirite

#

And I can also save everything from mynmaspace into profilenamespace pretty ez

#

or extDB

still forum
#

getVariable uses a real hashtable/hashmap.

#

it's not always faster.

#

the getVariable lookup is basically always the same time.
But with find it increases linearly the further it has to search.
find is really fast if the thing you are searching is right at the start of the array. Probably even faster than getVariable.
But if you have dozens of entries and want to find the index of the last.. it's incredibly slow.

#

getVariable only supports string and is case-insensitive though. Which is probably the only reason why CBA hash is still around.
Until you use Intercept_CBA which has a real hashMap container.

little eagle
#

And I can also save everything from mynmaspace into profilenamespace pretty ez

#

Which is probably the only reason why CBA hash is still around.

still forum
#

oh yeah. CBA hash has a function to export/import to/from namespace

little eagle
#

I'd say one major benefit of those CBA hashes is, that they can be stored in profile namespace (and the mission.sqm as 3den setting).

#

oh yeah. CBA hash has a function to export/import to/from namespace

errant jasper
#

Just tried CBA_hash vs CBA_namespace with just one entry. CBA_namespace is almost 10 times faster at setting and almost 5 times faster at reading. And this even includes an additional 'str _key' conversion for the namespace.

little eagle
#

Yeah, it's an old mediocre and superseded idea, and is only really used by me for what I wrote above.

errant jasper
#

My main worry in using cba_namespace is in how much do these buggers location/simpleobject use of. Like can you spray namespaces around as often as arrays?

lone glade
#

anyone and their mother has a hash func in their mod these days huehuehue

little eagle
#

Another failure of language, that it's called hash, while the not-hash (namespace) actually uses the hashtable.

peak plover
#

I was reading about reasons why OOS is bad and memory allocation issues with it

lone glade
#

tho life servers have them for different reasons entirely ๐Ÿ˜„

still forum
#

OOS is bad because it isn't as optimized as normal script would be.

peak plover
#

That parts liek that can be in different parts of memory causing pointless cpu bandwidth

still forum
#

Any shitty written script might be worse or better than any OOS script

peak plover
#

Made me think of setvariable

#

etc.

#

So there might be

still forum
#

And almost every sqf instruction causes a cache miss unless you have tons of cache on your CPU

peak plover
#

faster things than setvariable

still forum
#

I don't remember if I benchmarked if my hashMap is faster than setVariable... I probably did test that though

lone glade
#

you're thinking too narrowly ded

errant jasper
#

I wish we just would get a engine-based hashfunction

little eagle
#

My main worry in using cba_namespace is in how much do these buggers location/simpleobject use of. Like can you spray namespaces around as often as arrays?
Think you can have literal millions of them, and they only reduce perf on the map, and that is really minor unless you have unreasonably large numbers of namespaces.

still forum
#

command you mean. Not function ^^

lone glade
#

create a bogus display and store shit in it's namespace, repeat, profit huehuehue

errant jasper
#

true, Dedmen

little eagle
#

I can see them becoming too costly if you start to dynamically create namespaces in some n^2 fashion.

lone glade
#

or better, create helipads and then store shit in their varspaces ๐Ÿ˜„

peak plover
#

helipads are slower than locaitons

little eagle
#

alganthe, that is the same thing, except worse than pseudo namespaces.

lone glade
#

that's the point ๐Ÿ˜„

peak plover
#

100k helipads kills fps, when 100k locations only affects fps when on the map

lone glade
#

or using any location related command

little eagle
#

Really? The only I can think of is nearestLocations at whereever they're created outside the map (-1000,-1000 iirc).

#

You'd have to use a script containing a loop iterating through the nearest locations of a point inside the map with a > 1.41 km radius. Somehow I doubt anyone does that.

still forum
#

cough my namespaces are completly free cough

peak plover
#

?

little eagle
#

Intercept.

lone glade
#

or just use parsing namespace, who else uses it anyways /s

little eagle
#

BI does for some function now and it makes me mad.

peak plover
#

How will such things pan out in enscript?

#

Also what was enscript resmbling again?

#

C++?

little eagle
#

C#

still forum
#

I haven't seen hashmaps in enscript yet

lone glade
#

you can see some example of enscript in take on mars

#

taaaaaaaaaaake meeeeeee ooooooooon, take on me

little eagle
#

I haven't seen hashmaps in enscript yet
This. Only a failed attempt at OO.

peak plover
#

C#?

#

Great

#

Just started learning C3

#

C#*

#

C# is actually where I found out about it's slowness

little eagle
#

"it's"?

peak plover
#

Sorry her's

#

OOS

little eagle
#

"her's"?

errant jasper
#

Did you just assume C#'s gender!

still forum
#

OOS is object oriented scripting. C# is not scripting

#

C# is OOP

peak plover
#

And using poop.liquidity for ex is slow

little eagle
#

Well, OO being suboptimal is in the nature of the beast.

still forum
#

And for example in c++ OOP is essentially free if you crank the optimizer to max

peak plover
#

OO is more logical and faster as it represents how we understand objects irl

#

Crank optimizer?

#

The what now?

#

Do we have a optimizer we can crank for sqf?

still forum
#

yes. compilers have optimizers

little eagle
#

OO is more logical and faster
Compared to what?

peak plover
#

Ohh okay

#

compiler

still forum
#

yes we have a SQF optimizer

peak plover
#

\๐Ÿ‡ฎ \๐Ÿ‡ณ \๐Ÿ‡น \๐Ÿ‡ช \๐Ÿ‡ท \๐Ÿ‡จ \๐Ÿ‡ช \๐Ÿ‡ต \๐Ÿ‡น

still forum
#

Are you trying to imply that Intercept has a RPT?

peak plover
#

oopsie

#

So how does this optimizer work?

errant jasper
#

Also you should give the optimizer a cool code name, say: Optimizer Prime

little eagle
#

Nooo.

peak plover
#

decraptifizer

#

decraptify your sqf

little eagle
#

Names should be descriptive.

#

Therefore:

#

SQF Optimizer // by Dedmen

peak plover
#

@still forum When do you think this optimizer will become usable ?

still forum
#

It's already usable ยฏ_(ใƒ„)_/ยฏ

#

But carries the usual Intercept stuff. aka no battleye on clientside.
And I didn't test it on linux server yet and it's incompatible with my profiler.. I think.. maybe... maybe not actually... gotta test that

peak plover
#

How do I use it? Couldn't find the docs / tut?

#

no battleye
No cares

lone glade
#

oh shit, maybe brofiler works on the RC @still forum

#

nope, still no scopes :/

#

only compile

winter rose
#

also, wrong tag I guess ^^

lone glade
#

yes shit

#

sorry random person I tagged ๐Ÿ˜„

peak plover
#

๐Ÿ˜ฉ .

still forum
#

huh what? scopes missing means there is probably something wrong with the cert. If it picks up anything that means Intercept works and that means everything it needs works.
Are you using the latest rc build thing?

lone glade
#

latest RC build, I also tried dev, can't use stable right now for reasons

still forum
#

do I need steam branch access code for RC?

lone glade
#

yes

still forum
#

gimme that. I guess I can update to RC and try it out

lone glade
#

Arma3Update182RC

queen cargo
#

Just wondering right now... Are those optimized Scripts transfered in optimized state? Or in the "old" state?

still forum
#

scripts are transferred over net in string form

neon snow
#

Guys, I am trying to use setObjectTexture but with no luck for now. I added selection name to hiddenSelections[] in config, in model.cfg in class cfgModels I added same selection inside "sections[]" and it still doesnt change the texture. What should I do else?

little eagle
#

sections[]
๐Ÿค”

still forum
#

Afaik the selection doesn't even need to be in model.cfg. But I'm not sure because this is #arma3_scripting and not #arma3_model
The selection has to be on your model. If it isn't then it can't know what texture to change

neon snow
#

@still forum That's what bothers me too, becouse on the wiki it says "Don't forget to add the model and the selections in the CfgModels" and I am not entirely sure what that means, becouse I dont see selections in CfgModels

#

And yes, my model has a selection named correctly etc

still forum
#

@lone glade profiler works just fine on RC for me. atleast it shows stuff like ace_nametags_fnc_onDraw3D and BIS_fnc_loop.. wait... BIS functions never worked before ๐Ÿ˜ฎ What's this.

little eagle
#

CfgModels ???
Do you mean the model.cfg?

lone glade
#

send me your current build ^

neon snow
#

@little eagle yes, class CfgModels inside model.cfg

little eagle
#

Does your config.cpp have
hiddenSelections[] = {"camo", "camo1"};
hiddenSelectionsTextures[] = {"a3\structures_f\training\data\target_longrange_co.paa", "a3\structures_f\training\data\target_figure_co.paa"};
too?

neon snow
#

Yes indeed

little eagle
#

camo and camo1 are the selection names.

neon snow
#

Previously , hiddenSeections[] had 10 elements, I added one , so AFAIK the command should be :
_FA18 setObjectTextureGlobal [10, _map];

still forum
#

true. Maybe there is a max limit of them but never heard of that.
The others still work fine? What if you change the order. aka put yours at the start

#

does the texture you define in the config take effect? Or that also not?

neon snow
#

Ingame I run script getObjectTextures player vehicle and it returns the previous ones aswell as added one by me

#

I will try reordering them, but as for limit, on the wiki it says that array max size is 10 elements, however I checked on different plane and it had its map texture on 13 element so yeah

#

Hmm still no luck. Might it be that its original texture is rendersurface or the fact that it is on View-Pilot LOD?

manic sigil
#

Would

MissionNameSpace setVariable ["Plane", this, 1]

be a public alternative to Plane = This?

still forum
#

no

#

well.. somewhat "public"

#

Owner number 1 will get it too. Unsure what that is. 2 is server

#

If you want it public then use true

#

or just

plane = this;
publicVariable "plane";
little eagle
#

Nobody is 1.

still forum
#

But I wanna be number 1 ._.

#

Guess I just gotta be number 0 then.

manic sigil
#

I could swear 1 was "run for all" >_>

And that that exists - guess I was more checking the idea than anything else.

little eagle
#
 missionNamespace setVariable ["Plane", this, true]; 

is the same as:

plane = this;
publicVariable "plane";
still forum
#

0 was everyone. But not on setVariable

little eagle
#

true is run for all.

#

1 or any number is run for one client with that id. Nobody has 1 as id. It starts as 2 in MP for the server and continues with 3, 4 etc. for clients, as long as no savegame was loaded, in which case the server is also something > 2.

real herald
#

Quick question. How do I get the classnames of custom Ie (CUP) uniforms? Do I have to equip them on NPC and then copy one by one?

strange urchin
#

Well, how would you equip them without knowing the classnames?

lone glade
#

by retrieving them by classname?

#

filter out anything that starts with CUP in cfgWeapons that is also type I don't remember for uniforms

gleaming oyster
#

vehicleClass uniform or something along those lines

strange urchin
#

Yeah, filter out by the CUP tag and maybe check that itโ€™s ItemInfo has the uniformClass field

gleaming oyster
#

Just look at the entries for any uniform vehicleClass make sure they match with your selected config entry

strange urchin
#

To check if itโ€™s a uniform

gleaming oyster
#

type = 131072;

#

Or

#
_uniforms = "isClass _x && getNumber(_x >> 'type') == 801" configClasses(configFile >> "CfgWeapons");
lone glade
#

the fuck are you on about

#

you forgot to use single quotes and the uniform type is 801

strange urchin
#

Yeah...

lone glade
#

fuck, know what, gimme 2 minutes

gleaming oyster
#

Be my guest.

#

Typing mobile is harder than it seems

lone glade
#

wait wut, why the fuck is my install corrupted O.o

#

fuck i'll have to use stable :/

gleaming oyster
#

Happy now?

lone glade
#

no because you're still missing the fact that you're using the wrong type entry and not checking for cup uniforms

gleaming oyster
#

I thought that was implied?

real herald
#

"Well, how would you equip them without knowing the classnames?" - Via edit loadout in the Editor, how else?

lone glade
#
private _uniformArray =  []; 
{ 
    if (isClass (_x >> "ItemInfo")) then { 
        if (getNumber (_x >> "ItemInfo" >> "type") == 801) then { 
            _uniformArray pushBack (configName _x); 
        }; 
    }; 
} foreach ("tolower (configName _x) find 'cup' > -1" configClasses (configFile >> "CfgWeapons"));
_uniformArray
#

something like this in the debug console, there might be a few false positives

gleaming oyster
#

Isn't there a way to check which addon a config came from?

lone glade
#

yes, but that would've taken me more than 2 minutes

#

now I need to figure out why my dev branch build shit the bed....

gleaming oyster
#

Carpal tunnel?

neon snow
#

Can I create camera which will show particular LOD of vehicle? For example to make camera in cockpit?

real herald
#

sweet tks

strange urchin
#

I normally get my classnames through virtual arsenal, but thatโ€™s just me.

gleaming oyster
#

Not always used for manual data. I've used something similar for filtering out ammunition boxes or va items

warm gorge
#
player playMoveNow "Acts_TreatingWounded01";

Any idea why this animation isn't playing properly? None of the animation commands seem to work for it, I tried switchMove.

real herald
#

Hmm. How to make aunit dead in a chair?

#

would be cool if couldge tunit dead in a chair. even better if slumped over table

lone glade
#

yourUnit playAction "Die"

#

works inside of vehicles too

peak plover
#

Question about locality

still forum
#

your answer is in another castle

#

arguably a bad locality pun

peak plover
#

Let's say object is local to player1 and he disconnects, when handle disconnect triggers on server, is the player1 object and any objects that were local to that player local to the server now?

still forum
#

they will get transferred

#

if player1 object doesn't disappear

#

but not sure if they are already transferred when handle disconnect fires

peak plover
#

Before or after handleDisconect?

#

ahh yeah

#

It doesn't get dissapeared

#

If handleDC returns false then or sth liek that

still forum
#

ah yeah true

peak plover
#

okay

#

so

#

Man I'm sure this has been done before

#

people loading ai duty onto player clients

still forum
#

yeah definetly

peak plover
#

I just had an idea

#

for my ai script to add client hosted ai

#

But my issue right now is

#

There is no way to check poing

#

ping

#

afaik

#

I guess intercept can do it?

still forum
#

not really

#

intercept-network might kinda be able to. But not really

peak plover
#

Hmm

#

Damn

#

I figured out

#

I'd measure client fps and get avergage

#

If client is above average it can take an ai group to handle

#

And then having a rating based on clients previous performance

#

So for ex. if client disconnects before mission end, he left or crashed therefor his rating drops

#

And if client drops below average with ai then this rating drops

#

etc.

#

But my issue was ping

#

no good if a guy with 300 ping gets all the ai

real herald
#

@lone glade so put i tthe chair first then this?

#

thanks

lone glade
#

oh shit a chair

real herald
#

want him sitting

#

and dead

lone glade
#

you have to play the death animation for the person

real herald
#

without falling from chair

lone glade
#

the one for sitting

#

check the anim viewer for the correct anim and attach the unit to the chair

real herald
#

cool how to attach it?

lone glade
#

you use the attachTo command

#

there's probably a BI func for those ambient anims tho, you'll have to check

real herald
#

thanks iwll try.

#

player attachTo [car, [0, 0, 1] ];

#

what are the numbers?

#

Sorry noob here

astral tendon
#
Error Type Number, Not a Number, expected Number

๐Ÿ˜ญ

lone glade
#

which is correct

#

NaN isn't a number

#

huehuehuehue

still forum
#

@astral tendon Error Type (Number, Not a Number), expected (Number)
There. more readable ^^

astral tendon
#

Still funny when I read that

real herald
#

I don't understand

#

i used without

#

now hes attached

#

but facing opposite way

astral tendon
#

those numbers are like the x y z of the object, you can set the facing using setdir

real herald
#

i see

#

set dir 180 will work then

#

hmm

#

now to find proper anim

#

tks

astral tendon
#

i have a problem with the camCommit, for some reason it gives a anoying zoom that i cant remove it, and i need that comand so i can use camSetTarget

#

Any way to fix that? also move the camera far is not a optiom because the target is inside of a building and the camera is created above him

real herald
#

grrr

#

unit falls through table after all that

#

ANyway to avoid that

#

or just arma limitation

astral tendon
#

with the attachto?

real herald
#

yeah

unborn ether
astral tendon
#

setFov does not matter, is at its minimal

unborn ether
#

Well otherwise that means your camera is like point-blank to a target, so its looks like zoomed, set relative position off your target

warm gorge
#

Added: A new "#" script operator (works in the same way same as select, but is shorter to write and has higher priority than math functions)

#

Nice little addition

lone glade
#

nope

#

it's literally useless

still forum
#

We already talked about that here

#

forget about it

lone glade
#

unless you absolutely need to have a higher priority array select indexand can't use () for some magical reasons

#

that's legit the only use case for it

little eagle
#

alganthe:

private _uniforms = "true" configClasses (configFile >> "CfgWeapons") apply {configName _x} select {_x call BIS_fnc_itemType select 1 == "Uniform"}
tough abyss
#

oh

warm gorge
#

lol

tough abyss
#

someone posted it

#

mb

still forum
#

We are literally talking about that right now cloud

real herald
#

hmmm guess theres no way to stop non collision with objects

still forum
#

I would've preferred a way to add weapons with attachments to boxes over that crap that literally no one really needs

tough abyss
#

nvm i read

#

ty boiz

still forum
#

Fixed: The setUnitLoadout command could cause lag / FPS drops when creating entities Thank you BI.

lone glade
#

hey ded, at least we got findif

still forum
#

Would you now please also fix the useless entities and the RPT spam?

astral tendon
#

@unborn ether

_CivThatDied = player;

//camera
_CutSceneCamera = "camera" camcreate [0,0,0];
_CutSceneCamera cameraeffect ["internal", "TOP"];
_CutSceneCamera camPrepareFOV 0.1;
_CutSceneCamera setPosATL [(getPosATL _CivThatDied select 0) + 0, (getPosATL _CivThatDied select 1) + 0, (getPosATL _CivThatDied select 2) + 2];;
_CutSceneCamera camSetTarget _CivThatDied;
_CutSceneCamera camCommit 0;
_CutSceneCamera camSetRelPos [0, 0.5, 1.5];

You see, its above the target

lone glade
#

it's fixed ded

#

we checked, don't you remember ?

still forum
#

nope ^^

lone glade
#

well, I checked and entity spam is gone

#

unless they reintroduced it in a later patch but I doubt it

main pawn
#

Entity spam gone? That would be nice

little eagle
#
_CutSceneCamera setPosATL [(getPosATL _CivThatDied select 0) + 0, (getPosATL _CivThatDied select 1) + 0, (getPosATL _CivThatDied select 2) + 2];;

->

_CutSceneCamera setPosWorld (getPosWorld _CivThatDied vectorAdd [0,0,2]);
astral tendon
#

Nice, thanks

still forum
#

Well according to changelog BI fixed a bug that never existed. So... I'm not too confident with their fix

real herald
#

Jus t to be clear

#

Unitds wil lalways go through for example a table then?

warm gorge
#

Wait, entity spam as in: "21:27:31 Error: Object(2 : 3070) not found" which spams my RPT logs all day?

lone glade
#

no

#

that's a different thing entirely

warm gorge
#

Ah okay

unborn ether
#

@astral tendon One more do you actually understand that camCommitPrepared and camCommit and all related commands are diffrent, so as I see you prepare fov, but your target is not prepared. So FOV is not applied AFAIK.

lone glade
#

setUnitLoadout didn't delete previous containers on the player, meaning at some point you ended up with thousands of backpack entities

still forum
#

That looks like the spam I meant though

#

these invalid entities cause it

lone glade
#

well then consider it fixed ๐Ÿ˜„

warm gorge
#

I do use setUnitLoadout, so probably is. Thank god.

#

I remember some feedback tracker ticket about it thats been around for years which heaps of replies on it, I think thats related

real herald
#

Jus t to be clear
Unitds wil lalways go through for example a table then?

unborn ether
#

setUnitLoadout didn't delete previous containers by saying did you mean thats fixed for now?

real herald
#

nvm

lone glade
#

afaik that's a script / function referencing a deleted unit / object @warm gorge

real herald
#

looks like you need to edit that object geometry

still forum
#

@unborn ether According to their changelog they didn't fix that.
But it seems like they fixed it too according to alganthe. I don't remember the results of the last tests

unborn ether
#

Because that just gave me creeps.

#

I use it kinda frequently.

real herald
#

ok cool

warm gorge
lone glade
#

I tested it on dev branch and that was fixed @unborn ether

#

no more thousands of ghost entries in the log that was produced by logEntities

real herald
#

Did it

#

Now unti is stil lfacing opposite way GRRR

astral tendon
#

@unborn ether "prepare the target"?

unborn ether
#

@astral tendon Yes, there are commands to preprare the cam, prepared cam commands commit only with camCommitPrepared

astral tendon
#

so just change to camCommitPrepared?

unborn ether
#

depends on how far from your render point that cam is created, prepared cam renders all around it. You use mixed, but only do camCommit

#

its better to use prepared OR unpreared, not both.

thick oar
#

Added: A new "#" script operator (works in the same way same as select, but is shorter to write and has higher priority than math functions)

So the same as @ in o2script? ๐Ÿ˜ฎ

astral tendon
#

Well, i kinda fix that by adding a negative number on camPrepareFOV

lone glade
#

don't use it

astral tendon
#

_CutSceneCamera camPrepareFOV -0.1;

lone glade
#

for the love of god

little eagle
#

Use it exclusively

lone glade
#

I swear someone need to remove this from the changelog

unborn ether
#

camPrepareFOV will not fire without camCommitPrepared in your case anyways, since you only use camCommit

astral tendon
#

so i just need to change the order?

real herald
#

Ok thaytwas a waste of time

#

no matter what I do

#

he flies out of the chair

lone glade
#

because you kill him, move him into the animation you want, disable animations

still forum
#

the actually important commands are not on changelog. But the useless thing is...

real herald
#

ah ok

#

thanks

#

will that work in MP

thick oar
#

I wonder how that will conflict with preprocessors

still forum
#

People already tried

#

and found that conflicts exist

#

in the dev branch feedback thread on bif

winter rose
#

first thought as well. but it's just a shortcut for select, no performance, no nothing? I didn't follow the last news

real herald
#

do i put playe playaction in his init field

still forum
#

yep

#

It is a exact dropin for (_array select _index)

#

with the braces

winter rose
#

well...
๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘
๐Ÿ‘ ๐Ÿ‘€ ๐Ÿ‘
๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

real herald
#

doesnt work

#

he just lies on floor

#

I'm guessing there is no way to do this

thick oar
#

thanks

#

I dont know why they didnt use @. Thats how it was in o2script since 2001.

still forum
#

Also it's literally only array#index. any other form of select doesn't work

thick oar
#

Anyone know who "SilentSpike" is?
He/She added the extra on the wiki about SQS/SQF meaning "Status Quo Script" / "Status Quo Function".

#

As far as I knew, it was never revealed what SQ* stood for

still forum
#

true

#

@tranquil nymph

thick oar
#

So yeh, I'd like some sources and citations for that ๐Ÿ˜›

real herald
#

FUUUUUUUCK!

little eagle
#

#define # select

still forum
#

What if you do #string then though

little eagle
#

Anarchy.

thick oar
#

classic case of

#define false !true```
little eagle
#

#define true (random 2 > 1)

austere hawk
#

#define # define?

winter rose
#

true = false was still possible in Arma 2 (-:

still forum
#

should still be possible

#

0 = false also works

winter rose
#

not via SQF anymore, they implemented keywords and protection (player = 5 would throw an error)

tranquil nymph
#

#define player 5 still works

little eagle
#

You can use protected variables as object variable names by editing the mission.sqm.
Naming a box items is a classic.

tranquil nymph
#

@thick oar my citation is in the old scripting skype group somewhere ๐Ÿ˜›

#

pretty sure one of the devs said it, which is why I updated that

little eagle
#

And you can still assing anything to numbers, but you only retrieve the value if you use:

0 = 127;
missionNamespace getVariable str 0 // 127
thick oar
#

Ah hey cool, do you know who? I poked a few old timeys of them and they never knew.

tranquil nymph
#

Honestly nope ๐Ÿ˜› It's entirely possible I misremembered that to begin with, that was quite some time ago

thick oar
#

I presumed sqs was short for "sequence script", as the original purpose was cutscene control, and well, a script is used in a scene, and multiple scenes form a sequence in filmmaking. maybe I'm interpreting too much logic into that. ๐Ÿ˜„

lone glade
#

it's either a mandela effect or me being insane but i'm fairly sure I saw status quo referenced a few times

little eagle
#

Doesn't matter if you have no original source. You might've fallen for an urban myth.

lone glade
#

true.

thick oar
#

I tweeted at the man himself, lets see if Maruk will provide a quotable source. ๐Ÿ˜„

little eagle
#

inb4 random letters

peak plover
#

punched keyboard

#

came up with sqf

little eagle
#

syd

#

That's what I got when I punched near s

peak plover
#

wsqf

#

but i had fingers extended

#

so it's kinda cheating

little eagle
#

sed

still forum
#

maybe dvorak

little eagle
#

gdr intensifies

peak plover
little eagle
#

"become"?

still forum
#

begone

gleaming oyster
#

t h o t ?

little eagle
#

Assassinate me, and it will be as boring as it was in the beginning.

digital hollow
#

Sun Tzu says "Know your enemy". Seems pretty relevant =D

tame portal
#

b e g o n e t h o t

peak plover
#

\๐Ÿ‘

drowsy axle
#

Is there anyway to: setActionIDs

still forum
#

no

#

that wouldn't make sense

little eagle
#

Well.

#

BIS_fnc_addStackedEventHandler allows for this, and if you reuse the id, you overwrite. I think that is pretty handy.

drowsy axle
#

Here's the code. Would they, be 0 , 1 , 2. respectively?

if (alive currentDrone) then {
    drone_sign_1 addAction ["<t color='#34495e'>A Drone is still <t color='#27ae60'>'ACTIVE'<t color='#34495e'>. <t color='#e67e22'>(You cannot have two drones at the same time.)", {}];
    drone_sign_1 addAction ["<t color='#e74c3c'>DE-ACTIVATE: <t color='#d35400'>Drone!", { 
        _action_sure = drone_sign_1 addAction ["<t color='#e74c3c'>DE-ACTIVATE: <t color='#c0392b'>Are you sure?.", { currentDrone setdamage 1; removeAction 2;}];
    }];
};```
little eagle
#

It would be _action_sure

drowsy axle
#

tried that. didn't work.

still forum
#

if no actions were added before them and the first action index is 0 then yes

little eagle
#

Of course that works.

#

sec

still forum
#

why removeAction 2? Why don't you just use the action's ID?

drowsy axle
#

that's what i'm doing..?

still forum
#

No

little eagle
#

My text editor froze sec

still forum
#

You are expecting that a ID that might be random will be 2

#

random 500000 == 2

#

Just use the actual ID instead of guessing and expecting that no mod or anything else might possibly interfere

#

the action ID is in _this

drowsy axle
tame portal
#

@drowsy axle What does the user do if he presses DEACTIVATE Drone and then is prompted to press again but he wants to cancel

still forum
#

you cannot set it.

#

addAction returns it

#

and you have it in _this

tame portal
#

just keep the latest action you added in a variable or something

little eagle
#
private _args = [];

private _action_sure = drone_sign_1 addAction ["<t color='#e74c3c'>DE-ACTIVATE: <t color='#c0392b'>Are you sure?.", {
    currentDrone setdamage 1;
    removeAction (_this select 3 select 0);
}, _args];

_args pushBack _action_sure;
drowsy axle
#

I've not got that far ๐Ÿ˜› @tame portal

little eagle
#

There, pass by reference array, yolo sqf

tame portal
#

lmao

#

hacky solution 10/10

still forum
#

wtf commy

tame portal
#

i like it

still forum
#

_this select 2. And done

drowsy axle
#

oh select 2

little eagle
#

Oh, that is a thing, lol

tame portal
#

didnt know either

little eagle
#

Boring though.

still forum
#

same with eventhandlers

little eagle
#
drone_sign_1 addAction ["<t color='#e74c3c'>DE-ACTIVATE: <t color='#c0392b'>Are you sure?.", {
    currentDrone setdamage 1;
    removeAction (_this select 2);
}];
#

boooring

tame portal
#

its only leetQF if you do it with hacky solutions

tame portal
#

<player> removeAction <id>;

drowsy axle
#

oh lol

#
drone_sign_1 removeAction (_this select 2)```
little eagle
#

Yep.

drowsy axle
#

I have a live stream going, if you want to watch / having suggestions.

little eagle
#

Twitch is stuttering for my shitty connection here @720p

drowsy axle
#

aww ๐Ÿ˜ฆ

little eagle
#

Idk how Youtube does it.

#

Guess their videos are rendered down to shit.

drowsy axle
tame portal
#

when where there, where are you from commy that you have such a connection?

#

๐Ÿค”

drowsy axle
#

The holdAction keeps going once i complete it.

#

But

tame portal
#

actionCompletedis a very dangerous variable name

drowsy axle
#

I have this: ```sqf
if !(alive currentDrone) then {
_droneBoardAction = [
drone_sign_1, // Object the action is attached to
"<t color='#27ae60'>Activate<t color='#34495e'>: A Drone", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 3", // Condition for the action to be shown
"_caller distance _target < 3", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{ actionCompleted = true;}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
12, // Action duration [s]
0, // Priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", [0,2] select isDedicated, drone_sign_1];
};

still forum
#

where are you from commy that you have such a connection? Germany :kappa:

tame portal
#

as if lol

drowsy axle
#

changed: actionDroneCompleted

tame portal
#

germany cant be the only country with bad internet

little eagle
#

I'm sitting here in a NVA barracks.

tame portal
#

You can basically feel commy whipping out his KGB knowledge

drowsy axle
#

brb getting food

little eagle
#

Yeah, rule 1 is to brag about it on the internet.

#

No one would believe you, the perfect cover up.

tame portal
#

Makes you less suspicious

#

I disagree with you

#

Hm well I expected you to say "Bot" now but I was let down

little eagle
#

Brain has too low capacity to play the long term jokes.

drowsy axle
#

lol

hollow lantern
#

Whats the approach for letting an AI gunner look in a specific direction? tried sqf (gunner this) setDir 181; (gunner this) setFormDir 181; on a MGS without success. Is that maybe because I'm the commander?

little eagle
#
gunner this lookAt (this getPos [1000, 181])
#

No idea if this works from the init box.

inland badger
#

Quick question, anyone know how to run a script only through a headless client, like if I execute it from the addaction but I want the script to be executed only on the headless client machine?

little eagle
#

remoteExec?

#
{
    if (!hasInterface && !isServer) then {
        call My_fnc_whatever;
    };
} remoteExec ["call"];

I'd say.

hollow lantern
#

worked, thanks commy

little eagle
#

No interface, but also not the server == headless client.

#

worked, thanks commy
lol nice, I just made that up and never used lookAt in my life.

inland badger
#

@little eagle thanks, I'll give that a go and see if I can get it to work, got weird problems with event handlers, for some reason only works if I have a headless client on the server as well, dunno why ^^

grand sleet
#

Ok so should we be using # instead of select or whats it for

little eagle
#

You should be using params.

#

praise be upon it

drowsy axle
#

@tame portal Do you have any idea why this is failing with the action* not being defined? sqf if (alive currentDrone) then { action_active = drone_sign_1 addAction ["Drone is still <t color='#27ae60'>'ACTIVE'<t color='#ffffff'>.", {hint format ["Drone Location: %1", droneSpawnPos]}]; action_deactive = drone_sign_1 addAction ["<t color='#e74c3c'>DE-ACTIVATE: <t color='#c0392b'>Drone.", { action_deactive_sure = drone_sign_1 addAction ["<t color='#ffffff'>DE-ACTIVATE: <t color='#c0392b'>YES, I want to delete the drone!", { deleteVehicle currentDrone; sleep 0.5; drone_sign_1 removeAction (_this select 2); drone_sign_1 removeAction (action_deactive_cancel); drone_sign_1 removeAction (action_deactive); drone_sign_1 removeAction (action_active); drone_sign_1 addAction ["<t color='#27ae60'>Activate<t color='#34495e'>: Drone.", { actionDroneCompleted = true; }]; }]; action_deactive_cancel = drone_sign_1 addAction ["<t color='#ffffff'>DE-ACTIVATE: <t color='#27ae60'>NO, I want to keep the drone!", { drone_sign_1 removeAction (action_deactive_sure); drone_sign_1 removeAction (_this select 2); drone_sign_1 removeAction (action_deactive); }]; }]; };

little eagle
#

_action_deactive_cancel is undefined.

#

Different script instance, local variable doesn't carry over. Seems like we have to go crazy array again.

drowsy axle
#

Would making them global make it work?

little eagle
#

Boring.

#

I think so.

still forum
#

(action_deactive select 2) you can't use select on a number

drowsy axle
#

?? I dont understand

little eagle
#

(action_deactive select 2)
should be
action_deactive

drowsy axle
#

((action_deactive = _this ) _this select 2)

little eagle
#

No, that's not valid.

drowsy axle
#

ok

#

edited above

#

works woop

#
while {alive currentDrone} do {
    action_active = drone_sign_1 addAction ["Drone is still <t color='#27ae60'>'ACTIVE'<t color='#ffffff'>.", {hint format ["Drone Location: %1", droneSpawnPos]}];

    action_deactive = drone_sign_1 addAction ["<t color='#e74c3c'>DE-ACTIVATE: <t color='#c0392b'>Drone.", { 
        action_deactive_sure = drone_sign_1 addAction ["<t color='#ffffff'>DE-ACTIVATE: <t color='#c0392b'>YES, I want to delete the drone!", { 
            deleteVehicle currentDrone;
            sleep 0.5;
            drone_sign_1 removeAction (_this select 2);
            drone_sign_1 removeAction (action_deactive_cancel);
            drone_sign_1 removeAction (action_active);
            drone_sign_1 addAction ["<t color='#27ae60'>Activate<t color='#34495e'>: Drone.", { 
                curentDrone = "B_T_UAV_03_dynamicLoadout_F" createVehicle position droneSpawnPos;
                curentDrone setDir droneSpawnDir; 
            }];
        }];
        action_deactive_cancel = drone_sign_1 addAction ["<t color='#ffffff'>DE-ACTIVATE: <t color='#27ae60'>NO, I want to keep the drone!", {
            drone_sign_1 removeAction (action_deactive_sure);
            drone_sign_1 removeAction (_this select 2);
        }];
    }];
};

while {!alive currentDrone} do {
    drone_sign_1 addAction ["<t color='#27ae60'>Activate<t color='#34495e'>: Drone.", { 
        curentDrone = "B_T_UAV_03_dynamicLoadout_F" createVehicle position droneSpawnPos;
        curentDrone setDir droneSpawnDir; 
    }];
};``` Would this break my game?
#

I think I need to put this both as functions?

inland badger
#

Ehm so it's the first time I've ever tried using remoteExec & the call, but this is this right?

{
    if (!hasInterface && !isServer) then {
        call {[1, 5] execVM "test.sqf";};
    };
} remoteExec ["call"];
still forum
#

the call in the middle is useless

#

and the remoteExec is missing it's target

inland badger
#

so then for example, would work?

{
    if (!hasInterface && !isServer) then {
        [1, 5] execVM "test.sqf";
    };
} remoteExec ["call", hc];
still forum
#

that looks good

inland badger
#

Thanks, works like a charm! ๐Ÿ˜ƒ

little eagle
#

What?

#

Dedmen, no target means everyone.

still forum
#

oh. good to know

little eagle
#

If you already have the id of the hc, you might as well just write:

[[1, 5], "test.sqf"] remoteExec ["execVM", hc];
opaque topaz
#

best part of the changelog from today

Tweaked: The 3rd, 4th, and 5th parameters in the createVehicle script command are now optional

finally

tough abyss
#

Hot damn that is good

winter rose
#

Hallelujah

#

(dang, more wiki edit)

south rivet
#

When you do if (condition) exitWith {} and leave the {} empty, does it return null or nil?

winter rose
#

nil

#

aka Nothing in the wiki

south rivet
#

Alright, thanks

raven oracle
#

Hey guys, low level problem here.

{
    TR+_i addEventHandler ["hitPart", {
    TR+_i    animate ["Terc",1];
        }];
};```
I want to have an incremental variable creator which reads off TR1, then TR2. How to i format this code so that it does that?
tame portal
#

@raven oracle

#

You can get a variable by a string with <namespace> getVariable ["variablename", <defaultValue>]

#

so for example in your loop you could do

#
private _object = missionNamespace getVariable [format ["TR_%1", _i], objNull];

if (!isNull _object) then {
    _object addEventHandler ["hitPart", {
        (param [0]) animate ["Terc",1];
    }];
};
#

although generally, I advise you to store the objects youre referencing in an array instead and work with that

#

it's just a cleaner solution and helps avoid errors which become annoying to debug

raven oracle
#

yeah, cutting corners. Have 2000 objects named too similarly.

tame portal
#

im not 100% sure if my snippet will work but it should, put it into the for loop

#

how are your vehicles named?

#

in what scheme

raven oracle
#

could you explain what each bit of that does?

tame portal
#

TR_1, TR_2,... and so on?

raven oracle
#

yes

tame portal
#

OK

raven oracle
#

terrible i know

tame portal
#
missionNamespace getVariable [format ["TR_%1", _i], objNull];
#

basically getVariable takes a string and an optional default value and returns you whatever is stored in that global variable in the namespace youve defined

#

your variables are most likely in missionNamespace anyway so dont bother about that

#

format ["TR_%1", _i] results in whatever number is stored in _i

#

so in the first iteration it will become

#

"TR_1"

#

second

#

"TR_2" and so on

#

so the script (in each loop run) gets the variable value from "TR_1", then "TR_2" and so on

#

objNull is just a default value in case your variable does not exist for whatever reason

#

it then stores it in the local variable _object which is marked as private (meaning you cant by accident override other variables which are named _object and which are defined in a parent scope)

raven oracle
#

rgr. Thank you for your time

tame portal
#
private _a = 1;

if (_a == 1) then {
    private _a = 2;
    
    hint str _a;
};

hint str _a;```
#

will hint 2 and then 1

#

and the rest is basically the same as your existing code

raven oracle
#

Well thank you for that, I appreciate you walking me through that.

tame portal
#

i changed TR+_i animate ["Terc",1]; to (param [0]) animate ["Terc",1]; as the vehicle youre attaching the handler to is passed into your script which runs when the handler is fired as an argument

raven oracle
#

not used to SQF proper yet. Not creating it from scratch

tame portal
#

the other option would be to hardcode which object you mean in each defined code segment.. but thats very dirty

#

this method instead just takes the object the handler is assigned to

raven oracle
#

Why would the "dirty" way be well. "dirty"?

tame portal
#

the issue is that somethign i define in my script like _a wont carry over into the eventhandler

#

(any local variable)

#

this wouldnt work

raven oracle
#

right, so thats why it wasnt working. Thank you

tame portal
#
_object addEventHandler ["hitPart", {
    _object animate ["Terc",1];
}];
#

because the code you give your handler to run when it fires is not in the same context as the script youre currently writing

#

it doesnt know _object and will error or maybe dont even error at all

#

so your dirty workaround would be to either have the code know a global variable to fetch from

#

for example if i only had one vehicle i could do this

#
myVehicle addEventHandler ["hitPart", {
    myVehicle animate ["Terc",1];
}];
#

but this isnt suitable for your application and certainly not a clean solution

#

so best way is to just use the reference the eventhandler passes into your code snippet

#

this way you dont have to keep track of the vehicle in a variable somewhere for the eventhandler to find it again when the code runs

#

the handler knows what its attached to anyway

raven oracle
#

rgr.

hearty plover
#

HOLY SHIT!

raven oracle
#

Thank you for the explanation

hearty plover
#

It was the god damn rain!

tame portal
#

give this chat 12 hours and it will be flooded of messages what i did wrong (probably) ๐Ÿ˜„

raven oracle
#

hahahaha, no worries, you helped me immensely

hearty plover
#

@little eagle @meager heart it was overcast / rain that caused snipers to not work.

raven oracle
#

@tame portal This doesnt seem to be picking up any of the objects

#

@tame portal How should I be calling this?

hearty plover
#

?

wary vine
#

not sure where to put this , but is it engine based, restricting what weapons can be shot from the back for 4x4's or benches of helis ?

umbral oyster
#

Added: A new "#" script operator (works in the same way same as select, but is shorter to write and has higher priority than math functions)
Example: _x # 1; equal - _x select 1;
Right?

tough abyss
#

I think, try it

hearty plover
#

Ya know, I have been playing arma for like..

#

many years, have not had a single unit I have been in, where there is another person instrested in scripting / dev of missions..

#

D:

subtle ore
#

I've met a lot of people that like to piece things together with waypoints and simple placement of units,
but never any sqf sure

plucky mauve
#

I'm having problems in the Bounty Hunt script in Altis Life, the actions in the NPC do not work and when someone buys a license they do not register in the Data Base.

modern sand
#

@plucky mauve ask on the official altis life forums...

meager heart
#

@hearty plover not sure about rain (i just always manually set it 0)
but i never had any troubles with overcast, even with multiple skipping/changing time and weather conditions during the mission ๐Ÿคท

smoky crane
#

Just a quick word to the wise: as of 1.82 hit point strings returned using commands (getAllHitPointsDamage) or passed to event handlers (HandleDamage, Dammaged) are now forced lowercase. Something to now keep in mind for anyone using statements such as _hitPoint in ["HitBody", "HitHull"] or _hitPoint isEqualTo "HitBody".

#

I have no idea why this wasn't documented in the changelog, but it certainly has caused me a few minor issues after updating to 1.82.

fast grotto
#

Tfw u were a 13 yold kid trying to put ur squad in ur heli in arma 2 and kept going to BI fourms to copy paste the getincargo script ๐Ÿ‘Œ

hearty plover
#

@meager heart I removed rain/oc effects and the AI shoots now, however on my dedicated server they do not...

subtle ore
#

would it be practical to recreate units on a headless client if say a zeus placed them?
add a curator event handler for a place object, delete them recreate them on headless and add them to editable objects on the curator?

lone glade
#

yes^

#

that's basically what most headless scripts do otherwise it's a fucking nightmare to transfer stuff

subtle ore
#

Okay sweet ๐Ÿ‘

warm gorge
#

Any ideas why im having so much trouble playing the "Acts_TreatingWounded01" animation? No matter what I use, playMove, switchMove, whatever, it just either doesn't play properly or partially plays it and just bugs out

wary vine
#

I had that so I went another route

#
{
  player playMove _x;
  [player,_x,true] remoteExecCall ["life_fnc_animSync",-2];
} forEach [
  "ainvpknlmstpsnonwnondnon_medic",
  "ainvpknlmstpsnonwnondnon_medic0",
  "ainvpknlmstpsnonwnondnon_medic1",
  "ainvpknlmstpsnonwnondnon_medic2",
  "ainvpknlmstpsnonwnondnon_medic3",
  "ainvpknlmstpsnonwnondnon_medic4",
  "ainvpknlmstpsnonwnondnon_medic5"
];
#

seems to work for me

lone glade
#

@warm gorge use playMoveNow

#

it's also possible you're switching to an other action while it's playing

#

remember that those actions are supposed to be chained

#

it's the start of a loop of actions

warm gorge
#

@lone glade playMoveNow made no difference. No matter what I try I can't seem to get it to work :/ @wary vine That works, but not the animation I wanted

peak plover
#

Remote exec in a loop like that ๐Ÿ˜ฏ ๐Ÿ˜ฉ

lone glade
#

@warm gorge does the animation "freeze" after the first loop?

#

if that's the case it's perfectly normal, like I said it's the start of a loop

warm gorge
#

My character does a weird animation to pull out a weapon, but then just goes to idle standing animation and I can hear the animation play but can't see anything happen. What makes it weird is sometimes if I switch into first person I can see the animation playing normal for a couple of seconds. Not sure whats going on

lone glade
#

dunno, the start of the loop plays for me :/

warm gorge
#

If you execute this: player playMoveNow "Acts_TreatingWounded01";

#

?

lone glade
#

yes

#

playMove is AL EG, make sure the unit is local

warm gorge
#

Yeah im testing this in singleplayer, not sure if that will affect anything, but yeah the unit is local

#

Would it have anything to do with the character/side? Im using a civilian for this

lone glade
#

nope

#

not at all

#

alternatively you could use
player playAction "medicStartUp";

meager heart
#

a lot of animations based on unit weapon position, like in hands/on back... lowered, also weapon type... pistol/rifle/launcher/throw... maybe that is the problem

lone glade
#

ah, true

meager heart
#

no idea about civilians... but afaik doesn't matter (side i mean) ๐Ÿคท

spark sun
#

Hello, does BIS_fnc_getVehicleCustomization bug ?

11:34:16   Error position: <select _foreachindex) < 0) exitwith {_se>
11:34:16   Error Diviseur nul
11:34:16 File A3\functions_f_mark\Vehicles\fn_getVehicleCustomization.sqf [BIS_fnc_getVehicleCustomization], line 28```
meager heart
#

btw we have getObjectMaterials and getObjectTextures

#

you need "Animation Sources" also ?

#

you can get them ^ from the config, if yes...

formal vigil
#

Hey I have two questions, related to each other:

#

I'm working on a sector control mission. The idea is that once the sector has been captured a transport boat should spawn in the river nearby the sector. This is the script I'm using for it:
`ship_safepos = [getPos module, 1,150,10,2] call BIS_fnc_findSafePos;
ship_marker_name = format ["mrk_ship
%1", random 100];
ship_marker = createMarker [ship_marker_name, ship_safepos];
ship_marker setMarkerType "hd_dot";
ship_marker setMarkerText "Transport";

   ship = "uns_PBR_M10" createVehicle getMarkerPos ship_marker;
    if (isServer) then { ["SpawnNotification",["A Transport ship has just spawned in"]] remoteExec ["BIS_fnc_showNotification",-2,true]; };
    if (!isServer) then { ["SpawnNotification",["A Transport ship has just spawned in"]] call BIS_fnc_showNotification; };`

Code itself works, HOWEVER - the ship spawns near the beach and it's getting "beached" - meaning I can get inside the ship but I can't move since it's stuck on the ground. Do you know a simple way to prevent that? (Changing findsafepos parameters doesn't solve the issue).

#

Related question: To have a workaround for this issue I've put together a script that would push the boat a little bit and get it unstuck for the ground:
if((veh isKindOf "Car") OR (veh isKindOf "Ship") OR (veh isKindOf "Air")) then { displayName = getText(configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName"); upp = format["Pushing %1",displayName]; hint upp; speed = 8.5; veh setVelocity [ (vel select 0) + (sin dir * speed), (vel select 1) + (cos dir * speed), (vel select 2) ]; };

This works locally, but not on dedicated server, I guess battleye prevents execution of this script because of considering it a cheat? I wasn't really able to properly diagnose what's the issue here. Does any one of you have a "vehicle push" script that would work on the server?

lethal ingot
#

Making shoreMode = 0 in BIS_fnc_findSafePos didn't help?

#

It's default, yes, but this is arma 3 ๐Ÿ˜„

#

Also you could blacklist an area with blacklistPos in BIS_fnc_findSafePos if your boat spawns at exact place

formal vigil
#

Hmm... I've set only waterMode = 2 so it must be in water.

#

I didn't set shoreMode, as you said default = 0 => does not have to be at a shore, but, as you said - IT'S ARMA. LOL ๐Ÿ˜„

#

I will try setting the shoreMode explicitly to 0, but frankly I doubt it will help.

lone glade
#

don't use findSafePos, use selectBestPlaces instead, you're much more likely to get a better spot

formal vigil
#

aaah, I see, and then do a spawn_position = result select 0; for getting the position, right?

lone glade
#

yep

#

just don't use a precision that is too high, 5-10 sources max

wary vine
#

Can I do useractions on basic items ?

#

feck

#

wrong channcel

clever mantle
#

Does anyone know where I find the RscDebugConsolePublic display class?

formal vigil
#

In ui_f_data.pbo there is directory under \GUI\RscCommon\RscDebugConsole but I'm not sure if this is what you want.

supple vine
#

So there's the "user" animation source that allows script-driven animations in weapon.cfg. Any idea if it works? I wasn't able to find any weapons with defined user animation sources.

#

I'd like to hide/unhide part of vest depending on scripting

clever mantle
#

@formal vigil Since those are all .paa files, I don't think that's exactly what I'm asking for, but thanks for trying, I'm searching for the sqf implementation of RscDebugConsolePublic, you can call it via the admin cรกmera by pressing F1, or via the debug console createDialog RscDebugConsolePublic

#

Those .paa's appear to be more engine related

formal vigil
#

I think they're just images you can open with TexView containing the elements for that window you're referring.

clever mantle
#

Yeah they are pictures used in the ESC-Screen regular engine debug console aswell as the dialog I'm looking for, I just can't find the code for it.

formal vigil
#

Gotcha

still forum
#

You won't find a SQF implementation for something that was not implemented in SQF

clever mantle
#

Are the displays not written in SQF?

still forum
#

displays are usually not written in SQF no

clever mantle
#

I'm sorry I'm fairly new to this as you can tell

#

Alright

#

What is it written in though?

still forum
#

Config

#

as you said the RscDebugConsolePublic display class class. Aka config class

#

How the UI looks will be in config. Maybe some button actions will have dedicated scripts

clever mantle
#

OK TY

#

Can you tell me where I can find the class?

still forum
#

Ingame config viewer

little eagle
#

Isn't the debug console hard coded? I don't think it works when disabled.

#

Even if you create the display, the engine implementation is disabled. And if it were enabled, you could just open the pause menu.

still forum
#

the disabled code is scripted

molten folio
#

is it possible to do this "_Whitelist = [] spawn TW_fnc_name;"

#

or this _Whitelist = buttonSetAction [1603, "[] spawn TW_fnc_name"];

blissful phoenix
#

So neither of those will do what you want

still forum
#

Well both set a variable. And both are possible so the answer is yes. Though it doesn't make much sense to do it

little eagle
#

Good answer.

molten folio
still forum
#

It's a big array. that you are not using. and some listbox code.

#

you are missing private twice.

#

Don't know what else to review

molten folio
#

ok Thanks

#

private["_test","panelWL"];

#

???

still forum
#

no

#

https://community.bistudio.com/wiki/private alt syntax 2

#

private _text = and private _index =

molten folio
#

but i can combine them like this

#

private["_test","_index"];

#

right/

blissful phoenix
#

That's a deprecated syntax, and if I recall correctly it's slower than using private as a keyword

still forum
#

private keyword is free. private array isn't

#

so yeah. infinetly times slower

peak plover
#

Inb4 slow life code