#arma3_scripting
1 messages ยท Page 269 of 1
ui_f
^
imagine if BI documented IDCs
For what?
To find the exit button IDC
for making it easier to mod their game
Not absolutely everything must be documented.
Somethings are self-documenting
Its a thing of max 1min to find that button
how?
Dscha - Today at 2:06 AM
http://stefanstools.sourceforge.net/grepWin.html
grep'ing exit/quit/etc?
ffs... Why don't you just try it?
i hate this generation... instead of trying it, they ask for every fkn shit...
right
"Can i do this" - "Have you tested it?" - "Can i test it?" - "Why do ask me?" - "Can i ask you?"
Not even familiar, just some basic logical thinking and some thinking of your own. Its no mastermind needed :/
ok i'm sorry i don't spend every waking hour figuring out how to mod specific arma stuff
@jade abyss Not many people have learned the basic understanding of logic
Or "(re)searching"
One of the things need to be familiar with, development.
You become a googler
So much googling.
@rancid ruin Don't get me wrong, but:
oneoh - Today at 2:08 AM
grep'ing exit/quit/etc?```
This is the most stupid kind of question to ask. Instead of just searching for it first... You would get your answer for yourself, instead of asking if you could do it.
No realy, why didn't you just search for that kind?
+what Geeky said: Google. I bet there is min. 1 entry that will answer your question, if you type "Arma 3 IDC Exit button"
^
But.
You must understand the question to answer your question
I know thats a little circular but it is true
You can not solve a problem you do not understand.
If you are already familiar for IDC's and how they work
That will help.
Had a bad day? ^^
As well as how the config files actually work.
More than likely the definitions for the exit button are.
a "button class type" obviously.
Thats probably the class type it's defined as.
How can I delete and reload the P drive @jade abyss
I just realised it unpacked to my C drive...
:/
Even if not:
"Text=" is the important part. Every button has a Text, wich means: Every button has a text defined in its config, wich means: Every button has a text="StringYourSearchFor", wich means: You can find that particular putton pretty easy.
There should be something in the Tools, where you can define a Part for the P: Drive
Can I delete it the same way?
Yeah mine was meant to be D:
Nah, no need to delete
It went to C
Check the ArmaTools settings
(I don't have them installed anymore)
"Path to P Drive" Yeah, i think so. Just copy everything from C to that new Folder you defined
Nothing anymore. Used n++ before.
@jade abyss Doing what you said
then changing the dir
Broke the P-drive
Now it refuses to mount correctly.
Restart
Windows?
xD
@jade abyss thanks for the assist it wasn't that though
Derp you can't put your P drive in the D:\ root dir
It requires a seperate folder
Double derp
It would overwrite the D:\ drive
and be bad.
Oh my
Atleast windows didn't allow me to do it
XD
So windows I guess isn't as dumb as we think
It's unpacking all the data now.
Thanks again @jade abyss will make scripting and dev'ing much easier
I use a flashdrive as my working drive
o7 yw
Also @jade abyss is there a way to interface with the Dynamic simulation system?
Via scripting commands etc?
I reworked lots of things on my code systems to englobe simple objects just to notice right after that simple objects are very specific objects and need to be threated separatelly.
You probabily will never want a building with doors to be simple object.
is there a way to interface with the Dynamic simulation system? <- ??
Recent update added in dynamic simulation manager
What it does is doesn't simulate everything thats in the mission
Only what players are near.
No clue, haven't touched Arma for... about 4-5 Month's
So the simulation loop doesn't spend so much time on things it doesn't need to.
As with old arma 3. ALL vehicles, ALL Objects, ALL AI
is simulated by clients and the server
I don't do anything in Arma anymore. More or less retired. Just here to rant around ๐
Anyone else familiar with the new dynamic simulation?
I noticed I can set it on vehs.
Biggest problem.
Ask the same Q in about 10 Hrs again.
I want a scripting command to use it.
Is there any way to use arsenal and incorporate it into a mission? A mission like BECTI that is...where certain gear shows based on a team's upgrade level
also, has anyone gotten arsenal to load in a way that doesn't load the virtual space, and keeps you in the current space you're in
We use ALIVE
so it uses a virtual profiler
They need to do 1 thing @tough abyss
Make it internal engine command based
Just like the new garbage collector
addToRemainsCollector
Funny enough, this was added to the wiki yesterday https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation
Machine Gun Wars
Wait, that sounds like the stuff i was talking about 1-2 weeks ago oO
(just without caching it)
https://dev.arma3.com/post/sitrep-00181
Many of you got excited to see Dynamic Simulation in the Release Candidate build. Unfortunately, as we've expanded on its implementation quite a bit recently, the feature requires more testing time by our QA experts and we've decided not to include it in Update 1.66.
Good morning @little eagle !
oh boy
how can I make a checker that would createvehicle explosion if a player is found carrying a certain type of weapon in his hands? I have 2 weapons that I would need to "prevent" for players to use and punish them.
using CBA?
["weapon", {
params ["_unit", "_weapon"];
if (_weapon == WHATEVER) then {
// explosion
};
}] call CBA_fnc_addPlayerEventHandler;
Using vanilla? Probably a trigger testing currentWeapon player
@velvet merlin may I nuke our comments while adding
This command will return 0 Number if given object is a vehicle instead of a person.
to this page? https://community.bistudio.com/wiki?title=currentMuzzle
I seem to be able to
In SQF this "60000 mod 33" is more expensive than "600 mod 33"?
No idea, doubt it. You could check it with code performance.
Tested - no difference
@buoyant heath thanks a lot.
I have a counter that starts in 0 and receive + 1 each cicle.
Then it triggers something when "_counter mod _someNumber" return zero.
So its periodically triggers many things.
The counter can reach really big values, and if a want to reset it i need to reset it on the number that is Connom Minimum Multiple to not break any trigger cycle.
And this CMM is really big also.
Is this all an attempt to spread out the execution of code?
hi
Hey guys
@buoyant heath is to have many execution periods in just one loop.
So one execute when _counter mod 10 is 0
Other execute when _counter mod 300 is 0
And so on...
In this example "... mod 10" and "... mod 300" i can reset the counter to 0 when it reachs 300.
With "... mod 3", "... mod 5" and "... mod 7" i can reset the counter to 0 when it reachs 3x5x7=105
Or never reset it, but it will reach really high values.
@little eagle sure go ahead
@native hemlock BI messed up and parts of DynSim is in 1.66
ACRE is now open source! https://github.com/IDI-Systems/acre2
Advanced Combat Radio Environment 2 (ACRE2) for Arma 3 - http://acre2.idi-systems.com
@grizzled cliff huh, wasn't it already for a while? ๐
On this code:
_building setDamage 1;
_building setVariable ["needClean",true,true];```
The var "needClean" will be set on the ruins?
Check the details of _building after you demolish it.
Specifically the classname, I would venture to guess it will be ruins.
@grizzled cliff If only we could integrate ACRE as a vanilla product and call it "Advanced Communications"
@halcyon crypt Yea but this is officially now the case. ๐
@tough abyss Haha yea that'd be nice
@tough abyss thanks man!
Code performance now. Works in MP
Good evening guys, quick question
Anyone out there using Taskforce Radio, how u pre-setting radio channels with latest version of TFR?
was previously using tf_freq_west_lr = false call TFAR_fnc_generateLrSettings; tf_freq_west_lr set [2,["80.1","81.1","82.1","83.1","84.1","85.1","86.1","87.1"]]; doesnt seem to work now with new version
Essentially, I have an odd issue. I have moved a bunch of scripts to Server-Side, and I can call this perfectly fine, but when I put it in my add action it doesn't do anything. It appears, but when I click it it does nothing. The function is life_fnc_bankteller , as I said works perfectly fine when called in console. The add action is = init="this enableSimulation false; this allowDamage false; this addaction [""Bank Worker Sign Up"",call compile life_fnc_bankteller];";
@vale hull Not certain bud, never messed with the default radio channels personally.
addactions are local, you will need to remoteexec it to server if you want it to run on the server
Sorry, that was one of my tests
The addaction is init="this enableSimulation false; this allowDamage false; this addaction [""Bank Worker Sign Up"", life_fnc_bankteller];";
All functions are precompiled via precompilelinenumbers
Sorry, I may of got mixed up. Big project, let me double check.
Okay, sorry. Thats how our InitFunctions are called. Our algorithm makes them all public variables and compiles them. Is it failing to compile the only possibility if the script works when calling in console vs. Addactions?
Our other functions in the algorithm is compiling and working via add action, so it's odd
@vale hull
#define RADIO_SW_FREQUENIES [[1,"41"],[2,"41.1"],[3,"41.2"],[4,"41.3"],[5,"41.4"],[6,"41.5"],[7,"41.6"],[8,"41.7"]]
#define RADIO_LR_FREQUENIES [[1,"70"],[2,"71"],[3,"71.2"],[4,"72"],[5,"73"],[6,"74"],[7,"75"],[8,"76"]]
player addEventHandler ["InventoryClosed", {
if (call TFAR_fnc_haveSWRadio) then {
{
[call TFAR_fnc_activeSWRadio, _x select 0, _x select 1] call TFAR_fnc_SetChannelFrequency;
} forEach RADIO_SW_FREQUENIES;
};
if (call TFAR_fnc_haveLRRadio) then {
{
[call TFAR_fnc_activeLRRadio, _x select 0, _x select 1] call TFAR_fnc_SetChannelFrequency;
} forEach RADIO_LR_FREQUENIES;
};
}];
Thats what I use for my group
@tough abyss Wrong chap, Look above @vale hull
Oops
Thats my pre-programmer attached to an EVH
As soon as you press I for inventory
It sets all your radios
Alright, one sec, let me give it a try
Crashed my dev server, it didn't like single quotes XDD
thanks @tough abyss will use that if i cant find the config to do it
i think can do TFAR_defaultFrequencies_sr_west = ["310","320","330","340","350","360","370","380","30.6"]; TFAR_defaultFrequencies_lr_west = ["84.4","31","32","33","34","35","36","37","38","30,6"]; now but need to test
Remember the script has to actually be executed
@tough abyss Already fixed the problem. It's because we are running the functions through the compiling algorithm and not the actual cfgFunctions which is what the addAction is configured to look for (currently addAction ["function",fnc_function] we changed to addAction ["function", { spawn fnc_functionl }])
I was just at school and didn't have time to change it to my new system before I left lol
which is what the addAction is configured to look for
pretty sure it's just a race condition, but w/e
Hey, it didn't work before, now it does. So whatever ye. xD @tough abyss what @tough abyss said.
In the end it actually increased all the load times of our crap a ton and stopped all our script lag where it occured
ended up quite well (occured in the first instance because of bad scripts that other people made) but it also meant people can't just steal my crap anymore
They can but it's harder
As in, idiots can't steal it
by just copying the missin
sniffsniff I smell life in here sniff
Well, they can, but at least I have the satisfaction of knowing someone actually had to try ๐
How would I execute it though if it was outside? (just like a normal mod I assume?)
@tough abyss
Thanks a ton, I've only just got into serverside scripting other this weekend
Kinda new to it but it seems to be a lot better than clientside
yeah
ah
Not rly, can be screwing up the bandwith if you overdo it (e.g. Yellow/Red Chains, Lags when ppl connect)
I guess we'll see how it goes, we are paying quite a good server tho
The question is: Is it rly needed? Worth the effort?
99% of the cases: Don't think so.
Exactly.
The main reason we are doing it is to keep a few hostile people away from our files
and then?
We don't want to get our crap ripped instantly. We are ok with it after awhile tho
I don't think it should overstress the server, we have 64mb RAM, a crap ton of bandwidth and a really powerful CPU
Its not "overstress" the Server, read what i wrote before.
You can have a 1GBit connection and still: Ppl can lag around like a rubberband in the hand of a kiddo
and if your Server is not properly setup -> all other Clients, that are currently connected, can feel that lag.
(even with proper setup, lag can occur)
w/e
Also a way to get rid of goddamn mission updates that give _CUR_MP.pbo errors
The ammount of people who don't know how to fix that is a absolute pain!
"I don't think it should overstress the server, we have 64mb RAM, a crap ton of bandwidth and a really powerful CPU". Holy shit 64mb of ram. :O hehe
some deditated wam
Raspberry Pi Mini I guess
Never the less, it is more secure, if you understand to use battle eye .. however, we all know.. battleye isn't perfect
hi can i use publicvariable just for one side for example i have testvar = 1; for independent and testvar = 30; for west ?
maybe with
testvar = 30;
{
if (side _x isEqualTo west)then {
_x publicvariableClient "testvar";
};
}foreach playableUnits;
?
publicVariableClient takes a client ID, not an object. Convert with owner (only works on servers)
Another option would be just to have a function that set the variable, then you would remoteExec it only on one side
okay because i want a persisten variable for one side
so i am not sure what to use
remoteExec would likely be better since it is JIP compatible and persistent
okay thank you ๐
which number do i need to use with remoteexec to execute it just serverside ?
yeah sorry havent seen it ^^
server ID is 2
Has anyone discovered a way to remap keybinds for cameras used by spectator modes like EGSpectator, etc... ? The underlying camera used is CamCurator, though I haven't noticed a way to hook into keybinds for that type of cam.
The hardcoded values aren't ideal for some Intl layouts.
Is it possible to make a dialog that will dynamically rezise itself based on how much text is inside it? E.g.: dynamically resize the height value?
@tough abyss np
@thin pine I just made myself look like such an idiot hahahahaha
@rotund cypress Depends.... If you are making it show text then yeah. The box will resize with text.
Just enable Simulation true
I believe will do it
You can always manually change the size @rotund cypress
But it's a replacement for hints @dusk sage
And thank you @cerulean whale It's two controls: title and then text
Does anyone know any ways of forcing someone's (ingame/profile) name to something apart from kicking them and asking them to change it?
can someone explain me CT_XLISTBOX=42 ? i want a listbox like this:
https://community.bistudio.com/wikidata/images/6/68/WuChaoRen_ctXListBox.png
And how can i fill it ?
Whats the little snip of code to load a dialog in from a mission already, I used to know how, but it's been ages since so I forgot and can't really find it anywhere
Hello, #arma3_scripting! If anyone has time to explain how to save player data to a database on a server i would appreciate it. What i am trying to do is save player inventory and also have a "personal safe" that will be backed up and accesible in multiple missions.
I doubt that it's explainable in a Discord setting.. Review DayZmod or any of it's clones, Exile, A3 life probably, ALiVE, etc
Look into extDB3 @sharp jay
@BoGuu#1044 I did and i could not understand it, but i will look harder. Thanks
As marcel said, use those as examples
okay the problem with the listbox i figured out. now my next problem is how can i set the active color of the lb ?
No idea anyone ?
@halcyon crypt Thanks, but i dont help me because the problem is still it will not set the color if i use lbsetcolor or ctrlsettextcolor. nothing of it works. maybe theres another way to do this
now it works with lbsetselectcolor
๐
How many of you guys actually write your pseudo code before coding?
I've noticed if I do it often turns out better than wing-ing it coding.
i kinda do yeah. i lay out the bones of it, do comments, then flesh it out after
not sure if it results in better code for me, but it saves time
I usually stay one down from pseudo code, if you will. I either go straight into it, or write a bare bones structure out
Usually file format
I've been trying to work with I&A's code for the past hour
And resulted to just gutting 90% of it and re-writing it.
@rotund cypress I've just done the exact same thing xD
How does the path to #included macros work?
Did you get it working with resizing the dialog?
@dusk sage Problem is when I attempt to include the file
from a specific folder
Arma goes nope
Can't find it.
does setButtonAction have any benefits over ctrlSetEventHandler'ing the button instead?
as far as I can tell, you can't tell what ctrl the button press originated from with setButtonAction, or am I missing something?
there is no setButtonAction
there is buttonSetAction though, and it's from the OFP/SQS era. You should probably forget about that one ๐
either use the action property in the config or use the UI EHs, IMO
buttonSetAction yeah sorry
wiki says it only allows SQS but SQF seems to work no problem. i would use configs but all the displays/dialogs are created via script
14:33:48 Server: Object 2:3895 not found (message Type_121)
rpt flooded with these any ideas?
think that's some kind of locality issue
trying to do stuff on a non-local object?
that was my fear so you kinda confirmed it thanks
@cerulean whale Did you get it working with resizing the dialog?
If I want to return a name of a player that is in a vehicle on my cursor, how would I do that? I tried name vehicle cursorTarget but that did not work
get the crew then get the name i guess
name (crew vehicle select 0) or something i'd say
ah ok thanks
What is the best command if I want to check a vehicle type? I tried cursorTarget isKindOf getArray ["Tank","Helicopter"]
also typeOf cursorTarget in ["Tank","Helicopter"];
E.g: If it is either a Heli tank or car I want the statement to be true
I tried all sorts of commands but it aint working,.
getArray is for returning arrays from cfg entries
((cursorTarget isKindOf "Tank") || (cursorTarget isKindOf "Helicopter")) should work
or something like typeOf cursorTarget in ["Tank", "Helicopter"]
I did typeOf cursorTarget in ["Car", "Tank", "Helicopter"]; pointing at a prowler but it returned false
cursorTarget isKindOf "Tank" || { cursorTarget isKindOf "Helicopter" }
So there isnt any way of getting it in a array to make it cleaner ? @tough abyss
typeOf returns classname actually
ye
so that won't work
if ( ( count _veh_list ) > 0 ) then { ... };```
Also does airplane name return true for the ceasar and all jets?
So like cursorTarget isKindOf "Airplane"
you can use nearEntities instead of nearestObjects for alive-only vehicles.
oh yeah
I wish there was a list of the generic names on the wiki (plane, tank, etc)
yeah
what, a class name list? there is
There's this: https://community.bistudio.com/wiki/Arma_3_Assets
Or you can open the config viewer and check out the class hierarchy
So an airplane would just be Air I guess?
I think so.
"Air" is a class which "Helicopter" and "Plane" both inherit from
yeah
Another question. I've been looking for the case code for key ยง on my keyboard. Does anyone know what key code that is?
I checked all lists but couldnt find it
create a handler for keycodes, make it log/hint the pressed key, press the key, note down output
Here's a good list https://resources.bisimulations.com/wiki/DIK_KeyCodes
Yeah checked that one but added an eventhandler instead in debug which logged what key I pressed instead as @rancid ruin mentioned.
Thanks though!! ๐
what kind of keyboard has a section key anyway?
i'd have to press alt + a load of numpad numbers to type that character
Nordic? @split coral
yes
Okey maybe thanks for the input. Ill use another key then
hey how can i get the display image of an object like a roadbarrier ?
"display image"?
the jpg from 3den?
getText (configFile >> "CfgVehicles" >> typeOf _barrier >> "editorPreview")
I guess
yeah thx. but i think there are other pictures like the chemlight picture. need it for an inventory item
you said road barrier
replace CfgVehicles with CfgWeapons and editorPreview with picture
and remove the typeOf ofc
yeah i want to have it in my inventory and creating for that my own inventory item. but now i need a displaypicture
you can check all this in the ingame config viewer
thx
will this work if target is a player? _vehiclePicture = [getText (configFile >> "CfgVehicles" >> (typeOf _target) >> "icon")] call BIS_fnc_textureVehicleIcon;
Type "Man" vehicle I guess?
@little eagle Does arma 3 not like you putting macro definitions in non-root folders?
@tough abyss i'm 100% sure that your include path is wrong
cuz i use macros a lot. And take a look at Altis life, macros everywhere
relative path:
#include "script_component.hpp"
path from root:
#include "\x\cba\addons\main\script_macros.hpp"
note, leading slash = root, no leading slasg=relative
I think C++ uses <path> vs "path" for this, but in Arma both quote marks and triangles do the same
the "\x\cba\addons
part is from pbo prefix:
x\cba\addons\COMPONENT
leave that out if you don't use it and use the BI tools instead
#include "\Mission Framework\shared\mission_script_macros.hpp"
Inside of a file that is not in the same directory as shared
It complains that the mission_script_macros.hpp don't exist.
"Mission Framework\Library\Setup\fn_setupEnemyInfantry.sqf"
Is the directory I'm including from.
@little eagle
#include "shared\mission_script_macros.hpp"
Also tried that.
Still no go.
Complains it doesn't exist
crashes arma 3
description.ext?
Does it have to go into the description.ext as well?
No it's not in the description.ext
I't included inside this file.
//---------- CONFIG
#include "shared\mission_script_macros.hpp"
params [
["_marker",""]
];
//---------- INFANTRY PATROLS RANDOM
for "_i" from 1 to PARAMS_GroupPatrol do {
tickInGrp = diag_tickTime;
_patrolGroup = createGroup east;
_randomPos = [[[getMarkerPos currentAO, (PARAMS_AOSize)],[]],["water"]] call BIS_fnc_randomPos;
_selectPatrolType = selectRandom [INF_TYPE];
_patrolGroup = [_randomPos, EAST, (GRPSCLASS >> _selectPatrolType)] call BIS_fnc_spawnGroup;
[_patrolGroup, getMarkerPos currentAO, 400] call BIS_fnc_taskPatrol;
_enemiesArray = _enemiesArray + [_patrolGroup];
{
_x addCuratorEditableObjects [(units _patrolGroup), false];
} foreach adminCurators;
};
tickOutGrp = diag_tickTime;
diag_log format ["Groups intialisation completed in %1",tickOutGrp - tickInGrp];
GRPSCLASS is the group superclass
where is this file?
what path is this file?
And "shared" is inside "Setup" ?
No.
then it won't work
Shared is inside this folder.
which one?
that is a file and not a folder
#include "..\..\shared\mission_script_macros.hpp"
use this
can't use root path for missions
but you can use parent folders I think
No crash thats a good sign
I heard something about .. not working in missions
no idea
but yeah. can't use the absolute path for missions
at all
outside of description.ext you can, but it uses the addon root
and description.ext and all includes files straight up crash the game
the server at least when changing missions
I think the first mission works or something. really weird and broken
So how does arma 3 parse this?
#include "..\..\shared\mission_script_macros.hpp"
What does it basically look for?
Yes
you're allowed to have spaces in the file path?
but did it include the file?
I remember it wasn't working in the missions for security purposes (so you can't reach out of the game files of people that joins your server and downloads the mission)
Maybe it is allowed with addons, I don't know
Interesting question
Do variables need to be initialised?
before being used?
e.g delcared?
no, but it's good practice to define a home scope for them
which almost looks like you're doing the same
private ["_pos","_i","_position","_flatPos",
"_roughPos","_targetStartText","_targets",
"_targetsLeft","_unitsArray","_radioTowerDownText",
"_targetCompleteText","_regionCompleteText",
"_null","_mines","_chance"];
eastSide = createCenter east;
enemiesInf = [];
enemiesVeh = [];
//---------------------------------------------- AO location marker array
// Disabled fobs.
// ["FOB_SE","FOB_SE_Hmv","FOB_SE_Hmv_1","FOB_SE_LZ","FOB_SE_Repair","FOB_SE_Medic","FOB_SE_Fuel","FOB_SE_Ammo","FOB_SE_APC","FOB_SE_Supp"] execVM "mission\Fob\FOB_Main.sqf";
//----------------------------------------------- AO MAIN SEQUENCE
_target = [] call MM_fnc_buildLocationsPosAndNameMain;
AOMarker_IDs = _target call MM_fnc_createMissionMarker;
currentAO = AOMarker_IDs select 0; // Return Primary marker
AO_String_Name = _target select 0;
sleep 1;
//------------------------------------------ Spawn enemies
enemyInfs =[currentAO] call MM_fnc_setupEnemyInfantry;
// enemyInfs = [currentAO] call MM_fnc_setupEnemyVehs;
enemiesInf pushBack enemyInfs;
// enemiesArray pushBack enemyVehs;
Complains that enemyInfs is undeclared.
#include "..\..\shared\mission_script_macros.hpp"
params [
["_marker",""]
];
//---------- INFANTRY PATROLS RANDOM
for "_i" from 1 to PARAMS_GroupPatrol do {
tickInGrp = diag_tickTime;
private _patrolGroup = createGroup east;
private _randomPos = [[[getMarkerPos currentAO, (PARAMS_AOSize)],[]],["water"]] call BIS_fnc_randomPos;
private _selectPatrolType = selectRandom [INF_TYPE];
private _patrolGroup = [_randomPos, EAST,GETUNITCLASS(_selectPatrolType)] call BIS_fnc_spawnGroup;
diag_log format ["_patrolGroup :%1",_patrolGroup];
[_patrolGroup, getMarkerPos currentAO, 400] call BIS_fnc_taskPatrol;
enemiesInf = enemiesInf + [_patrolGroup];
diag_log format ["enemiesInf: %1",enemiesInf];
{
_x addCuratorEditableObjects [(units _patrolGroup), false];
} foreach adminCurators;
};
tickOutGrp = diag_tickTime;
diag_log format ["Groups intialisation completed in %1",tickOutGrp - tickInGrp];
Even though I add a value to it
then diag_log it out
It exists.
Should I declare enemyInfs?
see if it fixes it?
Or should I just use setVariable and give it a default var?
Might try that.
I have no idea, it's too late.
"enemiesInf: [O Alpha 1-3,O Alpha 2-2,O Alpha 3-1,O Alpha 3-3,O Alpha 4-2]"
See returns the AI
even spawns them.
No, the keyword. params is for _this or other arrays
private _var = stuff;
Use private keywords for the rest
^
^^
Oh the legacy code.
the private ["_array"];
Thats old It's being phased out if you look in 1 script
you wanted advice about variable names?
Wonder if pushBack doesn't work on global arrays.
It does work
having both _pos and _position is horrible
Hehe
What should I do instead?
enemyInfs =[currentAO] call MM_fnc_setupEnemyInfantry;
I'm sure you can work that out
I think this line just assigns nil
MM_fnc_setupEnemyInfantry probably reports nothing
Yeah thats what I saw.
It should be returning as the global var
inside that function gets updated.
ohhh derp...
Huh
facepalm
๐
@meager granite Are global variables still alive when a script finishes?
When an object is destroyed do all setVariables to that object get null'ified?
like setDamage 1 or what?
Damn event handler not firing...
Why?
Radio-tower gets destroyed but the EH is not firing.
Why particularly reason why?
Previous tests it worked perfectly.
Ah k.
@tough abyss What can prevent an EH from firing?
params [
["_object",objNull],
["_state",false]
];
missionNameSpace setVariable ["towerDestroyed",false,true];
diag_log format ["_object: %1",_object];
_HandlerID = _object addEventHandler ["killed",{
diag_log "Handler executed";
/*
missionNameSpace setVariable ["towerDestroyed",true,true];
diag_log format ["towerDestroyed: %1",towerDestroyed];
[] spawn {
waitUntil {
sleep 10;
(towerDestroyed && ((east countSide (enemiesInfs)) < PARAMS_EnemyLeftThreshhold))
};
};
private _aoClean = [enemiesInfs] spawn QS_fnc_AOdelete;
private _MarkersClean = AOMarker_IDs spawn MM_fnc_deleteMissionMarkers;
waitUntil {(scriptDone _aoClean) && (scriptDone _MarkersClean)};
*/
}];
diag_log format ["_HandlerID: %1",_HandlerID];
_object removeEventHandler ["killed",_HandlerID];
Doesn't even register firing.
...
Might have just noticed the issue
Yep that was it.
Holy cow
My EH based objective system is flawless
Everything works.
wasn't it not working properly about 20 minutes ago?
are you sure you've tested it thoroughly?
No it was a problem with the EH not firing
Was related to me attempting to call it and expecting a return from an eventhandler
without explicitly providing one.
More fool me.
Codes lightning fast tough.
though*
so you're using EHs to control mission flow and track objectives?
towerDestroyed is just a single global var? not attached to an actual tower object?
Nope as I had a problem
setVariables on local objects
are destroyed when the object is destroyed.
Or are they?
i would guess that setdamage 1 would not destroy the var, but deleteVehicle'ing the object definitely would
that's just my assumption though. wouldn't take long to test
what i'd do is just create a logic/location of a specific type, at the position of the tower, and store all vars on that
locations are good shit
Best thing about my EH?
I can re-use it for any mission flow
that involves blowing things up
I can also probably ditch BIS_fnc_randomPos for
selectBestPlaces
with an accurate of 100
precision*
selecting interesting and suitable random positions is always a bit of a struggle
selectBestPlaces will scan for specific expressions
someone always spawns inside a rock or some shit
i've used that, it's generally good but not 100% reliable
One good rule I've noticed works
is spawning AI on roads.
Using a small scan distance per cycle
yeah that's reliable but not so versatile
And randomising the selection of the road.
using selectRandom
I'm incremental debugging right now.
I've gutted large bits of I&A's code.
I doesn't even look like I&A anymore.
I've seperated spawning into 2 seperate systems
1 for vehicles 1 for infantry
Infantry is executed first as 2 operations are not necessary for it.
was I&A's code bad to begin with?
I would say, yes and no.
It definitely could have been far far more efficient.
I'm assembling components piece by piece.
EH based mission flow is extremely efficient.
As it indepdently can now manage the AOs in sync?
Why? because I can literally execute them all in parallel
And not have to update them inside a loop
There is no code watching them or while {true} do {}ing
Which is utterly dirty in my opinion
Is there a cleaner way to do this?
for [ {_i = 0}, {_i < count(paramsArray)}, {_i = _i + 1} ] do {
call compile format
[
"PARAMS_%1 = %2",
(configName ((missionConfigFile >> "Params") select _i)),
(paramsArray select _i)
];
};
Oh
I can micro-optimise here and improve readability
for "_i" from 0 to count(paramsArray) step 1 do {};
i couldn't tell you right now, it's too late
it's certainly not very readable though...call compile format never is
getMissionConfigValue [attribute, defaultValue]
Last time I tried this it had problems
ask commy tomorrow and he will solve it with a 1 liner
Don't use that syntax in for loops, use the one you posted after (you can omit the step 1). Also, use missionNamespace setVariable instead of the call compile
@tough abyss
?
Example?
That codes not mine
It's I&A's
I just wanted a better way to do it.
What is that code for? I'm drawing a blank on understanding it.
Parameter initialisation
Does this.
for "_i" from 1 to PARAMS_GroupPatrol do {
for [ {_i = 0}, {_i < count(paramsArray)}, {_i = _i + 1} ] do {
call compile format
[
"PARAMS_%1 = %2",
(configName ((missionConfigFile >> "Params") select _i)),
(paramsArray select _i)
];
};
Takes the Parameters name an data
and assigns it to a global variable
doesn't the 1st example here do exactly the same thing https://community.bistudio.com/wiki/missionConfigFile ?
Use missionNamespace setVariable [..]
it's just taking vars from mission cfg entries and making them global vars in mission namespace right?
Thats it.
Call compile is not good for performance, definitely don't want to loop it
I figured as much.
i just downloaded I&A source and i'll say: if you're re-doing the mission, compress or remove the sound files
there's 1.2MB of oggs here which is a lot of filesize for little value
3
No I have I&A 2
I didn't like a lot of things in I&A 3 and 2
E.g mod-server-side componenting everything.
So no-one can look at the source code.
Although last I heard, people can just hack it anyway.
And if I want to be lazy.
for "_i" from (0) to ((count paramsArray) - 1) do {
missionNamespace setVariable [toUpper(configName ((missionConfigFile/"Params")) select _i),
paramsArray select _i];
};
https://community.bistudio.com/wiki/getMissionConfigValue Doesn't that simplify things event further?
Parameters for my mission are in a .hpp
it looks like a pretty simple mission code-wise, that gives me more faith in my future mission making
Ah, yeah, that makes sense
I&A?
Yeah it's simple
But half the code I've gutted.
Been assembling pieces as I need them.
it's all way more simple than any of the wasteland missions i've looked inside
i've got some kind of leper P drive
it's set up but i'm always low on SSD space so half the data isn't there
Yeah read BI's functions
and open ACE3s source-code
and CBA's
Much to learn from that.
Much more than Altis Life or Wasteland
ye, i'm more interested in the mission flow part
Most of BI-missions I've found
use FSMs
For mission flow.
params [
["_object",objNull],
["_state",false]
];
missionNameSpace setVariable ["towerDestroyed",false,true];
diag_log format ["_object: %1",_object];
_HandlerID = _object addEventHandler ["killed",{
diag_log "EH Fired";
missionNameSpace setVariable ["towerDestroyed",true,true];
diag_log format ["towerDestroyed: %1",towerDestroyed];
[] spawn {
waitUntil {
(towerDestroyed && (count (enemiesInfs)) < PARAMS_EnemyLeftThreshhold))
};
private _aoClean = [enemiesInfs] spawn QS_fnc_AOdelete;
private _MarkersClean = AOMarker_IDs spawn MM_fnc_deleteMissionMarkers;
waitUntil {(scriptDone _aoClean) && (scriptDone _MarkersClean)};
};
}];
Thats my entire system watching the radio-tower
I can even hook the side missions into that code.
I have intentions of making that into a generalised function
where I can set the state.
and name the "setVariable" anything I want.
Feel free to use it.
Garbage collector is next.
This mission works partially
AI gets deleted
Main AO initialises correctly.
There is some tiny bugs left here and there.
and the BIS_fnc_notification I might do away with aswell
and integrate into the new BIS_fnc_setTask system
@rancid ruin Some advice.
I learned from code.
Incremental debugging.
You can always start with the skeleton and say oh I'd like X feature.
And add it later.
ye, i'm not a noob, been scripting since arma 2
just haven't released any proper missions yet. got a shit load of miscellaneous functions and addons i've made which will hopefully materialise in to something one day
MouseButtonClick EH isn't functioning as I expected. it fires straight after mouse down, rather than firing after mouse down + mouse up
_yo = [] spawn {
disableSerialization;
private _parentDisplay = (findDisplay 12);
waitUntil { !(isNull _parentDisplay) };
_ctrl = _parentDisplay ctrlCreate ["RscButton", 6557];
_ctrl ctrlSetPosition [SafeZoneX + (15 / 1920) * SafeZoneW, SafeZoneY + (795.25 / 1080) * SafeZoneH];
_ctrl ctrlSetText "default";
_ctrl ctrlAddEventHandler ["MouseButtonDown", {_this select 0 ctrlSetText "down" }];
_ctrl ctrlAddEventHandler ["MouseButtonUp", {_this select 0 ctrlSetText "up" }];
_ctrl ctrlAddEventHandler ["MouseButtonClick", {_this select 0 ctrlSetText "clicked" }];
_ctrl ctrlCommit 0;
};
can someone test that? it adds a button to the map display
click and hold on the button, mouse away from the button, mouse up - that shouldn't fire clicked EH like it does, right?
hey guys, how can i make my inventory items (mods) useable. cant find it out. heard something with EVH but i dont know how i can use them in my mod (config)
Do you mean like double clicking or having a dropdown menu on items in the inventory?
Google brought me this: https://forums.bistudio.com/topic/151006-interaction-with-inventory-items/#post2453193
@indigo snow yeah but how can i connect these script in a mod ? in a mission i have my init and so. but how can i do this in mods ?
Mods can run scripts too. I myself use CBA stuff but I believe simply putting an init.sqf inside the pbo works.
okay thx i will try it
Config cpp. Cfgfunctions function with preInit or postInit attribute set to 1. Whatever file that you designated in that function will then be automatically run either before or after init sqf
I've never seen init.sqf in a mod. I doubt that'd work
Find the wiki page on cfgfunctions
Ah yes id recommend using cfgFunctions as well, forget about the init attributes.
There are any way to know if the player is in the green areas of the map (florest).
Does "surfaceType" do anything useful?
Yep, afaik the only command that returns that.
Hi all! Do you guys have suggestions to select the shortest distance between a player and a list of objects?
Thanksยฌ
@stoic sphinx iterate through the array of objects and always check whether the current object is closer than the closest
If yes, make it the closest one
If not, continue iterating
If the closes object is null (not set yet), make the current object the closest
Thanks for replying! That's the method I'm currently using, but I need something "faster". Is there anything more efficient?
(I'm making a zombie script, and a dozen zombies using that method is not very effiecient)
How often are you checking the distances BobbyDot?
every second.
That's probably unnecessarily often.
@tough abyss I disagree, sorry lol
@buoyant heath I have tried every 2 seconds, but then zombies start hitting players too early when he's moving
@tame portal k, it'll do for now
Obviously there's nearestObject
Zombies look for targets within 100m
nearestObject has a limit of 50m max. Zombies give up the chase too early if the players Sprint
nice suggestion though
Well then check which method is faster
Zombies shouldn't hit someone unless they are locked onto the player, and this lock on check can run in Greater intervals than 1 second
If a player is locked on, use a smaller interval for distance checking of the target
Basically a hybrid
If a player is locked on, use a smaller interval for distance checking of the target
+keep one thing in mind: Walls/Doors/ThingsThatShouldBlockIt
( e.g. making a check with LineIntersectSurface if Player)
@jade abyss I'll consider it if I want stealth, but for now zombies will detect you immiedietly ๐
For CloseRange (>5m range)
Otherwise they would detect a player through a housewall, for example.
Means: Just executing the LineIntersectSurface check when <Xm Distance to player
If <X -> Execute Attack
Just a friendly reminder
anybody know where i can find a wasteland mission outside of a pbo so i can look at the scripts?
NP enjoy your viewing/learning session, lots to grasp
camera_update_target
"camera" used as tag ๐ฆ
For checking minimum distance, selectMin might come in handle for a quick one or two liner
example?
More commands , more stuff to choose from. But I don't see much utility in this one particular
array of objects -> array of distances -> selectMin, select from objects. On phone though
how would you do that?
I posted one the other day. Only downside was using find, which wasn't too bad
Yeah, I see
Might be a neater way than find though
make a new array with apply of the distances to origin
๐
and pick from the objects array the index with the lowest distance
Yeh
Certainly a neat way, no idea what the total performance would look like. For large arrays, might well be better
true
those should be the slowest part of all of this
but it's still better than sorting
You'd have to know about selectMin engine side
Probably just a normal O(n) operation
Yep
I found one minor problem with these commands:
Wiki says: Other non Number elements are also permitted, but their value will be treated as 0.
But if you use anything other than a number or booleans in the array, it prints:
Bad conversion: scalar
into the RPT
mixing booleans and numbers is also weird, since when you have a 0 and false in your array, it will pick the leftmost one
I hate those errors that don't appear on screen and only in RPT when talking about scripting
also, it should not treat them as 0
but instead either just ignore them or error
now it treats them as 0 and errors off screen
worst case scenario
also
selectMin [nil,1]
-> nil
assignedTeam player reports nothing when you remote control a drone or via zeus
ยฏ_(ใ)_/ยฏ
currentWeaponMode reports a number 0 when used on vehicles
@dim owl https://forums.bistudio.com/topic/199230-enhanced-arma-3-inventory/ < check github link for code
@dusk sage Using selectMin for distance check now ^^ . It's halved the run time of my last mthod
_distanceArray = [];
{_distanceArray pushBack (_x distance _unit)} forEach _targetArray;
_item = _targetArray select ( _distanceArray find (selectMin _distanceArray));
//_unit => The zombie
//_targetArray => Array of players, which zombie wants to eat
//Speed is around 0.006
//Or 0.06, I can't remember which
//Using debug console's performance testy thing
//_item gives the player who closest to the zombie
You can populate a distance array with apply
_distanceArray = _targetArray apply {_x distance _unit}
etc
Apply? What is this wizardry XD
basically what you wrote with that forEach and pushBack thing, but less words
@tough abyss thanks man! I'm doing a simple radar and it have different efficience if the object is in a florest or if there is terrain beetwen radar and object
Anyone knows where the screenshots are saved when using BIS_fnc_exportCfgVehicles function?
My Documents\Arma 3 or Arma 3 - Other Profiles depending on if you're using the default player profile or a custom one. Then it's in a folder called Screenshots\EditorPreviews
That's for https://community.bistudio.com/wiki/BIS_fnc_exportEditorPreviews
https://community.bistudio.com/wiki/BIS_fnc_exportCfgVehicles is similar, but slightly different
Ehm..
Last time I checked it was using a command that is no longer available to take screenshots
@native hemlock exactly, that is diag_screenshot, but now it can be changed to "screenshot" I think, let me check if It can be fixed..
Yeah that should work, I did something similar
@native hemlock Ok, I can confirm It works like acharm ๐
you can do if !(...
the !equalTo could work, but im not sure, blame arma
() will fix everything
Nope brackets don't fix it.
!(_something isEqualTo _somethingElse)
#define AIR_TYPE "O_Heli_Attack_02_F","O_Heli_Attack_02_black_F","I_Heli_light_03_F","O_Heli_Light_02_F"
tickStart = diag_tickTime;
_pos = getMarkerPos (_this select 0);
_ParamName =
_enemiesArray = [];
_x = 0;
// Spawn Light vehicles first.
_localParam = missionNameSpace getVariable [format ["PARAMS_%1",],""];
tickStart = diag_tickTime;
for "_x" from 1 to PARAMS_AAPatrol do {
tickInAA = diag_tickTime;
_AAPatrolArray = [3,_enemiesArray] call MM_fnc_createVehicles;
sleep 1;
diag_log format ["Is this scheduled environment: %1",canSuspend];
if (_x == PARAMS_AAPatrol) exitWith {};
};
Ha!
1 function to do it all
Spawn any vehicle I want after passing PARAM name.
๐
There goes another big slab of code from I&A
Still being re-written
yea
sorta similiar
it's a mod for Optre there's a commander slot that allows players to use Zeus
Is there a way to replicate the effect of the ordinance module from a script? I'm Trying to create a rocket barrage, but I want them to fall sort of randomly,
if i try creating a bunch of randomized timeout triggers they seem to bunch up and all drop in waves.
Can't seem to find much information about how to use the 230mm rocket module other than syncing to triggers,
I want to have about 20 rockets drop over 20 seconds, but if I use timeouts, even manually they keep grouping up and I have like 2 or 3 groups.
I had a script that I used for a mortar barrage, but it involved spawning the mortars at ground level, you get the explosions, but you don't get the rocket trails which is what I'm most interested in.
Could just have rocket artillery fire them and space the firing out as needed?
i have a barrage script you could change to fire 1 rocket each second or something with 20 rockets all up
@sweet raft would it be possible to get those sources retrived by scripting command too? "Added: New "engineTemp", "wheelsTemp" and "turretGunTemp" vehicle animation sources "
๐
๐ STOP ๐
I think Dscha doesn't want more commands
yeah he's definitely not stopping @sweet raft from fleeing.. ๐
I just wanna stop... exactly ๐
if (!!!!true) then {systemChat "Holly cheeese!";};
hey guys have some way to verify two arrays with same values but not same sequence like _array1["one", "two", "three"] - _array2["three", "two", "one"] ?
Huh ๐ค ?
:^)
i have two arrays with same values but not same sequence
so if i use _array1 == _array2 not work
becase is not "equal'. but have the same values but in different orders
I guess this could work for == -> if (({!(_x in _array2)} count _array1) == 0) then {};
not sure if you can exit the count early as soon as something isn't in _array2 (to avoid unnecessary testing)
Would also not take into into account duplicates @halcyon crypt
true
I seem to remember it was possible to exit out too, it came up the other day
Can't quite remember
_array1 sort true;
_array2 sort true;
if (_array1 isEqualTo _array2) then {};
๐
๐
ty guys ๐
you should probably test the length of both arrays before using the sort method for performance reasons though
with count right?
yep
anything for name buddies ๐
hahaha
How does one create a script addon?
what?
Have addon with CfgPatches entry in config, addon path prefix ($PBOPREFIX$ if you use cpbo for packing) and any script files you want
Then access them by that prefix path and whatever directories and filenames for scripts you have
@tough abyss You could use an eventhandler for init in the config
class someClass {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {};
init = "call compile preprocessFileLineNumbers '\nameofpbo\init.sqf'";
};
};```
that config.cpp inside @addon/addons/nameofpbo.pbo
along with init.sqf
i think
Heh. It is simplier than I thought.
that's how i do it, there might be a more proper way
cries alone in CfgFunctions
Lemme give you a hug @thin pine I know how you feel. Just read/seen it.
You'll have to excuse Dscha, he had Salami on his mind.
Can't blame him ๐
ffs?
Schnitzel, Salami... do you see a pattern here? ๐
step on Lego!1oneeleven
setVelocityModelSpace, nice
i wish they would add some more drawing commands in future
for drawing solid polygons, etc
also pathfinding debug commands would be awesome
oh gosh
time to reinstall dev branch
sounds like that's purely visual debug, would be nice to be able to return an array of pathfinding points or something
how have they made those graphs?
i've seen people do it on map ctrls, but that seems so hacky
Check out
YAB
Yet Another benchmark
Inside there they draw a graph.
@rancid ruin
yeah that's with a map ctrl and drawLine iirc
Yeah, it was a map ctrl.
i remember thinking of doing it with individual line controls, but it would've been even more difficult
you put the variable name of the vehicle and then the variable name of the unit that is going to get the kill i think
might seem like a stupid question, but how can i copy a command's output so i can paste it elsewhere
setShotParents has to run on the server
that's the only potential problem I can see.
And missiles, grenades and some others are still reported as null projectiles if the firing object isn't local
maybe it's borked ยฏ_(ใ)_/ยฏ
Anyone knows why this is not working? ```{if (side _x == west && _x != Player) exitwith {deleteVehicle _x};} forEach allUnits;
west units do not get deleted
then, not exitWith
ah I see
yep correct, I just oversaw that, thanks
also
side group _x
otherwise it will not delete units of that side that did friendly fire
or are captive
okay, thanks ^^
Hey guys I have a problem atm with a vehicle icon not showing up in a HUD i made. This is the code I have private _getVehiclePicture = [getText (configFile >> "CfgVehicles" >> (typeOf _target) >> "icon")] call BIS_fnc_textureVehicleIcon; _vehiclePicture ctrlSetText parsetext format ["<img image='%1' size='2'></img>", _getVehiclePicture];
When I did this ```_target = cursorObject;
hint format ["<img image='%1' />",[getText (configFile >> "CfgVehicles" >> (typeOf _target) >> "icon")] call BIS_fnc_textureVehicleIcon];
I am only getting the path
not the icon itself is not showing up
Anyone have an idea?
You don't need closing tag for img
hi, how can i delete a array at given position when number in my array is for example 1 ?
tested it with this:
test = [[0,"John Collins"],[1,"blabla"]];
_test = test select {(_x select 0) isEqualTo 1};
test deleteAt _test;
any ideas ?
@meager granite Ok, but do you know why its not showing the icon?
what do you mean "getting the path"
When I do this _target = cursorObject; hint format ["<img image='%1'>",[getText (configFile >> "CfgVehicles" >> (typeOf _target) >> "icon")] call BIS_fnc_textureVehicleIcon]; it only types out the path to the image, doesnt show the image
Oh thanks that worked
I needed a space after the img though for it to show in a hint
yes hint needs at least single character to show up
img tag is not considered one
@dim owl
{
if(_x select 0 == 1) exitWith {
test deleteAt _forEachIndex;
};
} forEach test;
thx
I have another question @meager granite If I want to get a vehicle type: e.g.: car, boat etc I would think I can use typeOf cursorObject but that doesnt work for getting the type it only gets the model like plane_f
That is the type
What could I do to get the Car name like SUV or Ifrit e.g.?
@dusk sage
ooh found it getText(configFile >> "CfgVehicles" >> (typeOf cursorObject) >> "displayName");
@dusk sage I know thats being an ass.
Hey Guys, Currently having an error relating to this _vehiclePicture ctrlSetText parsetext format ["<img image='%1' size='2'></img> ", [getText (configFile >> "CfgVehicles" >> (typeOf _target) >> "icon")] call BIS_fnc_textureVehicleIcon];
_vehiclePicture ctrlSetText parsetext format ["<img imag>
2:19:57 Error position: <ctrlSetText parsetext format ["<img imag>
2:19:57 Error ctrlsettext: Type Text, expected String
2:19:57 File mpmissions\__CUR_MP.altis\core\functions\FL\fn_metaGame.sqf, line 76
2:22:19 Ref to nonnetwork object 69de4080# 1783533: b_soldier_02.p3d
2:22:19 No speaker given for Henry Wilson
2:22:28 WARNING: Function 'name' - Max MacDonald is dead
2:22:28 WARNING: Function 'name' - Max MacDonald is dead
2:22:28 Error in expression <manName];
};
};
};
_vehiclePicture ctrlSetText parsetext format ["<img imag>
2:22:28 Error position: <ctrlSetText parsetext format ["<img imag>
2:22:28 Error ctrlsettext: Type Text, expected String
2:22:28 File mpmissions\__CUR_MP.altis\core\functions\FL\fn_metaGame.sqf, line 76
2:22:31 Error in expression <manName];
};
};
};
That is the error I get
But cant figure out what that is
It says what the error is
ctrlSetText only accepts strings, not structured text
You cant parsetext because that makes your string a text
If you want to use structured text use a RscStructuredText and ctrlSetStructuredText
Ah thanks
@rotund cypress This type of error is known as a type coercion error
ctrlSetStructureText I believe exists?
ctrlSetStructuredText
ye
But all your usual language contructs exist.
Floats, Integers, etc.
But no explicit declaration is required before assignment
It's implicit declaration at time of assignment.
im trying to set an RscText with a background colour with _sideColour ctrlSetBackgroundColor [0, 0.3, 0.6, 1];
But that doesnt work
the box is just no colour at all
Sure it's the correct syntax?
If in doubt, check it's the right way to do it.
On the Wiki
ASSUME nothing.
_control ctrlSetBackgroundColor [1, 0, 0, 1]
Assumptions always screw you up.
wiki
that is the colour for west directly pulled from the wiki
i made a switch like this
switch (_playerSide) do {
case west: {
_sideColour ctrlSetBackgroundColor [0, 0.3, 0.6, 1];
};
case independent: {
_sideColour ctrlSetBackgroundColor [0, 0.5, 0, 1];
};
case civilian: {
_sideColour ctrlSetBackgroundColor [0.4, 0, 0.5, 1];
};
case opfor: {
_sideColour ctrlSetBackgroundColor [0.5, 0, 0, 1];
};
};```