#arma3_scripting
1 messages · Page 551 of 1
use:
```sqf
-your code-
```
it declare _myName variable with the content of the first argument passed to your code. @abstract idol
https://community.bistudio.com/wiki/select
_this has to be an array
select then is a command to pick one element from the array
0 is the index you choose (aka: the first element of the array in the variable _this)
https://community.bistudio.com/wiki/private
private ensures that you set this variable on the local scope (code) you have
Oh, now it’s clear, I didn’t even think that this refers to an array
well ... it will only ever if you do it like this:
yourcode = {...};
["foo"] call yourcode;``` 😛
the yourcode assignment though, may also be handled automatically by CfgFunctions
_this is what you make it to be when you pass arguments to function. You normally make it an array if you have multiple arguments
@queen cargo does your switch implementation make ___switch variable?
Yes of course 
Hello guys! Does anyone remember if there is a universal command for checking inventory space? there is nothing in https://community.bistudio.com/wiki/backpackSpaceFor 's see also , but i think i saw somethig before
canAdd @calm bloom
tnx
Helo guys id like to change the appearance of markers and crosshair on the screen with a trigger, is there any way to make it happen? or it cannot be changed mid game?
For the crosshair you could disable it from the difficulty settings (to remove it), and add a custom UI layer with a custom crosshair image. However this will be a static image instead of a dynamic one (which changes size or position based on recoil and fatigue)
oh dang it, well down the trash the idea of making a cyborg scenario 😦
I have seen mods where the full UI was hidden and a custom UI got implemented, but that requires a lot of work 😉
You can still make pretty advanced UIs in arma, although you can't change the cross (or maybe you can change the cross, I don't know)
i know ive tried and it doesnt work, maybe if i change the overall level of difficulty to "regular" from Veteran mid game all thhat stuff should pop out?
Does anyone knows a initscript to make all passengers from a vehicle when bullets start flying?
@dusk badger jump* from a vehicle?
Dismount
yes
😄
I would say a combination of waitUntil, behaviour, allowGetIn would do the job
that's for vehicle crew. what is your setup? a group for vehicle crew, a group in cargo?
A convoy its ambushed the fist to push across then de last one stops and dismounts to supress the attackers
First two* not fist to
yes maybe, but regarding the groups, crews, etc?
Does anyone have any ideas/advice on why my event handler breaks after one "Killed" event?
[2019-09-19 / 23:33:19] B Zero:1 (Maj. N. Home), B Zero:1 (Maj. N. Home), <NULL-object>
[2019-09-19 / 23:36:16] bis_o2_1026, bis_o2_1026, <NULL-object>
init.sqf
{
_x addEventHandler ["Killed", {
_unit = _this select 0;
_killer = _this select 1;
_instigator = _this select 2;
details = format ["%1, %2, %3", _unit, _killer, _instigator];
[details] remoteExecCall ["A3Log", 2];
}];
} forEach playableUnits;
Been driving me up the wall. Can't find anything on what the hell "bis_o2_xxxx" is either 😦
bis_o2_xxxx is the name of the unit when no real person is playing it.
heh, didn't know that
Not on my server... they are named O Bravo 1-1:2 etc
Never seen the bis_o2_xxxx ...
Or maybe not noticed...
oh wait. that's maybe the unit names in BI official missions
@exotic flax Does the EventHandler not stick to a player/unit? Do i need to reapply it after it's been used to prevent this?
hi there - i am trying to make icons that I draw with drawIcon3D clickable while a dialog is active. I have added a MouseButton Eventhandler to the dialog that picks up the x- and y-pos of the click. However I can not figure out to return if I click on the icon of which I know the screenPosition and x/z sizes.
I have this bit that picks up clicked icons on the map - I tried adapting that from ctrlMapWorldToScreen to worldToScreen but can not pick anything up. This is the bit that works for the map, might be useful for some folks:
_iconAtPositionFound = false;
_iconsAtPosition = [];
_iconsNotAtPosition = [];
{
_x params [_iconTargetObject,_iconSizeArray,_iconWorldPosition]; //-- icon data format
_iconMapPosition = (findDisplay 12 displayCtrl 51) ctrlMapWorldToScreen _iconWorldPosition;
_iconMapPositionX = _iconMapPosition select 0;
_iconMapPositionY = _iconMapPosition select 1;
_iconMapDimensions = _x select 1;
_iconIndex = if (count _x > 3) then {_x select 3} else {-1};
_iconMapWidth = safeZoneWAbs * ( (_iconMapDimensions select 0) / (getResolution select 0));
_iconMapHeight = safeZoneH * ( (_iconMapDimensions select 1) / (getResolution select 1));
if(_iconAtPositionFound) then {
_iconsNotAtPosition pushBack _x;
} else {
if( (_mapPositionX < _iconMapPositionX + (_iconMapWidth/2)) && (_mapPositionX > _iconMapPositionX - (_iconMapWidth/2)) && (_mapPositionY < _iconMapPositionY + (_iconMapHeight/2)) && (_mapPositionY > _iconMapPositionY - (_iconMapHeight/2)) ) then {
_iconsAtPosition pushBack _x;
_iconAtPositionFound = true;
} else {
_iconsNotAtPosition pushBack _x;
};
};
} forEach my_icon_array; //-- defined array of icons
_iconsAtPosition
@burnt cobalt use lazy evaluation
if ( (a) && (b) && (c) ) rewrite to if ( a && {b} && {c} )
it is matter of ordering conditions. in most cases if first condition return false, others will skip and save you whole bunch of processing
its a mix of complexity of condition, relation of true-false, and to some extent frequency of condition checks
_iconAtPositionFound = true; that variable is useless. Youcan just check whether the array is not empty
_iconMapDimensions = _x select 1; why? why use params and then select with select anyway
_iconIndex = if (count _x > 3) then {_x select 3} else {-1};
you know params can take care of that for you?
_iconIndex = if (count _x > 3) then {_x select 3} else {-1};
could be done in params
_x params ["_iconTargetObject","_iconSizeArray","_iconWorldPosition",["_iconIndex", -1]];
which brings me to another question how this
_x params [_iconTargetObject,_iconSizeArray,_iconWorldPosition];
even work and not giving you the error? The array values are supposed to be STRINGS, the names for variables not the variables! "_iconTargetObject" NOT _iconTargetObject
you pass nil's, I think params uses nil arguments to say "skip this argument" just as "" as argument
then the rest to the code will go mad
This is the bit that works for the map
works
From BIKI All variables names must start with underscore and be enclosed in quotes: params ["_myVar1", "_myVar2"];
I keep sayin, no one reads BIKI and you all keep telling me that I am wrong
why not spend like extra millisecond checking unknown command in wiki instead of mindlessly copy pasting someone else's script?
- Oh noes, READING! Ruuuuuuuun
@still forum It gives you error, only empty string is accepted to skip arg:
9:26:16 Error in expression <[] params [_iconTargetObject,_iconSizeArray> 9:26:16 Error position: <params [_iconTargetObject,_iconSizeArray> 9:26:16 Error Type Any, expected Array,String
This is the bit that works for the map
🤦
It gives you error, only empty string is accepted to skip arg
welp, that's what I get for trusting a human when he says "it works"
And that while I so often say that I trust logfiles more than humans
I know someone else here that would willingly take people's word for it, oui mon amie?
Well granted. Maybe he didn't include this part of the script in his copy paste:
_iconTargetObject = "_iconTargetObject";
_iconSizeArray = "_iconSizeArray";
_iconWorldPosition = "_iconWorldPosition";
yeah sure 🙄
ami*, Freund
tell this to google
as for the nil thing, it is what is used in maaany things to get default values in BIS_fnc so there's something wrong here
Bis_fnc != script command
yeah having nil as "ignore me" seems sensible.
But atleast this way people will be screamed at, instead of falling into a silent trap
Bis_fnc != script command
we are talking about params, right?
which for all intends and purposes is a script command
I mean nil as _this argument, then passed through params to get the default value for this argument's index
what what?
[nil] params [["_test", 0, [1, "", []]]]``` shouldn't throw error but have _test = 0
as default value?
no as variable name
🤔
Never tried. nil is ANY type. What if you put nil in the allowed types array in the param array 🤔
is nil really any? isn't it nothing 🤔
I just got what was going. yes, don't forget quotes around varnames.
isEqualParams will allow it
isEqualTypeParams*
so… what's the issue here beside placing your varname between quotes, I don't follow anymore 😁
he didnt use variable name he used undefined variable which is == params [nil, nil, nil]
yes, so he just has to set "_varname"
empty string to skip the var, IDK if it is written on the wiki
one could add that…
un
(just so you know btw, Google wasn't "wrong"; ami is ♂ and amie is ♀)
why google would assume female by default?
maybe thought "my friend" as "here's my (girl)friend"
that makes no sense
¯_(ツ)_/¯
@tough abyss ask Dwarden a Wiki account 😄
Already did
Can I change the message in the JIP queue without actually remote executing it globally right now?
If not, is it very hard to tweak it to work like that? 🙃 (through an additional parameter)
you can delete a message with the JIP parameter and remoteExec
no you don't get it, so I have something like [0, 1, 2], "myFuncName" in the queue right now, and I just want to change it to [123, 1, 2], "myFuncName" without broadcasting it to everyone now
no can do. why would you need that?
I want to send partial updates of my objects
Like update only one variable
But for new clients, I want them to have all the actual data
then set an onplayerconnected EH maybe
yeah basicly I would have to reinvent the JIP queue 🤷 and add this functionality to it
if you just use remoteExec, all the previous remoteExec will be applied to JIP, what do you want more?
they will have all the updates if you set the JIP param to true
I want to change the data in the JIP queue but not broadcast a hell of an array right now with variables every time I make a tiny change in the array
I want JIP clients to get the full array, to sync object data to them
Hmm, if you update the data independently, then might want to use independent variables.
or simply set your variables on an object with setVariable from the server, that gets sync too
what is the situation needing it?
^^^exactly, but you still need to tear apart the array
or simply set your variables on an object with setVariable from the server, that gets sync too
Yes but I can't run my code along passing data
what is the situation needing it?
Ugh, synchronization of OOP objects
So that when I change variable "pos" on something, I don't have to retransmit all object's variables, but only "pos"
But why are those particular OOP objects "copied" on multiple machines?
Well, client must have this object on his machine because ... the scenario demands it 🤷
Think of these as if they are just namespaces with variables and values, for this conversation
when you remoteExec, why not set the JIP var to true? it will reapply all the changes
Yeah, I get that they are namespaces. But, you are presumably sharing the data, because you want them to perform the same kind of computation. But if the changes all server originate for instance, then let the server do the computation and send the result.
@winter rose that will be even worse than using a JIP "key", since then you do array transmission even more times
yep, but it works
I mean yeah, but for some reason this array is large or something and he does not want to do that
if you don't want to do that and want a separate sync on player's connection, use an on player connection event to broadcast the data 🤷
let the server do the computation and send the result
Sure that's what I do, however I would like to execute some SQF code along with passing of the variable for clients who are already there, and just change the full large array in the JIP queue for the clients who will be joining
That's how object property sync should work IMO 🤔 if I could only change the values in the JIP queue
Hmmm, can you do a remoteExec only on the originating machine with the JIP flag?
Maybe that will only work on the server though?
@tough abyss It will still broadcast data though
yeah, but it wont execute
[newData] remoteExec ["updateData", 2, "KEY_LatestData"];
[newDelta] remoteExec ["updateDelta", -2];
if you gonna have an array you will still have to publicVariable it every time
[newData] remoteExec ["updateData", 2, "KEY_LatestData", true]; // Please run it for JIP only
[newDelta] remoteExec ["updateDelta", -2]; // Please run it for everyone who is already connected
Ideally I'd like to have smth like this
[newData] remoteExec ["updateData", 2, "KEY_LatestData", true];
you cant
I know! I recall Dedmen asking for ideas for new SQF functions or changing existing functions or something of this kind, maybe he would like to assist
you cant because this is illegal syntax
It seems like a good idea to change the JIP queue without remote-executing the command right now
why you worry about extra broadcast?
are you going to spam it? then you should rethink the whole design
Well it seems natural to me to worry about that, in UE as I know they send only changed properties too
Anyway let's not talk about my situation, just in general, being able to change JIP queue without sending data immediately, I think it could be useful, no?
dunno, you are not explaining what you want to do so ¯_(ツ)_/¯
Well I've just explained, change data in the JIP queue with a given JIP ID, but don't send data to clients now
He wants to perform updates to small parts of an array for connected clients, but still have JIPs getting everything / the latest
changing for the sake of changing? I havent seen anyone else asking for it so curious why do you need it so much you want to go to the extend of manipulating the guts of the remote exec system, not to mention that it would probably never happen
OOP objects
He wants to perform updates to small parts of an array for connected client
Dont think this is what he wants
Fun fact: OOP in French is… you guessed it, in reverse order
"Sparker Today at 11:46
I want to send partial updates of my objects
Like update only one variable
But for new clients, I want them to have all the actual data"
that sounds like remoteexec all with JIP false
then all existing clients will be updated but JIP will get old data
Anyway, you are probably not gonna ever get the opportunity to manually adjust the JIP queue @astral dawn , so if that is what you need then look for how CBA designed theres.. This is where they add to it: https://github.com/CBATeam/CBA_A3/blob/fbd59d2ac1f85da79ea18a53b2d14e3ea285f60a/addons/events/fnc_globalEventJIP.sqf#L38 and this is where joining clients run it, https://github.com/CBATeam/CBA_A3/blob/ef8a10f27f2d0c962e7b404697d7ee72e4912489/addons/events/XEH_postInit.sqf#L12
You see my dilemma, lots of confusion
that sounds like remoteexec all with JIP false
for the small delta-update, yes
Then I need to make sure JIPs get the full proper data, so I'd like to modify data in the JIP queue, but not send the whole huge array to existing clients
yes
[staticData, staticData, dynamicData]?
dynamic data could be a public variable
if you broadcast it for updates then jip will get the last broadcast
...but I want the remoteExec functionality of actually running my sqf code with data passed to it, instead of chaning a missionNamespace variable in the middle of client's code execution, so that I can sync it up properly, etc
Anyway where can I suggest this additional param to be added? I believe it shouldn't be hard, just disable the actual remote execution with an optional param. I see them still working on SQF commands for arma 3, so who knows 🙄
"shouldn't be hard" heh
Thanks @errant jasper I will look into how they've done it, I didn't know that CBA has some JIP features
Open file
Type
Save
...
Was this hard?
Doing networking is hard, what's hard is there in not doing networking? 🤣
Anyway IDK what's inside so I just assume things
Is JIP queue encrypted?
conscripted?
Like each element in the queue? Why? I have no idea, but then we can already change data and function name in the JIP queue by passing a JIP_ID
@astral dawn Just relooked. Fair warning, looks like CBA uses allVariables to run the JIP events, so they are not likely to happen in the sent order. But that is sort of irrelevant if you implement your own.
hey guys, sorry for being sloppy. I tried to cut out the relevant bits of the script to avoid confusion but made dumb mistakes instead. Here's a working working version of the map bit, just run the code from anywhere and click on the two dots it created. I am trying to get the same result for icons drawn with drawIcon3D but rewriting the code (which I did not create btw) using worldToScreen instead of ctrlWorldToScreen did not cut it
(too much code) : https://pastebin.com/CE8SFMtR
also I appreciate the performance tips, I am not really a coding expert as you can tell
whats the question/problem exactly?
i am trying to do the same thing with icons drawn in 3d-space - while a dialog is open so you can click on the icons with a cursor
i tried adapting that code but my results are completely off.
_iconsAtPosition pushBack _x;
All that stuff can be replaced by a select
is there a way to make a volume like a trigger box that doesnt tick ?
Huh?
i want to make a script that can check if people are in a zone but noch only X/y but also limited to Z so i would need a trigger box but triggers tick by default arent they?
triggers can be limited in height @royal abyss
what do you mean, "they tick"?
so the more i place the worse is the performance
All loops, yes.
they tick every 0.5s; if this frequency is good to you, use a trigger
i dont want them to tick at all
(@tough abyss ☝ ☝ ☝ I did it!)
So you want a trigger that doesn't do anything?
you just want a single check?
you can use these commands:
distance, for 3D distance, or distance2D + getPosATL select 2
a "volume" like a trigger box that a script can check if im inside or not when client is executing a script
a sphere? distance
if (player distance _myPoint < _distance) then { ... };```
distance is distance in straight line
yeah but if the objective is wider then high
Then yes, you'd have to check height and distance2d for a radius.
and what if the objective is a rectangle ?
You can use inArea command and some English lessons
im not a native eng. speaker 😅
Me too, what’s your point?
Me neither*
i dont get what your problem is @tough abyss but yeah
Yep, look at alt syntax 3 for inArea:
https://community.bistudio.com/wiki/inArea
No problem, just don’t see the point asking questions no one can answer
OK now that's just mean 🙄
yup was looking in to "InArea" seems to be what i was searching for
Sometimes I’m good but when I’m bad I’m even better @winter rose
How do you get bounding box of a geometry LOD of a projectile? I used
(2 boundingBoxReal _projectile)
with I think should give me the geometry LOD size, but it still returned the LOD1 size
is there anyone that would be willing to look over a block of code for a mission with me and help me understand why its not working?
just post it and see if someone reacts
im not sure why this isnt executing when ran against execVM
/*
Developed by specCon18 and [NFG]Draycos
© All Fucks Reserved
specCon18@skdevstudios.com
Map clearing code
*/
_locations=[[5789.38,10383.6],[5724.87,10404.2],[5793.5,10421.4],[5759.32,10444.9],[5798.47,10468.9],[6895.849,7453.282],[6895.849,7453.282],[5822.715,10783.907],[5830.870,10187.938],[5845.938,10223.338],[5840.145,10143.083],[5876.150,10186.08],[5878.213,10210.816],[4985.84,11373.3],[4961.61,11323.8],[5755.97,10696.4],[5755.66,10717],[5755.51,10731.1],[5479.933,9977.303],[5469.477,9947.218],[5761.33,10628.7],[5730.21,10625.1],[4676.46,9315.29],[3875.18,9667.09],[5836.25,10830.8],[5938.71,10645.7],[5835.59,10545.3],[5805.89,10579.7],[4634.15,9265.12],[4712.04,9263.93],[4054.704,9105.791],[9877.941,13536.048],[4048.31,8318.89],[4073.25,8294.63],[6921.5,7584.5],[8262.4,11990.3],[8356.62,11957.9],[5935.47,11051.4],[5948.38,10987.6],[5922.09,10983.3],[5922.09,10983.3],[5918.39,10993.2],[5918.39,10993.2],[5763.97,10586],[5756,10567.3]];
_radi=[50,20,30,50,20,20,20,30,30,30,10,20,8,50,20,20,20,20,5,10,20,20,50,99,15,40,50,20,35,25,100,20,50,50,100,100,50,50,25,10,5,5,45];
_locElementCount = count _locations
_locRadiusCount = count _radi
if(_locElementCount == _locRadiusCount) then
{
_locationIop = 0;
for [{private _locationIop = 0}, {_locationIop < 43}, {_locationIop = _locationIop + 1}] do
{
_lat = ((_locations select _locationIop) select 0;
_lon = ((_locations select _locationIop) select 1;
_location = [_lat,_lon]
_radius = (_radi select _locationIop);
_terrainobjects=nearestTerrainObjects [_location,[],_radius]; {hideObjectGlobal _x} foreach _terrainobjects;
};
}
else
{
hint "invalid grid"
}
and execVM "Modules\MapEdits\clearmap.sqf"; in initServer.sqf
for [{private _locationI looks very much like that can be replaced with a forEach
don't see a reason why execVM would break that 🤔
🤔
where are my glasses
tha doesn't make sense
first you have an array, then you take the first and second element out of the array.
Then you create a new array and put the first and second elements back
why?
/*
Developed by specCon18 and [NFG]Draycos
© All Fucks Reserved
specCon18@skdevstudios.com
Map clearing code
*/
private _locations=[[5789.38,10383.6],[5724.87,10404.2],[5793.5,10421.4],[5759.32,10444.9],[5798.47,10468.9],[6895.849,7453.282],[6895.849,7453.282],[5822.715,10783.907],[5830.870,10187.938],[5845.938,10223.338],[5840.145,10143.083],[5876.150,10186.08],[5878.213,10210.816],[4985.84,11373.3],[4961.61,11323.8],[5755.97,10696.4],[5755.66,10717],[5755.51,10731.1],[5479.933,9977.303],[5469.477,9947.218],[5761.33,10628.7],[5730.21,10625.1],[4676.46,9315.29],[3875.18,9667.09],[5836.25,10830.8],[5938.71,10645.7],[5835.59,10545.3],[5805.89,10579.7],[4634.15,9265.12],[4712.04,9263.93],[4054.704,9105.791],[9877.941,13536.048],[4048.31,8318.89],[4073.25,8294.63],[6921.5,7584.5],[8262.4,11990.3],[8356.62,11957.9],[5935.47,11051.4],[5948.38,10987.6],[5922.09,10983.3],[5922.09,10983.3],[5918.39,10993.2],[5918.39,10993.2],[5763.97,10586],[5756,10567.3]];
private _radi=[50,20,30,50,20,20,20,30,30,30,10,20,8,50,20,20,20,20,5,10,20,20,50,99,15,40,50,20,35,25,100,20,50,50,100,100,50,50,25,10,5,5,45];
if (count _locations != count _radi) exitWith { hint "invalid grid" };
{
private _location = _x;
private _radius = (_radi select _forEachIndex);
{hideObjectGlobal _x} forEach (nearestTerrainObjects [_location,[],_radius]);
} forEach _locations;
your right i wasnt even paying attention to that in my sleep deprived state. should the edits you made work?
looks working to me. But I tend to make mistakes
okay ill test it thanks for your assistance. people in this discord are so helpful
_worldRadius = worldSize / 2;
_worldCenter = [_worldRadius,_worldRadius,0];
_atmObjects = [];
{
if (str _x find ": atm_" > -1) then {
_x addAction ["Hint Hello!", { hint format ["Hello %1!", name player] }];
_atmObjects pushback _x
};
} forEach (nearestObjects [(position player), [], 50]);
hint format ["Test: %1", _atmObjects];```
Anyone know why this isn't adding the action to all the ATMs in the array?
This script is supposed to make a character smoothly switch weapons from primary to handgun. It is necessary to remove the primary ammo else the character will immediately switch back to primary when targets are acquired. Adding 1 round (or an arbitrary amount) plus an ammo EH doesn't seem to work.
SWO_fnc_weaponSelector=
{
selectWeap = currentWeapon _this;
if (selectWeap== "arifle_mk20_f") exitWith {
_this setAmmo [handgunWeapon _this, 1];
_this selectWeapon "hgun_pistol_heavy_01_f";
_this setAmmo [primaryWeapon _this, 0];
_this addeventhandler ["Fired",{(_this select 0) setvehicleammo 1;}];
};
if (selectWeap== "hgun_pistol_heavy_01_f") exitWith {
_this setAmmo [primaryWeapon _this, 1];
_this selectWeapon "arifle_mK20_f";
_this setAmmo [handgunWeapon _this, 0];
_this addeventhandler ["Fired",{(_this select 0) setvehicleammo 1;}];
};
};
This is maybe a bit nicer to look at but still doesn't replenish ammo,
SWO_fnc_weaponSelector=
{
selectWeap = currentWeapon _this;
if (selectWeap == "arifle_mK20_f") exitWith {
_this setAmmo [primaryWeapon _this, 0];
_this setAmmo [handgunWeapon _this, 1];
_this selectWeapon "hgun_pistol_heavy_01_f";
};
if (selectWeap == "hgun_pistol_heavy_01_f") exitWith {
_this setAmmo [primaryWeapon _this, 1];
_this setAmmo [handgunWeapon _this, 0];
_this selectWeapon "arifle_mK20_f";
};
ammoEH=_this addeventhandler ["Fired",{(_this select 0) setvehicleammo 1;}];
};
is it because the function is called and the EH needs to be spawned?
@frozen knoll I'm wanting to add it to the atm thing
So players can walk up to it and select that
_x is an the atm object
So it should be adding the action to it
At least I think
@hot kernel I think you can make a player switch weapons without changing their ammo
Maybe force them into an animation I'm not to sure
@tough abyss , if you want to disambiguate your script function try it in a VR map-- what happens with 3 atm's sitting next to one another with nothing but the player present?
yeh tru but could return more than one also
@hot kernel ... Then the three atms would be in the array and the same thing should happen
@tough abyss , yes, you can switch weapons easily. The character will immediately switch back when contact is engaged
Ah
Alright
atmCount= count "atms";
systemChat format ["%1", atmCount];
so that's good news!
No clue how to fix it but still found the issue
Lol
It only works on ATMs I put on the map but not ones that are there by default
ah-ha!
Why does that happen lmao wtf
@tough abyss ,I don't know. I would have wrote it like you did and then probably been here asking the same things 😄
Lmao
make a forum topic,
https://forums.bohemia.net/forums/forum/154-arma-3-mission-editing-scripting/
its a map object (p3d) so wouldnt it be best to add the action to player with a condition checking if its a atm?
@tough abyss , check here
https://forums.bohemia.net/forums/topic/184859-return-all-atm-objectspositions-on-map/
So back like 2 years ago when I played Exile. Some one had some sort of script that basically allowed you to tune into enemy NPC comms. Not as a tactic thing, more like a warning system as you got closer. It was just a bunch of audio ques and text that would appear, only if you had a radio. Does anybody possibly know what that script is called? I tried googling enemy radio script with not to much luck.
Ty @hot kernel
@outer fjord i believe that was a feature in @a3xai
the event handler is unnecessary, the character already has an EH for this. At first I thought the EH was being removed when I set the ammo count to zero (see above if this isn't making sense). But I took my own advice from (also above) and system chatted the EH and regardless of which weapon/when/whatever the initial EH still fired-- all good.
the character's initial magazine count was zero and this caused the EH to fail. That common ammo EH we all use requires a unit must have more than 1 magazine (ie 1 in INV and 1 in weapon). That said, this works great,
SWO_fnc_weaponSelector=
{
selectWeap = currentWeapon _this;
if (selectWeap == "arifle_mK20_f") exitWith {
_this setAmmo [primaryWeapon _this, 0];
_this removeMagazines "30Rnd_556x45_STANAG";
_this addMagazines ["11Rnd_45ACP_Mag", 2];
_this selectWeapon "hgun_pistol_heavy_01_f";
};
if (selectWeap == "hgun_pistol_heavy_01_f") exitWith {
_this setAmmo [handGunWeapon _this, 0];
_this removeMagazines "11Rnd_45ACP_Mag";
_this addMagazines ["30Rnd_556x45_STANAG", 2];
_this selectWeapon "arifle_mK20_f";
};
};
With the added cinematic effect of weapon reloads which the EH usually prevents.
I want that the player get damage, when he arrives an trigger and he hav´nt an gas mask!
while{Alive player} do {
if (headgear player in [""]) then {
player setDamage 0.2;
sleep 5;
player setDamage 0.2;
sleep 5;
player setDamage 0.2;
sleep 5;
player setDamage 0.2;
sleep 5;
player setDamage 0.2;
};
if (headgear player in ["U_B_CBRN_Suit_01_Wdl_F"]) then {
player setDamage "";
};
};
The script looks correctly, but the player get 1x damage when he go in the trigger with gas mask! Did someone know an other script or can write it correcly for me?
You are setting the same 0.2 damage all the time.
It does not add up like that.
But also if player already had 0.6 damage you would be healing him.
You'll have to first get the players current damage and add to that.
The player should get damage every 5 sec, when he did´nt use the gas mask, in the trigger zone!
Q: re: adding AI crew to turrets. I have found that that AI tend to pick up where players leave off in terms of engaging enemy combatants at will. This in spite of my disabling all of the AI behaviors. Is there a way for that to stick? Or would I need to watch for player releasing and/or disconnecting and instruct the AI once again?
If I am unable to persuade the AI to stand down, and remain stood down, it would not be the worst thing for us to forego the AI in the turrets and simply expect players are in proximity of the turrets in order to use them.
@tough abyss Try while {alive player} do { if !(headgear player in ["U_B_CBRN_Suit_01_Wdl_F"]) then { player setDamage (damage player - 0.2); sleep 5; }; };
Could someone please tell me if it's possible to script flight paths at certain altitudes ?
I need a low flying spitfire path
is it always the same path?
@tawny badger see flyInHeight; it seems flyInHeightASL doesn't work (or not as intended)
//Starts up the loop for saving the player
params ["_player"];
[_player,
{
if (alive _this) then {
_handle = _this spawn {
["loadPlayer", _this] call pdw;
["loadInventory", [name _this, _this]] call pdw;
}
};
waitUntil {scriptDone _handle; false};
while {true} do {
if (alive _this) then {
["savePlayer", _this] call pdw;
["saveInventory", [name _this, _this]] call pdw;
};
sleep 15;
};
}
] remoteExec ["spawn", 2];
can someone tell me why _handle is undefined? I'm guessing it's because this is inside a remoteExec :/
Maybe try this?
//Starts up the loop for saving the player
params ["_player"];
[_player,
{
// Look here Pritchard, we create a variable before we enter another scope
private _handle = scriptNull;
if (alive _this) then {
_handle = _this spawn {
["loadPlayer", _this] call pdw;
["loadInventory", [name _this, _this]] call pdw;
}
};
waitUntil {scriptDone _handle; false};
while {true} do {
if (alive _this) then {
["savePlayer", _this] call pdw;
["saveInventory", [name _this, _this]] call pdw;
};
sleep 15;
};
}
] remoteExec ["spawn", 2];
no dice :( just never gets around to starting the save loop
So you're spawning a new script for each player 🙄
The usual conversation which must start right now, is why spawn is bad 🤔
like... player can disconnect right in the middle of the call of ["savePlayer", _this] call pdw;function
although probability of it is pretty low... maybe one of 10^3 players would experience loss of his inventory, IDK
wait WHAT
waitUntil {scriptDone _handle; false};
waitUntil is my bane but the wiki says it should always return something
so when it was saying "_handle is nil" i was like "ok :/"
waitUntil blocks until the code on the right of it returns true
but you are returning false all the time
// bad
waitUntil { if (!alive player) exitWith {}; _time = _time + 1 };
// good
waitUntil { if (!alive player) exitWith { true }; _time = _time + 1; false };```
?
Anyway, unless I know something else, just looks like a strange design
Why would you spawn a code and wait until it's done if you can just call your code? Making 'threads' for the sake of making 'threads'?
Hmm. I probably should call it. I guess i'm paranoid about the file operations locking the game up noticeably whenever a player joins
but.. they probably still will anyway :/
scheduled code still runs in the main thread
so it's no difference
you are just bringing asynchronousity into your design for no reason or benefit right now
_handle was nil because it was only defined inside the if statement
local variables are local afterall
yeah, i think i'll change it to call
if file ops need to be accelerated, probably the extension which performs them must have multithreaded design
call in remoteExec will make it unscheduled. which means no waitUntil for you
Me no read all the chat :U
New achievement unlocked: ⭐ Developer lvl II. ⭐
lol i've crashed the game plenty before now. thankfully this mission is actually decently stable now
it used to produce a LOT of RPT errors and now it's 👌
honestly I'd suggest you to rethink about how scheduler works, and move such things as you are doing right now into unscheduled env.
Such as...
replace remoteExec with remoteExecCall at least
Instead of spawning stuff, add some CBA thing to run every 15 seconds (probably other ppl will correct me, I don't know the exact function name)
in this cba run-every-15-seconds thing, delete the thing if player has disconnected, otherwise save his data
If you still feel like spawning something, wrapping code into isNil makes it unscheduled
i thought about the CBA thing. (PerFrameHandler) but i wasn't sure if it's actually more performant?
Hmm. Using remoteExecCall seems to be the cause of the game locking up
:/
It's not about the performance, but the issue is, as I've said, I assume you are getting player's loadouts and whatever other things in a scheduled script, that script can get interrupted at any time, and player's state might have changed by a lot (or he has even left the server) by the next time your script continues to run
I forget. If you run call within a spawned script, it's actually just unscheduled too isn't it?
ah :/
replace remoteExec with remoteExecCall at least only makes a difference when exec'ing script functions, not commands.
calling the load functions has undesired results :/
idk why but it just. really hates loading the inventory. It moves the player correctly but they have no loadout.
Thanks for the advice on the scriptDone waitUntil. I'll probably leave this how it is for now (which is definitely not perfect) and revisit if any data loss issues appear in the future
Though unless the game writes corrupt data I imagine that it won't be a big issue.
IDK, maybe the database functions are meant to be called from scheduled env? It would make no sense IMO, but who knows 🤔
I guess you are using some database addon extension?
inidb2, and the only reason i can imagine is that i use setUnitLoadout to restore the loadout
inidbi2 should work in a fine synchronous way I would imagine
¯_(ツ)_/¯
Hmm. Using remoteExecCall seems to be the cause of the game locking up
Daim! You really have to try to make it happen
lol. more specifically it was using sqf remoteExec ["call", 2]; or sqf remoteExecCall ["call", 2];
using "spawn" worked but yeah remoteExecCall-ing "spawn" is pretty pointless from what i understand?
Remote executing call or spawn is not a good design, you lose ability to control what should and should not be executed in mp and by whom. Having a function that you remoteExec or remoteExecCall is way better and more flexible
mm. good point. i will rework this :o
Tbh... Dedmens DB plugin for intercept is one of the biggest pros for Serverside intercept right now
it really is, just don't push too much data through one connection or you will be covered with errors
okay i have to add i am talking 10.000 statments/h
Uhm... No
The rule of thumb is: do not use crappy extension interface
private _arr = [ ["assertEqual", { for "_i" from 1 to 10 do { _i }; }, 10],
["assertEqual", { private _arr = []; for "_i" from 1 to 3 do { _arr pushBack _i; }; _arr }, [1, 2, 3]],
["assertEqual", { private _arr = []; for "_i" from 0 to 5 step 2 do { _arr pushBack _i; }; _arr }, [0, 2, 4]],
["assertEqual", { for "_i" from -1 to -10 step -1 do { _i }; }, -10],
["assertEqual", { private _arr = []; for "_i" from (-1) to (-3) step -1 do { _arr pushBack _i; }; _arr }, [-1, -2, -3]],
["assertEqual", { private _arr = []; for "_i" from 0 to (-5) step (-2) do { _arr pushBack _i; }; _arr }, [0, -2, -4]]
];
{
private _res = [] call (_x select 1);
if !((_x select 2) isEqualTo _res) then {systemChat ("invalid test: " + str (_x select 1));};
}foreach _arr```
could one double-check?
expected output is none

so test-cases work as expected
neat
SQF-VM now again, is bugfree according to the tested range
now ... back to my math 😦
And, just because the list is kinda empty ...
https://docs.google.com/spreadsheets/d/1kRw1afDwnJvnW67ylmj91CVr8Qs57G7570-5XmnqSD4/edit#gid=0
Lil "call to action" for people to add some SQF-Commands that are not yet in SQF-VM but are useful for everyday usage ... daddy needs something to do after his math exams which he probably will fail like ... the last few times
Just to note for those who do not know what i am talking about (and why i am in need of correctness checks for basic SQF code): SQF-VM is a project, that "emulates" the arma scripting language
question: is it possible to get the contact map layout into a3? just talking about the map - not the task system
Why hold in because of scanConfig? @queen cargo
in is on hold because stuff like locations are not yet existing
the fnc_scanConfig should actually fully be working using sqf-vm right now
to be more precise:
position in location
unit in vehicle``` are not implemented in sqf-vm
Haven’t seen any references to locations in scanConfig
the scanConfig was the reason, why i wanted it to be implemented
the hold reason can be seen when hovering above the HOLD
anyone at all with insight into the turrets AI issue? I basically want them to remain dormant and/or stood down no matter what, but still allowing for players to connect via their UAV Terminals. what I have found is that upon Release or Disconnect, the AI goes right back to being active again. worst case I forego my AI goals and expect players to be in proximity to man the assets, I suppose.
when you have the addAction can you tell the typeOf _caller, is that "man" ? whether or not that is also isPlayer, possibly. thanks!
you have the "action bearer" in the code parameters @dreamy kestrel
@winter rose not sure what you mean, I do not see an action bearer in the docs, https://community.bistudio.com/wiki/addAction
"target" in scripts parameters
"caller" being "who used the action"
Oh, wait - you want to filter who has access to this action? @dreamy kestrel
@dreamy kestrel isKindOf "CAManBase" and isPlayer
@winter rose re: addAction not so much filter, but determine whether that was a player, in either client/server, presumably in our scenario, running on server side.
http://www.armaholic.com/page.php?id=24859
I've been trying for 4 hours to understand how this works exactly
I can make it work but I can only follow the template
I'd like to be able to change the dialog tree according to the scenario but to do that I need to understand how the system works
I know its a really timespending thing to do but can anyone help me decipher how this works?
I'm sure it can be useful for other people too.
Or even better if you knew a better way to simulate rpg-like dialog trees ingame could you tell me?
Does anyone know how to create a marker and set it's variable name in the editor? Right now I am trying
myMarker = create3DENEntity ["Marker", "Empty", [0,0,0]];
myMarker set3DENAttribute ["name", "respawn_west"];
That creates the marker but the name does not change
how can move a player to the surface of the water via script?
_unit setPosASL ((getPosASL _unit) set [2,0])
@fringe yoke
is this what your looking for? With out all my stuff?
//add mission marker
_tempMissionMarker = createMarker ["mission_marker_" + _missionname, getmarkerpos _missionMarkerName];
_tempMissionMarker setMarkerShape "ICON";
_tempMissionMarker setMarkerType "mil_dot";
_tempMissionMarker setmarkersize [1,1];
_tempMissionMarker setmarkercolor "colorOPFOR";
_tempMissionMarker setmarkertext _squadname + "-Squad Mission";
Nope, I'm trying to do it in the editor, not in game
via script?
Yes
sorry mate, never done that before. thx for the code though. ill test it out now.
@fringe yoke
does this help?
https://forums.bohemia.net/forums/topic/221999-cfgmarkers-for-ellipserectangle-one/
When someone logs on our server they get popups for all the completed tasks for all the missions before they logged on. Is there a way to disable or prevent that?
anyone know why this doesnt work on the server? i have confirmed that the AI varname is the same on the server as it is on the clients.
private _AI = missionNamespace getVariable [_ai_varname, objNull];
@compact wyvern no crossposting, please delete your message here and wait for an answer in #arma3_editor
Ah great, thanks
@compact wyvern you are not supposed to edit sqm
@fringe yoke @exotic tinsel Technically you would want setPosASLW https://community.bistudio.com/wiki/setPosASLW
anyone can tell me how the glowing lights are attached to the drones in contact? BIN_fnc_initUAV / UGV; does that to them, but i can't find in the actual script where it is done.. so i'm assuming something else does it somewhere else
So what is there inside this BIN_fnc_initUAV?
Maybe paste it here so others can find the line of code that does that?
sure, as soon as pastebin is back on
but i'm pretty sure there is nothing in it that does it. my guess is that contact has some other script running that fetches these initiated critters and does stuff then
ok, found it now in initaidrone
!issuewarning @compact wyvern crossposting x2
Done.
Can setVariable and getVariable be used in one statement? https://sqfbin.com/ejasalukotawuruterad
yes sure
not sure how your code is supposed to be related to that tho
your code is 3 statements with 0 getvar
https://sqfbin.com/udoneriquwizavobapiv Sorry, I'm wrong. I mean whether setVariable can be used in the same statement. _ isfed is a variable of the door, and I want to lock it automatically 30 seconds after prying it open, so I write this
@still forum
Okay, please forgive my English level. Thank you very much. @still forum
just do -2m on the height?
I am going to try
@still forum Do you know how to add a button to a door of a building so that the player can have an option of a roller for the door of the building? Thank you
no
Can someone tell me why this isnt working. i have confirmed the AI varname to match what im passing in to the function. but it doesnt get the AI's object
params ["_ai_varname", ["_player_steam_id", ""]];
private _AI = missionNamespace getVariable [_ai_varname, objNull];
@runic quest do you mean an action in the action menu?
I mean something like player Addaction. For example, there are seven doors in a building. I want to add a button (mouse wheel) to the third door.
@exotic tinsel
@runic quest give me a min to find the script i have
can you show how you call the script function?
@still forum
[vehicleVarName _AI, getPlayerUID _caller] remoteExec ["feature_5_fnc_state_3_apply", 2];
checked that vehicleVarName returns what you expect?
@still forum from an actionmenu item
Wiki says
Since it is possible to setVehicleVarName individually on each PC, the value of vehicleVarName returned will be local to the PC on which command is executed.
so maybi?
na, i checked that what i sent was the same as on the server.
😊
@still forum so that code should work though right. its prolly im doing something wrong somewhere? but none the less that is the proper way to get an object by string var name?
ok. ill keep testing, thx
Why not refer to AI by direct reference to the object?
well, i was thinking that it would be better for performance to pass a string from clients to server. lots of scripts, lots of players.
no it's actually worse
sending objects in remoteExec requires less network traffic
the object is a single integer
4 bytes
good to know, noob here remember. thx guys.
Anyone know what I need to do to retain a custom loadout after death? Not just what they die with but what they start the mission with?
@broken snow you can do something like this on each client when you trigger a mission. Dont do it from the server, it isnt very reliable.
v_playerLoadout = getUnitLoadout player;
I added eventhandlers for when they close inventory and arsenal and save their load out.
@exotic tinsel where would I put that code?
Never mind Im dumb its already in 3eden mod
_nTrees = nearestTerrainObjects [(visiblePosition player), ["TREE"], 10];
{
if (_x distance player > 10) exitWith {};
if ([_x, "VIEW", player] checkVisibility [eyePos _x, eyePos player] < 0.3) exitWith {};
drawIcon3D [ //--- Title
"\a3\Data_f\clear_empty.paa",
[0.051,0.447,0.784,1],
visiblePosition _x,
0,
-2,
0,
"Arbol",
1.8,
0.042,
"RobotoCondensed",
"center",
false
];
} forEach _nTrees;
the same thing still happens to me
hi, i have created an extension on arma 3 in c++ but the "if,else,else if" statement doesn't work and i have nothing in .rpt and it work when i put the code in c++ console project so it's not my code but why arma 3 doesn't recognize the if,else,else if statement ? my code : https://pastebin.com/6fJF1ETS so anyone know how to solve it ?
@faint oasis As far as I know, else if is not applicable in arma3 grammar
yes but it's only in c++ because in c# it work
@runic quest so if the "if,else" is not available how to use it ? or an alternative
@faint oasis if () then {
/* code /
} else {
if() then {
/ code /
} else {
/ code */
}
}
oh ok
it's only the "else if" ?
ok i understand because when you have say "else if" i think "if,else and else if"
ok i will test it
but in c++ you don't have then
You can ask others that my grammar level is not very good.😅
ok but no problem
@runic quest thx but it doesn't work
void __stdcall RVExtension(char *output, int outputSize, const char *function)
{
if (function == "test1") {
std::strncpy(output, "test2", outputSize - 1);
}
else {
if (function == "test2") {
std::strncpy(output, "test1", outputSize - 1);
}
}
}
sorry,i used https://sqfbin.com/buqilolibudejunayule ,not if else if
yes that is .sqf not c++ but don't worry
if you have multiple if...else statements, then it also might be an idea to use switch instead:
switch (true) {
case (function == "test1") :
std::strncpy(output, "test1", outputSize - 1);
break;
case (function == "test2") :
std::strncpy(output, "test2", outputSize - 1);
break;
}
@faint oasis see https://community.bistudio.com/wiki/callExtension and no you can’t compare a pointer to array like this and expect it to work.
@faint oasis is the extension actually loaded correctly?
And what exactly is the issue? Are you not getting any results?
@exotic flax that ain't how switch works in c++ 😉😉
@queen cargo it is obvious what the problem is function == "test1"
does switch (true) work in c++ though? 🤔
@winter rose https://ideone.com/PyPWQK
so I take it works!
Well not exactly like in sqf
More like not at All like in sqf 😂
ok but when i use the switch (true) do it doesn't work because he say i need a const expression
The compiler should optimise out the false cases in C++ (gcc/clang, probably not with msvc) - you should get a warning for using a boolean in the switch though @winter rose @tough abyss
@dusk sage do you know how to use switch (true) with the function ? because he say i can't because i don't have an constexpr
and i don't know how to convert the function string to an constexpr
What's your aversion to using if/else?
But to answer the question, the cases and condition are expecting integral/enum types, not expressions (minus init statements in C++17 - doesn't help you), needs to be compile time
So, you cannot
@faint oasis once again, your problem is not if else if, but comparing what you think is both strings which are not
@dusk sage that is not fully true.. Sorta... Theoretically, one could use a constant expression to create a hashvalue from a string and compare the hash of the input against that
If your string is available at compile time, which it's not in this case
It is available (test1, test2)
function is not
They are not strings though
if you insert type here is available
Reread what I wrote
@dusk sage
the hash of the input
the input being?
Welcome to my world
You're still doing conditional execution at runtime in the switch, unless you wanted to make a case for every hash?
Can you write some mobile phone pseudo code 🙂 ?
I will just Boot up the PC.. 😂
And lay down afterwards again
Das boot!
@dusk sage https://ideone.com/iouynN
Where's the switch(true) 🙃 ?
never was talking about the switch true 😅
just "prooved" that in a hacky way, strings can be switched too
👍 That's what I was yapping on about
@tough abyss yes but both is not string ? because it work in c#
Sorry, could you explain?
he means: switch(System.String) works in C#
which is also not fully true ... as this is rather a compiler trick
@tough abyss say both is not string sothe problem is not the "if,else" but the comparation
it gets converted to a simple if (...) else if (...) else ... chain or at some point may even get transpiled into some dictionary (that then again uses a hash-lookup)
@still forum I'm still with the problem
ok thx but how to use "if,else" then ?
by just using it ....
there is no trick in c/c++/c#/...
only thing is:
c/c++ knows no "string" type persé
aka: "foo" => const char*
not std::string
thus you cannot compare some pointer with another
because it work in c#
you write in c++?
as you are essentially just checking wether instance a is the same as instance b
(which is simplified here, you actually compare addresses)
because in c# i can't use all of system because he crash
and in c++ not
so i want to use c++
then write in c++
i will tell you the same thing that i tell all people who ask me about programming things:
resolve the types, and you will notice that you are not comparing string literals but rather the addresses where those strings are physically in the RAM
yes i know
so make it a string
but how ?
std::string functionstr(function);
thx
i gave you link to callextension page Y U NO READ?
or simplified:
const char* something = "bar"; // stored at 0x0001
const char* someOtherThing = "foobar" + 3; //"bar" - stored at 0x004
return something != someOtherThing; // True```
if but the link can't resolve my problem but thx
it has the example of extension you ripped off and it shows how to compare input
Y U NO READ?
you can also compare strings if you convert function to string
how ?
seriousdly ?
std::string functionstr(function);
Let me know if you want me to copy paste my answers more
no
but i think when you say that it's to convert the function void to const char
yes i have see your comment don't worry
What about this @queen cargo 🙃 ?
const char* something = "bar";
const char* someOtherThing = "bar";
return something != someOtherThing;
Oh compiler joy
Yeah I think it won't even care to actually compare anything at run time
With any optimisation level (-OX) it won't
With gcc at least, it'll reuse the loc, with no optimisation
switch and if and else if are all good but real programmers use goto
https://www.explainxkcd.com/wiki/images/7/7a/goto.png
goto bar;
...
bar: while(true) drink();
A quick goto error
If you don't know C++ basics, you shouldn't try writing Arma extensions in c++
Can I make unbreakable ropes using the ropeAttach EH? As in, if I disable the damage for those ropes, will they not break?
try and thy shalt see!
I would but the reason I'm working on my project is because this class is particularly boring
@ work, can't (easily) try =)
that too iirc. what can be dammaged:
- rope
- cargo
- carrier
- carrier's hitpoint
can i use alive with faction to check if there is no enemy anymore?
spawn {
waitUntil { !alive east };
["Task_001", "Succeeded"] call BIS_fnc_taskSetState;
};
It is simple
- open page with alive
- note what type of argument it takes
- open page with east
- note what type it returns
- compare them and get answer to your question
ah okay, i thought it wouldnt work just making sure.
points compass eastwards
There is no page opening 🤔
i am currently lost on trying to check if the enemy is still alive
can anyone point me to the right direction?
private _eastUnits = allUnits select { side _x == east };```
ahh
// (checks that all units are dead)
waitUntil { sleep 1; _eastUnits findIf { alive _x } == -1 };```
// or
waitUntil { sleep 1 ; east countSide allUnits == 0 }; // maybe a bit more perf hit```
oh
beware of captive though
// maybe a bit more perf hit
explain?
thank you @winter rose and @tough abyss . never use countside before. thanks again for the guide
count side always iterates through all units
== more perf hit than just searching the first alive one
and this doesnt? private _eastUnits = allUnits select { side _x == east };
it has to be or it is useless
you make no sense
k
you can precache for countside in the same way
well in my case, enemy spawn in waves, only stop after ticket == 0
you can precache for countside in the same way
Yeah, still counts all of them, doesn't stop at first
does countSide check alive? wiki doesn't say anything about that
dunno lemmie try
some dead units might switch over to civilian side, but that's not really equal.
wouldn't work if you wanna check alive civs
can i do it like this?
waitUntil {
sleep 1 ;
[EAST] call BIS_fnc_respawnTickets == 0;
east countSide allUnits == 0;
};
["Task_001", "Succeeded"] call BIS_fnc_taskSetState;
yes
but your respawnTickets check will be useless
you probably want to check tickets AND alive?
then you also need to write down the "and" part
in my spawn script there is already a ticket checker to stop the spawn
waht i am trying to figure out is to make sure the enemy left in the mission is dead before succeding the task
which is in another script outside of the spawn script
but your respawnTickets check will be useless
if want the script to check if the side is all dead after the ticket turns 0
isnt my approach correct?
but the script sees now:
waitUntil {
sleep 1;
true;
true;
};
// do something
@exotic flax yes i know that, i want it both to be true before "do something"
because event after the ticket turns 0, there will still be enemy left in the mission
so, like Dedmen said, use && to check both
waitUntil {
sleep 1 ;
([EAST] call BIS_fnc_respawnTickets == 0 && east countSide allUnits == 0);
};
["Task_001", "Succeeded"] call BIS_fnc_taskSetState;
private _eastUnits = allUnits select { side _x == east };
waitUntil { sleep 1; _eastUnits findIf { alive _x } == -1 };```↑ best
```sqf
waitUntil { sleep 1 ; east countSide allUnits == 0 };``` ↑ same as ↓```sqf
waitUntil { sleep 1 ; { alive _x } count _eastUnits
== 0 };``` and no findIf here to save perfs @tough abyss
ahhh so i need to use it like using If
my example already solves it 😉
... guess it's a bit hard when multiple people give reactions to different issues 😉
yeah that too 😛
yeah 😅
@still forum no it doesnt skip dead units
argh
well thanks everyone, learns something new today
↑ best
what stops you from doing the same with countside?east countSide _eastUnits = 0?
the alive part
countside will not count dead units because they will be civilian
yet it will count all of units, whereas with findIf you can stop your count, e.g sqf allUnits findIf { side _x == east && alive _x } == -1 findIf stops as soon as it finds a result, countSide doesn't
(btw, I don't think countSide is an OFP command, but I might be wrong)
countside doesnt have to evaluate expression each iteration
perf tests should be made
allUnits findIf { side _x == east && alive _x } == -1
why is it -1 instead of zero? can it count below zero?
@grave stratus it returns -1 if it doesn't find anything
The real question is, why BI did not just make find overload....
Return Value: Number - Zero-based position of the first array element for which the code evaluate to true, -1 if not found
now it's white on black
so use
allUnits findIf { side _x == east && alive _x } < 1
@tough abyss not that i dont want to, im learning as i go. i never learn any programming language so i am not sure where to find somes commands/functions.
i can read every command there is but i would not remember it anyway
welcome to the world of programmers, where Google is your best friend 😉
heck i didnt even know how to use an array properly
so use
and if you get fist element match?
< 0 @exotic flax 😉
but < 0 only returns TRUE on -1, not on 0 😉
yes, and 0 means it found something
exactly
@exotic flax i tried it everytime before coming over here 🙂
ah ok... it returns the array pos, in that case -1 makes sense
yes, and 0 means it found something
now this make sense
0..n = found something / -1 = found nothing, aka no array index
what do you think Zero-based position of the first array element means?
it means that I didn't read
@tough abyss
what do you think
i never learn any programming language
means?
thats ok, no one reads biki anyway
i do for the commands that i wanted to use, but sometimes it contains some fancy terms i dont understand 😅
Well, I think the ultimate lesson here for any learner is, that if one encounter something unfamiliar like "Zero-based position" then one should inquire to its meaning.
Bad assumptions are the devil... Or at least I assume so.
trial and error also work fine, as long as you know how to debug 😉
I usually goes with trial and error, thats how i normally learn anything. Except when i hit a stump, i'll seek help
that's what this channel is for @grave stratus
Anyway, back to all east eliminated problem - a simple NOT PRESENT trigger side OPFOR will do
now that will trigger me 😄
most optimal solution, why are you against good code?
2× more expensive than a 1s delay,
and the big area trigger issue if this hasn't been fixed
so… not optimal 😊
there is no big area trigger issue and it doent run any condition apart from this which is just a boolean so mega cheap
perf tests should be made ¯_(ツ)_/¯
Just making sure, the underscore before a variable like _variable means it can only can be call in thay script correct?
it means it's local
it's only accessible in current scope (everything between { and }) and below (deeper nested scopes, not below in terms of line number)
ah now i get it. thanks
Hi, guys! Are there any details on the group creation that one need to know, except limited amount of groups? It looks like when I spawn groups of units as waves sometimes createGroup doesn't work even though the script sleeps for 1 second after the command is invoked.
And I do clean the empty groups for previous waves, so the overall number of groups usually is no more then 82.
How do you define 'does not work'
Be careful when moving units between groups, as when the group becomes empty it is auto deleted regardless of the delete when empty flag
even though the script sleeps for 1 second after the command is invoked.
How would sleeping affect anything :/
might affect negatively
Is it like, "if something doesn't work, try to sleep"?
one second time for the game to notice that there is a empty group that could be deleted
I can certainly recommend that
coding while tired is stupid
Is it like, "if something doesn't work, try to sleep"?
No, remoteExec
or put it into description.ext and try to execVM it 🤔
The code wasn't mine actually so I thought that sleep was an OK move.
The idea that sleep actually kills an empty group is fascinating, @still forum
Is it like, "if something doesn't work, try to sleep"?
That part of code actually worked. But sometimes a while loop that run it gave me a null group, @astral dawn . Probably that sleep actually killed the group sometimes, I'll investigate it tomorrow. @tough abyss , nice one with remoteexec and so true lol.
code or it didn't happen
this switchmove 'AmovPercMstpSnonWnonDnon_SaluteOut'
what is this? Is the code being put into an object's init field or something?
It is the script within the Init indeed.
_grp = creategroup _Team;
sleep 1;
if !(isnull _grp) then
Makes no sense
My first thought on that one was that Ryan tried to be sure that group was 100% created or something.
according to this page https://community.bistudio.com/wiki/Initialization_Order
objects init fields are unscheduled
are you spawning the code maybe?
or not using -showScriptErrors
are you even showing us the whole code
Not me, it's the Ryan mod's code. But the Init works okay until it generates pauses and in the end stops spawning zombies.
_grp = creategroup _Team;
sleep 1;
if !(isnull _grp) then
{
// Do something
sleep _Frequency; // I am so tired, let me sleep before leaving this scope
};
It's a while's sleep
There is no while in that code though
Allright sorry for these uncomfortable questions 🙄 about the code made by not you
Sorry, I made a wrong mouse move, my mistake,
There should we a while line above
and couple of exitWith's
But it doesn't really matter. The mod code works ok-ish for the first 3 to 5 waves of spawns. And then starts failing this awkward !(isnull _grp) condition.
Allright, another question, where does _Team variable come from
Or is it a magic variable ...
no it isnt magic
From the pre-while set of global to local vars.
why not shown in your code?
afaik you cannot have a while true loop in a init script
that doesn't really make sense
I kind of like it, guessing code context from existing code
"hey there is a missing variable here, there must be something missing"
"hey you can't sleep here, it must be spawned"
"hey this variable must refer to something, I guess it's an init field'
Because I've traced the hell out of everything there and everything is legit. Because the only awkward thing that I wasn't sure about was a sleep after a group creation.
There is no loop inside an Init.
It's outside. There is a unit creation within the loop that gets an Init field as a part of ARMA scripting command "alternative" syntax that Ryan uses: https://community.bistudio.com/wiki/createUnit
"There is no loop inside an Init." there is a while true
"It's outside" can't be, you are using this which is only valid in init
welp besides that part
I'm not using anything, this is a Ryan's mod code 🙂
As I said, coding while tired is bad, same about reading code
this setposATL [(getposATL this select 0) + random _density - random _density, (getposATL this select 1) + random _density - random _density, (getPosATL this select 2)];
vectorAdd.
this is inside the Init that starts at the line 21
oh fuck this whole thing is an init field
you can see how he creates unit, giving the position parameter, then the group and then there is an open " symbol after which he scripts the Init insides, using this also
Not the whole, but the major part of the listing, yes.
I thought first that you have copy-pasted something wrong xD
And the prize for the longest createUnit init field goes to...
Ryan's Zombies & Demons mode 🙂
I have actually couple of more bugs fixed there, probably I need to find this guy if he is still interested in supporting his work. Which is actually very good. But sometimes awkward.
As in my favorite part:
_Activation = _logic getVariable ["Activation",1];
if (_Activation == 1) then {_Activation = 0.9;};
if (_Activation == 2) then {_Activation = 0.7;};
if (_Activation == 3) then {_Activation = 0.5;};
if (_Activation == 4) then {_Activation = 0.3;};
if (_Activation == 5) then {_Activation = 0.1;};
Maybe he wants 0.3, not some 0.299999999 (although it would be 0.29999 anyway)
I didn't find anything in code that supports the idea of this even was needed.
It's just taking the ints from config, then converting them into short doubles and then a column of if statements like if _Activation == 0.9 then do this code
There was no math, they are just flags for activation type like "this will activate first wave of zombies and that is for the second"
if ((_Type3 == 13) OR (_Type3 == 0.45)) then {_array = _array + _a13;};
WHY
append he also doesn't know
welp.. every big-ish framework type of code is usually about 5 years out of date and not being maintained properly
thats just normal
I mean just look at this init field of createUnit I am still shocked 😮
Well I hope no one will see my own code, it's just a shitpile of junk 🙂
I pray that I will have some time to refactor EVERYTHING
Also
Is it like, "if something doesn't work, try to sleep"?
still sounds as a bulletproof advice.
Is there a way to display a player's name with no Spaces? Like if a players name is Jason Smith, can you make it display as JasonSmith?
Display where?
on a UI, im trying to make a twitter type of display, and I would like the players RP Name to appear as like @FirstLast(RandomNum)
thank you very much
Hi. Have someone a simple suggestion to restrict some userprofile names to join the game? I saw the such system in Invade & Annex (Apex Framework from QuickSilver). But it is a deep integrated in it and using it's own Robocop system to manage the restrictions.
// initPlayerServer.sqf
private _list_with_names = [
"NAME A", "NAME B", "SOME WEIRD NAME" // all uppercase
];
if (toUpper profileName in _list_with_names) then {
serverCommand format ['#kick %1', name player];
};
probably something like this
however I would suggest using their STEAM ID instead, because it's easy to change your name
That is great. I want to restrict using exactly the prohibited names.
Some like Admin, User etc
in that case it would also be nice to first tell the person the reason why they got kicked 😉
if (toUpper profileName in _list_with_names) then {
titleText ["Your name is not allowed at this server, please rename it or play somewhere else", "BLACK", -1, true];
player enablesimulation false; // prevent player to do anything
sleep 30; // wait 30 seconds
serverCommand format ['#kick %1', name player]; // kick from server
};
btw... I'm not 100% sure about the serverCommand line, since I never used it, but according to the biki it's how it works
Greatest thanks! I'm administrating the Linux server over the year, but still the nerd in Arma scripting... 😕
server management has nothing to do with programming 😉 mistake I also made (just the other way around)
👍
not sure if I need to ask this here or in config, but does anyone know of a scripted way I can close the front door on Land_Hangar_F? I've looked in its config for animationSources but it doesn't have any defined for some reason but I know I've seen it closed before
well... the default object doesn't has any doors which can be opened/closed at all
Land_Airport_01_hangar_F on the other hand does have doors which can be opened/closed/locked
but perhaps it was a mod which enabled it in some way
hi, for a prophunt game mode how would you punish players for shooting at the wrong objects? like in garry's mod if a hunter shoots at a barrel thats not on the enemy team they loose a bit of health.
setDamage to the shooter
// Rocketmaaan
_badShooter setPosATL (getPosATL _badShooter vectorAdd [0,0,10]);
_badShooter setVelocity [0,0,300];```
I could use a hint in the right direction :)
i can get this to work when i have the UID of ppl in the same file but when i try to have a server side file contaning the uid's it stop working
_Uniform = uniform player;
_Ui = getPlayerUID player;
_donate_file = "\Donation\Donater.txt";
[_donate_file, _Uniform, _Ui] spawn {
private ["_Ui","_Uniform","_donate_file"];
_donate_file = _this select 0;
_Ui = _this select 1;
_donator = call compile preporcessFile _donate_file;
if (_Uniform == "RDF_Pilot_2_U") then {
if (!(_Ui in _donator)) then {
removeUniform player;
Hint "Donations Uniform";
}; else {
Hint "Tak for din støtte";
};
};
};
oh and i have this in the init.sqf
RDF_fnc_Donate = compile preprocessFileLineNumbers "scripts\Donation.sqf";
["loadout", {
player call RDF_fnc_Donate;
}] call CBA_fnc_addPlayerEventHandler;
Any help would be appreciate
hmm.. i could start by not suck at typing.. preporcess 😭
how do you get the stuff from serverside to the client?
do you have filePatching enabled?
do you have a dummy file on same path in a pbo that's loaded on the same server
filepatching is enabled
private ["_Ui","_Uniform","_donate_file"]; that's bullsh. Use the private keyword.
_donate_file = _this select 0; that's bullsh, use params
ill look it up.. not that strong in writing scripts 🙂
i thought that the compile preprocessfile got the server side donate.txt to work in the script.
and i dont have a dummy file anwhere.
@still forum so I've fixed that issue with sleep and group creation. And there were actually two sleep commands that gave ARMA an additional possibility to kill the empty group lol, counting to the total of three.
Like, when you shoot at your own knee, do it thrice just to be completely sure.
Look at the code you posted above _donator = call compile preporcessFile _donate_file;
your have a typo, which the color in your post above shows you
No it doesn't load from server, preprocessFile (you should probably be using loadFile btw, or name your script .sqf if that's what it is) loads from the local machine, if you run that code on a players machine it will try to load it on the players computer, where the file doesn't exist
i know i corrected the typo.
@dull drum you can disable deleteWhenEmpty afaik
Not needed anymore, it now just works. I rewrote this part of code completely.
@lavish hamlet you are trying to make some uniforms only available for donators? you know that at that point it's not a donation anymore but payment for an item/benefits which means you need monetization approval by BI to do that. Do you have that approval?
You sure about that Dedmen?
If it gives you game advantage maybe but if it is a cosmetic item I’m not so sure
game advantage is not allowed in any case
yes for cosmetics you need approval
and also by all the mods you're using
nothing is emplementet yet, just testing.. and the full scope is members of RDF who help out with the server cost get a tag on ts and a Different uniform
you cannot give people ingame stuff for paying money without approval by BI
oki..
Give them pink username
And if the modpack that google gives me is yours, then you can't monetize anyway as you are running multiple mods which explicitly forbid that
monetization soon expires
Anyone know if you can set an custom location/position for the ace interact action on an object?
only via config not via script?
you might be able to mess with the config cache if it has one
You can do this with addAction if the object has a memory point
Well I want to use ace action, it's an sign close to a wall, just found out if it's to close to a wall (the sign) the action will be behind the wall and can't be accessed. So I need to move the point more into the actual sign.
But I will look at configs then I guess seems simpler.
check the interaction framework wiki page on ace website
question on setVelocityModelSpace: when I apply it with [0,1,0], the plane taxis on the ground in a straight line. Any bigger value and the control surfaces/nose wheel seem to be active and the plane steers to the left. Here's the working code (yes, the sleep should really be a per frame eh, I know): sqf _plane setDir (_plane getDir _pos); while {alive player and alive _plane and _plane distance _pos > 5} do { _plane setVelocityModelSpace [0, 1, 0]; sleep 0.01; };
so when I change to _plane setVelocityModelSpace [0, 2, 0]; the plane steers left. No matter if F/A-18 nod or F/A-181 jets dlc
anyone has an idea why that steering happens?
there is no AI in the plane, with AI the plane steers left with any value
You are applying force to the centre of mass which could be slightly off
Try addForce
Or could try to change centre of mass with setCenterOfMass (not recommended)
addForce I tested a year or so back, it had slightly erratic results when used for taxing, works fine for afterburner though
not sure why center of mass should be offset and differ between applying 1 and 2?
no, the addForce seems to do nothing and then jump the plane forward in a leap, it's like it's accumulating and then releasing, like a compressed spring
for the F/A-181 yes, for the F/-A-18 no, on wheel spin
Strange behaviour
Never had problem with addForce
You can always setVelocityTransformation to get the plane from a to b smoothly
_Arr = [1,2,3,4,5,6,x,7,8,9,10];
Given this, what is the best way of splitting _Arr into _div pieces, where no element=x. (so ignoring x). I'm good with 1-4, 5-7, 8-10 being 3 chunks, or (1,4,7,10),(2,5,8),(3,6,9) or any other method.
On the hacky side you could do it with a 2 loops (nested) and a check to see if there enough left for another split and making an array of arrays as an output.
private _wantedSplitSize = 3;
private _array = [1,2,3,4,5,6,x,7,8,9,10];
// removes non-numbers
_array = _array select { _x isEqualType 0 };
(…)```
Thanks Lou. Doesn't really answer the question.
Removing the x is relatively straightforward a number of ways.
Right, but that fixes the bit I missed 
I threw it into the example as a complicating factor but probably didn't need to.
Of course my actual use case isn't 1,2,3... but a number of subarrays
@worldly locust take a look at BIS_fnc_subSelect
how about something like this (untested!)
_div = 3;
_Arr = [1,2,3,4,5,6,7,8,9,10];
_newArr = [[]];
_newArrIndex = 0;
_perGroup = ceil ((count _Arr) / _div);
{
if (count (_newArr select _newArrIndex) == _perGroup) then {
_newArrIndex = _newArrIndex + 1;
};
(_newArr select _newArrIndex) append _x;
} forEach _Arr;
@exotic flax thank you for that classname. I may have been incorrect about the classname i used in my post. I'll try your suggestion now as that's poetically what I'm actually looking for
it's also possible that for example CUP has a hangar with openable doors (imported from Arma 2), because I also believe there used to be a hangar with doors 😉
found it ;)
Land_Ss_hangar and Land_Ss_hangard are in CUP, and have proper door animations.
I'm currently having some trouble with the moveInCargo command.
I've applied the following code to a unit
_unit disableAI "MOVE";
_unit disableAI "ANIM";
_unit setCaptive true;
If i try to use the moveInCargoafter that the unit will be automatically kicked out of the vehicle 1 or 2 times.
Any suggestions on this?
@dry inlet , you need to do this first,
https://community.bistudio.com/wiki/assignAsCargo
something like,
{_x assignAsCargo vehicle player; _x moveinCargo (vehicle player);} foreach units goodGuys;
(and if necessary, enableSimulation false)
And even better use this
https://community.bistudio.com/wiki/assignAsCargoIndex
@astral dawn , that can be problematic depending on usage
I know but arma AI is all problematic, IIRC I've had some problems with the basic assignAsCargo and FFV seats as they would jump out sometimes, cant remember correctly any more
@hot kernel assignAsCargo doesn't work either, with enableSimulation it works but i guess there should be another way to avoid the behaviour instead of this. (Also the AI looks really dump with disabled simulation 😅 )
I use it here, where I need to keep track of seating,
passenger1 assignAsCargoIndex [vehicle player, 0];
@dry inlet what is happening wrong?
you don't actually have to disable anything just make sure they don't have a WP and they should sit and behave
oh-oh
I missed something
I thought I set those AI to enableSimulation false but they're not
it's just "CARELESS"
toggled to "AWARE" when they exit
and the added bonus for that is if engaged they will shoot back from mounted position-- inexplicably
As they're captives they're on civ side. so no WP or anything.
And normally with the disabled "MOVE" they shouldn't move anywhere or even get out of the vehicle
First I've thought it could be a locality fault, but it now runs with CBA targetEvent
What if you disable FSM?
doesn't work
okay, so instead of making them captive just make them civilians dressed as soldiers until they deploy-- then switch sides-- it seems like "captive" is the issue
I don't see why this wouldn't work,
goodGuys = [getPOS baseArea1, west, ["b_soldier_AR_f", "b_soldier_AR_f"]] call BIS_fnc_SpawnGroup;
goodGuys setBehaviour "CARELESS";
{_x assignAsCargo vehicle player; _x moveinCargo (vehicle player);} foreach units goodGuys;
I am sorry but have you tried orderGetIn true?
try orderGetIn true
assign as cargo
order get in true
move in cargo
and if necessary,
{_x assignAsCargo vehicle player; _x moveinCargo (vehicle player); _x setCaptive true;} foreach units
try this:
_unit setCaptive true;
[_unit] join createGroup side group _vehicle;
_unit moveInCargo _vehicle;
@astral dawn same effect with orderGetIn
@dry inlet , the solutions I provided all work. You'll need to explain the problem more precisely-- what isn't working?
they won't get in? they get back out? what is happening?
after the moveInCargo the unit sits like one second and will moveOut after that, without any command or something
make sure careless
Is your truck tightly packed? Like are they occupying all the seats or there are half seats free?
you could also lock the doors on the vehicle
Honestly this part of arma seems terribly broken to me, I have had so many problems with making units enter vehicles as cargo. Of course it works 95% of time, but sometimes they would start randomly jumping out or even leaving their group for no reason, into a group which I have not created myself.
Even although my code has had one total rewrite at some point, now you are also having this problem, I think it's dammaged inside arma
oh yeah this is really annoying, also it worked everything fine in SP but not in MP
And of course there is no way to make a repro for the issue I was having, as it happens very rare
@hot kernel the behaviour change works (until now)
Honestly this part of arma seems terribly broken to me
What AI? Nooooooooooooooo
Having them stuck by an obstacle is one thing, but unable to manage vehicle seats is something utterly unexpected...
next step will be to get the unit out of the vehicle... 😅
moveout _unit works from anywhere
{moveOut _x; unassignvehicle _x;} foreach units goodGuys;
unless you want them to try and get back in... 😄
yeah i know the commands, but i guess it'll be the same hell as the get in.... ^^
BTW thx to @tough abyss @hot kernel @astral dawn for your help
no moveout should work flawlessly
@astral dawn you have setEffectiveCommander now which is a biiiiiiiiiiiiiiiiiiiiig help if you want to manage vehicle roles
so... I don't see how it can help me
i dont see either because I have no idea what you doing
😄
@tough abyss , that is super useful
Ok so setEffectiveCommander is for the case when there is a player in a vehicle, right?
I think the important part is it doesn't require grouping
I still don't understand how is the way we manage vehicle roles now with this command different from the way we did it before, maybe I am missing something or never encountered some problem/situation?
I don’t even know what you tried that failed randomly so maybe we are talking about different things
anyone ever wrote some XML parser for SQF?
Are you up for making this GUI layout thing?
thinking about it right now
Hmm I was thinking about it today too
😄
Why do you need XML for that?
« Great minds think alike » hahaha
isn't there a BIS_fnc from TKOH for that?
Or... how would a GUI be described in XML?
check out XAML @astral dawn
HTML theoretically is also an example
java swing
long story short:
<dialog>
<panel margin="2">
<grid>
<column width="*">
<label>Enter ID:</label>
</column>
<column width="*">
<textbox/>
</column>
</grid>
</panel>
</dialog>```
could describe a most basic UI that contains a label and some textbox
surrounded by a panel
JSON ain't better then XML
it is just having a different use
for most cases, XML is absolute overkill in its feature-range
it's a markup language, like HTML... and not a transport language like JSON 😉
although if it's possible with JSON, it shouldn't be too hard to do the same for XML
unless the data is too big for sqf to handle
though ... JSON (JavaScriptObjectNotation) is more for raw data then for "transport"
unless the data is too big for sqf to handle
For our case (GUI) performance should not be limiting anything
well ... writing a proper, full support XML parser is pretty damn overkill
ommiting stuff like namespaces
managable
Still even if you make the XML/JSON/any other parser, there must be some code to manage these layouts for controls 🙄 (preferably an OOP code :D)
that is actually the smallest problem
OOP will make stuff simpler here though
the long story short in the end is: create elements top to bottom, set size bottom to top
@queen cargo perhaps this could help: https://community.bistudio.com/wiki/BIS_fnc_dbImportXML
in the core it's used to import .kml files from GoogleEarth (BIS_fnc_klmImport)
and although the biki says it's for TOH, the function exists in Arma
So how easier it will be to write gui in xml?
by hand already 10x easier... with a simple editor written in any other language (Java, C++, C#, NodeJS, etc.) 1000x easier
I can’t imagine how writing it by hand is easier
XML is easier to write than UI configs (IMHO)
If that was true the c++ classes would be all written in xml
already provided some example @tough abyss
easier doesn't mean more optimized 😉
If you refer to the example a few posts up, that is not an example, ui config contains a lot of params
i do refer to that
most dialogs just reuse existing settings with a lot of them being just attributes
all of them, can be mapped to XML
I won’t argue with you, but as I said I can’t imagine it being easier
And it seems like it might be quite ambitious project to undertake with questionable improvement over current way of writing configs
well .. it is :D
simply because the default UI system literally forces you to do the whole layouting in ugly ways
stuff like that you need to calculate the whole crap yourself etc.
whilst i do agree, if one only ever uses the dialog creator, the benefit is so neglectable ... that it just is not there
but for more complex UIs, this would just introduce industry standards
to be fair; there are already several tools available which can export UI configs, or even create them
https://discordapp.com/channels/105462288051380224/616327617725071373/621214763032117268
possible