#arma3_scripting

1 messages ยท Page 243 of 1

shadow sapphire
#

Multiple lots of damage? I could just allowdamage false at 95% damage, then have the script set it to one, right?

#

I don't need to protect the players inside the chopper, if they die, they die. I just want to make it where if a chopper lands gently and then rolls over, that the entire chalk doesn't have to pay the price for the pilots' error.

#

So, I guess if you mean there are multiple parts of the vehicle taking damage, I just need to protect the hull or whatever thing that makes it explode.

dusk sage
#

I was referring to the fact the EVH will more than likely fire multiple times. If you added something in there telling it 'wait 60 seconds then explode'. That would trigger multiple times, so you'd need to make sure that happened only once

shadow sapphire
#

Ah, I see.

#

Surely, someone has a script already out there that does something like this, right? I mean, I can't be the only guy that thinks that helicoters rolling over while sitting still and exploding is ridiculous.

dusk sage
#

So you check if it's taken >95% damage, limit that down to 95% only, spawn something that will kill it after 60 seconds

shadow sapphire
dusk sage
#

That escalated quickly

#

My god

lone glade
#

that's because the fuel tank takes absolutely MASSIVE collision damage when the chopper flips

shadow sapphire
#

Yeah, it's like that for every chopper model that I've tried it with. If you sit on the ground perfecty still, give it full tilt, then you explode immediatey. So, if you're flying AFM, you have to absolutely stick the landing, there is no room for a crash landing. You either landed great or no one walks away. Which isn't a problem for me most ofthe time, but I'm not a pilot. But this issue makes it where aspiring pilots are just too risky to even use until they've been through extensive training.

little eagle
#

iirc you cannot stop helicopters from explosing due to tilting

#

even with handle damage, they will still explode

#

it's kinda like how the killed event handler doesn't trigger if you sink a helicopter into the ocean

#

it's all bugged

foggy pike
#

only way I can think of, is to run a PFH for the helicopter that checks if it's a) close to the ground and b) about to hit anything doing some line intersects magic

#

then just go from there

shadow sapphire
#

@little eagle, that just made me realize that I should test this before I go any further. I'm just going to allowdamage false on a helicopter and try rolling it to see what happens.

little eagle
#

allowDamage false might work

#

but not handleDamage

rancid ruin
#

BI should just hardcode stabilisers on to all helis, kinda like children's bicycles

little eagle
#

I don't see the problem tbh

#

Never had issues flying

#

But that only happens once a year I guess

shadow sapphire
#

I've never had issues flying, but my group's servers are all forced to AFM on, and when we have an inexperienced pilot, we never know if the trip will end in tragedy. They could sit it down gently, then it starts to tip super slowly and we all already know it's over. It's crazy.

#

@little eagle, allowdamage false was always the plan, but I need an eventhandler to switch that on at the appropriate time.

little eagle
#

hmm

#
0 = this addEventHandler ["EngineOn", {
    params ["_heli", "_state"];

    if (_state) then {
        _heli allowDamage false;

        private _script = _heli getVariable ["myMission_heliAllowDamage", scriptNull];
        terminate _script;

        _script = _heli spawn {
            sleep 30;
            this allowDamage true;
        };

        _heli setVariable ["myMission_heliAllowDamage", _script];
    };
}];
#

this should make the helicopter invulnerable for 30 seconds after starting the engine

shadow sapphire
#

That's not the problem I need solved.

willow basin
#

^^

shadow sapphire
#

But, maybe I can figure out how it works and apply it.

#

I don't need protection on take-off, I need the helicopter to not blow up if it rolls over after an otherwise gentle landing.

little eagle
#

hmm

halcyon crypt
little eagle
#

there is no eventhandler for landing a helicopter

#

only for planes - but those only work on AI afaik

shadow sapphire
#

Right.

#

My proposition was a damage handler on the hull or something of that nature that when the helicopter hit .95 damage, it would stop allowing damage, then set damage to 1 after sixty seconds or so.

little eagle
#

but that would make it invulnerable for the whole mission

shadow sapphire
#

AKA, if the helicopter rolled upon landing, instead of exploding instantly, it would just wait long enough to get out before exploding.

#

Even if you have allowdamage false; if you set damage to 1, that bitch is toast, in my experience.

little eagle
#

Tbh, it sounds to me like you don't need a script

#

but a better pilot

willow basin
#

xD

halcyon crypt
#

I'd suggest you stop looking for an eventhandler and implement/test it with a spawned while loop to get the behavior you want

little eagle
#

sorry^^

halcyon crypt
#

after that you can worry about eventhandlers ^^

willow basin
#

Why not handleDamage event handle and if ATL < 10 you just negate the damage for like 10 seconds?

shadow sapphire
#

A better pilot cannot possible make the helicopters stop exploding if they roll over gently. That's an Arma problem exclusively. IRL, anyone could walk away from that, only the rotor would be damaged and maybe some superficial damage to the chopper body.

little eagle
#

I have never had this happen to me

shadow sapphire
#

Then you don't fly AFM.

little eagle
#

it's this a modded heli?

shadow sapphire
#

No. EVERY vanilla model in the game does this in AFM.

little eagle
#

splendid AFM then

shadow sapphire
#

*every one I've tested. I'll go test them all real quick, just to be sure, though.

little eagle
#

Our UH Tiger doesn't do this. Even with our custom AFM

shadow sapphire
#

All of my community's servers are locked to AFM, because we don't want chump pilots. Our pilots are great, but sometimes, if you're doing an emergency landing or something, it's nearly impossible to not roll, even if you landed gently otherwise. It's just the name of the game. Helicopters crash all the time IRL and people sometimes survive. Currently, with vanilla choppers in vanilla Arma 3 advanced flight model, they explode if they tilt further than about twenty degrees while on the ground.

halcyon crypt
#
    while {true} do {
        if ((getPosATL (vehicle player) select 2) < 1) then {
            private _bank = abs (([vehicle player] call BIS_fnc_getPitchBank) select 1);

            if (_bank > 50 && {damage (vehicle player) > 95}) then {
                (vehicle player) allowDamage false;
            };
        };
    };
    
    sleep 0.1;
};```
#

something like that-ish?

#

for testing that is

little eagle
#

please add a sleep

halcyon crypt
#

no, I like my menus to lagg ๐Ÿ‘

little eagle
#

grr

halcyon crypt
#

๐Ÿ˜„

#

okaayyyy

#

no clue if the above snippet actually works though, just an idea on how to get the behavior you want

little eagle
#

I could be mean and say that it will probably fail when you actually need it , because there are other scripts eating up the scheduler execution time

#

but oh well

halcyon crypt
#

yeah like I said, get the desired behavior first after that you can worry about event handlers or per frame handlers, or whatever else floats your boat. ๐Ÿ˜ƒ

little eagle
#

I'll cry if you use a PFH for something like this.
I still think you need better pilots

#

Or ... don't use AFM if it's broken

shadow sapphire
#

Can't not use AFM. I HATE how many people play this game and think they are good pilots because they can fly the incredibly easy non-AFM stuff. Also, my pilots are fine. They nearly never roll, but this is still an important thing. Helicopters crash IRL all the time and people are able to walk away.

lone glade
#

AFM is unrealistic and a pain in the ass on keyboard

#

well, until we get analog keys

little eagle
#

oh snap

shadow sapphire
#

Okay, so just to be sure I was thorough, I just tested every helicopter in the base game plus helicopters DLC. In AFM, every single one of them explodes if their rotors touch the ground.

little eagle
#

AFM isn't harder to fly

#

it's just annoying for addon makers

lone glade
#

it's normal del

little eagle
#

But then again, Panzergrenadiers don't fly

lone glade
#

the fuel tank takes damage from the physX collision....

shadow sapphire
#

I find AFM perfectly usable with a keyboard. But yes, it is harder to fly for most people, otherwise, why do all of these pilots that think they are good pilots fail at it so hard immediately?

rancid ruin
#

sorry commy but AFM is much harder to fly

#

with non-AFM you only fuck up if you crash...with AFM you can fuck up if you give it too much throttle

little eagle
#

because you flip over when starting the engine ^^ ?

lone glade
#

nah, nah afm is awful on keyboard due to the throttle being a bitch to control without analog

shadow sapphire
#

You don't flip over when starting the engine... what?

warped thicket
#

@little eagle I fly AFM-only and there is no way I am going to back to basic ๐Ÿ˜›

little eagle
#

your video

warped thicket
#

it's just too casual

shadow sapphire
#

@lone glade, what throttle? Helicopters in Arma don't even have a throttle.

little eagle
#

i don't argue

lone glade
#

collective*

little eagle
#

But if it's bugged, don't use it

warped thicket
#

what's bugged?

shadow sapphire
#

@little eagle, the point of the video is just to show that if the rotors touch the ground, the chopper explodes.

warped thicket
#

I wasn't paying attention to the convo above

lone glade
#

raising / lowering collective is a pita with a keyboard

little eagle
#

AFM, you tilt over according to @shadow sapphire

lone glade
#

much easier with a controller / stick

warped thicket
#

what

#

that video?

#

let me watch

#

lol what

#

never ever happened to me

shadow sapphire
#

@lone glade, you can switch it. There are multiple ways to run it on keyboard, but I go with default and I nearly never crash unless something is trying to shoot me down.

little eagle
#

same here

#

never happened to me

warped thicket
#

what I see is someone pushing cyclic to the right ๐Ÿ˜›

shadow sapphire
#

@warped thicket, holy shit...

#

Obviously!

lone glade
#

did they fix it ?

warped thicket
#

what's the problem then?

rancid ruin
#

if you've never crashed with AFM then you've not been flying crazily enough imo

little eagle
#

^ I'm confuse

warped thicket
#

I've crashed plenty of times

#

I wasn't paying attention to the convo, but what is that video supposed to show?

shadow sapphire
#

The point of the video is to show that as soon as your rotor touches the ground with any vanilla or DLC chopper in Arma 3's advanced flight model, it explodes.

lone glade
#

not the rotor, the fuel tank

shadow sapphire
#

So, even a gentle landing can result in the helicopter exploding if it tips more than a few degrees.

warped thicket
#

that's not true @shadow sapphire

#

you can break off rotors just as easily

#

and helicopter won't explode

#

in that video helicopter flips upside down

lone glade
#

you can absolutely destroy a chopper by landing it, if the fuel tank is fine it won't explode

warped thicket
#

causing damage to the tank, causing it to explode

#

which is the same in basic flight model

shadow sapphire
#

@warped thicket, you joined the conversation late. Why does this keep happening. I've had to explain this shit like eight times now.

warped thicket
#

copy/paste ?

shadow sapphire
#

You are telling me nothing I don't already know. Helicopters crash IRL all the time and people are able to walk away. In Arma however, if you gently roll over while on the ground, everyone onboard is killed instantly. Not realistic.

warped thicket
#

yes

#

but that's a bug in Arma

little eagle
#

^

warped thicket
#

I thought you were saying about AFM specifically

shadow sapphire
#

I wouldn't know, because all I've ever flown is AFM since it was released.

little eagle
#

That's what you get for making Tanks not explode in the laziest way possible (moving crtical hitpoint from hitEngine to hitFuel)

warped thicket
#

well why do you complain it's AFM then if you don't even know ๐Ÿ˜›

#

it's a general Arma problem and only BI can fix it

shadow sapphire
#

@warped thicket, I didn't even say it was an only an AFM problem. I just said that it happens in AFM, that doesn't mean only.

warped thicket
#

ok, my bad

shadow sapphire
#

"When I get in the ocean, I get wet."

"Yeah! But that happens in lakes, too! Why would you say you get wet in oceans if you get wet in all water!"

#

Maybe I'm thinking about this the wrong way. Maybe I just need to make the fuel tanks allowdamage false for now.

little eagle
#

I'll try something DEL-J

#

give me a minute

#

...

halcyon crypt
#

@shadow sapphire did you try my snippet above?

shadow sapphire
#

If the fuel tank damage was say... tied to the hull damage or something.

#

@halcyon crypt I have not, yet.

rancid ruin
#

wait, you can allowdamage false on individual hitpoints?

shadow sapphire
#

Will try momentarily.

rancid ruin
#

i thought allowdamage was for objects only

halcyon crypt
#

it is

#

according to the wiki

shadow sapphire
#

Rats.

#

Well, that's a bummer, then.

#

Anyway, trying MarcelDev's solution while awaiting Commy2's input.

rancid ruin
#

infinite while true sethit 0 it is then

shadow sapphire
#

@halcyon crypt, where do I stick this code?

halcyon crypt
#

debug console should work fine

#

or init.sqf

shadow sapphire
#

Error line 33.

#

There is no line 33. WTF, Arma?

halcyon crypt
#

it's probably in BIS_fnc_getPitchBank

shadow sapphire
#

Oh, yeah:


_obj = _this;





_yaw = getdir _obj;







_vdir = vectordir _o>
 9:36:24   Error position: <getdir _obj;







_vdir = vectordir _o>
 9:36:24   Error getdir: Type Array, expected Object
 9:36:24 File A3\functions_f\objects\fn_getPitchBank.sqf, line 33```
halcyon crypt
#

try removing the square brackets in private _bank = abs (([vehicle player] call BIS_fnc_getPitchBank) select 1);

#

so private _bank = abs (((vehicle player) call BIS_fnc_getPitchBank) select 1);

#

yes I like my parentheses ๐Ÿ˜„

shadow sapphire
#

Didn't seem to do anything.

#

Still exploded dead.

little eagle
#
this call { 
    params ["_heli"]; 
    getAllHitPointsDamage _heli params ["_hitpoints", "_selections"]; 
     
    private _fuelSelection = _selections param [_hitpoints apply {toLower _x} find "hitfuel"]; 
    _heli setVariable ["MyMission_fuelSelection", _fuelSelection]; 
 
    _heli addEventHandler ["HandleDamage", { 
        params ["_heli", "_selection"]; 
 
        if (_selection == _heli getVariable "MyMission_fuelSelection") then {0}; 
    }]; 
 
    nil 
};
#

works from my testing

#

it will explode eventually, because everything else get's damaged

#

but not as quickly

halcyon crypt
#

@shadow sapphire okaayy ๐Ÿ˜ฆ

shadow sapphire
#

@little eagle, I stick this in init?

little eagle
#

yes

#

you can move it everywhere

#

just replace the "this" with the heli

#

has to be executed on every machine

shadow sapphire
#

It has to be executed on every machine?

#

Dang!

little eagle
#

just put it into the init.sqf

#

or you know, init box

shadow sapphire
#

Does it need to be executed on initplayerlocal for it to work in PVP with JIP?

little eagle
#

just put it into the init box and you'll be fine

#

I have no idea how initplayerlocal.sqf works

#

it's stupid^^

shadow sapphire
#

The helicopter init box?

little eagle
#

yes

shadow sapphire
#

Pasting your code into the helicotper's init didn't seem to do anything for me.

little eagle
#

are you using vehicle respawn?

shadow sapphire
#

Negative.

little eagle
#

it makes the hitfuel hitpoint invulnerable

#

works for me

shadow sapphire
#

So then what am I doing wrong?

little eagle
#

script errors somewhere?

shadow sapphire
#

I have an editor placed helicopter, I pasted your code into that helicopter's init, I got no errors, it just explodes if I tip it far enough for the rotor to touch the ground. Maybe it's different for different helicopter models?

#

The one I'm using for testing is the Orca.

little eagle
#

I don't have Tanoa

shadow sapphire
#

I don't have Tanoa, either.

#

The Orca is a vanilla CSAT chopper from the base game.

dusk sage
#

Maybe as commy said, it's exploding due to everything else destroying itself

little eagle
#

Oh, I thought you mean the VTOL which looks kinda like an ORCA from C&C

shadow sapphire
#

Negative. The Orca helicopter that's called Orca in game.

lone glade
#

the new vtols are called the blackfish and Xi-an

little eagle
#

always with these fake names

shadow sapphire
#

@dusk sage, I expected it to at least delay a second or two. This stuff is INSTANTLY exploding. It's crazy. Maybe I'll just allowdamage false on choppers with .95 damage, the way I intended to originally.

little eagle
#

So, what do you want? the heli being totally invulnerable on the ground?

shadow sapphire
#

If only I wasn't so crappy at scripting!

lone glade
#

aka the fakesprey and the fuk-fysX

shadow sapphire
#

@little eagle, no. I want nothing invulnerable, but I want a delay between crashing and exploding.

little eagle
#

You should write a ticket to BI. Doesn't seem like something suitable for a script

dusk sage
#

It doesn't matter if you think you're crappy at scripting, this isn't a straight forward task, either way

shadow sapphire
#

@little eagle, it's hard for me to believe this isn't already a ticket. I can't have been the only one to notice that this behavior isn't right.

little eagle
#

I'll try something else

#

gimme a minute

shadow sapphire
#

The way we do our medical script is that we make players invulnerable at .95 damage, then if they aren't stabilized within a couple of minutes, they get setdamage to 1. I was hoping we could do something like that for helicopters. Just have them become invulnerable for one minute when they hit 95% damage, then set them to 100% damage at the end of that minute.

little eagle
#
this call {
    params ["_heli"];

    _heli addEventHandler ["HandleDamage", {
        params ["_heli", "", "_damage"];

        if (_damage >= 0.9) then {
            if !(_heli getVariable ["MyMission_killScriptInit", false]) then {
                _heli setVariable ["MyMission_killScriptInit", true];
                _heli spawn {
                    systemChat "heli about to explode!";
                    sleep 30;
                    _heli setDamage 1;
                    systemChat "boom!";
                };
            };
            0.9
        };
    }];

    nil
};
#

BUT

#

but helicopter create tons of particles when getting damaged

#

so this will looks really strange and eats tons of FPS

dusk sage
#

I already made something like this based on my original solution with HandleDamage

#

It worked but my game crashed

little eagle
#

And the passengers will probably still die due to damaged passed from the heliopter

#

Yeah, as I said

#

this isn't suitable for scripts

#

Even if "something like this" works for soldiers

#

helicopters are way different

#

I consider them bugged

#

shrug

shadow sapphire
#

@little eagle, haha, indeed. Definitely bugged.

#

Friggin DAMMIT, BIS.

little eagle
#

Sorry

#

This is the best I can do I am afraid

shadow sapphire
#

Okay, well, time to open a ticket,if one isn't already open.

#

Ugh. Yeah, all kinds of problems with that one, but it had a noticeable effect, at least.

little eagle
#

if it's of any consolation ....
just think about what Tank and APC guys have to deal with

#

Tracked vehicles fly around for no reason

#

no one cares about that either

shadow sapphire
#

@little eagle, and no modelled interiors for armor crews. Yeah, it's a pretty low quaity stuff, some of this.

little eagle
#

that would be acceptable

#

but they fucking fly around for absolutely no reason

shadow sapphire
#

That's pretty bad.

rancid ruin
#

so, all these new(ish) polygon related commands

#

but there's no in-built way to actually draw polygons

#

what do people do? just use map markers to mark the corners, then turn them in to a polygon?

queen cargo
#

mhh?

rancid ruin
#

que?

queen cargo
#

so, all these new(ish) polygon related commands

little eagle
#

In know of inPolygon and drawPolygon

#

dunno if they are related

#

my guess is that you use drawPolygon

#

to, well ...

#

draw polygons?

nocturne bluff
#

:O

#

What really?

lone glade
#

no you silly, use drawCircle with negative values ๐Ÿ˜›

#

because that's clearly how polygons are made

little eagle
#

What really?
ikr

#

I can't believe it either

native hemlock
#

How do I draw a pentagon then?

#

I don't see a drawPentagon command

lone glade
#

it's a polygon !

native hemlock
#

No it's a pentagon

#

And what about hexagons, heptagons, octagons, nonagons, and decagons

#

It's not fair to them to be left out

little eagle
#

How do I draw a pentagon then?

Syntax
Syntax:
map drawPolygon [polygon, color]
Parameters:
map: Control
[polygon, color]: Array
polygon: Array - array of positions in format [pos1, pos2, pos3,....posN], where pos is Position3D
color: Array - line color in format [r,g,b,a]
#

with drawPolygon ..

native hemlock
#

Sigh...

little eagle
#

that was a joke?

native hemlock
#

Yes, but clearly I failed

little eagle
#

sorry

#
#ifdef GETVAR
#undef GETVAR
#endif
#define GETVAR(var1,var2,var3) var1 GETVAR_SYS(var2,var3)
#

T_T

lone glade
#

OH NO MACROS

#

vade retro macronas

tame portal
#

ALERT ALERT

zealous solstice
#

Macro Rage in 3 2 1 ....

#

nothing? what is X39 AFK?

little eagle
#

macaronis

tame portal
#

We can fix that

zealous solstice
#

nooooo

tame portal
#

@queen cargo Macros detected

zealous solstice
#

nop

#

nopn

#

nop

#

there is nothing

rancid ruin
#

i mean drawing polygons in 3d or 2d editor, there's no way

queen cargo
#

leave me alone! making food currently (jalapenos with sandwich)

noble ether
#

so can anyone help with as to why this is throwing a 'generic error in expression' I have no clue

#
b = 2;
while {a < b} do {
    if (alive p) then {
        "marker_1" setmarkerpos (getPos p); 
        sleep 1; 
    };
        //x18 times
        if (!alive p) then {
        "marker_1" setmarkerpos (getPos nullUnit); 
        sleep 1; 
    };
        //x18 times
    sleep 10;
};

Generic error occurs on the 'sleep 10;' line

native hemlock
#

Probably not being run in scheduled environment

lone glade
#

that

noble ether
#

it runs at the bottom of init

lone glade
#

:facepalm:

#

we need a facepalm emote

native hemlock
#

I'm guessing it falls under Object initialization fields are called

lone glade
#

Just confirmed that remoteExec whitelisting increases bandwith usage by a huge factor

noble ether
#

it's at the bottom of init.sqf file. It works as intended in single player (still throws that error, but works) but in multi it throws the error and doesn't start the mission

native hemlock
#

Which is run in the unscheduled environment. In order to use waitUntil and sleep the script needs to be run in the scheduled environment

#
[] spawn {
    a = 1;
    b = 2;
    while {a < b} do {
        if (alive p) then {
            "marker_1" setmarkerpos (getPos p); 
            sleep 1; 
        };
            //x18 times
            if (!alive p) then {
            "marker_1" setmarkerpos (getPos nullUnit); 
            sleep 1; 
        };
            //x18 times
        sleep 10;
    };
};
#

Also using variables "a", "b", and "p" isn't really the best idea

noble ether
#

a and b are just there to keep it in the loop and p references the player, I could have done better names, but I'm lazy

#

cheers anyway, I'll give it a go and look into what [] spawn {} does

little eagle
#

With spawn you hand over your script to the scheduler.
The scheduler will make it so only 3 ms of SQF are being executed per frame.
Execution could be suspended and resumed later.
This also enables you to use suspension commands (sleep, uiSleep and waitUntil)

#

You have to be really careful about race conditions with global variables, because different "spawns" could access the variables at any time.

#

And don't make infinite loops with really short sleep intervals. It could prevent execution of the spawns from others (including BI) by taking away from those 3ms.
Yours look good.

queen cargo
#

i support you in that request @lone glade
there is a general lack of facepalm emoticons in the entire internet though ...

little eagle
#

We have picard as emoji in Slack

normal citrus
#

I'm trying to find all players, side civillian, that hold a certain variable, in order to send only them a message. Any simple way to accomplish this?

native hemlock
#

Is it a variable only known to their client?

normal citrus
#

No, it is a glabal variable

#

global

native hemlock
#

As in a public variable?

normal citrus
#

yes, sorry

native hemlock
#

One way would be to use remoteExec to execute a function on all civilians and on one of the first lines you could exit if they don't have the specified variable

#

Otherwise we need more information, as I don't know how a player can hold a public variable

#

Then they aren't holding it, because every client knows the value of that variable

normal citrus
#

I see. I think the remoteExec may work for me. How taxing on the server is it?

native hemlock
#

Probably a lot less than having a public variable for every client

normal citrus
#

lol, ok

normal citrus
#

@native hemlock if I'm remotExec a script, in that script do I refer to the client it is running on as player when I'm trying to see if the variable is present?

native hemlock
#

Yes

normal citrus
#

Thanks again

tawdry cave
#

How would one go about limiting, or removing via script, the spawn points created by the placeable tents (from backpacks, like "B_Respawn_TentA_F"? At the moment if you give a player that backpack on spawn, they can respawn with a new backpack and place unlimited spawn points

hollow fiber
#

Could I ask sqf questions about an error I'm getting?

jade abyss
#

No

#

(cough)

#

Of course, its "scripting" ๐Ÿ˜›

hollow fiber
#

I'm getting this error:

 20:50:23 Error in expression <select _i >> "variable")];
if((GVAR_MNS _str) < _matsNum) then {
if(!_vehicleChe>
20:50:23   Error position: <_str) < _matsNum) then {
if(!_vehicleChe>
20:50:23   Error Missing ) ``` 
located in this file:

{
if(_item isEqualTo (_x select 0))then
{
_matsNeed = _x select 1;
_invSize = count _matsNeed;
for [{_i=0},{_i<_invSize-1},{_i=_i+2}] do {
_matsNum = _matsNeed select _i+1;
_str = ITEM_VARNAME(_matsNeed select _i);
if((GVAR_MNS _str) < _matsNum) then {
if(!_vehicleCheck) exitwith {_allMaterial = false;};
if(!(([_trunk,_matsNeed select _i,_matsNum] call life_fnc_itemInVeh) select 0)) exitWith {
_allMaterial = false;
};
};
};
};
} foreach _config; ```

jade abyss
#

if(!_vehicleCheck)

#

if""" ( """"!_vehicleCheck """ ) """""

#

""" ( """" """ ) """""

#

( )

#

@hollow fiber

#

fk, brainfart

#

whistle

hollow fiber
#

I was like wtf

jade abyss
#

^^ Too long awake, brain had a huuuggee hickup

#

Ignore what i said. Had a brainfart here

#

What is GVAR_MNS doing?

#

(i fkn hate macros...)

hollow fiber
#

here is the whole file if it helps

#

let me double check on that @jade abyss

jade abyss
#

oh my... life

#

macro this, macro that, macro everything

hollow fiber
#

I know man, I'm new to this stuff, and the macros ain't helping

jade abyss
#

@Tonic you.... hmm... left Discord

hollow fiber
#

GVAR_MNS missionNamespace getVariable

jade abyss
#

...

#

try
if((GVAR_MNS _str) < _matsNum) then {
to
if(GVAR_MNS(_str) < _matsNum) then {

hollow fiber
#

alright will do

#

got it working

#

was missing two macros @jade abyss

jade abyss
#

Macro the Macro for the Macro to get the Macro Macroing

#

fk it

#

Yep

hollow fiber
#

Where did I go wrong....

jade abyss
#

No idea, but, tbh. no time for it now.

hollow fiber
#

@jade abyss Well thanks anyways man, you put me on the right track for the macro thing earlier ๐Ÿ˜ƒ

velvet merlin
#

macros = the evil of the lazy

willow basin
#

Gosh, how all these restrain scripts just loop the "hands on the back" animation with playMove, it's so sick to spam broadcast it <.< same with sirens etc.

queen cargo
#

wait wait wait ... broadcasted over the network each time "playMove" gets played?

#

or just the initial, unavoidable?

dusk sage
#

they are on a while loop

#

So every time it's used it'll broadcast

queen cargo
#

:facepalm:

#

simple thing to fix it:
broadcast the "startloop" and "stoploop" only

dusk sage
#

I get the logic behind that, but in reality, will it work? What happens during the mean time

willow basin
#

jep, best way would be to change the animation itself ~ otherwise to set a "restrain" variable or a variable with all restained players that get's looped on each client with switchmove... so it's locally only.

#

@queen cargo problem would be that newly connected players wouldn't get that, and making such persistent would be sick ๐Ÿ˜‰

queen cargo
#

nope
not really @willow basin

#

actually it is damn fucking easy to do that

willow basin
#

If I understood you correctly, you'd broadcast once something like "plr spawn fnc_doRestrain" via remoteExec... that'd work for connected players... but how would that work for connecting players without making the broadcast persistent or storing it in a synchronized variable?

queen cargo
#

if you just want to start it, you please the ppl

#

if you want it JIP safe, you use a variable

#

and the code lines required for that

#

are so damn few that even though i am at work i rly consider doing it ...

willow basin
#

I'm also at work ๐Ÿ˜‰

queen cargo
#
watched = [];
StartOrAddLoop = {
    params["_unit"];
    watched pushBack _unit;
    if(scriptDone loop) then
    {
        loop = spawn loopFnc;
    };
};
RemoveFromWatched = {
    params ["_unit"];
    watched deleteAt (watched find _unit)
};
loopFnc = {
    while{count watched != 0} do
    {
        {
            _x playMove "whatever"
            false;
        } count _watched;
        sleep 1;
    };
};``` still needs some adjustments but ... i am at work --> just quickly threw this together
willow basin
#

Will clean it up later or once I'm at home... everything is better than the current way it's being solved xD

dim terrace
#

is there way to get current CM selected?

willow basin
#

CM?

dim terrace
#

counter measuers

velvet merlin
#

maybe remove all weapons but it, and readd them thereafter

#

what cmds did you try yet to select it?

dim terrace
#

I don't want to select it

#

I want to know which one is currently selected

velvet merlin
#

you could try to read the interface dialog element that shows the current weapon/magazine/weapon mode text

#

if its not selected, but another weapon, that wont work - i dont think one can determine the current selected weapon mode or magazine of weapons not selected in general

#

one could try to cache the state, yet its probably not possible to do this reliably given the various ways the player or scripts can interfere

jovial nebula
#

Hi guys, i'm trying to create/move a module to a position after the start of a mission (so dynamically), i'd like to have the animal module created / moved (with respective animals) on the execution of a script.

velvet merlin
little eagle
#

counter measures / smoke are always "selected"

#

similar to hand grenades for soldiers

#

currentWeaponMode only works for turrets on the local machine of the turret gunner, by using the gunner as object instead of the vehicle

dim terrace
#

guess I will end with reading name from user interface, thanks for help

velvet merlin
#

np

jovial nebula
#

Anyone knows if the hotkey alt-f4 triggers handleDisconnect?

dusk sage
#

It shouldn't

#

Nothing is going to run when the game is closed

jovial nebula
#

Damn

#

Thx (for the 100th time)

dusk sage
#

๐Ÿ˜ƒ

lone glade
#

dafuq are you saying

#

handleDisconnect is serverside, of course it's going to be triggered

native hemlock
#

^

#

Doesn't matter how the player disconnects

jovial nebula
#

Going to test it if you don't mind

dusk sage
#

My bad, confused things with onPlayerDisconnected for a minute

native hemlock
#

You must be confused again, because onPlayerDisconnected is only executed on the server in MP...

tame portal
#

@native hemlock Shrekt

dusk sage
#

I'll take my leave, I must need the EU behind me to do this stuff

#

๐Ÿ’ฉ

little eagle
#

PlayerDisconnected, onPlayerDisconnected and HandleDisconnect are all server side

#

so it doesn't matter if you alt+f4 or crash or were kicked or however you left the mission

rancid ruin
#

as a general rule, is it a good idea to run as many of your scripts server-side as possible?

#

e.g say i'm spawning enemy units in towns when players are near

willow basin
#

Depends, don't overdo it. Server often has delays so time dependend stuff (like events) should be kept clientside

rancid ruin
#

is it better to run a script client-side, on the players, then tell the server "yo, i'm a player and i'm near a town", or better to run a script on the server checking where players are?

#

i've been keeping anything i can server-side, seems to be less hassle when it comes to locality, public'ing vars, debugging etc

#

not sure if it's good practice though

willow basin
#

It's better if the client does the work and tells the server to broadcast the results... especially with loops or AI stuff.

rancid ruin
#

so in an ideal world, with that example (spawning enemies when players are near towns) you think it'd be best to run as much of it client-side as possible?

#

kinda like how dayz mod did zombies, the client did most of the work

willow basin
#

yep.

#

AI should be either client side or be managed by an headless client

rancid ruin
#

well that's something i didn't know, thanks

compact current
#

Is it possible to play a video thats in a mod folder or mission file on to a billboard or arma object, or even youtube videos, im sure i have seen a command on the BIS Forums about LoadVideo or LoadYoutubeVideo or play, somthing like that anyway ?

#

he has a yt video of it in game

queen cargo
#

any info available about the cargo loading system in apex? (or at least if it is already inside of the preview build?)
want to build a mission in the next few days which is supposed to drop a vehicle and the crew using that MV22 thingy

halcyon crypt
#

Don't recall seeing anything "cargo loading system" related in the changelogs for the dev branch

#

Or is it the vehicle in vehicle thing you're talking about?

#

no clue if it's in the rc/preview branch though

queen cargo
#

apex preview

#

not dev

tulip silo
#

trying to make CHVD's display toggleable by the tilde key

#
    {
        if (_CHVDtilde) then 
        {
            _CHVDtilde = false;
            call CHVD_fnc_openDialog;
        }
        else
        {
            closeDialog 2900;
            _CHVDtilde = true;
        };
    };```
#

my prob is that _CHVDtilde = false and _CHVDtilde = true doesn't seem to change anything

little eagle
#

Is _CHVDtilde defined in the main scope?

#

This can be done by setting the variable private to the main scope.
Example:

private "_var2";

switch (true) do {
    case (true): {
        _var1 = 1;
        _var2 = 2;
    };
};

systemChat str [_var1, _var2];

->
[<any>, 2]
#

Other potential issue:
Is _CHVDtilde even defined? Because it's a local variable, but how you use it , I think it's supposed to be a global variablle (flag)

#

keep in mind that local variables don't keep there values, even if you execute the same piece of code multiple times

little eagle
#
[] spawn 
{
    waitUntil {!isNil "ExileClientLoadedIn"};
    "Main thread started" call ExileClient_util_log;
    while {true} do
    {
        if !(ExileSystemSpawnThread isEqualTo []) then
        {
            [...]
        };
        onEachFrame {};
        ExileSystemMainTimer = time;
        uiSleep ExileSystemThreadSleep;
    };
};

Why is Exile so unbelievable shitty and why are the devs such gaping assholes?
I had to debug this with a poor guy for 2 hours yesterday. We ended up creating a trigger that reapplies a dummy OEF stacked event every 0.5 seconds

#

Thanks for breaking TFAR and many many other scripted mods you asshats

tawdry cave
#

yeah, because it's TOTALLY their job to make sure THEIR mod is compatible with every other mod. Particular the ones YOU use.

jade abyss
#

grabbing popcorn

little eagle
#

@tawdry cave You have absolutely no idea what's going on. : )
Exile is deliberately breaking other mods with onEachFrame, probably for some ""security"" voodoo.
I don't use Exile, I just helped out a guy.

#

So go away with this silly C&P argument

tawdry cave
#

So if you don't like it, don't use exile? You're free to spend "two whole hours!!1" making your own better version.

#

their mod, their rules.

little eagle
#

I'm a dev and have to deal with bug reports from others using this shit code

#

It's annoying

#

And yes, it is their task to not DELIBERATLY break stuff.
If they don't then they can fuck off from this community

nocturne bluff
#

@queen cargo the cargo dropping dosent work in preview

#

so hohohoh

#

HO

#

explodes

tawdry cave
#

wow. You're incredibly entitled, surely you realise that

#

they've no obligation to do anything

#

You get what you're given. Don't like it, don't use it

delicate mason
#

Exactly, they're not obligated to do anything

nocturne bluff
#

Noone should use Exile huehue

delicate mason
#

They go out of their way to break stuff

tulip silo
#

going out of their way to break stuff is bad D:

tawdry cave
#

Their choice to do that. If it sucks, people won't play it, and they'll die and disappear

tulip silo
#

like, if the code's required for function, then yeah, it's fine, but if it's for the sole purpose of fucking up other mods

#

then it's just bad ethics

delicate mason
#

When commy posted that I thought "Well no one is going to bitch about that, they're literally worse than Altis Life"

tawdry cave
#

Could certainly be considered a dick move

#

But the charitable thing to assume is that it's required for some reason on their part. And if not, still their choice.

#

vote with your wallet (don't host an exile server)

tulip silo
#

hosts my own server with blackjack and hookers

torpid dagger
#

Actually, it is every modders job to make sure they don't collide with or break anything else

#

How would you feel if @little eagle, as an ACE3 core dev, would go and implement something in ACE that breaks Exile, RHS, CUP, TFAR, ACRE2 or whatever?

#

Or if CUP, which I am a part of, goes and renders ACE3 useless when used with CUP?

delicate mason
#

Well you can just not use them @torpid dagger :kappa:

torpid dagger
#

Yeah, and do you think the community would accept that? It would start a total shitstorm

#

If you're modding, stick to the golden rule: "If you don't want others to break your stuff, don't break others stuff"

#

If everyone would start breaking everyone else's stuff, all of us could only use one mod at a time

#

And that would seriously suck

#

So yes, @little eagle is absolutely right: It is their job to not break other's stuff

ruby spoke
#

Does anyone know if it's possible to change the license plates on vanilla vehicle models?

agile pumice
#

map makers and addon makers can set custom plates, I don't know about changing them dynamically via script

#

killzone kid had a page for it

little eagle
#

this is only a getter and no setter

#

it's also a dll, which might be overkill for something like this

ruby spoke
#

So I'm guessing the "setter" is hardcoded into the engine?

lone glade
#

isn't there a command for that ?

#

I remember seeing one a while ago

ruby spoke
#

hmm really?

#

I can't seem to find it

little eagle
#

isn't there a command for that ?
I don't think so.
The number plates for BWA3 vehicles can be set with a function, but those are completely different and cannot be compared

nocturne bluff
#

In VBS

#

i think

shadow sapphire
#

DeleteVehicle is the command to delete triggers, right?

lone glade
#

yes

shadow sapphire
#

Thanks!

rancid ruin
#

is there any way to tap in to a unit's pathfinding to discover the route it plans to take from A to B?

#

expectedDestination seems to be a short-term, short distance thing

#

need expectedRoute or something

lone glade
#

They override the default behavior of oneachframe

#

which is stupid because the stackable / missionEvent versions are better for taht

#

also about remoteExec whitelisting,
it increases the desync / bandwith use by a very significant amount

#

I don't know if it's a bug or intended but it's a pretty big issue

#

was using a server monitor / just checking two equal versions of the same missions but with different whitelisting settings

#

no idea, it could be related to why they disabled that mode back in 1.54 - 1.56 (can't remember the exact version)

little eagle
#

if you haven't noticed any problems, then probably not

lone glade
#

yes it's big enough to stop using whitelisting altogether, it's less noticeable on low populated servers, or server with very good upload

ruby spoke
#

wait are you talking about remoteExec whitelisting altogether or just in the case of onEachFrame being used in a function?

lone glade
#

remoteExec whitelisting itself

#

onEachFrame is an other discussion and don't matter in this case

ruby spoke
#

ooh ok

#

Is there any good way around it? As far as I know using remoteExec + whitelisting is the best framework for a callback system.

lone glade
#

no idea, need to ask BI

ruby spoke
#

I guess (in terms of creating a callback system) you could use public variable eventhandlers but from my experience they also tend to have a significant delay in transmitting data and function calls.

ruby spoke
#

btw, how can I whitelist functions that are in a mod?

lone glade
#

same as vanilla

#

you'll have to do it function by function

ruby spoke
#

What should I put as the folder path?

lone glade
#

wut, folder path ?

#

you don't need a folder path for whitelisting, it's the var where the function is stored that is used

ruby spoke
#

OH I see nvm

#

I was using CfgFunctions as a reference

#

I didn't know that CfgRemoteExec doesn't have a "file" property

#

So am I right to assume if I whitelist functions through CfgRemoteExec I don't have to declare them via CfgFunctions?

lone glade
#

you still do

ruby spoke
#

okay thanks

vital onyx
vocal mantle
kindred kayak
fallen locust
#

@tough abyss onEachFrame being reset evey main thread loop cycle was due to a security issue a while back where you could have set onEachFrame in editor then enter a server and that code would ran + hackers love onEachFrame

little eagle
#

So what? Use stacked eh. That has the same effect without blowing up stuff from everyone else

#

fuck you

halcyon crypt
#

Oh the love! ๐ŸŒž

fallen locust
#

nice to see maturity in CBA dev team ๐Ÿ˜‰

little eagle
#

bla bla bla

#

fuck you

#

blocked

fallen locust
#

Thanks for proving yourself 10/10

little eagle
#

,,|,,

jade abyss
#

munching popcorn

halcyon crypt
#

someone blocked someone, think you can put the popcorn back ^^

jade abyss
#

nope

queen cargo
#

its a beautiful day
anyone got an idea of a pure "mark" script command to mark some spots in code but which is purely meaningless?

#

should also contain a way to add some sort of label

#

more or less like a comment

little eagle
#

"mark" as in line number?

queen cargo
#

but without the comment part as configs do not like comments

halcyon crypt
#

something like #region in visual studio?

little eagle
#

configs can have comments too

queen cargo
#

more mark as in /* section A */

#

not the string fields

#

which is the problem i currently have

little eagle
#

Yeah, you cannot use comments inside strings

#

but why would you need that?

halcyon crypt
#

:p

queen cargo
#

my UI-Editor tool i create needs some way to add script commands so that eg. adding entries to a listbox would be possible from within

little eagle
#

Oh, so you end up with lots of SQF in config?

queen cargo
#

UI editor is supposed to do everything for you

#

that includes SQF in configs

indigo snow
#

if its your own textbox you could wrap it inside special characters and try to splitString it before parsing

#

non ideal solution of course

queen cargo
#

the result is always supposed to be a valid config @indigo snow

halcyon crypt
little eagle
#

Well, generally it is no good practice to have more than one line of SQF in config

#

the comment command would do it, but it's kinda stupid

queen cargo
#

@halcyon crypt noticed and just tested if it was still usable in SQF
youre my heroe today ๐Ÿ˜ƒ

halcyon crypt
#

YESSSS โ˜€

little eagle
#

I don't get the point of comment though

queen cargo
#

its for the auto-generated code @little eagle
youre kinda right .. but ... still ...

little eagle
#

You might as well put the raw string into the script

#

I mean, comment does nothing

queen cargo
#

that is the point

little eagle
#

you'd get the same result without the command though

queen cargo
#

creating thousands different files from within the editor would just be a nightmare as it would require a lot of other things (eg. project management)
want to avoid that
at least for the alpha & beta phase

little eagle
#
_x = 1;
comment "blah";
_y = _x + 2;

==

_x = 1;
"blah";
_y = _x + 2;
queen cargo
#

still it feels differenjt ^^'

little eagle
#

true

queen cargo
#

in the end though ... not rly saves you any performance

halcyon crypt
#

it's easier to scan for the comment command than it is to scan for a string ^^

queen cargo
#

that is true too

#

anyway
can continue with my work now

#

new release is comming up soon <3
but only rly usable with apex ... ^^'

little eagle
#

apex will come soon enough

halcyon crypt
#

same for ACE3 3.6.0 it seems, finally some activity in the release branch โ™ฅ

ruby spoke
#

Is it more secure to have clientside scripts run through a mission file or through a mod/pbo?

queen cargo
#

what do you mean with "secure"?

ruby spoke
#

Server-wise I guess. I want to make it an MP mission, so I'm trying to find ways to secure the functions better.

#

So I'm pretty much asking, what are the benefits of having scripts and functions in a mod/pbo rather than directly within the mission folder?

jade abyss
#

Yes

queen cargo
#

well ... if done correctly, you can in theory hide code from the player who however still can interact with that code

#

however ... that requires that you know what you are doing

#

and creates latency

#

assuming you speak about serverside mods

#

for normal client & server side mods it is just that the functions are available in all missions without readding them always

ruby spoke
#

Oh I see so if I wanted the functions available outside of my main mission I should just go with the modded option, but if the functions were specifically for my mission it would be best if I just left them in the mission?

queen cargo
#

exactly

ruby spoke
#

Would leaving them in the mission make the functions more vulnerable to exploits or is it generally the same in that sense?

queen cargo
#

no difference

ruby spoke
#

Ok, thanks.

winged thistle
#

is there a way to check if an event handler already exists on an object?

#

i.e. check if an EH exists at a specified index?

#

Also, does allowDamage false not work with collisions?

little eagle
#

is there a way to check if an event handler already exists on an object?
no, there is no function to report the event handlers attached to an object

winged thistle
#

Awww. Day ruined...

#

Thanks though.

#

Is there a way to prevent helis from exploding on collisions other than disableCollisionWith?

little eagle
#

disableCollisionWith is legacy from A2 and only works for non PhysX objects in A3

winged thistle
#

Ah

little eagle
#

allowDamage false should prevent damage from collisions though

winged thistle
#

Hm

#

It doesn't seem to

#

Also still lets my tires explode on collisions

little eagle
#

Well, not sure

#

allowDamage doesn't prevent damage from setDamage

#

It also doesn't prevent a soldier from drowning when reaching zero "oxygen remaining"

#

maybe there are more issues with it`?

winged thistle
#

I don't have scripted damage in. It's just normal engine behavior with a trigger that adds allowDamage false to each player/vehicle in the trigger zone.

#

It mostly works, except for tires and helis exploding

little eagle
#

I don't want to destroy your hopes and dreams

#

But I doubt you can solve that

#

We get this question every other day

#

or similar ones

winged thistle
#

Well, at least I've investigated it for months prior to bothering you guys ๐Ÿ˜›

#

It's too bad I can't do much there, but if it isn't possible, at least now I know.

#

If I could only check if event handlers exist on an object, I'd be able to selectively add/remove them where necessary

velvet merlin
#

there is no function to report the event handlers attached to an object
its been a while, but doesnt the index returned tell the story?

little eagle
#

You could add a dummy eh and check what index it reports

winged thistle
#

But the goal is to add the EH through a trigger if it doesn't exist.

little eagle
#

But that is very vague

#

Oh

winged thistle
#

So it'd be in a loop

little eagle
#

Just set a flag

winged thistle
#

Hm, good call

little eagle
#

if (!isNil {_heli getVariable "My_EHID"}) exitWith {};
private _index = _heli addEventHandler ...
_heli setVariable ["My_EHID", _index];

#

something like that

winged thistle
#

Very nice. Thank you very much.

#

Now to see if I can get it to prevent damage from collisions ๐Ÿ˜›

little eagle
#

Helis are very strange

#

Even if you add a HandleDamage event handler

winged thistle
#

It's like they are full of nitroglycerine

little eagle
#

they spawn tons of particles

#

So making a heli invulnerable can severly hurt FPS

#

by making the game almost freeze

#

It just keeps generating particles

winged thistle
#

...

little eagle
#

And "explosion sounds"

#

try it

#

it's hillariously bad

winged thistle
#

Sometimes I think Arma only exists to further my spiral into insanity...

little eagle
#

It's the case since Alpha of A3

#

It worked in A2 just fine afaik

#

must be something that broke with PhysX

#

one of the many many things

winged thistle
#

Is it wrong of me to hope that secretly they already fixed it and just didn't tell us?

little eagle
#

well

#

I tried it yesterday on 1.63

#

So the dev after the upcomming update

winged thistle
#

... So yes, it's very wrong of me.

#

All I want to do is ram a heli and watch it roll like a tumbleweed.

#

All without the pilot spilling a drop of his drink

little eagle
#

That's another thing

#

In helicopters the crew get's hurt by damage taken by the heli

#

So even if you make the helicopter inculnerable

#

the crew dies

winged thistle
#

well, at least the allowDamage false is already working for crews

#

So that part is covered

little eagle
#

Haha...

winged thistle
#

It's just the explosive helicopter behavior and paper tires I have issues with. Everything else is invulnerable atm

#

I even tried to use the protection zone model

#

Nada

little eagle
#

Another thing

#

Don't believe the wiki

#

The command does not prevent object from taking scripted damage such as setDamage or setHit.

#

setDamage still works

#

setHit, setHitPointDamage and setHitIndex don't

#

I edited it once, but it was reverted

winged thistle
#

Well poop. I was going to use setHit in the script I was going to try...

little eagle
#

That I haven't checked in a while

winged thistle
#

Well, I'm in the debug console atm... sec

#

Yeah, setHit didn't add any damage with allowDamage false on my player unit.

little eagle
#

yup

winged thistle
#

But it does when I walk out of the zone

little eagle
#

see

#

the wiki lies

winged thistle
#

Hm, what's interesting though is that it might still work

#

I added allowDamage true and set damage to my hands to 0.9

#

then, I did allowDamage false to my player, then set damage to my hands to 0

#

that actually worked...

#

So I can heal but not harm

little eagle
#

...

#

allowDamage doesn't have any effect on setHit, at least in Arma 2 OA. If this is Arma 3 related, leave a note, or if you want to edit description, make sure you include from which version of Arma 3 this behaviour has started. Killzone Kid (talk) 01:00, 17 October 2015 (CEST)

#

That's the answer I got

winged thistle
#

Well, that doesn't seem accurate anymore

little eagle
#

Yeah, but think of all those playing A2

#

...

winged thistle
#

Ah, yes...

#

Oh wait, I misread that.

#

So it doesn't work in A2, and it half works in A3.

little eagle
#

congratz

winged thistle
#

So wait until A4 when it works?

#

๐Ÿ˜›

little eagle
#

I use:
_obj setHit ["something", _obj getHit "something"];
to make PhysX objects fall after they were detached

#

Because they'd float otherwise

#

for some reason that only happens to objects that have at least one hitpoint, so they can take damage

winged thistle
#

lol a 'Poke' script

little eagle
#

yup

winged thistle
#

Yeah, I was seeing something similar in KK's blog on forcing ragdolls

little eagle
#

omg that script

#

don't ever use it.

winged thistle
#

I never ever will, especially not in MP

little eagle
#

the dummy object that collides with the player can wreck buildings

winged thistle
#

But it was fun

#

wait what?

little eagle
#

yeah. If you attach an object with a player, it also calculates collisions

#

As if the object just moved super fast

#

And if the player is standing near a wall or inside a door frame

#

the whole building blows up

winged thistle
#

I love finding those little easter eggs ๐Ÿ˜„

little eagle
#

If the player is near a tank or car, you can launch the vehicle with this

#

and make them flip over

winged thistle
#

I learned how to launch vehicles using setVectorUp to reset to the current position, but if you are by another vehicle, it will launch your neighbor

#

Yeah

#

^

#

I discovered it during the creation of my "Flip Vehicle" script

#

I wanted to create a mission like Mario Kart in Arma, but I don't know if it'll be possible with the physics and MP issues I'll encounter

west lantern
#

I edited it once, but it was reverted ???

Wth why that? Make a note there, dont touch or Ill bite you

ruby spoke
#

Does anyone know if there's a way to set new document templates in notepad++?

hallow spear
#

I once saw a dialog that had the RscEdit box increase in size as you typed more into it. Am I hallucinating, or is this possible?

noble ether
#

hey would someone check this over for me?

    _count = 0;
    {
        _count = _count + 1; 
    } forEach allPlayers;
    if(_count == 1) then {
        {
            hint format ["%1 is the last man standing!", (name _x)]
        } forEach allPlayers;
    } else {
        hint format["Another player had died. There are now %1 players alive.",_count];
    }
};```
it runs  through a trigger whenever a player dies. It should just count the number of alive players on the server and output the number
#

Just want to run it past someone as I can't test it with multiple people on a server for sometime

little eagle
#
    _count = 0;
    {
        _count = _count + 1; 
    } forEach allPlayers;

_count = count allPlayers;

jade abyss
#

^^

native hemlock
#

Wouldn't playableUnits be better? Since allPayers returns dead players

#
{
   hint format ["%1 is the last man standing!", (name _x)]
} forEach allPlayers;

This would also just cause the server to be spammed with hints looping through every player on the server saying they are the last man standing

noble ether
#

cheers guys

#

I guess i can also remove the {} forEach allPlayers as there will only be one alive

native hemlock
#

You would still need to use remoteExecCall or remoteExec if you wanted every client to receive the hint

noble ether
#

it's being called with 'Null = execVM "playerCount.sqf";' in the trigger

tame portal
#

Just me or did the AI forgot how to drive over bridges in dev branch?

#

Told one vehicle to cross the bridge, it just stood there 2 minutes calculating its route and then drove under the bridge to get to the other side lol

fading dust
#

hello

vital onyx
#

Hi

manic sigil
#

So, I have a trigger with onAct "OnEachFrame {dist = a getRelDir b;
hintsilent str dist;}". I want it to have a constantly updated hint box with the direction one unit is facing in relation to a specific point. Sometimes it works but only with the initial spawn direction, sometimes just with 'any' in the hint box.

#

Dumping the script into a's Init field makes it work for a split second when the mission starts, but then it sticks at whatever it hits - so the difference is a millisecond of .05 difference.

#

Running the same script in the editor's debug console function makes it work exactly like I want - but that's hardly useful for mission making.

#

Setting the variable to local while init in the unit seems to work. Problem solved, I guess.

little eagle
#

Don't use onEachFrame
https://community.bistudio.com/wiki/onEachFrame

In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and >BIS_fnc_removeStackedEventHandler should be used instead.

["someId", "onEachFrame", {
    hintSilent str time;
}] call BIS_fnc_addStackedEventHandler;
manic sigil
#

Huh, did not know that. After some headbashing I got it to working status again with >["Heading", "onEachFrame", {_dist = a getRelDir b;
hintSilent str _dist;
}] call BIS_fnc_addStackedEventHandler;

#

Is that the proper use?

manic sigil
#

Bluh... this would be a good deal simpler if I could figure out how Take On Helicopters' sightseeing missions were scripted. I get the feeling I'm trying to brute-force something that's actually really simple.

rancid ruin
#

@tame portal I couldn't get AI to drive over a bridge connecting two islands on tanoa yesterday

tame portal
#

Yeah they seem to be a bit clunky in dev branch at the moment

prime valve
#

All of the lies

lone glade
#

seems fine to me

#

they drove past the bridge between main and the southern one easily, same for foot soldiers

manic sigil
#

Seems to be exactly what I needed - a function measuring how a helicopter circles a target.

#

My issue now is making it work in ARMA 3, or if it's exclusive to Take On Helicopters.

#

At present, even trying to use the example returns "Type Script, Expected Nothing."

manic sigil
#

After testing in ToH and finding the example script to work perfectly, I'm resigned to accepting that it does not function in ARMA 3.

little eagle
#

Type Script, Expected Nothing

#

init box in editor?

#

just add ; nil to everything

#

it's stupid and useless, but hey ... Arma

tame portal
#

Arma has high expectations ho

willow basin
#

Ewww just realised that in Tanoa you can run up any rocky slopes, no matter the angle, aslong as they're flat <.< so no natural walls. Must reinforce my prison with actual walls.

tame portal
#

Well actually you cant run up every rocky slope but for that it has to be near 80ยฐ

#

Atleast when I tried it

willow basin
#

you can even glitch up 90ยฐ angles.. keeps you stuck but aslong as you keep running you'll get up.

sacred fox
#

what is the correct way to add multiple conditions to a if statement?
for example "if 1 = 1 or 2"

willow basin
#

you can use () i.e. "if ( (1==1 && var != 7) || 1 < 2) then {};" ( "||" equals "or" , "&&" equals "and" )

sacred fox
#

ok thx

#

im getting tired here :P

    {
        hint "Wrong kind of object";
    };```
#

that doesnt seem to work

#

i can get one condition to work, but not the second ๐Ÿ˜›

indigo snow
#

read up again on whator does

#

it only compares boolean values

lone glade
#

that || is misplaced

willow basin
#

Grr code tags...

lone glade
#

should be

if !(typeOf _object isEqualTo "object1" || {typeOf _object isEqualTo "object2"}) then {
    hint "Wrong kind of object";
};
sacred fox
#

ah!

nocturne basalt
#

Hi guys. How can I make my aircraft handle rougher landings without exploding? I want it to be able to take a punch. Can I make it immortal?

willow basin
#

in the init that would be "this allowDamage false;" or "this addEventHandler ["HandleDamage", {false}];"

little eagle
#

allowDamage

nocturne basalt
#

ok thanks. Can I also only make it take more punch and not make it immortal? adjusting armor or something?

willow basin
lean tiger
#

any tricks to force a unit to ragdoll? Like when hit with a vehicle? Ideally without having to throw APCs at them ๐Ÿ˜ƒ

nocturne basalt
#

Thank you Armitxes

lean tiger
#

@nocturne basalt Look into setVariable on the plane to keep track of incoming damage per-object

indigo snow
#

Why isnt there a 3DEN entity created EH? Do i really need to add an init XEH to fire in 3den? ๐Ÿ˜ฆ

#

Zeus has it with CuratorObjectPlaced

native hemlock
lean tiger
#

Ah, figures KK'd have something on it ^^

#

thanks man, I did google around bistudio first ๐Ÿ˜›

#

ah, he just uses that trick, yeah -- people on the forums were laughign they found a use for high mass tactical bacon ๐Ÿ˜ƒ

deft zealot
deft zealot
#

i dont get which in state a call of isNil (with a string as a parameter) should not be possible

queen cargo
jade abyss
#

setOwner: ID 0 = Server? or was it 1? (too lazy to search atm :P)

lone glade
#

0 should be the server

jade abyss
#

2 is Server, just found it

lone glade
#

fun fact: BI don't know how to calculate map size confirmed

private _mapSize = worldSize / 2;
private _wordArea = [[_mapSize, _mapSize, 0], _mapSize, _mapSize, 0, true];
#

found in BIS_fnc_randomPos line 48 - 49

jade abyss
#

hmm... deleting empty Groups not possible? oO

lone glade
#

it's possible

#

the engine doesn't do it automagically anymore tho

jade abyss
#

Ah, didn't meant deleting, i meant setGroupOwner

lone glade
#

it's a server command

#

make sure you remoteExec it.

jade abyss
#

...

#

Its beeing executed on the Server

#

+You should check your script, if the Groups are rly beeing deleted

#

ah

lone glade
#

they are, otherwise I would hit group limit very fucking fast

jade abyss
#

With script -> Nope

lone glade
#

they are.

jade abyss
#

make a diag_log str (count allgroups);

lone glade
#

I was monitoring the group amount live

#

line 27 takes care of it.

jade abyss
#

nope

#

won't change the owner or lets me delete it

#
diag_log "----";
{
   diag_log format ["%1 || %2 || %3 || %4",_x, (local _x), (units _x), (groupOwner _x)];
    _x setGroupOwner 2;
    diag_log format ["%1 || %2 || %3 || %4",_x, (local _x), (units _x), (groupOwner _x)];
    deleteGroup _x;
    diag_log "----";
}forEach allGroups;
jade abyss
#

nope... won't let me change the Owner of the Group or even delete it... -.-

lone glade
#

which version are you running, and where is this running

jade abyss
#

ONLY when i disconnect -> Server deletes the groups..

#

means -> They were not local -> Not deletable

#

Stable
DediServer

lone glade
#

possible

jade abyss
#

Not "possible" ^^ Its "fact" ๐Ÿ˜„

lone glade
#

would be weird to delete a non local group, just saying

jade abyss
#

setGroupOwner seems not to be working... :/

#

(with empty Group)

torn jungle
#

i have a flag object with this addAction ["Sleep for 2 hours", "skiptime 2"];

#

would this pose nay problems for multiplayer?

jade abyss
#

Yep

#

"Additional Informations"

#

means -> Must be executed on the server (so it gets updated for everyone)

#
  • last comment:
    skipTime executed on a client will change time on client for about 5 seconds after which it will sync back to server time. @torn jungle
torn jungle
#

oh. whoops, missed that part

jade abyss
#

Locality is a bitch sometimes ๐Ÿ˜‰

torn jungle
#

ok so i use: 2 remoteExec ["skipTime", 2]

#

soit would look like: this addAction ["Sleep for 2 hours", "2 remoteExec ["skipTime", 2]"];

lone glade
#

yes

torn jungle
#

you sure i can use remote exec with addaction? also does that format seem right?

jade abyss
#

this addAction ["Sleep for 2 hours", { YourCodeHere }];

lone glade
#

seems right.

#

@jade abyss addAction also accepts strings

#

old format from A2 / OFP

jade abyss
#

Yeah, but its fkd up, when you use " in it

lone glade
#

oh good point, he didn't used single quotes

jade abyss
#

Like his "" "skiptime" "" ๐Ÿ˜‰

#

Thats why -> Stay safe and use {}

#

= )

torn jungle
#

oh right. quotes

#

because it is melting my head, youre right ill just go with this --> this addAction ["Sleep for 2 hours", { 2 remoteExec ["skipTime", 2] }];

#

correct?

jade abyss
#

No idea, test it out

lone glade
#

yes it's correct

jade abyss
#

(don't trust him, he always says "Yes"!!11oneone)

lone glade
#

๐Ÿ˜›

jade abyss
#

๐Ÿ˜›

rancid ruin
#

what's the best way to check if a position is inside a rock?

#

cos Arma 3 seems to think inside rocks is a nice stealthy place to spawn infantry and it's really annoying

lone glade
#

that's not arma 3, that's BI function

rancid ruin
#

you're right, i'm using findEmptyPosition

#

is there something like a findEmptyPositionWhichIsntAFuckingGreatBigRock command?

lone glade
#

oh findEmptyPosition

jade abyss
#

for example:

_PosCheck = _pos distance (nearestObject _pos);
if(_pos > 2)then{ SpawnYourStuff};
rancid ruin
#

thanks, i'll try that. does nobody ever really use findEmptyPosition then? it seems to totally fail at doing what it says on the tin

torn jungle
#

now i wanna add a fade in and fade out when resting.

#

so i made a script file

#

2 cutText ["Resting for 2 hours..","BLACK",2];
uisleep 2;
2 remoteExec ["skipTime", 2];
uisleep 1;
2 cutFadeOut 2;

#

my question is. How do i remoteexec a script file? i cant find it in the examples

torn jungle
#

Oh nevermind. it doesnt need to be called from a script. :p didnt know you could just cram all that into an addaction ๐Ÿ˜ƒ

vital onyx
#

pass script text as an argument to BIS_fnc_Call

lone glade
#

oh god please no

#

just put it in a function and call it FFS

#

BIS_fnc_Call is deprecated, it should NOT be used.

vital onyx
#

when was it deprecated?

lone glade
#

the instant remoteExec entered a dev mind

vital onyx
#

instant RE is optional

#

jip flag can be unset

lone glade
#

also, BIS_fnc_Call is just..... call

vital onyx
#

yes, but for call you need a function to be compiled and stored in a missionnamespace variable

lone glade
#

no

#

just no.

#

you can call code blocks too.....

vital onyx
#

well, yes

#

I used bis_fnc_call probably for a habit

lone glade
#

it's a remnant from BIS_fnc_MP

#

it should not be used ever again.

vital onyx
#

:)

#

can you then post and example when we can remoteexec a piece of code with call, and supplying arguments to that code?

lone glade
#

gimme a sec

vital onyx
#

like [{code},[params]] remoteexec ["call",-2,"jip_msg"];

lone glade
#

[[args], {code}] remoteExec ["call", target, jipFlag]

vital onyx
#

oh

#

params go first then?

lone glade
#

remoteExec args are the command / function args separated by ,

vital onyx
#

great

#

thanks for a new discovery

lone glade
#

also, arguments are resolved before being sent

vital onyx
#

yes, I know that

#

played around the code obfuscation a bit

lone glade
#

example : [["lol"], {hint (_this select 0)}] remoteExec ["call", -2]

vital onyx
#

nicce

#

thanks again

torn jungle
#

wow never new what functions were till you mentioned it. Read a tutorial, and now it works. And now i can add multiple rest options for different times. Way better then putting all of that in multiple addactions

#

Thanks again @lone glade @jade abyss

jade abyss
#

hf

prime valve
#

or you know, maybe public variables

little eagle
#

"BIS_fnc_call" has one difference to "call" in remoteExec

#

remoteExecCall executes all commands and functions in unscheduled environment

lone glade
#

remoteExecCall = scheduled

#

remoteExec = unscheduled

little eagle
#

remoteExec runs functions in scheduled, but commands in unscheduled environment

#

try it

#

{systemChat str canSuspend} remoteExec ["call"];

#

vs.

#

{systemChat str canSuspend} remoteExec ["BIS_fnc_call"];

#

That is the only use of BIS_fnc_call that I can think of

#

Generally it's a bad idea to send code over the network

#

because it can get huge

lone glade
#

it's also unsafe as fuck

winged thistle
#

This is so weird...

#

I have an array of IDCs, like this: _itemSlots = [1000,1001,1002,1003,1004,1005]

#

Then, I select the appropriate IDC from that array later, like this:
(findDisplay 46) displayCtrl (_itemSlots select _forEachIndex)
in a loop to fill all the controls with content.

#

However, when I change the variable _itemSlots to _10, everything stops working. It says _10 is a control instead of an array

#

What is this witchcraft?

#

That variable only appears in those two spots in the whole script.

little eagle
#

_itemSlots select _forEachIndex

#

_x

#

???

winged thistle
#

It's in a loop

#

{} forEach (another array that is the content)

little eagle
#

oh, associative array

winged thistle
#

Yus

little eagle
#

Do you call any functions in that loop?

winged thistle
#

It works one way but not the other. All I'm doing is changing the variable name. No other changes.

little eagle
#

Can you paste the whole loop?

winged thistle
#

I really can't. I'll get you a stripped down version

#

Please hold

#

There you go.

#

Like I said, the script works with a longer variable name, so if something is off there syntactically, it's probably just from me stripping it down.

lone glade
#

privates FFS

winged thistle
#

I'm allowed to ask for scripting help in the scripting channel. Calm down.

little eagle
#

would be my guess to

winged thistle
#

Oh, you mean private vars ๐Ÿ˜›

little eagle
#

you never set the home scopes of your variables

#

so it's probably colliding variable names

lone glade
#

yep

#

had the same issues a while ago, drove me crazy, now all my local vars are privatized

winged thistle
#

Ok, so just add private in front of my vars?

little eagle
#

well yes
you should understand how it works too

winged thistle
#

I understand scope

#

Just apparently not well enough

#

So you're saying if I change the var name to _10, that _10 is probably in use elsewhere and is causing a conflict here?

little eagle
#

Why are you renaming your variables to something like _10 anyway?

winged thistle
#

All the obfuscation

little eagle
#

Whats the point of that?

winged thistle
#

Tediousness

little eagle
#

You got what you asked for I guess

winged thistle
#

Let's just say, I'm not the boss, just the dev

lone glade
#

it's not obfuscation, it's stupidity

little eagle
#

Yeah

winged thistle
#

I'm quite aware boys

little eagle
#

Obfuscation would've to be done by a script

#

this just makes the code unmaintainable

winged thistle
#

I have separate versions

lone glade
#

and also tanks the performances

winged thistle
#

I'm actually getting about the same performance

lone glade
#

you're not obfuscating it then.

dusk sage
winged thistle
#

I'm doing a lot of things I'm not going to mention here

#

Thanks BoGuu

#

Seen it before

#

My goal is to manually obfuscate for now, then when I finish my mission, write a better obfuscation tool in C#

little eagle
#

I think you reuse the same variable name for different variables

winged thistle
#

These are all tangents though.

little eagle
#

and since you never use private

#

the variables collide