#arma3_scripting
1 messages ยท Page 105 of 1
But ig I could do it within the addAction itself
addAction's condition check runs locally
You could either just use player in the function itself, or pass player to the function as a parameter (assuming it's your own function)
So, as long as I check the players inv within the addAction it will always check that one players inv?
Would like to know what is sector tactic. Is that an official module?
Yup
Great, thank you!
Let me check once am back
Basicly If U Spawn AI with the Spawn AI Module and sync the Module to a sector tactic Module, the ai that spawns will Go and capture sectors (other modules), but for some reason it doesnt Work If i Spawn the Units myself and try to Add the sync via Script
Sure, ty for trying
Im at Work now, so i have alot of time to wait xD
Hi, so Ive tested the method you guys suggested and it works, but it wont work for this key item, Its in my inv, but it wont detect it
if ( [player, "Item_Keys", true] call BIS_fnc_hasItem) then{ hint"OOOOGA"; }else{ hint"Missing Key" }
Can it only detect certain inv items?
Are you sure "Item_Keys" is the classname?
Yeap
ctrl f Keys
Same classname as it has on eden
I don't think inventory item class == vehicle class
Make sure to check items player to fetch the correct class
You don't need the true, that's if you're calling it on a vehicle and wanted to check the crew's inventories
Not sure if it's causing the issue here though
Yea, I just added it to see if anything happens
Ill give it a look
I cant seem to find items player
in the wiki
?
The command is items, it takes an object
So items player gives all the items in the player's inventory
Just to get the correct class name of Item_Keys
It weirdly just outputs first aid, nothing else
Returns an array of names of all unit's stored items, including weapons but excluding magazines (see itemsWithMagazines) and assignedItems.
https://community.bistudio.com/wiki/items
Probably because of this
Hint wont output the entire array?
Just outputs the firstAid
_itemsPlayer = items player; hint format ["Items: %1", _itemsPlayer];
Item_Keys might not be included in the items command
I went in-game to check, it's because Keys (the correct classname) is a magazine
So just use if ("Keys" in magazines player) then {...};
oh sweet
It works, thank you man!
BIS_fnc_hasItem will detect magazines (and other things), you just need the right classname. The items command specifically won't.
Btw you don't need all this for a quick check. The debug console includes a return line, which shows whatever the executed code last returns. So if you just do items player in the debug console and hit execute, the return line will show you the output. You can also copy from the return line, so it's a lot more convenient than hints for this.
Ohh, thats really nice, I completely forgot the debug console exists, thanks!
I figured hasItem just did "Item" in items object internally, good to know it checks magazines as well
Since I really don't know how it works so I ain't sure, but seems bis_fnc_moduleSpawnAISectorTactic_initGroup is a key to activate them for the module
Sounds promising! I'll Test it when i get Home. Ty for help
_init = ((_turret get3DENAttribute "init") # 0); //returns--โ "this setCaptive true; this setDamage 1"
how I can check there are ";" in the end of text or no?
_init select [count _init-1] == ";"```not tested
Not sure what is the usecase also though
it works, thank you
Is there a better way to run an !alive trigger for multiple targets, rather than just 't1 && t2 && t3...'
what's your setup?
(triggers don't die)
!alive t1 && !alive t2 etc?
I don't actually have setup ready, but a trigger to a task complete with !alive t1 && t2 && t3, to trigger the completion when all targets are destroyed
is how I would do it, was wondering if there's a better way
Not great with discord formatting, sorry
this won't work, it should be !alive t1 && !alive t2 && !alive t3
[t1, t2, t3] findIf { alive _x } == -1;
```this is what you need
ahh interesting, so [!alive (t1 && t2 && t3)] wouldn't work either?
I have very limited coding experience that I'm trying to bring here
Nope, that'd give you a syntax error
Cool, trying to get my head around Bohemia's language
Oh did the forum get added to a whitelist for the masked link regex?
nope, only moderators can do it safely
I have been referencing that, discovered it here actually ๐ thank you though!
Yeah I knew it wouldn't stop mods, was just wondering if it was changed
negative, sorry for the false hope
but this is too much of a safety issue, unfortunately
e.g google.com
Oh no I 100% get why it was changed, just thought the forums specifically would've been added to a whitelist for it
It's been a while since I've set something like it up myself, but it's not too difficult
Basically just a "block every link except for x, y, z, etc. etc."
I'd be up for that - only allow BI URLs ๐ ๐ (everywhere!)
I might have it saved somewhere, I'll do some looking around
if it's a regex don't worry, we can deal with it ๐ just need to actually do it
Nice, it's just putting *https://community.bistudio.com* in the "Allow words or phrases" section
Weird alt account name but I let my friends name it a couple years ago and stuck with it
Why is the HTML not rendering?
disableSerialization;
private _display = findDisplay 313 createDisplay "RscDisplayEmpty";
private _ctrlGroup = _display ctrlCreate ["RscControlsGroup", -1];
private _ctrlHTML = _display ctrlCreate ["RscHTML", -1, _ctrlGroup];
_ctrlGroup ctrlSetPosition [0,safeZoneY + 0.01,1,safeZoneH - 0.02];
_ctrlGroup ctrlCommit 0;
_ctrlHTML ctrlSetPosition [0,0,0.98,2];
_ctrlHTML ctrlSetBackgroundColor [0,0,0,1];
_ctrlHTML ctrlCommit 0;
_ctrlHTML htmlLoad "html/1.html"
Im using the Wiki's example as well
You are missing ; here: _ctrlHTML htmlLoad "html/1.html" Also make sure your path to html is correct there as well.
- it doesnt matter (still wont work)
_ctrlHTML htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English";
Try this
that-
<html>
<head>
<title>Arma 3</title>
</head>
<body>
<h1>INTEL</h1>
<p><b>23/08/2016</b></p>
<h2>SITREPs</h2>
<p>Visit our Dev Hub for the latest <a href="https://dev.arma3.com/sitrep">SITuation REPorts</a>.<br /></p>
<h2>Feedback</h2>
<p>You can help us by reporting issues on the <a href="http://feedback.arma3.com/">Feedback Tracker</a>.<br /></p>
</body>
</html>
huh
i'll try load this
Okay it was the pathing
confusing
Also is anyone here familiar with the ArmA 3 "BIN_fnc_gravityBurst" function? I've tried using it but asides it being undocumented, the errors simply spout undefined variable. I guess im missing some parameters.
contact dlc functions are catered for the campaign and not meant to be used outside of it
I know
I just want to know if anyone knows the params needed for it
I know I can use it with the alien drone but thats about it
I was wondering if it was possible to manually trigger this
read the function header if there is one
anyone have any help on how I can write a script that gives players access to a restricted arsenal? I'm trying to essentially have multiple boxes all of which are different restricted arsenals but I only want a specific player to be able to interact with there specific arsenal crate
Can anyone guide me on scripting a tank fully ?
the process is shorter, but i think is easyer to told you how to build a nuclear reactor to be honest lol
use the arma 3 samples, is a good way to start
iirc you can set the inventory of each box, and select to have it as arsenal from parameters
Is it possible to access a proxy LOD using a script? Trying to make a script that when you lock an enemy aircraft it spawns a little version of it in your cockpit. For performance purposes just wanted to access the firegeo or geo lod and not the res lod.
no
Is there a way to lock interaction with that box if your not a specific player?
Iโm not sure if there is an โarsenal openedโ eventhandler.
But maybe you can use removeaction to remove the interaction
Unfortunately not the solution I'm looking for but I do appreciate the help
this setvariable ["bis_fnc_arsenal_condition", {backpack player isNotEqualTo ""}]; also seems to work on my machine. Doesn't show the arsenal menu entry when player has no backpack 
in box's Init, i mean
or maybe ["AmmoboxInit", [this, false, {backpack player isNotEqualTo ""}]] call BIS_fnc_arsenal would be more proper, as it does go through the public function interface
or even if (isServer) then {["AmmoboxInit", [this, false, {backpack player isNotEqualTo ""}]] call BIS_fnc_arsenal} so it doesn't get spammed by all clients 
I really appreciate it and its deffinitly close but I think what I'm looking for is something similar to that but instead of it checking by backpack there is just something that disables the interaction pop up all together if you dont have a matching variable name
{vehicleVarName player in ["varName1", "varName2", "varName3"]} then. Any code that returns true/false should work
I'm not sure what you exactly mean? I'm quite novice when it comes to scripting apologies
I think there is. In scripted eventhandler.
Like bis fnc addscriptedeventhandler
this setvariable ["bis_fnc_arsenal_condition", {CODE HERE}];. For example: this setvariable ["bis_fnc_arsenal_condition", {vehicleVarName player in ["varName1", "varName2", "varName3"]}]; 
Hi, is there a way I can make AI target player civilians? If they target all civilians thats fine, whatever is easiest to implement
Id like to avoid adding the civs to a group since they will all be in specific squads
I dont think you can make AI to attack civilian side. The only way i see it you could force those civilians to join a side. Example code:
private _allAiUnits = allUnits - allPlayers;
private _aiCivilian = _allAiUnits select {alive _x AND side _x isEqualTo civilian};
private _grp = createGroup east; //west, resistance, east, civilian
{
_x joinSilent _grp;
}foreach _aiCivilian;
They would still remain within their civ slot and squad though right?
Well in this code i just put all civilians in 1 group. and what do you mean by civ slots. If you mean by they will be visible in lobby then no they wont be visible in lobby as civilians.
Could I instead have a trigger that puts all the players inside that trigger within an array and make all the AI then target all the players within the array?
you can _civ addRating -1000 to make everyone target that civilian, or make it join an enemy group
or have it as an enemy already that is setCaptive to hide his enmity
Ive tried the addRating but nothing happens
something went wrong then, because it does work
Im sorry Im still not understanding why there is code in reference to a vehicle?
So, when it does work. All units will target these civs with the bad rating?
Anyways, I put a civs rating to -2000 no FIA are shooting him
CivTest = createGroup civilian; _unitciv = CivTest createUnit ["C_Man_casual_8_F", [12279.812, 8908.474, 0], [], 0, "CAN_COLLIDE"]; _unitciv addRating -2000;
anyone know?
Did you check what the default rating is?
Id assume it was 0, anyways I changed it to -5000 instead and it worked.
Do you have any tips on detecting which units are played by players?
isPlayer?
Anyway to do it without going through a loop?
Describe exactly what you want to do.
So, using this addRating. I want the FIA to shoot all player civilians (there only are player civilians) on sight. There may be many players, up to 100. So I want to make sure it wont kill performance
All players are civilians?
yea
Are all civilians also players?
Well, some are opfor, and others bluefor, but FIA will just be set to hostila so this wont matter for them
There wont be any AI civilians, only players
Rating matters if there are also AIs on the player's sides.
whatever. There's always a loop anyway, so there's no superfast way to do this.
vehicleVarName gives the variable name (in Eden) of an object
"Vehicle" doesn't mean a vehicle like how you might think of it, like a car; or a plane; etc. it just means an Arma object.
Like you can't do the setRating without a loop.
Ah, I see
And, addRating only works for the name of the unit right? Like I cant use it for players specifically, but I have to reference the unit they are playing
So, instead of _unitCiv addRating, can I do player?
For example, it will change the rating of all players that enter a trigger zone
Well, addRating is also local argument so unless your trigger statements are globally added then you'd need to remoteExec.
hmm
Well, Id only want to change the rating of players within the zone, so wouldnt that technically work as local?
Or, is it because Im applying a change to a player that isnt me, I always have to do remoteExec?
No, everything through SQF
So where is setTriggerStatements executed?
In sqf like this LOC1_trigger setTriggerStatements ["this", "execVM 'Warzone Locations\loc1.sqf'", "execVM 'Warzone Locations\locDespawn.sqf'; LOC_tracker = 1;"];
works like a charm
I mean on which machine?
It would be in a SQF that gets ran when the mission file boots up?
I didint set if its specifically server side, or not. Im not very knowledgeable on that side of things yet, as you can tell
Ok, so for multiplayer you need to understand where your code is running.
Until you can answer that question you're just trying to run before you can walk.
Is there a specific wiki section that talks about this?
So... I added this to my mission and hosted a server. My buddy hopped on, and while I (the server) was able to see the action, he was not. For reference, the mission is structured like this:
initServer.sqf:
execVM "init_villages.sqf";
init_villages.sqf (among other things):
_e = _grp createUnit[_elder,_village,[],0,"FORM"];
_actParams = ["Talk", "talk_to_elder.sqf"];
[_e, _actParams] remoteExec ["addAction", 0, true];
_grp setBehaviour "CARELESS";```
This leads me to believe that only the server is executing the addAction, which seems impossible based on the syntax...
thanks!
meh ... anybody knows the function name which types text letter by letter in the bottom right corner out of his head?
i cannot find it right now or i am too lazy to use it currenlty
found it
BIS_fnc_infoText
yes i was too lazy to find it ...
What's the event that's triggered when hitting a surface?
Switching a bunch of hit effects out and trying to figure out why some aren't appearing
Nevermind, forgot to actually put it in a HitEffects class
Is there a way to disable/deactivate an sqf for a player via a trigger
what do you mean by that?
toggling a boolean basically I'm very new to this
I am working on a jetpack script.
I want to mitigate damage from falling while using a jetpack and I want to be able to use it with ace's medical system.
I was able to achieve the desired results by modifying The damage handler SQF file inside of aces medical engine PBO. But now I need to figure out how to make it work without messing with the stuff contained within the Ace mod.
The plan was to make their mod a dependency, and use the modified damage handler script in place of ace's
But I cannot figure out how to swap in my code from outside of ACE without breaking it. Can anyone provide guidance on this?
You can use #include "path\to\script.sqf" in sqf files, you could just include the entire script but that may or may not work for your specific use case.
You could also just toggle allowDamage on a given unit if it matches a condition
I only want to mitigate fall damage while the jetpack is active. the unit should not be invulnerable from other damage sources.
Is it just to prevent damage when touching the ground?
You could wait until ACE installs its damage handler, then remove it and add your own. Then call ACE's damage handler from there once you've filtered out the fall damage.
Fiddly but HandleDamage is always a pain in the arse.
If it's just to prevent fall damage, you could just disable damage when a unit is almost touching the ground, and then re-enable it once back on the ground
That is what I am attempting and failing to do.
That's how I originally planned on doing it when I made my own jetpacks (because I was bored), but then decided to tell people to just get good and not try to land at 40 km/h
Maybe easier to actively slow them down when they're heading towards the ground?
also would make more sense.
just a bit of physics in an eachFrame
Found some old mocked up code
_renderedPos = getPosVisual player; // Returns positionAGLS in render time scope
if (_renderedPos select 2 < 0.2) then
{
player allowDamage false;
};
I like this Idea but I'm not sure how I would acomplish it In an Ideal world I would have the skill to waste some of their fuel, insert an animation right before they hit the ground, slow thier velocity to near nil and make it work when they are landing on buildings.
is there a way I could ID the ace HandleDamage event handler and replace it without removeing All Event Handlers?
It should be the last one. Otherwise it wouldn't work :P
Hence you shouldn't even need to remove it. You can just add another one.
I will review my code with that in mind.
Sorry, I'm having a bit of a hard time with this still.
Would I insert it in the cfgPatches or the cfg FactionClasses
{
class KRAFF_Kenya_Republican_Air_Force
{
units[]={"KRAFF_Helo_Pilot","KRAFF_Fixed_Wing_Pilot","KRAFF_AH_6M_Little_Bird","KRAFF_MH_6M_Little_Bird","KRAFF_Mi_48_Kajman","KRAFF_Ka_60_Kasatka","KRAFF_Ka_60_Kasatka_Unarmed","KRAFF_Y_32_XianInfantryTransport","KRAFF_Yak_130","KRAFF_To_201_Shikra"};
weapons[]={"KRAFF_hgun_P07_blk_F"};
requiredVersion=0.1;
requiredAddons[]={"ace_captives","ace_hearing","ace_trenches","ace_attach","ace_flashlights","ace_maptools","ace_microdagr","cTab","A3_Weapons_F","rhsusf_c_commskit","ace_vector","A3_Weapons_F_Exp","A3_Characters_F_Exp_Civil","rhsusf_c_troops"};
};
};
class cfgFactionClasses
{
class KRAFF_Kenya_Republican_Air_Force
{
icon="";
displayName="Kenya Republican Air Force";
side=2;
priority=1;
};
};```
Neither, you would put it in the unit(s) of that faction.
So, would I put, for example
[ , "111thID"] call BIS_fnc_setUnitInsignia;
Under Items[]= in this?
{
faction="KRAFF_Kenya_Republican_Air_Force";
side=2;
displayName="Fixed Wing Pilot";
uniformClass="acp_US_M81_U_O_PilotCoveralls_US_M81";
weapons[]={"ACE_Vector","KRAFF_hgun_P07_blk_F","Put","Throw"};
respawnWeapons[]={"ACE_Vector","KRAFF_hgun_P07_blk_F","Put","Throw"};
items[]=
***HERE***
{"ACE_CableTie","ACE_CableTie","ACE_CableTie","ACE_CableTie","ACE_CableTie","ACE_EarPlugs","ACE_EarPlugs","ACE_EarPlugs","ACE_EntrenchingTool","ACE_IR_Strobe_Item","ACE_IR_Strobe_Item","ACE_IR_Strobe_Item","ACE_Flashlight_XL50","ACE_MapTools","ACE_microDAGR","ItemAndroid","ItemcTabHCam"};
respawnItems[]={"ACE_CableTie","ACE_CableTie","ACE_CableTie","ACE_CableTie","ACE_CableTie","ACE_EarPlugs","ACE_EarPlugs","ACE_EarPlugs","ACE_EntrenchingTool","ACE_IR_Strobe_Item","ACE_IR_Strobe_Item","ACE_IR_Strobe_Item","ACE_Flashlight_XL50","ACE_MapTools","ACE_microDAGR","ItemAndroid","ItemcTabHCam"};
magazines[]={"SmokeShell","SmokeShell","SmokeShell","SmokeShell","SmokeShellBlue","SmokeShellBlue","SmokeShellRed","SmokeShellRed","rhs_mag_mk84","rhs_mag_mk84","rhs_mag_mk84","MiniGrenade","MiniGrenade","MiniGrenade"};
respawnMagazines[]={"SmokeShell","SmokeShell","SmokeShell","SmokeShell","SmokeShellBlue","SmokeShellBlue","SmokeShellRed","SmokeShellRed","rhs_mag_mk84","rhs_mag_mk84","rhs_mag_mk84","MiniGrenade","MiniGrenade","MiniGrenade"};
linkedItems[]={"ItemMap","ItemCompass","ItemWatch","rhsusf_radio_anprc152","ItemGPS","ACE_Vector","RHS_jetpilot_usaf","acp_US_Tigerstripe_V_TacChestrig_US_Tigerstripe_F","acp_Solid_Black_G_Balaclava_TI_Solid_Black_F"};
respawnLinkedItems[]={"ItemMap","ItemCompass","ItemWatch","rhsusf_radio_anprc152","ItemGPS","ACE_Vector","RHS_jetpilot_usaf","acp_US_Tigerstripe_V_TacChestrig_US_Tigerstripe_F","acp_Solid_Black_G_Balaclava_TI_Solid_Black_F"};
backpack="KRAFF_Fixed_Wing_Pilot_pack";
class EventHandlers {init = "";}; ```
It'd go in the init Event Handler
So:
class C_Man_casual_1_F;
class C_Man_casual_1_F_afro: C_Man_casual_1_F
{
class EventHandlers; // Make sure you don't lose any other event handlers, like CBA's extended event handlers
};
class KRAFF_Fixed_Wing_Pilot: C_Man_casual_1_F_afro
{
...
class EventHandlers: EventHandlers
{
init = "[_this#0, '111thID'] call BIS_fnc_setUnitInsignia;";
};
};
Ohhhh, is this how I can set custom skins for the vehicles too?
You could just change those with hiddenSelectionsTextures
So that they spawn in that way?
Or if you want multiple skins on a vehicle, TextureSources
Yes, hiddenSelectionsTextures are what textures are on the vehicle, object, etc.
Excellet tysm
Ok this might be an easy one. Hemtt seems to not want to build any mod that makes reference to a mod not in the build. Is this how it is meant to be, or is their a way to build your mod with the dependancies?
I'd assume that's intentional, since you (or likely ACE in your specific case) is trying to include a file that it uses, and if you don't have that file, you will crash
There's a hemtt specific channel in the ace discord as well, they could probably help you better
Thanks I'll check there. Seems like there would need to be a way around it.
If anyone's curious I found my issue and that it was I started over on the code and forgot to replace the pointers to my own script
private _commands = supportInfo "" apply {_x regexFind [".\b([_a-z0-9]+).*/"]} select {count _x >= 0 && {count(_x select 0) > 1}} apply {_x select 0 select 1 select 0};
private _unique = _commands arrayIntersect _commands apply {supportInfo ("i:"+_x) select 0 select 2};
_unique sort true;
_unique;
Here is a snippet to return all cased scripting commands in the game (excluding operators), in case somebody might find it useful.
Maybe worth putting it to supportInfo wiki page comments
If I want to remove a certain magazine from the inventory with lets say a ammo count of 15, but I have other magazines that have the same name but a different ammo count. How do I target only the mag with 15 bullets left? I tried getting the magazines via "magazinesAmmo" and then sorting out all other mags & not matching ammo count types. but when I call removeItem it needs a string and does not accept a array or number. But if I just call it with the string the fnc removes the first mag from that class (string name) from inv. regardless of the ammo count. So is there any way to do what I want to?
vestcontainer player addMagazineAmmoCargo ["30Rnd_65x39_caseless_mag", -1, 29]; with the proper container selected works on my machine
with -1 to delete one mag and 29 being the ammo count in said mag
magazinesAmmoFull player kinda returns where the magazines are stored (in form of "Vest"/"Uniform"/"Backpack" in ["30Rnd_65x39_caseless_mag",28,false,-1,"Vest",1e+007,0])
or magazinesAmmoCargo vestContainer player over the player's uniformContainer/vestContainer/backpackContainer can be used instead to find where the specific mag can be found
or some derpy getUnitLoadout/setUnitLoadout combo that breaks stuff just enough for the target magazine to disappear
Thanks, I'll try that.
Hi guys. Quick question how would i detect is object on the side or on upside down.
I have this for upside down, but how would i check is the object up right:
(vectorUp cursorTarget) select 2 < 0}
Just to clarify, up right, as the opposite from upside down?
So yes. Basicly i want to check is supplie crate up right if not add the addaction to flip it up right.
Then just > instead of <?
No i am aweer of how to flip the crate but i am asking how to detect if the crate is sideways or up side down or any rotation that is not up right
_unit addAction [
"<t size='1.2'>Flip Crate</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _veh = nearestObjects [_caller, ["ReammoBox_F"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];
_caller playActionNow 'Medic';
titleText ["<t color='#FFFFFF' size='1'font='PuristaBold'>Flipping Crate</t>", "PLAIN DOWN", -1, true, true];
},
[],
0,
false,
true,
"",
"{(count nearestObjects [_target, ['ReammoBox_F'], 5]) > 0 && {(vectorUp cursorTarget) select 2 < 0}}"
];
``` This is what i have so far.
Not 100% sure what is the question. In this picture, left to right 1, 2, 3, portraited by poor soldiers instead of supply box. Which is the โnot up rightโ you mean?
solider 2 and 3 are not up right.
Then you can simply do sqf (vectorUp cursorObject)#2 < cos 45
Thank you very much.
- Why do you use nearestObjects? You just need cursorObject
- Your action condition is wrapped in {} and won't work
- I am using NearestObjects for the radius. I want to give player addaction only when he aproches the crate that is 5 m away from him.
- True.
why even add it to the player and not the crate? Is rearming when looking away from the crate that critical? Or are the crates freely creatable form unchecked places?
I guess its not nessery becouse you still need to look at the crate to flip it.
Or are the crates freely creatable form unchecked places?
I just dont understand what you mean by this.
It is easy to add addAction into crates, not the player
Yea but i am adding this to warlords scenario.
- I dont know how to add scripted stuff in request menu. if there is a way pls tell me.
- These crates are dynamicly spawned. So i dont need a loop that adds the addaction to a crate that is spawned dynamicly or EH when crates get crated.
There is an EH to detect if something has spawned
I have the following script that spawns patrolling helicopter. It spawns at the player location. I would like to spawn it at predefined coordinates. What should I change within the script?
private _vehicle = createVehicle ["B_Heli_Light_01_F",player getPos[ 100, getDir player ],[],0,"FLY"];
private _grp = createVehicleCrew _vehicle;
[_grp,getPos leader _grp,1000] call BIS_fnc_taskPatrol;
- Put a invisible helipad in eden editor and give it variable name like pos1
- Here is a code for that:
private _vehicle = createVehicle ["B_Heli_Light_01_F",getposASL pos1,[],0,"FLY"];
private _grp = createVehicleCrew _vehicle;
[_grp,getPos leader _grp,1000] call BIS_fnc_taskPatrol;
Thank you very much
first time working with eventhandlers
trying to make a zen module that triggers when opening a container but for some reason it won't work
[
"[- PACIFIC -]",
"- Boobytrap (Inventory)",
{
params [["_position", [0,0,0], [[]], 3], ["_attachedObject", objNull, [objNull]]];
_attachedObject addEventHandler ["InventoryOpened", {
_attachedObject removeAllEventHandlers "InventoryOpened";
_nade = "fow_e_type97" createVehicle position _attachedObject;
["Inventory opened!"] remoteExec ["hint"];
true;
}];
}
] call zen_custom_modules_fnc_register;
nor does the hint show up even though its remoteexec
just found out its done through ContainerOpened but still no success
is there any event for the end of a trigger pull versus fired? i.e weapons on burst etc
It would be something like this:
["[- PACIFIC -]", "- Boobytrap (Inventory)", {
params [["_position", [0,0,0], [[]], 3], ["_attachedObject", objNull, [objNull]]];
if (isNull _attachedObject) exitWith {
hintSilent "Add to object";
};
_attachedObject addEventHandler ["ContainerOpened", {
params ["_container", "_unit"];
["Inventory opened!"] remoteExec ["hint",0];
}];
}] call zen_custom_modules_fnc_register;
ill check now
strangely enough no hints at all again
[
"[- PACIFIC -]",
"- Boobytrap (Inventory)",
{
params [["_position", [0,0,0], [[]], 3], ["_attachedObject", objNull, [objNull]]];
_attachedObject addEventHandler ["ContainerOpened", {
params ["_container"];
if (_container getVariable ["ROM_searched", false]) then
{
// spawn grenade
getPosATL _container createVehicle "fow_e_type97";
};
_container setVariable ["ROM_searched", true, true]; // tells all machines
_container removeEventHandler _thisEventHandler;
}];
}
] call zen_custom_modules_fnc_register;
before i tried yours i went back in chat history and found lou montanas version which i implemented
also didnt work
Crazy idea, what if there was a way to change mission name with a scripting command? This way you could display mission progression or details in the mission name itself so people see what they join without having to load into the game.
Perhaps limit it by a regular expression defined in description.ext so cheaters can't set server name to naughty stuff
Anyone would find this useful? (Yeah, its a fluff feature)
yeah I would find it useful. Even the ability to change the server's name while its running would be nice.
Agreed, changing server name might be cool too
Like in your instance, you could use it to show the current time left in the Koth round and current AO
Yeah, I'd love to show current AO and game score
estimatedTimeLeft has limitations indeed
Also some other options like (no jets, no tanks) etc. shown dynamically depending on actual settings
yeah he would need something he could throw a var into
this would be useful if you developed some sort of voting system to dynamically choose restrictions for the next round
You could then reduce the # of servers and have the games build themselves based on the clients
I just tested this on my end and its working:
["[- PACIFIC -]", "- Boobytrap (Inventory)", {
params [["_pos",[0,0,0]],["_object",objNull]];
if (isNull _object) exitWith {
hintSilent "Add this to object.";
};
_object addEventHandler ["ContainerOpened", {
params ["_container", "_unit"];
private _granade = createVehicle ["GrenadeHand",getposASL _container,[],0,"None"];
_container removeEventHandler [_thisEvent, _thisEventHandler];
}];
}] call zen_custom_modules_fnc_register;
Yeah that's one of the ideas, to let people vote on game rules too. Not sure how good of an idea it is to give players more choice, but being able to reflect game info in mission name sounds useful, so you can see it right in the server browser.
you just have to think of a clever way to prevent the same things voted on every time. ensure the same settings don't get played over and over again. possibly a veto system like halo 2.
interesting
ill try now too
did you test it out on a corpse?
no on a crate.
because my corpse isnt blowing up
ohhh
alright it does work on a crate but not on a corpse
which is what i tried doing
@fleet sand sry, I'm new and dunno how to help you there, but just wanted to ask. You're making a warlords mission? You were able to add a scripted entry to the request menu?
Yea i manage to create a scripted vehicle but its affected everyvehicle. but seeing its only gonna be spawn via zeus or via request menu i am fine with that.
you can do it with:
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
if(_entity isKindOf "rhsusf_M1083A1P2_WD_fmtv_usarmy") then {
//your code for a vehicle.
};
}];
Oh sorry, I mean were you able to add like another option on the request menu?
I disabled the request menu on my mission using this cuz I couldn't figure it out
how do u show ur script like that in the small box
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
ooh
credits to POLPOX for this btw:
systemChat "The request menu is disabled in this server.";
systemChat "Visit your HQ for gear and supports.";
uiNamespace setVariable ["BIS_WL_purchaseMenuDiscovered", TRUE];
addMissionEventHandler ["Draw3D",{BIS_gearKeyPressed = true}];
but were you able to like add the flip cargo box thing to request menu or something? Just wondering if you can add stuff to that cuz I know you can just change the vehicle classes and stuff but not sure how to add new entries and stuff
You cant change classes while editing mission you can only do that as a mod.
I did add flip cargo box to player, aperently its better to add it to a box it self then player ( i see why.) , and no i didnt add that to request menu.
There has to be a way to add via script its not just documented.
Yeah not much documentation on it
And reading the scripts in the addons folder is hard for me since i dont really have any coding background haha
For dead bodies you should use something like this:
["[- PACIFIC -]", "- Boobytrap (Deadbody)", {
params [["_pos",[0,0,0]],["_object",objNull]];
private _holders = nearestObjects [_pos,["WeaponHolderSimulated","GroundWeaponHolder","Default"],5];
{
_x addEventHandler ["ContainerOpened", {
params ["_container", "_unit"];
private _granade = createVehicle ["GrenadeHand",getposASL _container,[],0,"None"];
_container removeEventHandler [_thisEvent, _thisEventHandler];
}];
}foreach _holders;
}] call zen_custom_modules_fnc_register;
btw, I would add some counter play to that. if every time you try to loot an enemy corpse they explode, that probably would be very frustraiting
This code adds zeus module vie ZEN mod. And zeus can put a module close / on top of a body and it will add a granade on every body that is in 5 m of a place where zeus put a module.
Granade will spawn only when player opens inventory to loot a body / interacts with Ground holder then it will spawn granade. The explosion isnt instant you have same amount time as if you are throwing granade.
For some odd reason, when me (as a Zeus) spawn an artillery piece with crew, then spawn an MLRS piece with crew, and group the MLRS to the artillery group, using assignedVehicles _artilleryGroup; only returns the artillery piece, not the artillery + mlrs, why is that?
this one doesnt seem to work for some reason
tried placing on and next to a body
Seems like expected behaviour to me?
If you want to add the other group's vehicles then you can do that.
I thought assigned vehicle meant a vehicle the group uses currently
assigned vehicle means assigned vehicle :P
You can have units assigned to a vehicle without adding it to their group.
Assigning vehicles to a group only affects their decisions about what to do when not in a vehicle, as far as I know.
Makes sense lol
Hello everyone!
I am trying to make a module with an area sector similar to the vanilla Hide terrain Objects where the size can be edited and will show in editor.
I have read through the https://community.bistudio.com/wiki/Modules wiki page but I cannot find any clue there on how to do it
Anyone got any leads / tips / instructions?
Also tried unPboing the files but unfortunately its all binary
use ArmAUnbin
I wonder if there are downsides but I can't think of any. But like only the displayed name in serverlist/steam
Scripts/extensions use Servername for validation.
If we could do the one in serverlist only, maybe. But don't like that.
Thanks man! That is what I needed!
How reliable can BIS_fnc_unitCapture be in MP environment? I've heard that it can be pretty jittery for people outside of the "captured" vehicle but it should be fine for the ones inside.
And are there any best practices when it comes to using it - where it should be executed, what FPS count.
Hey, I wanted to ask. What would be a easy way to spawn combat troops inside a heli. They will later be unloaded?
@ebon wing Spawn them wherever and use moveInCargo
oooooh! Thats awesome thank you
Is there any way I can do it this way? _heliInfUnits apply {moveInCargo _heli}; heliInfUnits is an array but keeps giving me a missing ; error
{_x moveInCargo _heli} forEach _heliInfUnits;
Actually just tried that, but even without a loop no troops enter the heli
I tried it with a single soldier, no sauce, no error too
May be my troops arent spawning
Is there a better way to check if a object has inventory then canAdd ?
https://community.bistudio.com/wiki/canAdd
I think i found it its maxLoad command.
There's probably a config method but I never found it.
maxLoad should be fine though.
Im trying to get a heli to do a TR UNLOAD, but it isnt working. I read the inf squad needs a set leader. Ive tried using setLeader but it keeps giving me errors, anyone know
The TR UNLOAD waypoint just keeps getting deleted on its own once the heli gets close enough
I set a leader using selectLeader, no errors, but the heli still buggs out and just deletes the waypoint
I noticed that my pilots are in their own squad as opposed to a heli spawned in via zeus, could it be that?
For TR UNLOAD you want a separate pilot and passenger/cargo group.
You give the pilot group the TR UNLOAD waypoint, and then they should land nearby and unload the cargo group.
Doesn't technically need a landing pad but if you create an invisible one then they'll likely use it.
What is the main difference between CfgSounds and CfgSFX?
CfgSounds is for specific individual sounds for use with e.g. playSound.
CfgSFX is for randomised sound groups for use with e.g. https://community.bistudio.com/wiki/createSoundSource
So, I have to give the waypoint to the one unit pilot I create, not the heli object?
You give the waypoint to the pilot group.
In the Virtual Arsenal, do the VR vehicles handle damage via a script to change the color of the section that was hit?
It's possible that the waypoint routine failed to find a landing position in the area.
although they're not that picky IME
hmm, it is flat land. I switched to the correct group trying now
It works! I was fucking with this for the past 4 hours lmfao
When setting waypoints for a group that is inside a vehicle, is there anything extra I gotta do. Once my AI squads jumps out the heli the waypoint doesnt exist
I forget how that works for helis.
For ground vehicles you can just give them a single move waypoint and they'll follow it once they leave.
IIRC this was unreliable with paratroops.
Yeah, They hop out but no waypoint. Should I try a event handler, and give them the waypoint once they all hop out?
Safer way for helis might be to add the cargo move waypoint with setWaypointStatements on the pilot group.
Ohh
The latter probably, except it's tricky with group vs unit.
Like the group leader might die before landing.
There's also waypoint synchronization but I'm not sure that's documented anywhere.
Wouldnt he get reassigned?
new GL
He would, but the event handler would still be on his corpse.
Could I set an event handler on the heli landing instead?
That will then give the group the waypoint
I don't think there is one.
I saw one for landing gear
LandedTouchDown is only for planes.
To what?
What event handler are we talking about?
gear
Helis don't all have gear.
In fact most of them don't, otherwise more of them would be crashing in Antistasi :P
fair enough then.
Should work right?
Yah, its not great lmao
So, this fires a waypoint for group X once Group Y reaches its waypoint?
I think it just prevents them from completing unless both conditions are fulfilled.
So you put a TR UNLOAD waypoint on the pilot group, a GET OUT on the passenger group, and then synchronize them.
Then have a move waypoint after that on the passenger group.
It can't progress from the GET OUT waypoint until the units are out of the vehicle, and therefore the MOVE waypoint should be preserved.
Assumption is that the MOVE waypoint is vanishing because it can't generate a path to it while airborne.
Ill give it a shot, also it wont let me sleep in the event handler ;(
I see
[Location1Pilots, 2] synchronizeWaypoint [[Location1ReinFINF, 3]]; Do you know what the numbers are, is that like the waypoint number or somethin?
The documentation is shite you were right
Holy shit it worked
I dont undertand how
but it worked
You are a goddamn hero @granite sky
waypoints are just [group, index]
I just left it at 2 and 3, still works
quick video showing an ai squad load in, fly, disembark on an ai heli https://www.youtube.com/watch?v=3EMHgQSTkvA
Which file formats can I use for sounds and effects?
.wav, .ogg, and .wss are the most common ones
Use .wav/.ogg for music, and .wss for other sound effects (gunshots, beeps, clicking noises, etc.)
waitUntil {!(isNull OTeamleader1)};
``` What did I get wrong here? `OTeamleader1` is a playable unit placed in the editor (and included in mission.sqm). It complains about the variable being undefined with and without the `waitUntil`
Identifiers must not start with a number (e.g "9myVariable" is invalid).
It starts with O (the letter)
Shows on phone 0, not O
Yeah, the font is weird ๐
Maybe you could check with isNil your variable.
if (isNil "OTeamleader1") then {
systemChat "teamleader O do not exists";
};
I bet it's trying to check a variable that is not defined so it doesn't get that with isNull.
Tried that too just a moment ago actually, then it complains about the Type Object, expected String,code ๐
...wait, I might have forgot the quotes. Lemme try again
Yup, still the same error
The problem with playable units is, if you don't have AI enabled, they just don't spawn.
Then they won't be null objects but undefined variables...
Actually thinking about that.. why don't we just fix that? We can just initialize all unit variables as objNull even if they didn't spawn, that would make alot of mission scripting and subtle bugs alot easier ๐ค
Show new code ๐ซ
While we're in wish mode, I wish that playable units kept their synchronization to modules/objects. Currently they lose it on respawn / player switching slots on mp since it's a new unit
Too hard to do
I figured but I can dream ๐ฅน
Trying to set unit variables at mission start that persist without relying on unit init fields
That would have saved me quite some headaches
but that also would introduce a whole new category of subtle bugs in already-published missions 
I'm all for the fire
See #arma3_editor
waitUntil {!(isNil "OTeamleader1")};
``` --> `Error isNil: Type Object, expected String,code`
That can't be your code
A string doesn't become an object
your code is something else, probably that without the quotes
Maybe you are running a old version of the mission
I connected to actual server running the old code instead of dev... ๐
Maybe I should turn the main server off while developing
I had that same problem so I removed the password from my local dev server.
Maybe just give it different name or password ๐
Yeah ๐
Does user action EH run where I add it, or always on the machine which controls the character? Documentation says it's local.
I assume you mean addAction command?
That runs on the machine that activated the action
Yes. Even if I add it on one client, and the player possessing the character is on another client?
you can't do that
Actions are only shown locally on the machine where the addAction was executed
how do you add an action to another client? remoteExec? where do you run that script
In case you did mean a user action EH, those are similar to mission EHs; they are attached to the mission/UI, not to a particular character or object, and will only activate for actions committed on the client where they were added.
Q: about canAdd, how do I gauge whether I can add a full weapon group to an object inventory? i.e. the base platform and all of its accessories, magazines...
_object canAdd [_class, "...", "...", "...", [], [], "..."];
https://community.bistudio.com/wiki/canAdd
Corollary to that is assessing whether canAdd an accessory to a weapon group after the base platform has already been added? Is asking _object canAdd _itemClass sufficient, only that will end up being, [_class, _itemClass, "...", "...", [], [], "..."], for instance? along similar lines, magazines, _object canAdd _magazineClass, i.e. [_class, "...", "...", "...", [_magazineClass, _rounds], [], "..."].
also assuming for the moment all the appropriate compatibility questions have already been answered.
Hi, I've made a script that allows through an hold interaction to make an ammo crate visible/non visible. It's basically like that:
Dig up interaction -> stash_1 hideObjectGlobal false; add bury interaction
Bury interaction -> stash_1 hideObjectGlobal true; add dig up interaction
it works single player but I have a lot of misbehaviours in multiplayer
please use https://sqfbin.com
That site isn't working to me
I think the site is currently down
oh, it is down indeed. https://pastebin.com it is
I've encountered such a problem. I have the respawn option at base (3) enabled. When a player dies, the onPlayerKilled.sqf script transfers the player to another bot using the selectPlayer command until the respawn timer runs out. However, when the respawn timer expires, the player starts controlling the respawned body, and the onPlayerRespawn.sqf file is triggered. But after the next death, the onPlayerKilled.sqf script no longer triggers.
How to make a task which is placed in the editor as a CreateTask entity appear only once the prior task is completed?
It's a bit confusional cause it's recursive but I think the problem is in the hideobject function
i tried both hideobject and hideobjectglobal, with similar issues
hideObjectGlobal must be executed on the server, so you probably aren't using it via remoteExec. See Example 3 on biki page
Hey, anyone know why this wouldnt work?
_awpp2 setWaypointStatements ["true","deleteVehicleCrew _heli2A; deleteVehicle _heli2A"];
Nothing happens, the vehicle just stays the same hovering
what are _awpp2 and _heli2A, my guess is you have some scope issues there. remember, the WP statements run, the scope that installed them will have vanished by that point.
awpp2 is the waypoint and _heli2A is the heli
so its just [stash_1, true] remoteExec ["hideObjectGlobal"]; instead of stash_1 hideObjectGlobal = true; right?
I'm not familiar with that syntax
[stash_1, true] remoteExec ["hideObjectGlobal", 2];
what's the 2 for?
You need to 2 so that it runs on the server only.
_heli2A not at the time the statement is being run, that's my point. is probably nil, can test for that simply with in the statement if you like , systemChat isNil '_heli2A'.
good luck, good hunting!
Got it, thanks!
In this case it'd probably work without it (because the command doesn't do anything except on the server) but it's spamming unnecessary remoteExecs.
But, why would it be nil. I created the variable, the heli still exists
Ill run that command
outputs true tf
Variables starting with an underscore only exist in the current context.
because the scope is no longer there at the time the statement runs.
https://community.bistudio.com/wiki/setWaypointStatements
How to make a task which is placed in
I see, so I should make it global then?
and so I understand setStatements, is in its own scope?
yes.
but you can leverage things about the the group leader, group, etc... maybe vehicle this, whatever... that is available to you.
scope in general, EH code, whatever, we had that discussion the other day IIRC. same principle guidance here.
Unless you're writing quick & dirty stuff you should probably do something like storing the vehicle with setVariable on the group.
never heard of setVariable gonna check it out on the wiki, thanks!
pretty sure I left you with this, maybe was lost in the noise, consider it required reading...
https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
Yeah, well Im not reading all of it at once. Im going through them as I encounter them
If you can guarantee that the group leader is still in the vehicle when the setWaypointStatements fires then vehicle this is fine.
i discovered about recompile = 1; today in cfgfunctions after about a month of doing ace function overwrites 
well, not like you read the encylopedia all at once. it is there as a topical reference.
Might not, he may be dead and in that case I need to despawn the dead heli
dead and in the vehicle works. But if you're throwing the body out then maybe now.
Yeah, I always have 20 tabs with the wiki open now
The setVariable/getVariable is safer anyway.
I see, thats fine then awesome!
you should see my browsers... ๐
Note that setWaypointStatements fires the code on every machine, so be careful what you put in there.
Often you want if (!local this) exitWith {}; at the start.
also good to know, can deal with that simple with isServer, but again, reference commands.
or that would work too...
Im only using it to manage AI, would going overboard with the setWpStatements cause some server lag?
Like adding a lot of them
It's probably not an ideal command but it's convenient.
I use the same to knock down resource crate values. very specific, targeted to a specific set of use cases.
The group waypointChanged EH only fires on the machine it's installed on if you're thinking long term.
lot of chatter understandably so... am I on the right track here? seems like I need to stage different phases adding weapons, accessories, etc, each by class, not the whole group.
That sounds useful, ill keep that in mind as well thank you!
Does seek and destroy stop after a while when no targets can be found, or does it continiously look for enemies around the waypoint?
If I wanted a sound to play on all clients on a position, would I use remoteExec on init.sqf?
or should I do it per client in localPlayerInit.sqf?
^ Taking in account that we are talking over 20 sounds on different locations
AFAIK ambient effects, particle sources, sounds, are local client. or I would want to position them there, does not make sense to root them on server at all.
True, thank you.
It stops after a while. 5min or something like that.
Perfect, thanks!
Anyone know if there's an easy way to disable the "extreme" video settings for clients through script or do I have to make a work around?
Due to visual exploits brought about by super low render values, you can effectively delete bushes like with the old AMD drivers.
Whats the best way to spawn in custom outpost with many objects, will i have to use createVehicle or can I make a sort of predefined collection?
Will I be able to call on the composition from sqf?
Greetings folks!
I have a script that seems to work just fine, however i would like to improve it, to make it even better. Could someone assist me please? sqf //Shoot tracking dart if (isServer) then { _shootstart = AGLToASL (vehicle player modelToWorld [0,0,-0.5]); _shootend = AGLToASL (vehicle player modelToWorld [0,50,-0.5]); _copcar = vehicle player; _targetobjects = lineIntersectsObjs [_shootstart, _shootend, _copcar]; _suspectcar = _targetobjects select 0; if (_suspectcar isKindOf "LandVehicle") then { [west, "gps_dart", ["Police unit successfully attached a GPS tracking dart to someones vehicle. You can now follow the vehicle from a safe distance.", "Tracking initiated!", ""], _suspectcar, "AUTOASSIGNED", 1, true, "car", true] call BIS_fnc_taskCreate; }; }; //------------------------------- //Disconnect dart ["gps_dart","CANCELED"] call BIS_fnc_taskSetState; sleep 5; ["gps_dart", west] call BIS_fnc_deleteTask; Both of these scripts are located in the on activation fields in triggers and both triggers are set to be activated by using radio alpha/bravo commands. First thing i would like to ask about is the sleep 5; line. Although not necessary, i would like to have a 5 second delay there, but sleep can not be used in triggers. Is there any good workaround?
0 spawn {
sleep 5;
["gps_dart", west] call BIS_fnc_deleteTask;
};
what's that 0 ?
spawn needs a parameter to pass in. In this case we don't need it so we use something cheap.
[] spawn {}; also works but creating arrays is relatively expensive.
oh ok, i'll give that a try
Depends on what you wanna do. You can pre-place them and just show them via script when needed. You could also export it to sqf and execute the exported code later
Yep, ive already got it spawning in now. Its a little messy when it comes to objects inside buildings, but that can be sorted out
its much easier and quicker than I though
do you know if the first part of the script is going to happen once or on every client? I mean if one blufor uses it, will it take affect only on the vehicle in front of him or will it take effect on all vehicles that are in front of all blufor players at that time?
I don't really know because I don't use editor triggers, but I'd guess that the code there runs everywhere.
allright, so how do i ensure it tries to create just one task and not as many tasks as there are blufor players? Maybe "server only" checkbox could somehow help?
Well, you already have if (isServer) then { on the first one.
Add that to the second and you're probably good.
IIRC tasks won't duplicate if you create them with the same task ID anyway, although I'd avoid that.
no no you misunderstood, i'm talking about the first part - creating a task, it has a given task id so there will be only 1 task created afterall but if the script tries to run it for all blufor players, the task may end up being created on a wrong vehicle.
Oh yeah, actually this code is completely broken for MP.
how come?
you're using player which is only valid on clients, but it's wrapped with an isServer check.
ok i guess there is no player when the script runs only on the server then, so how do i define the player, who actually used the radio alpha command and therefore triggered the trigger?
probably just thisList#0
could you please elaborate? i don't understand
#include "function_macros.hpp"
GVAR(AWACS_Index) = 0;
createMarkerLocal[QGVAR(ownship), vehicle player];
QGVAR(ownship) setMarkerShapeLocal "ICON";
QGVAR(ownship) setMarkerTypeLocal "jmm_g_End";
QGVAR(ownship) setMarkerColorLocal "ColorGreen";
QGVAR(ownship) setMarkerDirLocal ((getDir (vehicle player) + 180) % 360);
private _fnc_tick = {
params ["_args", "_handle"];
//clean up last run's markers.
for "_loop" from 0 to GVAR(AWACS_Index) do { LOGF_1("Deleting: %1", _loop); deleteMarkerLocal format ["HOB_AWACS_T_%1", _loop ]; };
LOGF_1("Index Reseting: %1", GVAR(AWACS_Index));
GVAR(AWACS_Index) = 0;
LOGF_1("Index Reset: %1", GVAR(AWACS_Index));
private _fnc_exit =
{
params ["_handle"];
[_handle] call CBA_fnc_removePerFrameHandler;
deleteMarkerLocal QGVAR(ownship);
removeMissionEventHandler ["MapSingleClick", GVAR(BRAA_EHID)];
GVAR(Running) = false;
};
//sanity checks
if(!GVAR(Running)) exitwith { LOG("Exiting because Running = False"); [_handle] call _fnc_exit; }; //check for user turning off AWACS system.
if(!alive player) exitwith { LOG("Exiting because Player is Kill."); [_handle] call _fnc_exit; }; //makes sure player is alive
private _vehicle = vehicle player;
if(_vehicle == player) exitWith { LOG("Exiting because Vehicle is Player"); [_handle] call _fnc_exit; }; // Not in a vehicle
private _validTypes = GVAR(validTypes);
if (_validTypes findIf { _vehicle isKindOf (_x) } == -1) exitWith { LOG("Exiting because Vehicle is not Valid"); [_handle] call _fnc_exit; }; // This vehicle is not awacs capable
QGVAR(ownship) setMarkerPosLocal _vehicle;
QGVAR(ownship) setMarkerDirLocal ((getDir (_vehicle) + 180) % 360);
private _rT = nil;
_rT = getSensorTargets _vehicle;
{
_x params ["_sensorTarget", "_sensorType", "_relationship", "_sensor"];
private _name = format ["HOB_AWACS_T_%1", GVAR(AWACS_Index) ];
GVAR(AWACS_Index) = GVAR(AWACS_Index) + 1;
createMarkerLocal[_name, _sensorTarget];
_name setMarkerShapeLocal "ICON";
_name setMarkerTypeLocal "jmm_g_End";
private _displayName = getText (configFile >> "CfgVehicles" >> (typeOf (_sensorTarget)) >> "displayName");
private _altitude = floor ((getPosASL _sensorTarget)#2 / 1000); //gets Z (altitude) from object and converts to KM.
if ((speed (_sensorTarget)) < 1325) then
{
_name setMarkerTextLocal format ["%1: A%2, %3KM/H", _displayName, _altitude, floor speed (_sensorTarget)];
} else {
_mach = [(speed (_sensorTarget))/1325 , 2] call BIS_fnc_cutDecimals;
_name setMarkerTextLocal format ["%1: A%2, Mach %3", _displayName, _altitude, _mach];
};
switch (_relationship) do
{
case "friendly": { _name setMarkerColorLocal "ColorWest" };
case "unknown" : { _name setMarkerColorLocal "ColorYellow"};
case "enemy" : { _name setMarkerColorLocal "ColorEast" };
};
_name setMarkerDirLocal ((getDir (_sensorTarget) + 180) % 360);
} forEach _rT;
};
private _pfhID = [_fnc_tick, GVAR(UpdateRate)] call CBA_fnc_addPerFrameHandler;
so I wrote this script to put sensor contacts on the map of the pilot, had been working great for almost a year now, but something updated this week and now the map markers are only appearing if you go into zeus and open your map
did something change?
How can I stop music started by a trigger, and then after reaching another trigger start another track? Right now I am using fadeMusic command, but how do I stop the music completely.
I think something like this would work if you are trying to stop the music:
playMusic "";
//i dont know if you can do this with playSound3d or do you have to delete the source as well ?
playSound3D ["", _box];
//if you are using say3D then
_box say3D "myAudio.ogg";
deletevehicle _box;
Thanks. I just use some music from the list in the trigger. If I try your solution, then I will probably need to know the name of the track. Do you know where names of the official tracks?
https://community.bistudio.com/wiki/Arma_3:_CfgMusic
Here are music class names. But if you want to stop the music i think then if you just do:
playMusic "";``` It should work fine
Hey, need some help. I want to create a trigger than when a player activates it it plays a random sound from an array. I tried something like this
_sounds = ["standback.ogg","stop.ogg"];
s1 say3D _sounds call BIS_fnc_selectRandom;
also tried
s1 say3D (_sounds select floor random count _sounds)
what is the best way to go about this?
use selectRandom
say3D uses the config class of a sound defined in CfgSounds (see: https://community.bistudio.com/wiki/Description.ext#CfgSounds) not the filename
Keep in mind that say3D takes CfgSounds classes
Should just be:
s1 say3D (selectRandom _sounds);
If you want to play a sound file directly, you can use playSound3D https://community.bistudio.com/wiki/playSound3D
No _ for selectRandom
Yep, typo
What is the default music volume in settings ? 100 or 50 %? I am figuring out which volume to give to my music in game, but not sure what is the base line volume.
when you set the volume with 0 fadeMusic 0.5 you set it at 50% of the user setting, so if the user sets it to 80%, your volume will be 40%
if someone disabled music, you cannot force it to 1 with 0 fadeMusic 1 - it will actually be 100% of zero, aka 0
Is there a way to construct a Zeus game logic where it can see the side chat of a side other than Game Logic?
I tried to create a Zeus logic for a game, and switched it to BLUFOR, but it turned it into a flying, invisible target for OPFOR.
Rather, I suppose a more generic question would be can I get a unit to be able to listen to the side chat of another side?
Game is hardcoded to show\play side chat of a side that your controlled unit is in
So there is no easy solution to this. Perhaps you can temporarily switch to a dummy unit of needed side, but you won't be able to control your main character
there is a "chat message" event handler where you could trigger some broadcast from players sending the message to listeners, but that would only cover player-written messages - not AI-like chats or voice chat
Potentially profiling branch, but nothing about markers was touched
Hi how can I make this script myLight setLightDayLight true; work for all lights during day? what should I place in the mylight thing? And also how do I execute it in missions? where can I put it
myLight is your light that is spawned by a script. So your question's answer is no
oh, any idea how I can make light work during the day?
Mods
anyone in particular cant seem to find a reliable one
I don't even know there is one
yeah me to, well hey you're polpox the great mod creator ๐ ๐
Is there no EH to tell when an entity gets created in Eden? There's "OnDeleteUnits" for delete but I cant find anything about one for creation
Does the EntityCreated mission EH work?
Ah yeah I could use those too, that worked, thanks ๐
it works for most, but doesnt trigger on everything I need, it triggers for units, objects, and modules.
However It doesn't trigger for waypoints, triggers and markers (neither does the "MarkerCreated" mission EH), not sure if there is an other EH I could use for those
OnHistoryChange and OnSelectionChange trigger when manually placing, could combine them, and with all3DENEntities if necessary to detect what you need.
Yeah I'm also starting to think I'll need to make something which checks all3DENEntities against the previously known all3DENEntities when an event like OnHistoryChange triggers
I think this should work fine but it would be nice to see a Eden "EntityCreated" EH be added instead
fnc_3denEntityPlaced = {
private _3denSelected = get3DENSelected "";
if (
last_OnSelectionChange != last_OnHistoryChange // not place or delete
|| {flatten _3denSelected isEqualTo []} // empty means delete action
) exitWith {};
systemChat str (get3DENSelected "");
};
add3DENEventHandler ["OnSelectionChange", {
last_OnSelectionChange = diag_frameno;
call fnc_3denEntityPlaced;
}];
add3DENEventHandler ["OnHistoryChange", {
last_OnHistoryChange = diag_frameno;
call fnc_3denEntityPlaced;
}];
Its gonna have to use all3DENEntities as get3DENSelected cant always be used, like when holding ctrl to place multiple waypoints the selection doesn't change
Oh wow, yup. you're right.
Guys, what condition can I check if damage was done to the hit point?
addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
Does this will help me?
it does yes. but idk what exactly you want to achieve
I want that when a certain zone on a tank is hit (hitpoint), I will start an animation on the object that I attached to the tank via attachTo[]
you can try something like this:
myTank addEventHandler ["HandleDamage", {
params ["_tank", "", "_damage"];
if (_damage > 0) then {
private _attachedObjs = attachedObjects _tank;
// do whatever you want with the attached objects here
};
_damage;
}]
They wanted to have a reaction for a specific hitpoint, so they'd need to check whether _hitPoint matches the correct name as well
Hey there, is there a way to config a backpack/script it so that missiles/rockets of specific classes use up less space than they usually would?
so if i write
myTank addEventHandler ["HandleDamage", { params ["_tank", "", "_damage"]; if (_hitPoint == "hitpoint name") then { private _attachedObjs = attachedObjects _tank; // do whatever you want with the attached objects here }; _damage; }]
it will work?
i mean
seems so
myTank addEventHandler ["HandleDamage", {
params ["_vehicle", "", "_damage", "", "", "", "", "_hitPoint"];
if (_hitPoint == "hitpoint name") then
{
private _attachedObjs = attachedObjects _tank;
// stuff
};
_damage; // damage applied to this specific hitpoint
}]
fixed
Im trying to use vanilla save on the steam workshop scenario "OPEX", me and my buddy play it together but our zeus objects and AI wont save with the persistent save system the mission uses, I searched through the pbo files and found a persistent file that explains the save system, but when I delete it the mission wont work, here is the file based around the persistent save system, you guys think theres anyway to put the vanilla arma 3 save back into this mod?
Sorry thats a lot, but thats the file based on the Persistent save system, only file I found, just curious how to delete it and go back to vanilla save on OPEX
And if this is helpful, the file location to this is ""C:\Users\NAME HERE\Documents\Arma 3\ARMA PROFILE NAME HERE\mpmissions\OPEX.altis\scripts\Gemini\fnc_persistence.sqf"" and the mod link is "https://steamcommunity.com/sharedfiles/filedetails/?id=907995360"
yes just change their mass
please use sqfbin.com / pastebin.com
Thank you very much!
If i run a loop delay 1 sec that checks the value of one variable, will it consume a lot of traffic in solo arma/multiplayer arma?
And question, if I have some kind of external variable, can I stick it inside the addEventHandler, since I tried through the param, and just like that, nothing happened, it doesnโt see it.
Because I want to force the use of the variable _myArmor when receiving hitpoint damage, which is declared externally, and I cannot declare it internally a second time because it will not be seen correctly. (I called it this way _myArmor = "Armor" createVehicle position _object;) // Armor is class
is it possible to create and fade in a post process effect smoothly?
"colorCorrections" ppEffectAdjust [1,1,0,[0.1,0.2,0.3,-0.3],[1.8,1,1,0.5],[0.5,0.2,0,1]];
"colorCorrections" ppEffectCommit 0;
I guess I could loop over the values ๐
ppEffectCommit's second argument looks like duration?
oh, lemme try that
yeah, doc says so as well
oh yah, works like a charm
read more docs added to the backlog
thanks
one more thing - is setting up post process effects something I should remoteExec ๐ค ?
it should work like this:
- There's a server trigger
- A single player steps in the trigger
- The activation code (pp effect) gets excuted for all of the players
It would be sensible to put all your local ppEffects stuff in a function and remoteExec that (https://community.bistudio.com/wiki/Arma_3:_Functions_Library)
Putting it in a function as a good practice or is there more to that?
Putting it all in a function means you're only making one remoteExec broadcast, no matter how many commands are in it. This is good for network performance.
-2 alone is not recommended because it will mean the host player won't be affected in a P2P game.
0 is very slightly inefficient but fine; a dedicated server will simply ignore the PP commands since it has no display.
[0,-2] select isDedicated is the most optimal targets - in P2P it will include the host, on DS it will not.
* for this usecase. What's best may vary depending on what exactly you're remoteExecing
It's pretty simple to make it work both for DS and P2P, and making it not work in P2P could cause problems later - for example, in an Editor multiplayer test, if you decide to distribute the mission, or if you need to P2P host because the server died
Very True
Hi, Im trying to create a 2D array that will store objects like this
``KEY_Spawn_Positions [
KEY_Spawn_LOC3[
LOC3_Key1 = createVehicle ["Box_CSAT_Equip_F", [9781.915,9392.567,3.231]]; //Command Post
LOC3_Key2 = createVehicle ["Box_CSAT_Equip_F", [9762.994,9366.421]]; //Camp site
LOC3_Key3 = createVehicle ["Box_CSAT_Equip_F", [9748.597,9348.902]]; //Tent Outside
LOC3_Key4 = createVehicle ["Box_CSAT_Equip_F", [9738.28,9387.251]]; //Outside House
LOC3_Key5 = createVehicle ["Box_CSAT_Equip_F", [9724.453,9360.099]]; //Tent Inside
LOC3_Key6 = createVehicle ["Box_CSAT_Equip_F", [9731.193,9397.106,6.102]]; //2nd Floor House
];
KEY_Spawn_LOC4[];
KEY_Spawn_LOC5[];
KEY_Spawn_LOC6[];``
But, its saying im missing a semi colon on the LOC3_Key1 line, so there must be a syntax error somewhere?
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Missing =
Not only that
and ""
In the first place to declare an empty array sqf Array = [];
An not-empty arraysqf Array = [1,2,3];
Should I put each object into quotations or no?
No
Only for strings ye?
Quotations tells the game it is an String
alr
Still getting errors
//Creates a 2D array that stores all the locations a key can spawn
KEY_Spawn_Positions = [
KEY_Spawn_LOC3 =[
LOC3_Key1 = createVehicle ["Box_CSAT_Equip_F", [9781.915,9392.567,3.231]], //Command Post
LOC3_Key2 = createVehicle ["Box_CSAT_Equip_F", [9762.994,9366.421]], //Camp site
LOC3_Key3 = createVehicle ["Box_CSAT_Equip_F", [9748.597,9348.902]], //Tent Outside
LOC3_Key4 = createVehicle ["Box_CSAT_Equip_F", [9738.28,9387.251]], //Outside House
LOC3_Key5 = createVehicle ["Box_CSAT_Equip_F", [9724.453,9360.099]], //Tent Inside
LOC3_Key6 = createVehicle ["Box_CSAT_Equip_F", [9731.193,9397.106,6.102]] //2nd Floor House
];
KEY_Spawn_LOC4=[];
KEY_Spawn_LOC5=[];
KEY_Spawn_LOC6=[];
];
Still wrong
If you do want to store KEY_Soawb_LOC3 into KEY_Spawn_Positions, here is the way:sqf KEY_Spawn_Positions = [ [ createVehicle ["Box_CSAT_Equip_F", [9781.915,9392.567,3.231]] ] ];And so on
What do the added [] do? Isolate each index?
[] means a dimension of an array
Just use , to separate an element
Same thing
So, instead of making another array within SpawnKeyPos I just add the two []?
?
How do i turn this into a 2D array?
But its unnamed, so if I do ```sqf KEY_Spawn_Positions = [
LOC1 = [
createVehicle ["Box_CSAT_Equip_F", [9781.915,9392.567,3.231]]
];
];
It will work?
Right
KEY_Spawn_Positions = [
[
LOC3_Key1 = createVehicle ["Box_CSAT_Equip_F", [9781.915,9392.567,3.231]], //Command Post
LOC3_Key2 = createVehicle ["Box_CSAT_Equip_F", [9762.994,9366.421]], //Camp site
LOC3_Key3 = createVehicle ["Box_CSAT_Equip_F", [9748.597,9348.902]], //Tent Outside
LOC3_Key4 = createVehicle ["Box_CSAT_Equip_F", [9738.28,9387.251]], //Outside House
LOC3_Key5 = createVehicle ["Box_CSAT_Equip_F", [9724.453,9360.099]], //Tent Inside
LOC3_Key6 = createVehicle ["Box_CSAT_Equip_F", [9731.193,9397.106,6.102]] //2nd Floor House
]
//KEY_Spawn_LOC4=[];
//KEY_Spawn_LOC5=[];
//KEY_Spawn_LOC6=[];
];```
You cannot declare a variable inside an array using =
ohh
So, Ill just make the variables outside and assign them the indexes yes?
Or, how do I go about addressing one of the arrays inside, and then its index
That will do, but the same thing with this
array = [
[
[1,2,3,4],
[5,6,7,8]
],
[
[9,10,11,12],
[13,14,15,16]
]
];
array select 0 select 0 select 2 // 3
array#0#0#2 // 3
I see, aweosome thanks
Hi, anyone know what is the difference between addItemCargo and addItemCargoGlobal? I need to add items into a crate for players to grab
addItemCargo is local (meaning it's only added on the machine that runs it), addItemCargoGlobal is global, which means it runs on every machine
So, if I run the local one, only one player will see the item?
If you only run it on that person's machine yes, in most cases you'll want to use the global version
Well, if Im running it in a sqf file, I want everyone to access the crate and see items, its best I use global then yeah?
Yes
got it, thanks!
If you're running this from an Editor init field or init.sqf, do not use the global version; those contexts are already executed on all machines and using the global command without protection will cause duplication
Hi, Im trying to get a crate obj out of this array but it keeps giving me a zero divisor error .
Random_Location = selectRandom KEY_Spawn_Positions;
Random_Crate = floor random count Random_Location;
KEY_Spawn_Positions select Random_Location select Random_Crate addItemCargoGlobal ["Keys", 1];
so. there is no item named Keys in Arma 3
Yes there is, I spawn it in within another file too
Its classified as a magazine though
But even when I // the last line, the error persists
It's a magazine, use addMagazineCargoGlobal
What the hell is Random crate supposed to be
that line makes no sense
you already got the crate with the selectRandom
Random_Crate = selectRandom Random_Location;
I was hopping to get the number, so this just stored the crate obj into the random_crate, ill try it
why?
Random_Location = selectRandom KEY_Spawn_Positions;
Random_Crate = selectRandom Random_Location;
Random_Crate addItemCargoGlobal ["Keys", 1];
there
Seems easier to work with in case I need it in other files
Yee seems to work
How would you go about getting the index though?
Thanks!
Hello, colleagues. I need assistance. Thank you in advance.
Let me start by saying that I'm new to creating sequential scripts to trigger events. Until now, I've been making them quite simple, but I'm challenging myself to make missions more complex.
Let me explain:
At a waypoint, an AI group with 10 units should:
Supposedly, this script sets up a scenario where the units move to specific positions, open suppressive fire on a target, and then move to another position. It also ensures that the units gather around R_1 before proceeding to the next phase of the scenario.
Stop all specified units.Move units R_4 and R_5 to the position marked "PosR_5."Move units R_6 and R_7 to the position marked "PosR_6."Wait until all units are close to their respective markers.Command units R_4, R_5, R_6, and R_7 to open suppressive fire on "Obj1."Move all remaining units to the position marked "Obj1."Wait until R_1 is within 50 meters of the marker "Obj1," then order units from Romeo1_1 to follow R_1 and ensure they are all near R_1.Set the next waypoint for Romeo1_1 to "Despejar."
commandStop [R_1, R_2, R_3, R_8, R_9, R_10];
commandMove (getMarkerPos "PosR_5");
commandMove (getMarkerPos "PosR_6");
waitUntil { (R_4 distance (getMarkerPos "PosR_5") < 1) && (R_5 distance (getMarkerPos "PosR_5") < 1) && (R_6 distance (getMarkerPos "PosR_6") < 1) && (R_7 distance (getMarkerPos "PosR_6") < 1) };
[R_4, R_5, R_6, R_7] commandSuppressiveFire "Obj1";
[R_1, R_2, R_3, R_8, R_9, R_10] commandMove (getMarkerPos "Obj1");
waitUntil { R_1 distance (getMarkerPos "Obj1") < 5; { if (alive _x && {_x != R_1}) then { _x move R_1; }; } forEach units Romeo1_1; sleep 1; count (units Romeo1_1 - [R_1]) == 0; };
setCurrentWaypoint ["Despejar", 1];
According to Arma 3, the error is in 'commandMove.' The message is as follows: 'Error #move: object type expected vector.' I've gone through it countless times, and there's no way around it. Please, any help would be appreciated.
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
https://community.bistudio.com/wiki/commandMove takes left and right operand, I think you need to do:
[R_4, R_5] commandMove (getMarkerPos "PosR_5");
```and similar with `RosR_6`
Also please use code formatting
The error I'm getting is 'Error move - Expected object type vector.' I'm thinking of providing coordinates [x, y, z] of the marker instead.
Hi guys i have a question. So i want to recreate this what is in video here:
https://www.youtube.com/watch?v=mkj5JrLuws0&t=1062s&ab_channel=dslyecxi
I want for the pilot to have a 3d icon to where copilot camera is currently looking.
I am just wondering how did somebody do this.
My guess is haveing EH EachFrame that grabs position of where the cammera is looking.
then haveing EH Draw3D that shows the icon on that location. But if i use drawIcon3d That will show icon for everybody and i want to have it only for pilot. If you have any ideas how is this made i would appreciate it so much.
โบ About #ShackTac: https://shacktac.dslyecxi.com/
โบ About this channel/my videos: http://dslyecxi.com/yt/
Bohemia Interactive, the creators of the Arma series from Operation Flashpoint to #Arma3, can be found here: http://www.bistudio.com
drawIcon3d That will show icon for everybody
Not necessary of course. Such command is always local
...Oh, BIKI doesn't say so. Let me fix it
Draw icon is the same right ?
https://community.bistudio.com/wiki/drawIcon
Not even comparable command
No i mean by LE
Of course. It is GUI command so is LE
Yea i mean its the same on BIKI it dosent say its LE
I don't really know if there is a need to have LE
Urm yeah, others have one, let me fix that too
I would like to know if you're a ChatGPT bot or not. Sorry if not, but your wordings, result and knowledge are really suspicious enough not to believe you're a human.
No, I'm not. I'm sorry if you think that, but I'm not going to deceive you. I use ChatGPT to:Translate because my English knowledge is limited.Acquire knowledge of scripts or at least a guide, then I have to figure things out on my own by comparing and testing functions with Bohemia's glossary.I'm sorry if using ChatGPT bothers you. It's here to help, and your questions are welcome.
Okay, I'll try to assume you're using ChatGPT to translate your words
And... pretty much Sa-Matra explained what was missing in your code
@wary dust
What language are you translating from? We have a lot of people from different countries here, maybe there will be someone who can help in your native language.
Spanish
That too maybe. But I 100% recommend to write in both English and your native tongue, since this server only uses English. I'd like to have a โspecial caseโ for you, if you need
Ok thanks
No hay problema. Yo intentarรฉ en escribir y preguntar en inglรฉs pero cuando me vea limitado pues... traducirรฉ
I 100% recommend to write in both English and your native tongue
Recomiendo al 100% escribir tanto en inglรฉs como en tu lengua materna.
Might be faster and better than ChatGPT
im trying to get the first digit of a 4 digit number but i fail as always xD please help
private _rightCode = "";
for "_i" from 0 to 3 do
{
_rightCode = _rightCode + str(floor(random 10));
};
private _firstDigit = _rightCode select 0;
hint format ["The first digit is %1", _firstDigit];
but i get the "general error in expression"
_rightCode select [0,1]
omg thank you 
Thanks friend
params ["_pos", "_class", "_side"];
if !(isServer) exitWith {};
_asset = createVehicle [_class, _pos, [], 0, "CAN_COLLIDE"];
private _vehCfg = configFile >> "CfgVehicles" >> _class;
private _crewCount = {
round getNumber (_x >> "dontCreateAI") < 1 &&
((_x == _vehCfg && { round getNumber (_x >> "hasDriver") > 0 }) ||
(_x != _vehCfg && { round getNumber (_x >> "hasGunner") > 0 }))
} count ([_class, configNull] call BIS_fnc_getTurrets);
private _myArray = [0];
_myArray resize _crewCount;
if (_side == west) then {
private _grp = createGroup west;
{
private _unit = _grp createUnit ["B_UAV_AI", _pos, [], 0, "NONE"];
_unit moveInAny _asset;
} forEach _myArray;
} else {
private _grp = createGroup east;
{
private _unit = _grp createUnit ["O_UAV_AI", _pos, [], 0, "NONE"];
_unit moveInAny _asset;
} forEach _myArray;
};
_asset;
What could possibly cause the asset, wich is always a uav, to not have any ai?
_class is always the classname of a radar, spartan, rhea, defender ...
Did you check what is your _crewCount after you ran the command make sure its not returning 0
it isnt
it also sometimes tends to create the ai and sometimes not.
the asset is always spawned but not with its crew
Myb instead of Foreach try for loop dont know ?
But i honestly feel like something in here is not correct:
private _crewCount = {
round getNumber (_x >> "dontCreateAI") < 1 &&
((_x == _vehCfg && { round getNumber (_x >> "hasDriver") > 0 }) ||
(_x != _vehCfg && { round getNumber (_x >> "hasGunner") > 0 }))
} count ([_class, configNull] call BIS_fnc_getTurrets);
Is it possible to set a number instead of a texture when using setObjectTexture? example: obj1 setObjectTexture [0, _number]
No it requires a string.
But you could do something like this:
private _texture = "";
switch (_number) do {
case 0: { _texture = "Texture1";};
case 1: { _texture = "Texture2";};
case 2: { _texture = "Texture3";};
case 3: { _texture = "Texture4";};
default { _texture = ""};
};
_obj setObjectTexture [0,_texture];
Does anyone out there have an idea how I can force an AI to just drive forward with no though, no aim, no reason, nothing. Trying to use an agent to just... effectively hold W for two minutes.
Hey, guys, how i can use external variables in addEventHandler? he doesn't see them.
Give me an example I might be able to help
https://community.bistudio.com/wiki/setDriveOnPath
https://community.bistudio.com/wiki/sendSimpleCommand
If there is, try these commands
I looked at those, my concern is it says send simple command cant be used without a player in the vehicle, is that true do you know?
IIRC yes
`params ["_IFV_object"]; // class from cpp, which called the sqf file script.
_spinner= "Spin"; // class from CPP_IFV_object addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];_spinner animate ["hitzone_1_hide", 1]; // for example, eventHandler dont see _spinner
_spinner animate ["hitzone_1_unhide", 1]; // for example, eventHandler dont see _spinner}`
But you can try the other whatsoever
.
Your code doesn't make sense after all, not because EH doesn't see that, but you're trying to use a string for an animate which is invalid
This is not about animation but about an example, I can use another function when receiving damage and call the _spinner variable for other work
event handler just dont see it
I wonder if you need to pull the variable as a public... probably not but
setVariable and getVariable
it will help?
Yes
thanks, i will check now
it doesn't need a player in the vehicle. just some other guy to "give him orders"
yea I'm not getting any results no matter what with either of those. DriveonPath seems to be getting ignored completely, and sendsimplecommand seems to be having the driver stationary while the other guy yells "FOWARD" repeatedly
oh hey, good timing
setDriveOnPath needs a doStop on the driver first.
DriveonPath seems to be getting ignored completely
first usedoStopon the driver
It should. I haven't tried it so it's probably broken.
Why not, let me dostop the agents and see if that helps
just right infront of it and then about 100 meters infront of that
I also tried 100 meters in front then 10 meters infront of that
neither resulted in any movement
Hi. Does anyone know how to input "call BIS_fnc_randomPosTrigger" in command below to make vehicle spawn in random marker position?
_veh = "rhs_bmp1_vv" createVehicle getmarkerpos "UPS_marker"
I think the first point should be close to the vehicle so try 3 points. the first point being exactly on the vehicle
wasn't getting results with that either. Maybe it doesn't work on amphibious stuff
it works on any object that uses the new driving component (typically new tanks/cars)
if you use an old vehicle from old mods maybe it doesnt have one
also it doesn't work on boats/helis/planes because they don't use a driving component
Hmmmmmmm
Then is there a way to force an agent boat forward without like, setvelocity?
no. you should use setVelocityTransformation
_veh = "rhs_bmp1_vv" createVehicle ("UPS_marker" call BIS_fnc_randomPosTrigger)
Is there a way to get the particle class / light color of particle and light sources?
Couldn't seem to find one on the wiki
get the particle class from what?
@little raptor Thanks.
oh yeah, setDriveOnPath needs a sleep after the doStop even for supported vehicles.
always forgets that
#particleSource and #lightsource(?) objects
they're not classes
I know, I mean the effect class name that was applied with setParticleClass
no it has no getter
Gotcha
If the marker goes beyond the land, then the AI will spawn in the water too. Is it possible to make spawn occur only on land?
Hey, guys, can you help me!
How can I trigger a visual screen temporary noise effect for a specific player?
Hi, I wanted to ask about addActions. For example I have an add action that displays a hint when fired by a player. Does only the player that fired the addAction see the hint, or does everyone?
If its everyone, how can I make it local to only one person
Code executed by addAction is local.
So, only the player that fired it will see the hint. Others will not?
Yes
Perfect thank you
How can I refrance the player that fired the addAction, putting _player within the add action for an if statement gives me a undefined variable error
Oh the _caller?
yes
if(!alive _caller )then{
break;
}
}else{
hint "You are too far";
}
This is within the addAction
just if alive caller then hint blah blah blah
No no, I want to break the loop, thats fine. But its giving me the same error
undefined variable
you need params
Whats the wiki section called?
addaction
Hey- question
Does anybody have any clue if Publisher works on Linux (Ubuntu) terminal?
Hey everyone, its a pleasure to be here with all you arma 3 fans
Im new to arma 3 modding. Im trying to play a sound only locally, so only the player will hear.
I cant find in documentation which method to call
Im editing a mod and the author used playsound3d
playSound3D has a local argument, if you set it to true, it will only play on the machine that runs it
playSound3D
[
"A3\Sounds_F\sfx\blip1.wss",
objNull,
false,
getPosASL player,
1,
1,
0,
0,
true // local
];
@tulip ridge Thank you so much, I cant believe I didnt see this in the documentation, im so stupid. Thank you ๐
You're good, no need to apologize over not seeing something
Everytime I edit the pbo, I have to reload the game to try it out? Or I can just leave the clan server, paste the pbo in folder and join again?
With SQF, how do you differ uniforms from vests and backpacks? I'm not sure of any proper way to do it currently.
U_ prefix?
... from different mods and DLCs, that is.
SOGPF uniforms follow a vn_b_ prefix, I believe, but the same, apparently, can't be said about RHS or 3CB.
Can you tell what exactly is the goal?
Extracting names of all items from commonly used mods/DLCs along with their display names, but now that I think about it
Do you have any codes so far?
It's just a script to extract them all into one huge array, which is fine by me.
private _all_items = [];
private _len = count (configFile);
for "_i" from 0 to _len do {
private _configname = configName ((configFile >> "CfgWeapons") select _i);
private _displayname = (getText ((configFile >> "CfgWeapons") select _i >> "displayName")) regexReplace ["ย ", " "];
private _type = getNumber ((configFile >> "CfgWeapons") select _i >> "type");
private _items = [_configname, _displayname, _type];
if !(_displayname isEqualTo "") then {
_all_items set [_i, _items];
}
else {
_all_items set [_i, ["", "", ""]];
};
};
_all_items
Maybe _len is not properly counted, I'll need to fix that, but the general idea is there I believe.
If a class doesn't have a display name, I don't need it.
I'll re-parse everything in Python later for more convenience.
This data will be used for a sort of convenient(?) UI that breaks down player inventories into what's in a specific slot (X items in uniform, Y items in vest, etc.).
Okay this can be simplified like 1000x better, let me write one
Though, I'm honestly questioning if I need to do that.
I mean, this won't be run all the time, but any areas of improvement you can point out will help. ๐
Would like ask you to what is the point of this
((configFile >> "CfgWeapons") select _i >> "displayName")) regexReplace [" ", " "];
That's a funky way of dealing with:
Nope, because I simply don't know how. I tried checking the type property of the class, but a) I haven't found any documentation on it and b) it is the same value between uniforms and vests.
And you want to have _all_items with [[uniform],[vest],[backpack]] or something like that?
Yup.
private _allItems = [[], [], []];
private _weapons = "getNumber (_x >> 'scope')== 2" configClasses (configFile >> "CfgWeapons"); // get all scope = 2 weapons
{
// ItemInfo >> type declares which type it is
// 801 is an uniform
if ((getNumber (_x >> "ItemInfo" >> "type")) == 801) then {
// pushBack is always good way to add an element into an array
_allItems#0 pushBack configName _x;
};
// 701 is a vest
if ((getNumber (_x >> "ItemInfo" >> "type")) == 701) then {
_allItems#1 pushBack configName _x;
};
} forEach _weapons;
// for historical whatever reason, a backpack is a vehicle not a weapon, actually
private _backpacks = "getNumber (_x >> 'scope') == 2 and getNumber (_x >> 'isbackpack') == 1" configClasses (configFile >> "CfgVehicles"); // get all backpacks
// we already got the all the backpacks, so just convert it into className and do the rest
_allItems set [2, _backPacks apply {configName _x}];
_allItems```
Since you can get the displayName later, I only included all of classNames
๐ Thank you so much!
Feel free to ask what's behind my code or if something was new for you
I think scope == 2 is confusing for me. What does it signify, exactly?
Like, what difference does it make here?
scope controls โis it visible or invisibleโ
Ah!
0 is โnono you can't see thisโ
1 is โah yes, you've found this secret oneโ
2 is โyou can always see thisโ
Which means, scope == 2 is an easy way to validate that if the item actually exists and working
I see, I see. That's good to know in the future.
The rest is pretty clear, the comments are good help. Thanks a lot!
I assume the way to differ rifles and pistols is similar?
I see that CfgWeapons >> RifleCore has type = 1 while CfgWeapons >> PistolCore has type = 2. ๐ค
1 is rifle, 2 is pistol, 4 is launcher IIRC
Yup, config viewer seems to confirm that!
Ooh. Compasses and radios seem to be tricky.
I think were based on simulation
Looks like it, but it's slightly tricky. The values are more or less similar...
Im trying to edit a mod, and im trying to add a line to the hud. But im confused with how the hud is being loaded. Would anybody help me understand?
Hi, im new to arma3 modding but im a java programmer. thanks for replying.
This is the mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1936285943
it has a file named hud.sqf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Im not understanding where its loading the hud. I want to find it so I can add another line to it.
cutRsc does
Oh, Got it. Thanks. What about #define __ctrldistance (__dsp displayCtrl 10860) ?
10860 is the idc, but I dont understand where its coming from?
I understand idc is the ID of an object?
No
Im sorry, I dont understand
Then I probably don't know
Native of the game?
mean I guess
So If I write 10863, it should get the next line?
No
class RscTitles
{
/*
omitted
*/
class CCPS_GUI
{
/*
omitted
*/
class Controls
{
class CCPS_RscText_DISTANCE: RscText
{
idc = 10860;
/*
omitted
*/
};
class CCPS_RscText_TARGET: CCPS_RscText_DISTANCE
{
idc = 10861;
/*
omitted
*/
};
class CCPS_RscText_DIRECTION: CCPS_RscText_DISTANCE
{
idc = 10862;
/*
omitted
*/
};
};
};
};```Part of the config of the Mod
Where did you get that?
Config
config.bin
Yes
I understand
But you need to unbin that
OK, let me google how to do that, I will be right back, thanks lot. It helped a lot ๐
Oh I got it how it works now. Thank you so much for helping me
Hi, im having issues with other players having access to add actions, this is across all addActions but as an example I do this to crate an action on a crate
LOC1_loot addAction ["Unlock",{
if ("Keys" in magazines player) then{
player removeItem "Keys";
hint"Crate Unlocking";
LOC_tracker = 1;
execVM "Warzone\Warzone Locations\locReinforce.sqf";
_timeLeft = GLOBAL_LootCrate_Unlock_Time;
while{_timeLeft >=0} do{
//Unsure if it shows to all players or not
hint format[ "Unlocking in: %1s",_timeLeft];
sleep 1;
_timeLeft=_timeLeft-1;
};
hint"Crate Unlocked!";
LOC1_loot lockInventory false;
}else{
hint"Missing Key";
}
}, [],1,false,true,"","_this distance _target < 3"];
The problem is, not every player can see it. Im intitializing this code via a initServer, is there something Im doing thats making my script local?
Yes. addAction only executes on local
Is it possible to disable collision with a static object for ALL players on a dedicated server? The object is part of a base composition that is placed by a script at the start of the mission. I can "disableCollisionWith" easy enough for myself at least on a locally hosted game but I don't really see how it can be done when the mission is on a dedicated box and the object isn't local to the player's PC?
Q: when creating a vehicle, how can I easily determine whether AI crew may be created... i.e. as a UAV platform. do not want to create crew for non-UAV objects, if I can easily avoid that being the case. thanks...
You can use https://community.bistudio.com/wiki/unitIsUAV to check whether it's a UAV or not and decide accordingly
An UAV requires crews to work though
Presumably that's why he's trying to create crews only for UAVs
Ah, yes I've read it wrongly
ah yes regardless of if it has a crew or if it is empty being the key. thanks!
Does anyone here know how to edit the Liberation File to allow for players on 2 different factions?
Just add playable units of the different faction?
'allowing' for it, and there being 'playability', like FOBs, build menus, the whole nine, two different stories.
also, assume you know there is the KP discord, correct? might find some traction there.
Did not know there was a discord.
And Allowing for it as in Just players to play alongside the "hostile AI" to add a little spice to the game mode.
Yea but where would i find that? Its not like i can open up the mission file in the editor and put down playable entities lol.
Yes you can
How? I've tried extracting stuff any it still doesnt work for me
I found the discord by the way just had to look at github Sorrryyy
there is, would recommend that group. pretty good bunch of regulars there, usually pretty helpful for most questions.
yeah, the mission is not really designed for competitive play, more for coop.
but heck if you can pull that off, might be interesting.
recommend starting from the github, get familiar with the build, what that is doing, your mission files, framework, and local dev copy right processes. that's how I play test things before building for dedi.
How do I escape the '%" character? __ctrlhealth ctrlSetText format["%1 % Health", round (_playerHealth)];
format ["%1 %2", round _playerHealth, "%"];
Thank you ๐
Assuming the object is on the server and doesn't change locality, you would need the server to run the command for every player, as well as every player running it themselves. Something like:
initPlayer.sqf
player disableCollisionWith myWall;
initServer.sqf
{_x disableCollisionWith myWall) forEach allPlayers;
So, how can I make it execute globally?
remoteExec
So, do I need to start all the script with remoteExec, or individual pieces of sqf?
There's an example of it on the addAction page
O lemme take a look
Ohh I see
So I have to remoteExec all the addActions individually?
Could make a function/script that adds them all, and then remote execs that
Ahh, so If remoteExec the entire file, everything within that file will be global?
Does anyone know if it is possible to link a variable to a item or magazine?
Do you mean like this?
LOC3_Key1 = createVehicle ["Box_CSAT_Equip_F", [9781.915,9392.567,3.231]];
not on a object you spawn in, on a item that is in cfgWeapons
I see, Im unsure. But Im sure you could use certain conditions or other functions to do what you need
if you mean "this very money stash is named 'Monies' and I can use it as an object var name", no
Anyone know how I can make this global?
where should I put remoteExec?
KEY_Spawn_Positions select _i apply {_x lockInventory true};
I mean more like "I took an apple out of this apple box and not it has 29 apples" Like saving that there was 1 apple taken out of row 4 or so.
you can count the amount of apples and check the difference, or use an event handler to detect a "take" event
So only thing I can use to save a variable is the ammo diffrence in a magazine. And for normal items (in cfg weapons) there is nothing?
because they are not "object" per se (as in "game object"), but proxies
if you put two similar "arifle_MX_F" in a box, you cannot distinguish which one was picked up
you could with an ID system similar to tfar/acre but thats a lot of complexity for apples
Dosn't TFAR just replace the item with the current channel you are on, so if you click 1 channel up it switches the item.
no
@tough nacelle ^
how often does a if then loop refresh or does it only run once?
the fastest time will be as mush sleeps or suspensions you do in the loop, then you add the time taken to execute the rest of the code + the suspension the engine will do if the code itself takes more than 3ms iirc.
an if is not a loop itself
if then is not a loop, it is only a one-time check indeed
Really hope someone can help me with this, been at it for days now trying to get it to work.
I just want the Zeus team to get a message (That ONLY Zeus players can see) when a non-Zeus player enters an area trigger.. this is what I have so far
if (isServer) then {
if not (player in allCurators) then {
[[sideLogic, "Base"], "Recon team is veering off course!"] remoteExec ["sideChat"];
}
};
if !(player in allCurators) then {
[[sideLogic, "Base"], "Recon team is veering off course!"] remoteExec ["sideChat"];
}
should work
! does the job of the not and i doubt that is formatted correctly
Is there anyway I can "fake" another player and test it on my own?
You can dupe your game and try in your local MP
It triggers when I fly into it as Zeus myself
But essentially "try it for real" is the only way
Are any of these settings wrong?
what is Base defined as?
Not sure, I was following this syntax and figured I had to pick one from the list?
And was basing it off of this example:
[[blufor, "BLU"], "message"] remoteExec ["sideChat"]; // shows the message to all players
i dont think sidelogic is correct maybe try player instead in the far left variable
Wouldn't that send it in the side chat the player is a member of?
So all Independent players for example
How would I remoteExec that for only the Zeus clients?
if !(player in allCurators) then {
[[player, "Base"], "Recon team is veering off course!"] remoteExec ["systemchat"];
}
Check each player using getAssignedCuratorLogic
isPlayer + forEach yes ^
otherwise you only check the server's player (which can be null for a dedi)
Wait sorry I'm not sure I'm following @digital hollow @winter rose, getAssignedCuratorLogic foreach loop with the remoteExec inside?
And replace the if statement with if !(IsPlayer player)?
Does IsPlayer only return true if they're an actual soldier unit?
No, according to the one-line wiki description it'll return true for (connected?) headless client objects too.
Shouldn't matter though because the only possible return values for getAssignedCuratorUnit are players and objNull? So this should work:
private _curatorPlayers = (allCurators apply { getAssignedCuratorUnit _x }) - [objNull];
So like this?
if (isServer) then {
private _curatorPlayers = (allCurators apply { getAssignedCuratorUnit _x }) - [objNull];
if !(player in _curatorPlayers) then {
[[player, "Base"], "Recon team is veering off course!"] remoteExec ["systemchat"];
}
};
No, player is just objNull on the server.
if (isServer) then {
private _curatorPlayers = (allCurators apply { getAssignedCuratorUnit _x }) - [objNull];
"Recon team is veering off course!" remoteExec ["systemChat", _curatorPlayers];
};
Okay, that seems to do what I want, however it still triggers when I fly inside the trigger as Zeus?
Triggers are someone else's problem.
fuck triggers :P
I don't think triggers can actually do what you want because it won't retrigger if zeus goes inside the circle and then someone else does? Dunno.
Also I'm not sure if this is the correct way to setup Zeus slots for multiplayer
Spawns me on the floor as an invisible unit running around but I can enter Zeus with 'Y'
This all seems annoyingly complicated to do something that seems so simple
Well, normal players can zeus too. Depends what you want.
I want pure Zeus slots
Never used that personally, wouldn't know.
If I do just a 'Zeus' object I'm just the invisible guy, but if I do just 'Game Master' then the multiplayer slot doesn't appear, pretty annoying
Oh well, I can live with it triggering the message if I fly into the trigger as Zeus, would prefer if not. Gonna have to test this with someone later, praying it works...
If you're making a pure Zeus slot you should turn on that Forced Interface checkbox. There's no point letting them return to controlling their unit when that unit is just a virtual gnome.
sqf pastebin not work anymore? my bookmark doesnt seem to work
