#arma3_scripting

1 messages ยท Page 105 of 1

crude egret
#

Bump ๐Ÿ˜ฆ does no1 Has a solution? ๐Ÿ˜ฎ

ebon wing
#

But ig I could do it within the addAction itself

warm hedge
#

addAction's condition check runs locally

tulip ridge
ebon wing
#

So, as long as I check the players inv within the addAction it will always check that one players inv?

warm hedge
#

Would like to know what is sector tactic. Is that an official module?

ebon wing
warm hedge
#

Let me check once am back

crude egret
#

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

crude egret
#

Im at Work now, so i have alot of time to wait xD

ebon wing
#

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?

warm hedge
#

Are you sure "Item_Keys" is the classname?

warm hedge
#

I don't think inventory item class == vehicle class

#

Make sure to check items player to fetch the correct class

tulip ridge
ebon wing
ebon wing
ebon wing
#

in the wiki

warm hedge
#

?

tulip ridge
#

The command is items, it takes an object

#

So items player gives all the items in the player's inventory

ebon wing
#

Ohh, you mean export all the player items into an array?

#

Or just print it

#

I see

tulip ridge
ebon wing
tulip ridge
#

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

ebon wing
#

Just outputs the firstAid
_itemsPlayer = items player; hint format ["Items: %1", _itemsPlayer];

tulip ridge
#

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

ebon wing
#

oooooh

#

So, it wont work with this then?

tulip ridge
#

So just use if ("Keys" in magazines player) then {...};

ebon wing
#

oh sweet

ebon wing
hallow mortar
#

BIS_fnc_hasItem will detect magazines (and other things), you just need the right classname. The items command specifically won't.

hallow mortar
ebon wing
tulip ridge
south swan
warm hedge
# crude egret Sure, ty for trying

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

crude egret
patent goblet
#
_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?

warm hedge
#
_init select [count _init-1] == ";"```not tested
#

Not sure what is the usecase also though

patent goblet
#

it works, thank you

flint sentinel
#

Is there a better way to run an !alive trigger for multiple targets, rather than just 't1 && t2 && t3...'

winter rose
#

(triggers don't die)

#

!alive t1 && !alive t2 etc?

flint sentinel
#

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

winter rose
#

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
flint sentinel
tulip ridge
flint sentinel
#

Cool, trying to get my head around Bohemia's language

winter rose
tulip ridge
winter rose
#

nope, only moderators can do it safely

flint sentinel
#

I have been referencing that, discovered it here actually ๐Ÿ™‚ thank you though!

tulip ridge
winter rose
#

negative, sorry for the false hope
but this is too much of a safety issue, unfortunately
e.g google.com

tulip ridge
#

Basically just a "block every link except for x, y, z, etc. etc."

winter rose
#

I'd be up for that - only allow BI URLs ๐Ÿ˜Ž ๐Ÿ˜„ (everywhere!)

tulip ridge
#

I might have it saved somewhere, I'll do some looking around

winter rose
#

if it's a regex don't worry, we can deal with it ๐Ÿ™‚ just need to actually do it

tulip ridge
#

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

manic flame
#

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

fleet sand
#

You are missing ; here: _ctrlHTML htmlLoad "html/1.html" Also make sure your path to html is correct there as well.

manic flame
#
  1. it doesnt matter (still wont work)
cosmic lichen
#

Must be the file

#

It works fine for me with different content

manic flame
#

huh

#

what content

cosmic lichen
#

Try this

manic flame
#

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

manic flame
#

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.

sullen sigil
#

there is no function called gravityburst

#

not in main game anyways

manic flame
#

Its part of the contact DLC

sullen sigil
#

contact dlc functions are catered for the campaign and not meant to be used outside of it

manic flame
#

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

sullen sigil
#

read the function header if there is one

supple tusk
#

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

brazen ledge
#

Can anyone guide me on scripting a tank fully ?

open hollow
#

use the arma 3 samples, is a good way to start

open hollow
sweet ridge
#

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.

little raptor
#

no

supple tusk
open hollow
supple tusk
#

Unfortunately not the solution I'm looking for but I do appreciate the help

south swan
#

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 blobdoggoshruggoogly

#

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 meowsweats

supple tusk
#

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

south swan
#

{vehicleVarName player in ["varName1", "varName2", "varName3"]} then. Any code that returns true/false should work

supple tusk
#

I'm not sure what you exactly mean? I'm quite novice when it comes to scripting apologies

still forum
south swan
#

this setvariable ["bis_fnc_arsenal_condition", {CODE HERE}];. For example: this setvariable ["bis_fnc_arsenal_condition", {vehicleVarName player in ["varName1", "varName2", "varName3"]}]; blobdoggoshruggoogly

ebon wing
#

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

fleet sand
ebon wing
#

They would still remain within their civ slot and squad though right?

fleet sand
#

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.

ebon wing
#

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?

winter rose
ebon wing
winter rose
#

something went wrong then, because it does work

supple tusk
ebon wing
#

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?

granite sky
#

Did you check what the default rating is?

ebon wing
granite sky
#

isPlayer?

ebon wing
#

Anyway to do it without going through a loop?

granite sky
#

Describe exactly what you want to do.

ebon wing
granite sky
#

All players are civilians?

ebon wing
#

yea

granite sky
#

Are all civilians also players?

ebon wing
#

Well, some are opfor, and others bluefor, but FIA will just be set to hostila so this wont matter for them

ebon wing
granite sky
#

Rating matters if there are also AIs on the player's sides.

ebon wing
#

No other AIS

#

FIA is the only AI faction

granite sky
#

whatever. There's always a loop anyway, so there's no superfast way to do this.

tulip ridge
granite sky
#

Like you can't do the setRating without a loop.

ebon wing
#

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

granite sky
#

uh

#

addRating takes an object as input.

#

What you said seems extremely confused.

ebon wing
#

So, instead of _unitCiv addRating, can I do player?

#

For example, it will change the rating of all players that enter a trigger zone

granite sky
#

Well, addRating is also local argument so unless your trigger statements are globally added then you'd need to remoteExec.

ebon wing
#

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?

granite sky
#

shrugs

#

Are you using an editor trigger or not?

ebon wing
granite sky
#

So where is setTriggerStatements executed?

ebon wing
#

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

granite sky
#

I mean on which machine?

ebon wing
#

I didint set if its specifically server side, or not. Im not very knowledgeable on that side of things yet, as you can tell

granite sky
#

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.

ebon wing
#

Is there a specific wiki section that talks about this?

barren summit
#

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...
queen cargo
#

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 ...

tulip ridge
#

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

steep wave
#

Is there a way to disable/deactivate an sqf for a player via a trigger

winter rose
steep wave
#

toggling a boolean basically I'm very new to this

zenith prairie
#

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?

tulip ridge
#

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

zenith prairie
#

I only want to mitigate fall damage while the jetpack is active. the unit should not be invulnerable from other damage sources.

tulip ridge
#

Is it just to prevent damage when touching the ground?

granite sky
#

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.

tulip ridge
zenith prairie
tulip ridge
#

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

granite sky
#

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

tulip ridge
zenith prairie
zenith prairie
granite sky
#

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.

zenith prairie
vast zodiac
#

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;
  };
};```
tulip ridge
vast zodiac
#
  {
    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 = "";}; ```
tulip ridge
#

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;";
    };
};
vast zodiac
tulip ridge
#

You could just change those with hiddenSelectionsTextures

vast zodiac
tulip ridge
#

Or if you want multiple skins on a vehicle, TextureSources

tulip ridge
vast zodiac
#

Excellet tysm

zenith prairie
#

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?

tulip ridge
#

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

zenith prairie
zenith prairie
meager granite
#
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

wicked sparrow
#

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?

south swan
#

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

wicked sparrow
#

Thanks, I'll try that.

fleet sand
#

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}
warm hedge
#

Just to clarify, up right, as the opposite from upside down?

fleet sand
warm hedge
#

Then just > instead of <?

fleet sand
#

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.
warm hedge
#

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?

fleet sand
#

solider 2 and 3 are not up right.

warm hedge
#

Then you can simply do sqf (vectorUp cursorObject)#2 < cos 45

fleet sand
little raptor
#
  1. Why do you use nearestObjects? You just need cursorObject
  2. Your action condition is wrapped in {} and won't work
fleet sand
south swan
#

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?

fleet sand
warm hedge
#

It is easy to add addAction into crates, not the player

fleet sand
#

Yea but i am adding this to warlords scenario.

  1. I dont know how to add scripted stuff in request menu. if there is a way pls tell me.
  2. 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.
warm hedge
#

There is an EH to detect if something has spawned

unborn rivet
#

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;

fleet sand
warm coral
#

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

warm coral
#

just found out its done through ContainerOpened but still no success

sullen sigil
#

is there any event for the end of a trigger pull versus fired? i.e weapons on burst etc

fleet sand
# warm coral just found out its done through `ContainerOpened` but still no success

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;
warm coral
#

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

meager granite
#

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)

fair drum
meager granite
fair drum
#

Like in your instance, you could use it to show the current time left in the Koth round and current AO

meager granite
#

Yeah, I'd love to show current AO and game score

winter rose
#

estimatedTimeLeft has limitations indeed

meager granite
#

Also some other options like (no jets, no tanks) etc. shown dynamically depending on actual settings

fair drum
#

yeah he would need something he could throw a var into

fair drum
#

You could then reduce the # of servers and have the games build themselves based on the clients

fleet sand
# warm coral ```sqf [ "[- PACIFIC -]", "- Boobytrap (Inventory)", { params [["_...

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;
meager granite
fair drum
warm coral
#

ill try now too

#

did you test it out on a corpse?

fleet sand
#

no on a crate.

warm coral
#

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

wooden dove
#

@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?

fleet sand
wooden dove
#

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

wooden dove
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
wooden dove
#

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

fleet sand
wooden dove
#

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

fleet sand
# warm coral because my corpse isnt blowing up

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;
fair drum
#

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

fleet sand
# fair drum btw, I would add some counter play to that. if every time you try to loot an ene...

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.

drifting portal
#

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?

warm coral
#

tried placing on and next to a body

granite sky
#

If you want to add the other group's vehicles then you can do that.

drifting portal
granite sky
#

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.

drifting portal
#

Makes sense lol

somber radish
#

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

still forum
still forum
somber radish
tribal sinew
#

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.

ebon wing
#

Hey, I wanted to ask. What would be a easy way to spawn combat troops inside a heli. They will later be unloaded?

ember locust
#

Can I attach objects to rockets with the attachToRelative funktion?

#

*function

granite sky
#

@ebon wing Spawn them wherever and use moveInCargo

ebon wing
ebon wing
granite sky
#

{_x moveInCargo _heli} forEach _heliInfUnits;

ebon wing
#

I tried it with a single soldier, no sauce, no error too

#

May be my troops arent spawning

fleet sand
fleet sand
#

I think i found it its maxLoad command.

granite sky
#

There's probably a config method but I never found it.

#

maxLoad should be fine though.

ebon wing
#

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?

granite sky
#

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.

ornate whale
#

What is the main difference between CfgSounds and CfgSFX?

hallow mortar
ebon wing
granite sky
#

You give the waypoint to the pilot group.

ebon wing
#

I gave it to the heli object, he still flies there but deletes the wp

#

I see

sweet ridge
#

In the Virtual Arsenal, do the VR vehicles handle damage via a script to change the color of the section that was hit?

granite sky
#

It's possible that the waypoint routine failed to find a landing position in the area.

#

although they're not that picky IME

ebon wing
#

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

granite sky
#

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.

ebon wing
#

Yeah, They hop out but no waypoint. Should I try a event handler, and give them the waypoint once they all hop out?

granite sky
#

Safer way for helis might be to add the cargo move waypoint with setWaypointStatements on the pilot group.

ebon wing
#

Ohh

granite sky
#

getout handler is also an option.

#

well, getOutMan.

ebon wing
#

Which one do you think would be better?

#

I just want them to re-secure a objective

granite sky
#

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.

ebon wing
#

new GL

granite sky
#

He would, but the event handler would still be on his corpse.

ebon wing
#

Could I set an event handler on the heli landing instead?

#

That will then give the group the waypoint

granite sky
#

I don't think there is one.

ebon wing
#

I saw one for landing gear

granite sky
#

LandedTouchDown is only for planes.

ebon wing
#

Ill add a sleep, for account for the delay

#

Could that work?

granite sky
#

To what?

ebon wing
#

inside the event handler?

#

Trigger -> sleep -> adds waypoint once they all hop out

granite sky
#

What event handler are we talking about?

ebon wing
granite sky
#

Helis don't all have gear.

#

In fact most of them don't, otherwise more of them would be crashing in Antistasi :P

ebon wing
#

The one Im using does

#

I dont plan on using other helis

granite sky
#

fair enough then.

ebon wing
#

Should work right?

granite sky
#

seems pretty flaky tbh :P

#

maybe try synchronizeWaypoint

ebon wing
ebon wing
granite sky
#

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.

ebon wing
#

Just a line under I give them the waypoint?

#

Wouldnt that result in the same thing

granite sky
#

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.

ebon wing
#

Ill give it a shot, also it wont let me sleep in the event handler ;(

ebon wing
#

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

granite sky
#

waypoints are just [group, index]

ebon wing
#

I just left it at 2 and 3, still works

digital hollow
ebon wing
#

nice

#

Im doing something a little different but I appreciate it

ornate whale
tulip ridge
tender fossil
#
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`
stable dune
tender fossil
stable dune
#

Shows on phone 0, not O

tender fossil
#

Yeah, the font is weird ๐Ÿ˜„

stable dune
#

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.

tender fossil
#

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

still forum
#

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 ๐Ÿค”

still forum
manic kettle
still forum
#

Too hard to do

manic kettle
#

I figured but I can dream ๐Ÿฅน

#

Trying to set unit variables at mission start that persist without relying on unit init fields

cosmic lichen
south swan
#

but that also would introduce a whole new category of subtle bugs in already-published missions notlikemeowcry

manic kettle
#

I'm all for the fire

cosmic lichen
tender fossil
still forum
#

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

tender fossil
#

Facepalm I connected to actual server running the old code instead of dev... ๐Ÿ˜„

#

Maybe I should turn the main server off while developing

still forum
#

I had that same problem so I removed the password from my local dev server.
Maybe just give it different name or password ๐Ÿ˜„

tender fossil
#

Yeah ๐Ÿ˜„

ornate whale
#

Does user action EH run where I add it, or always on the machine which controls the character? Documentation says it's local.

still forum
#

I assume you mean addAction command?
That runs on the machine that activated the action

ornate whale
#

Yes. Even if I add it on one client, and the player possessing the character is on another client?

still forum
#

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

hallow mortar
dreamy kestrel
#

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], [], "..."].

dreamy kestrel
feral epoch
#

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

winter rose
feral epoch
#

I think the site is currently down

winter rose
last rain
#

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.

feral epoch
#

Here's the code

ornate whale
#

How to make a task which is placed in the editor as a CreateTask entity appear only once the prior task is completed?

feral epoch
#

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

digital hollow
ebon wing
#

Hey, anyone know why this wouldnt work?

_awpp2 setWaypointStatements ["true","deleteVehicleCrew _heli2A; deleteVehicle _heli2A"];

#

Nothing happens, the vehicle just stays the same hovering

dreamy kestrel
ebon wing
#

awpp2 is the waypoint and _heli2A is the heli

feral epoch
#

I'm not familiar with that syntax

granite sky
#

[stash_1, true] remoteExec ["hideObjectGlobal", 2];

feral epoch
#

what's the 2 for?

granite sky
#

You need to 2 so that it runs on the server only.

dreamy kestrel
feral epoch
#

Got it, thanks!

granite sky
#

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.

ebon wing
ebon wing
#

outputs true tf

granite sky
#

Variables starting with an underscore only exist in the current context.

dreamy kestrel
digital hollow
#

How to make a task which is placed in

ebon wing
#

I see, so I should make it global then?

#

and so I understand setStatements, is in its own scope?

granite sky
#

yes.

ebon wing
#

ooowwie

#

makes sense now

dreamy kestrel
#

but you can leverage things about the the group leader, group, etc... maybe vehicle this, whatever... that is available to you.

dreamy kestrel
granite sky
#

Unless you're writing quick & dirty stuff you should probably do something like storing the vehicle with setVariable on the group.

ebon wing
#

never heard of setVariable gonna check it out on the wiki, thanks!

ebon wing
granite sky
#

If you can guarantee that the group leader is still in the vehicle when the setWaypointStatements fires then vehicle this is fine.

sullen sigil
#

i discovered about recompile = 1; today in cfgfunctions after about a month of doing ace function overwrites hmmyes

dreamy kestrel
ebon wing
granite sky
#

dead and in the vehicle works. But if you're throwing the body out then maybe now.

ebon wing
granite sky
#

The setVariable/getVariable is safer anyway.

dreamy kestrel
granite sky
#

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.

dreamy kestrel
dreamy kestrel
ebon wing
#

Like adding a lot of them

granite sky
#

It's probably not an ideal command but it's convenient.

dreamy kestrel
granite sky
#

The group waypointChanged EH only fires on the machine it's installed on if you're thinking long term.

dreamy kestrel
ebon wing
ebon wing
#

Does seek and destroy stop after a while when no targets can be found, or does it continiously look for enemies around the waypoint?

manic flame
#

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

dreamy kestrel
manic flame
#

True, thank you.

granite sky
ebon wing
dusk gust
#

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.

ebon wing
#

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?

ebon wing
limber panther
#

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?

granite sky
#
0 spawn {
  sleep 5;
  ["gps_dart", west] call BIS_fnc_deleteTask;
};
granite sky
#

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.

limber panther
#

oh ok, i'll give that a try

cosmic lichen
ebon wing
#

its much easier and quicker than I though

limber panther
granite sky
#

I don't really know because I don't use editor triggers, but I'd guess that the code there runs everywhere.

limber panther
granite sky
#

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.

limber panther
# granite sky Add that to the second and you're probably good.

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.

granite sky
#

Oh yeah, actually this code is completely broken for MP.

limber panther
#

how come?

granite sky
#

you're using player which is only valid on clients, but it's wrapped with an isServer check.

limber panther
#

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?

granite sky
#

probably just thisList#0

limber panther
fair lava
#
#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?

ornate whale
#

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.

fleet sand
ornate whale
fleet sand
open mirage
#

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?

sullen sigil
#

use selectRandom

hallow mortar
tulip ridge
tulip ridge
#

Yep, typo

ornate whale
#

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.

winter rose
#

if someone disabled music, you cannot force it to 1 with 0 fadeMusic 1 - it will actually be 100% of zero, aka 0

harsh sedge
#

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?

meager granite
#

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

harsh sedge
#

Darn

#

Thank you for the insight, though

winter rose
#

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

still forum
desert palm
#

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

warm hedge
#

myLight is your light that is spawned by a script. So your question's answer is no

desert palm
#

oh, any idea how I can make light work during the day?

warm hedge
#

Mods

desert palm
#

anyone in particular cant seem to find a reliable one

warm hedge
#

I don't even know there is one

desert palm
#

yeah me to, well hey you're polpox the great mod creator ๐Ÿ™„ ๐Ÿ˜„

fossil cradle
#

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

hallow mortar
#

Does the EntityCreated mission EH work?

fossil cradle
#

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

digital hollow
#

OnHistoryChange and OnSelectionChange trigger when manually placing, could combine them, and with all3DENEntities if necessary to detect what you need.

fossil cradle
#

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

digital hollow
#
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;
}];
fossil cradle
#

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

digital hollow
#

Oh wow, yup. you're right.

radiant nova
#

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?

little raptor
#

it does yes. but idk what exactly you want to achieve

radiant nova
little raptor
hallow mortar
#

They wanted to have a reaction for a specific hitpoint, so they'd need to check whether _hitPoint matches the correct name as well

hoary kernel
#

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?

radiant nova
#

i mean

winter rose
#

seems so

radiant nova
#

how its check damage to hitpoint?

#

by eventHandler?

winter rose
#
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

kind cedar
#

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

radiant nova
#

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?

radiant nova
#

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

tribal sinew
#

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 ๐Ÿ˜…

south swan
#

ppEffectCommit's second argument looks like duration?

tribal sinew
#

oh, lemme try that

south swan
#

yeah, doc says so as well

tribal sinew
#

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:

  1. There's a server trigger
  2. A single player steps in the trigger
  3. The activation code (pp effect) gets excuted for all of the players
hallow mortar
tribal sinew
#

Putting it in a function as a good practice or is there more to that?

hallow mortar
#

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.

tribal sinew
#

Huh, interesting

#

And then just remoteExec it with -2 as the targets argument?

hallow mortar
#

-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

tribal sinew
#

This would be on a DS

#

But thanks a lot for the additional cases!

hallow mortar
#

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

tribal sinew
#

Very True

ebon wing
#

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?

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
warm hedge
#

Please use the correct formatting

#

And... your syntax is very wrong after all

ebon wing
#

Missing =

warm hedge
#

Not only that

ebon wing
#

and ""

warm hedge
#

In the first place to declare an empty array sqf Array = [];

#

An not-empty arraysqf Array = [1,2,3];

ebon wing
#

Should I put each object into quotations or no?

warm hedge
#

No

ebon wing
#

Only for strings ye?

warm hedge
#

Quotations tells the game it is an String

ebon wing
#

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=[];


];
warm hedge
#

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

ebon wing
#

What do the added [] do? Isolate each index?

warm hedge
#

[] means a dimension of an array

ebon wing
#

Right, but you have 4 of them

#

The two around crateVehicle arent called anything

warm hedge
#

Just use , to separate an element

ebon wing
#

Yea, but Im trying to make a 2D array

#

Not 1D

warm hedge
#

Same thing

ebon wing
#

So, instead of making another array within SpawnKeyPos I just add the two []?

warm hedge
#

?

ebon wing
warm hedge
#

[] is an empty array already

#

Isn't that already is?

ebon wing
#

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?
warm hedge
#

No

#

LOC1 = <- remove it

ebon wing
#

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=[];


];```
warm hedge
#

You cannot declare a variable inside an array using =

ebon wing
#

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

warm hedge
#
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
ebon wing
#

I see, aweosome thanks

ebon wing
#

Hi, anyone know what is the difference between addItemCargo and addItemCargoGlobal? I need to add items into a crate for players to grab

tulip ridge
#

addItemCargo is local (meaning it's only added on the machine that runs it), addItemCargoGlobal is global, which means it runs on every machine

ebon wing
tulip ridge
#

If you only run it on that person's machine yes, in most cases you'll want to use the global version

ebon wing
#

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?

tulip ridge
#

Yes

ebon wing
hallow mortar
#

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

ebon wing
#

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];
simple trout
ebon wing
#

Its classified as a magazine though

#

But even when I // the last line, the error persists

tulip ridge
ebon wing
#

ohhh

#

error persists

simple trout
#

What the hell is Random crate supposed to be

#

that line makes no sense

#

you already got the crate with the selectRandom

ebon wing
#

No, its a 2D array

#

So, It picks a random crate within a random location

simple trout
#
Random_Crate = selectRandom Random_Location;
ebon wing
#

I was hopping to get the number, so this just stored the crate obj into the random_crate, ill try it

simple trout
#

why?

#
Random_Location = selectRandom KEY_Spawn_Positions;
Random_Crate = selectRandom Random_Location;
Random_Crate addItemCargoGlobal ["Keys", 1];
#

there

ebon wing
#

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?

tulip ridge
ebon wing
wary dust
#

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.

tulip ridge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
meager granite
#

Also please use code formatting

wary dust
warm hedge
#

There is no โ€œvectorโ€ type?

#

And pretty much Sa-Matra said

fleet sand
#

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

โ–ถ Play video
warm hedge
#

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

warm hedge
#

Not even comparable command

fleet sand
warm hedge
#

Of course. It is GUI command so is LE

fleet sand
#

Yea i mean its the same on BIKI it dosent say its LE

warm hedge
#

I don't really know if there is a need to have LE

#

Urm yeah, others have one, let me fix that too

warm hedge
wary dust
warm hedge
#

Okay, I'll try to assume you're using ChatGPT to translate your words

warm hedge
hallow mortar
#

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.

wary dust
#

Spanish

warm hedge
#

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

wary dust
#

Ok thanks

wary dust
warm hedge
#

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.

cosmic lichen
drowsy geyser
#

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"

warm hedge
#

_rightCode select [0,1]

drowsy geyser
#

omg thank you meowawww

granite haven
#
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 ...

fleet sand
granite haven
#

it isnt

#

it also sometimes tends to create the ai and sometimes not.

#

the asset is always spawned but not with its crew

fleet sand
#

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);
drowsy geyser
#

Is it possible to set a number instead of a texture when using setObjectTexture? example: obj1 setObjectTexture [0, _number]

fleet sand
#

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];
fluid wolf
#

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.

radiant nova
#

Hey, guys, how i can use external variables in addEventHandler? he doesn't see them.

fluid wolf
#

Give me an example I might be able to help

fluid wolf
#

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?

warm hedge
#

IIRC yes

radiant nova
#

`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

}`

warm hedge
#

But you can try the other whatsoever

radiant nova
warm hedge
#

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

radiant nova
#

event handler just dont see it

fluid wolf
#

I wonder if you need to pull the variable as a public... probably not but

warm hedge
#

setVariable and getVariable

radiant nova
warm hedge
#

Yes

radiant nova
#

thanks, i will check now

little raptor
fluid wolf
#

oh hey, good timing

granite sky
#

setDriveOnPath needs a doStop on the driver first.

little raptor
#

DriveonPath seems to be getting ignored completely
first use doStop on the driver

fluid wolf
#

Well the driver and gunner are agents

#

shouldn't that do that already?

granite sky
#

It should. I haven't tried it so it's probably broken.

fluid wolf
#

Why not, let me dostop the agents and see if that helps

little raptor
#

what do you set for path?

#

it should have at least 2 points iirc

fluid wolf
#

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

serene sentinel
#

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"
little raptor
fluid wolf
#

wasn't getting results with that either. Maybe it doesn't work on amphibious stuff

little raptor
#

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

fluid wolf
#

Hmmmmmmm

#

Then is there a way to force an agent boat forward without like, setvelocity?

little raptor
#

no. you should use setVelocityTransformation

fluid wolf
#

Agh I was afraid of this

#

fair enough

little raptor
tulip ridge
#

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

little raptor
#

get the particle class from what?

serene sentinel
#

@little raptor Thanks.

granite sky
#

oh yeah, setDriveOnPath needs a sleep after the doStop even for supported vehicles.

#

always forgets that

tulip ridge
little raptor
#

they're not classes

tulip ridge
#

I know, I mean the effect class name that was applied with setParticleClass

little raptor
#

no it has no getter

tulip ridge
#

Gotcha

serene sentinel
#

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?

little raptor
radiant nova
#

Hey, guys, can you help me!
How can I trigger a visual screen temporary noise effect for a specific player?

ebon wing
#

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

cosmic lichen
#

Code executed by addAction is local.

ebon wing
cosmic lichen
#

Yes

ebon wing
#

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

sullen sigil
#

here

ebon wing
#

Oh the _caller?

sullen sigil
#

yes

ebon wing
#

if(!alive _caller )then{
                    break;
                }

                }else{
                    hint "You are too far";
                }
            

sullen sigil
#

what

#

why on earth are you doing that

ebon wing
#

This is within the addAction

sullen sigil
#

just if alive caller then hint blah blah blah

ebon wing
#

No no, I want to break the loop, thats fine. But its giving me the same error

#

undefined variable

sullen sigil
#

you need params

ebon wing
#

[],6,false,true,"","_this distance _target < 4"];

#

these?

sullen sigil
#

no

#

in the picture i sent

ebon wing
#

Whats the wiki section called?

sullen sigil
#

addaction

ebon wing
#

I see, thanks, ill give it a read!

#

Errors, gone gracias!

tidal ferry
#

Hey- question

Does anybody have any clue if Publisher works on Linux (Ubuntu) terminal?

tough abyss
#

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

tulip ridge
#

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
];
tough abyss
#

@tulip ridge Thank you so much, I cant believe I didnt see this in the documentation, im so stupid. Thank you ๐Ÿ™‚

tulip ridge
#

You're good, no need to apologize over not seeing something

tough abyss
#

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?

teal drum
#

With SQF, how do you differ uniforms from vests and backpacks? I'm not sure of any proper way to do it currently.

teal drum
#

... 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.

warm hedge
#

Can you tell what exactly is the goal?

teal drum
#

Extracting names of all items from commonly used mods/DLCs along with their display names, but now that I think about it

warm hedge
#

Do you have any codes so far?

teal drum
#

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.).

warm hedge
#

Okay this can be simplified like 1000x better, let me write one

teal drum
#

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. ๐Ÿ˜„

warm hedge
#

Would like ask you to what is the point of this
((configFile >> "CfgWeapons") select _i >> "displayName")) regexReplace [" ", " "];

teal drum
#

That's a funky way of dealing with:

warm hedge
#

Ah

#

In your code you have no filter to check if is a vest or nah, right?

teal drum
#

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.

warm hedge
#

And you want to have _all_items with [[uniform],[vest],[backpack]] or something like that?

teal drum
#

Yup.

warm hedge
#
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

teal drum
#

๐Ÿ˜„ Thank you so much!

warm hedge
#

Feel free to ask what's behind my code or if something was new for you

teal drum
#

I think scope == 2 is confusing for me. What does it signify, exactly?

#

Like, what difference does it make here?

warm hedge
#

scope controls โ€œis it visible or invisibleโ€

teal drum
#

Ah!

warm hedge
#

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

teal drum
#

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!

teal drum
#

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. ๐Ÿค”

warm hedge
#

1 is rifle, 2 is pistol, 4 is launcher IIRC

teal drum
#

Yup, config viewer seems to confirm that!

teal drum
#

Ooh. Compasses and radios seem to be tricky.

warm hedge
#

I think were based on simulation

teal drum
#

Looks like it, but it's slightly tricky. The values are more or less similar...

tough abyss
#

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?

warm hedge
#

Without knowing the Mod nothing really can be told

#

And which HUD you mean

tough abyss
#

Hi, im new to arma3 modding but im a java programmer. thanks for replying.

#

it has a file named hud.sqf

#

Im not understanding where its loading the hud. I want to find it so I can add another line to it.

warm hedge
#

cutRsc does

tough abyss
#

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?

warm hedge
#

Basically yes

#

It is predefined in the display aka Resource's config

tough abyss
#

hm

#

Native of the game?

warm hedge
#

No

tough abyss
#

Im sorry, I dont understand

warm hedge
#

Then I probably don't know

Native of the game?
mean I guess

tough abyss
#

So If I write 10863, it should get the next line?

warm hedge
#

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
tough abyss
#

Where did you get that?

warm hedge
#

Config

tough abyss
#

config.bin

warm hedge
#

Yes

tough abyss
#

I understand

warm hedge
#

But you need to unbin that

tough abyss
#

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

ebon wing
#

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?

warm hedge
#

Yes. addAction only executes on local

devout gust
#

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?

dreamy kestrel
#

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...

hallow mortar
warm hedge
#

An UAV requires crews to work though

hallow mortar
#

Presumably that's why he's trying to create crews only for UAVs

warm hedge
#

Ah, yes I've read it wrongly

dreamy kestrel
#

ah yes regardless of if it has a crew or if it is empty being the key. thanks!

deft lotus
#

Does anyone here know how to edit the Liberation File to allow for players on 2 different factions?

sleek token
#

Just add playable units of the different faction?

dreamy kestrel
deft lotus
deft lotus
sleek token
#

Yes you can

deft lotus
#

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

dreamy kestrel
dreamy kestrel
tough abyss
#

How do I escape the '%" character? __ctrlhealth ctrlSetText format["%1 % Health", round (_playerHealth)];

winter rose
tough abyss
#

Thank you ๐Ÿ™‚

digital hollow
ebon wing
tulip ridge
#

remoteExec

ebon wing
tulip ridge
#

There's an example of it on the addAction page

ebon wing
#

O lemme take a look

#

Ohh I see

#

So I have to remoteExec all the addActions individually?

tulip ridge
#

Could make a function/script that adds them all, and then remote execs that

ebon wing
#

Ahh, so If remoteExec the entire file, everything within that file will be global?

wicked sparrow
#

Does anyone know if it is possible to link a variable to a item or magazine?

ebon wing
wicked sparrow
#

not on a object you spawn in, on a item that is in cfgWeapons

ebon wing
winter rose
ebon wing
#

Anyone know how I can make this global?

where should I put remoteExec?

KEY_Spawn_Positions select _i apply {_x lockInventory true};
wicked sparrow
winter rose
wicked sparrow
#

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?

winter rose
#

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

sullen sigil
#

you could with an ID system similar to tfar/acre but thats a lot of complexity for apples

wicked sparrow
#

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.

sullen sigil
#

no

winter rose
winter rose
#

@tough nacelle ^

tough abyss
#

how often does a if then loop refresh or does it only run once?

kindred zephyr
winter rose
split scarab
#

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"];
    }
};
tough abyss
#
    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

split scarab
#

Is there anyway I can "fake" another player and test it on my own?

warm hedge
#

You can dupe your game and try in your local MP

split scarab
warm hedge
#

But essentially "try it for real" is the only way

split scarab
#

Are any of these settings wrong?

tough abyss
#

what is Base defined as?

split scarab
#

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

tough abyss
#

i dont think sidelogic is correct maybe try player instead in the far left variable

split scarab
#

Wouldn't that send it in the side chat the player is a member of?

#

So all Independent players for example

tough abyss
#

true propably better to use systemchat for the example

#

same thing different colour

split scarab
#

How would I remoteExec that for only the Zeus clients?

tough abyss
#
    if !(player in allCurators) then {
        [[player, "Base"], "Recon team is veering off course!"] remoteExec ["systemchat"];
    }
digital hollow
winter rose
split scarab
#

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?

granite sky
#

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];
split scarab
#

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"];
    } 
};
granite sky
#

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];
};
split scarab
#

Okay, that seems to do what I want, however it still triggers when I fly inside the trigger as Zeus?

granite sky
#

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.

split scarab
#

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

granite sky
#

Well, normal players can zeus too. Depends what you want.

split scarab
#

I want pure Zeus slots

granite sky
#

Never used that personally, wouldn't know.

split scarab
#

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...

hallow mortar
tough abyss
#

sqf pastebin not work anymore? my bookmark doesnt seem to work