#arma3_scripting
1 messages · Page 523 of 1
Uhhh, find returns index in array connor
@robust hollow wont work, allvariables are all lower case
private _newArray = _oldArray select {_x find "blah" != -1};
@tough abyss so write the search string in lower case?
@high marsh he wants to get vars that start with the string
Yes, so if it's found. Then it returns the index, if not then it returns -1
0 is still a valid index in the array,
@high marsh will match whatblah, theblah and fuckblah
Yes, I understand this.
yea, my point is he wants the index to be 0 because thats what it starts with
if the string doesnt start with the search term then ignore it
So you want the first entry in the array? It doesn't make sense.
get all the variables in an array which names start with "varName"
0 based position of the first array element that matches x, -1 if not found
so write the search string in lower case? dont have to tell me, but worth mentioning for inexperienced
find alt syntax 0 based position of the first sequence of characters that matches x, -1 if not found
if the string starts with the search term, it will return 0 and be included in the output array
that's string find number
either way, both syntax returns -1 if not found
yea...
¯_(ツ)_/¯
idk what ur trying to get at anymore
the case is more of confusion
that's string find number 🤔
it's 5:30 AM okay..
☕
lol thank you guys
is present any analogs of "getUnitLoadout" for containers?
heh? weaponCargo
Cant figure out why this script isnt working "UMI_Briefcase_Money_Open" in heli1;
Any ideas?
I dont think I've ever been so stuck on creating a mission haha
are you puting that item in the helo inventory? @long pewter
if("UMI_Briefcase_Money_Open" in (itemCargo heli1) then
{
//end task
};
heh? weaponCargo
No, it isnt good idea, because you can hold items on weapons, items in backpacks, etc.
sure it is, because it's the weapons, not the items
not weapons inside of backpacks
the command actually doesn't care at all what's inside the backpack
you can check that if you want the specific backpack cargo
but none of that will be checked
so, its very strange, that for all time for developing arma, we dont have any command, that can show all gear in a crate propetly. And only in A3 1.58 was created "getUnitLoadout"
You know what's even stranger? That you can't just use each getter command for each type of cargo
there isn't any particular reason to have one
because it can be done on your own
@safe forum yes, it is very very strange that Arma lacks some essential functionality, not like any other game out there
@high marsh (getItemCargo _vehicle) + (getMagazineCargo _vehicle) +( getWeaponCargo _vehicle) + (getBackpackCargo _vehicle) not a solution
it works right? 😃
it works, but doesnt contain full info about container
What more info do you even need?
What I use to collect all info
private _obj = _this select 0;
private _disallowedItems = _this param [1,[]];
private _r = [];
private _arrr = [];
private _containersClass = [];
{
_x params [
"_xType",
"_xObj"
];
private _items = [];
{
private _isVest = (_x isKindOf ["Vest_Camo_Base", configFile >> "CfgWeapons"]) || (_x isKindOf ["Vest_NoCamo_Base", configFile >> "CfgWeapons"]);
private _isUniform = _x isKindOf ["Uniform_base", configFile >> "CfgWeapons"];
if !(_isVest || _isUniform) then {
_items pushBack _x;
};
} forEach itemCargo _xObj;
_items = _items call BIS_fnc_ConsolidateArray;
private _mags = (magazineCargo _xObj) call BIS_fnc_consolidateArray;
{
if (toLower(_x select 0) in _disallowedItems) then {_mags set [_foreachIndex,-1];};
} forEach _mags;
_mags = _mags - [-1];
private _weapons = weaponsItemsCargo _xObj;
{
if (toLower(_x select 0) in _disallowedItems) then {_weapons set [_foreachIndex,-1];};
} forEach _weapons;
_weapons = _weapons - [-1];
_arrr pushback [_xType, [_items, _mags, _weapons]];
_containersClass pushback _xType;
} forEach everyContainer _obj;
_r pushback _arrr;
private _ItemCargo = [] + getItemCargo _obj;
private _newItemCargo = [];
{
if !(_x in _containersClass) then {
for "_i" from 1 to ((_ItemCargo select 1) select _forEachIndex) do {
_newItemCargo pushback _x;
};
};
} forEach (_ItemCargo select 0);
_newItemCargo = _newItemCargo call BIS_fnc_consolidateArray;
_r pushback [((magazineCargo _obj) call BIS_fnc_consolidateArray),(weaponsItemsCargo _obj),_newItemCargo];
_r
As sample, backpack can store any items, and (getItemCargo _vehicle) + (getMagazineCargo _vehicle) +( getWeaponCargo _vehicle) + (getBackpackCargo _vehicle) doesnt save them
you need to check every container in container, to save full info
I know, how to do it. My first question not about scripting commands, that can help me to make a big function, to save all gear in container. I had asked, is present any solutions in BI scripts\commands like "getUnitLoadout"
The answer is clear I imagine at this point
@still forum because i know you use it, does the VS Code SQF plugin have any magic option to open up the biki page for commands?
Dunno. Never tried
@austere granite No, but there is an extension that does open up biki for highlighted commands
It's called SQF Wiki
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=EelisLynne.sqf-wiki
Seconds
So, that comand works only when the condition is met, not the actually time out to complete it
That is a verry miss leading name.
You gonna complain about names? modelToWorldVisualWorld?
lockIdentity (It dos the oposite)
Would you change it if you worked at BI?
Would not even name it like that really.
Well for original naming it's about 19 years too late now 😄
And sadly a command cannot be renamed/changed/removed after it was added
Or, just make the same kinda of command with a diferent name like setDammage
as if that helps...
Anyway, how to complete a waypoint by script with out have to delete it?
does anyone know how I'd be able to "lock" the camera while I have cinematic borders enabled? Basically I'm trying to set it so that when the player looks around it's like they double tapped alt instead of rotating the player.
This is what I've got in my init.sqf
[0,0,false] spawn BIS_fnc_cinemaBorder;
Vanguard playMove "Acts_A_M01_briefing";
sleep 2;
titleCut ["", "BLACK IN", 5];
player switchMove "Hubspectator_walk";
sleep 5;
player PlayMoveNow "amovpercmstpslowwrfldnon";```
ohla, I have an issue. I want to make gunner optic with a full (non-functional) control panel. So that would look like a controller with a screen in the middle (all texture). The issue is that the game is zooming in on the texture itself. Making the image in the texture smaller lowers the overall qaulity too much and I think its something in the coding. Does anyone have a clue?
_zLogic addEventHandler ["CuratorObjectPlaced", {
params["_curator","_entity"];
if(_entity isKindOf "AllVehicles") then {
[group _entity] remoteExec ["AEF_fnc_aiSetSkill", 2, false];
};
}];```
Say I wanted to cut down on every curator placed object from doing remoteExecs that change skill levels down to only units and vehicles, would the type "AllVehicles" suffice in the above conditional statement?
@earnest ore I really doubt setting skill on vehicles is going to do anything
AI on the other hand
_zLogic addEventHandler ["CuratorObjectPlaced", {
params["_curator","_entity"];
if(_entity isKindOf "Man") then {
[group _entity] remoteExec ["AEF_fnc_aiSetSkill", 2, false];
};
}];
I believe it has to do with the gunners skill
was it ever understood why some shortcuts work with addAction, and others dont? (plus it seems to vary based on the situation - say infantry vs vehicle)
Are you sure you're using the correct shortcut action? Seems to work with all the supported ones for me Kju
_x addAction ["RESET",{0 = [] spawn TEST_fnc_CreateVehicle;}, nil,1.5,true,true,"ReloadMagazine"];
_x addAction ["SET WEAPON",{0 = [] spawn TEST_fnc_SelectWeapon;}, nil,1.5,true,true,"SwitchWeaponGrp1"];
_x addAction ["SET VEHICLE",{0 = [] spawn TEST_fnc_SetVehicle;}, nil,1.5,true,true,"SwitchWeaponGrp2"];
_x addAction ["SET BOMB",{0 = [] spawn TEST_fnc_SetBomb;}, nil,1.5,true,true,"SwitchWeaponGrp3"];```
works as infantry
when you get into a vehicle/assign to a vehicle, only ReloadMagazine works
as an example
you have all these kind of weird situations where some work, and others dont - but different in different situations
Add them to the player, but add a in vehicle check to the condition
Is there anyway to make this text that appears on the screen, stay on screen for longer?
[
[
["Mission Complete - Juan Will Return", "<t align = 'center' shadow = '1' size = '0.4'>%1</t>", 15]
]
] spawn BIS_fnc_typeText;
@high marsh the actions work fine when executed from the action menu
as said ReloadMagazine works too in this context
also not the first with this problem. the BIF has a couple of threads on this too
unfortunately no solution/insights why its bugged/behaving weird
@long pewter I think it is said on the wiki page that you can add empty lines to "cheat" about display time
@winter rose cheers bro
anyone any idea how i delete the douple quotion marks from string? Example: ""76561197993746xxx""
@upper cliff What exactly is your player doing while he's not supposed to be able to do anything but turn his head?
They’re just supposed to be standing there listening to the briefing
Hm, I think if you play an idle animation on them, they can't turn around anymore
just move their head
Will I think it’ll probably be easier to just have the briefing as a diary entry rather than a cutscene just because of the way the mission is set up.
Del and End rotations still apply
@winter rose Aren't there animations where you can't turn around in anway? The only example I can think of is that silly fighting animation 😄
That would make briefings awesomely fun
You could intercept rotation keys by scripts, or just use a camera
Well I think the only animations that you can’t rotate the camera while doing are the ones in the cutscene category
Hey there, I have a public variable in a script that sometimes stores an empty array. I get Battleye kicks when this happens. Is there a way to exclude empty arrays in publicvariableval.txt?
Is there any script that "scans" a soldier and gives you a "config" setup for him with weapons, ammo, etc? The ALiVE ORBAT creator gives a bit borked configs
Arma arsenal can export config loadout
I think STRG+Export or Shift+Export or some other modifier key
You could try https://community.bistudio.com/wiki/getUnitLoadout
but its not viable for vehicle config, like when you create a new soldier
@finite dirge Thanks
I heard the arsenal config export is exactly that. Config for when you create a new solder unit in config
nope, it just gives you script based lodout, that you put in init
tried different ones, still get the same scripting stuff
We talked about exporting loadouts to get a unit config just 2 days ago in this channel
Thanks
pretty good, but it does skip the magazines that are already in the weapons, not that big of a deal, just annoying
I think STRG+Export or Shift+Export or some other modifier key ctrl+shift+c
it also skips attachments to guns 😦
yeah, you need to add those via new weapon class
the missing magazines are a bit more annoying
I'm having trouble with this script that spawns a helicopter and an infantry group. The helicopter and infantry SL spawn about 10m in the air - damaging the chopper and killing the SL - while the rest of the units spawn at ground level:
private _pos_Spawn = getMarkerPos selectrandom ["QRF_H1_S","QRF_H1_S","QRF_H1_S"];
Selects one of three markers (All the same for testing purposes)
private _H_AR = [_pos_Spawn, 0, "rhs_mi8mt_vdv", EAST] call bis_fnc_spawnVehicle;
Creates the helicopter, 10m in the air (I don't understand why though)
private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos; private _I_G = createGroup [east, true]; // explicitly mark for cleanup private _I_U = _I_G createUnit ["O_Soldier_SL_F", _pos_Ispawn, [], 0, "NONE"];
Creates the group and its SL - again, around 10m in the air
private _counter = 0; while {_counter < 12} do { // {_counter < # } - Num units of type to spawn _newUnit = "O_Soldier_F" createUnit [_pos_Ispawn, _I_G]; _newUnit = "O_Soldier_F" createUnit [_pos_Ispawn, _I_G]; _newUnit = "O_Soldier_LAT_F" createUnit [_pos_Ispawn, _I_G]; _newUnit = "O_Soldier_AR_F" createUnit [_pos_Ispawn, _I_G]; _counter = _counter + 4; sleep 2; };
Creates 4 subordinates at a time, all at ground level - despite using the same markerpos as the helicopter and SL
Any ideas?
Oh, and private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos; for the infantry spawnpoint, just so the chopper doesn't crush them
//bis_fnc_spawnVehicle L60-67
case "airplanex";
case "helicopterrtd";
case "helicopterx": {
//Make sure aircraft start at a reasonable height.
if (count _pos == 2) then {_pos set [2,0];};
_pos set [2,(_pos select 2) max 50];
_veh = createVehicle [_type,_pos,[],0,"FLY"];
};
the spawn script purposely spawns aircraft at least 50m in the air.
That explains the helicopter spawning in the air, thanks - I was going to change it to createvehicle once I figure out how. But that doesn't apply to the SL, does it?
Since the SL's spawn position is just the markerpos + 20m north
🤷
is that really what the bis fnc has?
i guess I should look at some of those bis functions
Yeah, for whatever reason using createvehicle instead of fnc_spawnvehicle for the helicopter fixed both it and the SL spawning in the air. I still have no clue why, but I'm not gonna complain either
This is PSA: Do put diag_activeScripts to your watch field from time to time to see if you have some scripts that shouldn’t be there spamming the scheduler
How do I create a "SCRIPTED" waypoint through a script?
_EXH1_W1 setWaypointType "SCRIPTED";
_EXH1_W1 waypointAttachVehicle _EX1LZ;
_EXH1_W1 setWaypointTimeout [30,30,30];```
Here, I'm trying to create a "Land" advanced waypoint at the given invisible helipad, and have it take off again after 30 seconds. But I'm not sure how to go about calling the waypoint's script. All I understand is `A3\functions_f\waypoints\fn_wpLand.sqf []` needs to go in there somewhere
Is there a trick that allows me to assign the curator interface to a virtual spectator unit (Virtual_Spectator_F)?
So there are static units and there are patrolling units. Both kinds do have the behaviour SAFE and waypoint type MOVE
Any idea how to differ them?
It'd help if I read the wiki:
[_EXH1_G, _EX1LZ, LZ_STAR] spawn BIS_fnc_wpLand;
So with this alone, the helicopter will land just fine. However, as far as I can tell this deletes its other (second) waypoint, at least as far as Zeus is telling me. Whether or not that's the case the helicopter will stay on the ground indefinitely. I tried [_EXH1,1] setWaypointTimeout [30,30,30]; but it seemed to have no effect.
you could check with https://community.bistudio.com/wiki/isTouchingGround or maybe the landed or alike eventhandler: LandedTouchDown
and after it has landed/touched ground, make a timer and add the new waypoints
What is a good way to check if an given parameter is a marker?
oof..
I'd say just try calling getmarker* command on it, and see if it returns something sensible
getMarkerPos "" would return [0,0,0] yep
Z value is always going to be zero right? So I guess that could work as part of the detection as well
that or "string" in allMapMarkers btw
Hmm, is there any way to prevent suspension inducing longer loading times in postInit ? I have a function that sets weather at the start of the mission and cannot use forceWeatherChange until weather sim has started. So in doing so I used waitUntil to make sure the game has started to do so. But this adds at least 10 seconds onto loading time
paramWeather = "maas_server_weather" call BIS_fnc_getParamValue;
paramFogValue = "maas_server_fogValue" call BIS_fnc_getParamValue; //main fog value
paramFogDecay = "maas_server_fogDecay" call BIS_fnc_getParamValue; //fog decay
paramFogBase = "maas_server_fogBase" call BIS_fnc_getParamValue; //fog base altitude
if(isServer) then
{
switch paramWeather do
{
case 1:
{
//clear
diag_log "[MAAS WEATHER]: Recieved input of 1, setting to clear";
0 setRain 0;
[0,0] remoteExec["setOvercast",0,"maas_jip_overcast"];
};
case 2:
{
//partly cloudy
diag_log "[MAAS WEATHER]: Recieved input of 2, setting to partly cloudy";
0 setRain 0;
[0,0.5] remoteExec["setOvercast",0,"maas_jip_overcast"];
skipTime 1;
};
case 3:
{
//raining
diag_log "[MAAS WEATHER]: Recieved input of 3, setting to raining";
0 setRain 0.75;
[0,1] remoteExec["setOvercast",0,"maas_jip_overcast"];
};
case 4:
{
//storm
diag_log "[MAAS WEATHER]: Recieved input of 4, seting to stormy";
0 setRain 1;
setWind[20,20,false];
[0,1] remoteExec["setOvercast",0,"maas_jip_overcast"];
};
};
0 setFog
[
paramFogValue,
paramFogDecay,
paramFogBase
];
waitUntil{time > 0};
forceWeatherChange;
};
Try a sleep . 001?
(I can't read it well, on mobile :x)
[] spawn { the last two lines @high marsh
So the script will end and then sync
Isn't it already in scheduled?
dunno
I'll try it thz
@winter rose Works perfectly now, thanks for that. Kind of strange if you ask me lol
Although spawn would create a new thread for the changes, instead of halting the entire script.
I would guess that the "post init" is waiting for the script to end, while it is halted by the waitUntil… else, idk
Yep, now here is a serious issue that happens if you start the mission too quickly. Everything freezes on the frame that forceWeatherChange tries to compute weather. All sim and control just freezes and will not resolve ever until you quit the mission.
I want to use playableUnits to get all "playable units" from each of the 4 factions.
I was told to use something like {side _x = west} count playableunits
but i don't really know what to do with this
_westUnits = playableUnits apply{side _x isEqualTo west};
_eastUnits = playableUnits apply{side _x isEqualTo east};
with count you need the return value to be true in your code, otherwise it just returns the array length
apply will modify the array based on the code in the brackets.
in this example, if the side is equal to your side that you need. It'll add the unit to the modified array
Cheers! I appreciate the help. Just needed to do a check to see if any playable units had been placed at all.
By Zeus?
Also god I hate isEqualTo lmao but ya know... arma
Nah I'm making a check for the eden editor
isEqualTo is faster than some basic operators ( i believe )
Basically I'm having a prompt appear asking the user to please add a headless client to their mission.
And I want to make sure that the mission maker has placed a playable unit
You're adding this to a mod correct? Can't check that ingame to any effect, it'll just throw an error saying that there is no players
because otherwise the virtual faction which is hidden by default will cause an error in the slotting screen
oh dw about that let me link you to the file I'm modifying
Seems fine to me, what do you need changing?
line 30? That's quite literally getting the number of player units and not the objects
You don't need to itterate through 0 1 2 3
line 30 is broken as fuck
_playables = count playableUnits;
if(_count > 0) then
{
/* code to execute when playable units have been found */
} else {
/* Gui message about how no playable units have been found */
};
I need to sort out AI from that count
how would I go about doing that
sorry quick correction
which script command do I use to check if a unit is headless
isTypeOf or isKindOf?
_playables = count (playableUnits apply{isPlayer _x});
if(_x isKindOf "HeadlessClient_F") then
{
//this object is a headless client
};
or if you're looking to execute on local client
if(!hasInterface && !isServer) then
{
//headless client
};
This function should only be executed during mission making
so I'm guessing local client correct?
Eh, you could execute the secondary example on the client as they are connecting and then add the client info to a list that's available to the mission
Ok, then look at the first example. That'll tell you how many HC's you have in total.
👍
Otherwise, if you need the hc count during runtime, use second example
apply?
_playables = count (playableUnits apply{isPlayer _x}); // no```
```sqf
_playables = playableUnits select { isPlayer _x }; // yes```
he needs the count
won't sqf playableUnits apply{isPlayer _x} return [true, true, false, true, …] ?
same array length
so the count will be the same as count playableUnits yes?
I can just trim false out
that or count the select
_playables = count (playableUnits select {!_x isKindOf "HeadlessClient_F"});
ultimately he was looking to exclude the headless clients
yep
private _count = 0;
_count = count (playableUnits apply{isPlayer _x && !(_x isKindOf "HeadlessClient_F")});
if(_count >= 1) then {_playableFound = true};
this is what I have right now
from https://community.bistudio.com/wiki/playableUnits
// To get a list of all player-controlled units:
_allPlayers = [];
{
if (isPlayer _x) then
{
_allPlayers pushBack _x;
};
} forEach playableUnits;```
but wait, what is it you really want 😆
I want to check if a playable unit has been placed
But Lou, use apply and you eliminate forEach and pushBack
Excluding headless
_justPlayers = allPlayers - entities "HeadlessClient_F";
Aha!
_justPlayers = allPlayers - entities "HeadlessClient_F"; yep!
I won't have to worry about dead stuff right
idk why I ask lol this is in the editor
If you need count.. Why don't you use count command on the array then??
this is true? 🤔
I am?
private _count = 0;
private _justPlayers = allPlayers - entities "HeadlessClient_F";
_count = count _justPlayers;
if(_count >= 1) then {_playableFound = true};
the part above. where you used count (x select y)
might aswell just x count y and be done
count array >= 1
->
!(array isEqualTo [])
yes
Also if(x) then _var = true...
How about
_var = x
Same result.
Why is playableUnits command not an option? only skimmed over the convo
wut
the understanding was that headless clients are included in playableUnits ded, is this not the case?
Dunno, never tried. Never actually used playableUnits
Sounds logical though.
They are
I've got it squared away, thanks guys.
Currently working on just setting up a mission attribute to ensure that the prompt I was making can be disabled.
how do you make primaryWeaponMagazine player; copy to clipboard?
copyToClipboard str primaryWeaponMagazine player
ahh thx
also is there a way to make an NPC carry specific clothing through cursor target
cursorTarget forceAddUniform "U_B_CombatUniform_mcam";
might need to remove old uniform first
what about vest?
addVest instead of forceAddUniform
in case somebody has a debug console currently open, can you check if this is valid in SQF:
private _val = 0xF9;
_val```
249
how does one go about passing on an object from an eventhandler to a user created function?
[_object] call myfunc
for multiple objects it would be like ["_object1", "_object2"] right?
[_object1,_object2]
putting them as strings would pass strings
and to recieve it into a function would you do something like _object = param[0] ?
yea. if you have multiple arguments its usually best to use params
which would be params ["_object1","_object2"];
thanks my dude!
is __FILE__ printing a path with or without quotations?
so im passing a killed player and killer by '''[_killed, _killer] spawn br3_fnc_handleCash; ''' and then executing this in my function '''params ["_aiKilled", "_pKiller"];
_aiKilledd = params["_aiKilled"];
_pKillerr = params["_pKiller"];
hint format ["Killed By %1", name _aiKilled];'''
_pKillerr = params["_pKiller"];```
why?
i was messing around to try and find a working method
that is not it
ok
what are you trying to do? you've shown what ur doing but not what the problem is.
im trying to display the killers name in a function
also for the record, code blocks in discord are done like this
```sqf
<code here>
```
lol my bad
tryin to learn 😃
but whenever I kill a player it only gives the player killed name
params ["_aiKilled", "_pKiller"];
hint format ["Killed By %1", name _pKiller];```
should be all you need.
not even the _aiKilled unless you use it elsewhere
i do plan on using _aiKilled somewhere else but whenever I kill the player it shows the killed players name regardless of if i do: hint format ["Killed By %1", name _pKiller]; or hint format ["Killed By %1", name _aiKilled];
[_killed, _killer] spawn br3_fnc_handleCash;
then _killed and _killer are the same unit.
im using the bis eventhandler
here is the full code: addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; // UAV/UGV player operated road kill if (isNull _instigator) then {_instigator = _killer}; // player driven vehicle road kill [_killed, _killer] spawn br3_fnc_handleCash; }];
🤷 dont see why it wouldnt work.
you will want to add a check to confirm you are the killed unit though, otherwise everyone will get the notification.
ok, I got it to work by restarting arma 3, it wasnt refreshing my mission folder for some reason. Thanks for all the help @robust hollow
what is the most efficient way to add elements onto an array in arma 3? im trying to fill an array with created soldiers using a forloop
when adding to the end of the array, pushback is good
ooohhh i thought pushback was only for stacks
stacks?
yeah i thought i saw a bis function for stacks in arma 3 and I assumed pushback was for stacks as it is in implementations of c++
BIS_fnc_arrayPushStack? thats just the append command.
ah gotcha, was just glancing through the functions and saw the word stack and push lol, ive been using set for arrays so didnt know about pushback lol
most efficient way to add elements onto an array
https://community.bistudio.com/wiki/Code_Optimisation#Manipulating_arrays
if (!isServer) exitWith {};
_randomQRF = selectRandom ["spawnQRFV.sqf","spawnQRFL.sqf","spawnQRFH.sqf","spawnQRFMi.sqf"];
while {true} do
{
_array = allGroups select {side _x isEqualTo EAST};
{
_group = _array select _x;
_leader = leader _group;
if (behaviour _leader == "COMBAT") then
{
hint "combat detected";
[_leader] execVM _randomQRF;
sleep 1;
}
else
{
hint "no combat detected";
sleep 1;
};
} forEach group _array;
hint "cycle";
sleep 1;
};
I've run out of ideas here, I find this sorta stuff very confusing.
What I'm aiming to do is have the If/Else run for each element of the array before cycling back through the if {true} loop - so as to re-populate the array each cycle. The array is comprised of groups, and I need to execute one of the random scripts on the leader of any it finds that are in combat - passing the leader on to those scripts
_group = _array select _x; is almost certainly wrong as is forEach group _array;
```sqf
```
to get proper code highlighting
Oh, thanks, I was always wondering about that
group _array that's wrong. group command doesn't take array as argument
{
_group = _x;
} forEach _array
like this
_x is the element in the array that's currently being iterated over
Aaah, thank you
Hmm, any idea why _leader is passed as an array its self to the script executed on it, rather than as a unit/object?
[_leader] execVM _randomQRF; because you are passing it as an array
you are wrapping it into an array []
I'm experiencing trouble with the AI when the FSM is disabled _unit disableAI "FSM"; and they have waypoints. They randomly stop at a waypoint "Move" without any obvious reason. If I reactivate the FSM, then they carry on... Anyone know about this issue ?
how does one make a variable available throughout sqf file but not others? I'm trying to make a variable _cash available to an "entitykilled" eventhandler
doesn't work
What you are imagining of doing is not possible
but you can just set a variable onto the entity that you are also adding the entitykilled eventhandler onto
oh, how would I go about that?
_unit setVariable ["cash", _cash]
and then you can getVariable inside the eventhandler
wow! thanks mate!
Is there an eventhandler for a group having a new waypoint assigned? I want to run code when I use Zeus to give a new waypoint to a VLS.
I was hoping for something less overkill =p I guess a typeOf check isn't that expensive.
_landVehicleArrayRaw = vehicles inAreaArray landGarage select {_x isKindOf "LandVehicle"} apply {[_x,getPosASL _x,getDir _x]};
Would this be correct? So i have an array of the vehicle, the position and the direction?
Update: I could test it now. It works as intended. Sorry for asking 😦 Should've waited until i could test it.
It works as intended. You sure? Where are you passing valid areas to inAreaArray? @keen bough
i dont see anything wrong with it 🤔
You know what landGarage contains?
no, but if he says its working then im going to assume its a trigger, marker, location or array of area info.
not sure why its a global variable 🤷
And if it is array of vehicles?
then he probably wouldnt have said It works as intended. because that errors.
And if he tries this on stable?
what?
Errors are suppressed
assuming he doesnt have showscripterrors on, the array will always return empty, therefor not working as intended
Anyway my question is still valid I want to know where are the valid areas in that expression, you seem to not know that either
I have a marker (ellipse) with a size of [200, 200]. Now I want to check if there are entities in this area.
private _markerPos = getMarkerPos _checkAreaMarker;
private _markerRadius = (getMarkerSize _checkAreaMarker select 0) / 2; // 200 is the diameter and 100 is the radius?
private _foundVehicles = _markerPos nearEntities ["Car", _markerRadius];
Would this be right?
looks reasonable
best.day.ever
@tough abyss The code works really as intended. It shows either nothing (when no vehicle is parked in the area of the trigger) or an array of vehicles, followed by position and direction.
@frigid raven no, that’s not how you do it
You need to grab array of entities either bigger than the area if ellipse or all entities and filter it via inAreaArray to get only entities inside the ellipse
Your code might return false positives
Unless your ellipse is always a circle then it doesn’t matter
Unless your ellipse is always a circle
It's a ellipse with 200 size on X and 200 size on Y.
Also known as a circle
It’s an ellipse and a marker, a user can change a and b placing it
I have a marker (ellipse) with a size of [200, 200]. Now I want to check if there are entities in this area.
He said what size he has
Fair enough
It is a bit idiotic to select from marker size if you know you have marker 200 x 200 already
Ok I see your points here
That marker will always be a circle but the diameter is subject to change
still always being a circle
is there a way to increase the inventory capacity of an object aside from the class cfg?
cargo, or unit ? @lusty canyon
unit backpack/vest/uniform
No. Had same question just a couple days ago
you might be able to use scripts to force more items into an inventory than actually fit into it.
ok thanks
you can play with setUnitTrait ["loadCoef", 0.5]
said unit can carry more weight, but the vest won't have more space @lusty canyon
Is there a way to change the optic UI scale for custom optic UI's? My texture is more then just a cross. There is way to show it all but that destroys the qaulity of the texture. Does anyone know the solution to this?
{if((getPos _x) inArea myTrigger && alive _x) then{
aliveThings pushBack _x;}
}forEach thingsInArray;
What am I doing wrong here? I get a type error on the getPos part: got string, expected object, location
I'm not sure if this is the correct channel or not, but would anyone happen to know how to make it dark at a certain altitude?
I'd look at setAperture/setApertureNew
@next scaffold _x is obviously a string then.
FAM_vehiculosBlufor = allVariables missionNamespace select {_x find "bluforveh" == 0};
this is the array I'm using
its content is all the vehicles which variable names start with "bluforVeh". If I type the array name into the debug console it returns [bluforVeh_1]
this is the array I'm using Yes. Strings.
its content is all the vehicles No it's not.
allVariables returns the names of variables.
yeah, sorry. I just realized you're both right
You don’t need getpos could just pass _x to inArea
can I? Well first I got to find out how to take the variable names from string to non-strings(?)
missionNamespace getVariable _x
would you happen to have any elaboration on the setAperture...im pretty new to scripting @cursive whale
@tough abyss thanks! It works 😄
if i check (_vehObject isKindOf "Air") will that be enough to net me all helicopters/planes/uavs? will it also net stuff i dont want like missiles/paratroopers?
http://tikka.ws/class/index.php?b=cfgVehicles just check.
Paratroopers
Parachute: http://tikka.ws/class/index.php?b=cfgVehicles&c=NonSteerable_Parachute_F Inherits from air.
Missile: http://tikka.ws/class/index.php?b=cfgVehicles&c=CruiseMissile1 Inherits from air, even inherits from helicotper
@still forum thanks ive been looking for a browser based config viewer, the in game one is so slow to load
There have been multiple in the past. Sadly they all died through lack of updates.
this one is also outdated. For some reason noone can make a open-source/community managed config viewer...
my issue is i want to get a flying veh thats being painted by a uav laser, so far i have:
_laser = objNull;
if ( isLaserOn (getConnectedUAV player) ) then {
_laser = laserTarget (getConnectedUAV player);
_vehTGT = (_laser nearEntities ["Air", 5]) select 0;
};
is there a better way to do this? also the uav thats locked onto a target will sometimes overlead the laser so when i near entity the laser it i get nothing
(or is there a way to force the uav to always slew the laser onto the surface of a moving target? i tried anim speed but nothing changed, im thinking the turret cannot rotate fast enough to track a locked target so it always adds too much lead, hence the laser object is lost in outer space)
you defined _laser inside a scope, it is undefined outside of it
@tough abyss sorry there is more code before and after i just pasted the important bits (edited)
Hello everyone! Can anyone help me with ACE3 Mortar system?
Ask on Ace Slack maybe?
@tough abyss sorry, I don't understand what you mean. Can you explain that to me?
so i spawned 3 ammo objects white flare, white smoke, and IR flare. they are emitting properly i just want to delete them after some sleep or other condition, but they dont want to get deleted and stay until TTL:
_smokeArrStrs = ["F_40mm_White", "F_40mm_CIR", "G_40mm_Smoke"];
_smokeArrObjs = [];
{
_i = createVehicle [_x, (getPosATLVisual player), [], 0, "CAN_COLLIDE"];
_i attachto [ player ];
_smokeArrObjs pushBack _i;
} forEach _smokeArrStrs;
sleep 10;
{ _x setDamage 1; deletevehicle _x; } forEach _smokeArrObjs;
as u can see i tried setdmg and delveh both did nothing
hey everybody, I'm looking for some help with a couple simple scripts I just don't know how to get to work on a dedicated server. 1) allow damage false on a chopper object and 2) group moveinCargo chopper variable. the scripts I use in editor work fine, but on a dedi server everything goes to shit for me.
that's the whole thing I'm trying to figure out right now, locality, maybe I'm putting these in the wrong location. Right now I'm throwing them in the object init
@astral dawn so i can connect to ACE3 Slack chat for free?
@fiery dew wiki says you have to run it globally to have global effects https://community.bistudio.com/wiki/allowDamage
is there a simple way of converting dik code to character
as in the key it refers to? keyName code
If I do
_array = [
["Alpha", getMarkerPos "alpha_mkr"],
["Bravo", getMarkerPos "bravo_mkr"],
["Charlie", getMarkerPos "charlie_mkr"]
];
Will the result be getMarkerPos result in its own array?
Or should I place the getMarkerPos "mkr" in brackets?
(Not connected to any code, just a side question)
So the above vs:
_array = [
["Alpha", [getMarkerPos "alpha_mkr"]],
["Bravo", [getMarkerPos "bravo_mkr"]],
["Charlie", [getMarkerPos "charlie_mkr"]]
];
Which is correct?
first one will result in:
_array = [
["Alpha",[x,y,0]],
["Bravo", [x,y,0]],
["Charlie", [x,y,0]]
];
second will be
_array = [
["Alpha", [[x,y,0]]],
["Bravo", [[x,y,0]]],
["Charlie", [[x,y,0]]]
];
https://community.bistudio.com/wiki/Array https://community.bistudio.com/wiki/getMarkerPos
which channel would I use for vehicle creation?
depends what part of it
theres #arma3_model, #arma3_texture, #arma3_animation and #arma3_config that could all be relevant
also.. #arma3_questions would be the place to ask 😄
Is there some fancy way to create a couple addActions in a loop? Before I start trying to use a while loop I thought id ask.
is there a chance anyone could help me understand the saveProfileNamespace and maybe help me get a demo script made for me to work off of since there are no tutorials on how to use this, i would appreciate the help. will provide more support for asking this if necessary
that or help with how to setup inidbi2 if its easier
saveProfileNamespace invokes file write operation that saves the data you stored in profileNamespace onto disk. Otherwise the data is kept in memory. File write is costly therefore it is not performed automatically every time you put something in profileNamespace, however Arma 3 scripted framework does force file write at certain points so you don’t have to do it yourself. You can always force it yourself if you think it is needed.
for _i from...do { addAction... How more fancy do you want it @real moat ?
@tough abyss not meaning to sound mean but i got that much from the wiki i was more asking if someone could explain briefly or DM me on how to use it to actually save things. sorry for not being specific, i wanted to avoid a long and drawn out message in the chat.
Guys. Where can I find Task Force Radio for Linux ?
You use the same version as on windows
Can someone please help me understand why this isn't working:
params [
"_obj"
];
_spawnCarrier = getPos _obj;
"respawn_west" setMarkerPosLocal [
_spawnCarrier select 0,
_spawnCarrier select 1,
_spawnCarrier select 2
];
I know that markers dont have a Z co-ord but I saw some guides say that this method works to move the marker.
I'd like to put the marker on the carrier deck. My _obj is an invisible helipad on the flight deck.
It moves the marker X and Y correctly, but I still get dropped in the water.
why do you take the position apart and then put it back together??
setMarkerPosLocal takes AGL. getPos returns AGLS.
use getPosASL and ASLToAGL
and don't take the array apart just to put it back together immediately that's useless
How do I take the position apart exactly?
Didn't do it consciously.
I dont know what I did to "take it apart".
What am I doing to take it apart?
_spawnCarrier select 0
You have an array of 3 elements, you are taking each element out seperately, just to put it back into a new 3 element array.
That's nonsense
Okay man, jeeze, thanks.
To be honest
"respawn_west" setMarkerPos getPos _obj;
This is what I had
But it didnt work
So I got the above from a tutorial video.
Never seen a good SQF tutorial video, that wasn't either horribly outdated, or where the author didn't actually understand what he was doing besides copy-pasting things together that someone else wrote
did*
Yea, hence why I have been trying to learn so I dont have to rely on tuts. But yea, I gotta get this thing to work so I resorted to a video.
Well Ill take what I had and look up the stuff you mentioned and try again.
What is _obj?
Invisible helipad
Try setMarkerPos ASLToAGL getPosASL _obj
Object init:
[this] execVM "scripts\spawnOnCarrier.sqf";
Okay, trying now
Works, many thanks
So it was the getPos variant and the conversion that I was unware of. Learning new things all the time. Thanks.
You need to read this https://community.bistudio.com/wiki/Position
Will do!
Since its so short...
You guys reckon I should just plop it all in the helipad's init?
"respawn_west" setMarkerPosLocal ASLToAGL getPosASL _this;
is there a way to get rid of these task destination icons?
couldn't find a flag to disable them in the framework
so basically you want to have them still in the task briefing menu, but not on the map, right?
Yes
I like to use the task framework - it's convenient somehow but I don't like their markers
just give objNull for destination
https://community.bistudio.com/wiki/BIS_fnc_taskCreate
Ah ok ? so destination is it
if it is just the 3d marker that you do not like, there is a bool at the end
@still forum Linux dont read dll task force
What are you talking about?
linux server? linux port?
Don't use the outdated linux port, just use proton. #linux_mac_branch
@still forum Linux server
Why do you need the dll on a linux server?
Task Force use dll for work.
dll expansion windows. I have Linux Server. I need to Task Force Work!
Yes...
Why do you need the dll's on linux?
I don't understand why you want them and what that has to do with #arma3_scripting
Without the DLL, will it work?
Sure
i running a heavy loadout on 10 ai units with setunitloadout, problem is players on the server actually feel the lag as the items are popluated. is there a faster way? what if i just do additem LOCAL ? will ai still respond normally? (like if magazine is local can they still shoot with it and mp clients can see it?)
I have the problem, that i want to scan for backpack and vest containers in a object (vehicle, moslty) and then scan the backpack(s) for all kinds of items.
But it seems none of the commands i found seem to work and i miss kind of a example to work on. Can anybody help me out with an example eventually?
I actually found an example ^^ Just took me over 1 hour to find :3 I selected the wrong container ^^
if anyone's available, i would love some help on how to make a scenario where four units have objectives to kill each other, FFA style, and if any of them kill a guy, the objective to kill that specific guy is completed for the killer and cancelled for everyone else (those who didn't get the kill)
@trail hinge i think this would be for #arma3_scenario
Hmm. When i clean up the inventory within a vehicle, it seems there are invisible objects left behind. I cant click anything within inventory of vehicle but it fills up more and more space. Any idea which may cause this?
Any ideas why markers name-prefixed with "_USER_DEFINED", created globally or locally, cannot be deleted from the map like other normal map markers?
Oh joy. If you have another non-"user defined" marker on the exact same position, that marker masks the user defined one even if it isn't visible on the map. 🤔
Wiki page implies you can delete user marker @dim token
Or do you mean player cannot delete one if it was added with script? Your question is vague
i read it as "why cant players delete markers created with createMarker?" and "You cant delete player created markers if a createMarker marker is on top of it". thats just my guess tho 🤷
@lusty canyon setUnitLoadout is expensive so if you run it on multiple units at once that is expected
Connor is correct.
What's the best strategy for making a specific group of AI (say pilot/gunner in a gunship) better able to spot infantry, without spoon-feeding them information about that infantry via reveal? I'm perfectly happy to adjust the target infantry's properties to make them easier to spot, but I don't want the gunship to have "impossible" (no line of sight possible, out of range, etc.) information about those units.
Personally I think what we did with CF_BAI/detect is the way to solve it. Ultimately it uses reveal but it is based on a whole range of factors and worksaround the issues with the games fundamental issue with spotting that was introduced fairly recently that shortened the range dramatically.
Can you give me a brief outline of your algo or can you just point me to your source?
Perfect! Thanks.
There is a decent description on our website, steam and the forums if you just want the high level of everything taken into account
Pretty interesting stuff, thanks for linking. A worthy pursuit.
Which would you prefer to script?
A) You equip yourself within an full ace arsenal and run through a payment-trigger and the cost of the items you have equipped are automatically withdrawn from the money-variable or
B) A Shop Menu where you can buy items directly and they are put into a container or
C) Do everything over 'addAction' for a'really old style' of shop?
A)
A
Yep, i came to that conclusion too. Its more work but totally worth it. Its not that hard as well ^^ just a lot to type XD
But instead of running through the payment trigger, you just exit the shoptrigger. Basically: Enter the trigger, your current equipment gets saved in the database under your name. You leave the trigger and you pay everything that you have extra on you (like more magazines, weapon attachements and so on)
yeah, connecting payment trigger with database saving is good
can i initialize a variable as simple array like _blep = [[]]; and then post there my loadout from my soldier? Like _boop = loadout from that gut _blep = _boop;?
sweet. I want to get a units loadout when they enter the shop, save that up in the database, let them do their thing and when they leave, the new items they got, will be tested with the old ones and then they have just to pay for things that they had bought anew.
all with the comfort of the sweet ace arsenal
still no idea what this has to do with _boop and _blep
i have to initialize the inidbi2 database entry somehow, because i use that one. And the unit loudout are a lot of arrays
normally i initialize for a category like weapons with [[name],[amount]] but with the unit-loadout... its very weird array
when I'm using command join grpNull - my unit start turning North. Is this a bug?
how can I remove unit from a group without turning?
does the whole group turn? are they doing something or just standing?
probably turning into direction of default formation. Try to add _unit setformdir getdir _unit; right after joining grpnull
yeah works
https://community.bistudio.com/wiki/boundingBoxReal
clippingType boundingBoxReal object
dose clipping type not exist
With Arma 3 v1.92 an alternative syntax is added allowing to specify clipping type to be used we're on 1.90 aren't we?
You would need to use dev branch for that.
i've noticed a few 1.90 pages say 1.92 🤷
ok thanks
In CBA settings, the logged in admin cannot change any setting, no matter what mission file is used. Is there any back-end files you need to adjust or is it something simpler?
if settings are forced by a userconfig/config then you cannot change them in interface, because you wouldn't be able to save them
guys. How to make the night lighter?
play at full moon night
@still forum And how to make the night was always a full moon?
Look into a calendar that shows moon phases
And choose a date that has full moon
https://www.timeanddate.com/moon/phases/ like this
19.04.2019 has full moon.
05.04.2019 has new moon
@still forum Thanks friend!
you can also check in-game thanks to utils 3:
https://community.bistudio.com/wiki/Arma_3_Utilities#Moon_Phases
Aren't marker variable names defined in editor global variables?
I defined two markers in editor (added variable names to them) but when I try to access those markers from script, it complains about undefined variable
markers are strings
are you sure your name is a variable, and not just the markername?
🤔
Maybe the Variable part of that is just wrong
try to just use it as the marker name
I'm trying to access it like this:
_areas = [tuna1, tuna2];
{
...
} forEach _areas;
marker names are strings
So how do I access them then? o.O
Ah, I see
Omg, I see why it didn't work now. I used markers in my own mission while the original one had triggers instead of markers
Is there a way to determine how large an object is in the field of vision of player/unit?
I know you could get it working in hacky ways but just wondering if there's some direct way to retrieve the info
The script should take into account if player is using eg. rangefinder or binoculars, ie. it should retrieve the actual size of the target object in player's FOV
boundingBox and worldToScreen maybe
Thanks for the tip @digital hollow! 😃 A bit of googling revealed that KK has kind of done this already:
KK_fnc_trueZoom = {
(
[0.5,0.5]
distance2D
worldToScreen
positionCameraToWorld
[0,3,4]
) * (
getResolution
select 5
) / 2
};
This is part of my init.sqf:
onEachFrame {
hintSilent format [
"CURRENT ZOOM: %1x, \n Soldier position on screen: %2 \n Distance between soldier and civ: %3 \n Currently recognized units: %4",
round (call KK_fnc_trueZoom * 10) / 10, call soldierWTS, call distanceSoldier, call playersInRange
];
frameNumber = frameNumber + 1;
};
This is function playersInRange:
playersInRange = {
if (frameNumber > 0) then {
deleteMarker "playersRecognizedInArea";
};
_playersRecognizedInRadius = call KK_fnc_trueZoom * 60;
_playersRecognizedInArea = createMarkerLocal ["playersRecognizedInArea", getPos player];
_playersRecognizedInArea setMarkerText "";
_playersRecognizedInArea setMarkerSize [_playersRecognizedInRadius, _playersRecognizedInRadius];
_playersRecognizedInArea setMarkerDir 0;
_playersRecognizedInArea setMarkerShape "ELLIPSE";
_players = allUnits; // just for testing, for production use this instead: allPlayers - entities "HeadlessClient_F";
_playersInRange = _players inAreaArray _playersRecognizedInRange;
_playersInRange
};
Why does my debug look like this? (The array thingy) https://i.imgur.com/okJC4xJ.png
nil
Shouldn't it show [] then?
no
nil of type array
inAreaArray returns nil
maybe because _playersRecognizedInRange is nil
Ah, I changed the variable name and forgot to edit the latter part
Yay! It works now 😄
There is a command that compares things to have the same things in two different arrays to get the new one only with the things that both have in common.
Maybe i oversaw it but is there a command to compare what is NOT in common and get a list of the things that puts all the things not in common into a new array?
arr3 = (arr1 + arr2) - (arr1 arrayIntersect arr2)
should give you only things that are either in arr1 or arr2. But It will remove duplicate values too.
Ah, sounds good! I gonna give it a test (i will compare two unit loadouts - if you know i will fail beforehand, tell me before i write my script XD)
This will only work for shallow arrays.
You can always pushBackUnique to avoid duplicates
so probably not for more complex arrays than the one i get with the unitloadout @hollow thistle ?
If you have arrays in array it's not shallow array anymore. So yes, it won't work.
dang. So probably i have to write a bigger script for comparing these two arrays haha ^^ thought so already.
why cant i just say
if player buys shit, pay the shit, let em play 😄
You said it
anyone can confirm keyframe animation system is broken since the last update?
😑
preview in 3den works, in game objects just dont move along
same code was working before
Cant believe I wasted all that time tweaking my curve 🙄
ok, well.. disabled mods and it works (kind of).. only if I start the timeline manually OR set it to loop fml i'm just dumb. its not bugged.
can i break "[] spawn"? I mean, disable it when i dont need it anymore?
or can i ignore it since i wont have thousands of scripts running. I would say, probably just a bunch up to at max a hundred, maybe.
uhm ... wut?`
@queen cargo https://community.bistudio.com/wiki/spawn
i mean, break/disable a running spawn
ARGH i overscrolled XD
If a player uses the 'take control' option while being the gunner of an AI controlled helicopter - can that state be returned?
Release control you mean?
The state where the player is gunner and driver/pilot at the same time
Or you want event handler?
Hoping to avoid eventhandlers if possible
i was hoping that _unit == driver _vehicle and _unit == gunner _vehicle would both return true but they don't of course, makes sense
I'm trying to return if the gunner is currently the pilot or not - in a perfect world something like:
player has not taken controls: effectiveDriver _vehicle == driver _vehicle
player has taken controls: effectiveDriver _vehicle == player
Is it possible to create a vehicle without using createVehicle?
Does anyone know of a way to increase a vehicle's top speed? I have a boat I would like to go a little faster.
@craggy hound setVelocity but I only know how to make it so that you can set a vehicle speed with cursor, I do not know how to change the speed within the actual vehicle.
cursorTarget setVelocity [0, 0, 125];
ty
That makes them go up
0, 0, 0 stops them in place
Mess around with that, Idk how to mess around with speed inside the vehicle though
Is it possible to create a vehicle without using createVehicle?
Uhm... Wut? @tough abyss
@queen cargo Do you not get what I'm saying? How do you create a vehicle without using the createVehicle command
*Spawn a vehice
Reread what you just said, and then try to actually ask a question one can answer
So it's not possible? Or do you want to be a dick?
ill ask before spending the next hour looking for it and not finding it but, what would i have to do in order to have a script in the initserver.sqf refresh in order to have it effect AI which i have placed down mid mission via zues?
add the entity placed event handler to the curator
im sorry? i that one might be out of my expertise/ understanding.
ok ok i see what you ment, and i reread my msg and relised that i fracked up i ment is there a way to have a script set to refresh/ rerun after a set period of time in order to include units placed by zues. and if i use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Curator then how would i have to integrate it into the script?
If i am correct, you could spawn a scheduled script with while and sleep in it, to detect placed units on the map and give them the proper handlers. At least, that was the way i could imagine it but i am not a reliable source with scripting since i am not perfect with arma scripting.
Was anyone forseeing the time of 'getUnitLoadout' and got every single position with its function (like select 0 select 0 is the main weapon)?
You see what I posted above? That's the solution, use the curator event handlers.
use weaponState or primaryWeapon to return primary weapon of a unit
I am scripting a huge comparing shop script where i get a units loadout completely and put everything in order to be checked 😃 The unitLoadout command gives a static array, and i wrote down already most of the positions - yet i wonder if anyone came up with an already pre-done list
i am missing launcher select 1/5 - i cannot figure out what this position stands for.
this is what i meant @high marsh https://pastebin.com/AMuCLNM2
@tough abyss yes it is possible
@tough abyss I've sent a friend request, please accept it
Thanks but I’m not looking for new friends
Ok, that's fine
dont know why you wouldnt want to use createvehicle
hey folks. quick question. i need to know if a player is looking at a certain point. i'm pretty sure i've seen a function for that already once, but i can't remember.
anyone got a clue?
i can't just run cursortarget or similar, because the point is.. well.. invisible
so i figured just checking if the player is facing that direction, in combination with a range check should do the trick as well
getPos point vectorDiff eyePos player -> matches roughly cameraViewDirection of player
maybe swap eyepos and point pos out.
thanks! i'll check it out
Hi
I'm struggling with a localise and a format. Can't find much on the biki about it...
player addAction [localize format ["STR_ACTION_WEAPONONBACK",(primaryWeapon player)], {player forceWalk true; player action ["hideWeapon",player,player,101]},[], 1, false, true, "", "currentWeapon player != '' && vehicle player == player"];```
```SQF
<Key ID="STR_ACTION_WEAPONONBACK">
<Original>%1 on back</Original>```
I can't get my %1 to be (primaryWeapon player)
format [localize "str_ddd", firstElement]
also, what if the player changes weapon ;-)
perfect, working !
i'll deal with that kind of thing after 😄
I'm trying to understand 1 thing after another 😄
Hi everyone! I have a problem with static weapons. I can add magazine to turret by addMagazineTurret command, but player need to reload this magazine manually by menu. How i can reload turret by command or script?
Not possible afaik
https://community.bistudio.com/wiki/loadMagazine doesn't work in A3?
remove/add weapon maybe? should load the magazine in the added "weapon"
@winter rose every time i add new magazine to turret i should remove and add turret weapon?
I'm working with mortar, i will add shells one by one 😅
But it's works, @winter rose
magazines of shells right?
ok. if you tell us more about your use case, we may have a better solution 🙂
Yes, magazines with one ammo in them. Your solutions works, but i worried about perfomance in the game.
add all the magazines of the same type you want, then remove/add the weapon, this should do
if you had a magazine with more than 1 ammo (I guess) we could have used setAmmo
In current variant of system player add one magazine with one round. And player can't add more magazines, only after shot.
https://community.bistudio.com/wiki/loadMagazine doesn't work in A3? why question mark? It should work
@tough abyss i try to use this command with my turret and it didn't do anything.
How did you use it
@tough abyss
_mortar = mortar_2b14;
_magazine = "ACE_1Rnd_Mortar_HE_2b14_0";
_mortar addMagazineTurret [_magazine,[0]];
_mortar loadMagazine [
[0],
_mortar weaponsTurret [0] select 0,
magazinesAmmo _mortar select 0 select 0
];
You are trying to get magazine name from empty mortar?
@tough abyss Cause it already have magazine. I add it by addMagazineTurret command and try to reload it.
MP, mortar can have a gunner or not (in the moment of adding magazine).
You have to have gunner and I suppose you also need to check that turret is local
I think if i find a solution - i will solve a problem with locality.
For now only solution of @winter rose works for me:
remove/add weapon maybe? should load the magazine in the added "weapon"
The solution is loadMagazine command that has rules of usage, if you don’t follow them it might not work as intended
Now i test this command in single player, use standart turretPath, weaponName from config and classname of magazine, which already added in mortar (cause i can reload it from action menu and fire after reloading). And loadMagazine didn't work!
I try to use this command on other static turrets. Maybe i do something wrong.
@tough abyss i test loadMagazine on vanilla static 12.7 mm HMG, it didn't work
Tried reload vehicle player?
works perfect, but it's not what i want to do 😩
Then I don’t understand what you want to do
Irgendein deutscher Scripter hier?
Nein
Ok, try to explain my idea. I works with ACE 3 mortar system, i want to adapt them for RHS mortars. I create my own ammo, create my own magazines, own weapons and so on. In ACE3 mortar shooting looks like:
- Loader takes mortar magazine from ammo box. This magazine contains one mortar shell.
- Loader by ACE action add this magazine to mortar. In ACE3 it based on CBA EH (in them i see this code "_static addMagazineTurret [_magazine,[0]];").
- After loading first magazine loader can't add more magazines into mortar before anyone fires from mortar.
- When mortar loaded, shooter (it's can be a loader or other player) can sit on shooter's slot and fire this round.
So this system works perfect, i can reload and fire mortar by my magazines, by there is a problem. If i firstly load one type of magazine, and shoot from mortar, other type of magazine didn't load automaticaly, only manual by shooter. And if magazine added to turret but not loaded - 3rd article become broken 😩.
That is why i want to reload mortar after adding magazine to them by script. Deleting and adding weapon to turret after any reload works but i think that is not good for MP.
Sorry that i don't explain all problem at once.
So why reload command is no good?
because when loader adds magazine, shooter slot can be empty
That’s fine addmagazineturret reloads mortar regardless if gunner present or not, you just need to remove empty magazines forcefully before that
How i can check empty magazines?
@tough abyss Englisch bitte
Deutscher Scripter gesucht, bitte per PN anschreiben!
German Scripter wanted, please write via PM!
Dont need to check just remove mortar removeMagazinesTurret ["8Rnd_82mm_Mo_shells", [0]];
you can see all magazines with magazinesAllTurrets
@tough abyss works with removeMagazinesTurret. Thanks for your help! 🥃 🥃 🥃
How to spawn vehicle without using createVehicle?
createSimpleObject, if we stretch it a bit
is possible to remove refuel action from fuel trucks?
https://community.bistudio.com/wiki/setFuelCargo maybe try that?
@winter rose Ty, will test out later
@copper raven ty, i will try
as i understand setFuel - for vehicle fuel tank, but setFuelCargo - for refuel truck cargo
yup
if 0 - fuel truck can't refuel another vehicles
In theory
willing check on practice 😄
working nice
when getFuelCargo return 0 - scroll on all vehicles disabled. And you can't refuel from that fuel truck
I am attempting to make a intro scene for my terrain (for the main menu). I copied the example that is posted on the BI Wiki but instead of using the camera position I copied, it just shows the 3rd person perspective of the character placed. How do I get it to show the camera position I copied?
did you create a camera?
["InitDummy",["Vacant",[3789.36,4009.8,10.1264],98.2004,0.75,[-2.56602,3.3384e-006],0,0,485,0.3,1,1,0,1]] call bis_fnc_camera;
and where did you put this line?
{
["InitDummy",["Vacant",[3789.36,4009.8,10.1264],98.2004,0.75,[-2.56602,3.3384e-006],0,0,485,0.3,1,1,0,1]] call bis_fnc_camera;
setviewdistance 2000;
},
] call BIS_fnc_initWorldScene;
initintro.sqf
It has syntax error
Any idea why a mechanized squad (crew commander is group leader) refuses to actually move to the next waypoint after an unload waypoint? Everyone except the crew disembark, but they just sit around despite the grouper leader issuing the move order for the next waypoint.
Let me guess, driver has to be the group leader or things break with vehicles? Doesn't seem to matter in this case at least.
I'm using switchmove on the player in mp mission. When player moves or pressing rmb - animations ends.. I dont want it to end because of the player inmput. What should I do?
Disable player input
but I want to save possibility for the player to cancel animation in scroll action menu
Open display, player control will be switched to it
Or dialog
Whatever doesn’t let you move
If i am correct, i can make single picked players to any side i want if i put them in the respected group. Like "Hey, you're in a civillian car" boom, player is now civillian. Am i kind of correct?
You can join player to different group on different side
So, i just have to have the four sides ready. My standard, which is resistance, then a red, blue and a civ one. Am looking for kind of a direction. Can i check if a respective player is still in line of sight to an enemy?
thanksies!
sweet, i wanna work on two projects. Bit of diversity. Shop is slowly going, i think i got it ready to test in two to three weeks followed by a very basic vehicle based undercover script that orients itself towards reality (i actually do research stuff that seems not so important) But it is very very hard to see a person in a car, moving at over 15 km/h (9 mp/h)
<stares at antistasi where people know that you're the resistance miles away just by feeling the air humidity> 😄
Do vehicles have a 'base side' so i could "easily" check if the vehicle is west/east/civ/independet vehicle? Or do i have to make it manually?
escape char?
hrm. You have any example i can look at?
Empty vehicles are civilian side by default. They will take on the side of whomever has occupied the vehicle. That "new" side remains for a short time even after the occupants have left the vehicle.
empty vehicle - i knew that, yes. Hmm. So i have do a manual list for (all) the vehicles to give them practically a side, so, when a player enters a bmp, he will be seend by all others as 'east'
I could be mistaken but I don't think you can override the vehicle's side specifically without changing the side of the group the vehicle belongs to. You have to assign the vehicle to a group on the side with which you want the vehicle to be identified. I'm fairly certain this group has to be the same group as the occupants.
its more or less a constant check script that checks my vehicle database. If a player is in a certain vehicle, their side will be changed to the respected side of the editor-side of the vehicle (like, bmps are east side, hemtt are westies and so on) Its not really hard to do but... eh, quite some typing work haha ^^
and the vehicle takes automatically the side of the player entering.
It seems like my problem is the AI pathfinding and not anything specific to the unload waypoint type. The next waypoint in question is on a wooded hill, and if they are issued move orders anywhere in the tree line, they just freeze up at that point.
tried to teleport them a bit? Sometimes they unfreeze (at least for me) and move again.
Worth a shot. It seems like the pathfinding routine is choking on the amount of trees in this area or something like that. I'd expect the AI to refuse the move order if they didn't think they could travel there. Instead, they just sit there, as if contemplating how to get where they need to go.
Hmmm, i get my ai always into woods. Eventually also try out shorter waypoints. Cant tell if that may help but i guess worth a shot. AI is still struggling with lot of things ^^ So we have to give them slight pushes into the right direction hehe ^^
hello any KP Liberation folks here? I am looking for a scripting way to add the ACE Arsenal menu interaction to the Supply Box? really to shift from the scroll wheel menu option altogether, clear out the Supply Box contents, that sort of thing.
Do you just want a full arsenal? @dreamy kestrel ?
You could just spawn in a scheduler to clear the contents of the supply box, if thats what you want something with https://community.bistudio.com/wiki/clearWeaponCargo that on the line. And you could just add the ace line https://ace3mod.com/wiki/framework/arsenal-framework.html to the box itself over the editor, so it gets initialized with a full ace arsenal. @dreamy kestrel
Why do you need a new thread for it?
you could write it all in the init box as well, or with a trigger, or with a simple ace interaction. Various ways to do it. Sounded like that the box should be cleaned up regulary - i would automate it :3
What is the command to find the vehicle that you are currently in?
I want to mess around with setVelocity
vehicle player or objectParent player
@robust hollow Thank you, it's working, I can control my velocity in the car. But is there a way to go forwards where the player (me) is looking, because the values are static and take you to the same point unless you change them yourself
@robust hollow Ty, that's exactly what I needed
392 vehicle placed and with a script saved... yeah. My initial thought was "how hard can it be, making a list writing the names by hand" ...
oi fellas. quick question again, because i'm feeling really stupid today. i have a script that spawns particles around vehicle player. now the thing is, if i switch to a drone... i'm not vehicle player anymore, thus the effect isn't following me. anyone got an idea for simple workaround?
is there something like "current camera" or somesuch?
dont know about arma 3, maybe you could check for a dialog?
If you are in drone mode, a dialog might exist
that wouldn't really work, because i'd also need the position of the drone
i mean i could just check to what object the player is connected to
that would probably do it
it wouldn't work for generic cameras, etc. though, but maybe i can totally ignore that
cameraOn might work
I don't really understand, do you want to transfer the particle effect from the player onto the drone?
you have already been informed about the #rules and which one you violated yesterday. I'd recommend you have a read before you violate again.
for some reason i really can't make the target commands work
reveal, dotarget, commandtarget and yet... the gunner is pointing to god knows where
it worked a couple years ago, but now it's either broken or something changed and i dont know what
i mean, how hard can it be to have the gunner move his weapon at any point? very, apparently.
yup, just trying it on a sitting helicopter and game logics all around it, dotarget and dowatch mean nothing to it
lol even if i create a laser target, it just won't point at it
maybe i should just script the bullets.
are you trying to command a gunner that is part of a group?
not sure if those commands work if the gunner has a group leader
it worked once. maybe it changed. i'll test it.
i had him join an empty group
thing is, dotarget seems to work... if the object is like right in front of it. so i assume they won't target, because for some reason they cant "see" it. but even using reveal 4 on it doesn't change that.
i'm pretty sure this stuff happened around the time we got the sensor overhaul
now everything is weird won't work as before
i'm just really curious why there aren't more posts about this on the forum. either i'm the only one who wants a vehicle to target something in the distance... or i'm the only one who does it wrong.
@winter rose createSimpleObject made he vehicle bit it was not drivable, i need it to be drivable
Any ideas
Reaper if your sole purpose is to get around battleye script filters, then I recommend stopping now.
If it's your server, why not remove the filter then? or execute your script serverside where the filter doesn't apply
You can?
Well yes.. createVehicle is not disabled by default
@west grove animateSource Example 2 is exactly how to animate turrets.
yeah, i was thinking about manually adjusting the turrets, but to me that seems to be quite overkill
i would constantly have to calculate the values just so the turret points at where it should
jesus, just two years ago, you'd use dotarget and the vehicle did exactly that
What vehicle are you trying to control? mabye try putting the target on datalink
kajman
Try putting it on datalink reportRemoteTarget assuming it's far away
@tough abyss is it working as you want then?
@digital hollow can't get it to work
now i'm thinking.. i could just switch to guided missiles.
but again, no luck 😄 god damnit
trying my luck with spawning and BIS_fnc_DirTo now, but yeah, obviously that won't work out, because it's not taking the up/down rotation into account
or maybe it is and i'm just stupid, what do i know
5 hours of wasted time, i'm dying
at this point i'm considering to record a flight path, shoot manually, adjust everything to fit the results and be done about it
@west grove
https://community.bistudio.com/wiki/BIS_fnc_dirTo
In Arma 3 use obj1 getDir obj2 instead of BIS_fnc_dirTo!
you should work with vector yes for 3-dimensional movement
yeah, i hate working with vectors. usually BI already has a function for everything, but in this case probably not
i'm recording a flight path now. who knows, maybe it'll look better anyway
private _vectorDifference = getPosASL obj2 vectorDiff getPosASL obj1;
_directionalVector = vectorNormalized _vectorDifference;``` you should be able to work something out? we're here to help 😃
usually i am, but i'm crunching on this project for 4 days now from morning to evening, and i'm at a point now, where i'm feeling it 😄
it's a "do something in 7 days"-thing, and i only have 2 days left
2 and a half or so
that's why it is even more painful having to spend hours on stupid stuff like "make a vehicle hit something"
_Stratis_Airbase_Units_Array = [];
_script = {
{
if (side _x == west) then {
_x enableSimulation false;
_Stratis_Airbase_Units_Array pushBack _x;
};
} forEach thisList;
};
waitUntil {scriptDone _script};
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];
Error scriptDone: type code expected script
I must not see it...
scriptDone takes a script
not a piece of code
script is a script handle that spawn returns
also you are never actually executing your _script
I assume you'd want to do that
Oh of course, missing spawn ahah
Even if you spawned your _script though that wouldn't make any sense in combination with the waitUntil
because it delays anyway
you might aswell not spawn and not waitUntil and not put your script into a variable and just run it directly. same result
yes
private _Stratis_Airbase_Units_Array = thisList select {
if (side _x == west) then {
_x enableSimulation false;
true
} else {false}
};
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];
And here is the whole script in a shorter and slightly faster variant.
private _Stratis_Airbase_Units_Array = thisList select {side _x == west};
{_x enableSimulation false} forEach _Stratis_Airbase_Units_Array;
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];
And even smaller. but probably slower
private _Stratis_Airbase_Units_Array = thisList select {
private _res = side _x == west;
_x enableSimulation !_res;
_res
};
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];
Or maybe this 🤔
But at that point one might aswell just
Stratis_Airbase_Units = thisList select {
private _res = side _x == west;
_x enableSimulation !_res;
_res
};
no. as @still forum said, createVehicle is made to… create vehicle. if the server is yours and you can run the script server-side, as you say, it should be no problem.
TL;DR: use createVehicle; if you can not, tell us why
Kk, will just use createVehicle
👍
Hey there, I have just tried to create a mission where the npcs have dialogue and speak to the player. I have gotten all the scripts to work with the correct callsigns however, as soon as they are grouped, the names will get mixed up. So for example, lets say Jack says, "hello". Instead of the name Jack being next to it, it is replaced with Brandon's name (another group member). I have tried different solutions and i am not too keen on getting them to speak on group chat because then their names are just numbers. Any advice would be much appreciated.
maybe setName could help. Using kbTell?
hi. i try to use diag_captureSlowFrame . Install profiling build from steam, got profiling label in launcher. when try to execute diag_captureSlowFrame ['total',0.003]; gor error:
23:54:42 Error in expression <diag_captureSlowFrame ['total',0.003];>
23:54:42 Error position: <['total',0.003];>
23:54:42 Error Missing ;
any idea what i'm doing wrong?
when i try to get the player's vehicle he's riding i still get the player. I use for testing this:
_blah = vehicle (_list select 0);
Got it.
_vehicle = ((typeOf (vehicle (_playerList select 0))));
Hm, i cant figure out why i cant set a selected players side/group. I used allplayers, picked a spot (array 0, because, just me for now and testing) and tried to put me in in the east-group:
hqEast = createCenter east; (just to be sure)
playerEast = createGroup [east,false];
_playerList = allPlayers - entities "HeadlessClient_F";
_thePlayer = _playerList select 0;
_thePlayer joinSilent playerEast;
Throw me a generic expression error. I tried many different ways now.
... got it ... again. Forgot i needed an array -.-
@lofty spear you didn't launch the profiling version of the game.
No matter what the label in launcher says ^^
Could someone possibly help me with using a trigger to drive a function.
I want a trigger to spawn this function -- nothing more than trigger a screen message.
["message on the screen",3,5,8] spawn BIS_fnc_EXP_camp_SITREP;
but defining the trigger action as,
m = ["show message on the screen",3,5,8] spawn BIS_fnc_EXP_camp_SITREP;
(obviously) isn't correct... I get an error with using 'call' instead of 'spawn' too.
why does the "modelToWorld" function seem to be inherantly offset from my player using simple code??
s2 = player modelToWorld [0, 1, 0];
s3 = player modelToWorld [1, 0, 0];
_fuel = createVehicle ["VR_Area_01_square_1x1_yellow_f", s1, [], 0, "NONE"];
_fuel = createVehicle ["VR_Area_01_square_1x1_yellow_f", s2, [], 0, "NONE"];
_fuel = createVehicle ["VR_Area_01_square_1x1_yellow_f", s3, [], 0, "NONE"];```
https://imgur.com/xVCEELv as you can see, it's nearly 3 meters to the right and 2 meters forward.
Well for one modelToWorld returns world coordinates. createVehicle takes PositionATL.
Also createVehicle doesn't necessarily place at the position you give it
Because it tries to place vehicles as such as they won't collide.
What functions would you use if you were to make a grid of 1x1 vr shapes there?
getpos is kinda weird because of the heading parameter
Add _fuel setPosWorld s1 after each of the createvehicles
that forces it onto the correct pos
Sweet, I understand. Thanks bro
Also you might want to use modelToWorldVisualWorld as that includes rendering interpolation and will be more accurately matching what you see.
Whereas modelToWorld accurately matches what Arma sees internally
I’ll be real with you I don’t understand the visual methods.
However if you suggest using that I will play with that method
Arma only updates positions once a position update comes in
The visual version interpolates the position between the last known, and the assumed future position
non visual version the player teleports around. In the visual he moves smoothly
Alright, I can see how that is useful. I believe that I do understand what you're saying, I appreciate your responce, let me play with the visual methods so I can understand better.
-- Additional question,
I'm trying to pull variable name of trigger on activation
_trg setTriggerStatements ["{typeOf _x == 'CargoNet_01_box_f'} count thislist > 0", "_vname = name this; hint _vname;", "hint 'off'"];
_vname = name this; hint _vname; well - that's clearly not what I need, any solutions there?
if you do a publicvariableclient directly from client to client. Will it be P2P or will the server still regulate that traffic
you cannot turn object into variable name really
You can try str this and hope the result is what you want. Which will only work if vehicle var name is set, and I don't know if triggers even support that
Maybe https://community.bistudio.com/wiki/triggerText that's waht you want?
@proper sail should still go through the server
alright thanks
Im just wondering, because the Headless client on A2 is not server binary. So to reduce some network traffic i was thinking to directly pubvar from hc to client. But if it still passes through the server i guess it will not have any benefit
hi guys. Im executing a killed script in my Eventhandler which works nicely with pre-placed units, but they wont trigger on units placed by Zeus. Anybody know whats going on here?
this only happens on dedicated servers btw
where does your eventhandler get added?
in cfgvehicles
killed = "_this execVM '\WHwalkers\warhound\scripts\killed.sqf';";
@still forum I have an hit EH that do trigger though.
🤔 confusing
Maybe zeus placed units are a different classname?
there is a curator object create eventhandler that you need to add to the zeus logic
afterwards though.. Don't think so
maybe check allVariables on the object and see if zeus sets some variables on spawn
ok ty
hello, a quick question of style:
// this?
waitUntil { !isNull player };
// or this?
waitUntil {
!isNull player
};
// or this???
waitUntil
{
!isNull player;
};
// ok, you asked for it
waitUntil
{
!!!isNull player // notice no semicolon
};```
@player == player``` in SQS 😄
So lou, is that your style for all statements with {}
waitUntil { }; one-lined if the condition is easily readable
else
waitUntil {
condition1
&& condition2
&& condition3
};```
I'm formatting legacy code, so i have to make a decision for the 'proper' style
I prefer the Allman style:
command
{
}```to the other style
command {
}```generally, but for some commands I can make an exception
I started with the former, and then eventually came to prefer the latter
heretic!
im guessing that rule of "Whichever you choose is fine, just be consistent" is in effect?
Although some may make a mission for their unit to arrest you.
How about this line
if (hasInterface) then { execVM "misc\gps_marker.sqf";};
I don't need the inner ;?
Okay, but I don't need the inner semi colon if its just one statement?
If it's the end of the scope
You can have as many statements in there as you want, the last won't need a semi colon
but still, sexier/more pro if you do add it :3
Soooo there a script lurking out there in the land of c++ , im looking for a script where if someone goes outside of my map , the user will have “X” amount of time to get back inside in map otherwise theyll die and respawn ..... there anything like that out there that i can use?
@lusty badge like the Warlords gamemode?
Idk ive never seen warlords gamemode tbh
Basically would act as a boarder between the map terrain and the edges ... idk how to put it in words but its the area outside the map
Like if u pull up the map u wont even see ur position it’d be a back area
Black*
Go to official server and try it, if you go into a zone you are not allowed to be in you will see a countdown appear and you will die if it reaches 0
I cant find anywhere how to spawn a jdam which blows up on trigger
can someone give me the script
Scenario: East-Player sits in vehicle.
What i want: How can i make every other player be able to get into the vehicle too, without changing their faction?
maybe setCaptive the crew @keen bough
Thanks, i will look into this
Sadly, not really usable with my system. But since its a coop-setting i use a non automated system for my concealment.
is there command to check - what is inside the Variable?
i dont get it how it works.
example: i have variable Car
how getVariable will help to check what is inside
you have a variable named “Car” and want to know the value of that variable, right?
yes
Well it depends on what you want to do with that value
You could just print it with systemChat Car
What kind of data are you storing in that variable?
how can i change color of smoke?
emitter = "#particlesource" createVehicle ([100,100]);
emitter setParticleClass "MediumSmoke"; //"MediumSmoke"
emitter attachTo [car, [0,3.5,0.3], "car"];
if BIS_fnc_moduleEffectsSmoke is anything to go by, you'd be doing something like this:
_emitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal_02",8,0,40,1],"","billboard",1,_particleLifeTime,[0,0,0],[0,0,2*_particleSpeed],0,0.05,0.04*_particleLifting,0.05*_windEffect,[1 *_particleSize + 1,1.8 * _particleSize + 15],
[[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.7*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.6*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.45*_colorAlpha],
[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.28*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.16*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.09*_colorAlpha],
[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.06*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0.02*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0*_colorAlpha]],
[1,0.55,0.35], 0.1, 0.08*_expansion, "", "", ""];
hi, i was try to make a "modular" function for loadouts to be used by my Unit. But i struggle in a Problem, maybe someone can give me a hint. The New function won't work, but no errors at all, even the debug console gave a "true" back. Before i was try using this, i was use a similar function but without the camo pattern switch, which was work flawless.
code https://pastebin.com/RGpNhi9r
in my description.ext i have
// Functions
class CfgFunctions {
class pb21 {
class loadouts {
file = "core\fnc\loadouts"
class bundeswehr{};
class loadoutActionsBW{};
};
};
};
class Params {
class Camotype {
title = "Uniform Typ";
texts[] = {"Flecktarn", "Tropentarn"};
values[] = {0, 1};
default = 0;
};
};
And please be fair, i am a beginner in scripting ^^ 😄
what do you mean when you say it wont work?
It won't assign the Loadout
it sets the variables and rank before it?
yes
it first sets ACE3 Traits, the the Rank after that the Uniform Camo pattern then the setUnitLoadout command
private ["_uniform1","_uniform2","_headgear1","_headgear2","_headgear3","_vestLeader","_vestMedic","_vestRifleman","_vestGrenadier","_vestMarksmen","_vestMachineGunner","_backpack1","_backpack2","_backpack3","_backpack4"];
add this above your _camoType == 0 if statement defining those variables, or change the way that works so you can use params instead maybe (only because private array is slow).
all those variables are nil in the function scope because theyre only defined in the if scope.