#arma3_scripting

1 messages · Page 278 of 1

tough abyss
#

Nope.

#

Nor have I tried to do it.

#

I'm done with A3 SQF

earnest coral
#

thanks tho

tough abyss
#

Well @earnest coral I can provide help

#

But I don't formally mod arma 3.

#

To seperate the server-side comment you normally user a server side init.sqf

#

inside a custom pbo

#

that PBO is added the mod loading

#

Then what happens is the server-dispatches remoteExec code to clients

#

The clients then process that data, then send it back to the server-side component.

#

It generates a lot of traffic overhead as arma 3 is not really designed to be a server-side -> client-side

#

message passing

#

it costs a lot.

cerulean whale
#

Ye. Less powerful machines feel it a lot more though.

cerulean whale
#

Well that's what one would think. .. but I find server to client traffic has far less effect to most people than it does to me, someone with a horrible pc

meager granite
#

@tough abyss The less scripting commands you have, the better

tough abyss
#

Any way to test things without the need to restart the whole game again and again... and again?

cedar kindle
#

file patching

#

diag exe for configs

little eagle
#

Was about to write that. Set up the dev environment and you just have to restart the mission. Some setups and you can even recompile functions during a mission.

tough abyss
#

i can change the files when using file patching and the server/client is running?

#

thanks!

dusk sage
#

two locations, that shouldn't need anything special

#
_myLocations = [loc1, loc2];
_locDistances = _myLocations apply {player distance (getPos _x)};
_nearestLocation = _myLocations select (_locDistances find (selectMin _locDistances));
#

If you want to use selectMin

#
_myLocations = [loc1, loc2]; 
_locDistances = _myLocations apply {player distance (getPos _x)}; 
_nearestLocation = _myLocations select (_locDistances select 0 > _locDistances select 1);
#

Is neater though

little eagle
#
my_fnc_nearerLocation = {
    params ["_origin", "_location"];

    private _distances = _location apply {_origin distanceSqr position _location};
    _location selectMin _distances;
};
#

Perfect case for distanceSqr for maximum speed

#

_origin is AGL

dusk sage
#

I don't think you can use selectMin like this, no?

little eagle
#

Why not?

dusk sage
#

It will purely return an element

#

From _distances

#

Which makes that a syntax error

little eagle
#

Oh, right

#

with find , right?

dusk sage
#

Yeh you need to find it in the distance array then select that element in the location array

#

But if there is only two elements, seems like a lot of overhead a simple > than could achieve

little eagle
#

Not so sure about that. Must test.

#

There is a massive overhead in SQF for every command used

#
my_fnc_nearerLocation = {
    params ["_origin", "_locations"];

    private _distances = _locations apply {_origin distanceSqr position _x};
    _locations select (_distances find selectMin _distances);
};
dusk sage
#

Yeh, the second example I posted should be quicker

#

Using find with 2 elements seems silly

little eagle
#

Sure, but SQF. It's not silly if it's faster

dusk sage
#

Gimme the results when you have them

#

If find is quicker I will eat my shorts in horror

little eagle
#

And find in two element array isn't actually that slow anyway

dusk sage
#

It's not slow, but you'd expect a quick* comparison to be quicker

#

In normal programming world, at least

#

Need to change what SQF stands for

little eagle
#

This is normal programming too. It's just that every command is a function with type checks instead of a low level "greater than"

#

We need a findMin and findMax

#
_arr = [127, 255];
_arr select (_arr select 0 > _arr select 1)

vs

_arr = [127, 255];
_arr select (_arr find selectMin _arr)
#

Is this right?

dusk sage
#

That's the discrepancy indeed. normal programming & low level

#

Selecting a minimum from an array, then finding that index in the array will be majorly slower than just a >

#

yeh that's right*

#

jesus oh god

#

I've been up far to long to make that typo

#

My words are just gone

little eagle
#

You don't do just a >

dusk sage
#

🙃 🔫

little eagle
#

you also do two select

dusk sage
#

you are just comparing

#

_arr select 0 > _arr select 1 vs _arr find selectMin _arr

#

As the rest is just duplicate

little eagle
#

select is a command too

dusk sage
#

yeh, but the result of either of those will be the same

#

So the result of selecting from the original array will be the same

little eagle
#

0.0053 ms

#

0.0047 ms

#

mine is faster

#

lol

dusk sage
#

if select has a big overhead, gonna be upset

little eagle
#

select has massive overhead, hence why params is so big

#

0.005 ms

#

0.0038 ms

#

yup, mine is faster

#

Every command has big overhead. select is a particularly shitty one.

#
_arr = [127, 255];
_arr select (_arr param [0] > _arr param [1])
dusk sage
#

That'll be slower

#

And if it isn't

#

BI need to fix their shit

little eagle
#

It's slightly slower

#

The difference is smaller than between selectMin find and select though

dusk sage
#

This all just saddens me

#

The fact they managed to create such a large overhead on one of the fastest operations is just

little eagle
#

Check the C++

#

two thirds are type checks

#

And select has many alternative syntaxes now

#

They all have to be checked. Many if's you're doing every time

dusk sage
#

The vanilla select requires nothing, so it's somewhat sad they couldn't avoid ruining it

little eagle
#

"vanilla select" ?

dusk sage
#

arr select index

#

I'll run this in C#, see what the results are

little eagle
#

Yes, it does check LHS and RHS types

#

selectMin for example only checks RHS type

#

That is 50% of 80% of the processing time gone

#

*estimate

dusk sage
#

A type check wouldn't slow it down that much C++ side

#

If it was left to purely arr select index, you're checking that index is an int

#

That's it

#

Which is negligible

little eagle
#

Maybe. I'm just trying to explain the observed behaviour. If you have better explanations that match reality, go ahead.

dusk sage
#

I'll do a select vs find in C#, hold on

#

Ignoring any type checks

#

Okay so, an int array of 1, 2 -> arr[0] > arr[1], then converting to int (like select bool would do in ARMA)

#

Is

#

80ms over 10m iterations

#

Same arr, finding the minimum, then finding the index of that element, over 10m iterations

#

is

#

403ms

little eagle
#

The vanilla select requires nothing, so it's somewhat sad they couldn't avoid ruining it

#

select wasn't ruined. It was always slow as dirt

dusk sage
#

Then

#

(╯°□°)╯︵ ┻━┻

little eagle
#

binary commands tend to be like that.

dusk sage
#

Was the plan to use a language for enfusion, or w/e it's called?

little eagle
#

Idk, should ask the devs

dusk sage
#

Even if that engine is the plan

little eagle
#

Okay so, an int array of 1, 2 -> arr[0] > arr[1], then converting to int (like select bool would do in ARMA)

#

Can you even test like this in C#?

#

Doesn't the compiler optimize everything away?

dusk sage
#

Sure, it does optimisation at runtime, but there isn't much you could abstract from it

little eagle
#

Idk how deep that rabbit hole goes. No programmer

#

Not a fan of machines thinking for you. But I guess that's better than getting more shitty programs from shitty programmers

dusk sage
#

Even with any optimisation, it still has to select the array twice, compare, then convert the bool to int

#

😄 yeh

little eagle
#

Oh, yeah. Now I remember why I tried param

#

_this select 0

#

is slower than

#

param [0]

#

Only works for _this of course

tepid quarry
#

Is there anyway to add all items to Arsenal EXCEPT default Arma 3 weapons? Updating a mission to incorporate VAS, but of course don't want a WW2 Map with the default Arma 3 weapons. Or do I have to do a whitelist :S?

little eagle
#

You have to fix the configs of the addon with the item.

#

oh, you want to remove the vanilla weapons

#

wait

tepid quarry
#

yes

#

I only want the WW2 weapons included with the mod, none of the default arma 3 weapons

little eagle
#

You cannot remove them, but you can add an Arsenal with only the WW2 weapons.

#

you have to go through all classes though

tepid quarry
#

yeah thats what I figured

#

But wanted to see if there was an easy way instead of whitelistinng

little eagle
#

No

#

I mean

#

You could write a script that reads the configs with and without the mod

#

and parses a list for you

#

But if you're not into scripting it's faster to do by hand

#

I think

tepid quarry
#

ok commy thanks!

rigid plover
#

Is there a way to hide script errors? I don't want to fix the error as it isn't causing a problem for the scene and I just want to film a quick cinematic shot and its in the way. I already have show script errors dissabled in the launcher and it is still there

indigo snow
#

are you previewing in 3den? 3den always shows errors.

rigid plover
#

yes

#

Is there a workaround? so errors don't show?

indigo snow
#

disable @sthud then

rigid plover
#

how do i do that?

#

in launc params?

indigo snow
#

dont launch with the mod, yes

rigid plover
#

Never mind just realised what you were saying ;D

little eagle
#

Fix the error ¯_(ツ)_/¯

#

Nah, you can just remove -showScriptErrors

#

They aren't shown by default, you enabled them with this startup parameter

indigo snow
#

The ones in 3DEN previews are independent from the parameter, they always show (in my experience)

little eagle
#

Check the screenshot

#

It's one of the -showScriptError ones

indigo snow
#

Yea i'm talking about those too. They show when you're previewing a mission in 3DEN even if you dont have the startup parameter enabled

little eagle
#

That's silly

jade abyss
#

commy2 - Today at 4:08 PM
Fix the error ¯_(ツ)_/¯

check #general_chat_arma @little eagle 😄

#

@indigo snow Since when? Do you know that? iirc i haven't noticed a msg in there oO

indigo snow
#

since it first came out man

little eagle
#

If there is an error, fix it. Everything else is retarded. Sorry.

indigo snow
#

was a bit suprised too

jade abyss
#

wut? oO

#

I mean, okay: Its an Editor.
You are never done learning. Interesting.

little eagle
#

Errors should always been shown. Imo

jade abyss
#

but think about the life-Server!

little eagle
#

It forces people to fix their shit or drop bugged addons

jade abyss
#

see msg above.

cerulean whale
#

Sometimes you might open a mission which its functions are serverside (like mine) and theb you cannot avoid errrors

digital pulsar
#

you can run it as hosted mp in eden

tough abyss
#

is there any Rsc or control that we cna create for a color picker or any thing arma related

#

if not would it be possible to make one?

#

also can it return "#(rgb,8,8,3)color(0,0,1,1)"

meager granite
#

you'll have to script it yourself, there is no ready color picker control

#

check how color pickers are implemented (tons of examples online), insert image with range of colors, add click event hander and translate mouse position into position on color picker image

tough abyss
#

thanks

hallow spear
#

is there any way to accept any value for the second position in an array? ex: [0,*]

tough abyss
#

array select 2?

hallow spear
#

I have a switch condition check. [x,y] ... hoping to have first value dependent and second not.

#

some need the second value specific. just curious

willow pike
#

this should have a color picker inside

tough abyss
#

😮 thanks

nocturne basalt
#

Can I simulate a multiplayer game somehow? I want to test my code using isMultiplayer, isServer

willow pike
#

run it on a server? 😃

#

join a server with enabledebug 1 test it with server side exec

digital pulsar
#

you have that option in eden

nocturne basalt
#

ok thanks Ill check it out

#

@willow pike I cant just join any server cause it doesnt have my mod

jade abyss
#

Make a local Server

nocturne basalt
#

@Foley#1330 When I try the map in MP its the same as hosting a server. therefore I cannot test isServer, as it will always be true

#

@jade abyss Can I make a local server and join that from the same pc?

jade abyss
#

Yep

#

Just setup a local DedicatedServer and connect to him.

nocturne basalt
#

@jade abyss ok Ill try

#

thanks

broken mural
#

What event handler, if any, can I add to an object like a box that is triggered when the box is destroyed?

#

Would it be the same as for soldiers?

jade abyss
#

killed

broken mural
#

thanks, Dscha.

jade abyss
#

yepyep

earnest coral
#

Anyone knows anything about a Anti Nss Script, there will block peoples nss, cours signing files issent working for me

broken mural
#

Is there a way to capture an object's vehicelvarname in the Killed event hander? Upon adding the eventhandler, it returns the correct name but when the killed handler is triggered it flips to "any".

#

basically trying to get the vehiclevarname of a killed unit or object, but it appears its dumped when the vehicle is destroyed?

#

nevermind I figured it out. Instead of trying to pass a variable set to the object's name on killed, I have to do vehiclevarname (_this select 0) inside the handler.

ionic orchid
#

am I right in reading that there's no server-side event handling for a player death/respawn?

#

all I can find is a bug report for the mpeventhandler "mprespawn" being client-side only

thin pine
#

you add the eventhandler on the players - on the server - and everytime a player will respawn, it will trigger

ionic orchid
#

it does read like it should work, but in practice not so much, sadly

thin pine
#

Aye. I was also looking at onPlayerRespawn.sqf for you but it seems that is also only locally executed

ionic orchid
#

I think I'll try hooking the client-side call...and passing something back to the server with publicVariableServer

#

messy, but I'll take it if it works

thin pine
tough abyss
#

veh2 = nearestObject [player, "All"]; doesnt seem to work

#

veh2 returns null i believe

ionic orchid
#

coolio, that worked... used the mission onPlayerRespawn.sqf script to do it

#

playerHasRespawned = player;
publicVariableServer "playerHasRespawned";

#

then I catch that on the server and use that to re-init the player addActions that lost when they died

#

that=they

tough abyss
#

To see it it catch the correct target when multiple targets.

knotty iron
#

Hi everyone, I'm new to scripting but want to create a script bound which will report the current in-game time to a hint. Every post I've read either has to do with syncing real-world time or something else unrelated to my needs. Is there a way to retrieve the current in-game time and display it in a hint? Any help would be greatly appreciated!

#

Thank you for the prompt response Quiksilver and for my purposes I'd rather have the time displayed as a hint than having to check the watch. I haven't seen any command to pull the in-game time (same as what's on the watch) so I can use it as a hint but I probably missed it in all my searching

#

Thank you!!

tough abyss
#

Sorry for my impatience but i wanted to ask how i would accomplish
veh2 = nearestObject [player, "All"]; doesnt seem to work
veh2 returns null i believe

#

Or just capture every vehicle that is Air tank LandVehicle and Ship

meager granite
#

accomplish what?

tough abyss
#

Well to find the nearest object that is type of all

cerulean whale
#

Well, 'ALL' would only work if you have an object which its ID is 'ALL'...

#

So unless you modded in a thing called "ALL"...

#

if you are referring to ALL as ALL objects then just do nearestObject player;

#

Oh, I read the bottom part

#

put Air, tank, LandVehicle and Ship into an Array and then do someting like nearestObject [player, _array]. You could have to put some operator in (I haven't done anything for a week because I was on vacation and can't remember crap). Otherwise just do a foreach statement with each part of the array.... e.g.

#
{
      _veh = pushBack (nearestObject [player, _x]);
} foreach _array;
#

that's for finding the closest of all 4 types

#

then you could do a foreach sttatement for each _veh

#

and then see which ones distance is the least

#

@tough abyss

tough abyss
#

@cerulean whale thanks

meager granite
#

player nearObjects ["All", 123]

half monolith
#

Im having a problem getting a blacklist to work via script for the bohemia arsenal, I have figured out how to whitelist, but when i change " BIS_fnc_addVirtualItemCargo; " to " BIS_fnc_removeVirtualItemCargo;" I get no joy

meager granite
#

@tough abyss CfgWorlds something-something

#

@half monolith remove probably removes item that you already added

half monolith
#

I think the issue is that nothing is getting added so when i try to remove say a nightstalker in my test script, all i really have is an empty box

#

[] spawn BIS_fnc_arsenal;

[_this,[
"stuff",
"moreStuff"
],true] call BIS_fnc_removeVirtualBackpackCargo;

[_this,[
"stuff",
"moreStuff"
],true] call BIS_fnc_removeVirtualMagazineCargo;

[_this,[
"stuff",
"moreStuff"
],true] call BIS_fnc_removeVirtualWeaponCargo;

[_this,[
"optic_nightstalker",
"optic_tws"
],true] call BIS_fnc_removeVirtualItemCargo;

#

this works to whitelist things,

meager granite
#

if (count _classes == 0 && _add < 0) then {
_cargoArray = [];
_save = true;
} else {

half monolith
#

but i changed the add to remove

meager granite
#

looks like removing anything just clears the list

#

probably not fully implemented

#

oh wait, classes == 0

#

no it supposed to remove properly looking at code @half monolith

#

@tough abyss First airport is defined right in CfgWorlds, others are in secondaryAirports

half monolith
#

so how would i initialize it full, so there are items to remove?

meager granite
#

I'd write my own script to add only what you need

half monolith
#

well i have no issue with a whitelist, as i can make it work. we have a rather large collection of maps id like to implement this on, and the task i was given was blacklist, and not to touch missionfile. it comes from above lol.. the other thing is we dont want to remove much more than thermals and some other stuff.

meager granite
#

I don't use Arsenal myself to tell for sure, just looking at scripts and guessing that you can't have "Everything but", only "Everything" or list defined by yourself

#

Yeah looks like add* and remove* functions only operate whitelist

#

basically to remove something you have to add it first

half monolith
#

thats what i thought i read somewhere

meager granite
#

if (_add > 0) then {
if (!(_class in _cargoArray) && (_class != "" || _class == "%ALL")) then {_cargoArray set [count _cargoArray,_class];};
} else {
_cargoArray = _cargoArray - [_class];
};

#

yeah it operates whitelist only

half monolith
#

so to make blacklist, need to white list everything first, is there a way to do this without actually making the list?

meager granite
#

Yeah just look how its done in arsenal itself and replicate in your script

half monolith
#

ok ill look at that , thanks for the help

meager granite
#

Or modify arsenal to make this blacklist instead of whitelist

#

Depending on your scripting ability

#

#define CONDITION(LIST) (_fullVersion || {"%ALL" in LIST} || {{_item == _x} count LIST > 0})

#

this is condition that checks if item should be included in the list

#

Make a copy of arsenal script, name it something else and have this define changed to exclude items that are in the list

#

I guess it should work

half monolith
#

not that great, learning as i go ported a couple missions so far. is one thing to get help, but to understand it at the same time is another sometimes. im trying to learn more than have handed to me, I wasnt able to get that to work, preprocessor failed missing filename. at least i get to see a diff error

meager granite
#

unpack functions_f_bootcamp, copy arsenal script from there to your mission, modify it, compile the script into your own arsenal variable, call it instead of BIS_fnc_arsenal where needed

half monolith
#

gotcha

earnest coral
#

So when i start my server i get this error "no entry 'bin\config.bin/CfgMarkers.ALR_Shop" anyone know how to fix it

indigo snow
#

You're trying to create a marker that's not present in the game.

thin pine
#

It's a pbo

#

Possibly trpg

earnest coral
#

I dont have a pbo called trpg

#

can it be ALR_Markers.pbo

median iris
#

Did you edit that missions mission.sqm with 3den or have any mods enabled when editing, potentially unnoticed?

earnest coral
#

in 3den and i have my modpack active

median iris
#

Put 3den on your server as a test if it starts with no error there is something calling one of its entities, or so it would seem. You need to find the "include addons", I want to say thats in the mission.sqm and find the dependency.

#

Or merge your edits with an older file

#

If anyone else can provide a better solution please do, I personally have never encountered this problem.

earnest coral
#

3den issent that just the normal edditor in arma 3

median iris
#

I'm sorry that is a bit confusing there is an extension for it and I read your error wrong lol, I am totally wrong

#

What was the last thing editied before you started seeing this error?

earnest coral
#

i deleted a shop

median iris
#

Is this mission.pbo derived from a mod? If so which one?

earnest coral
#

i dont know what you mean

median iris
#

You have VOIP:

earnest coral
#

no

median iris
#

Whats the mission like my dude?

#

Is it alits life, exile, domination, annex?

#

And can you paste your servers rpt log

earnest coral
#

It is Kelleyisland

median iris
#

Nice

rotund cypress
#

Hey guys, what command can I use to set a lb item greyed out?

earnest coral
#

Its works when i lunch with TDAST but when i lunch with my start.bat it come with the error

loud python
#

Guys, I am looking for a way to set OPFOR units in an outpost to captive until a condition is met

#

What's the best way for doing this?

#

Can I somehow get a list of all units (or vehicles in general) inside a trigger area?

rotund cypress
#

Yes

#

With foreach loop

#

And using _x

loud python
#

do I need to iterate over all OPFOR and check if they are inside the area?

rotund cypress
#

Just check before the loop

#

like player distance whatever

loud python
#

?

rotund cypress
#

then set a variable

#

check in the loop

loud python
#

I don't get what you mean =/

rotund cypress
#

if ( _inArea ) then { do whatever you want with _x }

loud python
#
{if _x <inside area> then <do stuff with _x>} forEach <opfor units>
#

something like that?

#

dammit

#

I was hoping for something like

{<stuff>} forEach <units inside area>
rotund cypress
#

{

     if ( player distance ( getMarkerPos _x ) < 100 ) exitWith { _inArea = true; };

} forEach [ "areas", "areas" ];

{
  if ( _inArea ) then { do something with _X };
} forEach _opforUnits;```
loud python
#

That's not at all what I want to do

rotund cypress
#

What do you want to do then?

#

You wanted to get all units inside an area right?

loud python
#
{<stuff>} forEach <units inside area>
#

Your code seems to check if the player is inside an area

rotund cypress
#

yes and then do stuff with the people inside that area

loud python
#

and if yes, do something with all OPFOR units

rotund cypress
#

then remoteexec on east when the trigger is made on map

loud python
#

I don't get it; you set _inArea once

#

and then you check it in each iteration of the loop

#

why though? It doesn't change

rotund cypress
#

If they're not in the area, then _inArea will be false.

loud python
#

no it won't

#

at the time you start the loop

rotund cypress
#

Hahah, yes it will

loud python
#

_inArea is either true or false

rotund cypress
#

Yes

#

if ( _inArea ) {}

#

If they're in the area, then the variable will be true

#

Otherwise it wont

#

It will check when that script is run

loud python
#
{
  if ( _inArea ) then { do something with _X };
} forEach _opforUnits;

is semantically identical to

if (_inArea) then {do something with _x} foreach _opforUnits;
rotund cypress
#

It's just how I write my code

loud python
#

the point is

#

no, I've already made my point

#

that script doesn't work

rotund cypress
#

Look mate, it works, I have tried it just right now

loud python
#

the logic of that script is If the player is in one of the following areas, then do something with ALL opfor units

rotund cypress
#

What are you saying is wrong with it?

loud python
#

I want do something with those opfor units that are in the area of trigger X

rotund cypress
#

Ok look, then that script may not be for you, but it works. You asked for a script to execute something on opfor units in an area. You may just go with a trigger and when a opfor unit enters, RE on all opfor units.

loud python
#

look, I was not saying that your script would cause arma to explode

#

I was saying that it doesn't do what I want (not even close)

#

and it doesn't

#

I could post some code to respawn a vehicle right now

#

and it wouldn't be wrong code

#

but it would still have nothing to do with what I was saying

#

and either way, what you said is wrong

rotund cypress
#

Then I understood wrong what you needed

loud python
#

that code does NOT operate on opfor units in a certain area

#

it operates on ALL opfor units if the PLAYER is in a certain area

rotund cypress
#

Yes, but You may just go with a trigger and when a opfor unit enters, RE on all opfor units.

loud python
#

...

#

I don't want all opfor units

rotund cypress
#

Ah ok

loud python
#

only those that are in the area

thin pine
#

Jeez

rotund cypress
#

What Opfor units do you need?

loud python
#

FFS what a misunderstanding xD

#

look, I don't care to get them filtered by faction, what I care about is getting a list of units that are inside the trigger area

rancid ruin
#

calm down boys lol

thin pine
#

Why not use a trigger

loud python
#

@thin pine I AM USING A TRIGGER

thin pine
#

Calm those titties

#

Use thisList

#

It's an array containing all units that match trigger condition

rotund cypress
#

ok im going to write you something reall quick

loud python
#

{_x setCaptive true;} forEach thisList; should this work?

#

(condition set to simply true)

thin pine
#

Condition must be this

#

Actually not sure

#

Test it

loud python
#

then I am screwed

#

it doesn't work

#

in this case I can set the condition to this

#

but then I need another trigger to activate when a flag is set

#

never mind, in that case I can just use this and <flag>

thin pine
#

Or use the inArea code if you want total control and oversight

loud python
#

then I need to iterate over all opfor units though

rotund cypress
#

    private _areas = [ "area1marker", "area2marker" ];
    private "_inArea";
    _inArea = false;
    {
    
        if ( player distance ( getMarkerPos _x ) < 100 ) exitWith { _inArea = true; };
        
    } forEach _areas;

    _conditionsMet = false;
    if ( _inArea && { side _x isEqualTo east } ) then {
    
        _conditionsMet = true;
        
    };

} forEach playableUnits;```
loud python
#

I would like to avoid that

thin pine
#

Could use nearEntities to only get the close ones hehe

loud python
#

@rotund cypress player? shouldn't that be a _x?

rotund cypress
#

yeah sorry

thin pine
#

Tbh tho what kind of environment is this in? Big MP gamemode?

rotund cypress
#

no

#

that wont work

loud python
#

@thin pine nearEntities THANKS! That's exactly what I wanted 😃

thin pine
#

Or coop mission?

loud python
#

It's a coop mission

#

I want players to drive by an OPFOR checkpoint and not be shot

#

after a while I want OPFOR to turn hostile though

thin pine
#

Ah

loud python
#

all other OPFOR units are hidden far away from the AO

#

so unless players go exploring and find out that santaclaus is actually their parents, I don't need to set all OPFOR units to captive, only that one outpost

#

the worst case alternative would be that: setting ALL opfor to captive until they are supposed to attack

thin pine
#

Btw you could have a trigger set to this, activation opfor, set trigger variable name and then retrieve a list of all opfor units in that area using the list command

#

List trigger1 for example

#

Idk if it has to be set to repeatable. Maybe.

#

But jusr useful hint

loud python
#

{_x setCaptive true;} forEach thisList; doesn't seem to work =/

#

neither does {_x setCaptive true;} forEach (list thisTrigger);

#

{_x setCaptive true;} forEach (thisTrigger nearEntities 50); DOES work, but it doesn't work with the triggers actual area

#

too bad we're not supposed to use setFriend after the mission has started

#

that would really help with this kind of mission

rotund cypress
#

Is there a command to add weapon sway?

#

Alright found it

meager granite
#

if list thisTrigger doesn't have needed units then you misconfigured trigger

earnest coral
jade abyss
#

Use the correct password.

earnest coral
#

Fixet it

little eagle
#

I'm laughing, Dscha. Just so you know.

#

What would they all do without you?

earnest coral
#

Anyone know how to fix where the database wont write or read to the database

jade abyss
#

commy2 - Today at 8:39 PM
I'm laughing, Dscha. Just so you know.
What would they all do without you?```
Good question.
ionic orchid
#

I'm trying to dump a connecting player straight into the running mission, but can't seem to stop the map screen from showing?

#

I've tried:
skipLobby = 1;
showMap = 0;

#

skipLobby works fine, showMap not so much :\

ionic orchid
#

ah, nevermind - in-editor tooltip says it only hides the map and that screen isn't skipped

cerulean whale
#

@ionic orchid Do you want to skip the briefing phase (map screen)? There is a launch parameter you can do when you launch your server to bypass it

#

I'll see if I can find it

ionic orchid
#

that would be awesome if you could

cerulean whale
#

I used it on my server before I went away on vacation. Let me just msg one of the guys to see if they remember it

ionic orchid
#

I see there's one for SP missions, but that's probably not the one you mean

cerulean whale
#

Try that. I've found the one for skipLobby and autoAssign but can't find the briefing one

#

Maybe I did it somehow different. 😛 I'll keep looking for you though

ionic orchid
#

Hmm, nope didn't work 😦

#

Thanks for still looking, though!

hallow spear
#

i'd be curious to get the command too

ionic orchid
#

looks like it might be just the thing

#

a filthy hack but I'm starting to find that filthy hacks are kinda common :/

little eagle
#

Doesn't look so bad, except that KK apparently doesn't understand how escaping the waitUntil code block works.

thin pine
#

@little eagle it's late....and i know I shouldn't..but ima do it anyway. Please elaborate.

#

my 2am brain dun see nuffin wron with dat code

little eagle
#

Yeah, nvm.

#
0 spawn {
    waitUntil {
        if (true) exitWith {false};
        false 
    };
    systemChat "exited scope despite using false";
};
#

Thought you can exit the scope anyway, but apparently you have to exit with true.

#

It's different from the while block apparently

#
0 spawn { 
    while { 
        if (true) exitWith {true}; 
        true
    } do {}; 
    systemChat "exited scope despite using true"; 
};
#

The waitUntil version does not exit, but the while version does.

#

Seems like they go out of their way to call the waitUntil code block inside a second scope.

#

Which they never do anywhere else.

#

So KK's code is still right, but since it works with no other command, I'd still avoid it.

#

I'll ask dedmen, the C++ guy with the source tomorrow if he can figure out why waitUntil is special

dusk sage
#

I'd imagine you can't exit it due to the way it executes engine side

#

With the rate at which it executes, etc

tough abyss
#

How is arma's code actually parsed @dusk sage ?

#

is it just strings with regEx?

#

that are performining instructions internal to C++ ?

#

Why doesn't BI make this native to arma 3?

#

And make a C++ system thats sandboxed to the game?

#

Also Dscha gets asked too many dumb questions.

woeful void
#

q: The side specific zeus missions has the other sides removed from the zeus interface so they can't be spawned. How do I replicate that effect in other missions?

lavish ocean
#

well @tough abyss as you can see the intercept sort of got went into stall (no progress(not enough contributors))

woeful void
#

Next q: Going from a class string to that class's faction, what is the easiest way to do this?

#

{ if ( faction _x == "BLUE_F" ) then [[true]] else [[false]; } forEach _classes; // does NOT work, _x is a string, not object.

#

help?

still forum
#

Commy always askin me stuff.. ugh...
Intercept is not Dead. It's stalled because Nou now has a new Job.. I am currently the only Dev semi-working on it that is really able to do Engine level stuff. But i got over a dozen other Projects that are higher on my Todo list.

lavish ocean
#

@still forum ye i know he is busy ... but what i mean is that it's surprising not more people joined it

tough abyss
#

I don't know enough sufficient to code in C++ to even consider contributing

still forum
#

Well the Range of people being able to do such level of stuff is kinda not big

#

@woeful void

{ if ( (getText (configFile >> "cfgVehicles" >> _x >> "faction")) == "BLU_F" ) then [[true]] else [[false]; } forEach _classes;

tough abyss
#

Not only that people who know how to do C++ are actually in jobs doing it.

#

@still forum

woeful void
#

@still forum Looks hacky as heck but.. if it works, I'm not going to argue. I'll try it now.

still forum
#

Theoretically.. There are a ton of Arma hackers.. All of the real hackers could actually do it.. Ask them why they don't. Even I learned all that stuff I am using on Intercept through Hacking

woeful void
#

I also need this to apply to Men and wepaons too. Will that cfgVehicles be a problem?

still forum
#

it will only work for Men

#

I don't know if Weapons even have assigned factions

tough abyss
#

Do you know any details on how the ArmA 3's engines commands are actually parsed @still forum

woeful void
#

weappons, no.. but I got men, drones, choppers, hemmtt's... it looks like it works for all the faction specific stuff. Thanks.

tough abyss
#

For the sake of intellectual curiosity ?

still forum
#

@woeful void should work for everything inside CfgVehicles.. "should"

#

Yeah i do why?

tough abyss
#

Are the scripting commands interpreted internally as function calls?

still forum
#

@little eagle exitWith is causing a "break" in script. The while loop has a special handler for break events which cause the while loop to go into the Done state -> Stops looping

#

Uhm.. yeah.. you could say that

#

Don't know what else they would be ^^

tough abyss
#

So what controls the pausing in the scheduler?

dusk sage
#

then [[true]] else [[false]; D:

#

How is arma's code actually parsed @BoGuu ?
Idk, try asking Dedmen while he is here 😉

woeful void
#

I only did that because the bits inside the [[]]'s wern't relevant to the question.

#

those are actually a bit longer then a simple bool each. 😃

dusk sage
#

Why doesn't BI make this native to arma 3?
That's like saying why don't they make their own game, native to their game, no 😉 ?

still forum
#

After every few instructions the game checks how long it has been executing scripts.. and if it's too long then it pauses execution till next frame... (from memory.. not quite right but close enough)

tough abyss
#

Is this being done single-threaded?

#

or multi?

still forum
#

Because offering full C++ coding ability would open the door for a ton of possibly malicious mods.

tough abyss
#

No way to do what space-engineers did?

#

Locked the NameSpace to control that?

still forum
#

With the extensions It's still kinda controlled... People can decide themselves if they wanna take the risk. If all scripts were fully capable C++ everyone would be forced to take the risk.. and BI can't do that.. Thats was also the argument with the Java thingy

#

It's singlethreaded

tough abyss
#

Thats what they did in C# with SE it doesn't allow access to certain aspects of the entire .dll library

#

purely because of that reason, they did however have to introduce an instruction counter

still forum
#

Arma is an old Engine.. It's not always easy to just "do stuff"

tough abyss
#

To prevent scripts locking up

dusk sage
#

You're talking about what I would imagine to be, total rewrite

tough abyss
#

Hmm, yeah not time feasible etc. I wonder if this increase in ram usage

#

will cause more performance issues?

#

Purely because of being 64bit ?

still forum
#

What? No.

tough abyss
#

Wouldn't make the singlethreaded aspect more pronounced?

dusk sage
#

o.O

tough abyss
#

Read something a while back about how RAM is allocated per core. And each core manages that RAM, in conjunction with the OS. Don't remember where it was.

still forum
#

Having more Ram the Engine can store more stuff in memory.. so instead of calculating stuff everytime do it once and store it.. For example Arma's String class doesn't have the length stored... They iterate the string to see where it ends. This was probably to save memory back then.. With 64Bit having more available could change that...

tough abyss
#

Ah so, the memory improvements will probably pave the way to more optimisation?

still forum
#

Ram is not allocated per core.... You're probably talking about cache... In short.. No 64Bit will not cause performance degredation

#

exactly

#

There might be minimalist uh.. "worsenings" (my english gud!) to performance... But only at a nanosecond scale... Nothing to care about

tough abyss
#

Interesting, on the note of dwarden pointing out that memory leak in badly written scripts. How does a person write "good scripts"?

#

If you don't mind me asking?

dusk sage
#

Ones that don't leak

#

Ones that work

tough abyss
#

How would you know they don't leak ?

dusk sage
#

It'll be quite obvious when you're causing a memory leak, unless it is a problem BI side of things

#

In most cases you'd have to be quite explicit on writing bad code

tough abyss
#

Only way I generated a memory leak was this.

#

_array append _sameArray;

still forum
#

Memory shouldn't be able to leak through scripts... Thats the a reason of implementing a engine controlled scripting system instead of allowing for example external c++ like we talked earlier. Everything is controlled Engine side.. They user shouldn't be able to do anything bad.. like leak memory or crash the game or anything

tough abyss
#

Well.

#

I did discover a bug.

#

Where I invoked one of the UI elements in game.

#

And actually crashed the game.

#

Which probably? Shouldn't have happened?

dusk sage
#

The term 'memory leak' in SQF is quite ambiguous

#

People often associate running out of memory -> leak

still forum
#

The scripting system is very nice.. (except performance wise) It doesn't let the user do reaaaal bad stuff.
Yeah.. I also have a report on the Feedback tracker about a sqf bug that can reproducibly crash the game. Bugs happen

tough abyss
#

@dusk sage It complained about the array being too big and exceeded the limit and kept spamming virtual memory page errors

still forum
#

Well.. It's your fault if you make an array so big that you run out of memory....

tough abyss
#

It was my fault I understood that.

#

But it was so easy to do thats the problem

#

Putting append in place of pushBack.

still forum
#

Like I said a perfect scripting engine shouldn't allow users scripts to influence the engine so far that it would crash... But nothing is perfect. SQF is close... But still far off (yes! that makes sense!)

tough abyss
#

Should this bug I discovered be reported?

still forum
#

Well... Filling an array till you run out of memory... Uhm... no.. not really... Report to yourself for not having enough memory

tough abyss
#

Not that one

#

This one.

#
/*
    Author: Karel Moricky

    Description:
    Shut downs the game.

    Parameter(s):
    NOTHING

    Returns:
    NOTHING
*/

//--- Open options menu (forces to return to main menu)
ctrlactivate ((finddisplay 0) displayctrl 102);

//--- Close options menu
(finddisplay 3) closedisplay 2;

//--- Activate exit button
ctrlactivate ((finddisplay 0) displayctrl 106);
still forum
#

oh.

#

yeah sure

tough abyss
#

If you access that in a manner without ctrlActivate

#

It actually made the game hang

still forum
#

My crashing script report got ignored so far... And i understand it not being high priority... Your code crashes the game.. so what? Either don't use it.. Or you want to crash on purpose. But BIS should have it on their Feedback Tracker for the day they decide to fix all that stuff

tough abyss
#

But this is a Bi internal thing

#

Related to directly invoking the UI elements

#

something the engine does on it's own

#

If I can crash it?

#

Can the engine not do the same?

dusk sage
#

The amount of ways you can crash a server with SQF is amazing

still forum
#

Does the engine crash itself? No it doesn't. That issue only happens if you semi-consiously cause it so... Not important

#

@woeful void btw please don't ask the same questions in multiple rooms if you don't get an answer after a few minutes... Some people only check discord every half hour or so

tough abyss
#

How do you debug @dusk sage diag_log format ?

#

and diag_log ?

dusk sage
#

That's a bit general, it would depend what I'm doing

#

I use diag_log a lot though, yes

#

😛

#

I saw one the other day, openDLCPage on the server

#

🤦

tough abyss
#

Hacker? script kiddie

#

@dusk sage

dusk sage
#

yeh

tough abyss
#

Easiest way to crash a server

#

is to flood the scheduler

#

With non-sense threads that do nothing.

woeful void
#

WOOT, got exatly what I wanted, where a faction (not sided) zeus only has access to his own faction stuff (and no story or VR units): ```
z_west_nato addEventHandler [
"CuratorObjectRegistered",
{
_classes = _this select 1;
_costs = [];
{
_cost = if (
((getText (configFile >> "cfgVehicles" >> _x >> "faction")) == "BLU_F")
and ((getText (configFile >> "cfgVehicles" >> _x >> "vehicleClass")) != "MenVR")
and ((getText (configFile >> "cfgVehicles" >> _x >> "editorSubCategory")) != "EdSubcat_Personnel_Story")
) then {[true,0.1]} else {[false,0]};
_costs = _costs + [_cost];
} forEach _classes; // Go through all classes and assign cost for each of them
_costs
}
];

#

Thank you for the help

#

Now all I need to do is preserve the original costs now....

tough abyss
#

Still quite annoying all we have for debugging is diag_log

dusk sage
#

Easiest way to crash a server is to flood the scheduler
Or just use one command 😛

tough abyss
#

I thought the server would intercept certain commands?

#

E.g OpenDLCPage

dusk sage
#

'intercept'?

tough abyss
#

Is something that should be CS locked

#

Not allowed to be run on the server-side?

dusk sage
#

Well they shouldn't be able to no

#

Not end user* side though

still forum
#

To debugging... diag_log, systemChat, diag_captureFrame Is all I need.

tough abyss
#

Hey @dusk sage Do you use this ever?

#

?

#

Wait.

#

I wonder if thats better than exitWith O_o

#

Ohhh it got a syntax update a while ago.

#

So it's not obsolete.

#

You could use a try catch throw in place of an exitWith?

#

yes?

#

Instead of exiting with simple try { condition then put the catch at the bottom bypassing all the returns etc } ?

#

Yep.

#

It appears to work.

#

@dusk sage Have you ever used try catch and throw?

#

It seems like you can bypass completely evaluating an entire block of code using it.

dusk sage
#

I have a couple of times

#

It's just syntax sugar though

#

And does not represent a 'normal' try catch

#

Well, sort of, but won't help with anything internally

tough abyss
#

Would it work in place of exitWith ?

woeful void
still forum
#

Are you in MP while executing that?

woeful void
#

SIngle player, but I'll try it in MP now.

still forum
#

no.. copyToClipboard doesn't work in MP

woeful void
#

ok, so I was in the right mode then.

woeful void
#

Just to make sure I understand the event model correctly... when someone does a radio message that a trigger is wired to (Radio Alpha), every client connected to the game is notified of that radio event so they'll run the trigger's On Activation event locally? or is it only executed on the server?

tough abyss
#

Triggers are evaluated globally by default

woeful void
#

so all clients and server as well then?

tough abyss
#

Only if you "tick the Server" box will it be evaluated server-side only

woeful void
#

ok. That makes sense, thank you.

tough abyss
#

If you are dynamically creating them

#

you just set the global false in the createTrigger

woeful void
#

ok, so createTrigger handles it's own client notification then... alright.

#

Far nicer than other languages I've had to work with.

tough abyss
#

Depends

#

What commands are you using?

#

Each command often has it's own locality restrictions.,

woeful void
#

Just for testing: {(leader _x) sideChat "GO!"} forEach allGroups;

#

something stupid simple just to get a message as feedback.

#

and a little earthquake rumbling.

round trout
#

Slowly progressing on my little script to get other AIs assist with a AI if he's engaged. Like Upsmon basically.. But more tailored for what I really need.
http://pastebin.com/zxzLLRLB
http://i.imgur.com/L0IrIN9.png

findNearby isn't done, as I am aware if group nearby was tasked in a area to patrol they will not return. For now I rather optimize what I have and improve important parts before working further with other functions i.e firednearby etc.

My question is:
Is there a better way finding nearby friendlies? If so how? Or how would you do it in a way to be much optimized and good code?

digital pulsar
#

One approach is allUnits select {_x distance yourAIGuy < 1000}

#

Ofc another conditions like side also go into {}

round trout
#

So allUnits is better than nearestobjects?

#

Yeah Foley, I do that check in my part.

digital pulsar
#

Try the diag tool in console to see what works best in your case

#

I dont say its better

round trout
#

Okay, I will do that. Reason why I ask is that is because we are a quite large community

#

40 players on each mission and I want to have the code so clean and optimized as possible..

#

For example this is how I do it:

#

_nearestunits = nearestObjects [getpos _unit ,["Man"], 1000];
_nearestfriendlies = [];

if(_side countSide _nearestunits > 0) then{
{
_a = _x;
if((side _a == _side) && (group _a != group _unit) && !(behaviour leader (group _a) isEqualTo "COMBAT")) then{
_nearestfriendlies = _nearestfriendlies + [_a];
[group _a, getpos _shooter, 100] call CBA_fnc_taskAttack;
};
} foreach _nearestunits;
};

digital pulsar
#

Loads more objects than 40 on the map

round trout
#

Haha well I want to avoid zeusing missions constantly cause I want to play.. And before UPSMON was perfect when we were 15 guys

#

Now bigger we are, more performance hit we get with UPSMON

#

So we decided to write our own.

#

Utilizing FSM also

digital pulsar
#

Also pushBack instead of adding arrays

#

Always better performance

round trout
#

Yeah thinking about doing this way -> I do findNearby - I store all nearunits in a array.

#

Then I call the function to task attack

#

And select few members out of that array

#

And task them cba_fnc

#

Just want to write it clean as possible to avoid performance hit

digital pulsar
#

No need to count before foreach

round trout
#

Oh don't worry the count is just for debugging

digital pulsar
#

If empty it will get skipped

round trout
#

Well quiksilver problem is we are already experiencing people getting kicked out cause of steam ticket null (memory leak) every 10 minutes..

#

We do have a heavily modified modpack we do ourselves but also using ACRE and ACE

#

Me and the other developer are programmers IRL and computer scientist guys

#

Yeah, i7

#

SSD

#

FIBER 100MB up and down, datacenter switches

#

Speedtest gives us approx upload to.. 50MB

#

Let me re test two secs

#

We got 3HC

#

headless clients running

#

Shit tons of ram but that doesn't matter since arma doesn't use half of it.

tough abyss
#

Agreed.

round trout
#

23:35:07 > Player Pte.Chase.J kicked off, Steam ticket check failed: Steam authentication failed.

#

battleeye disabled

#

RPT and client files shows nothing more than some usual errors that's arma related

#

Yeah our speed as been increased.

tough abyss
#

I don't think your issue is hardware related.

round trout
#

verifySignatures = 2;

tough abyss
#

If that's what he was saying lol

#

Have you optimized your basic.cfg?

round trout
#

Nothing to do with my basic.cfg - ran with both modified and unmodified

#

Same affect.

#

People just simply CTD every 10-15 min (Not everyone just one or two person at time)

#

Not everyone, just 1 or 2.

#

So lets say you crash quik. You rejoin then 20min later someone else crash

#

etc

#

Different

tough abyss
#

Try a simple mission. See if it persists.

#

Then you know it is /isn't mission related

round trout
#

We are debugging ACRE as they run a masteridcheck and noticed few people crash at the same time.

tough abyss
#

Mods are fun to work with too lol. Have fun

round trout
#

Yeah? Where do you recommend start adding them, just in our mods?

#

Well that is because they CTD

#

So that shows up when they CTD

#

Yeah that is what we think it is.

#

We got nooo freaking clue where

#

Our HC have never actually crashed

#

funny thing

#

HCs **

#

Haha yeah problem is.. SideOps we have only like 25 people and it barely happen.

#

And if it happened it would take hour(s)

#

While in a main op, we have 40 people

#

It goes mad.

#

What I probably will do is debug the main op on my end only.

#

And host.

#

See what happens and see what I can do.

#

Its something Idk.. My other partner tells me its ArmA

#

And maybe some old mods.

#

So we are going to CUP to see if that will help it and remove older mods.

#

Yeah well we noticed one thing

#

If shit isn't optimized

#

This shit keeps happening

#

Hence removal of upsmon

#

Well I'm frustrated..

#

I can't make a active mission for 40 people cause anything above 60 ai

#

people drop like flies

digital pulsar
#

U use mods?

round trout
#

Yeah, ACE ACRE Maps (CUP) 3CB and our modified version(s)

digital pulsar
#

Myeah u can always blame those

round trout
#

We also have our custom scripts as addon(s)

#

My hardware health is green, its from my own company lol (HPE)

digital pulsar
#

See if the problem persists in vanilla

median iris
#

You ever try headless client my dude?

round trout
#

Again, I can't really run vanilla here guys for 40 people.

#

For 10 people sure but then issue will not happen

#

even with mods.

#

Is headless really that unstable? My network performance should handle it.

#

So should my threading

median iris
#

Dont use HT on dedicated servers on x32 it will just re-thread the main thread more of a client improvment and should be implmented client side, anyone else do that testng yet?

round trout
#

I'm on 64 bits

median iris
#

Oh sweet sauce nevermind

round trout
#

Alrighty, plan set .. still finish my tasking system for AI being engaged etc

#

Use perf branch for dedi server

#

Make a separate addon for me and my friend for debugging purpose and for the server.

#

Re do basic.cfg

#

And pray..

round trout
#

lol maybe actually noticed the culprit

#

Still doesn't explain CTD

meager granite
#

What's with AI behaviour lately? I'm constantly having my patrolling AI go into random directions.

#

I thought they were fleeing somehow but I had allowFleeing off.

#

I never really worked with AI, Wasteland just has group that moves around objective through 4 move waypoints and that's it

#

Which didn't change since like 2012 when I started making Wasteland but now they suddenly wander off under unknown reason

#

Hm, yeah AI following target sounds like explanation

#

All my attempts to repro it in closed environment failed though, only seem to happen on populated server with lots of players everywhere around AI group

lavish ocean
#

ok, here is script-code what caused known memory leak / overloaded netlayer and lead to server freeze / stall later

[] spawn {
  while {true} do {
    if (!isNull objectParent player) then {
      detach player;
    };   }; };

and this was workaround script-code attempt to address it (no more leak/perf issues nor crash)

[] spawn {
  while {true} do {
    if (!isNull objectParent player) then {
      if (!isNull attachedTo player) then {detach player};
    };  }; };

since new Profiling branch 1.66.139995 (and it's performance binaries) in #perf_prof_branch
this is covered and FIXED at low-level within engine itself, to prevent leak, stop performance/netcode issues etc.
yet,
please take look into your script code for similar cases of 'weird' script-code related to different commands as issues may still exist

round trout
#

Oh , sweet. Thanks.

lavish ocean
#

similar bug may exist for different command, hence i share it so creative community can take look and help narrow it down ...

meager granite
#

Why would someone detach player if it has no parent object? 🤔

#

objectParent doesn't even return object you're attached to

meager granite
#

Players are on foot most of the time

#

I'll see about courage

round trout
#

by the way arma 3 tools, only through steam? I want to start on FSM

meager granite
#

No wonder it is causing issues

#

They execute detach tens of times per frame

#

Its script fault, not command fault

#

I wish detach would get logged just like attachTo by BE

#

No, I mean if it was they would instantly understand what's going on

#

with all this pointless detach spam their script is causing

#

Well if you RE'd into server you could do much worse stuff anyway

#

Actually would BE should really log is moveOut messages

#

You could crash server with single command just recently

#

"access" createVehicleLocal [0,0,0]

#

try from another position?

#

did you make civilians your enemy by any chance?

#

if you make civilians enemy you can't enter or loot any empty vehicles

#

as they belong to civilian side

thin pine
#

😄

#

Allows you to set the amount of shit on an unit's hands, for decreased accuracy actually

#

😄

little eagle
#

Can't you just crash a server with this anyway?
isNil {_a = {call _a}; call _a};

#

No need to get fancy

meager granite
#

it will freeze the server, not crash 🤔

little eagle
#

Does it make a difference? I'm sure it crashes eventually

#

Freeze

#

Permanent.

still forum
#

I'll sure add that to my script collection... combined with my execOnSteamID script that will sure be useful :3

little eagle
#

I thought this already was a staple.

round trout
#

lol can it cause CTD?

little eagle
#

No, freeze.

round trout
#

aw

#

but works same

#

thats good

little eagle
#

There are tons of ways to crash the game. I won't tell you though, because you sound shady!

#

Dedmen, since when are you unbanned here?

round trout
#

fair enough, im trying to find solution(s) for my CTDs lol

little eagle
#

Still selling TS exploits? ;^)

#

Probably out of memory, Alwandy. Known problem. I think lowering texture size helps.

round trout
#

Well it is out of memory but trying to prevent this happening in possible ways from a mission making perspective.. Until we get rid of our mods that we believe causes some of this texturing thing.

#

Dwarden provided a nice perf branch so lets see

#

if it works

#

Tiny bit atleast 😄

lavish ocean
#

@little eagle well @still forum is on probation, i gave him 2nd chance 😉

still forum
#

Unbanned since yesterday. And i never sold Teamspeak exploits... I make some of them... that may be true.. but i don't get any money for it

lavish ocean
#

is now sure @still forum now feels all the invisible eyes watching him hidden in the internet jungle around

still forum
#

So... commy.. you just now noticing I'm back tells me you didn't read my stuff about why while gets killed with exitWith {true}

little eagle
#

Didn't notice

#

My question was though, why it does not kill waitUntil

#

As every other loop is exited by exitWith too

#

apply

#

count

#

select

#

for

still forum
#

ouh... uhm.... yes... it.. eh.... Because

little eagle
#

It also doesn't support return values of event handlers, so more evidence that it doesn't end the scope with it's return value, but exits it.

#

You're turning into @queen cargo with all these ellipses.

queen cargo
#

someone summoned me?

little eagle
#

Not really, you can go now.

jade abyss
#

😄

little eagle
#

Seems to me like waitUntil and exitWith have a special interaction which is not present for other loops.

queen cargo
#

but to answer your question: waitUntil is a special case and it has nothing to do with exitWith

#

same should happen with breakOut and scopeName in waitUntil

little eagle
#

That is a good test case.

queen cargo
#

waitUntil simply will wait until you either leave that scope explicitly or the condition is reached (including the 10k limit)

#

exitWith will just instantly leave the current scope at given spot

#

--> it is like you just ended there

little eagle
#

I don't think waitUntil has a 10k limit. That only applies to while in unscheduled environment

queen cargo
#

waitUntil should also have some limit if i remember correctly
but does not really matters 😛 reasoning will stay the same

little eagle
#

waitUntil is not really interesting to me anyway since I won't be able to use it ever anyway. But it would be nice to have a one code block loop in unscheduled that is not a ugly for-step-0-do.

queen cargo
#

in general though ... should be a bug even if it was implemented like that intentionally most likely

little eagle
#

It violates the behavior of all other loops and is not documented, so feature-bug

queen cargo
#

waitUntil is essentially not a loop

#

using it as such is not how that command was intended

little eagle
#

I think it should be avoided as it can lead to problems when you substitute the loop with another command.

jade abyss
#

since I won't be able to use it ever anyway <-?

waitUntil{sleep 1; False}; <- why not? Came in pretty handy

little eagle
#

Nice way to lock up a scheduled script I guess?

#

Put it in postInit. Will break every other mod or mission that comes after your function in CfgFunctions.

#

...

jade abyss
#

who the f would use it there? You always pick the worst possible scenarios oO

meager granite
#

What's the deal with waitUntil and exitWith again? I am very curious.

little eagle
#

MCC does

#

And so does Alive in 3den

#

¯_(ツ)_/¯

jade abyss
#

Oh my

little eagle
#

exitWith does not quit the waitUntil code block, but actually substitutes it's return value with the one that ends or continues the waitUntil block

#

exitWith does quit every other loop regardless of the expected return value, like the condition block in while-do

#

Apparently the same is true for breakOut, so it's not really a special property of exitWith, but waitUntil

queen cargo
#

as i said: you understand WaitUntil as loop

#

thats the false perception here 😛

little eagle
#

It is though

meager granite
#

Interesting

queen cargo
#

it is just the function that is called frequent

#

it is not an actual loop in its "design" but you somehow have to recheck the condition

little eagle
#

I had some code examples illustrating the difference

meager granite
#

I think I heard about it before but I barely use scheduled threads anymore to really encounter it in real scenario

queen cargo
#

though ... you should avoid exitWith in most cases anyway

little eagle
#
0 spawn {
    waitUntil {
        if (true) exitWith {false};
        false 
    };
    systemChat "exited scope despite using false";
};
0 spawn { 
    while { 
        if (true) exitWith {true}; 
        true
    } do {}; 
    systemChat "exited scope despite using true"; 
};
#

Both scheduled

#

First one does not print, but loops forever

queen cargo
#

second is a bug

little eagle
#

the second one does print

queen cargo
#

while {shouldnotexit} do {}

#

or the waitUntil

jade abyss
#

Wait, the first doesnt exit?

queen cargo
#

it is for BI to decide

little eagle
#

The first one doesn't

jade abyss
#

Okay, thats strange.

queen cargo
#

no thats obvious

little eagle
#

well it would if you report true instead of false

queen cargo
#

exactly
and that is what the second should do too

little eagle
#

X39, it's not so obvious when every other loop does the same thing

#

count

jade abyss
#

2nd : Of course, While()true + exitWith worked since.. idk. forever like that.

little eagle
#

apply

#

select

#

for

#

forEach

queen cargo
#

while & waitUntil are no loops

#

Spinlocks are also no loops

#

they just loop your condition over and over again

#

until they return true

#

it is how they work

little eagle
#

they just loop your condition over and over again
/shrug so they're loops

queen cargo
#

waitUntil is essentially:
while {true} do {if (call _condition) exitWith {};};

#

there is an "over" missing

little eagle
#

No it's not. The gimmick of waitUntil is to only loop once every frame

queen cargo
#

... waitUntil is a spinlock ...

little eagle
#

Semantics

queen cargo
#

not only semantics

#

a pretty damn essential difference

little eagle
#

yawn

queen cargo
#

spin locks should not exit until their condition is met

#

thus that while {exitwith} is exiting the loop

#

is a bug

#

not that waitUntil is

#

frameLoop is not existing

#

the spinLock waitUntil is

#

but as you wont believe me anyway as always ... https://en.wikipedia.org/wiki/Spinlock
In software engineering, a spinlock is a lock which causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking if the lock is available.

little eagle
#

to simply wait in a loop

queen cargo
#

and i already told you how the actual SQF code would look like ...

#

do you even read what i fucking write?!

meager granite
#

I don't think spinlock is applicable term here

queen cargo
#

loop != inside loop

#

it is the closest that you can get for it as far as i know

#

it is simply looping over the condition
and that is where the essential difference is

little eagle
#

If you're really worried about this

#

And you need to compile that string badly

#

Why not do this:

#

"if (true) exitWith {};" + _string

#

And then:
_string = _string select [20];

#

Idk if that works in your context

#

20 is how long that exitWith string is

#

didn't count, you have to insert the correct number

#

22

#

How would that even work

#

hmm

#

I don't think it's possible to tell if a marker is SQF without running it. And then it's too late

#

You can write code without semi colons

#

just use commas

#

try it

#

you will be surprised...

#

But yeah. Good idea. Ban all markers with semi-colons

#

No one uses these in sentences anyway, besides me and I don't play whatever you're working for

#

/ban

#

how do they even execute stuff on the server?

#

on the server???

#

onLoad never fires on the server

#

there are no displays on a dedi

#

remoteExec ?

#

true, but the best way would be to prevent them from executing stuff on the server in the first place

#

Can you getText the onLoad of the rscdisplaychat thing?

#

kick em if it's edited

#

check it twice a second

#

Do you even need markers for you missions?

#

Just disable them if they cause problems

#

No, scrape them entirely

#

right, by command

#

I think you should figure out how they execute anything on the server in the first place.

#

That seems like a more worthwhile endeavor as that could stop other exploits

#

Isn't this what BE is for though?

still forum
#

New SQF command proposal. localUnits. Same as allUnits but only returns local ones. I know that waiting for that to be implemented would get me a nice beard.

little eagle
#

binary createUnit and addMPEventHandler should be nuked though.

#

Just use select, dedmen : P

still forum
#

AllUnits select {local _x}
every few frames in MP with hundreds of AI's running around.. uh.. no

little eagle
#

They didn't care for that when they changed all weapon sound configs

#

dedmen, just use it on the groups then

#

for AI

#

they're all local to the group leaders machine

#

unless they are players

still forum
#

AI PFH script. ACE.

little eagle
#

I mean

#

You could just add local event handlers to the units and keep your own list updated

#

If it's only for soldiers, it should be fine

still forum
#

ace medical_ai ... Tells AI to heal themselves and heal nearbly hurt players. should only run on local AI's for sure.. thats why it's currently using allUnits select {local _x}

little eagle
#
// preInit
CBA_localUnits = [];

["CAManBase", "init", {
    params ["_unit"];

    if (local _unit) then {
        CBA_localUnits pushBack _unit;
    };
}] call CBA_fnc_addClassEventHandler;

["CAManBase", "local", {
    params ["_unit", "_local"];

    if (_local) then {
        CBA_localUnits pushBack _unit;
    } else {
        CBA_localUnits deleteAt (CBA_localUnits find _unit);
    };
}] call CBA_fnc_addClassEventHandler;
#

This is the solution, now use it.

still forum
#

It's ACE code not mine ^^

little eagle
#

Make a PR

#

It's OS, it belongs to everyone

#

basically

tough abyss
#

@little eagle I want BI to remove select

#

and replace it with a less verbose version

#

replace _array select _something

#

with _array[0]

#

slice syntax would be nice.

#

and easier on the eyes.'

dusk sage
#

We talked about that the other day

little eagle
#

OK, but you don't have to ping me for that. Nothing I can do about that.

tough abyss
#

Just want your opinion on that.

dusk sage
#

I don't think anyone would be upset with a faster select

tough abyss
#

It's just so dirty and verbose.

#

select

#

And SQF is close to C why not do that.

little eagle
#

I like dirty, but too much talking does take away from the experience.

dusk sage
#

SQF is not close to C

tough abyss
#

It uses the same preprocessor directives as C @dusk sage

dusk sage
#

Similar yes, close? No

tough abyss
#
#include
#ifdef
#define 
dusk sage
#

Just beacuse it uses similar style, doesn't make it at all like C

tough abyss
#

etc

dusk sage
#

It's more like javascript than C, and that's saying something

little eagle
#

Everything that is not assembly is C++ like. We went over this already.

tough abyss
#

Code wise? No definitely no C

#

Syntax

#

Yes. In someways.

dusk sage
#

Everything that is not assembly is C++ like

jade abyss
#

Does it matter?

dusk sage
#

💤

little eagle
#

Hahaha.

tough abyss
#

Nah SQF is closer to C than it is C++ only in syntax, but SQF is really a bastardisation between PHP (forEach), C, and JavaScript

jade abyss
#

"Does it matter?"

tough abyss
#

Depends.