#arma3_scripting
1 messages Β· Page 655 of 1
-
That is a really bad approach. What if more units are created later?
-
In MP you should use MPKilled
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPKilled
and the EH should only be added once -
Why do you arbitrarily remove EH id 0? Get the correct EH ID:
https://community.bistudio.com/wiki/Magic_Variables#thisEventHandler -
Some of the commands you're using require special locality handling, for instance:
https://community.bistudio.com/wiki/removeAllItems
takes local arguments
- I know, want to get this to work first
- okay
- didn't work what is stated in the documentation. 0 works for now
- yeah, the removeAll stuff is flaky
this is of course terrible and very bad. that is my first approach of doing things π
I am blind man trying to climb a mountain
Not sure what you meant by "EH should only be added once" I only add it once for each returned item, or what do you mean?
when you put it in initPlayerLocal it gets added for each connecting client
It should preferably be only added by the server
Makes sense
What is best perfomance wise method to :
I spawn "Tochka-u" with
this setVehicleAmmo 0;
after 2hrs=7200 seconds i want send ammo to tocka-u
this setVehicleAmmo 1;
my curr implementation
[] spawn {
if (isServer) then
{
waitUntil {sleep 7200};
{
_tochkaU = setVehicleAmmo 1;
};
};
};
first of all that won't work (you wrapped the setVehicleAmmo part in { } + syntax error)
second of all if (isServer) then {[] spawn{...}}
third of all there's no need for waitUntil (and your waitUntil is incorrect). you just need sleep 7200
fourth of all _tochkaU is not defined
fifth of all the syntax is obj setVehicleAmmo percent (it's a binary command)
Hi, can I ask a useless question xd?
I have to do a function that if you are not "independent" or have a specific SteamID, you cannot do a certain thing
So what's the question?
I have the code, but I don't know how to make the
or
hola = ["XXX"];
if (!(getplayerUID player in hola) or (side player != independent)) exitwith
{
hint "x";
};
that's don't work IDK
missing )
No, was my mistake writting here
where do you exec that?
in a script, the function I want is that if it does not meet the above requirements, it will not create a dialog
it's fine
I don't know why you say it won't work
maybe you're doing it wrong
post the full code
Can I send you to DM?
you can post it here with a description π
What is a video supposed to tell me anyway?!
Post the code
No DM
https://gyazo.com/e2840c172d0691cd68ce74541ee1df69 That's a short video, showing you that it don't work
I'ts now right?
You don't need the complete code, I just don't know why this code doesn't work.
I already told you that it's correct
It doesn't work because you're doing something wrong in the code
Imagine that this is the whole code. Why is it not working?
Called at the wrong time.
Because if THAT is the code, it will work
Btw..
You currently say:
- player is NOT in UID list
- OR is not independent
So if in the list, or independent, it will show
If in the list and independent, it will show.
If not in the list and not independent, it will show
So, how can I make that if a player is on the list and is not "Independent" then it doesn't hint?
By changing the statement to meet that requirement
if a player is on the list and is not "Independent"
orand
if !(getPlayerUID in hola && side player == independent) exitWith {
hint "you're not on the list or independent";
};
I'm trying to use BIS_fnc_moduleRespawnVehicle to create vehicle respawn sqfs. No matter what I put in parameter 4 (Code) I seem to get an error for either "Local variable in global space" or "Generic error in expression". I've tried using _vehicle (defined in params), _this, _this select 0, newVehicle, and <newVehicle>. Any ideas what to pass? The script works fine when manually placed in the module
https://community.bistudio.com/wiki/BIS_fnc_moduleRespawnVehicle
what's the best way to go about checking which way a door opens?
In arma3, do all exterior building doors open outwards?
Doors are animations within an object, so not really possible to get information from it.
As for exterior doors; usually they open outwards, but not all objects may follow the same "rule".
There's an forum article with the same question and some scripts which may be useful: https://forums.bohemia.net/forums/topic/229618-return-direction-of-a-door/
However I guess the only "perfect" method is to make a list of all the doors of each building and define the direction (and side) it opens.
It may be possible to calculate it based on the animation settings in the configs, but no idea how to identify which door is which.
I already know how to identify which door is which
I actually was reading this same forum post the other day
Main issue is that you don't know how a door is placed in an object, so even if you know which door it is and how it rotates, you still don't know from which position into which direction.
Have seen this question pop-up a couple of times with the same result; nobody knows how to do it reliably.
Have you tried wrapping the code in {} or ""?
Also, as the name implies that function is designed only for internal use by the vehicle respawn module, so it isn't very well documented. You might have better luck spawning the module itself and syncing the vehicle to it.
To understand it better, try finding the function in the editor Function Viewer under Tools, so you can see how it works. Or look up one of many vehicle respawn scripts that aren't designed for internal module use...
I've wrapped it in {} but I haven't tried making it a string with ""
I'm hoping to avoid use of the respawn module itself to make adjustments much easier as it's being maintained in a github repo and merging sqm changes is a pain
I don't mean place it in the editor, I mean spawn it scriptwise using createUnit and...whatever the hell the sync command is
synchronizedObjectsAdd
_init = _this param [4,{},[{},[]]];
First of all the init can be both a code ({}) and array (in format [code, params])
Second of all this is how the function executes it:
_initScript = if (typeName _init == typeName []) then
{
([_newVeh,_veh]+(_init select 1)) spawn (_init select 0);
}
else
{
[_newVeh,_veh] spawn _init;
};
And you get that error you described for putting any variable name in params/private without starting it with _ (aka local variable)
play = ["videoName.ogv"] spawn BIS_fnc_PlayVideo; trying to play custom video from a mission file. The video is in ogv format. The game just crashes instead. Help....
the script is good, the file might not be. let's head to #arma3_troubleshooting
@winter rose thank you
I got 2 arrays:
_default = [a,b,b,b,c,c,d];
_current = [a,b,b,c,c,d];
How do I find out, which element is missing in _current?
@languid oyster Depending on the values inside the array you can use _missing = _array1 - _array2
returns []π
["a","b","b","b","c","c","d","f"] - ["a","b","b","c","c","d"] returns "f"
yeah
but I think we should also count every missing element?
I don't know which one you meant @languid oyster
Idk what he wants
Count unique elements in arrays and get difference?
I am doing a rearm script. I got the problem, that turrets have multiple magazines of same type. My thought: Search the default mag loadout, look the current loadout, compare both.
Then slowly add one missing mag after the other. If no mag is missing, search for the one with less rounds than default mag round count, and replace that
It sure does, I wanted more immersion π
What about just apply'ing through the loadout mag array and checking status with magazine commands?
Can do the timing in the loop
hmm, will have a look @slim oyster
@languid oyster
then do this maybe?
_unique = (_magD arrayIntersect _magD) apply {
[_x, count _magD - count (_magD - [_x]), count _magC - count (_magC - [_x])]
};
{
_x params ["_mag", "_cntDef", "_cntCurrent"];
for "_i" from 1 to _cntDef-_cntCurrent do {
_veh addMagazine _mag;
sleep 3;
};
} forEach _unique;
_magD is default mags
_magC is current mags
@little raptor will apply the routine. Let me see, if that works
hopefully some can help here ive ran out of idea's. im trying to added some Script's to my liberation mission file after following docs for install and lauch for testing i get a error. .CfgSounds: Member already defined. been going at it all day trying to find the issue but no luck
it means you have two entries of the same name in CfgSounds
ohhhhh right ill have a look again see if i spot anything π thank u for fast reply
note that it might come from an include done twice
wish the rpt file told me where it was lol its like finding a needle in hay stack
doesn't it say which entry?
Yep it doe's think i found what its possibly going on about but now i got to figure i way to sort it.
kowning that that erorr was a double up i ended up opening all the main files for the mission and searching everything for cfgsounds and their is a match
Is there a way, apart from onToolBoxSelChanged, to find out what selection the user has made on a toolbox? And is there a way to set a toolbox selection via script
Trying to make the rhsusf_M1238A1_M2_socom_d respawn with the woodland camo. Any idea what I would input in this code for that to happen?
if !(isServer) exitWith {};
private _code = {
params["_veh"];
_veh removeMagazines "RHS_48Rnd_40mm_MK19_M1001"; //Removes canister ammo from Mk19 variants
_veh removeMagazines "rhs_mag_100rnd_127x99_mag_Tracer_Red"; //Removes default magzines
for "_i" from 1 to 8 do {_vehicle addMagazine "rhs_mag_200rnd_127x99_mag_Tracer_Red"}; //Adds n magazines
_veh loadMagazine [[0], "RHS_M2", "rhs_mag_200rnd_127x99_mag_Tracer_Red"]; //Loads turret magazine
[_veh, 26] call ace_cargo_fnc_setSpace; //Sets cargo space
[_veh, 80] call ace_cargo_fnc_setSize; //Sets cargo size
["ACE_Wheel", _veh, 4] call ace_cargo_fnc_removeCargoItem;
[_veh, 2, "ACE_Wheel", true] call ace_repair_fnc_addSpareParts; //Adds spare wheel
_veh setPlateNumber "1/7 Cav"; //Set plate number
[
_veh,
["W",1],
["hide_rhino",1,"hide_ogpkover",0,"hide_ogpknet",1,"hide_ogpkbust",0,"DUKE_Hide",1]
] call BIS_fnc_initVehicle; //Handles vehicle appearnence```
I've tried putting "woodland" here:
["W",1],
but nothing. I'd appreciate any suggestions
I'd like to create a "Simunition" script. Simunition is ammunition that is definitely painful, but does not kill - useful for training scenarios. I'm trying to make it ACE compatible, with a specific magazine, so that if you have a specific magazine loaded in your weapon and fire at another player, it knocks them out for a few seconds but does not kill them or otherwise injure them (would be cool if it would include a temporary pain effect from ACE though).
Right now, I've written a cfgPatch to create a new 5.56 magazine variant from RHS, and then I'm also retexturing the magazine orange to indicate that someone is loaded with simunition. I've tried a couple ways to handle the "knockout target but don't hurt them" part of the script, but I'm having difficulty.
Would anyone be able to point me in the right direction?
My first idea was to have a handleDamage event handler running on each player at all times, which checks to see if the ammunition is simunition or not. If not, it'd just allow damage, and if yes, then it wouldn't allow damage. I ran into two roadblocks - My group has 50-60 people at events and I'm worried an event handler on each of them would cause lag in a heavy firefight when a lot of hits are being taken, and also I could not find a function to determine what type of ammunition you're being hit by.
I tried finding a taser script to look at for guidance but it seems like all the taser mod creators have obfuscated or .ebo'd their mods π¬
It probably uses lb or lnb commands
Try lbCurSel or lnbCurSel on it, see which one does the trick
https://community.bistudio.com/wiki/CT_TOOLBOX
Hmm, I was thinking the same however my laptop canβt run ArmA, will have to wait till Iβm back at my PC π
Look in the config for that vehicle (right click on a vehicle in Eden -> Find in Config)
Then check its animationSources/textureSources to see which one does what you want.
You can either use BIS_fnc_initVehicle or write your own code to set anims/textures.
https://community.bistudio.com/wiki/BIS_fnc_initVehicle
if you're modding try hit = 0 and indirectHit = 0 for the ammo.
https://community.bistudio.com/wiki/CfgAmmo_Config_Reference
Also the handleDamage EH does return the projectile. So you can find out what you're being hit with
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
_ammoType = typeOf _projectile;
Hi all, does anyone how to sequence An Ai Catapult Launch from the USS NImitz while using the CAT shuttle from the Asset Browser
I'm in the config window, how do I check it's animationSources/textureSources
Ok, thx i've also found some scripts in the Nimitz addon folder
@little raptor thank you! I'll try that
I think ACE does overrule the damage handling if I remember correctly though
It's very obvious. Look at the "tree" on the left. You'll see AnimationSources and TextureSources (you must first navigate here if you don't see them: configFile >> "rhsusf_M1238A1_M2_socom_d")
You can expand those tree items too. Those that have the property source = "user" in them can be customized by you.
Once you have what you want to modify, simply use its config name with BIS_fnc_initVehicle
Thanks!
yes it does
that's why creating a new bullet is recommended
if you're modding try
hit = 0andindirectHit = 0for the ammo.
Ahh understood! Thanks!
_veh,
["Woodland",1],
["hide_rhino",1,"hide_ogpkover",0,"hide_ogpknet",1,"hide_ogpkbust",0,"DUKE_Hide",1]
] call BIS_fnc_initVehicle; //Handles vehicle appearnence```
I tried >_<
I did it! It was supposed to be rhs_woodland ^_^ Thanks again!
For class names, are wildcards a thing? Like instead of listing all rhs_ i can just have rhs_*?
hi everybody. I search a solution for get position of an object in a lbadd array.
I explain :
I have a listBox and A mapView.
My listBox set all Object with "Land_Building_exod" classname.
I want, when i click on the object in the lbadd, set the position in my mapView. But I search and i don"t know how to do that :/
Is there a way to force AI to drive over a shallow part of a river with a boat that the default AI behaviour refuses to cross?
save the array of objects on the display with setVariable and then select from it via lb index
Huum explain ?
On mission start (if the array of objects is static, say, does not change during the mission):
TAG_selectableObjects = allMissionObjects select {typeOf _x == "Land_Building_exod"}; // instead of allMissionObjects ofc how you return the objects
Display is opened, fill the listbox:
{
_ctrlListbox lbAdd format ["Building %1", _forEachIndex];
} forEach TAG_selectableObjects;
When another entry is selected, eg via onLBSelChanged
params ["_ctrlListbox", "_index"];
_building = TAG_selectableObjects select _index;
My problem is not for add my buildings on the listbox π
Here my listBox :
class ListBox: Life_RscListNBox
{
idc = 95002;
sizeEx = 0.041;
coloumns[] = {0,0,0.9};
drawSideArrows = 0;
idcLeft = -1;
idcRight = -1;
rowHeight = 0.050;
x = 0.221176 * safezoneW + safezoneX;
y = 0.28088 * safezoneH + safezoneY;
w = 0.112148 * safezoneW;
h = 0.506 * safezoneH;
onLBSelChanged = "_this call life_fnc_pmvSelected;"
};
And My pmvSelected don't execute :/
private ["_control","_selection","_spCfg","_sp"];
_control = [_this,0,controlNull,[controlNull]] call BIS_fnc_param;
_selection = [_this,1,0,[0]] call BIS_fnc_param;
Hint "test";
I try just a hint test in my pmvSelected but nothing.
And i can't get an info of my lbadd
My OpenDir.sqf do this :
disableSerialization;
createDialog "life_menu_dir";
//chpmv_aut & chpmv_dep
_list = CONTROL(95000,95002);
_pmvAll = [];
{
_pmvAll pushback _x;
} forEach (nearestObjects [[worldSize/2, worldSize/2],["chpmv_aut","chpmv_dep"],worldSize]);
{
_list lbAdd format ["PVM - %1",vehiclevarname _x];
_pos = getpos _x;
_list lbsetData [1,str _pos];
_list setVariable ["data",_x];
} forEach _pmvAll;
And this working fine
But i can't have the data, this return always any
BIS_fnc_param is deprecated
Use param/params
no
It working, and now nothing ... Fucking eventHandler.
Just a hint "test"; wont work
are you sure the function is setup correctly?
So, Im trying to check a variable's value but it never returns anything. I'm execting the code on a player (dedicated server) and its returning nothing.
_this getVariable ["HALs_money_funds", 0]
how did you set it?
Each unit is supposed to have it attached. I'm using a script made by HAL for a shop and I just wanna check a player's money. https://github.com/HallyG/HALs_Store/wiki/Usage#get-money
so why not use those functions instead?
@exotic flax yes my functions setup properly now. I can have my selectedIndex by LbCursel but not by the params ::
Tehy arent working either
I try running [_this] call HALs_money_fnc_getFunds; and it returns nothing
params [
["_unit", objNull, [objNull]]
];
(_unit getVariable ["HALs_money_funds", 0])
is what its params are from its function file
_this equal ?
what?
what if you change it to player? perhaps your _this doesn't exist or is something else
_this return a selectedIndex or something else no ?
it should be the unit or player you want to check
It returns an array with 2 variables: params ["_control", "_selectedIndex"];
So you have the control and the index, which will allow you to retrieve the value you need
Okay [player] call HALs_money_fnc_getFunds; this worked but im only getting the value of my own money.
I need to replace player with whatever I need to use for another player
in that case you need to get the player object of the other player
a bit hard to tell you how without knowing what you want, have and expect
Yes i know, i've my return @exotic flax But it doesn't work with the param ... I need to use my lbcursel like that :
_dialog = findDisplay 95000;
_list = _dialog displayCtrl 95002;
_sel = lbCurSel _list;
_pmv = _list lbData _sel;
_pos = call compile format ["%1", _pmv];
I welcome it all Grez. I really need to do this lol
params ["_control", "_selectedIndex"];
_selectedValue = _control lbValue _selectedIndex;
_selectedData = _control lbData _selectedIndex;
So uh, how does refering to a player object work?
again; without knowing what you want, what you have and what you expect it's not possible to give a single answer on that
Well I dont know what I really need to tell you. I have a player who isn't me on a dedicated server, Ive got debug console, and all I want is a way to do [<unit>] call HALs_money_fnc_getFunds;
Like replace unit with that player.
Does the other unit have a variable name?
No
in that case you'll need to loop over all the players, check if it's the one you want, and use the object in that function
What do you mean loop?
{
if (profileName _x == "Name of player") then {
hint [_x] call HALs_money_fnc_getFunds;
};
} forEach allPlayers;
Wow so I just replace Name of player with their exact name and i get it?
btw... you might want to check the wiki on how to do stuff and learn how to script SQF, because you should at least know the basics if you want to make modifications (instead of just Copy&Paste from random sources)
I do refer sometimes but scripting isn't really my favorite thing in the world lol
because this Discord is not to write stuff for free, we help those who at least are trying themselves...
and if you don't like scripting, simply don't π€£
I know that wasn;t my intent mate I didnt know referring to a person required a script like that lol seemed like an easy thing but apparently not
That's why I asked "How" instead of "Can you"
there are hundreds of ways to do that, but each one depends on the situation
which is why I asked for more info
Right well thanks for the help. The thing you wrote unfortunately didn't work when I put it into debug console
I assume I'll need to find some way to refer to people, or rather just assign all slots a variable name
And then figure out how to find what variable each player is under.
I was thinking about
- use unitCapture/unitPlay to manually find path over the shallow part. (drawback: no engine sounds)
- use an agent as driver and setDestination with "LEADER DIRECT" as planning mode. (drawback: can't get the boat to go at full speed)
manually find path
what?
agent as driver and setDestination with "LEADER DIRECT"
and how is that different than simply giving the AI waypoints? Hint: the answer is none
- record a path with unitCapture where you cross it and play it with unitPlay for the AI boat when it comes near the shallow
that's not called "finding a path"
- agents with setDestination "LEADER DIRECT" will just go directly to the destination disregarding any obstacles (like soldiers getting in to vehicles and walking through walls).
no they won't
I have tested both of those methods they really work. But yes, they are not real pathfinding methods, just best approximations I could come up with.
What I meant is that "LEADER DIRECT" doesn't work on vehicles.
It's just an "animation" kind of thing. Obviously infantry only.
It does, just give a destination to the agent and put the agent into a boat. The boat won't go through ground but it will go over that shallow part that the AI would not.
So you mean give the destination BEFORE putting the agent into the boat?
That might work. I never tried that
my follow up questions would be:
is there a way to have unitPlay make engine sounds?
is there a way to make agents drive at full speed?
The first one is probably not possible. You can turn on the engine but you can never rev it up
The second one is better done with setDriveOnPath
But not compatible with boats
I just managed to do this, im not sure how can it be used... but here it is, maybe some one find it usefull
waituntil {!isnull(findDisplay 12) };
//poly = allMapMarkers apply {getMarkerPos _x};
//systemchat str _poly;
//inPolygon polygon
poly = allMapMarkers apply {getMarkerPos _x};
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
params ["_map"];
//poly = allMapMarkers apply {getMarkerPos _x};
private _colorBLU = [0,0.3,0.6,0.5];
private _colorOP = [0.5,0,0,0.5];
private _colorIND = [0,0.5,0,0.5];
_sub = 64;
_radio = worldSize/_sub;
_r = (_radio*0.866);
Puntos = [];
for "_y" from 0 to _sub do {
for "_x" from 0 to _sub do {
if (_y%2==0) then {
_npos = [2*_x*_r,_y*_radio*1.5,0];
if (!(surfaceIsWater _npos) && _npos inPolygon poly ) then {
Puntos pushBack _npos;
};
}else{
_npos = [(2*_x*_r)+_r,_y*_radio*1.5,0];
if (!(surfaceIsWater _npos)&& _npos inPolygon poly) then {
Puntos pushBack _npos;
};
};
};
};
{
_vertices = [];
for "_i" from 0 to 5 do {
_vertices pushBack (_x getPos [_radio,(360/6)*_i] );
};
for "_i" from 0 to 5 do {
_punto_2 = _i + 1;
if (_punto_2 > 5) then {_punto_2 = 0};
_map drawTriangle
[
[
_x,
_vertices select _i,
_vertices select _punto_2
],
[0.5,0,0,0.5],
"#(rgb,1,1,1)color(1,1,1,0.5)"
];
};
}forEach Puntos;
}];
It makes exagonal areas im trying to use it in a dinamic mision im working on it... but yea... fun to code, but no idea where to use it lol
why do you use a global variable for "Puntos" (whatever that means)?!
is there an oposite function to BIS_fnc_relPosObject ? #getRelativePositionOfObjectFromSource
worldToModel something?
"points"
Yep I forget that, still needs some work.
Puntos is the center of the hexagon, I used it global because I generates the points outside the event handler
Then I move it all into the event handler to modify the βpolygonβ in real time using marker on map
https://community.bistudio.com/wiki/BIS_fnc_traceBullets
Does this have a local effect or a global effect?
Must be local. No point to make it global
Anyone know how to trigger this one when an infantryman on foot uses thermal vision?
if (currentVisionMode player == 2) then
{
setViewDistance 300;
setObjectViewDistance 300;
};
While this one here is triggered when using thermal in a vehicle?
if (currentVisionMode player == 2) then
{
setViewDistance 3000;
setObjectViewDistance 3000;
};
How can I tell if a vehicle has an engine, collision lights, flaps, etc?
Is there a good tutorial about spawnable visual effects for Arma 3? And is it possible to create an orbital laser effect from base game effects? (Think of it as big a glowing line)
Look into config
Yeah there is flaps = 1; for flaps, found that. Can't find anything for collision lights though
That's the default state, doesn't actually tell you if they exist or not
Can you check what actions a vehicle has by default? (Can't look at config myself ATM) if so you could check that for references to collision lights as usually there's a toggle action for them
https://imgur.com/23Wlgt2
well, i optimized the code, still use the points as global variable son can change the color from the polys mid mission via script (also to generate the grid only once, and not on each frame)
#define RADIUS worldSize/64
#define r RADIUS*0.86
/* makes the poit grid to draw the hexagons
. . . . . . .
. . . . . . . .
. . . . . . .
*/
private _points = [];
for "_y" from 0 to 64 do {
for "_x" from 0 to 64 do {
if (_y%2==0) then {
_points pushBack [2*_x*r,_y*RADIUS*1.5,0];
}else{
_points pushBack [(2*_x*r)+r,_y*RADIUS*1.5,0];
};
};
};
//Filter points
data = [];
{
_color = [0,0.3,0.6,0.5];
//Markers only on Land
if !(surfaceIsWater _x) then {
data pushback [_x,_color]
}else{
for "_i" from 0 to 5 do {
_rpos = _x getPos [worldSize/64,60*_i];
if !(surfaceIsWater _rpos) exitwith {data pushback [_x,_color]};
};
};
}foreach _points;
//Execute this locally on the player
waituntil {!isnull(findDisplay 12)};
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
params ["_map"];
// Hexagon Draw taking points as input, can be modificated and polys change
{
_x params ["_pos","_color"];
_vertices = [];
for "_i" from 0 to 5 do {
_vertices pushBack (_pos getPos [worldSize/64,60*_i] );
};
for "_i" from 0 to 5 do {
_punto_2 = _i + 1;
if (_punto_2 > 5) then {_punto_2 = 0};
_map drawTriangle
[
[
_pos,
_vertices select _i,
_vertices select _punto_2
],
_color,
"#(rgb,1,1,1)color(1,1,1,0.5)"
];
};
}forEach data;
}];
this will be more eficient with hasmaps π
TLAM launch script, all works great, but does it performance-wise? g10 g20 is bots, g1 g2 is VLS's
sleep 10;
1 = g1 spawn {
_vls = _this;
{
_vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
west reportRemoteTarget [t1, 30];
t1 confirmSensorTarget [west, true];
_vls fireAtTarget [t1, "weapon_vls_01"];
uiSleep 3.1;
} forEach [t1,t1,t1,t1,t1,t1];
deleteVehicle g10;
deleteVehicle g1;
};
2 = g2 spawn {
_vls = _this;
{
_vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
west reportRemoteTarget [t1, 30];
t1 confirmSensorTarget [west, true];
_vls fireAtTarget [t1, "weapon_vls_01"];
uiSleep 2.5;
} forEach [t1,t1,t1,t1,t1,t1];
deleteVehicle g20;
deleteVehicle g2;
};
it will be executed only once... so not a big hit
yep, just cosmetics before start of the game
maybe deleting the misile after 5/10sec so dont explode can be useful
but still
cruice misiles dont make a big hit lol

how?
if missile explode far away from players, that's definitely costs server time, esp with playerCount over 220
what? no
this should work
_vls addeventhandler ["fired",{
[_this select 6 ] spawn {
sleep 5;
deletevehicle (_this select 0);
}}];
if !(isserver) exitwith{};
g1 addeventhandler ["fired",{
[_this select 6 ] spawn {
sleep 5;
deletevehicle (_this select 0);
}}];
sleep 10;
1 = g1 spawn {
_vls = _this;
{
_vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
west reportRemoteTarget [t1, 30];
t1 confirmSensorTarget [west, true];
_vls fireAtTarget [t1, "weapon_vls_01"];
uiSleep 3.1;
} forEach [t1,t1,t1,t1,t1,t1];
deleteVehicle g10;
deleteVehicle g1;
};
g2 addeventhandler ["fired",{
[_this select 6 ] spawn {
sleep 5;
deletevehicle (_this select 0);
}}];
2 = g2 spawn {
_vls = _this;
{
_vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
west reportRemoteTarget [t1, 30];
t1 confirmSensorTarget [west, true];
_vls fireAtTarget [t1, "weapon_vls_01"];
uiSleep 2.5;
} forEach [t1,t1,t1,t1,t1,t1];
deleteVehicle g20;
deleteVehicle g2;
};```
use that on init server if you dont want a spam of missiles lol
changing individual color from hex on server and trasmiting the hasmap wont be more eficient?
won't be any different than sending an array
I think the hashmap might be even slower π€
:c
Is it possible to make a spotlight source, that looks like a laserbeam?
i'm trying to use the new setObjectScale on Land_ClothShelter_02_F but it doesnt seem to work
first thing i noticed is that using setObjectScale on a non-simple object will crash the game
so i figured.. why not transform the object into a simple object first and then run setObjectScale on it ... but the problem is, i seem to be too stupid to get a pointer
ok, i guess that explains the crash
what do you mean with "only works in 3den editor" -- where else would it work?
ok, managed to get it to work. quite a hassle.
can someone help me, not sure why this is not working
_WhiskeyClasses = ["Whiskey_Lead", "Whiskey_Pilot"];
_WhiskeyCount = "_WhiskeyClasses" countType units player`
only in eden editor, nowhere else
Ah else.
Well singleplayer/multiplayer for example
If im add even a single AA system such as Mk21 Centurion with bot
synced with AN/MPQ-105 with bot too
im experiencing stuttering like this https://www.youtube.com/watch?v=FTG_Tqds06E&feature=youtu.be
if i delete that completly it runs much smoother https://www.youtube.com/watch?v=2fj2QCkgCqo&feature=youtu.be
Only solutions i see is that i should replace vanilla AA to solely script code
can someone help me get an accurate door angle that's relative to world space?
_posAxis = _building selectionPosition format ["Door_%1_axis", _doorNum];
_posPlayer = _building worldToModel (ASLToAGL getPosASL player);
//_return = false;
_doorAngle = _posTrigger getDir _posAxis;
_doorAngle = [_doorAngle, 0] call BIS_fnc_cutDecimals;*/
I did some testing on a building with doors facing north/south, and the angle read 270 even though the doors opened in 2 different directions
I'd like a result where the angle reads positive and negative
Hi, i made a mission with enemy AI's (OPFOR side).
In editor - they works good, they shoot me when i walk near, but in multiplayer - is not works. They just looking at players, but don't shoot them.
I made settings with setFriend (before creation group), but nothing is changed
{
east setFriend [_x,0];
_x setFriend [east,0];
} forEach [west,civilian,independent];
Maybe i doing something wrong?
Use round
Not gonna fix your issue tho
I'm not sure what you're doing
What is _posTrigger? What does it have to do with the door axis?
Did you try without setFriend?
Because you're checking how many are of type _whiskeyClasses (literally)
_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;
_nvgoggles = [
"False"
_availableHeadgear = [
"True"
];
_availableGoggles = [
"True"
];
_availableUniforms = [
"True"
];
_availableVests = [
"True"
];
_availableBackpacks = [
"True"
];
_availableweapons = [
"True"
];
_availablemags = [
"True"
];
_availableaccs = [
"True"
];
[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableaccs)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _availablemags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableweapons)] call BIS_fnc_addVirtualWeaponCargo;
can someno take a look and tell me if it has sense
@little raptor the trigger point is at the center of the door, so using getdir with the axis is how the angle is determined. But that angle is only relative to the door itself
First of all, you should get the trigger relative to the axis (you're doing it in reverse)
second of all ```sqf
_doorAngle = (_posAxis getDir _posTrigger) + getDir _building;
will give you the absolute angle (in world coordinates)
use ```sqf (see the pinned messages) to make your message readable
wich one?
very top, by Lou
@little raptor I need to detect if the axis is on my left and the handle is on my right, what's a mockup of that code look like?
I'm not sure which vector math to use
_doorAxis = _building modelToWorld (_building selectionPosition format ["Door_%1_axis", _doorNum]);
_doorTrigger = ...;//also in world coords
player getRelDir _doorAxis > 180 && player getRelDir _doorTrigger < 180
@agile pumice if you want _doorAxis and _doorTrigger to be on either side (not necessarily one left and other right):
((player getRelDir _doorAxis) - 180) * ((player getRelDir _doorTrigger) - 180) < 0
/* _crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;
_nvgoggles = [
"False"
_availableHeadgear = [
"True"
];
_availableGoggles = [
"True"
];
_availableUniforms = [
"True"
];
_availableVests = [
"True"
];
_availableBackpacks = [
"True"
];
_availableweapons = [
"True"
];
_availablemags = [
"True"
];
_availableaccs = [
"True"
];
[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableaccs)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _availablemags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableweapons)] call BIS_fnc_addVirtualWeaponCargo; */
hint "good!";
like this?
oh...
sorry, was afk
yes, nothing changed
how are you testing that in MP?
Any headless clients? Dedicated server? etc.
_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;
_nvgoggles = [
"False"
_availableHeadgear = [
"True"
];
_availableGoggles = [
"True"
];
_availableUniforms = [
"True"
];
_availableVests = [
"True"
];
_availableBackpacks = [
"True"
];
_availableweapons = [
"True"
];
_availablemags = [
"True"
];
_availableaccs = [
"True"
];
[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableaccs)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _availablemags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableweapons)] call BIS_fnc_addVirtualWeaponCargo;
hint "good!";
this means is alright, right?
syntax wise it seems so
logically no
@dusk badger these commands take classes. for example:
https://community.bistudio.com/wiki/BIS_fnc_addVirtualItemCargo
not "true" "false"
so %All for all classes, Null for no classes and classnames for specifics
there is no such thing
At least not that I know of
you must specify all classnames
no need to copy paste them tho
use "config crawling" to get what you want
see:
https://community.bistudio.com/wiki/configClasses
https://community.bistudio.com/wiki/configProperties
np
@dusk badger for example to get all mags:
_availableMags = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "cfgMagazines");
i planned to spawn them on headlessClient, but for tests - i used local server and spawned on it, but nothing had changed :\
_availableweapons = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgWeapons");
so for weapons will be this one, and the all I have to do is add the to a crate via BIS_fnc_addVirtualItemCargo
Hi, is there any eventhandler for using thermal or looking through a scope?
_WhiskeyClasses is a variable, "_WhiskeyClasses" is a string, those two things are not the same.
Assuming that Whiskey_Lead & Whiskey_Pilot are available class types you'll need to check for each one separately, e.g ("Whiskey_Lead" countType units player) + ("Whiskey_Pilot" countType units player), but you can do one better by going through the array of units once, and checking them against both, rather then going through the array twice.
private _WhiskeyClasses = ["Whiskey_Lead", "Whiskey_Pilot"];
private _WhiskeyUnits = [];
{
private _unit = _x;
// Go through each item in the classes list and check to see if the unit is one of them,
// findIf stops once one of the items returns true, so if the unit is a Whiskey_Lead,
// we don't need to check if they are a Whiskey_Pilot.
if (_WhiskeyClasses findIf { _unit isKindof _x } > -1) then
{
// This unit is either a Whiskey Lead or Whiskey Pilot
_WhiskeyUnits pushBackUnique _unit;
};
} foreach units player;
// If you want an array of units which are either whiskey lead or pilot
_WhiskeyUnits
// If you want the number of units that are either whiskey lead or pilot
count _WhiskeyUnits
Are there no setItemCargo/setItemCargoGlobal commands?
add*? @timid niche
Well then I would have to add all items one by one
β¦ no?
rly?
myCrate addItemCargoGlobal ["itemMap", 50]```
yes but storing multiple items
Can't do
myCrate addItemCargoGlobal [["itemMap", 50], ["ItemWatch", 20]]
So would have to do a loop
forEach yeah
loop da woop

_selectionPosition = _building selectionPosition [format["door_%1",_doorNum], "Geometry"];
_worldPos = _building modelToWorld _selectionPosition;
Can someone help me find the center position of a door? Getting the point this way doesn't return the center of the door, but rather a corner.
_selectionPosition = _building selectionPosition format["door_%1_trigger",_doorNum];
``` works but only for doors with that memory point (a3 buildings)
Hi everyone, I"m struggling to get the hang of scripting... I'm trying to make a simple script that changes a flag texture with an addaction but I can't tell where my syntax is wrong?
flag1 addAction ["Blufor Capture", setFlagTexture "\A3\Data_F\Flags\flag_blue_CO.paa"];```
your missing the first param
flag setFlagTexture texture
flag1 setFlagTexture is what you want
ah, I thought I didn't have to define it since I was specifying
that makes more sense, thank you!
flag1 addAction ["Opfor Capture", { (_this select 0) setFlagTexture "\A3\Data_F\Flags\flag_red_CO.paa"}];
flag1 addAction ["Blufor Capture", { (_this select 0) setFlagTexture "\A3\Data_F\Flags\flag_blue_CO.paa"}];
Why select0?
params ["_target", "_caller", "_actionId", "_arguments"];
target (_this select 0): Object - the object which the action is assigned to
caller (_this select 1): Object - the unit that activated the action
actionId (_this select 2): Number - activated action's ID (same as addAction's return value)
arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax
the script part has 4 parameters, and you want the first one (the target, which is the object the addAction is attached to)
ohhhh okay
so if I wanted it to also play a hint saying the flag had changed colors, would I add that after setFlagTexture?
yup, within the {}
With remoteExec though
Also you might wanna https://community.bistudio.com/wiki/setFlagSide depending on what it is you are doing
setFlagTexturehas global effect
the command executed where unit is local effect of the command will be global and JIP compatible.
so I'd want to do like
flag1 addAction ["Blufor Capture", { (_this select 0) setFlagTexture "\A3\Data_F\Flags\flag_blue_CO.paa"; remoteExec ["hint Blufor have captured point 1", 0] }];
I wasn't sure about the "" in remoteExec
sorry if this is a dumb question
check the wiki on how to use it: https://community.bistudio.com/wiki/remoteExec
I did, I was going by use 1
[] remoteExec ["someScriptCommand", targets, JIP];
question, a fsm can only travel in one direction and its the direction that returns true first correct?
Hi guys. Is there anyway I can add one insignia on the right shoulder as possible already but also one on the left?
eg. I want to apply 1 insignia on left and another on right.
I tried google and everything but couldn't find any answer
you can't outside of modding the uniform itself. BIS_fnc_setUnitInsignia only does the available side(s) provided by the creator.
and by default the other is handled by units.arma3.com or a squad.xml
Also, no crossposts dude
setVehiclePosition and setPos workaround
alllllrighty
Ok ok, I have an odd question. is there a way to do something like getObjectTextures (uniform player); to figure out specific textures making up a uniform in order to see if say, an armband on a uniform is a seperate texture that can be applied onto another uniform with a different armband?
I did getobjecttextures player but it wasn't pulling what I expected, though maybe I wa slooking at it incorrectly. Seemed like it was just giving me the textures for the face, rather than for the uniform I was wearing
all else fails yea i can try to find it in the configs but I was hoping I could pull this easier this way
No. It will return the uniform's textures
OH yes it does. Apparently only if i go through the arsenal to grab it though for... some reason. Or maybe I was just glitching out. Regardless, I got it! Thank you
it's not possible without either a memory point for the center itself, or two memory points on either side of the door.
remoteExec ["hint Blufor have captured point 1", 0]
[] remoteExec ["someScriptCommand", targets];
do these look similar to you?! π€¨
it should be ```sqf
["Blufor have captured point 1"] remoteExec ["hint", 0];
I guess what's got me confused is that the ordinarily it would be "hint" followed what you'd want to pop up. This is my first time really trying to understand a scripting language. They did look similar because I didn't realise that [] was where I would input where I wanted to be run remotely. Thanks for your help and clarifying.
when i am making my mission pramas can i use decimals for the values?
Yes.
(but I'm not sure what you mean)
if you mean in description.ext, integers only
i thought so thank you
BIS_fnc_startLoadingScreen is global or local?
local
Cool ty
Trying to keep targets down in MP:
//not adding the rest, but the forEach works.
_x addEventHandler ["HitPart", {
(_this select 0) params ["_target"];
_target animate ["terc", 1];
systemChat "hit";
}];
Target stays down in SP but not MP, I'd imagine this has been asked before
EH works too, the object that execs sees hit everytime, but even for them the target wont stay down
nvm found out its the variable "BIS_poppingEnabled"
how does this even work?!
it's missing ]
clooose your EH @brave jungle :p
and use -showScriptErrors flag π will save you some headaches!
how can i slingload a crate by script? with having the helo pick it up, just kinda magic attach it to the helo.
thanks π
Hi, trying to bring work my multiplayer mission with enemy AI's, but have a problem with AI.
They don't attack players.
(works only in editor...)
I though - problem in CombatMode, Behaviour, Formation or setFriend - changed them, but problem is still not solved :\
Maybe you had same problem with AI, or i doing something wrong?
Thank you!
Which sides are the players and AI?
Im so looking forward to the new enfusion engines scripting
players used all 4 sides, but ai's spawned on eastside. East players can't enter to the area with ai's
Does any one know what language it will be or if there are any guides on it yet?
Keep in mind that the only "fixed" enemies are BLUFOR (west) and OPFOR (east).
Civilians are always friendlies, and Resistance can be friendly with BLUFOR or OPFOR.
see: https://community.bistudio.com/wiki/Side_relations
As said in #general_chat_arma , the engine has not been released yet, so there is also no documentation whatsoever.
The closest thing to what we MAY expect is what's currently in DayZ:SA, but documentation on the BIKI is very limited.
but civilian setFriend [east,0]; is not solve this problem?
you can't change the status of civilians
Ah okay. Thanks π
understood, thank you! π¦
hm, but _civilian addRating -10000; probably will fix that
Everyone is friendly toward civilians. Civilians AI have a total impunity and can kill any enemy without retaliation (same as captive units).
so the civ may be shot, but won't shoot back
That will make the _civilian enemy to everyone, including other "renegades"
i used there civilian and independent - for players, so if i have AI's on east side - i can make player on civilian slot - like a renegade for AI, or i understood something wrong
how do i find out which crates can be airlifted and which cant?
also could i maybe force them to be airlifted?
I believe an object needs slingLoadCargoMemoryPoints in the config, and the weight shouldn't be beyond what the vehicle can lift.
canSlingLoad is afaik the only way to check that
although you could check some mods which add custom implementations of slingloading to see how they handle it
or i attach my crates to an invisible quadbike.
but canSlingLoad looks good π
b_supply_crate_f for anyone interested can be slingloaded (seems to be the only one). thats a big box packed in a green blanket
https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_Equipment has a list with (almost) all objects, and tell you if they are slingloadable (similar for some props)
You can probably hack it with ropeCreate commands if you really want to make it work with something that's not otherwise slingloadable. It won't work quite the same as regular slingloading, though.
Anyone who know how to add params to this eventHandler?
addMissionEventHandler ["PlayerViewChanged", {
params [
"_oldUnit", "_newUnit", "_vehicle",
"_oldCamera", "_newCamera", "_uav"
];
}];
Those are the only params available in that EH, so if you need more info you'll need to retrieve it with the data you have in there (eg. attach data to unit, or use missionNamespace)
ok thank you
There's an upcoming change that will allow you to do some more things with all missionEHs:
Since Arma 3 v2.03.147276 it is possible to pass additional arguments to the EH code via optional param. The arguments are stored in _thisArgs variable
but not yet.
any suggestion on how to tell if a helo is under heavy fire?
i want a condition to abort my supply drop.
Hi, is this what you are looking for?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#IncomingMissile
this addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
if (currentVisionMode player == 2) then
{
setViewDistance 300;
setObjectViewDistance 300;
};
if (currentVisionMode player == 0) then
{
setViewDistance -1;
setObjectViewDistance -1;
};
}
];
Anyone who know why these animations doesn't trigger the funktions?
which animations?
I figured it out !! π
I added
player addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
if (currentVisionMode player == 2) then
{
setViewDistance 300;
setObjectViewDistance 300;
};
if (currentVisionMode player == 0) then
{
setViewDistance -1;
setObjectViewDistance -1;
};
}
];
to the mission "init.sqf" file π
yyyes, but does being immobile and switching vision mode work?
I believe animChanged is "when changing human anim/posture" not lowering/raising NVGs
correct! I have not found an event handler for NVG/TI...
maybe a loop and a waitUntil�
good idea but I try to figure out a way to do it without an high performance script.
while { alive player } do
{
waitUntil { sleep 0.1; currentVisionMode player == 2 };
setViewDistance 300;
setObjectViewDistance 300;
waitUntil { sleep 0.1; currentVisionMode player != 2 };
setViewDistance -1;
setObjectViewDistance -1;
};
```?
animStateChanged might suit your need better
But neither of them is 100% reliable
The best ting would be if there was an NVG eventHandler.
Do you if it is even possible to sett that up?
Not entirely sure; but perhaps it's possible to trigger a UI event (onLoad, onUnLoad) in case the NVG overlay is actually a configured UI element
I know this would work with ACE NVG's, but no idea how this is handled in vanilla
you can on latest dev
Nice! You got a link to info about it?
wiki page
im trying to make a helicopter land and then afterwards, do other things. bis_fnc_wpLand says on its wiki side:
https://community.bistudio.com/wiki/BIS_fnc_wpLand
Return Value:
Boolean
but:
_handle = [_grp, getPos _airport, _airport] spawn BIS_fnc_wpLand;
waitUntil {
sleep 5;
systemChat str ["helo landed: ",_handle];
_handle
};
throws "handle is type script, expected boolean".
is there no vanilla WP for landing which i can check if its compelted?
Is it this you are thinking about?
_id = addMissionEventHandler ["EachFrame", { systemChat str [_thisArgs, time] }, [time]];
Basically what I am looking for is a trigger and not a script which checks if a change has occurred.
you mean like making event handler for any event you can think of? no you cannot do this then
I see.
spawn returns a script handle (ID of the script) not the result of the script (because the script may not complete at the time that you use spawn)
use setWaypointScript wth "A3\functions_f\waypoints\fn_wpLand.sqf" and then use setWaypointStatements to do whatever when it completes
you can make custom events with Scripted Event Handlers: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/ScriptedEventHandlers
but that would still require coding around whatever you want to catch as an event
Thank you.
@tough abyss please use https://sqfbin.com/
Sorry!
Hi. I'm new to Arma 3 coding and would appreciate help. So here is the randomizeWeapon script; https://sqfbin.com/unuzukiharulacazasuc. How can I call this script in the configVehicles to make my unit either for example get an AK or M4? I only need to know how to call it and how to write. Help would be highly appreciated. Cheers!
yes but how do I define which weapons I want to be randomised?
- first call
until now, I did like this with gear; ```sqf
randomGearProbability = 80;
headgearList[] = {"SP_M1Helmet_Iran",0.25,"SP_M1Helmet_Tan",0.45,"SP_M1Helmet_GrayDim",0.20,"SP_M1Helmet_Green",0.15,"iri_headgear_desert_camo_helmet", 0.30};
and I called it like this; ```sqf
[_this] call CFP_main_fnc_randomizeUnit;
init = "if (local (_this select 0)) then {_onSpawn = {_this = _this select 0;sleep 0.2; _backpack = gettext(configfile >> 'cfgvehicles' >> (typeof _this) >> 'backpack'); waituntil {sleep 0.2; backpack _this == _backpack};if !(_this getVariable ['ALiVE_OverrideLoadout',false]) then {_loadout = getArray(configFile >> 'CfgVehicles' >> (typeOf _this) >> 'ALiVE_orbatCreator_loadout'); _this setunitloadout _loadout;[_this] call CFP_main_fnc_randomizeUnit; [_this, "Rifles"] call cfp_fnc_randomizeWeapon; [_this, 'USP_PATCH_IRN_ARMY_GROUND_FORCES'] call BIS_fnc_setUnitInsignia;reload _this};};_this spawn _onSpawn;(_this select 0) addMPEventHandler ['MPRespawn', _onSpawn];};";
};
So like this?
how can I define which weapons I want to be randomised?
cheers btw for the help guys.
All items are defined in config.
I see buddy. I may sound retarded but I have not the knowledge like you guys. So far I have been using this with the randomisedUnit things and defined it like this; ```sqf
randomGearProbability = 80;
headgearList[] = {"SP_M1Helmet_Iran",0.25,"SP_M1Helmet_Tan",0.45,"SP_M1Helmet_GrayDim",0.20,"SP_M1Helmet_Green",0.15,"iri_headgear_desert_camo_helmet", 0.30};
Yep
really?
Thank you so much going to try right now since I think I already did this and was unsuccesful
but gonna give it another try,
But, you posted RifleList. While example at code, uses RiflesList.
Must be it. Gonna give it a try. Much love to you sir.
error undefind variable in expression: rifles
console. When I place the unit down.
you mixed quotes up, see highlighted code above
#arma3_scripting message
use single quotes around 'Rifle(s)'
cheers, gonna give it a try.
error undefined variable in expression: cfp_fnc_randomizeweapon
this function is apparently not defined π€·ββοΈ
ay stupidly simple question that i cant for the life of me find, what's the function that makes that pop up Hold down Space to Interact called?
did you define a CfgFunctions?
BIS_fnc_holdActionAdd π
Perfect thanks. Also house is the best show ever
check this @winter rose
sorry man I don't want to sound annoying or so. I am pretty new to this as I said.
the function file exists, but the CfgFunctions must be defined somewhere
this is a picture of my mission flow FSM so far... is this allowed? I'm trying to have a mainline and then a bonus objective line. https://imgur.com/a/nrJgqsE
i know i can't link two conditions together and that a state will progress only once through whichever line shows true first
Is the solution easy or complicated?
make an "end" to "commando killed"
what command do i use to detele somethink when tiggered, and what one to disable?
PS: you can add a magnetic grid in the options, so FSM tiles are well aligned π
yeah i know, i just wanted to stop there before i went further. i apparently can't link two white boxes together either. so back to the drawing board
you can make an empty yellow diamond in-between if needed
deleteVehicle? enableSimulation?
its annoying that it only goes down one line. is there a way to do a "or"?
well that's the yellow things
or rather "and" i mean
yeah let me mess around with it some more. i used to do big switch do files for things but I want to learn this since its better apparently
sorry i have a map marker that i would like to be deleted when the tigger is triggered
see https://community.bistudio.com/wiki/Category:Command_Group:_Markers and deleteMarker(Local)
Holy crap my brain just melted reading that wiki. I'm going to dig around more. Cheers for the help this far man. Seems to complicated for a newbie like me. I'm going to dig around.
no way to get the FSM to go down two lines simultaneously/independently is there?
actually, will a state box fire every time that a link comes back to it? or only fire the first time?
thanks
@winter rose last question, isn't it defined here?; https://sqfbin.com/petukarigibalidaluwe
seems not.
Sorry lol. But I just noticed this;
/* ----------------------------------------------------------------------------
Function: CFP_fnc_randomizeUnit)
Description:
Randomizes a units weapon and gear loadout based on config
This function, I am already using;
[_this] call CFP_main_fnc_randomizeUnit;
and as above it I can randomize a units weapon
the file is the function's content.
the game does not know about this file
so this is a totally new question. How can I randomize weapon using this function. Throw the other script in the trash that I was asking about. Since I already am using this function to randomize gear and is implented and working, I only need to know how to define how I need to write code for which weapons to randomise. Here is the script; https://sqfbin.com/munigogunojakikoviye
that or you messed something else if the game says error on CFP_main_fnc_randomizeUnit
no, my english might be trash so you must have been misunderstanding. This function/script is working so far and randomises units vests, uniforms, headgear and facewear. It also offers weapon randomisation but how can I call it?
for the e.g gear part I called it like this;
//Vests
vestList[] = {
"V_TacVest_khk", 0.35,
"CFP_Tactical1_ACRDesert", 0.12,
"CFP_Tactical1_3ColorDesert", 0.12,
"SP_Tactical1_Tan", 0.10
//Rifles
riflesList[] = {
"CUP_arifle_G3A3_modern_ris_black", 0.70,
"CUP_arifle_M16A2", 0.40
};
that's not even a call
Hi Leopard. But it is working and randomises my vests, uniforms, headgear and facewear already.
I just have problem adding the randomisation of weapon.
@winter rose How about something like this? Would this make sense with FSM logic? Mainly concerned about the children of "Transformers Destroyed". https://imgur.com/a/Rfml6ge
I mean it's not a function call
And where are you even using that
That seems like a config modifcation
CfgVehicles
If you are trying to apply the randomization to any unit that spawns, why don't you use CBA's unit init function and then call the script from there?
I am not sure what you want to do π
you can also simplify the end by having assault loss/win on Dead Commando
It is from CFP mod who has a lot of scripts, including this and I'm just editing a faction of it to fit scenarios.
oops forgot a link from the AI assault started true condition to the blank state
I want the win condition to be separate from the objective conditions. the win condition becomes more probable as you complete objectives
im just concerned about the transformers destroyed. will that go down two lines at once?
or will it only pick one
nvm. it threw so many errors its silly hahaha... too many in conditions and out conditions on everything. guess its not possible that way
#define GEAR_CATEGORIES ["uniform","headgear","facewear","nvg","vest","backpack","speaker","insignia"]
#define WEAPON_CATEGORIES ["rifle", "handgun", "launcher", "grenade", "explosive"]
If it helps understanding...
from the .sqf
this is so much easier if you just write your own basic randomizer script then call it on unit's init event handler as they spawn
I see fam. But I am really new to this so I have almost no knowledge. Just the basics.
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
private _cat = format ["%1List",_x];
#define WEAPON_CATEGORIES ["rifle", "handgun", "launcher", "grenade", "explosive"]
that's literally it
params ["_unit"];
private _helmets = [blah, blah, blah];
private _vests = [blah, blah, blah];
//etc
removeallitems _unit;
removeallassigneditems _unit;
//etc etc
_unit addvest selectRandom _vests;
//ect ect
then you call it using the CBA unit init event handler
i think you are jumping in wayyyyy too deep with #defines and .hpp/.cpp code if you are a beginner. try doing everything with just .sqf now and creating your own basic thing that works. then as you learn it, you can dive deeper.
looking into it.
@fair drum Yeah lol I just started studying python courses imfao. Only that and HTML5 knowledge.
the thing is learning the logic behind stuff. i only know .sqf right now but my CS friends say that .sqf is a garbage language and that it will be easy to pick up the others since .sqf has taught me the logic behind coding.
the thing that @little raptor wrote is for a new .sqf or editing the already existing one?
he had posted something for the existing one i think
That's how the function reads stuff
all you have to do is take
"rifle", "handgun", "launcher", "grenade", "explosive"
add list to them
then use them like before
#arma3_scripting message
let me see if i can dig into my old stuff when i was learning and send you some things to go off of.
Cheers @fair drum, @winter rose and @little raptor
@tough abyss Also you have to define them under randomWeaponProbability in config
if you can with whats in the game, how would i make a intel acquire mission?
randomWeaponProbability = 100;
riflesList[] = {"CUP_arifle_G3A3_modern_ris_black",0.70,"CUP_arifle_M16A2",0.40};
So like this?
I said under it 
Hello there, I have little question about triggers in MP and calling some commands.
I have player with name u1, trigger created in editor and its set with on activation: u1 addMagazine "30Rnd_556x45_STANAG" Everything looks fine in SP and in MP when trigger is not server only. But if I set trigger as "server only" than no magazine is added. But command addMagazine have "arguments global" and "effect is global". Why it doesnt work?
@tough abyss
class CfgVehicles {
class Blabla
{
class randomWeaponProbability {
rifleList[] = {"CUP_arifle_G3A3_modern_ris_black",0.70,"CUP_arifle_M16A2",0.40};
};
};
};
first syntax is aL eG
sorry lol my english is trash
it goes like this
but I supposed its for ofp, but for Arma 3 is AG, EG
@tough abyss what you wrote was correct:
randomWeaponProbability = 100;
rifleList[] = {"CUP_arifle_G3A3_modern_ris_black",0.70,"CUP_arifle_M16A2",0.40};
you are talking about the fnc_randomizeUnit.sqf right?
ok
testing it rn
much love bro
no homo
it's rifleList
not riflesList
that's not how you read it
the main syntax is aL eG, the alternative syntax is aG eG for Arma 3
ok, I didnt expect that command can have different effect for different syntax... ok
I tried it and its correct... u1 addMagazine ["30Rnd_556x45_STANAG",30]; work if its called on server... interesting
Okay. One step further! Now when I place units down they spawn with no weapon at all, in a "weapon holding" pose.
but no error codes thank god.
I can see the HK3 in the hands and quickly disappear after placing unit down in the editor.
use addMagazineGlobal to be sure π
and do not doubt me ever again π
so i tested AI like a year ago and came to the conclusion that they dont really hear vehicles. seems like their ability to know a helo is approaching is pure LOS.
any suggestion on what knowsabout value is good for feeding the AI the info "theres a helo coming somewhere north"?
They do hear ground vehicles
use reveal
for air
yeah but how much? 1 ?
yeah 1 should be enough
4 means they know exactly where it is
the higher, the more accurate
alright, trying that tomorrow.
@little raptor last question. You know?
no
aight cheers for all the help m8
whats responsible for making an empty vehicle somewhat hostile? I have a BTR-80A from a mod that for some reason even though it is empty gets targeted by AI units. They don't shoot but still target the vehicle unless there is an actual enemy around. Even tried a simple this setCaptive true; but that didn't change anything
how to set an mission end, to be disabled untill the objective is completed and how to set it to require all players that are alive?
to be in area
I guess its cost?
yep the units inventory gets empty when placing the units down. If someone found the solution, pm me. Cheers.
so now I have this version lol.. @winter rose
this one at least doesn't throw errors
not sure if I follow. wdym by that, the wiki did not enlighten me
now it did
You can't modify it by scripts.
yeah that
ah I see
although it seems threat is also affecting that
cost = 40000; threat[] = {1,0.6,0.6};
for the vehicle
I see
I mean it makes sense to me if the vehicle is occupied, however it is a empty vehicle from the beginning. Guess I just have to live with it then
The vehicle is probably badly configured
Or maybe you have mods that make the AI do that
and not #arma3_scripting π
thenk you so much
Hey there! Im trying to get an artillery gun to fire at a target, but randomly. My SQF File apparently has a generic error in line 3, but i cant figure it out.
_rounds = 10;
while {_rounds>0} do {
_dir = round random 360;
_dis = round random 150;
_tgt = target1 getRelPos [_dis, _dir];
gun1 doArtilleryFire[_tgt,_ammo,1];
_rounds = _rounds - 1;
sleep 5;
};```
its probably a very simple fix honestly, but im quite new to scripting
I believe generic error means spelling or such?
where is that code?
In the mission folder, next to my mission.sqm
Its a .sqf file
Ignore me, its working now. π
im very confused, my arma has been like this since yesterday, something says its wrong, i just reopen the mission and it works first try
That has nothing to do with "your arma".
Depending on how and where your script is executing, you may have to completely exit the mission and start it again (not just restart)
Thank you so much for letting me know, its been confusing me so badly π
So I want to make it so that when a player steps over a trigger it gives a certain enemy a weapon, I know the give weapon command I just need help telling the trigger who to give the weapon to
does the respawned event handler fire for first spawns?
Yes, as long as the respawn settings are correct in description.ext
I got a generic error upon activating my tigger
opfor addWeapon "hlc_Pistol_M11";
thats the trigger upon activatio
n
I'm trying to make it give a certain soldier a weapon
nevermind got it working
Is it possible to make a weapon spawn with a mag already in it?
Using scripts
Use addMagazine before addWeapon
Alright, and for addMagazine do I have to define what to add the magazine to?
Because if I did wouldn't it not work considering it's trying to give a magazine to something that is not yet spawned
Because I'm trying it so that the magazine is in the weapon when it spawns, making it where the civilian does not have to load it
Yeah just add the magazine in the uniform or vest or backpack first
And then add the weapon
I did, but the magazine doesn't come loaded in the pistol already
They would have to load it, giving blufor way too much of a window to react
Alternatively u can use addWeaponAttachment or something similar called. It does work for magazines too.
alright, so how would I define what to add the attatchment to?
Could I just put it after addWeapon?
Im sry addWeaponItem
The Macros are WEAPON_RFM is the weapon classname WEAPON_RFM_STUFF is a string array of attachment classnames
_x is the Variable for the Loop of apply over the array
Alright so weapon_rfm is the weapon id name and the weapon_rfm_stuff is the attatchment id name
It is a array of weapon attachments ids
Just remove the loop. This is only a example
yourSoldierVarName addWeapon "yourWeaponClassname";
yourSoldierVarName addWeaponItem ["yourWeaponClassname", "yourMagazineClassname"];
alright, thank you so much
while {true} do
{
private _objtarget = missionNamespace getVariable [format ["targ_n_%1", random [1, 3, 6]], objNull];
(gunner light_north) dotarget _objtarget;
sleep random [5, 10, 15];
};
I've got a searchlight light_north that I want to pan around a series of targets (rocks) targ_n_1 through targ_n_6. The script runs without errors but the light stays still.
What have I done wrong here?
You may also need to use doWatch and/or lookAt. Also, some searchlights (like the GM ones) require you to add a fake weapon to the turret otherwise the AI don't know how to use them.
That method of target selection seems a bit weird to me, personally I would use selectRandom from an array of targets, but I don't think it would cause a problem
https://community.bistudio.com/wiki/setObjectScale what does meaning walk-able surfaces can only be X m in size, and collision in general will only work up to X m from object center X mean in this description?
there is an upper size limit but whoever wrote that didn't know exactly what it was
AKA you make an object bigger than certain size (50m?) will destroy the collision and such
70m iirc
ah OK, and im reading this correctly, you cant move these objects once you have set the scale because they wil reset in size?
Because if so, then how is dedmen doing this: https://twitter.com/dedmenmiller/status/1357727204482969600?s=20 (go-kart vehicles)
attachTo
ahhhh so moving means actually getting inside and moving it like that, thought it meant if it moved at all, in hindsight that makes sense
setPos setVectorDirAndUp and such might reset scaling
why does attachTo not reset the scaling? Internally, is it not doing essentially the same thing?
ah OK
I would like to 'construct' a hint from an array, with each element separated by a line break. This
hint formatText ["%1%2%3%4%5%6%7", "Units on the way:", lineBreak, "A", lineBreak, "B", lineBreak, "C"];
should be turned into something like this:
_unitsEnRoute = ["A", "B", "C"];
hint formatText ["%1%2%3%4%5%6%7", "Units on the way:",
{
lineBreak, _x
} foreach _unitsEnRoute
];
Is this somehow possible?
Also you can use multiple %1 %2 %3 or whatevers, no need to put the same variable multiple times
Ok guys, many thanks, will have a look and work out a solution. But be warned. If it do not make it, I'll be back.
Yes, much nicer than a hint
Right I'm using Hold Action in eden Enhanced, i'm using an Assembled Device as a nuke that i want to disarm if the action is completed and i want it to explode it the sequence is interrupted whats the code for that please ?
BIS_fnc_holdActionAdd has parameters: codeCompleted and codeInterrupted.
_pipCam attachTo [player, [-0.05, 0.1, 0.1], "head", true];
I want to use the followBoneRotation feature but it's not working. Whether it is set to true or false, it doesn't rotate with the head. Is this a bug or am I using it wrong?
Are you on RC branch?
in code completed i want the device to be disassembled so what code do you put in this category? Also fo the code interrupted, i want the device to explode and kill the player
Or dev?
dev
the device*
"pilot" is working the same way as "head" π€
No rotation

^rotation
Well dunno. I guess that should work
Show your entire script
Is there a way I can have a trigger make a civilian go into the "Surrender" state when activated?
Make sure the trigger is running on the server only and not globally.
Should I get someone else to see if they can reproduce it or shall I just post it as a bug report on the feedback tracker?
But would it make someone who is already a civilian put their hands up?
I just need a trigger that makes a civilian put their hands up when activated
It should still work. I haven't tested it so don't quote me but the biki doesn't say otherwise either.
Will this carry over into the dev branch once RC becomes the main stable?
Thanks for the help but I couldn't get it working, I just used an animation trigger instead
After testing it, it seems that the civilian does in fact become captive but the animation isn't triggered like it does with BLUFOR/OPFOR/IND.
Ah
wat
dev branch is newer than RC
So if I try it with an opfor unit it should trigger the animation?
Oh so dev has everything RC has plus more. I don't know why it's not working then
So if the player were to alt and free look, the camera would rotate with it?
Is there a way I can easily change a civilian to the opfor team without having to make an opfor unit look like a civ?
You could joinSilent the unit into a group under the opfor team
You can also just create a group with createGroup and use the side as east
Then joinSilent into that new group
Is there any way to disable outlining/focusing on custom RscText control?
If its already on the civilian side, setting it as captive won't do anything. If you are using a civilian unit you need to have it join an opfor group
I tried it with an opfor unit, still nothing
BLUFOR
If you are using a opfor unit and you only want that unit to trigger it and have it stated in the condition box then you have to use Anybody and present for it to fire.
No, I want it so when I or a teamate walk through the door, the civilian or opfor member will put their hands up
However
When using an animation
switchMovee
Once the unit is detained or taken prisoner, the animation continues
Use the action command with surrender.
Send me a pic of your whole trigger menu you've done so far
I don't know where the conception has come from that setCaptive puts the unit in a surrender animation. It never has, nor is such a function described on its wiki page.
// Assuming the civi is civi1...
civi1 action ["Surrender", civi1];
It appears that setCaptive simply sets the unit's side to civilian so that other units do not fire on it. If you don't put the unit into the surrender action, the unit will not be restrained so it is free to walk/run away.
Use setCaptive on units which are not already civilians.
solved privately for him. he was using ACE and needed the ace function for their surrender instead
ah π
who pinged me
@slate cypress idk
I did but rather deleted it because its the morning and it would have came out wrong. don't worry about it.
Is there a way I can make a civilian target BLUFOR? I have tried setting their mode to combat and open fire, but they just point the gun and don't do anything.
And they don't track the BLUFOR target either.
make them into an OPFOR by joining them to an OPFOR group
that was one of the examples on that page, which is why I said it
i already told you how π
Ah sorry, I mentioned the wrong guy π
Couldn't get it work
send your code
use blufor and opfor then π
I tried that, but in this mission i need them to be civilian, and the only other option would be to change very single opfors loadout and make them look like a civilian
Which would be very tedious
Use 3den Enhanced's copy loadout feature π
But anyway, the example on the biki should work and is very straightforward
Yeah, but I can't use the same civilian, and would prefer to not flood my saved loadouts with 20+ civilian kits
legitimately, post the code you were using to join them to a group that didn't work
it should work and we can troubleshoot it
I didn't make any, I know it sounds very lazy but I am genuinely confused by it
i have zero scripting experience
You have your civilian unit, we call it CIV_SOON_TO_BE_BLUFOR
private _eastGroup = createGroup east;
[CIV_SOON_TO_BE_BLUFOR] joinSilent _eastGroup;
done
private _eastGroup = createGroup east;
Where would this go?
exactly the same place as the rest of the code, presumably in the On Activation field of your trigger
Alright
Got an error
private _eastGroup = createGroup east;
enemy2 joinSilent _eastGroup;
Thats the exact code
you have to include the []
things inside [] are Arrays, essentially lists of things. If you have more than one unit, you can put them in the same array to do them at the same time, e.g. [enemy2,enemy3] (not all commands accept Arrays, some commands require Arrays, so check first)
in the debug console, execute sqf side enemy2;
see if it worked. Should be east now.
Add this line to the end of the On Activation field of your trigger:
hint "trigger activated";
and try again
private _eastGroup = createGroup east;
[enemy2] joinSilent _eastGroup;
side enemy2; ```
Alternatively, restart the preview and execute this in the debug console.
If it returns "EAST" then it worked.
Are you sure your unit is called "enemy2"?
Hold on yeah it shows east
it must be otherwise the previous test wouldn't have returned civ
Well if your trigger is activating, and the code in your trigger works otherwise, but the code doesn't work when you put it in the trigger....I can't see what's going wrong.
So there is no code that can just change the civ to the opfor team?
@still forum I managed to get it working after verifying game cache. Is the camera supposed to be rotated at an angle on the y axis? I noticed that when followBoneRotation is set to false, it's straight. When set to true, it becomes wonky.
No, there is no direct "change side" command. However, this (very simple) code that we are trying to make work.....should work. It is the easy and reliable way to do this. There must be either something weird in your implementation, or something incredibly obvious we're overlooking or not aware of.
Is there anything I need to do extra to make the East group a hostile group to BLUFOR, to the point where they will fire at any blufor?
camera rotating? no camera is supposed to be rotating at all?
You should only need to do that if you've previously made OPFOR friendly to BLUFOR for some reason
by default they are as enemy as they can get
Ok I finally got it working
private _eastGroup = createGroup east;
[_civilian] joinSilent _eastGroup;
I'm not sure if you pointed it out to me but if you did I am extremely sorry for wasting your time, that command I put up top was ment to be put in the debug, for some reason it wasn't working in the trigger.
Yeah it just doesn't seem to want to work in the trigger.
Do you mind if I send you two screenshots in DMs so I can show you what it looks like when followBoneRotation is set to true?
don't mind
Well this is still concerning because we need to make it work in the trigger, otherwise it may as well not work
It also works for me π
player opfor addEventHandler ["GetIn", {
params ["_vehicle"];
Anyone who knows if this eventHandler only triggers when an opfor player is entering a vehicle?
player addEventHandler ["GetIn", {
params ["_vehicle"];
if (player == opfor) then {
[
"I_LT_01_AA_F"
["Indep_03",1],
["showCamonetHull",1]
] call BIS_fnc_initVehicle;}
};
];
Basically what I want is to change the animation(skin/look) of the vehicle when an opfor player enters the "I_LT_01_AA_F"
player addEventHandler ["GetIn", {
params ["_vehicle"];
if (playerSide == opfor) then {
[
"I_LT_01_AA_F"
["Indep_03",1],
["showCamonetHull",1]
] call BIS_fnc_initVehicle;}
};
];
@fresh wyvern
Wow! Thanks a lot!! π
np π
Some how I still don't get the animation to trigger..
This code work so I know that the animation is right.
_veh="I_LT_01_AA_F"createVehicle(player modelToWorld [-8,0,0]);
[
_veh,
["Indep_03",1],
["showCamonetHull",1]
] call BIS_fnc_initVehicle;
However i get an error when I apply the this line the code above:
["Indep_03",1],
https://community.bistudio.com/wiki/BIS_fnc_initVehicle
vehicle, variant, animations @fresh wyvern
if you remove showCamonetHull, remove the Indep_03 end comma as well
Both depend on each other
["Indep_03",1],
["showCamonetHull",1]
then what is your error; you say it works then it doesn't. which one works, which one does not?
Perhaps I should add
"I_LT_01_AA_F"
to params swapping out "_vehicle"?
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
}];
I don't know what you are trying to do π€·ββοΈ
Hi. Can somebody tell why the Weapon Randomisation script makes my unit empty his whole inventory and add no weapons at all? Here is the script; https://sqfbin.com/elapureqohidoheribag, and here it is called (Unit Config part of the config code, line 84) https://sqfbin.com/rarixohorozituripuru. Help would be appreciated. I tried the whole day today finding the solution.
I what to make the
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
}];
trigger when an opfor player enter the an
"I_LT_01_AA_F"
then if type of _vehicle is not that, exit the script
or
only add that event to vehicles of such type π
like:
this addEventHandler ["GetIn", {
params ["_I_LT_01_AA_F", "_role", "_unit", "_turret"];
}];
Guys, would this work:
_list = player nearEntities ["agentObject", 50];
I am trying to detect all the agent units near the player (50 radius)
Is there such a class as "agentObject"?
But anyway, even if there was, your method is wrong
agents select { _x distance player < 50 };
agents select {teamMember _x distance player < 50}
might be more accurate yes
THanks!
@winter rose @wind hedge I meant agent 
agents select {agent _x distance player < 50}
agents returns team members 
I got it backwards π
agents is stoopid
"task1 " SUCCEEDED, BIS_fnc_taskState; do i need to put the code like that ?
no
that's not even valid
["task1", "SUCCEEDED"] call BIS_fnc_taskSetState;
thx
The script removes all weapons from the unit.
removeAllWeapons _unit;
You have to specify every single weapon category to be randomized (which is stupid and you're better off making your own function)
Does hideObject disable its simulation?
kinda
it doesn't disable the simulation but the object can no longer interact with the world (the world doesn't see its lods)
(e.g. they float in the air, they pass thru objects, etc.)
So theres no way to slingload an invisible crate?
make an invisible crate?
or find a helper object that can be slingloaded
and can become invisible with obj setObjectTextureGlobal [0,""]
Like "mod an invisible crate"?
@real tartan habe you tried the no texture approach?
maybe it works on some vanilla crate
// private _helper = createVehicle ["CargoNet_01_box_F", [0,0,0], [], 0, "NONE"];
_helper setObjectMaterialGlobal [0, "\a3\Structures_F\Data\Windows\window_set.rvmat"];
{ _helper setObjectTextureGlobal [_forEachIndex, ""]; } forEach getObjectTextures _helper;
this does not work
ah, that object does not have hiddenSelections
@real tartan @spark turret
I recommend you try one of these:
- Make a new vehicle inherited from this:
configFile >> "CfgVehicles" >> "Slingload_01_Base_F"
and setscope = 1(the current one is not accessible, because ofscope = 0) - Try other vehicles like the quadbike
that will require mod :/
that's the easiest way :/
PaperCar would be perfect, but it does not have slingLoadCargoMemoryPoints
That means either modding a crate or script attach ropes to the heli
this kinda works
private _helper = createVehicle ["B_Quadbike_01_F", getPos player, [], 0, "NONE"];
{ _helper setObjectTextureGlobal [_forEachIndex, ""]; } forEach getObjectTextures _helper;
but it has shadows 
Meh i think thats something i could live with
Also you can see the headlights from the front (but not visible from the back) π€£
Featured specifically for use with the Old Man mini-campaign/scenario, a variant of the Mine Detector exists in the form of the Drone Detector.
It cannot be equipped outside of the scenario without scripting commands, and is functionally identical to regular Mine Detectors. Its main purpose in Old Man is to detect suicide UAVs that patrol the outskirts of large military bases throughout Tanoa; as such, it has a much wider scan range of 200 metres rather than 15.
How can I access this Drone Detector?
||mines are attached to the drones in Old Man|| π
Yeah but what I care about is the 200 meters radius
also please use || spoiler || β ||spoiler||
used B_supplyCrate_F. problem is, that CargoNet_01_box_F does not have hiddenSelection to override texture
Maybe there some big cargo cobtainer thats slingloadable. Use this like ViV transport?
Or you attach the thing yiu wantto transport and hide it. Wheb dropped, crate gets deleted, thing unhidden
Like it "gets packed" for transport
If you've already played that much, then just play that scenario and use the debug console to get its class name
Or look in old man files
Or keep adding/searching thru all vanilla items one by one until you find it
@little raptor just FYI: debugged the issue from yesterday. Was ACE.
Thanks for the insights. I may commence silence now 
How would I go about making a trigger activate a series of move markers for a certain ai?
sync them via "Waypoint activation"
or in the waypoints condition field put triggerActivated nameOfTrigger
I don't even remember what it was 
Cheers Leo! By specifying every weapon catagory you mean Pistol, Rifle and Launcher? If so, I am planning to only randomise Rifles which is no problem, or did I get you wrong?
Every category that function uses
there was more iirc
params ["_unit"];
//Remove all items and clothing from _unit
removeAllWeapons _unit;
//Weapons
private _weapons = ["CUP_arifle_G3A3_modern_ris_black","CUP_arifle_M16A2"];
//Add random weapons
private _weaponClass = selectRandom _weapons;
private _magazine = _weaponClass select 1;
private _weapon = _weaponClass select 0;
_unit addWeapon _weapon select 0;
_unit addMagazines [_magazine,5];
_unit addPrimaryWeaponItem _magazine;
};
or just create your own function and remove removeAllWeapons _unit;
how about this I have worked one?
won't work
private _magazine = _weaponClass select 1;
private _weapon = _weaponClass select 0;
don't just randomly copy paste stuff
understand what they do
π¦
True.
By worked on I mean removing some coding and cleaning it a bit.
so all I can do is remove ```sqf removeAllWeapons _unit;?
Probably
Depends what that other function that it called does
[_unit, _x] call FUNC(randomizeWeapon);
Sure. Gonna dig in and do some testing. Cheers.
I think that's linked to this; https://sqfbin.com/sumegizuzosigepuciri
Maybe that will clarify things for both of us.
then it won't work
once the weapon slots are filled, any further addWeapon commands are ignored.
this is regarding the last sqfbin link/script yes?
Okay. So I have come to an conclusion to just create a own small script to randomize weapons. At the same time I will get more knowledge about all. Any tips or tricks before I dig in and stop annoying the hell out of you lol. I
However what is confusing is that the script is from CFP and they have faulty scripts as seen now. (No. I am not doing retarded things with their stuff, just editing one of the faction to modernise it for scenario singleplayer purposes)
Honestly if all you want to do is randomize the primary weapon it's pretty easy.
Review the basic data types:
https://community.bistudio.com/wiki/Category:Data_Types
especially arrays.
Remove the primary weapon
https://community.bistudio.com/wiki/removeWeaponGlobal
add random weapon with appropriate mags
https://community.bistudio.com/wiki/addWeapon
cheers! I found this on a forum; ```sqf
private _weapon = selectRandom ["CUP_arifle_G3A3_modern_ris_black","CUP_arifle_M4A1"];
[_this,_weapon,8] call bis_fnc_addWeapon;
seems pretty simple. If this also isn't faulty lol.
It will add either the G3A3 or M4 rifle with 8 mags.
as long as _this is what it should be
hi guys
can someone tell me why this is not removing the inventory of my vehicle?
params ["_veh"];
_HQ = [West,"HQ"]; // do not touch this!
// array of marker names
// Make sure you place an empty marker with the name of the below positions
private _markers = ["Logistics_Spawn"];
{
private _position = getMarkerPos _x;
private _radius = ((markerSize _x) # 0) max ((markerSize _x) # 1);
private _vehicles = (_position nearEntities 20) select {_x isKindOf "LandVehicle" && !(_x isKindOf "CAManBase")};
{
//Clear Vehicle
clearWeaponCargo _Veh;
} forEach _vehicles;
} forEach _markers;
i wish to write a script to add ammo to the vehicle but first i have to empty it. Thought this would have worked but nothing is happening
I think I have figured out the problem. I just only need to know how I need to write the code in the Init field of the unit(CBA Event Handler) when the script says this; ```sqf
Examples:
(begin example)
[_this, "Rifles"] call cfp_fnc_randomizeWeapon;
(end)
the working gear randomise script says this if you want to compare: ```sqf
Examples:
(begin example)
[_this] call cfp_fnc_randomizeUnit;
(end)
clearWeaponCargo only removes weapons π
so how do i clear everything
does not even remove the weapons
as there is still an MX in there
are you sure _vehicles is not an empty array?
also, clearWeaponCargo has a local effect
my vehicle is inside the marker zone
try using systemChat str _vehicles to be sure
says vehicle_0
whats that mean?
is that good
or is it saying it cannot see any vehicles
what's the purpose of the radius if you're giving it your own radius (20)?
_veh is not defined
to clear everything use the similar commands for other stuff (removeXXXCargoGlobal)
(clear*)
yeah that
clearBackpackCargoGlobal
clearItemCargoGlobal
clearMagazineCargoGlobal
clearWeaponCargoGlobal
so im trying to make a mission, so the end is a tigger linked to a end scenario, and im trying to implement "allPlayers inAreaArray myLocation;" code form the wikia
so am i supposed to use clear or remove?
error undefined variable in expression _array (line 45) https://sqfbin.com/duxoxoceculupegaciru
how are you calling that?
there's nothing wrong
unless you call it wrong
I place the units down and this error shows.
so what's the question?
its not working what am i doing wrong
do i put that code in an area module or tigger?
so how do i define the vehicle that is in the marker zone?
{
//Clear Vehicle
clearWeaponCargo _x;
} forEach _vehicles;
params ["_veh"];
_HQ = [West,"HQ"]; // do not touch this!
// array of marker names
// Make sure you place an empty marker with the name of the below positions
private _markers = ["Logistics_Spawn"];
{
private _position = getMarkerPos _x;
private _radius = ((markerSize _x) # 0) max ((markerSize _x) # 1);
private _vehicles = (_position nearEntities 20) select {_x isKindOf "LandVehicle" && !(_x isKindOf "CAManBase")};
{
clearWeaponCargoGlobal _x;
clearItemCargoGlobal _x;
} forEach _vehicles;
} forEach _markers;
still wont work
and this is the init code part; ```sqf
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base{};
class ALiVE_orbatCreator
{
init = "if (local (_this select 0)) then {_onSpawn = {_this = _this select 0;sleep 0.2; _backpack = gettext(configfile >> 'cfgvehicles' >> (typeof _this) >> 'backpack'); waituntil {sleep 0.2; backpack _this == _backpack};if !(_this getVariable ['ALiVE_OverrideLoadout',false]) then {_loadout = getArray(configFile >> 'CfgVehicles' >> (typeOf _this) >> 'ALiVE_orbatCreator_loadout'); _this setunitloadout _loadout;[_this] call CFP_main_fnc_randomizeUnit; [_this, 'Rifles'] call CFP_main_fnc_randomizeWeapon; [_this, 'USP_PATCH_IRN_ARMY_GROUND_FORCES'] call BIS_fnc_setUnitInsignia;reload _this};};_this spawn _onSpawn;(_this select 0) addMPEventHandler ['MPRespawn', _onSpawn];};";
If you mean
allPlayers inAreaArray myLocation
that doesn't do anything
perhaps you meant this?
if (allPlayers inAreaArray myLocation) then {
"SideScore" call BIS_fnc_endMissionServer
}
I told you to do this
_position nearEntities _radius
also use systemChat str _vehicles to make sure it's actually picking up something
thing is that i have this code working on a mission i did using ace. I created crates and had them loaded into the vehicle. Worked fine. Now i wish to do it with out ace so i am stripping those bits out and instead of having the items being placed into crates and the crate loaded, just put the items straight in. This was my ace code which worked just fine.
// Place the following in the init line of the object you wish to spawn from.
//this allowDamage false; this addaction ["Request Ammo Crate", "scripts\crateSpawn\crate_ammo.sqf"];
params ["_crate"];
_HQ = [West,"HQ"]; // do not touch this!
// array of marker names
// Make sure you place an empty marker with the name of the below positions
private _markers = ["Logistics_Spawn"];
{
private _position = getMarkerPos _x;
private _radius = ((markerSize _x) # 0) max ((markerSize _x) # 1);
private _vehicles = (_position nearEntities 20) select {_x isKindOf "LandVehicle" && !(_x isKindOf "CAManBase")};
{
//Spawn Box
private _crate = "Box_NATO_Ammo_F" createVehicle _position;
//Clear Box
ClearWeaponCargoGlobal _crate;
ClearMagazineCargoGlobal _crate;
ClearItemCargoGlobal _crate;
ClearBackpackCargoGlobal _crate;
// fill crate with our junk
_crate addMagazineCargoGlobal ["7Rnd_408_Mag", 5];
_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 25];
_crate addMagazineCargoGlobal ["10Rnd_762x54_Mag", 15];
_crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_black_mag", 10];
_crate addMagazineCargoGlobal ["200Rnd_65x39_cased_box", 6];
_crate addMagazineCargoGlobal ["130Rnd_338_Mag", 10];
_crate addMagazineCargoGlobal ["HandGrenade", 10];
_crate addMagazineCargoGlobal ["SmokeShell", 6];
_crate addMagazineCargoGlobal ["SmokeShellGreen", 6];
_crate addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell", 6];
// Add to ACE cargo
[_crate,1] call ace_cargo_fnc_setSize;
[_crate,_x,true] call ace_cargo_fnc_loadItem;
} forEach _vehicles;
// lets people know stuff happened
Systemchat "Your Ammo Crate has been loaded.";
} forEach _markers;
no dice
I still don't know how you're doing it π€·
a tigger linked to a end scenario module
you're doing completely different things
there's no crate in your new code
how do you expect it to work?
you're just clearing the vehicle cargo
i know, i started basic and was making sure the code was running before continuing. Starting with just emptying the vehicle
your old code didn't do that either π€·
it wasn't a question
i now want it to empty the vehicle in the zone and then allow me to customise the cargo i want loaded the same as i did with the crate idea
but vanilla arma doesnt work with crates too well so i have to resort to the vehicle inventory
someone could correct me on this, but as far as I know crate and vehicle inventories are functionally identical
because crates are vehicles
nope, no one can correct you on this
you are right
it means one of the parameters/arguments you gave to the command was an Array, when it was looking for a piece of code
Cheers.
Figured I needed to use the eventHandler "GetInMan". "GetIn" didn't trigger.
Anyone who knows how to change this script so that the vehicle a player enters into changes its present animations for new animations instead of spawning in a new vehicle with the new animations?
player addEventHandler ["GetInMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
_veh = createVehicle ["I_LT_01_AA_F",position player,[],0,"NONE"];
[
_veh,
["Indep_03",1],
["showCamonetHull",1]
] call BIS_fnc_initVehicle;
}
];
Figured it out!
Had to refer to the right params π
player addEventHandler ["GetInMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
[
_vehicle,
["Indep_03",1],
["showCamonetHull",1]
] call BIS_fnc_initVehicle;
}
];
Thanks for the help. It worked when swapping eventHandler "GetIn" for "GetInMan" and when referring to the right prams "_vehicle"
player addEventHandler ["GetInMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
if (playerSide isEqualTo opfor) then {
[
_vehicle,
["Indep_03",1],
["showCamonetHull",1]
] call BIS_fnc_initVehicle;}
}
];
Hemlos, i have a problem with say3d
class CfgSounds
{
sounds[] = {};
class music1
{
name = "music1";
sound[] = {"\sounds\oggetto.wav", 1, 1, 500};
titles[] = {};
};
class music2
{
name = "music2";
sound[] = {"\sounds\machecazzo.wav", 1, 1, 600 };
titles[] = {};
};
class music3
{
name = "music3";
sound[] = {"\sounds\agente1.wav", 1, 1, 600 };
titles[] = {};
};
class music4
{
name = "music4";
sound[] = {"\sounds\maniinaltrocringe.wav", 1, 1, 600 };
titles[] = {};
};
};```
music1 and music3 are working
not the other ones tho
on activation:
a1 say3D [ "music4", 1000, 1];
@ me no problem
sorry to ask but is there any way to link sub classes in a class to an external sqf ?
what do you mean?
#include "filename"
although this is more a #arma3_config question instead of scripting
yes
and oh my apologies
and the file path would I need need to add the full path from root of pbo or just the file name if it is in the same subfolder of the sqf rile ?
can be both
I know this is an easy question but I've watched so many videos and can't seem to get it, I want a trigger to make a helicopter come and land in a field, then wait for me and some other people to get in before going on, how would I do so?


