#arma3_scripting
1 messages Β· Page 657 of 1
then idk
Okay
Are the sound files also on the dedicated server? Only other thing I would think could be Radio1 being undefined.
Is it possible to override a default action? Specifically "Get in <vehicle>" for a specific vehicle
Can I at least remove a default action and then create it under the same name?
radio1 exists - itβs an object placed.
The sounds are on the dedi, my testing hint returns them
Have you just executed a playSound3D on the (dedicated) server with the debug console?
Hi, I try to make the "B_Helipilot_F" spawn in as my subordinate when I spawn in the "B_Heli_Attack_01_F".
Anyone know where I go wrong?
I get an [Agent 0xf40820c0,<NULL-object>] error.
_veh = "B_Heli_Attack_01_F"createVehicle(player modelToWorld [8,0,0]);
[_veh, ["B_Helipilot_F", "driver"], true, true, true] call BIS_fnc_initVehicleCrew
for Get In actions specifically, you could lock the vehicle and then add new actions using the appropriate moveInCargo/etc commands
Thanks
You're trying to add the new "B_Helipilot_F" to your group and that's where the error is?
Yes, I try do add the "B_Helipilot_F" to my group which I am leading.
Then do:
[_veh, ["B_Helipilot_F", "driver"], true, true, false] call BIS_fnc_initVehicleCrew
Agents don't have groups.
Hmm. ok, didn't know. So then what I do each time is creating a new group leader?
Whit the mentioned code I get error: [B Alpha 3-2:1,<NULL-object>]
private _crew = [_veh, ["B_Helipilot_F", "driver"], true, true, false] call BIS_fnc_initVehicleCrew;
[_crew select 0] joinSilent (group player);
Wow! Incredible. Thank you very much π
Why does
systemChat format ["is bomb near: %1, %2",!isNull _dogNearestBomb,!isNil _dogNearestBomb];
ouput bool instead of true/false?
because your variable is probably nil
I guess you're not using isNil correctly
!wiki isNil
mh
well this is where the nearest bobm is calc:
_mines = [ nearestObject [ player, "MineBase" ], nearestObject [ player, "TimeBombCore" ] ];
_dogNearestBomb = [ +_mines, [], { _x distanceSqr player }, "ASCEND", { !isNull _x } ] call BIS_fnc_sortBy select 0;
glad to see you werent laughing at me D:
yeah bad timing π
wh... wh.. what is that code
ah, two objects
just realised isNil is not what I need, I did that because isNull wasnt working how I wanted
well if neither object was found they'll be null.
You told BIS_fnc_sortBy to remove all null elements. Thus you have empty array.
You grab first entry in empty array. That value is nil.
_dogNearestBomb is nil.
you need to check it using isNil I'd say
well that's what I get for copy and pasting code
which you attempted to do, but you didn't pay attention to the isNil syntax
ohhh string, WHY STRING?
Why does _removeAllWeapons remove everything in a units inventory? Binoculars, First Aid Kit, and so on? Isn't it supposed to remove weapons only? π¦
Because you cannot pass undefined variables to script commands
The command will be skipped and return nil
Items are also weapons
Just like how ammo boxes are vehicles
ohh, also for some reason
if (isNill "_dogNearestBomb") then {_boolVal = false};
fails. It shouldnt right?
you mean besides the typo?
oh ffs D:
will it work if I remove removeAllWeapons _unit; from this line of scriptcode;```sqf
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
if (random 100 < _weaponProbability) then {
removeAllWeapons _unit;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC(randomizeWeapon);
};
} foreach WEAPON_CATEGORIES;
};
};
and just add ```sqf
_this removeWeaponGlobal primaryWeapon _this; [_this] call CFP_main_fnc_randomizeUnit;
to the units init eventhandler in cfgvehicles? So it only removes the primary weapon and not touch anything else?
trying to make the particle effect disappear like 3 meters from where it starts but no matter what I try it goes on for a long time
_ref = "#particlesource" createVehicleLocal (getpos bPos_01);
_ref setParticleCircle [1, [0, 0, 0]];
_ref setParticleRandom [8, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ref setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 3, [0, 0, 0], [0, 0, -40], 0, 5, 5, 0, [5,5,7], [[0,0.1,1, 1], [0.01,0.02,1, 1], [0.01,0.02,1,0]],[0.02], 1, 0, "", "", bPos_01];
_ref setDropInterval 0.065;
(just to be clear, you can only change its lifetime and velocity, not distance directly)
that's what I mean the time it's alive would effect the distance it travels no? in the params I change the numbers but nothing happens
https://community.bistudio.com/wiki/Particles_Tutorial here is a tutorial resource
velocity works but lifetime doesn't change
lifetime is the "3" in "Billboard", 1, 3
I changed it to 0.1 and it still lives for a long time, is the 0.1 seconds or frames or something else?
oop
thank you lol
happens π
Hi! Is possible to not allow take item from vehicle inventory to player's?
I try'd Take event handler, but is didn't work for me, maybe is possible to make it somehow else?
iirc you can disable vehicle's inventory, see the wiki
i need vehicle inventory in my mission,
just - not allow player to take backpack\uniform\vest from vehicle - if vehicle inventory is full
then yep, EH
this one
this addEventHandler ["Take", {
params ["_unit", "_container", "_item"];
}];
or something else?
I suppose so yes
kk, ty
So, does anyone have an idea?
For #2 use say3D if you want the sound to continue following the object's position.
Don't see how you could possibly be causing #1 with that action.
Can somebody please tell how I can make this line of script not remove any other inventory items but weapons? ```sqf
if (random 100 < _weaponProbability) then {
removeAllWeapons _unit;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC(randomizeWeapon);
};
} foreach WEAPON_CATEGORIES;
};
};
so remove and replace:```sqf
removeAllWeapons _unit;
So there is possibility to only remove primary weapon and make the script do what it is supposed to do? (Random Rifle)
//Bridge 1 destroyed
objective_1 = true;
target_1 addEventHandler ["killed", {
objective_1 = false;
sleep 60;
deleteMarker "marker_34";
}];
i want to delete marker_34 if target_1 (bridge) destroyed
how to use eventhander with sleep? Marker deletes correctly, but instantly, without sleep
target_1 addEventHandler ["killed", {
objective_1 = false;
null = [] spawn {
sleep 60;
deleteMarker "marker_34";
};
}];
after deleteMarker "marker_34"; does null = [] spawn automatically unloads from memory/cpu?
Yes. No
Help ...
Before the update, this returned the muzzle (or silencer) class name... Now it's empty...
((getArray (configFile >> "CfgWeapons" >> currentweapon player >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "CompatibleItems")) select 0)```
null = that null is nonsense
Habit
And it will make the handle of the spawn stay in memory
so
automatically unloads from memory/cpu? no, the spawned handle is stored in the null variable.
By the way, the only place that "trick" was required was in editor scripts. And that will be fixed in 2.04 (already is fixed on #perf_prof_branch)
Now, nor the gear randomises, nor the weapons. The units just spawn in with their standard weapon. Am I on the right direction? Thank you very much.```sqf
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
if (random 100 < _weaponProbability) then {
removeWeapons _unit;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC(randomizeWeapon);
};
} foreach WEAPON_CATEGORIES;
};
};
from you dear friend.
no definitely not
Read again
removeWeapon
primaryWeapon player
What you did:
removeWeapons _unit
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 Here, bookmark this page. Its a list of all script commands
including removeWeapon
https://community.bistudio.com/wiki/removeWeapon
and primaryWeapon
https://community.bistudio.com/wiki/primaryWeapon
But I need to attach those two commands, that's what I have problem with.
target_1 addEventHandler ["killed", {
objective_1 = false;
null = [] spawn {
sleep 60;
deleteMarker "marker_34";
terminate null;
};
}];```
?
try around there aren't many possibilities
removeWeapon primaryWeapon player _unit;
remove the null =
its nonsense
and the terminate too, also nonsense, and terminate also wouldn't clean up that variable
before trying around, is this the correct way to write it? or do I need to add a "," between the two functions?
Idk why people are using globals for this. I've always used _ = [] spawn {}; in editor init boxes or _0 as _ looks weird :D
objective_1 = true;
target_1 addEventHandler ["killed", {
objective_1 = false;
[] spawn {
sleep 60;
deleteMarker "marker_34";
};];
``` that's all? Sorry for re-quoting
they are commands, not functions.
Check wiki.
primaryWeapon takes a Object, and returns a String.
removeWeapon takes a Object on the left, and a string on the right.
player returns an Object, the current player unit.
But you already have a unit in _unit
Hi, is possible somehow check if vehicle canAdd backpack with items?
not really, don't think so. Atleast not besides adding them all and seeing if it worked
I see dear Dedmen. But since you are alot and I mean ALOT more educated in this and my english and knowledge is kinda broke, what my question basicly is if I could write it like that. I have checked the Wiki but it is kinda not beginner friendly. Even though I am taking a Python course.
understood, ty
think of them as puzzle pieces that need to be put together.
your _unit is a Object puzzle piece.
removeWeapon takes a Object on the left, and a String on the right.
The object you already have, so half is done.
For the string on the right, you need to get the name of the primary weapon
There is the primaryWeapon puzzle piece which takes an object on the right, and returns a String.
Again the object you already have, so just stick them together
removeWeapon "BAF_L85A2_RIS_SUSAT"; primaryWeapon _unit;
Isn't this better? ```sqf
player removePrimaryWeaponItem
no its something completely different
removeWeapon "BAF_L85A2_RIS_SUSAT";
you are missing the left puzzle piece.
Cheers gonna dig in and come with it soon.
And you are not even using the weapon name that you got from primaryWeapon
Yes I know. Just wanted to get the "template" right.
player removeWeapon "CUP_arifle_G3A3_modern_ris_black"; primaryWeapon _unit;
Still can't manage to why we do need: ```sqf
primaryWeapon
if you hard-code the weapon class, you don't
you need to give it the name of the weapon you want to remove
you don't know what weapon the unit has, or do you?
all units that your script runs on will always have that exact weapon?
then you can hardcode it yes.
Yes. They have that in the beginning. Before randomisation.
If you're talking about rifles.
Then you can hardcode the name, but you need to remember to always adjust it in case the starting rifle changes someday, or you want to reuse the script in a different mission
Cheers!
Jesus christ I am so stupid. I just realised this is an universal script and it runs on the other factions aswell.
Which is what I assumed π
so I need to include EVERY weapon of all factions? To make it work? That's like 50+.
no
Yes. If you want to hardcode
_unit removeWeapon primaryWeapon _unit
but you could also just use primaryWeapon like I told you to
maybe this is clearer:```sqf
private _weaponClass = primaryWeapon _unit;
_unit removeWeapon _weaponClass;
so, the conclusion; ```sqf
// Check to see if we randomize Weapon
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
if (random 100 < _weaponProbability) then {
private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC(randomizeWeapon);
};
} foreach WEAPON_CATEGORIES;
};
};
now you have one of 3 weapons
now repeat the same for the other 2 slots (secondary, launcher)
I only want to randomise rifles.
So also, If applied to an AT-men, his inventory RPG will remain even though his Rifle gets randomised?
But WEAPON_CATEGORIES is Rifle, Handgun, Launcher, Grenade, Explosive
And you are going through all the categories } forEach WEAPON_CATEGORIES;
only his rifle will be removed, and then replaced by some random one according to your randomizeWeapon function
So I MUST add the secondary, launcher, grenade.
even though I don't use randomisation of them?
To my understanding it will break the code if I do not do it yes?
Looks to me like you DO use randomization on them
You do } foreach WEAPON_CATEGORIES;
you randomize for each weapon category
This will maybe clarify; ```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};
vestList[] = {"V_TacVest_khk",0.3,"CFP_Tactical1_ACRDesert",0.2,"CFP_Tactical1_3ColorDesert",0.15,"SP_Tactical1_Tan",0.15};
facewearList[] = {"CUP_Beard_Black",0.25,"CUP_FR_NeckScarf2",0.35,"CUP_FR_NeckScarf5",0.35,"CUP_G_White_Scarf_Shades",0.2,"CFP_Scarfbeardshades_tan",0.2,"CFP_Scarfbeardshades_green",0.2,"USP_ADVANCER_GU_SF2",0.15,"TRYK_SBeard_TK6",0.25,"TRYK_SBeard_BW6",0.3,"TRYK_SBeard_BW",0.25,"TRYK_SBeard_BW",0.3,"CFP_Scarfeard_white",0.25,"CFP_Scarfeard_white",0.25,"CFP_Neck_Plain2",0.25,"CFP_Neck_Plain3",0.25,"CFP_Neck_Plain4",0.25,"CFP_Neck_Plain1",0.25,"CUP_G_Scarf_Face_Tan",0.2,"CUP_G_Scarf_Face_Red",0.2,"CUP_G_Scarf_Face_White",0.2,"CUP_G_TK_RoundGlasses_gold",0.15,"CUP_G_TK_RoundGlasses_blk",0.15,"CUP_G_TK_RoundGlasses",0.05,"SP_Kneepads_Tan2",0.25};
uniformList[] = {"iri_u_desert_camo_1_uniform",0.6,"iri_u_desert_camo_2_uniform",0.4};
randomWeaponProbability = 100;
rifleList[] = {
{"arifle_Katiba_GL_ARCO_pointer_F", {"30Rnd_65x39_caseless_green", 8} }, 0.35,{"arifle_Mk20_GL_F", {"30Rnd_556x45_Stanag", 8} }, 0.40,
{"arifle_MXC_F", {"30Rnd_65x39_caseless_mag", 8} }, 0.35
};
see, I do not have an ```sqf
grenadeList[] =
for example.
Ah so the count check will make it skip then
But then no sense in doing it forEach WEAPON_CATEGORIES if all but "Rifle" are being ignored anyway
You gotta ask the CFP devs of that (Community Faction Projects). I took it from github and clean the code+faction to meet modern standards, for private use.
They did not use the Weapon Randomisation in this faction. So I manually added it.
I may now have taken to much of your valuable developer time, because I know y'alls time is very valuable for you lol, my old man was a coder/progammer too. To round it up, I can just leave as it is? I can do the launcher, etc part later as I do not need it now.
yeah
Thank you very much for your help, gonna try it out now. Edit; It works like a charm. Thank you Dedmen and Lou Montana!
Hi, is possible to somehow prevent take item from container?
(i mean with take event handler)
Hello can someone help? I have made a custom vehicle, sort of, here is the code for the camera
DropShipCamera = "Land_HandyCam_F" createVehicleLocal [0,0,0];
DropShipCameraVectorUp = [0,0.25,1];
DropShipCamera hideObject true;
DropShipCamera attachTo [dropship_base, [0,-40,10]];
DropShipCamera setVectorUp DropShipCameraVectorUp;
switchCamera DropShipCamera;
switchCamera player;
I'm trying to make it so when the player enters said vehicle their camera will switch to this and then when they leave it will switch back to their player view but I have no idea where to start
Any thoughts ?
have you checked what getArray (configFile >> "CfgWeapons" >> currentweapon player >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "CompatibleItems") returns?
Have you looked in config viewer?
checked whats in config viewer?
maybe that config entry changed
Actually
yes it changed
Look at config viewer.
They are entries in a class, not an array
what weapon is it?
check configProperties (with inheritance on) of configFile >> "CfgWeapons" >> currentweapon player >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "CompatibleItems" and you'll see
But that's the kind of change that would break a lot of things ...
Where can I ask questions?
No it wouldn't
#arma3_questions π
Thanks
This has been a thing since atleast 2017/2018
Its nothing new
i try to prevent take item with that code```sqf
player addEventHandler ["Take",{
params ["_unit", "_container", "_item"];
_type = (_item call BIS_fnc_itemType) select 1;
if (_type in ["Backpack","Uniform","Vest"]) then {
if (_item in [backpack player,uniform player,vest player]) exitWith {
true
};
};
}];
but nothing is changed, i still can take this item
Could you help me with that, please?
All
You mean any?
Why did you think it would?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take
It doesn't have a return value, it doesn't let you block
player addEventHandler ["GetIn", {
params ["_vehicle", "driver", "player", "_turret"];
}];
is it possible to make the role any of the vehicle seats?
did you copy that from wiki? driver and player are missing the underscore?
I don't understand the question
like moveInAny but for the role
understood, thank you!
Gonna try to find another way to do that π¦
Does locking the inventory not work for you?
Disable all take/put and even opening the container?
it says the role can be driver gunner or cargo but I want it to be all of them
I still don't understand.
Just ignore the _role variable then?
Are you missunderstanding how params works?
you cannot seat on all seats at once
Are you adding the eventhandler to a specific vehicle? Yes right?
is works, but i need to have access to inventory of that container, need to block - only if that item type is equal to player's uniform/backpack/vest
Then you can probably just ignore all the parameters
Execute the script you want to execute when entering the vehicle on "GetIn" and execute the script when getting out on "GetOut"
and ignore the params line
okay thank you
One major issue I have noticed is that it does not add mags to the inventory, only randomises chosen weapon but adds no mags at all. #arma3_scripting message Ofcourse this isn't Leo's fault. Just a misunderstanding π ```sqf
rifleList[] = {
{"CUP_arifle_G3A3_modern_ris_black", {"CUP_20Rnd_762x51_G3", 8} }, 0.25, {"CUP_arifle_G3A3_ris_black", {"CUP_20Rnd_762x51_G3", 8} }, 0.3,
{"CUP_arifle_AKM_Early", {"CUP_30Rnd_762x39_AK47_bakelite_M", 8} }, 0.15,
{"CUP_arifle_AK47_Early", {"CUP_30Rnd_762x39_AK47_M", 8} }, 0.15,{"CUP_arifle_AKMS_Early", {"CUP_30Rnd_762x39_AK47_bakelite_M", 8} }, 0.15
};
because the unit doesn't have enough room for 8 mags
@still forum
player addEventHandler ["GetIn", {null = [] execVM "DS_fnc_inShip"}];
player addEventHandler ["GetOut", {null = [] execVM "DS_fnc_outShip"}];
this is what I got, I am a little confused still
null = that's nonsense, remove that.
player addEventHandler
I specifically asked you:
^ that and you said yes
but your code doesn't add to a vehicle
if you want it on a specific vehicle, you have to add it to the vehicle
not to player
if you want to add it to player's vehicle, it's vehicle player of course
[] spawn someFunction;
[] call somethingElse;
``` is same? I mean `[]` not needed - if u don't need to send parameters to script?
@little raptor understand, ty
dropship_base addEventHandler ["GetIn", {[] call "DS_fnc_inShip"}];
dropship_base addEventHandler ["GetOut", {[] call "DS_fnc_outShip"}];
vehicle player work for specific vehicle?
@toxic dirge DS_fnc_inShip is function? or filename
remove " "
from "DS_fnc_inShip"
DS_fnc_inShip = {switchCamera DropShipCamera;};
DS_fnc_outShip = {switchCamera player;};
dropship_base addEventHandler ["GetIn", {[] call DS_fnc_inShip}];
dropship_base addEventHandler ["GetOut", {[] call DS_fnc_outShip}];
it still didn't wrk.. hmm
dropship_base is defined?
dropship_base = _this;
_this setVehicleVarName "dropship_base";
I don't understand how this can help me :
configProperties [configFile >> "CfgWeapons" >> currentweapon player >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "CompatibleItems", "true", true];
returns
[bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_h,bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_h_khk_F,bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_h_snd_F,bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_H_SW,bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_65_TI_blk_F,bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_65_TI_hex_F,bin\config.bin/MuzzleSlot_65/compatibleItems/muzzle_snds_65_TI_ghex_F]```
and why was the getArray working before the update π¦
it still does
where does _this come from
private _item475 = objNull;
if (true) then {
_item475 = createVehicle ["OPTRE_Pelican_armed",[2298,5713,0.0530672],[],0,"CAN_COLLIDE"];
_this = _item475;
_crewVehicle = _this;
_objectIDs pushback 475;
_this setPosWorld [2298,5713,9.20281];
_this setVectorDirAndUp [[-8.74228e-008,-1,0],[0,0,1]];
[_this,15] call ace_cargo_fnc_setSpace;;
dropship_base = _this;
_this setVehicleVarName "dropship_base";
_this setPylonLoadout [1,"OPAEX_M_ANVIL1_16Rnd"];
_this setPylonLoadout [2,"OPAEX_M_ANVIL1_16Rnd"];
_this setPylonLoadout [3,"OPAEX_M_Mk127_1Rnd"];
_this allowdamage false;;
[_this,"[[[[],[]],[[],[]],[[],[]],[[],[]]],false]"] call bis_fnc_initAmmoBox;;
_this setVehicleReportRemoteTargets true;
_this setVehicleReceiveRemoteTargets true;
_this setVehicleReportOwnPosition true;
};
You get all compatible items
muzzle_snds_h
muzzle_snds_h_khk_F
muzzle_snds_h_snd_F ....
Since atleast 2018, CompatibleItems can be either array, or a class with entries set to =1.
That's nothing new.
The class way makes it easy to add inter-mod compatibility though, and is what CBA changes every vanilla weapon to to make it mod compatible.
Now vanilla items are by default mod compatible.
How about this? https://community.bistudio.com/wiki/BIS_fnc_compatibleItems
https://dev.arma3.com/post/spotrep-00096
Tweaked: Changed slots configuration on all weapons from the array-based old method to the class-based one (this should also fix any issues with muzzle accessories)
I see, so the change was done in 2.02 for compatibility reasons. Makes sense
Should have read that first. Very useful. Thanks.
Question, in order to execute a script from a trigger. whats the difference between remotexec, execvm, etc
to run a script (once) from a file, use execVM
if you intend to use it multiple times, declare it as a function in CfgFunctions and use call or spawn
Alright π
That's another thing, next to file creation, that should be part of the Introduction to Arma Scripting if you ask me.
true
I'm trying to achieve blocking player's ability to open the inventory when they are inside a trigger zone. Would anyone has a recommended approach for this problem ?
inventory opened EH should do yes π
would you mind elaborate ? I never tried having something triggered only when inside a zone before.....
I would not recommend a trigger-based detection, but here it is:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened
and of course, the EH would have to be removed/re-added every time the person enters/leaves the trigger
Different option would be to add the EH once and check whether the player is in the trigger area every time the EH fires.
and how would I trigger it so that the player can not opened ? since from the documentation I can see it can be used to overide the content of the inventory :/
Apparently, closeDialog can be used to close the inventory, but I've never tried that.
why? a simple check player inArea blabla is faster
well I am trying to block the ability to open the inventory form the first place
I believe that is not possible.
yeah that can't be done
if it's an object/vehicle you can lock its inventory
wat?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened
why not return true to prevent opening?
player addEventHandler ["InventoryOpened", {
player inArea myTrigger; // <-- inventory override
}];
that's what I meant π
@tough abyss β?
but the inventory does open and close
oh yeah indeed. I am trying to make it "not opened" in the first place
so not
block the ability to open the inventory form the first place
if that makes any sense
I thought that it simply did not open the interface at all 
the player plays the opening anim
but the inventory won't appear
@tough abyss won't this just do ?
aaah, well yeah
then overriding the inventory key would be the way to go
Hello all, im wondering would anyone be willing to help me with a script modification that spans through a couple of files?
well I do have the an EH Inventory closed
I assume
using this
would also trigger Inventory closed EH ?
Idk
it never opens in the first place
so it shouldn't
let me give it a try then π ty so much for your help
If you need help with it, then this is the place, if you need somebody to do it for you, #creators_recruiting is the place to ask.
Splendid ! Ty so much :d
it would be great if someone could do it for me or spoonfeed me the steps, but at the same time i would want to learn how to do it for the future π
looking for EH that could be triggered once an unit has been stopped moving (f.e. has reached some way point). Does a3 has something similar ?
@warm blaze its not an event but if you have loop running checking unitready. you can create a custom event also. https://community.bistudio.com/wiki/unitReady
@still forum I got it working thanks for the help
I suck at math, anyone willing to tell me how to use boundingboxreal and inarea to detect if ai is in object like a building?
nvm i figured it out
@winter rose is the 1 in "Billboard", 1, 0.5, in minutes?
_ref setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 0.5, [0, 0, 0], [0, 0, -17], 0, 5, 5, 0, [4,4,4], [[0,0.1,1, 1], [0.01,0.02,1, 1], [0.01,0.02,1,0]],[0.02], 1, 0, "", "", bPos_04];
seconds probably
Yep, i worked it out. starting from scratch
Would it be possible to have a HashMap with HashMaps? π€
// simplified, doesn't work
_myMap = [ // external map
[
"player1_uid",
[ // internal map
["key1", "value"],
["key2", "value"],
["key3", "value"]
]
],
[
"player2_uid",
[
["key1", "value"],
["key2", "value"],
["key3", "value"]
]
]
];
And would it be possible to link get/set with that?
// get data
_myValue = (_myHashMap get "player1_uid") get "key1";
// set data
_myHashMap set ["player1_uid", (_myHashMap get "player1_uid") set ["key2", "new_value"]];
those are KEY types, not values π
oh I read it wrong
yeah you can
or at least you should be able to
I didn't test it
so ... values, why should it not work to have a hashmap as value?
regarding the "how"
_map get "property" set ["target", value]
you first get the actual map you want to change and set then
as alternative: start using SQC π map.property = value (requires SQF-VM and/or the vscode extension)
@exotic flax but this part doesn't make much sense:
_myHashMap set ["player1_uid", (_myHashMap get "player1_uid") set ["key2", "new_value"]];
(_myHashMap get "player1_uid") set ["key2", "new_value"]
set only returns true false (not sure if that was actually your intention)
Yeah, was reading the set wiki and noticed the same. Meaning it will need to get the (1st) hashmap, update it and than set it back. Unless some magic happens which updates it by reference π€
And I need a method to ensure the value of the 1st hashmap is an actual hashmap.
hashmaps obey the same rules as everything in SQF
all is passed by reference
set modifies the reference of the hashmap
aka: just like you would not have to set the array again, using set, you do not need to with hashmaps either π
guess I need to test it properly (and return the results to the wiki)
test what?
if the outer hashmap will have the updated inner hashmap, without re-setting it
of course it will
it is modified by reference
as @queen cargo said
just like arrays
but what you wrote was wrong and will change the value
but this works:
(_myHashMap get "player1_uid") set ["key2", "new_value"]
I knew my examples wouldn't work out of the box
no need for the () btw π€«
meh, both are binary so it's for safety π
I prefer to be on the safe side there, already spent too many hours debugging π€£
@queen cargo what about _array select _index+1 π¬
the sum executes first
my new (not tested) functions:
params ["_uid", "_key", "_value"];
(GVAR(Stat_HashMap) getOrDefault [_uid, createHashMap]) set [_key, _value];
params ["_uid", "_key"];
private _return = (GVAR(Stat_HashMap) getOrDefault [_uid, createHashMap]) get _key;
_return
I know already
but I was just saying that it's a good idea to keep the parentheses for chained binary commands
the particle effects and camera work on my vehicle but not everyone can see them, I'm not really used to remote exec can someone help, heres what I got
[_pos] spawn
{
_pos = _this select 0;
playsound "hint";
remoteExec[DS_fnc_Camera,0];
remoteExec[DS_fnc_Effects,0];
onMapSingleClick{};
};
?
remoteExec[DS_fnc_Camera, 0]; // functionName is variable
// vs
remoteExec["DS_fnc_Camera", 0]; // functionName is String
I tried with quotation, I locally execute with debug in game and remote exec doesn't add for everyone
the code is executed on all clients and server, so the issue is probably in the functions you try to execute
what happens when you run:
"hello" remoteExec ["hint", 0];
``` *should show a hint with "hello" on all clients*
Hey, does anyone know where I could find a detailed guide on how to go about packing a script into a mod? I've written something pretty small, but have had trouble finding good guides. I've looked at HEMTT, but even then, still haven't gotten far.
DS_fnc_Camera =
{
DropShipCamera = "Land_HandyCam_F" createVehicleLocal [0,0,0];
DropShipCameraVectorUp = [0,0.25,1];
DropShipCamera hideObject true;
DropShipCamera attachTo [dropship_base, [0,-40,15]];
DropShipCamera setVectorUp DropShipCameraVectorUp;
};
DS_fnc_inShip = {switchCamera _DropShipCamera;};
DS_fnc_outShip = {switchCamera _player;};
this is the func
so it will attach an object to another object when executed, and nothing else.
DS_fnc_inShip and DS_fnc_outShip won't work, since the code is wrong
- https://community.bistudio.com/wiki/switchCamera
_DropShipCameraand_playerdon't exsit
You just really need to pack your stuff into a PBO and can call it a day (given that you have a corresponding addon folder etc.)
There is no black magic or anything really. You obviously can go deeper down the rabbit hole, but for the most basic thing: Addon folder, pbo packed, done
Yeah, I've tested my script in game and it works, the bit that I'm struggling with is, I'm attempting to use some CBA stuff (post-init), and I'm having trouble with the functions library, and I've packed it into a PBO
You might also want to read these
https://community.bistudio.com/wiki/CfgPatches
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Path
I've just started reading the funcs lib one, and I'll have another look over CfgPatches, thanks :)
How to copy this message and paste to discord ? (same)
open pinned messages, select the text you want, right click on the selection, click 'copy', right click on the message field, click 'paste', modify to your needs
if i copy the message both codes is looks like second.. π
Does anyone know how to check if a Custom Control is pressed? I've been looking all over, and can't seem to find anything. CBA won't work in this case :/
@trail smelt You need to use \ before whatever you wanna type in to prevent discord magic.
So in this case:
\```sqf
/* your code */
hint "good!";
\```
how can i disable the incapacitated state for particular units?
mdoing?
He meant mission/scenario creating, already answered in #arma3_editor and #arma3_scenario ^_^
He asked about his mdoing for 4 or 5 times here π
This should be it, not sure if it is there in Vanlila game tho since I use 3den Enhaned
Vanilla
Thank you dedmen, finally π
addMissionEventHandler ["HandleChatMessage", {
params ["_channel", "_owner", "_from", "_text", "_person", "_name", "_strID", "_forcedDisplay", "_isPlayerMessage", "_sentenceType", "_chatMessageType"];
_channel = _this select 0;
_text = _this select 3;
_ltxt = toLower _text;
_doNotShow = ["connected","connecting","modified","disconnected","are not allowed"];
if(_channel == 16) then
{
{
if(_ltxt find _x > -1)exitWith{true};
} forEach _doNotShow;
};
}];
keep in mind, the texts are translated to the users language. So what works in english might not work in german.
Though I think the Arma server decides the language for these messages?
I believe KK did something about that?
yea looks like it, only the popup clients get is localised (i think)
yes. some pass the translation key in (in 2.04). But don't know if these system messages do that too
(oh, 2.04! mb)
I think, don't remember when that was π
quite recently, so maybe did not make it into 2.02
you were right, only works with english localisation π
Check translations of
STR_DS_PLAYER_CONNECTING
or
STR_MP_CONNECTING
I think its the second one
In current code for 2.04, it doesn't pass you the translation key for atleast the connecting message
The other is STR_MP_DISCONNECT and probably STR_MP_CONNECTED
and STR_MP_CONNECTION_LOOSING which you forgot above?
and probably STR_MP_VALIDERROR_1 or 2
is a particle effects duration timerPeriod or lifeTime?
I believe the effect is despawn/disappearing due to range of where it is spawned in (which is like 5km) whenever I leave that range the effect disappears off the vehicle and when I go closer to where it was spawned in it re-appears.
ah yes, a distance check might also be done
is there any way to remove that?
no, no can change that ^^
that's engine-based
@toxic dirge how do you use smoke? a particle source, or drop?
particle source
well that's the best, so maybe 5km is a hardcoded distance
https://cdn.discordapp.com/attachments/221488891230683137/814253164965658643/dwadwa2.mp4
thruster effect on vehicle, is there any way to re-add it when the range is passed
@winter rose
I don't see any issue in that video?
no that was just showing the effect
but the effect just disappears then re-appears
when a certain range
then no can do re-adding, that's it
you can check for the press of a custom control with
inputAction "User1" > 0
``` I'd recommend doing that in a KeyDown UIEH on the mission display (`[] call BIS_fnc_displayMission`)
I attached the effect to the base and that seams to work for now
ah you were using the object offset??
yes, attach the particle source to the vehicle π¬
yea haha
Cool, but is there a way to apply this to spawned units without having to select them directly?
No idea.
Understandable
addMissionEventHandler ["HandleChatMessage", {
params ["_channel","_text"];
_channel = _this select 0;
_text = _this select 3;
_ltxt = toLower _text;
if(_channel == 16) then
{
{
if(_ltxt find _x > -1)exitWith{true};
} forEach [
[localize "str_mp_connecting", " %s"] call BIS_fnc_splitString select 1,
[localize "str_mp_connect", " %s"] call BIS_fnc_splitString select 1,
[localize "str_mp_disconnect", " %s"] call BIS_fnc_splitString select 1,
[localize "STR_MP_VALIDERROR_2", " %s"] call BIS_fnc_splitString select 1,
[localize "STR_MP_CONNECTION_LOOSING", " %s"] call BIS_fnc_splitString select 1,
"modified"
];
};
}];
That does the job so far (except for "uses modified file" that has no localisation)
now we just need regular expression matching and string replace so you can just
_ltxt matches (localize "STR_MP_CONNECTION_LOOSING" replace ["%s", "*."])
might be that modified data file is translated on server. And servers are almost always english
whatever that means, iam happy that i got it working at all π
comment "event handler";
DS_fnc_EH =
{
dropship_base addEventHandler ["GetIn", {[] call DS_fnc_inShip; [] call DS_fnc_camExit; [] call DS_fnc_camEnter}];
dropship_base addEventHandler ["GetOut", {[] call DS_fnc_outShip}];
DS_fnc_camExit = {(findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 57) then {[] call DS_fnc_outShip};"];};
DS_fnc_camEnter = {(findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 15) then {[] call DS_fnc_inShip};"];};
DS_fnc_inShip = {switchCamera DropShipCamera; [] call DS_fnc_inShipMSG};
DS_fnc_outShip = {switchCamera player; findDisplay 46 displayRemoveEventHandler ["keyDown"]; [] call DS_fnc_outShipMSG};
DS_fnc_inShipMSG ={[]spawn {hint "Press SPACE to exit camera."; sleep 2.5; hintSilent "";}};
DS_fnc_outShipMSG ={[]spawn {hint "When in the dropship, press TAB to enter camera."; sleep 2.5; hintSilent "";}};
};
trying to add camera controls for the ship but in DS_fnc_outShip the displayRemoveEventHandler doesn't seem to remove it
Q: I'm cooking up some units of measure, and I wonder if I can leverage macros to help with that a little bit. i.e.
#define KPLIB_DEFINE_UOM(PREFIX,X) KPLIB_uom_siPrefix_##PREFIX = (10 ^ X)
because your syntax is wrong
what you wrote:
findDisplay 46 displayRemoveEventHandler ["keyDown"];
```what it should be:
```sqf
findDisplay 46 displayRemoveEventHandler ["keyDown", _id];
you have to save the EH ID to remove it:
_id = findDisplay 46 displayAddEventHandler ["keyDown", {blabla}];
findDisplay 46 setVariable ["my_keydown_eh", _id];
```which you can fetch using getVariable:
```sqf
_id = findDisplay 46 getVariable ["my_keydown_eh", -1];
findDisplay 46 displayRemoveEventHandler ["keyDown", _id];
so like
DS_fnc_camExit = {outShip1 = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 57) then {[] call DS_fnc_outShip};"];};
DS_fnc_camEnter = {inShip1 =(findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 15) then {[] call DS_fnc_inShip};"];};
displayRemoveEventHandler ["keyDown",inShip1,outShip1];
like so?
no
I need to do it twice?
yeah
oka
@little raptor it worked but now I can't go in the camera in the ship again
only the start
@toxic dirge there's a logical error in your code
you shouldn't remove the EHs while you're still inside the ship (or whatever it is)
they should only be removed when you exit the ship (not camera)
objective_1 = true;
trg_1_1 addEventHandler ["killed", {
objective_1 = false;
[] spawn {
sleep 60;
deleteMarker "target_1";
};];
trg_1_2 addEventHandler ["killed", {
objective_1 = false;
[] spawn {
sleep 60;
deleteMarker "target_1";
};];
trg_1_3 addEventHandler ["killed", {
objective_1 = false;
[] spawn {
sleep 60;
deleteMarker "target_1";
};];
trg_1_4 addEventHandler ["killed", {
objective_1 = false;
[] spawn {
sleep 60;
deleteMarker "target_1";
};];
if one span of bridge is killed, marker won't delete after 60 sec
yep, ty
objective_1 = true;
trg_1_1 addEventHandler ["killed", {
objective_1 = false;
[] spawn {
sleep 60;
deleteMarker "target_1";
};};];```
remove the ; before ]; 
finally all working great xD
in one scenario
Not sure why this is not working in my other deathmatch mission, playercount was 26 and "respawn_east" doesn't change from Eden-set [1200, 1406]
if (isServer) then {
while {true} do {
sleep 10;
_allPlayers = allPlayers;
call {
if ((count _allPlayers) <= 7) exitWith
{};
if ((count _allPlayers) <= 8) exitWith
{"respawn_east" setMarkerSize [1500, 1406]};
if ((count _allPlayers) <= 25) exitWith
{"respawn_east" setMarkerSize [1700, 1406]};
if ((count _allPlayers) <= 35) exitWith
{"respawn_east" setMarkerSize [1900, 1406]};
if ((count _allPlayers) <= 45) exitWith
{"respawn_east" setMarkerSize [2100, 1406]};
if ((count _allPlayers) <= 55) exitWith
{"respawn_east" setMarkerSize [2300, 1406]};
if ((count _allPlayers) <= 65) exitWith
{"respawn_east" setMarkerSize [2500, 1406]};
};
};```
Let's say I got a sequence of random animations an AI character has to perform. I would like to have some kind of countdown, when the sequence will be over. Since the animations should be random, I would need a method to get the length of each animation. Is this possible?
yes
_animDuration = -1 * getNumber(configFile >> "CfgMovesMaleSdr" >> "states" >> _anim >> "speed");
if (_animDuration < 0) then {_animDuration = -1/_animDuration};
@languid oyster but you're better off using event handlers
where do you execute that?
Init.sqf
use initServer instead
and remove the condition
because it's true
@quasi sedge also you're code is missing }
again 
use a code editor with syntax highlighting to catch missing parantheses/brackets
@little raptor many thanks mate. I am fiddling with an AI healing the player script, and the AI performs animations during the treatment. While treating, the player is informed about how long the treatment will last. It is ment to be run on a server later.
In fact, it was you giving me the code for the animation sequence to work :9
π
Was this lot, if you can remember:
if (_medic getVariable ["TAG_AnimDone_EH", -1] == -1) then {
_EH = _medic addEventHandler ["AnimDone", {
params ["_unit"];
_anims = _unit getVariable ["AnimSequence", []];
_anims deleteAt 0;
if (count _anims > 0) then {
_unit switchMove _anims#0;
_unit playMoveNow _anims#0;
} else {
_unit removeEventHandler ["AnimDone", _thisEventHandler];
_unit setVariable ["TAG_AnimDone_EH", -1];
};
}];
_medic setVariable ["TAG_AnimDone_EH", _EH];
};
_sequence = _medic getVariable ["AnimSequence", []];
_sequence append ["AinvPknlMstpSnonWnonDnon_medic_1",
"AinvPknlMstpSnonWnonDnon_medic_2",
"AinvPknlMstpSnonWnonDnon_medic3",
"AinvPknlMstpSnonWnonDnon_medic1",
"AinvPknlMstpSnonWnonDnon_medicEnd"
];
_medic setVariable ["AnimSequence", _sequence];
_medic playMoveNow _sequence#0;
waitUntil {_medic getVariable "TAG_AnimDone_EH" == -1 ||
(lifeState _medic != "HEALTHY" &&
lifeState _medic != "INJURED") ||
lifeState _victim != "INCAPACITATED"
};
Holy moly that was from a few months ago! π
disclaimer: this wasn't by me:
waitUntil {_medic getVariable "TAG_AnimDone_EH" == -1 ||
(lifeState _medic != "HEALTHY" &&
lifeState _medic != "INJURED") ||
lifeState _victim != "INCAPACITATED"
};```

Hope this is the correct place for this
Is there anyone here that has used Ravage and knows it fairly well. Getting an error as I start the game with Loot pools
https://pasteboard.co/JQ13RQ9.png
Here's the error I'm getting. As far as I can see I've written it in the correct format.
This is my "Common Weapons" loot pool in the "Gear Pool" Module - ["rhs_weapon_rhs_weap_m14","rhs_weapon_rhs_weap_m14_rail","Weapon_hgun_Pistol_heavy_02_F","rhs_weapon_m24sws","Weapon_SMG_05_F","rhsusf_weapon_m9","rhsusf_weapon_m1911a1","rhs_weapon_pya","rhs_weapon_makarov_pmm","Weapon_hgun_Pistol_01_F","rhs_weapon_savz61","rhs_weapon_m38_rail","rhs_weapon_m16a4","rhs_weapon_ak74","rhs_weapon_akm","rhs_weapon_aks74u","rhs_weapon_kar98k","rhs_weapon_M590_8RD"]
It's not a scripting error. The mod is blocking you. Contact the mod developers to see what the issue is.
Ahh, I see! Sorry
is there a better way than this to make a turret point at an incoming missile, such as those fired from the TU-95?
addToCIWS = {
params["_turret","_range"];
_null = [_turret,_range]spawn {
private["_turret","_range","_incoming","_target"];
_turret = _this select 0;
_range = _this select 1;
while{alive _turret}do{
_incoming = _turret nearObjects["RocketBase",_range];
_incoming = _incoming + (_turret nearObjects["MissileBase",_range]);
_incoming = _incoming + (_turret nearObjects["ShellBase",_range]);
if(count _incoming > 0)then{
_target = _incoming select 0;
_fromTarget = _target getDir _turret;
_dirTarget = direction _target;
_targetBoom = getText (configFile >> "CfgAmmo" >> typeOf _target >> "explosionEffects");
while {(alive _target) && (_dirTarget <_fromTarget + 60) && (_dirTarget >_fromTarget - 60)} do {
_turret doWatch _target;
if ((_target distance _turret < 2000) && (_target distance _turret > 100)) then{
_shots = floor random [1, 2, 3];
while {_shots>=0} do {
_turret fireAtTarget[_target,(currentWeapon _turret)];```
also, apologies if my code looks sloppy. I'm using this as a test more than an actual script for now
The remaining part of the script works fine. The gun fires, the missile blows up. But the issue is, the turret isnt pointing at the missile as of yet
apologies if my code looks sloppy.
@true frigate at least add ```sqf to make it readable for us
see the pinned messages
I was only adding the 3 backticks. My bad
@still forum Do nested hashmaps become slower like nested arrays and pushBack?
I think you said it doesn't
but checking to make sure
Guys, the SQF code posting on the forums is not working right? Can't find it on the list anymore
Anyway, I posted a question regarding a script here: https://forums.bohemia.net/forums/topic/233551-alien-like-motion-scanner-using-the-gps-minimap/
If any care to suggest something about it π
Thank you
it does work
there's an icon <> on top for code
select your code and press that button
but there is no sqf highlighting in the language list
yeah
THanks, there used to be a SQF on the list like Terra said
Actually @little raptor I meant that inside that <> icon there is no SQF in the list... like how do we post SQF code on the forums now?
@little raptor
[_pos] spawn
{
_pos = _this select 0;
playsound "hint";
null = [dropship_base] remoteExec ["fnc_DS_Effects",0];
null = [dropship_base] remoteExec ["fnc_DS_EH",0];
null = [dropship_base] remoteExec ["fnc_DS_Camera",0];
onMapSingleClick{};
};
I want to add particle effects event handler and camera fnc for all players (works locally already) would this work?
I don't know. That depends what the functions do
it's better to put all of them in one function and remoteExec that
every remote exec is sending data over network
try to use as few remoteExecs (and other network commands) as possible
@wind hedge replied on the forum
Thanks, will answer!
I haven't seen any but it is possible using kbTell
radioChannelCreate?
Uh Leopards mod was mentioned in Radio Arma :u
The AoW one, the latest
Gotta listen to it!
since when can we post images here
only veterans and above can

I'm gooooood π
When mission editing, is there any difference between hosting a mission on server or running the server from my PC?
yes. on a hosted server the player is also the server while on a dedicated server there is no player on the server's machine https://community.bistudio.com/wiki/Multiplayer_Scripting
Link without description alert π¨
π¨
Does it make any direct different in scripting?
if i was a veteran, it wouldnt be a link, it'd be a pic
yes.
on server isDedicated returns true.
And when running it locally, serverside scripts are still local to you. When running on a server they aren't
So it would be best to always make your missions able to run on dedicated server? would hosted players still be able to play it as if it was started on dedicated server?
yes, if it runs on a dedi, provided theu host it as MP, it will work
hah i was faster
and less typos π
i think most dedicated missions should run in SP as well
mine wont π
whys that?
domination wont either
tbh, i dont know lol
its a 6 year old mission, i should have thought about it earlier
Thanks, guys
Q: how deep does isEqualTypeArray verify? Just the first level?
I guess this answers my question:
_array = [true, -1, [0, 0, ""]];
_array isEqualTypeArray [false, 0, [0, true, ""]] // true, i.e. shallow "equality"
according to wiki its one dimensional
Be happy and proud about it
Stuff I do barely ever gets mentioned in channels like theese, even when I still had a popular mod going ππ
https://community.bistudio.com/wiki/effectiveCommander
What happens if the driver is a player? the effectiiveCommander will return the second player gunner or the driver?
Hey is there any method disabling/change duration of the "Secure Body" action for incapacitated players?
https://community.bistudio.com/wiki/Arma_3:_Revive#Settings barely gives a hint :(
tempting to implement a recursive, i.e. "deep", isEqualTypeArray ...
What for?
because I need to verify the shape of an array beyond just the surface level.
_array = [true, -1, [0, 0, ""]];
flatten _array isEqualTypeArray flatten [false, 0, [0, true, ""]] // false
ah flatten? oh ok... nice.
it kinda sorta fits the bill...
but I really do need to preserve the array members and recurse through them if possible
recurse, or iterate (more likely) if A3 ain't so good at recursion
is it possible to add a custom font to a mission?
It's not really related to this channel.
But anyway, I don't think so. You can add fonts by modding tho.
aw thats a shame
is there a way of testing if crew is inside of a vehicle with a script?
I want it so that artillery fires on a vehicle if it is populated.
I was planning on using something along the lines of this, but cant find the function to check if crew exists within a vehicle
if (insertCrewFind);
gun1 doArtilleryFire[_tgt1,_ammo,1];
sleep 1;
gun2 doArtilleryFire[_tgt2,_ammo,1];
else
gun1 doArtilleryFire[_tgt1,_ammo,1];
sleep 1;
gun2 doArtilleryFire[_tgt1,_ammo,1];
I thought the 'Crew' feature might do something, but it says it returns as an array, and really id just like a "yes there is crew" or "no there isnt crew"
Kinda like a true or false π
count crew _vehicle > 0
thank you! π
How can I get the vector of my player relative to a position in a model?
right now I'm using player getRelDir _pos but I think its world space and changes for every instance of the same building class
can someone help me remote exec a function? I execute in locally ingame with debug but no one else sees particle effect
can you successfully remote exec other functions?
no
Can you successfuly remote exec any of the examples from the wiki? https://community.bistudio.com/wiki/remoteExec
what is "vector of your player"?!
anyway, maybe you mean vectorModelToWorld or vectorWorldToModel?
@toxic dirge I don't think what you have is real functions.
See:
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Adding_a_Function
to learn how functions are actually made
everything is done through one sqf heres an example of one
comment "Dropship camera";
fnc_DS_Camera =
{
DropShipCamera = "Land_HandyCam_F" createVehicleLocal [0,0,0];
DropShipCameraVectorUp = [0,0.25,1];
DropShipCamera hideObject true;
DropShipCamera attachTo [dropship_base, [0,-40,10]];
DropShipCamera setVectorUp DropShipCameraVectorUp;
};
that's not a function
can it not be executed like one with remote?
no
what do you call a chunk of code defined as a variable?
that can be called or spawned?
the only thing I found is
_source = createVehicle ["#particlesource",getPosATL _object,[],0,"CAN_COLLIDE"];
[_source,"BombSmk3"] remoteExec ["setParticleClass",0,_source];
_source attachTo [_object,[0,0,0]];
_smokeGroup1 pushBack _source;
but I don't know how to get it to do what I want
Is it not an inline function?
it doesn't need to have parameters or return a value to be a function does it?
This should work: ```sqf
some_function = { hint "yup"; };
[] remoteExec ["some_function", -2, true];
it absolutely won't
what is some_function on other machines?
remoteexec makes my brain hurty
"call"
#arma3_scripting message
My question some time ago regarding this, and multiple people said "just remoteExec it"
you can't remote exec a function on another machine where it is not defined
but you can put the contents of your function in the code parameters of a bis_fnc_call remoteExec
which for me was the reason for that question, because I need to
client doesn't know the code
let's not teach bad ways here
always use CfgFunctions
Its an example from the wiki
don't send large chunks of code over the network
I do this in some situations, but not for freaking large files.
so... How would I have a client run code which is only available in a server-only mod?
create piece of code, stick it to public var
Does anyone have a script for reparing destroyed vehicles? Something similar to vdauphin's H&Ms one
_configs = "true" configClasses (configFile >> "CfgFunctions" >> "PSF" >> "core");
_configs append ("true" configClasses (configFile >> "CfgFunctions" >> "PSF" >> "scripts"));
{
private _varname = format["PSF_fnc_%1",configName _x];
private _var = missionNameSpace getVariable _varname;
if(!isNil "_var")then
{
publicVariable _varname;
};
} forEach _configs;
_initScriptsOnClient = "
waitUntil {!isNull findDisplay 46 && !isNil ""ExileClientLoadedIn"" && getPlayerUID player != """"};
[] spawn PSF_fnc_rad_client;
";
fnc_initScriptsOnClient = compileFinal _initScriptsOnClient;
publicVariable "fnc_initScriptsOnClient";
"" remoteExec ["fnc_initScriptsOnClient",-2,"fnc__initScriptsOnClient_JIPID"];
@exotic flax you can send functions from server to client
Altis Life does it for example using publicVariable
server only mods like that can be a source of bad performance
They always have to send everything to the clients
but anyway, you can use this:
[_params, some_fnc] remoteExec ["call"]
This is what i do, Infistar does it similar with their anti hack as well.
interesting how people (who know scripting as well) in this case gave a wrong answer π€·ββοΈ
but if publicVariable solves the issue I'm fine with it
Don't really care, wanted to give you a example. What i've send is also being executed as soon as the player joins JIP.
Also not prolly what you wanted.
actually I do; it needs to run on all clients including JIP
Oof
it's 14 lines of code (may become a bit more) to add local EH's on the client, nothing bad
I won't execute a full framework from the server π
technically correct π
Hello, hoping someone with a bit more experience with sqf could give a tip for me having to do with the tasks system.
I have 7 tasks set and working, and while im sure there is a better way to get the desired effect, I have them simply tied to 2 triggers per task area. 1 trigger for opfor seized, and 1 trigger for blufor seized. As this will be an MP scenario, the players will all be on blufor side. All the tasks start out as just created. When blufor controls the area, the tasks is set to complete. When/if opfor re-takes the area, the tasks is set to reset to "Created" state. Both triggers are set to be repeateable, and they work fine with my testing, correctly swapping back and forth (with color coded area marker).
My issue right now, is that I would prefer to set up a trigger that knows when all 7 tasks are completed, and to end scenario. I've tried a couple things, to no avail. This is the latest variation I tried in the condition field of this end scenario trigger
["hq","oil","s1","s2e","s2w","s3","sc"] call BIS_fnc_taskState == "SUCCEEDED"
the strings are the variable names of the task modules themselves. I would love to get this working, but honestly its just icing on the cake for me as there will be zeus (me) active for the mission who can just end it manually if needed. Any help is appreciated, i'm not a noob to the editor, but scripting is something I am still not too strong in aside from real basic stuff.
_done = false;
{
_state = _x call BIS_fnc_taskState;
if !(_state isEqualTo "SUCCEEDED") then {
_done = true;
};
} forEach ["hq","oil","s1","s2e","s2w","s3","sc"];
!_done
Should return true when all tasks are set to SUCCEEDED
hm, so this goes in the condition field for the trigger, or no? simply plopped in there nothing happens. To me this looks more like a block that would go into the init?
condition field of trigger
well nothing happens, that trigger is synched to the end scenario module, nothing happens. I'm sure its something whacky that i've done, but I don't want to force the issue. Its a small feature that in the end doesn't need to work. Thanks for the help though.
Hello,
Is there any way to save a variable to a person right before they exit to the main menu and then add that variable back when they load back in?
for those experienced with scripting ace interaction menus,
_action = ["Sit0", "Sit Down", "a3\ui_f\data\igui\rscingameui\rscunitinfo\role_cargo_ca.paa", {player moveInCargo [_this select 0, 0]}, {true}, {}, [], [-0.84668,-2.70801,-1.32691], 10] call ace_interact_menu_fnc_createAction;
[this, 0, [], _action] call ace_interact_menu_fnc_addActionToObject;
``` I can't see my action at the position specified, what have I done wrong?
bit confused on arma supporting some unicode characters but not others
for example "β" shows up but other stuff from the same version of unicode doesn't?
its really tripping me up cus I need a character that forms a seamless line
I have a janky soultion with invisible characters and underlines but underlines dont seem to be resizeable
Save to profileNamespace on disconnect EH, reload that variable on initPlayerLocal
And for SP you could try a onGameInterrupt EH
whats the best linter to use for arma scripting?
Wondering if anyone has any idea what NCLoggedIn means? I am using TADST to run my server to test locally, and i've never seen it before
What else should I do to keep my brain fit than teaching myself to code? And as I am slow and lazy, things need their time when I do them π
Bumping this
Why not just use that one then?
Ah cause it'd require me to spend a shitload of time trimming it from the original. It'd apparently be a huge PITA because the functions call from each other across a lot of different sqfs, just for the one feature
Even if I had the time for that, I certainly don't have the brains
you can try using setdamage on it to reset the damage. or if its wreck and too far gone, then you need to delete the wreck and spawn a new vehicle
ignore it, ~~ I ~~ KK forgot to remove that
Anyone here knows how to make a sub category for my action in ACE? for example, this action is stuck on the plane but there is allot others in plane and it gets messy, I need to create a sub action to access this, like Plane>>Radio>> Request Bogey Dope
the page in ace has no example to create my own sub category, instead only to use one that already exist
private _action = ["RadioToAWACS", "Request Bogey Dope", "", {[] spawn RTG_fnc_RequestBogeyDope}, {_player in _target},{},[],[0,0,0],4,[false,true,false,false,false]] call ace_interact_menu_fnc_createAction;
["Plane", 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
So after roughly digging around for some hours, I came up to a major problem. The weapon randomisation does not remove the standard weapons mags (G3A3), hence it will stay in the inventory even when a unit gets a randomised weapon. An easier explanation, if the unit gets an randomised weapon, lets say AKM, the unit spawns in with the AKM but still has the G3A3 mags in its inventory. So the question is, how do I remove the mags, I highly suspect it is something I add to; ```sqf
if (random 100 < _weaponProbability) then {
private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass;
{
yes, removeMagazines with the mag classname
But the script is universal.
It is applied to many factions.
So It cant be specificly tied to one sort of mag.
Yes I tried removing ```sqf
magazines[] = {"CUP_20Rnd_762x51_G3","CUP_20Rnd_762x51_G3"};
respawnMagazines[] = {"CUP_20Rnd_762x51_G3","CUP_20Rnd_762x51_G3"};
including removing it from it's inventory in configs.
but the unit still spawns with the mags.
you need to use removeMagazines
Oh, so not apply that to the script but the unit config?
in the script, where you removeWeapon
But then we will be back to here.
Grab it from the config
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
removeMagazines;
}
Yes. Thank you. Although will this not remove RPG ammo etc? ```sqf
{player removeMagazine _x} forEach magazines player
this ^ will
Font problem. Make your own font.
@little raptor sorry for @ you, but since you already have a bit knowledge regarding my script, do you know of anything? I know it's a easy fix. Thanks Lou too. #arma3_scripting message
You can't repair a destroyed vehicle. You'll have to create a new vehicle (delete the old one), set its damage to a relatively high value (say 0.75), and keep reducing that damage in a loop
or use HandleDamage EH to prevent further damage
Yeah I know, I was hoping there'd be a script out there that would let me do what happens in hearts in minds
You can add a Damage EH that any damage only damages specific parts like the engine and wheels and so the vehicle is never trully destroyed, only rendered unusable
i.e you tow the wreck to the repair area, use an ace interact and it replaces the vehicle
But like I said vdauphins scripts are way too difficult for me to unravel
Here's some pseudo script:
params ["_veh"];
_vdu = [vectorDir _veh, vectorUp _veh];
_pos = getPosASL _veh;
_type = typeOf _veh;
_newVeh = objNull;
isNil {
deleteVehicle _veh;
_newVeh = createVehicle [_type, _pos];
_newVeh setPosASL _pos;
_newVeh setVectorDirAndUp _vdu;
_newVeh setDamage 0.75;
};
while {alive _newVeh && getDammage _newVeh > 0} do {
_newVeh setDamage ((getDammage _newVeh - 0.1) max 0);
sleep 2
};
hint "Repaired";
if (random 100 < _weaponProbability) then {
private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass; removeMagazineGlobal;
Correct? ```sqf
removeMagazineGlobal;
no
This will still remove RPG ammo...
I know my friend. But I don't know how. Is there any place in the wiki that can explain me how I bind/attach the command to get it from the config?
really, to me you are way over your head in trying to reuse this randomisation script;
why not write one from scratch that fits your needs?
a simple, easier one that does not use a framework you don't know
{_unit removeMagazineGlobal _x} forEach magazines _unit;
This will still remove RPG ammo...
so?
he wants to remove weapon's magazines
wasn't that the objective?
Yes.
Rifle.
Since the script is also used on RPG units, AA units etc. Because I want them to also get randomised rifles.
then use this
{_unit removeMagazines _x} forEach (magazines _unit arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines));
Sorry guys, but I think it would be alot easier for me to just use this script then create a whole new one. Since I already have going to deep into it and using some functions from it already.
@tough abyss that script should be used before you remove the old rifle
if (random 100 < _weaponProbability) then {_unit removeMagazineGlobal _x} forEach (magazines _unit arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines)); private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass;
// Check to see if we randomize Weapon
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
if (random 100 < _weaponProbability) then {
{_unit removeMagazines _x} forEach (magazines _unit arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines));
private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC(randomizeWeapon);
};
} foreach ["rifle"];
};
};
since you only want to remove rifle classes change WEAPON_CATEGORIES to ["rifle"] only (it can be optimized further but not in the mood to explain)
Yes. I will. But the code I just sent you was correct yes?
probably
since you don't need _weaponClass just make it one liner:
_unit removeWeapon primaryWeapon _unit;
Thanks. I highly suspect you roll up a spliff for a mood booster, prob the best natural remedy. Thanks again Leo!
I neither drink nor smoke
Quoted;
Richard Smith, Writing C for 35 years
Answered 3 years ago
"this is how i use, and donβt use, pot as part of my programming.
i do not get high to code, ever. i tried once (or twice) and found i just sit and stare at code and literally nothing happens in my brain to advance to the next thought, logic is non-existent. not a good state of affairs, if you willβ¦"
So yeah. Good choose. Wait, is this why I..-
Yeah it does not work unfortunatly. If you got a better mood and don't mind helping, I will be waiting happily for some help. You don't need to do it now. Cheers.
yeah this is why:
private _magazine = tolower _x;
So typical of BIS functions 
So it's the scripts fault or BIS functions fault?
BIS
I see.
I'll change that
@tough abyss actually I don't want to risk it.
Do this:
{_unit removeMagazines _x} forEach ((magazines _unit apply {toLowerANSI _x}) arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines));
So this; (I still haven't edited _CATAGORIES since I later at some point want units to randomly get or not get grenades etc. ```sqf
// Check to see if we randomize Weapon
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
if (random 100 < _weaponProbability) then {
{_unit removeMagazines _x} forEach ((magazines _unit apply {toLowerANSI _x}) arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines));
private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC( randomizeWeapon);
};
} foreach WEAPON_CATEGORIES;
};
};
I made a modification to a mod, and I changed a lot in the config.cpp. Might I ask, if someone can see any major flaw within the cfg? https://github.com/nicoman35/BarrettM107/blob/master/Addons/daggerbarrett/config.cpp
Now it doesn't randomise the weapon at all and they spawn with standarded issues G3A3's.
FUNC( randomizeWeapon)
your own fault
Hey, somebody know how to stop the VR Timer using BIS_stopTimer? Want to use it in my mission but when the Player reaches a trigger it should stop
Thanks Leo! Much appreciated as always!
what's a VR timer?
thats the problem it does not work
How are you using it?
oh damn sorry i found the problem... i spelled BIS_stopTimre xD
It does work. Maybe you're doing it wrong
[] spawn {
["#025D00"] spawn BIS_fnc_VRTimer;
sleep 3;
BIS_stopTimer = true; //stop the timer after 3 seconds
}
roger
@wind hedge
I said too many spawns.
As I mentioned already, use the sleep you use for the while. For example:
[]spawn {_contacts = allUnits;
while {true} do {
{
_pos = getPosWorld _x;
_marker = format ["markerblabla_%1", _forEachIndex];
createMarkerLocal [_marker, _pos];
_marker setMarkerShapeLocal "ELLIPSE";
_marker setMarkerColorLocal "ColorBlack";
_marker setMarkerAlphaLocal 0.85;
_marker setMarkerPosLocal _pos;
_markerSize = ((getMarkerSize _marker select 0) + 0.1) mod 2;
systemChat str _markerSize;
_marker setMarkerSizeLocal [_markerSize, _markerSize];
} forEach _contacts;
sleep 0.1;
}}
you can go ahead and test this in Debug Console
Thanks, Will do!
How do i set up the disconnect EH?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#PlayerDisconnected
Put the event handler in initServer.sqf
When converting player worle position to model position, I need to use getposasl right?
AGL
which needs ASLtoAGL getPosASL
Thanks
Oh yeah right. If I just use player worldtomodel that should be fine right?
What do you mean?
The syntax for worldtomodel takes object as a param
I'm trying to think of ways why my ace action I made wasn't showing at the location I specified using worldtomodel
I guess I have to tear apart the create action function and see what type of position in needs
Noted, I'm sitting in a vehicle seat before getting the worldtomodel position
Will this check if the host leaves or just the clients?
If the host leaves everyone leaves π
Yes but will it trigger if the host leaves?
I don't know. I don't think so
How can I use playSound3D to play a sound with multiple sources in sync?
play all of them together
and use isNil
to make it unscheduled
won't there still be some delay as they're being played in order of the code?
or is it not noticeable
and use isNil
to make it unscheduled
unscheduled code executes in exactly one frame (as if everything happened at the same time)
oh I see
I noticed a comment in 2014 saying it's not JIP compatible. is it now JIP compatible?
Probably not
How can something with local effect be JIP compatible 
Isn't it global?
it's global
Ah I looked at playSound
i'm going to use say3D ig because of local effect. what is the best way to synchronise an existing sound with JIP?
track the offset and play it for them with offset?
sound_start_time = time;
//remoteExec the say3D for everyone
_offset = time - sound_start_time;
//remoteExec the say3D for JIP with offset
both must be executed by the server
so if I'm tracking this on the server, I should remoteexec for every player that joins? if I use the JIP parameter of remoteExec, it'll play the sound from the beginning
added some notes
note that they still won't be perfectly synchronized
i.e. you can't dance to that say3D π€£
oh notes to the code
Answering my own question, it has to be from config
class CfgVehicles
{
class AllVehicles;
class Air: AllVehicles
{
class ACE_SelfActions;
};
class Plane: Air
{
class ACE_SelfActions: ACE_SelfActions
{
class RadioToAWACS {
displayName = "Radio AWACS";
condition="true";
statement="";
icon="";
class RadioToAWACS_Connect
{
displayName="Connect to AWACS";
condition="True";
statement="[] spawn RTG_fnc_SelectAWACSDialog";
};
};
};
};
};
not #arma3_scripting
The question was #arma3_scripting , the answer is #arma3_config
hello, Q: I have two 3D positions, how to I calculate the bearing between them? is that BIS_fnc_dirTo (https://community.bistudio.com/wiki/BIS_fnc_dirTo )? note this is saying use getDir, but I do not have objects, i have 3D positions and that is it. Thank you...
https://community.bistudio.com/wiki/getDir
And what arguments does getDir take?
ah I see, second form. thanks...
hmm i'm trying to setup a time trial based on the wiki article, but on mission start i am getting a script error
_object setTriggerActivation ["None"...
Error undefined variable in expression: _object```
so i guess something is missing ... i just have no idea what. followed the guide 1:1
Which guide?
that's wrong
did you write it?
it's not wrong, it is what the script error shows me :p
no, i did not write any script
call compile compile is wrong
compile is not used on that page, is it?
ok, sure, but i don't compile anything
i literally followed the guide
now that makes me realize i probably should have asked this question in mission_makers
@west grove can you tell me which function throws that error?
You checked error in RPT?
And it gave you no filename?
Are you running Arma with -debug parameter to get better error logs?
How can I check if I am in SP/MP scenario running from 3den (preview scenario) ?
is3DENPreview, thank you @still forum
There is no double compile in there tho.
Also what is that old man error there :D
wiki tutorial is wrong. it says "BIS_FD_quitSelector1" while it needs to be "BIS_TT_quitSelector1"
same with reset trigger
just wanted to do the same :p
so sloppy :>
ok, it works now. only took me 30 mins to fix. \o/
Not your fault if the guide is faulty 
So this snippet does actually work, the change that made it work was using the taskID name, not the variable name of the module itself. So naming the taskID the same as the variables in this list has it working fine.
no clue why there is some OM error in my log.
i keep forgetting but:
init.sqf is executed for each player (+ server) once when they join.
if i join later, it wont run again for everyone else, correct?

ah seems like i want initPlayerLocal
Usually
not to familiar with init order
put in trigger condition: ["hq","oil","s1","s2e","s2w","s3","sc"] findIf { !(_x call BIS_fnc_taskCompleted) } == -1
its not that i didnt know about the sources, its just very very low on my priority list usualls
if i get to the point where my script is flawless and i worry about initialization, i have usually already lost interest π
I love how there are multiple ways to always do something in this. His snippet works fine when I made the taskID the same as the variable names that are in that list. Tied to an end scenario module, and it works correctly once all are completed.
_ref01 = "#particlesource" createVehicleLocal (getpos bPos_01);
_ref01 setParticleCircle [0, [0, 0, 0]];
_ref01 setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0];
_ref01 setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 0.5, [0, 0, 0], [0, 0, -17], 0, 5, 5, 0, [4,4,4], [[0,0.1,1, 1], [0.01,0.02,1, 1], [0.01,0.02,1,0]],[0.02], 1, 0, "", "", bPos_01];
_ref01 setDropInterval 0.06;
if I createVehicle non locally and then locally execute with debug or something will the effect still appear to all clients similar to props and what not?
Say again?
createVehicleLocal
createVehicle
What about them?
If you run createVehicle on any machine, it has global effect and the object will exist everywhere.
If you run createVehicleLocal on one machine, the object will only exist on that machine.
If you run createVehicleLocal on all machines (using Remote Execution for example), a different object will exist on every machine.
what I'm asking is if it still counts being a particle effect
and would the params work being executed locally aswell
Particle Effects are strictly local.
Have you checked out https://community.bistudio.com/wiki/Particles_Tutorial ?
then my question is how can I get all clients to be able to see it while executing locall
y
execute it locally for every one
and I don't mean remoteExec
just locally
remoteExec execVM?
How do you show the particle effects?
how do you mean?
The code
Put your particle effect creation code into a separate script file (better yet, make it a function) and then, yes, remote execute that file / function on every machine.
null = [dropship_base] remoteExec ["fnc_DS_Effects",0];
null = [dropship_base] remoteExec ["fnc_DS_EH",0];
null = [dropship_base] remoteExec ["fnc_DS_Camera",0];
this is what I was doing but it only was working locally
I mean the functions
what I am creating, everything must be in one sqf file
Why?
it makes it more simple to use mission to mission and on the fly and I have no interest in making a mod or using in mission file
It may make copy-pasting it easier, but it certainly doesn't make anything else easier.
^
I've even tried
{code_for_particle} remoteExec ["BIS_fnc_call",0];
to no avail
That should have worked though.
Provided getpos bPos_01 worked inside your remote executed code_for_particle.
yes
in a variety of different test using remote ex too
but never in mp
the vehicle object spawn without being remote exec'd but the particle effect and camera do not carry over for anyone
no matter what i try
Split it up into several files properly, get it working, then you can go back to a single file if you have to.
I have seen it work in a single file before
_source = createVehicle ["#particlesource",getPosATL _object,[],0,"CAN_COLLIDE"];
[_source,"ExpSparks"] remoteExec ["setParticleClass",0,_source];
_source attachTo [_object,[0,0,0]];
_smokeGroup1 pushBack _source;
but I don't know how to get the particle params to work like this
What params?
setParticleParams
random
circle and interval
Okay and in which code?
Ah, because _ref01 is local there?
yes
{_ref01 = "#particlesource" createVehicleLocal (getPos bPos_01);
_ref01 setParticleCircle [0, [0, 0, 0]];
_ref01 setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0];
_ref01 setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 0.5, [0, 0, 0], [0, 0, -17], 0, 5, 5, 0, [4,4,4], [[0,0.1,1, 1], [0.01,0.02,1, 1], [0.01,0.02,1,0]],[0.02], 1, 0, "", "", bPos_01];
_ref01 setDropInterval 0.06;} remoteExec ["call", 0];
```Should work if you do it like this though.
poor, poor network π
Not my fault 
I also should mention there are 6 separate effects that I will prob need to repeat this with
Well, do it properly with functions or at least files then π€·ββοΈ
I will see what i can do thank you for the help
@toxic dirge As I told you numerous times, just call the function locally
And if you're not gonna do that, at least define that as a function. Don't send the code over the network every time.
I'm not sure how to do that
which one?
also, you didn't tell me how and when you create the particles, so I don't know how to help you
oh, it is done on mapSingleClick
Oh. Well that can't be done locally. I thought maybe it was some smoke or something that came out of that ship thing you showed me.
Anyway, define it as a function:
class CfgFunctions
{
class DS
{
class particles
{
tag = "DS";
file = "path\to\folder";
class dropParticles {};
};
};
};
if it's a mod, put that in config.cpp. If it's a mission, put that in description.ext.
Next, create a file named fn_dropParticles.sqf in path\to\folder (which is path to the folder where you keep your functions) and put whatever you want in it.
that's it. you now have a function called DS_fnc_dropParticles (DS is the tag, as you see in cfgFunctions)
See this page for more info:
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Adding_a_Function
it's just one sqf that it/was being made to use in any mission the person felt like using it in and the effect is the thruster. not mod or mission file
is there an eventhandler which is fired when player is talking?
Don't think so, not for the vanilla VoN system at least.
Can someone tell me why this isn't working for trying to apply random damage to a vehicle? Apparently I'm missing a ] but I can't see it for the life of me
_array = ["setHitPointDamage ["HitFuel", 1]", "setHitPointDamage ["HitEngine", 1]", "sethit ["wheel_1_1_steering", 1]", "sethit ["wheel_1_2_steering", 1]", "sethit ["wheel_2_1_steering", 1]", "sethit ["wheel_2_2_steering", 1]"];
_vehicle = selectRandom _array;```
you can't put " inside "
unless there's two
_array = ["setHitPointDamage ["HitFuel", 1]", "setHitPointDamage ["HitEngine", 1]", "sethit ["wheel_1_1_steering", 1]", "sethit ["wheel_1_2_steering", 1]", "sethit ["wheel_2_1_steering", 1]", "sethit ["wheel_2_2_steering", 1]"];
_vehicle = selectRandom _array;
see?
always use syntax highlighting
I wasn't aware of that, what am I meant to do instead?
unless there's two
or use ' (single quotes)
Alright cheers Leopard, the script is running through now, but for some reason it isn't applying the damage to the vehicle
how is it supposed to?
use code
_array = [{_veh setDamage 1}, {_veh setDamage 0}];
call selectRandom _array;
Alright, I got it. Thanks heaps Leopard. Great work as always
what is the diffrence between LootWeaponHolder and GroundWeaponHolder
upon reading an example #2 from the worldToModel wiki, wouldn't the second example be incorrect?
_relPos = player worldToModel position car; parameter is , format PositionAGL or Position2D but position is Array - format PositionAGLS
https://community.bistudio.com/wiki/worldToModel
https://community.bistudio.com/wiki/position
#community_wiki but yes, using it with position can probably lead to incorrect results.
Adjusted.
I'm always reading here functions, functions, functions. Ok, because you guys tell, I made my mod with functions too. But what advantage has the function has over a normal script?
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Adding_a_Function
Main benefits are listed there
i have a particle source spawning dust clouds around the player, but i have a hardtime getting the particles velocity. i feed it [0,0,0] as movevelocity in setParticleParams, setParticleCricle and setParticleRandom. they still move with windspeed. any ideas how to stop that?
or is that just the way the cloud particle behaves?
move velocity is their initial movement velocity and has nothing to do with wind
yeah well thats my problem. they move even tho i set it to zero
that particular parameter does not affect external forces
I believe there is something else that can be done about it but cant remember what the parameters are
okay, im not able to manipulate the velocity, but thats fine. i can just offset it into the wind direction, so the particles is "fully mature" when it reaches the player.
can someone add to the setParticleParams wiki site that the position of the source is completely overwritten by:
this, /Object/
param. it will use the objects positon instead.
@winter rose
Judge this proposal, oh wise Particle Tutorial man
I say -no-
I think there is a way to make it no wind-sensitive
According to https://community.bistudio.com/wiki/ParticleArray, the rubbing parameter affects how the particles behave in wind (though I haven't experimented to see exactly how the behaviour is changed)
Why is this giving me a "generic error in expresion": _sortedContacts = [_nearObjects, [], {(player distance2d _x)}, "ASCEND"] call BIS_fnc_sortBy;
specifically at the player distance2d _x part
did you set rubbing to 0 so you don't get wind effect?
aha!
i did not. but it works now as intended. wind is actually what i want, i was just confused that it ignroed my input
wind is actually what i want
it will still impact further during the particle's lifetime
how?
wind? by gusts, or wind change
your particle velocity is the initial velocity of the particle, that's it
what is _nearObjects? each element must be an object/position
Also, if there are agents among them, you must use agent to get the agent unit
private _nearObjects = [];
private _motionMarkersArray = [];
private _maxMotionMarkers = 10;
while { vMotionScannerRunning } do {
if (visibleGPS) then {
switch (true) do {
case (_detectAllEnemies) : { _nearObjects = (player nearEntities [["Man", "Air", "LandVehicle", "Ship"], _motionScannerDistance]) select {side group _x isNotEqualTo side group player && abs speed _x >= 3}; };
case (_detectEnemyUnits) : { _nearObjects = (player nearEntities [["Man"], _motionScannerDistance]) select {side group _x isNotEqualTo side group player && abs speed _x >= 3}; };
case (_detectEnemyVehicles) : { _nearObjects = (player nearEntities [["Air", "LandVehicle", "Ship"], _motionScannerDistance]) select {side group _x isNotEqualTo side group player && abs speed _x >= 3}; };
case (_detectEnemyAgents) : { _nearObjects = agents select {agent _x distance player < _motionScannerDistance}; };
};
if (_nearObjects isNotEqualTo []) then {
private _sortedContacts = [];
_sortedContacts = [_nearObjects, [], {(player distance2d _x)}, "ASCEND"] call BIS_fnc_sortBy; ```
the true case I am using right now is _detectEnemyAgents
so, the answer to your question is: _nearObjects = agents select {agent _x distance player < _motionScannerDistance}
well then yeah
agents returns teamMembers
which you'll have to convert to object using agent
how?
(because the aliens I am spawning are agents so I need the motion scanner to detect them!)
agent
@wind hedge you're already doing it:
agents select {agent _x distance player < _motionScannerDistance}
use that too for the sortBy
_sortedContacts = [(agents select {agent _x distance player < _motionScannerDistance}), [], {(player distance2d _x)}, "ASCEND"] call BIS_fnc_sortBy;
like so?
I thought that _nearObjects already catched that...
@wind hedge player distance2D agent _x 
ohhhhhh, now I get it! 
if i remoteExec a BIS_fnc_addStackedEventHandler OnEachFrame on the server, the file called on the EH its handled by the remoteExecutedOwner or the Server?
server
can i add a "onWaypointcompletion" code to my waypoint through script?
cant find a command
setWaypointStatements I think
oh cool thanks
when in doubt, see command groups π
https://community.bistudio.com/wiki/Category:Command_Group:_Waypoints
comment "Dropship camera";
fnc_DS_Camera = {
[dropship_base,{
DropShipCamera = "Land_HandyCam_F" createVehicleLocal [0,0,0];
DropShipCameraVectorUp = [0,0.25,1];
DropShipCamera hideObject true;
DropShipCamera attachTo [this, [0,-40,10]];
DropShipCamera setVectorUp DropShipCameraVectorUp;
}] remoteExec ["BIS_fnc_call", 0];
};
okay so when I remote exec my camera with onMapSingleClick it looks weird for example it will appear upside down in first person or too low in third, however it looks perfectly normal when locally executing
cant find how to delete an unit?
deleteVehicle
... why
as funny as it sounds π
its createUnit and deleteVehicle. alright then
and deleteVehicleCrew if the unit is in a vehicle π¬
Is there a reliable, fast way to get the height of an object? I tried with boundingBoxReal but had some inconsistencies
BIS_fnc_objectHeight but I suspect it also uses the bounding box
Return object height defined by it is bounding box and ev. offset/fix.
other than that a "hacky" way is to use some lineIntersects and make the difference with its base altitude I'm afraid
let's hope so!
lineIntersect with onEachFrame for 50 units, not good π
yyyyyyyyyeah π¬
said fixes in image:
Was about to add them to the biki
u too quick 4 me
{
if (_displayedMotionMarkers < _maxMotionMarkers) then {
private _contactName = random 9999;
_marker = objNull;
if (_detectEnemyAgents) then {
_contactName = name agent _x;
_marker = createMarkerLocal [_contactName, getPosWorld agent _x];
} else {
playerSide reveal _x;
_contactName = name _x;
_marker = createMarkerLocal [_contactName, getPosWorld _x];
};
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "hd_dot";
_marker setMarkerColorLocal "ColorGrey";
_marker setMarkerAlphaLocal 0.85;
_marker setMarkerSizeLocal [0.5, 0.5];
[vAnimatedMarker_1_Fnc, _marker, 0.3] call CBA_fnc_waitAndExecute;
[vAnimatedMarker_2_Fnc, _marker, 0.6] call CBA_fnc_waitAndExecute;
[vdeleteMarkerLocalFnc, _marker, 0.9] call CBA_fnc_waitAndExecute;
_displayedMotionMarkers = _displayedMotionMarkers + 1;
};
} forEach _sortedContacts;
Question incoming, TAKE COVER!!
I am getting a _marker undefined at setMarkerShapeLocal "ICON";
private _marker = "";
First of all, markers are STRINGs, not OBJECTs
Second of all, if marker names is duplicate you can't create it (it becomes "")
So don't write _marker = createMarker ["blabla",...];
write ```sqf
_marker = "blabla";
createMarker [_marker, ....]
instead of objNull
they're in the same scope
it shouldn't throw undefined error
That is because we need a mrkNull!


