#arma3_scripting
1 messages · Page 641 of 1
…playMission?
do you mean force them out of slots or into empty slots? @umbral nimbus
I think I found it
into a slot
Mmh you could use autoassign in the mission attributes, but that forces people into random slots
yeah
although that wouldnt be a big issue for my case.
But being able to put them in specific slots would be great
unless someone has an idea how. Ill go for the random slots
then forcing the mission to start when all connected players are assigned would be the last step..
skipLobby
When enabled, joining player will join the mission bypassing role selection screen. The joinUnassigned param will be set to 1 automatically, so that player receives first available role from mission template. When leaving such mission, player will go straight back to server browser.
Thats what I need 😎
So on a trigger, I exectute saveloadout of the players to their profile namespace.
Execute "playmission".
Have fhe next missionnset to skiplobby and skip briefing.
And beng mission starts on Altis. Asif they travelled there
😎 👍
Thanks my Discord Rubber Ducks
sweet, you actually gave me an idea
You're welcome
How to get path to this bad boy
DisplayName of gunner selected ammunition
here is my shitty non working code again
(configfile >> "CfgWeapons" >> vehicle player currentWeaponTurret >> "displayName");
vehicle player currentWeaponTurret…
have you heard about our Lord and Saviour the biki?
you may be unaware of this lou, but writing random stuff hoping it'll work is superior in all of the ways 😉
private _vehicle = vehicle player;
private _magazine = _vehicle currentMagazineTurret (_vehicle unitTurret player);
getText(configFile >> "CfgMagazines" >> _magazine >> "displayNameShort");
Hm, how can I activate a trigger, if a certain type of vehicle is in it?
I already tried
"UK3CB_TKC_C_V3S_Closed" in thisList;
But that didnt do the trick
"UK3CB_TKC_C_V3S_Closed" in (thisList apply {typeOf _x}); maybe 🤷
thisList findIf {typeOf _x == "UK3CB_TKC_C_V3S_Closed"} != -1``` a slightly better version of that, but isnt really good either way because its a frequently repeating loop.
Hmm nop
I made script that plays a sound from a radio, it works really well but when im in range i have sudden lag spikes and stutters, is this happened to anyone?
works for me 🤔
Huh
how does one add multiple sound files to a mission or is that not possible?
uhmmm.... you add one, then you do it again.
it keeps saying that file isnt found
if it is in the mission then the filepath you're using is incorrect
ok
Yee dunno why it doesnt work 
got the latest code in the condition field, and a (working) hint in the on activation field, but it no worky
cuz u drunk

wrong class name?
Already checked that, and its the same
my last guess would be to try with typeOf vehicle _x, but i didnt need to
shooow the whole thiiing
no in the condition
also is your trigger set to repeatable, any, etc?
^ + also make sure your trigger activation type is set correctly
I'm sure he wants to get spanky
class CfgSounds {
sounds[] = {};
class Playlist
{
name = "Playlist";
sound[] = {"music\Playlist.ogg",1,1,.01,1,1,1,0}; //The 18 indicates the distance at which the sound will be heard;
titles[] = {};
};
};
class Speaker
{
name = "Speaker";
sound[] = {"music\Speaker.ogg",1,1,.01,1,1,1,0}; //The 18 indicates the distance at which the sound will be heard;
titles[] = {};
};
};
anyone see anything wrong with this code
that is saying the second sound file cant be found
never done anything with CfgSounds, but shouldnt speaker also be part of the config?
or am I missing an open bracket?
yea, class Speaker should be inside class CfgSounds
class CfgSounds {
sounds[] = {};
class Playlist
{
name = "Playlist";
sound[] = {"music\Playlist.ogg",1,1,.01,1,1,1,0}; //The 18 indicates the distance at which the sound will be heard;
titles[] = {};
};
class Speaker
{
name = "Speaker";
sound[] = {"music\Speaker.ogg",1,1,.01,1,1,1,0}; //The 18 indicates the distance at which the sound will be heard;
titles[] = {};
};
};
Okay I have another question about the truck in trigger thing 
Whats the best/right way to then get that truck as a variable?
how do you mean?
being able to assign that truck a variable like _truck
so that I can do stuff with it like deleting it
private _index = thisList findIf {typeOf _x == "UK3CB_TKC_C_V3S_Closed"};
private _truck = thisList param [_index,objNull];```
thank you
Is it possible to add new fields to a music class? Basically, if I add a new field, do the other fields like music-path, name etc still exist? Even if I do not declare them again?
if they inherit from a base class, yes
this is more related to #arma3_config
Alright, I'll move the convo to there, you're right
Doesnt seem that playMission works from the 3D world
from the main menu
https://community.bistudio.com/wiki/playMission
Most unlikely
hmm
#mission <mission name> does give this capability. Would be nice to have it as a scripting command
it exists
Not in the normal list then?
serverCommand
switch (_x in (_vehicle weaponsTurret [-1])) do
{
case "rhsusf_weap_CMDispenser_M130":
{
for "_fire" from 1 to 4 {
_pilot forceWeaponFire ["rhsusf_weap_CMDispenser_M130", "AIBurst"];
sleep 1;
};
};
case "rhsusf_weap_CMDispenser_ANALE39":
{
for "_fire" from 1 to 4 {
_pilot forceWeaponFire ["rhsusf_weap_CMDispenser_ANALE39", "AIBurst"];
sleep 1;
};
};
};``` Can one help me in optimize and fix that switch?
1.) I think I should use a ``forEach`` to execute that forceWeaponFire line probably?
2.) My switch statement seems not working, not 100% sure why
in (https://community.bistudio.com/wiki/in) returns a boolean, and you're switching against strings, so none of those cases will ever match. You should use https://community.bistudio.com/wiki/for loop for firing
ah yeah thanks for that
This is what I can get out of it with switching mission through a trigger.
usering the serverCommand with #mission
but I cant get rid of that endmission screen. debriefing = 0 in description.ext
maybe switchMove
setDamage 1 then 😄
idk really
what is that unstoppable action?
I can only speak for vanilla, sorry
Is there a way to inverse selection of nearObjects ? i.e. I want to find objects only except the given range.
you mean outside of given range?
yeap
grab all objects in a big radius, then remove those from the small one 🤷♂️ I think this is the only way
for performance issue, store the "all objects" somewhere
how to remove from all objects? deleting elements from all objects array?
i mean if there's specific things you're looking for theres probably better things you could do than huge radisu nearObjects
Could having too many groups cause performance issues?
I have noticed that count allGroups seems to go up the longer my missions run and im wondering why. I create and delete AI units dynamically, but groups ought to be accounted for in that.
It almost seems like when all of the units in a group are killed the group is not being deleted
Here is a graph of a couple different things in the mission https://snapshot.raintank.io/dashboard/snapshot/TO7Sw318CSzwk3QNlhblipGExFqRPO5J
the groups are likely not set to delete when empty. empty groups probably wont cause too big a performance issue, but there is a limit per side (255 i think).
is there a way to set them to do that automatically or would it need to be some sort of garbage collection script?
when you create groups you can use the createGroup alt syntax or use deleteGroupWhenEmpty any time after creation.
re is a limit per side (255 i think).
288 is the new limit
that..... is a weird number to stop at 🤔
It's not a hard engine limit thought, just a limit in the config which generates the group names
oh is it?
Yup
It's a single class which needs to be modified, it's just not possible without modifying this .bin file (can't remember the exact name)
If you create the groups yourself, use the alternative syntax and set delete when empty to true.
I need some advice if my approach is right or if I shouldn't use switch in that case. My current not working code is the following:
switch (_dispenser) do
{
case "rhsusf_weap_CMDispenser_M130":
{
for "_fire" from 1 to 4 do {
_pilot forceWeaponFire ["rhsusf_weap_CMDispenser_M130", "AIBurst"];
sleep 1;
};
};
case "rhsusf_weap_CMDispenser_ANALE39":
{
for "_fire" from 1 to 4 do {
_pilot forceWeaponFire ["rhsusf_weap_CMDispenser_ANALE39", "AIBurst"];
sleep 1;
};
};
};```
my goal is that based on the cm launcher the vehicle has, the specific ``forceWeaponFire`` will be executed.
I can get the weapons of said vehicle via ``_guns = _vehicle weaponsTurret [-1];`` as array. However I'm currently not quite sure how to write that switch condition in a way the output it gets is indeed the string of said launcher.
The problem with _x in _array is that the return value is a boolean. Find returns an integer and well I'm currently not sure if select could be of use here
since the only thing that changes is the weapon, directly use _dispenser in forceWeaponFire?
yeah but the script only knows the vehicle
and has no knowledge what the cm launcher is unless there is a dynamic way to return it
1/ get the weapons
2/ if CMdispenser somewhere, grab it
3/ fire it
yeah that will work.
isn't [-1] for the driver, and aren't Chaff on commander's turret?
not for helicopters
oh okay - yeah true
the only thing on your list I need to figure out is if I can do a regex regarding CMDispenser
because the class changes but has still CMDispenser in it
private _weapons = weaponsTurret [-1];
{
if ("cmdispenser" in toLowerANSI _x) exitWith
{
for "_fire" from 1 to 4 do {
_pilot forceWeaponFire [_x, "AIBurst"];
sleep 1;
};
};
} forEach _weapons;
ta-daaa
free of charge!
Hi guys,
I'm creating a simple object from a .p3d file.
Now I want to hide a selection but it won't work.
I've checked with selectionNames that the selection exists.
The script I'm using is the following:
private _pos = player getRelPos [10, 0];
private _obj = createSimpleObject [(str missionConfigFile select [0, count str missionConfigFile - 15]) + "models\testing\test_obj.p3d", _pos];
_obj attachTo [cursorObject,[-0.45, -0.45, 0.3]];
_obj hideSelection ["test_sel", true];
The model is inside the missionfolder if that is important to know.
Any help is appreciated :D
fsm instructions/tutorials/documentation?
nice
i have a function that i'd like on all cars. how can i filter Car_F class from allMissionObjects
i have a function that i'd like on all cars.
wot 🤔
i'd like to run on all cars*
ah
isKindOf is what i was looking for
i think you may find vehicles or entities to be faster than allMissionObjects
entities wiki even has an example for cars
_allcars = entities "Car";
not sure if that works for a3 but worth a go
thanks!
How do i set the ammo of the minigun, for example, of the Blackfoot and Wipeout? Those miniguns have no magazines, and i believe they also aren't pylons.
https://community.bistudio.com/wiki/setVehicleAmmo @past tiger Did you try that?
@cosmic lichen it worked, thanks. I noticed those miniguns have magazines, they just don't show the the number of magazines because by default they have only one magazine. This seens not to work with pylons.
I tried this:
_ammo = [
["1000Rnd_Gatling_30mm_Plane_CAS_01_F",[-1],1000],
["Laserbatteries",[-1],1],
["120Rnd_CMFlare_Chaff_Magazine",[-1],120],
["PylonRack_1Rnd_Missile_AA_04_F",[-1],1],
["PylonRack_7Rnd_Rocket_04_HE_F",[-1],7],
["PylonRack_3Rnd_Missile_AGM_02_F",[-1],3],
["PylonMissile_1Rnd_Bomb_04_F",[-1],1],
["PylonMissile_1Rnd_Bomb_04_F",[-1],1],
["PylonMissile_1Rnd_Bomb_04_F",[-1],1],
["PylonMissile_1Rnd_Bomb_04_F",[-1],1],
["PylonRack_3Rnd_Missile_AGM_02_F",[-1],3],
["PylonRack_7Rnd_Rocket_04_AP_F",[-1],7],
["PylonRack_1Rnd_Missile_AA_04_F",[-1],1]
];
{_wipeout addMagazineTurret [_x select 0,_x select 1];} forEach _ammo;```
i run that on a Wipeout witout any missile/bomb on the pylons.
After the code the pylons stay empty.
I'm trying to save vehicles ammo on a database.
@cosmic lichen the pylons commands should work. But i'm trying to do a universal and simple save and load that works with all vehicles like that:
1 - Save vehicle ammo on database:sqf _ammo = magazinesAllTurrets _vehicle; //save _ammo on database(...)
2 - Load ammo from database:```sqf
//get _ammo from database(...)
_vehicle setVehicleAmmo 0;
{_vehicle addMagazineTurret (_x select [0,3]);} forEach _ammo;
Dunno if that is possible. Maybe someone else knows more.
addMagazine
Isn't it still impossible to serialise vehicle inventories correctly
Imagine a World, in which a "weapon" object would exist
Inconceivable
The Cheetah AA vehicles have two smoke walls the commander can release. If you use weapons _cheetah; it show the vehicle weapons but don't show any smoke weapon. I put ammo loaded in weapons with setAmmo but i can't do that with those smoke because setAmmo needs a weapon classname (_cheetah setAmmo ["Smoke_weapon??",2];). With _cheetah addMagazineTurret ["SmokeLauncherMag",[0,0],2]; i can add 2 smokes, but they will not be loaded, player need to reload it. Any way to add the smokes loaded?
Is there any way to capture a submunition from a projectile captured with a fired eventhandler?
you must remove the old magazine first
what's the best approach to get all enemy units from point X with a radius of lets say 1 click in all directions?
My thought is to create a trigger via https://community.bistudio.com/wiki/createTrigger and play around with this, or is there another way?
@hollow lantern depends on what you want to do
normally you don't need a trigger
_enemies = allUnits select {side group _x getFriend side group player < 0.6 && {_x distance _pos < 1000}}
I just need an array of "enemies" around a given point. Nothing more. I will check out your code, thanks
"enemies" is a relative term. enemy to who? I just assumed you meant player
does that really matter? I mean getFriend side group unitName works as well.
or in other terms, I can change the person/group who is the friendly one without hassle
your code works, thank you very much
vehicle player addEventHandler ["Fired", { if (_this select 5 == "rhs_mag_M829A3")
then {
sleep 5;
hint "reloading 5 сек";
vehicle player addMagazineTurret ["rhs_mag_M829A3",[0]];
};
}
];```
16:45:24 Error position: <sleep 5;
hint "Перезарядко
16:45:24 Error Generic error in expression
16:45:24 Suspending not allowed in this context
16:45:24 Error in expression <ect 5 == "rhs_mag_M829A3")
then {
sleep 5;
hint "reloading
How to add 5 second waiting before executing addMagazineTurret here?
spawnvehicle.sqf, which executing from onPlayerRespawn.sqf
🤔 try using spawn
vehicleName addEventHandler ["Fired",{
spawn {if (_this select 5 == "rhs_mag_M829A3")
then {
sleep 5;
hint "reloading 5 сек";
vehicle player addMagazineTurret ["rhs_mag_M829A3",[0]];
}; }];
here you go @quasi sedge
dta/bin.pbo you can actually modify it via a mod. But only one mod can do that
Any clue how to omit this enf-mission UI?
debriefing = 0 in the description.ext doenst work
in MP
vehicle player addEventHandler ["Fired",{
spawn {if (_this select 5 == "rhs_mag_M829A3")
then {
sleep 5;
hint "reloading 5 сек";
vehicle player addMagazineTurret ["rhs_mag_M829A3",[0]];
}; }];```
Dont working, no errors in .rpt
@umbral nimbus you can maybe ctrlActivate the button control in the end to skip it, that setting does nothing in mp
spawn is a binary command
i.e you should write:
_this spawn ...
vehicle player addEventHandler ["Fired",{
_this spawn {if (_this select 5 == "rhs_mag_M829A3")
then {
hint "reloading 5 сек";
sleep 5;
vehicle player addMagazineTurret ["rhs_mag_M829A3",[0]];
}; };}];``` freaking works  Thank's everyone
should put the spawn inside the if after the hint, it's better to stay in unscheduled for aslong as you can
Anyone have an updated guide on pre-scripted vehicle paths and is it possible in other vehicles like ifrits and not just helicopters?
End purpose is to make an ifrit ripping arena where you have ifrits driving pre-recorded paths to practice ripping on, if there is a more efficient way please do let me know.
Does anyone have a guide on how to make doors?
In all those years I never really seriously scripted with UI/Controls etc.
How would I find out the control name of the button.?
displayCtrl combined with IDCs
That doesn't give the name
If he wants to ctrlActivate he doesn't need the "name". 🙂
Please read. The suggestion is on ctrlActivate, and he's not sure how to use that.
You don't need ctrlClassname to ctrlActivate. I know plenty of people who consider getting some pointer to something the "name" of it
Oh i need to go back like 3 hours in the chat history? I didn't realise. I was only going off his last question about control name.
He was asking for the control name which could only mean the class name so that's what i gave...
🤷
I guess it doesn't show you what he replied to? Anyway moving on, ctrlClassname to get the classname for it in the config, Generally most commands you need the ctrl which is done with findDisplay (Or getting something from uiNamespace) and then displayCtrl
I'm on mobile, maybe i just don't see it
You could use a lot of UI commands directly with an IDC without display, but generally that's bad and you should feel bad for doing it 😄
I feel bad for not understanding the whole UI scripting at all
Thanks, it worked, but that create a reaload state that take long for some kind of weapons, and for the smoke it's a little bugged because it takes forever to reload.
The main problem is that there are a lot of engine-sided UIs and its tricky to do things with those. Especially in what you're trying to do
ok
now I found a script from @unique sundial to omit a briefing screen. through a script. Someone basically asked the same question on his site, what I'm asking now. But unfortunately he didnt respond to it
wait I have a link
Briefing screen? Is that the one with map and mission objectives?
well yes
but I'm talking about the debriefing
as is this guy asking the question in the post
That whole debriefing system is scripted I believe
I don't have the code available but I think it's some the biki somewhere
A2 has some native "waiting for respawn" crap
There's some sort of template system. I have you look for the expected config entries on your pdrive you should find ways to bypass it
Yeah. It's a starting point to look on pdrive for those config entries
right
is missionNameSpace or other variables stored in objects saved when using the save button?
Eden save, no, mission save, yes
ah perfect
a lot of scripts would break otherwise :D
careful of UI variables though 🙂
what do you mean? whats to be careful about?
a display/dialog/overlay is not saved
ok so all ui related variables need to re-init upon mission start then
there is a "loaded" mission EH yep
Hey peeps I have another questions, how do I get a variable into a remoteExec
?
I have this code:
_index = thisList findIf {typeOf _x == "UK3CB_TKC_C_V3S_Closed"};
_truck = thisList param [_index,objNull];
_truckstr = str _truck;
hint _truckstr;
[truck_1_spawm_holder,"Load Concrete Pieces","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","_this distance _target < 3","_caller distance _target < 3",{},{},{ truck_pile_1 setPos (getPos truck_1_spawm); deleteVehicle _truckstr; deleteVehicle truck_1_spawm_holder; hideObjectGlobal concrpile_1_1; hideObjectGlobal concrpile_1_2; hideObjectGlobal concrpile_1_3; hideObjectGlobal concrpile_1_4; hideObjectGlobal concrpile_1_5; },{},[],12,0,true,false] remoteExec ["BIS_fnc_holdActionAdd", 0, truck_1_spawm_holder];
Which gets a truck in a trigger, and also adds a holdAction to an item.
Now I want the truck to be deleted when the holdAction is executed, but it always gives me an undefined variable error for _truckstr, I presume since its a remoteExec.
Now I need to somehow get the variable into the remoteExec so it can do the thingy, anyone got an idea?
yep, _truckstr does not exist in the action code, even if it were not remoteExec'd
you could e.g setVariable _truckstr on truck_1_spawm_holder eventually @oblique arrow
(also, spawn, no?)

yeah just a typo
setVariable _truckstr on truck_1_spawm_holder eventually
what does that do?
no worky
_index = thisList findIf {typeOf _x == "UK3CB_TKC_C_V3S_Closed"};
_truck = thisList param [_index,objNull];
_truckstr = str _truck;
truck_1_spawm_holder setVariable ["_truckstr", _truckstr, true];
hint _truckstr;
[truck_1_spawm_holder,"Load Concrete Pieces","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","_this distance _target < 3","_caller distance _target < 3",{},{},{ truck_pile_1 setPos (getPos truck_1_spawm); deleteVehicle (truck_1_spawm_holder getVariable _truckstr); deleteVehicle truck_1_spawm_holder; hideObjectGlobal concrpile_1_1; hideObjectGlobal concrpile_1_2; hideObjectGlobal concrpile_1_3; hideObjectGlobal concrpile_1_4; hideObjectGlobal concrpile_1_5; },{},[],12,0,true,false] remoteExec ["BIS_fnc_holdActionAdd", 0, truck_1_spawm_holder];
Still the same error
_truckstr is undefined in hold action code
Ye thats what I was trying to fix with the set-/getVariable
Which Lou recommended
How do I fix that?
Actually now that i looked at it again, you forgot to quote it
in getVariable or?
Sooo, I am trying to create a cargo/container area.
I have an array and I am attempting to create x amount of container depending on the amount of arrays, so something like this:
private _containers = [["someInfo"],["someInfo"],["someInfo"]];
{
_container = createVehicle ["someContainerClass", getMarkerPos "someMarker", [], 20, "CAN_COLLIDE"];
} forEach (_containers)
But I want to create the container within a rectangle marker but also want them to, well not collide with each other/hit each other.
So want to create them on a line but keep them within the rectangle. Or just make them look like a port/cargo/container area would look like. I have tried making a position check, to check if the position is within the area and then keep changing the pos until the container is x amount away from the last container so they don't collide. But it just didn't seem to work as I wanted.
If anyone could help me, that would be greatly appreciated.
does setWeaponReloadingTime work?
@timid niche
have tried making a position check, to check if the position is within the area and then keep changing the pos until the container is x amount away from the last container so they don't collide
why?
if you simply want them to be in the area in an orderly fashion, just use a pattern.
what do you mean "a pattern"
What function can I use which will tell me how much ammo they have in each mag as well as the currently loaded mag?
I want it so that the player will respawn with the same mags and the same amount of ammo instead them
Currently, I am just copying the inventory at death and giving it to them upon respawn
https://community.bistudio.com/wiki/magazinesAmmo
but get/setUnitLoadout is nice too
It doesn’t seem to store information about how much ammo there is in each of the mags so it ends up giving them fully replenished mags
setUnitLoadout
thanks
I am already using get/setUnitLoadout but it isn't holding any information about how much ammo is in each of the mags
here is my code for saving the loadout
(_this select 1) setVariable ["loadout", getUnitLoadout (_this select 1)];
This seems to treat every magazine as if they're all full
where do you use this?
onPlayerKilled.sqf
here is my respawning code
_loadout = player getVariable ["loadout", nil];
if !(isNil "_loadout") then {player setUnitLoadout [_loadout, true]};
this code is in onPlayerRespawn.sqf
@slate cypress
onPlayerKilled.sqf
Executed when player is killed in singleplayer or in multiplayer mission.
params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];
oldUnit: Object killer: Object respawn: String? respawnDelay: Number
_this select 1 is the killer
why return nil if it's nil?!!!
_loadout = player getVariable ["loadout", nil];
is the same as
_loadout = player getVariable "loadout";
ah ok thank you
Is there a built in function or one that someone has made that coverts a date from systemTimeUTC to time since epoch?
I want to compare the difference between two dates
numbers dont go that high in arma properly. they become inaccurate
i do have an fnc for comparing dates, just not access to it at this moment
Oof, my bad. Maybe I should have started there lol, thanks for the link
with pleasure! ^^
PS: dates are a b**** (and that in every language!)
well, I know what I mean with time, time difference, UTC, durations etc in a professional environment 😄
This command needs a unit to be in the turrets, but i will keep it in mind.
Thanks.
The Gorgon have a weapon "autocannon_30mm_CTWS", this weapon have 2 muzzles muzzles[] = {"HE","AP"}. If i do a _gorgon setAmmo ["autocannon_30mm_CTWS",140]; nothing happens, may be because i not specified the muzzle. How can i make setAmmo work with the Gorgon auto cannon? PS: in ammo function (setAmmo getter) you can specify the muzzle, so i believe this also can be done with setAmmo, i just don't know wath string to use as the muzzle.
Sorry for the long text.
I found, i need to use _gorgon setAmmo ["HE",140] or _gorgon setAmmo ["AP",60].
good morning...
is it possible to have the following functions only output mod content (CUP) and exclude vanilla?
https://community.bistudio.com/wiki/BIS_fnc_exportCfgMagazines
https://community.bistudio.com/wiki/BIS_fnc_exportCfgWeapons
https://community.bistudio.com/wiki/BIS_fnc_exportCfgVehicles
https://community.bistudio.com/wiki/BIS_fnc_exportCfgVehiclesAssetDB
i have never done scripting, so consider me a noob in that sense. please ping me if somebody has an idea / solution, i have this channel muted.
many thanks in advance
morning?
should be doable yes
are you trying to setup your own wiki with bl***j*** and h****** ?
i already have a wiki, but the manual rework of the export is just... well... _annoying _
Hello i need help iv been trying to fix an error that shows in the RPT file but can not figure this out any input?
Error in expression <forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;>
Error position: <select _forEachIndex] } forEach _pylons;>
1/ don't crosspost
2/ provide code, it can be useful
sorry i posted in the wrong place then posted here forgot to delete the other post
(```sqf to colorcode it plz)
im new to all this so i dont know how to do the color coding....
one sec i see your pin on it
When I play with "Master Zeus", the Maximum field of view is too low in server
Even I set up 14000m in game it doesn't work
I heard that There's a commend which extend maximum field of view...
yes, setViewDistance
oh thanks
nvm ill figure it out tm im tired as hell working on a map for hours
Do I type it like this? setViewDistance 5000m
nope; and it has to be run on the server as well
see https://community.bistudio.com/wiki/setViewDistance
thanks alot
it's pretty easy actually. you just have to make sure that their configSourceAddons contains one of cup pbos. (provided that guys don't modify vanilla content as well)
you can also use the "author".
@deft dock
basically, all you have to do is add another condition where it does: getnumber (_x >> "scope") > 0
for example:
getnumber (_x >> "scope") > 0 && getText (_x >> "author") == "CUP Team" //I don't recall what you guys use as the author so I'm just using "CUP Team"
or
getnumber (_x >> "scope") > 0 && configSourceAddonList _x findIf {_x select [0,3] == "cup"} != -1
I recommend the first one, especially if you guys don't use localization for the author's name (but even if you do, you can localize the string and use that instead)
So i am getting an error in RPT file and still cant figure this out i am very new to it all here is the error and the code below any ideas would be great.
Error in expression <forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;>
2:49:39
Error position: <select _forEachIndex] } forEach _pylons;>
Error Zero divisor
File C:\Users\Hayden\Documents\Arma 3\mpmissions\BMR_InsurgencyTEST.Altis\INSfncs\server\server_fncs.sqf..., line 147
INS_replace_pylons = {
params ["_veh","_pylons"];
private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _veh >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
private _nonPylonWeapons = [];
{ _nonPylonWeapons append getArray (_x >> "weapons") } forEach ([_veh, configNull] call BIS_fnc_getTurrets);
{ _veh removeWeaponGlobal _x } forEach ((weapons _veh) - _nonPylonWeapons);
{ _veh setPylonLoadOut [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;
};
You sure you're not missing a };?
yea sorry im not lol just was not in my copy and paste
where do you make the _pylons array?
the error is obvious. the size of the _pylons array is bigger than _pylonPaths (it could even be empty), so you get a zero divisor error when you use select _forEachIndex
I suggest that you systemChat/diag_log both of the arrays to see what the problem is
leopard I changed my code in onPlayerKilled.sqf however it has the same behaviour
this is onPlayerKilled.sqf
(_this select 0) setVariable ["loadout", getUnitLoadout (_this select 0)];
this is onPlayerRespawn.sqf
_loadout = player getVariable ["loadout", nil];
if !(isNil "_loadout") then {player setUnitLoadout [_loadout, true]};
All mags still get refilled
you are still getting the variable from player
which is the living unit.
@slate cypress see https://community.bistudio.com/wiki/Event_Scripts#onPlayerRespawn.sqf
params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"];```
also, you are still using getVariable + nil, which will make Leopard20 angry at you now 👀
ah yeah I forgot to change that part
given that this has information about oldUnit, do I even need onPlayerKilled.sqf?
depends if the old unit gets deleted in the meantime
if you could confirm to me the data type of _respawn, that would be great so I can fix the wiki 🙂
scalar
thankie!
np 😄
rawr
yes, both are scalar 😄
can't taste them anyway 🤢
erf! sorry to hear =\
oh you're kidding me
all this time, i've had fullMagazines set to true...
aghhhhhhhhhhhhh
self-spank 🤣
🤣
ok so that's now working
how can I fix the fact that the gun gets removed from the loadout if the player dies in a blast such as a grenade explosion?
do you still use onPlayerKilled?
yes but it seems to have been a one-off now
do you know why it happened?
😄
the rifle gets removed for it to "drop to the ground"
but -right- when the player dies, you should still be able to get the weapon
when creating a waypoint, is it sufficient to use addWaypoint and then just use setWaypointType with the waypoint class name
I am using lambs for reference
the AI seem to be moving but I'm not sure they have the move waypoint or specifically the custom waypoint that I intend for them to have
the class name for the waypoint is lambs_danger_Rush
_wp1 setWaypointType "lambs_danger_Rush";
Hey peeps I have another question, I'm playing around with using a camera, but when I use
_camera camPreparePos (getPos cam_1);
the camera just spawns on the ground, rather than the correct height, any chance anyone has an idea what I'm doing wrong?
camCommitPrepared 🙂
Yee I'm doing that
and the camera does move to the position, but it stays on the ground 
AGL/ATL/ASL issue?

because getPos to a man on top of the building will return a Z of 0, therefore ground
the provided position must be in AGL format. you're providing AGLS. see:
https://community.bistudio.com/wiki/Position
you're providing AGLS. see:
Thats just the position logged through 3den, but I'll take a look at that anyways
guys... with setSkill, is the "general" subskill still in use?
I have a memory of Suma or somone similar saying, maybe on reddit, that it is redundant
but can't find it now
who knows?! but more importantly, does it matter?!
*cross Leo off next years christmas card list
says Some information on this page were not confirmed by BIS!
and about 'general'
general
Raw "Skill", value is distributed to sub-skills unless defined otherwise. Affects the AI's decision making
I don't think it is used. It was probably used in older Arma games. It doesn't do what it's supposed to do either.
that does seem to tally with my tests
yeah, I'm saying that according to a quick test scenario I just made.
yes, thanks, glad its not just me getting those results
you might both be crazy, just sayin'
hehe
problem is all my work with setskill is undone when someone puts the mission on a server with different difficulty presets
and yes, im aware I don't understand skillfinal and related stuff
So, I've got a helicopter that's being flown with unit capture that's supposed to land but after it's landed with unit capture the pilot takes back off and hovers.
What can I do to make the AI just stay still?
@cerulean cloak Follow the rules. No profanity.
You can try the land command. Create an invisible helipad and tell the AI to land there.
Another approach would be to use an eachFrame EH loop and applying a (small) negative velocity to the helicopter.
I tried the land command and no luck.
I'll try and work something for the negative velocity. How much would you suggest?
About 1-2 is enough ([0,0,-1])
Ok
while {bhl} do
{
{
_vel = velocity _x;
_velx = _vel select 0;
_vely = _vel select 1;
_x setvelocity [_velx, _vely, -1];
} foreach [bh_1, bh_2, bh_3];
};```
That did the trick. Thanks for the help and sorry for the rule violation. I was just getting quite annoyed with the AI being stupid.
question. is it possible to detect if the player is on a slope and which directon of that slope is "down"?
evening everyone. is there a way to place a trigger and use it to change the side of a groupe of ai soldiers? so i can change the side of them in just a second. i searched the bohemia i command website but i cant find a command or how to put it in the trigger. thanks and merry x mas by the way
createGroup east and joinSilent? 🙂
@west grove check this thread https://forums.bohemia.net/forums/topic/193097-testing-terrain-gradient-of-an-area/
Hello guys, does anyone of you tried football script that actually works? And if so would you be so kind and send me link there? Thank you very much and Merry Christmas
@devout obsidian what you looking for?
https://youtu.be/LAYc-n0UE6E Something like this (doesnt need to be super complicated, players moving the ball is enough of entertainment
Question about hashmap - if i use objects as keys, if they are dead i lose key, right? So i guess i should create random key name and save object in array. Is there a "fastest datatype" to use for random keys?
E.g. 5 digit number faster than 3 digit string?
"if I use objects as keys"
Read the wiki page before you use the Hashmap, object as key is not a thing
Number of digits in a number makes no difference, that's not how numbers work.
Number is probably a tiny bit faster than string
just mind the precision right?
if i only use "integers" i wont, right?
i was thinking if i should use key with some identifier letters + random tail, just so its more debuggable later. But only if its not too costly. Thats why i was asking
String is only more expensive by one pointer indirection, basically.
It's nothing you could measure or notice.
But string is slower than number
= go for it @austere hawk
i see, thanks
now if you have a 9999999999 elements hashmap…
also, hasmap arrived with perfect timing 😄 Thanks Dedmen. Dont know how else i could do the thing i want otherwise without losing sanity from having to reshuffle / constantly redo index accounting arrays all the time and stuff
talking about that, no word on a max limit?
he still has to fill it :p
No
hah! you just did
if i send my AI units to sleep they all start counting sheep. All sheep must be accounted for. And named
and each sheep has four legs… etc
and more seriously, for the wiki?
cannot estimate?
neverending hashmap? :3
RAM overflow? :3
don't use while. use the eachFrame event handler
surfaceNormal
to get the down direction, just get its horizontal projection
I only want it to go after they've landed and only for a limited time thougj
still, don't use it
So how would you do it then?
do a projection on the vector3.up and subtract it from the surface normal. receive direciton in horizontal plane pointing downwards the hill
vector projection is done using scalar product.
or you can just set its z component to zero (for direction)
unless you want the actual slope
hm yeah that works to.
still stuck in my spacegame mindwise where its a bit more complicated.
your method is better.
there are no integers in sqf
hence the quotes
Speaking of hashmaps, what happens if I set the hashmap itself as the value?! Error?! _hashMap set [_key, _hashMap]
that would be a recursive error for arrays. but I wonder what would happen if I did it with hashmaps. I don't see it as an error.
you create a black hole. are you happy with the destruction of our planet now??
(iirc Dedmen said it throws an error?)
that would be with an array 😅
btw what does having a true at the bottom of a script do? Seen it in a lot of BI's scripts
"just" returning true, usually as a default return value / saying the end has been reached
returns it
ah oki, thanks 
Can triggers be dynamically simulated?
created you mean?
After they are created can they by dynamically simulated so that only ones that meet the criteria for it are running checks for their activation condition?
If you're referring to:
https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation
I don't think it makes much sense for the triggers to be dynamically simulated
I use triggers to create enemy units for players so that the composition of these units can be changed on the fly via scripts if need be
yep ↑ (what Leopard20 said)
you can do it manually, it doesn't work for non-object entities I believe
as opposed to just spawning everything in and then dynamically simulating only ones that players might have contact with
use loops
I don't think what you want needs triggers
plus triggers are loops too
Right now every trigger on the map is evaluating its activation condition when the interval ticks over, would be nice to have only the ones near players doing that
Triggers have just been a convenient vehicle for controlling the conditions in which enemy units are created
There are just a lot of requirements that the mission needs to meet when it comes to that, and with a minimum of manual work required to make it
Since with the current system all we need to do is place down markers for areas in which we want an enemy presence, configure some className lists and the script takes care of the rest
Hey, I'm looking to make a script that gets all the weapons classnames in my mission's modpack and placed into my clipboard.
But I need it to be in a particular format. How do I go about doing this?
so now that I have the class names, How do i use that to get a display name?
"CfgWeapons" >> class >> "displayName" iirc
is there a way use the script to save to text doc?
yeah, thats how the allinone config extraction works
(or at least it did, i think now someone did a dll that does it (?))
Only using extensions
Hey good afternoon everybody. I was wondering if it were possible to adapt this arma 2 script (https://forums.bohemia.net/forums/topic/150624-jip-helicopter-insertion/) for helicopter insertions in to a3, with my reference photo attached here (https://imgur.com/a/ZacNkD5). has anyone here tried this before?
That. Probably.
I don't remember what exact number it is.
But it's atleast 4GB*16 ram usage.
In the usual case atleast 4GB * 32
Ur not gonna have that much ram.
Already explained multiple times what happens, afaik even directly to you too.
Also should be written on wiki page.
I'd like the helicopter to only be a spawnable point between points A and B, wheres Point C is a flight outside of map boundaries. and Point D is a loop setup phase. any help or suggestions would be appreciated as i have zero knowledge of how to script in this game yet 🙂
Want to do custom sqf objects?
I am still having problems with getting the display name of a class
_DisplayNameX = str getText (configfile >> "CfgWeapons" >> "displayName" >> _CLassBoi);
What am I doing wrong?
For starters, str is not Needed as you get a string
Then, you the class Name nav belongs in Front of displayname, assuming that it is clasboi
GetText Returns a string already
That is why str is not Needed there
oh double strings
SO i am getting some weird shit
displayName = ОЦ-14-4 Гроза;
Guess you used copy paste?
correct
And eg. Notepad++ as target?
Yep
Check the file encoding
utf-8?
turns out it was because one of my mods is in russian.
as other entries have turned out great
You know grad-listBuymenu?
im trying to print out on mass this
class RHS_Weap_AKM_gp25 {
displayName = "AKM 7.62 mm (gp25)";
description = "The AKM is a Soviet assault rifle designed by Mikhail Kalashnikov during the 1950s. This ones comes with the gp25 grenade launcher";
price = 1100;
stock = 40;
};
for every weapon.
Ahh
Okay
Now I need a way to delete double ups
I don't need every AK known to man, let alone twice.
So say if I have a srifle_DMR_01_MRCO_F and a srifle_DMR_01_F within the same array.
How do I find the one with the least amount of attachments and purge it from the array?
not to me. you just mentioned it in one of your note-to-self-like messages
you only mentioned this: !!HashMap circular reference!!
@still forum
_hm = createHashMap;
_hm set ["1", _hm]; //no error shown here
_hm set ["2", 1];
_hm get "1" //now you get an error
it only throws error when I use the get
this is what I was asking. whether it shows an error
the error is only a warning. it doesn't prevent you from using that
hashmaps... another thing to learn
ok, so the wikipedia page appears to be aimed at someone who already understands this stuff
ah, biki page is much better
thanks to dedmen and revo for a nice piece of writing on that page - making it understandable for noobs
oh, and Lou 🙂
On serialization, it will error and kill your game. And it causes memory leaks.
get shouldn't error.
str, isEqualTo and serialization will
You can do it, doesn't mean you should.
And I might randomly in some game update just add a check for it and force crash everyone's game when it happens
How to add a custom event for an object and then call it? Does this need to use BIS_fnc_addScriptedEventHandler?
You could use scriptedEventHandler yes
There should be something like fnc_fireScriptedEventHandler to trigger it
Thanks for the answer.
I don't want to do it. It was purely for testing.
You could pick up my custom language SQC, making your life with hashmap simpler 🤪🤪 (hashmaps as sqf objects 💪💪)
Sure, yet another thing to learn.
Surely a great idea
Always 😏
I've never actually looked at sqc. Does it offer any major advantages over sqf? Especially performance wise?
It's compiled down to SQF code currently.
But it will be able to use optimized SQF bytecode once that becomes a thing.
Which will yield a performance improvement
Soon job adverts will mention requiring 5 years of SQC experience
i dont even know whats meant by that, so propably not :P
I just need arrays with a fixed index, so that whenever i remove or add an element, the index for the other elements never changes - which is exactly what hashmap offers
you can always _array set [3, nil] 😬
Would be funny indeed, but in the end, sqc is just sqf with a nicer syntax and some extra Features
or just any other value 
no, objNull set [3, nil] would throw an error 😏🤣
Can someone help me fetching all door objects on the map ?
im trying something with numberOfDoors
private _object = [];
{
private ["_numberOfDoors"];
_numberOfDoors = getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors");
if (_numberOfDoors > 0) then {
_object pushBack _x;
};
} forEach nearestTerrainObjects [[0,0,0], ["House"], ( worldName call BIS_fnc_mapSize ), true];
Use the center of the map instead.
nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true]
what do you mean "to work"?
the code looks fine to me
apart from that unnecessary private
private _object = nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true] select {
getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors") > 0
}
your data is then in the _object variable
private _object = [];
{
private ["_numberOfDoors"];
_numberOfDoors = getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors");
if (_numberOfDoors > 0) then {
_object pushBack _x;
};
} forEach nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true];
systemChat str count(_object);
``` prints 0
oh
*** i tested it on Altis and it works, apparently i did setup my doors wrong
ok,
also, use select instead.
see:
#arma3_scripting message
yes thanks i changed it
i am confused:
if i look at my door and check
getNumber (configFile >> "CfgVehicles" >> typeOf cursorObject >> "numberOfDoors") > 0
``` I get a True
But if i runn
```sqf
private _object = nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true] select {
getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors") > 0
}
systemChat str count(_object);
``` i get 0
I checked :
```sqf
count nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true]
``` = 76
:/
( ) maybe?
private _terrainObjects = nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true];
private _doorObjects = _terrainObjects select {
getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors") > 0
};
count _doorObjects;
systemChat format["found : %1 doors",count _object];
found : 0 doors
use temp vars
still 0 with your changes :/
no. based on the rules of precedence my code was correct
this is wrong
you didn't terminate the statement with ;
and I'm not sure how you say it returns 0 because it shouldn't run at all
yes wrongly coppyed to dc but tested with
is your "door" even in the list of nearestTerrainObjects?
current version:
private _doorObjects = nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true] select {
getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors") > 0
};
systemChat format["found : %1 doors",count (_doorObjects)];
found : 0 doors
try this while looking at the door object:
systemChat str (cursorObject in nearestTerrainObjects [[worldSize/2,worldSize/2,0], ["House"], worldSize/sqrt(2), true])
I bet it returns false
yes returns false
so it's not even in the list of nearestTerrainObjects
hm
did you place it yourself (via editor or sth)?
that's not the same thing
nearestTerrainObjects doesn't use iskindOf
try "Building" instead
found 59 doors 😄
thanks
can you explain me quicly why this was not working ? i used class house as BAse class in the cpp thats why i thought i need house
because of this:
https://community.bistudio.com/wiki/nearestTerrainObjects
this command returns terrain placed objects like trees, rocks and buildings which don't necessarily need an associated config class.
okay thanks alot
is there a way to overwrite server addon settings through code?
Server addon setting? What?
missionNameSpace setVariable ["ace_common_allowFadeMusic",false,true]; this doesn't seem to be working unless the player sets it themselves (or the server forces it)
Likely because ACE settings are saved in the profile namespace.
You May be better off asking at the ace slacks Chat that
As it is more likely you get an answer there then here
Yeah I did that already, thanks 😄
Npnp
Just to confirm, when does this trigger get activated? https://imgur.com/a/XwX2dNN
I believe "any member of the linked group"
ah yeah, true
fundamental question:
when I have a while loop in a script, and that script only once get to the point where the while loop will be "called" (and therefore the condition will be checked), does it then on every iteration, check condition or would another call of the script be needed to check the condition once again?
I have an array that at one point is empty. The while condition states that the code block in the loop should be executed as long as the array is not empty.
However said while loop seems to be looping forever
The condition is checked everytime the code leaves its scope and until it yields false
_enemies = allUnits select {side group _x getFriend side _group < 0.6 && {_x distance _target < 1000}};
_visTargets = _enemies select {([objNull, "VIEW"] checkVisibility [eyePos (gunner _aircraft), eyePos _x] > 0.3)};
while {(_group getVariable ["KI_airSupport_cfSwitch", objNull]) == "IAO" && !(count _enemies == 0) } do {
_bulletMagnet = _visTargets call BIS_fnc_selectRandom;
if (alive _bulletMagnet) then
{
(gunner _aircraft) reveal [_bulletMagnet, 4];
(gunner _aircraft) doWatch _bulletMagnet;
(gunner _aircraft) doTarget _bulletMagnet;
}
};```
Here is the code of said ``while loop`` In my opinion it never leaves the scope.
maybe my question should also ask if when the while is no longer active (condition false) if code below it will be still executed
after the };
yes, the variable is never updated and the while loop will run forever
you could update the _enemies variable e.g in the while loop, or in the while code
ah yeah that would make sense
private _array = getAllEnemies; // empty because no enemies
while { count _array == 0 } do
{
// update here
_array = getAllEnemies;
};
that or count getAllEnemies directly in the while
now that you mentioned it, it all makes sense, thanks you two
what's the best way to run a while loop for x seconds? Currently I do
diag_log format ["%1, %2", groupId _group, "arrived at the AO." ];
while {_gametime != 0} do
{
// code things
_gametime = _gametime -1;
};
diag_log format ["%1, %2", groupId _group, "is RTB, good luck soldiers, out." ];
And _gametime in this case is 120. However it seems that this method is in-accurate as my while loop is over in less then a minute according to the RPT:
23:39:53 "Vulture 2-1, arrived at the AO."
23:39:59 unable to get word:'laserdesignator' in protocol:'radioprotocoleng'
23:40:04 "Vulture 2-1, is RTB, good luck soldiers, out."```
that would work if you had a sleep in the loop. or a for loop would do the same thing with a sleep, no need to do the math with _gametime.
or for the sake of covering all options, another is to define the end tick and use that as the condition
private _end = diag_tickTime + 120;
while {diag_tickTime < _end} do {
/// code things
};```
though again, you'd want a sleep in that otherwise itl spam and has the potential to crash your game
you mean like a execution delay in the loop?
aka sleep 1; ro run it only every second
yea, so 120 becomes 120 seconds rather than 120 iterations
though... it would stll be 120 iterations, but spaced one second apart
do event handlers fire only on the machine where the unit (it is attached to) is local?
depends on the event. as a general rule they fire on the machine where the event was added, but there are some exceptions.
yes (with exceptions), except for MPEH yes
Good evening everyone
So I am to make a training map for a Unit and I wanted to make the targets moving (like the Shoot tagerts, yellow practice idk how to call it) from left to right or from the back to the front. I followed this guide, the tutorial is from a German Scripter https://www.gruppe-w.de/forum/viewthread.php?thread_id=2235
I followed it and yet still dident understand it(not because its german) is there an easier guide or is this the only one(I spend many min about 45 or so trying to see if there is an answer to my question on the Internet, I couldent find one so I would try it here) ?
Thanks in advance.
Your question is too general. What don't you understand?
The scripts from that link are working when you make a few modifications (at least that's what I remember from using it myself).
So as Ryko said; if we know what you don't understand we can help you better 🙂
Hello friends! I am looking to make a script that turns on and off reflectors by using a UserAction rather then pressing L
I am looking to do this so that I am able to make police lights that actually flash reflective lights rather then just an animation
Thanks for any and all help!
Hello! I am looking for a mod or a script that make interaction ( the scroll wheel lotting easier) is there someone who could tell me the script or mod name if there is one? Thanks!
"reflectors" as in headlights?
https://community.bistudio.com/wiki/Arma_3_Actions#LightOff
try using LightOff and LightOn actions in an addAction.
i thought pressing L toggled headlights 🤔
It does
I am looking to make police lights as said here
when would I want to use task ID and parent task ID? Right now I just make all tasks parents.
are you using the task framework?
just the modules at the moment
but i usually keep both IDs blank for default
is it for doing something like...
parent task - destroy all vehicles
subtask 1 - vehicle 1
subtask 2 - vehicle 2
subtask 3 - vehicle 3
and then each time you kill a vehicle it completes that subtask? cause normally i just have the 3 vehicles tied to a trigger to set the overall task as complete
it is for organisational/visual purpose
e.g taskA will be at the top, then taskA1, A2 and A3 will always be set/added under taskA
also, if you complete the parent task all sub-tasks will get completed @fair drum
the other way around is not true (completing all sub-tasks will not complete the main task)
how can i have a publicVariable array be appended via multiple functions executing at different times and still make sure all appends are there
or is everything executed sequentially in which case this is a non-concern
who is appending, who is publishing?
i have some functions in init fields of eden objects
that is the only time this public array will be modified at all
ugh, init fields…
yeah, i know, sorry
so it is going to be executed by everyone, even JIP, and publicVariable'd as well? that's…
right, so i have to give variables to these eden objs and have the script run at initServer
ideally yes. or wrap everything in a if isServer
that's adding to the ugliness, but it would solve it
if i do that, i wont have to worry about continuity in the array, right? every append will be there and none will get overwritten
yep
one init field after another
thanks!
understood
strategic map is local correct? if I do some remote shenanigans, will it work for MP too?
I think it should?
welp... hold my MXC, I'm going in
what do you mean with "remote shenanigans"?
we don't want to know 😄
just remote exec stuff
i can't find the biki page for remote shenanigans
What is the chance of zombies without a mod?
vague question is vague
i'm searching for zombies without mod, can't find any.
Don't want to add zombies mods to my mission.
what sort of zombies do you want? What aspect of a zombie to you want? If you want the total zombie experience without mods, then I think you're stuck
you cant make civs look like z without a mod
ok, i will try
you might be able to script zombie like behaviour, but unless you're well versed in scripting, this is going to be very hard
Any way to get all files from a mission folder?
dePBO it
Yeah, well... I think if there's a way to do it in-game
in game? don't think so
addonFiles is the closest thing I've ever thought but well, it's not what I need. It's not even hard to do it manually so I'll forget the idea
too blind to see the issue 😐
// If respawn tickets were disabled, remove the initial ticket for each of the players
if (missionNamespace getVariable "BIS_respawnTickets" == 0) then {[(_this select 0),-1] call BIS_fnc_respawnTickets};
_unit = _this select 0;
_class = _unit getVariable ["BIS_UnitClass",""];```
rpt:
Error in expression <respawnTickets};
_unit = _this select 0;
_class = _unit getVariable ["BIS_U>
Error position: <;
Error Missing ;
File \WW2\MissionsWW2_p\WW2_GameModesBI_p\WW2_Escape\respawn\fn_BIS_onPlayerRespawn.sqf [A3_WW2_Escape_fnc_OnPlayerRespawn]..., line 6
➥ Context: [] L1 ()
[] L291 (A3\functions_f\initFunctions.sqf)
[] L299 (A3\functions_f\initFunctions.sqf)
[] L304 (A3\functions_f\initFunctions.sqf)
[] L314 (A3\functions_f\initFunctions.sqf)
[] L323 (A3\functions_f\initFunctions.sqf)
[] L328 (A3\functions_f\initFunctions.sqf)
[] L333 (A3\functions_f\initFunctions.sqf)
[] L338 (A3\functions_f\initFunctions.sqf)
[] L374 (A3\functions_f\initFunctions.sqf)
[] L375 (A3\functions_f\initFunctions.sqf)
[] L102 (A3\functions_f\initFunctions.sqf)
[] L129 (A3\functions_f\initFunctions.sqf)
[] L130 (A3\functions_f\initFunctions.sqf)```
definition:
class CfgFunctions {
class A3_WW2_Escape {
class functions {
class OnPlayerRespawn {file = "\WW2\MissionsWW2_p\WW2_GameModesBI_p\WW2_Escape\respawn\fn_BIS_onPlayerRespawn.sqf"; preInit = 1; recompile = 1;};```
nope
if (missionNamespace getVariable "BIS_respawnTickets" == 0) then {[(_this select 0),-1] call BIS_fnc_respawnTickets;};
semicolon before the closing curly?
no need
my sqf checkers find no error in that line
which one is line 6 of that script?!
the code worked directly in mission - moving to cfgFunctions in config bugged it
also, just for safety, use:
missionNamespace getVariable ["BIS_respawnTickets", 0]
Invis character?
did you try systamChat/diag_log ing _this to see what it gives you?
zombies need zombie animations, which need modding
in first line but it crashes the game startup with preStart = 1 and preInit already errors on parsing the file
rewrote the code section to make sure no special chars slipped in there
its a 0 - compared vs the line above just to be sure
🙂
not if you use syntax highlighting! 😅
tell me you've never done the O vs 0 thing?
nope. I mean I make the typo sometimes, but I correct it immediately thanks to syntax highlighting
yes, thats wht i mean 🙂
what language is your keyboard Leo? on my UK English keyboard, those two keys are very close and easy to miss press with fat, drunken fingers
it's QWERTY, so pretty much the same
yeah, Leopard20 was taken! 😄
🙂
seems like some special char slipped in indeed. rewriting the code line and newlines worked
ty
Is there a faster way to locate all (baked) objects in the world with a known name than using nearestObjects in the centre of the map with a 20km radius - which takes forever? Are the named objects available as-is in a world array? I need to grab the array once only at map startup, I'm using it to script traffic lights across a map.
nearestterrainobjects
Tankbuster, is that faster? I'm not bothered about nearest at all, I just need all objects of a name in a nice handy array so I can forEach around them
tbh, in your application, you should gather the array before the mission starts
yes yes, indeed I am gathering at start once only, but it still locks up for 30 secs or so
really?
i do similar stuff.. i get all the big buildings for example and it takes 700 ms
you cant do that during the mission, but during setup, it's nothing
I am very happy for you 😄 It may be because I has custom map? And it locks up completely the world - animations, everything. Definitely the nearestObject doing this as if I comment it out, everything else works great. Once it has all the values, it's quick too, becuase I'm storing it in a persistent array. It would just be nice if there was an array table I could query by name rather than by distance to just grab the objects I need.
ah, a custom map... yeah, thatmight be tricky
So, definitely nothing I could use to just iterate the terrain objects and forget distance?
I'd try nearestterrainobjects in place of nearestobjects
Okay - I'll give it a whirl now and report back, thx 🙂
np
bear in mind the it uses its own slightly odd search hierachy
if the map has been made correctly, the traffic lights will probably be "hide" or "house"
also, turn it's search off, it will speed it up a lot if the array is big
yes, just reading the wiki now 😮 it's just strange there's no function to get to the world objects array directly, I don't need any 3D distance calcs doing at all, it's all a waste really
yeah if you're grabbing everything in the map during setup for array use later in the mission, dont need sort
and yes, it is strange as you say
glad it's not just me not finding the func 😄
nope 🙂
Okay so I've got this issue where this command https://community.bohemia.net/wiki/lockInventory will not work until someone has entered the vehicle at least once.
effectslocal
the effect of that command is local so is only locked where the vehicle is local to the client that ran the command
Yeah but the command is ran on the vehicle
Like it gets remoteExecCalled on the vehicle
it needs to be remoteexeccalled everywhere, all clients
i suspect you're locking it only on the server where it was created?
Well, I did _vehicle lockInventory true on the server first
But that didn't work, so I remoteExecCalled that on the vehicle through the server
But both didn't work
And the players can (un)lock the inventory through the keyhandler
the effects of that command are local, you need to run it on the players too
Ah right
why do you remote exec that on the vehicle?! The arguments are global
arguments are global, yes
as Tankbuster said, remoteExec for all players
effects are local
So I remoteExecCall on -2 right?
doesn't matter. use 0 (to account for non-dedi server)
yes, use zero, thx leo
yes
good catch
[0,-2] select isdedicated
will work nicely for both dedi and localhost
just one extra machine doesn't really matter you know! 😄
Yeah idk that's not working
[cursorObject,false] remoteExecCall ["life_fnc_lockInventory",0];
I do this right?
/*
File: fn_lockInventory.sqf
Author: Edward
Description:
(Un)locks the vehicle inventory.
*/
params [
["_vehicle",objNull,[objNull]],
["_state",true,[0,false]]
];
if (isNull _vehicle) exitWith {};
_vehicle lockInventory _state;
This is the function it calls
Oh it worked now
When I didn't use the debug menu
I did cursorObject lockInventory true; and executed it on global
I suppose the command is not JIP compatible as well then right?
there's a jip flag you can set to true
Ah right I see
[_veh,true] remoteExecCall ["life_fnc_lockInventory",0];
This doesn't work :(
Still the issue where someone has to enter the vehicle once
have you rerun the mission from the start of the editor, or recompiled the functions?
I allways have this fear when i copy something from the BI WIKI.
I had problems some times. Highlight can help because it don't reconize the "broken" function.
If you find a problem do report it in #community_wiki so it can be fixed 
@oblique arrow ok, i will. I can't remember now wich copy and paste caused the problem, but if i find it again i will report.
Thank you 
is it safe to assume profileName is okay to use as a filename? I don't know if the engine does anything special with character encoding to make ProfileName.Arma3Profile safe
That just stores the game configuration stuff. Why do you need it?
I'm saving savegames on the server, currently with
params ["_id", "_uid", "_name", "_jip", "_owner"];
private _accountID = _uid + "_" + _name;
//Send _accountID to a DLL to load a file with that name
just wanting to make sure that _name wont have any characters in it that will cause me problems
Always sanitize your input
Always
Not even if you think you can trust one side
But always
Depending on your language used for extension developmentment, you have numerous options to fix that
yeah, I have a big //TODO in there for exactly that - just doing some checking first and saw there's not a lot of info about profileNames
Not safe
Steam Name might be
I'm making a script that respawns players in a created Taru transport pod when someone in the squad throws a certain color smoke down. I have it mostly working, except when I try to move the respawned player into the pod, it grabs their old dead body. I've tried using BIS_fnc_updatePlayerArray to try to update the array to the respawned unit, but it doesn't work to my intentions. Any ideas?
...
_playerGroup = group _thrower;
_deadPlayers = [];
_smokePos = getPos _smokeNade;
_smokePos = [_smokePos select 0, _smokePos select 1, (_smokePos select 2) + 500];
_pod = createVehicle ["Land_Pod_Heli_Transport_04_covered_F", _smokePos, [], 0, "NONE"];
{if (!alive _x) then {_deadPlayers pushBack _x}} forEach (units _playerGroup);
{[0] remoteExec ["setPlayerRespawnTime", _x]} forEach _deadPlayers;
sleep 0.1;
{[_x, _pod] remoteExec ["moveInAny", _x]; [_x, false] remoteExec ["allowDamage", _x;} forEach _deadPlayers;
...
use an event handler instead
and don't use getPos
I've gone with an md5 hash of the profile name for now, so the filename will be (_uid + "_" + md5(_name) + ".ext")
how can I get the config entry of a weapon? I don't seem to find it in the Config Viewer. Class name is rhs_weap_M230 (gun of an Apache). Basically what I'm looking for is what parents it references
see https://community.bistudio.com/wiki/BIS_fnc_returnParents with configFile >> "CfgWeapons" >> "rhs_weap_m230" mayhaps
I am like that 😎
sometimes
once a year?
😭
Say i have a big data array, where each element has ["Land_someBuildingClass", < other data>].
To access a <other data> i use a known class and search for it in index 0 of the elements. Would hashmap be faster (using the classname as key) to access the data?
way faster yes
no more searching through the array hoping to find the element
I have this sqf radar animateSource ["radar_rotation", 5000, 1];
to animate a rotating radar ( Land_MobileRadar_01_radar_F (tower) ).Works...BUT, how do I stop it now? LOL
0, maybe?
not quite your question, but it will stop when it's derstroyed
LOLLL
nope..tried that..
animateSource "radar" 1, 1 then 1, 0
(or 0, 1, dunno)
wait, true as the last param
radar animateSource ["radar_rotation", 0, true]; works..thank you @winter rose
and please, don't use 5000, 1 will do
you could use it with animationPhase to stop it the way it is facing (if it doesnt always stop on 0/1)
but with 1,1 it will only do 1 rotation
then, with 5000 it will only do 5000 rotations
LOL..exactly!
that's weird, I would have thought they had implemented it as 0 = stopped and 1 = turning, not "number of rotations"
I need the radar to rotate until player deactivate it as a mission task
turn off its simulation?
Yeah..it's awkward at least...
the "infinite rotation" is the issue here
I got this resolved with "radar animateSource ["radar_rotation", 0, true];"
No kidding...maybe there's something with the phases of the animation that prevent to loop to form an infinite rotation..who knows.
since the looping animation will propably use time as source, you just need to stop the time 😛
I'm trying to add a variable to all units spywned by my function, but for some odd reason it does not seem to get set.
The spawning works fine and dandy, tested multiple times. The issue is setting the variable. The function is run via module placed on the map, I set isGlobal in the module config to 1. Testing it in singleplayer in editor. When I use getVariable it returns as <NULL>
private _soldier =_group createUnit [_x, _safePos, [], 0, "FORM"];
_soldier setVariable ["taro_srf_unit_faction", "TEST NAME", true];
https://community.bistudio.com/wiki/Model_Config#Animation_sources
see activeSensorsPhase and activeSensorsOn
if the radar is setup properly model and animation wise, you just need to deactivate the radar sensor and the animation should stop
if that's actually all of it, it should work because I don't see a problem.
another issue might be the module running in preInit (so maybe the unit's var space isn't even created yet)
no I think it doesnot, it even has delay set
there is more to the code, but that's how the spawning and variable setting is set up (for now)
// if any foot solders are definded create them as well
if (count _compSoldiers !=0) then {
{
_safePos = [_pos, 0, 30, 5, 0, 30, 0,[],[_pos,_pos]] call BIS_fnc_findSafePos;
private _soldier =_group createUnit [_x, _safePos, [], 0, "FORM"];
//if there is any code run it on the newly spawned vehicle
if !(_code isEqualTo "") then {_soldier call compile _code;};
_soldier setVariable ["taro_srf_unit_faction", "TEST NAME", true];
sleep 0.3;
} forEach _compSoldiers;
};```
I moved setVariable bellow compiling code, but no luck
I tried the spawning and setting variable via debug and it worked fine
And ASoldier getVariable "taro_srf_unit_faction" returns <NULL>?
Is <NULL> the string representation of nil / Nothing?
yes
if I set it via debug console it gets set fine
the call compile code works fine, tested via setdamage, so it's not like the newly created unit is somehow wrongly defined or something
is there actually a efficient method available to force a helicopter to land at a specific dir? I'm currently doing a workaround like this:
_heliPad = getPos(_aircraft getVariable ["KI_airSupport_heliPad", objNull]); // some coords from a helipad ;)
_originalHeading = (_aircraft getVariable ["KI_airSupport_heliHeading", objNull]); // 89.034
_aircraft land "LAND";
waitUntil {_aircraft distance _heliPad < 5};
_aircraftRight = true;
if (_originalHeading < 180) then {
_aircraftRight = false;
};
_aircraftAdjust = true;
while {_aircraftAdjust} do {
if (_aircraftRight) then {
_aircraft setDir ((getDir _aircraft) + 1.2);
} else {
_aircraft setDir ((getDir _aircraft) - 1.2);
};
sleep 0.01;
if ((round (getDir _aircraft)) == (round _originalHeading)) then {_aircraftAdjust = false};
};``` however that rotation is not seamless and looks scripted. ALso the helo drops literally to the floor once the while finishes.
_muhHelo land "land";
It will land on the nearest available helipad
ah sorry, you want the helo to rotate/yaw to match a direction
yes
landing is not the issue, the rotating part works as well with my code above but is not smooth and rather hacky
Try putting
systemChat (_soldier getVariable ["taro_srf_unit_faction", "Default Value"]);
```after the `sleep 0.3;`, let's have a look what that gives us.
try adding small sleep before setting the variable, or use execNextFrame if you have CBA, just to test
i think there was some issues with owner of a freshly created unit being different next frame, maybe something similar is happening here
I doubt it can happen in SP tho
I don't think so either
_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "FORM"];
_unit setVariable ["taro_srf_unit_faction", "TEST NAME", true];
This run in debug creates unit and sets the variable without any issues
Oh hey, this time it worked for some reason
¯_(ツ)_/¯
How did you use getVariable?
if (count _compSoldiers !=0) then {
no need for this
yes there is a need for this
anyway, I think I done really dum and was packing wrong folder
} forEach _compSoldiers;
when the array is empty, it doesn't do anything
lets just say there is more to that whole thing
yeah, I done dum and was packing the wrong PBO
if a bool parameter inside config is entered as
someparameter = 1 instead of someparameter=true
will "[ bla ] call BIS_fnc_GetCfgData " or "[bla] call BIS_fnc_returnConfigEntry" return the number instead? and how do i check type correctness properly the easiest way then?
Feel free to disclose
We are a community here, sharing wisdom leads to fixing Bugs too 🤫
Iirc, it Returns the number
But you May better be off to just testing it quickly
hm it might actually always just be a number - looking at configviewer, i dont see a true or false anywhere
true/false do not exist in config; they are #defined with macros for ease of use/readability, but 0 is false and anything else is true
https://community.bistudio.com/wiki/Category:Command_Group:_Config there is no getBoolean here 😉
phew ok, that makes it easier
alright I have no fucking idea why this isn't working anymore
just gonna post it in here now
I'm modifying a limited arsenal script to pull its data from the server always, bc otherwise shit breaks in fascinating and infuriating ways in multiplayer. Anyone have any idea on this error message? Sample little bit of script has this:
case "CreateListAll":{
params["_display"];
private _object = uiNamespace getVariable "jn_object";
["tt_jna_datalist", owner player, "MISSION"] remoteExec ["sg_fnc_getdata_server", 2];
private _datalist = missionNamespace getVariable "tt_jna_datalist";
missionNamespace setVariable ["tt_jna_datalist", []];
{
private _inventory_box = _x;
private _index = _foreachindex;
if(_index in [IDCS_LEFT])then{
_ctrlList = _display displayctrl (IDC_RSCDISPLAYARSENAL_LIST + _index);
lbclear _ctrlList;
//create list with avalable items
["CreateList",[_display,_index,_inventory_box]] call jn_fnc_arsenal;
};
} forEach _datalist;```
sg_fnc_getdata_server looks like this:```sqf
if (!isServer) exitWith {};
private _variable = _this select 0;
private _client_ID = _this select 1;
private _namespace = _this select 2;
[(profileNamespace getVariable _variable), _namespace, _variable] remoteExec ["sg_fnc_getdata_client", _client_ID];```
sg_fnc_getdata_client looks like this:```sqf
private _data = _this select 0;
private _namespace = _this select 1;
private _variable_name = _this select 2;
if (_namespace == "UI") then {
uiNamespace setVariable [_variable_name, _data];
};
if (_namespace == "MISSION") then {
missionNamespace setVariable [_variable_name, _data];
};
if (_namespace == "PROFILE") then {
profileNamespace setVariable [_variable_name, _data];
};```
(the function naming here isnt the best)
owner player owner only works on server, so this needs to be clientOwner
you need to wait for the variable to be defined before setting it to _datalist
remoteexec isnt instant, it doesnt wait for the remote execution to finish, just for the message to send (/be added to the queue to send?)
oh you're right! cuz it's running async
does CBA have any functions for making passing data from client/server easier?
I feel like this is something CBA would have for sure
idk, never used cba. does the variable ever change on the server?
what do you mean?
does the data you get from sg_fnc_getdata_server change during a game.
potentially, yes
is it a big array?
yes
is this not the best way of doing it?
it's the contents of an arsenal so theoretically could be very very large
i just wonder if this would be better off as a public variable. sure it makes sense to limit sending the data to only those who need it, when they need it, but after a certain point this would surely use the network more than publicvariable.
especially because it requests the data every time the list is created
I'm not opposed to using publicVariable, I just didn't see a way to make it a read only variable for clients
the only way to make an array read only is to string it but thats ugly. is a client overwriting it a concern? if global updates only come from the server when it changes then it shouldnt be an issue?
I was just thinking about malicious scripts on the client but this is a co-op mission so who really cares if the person playing wants to ruin their fun fair enough i guess
I will probably just rewrite this to use publicVariable, though I do wonder about the network performance of that
because honestly, I don't really want to write a complex data synchronization algorithm I graduated already lmao
how many players can the mission have?
ehh, i'd say a few big public variables wont be a huge deal.
I'm less worried about it being a bandwidth problem for the server cuz it has gigabit and more with individual clients having fps problems because they have slow network
is setting publicVariable async on the client? Does it block?
itl take that little bit longer to load in and to receive the variable again if it updates, but the data size wouldnt be big by any stretch.
little bit longer to load
as in a second or so maybe, depending on the size.
I assume it doesn't do partial updates?
not unless you deliver the array in parts i dont think.
ugh jesus that sounds awful
you can always update the first function to wait for the variable to be delivered and stick with the setup you have, but i think a bit of sub-optimal code isnt the end of the world in this case.
most likely not, just gonna see if publicvariable works well enough and if it doesn't just rework my existing code
We have events system which is usually great for that use cases.
is this like pub/sub basically?
You register event handlers and send the events... so kinda
Not very much different from bis scripted events but more robust.
when you put a function name in an array or variable, it puts only an index to that function, and not all the function text, correct?
uhmm... depends what you mean. [BIS_fnc_inString] would be [{/* code of BIS_fnc_inString */}]
(as an example ^)
if I have a function like: func_A = { blah blah blah }; B = func_A;
B = index to func_A, right, and not {blah blah blah};
b would be the code of func_A, not a reference to func_A
can I get the index to a function?
so I don't have to use a bit switch statement?
or let me put the original question a different way
b = "func_A"; and then use getvariable if you need the code later
is the text in func_A actually coppied, or just referenced?
{
[
_x
] call mts_markers_fnc_deleteMarker;
} foreach
[
prefix_1,
prefix_2,
prefix_3,
prefix_4,
prefix_5];
Is there a shorter way to do that where prefix_1-5 are variables with a string as there content?
if it is always those 5 then that is probably the best way. you could do the same thing with a for loop to look a bit neater, but it does more work to achieve the same thing
for "_i" from 1 to 5 do {
[missionNamespace getVariable ["prefix_" + str _i,""]] call mts_markers_fnc_deleteMarker;
};
Thanks, I'll go for what you did since there's actually 16 of them but didn't want to type them all out.
RESOLVED can anybody spot why the radio trigger statement is not working in this example? radio_triggers = []; for "_i" from 0 to 7 step 1 do { _new_trigger = createTrigger [ "EmptyDetector", [0,0]]; _name = ["ALPHA","BRAVO","CHARLIE","DELTA","ECHO","FOXTROT","GOLF","HOTEL"] select _i; _new_trigger setTriggerActivation [ _name, "PRESENT", true ]; _statement = str(_i+1) + " call func_process_command"; _new_trigger setTriggerStatements ["this",_statement,""]; radio_triggers = radio_triggers + [_new_trigger]; };
My bad. It was actually a logical error. _i+1 should have just been _i
you could optimize that a little bit if you want ^
has some minor unnecessary things going on.
for "_i" from 1 to 4 do {
//spawn plane
_bluforPlaneN = createVehicle [...]
}```
is it possible to have a self modifying N here?
technically yes i think so but it isnt clean to do with local variables
you'd be better off inserting the vehicles into an array if they are only used in that one script
this is the logic behind it for local variables but its very 🤢 🤮
_vars = [];
for "_i" from 1 to 4 do {_vars pushBack ("_bluforPlane" + str _i)};
private _vars;
for "_i" from 1 to 4 do {
_i call compile format["_bluforPlane%1 = _this",_i];
};
_bluforPlane2 // 2 (or in your case the object from createVehicle)
Does isPlayer return whether a unit is controlled by a player, or whether it is playable?
if the unit is controlled by a player
Is it possible to change difficulty parameters for individual players?
For example could an individual player have mapContentFriendly set to 1, while everyone else has it set to 0, so that they can see friendly positions on the map but everyone else cant?
i dont believe so because difficulty settings in mp are defined by the server. you could script your own replacement for it though, then allow for toggling that.
shame, I imagine having the game do it would be the most efficient way
Can setVariable be set to a weapon like a mortar "B_T_Mortar_01_F", if so how? Would like to be able to set triggers that would enable and disable the ability for players to use them. The triggers would simply change the setVariable status between true and false.
If you want the mortar to be unusable then you can just do something like this.
while {variable} do
{
{
_x moveout;
}foreach [crew mortar_1];
};
@craggy lagoon
That'll do it for one specific mortar
That actually is not correct. Everything in sqf is passed by reference
Variables hold references only
And Arrays are the only datatype pretty much that can be modified, thus appearing to be the only references with everything else copied
while {variable} do
{
if (typeOf vehicle player == "B_T_Mortar_01_F") then
{
{
_x moveout;
}foreach [crew vehicle player];
};
};
And that'll do it for all mortars of classname "B_T_Mortar_01_F"
Thank you. Where do I put this code? Sorry I'm just starting to learn this stuff and it's not going well. HAHA
If you want it could go in the init.sqf or if you want it in a trigger make the condition variable and the stuff after do the activation
Make sure the trigger is repeatable though
@cerulean cloak Thanks, I'll give it a shot.
@cerulean cloak @craggy lagoon why do you use a loop?
use an event handler instead:
example:
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
moveOut _unit;
}];
Because I'm not familiar with event handlers
you should be
otherwise you're going to make really slow missions/mods with those loops
How big of a performance hit is one loop really?
depends. but the main problem is that a loop stays in the scheduler queue. an event handler only executes when that event happens
plus it happens EXACTLY when that event happens
loops in the scheduler have delay
@little raptor Thank you, I will look into that as well.
Pick leopards thing over mine and it looks like it should go in the vehicle init
event handlers are easy to use. just add them once to any valid type (e.g. addEventHandler should be added to objects) and you're good to go
the code executes when that event triggers
Next time I'm going to use a loop I'll think twice and look for an appropriate EH
also, I'd recommend that you always consider the event handler approach whenever you can



fixed that and it works
