#arma3_scripting

1 messages · Page 257 of 1

tough abyss
#

You wont its anew engine command in dev branch of arma. Its prob not documented yet on the biki
Also with dev branch its not guaranteed the change will make it into next arma.
Most of the time it will, but sometimes it wont

steep matrix
#

b:ARRAY inareaarray ARRAY
b:ARRAY inareaarray LOCATION
b:ARRAY inareaarray OBJECT
b:ARRAY inareaarray STRING
u:switchcamera OBJECT

opal thistle
#

well, I'm aware of Arma beta patches in that regard

#

hmm

austere granite
#

I'm guessing that allows you check whether multiple objects are inArea in one go?

#

[player1, player2, player3] inAreaArray _markerRandom >> [true, false, false]

velvet merlin
#

@opal thistle

  1. optimization last
  2. optimization work is done based on statistics
#

2 is hard(er) in arma

#

one has some options though

#
  1. debug.log in diag.exe show long running sqf and fsm
#
  1. wireshark et all to analyse traffic
#
  1. log amount of script calls (total and per minute/second)
#
  1. log amount of network calls
#
  1. compute data sent for each network call
#

(talking about network traffic optimization)

#

that aside one can try to improve coding design/architecture ofc - depends largely on goals and specific setup though

#

someone with access to the source code could also create a mapping for mpnetwork.log - atm it only shows ids, but it logs the amount of different network calls (init, pV, setVar, etc)

little eagle
#

@polar folio I don't think you can get around the weapon sway from HitHands. And you have to prevent handleDamage from overwriting your "states" without changing the health system

#

it's a mess

polar folio
#

again. i was just trying to reskin units to make them bloody like if all body parts are damaged except the head

#

only visual

#

appreciate the help though. i'm curious though. why would you want to disable arm injury induced sway? i think it's a neat feature

little eagle
#

You can't do that

#

why would you want to disable arm injury induced sway?
can't do that either

#

I looked everywhere

#

all hard coded

#

just like how vehicles with HitEngine == 1 blow up after ~5 seconds

#

or was it changed to HitFuel? It was one of them

tough abyss
#

Think its hitfuel, the crippled walk occuring at 0.5 health bugs me :/

halcyon crypt
#

@opal thistle ALiVE uses setVariable on logics/modules quite a bit for it's OOP-ish bits, haven't heard of major drawbacks so far. Also check out CBA's hashes.

little eagle
#
testNS = [] call CBA_fnc_createNamespace;
for "_i" from 0 to 1e7 do {
    testNS setVariable [str _i, _i];
};
#

(takes a long time ofc.)

#

testNS getVariable "13221"

#

0.0022 ms

velvet merlin
#

@tough abyss probably 1 thread in general; depends on some specifics though

velvet merlin
#

kju_laptop - Yesterday at 9:13 PM
b:ARRAY inareaarray ARRAY
b:ARRAY inareaarray LOCATION
b:ARRAY inareaarray OBJECT
b:ARRAY inareaarray STRING

velvet merlin
#

feel free to update the wiki

zenith whale
#

Anyone active?

willow pike
#

no

zenith whale
#

sweet

#

Does anyone have any ideas why selling a vehicle from the garage in altis life is crashing my server?

willow pike
#

not without any logs

#

Do you have logs ?

zenith whale
#

Not sure, might have to chop a few up.

#

haha I'll see

leaden knoll
#

Hi Guys. Just a quick question about remoteExec. I am adding an add action for all users using a specefic item ingame. Current the code looks like this:

params["_object","_screenMsg","_scriptToCall",["_arguments",""]];

fnc_addActionMP = {
    params["_object","_screenMsg","_scriptToCall","_arguments"];
    if(isNull _object) exitWith {hint "Object is nothing"};
    _object addAction [_screenMsg,_scriptToCall,_arguments];
    sleep 1;
};

[_object,_screenMsg,_scriptToCall,_arguments] remoteExec ["fnc_addActionMP", -2];

My question is why does it add multiple action menu lines? I know -2 means it will execute on everyones pc except for the server but I thought it would only show one action line but allow everyone to execute it.
While testing this I made the target 2 then it doesnt show at all, since I suppose it only executes on the server.
So I am a bit confused how to use it effectively. Any direction would be appreciated.

little eagle
#

where is this executed from?

#

also, remove the sleep 1;. it's pointless

leaden knoll
#

Executed from a stand: null = [this,"Teleport to ACE Medical Training","scripts\teleportScript.sqf","marker_training_medical"] execVM "scripts\addActionMP.sqf"; Will do.

little eagle
#

and where is that line located?

#

if it's

#

for example from the init.sqf

#

then every client and the server will execute the remoteExec

#

which means that you have one action for every connected machine

leaden knoll
#

No its added in the init of the item, thus locally on the server

#

Thats whats boggling my mind

little eagle
#

what do you mean by init exactly? Editor init box?

leaden knoll
#

Yes, object init

little eagle
#

That is executed on every machine

#

So every machine will send the event to every machine

#

n^2

leaden knoll
#

Seriously? I always thought that all items with codes in the init will only be executed on the server.

little eagle
#

Not the init box. That will be executed everywhere

#

in theory you can simply omit the remoteExec and switch to addAction

#

I just can't remember if these persist through respawn

leaden knoll
#

And if I add if (isServer) exitWith {}; to the script?

#

I mean if !(isServer) exitWith {};

little eagle
#

Same problem

#

Oh. The second line might work

#

But it's really overcomplicated

#

I mean. You filter out all clients, just to send the remoteExec to them

#

Not really needed

#

Also

#

There is a general problem with your approach

#

You remoteExec that "fnc_addActionMP" function

#

But that requires the function to be defined on the clients in the first place

#

defining it in init.sqf won't do, because that is executed after the object init in multi player

leaden knoll
#

I hear you. But for some reason, when I added it normally some people are able to use the addaction, others wont.

little eagle
#

Yes, because you made a race condition

#

if the remoteExec of "fnc_addActionMP" arrives before that function is defined locally (by executing the object init line)

#

then the function will be undefined and no action will be added

leaden knoll
#

I dont exexute it in the init.sqf. I execute it in the object init of the object placed in the editor.

little eagle
#

I didn't say init.sqf

#

even the object init boxes can be executed after the remoteExec command arrives

#

So the remoteExec arrives, but fnc_addActionMP was never defined on the client

#

Your whole approach is overcomplicated which introduces problems like this

leaden knoll
#

Should I then rather define in description.ext as a cfgFunction?

little eagle
#

I still believe that you don't need the remoteExec in the first place

#

so no CfgFunctions entry is needed either

leaden knoll
#

I understand I might be overcomplicating it, I am just trying to wrap my head around the everything

little eagle
#

If you make it simpler it will be easier to understand

#

It being hard to understand is the first sign of it being too complicated

#

First of all

#

You don't need fnc_addActionMP at all

#

all the function does is use addAction

#

So you might as well just remoteExec the addAction command

#

that would get rid of the need to define a function

#

And secondly. You're adding the function at mission start

#

But you have full control of what is being executed on the clients already

#

By utilizing init.sqf and all the other init boxes/files/scripts

#

So there is no need to use remoteExec on mission start in the first place

#

Another minor thing. You planned to execute the addAction everywhere, but the server

#

But that doesn't really make sense if you think about it

#

In single player, you are the server

#

And even in MP, headless clients don't need the action, but they are clients

#

What you really want is a hasInterface check

#

(remoteExec can't do that)

#

Only add the action on machines that "have an interface"

#

which means that there is a player sitting behind the keyboard on that machine

#

Same problem with local hosted MP

#

The host would be the server and would lack the addAction

leaden knoll
#

Ok I will execute it directly. I developed it for MP, so thats why I didnt bother about the server. Just added the target as 0 to test it and change it when I tested on the server. Thanks for that command, first time I have seen it, definitely usefull

#

You mentioned that respawning might cause the command not to persist. I will test it to see if so but any suggestions to circumvent it if it happens?

little eagle
#

I'm not 100% sure. I think the usual method is to utilize a "respawn" event handler

#

I don't use addAction much.

#

And if I would, i'd probably make a framework to fix all these issues first

#

I mean, we do use it for some hacky implementations in ACE.

#

But it's all behind frameworks, so you never actually use the command

leaden knoll
#

Maybe use onPlayerRespawn.sqf somehow? Regardless, thanks for all the tips commy. Appreciate it

earnest path
little eagle
#

All you need to do is to call it in init.sqf

#

on every machine with "hasInterface"

#

I don't know anyone who ever used that @earnest path
What would you need that for? Opening these BI functions is pretty intimidating

leaden knoll
#

Thanks Commy, I should really dig into CBA. THey have sooo many usefull command. CHeers!

earnest path
#

I am trying to make an ambient transit system so busses travelling on routes and picking up and dropping off passengers. I want to have a nice encapsulated structure for the code and i can not find a descent structure anywhere. That link that i posted looked quite nice but there is 0 information about it

little eagle
#

I hope it still works. It's one of the functions I haven't maintained for A3

#

ivaylosp
I think you are better off just using the actual busses as objects with setVariable/getVariable

#

There is a reason that there isn't much info about it. It's probably all quirky and broken

austere hawk
#

is there a quick and easy case-insensitive variant for "find" ?

little eagle
#

(_haystack apply {toLower _x}) find toLower _needle;

austere hawk
#

ok thanks

little eagle
#

quick, but not easy

private _index = -1;
{
    if (_x == _needle) exitWith {
        _index = _forEachIndex;
    };
} forEach _haystack
_index
austere hawk
#

the array is already lower case, only the needle is upper - so the first version is much simpler^^

little eagle
#

_haystack find toLower _needle
then

#

imo

#

it's good practice to make all arrays lower case

#

if you plan on using find in etc. at least

austere hawk
#

noted. im working with hitpoints and config data though

little eagle
#

Yeah. If you always toLower on every input you should be good

opal thistle
#

a bunch of FSM questions:

#

some say FSM processes faster, some say it's not. I heard FSM processes conditions generally faster due to its differewnt realization

#

that's true?

#

I see that FSM allows a natural re-usage of the states in the logic, which is a bit hard in sqf

little eagle
#

The FSM uses a different scheduler space from what I've heard. So you don't take away from the 3ms of the SQF scheduler

zealous solstice
#

@little eagle nit 100% Trze

#

condition run in the unscheduled space and Actions in scheduler

little eagle
#

ok

zealous solstice
#

and FSMs run bevor the other

little eagle
#

sooo. the conditions are done every frame?

zealous solstice
#

you have CPS that is not 100% depended in frames

#

but basicly as far i understand it yes

little eagle
#

so it's like triggers

zealous solstice
#

i think trigger are FSMs

little eagle
#

hmm

zealous solstice
#

but FSMs can slowdown masivly the game and make AI stupied

#

because the AI is Based on FSMs

#

and than higher the CPS are than better reacts the AI

little eagle
#

That is true. Since AI is running on FSMs, taking away scheduler time from FSMs is bad for AI behaviour

zealous solstice
#

a SQF based Statemachine is way better and would run way better

little eagle
#

the annoying thing about .fsm is the editor

#

for sure

#

so how often are the conditions evaluated? they are unscheduled, but the delay between checks depends on what exactly?

#

Or is it hard coded to be 0.5 s like the triggers?

#

you're right about the conditions being unscheduled

#

{systemChat str canSuspend} execFSM cba_common_delayless
-> false

#
0 spawn {
    {systemChat str canSuspend} execFSM cba_common_delayless
};
zealous solstice
#

yes but the question is where they split it because CPS and FPS not must be equal

little eagle
#

What is CPS exactly?

zealous solstice
#

condition evaluations per second

little eagle
#

So it doesn't matter how long they take?

#
0 spawn {
    {systemChat str ["fsm", canSuspend, diag_frameno]} execFSM cba_common_delayless;
    {systemChat str ["dc", canSuspend, diag_frameno]} call CBA_fnc_directCall
};

DC still is one frame earlier

#

But it's a nice alternative

#

in case they fuck it up

opal thistle
#

directCall?

#

what's it, in short?

zealous solstice
#

to change the Env from scheduled to unscheduled

little eagle
#

executes a piece of code in unscheduled env. inside scheduled env. while still supporting return values, HarryD

#

But I'm reminder of another reason why fsm sucks for this, joko.

#

You have to preprocess and load the .fsm file every time with execFSM

#

no precompiling

zealous solstice
#

yes

#

i know

#

FSMs are not the best for normal Game Code

little eagle
#

sqs all over again

zealous solstice
#

its for AI

little eagle
#

And mission flow

#

I guess

zealous solstice
#

as i sad SQF based statemachines are way better

#

and cleaner

little eagle
#

Or you know

#

Don't use state machines in the first place

#

But then again. Baer got the medic AI to work with this

zealous solstice
#

they can improve the performance massivly

#

we in PRA3 use also a statemachine. it is way simpler then the one from baer but a little bit more controllable

little eagle
#

Btw. Is a guy named Tom Nedry working with you on this?

#

He's Austrian

zealous solstice
#

i think he joined our QA team

little eagle
#

I see

opal thistle
#

and what's better performance-, and consistency-wise, if you have to monitor&change the state of 50 towns: to spawn the same loop for every town, or to check all the towns in one large loop and call the state processor if necessary?

#

spawn != new thread in sqf, so I don't see a real difference

little eagle
#

probably one spawn for everything.

#

no idea what you mean by "state processor"

#

if you want "consistency" then don't use the scheduler at all. <---- my opinion

opal thistle
#

by state processor I meant a script that's called if there's something changed in the town state (bool indicator is true) and processes the necessary logic (what do we do if the town is under attack? Changing values, spawning units, etc)

little eagle
#

probably one spawn for everything.

tough abyss
#

How would I use this without
addAction
since I need to run this function onButtonClick?
this addAction[localize ""STR_MAR_Rebel_Clothing_Shop"",life_fnc_clothingMenu,""reb"",0,false,false,"""",' license_civ_rebel && playerSide == civilian'];
So I basically need to run this
life_fnc_clothingMenu,""reb"",0,false,false,"""",' license_civ_rebel && playerSide == civilian
Anyone who knows how to do it? Thanks in advance

little eagle
#
if ( license_civ_rebel && playerSide == civilian ) then {
    call life_fnc_clothingMenu
};

???

tough abyss
#

yes but it's not calling "reb"

#

that button would open the rebel clothing shop

#

so i need "reb" in it

#

... call life_fnc_clothingMenu, ""reb""?

little eagle
#

oh

#
if ( license_civ_rebel && playerSide == civilian ) then {
    "reb" call life_fnc_clothingMenu;
};
dusk sage
#

You'd need it as the fourth element, as to not change the function

tough abyss
#

@little eagle that doesn't work

little eagle
#

[nil, nil, nil, "reb"]

#

as BoGuu said ...

tough abyss
#

if (licence_civ_rebel && playerSide == civilian ) then ["","","","reb"] call life_fnc_clothingMenu; ?

#

["","","","bruce"] call life_fnc_clothingMenu; works well

little eagle
#

no. you need the curly brackets after the then

#

they are not optional in sqf

opal thistle
#

is a game logic spawned only by createUnit command?

little eagle
#

Yes

round scroll
#

question on fired eventhandler from config.cpp: Is the script executed on all connected clients or where the vehicle/weapon is local? Code looks like fired = "_this execVM '\uns_armour_c\scripts\zu23_fired.sqf'; _this call BIS_Effects_EH_Fired;";

meager granite
#

Fired is executed on all clients

tough abyss
#

Hi! BRPVP have a Rush version that is only a mission. I'm having problem with the loading image, it gives an error "brp_imagens\brpvp_tanoa.jpg not found" but the image appears. Tried many formats and names. What is wrong?

round scroll
#

it's not a wonder that the Flak fire would induce lag in Unsung 2.6 on arma 2 with stuff like that then

#

I'll make zu23_fired.sqf a function via CfgFunctions and use spawn instead of execVM. also will change it to fired = "if (isServer) then {_this spawn uns_armour_fnc_zu23_fired;};" I guess it will put stress on the server that way, but reduce lag a bit. Any suggestions to execute the script in a different way that's less costly?

round scroll
#

I checked the script, it selects an ammo burst vehicle, waits for a fuze delay length and then creates the ammo burst vehicle

#

I don't see any particles or other that needs to be local

little eagle
#

this really depends on what the script actually does.

#

my bet is that you'll break it

round scroll
little eagle
#

yup

#

RADAR_SETTARGT_HT is probably a variable set on the gunners machine

#

on the other hand, it is very strange that it uses a global command (createVehicle) in a global event handler (fired)

#

this would create n projectiles. one for every machine

round scroll
#

yes, that's why I'm tasked to look into, to better the situation

#

and before I stumble in this multiplayer forest, I thought I come here for help

little eagle
#

you're tasked to optimize this code?

round scroll
#

yep

little eagle
#

ok.

round scroll
#

or at least to not have it execute on every client

little eagle
#

Do it only on the instigators machine

#

Is this mod using CBA ?

round scroll
#

yes, Unsung depends on CBA

little eagle
#

Good

#

Because the sleep in while thing will never work in MP

#

I'll explain later. brb in 15 mins

round scroll
#

ok, thanks!

little eagle
#

ok. here my suggestions:

  • get rid of execVM by precompiling (seems like you've already done that)
#
  • get rid of _this select 1 by using params
#
  • get rid of the private ARRAY at the start by using the private keyword syntax
#
  • No need for the typeOf here: _btype = typeof _bullet;, because that already is argument 4 (iirc) in the fired eh
#
  • replace:
    if ( (_btype == "Uns_ZAP23_API") || (_btype == "Uns_Quad_ZAP23_API") || (_btype == "uns_RU_B32_145x115_API_quad") ) exitwith {};
#

with:
if (toLower _btype in ["uns_zap23 ....]) exitWith {};

#
  • _ammo = _ammoArray select floor random count _ammoArray;
    use `selectRandom
#
  • replace the binary createVehicle with the unary one:
    createVehicle [type, position, markers, placement, special]
#

use special == "FLY" for projectiles and use position [0,0,0] and then setPosASL

#

^ that is much much faster

#

It's a sum of small things plus that createVehicle

#

Oh and regarding locality

#

(Since Arma 3 v 1.65)
gunner: Object - Unit that fired. The actual shot instigator could be retrieved with getShotParents command

#

iirc this should be working right now too

#

Use the gunner and exitWith if the gunner isn't local

round scroll
#

ok, 1.65 is current dev I guess

little eagle
#

otherwise use:
private _gunner = [cameraOn, "HMG_127_mbt"] call CBA_fnc_getFirer select 0

#

If gunner isn't defined yet, you can use the CBA function I posted

#

shouldn't make much difference, but eventually you want to use the gunner reported from the event handler

round scroll
#

so you would recommend against publicVar'ing the setvar and just executing it on the server?

little eagle
#

Do it on the gunners machine

#

You should get rid of the lag from scripting if you use the createVehicle ARRAY - setPosASL trick

#

if it still lags, then it's particle effects from the explosions or something like that

#

maybe uncompressed sounds

round scroll
#

ok, will give it a try! Thanks a lot

little eagle
#

Don't think so. Last time I used AGLToASL for that, no one complained

round scroll
#

will test it now 😃

little eagle
#

Quiksilver, do you remember what the default value for getText is?

#

In case the entry is undefined?

#

I don't need to know

#

But if you figure it out

#

And stare at BIS_fnc_effectFired long enough

#

You'll find something nice

#

"nice"

#

...

#

yup

#

😉

#

I think it's hard coded like init.sqf

#

it doesn't appear in the all in one config

#

gl with that

#

teach the plebs how to install mods

#

ffs

#

The projectile should be the same

#

but there is no way to tell when it pops

#

maybe some kind of array pushing back all projectiles a gunner shot

#

and then poping the oldest one via onFlare.sqs

#

if the gunner is the same?

#

retrieve it with the method I described

#

should be simple enough

#

they're not gonna update a .sqs file

#

Flares are neither shotBullet nor are they parachutes though

#

So who knows what it does in C++ land

#

It never specifies a "sub projectile"

#

like the mine thrower arty does for example

#

or shot guns

#

So I'd say it's the same projectile

#

Doubt it

#

Pretty sure even if you could get a scripted flare to actually glow

#

It would use the local config for that

tough abyss
#

Evening all, trying to make a world intro for my ArmA 3 mod. I put this in the initIntro.sqf however when it starts, its just a black screen

#
[
    {
        ["InitDummy",["Altis",[4711.24,21737.6,1.67612],346.591,0.7,[-0.606029,0],0,0,493.103,0.00851527,0,1,0,1]] call bis_fnc_camera;
        setViewDistance 2000;
    }
] call BIS_fnc_initWorldScene;
#

I tried setting view distance higher but that didn't work

dusk sage
#

that works for me fine ^

tough abyss
#

hmmm, I am not sure why it is a black screen.

earnest path
#

Hey guys i have the following setup:

@mod1
    Addons
         mod1.pbo
             init.sqf
         mod2.pbo
             init.sqf

I can not get the init.sqf of mod2 do execute. Any ideas why?

little eagle
#

How is the init.sqf executed? CfgFuntions pre/postInit = 1; ?

#

My guess is that the configs clash

#

the class names

earnest path
#

Omg i thin you are right

#

I will try it now

#

So i have CfgFunctions class in both pbo

#

Is this not allowed

little eagle
#

You can have CfgFunctions in both, but the sub classes inside have to use different tags

#

I usually use "Component" names

#

So in your example the master config would look like this:

#
class CfgFuntions {
  class MyTag_mod1_functionName { ... };
  class MyTag_mod2_functionName { ... };
...
};
#

for mod1.pbo and mod2.pbo

broken mural
#

Do you spawn npcs with createVehicle?

little eagle
#

No

#

createUnit for everything that has a "brain"

broken mural
#

Thanks!

earnest path
#

@little eagle When you refer to master config. Where is that config situated?

little eagle
#

Nowhere. it's what the game generates when it's started out of all "config patches"

#

which are all the config.cpp and config.bin files of all loaded PBOs

earnest path
#

I see

little eagle
#

You can look at it in the ingame config viewer

earnest path
#

i will check it now

little eagle
#

If there is only one entry, the game will only execute one function

gilded rover
#

how do you swap recoil of weapons (base game) . for example replace MX recoil with MK20

little eagle
#

you need to edit r

#

configs for that

#
    class GM6_base_F: Rifle_Long_Base_F {
        recoil = "recoil_gm6";
    };
broken mural
#

No errors, ether.

modest sonnet
#

hey anyone here to help?

#

well anyway Im trying to add a action for a certain type, how I make something like this work if addAction ["Delete Vehicle", "deleteVehicle cursorTarget;"];

#

with if type="B_diver_F" then

tough abyss
#

okay that code formatting got fucked up

#

also i'd add the action on the vehicle itself

broken mural
#

is there a bound sitting animation? Only one I can find on the wiki is for Queen's Gambit

tough abyss
#

@modest sonnet Can you send that code a bit more proper?

#

I'd also recommend putting the addaction in the vehicle and using deleteVehicle

gilded rover
#

@little eagle cant you say class GM6_base_New_F : GM6_base_F { recoil = "recoil_gm6"; };

little eagle
#

Yes

thorn saffron
#

does anyone know how to make AI give "Take Cover" order available to player?

lyric isle
#

looking for a script to play music from a vehicle in 3D (gets quieter as you move away). Anyone able to be a legend and help me?

thorn saffron
#

TPW mod has a radio transmissions going on when you are inside vehicle and near it, you can take a look at the scripting to maybe see how's it done.

round scroll
#

playSound3D seems to be a good way, it supports a max range

inner swallow
#

say3D may be simpler.

#

playSound3D uses absolute paths.

broken mural
#

should you execute addaction on initPlayerServer or initPlayerLocal? All players will have this addaction.

tame portal
#

Initplayerlocal

#

Initplayerserver only gets called on the server when a player joins the mission

broken mural
#

Roger.

broken mural
#

is there a better way to handle a specific AI's death other then a trigger? I want something to happen when a player kills a specific AI and want to avoid trigger objects if at all possible.

inner swallow
#

maybe look at event handlers?

broken mural
#

@inner swallow cheers. Looks like this is what I'll need.

tough abyss
#

Hello, I'm having a wave script and it doesn't work.
I have 3 groups of enemies spawning from a script, I named each group with a global variable "groupWaveOne" "groupWaveTwo" and "groupWaveThree". In the RPT file I get script faults saying that it doesn't recognize the variables.

({alive _x}count units groupWaveOne) <1 && ({alive _x}count units groupWaveTwo) <1 && ({alive _x}count units groupWaveThree) < 1;
};```
#

It should recognize the variables because I've done something like this berfore, and the groups script is just the same as it was before.

broken mural
#

@tough abyss create the global variables in init and set them in your script you're calling them in, then call publicVariable groupWave___ after giving them value. Should be able to call them after the fact.

#

publicVariable broadcasts the change. If you cant set the value in init it should work fine.

tough abyss
#

Sorry, I don't think I got it right.

I need to create the group in the init file? or just do
publicVariable groupWaveOne;

#

creating the group creates the veriable, I think,

broken mural
#

Based on the error it sounds like the global variable(s) haven't been instantiated yet. As if your waitUntil is being called before your groups are created. If they aren't, try calling publicVariable _____ after setting the value of each

austere granite
#

Is there a reliable event I can use that always runs whenever a mission is ended, but still has all the info on objects / players? (Specifically getPlayerUID and allPlayers)

little eagle
#

no

austere granite
#

10/10 : (

#

I can do modside things btw, any way then? 😦

#

This sorta stuff still seems.... obvious to me to have in some way

#

I don't have the game on this PC to test, but I'm guessing "Ended" mission event doesn't run when #missions is used then?

#

Or does that not have the functional commands anymore

broken mural
#

any idea how to disable an object's disassemble action? removeAction and removeAllActions doesnt work.

little eagle
#

you have to edit the configs for that. no script solution possible

opal thistle
#

guys, there's a thing. I plan to store mission-related player data, like money, role, etc in an array. But when a man is no longer on the server, I have to clean this info. How?

#

there's onPlayerDisconnected EH, but does the event fires every time the player disconnects, e.g. on kick, not-responding-timeout disconnect?

#

can't find any way to check if a player with given UID is still on the server

#

or with given GUID

cedar kindle
#

you can't save it to profileNamespace? on the clients

polar folio
#

didn't know which section to ask this in:

#

if your addon released on the workshop consists of several pbos, can you update only one of them or will putting only one in cause in the other pbos being perceived as obsolete?

native hemlock
tough abyss
#

Any ideas how to pass a task variable and a unit into a trigger as parameters?

params ["_targets"];
private _count = 1;


{
    //element in targets array
    private _target = _x;

    //check if target is group leader or in group? //TODO

    //create eliminate task for this target
    private _eliminateTask = ["eliminateTask", _count] joinString "";
    [
        west,
        _eliminateTask,
        ["Eliminate hostile forces","Neutralise"],
        getPos _target,
        1,
        2,
        true
    ] call BIS_fnc_taskCreate;


    //create a trigger that completes the task when the target has been eliminated
    _eliminateTrigger = createTrigger [["eliminateTrigger", _count] joinString "", [0,0,0]];
    _eliminateTrigger setTriggerArea [0, 0, 0, false];
    _eliminateTrigger setTriggerActivation ["NONE", "present", true];
    _eliminateTrigger setTriggerTimeout [0, 0, 0, true];
    _eliminateTrigger setTriggerStatements ["!alive _target", [_eliminateTask, "SUCCEEDED",true] spawn BIS_fnc_taskSetState , ""];

    _count = _count +1;

} forEach _targets;
little eagle
#

@native hemlock No. That won't block pressing space/f or whatever "default action" is bound to

#

you get an icon to disassamble and that doesn't use the interaction menu and the ui handler

opal thistle
#

@cedar kindle ah, yeah, it might be good idea for a role. As for the rest, well, the server has to know about player money at least, hence I need a public data structure for it

#

Well, and storing money locally is unsafe

broken mural
#

Another problem! I'm calling a function from initServer which spawns a bunch of objects, and for each object I addAction. Works just fine when Im testing in multiplayer client hosted. When I switch to dedicated, it fails to addaction. The only information I can find refers to BIS_FNC_MP which the wiki says use RemoteExec or RemoteExecCall. What would the proper syntax be for calling a function in an addaction via remoteExec/RemoteExecCall, and which remoteExec iteration would be better suited?

Note: the addaction has to be present for all players.

broken mural
#

Furthermore, @native hemlock I added that event handler and it worked perfectly! For those interested, I found this: https://forums.bistudio.com/topic/186347-eject-player-using-mortar/

code
inGameUISetEventHandler [ "Action", " _target = _this select 0; if ((_this select 3) in ['GetInTurret','DisAssemble'] and (typeof (_this select 0) in ['B_G_Mortar_01_F','O_Mortar_01_F','I_Mortar_01_F'])) then { true; }; " ];
doesnt remove the action from the object but it doesnt do anything when the player selects it.

broken mural
#

it appears [_object, ["interact", functionName, ["f", 1], 6, true, true, "","side _this == west", 3, false]] remoteExec ["addAction", 0, true]; works fine in client hosted but not in dedicated.

halcyon crypt
#

did you try adding a delay before doing the remoteExec to allow the clients to sync up with the server after object creation?

broken mural
#

Trying now, @halcyon crypt

#

negative, @halcyon crypt . sleep 1; before remoteExec had no effect.

halcyon crypt
#

hm weird

#

perhaps try increasing the radius to 10?

#

probably won't do much but it can't hurt to try ^^

#

also, does functionName exist on the server?

#

I think it's better to create a function that does the addAction and stuff and call that function with remoteExec, that way you can also "debug" the thing.

broken mural
#

I have one function that spawns each object and adds addaction to each which calls a function that dictates what happens based on the object calling it. Yes, fn_functionName exists. for clarity, the code works fine in isServer, just not isDedicated.

jade abyss
#

test it like that:
[{player addAction [blablubsettingsvarsetc]}] remoteExec [blablaTargetBla];

shadow sapphire
#

How do you make a certain side win a PVP game mode based on trigger conditions? The trigger conditions are set, but "SideScore" call BIS_fnc_endMissionServer; doesn't work like I need it to for this. I want to it specifically say Blufor or Opfor won based on triggers I've set.

broken mural
#

interestingly i tried testing remoteexec and remoteExecCall from debug in dedicated server and only I receive the hint

broken mural
#

Alright small update; I was able to get this to work in the debug console [player, ["Greetings!", {hint "Hello!"}]] remoteExec ["addAction", player ,true]; however I had to click Global Exec. What is the script equivelant of running that as global exec? lol

lime tangle
#

That is exactly what I have been needing for a long time quiksilver haha

clear tendon
#

stupid question i guess, but diag_log pushes a format to the (server) log file, right?

#
if (isDedicated) then {
    while {profiler} do {
        _profilesBySide = [ALiVE_profileHandler,"profilesBySide"] call ALIVE_fnc_hashGet;
        _profilesBySide = _profilesBySide select 2;
        sleep 30;
     
        diag_log format ["Profile Count OPFOR - %1", count (_profilesBySide select 0)];
        diag_log format ["Profile Count BLUFOR - %1", count (_profilesBySide select 1)];
        //diag_log format ["Profile Count INDEPENDANT - %1", count (_profilesBySide select 2)];
    };
};

Doesn't show up in the logfiles for some reason :/

little eagle
#

profiler false or undefined?

tough abyss
#

this might be nit-picky, but does it matter if independent is mis-spelled?

little eagle
#

isDedicated also is only true on a dedi. Might want to use isServer to support local hosted MP

#

the command, Vauun?

tough abyss
#

//diag_log format ["Profile Count INDEPENDANT - %1", count (_profilesBySide select 2)];

#

This line.

little eagle
#

nah. it's just a string

tough abyss
#

that's what i thought

#

What's the best way to grab the PID of a player?

#

I

little eagle
tough abyss
#

I'd like to make a redundant zeus module which doesn't let anyone initially connect to it, and if the primary one goes down the zeus can take the other slot with the game checking against his PID so there's only one zeus.

#

Thanks.

broken mural
#

@tough abyss With regard to your example, <target> refers to the object I'm adding the action to? Because player addaction would just add it to the player. Would it be
[ [], { <target> addAction ... } ] remoteExec ['call',<target>];

instead?

little eagle
#

No. The code block is executed on the targets machine. Where "player" is the object you want to attach the action to

#

<target> in remoteExec can be an object. but it can also be a side or a group

#

or a number

#

2: server
0: everyone
-2: everyone but the server

#

And if you want to pass variables to the code block, which <target> presumably is, you'll have to use the first array and then params inside the code block

halcyon crypt
#

anyone know of a way for getting the mass of an object without spawning it in?

clear tendon
#

@little eagle profiler = true

#

it's a quick way for me to turn it on or off while in game to enable the profiler debug, but it's on by default.

#

@little eagle it's also hosted on a dedi, so that's not the issue

halcyon crypt
#

hmm, last time I checked mass isn't set in config but in the model itself?

#

nope 😦

#

getnumber (configfile >> 'cfgvehicles' >> 'B_MBT_01_cannon_F' >> 'mass') returns 0

little eagle
#

without spawning it in

#

not possible : /

halcyon crypt
#

yeah we figured, was hoping that it changed in the last weeks/months ^^

little eagle
#

oh right

#

wasn't there something that accepts the models path?

#

I guess I'm thinking of createSimpleObject

#

yo

#

the physx masses are BS anyway

#

like

#

a ammo box has 500

#

You litterally have to make tripods weight 250 kg for them to not topple

halcyon crypt
#

@lavish ocean any known plans to allow getting the mass of an object by classname without spawning in the object? 😊

little eagle
#

edit the configs

#

they were brighter in Alpha

#

and then they toned them down

tough abyss
#

anyone able to script something like this ?

halcyon crypt
#

it requires an extension so mod only

#

if you want to stream internet radio stations anyway

tough abyss
#

i do indeed 😃

#

the one linked doesn't seem to work

clear tendon
#

@little eagle

while {profiler} do {
        _profilesBySide = [ALiVE_profileHandler,"profilesBySide"] call ALIVE_fnc_hashGet;
        _profilesBySide = _profilesBySide select 2;
        sleep 10;
     
        if (isServer) then {
        diag_log format ["Profile Count OPFOR - %1", count (_profilesBySide select 0)];
        diag_log format ["Profile Count BLUFOR - %1", count (_profilesBySide select 1)];
        //systemchat format ["Profile Count INDEPENDANT - %1", count (_profilesBySide select 2)];
        }
        else{
        
        systemchat format ["Profile Count OPFOR - %1", count (_profilesBySide select 0)];
        systemchat format ["Profile Count BLUFOR - %1", count (_profilesBySide select 1)];
        //systemchat format ["Profile Count INDEPENDANT - %1", count (_profilesBySide select 2)];
};
};

even doing it like that doesn't poop it out on the dedicated logs

halcyon crypt
#

@clear tendon sounds like the script isn't even called

broken mural
#

@little eagle would the same apply if I wanted to attach an addaction to an object and not the player? So
[ [], { _objectLikeABoxOrSomething addAction ... } ] remoteExec ['call',-2];
would fire for every player including JIP to addaction to that object? Would you place that in initPlayerLocal?

tough abyss
#

are there any freelance scripters that any of you guys know of ?

#

literally all of us here freelance

#

emphasis on FREE

#

it's just that the lengths we go to are less to solve problems compared to someone who is getting paid

clear tendon
#

the fun fact it, it does work on sp /w the systemchat

#

yet logs.. ¯_(ツ)_/¯

tough abyss
#

ok 😃 , well if anyone has the opportunity to look into that- it would be highly appreciated, I'm also happy to make a donation for someones time

halcyon crypt
#

@tough abyss or you can just ping @brazen sparrow ^^

tough abyss
#

@halcyon crypt He doesn't seem interested

halcyon crypt
#

no clue if he's active though

#

@clear tendon put a diag_log before the while loop and check if that shows up

clear tendon
#

goodone, you're @halcyon crypt from aliveforums too right 😉

halcyon crypt
#

mhm

clear tendon
#

whuuut..

14:55:30 Error in expression <hile {profiler} do {
_profilesBySide = [ALiVE_profileHandler,"profilesBySide"] c>
14:55:30   Error position: <ALiVE_profileHandler,"profilesBySide"] c>
14:55:30   Error Undefined variable in expression: alive_profilehandler
#

@halcyon crypt perhaps add a waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"}

#

or something to check if alive is actually called

halcyon crypt
#

waitUntil {!isNil "ALIVE_profileSystemInit"}; seems to be the right one

clear tendon
#

Rgr, let me boot the server gain.

#

@halcyon crypt - got it working now. Dumped it in a septerate sqf w/ that waitUntill + loop:
Loop:

waitUntil {!isNil "ALIVE_profileSystemInit"};
while {profiler} do {
    _profilesBySide = [ALiVE_profileHandler,"profilesBySide"] call ALIVE_fnc_hashGet;
    _profilesBySide = _profilesBySide select 2;
    sleep 10;
        diag_log format ["Profiler is: %1", profiler];
        if (isServer) then {
            diag_log format ["Profile Count OPFOR - %1", count (_profilesBySide select 0)];
            diag_log format ["Profile Count BLUFOR - %1", count (_profilesBySide select 1)];
            //systemchat format ["Profile Count INDEPENDANT - %1", count (_profilesBySide select 2)];
        }
        else
        {
            systemchat format ["Profile Count OPFOR - %1", count (_profilesBySide select 0)];
            systemchat format ["Profile Count BLUFOR - %1", count (_profilesBySide select 1)];
            //systemchat format ["Profile Count INDEPENDANT - %1", count (_profilesBySide select 2)];
        };
};

Debug:

15:14:09 "Profiler is: true"
15:14:09 "Profile Count OPFOR - 44"
15:14:09 "Profile Count BLUFOR - 15"
#

gives me insight to see if the backup/ai spawns keep working

halcyon crypt
#

neat 😃

little eagle
#

@broken mural You cannot use _objectLikeABoxOrSomething inside that code block. You have to pass it as argument.

would fire for every player
It would fire for every machine that is not the server (-2)
including JIP
No, but there is a flag to do that. See: https://community.bistudio.com/wiki/remoteExec
Would you place that in initPlayerLocal
Probably a good idea, unless it's an object that is spawned by the server and thus has no reference on the client when initPlayerLocal is executed

tough abyss
#

hmm ok , so it appears the creator maca134 has had issues with his own creation, asked for help to fix it, now that he has he wont share it :p sounds fair

broken mural
#

@little eagle so it'd be
[ [objectLikeABoxOrSomething , [addaction parameters]], { _player addAction ... } ] remoteExec ['call',-2, true];? Trying to fully understand this as this is a cornerstone for the mission file.

If ithe objectLikeABoxOrSomething IS spawned by the server, how would you call this addaction so that all players have the action?

little eagle
#

_player is undefined

#
[
    [_objectLikeABoxOrSomething , _addActionParams],
    {
        params ["_objectLikeABoxOrSomething", "_addActionParams"];
        _objectLikeABoxOrSomething addAction _addActionParams;
    }
] remoteExec ['call',-2, true];
#

like this

#

passing arguments

broken mural
#

@little eagle thanks, i really appreciate the example.

broken mural
#

oh @little eagle where should you call this if the objects are spawned by server on initServer (the function is the last thing called in initServer that handles all the spawning)? Still initPlayerLocal?

little eagle
#

No. If you use remoteExec , then you do it from the server

#

otherwise all the clients would remotely add these actions on all other clients

#

You'd end up with multiple copies for every connected client

tough abyss
#

What's the best way to bar connections to a slot based on player UID?

#

I have a second zeus module I would like to not have players connected to based on the UID of the primary Zeus. I can ensure players don't start in the secondary Zeus initially, so I can add a script that grabs the UID just fine, but I want to bar connection to it if their UIDs don't matc.

#

Does arma2net still work with arma 3

dusk sage
#

@tough abyss

Check if they are in the slot, then kick them

#

Nothing to overthink

tough abyss
#

That's easy enough. Is there a kick command? At work, I can't browse the library right now.

dusk sage
#

Use endMission

#

Naming your units

#

Can just do

tough abyss
#

endMission locally?

dusk sage
#
If in slot ["zeus_2","zeus_3"] -> endMission
#

use str player

#

Yes, locally

tough abyss
#

Sounds good. Thanks!

broken mural
#

@little eagle Thanks for the info!

rich sphinx
#

Hello, is there someone online willing to help?

dusk sage
#

Doesn't look like it!

#

1000 people isn't enough

rich sphinx
#

Okay, is there some way, when I set a boolean variable in a script to true, to move certain AI unit to certain position, say, to position of Game Logic?

opal thistle
#

there's a question here:

#

https://community.bistudio.com/wiki/Game_Logic states that the game logic will always be local to a host that created it. What if I spawn a gameLogic at the mission start for both client and server with the same name and then call myGameLogic setVariable [name, value, true]?

#

does the value updates for all clients as well?

modest sonnet
#

quick question.....why would this work " if (sign > 4) then { sign = 0 }; " but not this " if (sign = 4) then { sign = 0 }; "

fallen locust
#

sign = 4 is an assignment
sign == 4 is what you are looking for @modest sonnet

modest sonnet
#

Thanks dude, was SO confused

fallen locust
#

@opal thistle
Server side: CreateLogic, PublicVariable it

open vigil
#

iirc "=" assigns a value ( x = 0) whereas "==" means equal to. I'm sure someone will correct me if im wrong (cause thats how we roll here 😉 )

little eagle
#

\a3\ui_f_curator\ui\displays\rscdisplaycurator.sqf: line 146

        _draw3d = addmissioneventhandler [
            "draw3d",
            {
                _fadeStart = uinamespace getvariable ["",1000];
                _fadeEnd = uinamespace getvariable ["",2000];
opal thistle
#

@fallen locust thanks!

clear tendon
steep matrix
#

new SQF in dev since yesterday:

Version: 1.65.139010
b:GROUP enabledynamicsimulation BOOL
b:OBJECT enabledynamicsimulation BOOL
b:STRING setdynamicsimulationdistance SCALAR
n:dynamicsimulationenabled
u:diag_dynamicsimulationend STRING
u:dynamicsimulationdistance STRING
u:dynamicsimulationenabled GROUP
u:dynamicsimulationenabled OBJECT
u:enabledynamicsimulation BOOL

#

acn someone check what they are about it please
they have an interesting sound to them at least

tough abyss
#

I want to change the key of this function but I don't now wich is the key.
player addaction [("<t color=""#FF0000"">" + ("Admin Menu") +"</t>"),"AdminTool\Admin-Pfad.sqf","",5,false,true,"",""];

meager granite
#

Hm, I just came up with a way to move remote object each frame without sending setpos packets

#
  1. Create (invisible) non-network object (createVehicleLocal)
  2. Attach remote object to that local object (no attachTo packet is sent when attaching to non-network)
  3. Move that local non-network object each frame however you like
#

Any flaws in the plan?

#

Could work like an imitation of setPosLocal

halcyon crypt
#

"should" work? I guess it's similar to how the player pos is updated, packet wise.

#

kinda out there but yeah ^^

tough abyss
#

What's the best way to add an eventhandler for an array of units?

velvet merlin
#

getMass only works with an entity as it has to read the data from the model/p3d - its not related to the "mass" stuff set in configs

split coral
#

@velvet merlin In-game command help doesn't tell much about the dynamic simulation. But the same thing is used when placing objects, and the tooltip says: "Makes object simulation dynamic. Simulation is enabled only if player or enemy unit is nearby".

velvet merlin
#

thanks!

native hemlock
#

That'd be nice, would save from having to use a caching script

velvet merlin
#

time to bother BI in the forum i guess

split coral
#

Oh, there's also a new entry in the editor's performance menu: "Dynamic simulation - Objects and empty vehicles: <distance>. Infantry: <distance>

dim terrace
#

dynamic simulation = old garbage collector?

tough abyss
#

Sounds more like enableSimulation that is engine controlled & you can define the distance to enable/disable it.
Instead of doing it via sqf

halcyon crypt
little eagle
#

wrong

#

pseudo namespaces are LOCATION type, not NAMESPACE

zenith whale
#

hello, would anyone happen to know how I can change the button layout of the Y Menu in altis life like if I were to make a tablet and have the buttons look like apps in it? like I want to know how to position them properly on screen

cinder cloud
#

@zenith whale, you will need to edit the \dialog\ files. Arma has a GUI editor that can be opened after pressing escape when previewing inside of the Eden editor.

zenith whale
#

awesome, thank you!

#

@cinder cloud

vapid frigate
#

anyone know how to run something as soon as the loading screen after the map screen is gone? basically trying to show a splash screen as the mission starts

#
    endLoadingScreen;``` using this before creating the UI but half the time it does the splash screen while the loading screen is up
vapid frigate
#

thanks, will give it a shot

halcyon crypt
#

@little eagle aahhh bad assumption 😁

runic heart
#

So players have asked us several times on moving our tazer to another slot so they can quickly move between a pistol and a tazer because we dont allow rifles. Without changing how the tazers look and feel does anyone have any suggestions on how I could do this efficiently?

meager granite
austere hawk
halcyon crypt
#

@runic heart keep track of the trazer and pistol in memory and switch them on a keypress / menu action? That's similar to how ACE2 and DayZ Mod handled it for the "weapon on back" kind of thing.

#

not too sure about ACE2 but DayZ Mod definitely

runic heart
#

Ya something where they don't have to drag the tazer/pistol out of backpack in a situation

flat hornet
#

Anyone know if the SQF (Status Quo Function) language is single threaded in scheduled or unscheduled enviroments?

#

Because what I've observed it executes single-threaded in unscheduled pushing CPU core 0 usage to 70 - 80%

#

Then drops down again.

spark phoenix
#

@flat hornet from what I know scheduled scripts run on a single thread.

flat hornet
#

Why?

#

Why couldn't they I don't know?

#

Create local headless clients?

#

to the client?

#

This way you could have as many HC's to offload from the primary thread?

#

I mean I even performed a hack when I hate a messaging system where by I had the HC's listening for a remoteExec message

#

and upon recieving it sent the message to clients

#

so it would go from Server Initial message -> Headless client (Processes messge) e.g setrain and setOvercast, then [60,1] remoteExec ["setRain",-2,false];

#

From the headless client to the main clients.

#

Could you see any useful benefit with this Kegan Hollern?

#

In this way the headless client behaved more like a server than a client.

#

?

spark phoenix
#

That'd work @flat hornet but it'd be a lot of work for them. The best solution is to implement a way for scripters to create multiple environments (that run on different threads) for non time sensitive script threads to be run on.

I haven't looked to much into the engine but from what I gather that would still be a tall order.

flat hornet
#

What about my method of offloading processing from the server?

#

Is there any danger in letting the HC's do processing via remoteExec ?

#

The interesting thing with that is it allowed me to stipulate exactly which HC's handled the code and which didn't

#

by simply getting the HC's ID's build it into an array

#

get the ID send it to the HC for processing

#

Wait...

#

Last time I checked I read something about Single player headless clients mentioned

spark phoenix
#

I don't see a danger in your offloading idea. Just be sure to secure remoteExec to prevent clients from sending the HC commands.

#

Although, headless clients need to be put under a microscope. We need to be able to run more than one on a dedicated box

flat hornet
#

I do run more than one.

#

Actually our server runs 3

#

Using CPU pinning to prevent them from affecting the main server

#

Then a bunch of bat files.

#

Which are going to get replaced with PowerShell

#

At the current time we only run 2 HC's as we need more CPU cores

#

But both of them are given 2 cores to play with.

#

Using the binary masks 1100000 and 00110000 -> ‭C0‬ and 30

#

/affinity confining the HC's to 2 cores each

gray hemlock
#

That's what we did with our old desolation servers. Set affinity with the bat file.

spark phoenix
#

Well now I feel out of the loop... Lol

flat hornet
#

I'll be changing to powershell

#

but I have to use -Set-ExecutionPolicy remoteSigned

gray hemlock
#

Yeah, I cleaned up a lot of stuff when MOTO reorganized. Basically you can set the affinity with /affinity and define which cores you want it to run on from start. Only ran into problems when the shutdown didn't work properly, duplicating the servers.

flat hornet
#

You know what I did to address that?

gray hemlock
#

I shure would

flat hornet
#

The bat-file had an interrupt waiting for you to press any key

#

hit keyboard twice server would terminate

gray hemlock
#

*facepalm

flat hornet
#

I also renamed the arma3server.exe

#

and then targeted taskkill to the /F /IM "arma3ServerOurExec.exe"

#

this way it would look for the file image name

#

and terminate correctly.

#

Also renamed for the arma3serverheadless.exe

#

that way we used taskkill /F /IM "arma3serverheadless.exe"

#

it would look for all the file image names

#

and terminate them

#

This way I could deal with the unknown /PID problem

#

You try that BigBen?

#

PowerShell is better suited to these tasks though.

gray hemlock
#

I had all the exe changed to unique names. Not sure why taskkill wasn't working. Have not ran public servers from that dedi since Desolation died.

flat hornet
#

Were you running them as administrator?

gray hemlock
#

Yes.

flat hornet
#

did you use /F ?

gray hemlock
#

I would have to take a look. I'm at work, so no access to that dedi.

#

Unless @spark phoenix is still awake and can look.

flat hornet
#

taskkill /F explicitly forces it to close it

#

but seriously powershell

#

is much much more flexible.

#

You can allow remoteSigned

#

Set-ExecutionPolicy remoteSigned

#

otherwise nothing will run

#

Funny story BigBen

#

Because our community was named something similar to the US marines

#

Chinese hackers kept trying to break into our server

#

Too bad for them I had lockout policies enabled

#

unfortunately I didn't account for a lockout policy DDOS

#

So even though they could keep trying to break into the server

#

I did the numbers and worked out how long it would take them to try every permutation

lethal ingot
#

Hello! Is there a tutorial on how to create database and insert/read player data from it? Thank you!

steep matrix
#

//Added: A set of bitwise scripted functions
class Bitwise
file = "A3\functions_f\Bitwise";
class bitwiseAND
class bitwiseOR
class bitwiseXOR
class bitwiseNOT
class bitflagsSet
class bitflagsUnset
class bitflagsFlip
class bitflagsCheck
class bitflagsToArray

#

maybe someone feels like extracting their scripts in dev branch and check how they are used/if the cmds can be used elsewhere too

#

or someone gets BI to document them 😉 @lavish ocean

lime tangle
#

get BI to document

#

Thats a task

steep matrix
velvet merlin
#
Global namespace not passed during: false
Error in expression <false>
  Error position: <false>
  Error Local variable in global space
#

any idea where this could come from - mission.sqm? (not my mission 👼 )

austere granite
#

I have this same thing in my RPTs, not sure why.

lime tangle
#

Rip BI

austere granite
#

For someone who doesn't do programming outside arma, what would you use the bitwise stuff for?

distant egret
#

@velvet merlin it's an issue in a mod.cpp I believe, RHS had this issue before.

dusk sage
#

An absolute plethora of things @austere granite

#

Encryption, networking, video/audio codecs, bit fields

#

The list goes on and on, I think a quick google search might quench your thirst to know 😉

#

For a quick fun example using the right shift operator (>>), the snowflake of your user on Discord is 106185333267255296, which corresponds to (by shifting 22 bits, then using the Discord epoch) your account being made at: 21/10/2015 00:22:36

little eagle
#

@velvet merlin RHS or a different mod.cpp. It's what happens when you teach people that false and true are valid things in config

velvet merlin
#

ok thanks 😃

little eagle
#

//Added: A set of bitwise scripted functions

#

Why are these functions and not SQF commands

dusk sage
#

Doesn't seem like overly much point tbh

#

They are meant to be fast

little eagle
#

Yeah. Everyone who could've used them is smart enough to make them themself

#

But no one does and guess why

dusk sage
#

XOR would've been nice

tough abyss
#

@velvet merlin I've seen "local variable in global space" when editor-placed units have local variables in their init. That is, _x, _this, or _whatever

#

when it doesn't make sense to have one..

dim owl
#

Hey, i have a structuredtext in my controlsgroup but it wont show the text when i set it in the script. Just trying with (_control is defined) _control ctrlsetstructuredtext parsetext _mytext; any ideas ?

spark phoenix
#

what are the contents of _mytext; @dim owl

#

@little eagle adding bitwise commands would take < an hour for them to add to the engine. Hopefully theyll take the time.

dim owl
#

@spark phoenix I have a switch and inside are for example these:case "1": {"<t align='center'>I am so cool!</t>"}; (thats just an example)

little eagle
#

show the whole thing, Basti

dim owl
#
_display = findDisplay 4354;
_ctrlgruppe = _display displayCtrl 121212;
_data = _contentlist lbData (lbcursel _contentlist);
_contenttext = switch (_data) do {
case "0": {"<t align='center'>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</t>"};
case "1": {"<t align='center'>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</t>"};

_ctrlgruppe ctrlSetStructuredText parseText _contenttext;
_h = ctrlTextHeight _ctrlgruppe;
_ctrlgruppe ctrlSetPosition [0, 0, 0, _h];
_ctrlgruppe ctrlCommit 0;

For testing just some lorem ipsum from the web

little eagle
#

hmm. needs some formating

dim owl
#

okay. what i need to do ? just add like some linebreaks or something like that ? xD

little eagle
#

wait

dim owl
#

okay

little eagle
#
_display = findDisplay 4354;
_ctrlgruppe = _display displayCtrl 121212;
_data = _contentlist lbData (lbcursel _contentlist);

_contenttext = switch (_data) do {
    case "0": {"<t align='center'>Lorem ipsum dolor sit amet.</t>"};
    case "1": {"<t align='center'>Lorem ipsum dolor sit amet.</t>"};

_ctrlgruppe ctrlSetStructuredText parseText _contenttext;

_h = ctrlTextHeight _ctrlgruppe;
_ctrlgruppe ctrlSetPosition [0, 0, 0, _h];
_ctrlgruppe ctrlCommit 0;
#

see how the switch block never closes?

#

there's a missing }

dim owl
#

oh lol. just opened a old file. that was fixed in the old version

little eagle
#

_contentlist seems to be undefined

dim owl
#

so thats not the error

#
disableSerialization;
_display = findDisplay 4354;
_contentlist = _display displayCtrl 1997;
_header = _display displayCtrl 1000;
_ctrlgruppe = _display displayCtrl 121212;
_data = _contentlist lbData (lbcursel _contentlist);
if (_data isEqualTo "") exitWith {hint "Es ist ein Fehler aufgetreten!"};

the whole script is too long to send it. thats the important part of the defines and the switch part

little eagle
#

Use pastebin or git gist then

dim owl
#

okay

#

wait a second 😄

little eagle
#

What is the problem anyway?

#

Nothing happens?

#

Script error?

dim owl
#

i have a structured text in my controlsgroup and no content is showin up. positioning in the dialog is right and the structuredtext elemt is found by the script. just the text will not showing up

little eagle
#

What type of control is it? Structured text is only supported by RscStructuredText

dim owl
#
class contentcontrols: RscControlsGroup
    {
        idc = -1;
        x = 0.438125 * safezoneW + safezoneX;
        y = 0.313 * safezoneH + safezoneY;
        w = 0.298125 * safezoneW;
        h = 0.451 * safezoneH;
class Controls
    {
        class Content: RscStructuredText
        {
                idc = 121212;
                text = "";
                x = 0;
                y = 0;
                //x = 0.438125 * safezoneW + safezoneX;
                //y = 0.258 * safezoneH + safezoneY;
                w = 0.45 * safezoneW;
                h = 3 * safezoneH;
                sizeEx = 0.04;
                colorBackground[] = {-1,-1,-1,0};
            };
        };
    };
little eagle
#
...
        class Content: RscStructuredText
        {
                onLoad = "(_this select 0) ctrlSetStructuredText text 'Lorem ipsum';";
                idc = 121212;
...
#

This is what I'd try first. To see if the config is right

#

The onLoad line I mean

dim owl
#

okay i will try it

little eagle
#

if that shows, then the next step would be adding debug lines to your script

#

systemChat, diag_log

#

to see if it does what you think it does

austere granite
#

Is it possible to retrieve weapon items of a weapon inside a weaponHolderSimulated container?

#

IE which attatchments are on it?

#

Also it's still not possible to remove only a single weapon from a weapon holder (nor any other cargo container) is it? 😦

dim owl
#

@little eagle Is this going to work ? systemchat _contenttext;

little eagle
#

if not try systemchat str _contenttext;
pr systemchat format ["%1", _contenttext];

dim owl
#

Ok

flat hornet
#

XOR?

#

You can make XOR from compound statements

#

((a || b) && !(a && b))

#

Like that.

#

@dusk sage

dusk sage
#

Ofcourse you can, but it is not a bitwise XOR

#

Which we were talking about

flat hornet
#

Ah I see operating on individual bits much like C's counterpart

dusk sage
#

They introduced 'bitwise functions'

#

Not commands

#

Would be nice to have some commands, such as XOR 😉

spark phoenix
#

Commands would be really easy for them to implement....

dusk sage
#

Indeed

flat hornet
#

Would there be any specific benefit for them?

dusk sage
#

With a C++ backbone, doesn't make much sense

#

Well anybody wishing to do any bitwise operations

spark phoenix
#

Yeah it would take 10 seconds to write the function.

dusk sage
#

XOR, being one example

flat hornet
#

Is there a version of array subtraction that doesn't involve unary subtraction?

#

e.g _array - [array] ?

dusk sage
#

You can delete specific elements

spark phoenix
#

deleteAt

flat hornet
#

doesn't that mean you would require the usage of deleteAt count(_array) ?

#

To find the last index then subtract it?

dusk sage
#

That wouldn't do much 😉

#

That would be specific to deleting the last element, yes, with count(_array)-1

dim owl
#

@little eagle the systemchat is showing right and i tried to set the structured text with the script and it worked (i dont used the variable for the text i used an custom parse text)

flat hornet
#

I swear Python, PHP, so much better than Status Quo Function...

dusk sage
#

PHP

#

smh

spark phoenix
#

Well if you wanted to delete all entries in an array of numbers for example.

You could do

_array = _array - [1];

or

while{_array find 1 != -1} do {
        _array deleteAt (_array find 1);
};

@flat hornet

but for just the last entry @dusk sage is right.

#

wouldn't recommend that second code block though

flat hornet
#

Yeah thats the method I used for changing to

#

In a Zeus object grabber

#

I'm better the second code is slower though.

#

betting*

#

Does anyone know how I can use the Zeus object grabber code to grab AI created using BIS_fnc_spawnGroup. Basically I use specialty marker key-names retrieve them so I can then dynamically spawn AI on those markers, they then randomise their patrols etc.

#

But for some reason the BIS_fnc_spawnGroup won't append the AI to the multiple curators I use.

#

It spawns them fine on the markers randomises their patrols fine.

#

But doesn't make them Zeus editable.

dusk sage
#

Yep, the first would be quicker

flat hornet
#

Also do you guys know the absolute safe AI threshold?

#

Even with headless clients?

#

Because all client FPS is severely degraded?

#

before*

severe pendant
#

Does anyone know if this would be a valid check (in Exile):
if !(ExileClientPlayerIsInCombat) then {

#

I'm doing a check and looking to do something only if the player is NOT in combat.

vapid frigate
#

@flat hornet depends on a lot of other stuff too.. (how many players, scripts, objects/vehicles on the map)

#

our group of 30-40 players on a dedicated with 2 HCs gets about 40-60 AI before it starts going to crap (it's quite bad at 80)

#

it's not really the server struggling though, it's the clients

#

we use a fair few mods including ACE3 and RHS

#

(well parts of ace3.. it was a lot slower when we used to use advanced ballistics/wind)

steep matrix
#

[player, -1, 0.8, true] call BIS_fnc_sandstorm;
did anyone try to turn this into a snowstorm/blizzard?

flat hornet
#

Change the particle sizes

velvet merlin
#

obviously - let me rephrase the question. can this be used as a base for something fitting?

opal thistle
#

ayone knows whether namespace getVariable/setVariable are atomic and as fast as getting element by its key from a hashtable in normal languages?

little eagle
#

yes

#

and it's about as fast as you get with SQF

#

I posted an example last week here...

#

oops

meager granite
#

Array forming is not atomic

#

<namespace> setVariable [<key>, <value>] is not atomic
<namespace> getVariable <key> is atomic

little eagle
#
testNS = [] call CBA_fnc_createNamespace;
for "_i" from 0 to 1e7 do {
    testNS setVariable [str _i, _i];
};

(takes a long time ofc.)
testNS getVariable "13221"
0.0022 ms

#

Proof, Sa-Matra? I'm not sure about it

meager granite
#

If array forming was atomic then doing [call func1, call func2, call func3] would execute all 3 funcs at same time in scheduled, wouldn't it?

little eagle
#

I've heard people argue that it does.

#

IDK. I never use the scheduler

#

From my understanding it can pause after every command. If it's just an array, there is no command

#

Too bad it's never explained anywhere

meager granite
#

From my understanding array forming is an instruction by itself

little eagle
#

and I thought it isn't. Although using call inside the array is one. We don't know without proof

meager granite
#

Yeah I'm not sure if single instruction is considered atomic by VM

little eagle
#

one can try this:

0 spawn {
    diag_log [diag_frameNo, diag_frameNo, ... diag_frameNo];
};
#

afaik, all will report the same frame. no matter how long you make the array

#

which should mean that getVariable ARRAY is just as atomic as getVariable STRING is

#

Scheduler is BS

meager granite
#

Did few tests, long array of diag_frameNo's indeed logs as all same frame numbers

#

But doing call {diag_log diag_frameNo}; many times does as well

#

This is with scheduler flooded with 1000 threads that do nothing

#
0 spawn {
    diag_log [
        call {nearestObjects [player, [], 3000] select 0; diag_frameNo},
        call {nearestObjects [player, [], 3000] select 0; diag_frameNo},
        //...
        call {nearestObjects [player, [], 3000] select 0; diag_frameNo},
        call {nearestObjects [player, [], 3000] select 0; diag_frameNo}
    ];
    systemChat "Done";
};

This ends up with different frames

#
0 spawn {
    diag_log [
        getPos (nearestObjects [player, [], 3000] select 0),
        getPos (nearestObjects [player, [], 3000] select 0),
        //...
        getPos (nearestObjects [player, [], 3000] select 0),
        getPos (nearestObjects [player, [], 3000] select 0)
    ];
    systemChat "Done";
};

This freezes game and all positions are the same with player running during execution of experiment

#

No matter how many getPos'es I add into array there is just single freeze and all positions are the same, so does it mean that array creation is indeed atomic expression?

#

But if context changes during array creation (call {} inside array) then VM can pause

#

Tried with same getPos expression but with call this time

0 spawn {
    diag_log [
        call {getPos (nearestObjects [player, [], 3000] select 0)},
        call {getPos (nearestObjects [player, [], 3000] select 0)},
        //...
        call {getPos (nearestObjects [player, [], 3000] select 0)},
        call {getPos (nearestObjects [player, [], 3000] select 0)}
    ];
    systemChat "Done";
};

Each array value is different

#

Still doesn't fully answers the question though, maybe
<Namespace> getVariable [<Key>, <Value>] is two atomic operations, first is array creation, second is binary command?

little eagle
#

good question.

#

So, @opal thistle There you have your answers.

as fast as getting element by its key from a hashtable
yes
atomic
who knows

meager granite
#

I'd say likely yes. Looks like expressions are atomic, but VM can be interrupted if instruction inside expression executes another expression through call.

#

Unless there is evidence of otherwise I'm fine with believing it works like this.

dusk sage
#

Is anybody aware of issues with lbSetValue/lbValue for large integers?

#

It seems large values (such as 6.5 million - tested) will come out the other end as some random negative of the same order

#

In this case: -3.04146+006

dusk sage
#

The limit seems to be: 4194303

#

Before it goes pot

little eagle
#

probably a conversion error between signed and unsigned floats

dusk sage
#

Why would it be trying a conversion

#

ah

little eagle
#

idk what they do internally with lbValue's

dusk sage
#

largest 22 bit integer

#

is 4194303

little eagle
#

So that's what lbValue uses, right?

dusk sage
#

If you go past 4194303 with lbSetValue

#

The return from lbValue will be random

#

Well 'random'

#

Undefined behaviour

little eagle
#

I thought you can use floats with lbSetValue

#

what happens for 0.5

dusk sage
#

Integer value

#

rounds

#

interesting

#

Ah, wiki says it though Sets the additional integer value

little eagle
#

mystery solved

dusk sage
#

Well

#

22 bit integer

little eagle
#

yop

meager granite
#

lb values are integers, yes

dusk sage
#

The question is, why are they 22 bit integers

little eagle
#

Because a dev made them that way?

meager granite
#

Probably because of float->integer method used in the engine

dusk sage
#

lovely bit of overflow 😉

meager granite
#

Guess who answered 😃

#

Suma himself!

#

I assume this is what Arma uses as well

#

Assert( fabs(fval)<=0x003fffff ); // only 23 bit values handled

#

0x003fffff is 4194303

dusk sage
#

Dirty 😛

#

'A commonly used trick for plain x86/x87 code is to force the mantissa part of the float to represent the int. 32 bit version follows.'

#

Sums it all up

meager granite
#

So yeah basically they throw away exponent bits and you get your integer

dusk sage
#

Thanks for the link 😃

#

Yeh

leaden knoll
#

Hi guys, sorry to interrupt the converation. Is there a way to hide a vanilla action like "eject" from a vehicle. As I understand removeAction is only for user added actions.

tough abyss
#

Anyone remember that command that check if a vehicle is usable?

meager granite
#

canMove?

tough abyss
#

OOOOH! Thankyou!

meager granite
leaden knoll
#

THanks, will give it a bash

opal thistle
#

logging shows like _objects = ((vehicle player) nearEntities ["rhsgref_cdf_b_para_grenadier_rpg", 1000]); takes 1 frame to execute

#

do I do something wrong here?

#

"nearEntities took 393650 - 393650 frames"

#

meaning it started at 393650 and ended at the same frame

tough abyss
#

so it take less than 1 frame?

opal thistle
#

or 1 frame

tough abyss
#

otherwise you will had 393650 - 393651

#

can be one frame exactly

#

but is more possible to be less than one frame

opal thistle
#

and it searches all the instances in 1000-m radius

#

in less than one frame

#

is that possible?

tough abyss
#

@opal thistle yes, i believe the nearEntities function is very fast but it can't search buildings for example.

opal thistle
#

well, found the mistake

#

I should've wait a sec or two to get all the mission vars initialized

#

anyway

tough abyss
#

you can use the editor creat a simple mission (just a unit) run it and then press esc and execute a nearEntities function on the exec box.

opal thistle
#

nearEntities takes "0 ms", meaning it takes a time below recognition if someone's interested

tough abyss
#

the game will execute it and say how much time it take

opal thistle
#

ah, tx Donnovan

tough abyss
#

if you do that, run the mission from the editor

opal thistle
#

@tough abyss a profiler says it takes 0,022 - 0,23 ms in all 3 attempts I made

#

0,022-0,023

#

meaning 22 nanoseconds

#

for 100 units in 1000-m range

#

impressive

meager granite
#

nearEntities only searches through mission entities, it will take longer the more stuff you have in the mission

#

unlike say nearObjects which searches through entire world and goes through all objects including tress, bushes

opal thistle
#

I know

tough abyss
#

@opal thistle and i believe it run the function 10000 times.

opal thistle
#

well, I'm interested in mission entities now

#

took 0,11 ms with 500 units

opal thistle
#

Donnovan, you think it's a result of 10 000 times, not an average exec time measured from 10 000 attempts?

tough abyss
#

@opal thistle if you used the mission preview benchmark, it tries to run it 10000 times.

#

It not run 10000 times only if it take too much time.

#

There is a indication on the results showing how much times the code was run.

opal thistle
#

no, I mean you think it shows the whole time spent on 10 000 attempts, or it calculates and average time of 1 run from 10 000 attempts?

meager granite
#

it is average of one run

tough abyss
#

@opal thistle oh, sorry. This what Sa-Matra sayd.

gilded rover
#
        recoil = "recoil_p07";
        author = "[SAWRecce]Maj.AntiAlligat3r";
        _generalMacro = "srifle_EBR_F";
        scope = 2;
        model = "\A3\weapons_F\LongRangeRifles\EBR\EBR_F.p3d";
        displayName = "MK14 EMR [Nutria]";
        picture = "\A3\weapons_F\LongRangeRifles\EBR\Data\UI\gear_EBR_X_CA.paa";
        UiPicture = "\A3\weapons_f\data\UI\icon_regular_CA.paa";
        hiddenSelections[] = {"camo1", "camo2"};
        hiddenSelectionsTextures[] = {"\SAWRecce_ArmA3\Nutria\Weapons\data\MK14EBR\MK14_EBR_Nutria_co.paa", "\a3\weapons_f\longrangerifles\ebr\data\m14_ebr02_co.paa"};

        class Library {
            libTextDesc = "$STR_A3_CfgWeapons_srifle_ABR_Library0";
        };
        descriptionShort = "$STR_A3_CfgWeapons_srifle_ABR1";

        class WeaponSlotsInfo {
            mass = 60;
        };
        inertia = 0.700000;
        dexterity = 1.300000;

        class ItemInfo {
            priority = 1;
        };
    }; ```
#

can anyone explain why i have 0 recoil

#

why can i not override recoil and replace it with another weapons recoil

flat hornet
#

0 ms is incorrect for nearEntities

#

MP Performance diag_codePerformance only works for 1 cycle

#

for security reasons.

vapid frigate
#

@gilded rover : recoil is set in fire modes as well

#

or maybe only in firemodes

gilded rover
#

thanks shall try

opal thistle
#

anybody knows what side is actually in RV?

#

An enum, I hope?

warped fractal
#

How do I make a trigger that when activated destroys all buildings withing a certain distance? So far i've tried ```
{ _x setdamage 1;} foreach (nearestobjects [getpos this, [],200]);

distant egret
#

Use thistrigger @warped fractal

warped fractal
#

bloody hell that seems simple, thank you very much it works perfectly

opal thistle
#

when you call lompile preprocessFile and assign the handler to a var, the result resides in RAM or stored on the HDD with its handler in memory?

halcyon crypt
#

RAM

opal thistle
#

good

halcyon crypt
#

RAM can be paged out to disk though 😛

opal thistle
#

you mean the OS paging system?

halcyon crypt
#

yeah

opal thistle
#

ah, well, nothing we can do about that))

slate vale
#

Hey guys, anyone that could help me out with the fastest way to remove map objects? Been trying alot of commands but nothing seems to work my way. Been trying to remove with ID but don't know how to get an Object ID and with position it doesn't work either. Any help?

#

Just want to be able to remove objects fastest way possible

tough abyss
#

Hi all, trying to get a count of alive units in a group. This script returns the same number even if all the group is dead

#

hint str count units (group target1);

broken mural
#

Okay so I've been asking about this topic a lot in the last few weeks and I cant get this damn thing to work..

#

From initServer, I have _this call fn_initServer. I'm trying to separate as much of the code from files players have access to. From fn_initServer, I'm setting some variables and grabbing objects in a radius of a specified object and passing the array to another function via call. In this function, I'm spawning objects (which functions properly) and trying to addaction to these objects for all players to interact with them. Here's a sample of one of several objects I'm trying to do this with.

_paperwork = createVehicle ["Land_Document_01_F", [getPosATL _x select 0, getPosATL _x select 1, getPosATL _x select 2], [], 0, "NONE"]; _paperwork setDir (getDir _x); _myAction = ["Interact",Test_fnc_delegateInteraction, ["1", "2"], 6, true, true, "","side _this == west", 3, false];

Using what @little eagle suggested,
[ [_objectLikeABoxOrSomething , _addActionParams], { params ["_objectLikeABoxOrSomething", "_addActionParams"]; _objectLikeABoxOrSomething addAction _addActionParams; } ] remoteExec ['call',-2, true];

and adapting it to my own does not appear to be working.
[ [_paperwork, _myAction], { params ["_paperwork", "_myAction"]; _paperwork addAction _myAction; } ] remoteExec ['call',-2, true];

#

Any insight into why this is not working? Because there are so many moving parts, I'm concerned that the call from fn_initServer somehow makes it no longer executing as initServer or something

tough abyss
#

No idea, I would recommend posting that in the BIS forums. Its a lot of information on a channel

broken mural
#

@tough abyss will do.

tough abyss
#

I have this on my description.ext: loadScreen = "BRP_imagens\BRPVP_tanoa.jpg";

#

But i near allways get a image not found while joining the server.

#

Not obstant the erros, the image appears.

#

Helpus!

little eagle
#

convert it to .paa

tough abyss
#

@little eagle i just converted from paa to jpg to try to end the problem... will try paa again 😦

little eagle
#
Image
Must be in PAA file format.
2:1 aspect ratio (different aspect are rendered correctly as well, but won't cover the whole area).
Ideally 1024x512 pixels.
#

I'd argue that you should use 2048x1024 these days, but w/e

#

oh

#

and save and load the mission again. I had problems with this before. apparently the game reads the files from a temporary folder

tough abyss
#

@little eagle i did that now!

#

First join was ok.

#

setUnitTrait needs to be reapplyed after respawn?

#

😦 😦 😦 😦 just got the image not found error after server restart...

#

The message comes when the server closes.

velvet merlin
#

its a bug TM

little eagle
#

setUnitTrait needs to be reapplyed after respawn?
I don't think so

#

@velvet merlin is there a ticket for this?

tough abyss
#

@little eagle @velvet merlin thanks a lot. No way to have the loading screen in mission without the error? 😦

#

I will leave default image for now. Best to do.

meager granite
#

there is ticket and repro I made years ago

#

If you're talking about loading image missing when switching servers

tough abyss
#

if("true" configClasses (configFile >> "CfgWeapons" >> _configName >> "Single")) then

#

it return Array not Bool :/

velvet merlin
#

@little eagle i gave up doing tickets the way BI decided to handle the A3FT

tough abyss
#

I can return true or false for it?

velvet merlin
#

isClass

tough abyss
#

oh ty 😃

#

work

tough abyss
#

Can i make that: if (condition 1 && !{condition2}) then {...

#

It's about the "!".

zealous solstice
#

no if you want to have a inverted condition2 you need to make it in the {}

tough abyss
#

@zealous solstice thankyou.

flat hornet
#

ArmA 3 is so retarded when it comes to conditional evaluation

#

When it evaluates part of a compound conditional expression even after going false

#

It still evaluates it.

#

When it should treat it as explicit code termination

#

false is false no questions asked

little eagle
#

you can't change that

#

&& and || are implemented as low priority binary commands

#

left and right side of these commands are almost always evaluated first

#

also I don't see why lazy evaluation would necessarily be the expected behaviour

dusk sage
#

Short circuiting is a standard in most languages

#

Certainly all of those based on C

flat hornet
#

Is there any "hacks" to get around it @little eagle

#

?

#

Probably could bypass the expression and use a ton of exitWith {} ?

#

Actually. Demorgans rule might help with that expression problem

#

Can probably take multi-expressions and compress them into a single boolean expression.

flat hornet
#

Why does ArmA do this in such a dirty way...

#

Still probably could still use Boolean algerbra to simplify your expressions

#

@tough abyss On that note of lazy evalulation, doesn't that violate the optimisation?

#

concept?

tough abyss
#

Test it out and check yourself

flat hornet
#

Also while I've got you Torndeco do you know of anyway I can test code-performance in MP?

#

As I know diag_codePerformance doesn't work @tough abyss ?

#

Nvm diag_tickTime

#

The old way the BIS_fnc_codePerformance worked

little eagle
#

Short circuiting is a standard in most languages
so what? I argue that lazy evaluation violates the associative property of the || and && operators. Just because other languages do it, doesn't mean that it's the correct approach. Even if all other programming languages (would) do it that way.

flat hornet
#

I agree @little eagle explicit control of code is much better.

clear tendon
#

what's the best way to 'hide' AI? i.e: they're hidden behind or prone on a building/ground, and have them get up only when you pass a trigger?

little eagle
clear tendon
#

Hmm.. Also useful

vague hull
#

What would be the way to define functions via remoteExecCall

#

Lets say I have the function XY on the server and want to broadcast it to the client with remoteExec.. I tried to send the name of XY and the code as seperate params of of remote exec to a function that would do: missionNameSpace setVariable [name,code]

but it didnt really work out

velvet merlin
#
Bohemia Interactive Forums

[Release] SQF Classes for ArmA 3 - posted in ARMA 3 - MISSION EDITING & SCRIPTING: SQF Classes for ArmA 3 Edited - release updated with a couple of bugfixes - if you downloaded prior to 6pm GMT on 29 October then please re-download to get the corrected files. If . . . [the] fact [that brutes abstract not] be made the distinguishing property of that sort of animal, I fear a great many of those that pass for men must be reckoned into their number. -...

#

@grizzled cliff

little eagle
#

^ excerpt:


_code = str _code;
_code = toArray _code;
_acc = [];
for "_i" from 1 to ((count _code) - 2) do {
    _char = _code select _i;
    _acc = _acc + [_char];
};
_code = toString _acc;
_code;
velvet merlin
#

the conversion stuff doesnt look to be efficient - also pushBack at least to be used
however for game logic where performance doesnt matter this is OK

dusk sage
#

select 😄 ?

fallen skiff
#

According to several prominent coder/commenters, Multiple Inheritance is an OOP practice that should be avoided at all costs. Any opinions?

dusk sage
#

Avoid any problems it can cause

fallen skiff
#

and another question - what language(s) does BI use for the main Arma3 application(s)?

little eagle
#

C++ C#

open vigil
#

Czech 😉