#arma3_scripting

1 messages ยท Page 444 of 1

hearty plover
#

So, I have gotten rid of all the syntax errors and type errors.

#

Now I am trying to figure out why my guy doesn't shoot.

#

He is 700 meters away

#

and he has line of sight.

#

Any input fellas?

meager heart
#

maybe target is null

hearty plover
#

I have that alive check debug it's output

#

and it's returning a group size of 1.

meager heart
#

out of ammo ? ๐Ÿ˜€

#
0 spawn {
    player allowDamage false;
    private _sniper = createGroup east createUnit ["O_sniper_F", player modelToWorld [0,1000,0], [], 0, "NONE"];
    _sniper reveal [player, 4];
    _sniper doWatch player;
    waitUntil {([objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos player]) >= 0.5};
    _sniper doTarget player;
};
``` works ^
#

range 1 km ^

hearty plover
#

Oh, that check vis is fancy.

#

Question

#
waitUntil {
        ([objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos player]) >= 0.5
    };
#

Will that shit out if the player dies / goes down while it's waiting?

meager heart
#

maybe not when he will die, but if player body will be removed/deleted...

hearty plover
#
while {[_targets] call ORMP_fnc_numberAliveInGroup > 0} do {
    private _targ = selectRandom units _targets; // select rand victim in group
    _sniper reveal [_targ, 4];
    _sniper doWatch _targ;
    // If in view, take the shot.
    if (([objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ]) >= 0.5) then {
        _sniper doTarget _targ;
    };

    sleep random[60, 65, 120]; // wait between shots (prevent shot spam)
};
#

Will that preform as expected?

#

If the targ is in view, take the shot, otherwise on to the next target

#

as per the while loop?

#

Also, should I convert the while loop to a spawn call within the function.

#

I don't normally like while loops to be honest.

#
[snp1, ormp1, false] spawn ORMP_fnc_sniperFire;
[snp2, ormp2, false] spawn ORMP_fnc_sniperFire;
#

That is in a script called manageSnipers.sqf

#

that gets kicked off in the init server.

#

Will this work as I think it will, and both of these happen 'at the same time' meaning I don't have to wait for the first sniper to finish to have the second one do stuff.

meager heart
#

maybe you can make function for that shot and then just call it, without loop

hearty plover
#

Example of how you would do that?

#

The goal of the effect is to.

  • have sniper at static pos in distance
  • have player team someplace in sight
  • continious sniper fire, if sniper can see players, ends when out of ammo or sniper dead.
#

The conttinious part is what kills me.

#

D:

meager heart
#

hmm

hearty plover
#

I want the use case to be this.

#

Place a 'sniper' in editor. Give him a hold waypoint or something.

#

in init.sqf / initserver, etc.

#

call this function, pass the sniper, and his target group.

#

enjoy recreating that scene from full metal jackety.

meager heart
#

lol

hearty plover
#

these functions will be eventualy handled by some sort of 'situation manager'

#

the goal of the frame work is to create a suite of puzzle peices for creating 'combat situations'

#

arty fire, sniper scenarious, etc.

#

and be able to kinda plug and play them to units without init calls on the units.

meager heart
#

just wait until players group will be at that "AO", select player, pass him in that "shot function" and that's it... ๐Ÿ˜€

hearty plover
#

Haha, yeah.

#

I am gonna test thee change now tho.

#

With the spawn methods, and see if it works.

meager heart
#

probably the easiest way is just distance check

hearty plover
#

oh?

meager heart
#

for the players

hearty plover
#

Like, if targets, in distance, do shot.

#

That works for a single shot, I wan't continious for this one tho.

meager heart
#
private _script = [] spawn {/* here some code, for the all checks and call for the 'shot fucntion'*/};
waitUntil {scriptDone _script};
//--- more checks
[] spawn _script;
#

kinda loop without loop

#

but this is not really far from while loops, in performance

#

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

hearty plover
#

Yeah.

#

I mean, I could have some kind of manager in place in the future.

#

For now I can do it manually, and just not fire more than 1 or 2 of them at a time.

#

I wish there was some way to see the status of the scheduler.

#

OR something.

#

Hmm

#
// 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];
    _sniper doWatch _targ;

    // If in view, take the shot.
    if (([objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ]) >= 0.5) then {
        ["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
        _sniper doTarget _targ;
        _sniper doFire _targ;
    } else {
        ["INFO | ORMP_fnc_sniperFire | No shot"] call ORMP_fnc_log;
    };

    sleep random[60, 65, 120]; // wait between shots (prevent shot spam)
};
#

I am always getting the no shot coming back.

meager heart
#

ORMP_fnc_log < what is this ?

hearty plover
#

Just a logging function that slows down execution.

#

Wraps a remoteExec call of system chat

#

Later it will do more.

#
params [["_text", "", [""]]];

[_text] remoteExec ["systemChat", 0, true];
sleep 3;
meager heart
#
"INFO | ORMP_fnc_sniperFire | Taking shot" remoteExec ["systemChat"];
``` you can just ^
hearty plover
#

I know.

#

But like I said, I want' to exapand that a bit later.

meager heart
#

_targets < that is group ?

hearty plover
#

Yes.

#

It is a valid group, I know it's correct because I tested against a invalid group as well.

#

And got the expected output, that the group size was zero.

#

Group size comes back as 1 with the valid group.

meager heart
#

if you have reveal in a loop, i think you need forgetTarget also

hearty plover
#

Oh?

meager heart
#

from the wiki

Values greater than or equal 1.5 reveal the side of the target, too.
#

kinda spam...

#

i mean _sniper reveal _targ; if sniper cant see the target _sniper forgetTarget _targ;

hearty plover
#
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];
    _sniper doWatch _targ;

    // If in view, take the shot.
    private _vision = [objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ];
    if (_vision >= 0.2) then {
        ["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
        _sniper doTarget _targ;
        _sniper doFire _targ;
    } else {
        [format["INFO | ORMP_fnc_sniperFire | No shot, %1 vision, needed 0.2", _vision]] call ORMP_fnc_log;
    };

    _sniper forgetTarget _targ;
    sleep random[60, 65, 120]; // wait between shots (prevent shot spam)
};
#

So, first loop... target not in view, output as expected.

#

move into view

#

Second loop

#

I am in view, output is expected, and I can see visible movement on the ai as he aquires me as a target, but he doesn't shoot.

meager heart
#

something with his weapons/ammo maybe ๐Ÿ˜€

#

also just _sniper reveal _targ;

#

and

#
if (_vision >= 0.2) then {
        ["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
        _sniper doTarget _targ;
        _sniper doFire _targ;
    } else {
        [format["INFO | ORMP_fnc_sniperFire | No shot, %1 vision, needed 0.2", _vision]] call ORMP_fnc_log;
     _sniper forgetTarget _targ; //--- forget if cant see
    };
hearty plover
#

I forget at the end there.

#

before the sleep.

meager heart
#

no i mean... use it, if he cant see (inside if)

#

before the sleep
not there

hearty plover
#

Okay

#

He is still not shooting..

#

odd..

meager heart
#

and you can delete your message

hearty plover
#

I just blocked him.

#
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];
    _sniper doWatch _targ;

    // If in view, take the shot.
    private _vision = [objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ];
    if (_vision >= 0.2) then {
        ["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
        [format["INFO | ORMP_fnc_sniperFire | Target in sight, %1 vision, needed 0.2", _vision]] call ORMP_fnc_log;
        _sniper doTarget _targ;
        _sniper forceWeaponFire [primaryWeapon _sniper, "SINGLE"] ;
    } else {
        [format["INFO | ORMP_fnc_sniperFire | No shot, %1 vision, needed 0.2", _vision]] call ORMP_fnc_log;
        _sniper forgetTarget _targ;
    };

    sleep random[60, 65, 120]; // wait between shots (prevent shot spam)
};```
#

Yeah, I don't know @meager heart it's still not firing..

#

Would you be willing to test it?

meager heart
#

i'm on the "wrong pc", cant test it atm... sorry, Jay

#

just spawn vanilla ai and try it in perfect conditions (vr maybe) also hint or systemchat on every "stage" will helps

hearty plover
#

Haha, you read my mind

#

already doing that now.

meager heart
hearty plover
#

It has to do with the checkVis I think

meager heart
#

i posted example above, with that thing... it works

#

try it in the console

#
0 spawn {
    player allowDamage false;
    private _sniper = createGroup east createUnit ["O_sniper_F", player modelToWorld [0,1000,0], [], 0, "NONE"];
    _sniper reveal [player, 4];
    _sniper doWatch player;
    waitUntil {([objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos player]) >= 0.5};
    _sniper doTarget player;
};
#

this ^

hearty plover
#

I can get him to fire.

#

It's getting him to fire only when I want.

#

With the above, he just starts firing, no delay.

#

May be the best I can do, I am testing setCombatMode "BLUE" now

meager heart
#

"BLUE" > never fire

hearty plover
#

Yeah

#

I was hoping forceWeaponFire would work.

hearty plover
#

Man, this seems so damn fickle..

#

D:

#

Worked fine until I tested in on a dedi server and with a friend

tough abyss
#

When I add custom turrets and ammo to vehicles, will the AI use them? (addWeaponTurret)

warm gorge
#

How would I go about making it so that the continue button on a debriefing (triggered by BIS_fnc_endMission) takes you to the slot selection lobby rather than completely exiting to the server list?

winter rose
#

I think it would be more of a server config than mission scripting... Or a mod issue?

warm gorge
#

@winter rose I've seen lots of servers do it, but I'm not sure how which is why I was just checking to see if anyone knew

radiant needle
#

How would I go about removing large sections of grass?

winter rose
#

@radiant needle in the mission editor, there are "grass cutter" (small, medium, large) you can create to get rid of grass

#

@warm gorge it may be about mission cycle - last mission = "closing" the server

radiant needle
#

Like I need to clear 500x500

#

Is the cutter the only way?

winter rose
#

You could detect grass (idk how) and use hideObject maybe

radiant needle
#

IS there a good way to check to see if a spawn location is safe?

peak plover
#

Can lights be greated globaly?

remote monolith
#

depends on how you create your light

radiant needle
#

how come when I define a variable inside a switch do case

#

I cant use it outside the switch

peak plover
#

Does it use triggers Z size?

errant jasper
#

When did BIS finally fix side command? So that if you query a OPFOR soldier in a BLUFOR group it actually says 'west'.

digital jacinth
#

@peak plover light objects can be global, just the values of the light e.g. brightness and color are always local, you'd need to remote exec that on all clients

molten folio
#

Anyone knows about the Rsc Dialogs?

astral tendon
#

Are setPos commands effected by the unit direction? if so there is other command i can use?

peak plover
#

Anyoe got a template or know class for creating particle effect of like a tiny red light

#

nvm

peak plover
#

I need to make flare but Can't find flare classname

#

Now I'm just getting mad that lights and light flares don't work at day and making a particle flare/light is too fucking stupid

#

If anyone can help with particles:

_particle = "#particlesource" createVehicleLocal [0,0,0]; 
private _object = cursorObject;
_particle setParticleParams 
[ 

    ['\A3\data_f\ParticleEffects\Universal\Universal.p3d',16,12,8,0],"",
    'Billboard',
    1,
    1,//todo 0.1
    [0,0,0],
    [0,0,0],
    0,0,0,0,
    [1,1,1,0],
    [[1,0,0,1],[1,0,0,1]],
    [1,1],
    0.1,
    0,
    "",
    "",
    _object,
    0,
    true,
    0.5,
    [[1,0,0,1]]
];
_particle attachTo [_object,[0,0,3]];
_particle setDropInterval 1.0;
#

Can't get anything of thisto work

still forum
#

@winter rose You could detect grass (idk how) and use hideObject maybe No and no ^^
@peak plover Can lights be greated globaly? if you have a real model light you can use createVehicle which is global.
The SQF light point isn't though as you probably already noticed.

#

So far all the stuff I did with particles was... Randomly try to change things till something nice happens

#

Example particle classes ObjectDestructionSmoke1_2Smallx , Ace_cookoff_cookoff, BloodUnderwater1

peak plover
#

Yeah, I found that now. But issue is

#

There is no flare

still forum
#

Maybe look into the Flare CfgAmmo class and see what that does. Maybe you can find something there

#

Maybe there is just a particleClass entry ยฏ_(ใƒ„)_/ยฏ

ember oak
#

How i use channelEnabled? It's right this? if ((channelEnabled 8) select 1 isEqualTo true) then { hint "In call" }; if ((channelEnabled 8) select 1 isEqualTo false) then { hint "Not in call" };

#

I need to know if channel exist or not...

still forum
#

isEqualTo true doesn't make sense. It would do exactly the same if you didn't write that

#

and yeah.. I think that's correct.

#

You check the voice channel though. Not chat

ember oak
#

Yes i just want to check if you have that channel

still forum
#

if (true in (channelEnabled 8))
would check if you can access voice or text or both of that channel.

ember oak
#

Ok thank you!

shadow sapphire
#

Does anyone know how to limit the distance AI will wander away from a DISMISSED waypoint? Also how to kill one after a random amount of time?

peak plover
meager heart
#

say3D ?

peak plover
#

that takes cfg

#

afaik

meager heart
#

yep

knotty mantle
#

A question for the guys with good knowledge about performance is it better to do

private _enemies_in_zone = (allUnits - playableUnits) inAreaArray "defend_area";

in a scheduled script every two seconds or do that via a trigger detecting opfor?

still forum
#

uh...

#

do it in a scheduled script every 2 seconds. Or do it on a scheduled script every 0.5 seconds.
I think you can answer that yourself

#

You could also do it in a trigger every 2 seconds. That would be golden

meager heart
#

probably just inAreaArray [<position params>] without anything placed on the map, will be better... ? ๐Ÿค”

knotty mantle
#

Not sure if sarcastic or not @still forum Basically i have no idea how demanding that (allUnits - playableUnits) call gets when there are a LOT of AIs around. And i know that a trigger checks its condition rather often but i have no idea how he detects units in its area. If that is way better or even pretty much the same... Therefore could you clear that up shortly? ๐Ÿ˜ƒ

#

defend_area is a for the players visible marker on the map and i think i prefer the better readability over the possible performance gain in this case. @meager heart

meager heart
#

I think you can answer that yourself
that is the right answer ๐Ÿ˜€
test it...

#

may the fps be with you

peak plover
#

Hmm

#

So

still forum
#

Also you cannot kill the FPS with that anyway cuz scheduled

#

It's not demanding enough to care about. I thought you were talking about inAreaArray which is waaaaay more demanding than the single -

wary vine
meager heart
#

with camera functions

wary vine
#

just resize it... I had to come up with an alternative xd

#

just made an image that covers up part of the picture

meager heart
#

๐Ÿ˜€

wary vine
meager heart
#

we have only camSetFov and nothing for the aspect ratio afaik...

wary vine
#

yeah shit xD

#

I just had to bodge it, but it works.

modest temple
#

if the mission is running on dedicated server does unit setDamage 1; have to be run on the server, not just on the player?

cedar kindle
#

no

errant jasper
#

Is there a compileFinal version just for code? E.g:
MY_fnc_awesome = finalize {...};

still forum
#

no

winter rose
still forum
#

No. just for code

#

compileFinal takes string

winter rose
#

oh, right - indeed

#

compileFinal str code ๐Ÿ˜„

#

(just kidding, I don't know if it would work)

still forum
#

No it wouldn't.

#

Well. Kinda.. But then you have to call call my_fnc_stuff

winter rose
#

awful, but it "works"

errant jasper
#

If loading screen disappears after you having called startLoadingScreen, but not endLoadingScreen would this indicate an addon screwing with you?

still forum
#

this would indicate some other script somewhere calling endLoadingScreen maybe to end it's own loading screen

#

maybe use the BIS loading screen function

errant jasper
#

Thx, that did it.

worldly locust
#

How do I spawn via script a premade composition that's in the editor drop down already? So for example under Guerrilla there is Camp Site #1. Do I need to use objectgrabber and then mapper on this, or is it possible to output already as the file with all the offsets must exist somewhere to do it in editor?

little eagle
#

Write a script for it.

warm gorge
#

I know I asked this last night, but I'm still having trouble figuring it out. Does anyone know what determines whether the Continue button in the Debriefing menu forces you to the server browser (disconnect) or just back to the lobby?

little eagle
#

This is a strange question.

still forum
#

If the server kicked you.. You'll go back to server browser

#

otherwise I never experienced the button throwing me back to server browser

warm gorge
#

Yeah its very strange. I'm basically just calling BIS_fnc_endMission when the pause menu abort button is clicked, and whenever the continue button is clicked it freezes for a couple of seconds and then puts me to the server browser

little eagle
#

Why?

warm gorge
#

Huh?

little eagle
#

Why would you do that?

warm gorge
#

For a custom debriefing

#

Plus a couple effects before it

little eagle
#

strange stuff

molten folio
#

does "if(alive _x && _x != player) then" means if the player is alive and not alive?

#

or means Alive and dead?

little eagle
#

if x is alive and x is not the local player then ...

still forum
#

yes.. alive most likely means dead.

#

if it would mean alive. It would be named dead ofcause. To not confuse people

worldly locust
#

Write a script for it. now why didn't I think about that...I'm gonna just take that answer as a "I don't know and I can't be arsed trying to help you."

warm gorge
#
create3DENComposition [
    configFile >> "CfgGroups" >> "Empty" >> "Guerrilla" >> "Camps" >> "CampA",
    screenToWorld [0.5, 0.5]
];

I don't know which camp you want, but this is how you do it using the create3DENComposition command (https://community.bistudio.com/wiki/create3DENComposition).

#

@sand axledog [3CB]#2890

little eagle
#

Reddog, I question the approach of using a 3den composition for that in the first place. Imo you should ignore the 3den stuff and make something from scratch.

ivory nova
#

Should a function that is called from within a loop (in another function) include anything in particular within it so that the function can be called multiple times?

#

I have a couple of loops that call a function, but it only ends up being called once, irrespective of loop iteration

#

If I copypasta the function into the loop itself, it works as desired

little eagle
#

Does the function contain a breakOut/breakTo?

ivory nova
#

Nope

little eagle
#

Otherwise no, you can use a function as often as you want.

ivory nova
#

I see

#

More troubleshooting I guess (: Thanks

molten folio
#

@little eagle thanks for helping me โค

#

U saved alot of time

#

For me

little eagle
#

Good (I don't even remember, may be dementia).

molten folio
#

If u scroll up abit i asked about alive _x

little eagle
#

Yeah, I just translated it to English.

molten folio
#

Anyone knows how to make a RscText Clickable?

still forum
#

put a invisible button over it

molten folio
#

eehhh

#

could do

#

ty

little eagle
#

Could try

_control ctrlEnable true;
_control ctrlAddEventHandler ["MouseButtonDown", {systemChat str _this}];

But I am not sure this control supports this event.

#

enable part may be needed, or may not be needed.

molten folio
#

i wanna add Scripts to RscListBox

#

Any help? ๐Ÿ˜„

molten folio
little eagle
#

Why not try it? How could anyone here know if it works or not?

rotund cypress
#

If you clean up your code and stop using tabs, you might have an easier time getting people to help you. @molten folio

little eagle
#

Yeah, at least get the syntax highlighting right if you want it reviewed. And try to get the indents and formatting consistent.

rotund cypress
#

And yes, commands like lbAdd is what you're looking for.

little eagle
#

The script has 26 { and 30 }, so it is fucked.

#

Who's idea was it to name a global bann. Boy I hope they add a command with that name.

rotund cypress
#

Lels

#

Also _script1 = _display displayCtrl 901;

#

Why would you name a variable containing a display _script1? ๐Ÿค”

little eagle
#

Master of deception.

meager heart
#

that idd also

queen cargo
#

what was this loop again called?

for (int i = 0; i < somelargenumber; i++);```
*performance loop* was not what i can find the xkcd comic for (think it was xkcd)
little eagle
#

I believe it's called a for loop.

#

Not SQF, out

rotund cypress
#

Trolling right? @queen cargo

queen cargo
#

nah @rotund cypress
seeking a meme right now

#

think it was speed loop now

#

loops that can get removed so you can write at the end of week "improved performance"

little eagle
#

And how are you supposed to improve that one?

rotund cypress
#

Wait I am so lost right now.

queen cargo
#

removing a zero

little eagle
#

I think the SQF equivalent is:

for "_i" from 0 to 10000 do {};

And there's nothing inside the code block, so the whole thing is pointless and you can be praised for fixing performance by removing it later or something like that.

queen cargo
little eagle
#

โ€œThe idea is,โ€ Wayne continued, โ€œwhenever we have those really slow weeks โ€“ you know, the kind where donโ€™t actually fix any bugs or make any other changes โ€“ we just drop one of the zeros on the loop. And then we just tell the manager that we ran into some speed issues with the latest change request, but after a whole lot of deep-juju optimization, we were able to speed things up significantly and should be able to do the change request the next week.โ€
So essentially it's fraud.

#

You can get fired for this, this is a stupid idea.

#

Also: things that never happened.

errant jasper
#

It was unsuccessful fraud. Remember the interview question Wayne asked.

queen cargo
#

you have to check wording
manager gets told that from the programing department

#

it is essentially a joke

#

nothing else

little eagle
#

Imagine giving an interview and just making shit up.

errant jasper
#

I know it's a joke. Double on the irony what Wayne doesn't know the mistake himself.

queen cargo
#

speedup loops are pretty much a meme and only that
explaining away why some programs are dead-ass slow

meager heart
#

in sqf that kind of 'for loops' is "for forspec" ?

#
for [{private _i = 0}, {_i < 5}, {_i = _i + 1}] do {};
#

is that correct ?

queen cargo
#

yup

#

avoid it

#

like

#

always

#

take it as vodoo magic that should not work but somehow does

meager heart
#

not using it, i'm just asking

#

i mean... your question was >what was this loop again called ?

errant jasper
#

Speaking of existing but useless commands, why is scudState in Arma 3?

little eagle
#

Heh, he doesn't know about the SCUDs.

remote monolith
#

why for gods sake is there no z coord for markers? would solve so much problems...

meager heart
#

with rhs maybe (scud)...

queen cargo
little eagle
#

Because maps are flat.

#

2D has no third dimension.

remote monolith
#

maps are flat.....but you have buldings on it...dont you?`^^

little eagle
#

And?

remote monolith
#

even if.... we still could set it to 0 if needed.... lol

errant jasper
#

K. Didn't realize anyone but bohemia actually used that command.

#

Seems like it a bit redundant when there are animations...

meager heart
#

try it with rhs, Muzzleflash

errant jasper
#

I tried the 9P129-K while systemChatting the vehicle's scudState - it stayed 0 all the time.

meager heart
#

yep... just tested it

cedar kindle
#

a2 had a scud

#

probably for that

ivory nova
#

@little eagle Just to follow up re. function that was only calling once inside loop that continued to run: the function call only works if I spawn it, not call it - is that a memory thing?

little eagle
#

No, makes no sense to me.

ivory nova
#

@little eagle are you able to elaborate, or tell me where I can read more to understand that?

still forum
#

if you call it from unscheduled and try to sleep inside it, it will throw an error and abort your script. aka it won't run a second time

#

Any error that would kill your script would kill it and not have it run a second time. So check your RPT for errors

#

you could alternatively show us the script.

still forum
#

And for todays horrid code snippet. Desolation Redux!

params["_container"];

_weapons = (weaponsItemsCargo _container);
if(isNil "_weapons") then {_weapons = [];};

_output = [];
{
    if(typename(_x select 5) == typename([])) then {

        _output = [_x select 0,_x select 1,_x select 2,_x select 3,_x select 4,_x select 5,_x select 6];

    } else {

        _class = _x select 0;
        _muzzle = _x select 1;
        _side = _x select 2;
        _optic = _x select 3;
        _magInfo = _x select 4;
        _bipod = _x select 5;

        _newData = [];
        {_newData pushBack _x;} forEach [_class,_muzzle,_side,_optic,_magInfo];
        _newData set [5,[]]; // set launcher ammo to []
        _newData pushBack _bipod;

        _output pushBack _newData;
    };

} forEach _weapons;

_output;

What a beautiful piece of art

meager heart
#

nice to see, guys getting close to "maestro Q" standards ๐Ÿ˜„

still forum
#

well atleast they use params.... But only for _this. And also not param...
I'm sure they'll get it someday

#
params["_container"];

private _weapons = [weaponsItemsCargo _container] param [0, []];

_weapons apply {
    if((_x select 5) isEqualType []) then {
        _x;
    } else {
        //Insert empty launcher ammo at index 5
        (_x select [0, 5]) + [[], _x select 5];
    };
}

Can anyone come up with a better variant? Besides getting rid of the _weapons variable?

little eagle
#
_output = [_x select 0,_x select 1,_x select 2,_x select 3,_x select 4,_x select 5,_x select 6];

Imagine being the person having to write this down.

still forum
#

if(_container isKindOf "Men") exitWith {
Another snippet from them... Isn't it Man?

lone glade
#

imagine being the person that has to debug that

#

it's definitely "Man" or "CAManBase"

meager heart
#

but allDeadMen ๐Ÿคท

little eagle
#

It's Man.

#

And it should be CAManBase.

#

Men is 404

#

The weaponsItemsCargo array doesn't even have 7 elements, so no idea where _x select 6 comes from.

still forum
#

From the code snippet's i've seen. Desolation Redux seems to be Altis Life level script skill.

#

It has. If there is launcher ammo

#

that's not listed on biki apparently

#

aka secondary magazine in primary weapon

little eagle
#

secondary muzzle mag, okay.

#

I still don't get it. Why would it report the fift element as array... Fml, BI does skip the bipod for launchers and append the secondary mag at the wrong index, don't they...

still forum
#

Because if it has launcher ammo then _x select 5 is the launcher ammo array. And then the 7th element will be the bipod.
Otherwise 6th element is bipod string and 7th element doesn't exist

#

["arifle_Mk20_GL_plain_F","","","",["30Rnd_556x45_Stanag",30],["LAUNCHER AMMO,"1],""]
["arifle_Mk20_GL_plain_F","","","",["30Rnd_556x45_Stanag",30],""]
Yes the first one is a syntax error. Copied it like that from desolation discord

little eagle
#

Oh, they use "launcher" for grenade launcher!

#

launcher refers to the secondary weapons in my book.

still forum
#

yeah. Mine too

little eagle
#

Not ugl / secondary muzzle.

#

I get it now.

#
params ["_container"];
private _weapons = [weaponsItemsCargo _container] param [0, []];

_weapons apply {
    _x params ["_weapon", "_muzzle", "_side", "_optic", "_primaryMagazine", "_secondaryMagazine", "_bipod"];

    if (_secondaryMagazine isEqualType "") then {
        _bipod = _secondaryMagazine;
        _secondaryMagazine = [];
    };

    [_weapon, _muzzle, _side, _optic, _primaryMagazine, _secondaryMagazine, _bipod]
} // return

My version. Readability focus.

still forum
#

I personally would probably

params["_container"];

[weaponsItemsCargo _container] param [0, []] apply {
    if (count _x >= 7) then {
        _x;
    } else {
       _x insert [5, []];
       _x
    };
}

but we don't have that insert

meager heart
#

set ?

still forum
#

no

#

that replaces

little eagle
#

insert is like pushBack, but not necessarily at the end I guess.

still forum
#

pushBack element is equal to insert [end, element]

lone glade
#

it's ez ded, resize the array use set to move all the other indexes past the wanted index then use set to change said index

#

EZ I TELL YOU

little eagle
#

end + 1
I think, no?

#

Or rather, "size", not "end".

#

count it's in sqf, sry

still forum
#

in c++ end is an iterator pointing to one after the last element

little eagle
#

Ok, the same as count then.

#

I thought the end is the last element.

still forum
#

wasn't sure if count is correct. And didn't want to think about it

little eagle
#

So, and why the fuck would weaponsItemsCargo report nil?

still forum
#

It doesn't actually. I forgot to fix that

little eagle
#

The only thing that comes to mind is objNull.

still forum
#

Oh wait. if _container is nil then it wouldn't be executed and return nil immediately

#

no biki says objNull returns []

little eagle
#

If container was nil, the script would error in scheduled environment everyone loves so much.

#
params [["_container", objNull, [objNull]]];

weaponsItemsCargo _container apply {
    _x params ["_weapon", "_muzzle", "_side", "_optic", "_primaryMagazine", "_secondaryMagazine", "_bipod"];

    // no secondary muzzle means bipod takes the index
    if (_secondaryMagazine isEqualType "") then {
        _bipod = _secondaryMagazine;
        _secondaryMagazine = [];
    };

    [_weapon, _muzzle, _side, _optic, _primaryMagazine, _secondaryMagazine, _bipod]
} // return
still forum
#

They actually code in scheduled yeah..

little eagle
#
weaponsItemsCargo param [0, objNull] apply {
    if ((_x select 5) isEqualType []) then {_x} else {
        (_x select [0, 5]) + [[], _x select 5];
    };
} // return
#

WAIT

still forum
#

woah... dude

little eagle
#
#define CARGO(obj) (weaponsItemsCargo ([obj] param [0, objNull]) apply {\
    if ((_x select 5) isEqualType []) then {_x} else {\
        (_x select [0, 5]) + [[], _x select 5];\
    };\
})
#

The only correct answer.

still forum
#

Commy is the best SQF compression algorithm. Turning a 780 byte script into 170 bytes.

little eagle
#

tfw no algorithm to fix shitty code

still forum
#

we need a big neuronal network for that

little eagle
#

In the case of sqf, it would be a neurotic network instead.

lone glade
#

we got the best machine learning expert from the ACE3 slack here: me

#

it's very simple, SLAP THE EVERLOVING SHIT out of the bot until it works

little eagle
#

๐Ÿคข

lone glade
#

EZ

still forum
#

But flummi made the chatbot AI thingy

lone glade
#

slap NO BACKTALKING DED

#

everyone else is a bot except me, that's how it works

little eagle
#

Yeah, everyone who disagrees with me is a bot. I mean, could any real person even disagree with ME?

lone glade
#

Nope, thus we're both humans

little eagle
#

Damn right, toady.

unborn ether
#

Somebody said SQF compression?

little eagle
#

No.

tame portal
#

@little eagle I say your assumption is false

little eagle
#

bot

meager heart
#

there is new "shrug" for the bots ยฏ\๐Ÿค–/ยฏ

peak plover
#

ok I'm sure

#

I've asked this

#

And other people have asked this

#

Anyone have a snipped to test the slowness of scheduler and would I benefit from unscheduled?

#

Mainly doing missions, and from time to time

#

I'm using a loop, or a sleep here or there

#

So I'm like, maybe I should just move everything into unscheduled

#

I assume it's easier to find out what's slow with @still forum 's new tool

#

Btw is that out or what's the deal with that?

#

I saw some screenshots here last week

still forum
#

yes it would benefit

#

every scheduled script is slower than the same unscheduled script.

#

my profiler can't profile scheduled. It's currently in beta-ish https://github.com/dedmen/ArmaScriptProfiler/releases/tag/brofilerRC3
Ignore all the newer builds. I gotta disable that.
You start Arma with the mod. Go into a mission (Per frame handlers need to run) then start the Brofiler UI and connect to game. Then it starts to capture. Then you press the stop button and you'll see all the info that was captured

little eagle
#

every scheduled script is slower than the same unscheduled script.

if (!canSuspend) then {
    for "_i" from 1 to 10000 do {};
};
still forum
#

Oh right. Forgot to explain why.
The scheduler checks at every script instruction if the 3ms limit is already reached.
unscheduled doesn't have that check. Thus faster.

quaint turtle
#

Hey, is it possible to force a new line in a listbox? I've tried straight up doing + \n +, but that didn't work, so then i moved onto putting it into a stringtable, still didn't work. It just came up with test\ntest, anyone have any ideas?

little eagle
#

The same item with linebreak? I don't think that is supported, but may be wrong.

lone glade
#

you can't if the listbox entry isn't tall enough

#

plus you need to use endl

quaint turtle
#

Yeah - i'm not too sure either, i thought i saw it somewhere else, but idk

little eagle
#

Maybe what you remember isn't a listbox actually, but something else.

peak plover
#

Every instruction? Holy crap

#

That's so many useless checkes

still forum
#

not really that useless though.

#

you have to check somewhere

peak plover
#

I wanna improve (a bunch) so I'll try fixing as many bugs and move into unscheduled, Anything I should look out for when converting into unscheduled?

#

I already imagine

still forum
#

don't wreck fps

peak plover
#

Since some things really do need to check some things every second

#

I thought about that yeah

#

I know that at least 5 things will check every second

still forum
#

CBA.

peak plover
#

So I could have 1 dedicated unscheduled check that runs some codes every second

#

But wouldn't that mean

#

ALL of the code running every second

#

causes stuttering

#

every second

still forum
#

jup.

#

make it run faster then ^^

peak plover
#

So I should do separate checks that (hopefully) will not land near eachother frame wise

#

Yeah but there's gotta be a part where I can make it run as fast as possible

#

and then just cuz I have them all run on the same frame, they all kill

#

like 30 if checks are still 30 if checks, can't get aroudnthat

#

CBA seems nice for this yeah

little eagle
#

What do you need to check all the time?

still forum
#

maybe you can replace some by eventhandlers

little eagle
#

Yep.

peak plover
#

Well

#

I have a (i think) really good way of doing AI for ex

#

What I see some people do is make a loop for every group and set waypoints on completion and check for some things to happenn like caching etc.

#

since those things can be expensive I made 1 loop that checks 1 group every frame.

still forum
#

CBA statemachine ^^

peak plover
#

Issue with that was, I was using 2 men teams for enemies and had ~500 groups that were checked which ment the script took like ~4 seconds(on my machien) to check all of those

#

But if fps is lower the time went to like evne ~10 seconds

little eagle
#

I'd say keep the loop very simple and make the rest event based. Switch to unscheduled using isNil if needed. And if you're worried about performance, do a set amount of checks per frame and continue with the other groups and units next frame, so your ai stuff scales for tons and tons of ai without lowering performance.

peak plover
#

So that ment sluggish ai

lone glade
#

and had ~500
here's your issue

peak plover
#

Well

#

400 were cached

#

so those were only checking if they should uncache

#

Also something that needs to be checkd frequnetly enough due to speeds of some vehicles

lone glade
#

then you had a 100 groups

peak plover
#

sure

#

That's normal for ~20-30 player mission imo

#

coop

little eagle
#

Only check 20 per frame, continue with 21+ next frame. Something like that. Like you implement your own scheduler so to speak.

peak plover
#

I did something like that for my performance testing(clientside caching)

#

But it's hard to nail down some loss of performance in scheduled

#

And also

#

I moved so far

#

That instead of checking all the 500 groups

#

I dynamically cluster them

#

And only do like 50 checks for 500 groups

#

But like everyone keeps saying to use CBA

little eagle
#

Sounds to me like you're doing something no one else has managed to do yet, and want advice.

peak plover
#

I might just bite the bullet and say goodbye to possibility of doing vanilla missions

#

Well

#

I did that and from my testing so far

#

Client fps gets very nice gains

#

But by the time the gains made sense, the huge amount of ai caused server to drop performance

#

I havent tested with mroe than 3 people yet

little eagle
#

Amount of clients shouldn't matter as long as your stuff doesn't send data around a lot.

peak plover
#

Also if I move to a unscheduled workflow I can debug and find out what's slow faster

#

That's my issue commy

#

if a unit is hidden / disabled on the client locally to that client, it continues to move around wherever it's local

little eagle
#

synching stuff scales horribly in Arma, guess that's the price of server client structure.

peak plover
#

but positon updates cease

#

This means

#

If nigel disables all ai units on his client

#

they keep running towards him on the server

#

nigel never knew about movement

#

so he doesn't know to uncache

#

causing invisible (disabled/cached) ai to shoot poor nigel

little eagle
#

Sounds to me like that stuff should be managed on the server exclusively in the first place. Why would the client handle AI stuff?

peak plover
#

No

#

Client uses disableSimulation and hideObject

#

These commands have local effects

#

Causing nigel to gain FPS

still forum
#

hideObjectGlobal.
and disableSimulation has to be local where the object aka the AI is. If it's on the server it only needs to run there

little eagle
#

Yeah, but those command should be remote executed or some global event in case of cba. Not the whole loop on a client, just what's needed.

peak plover
#

So I made a system that sends the (TO UNCACHE) array of units to nigel from server. That way nigel knows what to uncache if they come towards him.

#

I don't wanna relay all client checks to server

little eagle
#

Why not?

peak plover
#

So all clients do caching loops. While server does a uncaching loop,

still forum
#

better 5fps less on all clients. than 0 fps on server ^^

peak plover
#

No

#

The improvement of disableSimulation andhideObject is bigger than you think. I went from like 40 to 70

#

fps

little eagle
#

So all clients do caching loops. While server does a uncaching loop,
Well that sounds awkward.

peak plover
#

So it's well worth it

#

I don't use global hideObject and disablesimulation because, I want units to be still moving arouind

#

This means

#

IF nigel is fighting in Berezino he only knows and sees units in Berezino.
Then commy is fighting in Vybor he only knows and sees units in Vybor.

This way there can be a lot more objects and units fighting around all over the map while also being cached and increasing performance

#

Basically nigel doesn't even know what commy is up to

#

If I do getpos commy on nigel

#

it will always be the position where disableSimulation was enabled on nigels client for commy's unit

#

Like I said, from testing clients gain A LOT of fps

little eagle
#

Sounds like you could do all this on the server. And abuse the shit out of that sweet inArea command.

peak plover
#

I do inArea

#

And clusters

#

But even then

#

I struggle to get the server to provide updates fast enough and without a performance drop on the server

#

However

#

The issue I have

little eagle
#

How many lines is this? I think you could write that in ~100 lines.

peak plover
#

Is that at the point when fps gains make sense, the server is already low on fps

little eagle
#

If you do this right, you don't lose any fps. These checks are simple enough.

#

It just gets annoying when you add vehicles and shit to this.

peak plover
#

I made a copy paste version with 1 file

#

1k lines

#

I also tell the server about which things have been cached on the client

meager heart
#

i hope that your tests with "improvements", was on dedicated server and that server was not on the same pc with your client, nigel

little eagle
#

Maybe I'm missing some essential feature, but 1k seems way too much.

peak plover
#

yeah it was on a dedicated server with HC and 3 clients

#

๐Ÿค”

little eagle
#

What's a cluster?

peak plover
#

It's a location that has a variable containing all units inside of it

#

So if I wanna check what to uncache for a client

#

I don't ahve to do 500 checks

#

Instead ~50

little eagle
#

LOCATION as in the data type?

peak plover
#

inArea

#
            // create location
            _location = createLocation [_nClusterType,_clusterPos,_distance,_distance];
            _location setVariable ['perf_cluster',true];

            _location setVariable [_nClusterUnits,_clusterUnits];
#

Yea

little eagle
#

That's more advanced than I though^^ Not convinced that all that is necessary, but if it helps that specific mission, I guess it's fine.

peak plover
#

Well

#

You try inArea for 500 units for 10 players

#

That's 5k inArea

#

That's a stutter/lag

little eagle
#

That's why you only do a set amount of units each frame.

peak plover
#

In that case

#

The check is so slow

little eagle
#

Then it doesn't matter how many ai there are.

peak plover
#

You get attacked by invisible ai

#

or have to increase the distance to a point where it makes less difference

#

I could do set amount of units each frame if I had a script per player

#

But I have 1 script chjecking a player per frame

little eagle
#

There're like 20 frames a second. That's 400 units each second.

peak plover
#

Maybe that might be better, idno

#

Also

#

Check dis out

little eagle
#

If you check 10 units a frame, and have 20 fps, you can have 12000 units on the map and check them all in one minute.

peak plover
#

inArea < sqf // get clusters that are in uncaching distance private _clusters = (nearestLocations [_pos, ["Invisible"], (_distance)]);

lone glade
#

why the fuck are you creating locations .....

still forum
#

He kinda already explained that @lone glade

lone glade
#

it's unnecessary tho

peak plover
#

Locations are faster than objects and inArea is slower than nearestLocations

still forum
#

I don't see how else to do it

lone glade
#

markers

still forum
#

with same perf

little eagle
#

arrays.

peak plover
#

markers don't allow setvariable

#

markers with arrays are slower

little eagle
#

I'm always for abusing the LOCATION type.

#

Though, nearestLocations, idk.

lone glade
#

nigel has what it takes to write a CBA module

#

huehuehuehue

peak plover
#

nearestLocations is faster because

#

inArea/inAreaArray would check all locations/clusters

#

meaning 50 clusters

#

nearestLocation was like almsot twice as fast with large amount of clusters

little eagle
#

From my experience, the more commands you use the slower shit gets, so there remains doubt in me. Though I obviously never messed around with your stuff.

peak plover
#

true

#

especially

#

since it's scheduled

#

hence my move towards unscheduled

little eagle
#

You could leave the loops scheduled, and move to unscheduled with isNil in the "events" part of the code. Though idk if scheduled is all that good for this in the first place, as it will probably break down when the server actually has load.

#

Does your stuff handle vehicles / crew?

karmic flax
#

Why is unscheduled better? Im still pretty new to Arma scripting?

peak plover
#

Yeah handles all objects and vehicles(including men)

#

@still forum Said: The scheduler checks at every script instruction if the 3ms limit is already reached. unscheduled doesn't have that check. Thus faster.

karmic flax
#

Ah, thanks

peak plover
#

Also profiling, so you can see exactly how slow your script is

karmic flax
#

Is there downsides to unscheduled scripts?

peak plover
#

if your script is slow the game will stutter/freeze

#

or fps will drop

#

In scheduled, if your script is slow

#

U'll jsut make the scheduler slower

#

causing ALL scheduled scripts to hinge on slow scirpt

lone glade
#

and ruin your framerate

little eagle
#

Is there downsides to unscheduled scripts?
It doesn't complain about undefined variables, which may cause scripts to fail silently.

still forum
#

you shouldn't use unscheduled if you don't know exactly what you are doing.

peak plover
#

It doesn't complain about undefined variables
Didn't know, thanks

lone glade
#

in some cases*

little eagle
#

In all cases.

lone glade
#

lies

little eagle
#

Example please.

lone glade
#

either i'm remembering wrong or i'm crazy but i'm fairly sure i've seen an RPT entry about undefined vars from an unscheduled func

peak plover
#

I make most of my things with

#

๐Ÿ‡ต ๐Ÿ‡ฆ ๐Ÿ‡ท ๐Ÿ‡ฆ ๐Ÿ‡ฒ ๐Ÿ‡ธ

little eagle
#

You dreamt that, alganthe.

peak plover
#

Using the default value so It's ok for me

still forum
#

Maybe that was from
diag_log [_number, 8, _number == 8] -> [8, 8, false] thing

lone glade
#

oh god don't remind me of that

#

I don't wanna remember that shit

little eagle
#

If _number were nil, it would log:
[<any>, 8, <any>]

#

No error.

lone glade
#

wait, that errors in scheduled?

little eagle
#

Yeah, Error undefined variable in expression: _number

#

We really do need that sqf blog, so I can write down all the diffs between scheduled and proper environment

still forum
#

It is there

#

and you can write

#

Why don't you just do it

lone glade
#

go make a PR commy

little eagle
#

This will be the first post if I ever write one.

peak plover
#

bad color

lone glade
#

told him already

peak plover
#

pls nerf

still forum
lone glade
#

like a month or two ago

still forum
#

Yes. I'm a design noob. I don't know how to do these things. Bux did everything. I only wrote the article

peak plover
#

The array copy methods praise god

#

So useful

still forum
#

didn't even know flat copy existed

lone glade
#

I still have to fix that one ace arsenal issue and finish the feature / framework doc overhaul but meh

little eagle
#

didn't even know flat copy existed
That is why we need that post.

still forum
#

y u no make then

peak plover
#

Shy?

lone glade
#

LUL

#

commy, shy? please

little eagle
#

I was a very shy kid, I think, maybe I just wanted to be left alone...

lone glade
#

that post needs to start with
//by commy2

#

๐Ÿ˜„

peak plover
#

It's okay commy, I'm just picking cuz im shy too

unborn ether
#

@still forum Can you please tell which TFAR functions are performed when somebody change waves?

still forum
#

Uhh.. wat?

#

how do you change waves? Slap the water with your hand?

lone glade
#

I think he meant frequency

#

unless he's a radio bender

unborn ether
#

^ yeah sorry

lone glade
#

correction, wave bender ๐Ÿ˜„

little eagle
#

ARR_2

still forum
#

Btw nigel. The profiler automatically add's measurement code to everything compiled with compile or compileFinal
But if you only compile one file that has all the functions inside it like myFunc = {} then it won't add measurement code into these as they are not directly compiled by the compile command

#

๐Ÿค” Why is ACE arsenal compiling campaignConfigFile>> "CfgUnitInsignia" >> "" and missionConfigFile>> "CfgUnitInsignia" >> "" and configFile>> "CfgUnitInsignia" >> "" and each of them twice in onSelChangedLeft? ๐Ÿค”

lone glade
#

uniform tab?

#

must be the BI func I call to reapply the insignia

#

the var is restricted

still forum
#

[Control #13, 35] are the args to onSelChangedLeft.

#

fillLeftPanel [#1127001, #2010]
Could be uniform yeah

lone glade
#

yep, uniform

still forum
#

The BI func doesn't have a scope though ๐Ÿ˜ฎ

little eagle
#

idc above 1e7 :^)

lone glade
#

that BI func is all sort of fucked ded

still forum
#

Yeah. Probably

[ace_arsenal_center, ""] call bis_fnc_setUnitInsignia;
[ace_arsenal_center, ace_arsenal_currentInsignia] call bis_fnc_setUnitInsignia;

Where ace_arsenal_currentInsignia == ""

lone glade
#

nowhere huehuehuehue

peak plover
#

Am I the only one that finds the giant BI single file scripts like arsenal confusing?
Would be nicer imo if they split it up

still forum
#

arsenal is a mess anyway. even if split up

peak plover
#

Still like the basic concept of having giant 1 file scripts

#

I do this only when prototyping a script

still forum
#

you can easilly open multiple files next to each other on multiple monitors. With a single file that's a little more tedious

peak plover
#

like the n00b way of defiing functions ```sqf
my_fnc = {
};

But I later move them into separate files and functions library with a comment in front of every file
tough abyss
#

I wish I had multiple monitors...

peak plover
#

You gotta get monitor and set it up vertically

#

Better for coding I've heard

#

Unless you are quicksivler

#

IN which case you need 3 widescreens to fit the code

still forum
#

3 widescreens. set up vertically. Stacked on top of eachother

little eagle
#

I have 2 additonal monitors, but they're 4:3

peak plover
#

๐Ÿค”

#

CRT?

#

Where'd u get 4:3?

little eagle
#

You keep them around from 2005.

#

Those are awesome when writing papers though.

#

Hate the scrolling you have with wide screens.

tough abyss
#

Hi guys! Is only one way to do network between server and client trough public variables and messages? Or there is semethink better?

winter rose
#

see remoteExec and remoteExecCall for example

little eagle
#

You have publicVariable(Client/Server), setVariable public, and remoteExec(Call) and that is all you could ever need.

unborn ether
#

Does ownership apply the same to createUnit, so if I create one from server it will return 2?

little eagle
#

AI units are local to the machine of the group leader.

unborn ether
#

So the first unit created in a group is a leader by default, or not?

little eagle
#

The group leader is whoever has the highest rating/rank. If they have the same rating, then the leader is the previous leader until someone else overtakes them. And if you create two units, the first created will be the leader and is never overtaken.

unborn ether
#

thanks

warm gorge
#

What determines whether or not a helicopter can pick up an object? Having trouble figuring out a way to return all of the objects that a helicopter is capable of slingloading

little eagle
#

The helis and the cargos configs.

still forum
#

Interesting.. BIS_fnc_colorRGBtoHTML also doesn't show up in the profiler.. Maybe it's all BIS functions

little eagle
#
#include "..\paramsCheck.inc"
#define arr [0,0,0]
paramsCheck(_this,isEqualTypeParams,arr)

private _hextable = [

    "00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F",
    "10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F",
    "20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F",
    "30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F",
    "40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F",
    "50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F",
    "60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F",
    "70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F",
    "80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F",
    "90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F",
    "A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF",
    "B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF",
    "C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF",
    "D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF",
    "E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF",
    "F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"
    
];

params ["_r","_g","_b"];

format [
    "#%1%2%3",
    _hextable select linearConversion [0, 1, _r, 0, 255, true],
    _hextable select linearConversion [0, 1, _g, 0, 255, true],
    _hextable select linearConversion [0, 1, _b, 0, 255, true]
]
still forum
little eagle
#

What do you mean? toHex is also a lookup table, except that it's generated on the fly.

still forum
#

BI variant per hex byte
0.0342ms 0.0337ms 0.0335ms
ACE variant
0.0036ms 0.004ms 0.0044ms
Okey.. yeah....

Didn't see the lookup table because of dynamically generated ^^

little eagle
#

The BI variant is slower because of 0-255 range,

#

But, it is ret... stupid to use linear conversion here.

#

Just multiply with 255, ffs.

#

I guess the clamp flag handles out of bounds, but why go for a lookup table then if you're going to waste time on input validation like that plus that paramscheck thingy from kk.

#

Oh, ACE handles out of bounds too, except efficiently:

_number = ((round abs _number) max 0) min 255;

All those parenthesis are superfluous btw.

#

@still forum Clock this one:

#define CLAMP(num) ((num) max 0 min 1)

if (isNil "commy_hextable") then {
    commy_hextable = [
        "00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F",
        "10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F",
        "20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F",
        "30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F",
        "40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F",
        "50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F",
        "60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F",
        "70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F",
        "80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F",
        "90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F",
        "A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF",
        "B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF",
        "C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF",
        "D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF",
        "E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF",
        "F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"
    ];
};

params [
    ["_r", 0, [0]],
    ["_g", 0, [0]],
    ["_b", 0, [0]]
];

format [
    "#%1%2%3",
    commy_hextable select CLAMP(_r) * 255,
    commy_hextable select CLAMP(_g) * 255,
    commy_hextable select CLAMP(_b) * 255
] // return
still forum
#

0.005ms 0.0056ms 0.0053ms

#

slightly slower than the current ACE variant

little eagle
#

Keep in mind ACE toHex is one color, while this and the BIS one is all 3.

still forum
#

yeah. I reduced every test to just one byte

little eagle
#

Hmm, how comes toHex is faster then? Lack of validation in params?

still forum
#

also removed the params. As I only have one number

little eagle
#

Maybe the 0-1 range as opposed to 0-255.

still forum
#

commy_hextable is shorter than ace_common_hexArray ๐Ÿ˜„

little eagle
#

Nothing beats:

call compile format ["0x%1", _hexnum]
winter rose
#
call compile ("0x" + _hexnum);
``` ?
little eagle
#

Dunno, unary + array, vs binary. Not sure which one comes out on top here.

winter rose
#

code length, I win
speed, I don't know. If it's the same as in C#, string + string is faster as long as there are less than 4 strings

little eagle
#

C# knows data types at compile time, sqf + has to check them for both sides during execution.

winter rose
#

well, format too in this example

little eagle
#

And + has a bunch of accepted data types. NUMBER, NAN, ARRAY, STRING.

#

format only requires an array on the right side. So it's only one arg to check and that can only have one data type.

winter rose
#

ah, I see - 1 check vs 2 checks
I would guess the overhead of format will cover the 2nd, but we can only test to be sure

little eagle
#

Yeah. Depends all on how these functions are implemented.

queen cargo
#

format should be slower then +

#

as format has to actually check the text

little eagle
#

than*

queen cargo
#

though ... it probably wont be noticable by this piece of text

little eagle
#

Also >should

winter rose
#

let's Arma test!

#

FOR SCIENCE

little eagle
#

YAY

winter rose
#

results:
format: 0.0016โ†’0.0018

  • : 0.0015
little eagle
#

close

winter rose
#

yup!

#

the thing is, it -may- be different if the string is bigger in SQF ๐Ÿ˜„

#

the variable name affects it too

little eagle
#

"FFFFFFFF" is the biggest string that would make sense here.

#

FFFFFF actually.

winter rose
#

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUโ€ฆ
is pretty adequate in SQF, too

queen cargo
little eagle
#

than*

queen cargo
#

mimimi

#

will never learn that

little eagle
#

will keep reminding you.

queen cargo
#

i know

#

and i actually appreciate it

#

ohh ... just noticed my format implementation is kinda broken ...
arma format has a 8k (iirc) char limit

winter rose
#

I will do this then that = one and the other after
I would rather do this than that = I prefer one to the other

little eagle
#

mimimi^

winter rose
#

haaah I always think of this video when someone write mimimi ^^

lone glade
#

wait, 8K? you're sure it's not 1K like diag_log?

queen cargo
#

assumption of mine is fixed buffer sizes

#

somebody just wrote

char formatbuffer[1024*8];```
little eagle
#

It's 8192, alganthe.

still forum
#

numberArrayToHexString [128,128,128] -> 0.0058ms
Commys script -> 0.0071ms
BIS_fnc_colorRGBtoHTML -> 0.0554ms
ยฏ_(ใƒ„)_/ยฏ

winter rose
#

BIS_fnc_colorRGBtoHTML also takes alpha in consideration (I mean, ignores it)

still forum
#

no it doesn't

#

it takes r,g,b

#

I don't know why the thingy says alpha

little eagle
#

But it doesn't?

#

I'm scared. What is the video.

winter rose
#

some stupid podcast with 69 (huehue) views, you can safely ban

tame portal
#

I don't want to click on it

winter rose
#

/me is warrior

#

wow, that was fast

little eagle
#

numberArrayToHexString
You're terrible with these names, Dedmen.

winter rose
#

LMS_fnc_ConvertArrayOfColourNumbersToHexadecimalStringToHtmlLikeFormat?

tame portal
#

HTML like?

formal vigil
#

Topic: Support Modules vs Multiplayer/Dedicated Server.

I have put Support Requester and Support Provider modules like in Jester's video (https://www.youtube.com/watch?v=uTVhTWPdg1M). The difference was that I haven't used the Artillery support, but the Transport one, so I have an ability to call evac/transport chopper. I've synched the Requester module to the RTO unit and the Provider to helicopter of my choice. Synced both Support modules and it works perfectly fine when I preview the mission in the editor. However, when I try to run the game in multiplayer/dedicated server the support request icon/option doesn't show up when I select the RTO slot. How to diagnose and fix what's happening here?

little eagle
#

Maybe the module doesn't work in MP.

ember oak
#

setCurrentChannel 5; is that correct? because is not working for me

winter rose
#

it seems to be that yes

still forum
winter rose
#

@ember oak , you may want to accomplish something but going at it wrong; what exactly do you want to do?

ember oak
#

@winter rose check pm

astral tendon
#

Do anyone know a script to close all doors with the nearestObjects? or if that is too hard just close all doors of the map.

still forum
astral tendon
#

If you wanna call me stupid you can just go ahead and say it, because I am not that stupid to not use google and test those scripts only to figure it out that it does not work or do what I want and come here to ask some one to give me the script or some other option.

still forum
#

You could atleast say that you tried it and it didn't work. Because if you ask people to give you a script to close doors. You should expect them to do that. And which is also what I did. I even showed you how I taught myself about how to do that. So that you can teach yourself next time and don't have to ask around.
How should I read your mind over the internet and know that you alread tried all this?
It sounded very much like you didn't even think of googling for it

little eagle
#

I think it's worse than calling one stupid, it's calling one lazy.

still forum
#

So it doesn't work. Which map? Modded maps/buildings might be different than vanilla

astral tendon
#

Altis, vanila assets and only CBA instaled

still forum
#

Just checked what google told me. I'm standing in the middle of Chalkeia on Altis and that code does open and close all doors in a 1km radius around me without any problems.

#

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

astral tendon
#

what was the one you use? i tested all the ones in the topic and replaced with player for the test

still forum
#

second post

#

with animate door_..._rot

astral tendon
#
0 = [getpos doorcloser,1000] spawn { 
sleep 1; 
 
{ 
 
private "_b"; 
 
_b = _x; 
 
for "_i" from 0 to 7 do { 
 
_b animate ["door_" + str _i + "_rot",0] 
 
}; 
 
} foreach (nearestObjects [MissionAirportArea, [], 100]) 
 
}

That worked, i had to change the nearobjects to nearestObjects

gleaming oyster
#

How would i go about finding duplicates of a word in a string?

#

Since find returns the index number in the string right?

still forum
#

yeah. And find only returns the first occurance. You could.. After you find the first occurence cut that off and then search again on the leftover string

little eagle
#

STRING select ARRAY

gleaming oyster
#

Hm, alright. I'll explore some options. Thanks dedmen, commy

little eagle
gleaming oyster
#

End goal is just to see how many times a word repeats, i'll take a look at this.

karmic flax
#

Hey why are scripts called with null or 0 infront, ex: null = [myunit,1234] execVM "test.sqf"

little eagle
#

That's only a thing in the editor. If you see it used like that anywhere else, it's just a bad copy paste.

#

The editor wants every statement in the main scope of a script to have no return value. There is no reason for this other than bad design by BI.

karmic flax
#

ah, thanks

#

I mainly do Java programming so SQF makes me want to tear my hair out more ofent then not

little eagle
#

than*

formal vigil
#

That's how you end up when programing in Java ๐Ÿ˜‚

tender fossil
#

Let's ask this here: how to learn to like programming?

#

To me it feels like sitting alone in front of screen, blindly staring at that cold, lifeless machine and getting frustrated because it doesn't work like I want (lol)

#

I'd like to work with people, not with machines

#

Do I have any hope?

still forum
#

work with documentation and code written by other people and teach yourself

#

machines were also built by people

tender fossil
#

Learning is not the problem, the problem is that I don't like it

#

I don't get kicks when I get my code to work, I get kicks when I'm being human to someone... And yes, medicine is my dream career, but it has the drawback of not allowing me to work remotely which option I'd really like to have

little eagle
#

The best thing about computers is that they never complain and don't have their own will or needs.

karmic flax
#

The best thing about computers is they do exactly what you tell them to

little eagle
#

Yes.

karmic flax
#

The worst thing about computers is they do exactly what you tell them to

little eagle
#

They don't correct themselves for minor mistakes you make by infering some goals of what you're trying to do.

tender fossil
#

Sitting down to code feels like entering a graveyard for me... I'm just staring at something that's cold and dead to me lol

#

I wish I would learn to like coding

little eagle
#

You don't have the freedom to change want you want, free will is a lie.

#

Aside from tricking your brain with rewards from sugar pills or drug injections I guess.

tender fossil
#

I don't believe in free will either ๐Ÿ˜ƒ

little eagle
#

See? This is why I don't like people. I say something that should be controversial and then they agree.

tender fossil
#

x)

little eagle
#

You could try to make something nice and useful, and then shill for it everywhere, so people thank you for your cool new feature.

still forum
#

If you don't seem to like coding. Then maybe that's just not supposed to be

lone glade
#

like me

#

make something that takes you something like 3 months then shill it for the next year or so ๐Ÿ˜„

#

speaking of which commy, who's tasked to rewrite cook off before the tonk updoot?

little eagle
#

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

lone glade
#

I still have to fix the arsenal cam over water but honestly it's so niche I might not even do it

#

it's such a pita

tender fossil
#

I've been thinking about industrial engineering too (which is focused on managing and leading high technology organizations in local uni)

#

But could you do it remote? Dunno

lone glade
#

doubt it

tender fossil
#

The reason I'd like to have a remote job is that I'd really like to move from Finland to eg. Spain because of the warmth and sun... I suffer from severish depression during Finnish winters that are dark and cold

lone glade
#

wait

#

you're in finland and don't take shitload of vitamin D supplements ?

tender fossil
#

This is the best country in the world, we just have shitty climate three quarters of the year ๐Ÿ˜„

lone glade
#

dude

tender fossil
#

Doc just put me on vitamin D test, will take it tomorrow

lone glade
#

finland is dark, even if you eat and live healthily you need vitamin D supplements

tender fossil
#

Yes, I'll know soon how much I need to take it

#

The thing just is that a pretty big chunk of the health benefits of vitamin D seem to be related to the lifestyle that causes higher vitamin D levels than the actual level of the vitamin itself (even though it does matter too, for sure)

little eagle
#

Uhm, offtopic?

tender fossil
molten folio
#

is it possilbe to have a Website in a Dialog?

little eagle
#

Or do you mean a hotlink?

north tree
#

this should prob be in the ask questions chat but is there anyone who could help me with the KP fuel consumption script it keeps throwing me the error "error generic error" i dont fully understand how arma is coded so it makes no sense to me.

little eagle
#

Post the script, post the line it errors, someone will probably help. This channel is the right one for this kind of thing.

north tree
#

thats just it idk what line of the code its talking about when it throws the error

little eagle
#

Check the rpt file. It should state which line.

north tree
#

ok

little eagle
#

%LOCALAPPDATA%\Arma 3

north tree
#

ok i just relised i said the wrong script its the one by shiragami that throws that error. my bad :-:

north tree
#

/*
Author: Shiragami aka Skullfox

Description:
Changes the fuel consumption of the vehicle

Parameter(s):
0: Vehicle

Returns:
nothing

*/

_vehicle = _this;

[_vehicle ] spawn{

_vehicle = _this select 0;

while { alive _vehicle} do {

_tick = _vehicle getVariable ["fox_fuel_settings_tick", 1.5 ];

    if (isengineon _vehicle) then {

comment "Data from config";
_rate = _vehicle getVariable ["fox_fuel_settings_rate", 0.00010 ];
_loadMultiplier = _vehicle getVariable ["fox_fuel_settings_loadMultiplier", 0.00005 ];
_tooFastRate =_vehicle getVariable ["fox_fuel_settings_tooFastRate", 0.00015 ];
_tooSlowRate = _vehicle getVariable ["fox_fuel_settings_tooSlowRate", 0.00005 ];


_crew = count( crew _vehicle);
    _load = _crew * _loadMultiplier;

    _speed = speed _vehicle;

    _speedMult = 0;

    if(_speed < 50 ) then { _speedMult = _tooSlowRate; };
    if(_speed > 75 ) then { _speedMult = _tooFastRate; };

    _realLoad = _rate + _load + _speedMult;

    if (!isNil "FOX_FUEL_DEV") then {
        hint format["Vehicle : %1 \n Crew : %2 \n Load : %3 \n Rate : %4 \n Speedload : %5 \n Realload : %6",_vehicle,_crew,_load,_rate,_speedMult,_realLoad];
  diag_log format ["###FOX_FUEL_DEV DATA: _rate: %1  - _loadMultiplier: %2 - _tooFastRate: %3 - _tooSlowRate: %4 - _tick: %5", _rate,_loadMultiplier,_tooFastRate,_tooSlowRate,_tick ];
    };

    _vehicle setFuel ( (fuel _vehicle) - _realLoad);

    };

    sleep _tick;

};

};

i can only asume that it is throwing errors about line 27-30 or 45-47 but im not sure

little eagle
#

Why are you not sure? Didn't look it up in the rpt?

#

The function header is a bit misleading. How do you execute this function? There is a potential problem with how the arguments are passed.

north tree
#

i have no clue and i cant find the rpt file. im not the best at scripting or that good when it comes to computers and finding files in the folders of games.

#

but ive been tring to trubleshoot this for the last month before comeing here

little eagle
#
  1. Copy:
    %LOCALAPPDATA%\Arma 3
  2. Press Win key
  3. Press ctrl + v
  4. Press enter
north tree
#

i feel stupid i even opend that folder and then just closed it like an idiot

meager heart
fringe yoke
#

Does anyone know a way to get the mission name in an SQF script?

#

Not the filename, but the Scenario Title that is set in Attributes -> Geneneral -> Presentation in the editor.

hearty plover
#

You can set it.

#

I don't know if it exists somehow in the missions namespace, prolly note.

#

not*

#

ARe you doing this in a way, where you don't already know the name of the mission?

fringe yoke
#

It's a script for a mod that runs on every mission, our server has randomized file names. So the mission file name will be something like missionAW6FD.pbo so that isn't helpful at all.

subtle ore
fringe yoke
#

I do not want to set the mission name during runtime, I want to get the mission name. Which is briefingName, in all my searching I couldn't find it, it was on the page.

velvet merlin
#

is it possible to get the target position from the BI artillery dialog? like some onMapClick EH in its map control?

tulip hare
#

hello all, I'm rather new to mission making and a total newb to scripts and the community I play with already has a mission template for zeus, was wondering if there was a script I can add to a plane or heli so that whenever someone ejects they would spawn a parachute and would still have their current bag when they reach the ground, for paratroopers scenarios. ty in advanced for replies.

#

I googled and looked for the scripts but they're all for the Eden Editor which I can't touch, I'm looking for a script I can add as zeus while already midgame

meager heart
#

is it possible to get the target position from the BI artillery dialog?
maybe something with: shownArtilleryComputer ctrlEH (afaik idd is -1 for arty computer) and ctrlMapScreenToWorld or onMapSingleClick ๐Ÿค”

modern sand
#

@fringe yoke not sure if this is the best way, but what you could do is set a public variable (Mission_Name = "missionAW6FD";) inside of the description.ext meaning manually do this in all of your mission files, just obviously change the string for each mission file. Then in an external script you could use the variable 'Mission_Name' to get the current mission files name.

still forum
#

He already found out that briefingName is the answer

modern sand
#

ops, didn't read the second part

modest temple
#

is there a way to make that has different things depending on who opens it

#

like if player 1 put a helmet in it player 2 could not see it

#

but player 1 still could

little eagle
#

Probably.

#

Depending on what you're actually trying to do, as I can't really decipher it from the first post, it's either like 5 or up to a million lines of code.

modest temple
#

im trying to make a box that works as a personal stash for players

still forum
#

just addWeaponCargo instead of addWeaponCargoGlobal

little eagle
#

But why? That would only be interesting if the box would persist after disconnecting etc.

still forum
#

and the item will be local

little eagle
#

Dedmen, but the item becomes global once you put it in by ingame inventory menu.

#

I'm thinking of createVehicleLocal.

still forum
#

Oh yeah.. That sounds much easier/better

little eagle
#

Probably needs some method to delete them on dc, as I'm pretty sure these crates would get transfered to the server on dc.

still forum
#

The wiki doesn't say if they get transfered. If they do that should be written down. That's a kinda important info

little eagle
#

It heavily depends on the type of object. I know that, at least a few versions back, vehicle vehicles became global once the owner dc'd.

#

This whole idea is kinda pointless if the boxes don't persist once you dc. And recreating boxes is a pain in the ass / impossible due to attachments etc.

still forum
#

<insert attachment sqf function rant thing here>

little eagle
#

Yeah, been there a thousand times already. Dead horse.

still forum
#

but you didn't throw the completed solution into their face

little eagle
#

There's none that satifies my autism. The moment they add it, I'll post this and a hundred other scripts.

still forum
#

make one that satisfies it

#

Take mine and modify the arguments to your liking ^^

little eagle
#

You mean using intercept? What good would that do when no one is using it.

still forum
#

no

little eagle
#

That's nice and all, but as long as it isn't in stable, no dice.

#

Also, I'd much rather have s/getUnitLoadout, but for boxes.

still forum
#

I can make that..... But....

#

You can already see how much code that one thing is

little eagle
#

addWeaponWithAttachmentsCargo

#

addWeaponItemsCargo

#

?

peak plover
#

addWeaponWithAttachmentsCargoGlobal

little eagle
#

WorldVisualWorld

still forum
#

Yeah. But wouldn't that be confusing. People might think you can use it to add items to a weapon that already is in cargo

peak plover
#

(((triggered)))

still forum
#

but you create weapon with attachments first. And put the entire thing into cargo

#

addWeaponWithItemsCargo would also be shorter ^^

little eagle
#

Lot's of cool stuff could be made, but never will, because the API is shit.

still forum
#

abstraction commy. abstraction. ๐Ÿ˜„

little eagle
#

How'd that help?

still forum
#

It'll hide the shittyness behind a polished piece of glass

warm gorge
#

How would I go about making a dummy object such as a hat from being picked up, and preventing any actions from popping up on it. I've tried creating it as a simple object, disabling simulation on it, removing actions on it but nothing seems to work.

still forum
#

a dummy object doesn't have any actions in the first place

#

Just like a bush.

warm gorge
#

For some reason it still has the Take action on it.

still forum
#

what simple object did you try? from classname or model path?

warm gorge
#

Class name

still forum
#

classname can add stuff like actions and hidden selection textures

warm gorge
#

Ah really? Ill try with the model path, 1 second

little eagle
#

It'll hide the shittyness behind a polished piece of glass
But we don't even have a turd stable enough to be polished. All we have is a pile of diarrhea.

#

Sure there are some undigested solid parts, but the bulk of it is slimey goo.

warm gorge
#
createSimpleObject ["Headgear_H_Cap_grn", AGLToASL (getPos player)];
createSimpleObject ["a3\weapons_f\dummycap.p3d", getPosWorld player];

What am I doing wrong here? The first one creates a dummy object, but I can't see it. The second one unsurprisingly doesn't create anything, not sure how I'm meant to put that into an actual hat class.

little eagle
#

Add the leading slash to the model path.

#

backslash*

warm gorge
#

How do I turn that simple object into an actual hat though, like Headgear_H_Cap_grn for example. That dummycap.p3d seems to be the model used for all dummy caps, so I'm not sure how I make them different

little eagle
#

???

#

sec+

#

Headgear_H_Cap_grn is a ground weapon holder (CfgVehicles). It uses a dummy model to display the model of the CfgWeapons class.

#

You need to use the model of the item (CfgWeapons) inside the cargo of that ground weapon holder.

#

And no leading slash. That was a mistake.

#

The first line simply creates the ground weapon holder, and as simple objects those probably don't display their cargo as proxies.

#

The second one is just an invisible dummy model.

warm gorge
#

Ah okay, I understand now. Cheers for explaining that, should be able to get it working now

little eagle
#

Nice. Btw. AGLToASL (getPos player) is not format PosASL, because getPos reports AGLS, not AGL. It only happens to use the same z iff there is no object with pathway LOD below the object.

#

Just getPosASL

warm gorge
#

Ah okay, alright will do ๐Ÿ˜ƒ

little eagle
#

Would be sad if the item got stuck inside a rock, pier or the aircraft carrier.

warm gorge
#

That is true lol

lone glade
#

or use ATL to not have your pos fuck up over water

#

trust me

warm gorge
#

How performance intensive are triggers? I've heard people say you should avoid using them, but I'm not sure whether its worth avoiding using them for something like messages for entering/exiting a specific zone

still forum
#

they check their condition every 0.5 seconds

#

If you need faster or slower then use script instead of trigger

#

if 0.5 is fine then just use triggers

little eagle
#

Every trigger also is an entity on the map. It's like placing an ai, just to have a clunky interface of something that could easily be achieved by script.

#

I'd say place a marker and write the 4 lines of code for the zone into the init.sqf.

warm gorge
#

4 lines? So you would prefer just a simple while loop with a distance/inArea check for the marker?

little eagle
#

Well, you would have way more control over what all it does.

#

Instead of checking all entities in an array, just check if the player is in that zone. And don't do anything on machines without interface.

#

And then you can also easily tweak those 0.5 s if you care, although two inArea checks per second are nothing.

warm gorge
#

Alright I think I might just do it that way instead. Considering I only want the message for entrance and exit of it, I'll just add in a couple of waitUntil's with a sleep for checking that

little eagle
#

4 lines is not enough, sorry, but I'm thinking of something that is no more difficult than:

// init.sqf
if (hasInterface) then {
    0 spawn {while {true} do {
        waitUntil {
            sleep 1;    
            player inArea "my_zone"
        };
        systemChat "entered zone";

        waitUntil {
            sleep 1;    
            !(player inArea "my_zone")
        };
        systemChat "left zone";
    }};
};
warm gorge
#

Im sure we could reduce the amount of lines with some compacting ๐Ÿ˜‰

#

Cheers though

little eagle
#

I actually like "long" code. As in making each individual line not too long, breaking things down.

fringe torrent
#

Hi, not sure where to ask this.
but is it possible to Broadcast/stream a spectator view from the server ? so u could link it to for instance to a website ?

little eagle
#

I just put that 0 spawn {while {true} do { inside one, because it's essentially an automatism, and scrolling isn't as nice in discord as it is in a text editor,

warm gorge
#

Yeah I do too, was just kidding. By the way, is there any reason why you pass 0 to the spawned scope rather than an empty array? Is it slightly faster or

little eagle
#

There's no reason to pass an array, and 0 is pretty much the simplest throwaway thing.

#

Literally null.

#

Preference I guess.

warm gorge
#

Fair enough

still forum
#

@fringe torrent Yes. Install a graphics card on your server. Then run the Arma 3 client on it and stream it somewhere with OBS or other software

lone glade
#

wait, from the server?
You'd need a second instance of the game running as client @still forum

fringe torrent
#

Ok thanx dedmen. Had hoped there was code or mod to do so.

knotty mantle
#

Do i understand it right that a unit/ded body that got removeFromRemainsCollector will lie there till the mission is over?

lone glade
#

wait, the garbage collector got fixed?

knotty mantle
#

It was broken?

#

๐Ÿ˜„

lone glade
#

yes, for like 10 updates at least

knotty mantle
#

Well it worked like i thought it should for my missions

lone glade
#

hell BI removed groups from it and added a command to add them back...

#

so now groups don't auto delete after they're empty, unless that got fixed too.

knotty mantle
#

Afaik they(groups) have a attribute for that now.