#arma3_scripting

1 messages · Page 688 of 1

noble flint
#

Thats it?

#

oh

#

I have to define if so

winter rose
#

the pinned message in this channel about SQF is a good starting point too if needed

noble flint
#

The one by you?

little raptor
noble flint
#

gotcha

winter rose
#

The one by me 😎 😜

noble flint
#

I still am trying to figure out how I use the CursorTarget command

little raptor
past wagon
#

Am I using the remoteExec syntax correctly?

["Hello", 100, 100, 1, 0, 0] remoteExec ["BIS_fnc_dynamicText", 0];
noble flint
little raptor
#

not sure about the arguments

past wagon
#

oh

winter rose
#

0 is optional for remoteExec

past wagon
#

yeah ik

little raptor
# past wagon oh

I mean idk if they're correct. if you checked the wiki then they're probably correct

past wagon
#

ok then yeah

#

thanks

noble flint
#

Do I have to define something?

little raptor
noble flint
#

{if cursorTarget unlinkItem hmd}

little raptor
#

😐

noble flint
#

First day man

#

Don't shoot me

#

I can't find many examples with cursortarget

little raptor
noble flint
#

Target something

#

with my cursor for a function to happen

little raptor
noble flint
#

Removing NVGs

#

from a unit

#

on cursor

#

@little raptor

little raptor
noble flint
#

I think I made it worse

little raptor
noble flint
#

insisted on doing it my way

#

and have no idea what im doing

#

still getting an error

#

unlinkItem hmd cursorObject

#

eh

#

How do you target something ..

winter rose
#

aiming down sights? 😁

noble flint
#

Im trying to do a Zeus module

little raptor
noble flint
#

attachedTo _logic?

#

I'm overthinking this

spark turret
#

🍿

noble flint
#

I'm using the Zeus module to target a unit to remove the attached NVGs they have

#

@little raptor

little raptor
noble flint
#

What ..

winter rose
#

could you not do it with a custom Zeus drag & drop module?

noble flint
#

That's what I'm trying to create.

winter rose
#

(I don't know a lot about Zeus)

little raptor
noble flint
#

I'm reading other code to try to understand how to code Zeus modules.

#

script starts off with these ```sqf
params ["_logic"];

private _unit = attachedTo _logic;
deleteVehicle _logic;

private _isAttached = !isNull _unit;

#

No idea what any of that is

#

Is it talking about game logic?

#

Might be way to advanced for me

little raptor
#

if so you can try this:

params ["_logic"];

private _unit = attachedTo _logic;
unlinkItem hmd _unit
#

no

#

I just found this:

#
_unit = objNull;
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objnull) then {_unit = _mouseOver select 1;};
noble flint
#

mouse over

#

interesting

little raptor
#

BIS_fnc_moduleRemoteControl

little raptor
noble flint
#

Might be close but not yet there

little raptor
noble flint
#
["Custom Modules", "Remove NVG",
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; 
if ((_mouseOver select 0) == typeName objNull) then { 
  _unit = _mouseOver select 1; 
  unlinkItem hmd _unit; 
};                 
] call zen_custom_modules_fnc_register
noble flint
#

what is?

little raptor
#

sharp already told you

winter rose
#

{}

noble flint
#
["Custom Modules", "Remove NVG",
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; 
{if ((_mouseOver select 0) == typeName objNull) then { 
  _unit = _mouseOver select 1; 
  unlinkItem hmd _unit;}
};            
] call zen_custom_modules_fnc_register
#

is that closed now?

digital torrent
#

hi, anyone has a method for additemcargo or additemcargoglobal but on dedicated server?
It works on multiplayer but on dedicated server, they dont show up for player. I was thinking of adding them local but idk if for each player, the item increase due to locality

copper raven
#

additemcargoglobal should show up for everyone, regardless of locality

noble flint
#

Looks like its still not running

digital torrent
#

i tried on the init in eden but it isnt working

copper raven
digital torrent
#

like it work on multiplayer but not in DS

noble flint
#

I closed it this time

#

Am i suppose to close all of it?

copper raven
noble flint
#
["Custom Modules", "Remove NVG",
{_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];  
if ((_mouseOver select 0) == typeName objNull) then {  
  _unit = _mouseOver select 1;  
  unlinkItem hmd _unit;}
};    
] call zen_custom_modules_fnc_register
copper raven
#

still wrong, }; ] call zen_custom_modules_fnc_register
that ';' is illegal

noble flint
#
["Custom Modules", "Remove NVG",
{_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];  
if ((_mouseOver select 0) == typeName objNull) then {  
  _unit = _mouseOver select 1;  
  _unit unlinkItem hmd _unit;
}    
] call zen_custom_modules_fnc_register
copper raven
noble flint
#

Wrong usage?

noble flint
#

Fixed it above

#

But now it isn't registering as a module

copper raven
#

ye because there's a missing '}' now

noble flint
#
_unit unlinkItem hmd _unit;}
#

right?

copper raven
#

yes

#

but if you indented your code properly, you'd have seen it already

noble flint
#

What is the correct way to indent

copper raven
#
_a = 1;
{
_a = 2;
}

vs

_a = 1;
{
  _a = 2
}
#

so

[
    "Custom Modules", 
    "Remove NVG",
    {
        _mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
        if ((_mouseOver select 0) == typeName objNull) then {  
            _unit = _mouseOver select 1;  
            _unit unlinkItem hmd _unit;
        }
    
    ^ here
    
] call zen_custom_modules_fnc_register

you can clearly see a missing '}' now

little raptor
#

more generally

{
  {
    {
    }
  }
}
noble flint
#

by 3 it looks like prob preference right?

copper raven
#

usually it's 4

noble flint
#

Welp

#

I feel pretty dumb

#

I'm going to digest what I've learned today.

#

The best way to see what things is to look at other code, and the wiki?

#

Also whats the best way to debug your code

winter rose
winter rose
noble flint
#

I shouldn't use arma to debug it right

#

I feel like that would mislead me

winter rose
#

there is debugging and debugging

if you write code and it doesn't compile, write/indent/check it properly
if you write code and it doesn't do what you want then yes, debug by asking here, checking the wiki, etc

weary hare
#

Can tags not include numbers in them?

copper raven
#

tags?

weary hare
#

the tag for my functions

copper raven
#

you can't have global identifier starting with a digit

#

that's about it

weary hare
#

aah

#

that's good to know

#

thanks

worn bone
#

Quick question (I hope)
I create a waypoint for a group using:
_wp0=nase addWaypoint [getMarkerPos "shilka_1",0];
_wp0 setWaypointDescription localize "@STR_cwr3_cwc30_wp1";

So far, so good. But how can I hide the black markers and line connecting my position and the waypoint destination?
[nase,0] setWaypointVisible false; doesn't do that

copper raven
#

you mean on the 2d map?

worn bone
#

yes

copper raven
#

i know what you mean, but i don't think that's possible, maybe map content difficulty setting?

worn bone
#

Thought as much as I can't find anything to hide them, no matter how long I search

winter rose
copper raven
#

that hides it on 3d

winter rose
#

it links to showWaypoint for the map! @worn bone

worn bone
#

Let me try that. Should work with no waypoints for players at all. Makes your life more enjoyable 😆

#

Nope, still visible. Even when 'waypoints' are set to hide in game options.
_wp0 =nase addWaypoint [getMarkerPos "marker0",0];
[nase,0] showWaypoint "NEVER";

digital torrent
#

how can i make a script that select a code in random and execute it?

this addaction ["hi",{selectRandom [hint "1",hint"2",hint"3"]}];
#

i keep getting 3

copper raven
#

you're calling selectRandom on nothing basically

digital torrent
#

oh it is not inside the []

copper raven
#

this addaction ["hi",{hint str ceil random 3}]; ?

#

this addaction ["hi",{call selectRandom [{}, {}, ...]}];

digital torrent
#
this addaction ["hi",{call selectRandom [{hint"1"}, {hint"!"}, {"hint"3"}]}];
#

Generic error in expression

copper raven
#

yea, you can see it based on syntax highlighting

digital torrent
#

got it. perf thank you!

little raptor
#

@digital torrent better selectRandom the text

copper raven
#

hint is just pseudocode

digital torrent
#

what do you mean?

copper raven
#

i guess

digital torrent
#

yea it is

#

XD

#

puting the whole code just going to create complication

astral dawn
#

so funny that there are so many commands that I still keep seeing new command names

copper raven
#

sure, but you need to script it

noble flint
#

How would I know when to use a function or command?

#

And what does it mean to define something

#

#define

copper raven
noble flint
#

So many commands

#

I dont even know where to start

#

To even learn

#

What does _this select 0 do?

#

Or where can I find that

#

Belongs to?

copper raven
shadow knoll
#

im still having this problem in the editor where my units arent starting with the equiptment i gave them through the editor

#

does the edit loadout feature just not work?

copper raven
#

ai units?

shadow knoll
#

any unit

#

they are for player slots

copper raven
#

i mean if you have respawn enabled, you need to reapply them

#

that's the only reason i can think of for it to not work

shadow knoll
#

im using the menuposition respawn template

copper raven
#

and apply the loadout(s) on respawn

shadow knoll
#

if i apply this to initplayerlocal then it will only do it for someone once they join right?

#

and not everytime they respawn

copper raven
#

correct

tough abyss
#

Does anyone know how to make it so a script is ran after blufor captures a sector module? Thanks in advance.

craggy lagoon
#
player addEventHandler ["WeaponAssembled", {
    params ["_unit", "_staticWeapon"];
    if !(_unit getVariable ["Engineer", false]) then {
        player action ["Disassemble", _staticWeapon];
        playSound "Denied";
        ["<t color='#FFBB00' size = '.5'>You're not an Engineer.</t>",-1,0.8,5,0.5,0,789] spawn BIS_fnc_dynamicText;
    };
}];

The script above applies to every static assembly, but I would like it to only apply to the "B_G_HMG_02_high_F". Would someone be able to help me write this correctly please?

late jacinth
#

so this is great. Got the live feed to work, but can someone please help me out.. ? I want to play it on a tv I already have spawned in the game. OR... figure out how to place the tv where I want it. with this script it just places it ahead of me facing the opposite direction . Thank you _video = ".ogv";
_screen = "Land_TripodScreen_01_large_F" createVehicle (player modelToWorld [0,10,0]);
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;

#

sry, not live feed, prerecorded video

#

I have spent a lot of time with this, surely it's something small I am missing. please help

fair drum
fair drum
fair drum
opal turret
#

Anyone know of a function or code to reset ace stamina mid-mission?

tough abyss
# fair drum the sector module has an "expression" box you can input code into. write it in V...
    params[ "_sector", "_owner", "_ownerOld" ];
    
    if !( _owner isEqualTo sideUnknown ) then {
        [east, 50] call BIS_fnc_respawnTickets;
        wa1 hideObjectGlobal false;
        "Respawn_west" setMarkerPos [2671.527,2873.644,0];
        deleteMarker "Respawn_east"; 
        s1 enableSimulationGlobal false; 
    };
}] call BIS_fnc_addScriptedEventHandler;```
I'm new to scripting so i'm properly missing something obvious but how to i make it so this only fires when blufor takes the sector, thanks in advance again.
late jacinth
#

thx all, I'll give it a try

#

so I figured out most of it but still the placement is troubling still. I am using now CreateVehicle GetMarkerPos "my marker name here" .. is there a way to get it to face a different direction?

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
winter rose
#

plz 😅

#
_video = "video file path";
_screen = "Land_TripodScreen_01_large_F" createVehicle getmarkerPos "marker variable name";
_screen setdir 180;
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;
late jacinth
#

oh, ok.. . thx

proven charm
#

how come none of the camera target functions (camSetTarget etc) wont work for curatorCamera ?

winter rose
#

which camera commands do work with this camera?

#

I also believe "because it would lock Zeus onto one target" and it is not an acceptable state

proven charm
proven charm
#

but camSetPos doesnt work either

#

curatorCamera SetPos does work but when I try to turn the camera with setVectorDirAndUp then the camera freezes

#

maybe worth making a ticket?

winter rose
#

nah 😄

proven charm
#

u kidding?

winter rose
#

well… I don't see that being fixed but I might be wrong 🙂 search for an existing ticket if any, otherwise create it yeah 🙂

proven charm
frosty cairn
#

How do I make a trigger be activated by a specific object?

cosmic lichen
#

Sync the object with the trigger.

frosty cairn
#

what if its a an object that gets spawned in by script @cosmic lichen ?

somber radish
# frosty cairn How do I make a trigger be activated by a specific object?
Private 
_Detector = createTrigger ["EmptyDetector", (_Pos), false];
_Detector     setTriggerActivation ["Any", "PRESENT", true];
_Detector     setTriggerArea [6.2, 6.2, 0, true];
_Detector   setTriggerTimeout [0.5, 0.5, 0.5, true]; 
_Detector     Setpos (_Pos); 
waituntil {(_Detector distance _Pos) < 5}; // seems to be a slight bug where the trigger is irregular in registering objects, this line gives the trigger the time needed to register properly
uisleep 0.5;
_Detector     Setpos (_Pos);                 // as stated above, this ensures that the trigger is in place.

if (list _Detector IsEqualTo []) then {_Fob_Clear = true};
if !(_Fob_Clear) exitwith {["Something is blocking the car-spawn area, teleport try to clear it out", [0.7,0.1,0.1,0.8]] spawn Tally_Fnc_Short_Msg; deletevehicle _Detector; };

You could use this and tweak it a little to make it fit your use,

#

Maybe change the if Condition to

#
if ((MyUnit) in (list MyTrigger)) then {Your code};
copper raven
#

why even use triggers like that

fluid wolf
#
_Spawnposition = "BP1Spawn1";
_grp = createGroup [east, false];
_unit1 = _grp |#|createUnit [ "O_Rifleman", _Spawnposition, [], 0, "FORM"];```

Expected 3 elements... received 0... this is almost exactly the example on the BI Wiki though...? Did I miss something obvious?
little raptor
#

it should be an array (3D position)

fluid wolf
#

,................................

#

Yea that would be it wouldn't it XD. AGH

somber radish
little raptor
fair drum
somber radish
#

of the loop I mean

little raptor
# somber radish Could you give me a practical example?
_Detector = createTrigger ["EmptyDetector", (_Pos), false];
_Detector     setTriggerActivation ["Any", "PRESENT", true];
_Detector     setTriggerArea [6.2, 6.2, 0, true];
_Detector   setTriggerTimeout [0.5, 0.5, 0.5, true]; 
_Detector     Setpos (_Pos); 
_Detector setTriggerStatements ["specificObject in thisList", "code_on_act", "code_on_deact"];
somber radish
#

AAh

#

nice

#

yeah

little raptor
somber radish
#

Sooo I just have to share this:

#
Private _Texting_String = {

params ["_Ctrl", "_String", "_Time"];
private _Letters = (count (_String));
private _Sleep = (_Time / _Letters); 
private _Selector = 1; 

for "_i" from 1 To (_Letters)      do {
_Ctrl ctrlSetText (_String select [0, (_Selector)]); 


_Selector = (_Selector + 1);
sleep (_Sleep)}};

I just got so proud of this little thing, and only the nerds on here will even bother to critique it

somber radish
#

Get feedback

amber lantern
#

Hey

#

Say I need something like
_x=y;
_x addAction ["asdf", {_x setPos ...}, ...];

is the only way to do this with a global variable?

#

And if so, how do I get a unique global variable?

copper raven
#

if you need a different object, then you can pass it through the arguments (see wiki)

amber lantern
#

I see, thanks!

#

@copper raven how about in general?

#

Like if I'd need a reference to an object inside some callback that doesn't provide either of those (for some reason)

#

is it then globalvar?

#

And is there a way to get a unique global var?

copper raven
#

depends on the context really

#

"unique global var"?

little raptor
amber lantern
little raptor
amber lantern
little raptor
copper raven
amber lantern
copper raven
#

...?

#

you mean generate them or what?

little raptor
#

using its arguments param

amber lantern
#

Yeah perhaps I'm thinking about it unnecessarily 😄

copper raven
#

i mean, just stick to common naming conventions, there is not much else about it, you want to use a unique tag so you don't override some other variable, e.g by some other mod or mission. yea you could say that then they're the ones breaking the rules, but it's better to be safe from your side with stuff like that, i.e myVehicle vs emil_myVehicle

amber lantern
#

hmm

#

I tried using _target in the code

little raptor
#
params ["_target"];

or

private _target = _this#0;
#

exactly the same thing

amber lantern
#

ah I see, thanks!

copper raven
#

i mean you can try and search scripts online blobdoggoshruggoogly

spark turret
#

you can set a vehicle as a rearm/refuel capable in the editor, not sure if you need 3den enhanced

drifting portal
#

How do I find the ammo class name of a weapon? such as "CUP_Vmlauncher_ub32_technical"

#

got it

fair drum
fluid wolf
#

sqf "ServerIntro.sqf" remoteExec ["Execvm", 2];
Does anyone see why this would be executing 6 times on a server when the script does not have any loop? (and is pretty simple overall)

spark turret
#

you put in in init.sqf or an object init and played with server + 5 people

fluid wolf
#

thats in a trigger thats server executed

#

it is not in init.sqf

copper raven
#

server executed, and you remoteExec server?

#

anyways that's not the issue, perhaps your trigger is repeatable?

fluid wolf
#

it is repeatable, is that the issue? I want to be able to run it more than once but not fire it 6 times at one click

copper raven
#

well that answers your initial question

fluid wolf
#

so repeatable is making it fire for every clienet even on the server???

copper raven
#

no

#

repeatable means it can fire multiple times on server

fluid wolf
#

Ok... so can you reset a trigger after a few seconds or something?

copper raven
#

reset?

fluid wolf
#

Because I wont need to run it more than like once a minute at worst

copper raven
#

i mean you just need to adjust your condition

fluid wolf
#

Alright.

#

oof...

spark turret
#

I think the condition has to become false first before it fires again

#

Like a lightswitch

fair drum
#

how did you manage to avoid the code block in this message to give the example of the tildes?

fair drum
#

```sqf
no codeblock for me
```

#

okay cool

winter rose
buoyant abyss
#

Attributes > ACE Settings > Rearm,

or something like that, I don't remember the exact tree

tough abyss
lavish sparrow
#

I managed to fix the dreaded black screen after rejoining as Zeus in a scenario. Only when I now rejoin I don't enter the Zeus mode and fall to the ground. Due to the ZEN mod. Any solution to that?

I use this to fix the black screen:

{
    if (!isnull (getassignedcuratorunit _x)) then {
        _unit = getassignedcuratorunit _x;
        if (isnull (getassignedcuratorlogic _unit)) then {
            unassignCurator _x;
            sleep 1;
            _unit assignCurator _x;
        };
    };
} foreach allcurators;
dreamy kestrel
hollow lantern
#

is there a convenient way to get a config path based on a classname? So you supply a classname and it will return the path

opal turret
#

You using 3den enhanced?
Believe there's a "find in config viewer" option which will take you to the right page and shows the full path on the lower portion of the screen.

hollow lantern
#

that would require the classname to be a placeable object in 3DEN

#

yeah

opal turret
#

BIS_fnc_configPath

Though there's no examples of using a classname, it does accept a string as first parameter so may work.

hollow lantern
#

yes, but input needs to be a config

fair drum
# tough abyss thanks for the replys but how do i stop it firing when other sides captures the ...
params [
    ["_sector", objNull, [objNull]],
    ["_owner", sideUnknown, [sideUnknown]],
    ["_ownerOld", sideUnknown, [sideUnknown]]
];

switch _owner do {
    case west : {
        /* Code if the owner is switched to blufor */
    };
    case east : {
        /* Code if the owner is switched to opfor */
    };
    case independent : {
        /* Code if the owner is switched to independent */
    };
    default { /* do nothing if nothing matches */ };
};
tough abyss
limpid maple
#

making a training map for my unit , it has a bunch of training ranges. I wanted to get some tanks to fire down range the whe time with an interval. No specific target.

lavish sparrow
fair drum
limpid maple
#

none.

#

lol

limpid maple
#

Thanks.

cosmic lichen
#
[] spawn
{
  while {alive tank} do
  {
    private _targetPos = getPos tank vectorAdd [random 1000, random 1000, random 1000];
    tank doWatch _targetPos;
    sleep 6;
    [tank, "cannon_120mm_long"] call BIS_fnc_fire;
    tank setVehicleAmmo 1;
  };
};
#

Works with the MBT Kuma

#

if you use a different vehicle you need to get the muzzle of the vehicle

#

Easiest way is to get into the gunner seat, select the wanted weapon and execute currentMuzzle player

#

replace "cannon_120mm_long" with the muzzle you retrieved

craggy lagoon
tough abyss
#

after i disable a sector module with enableSimulationGlobal when i enable the sector it just doesn't let me capture it, thanks in advance

fair drum
tough abyss
#

GWsetmyxPeepoSad is there any way to make it so it only activates once the previous one has been taken?

fair drum
tough abyss
#

the sector module itself

fair drum
# tough abyss the sector module itself

try syncing it with a trigger for the area, then disabling the sim of the trigger. that way the sector module can keep doing its thing and not error out. change the trigger, not the module

tough abyss
#

alright thanks

digital torrent
#

hello, i am i having difficulty for creating a simple random adding item/weapon into a cargo box. The SQF would be called on the box/cargo's init

If someone can add or suggest how to make that the selectrandom select 2 or N set of weapon out of the list instead of 1, it would be appreciated.

https://sqfbin.com/oyeqidikururodamenax

fair drum
dreamy kestrel
#

Q: is there a way to determine if a player is "in" a building?
Q: or for that matter, count the number of units "in" a building?

tight cloak
#

so i was making a script, and in part of it. it would run an fps check.
i found arma has one built in: A3\functions_f\diagnostic\fn_fps.sqf
and that it outputs to hint and global chat, so i thought hey ill use it. but it doesnt work. it throws alot of errors. am i missing something obvious?

#

i presume im missing an #include etc

warm hedge
#

Without telling us how you do, nothing can be said

tight cloak
#

execVM ["A3\functions_f\diagnostic\fn_fps.sqf"];

#

@warm hedge

#

wait...

#

i might be stupid

#

give me 2 seconds

dreamy kestrel
# dreamy kestrel Q: is there a way to determine if a player is "in" a building? Q: or for that m...

so far what I can come up with is this, but I'm not positive how to turn the question more or less inside out. for instance, it is possible to ask for allUnits, but that's cumbersome and inefficient. my starting point is a building, for instance. that is the perspective from which I would like to ask the question.

// responds with the building 'containing' the player, for starters...
CF_ALL_OBJECTS = 32;
lineIntersectsObjs [atltoasl (getpos player), atltoasl (getpos player vectoradd [0, 0, 20]), objnull, objnull, true, CF_ALL_OBJECTS];
tight cloak
#

yeah i realised my mistake, for anyone who may stumble across this:
[10, "", 0] call BIS_fnc_fps
^^ is the line to use, [duration, sceneid, start delay] then run the func

late jacinth
#

when I place a tv or billboard, whatever it may be. I can change the texture to a video, but how do I make it so the sound actually sounds like it is coming form the tv?? I know the say3D command but it doesn't seem to do anything when the video starts playing. Thanks

spark turret
#

hm are you sure its bc of the type of parachute?

#

i have in the past attached units to normal parachutes and added velocity [0,0,-5] f.e. without problems

drifting portal
#

is BIS_fnc_timeline_play global?

winter rose
drifting portal
winter rose
#

remoteExec

drifting portal
#

hmm

#

but isn't this function called?

winter rose
#

it can be spawned, so don't worry

drifting portal
#

thanks

craggy lagoon
#

If I have the "AI Unconsciousness" option in ACE Medical off, could it be scripted to allow some eden placed units to be set to an Unconscious state allowing them to be revived? Or is it an all or nothing option?

dreamy kestrel
cosmic lichen
#

boundingBoxReal

#

inArea

dreamy kestrel
#

If there is, great; I took a slightly different tact side slipping the question.

#

ah ok, thanks...

desert palm
#

how to edit the fatigues carry weight and to have it carry more items?

spark turret
#

you mean a clothings inventory size?

desert palm
#

yes

spark turret
#

config mod. no scripting afaik

desert palm
#

how im in the pbo of the mod

#

what file is to edit

spark turret
#

uh its config 😄

desert palm
#

the cpp?

spark turret
#

idk the name of the field sry.
yeah cpp sounds right

desert palm
#

okie thanks

winter rose
#

does not improve room but improves weight capacity

desert palm
#

what does that mean? my guy is much more faster?

winter rose
#

…no?

#

it means weight impacts you less

desert palm
#

oh okie thanks

faint oasis
#

how can we "setVelocity" on a "Steerable Parachute" ?

copper raven
#

_parachute setVelocity [...]?

digital torrent
austere hawk
#

is there a BIS function to get a random position inside an area (marker/trigger)? Didnt see one on biki

digital torrent
#

@austere hawk

austere hawk
#

ah thanks, i was looking for marker/ area/trigger all the time 🙃

digital torrent
#

it can be marker or trigger, look example 5 and replace position player with getmarkerpos or anything you wish

faint oasis
#

@copper raven this is the problem we can't do "_parachute setVelocity [...]"

copper raven
#

how come?

copper raven
digital torrent
#

it just says error that why i am lost

#

maybe the _lootbox is undefined

#

i think the (_this select 1) dont work

copper raven
#

ah well i didn't look at the top part

#

you got a missing ';'

digital torrent
#

_lootbox = [];
_lootbox = (_this select 1);

#

this?

copper raven
#

remove the first assignment entirely, and yes

digital torrent
#

remove _lootbox = [];

#

is what u mean?

copper raven
#

yes

digital torrent
#

it is saying error

#

_lootbox = (_this select |#|select 1);
.....etc

error select: type object, expected array,String,Config entry

copper raven
#

well that's self explanatory

digital torrent
#

but _lootbox is the init of the box i am putting no?

#

so technically (_this select 1) should work no?

copper raven
#

how are you calling the script

digital torrent
#

0 = this execVM "loot.sqf";

#

in the init of the box in editor

copper raven
#

well you're passing an object

#

and then you're calling select on it

#

which obviously won't work

#

so either wrap this into array, or omit the select

digital torrent
#

but the additemcargoglobal are being added on the object

copper raven
#

[123] execVM "script.sqf"

// inside script.sqf
// _this is [123]
_oneTwoThree = _this select 0;
#

hope it makes sense

#

equally,
123 execVM "script.sqf"

// inside script.sqf
// _this is 123
_oneTwoThree = _this; // no more select, because we passed a number 123
digital torrent
#

@copper raven thanks it worked

plush falcon
#

How do I add a custom horn sound?

turbid tide
#

not sure if this is the correct channel to ask this question but I am having some trouble getting my description.ext to work, any help/info is greatly appreciated

winter rose
turbid tide
#

im trying to add the new CDLC radio AI fire support thing into a mission that i no longer have the original folder for, so im trying to add the description.ext file into it after the fact and im not sure if its the code that i have put in or if its just not loading the desc.ext file when added to the .pbo file

winter rose
#

if the config works in the editor, it should work in the pbo'd mission

turbid tide
#

yea so i wasnt sure how to test if the code even works or if there was other stuff i needed in the desc.ext file

winter rose
#

just to be sure, description.ext, not desc.ext, descr.ext or description.ext.txt

turbid tide
#

yea its just "description.ext" without the quotes

#

i was only shortening it for ease of typing

winter rose
#

for info you don't really place code in description.ext, but config

can you show your file (on pastebin for example)?

turbid tide
#

its the example code from the savagegamedesign wiki page on it

#

but ill get a paste bin link to it one sec

#

i never changed anything other than the availability binary array

drifting portal
#

When using keyframe animation and hosting using client server, when I switch to camera thats is attached to the keyframe animation, on my POV it works fine, but when it moves my friends POV is basically the camera clipping through the map, while for me its fine

#

using remoteExec to both start the timeline and switch to camera

shadow knoll
#

is there a command to disable and enable revive i can put in an sqf file. i dont want to put it in my desctiption.ext

copper raven
#

there is a config switch only im pretty sure

#

you can maybe look into the revive functions and see if you can find a way to do it

winter rose
#

there is the Revive function group to check

shadow knoll
#

i figured it out

#

well actually

#

thank you @astral dawn

#

that code you provided me with saved me

#

is it BIS_fnc_reviveInit @winter rose

digital torrent
#

How can i make the below work on Dedicated server? the Setfuel dont happen. Tried to run the sqf in both init and initplayerLocal

if(isServer) then {

waituntil{ 
 
if (speed car23 >= 30) then {car23 setfuel 0; "Limit speed script" remoteExec ["hint"];} 
else {car23 setfuel 0.1}; 
 
sleep 1;  
false
};

};
drifting portal
digital torrent
#

on dedicated server?

drifting portal
#

I tried it on a server client, so not sure

digital torrent
#

ok i will try it. bc i know on multi it work but idk for dedicated

#

yep worked

#

i though setfuel was global, guess was wrong XD

copper raven
#

global effect, local argument

ashen warren
#

hey guys,

Hopefully this might be a simple fix.

trying to pass an array variable over to another SQF.

Shows that _tracks is undefined when running the script

parameters = [_tracks];
_selecter = 0;

_selecter = fl>
23:03:02   Error position: <_tracks];
_selecter = 0;

_selecter = fl>
23:03:02   Error Undefined variable in expression: _tracks

Main.sqf

_tracks = ["LeadTrack01_F", "Track15_MainTheme", "Track14_MainMenu", "LeadTrack03_F_Mark"]; 


["_tracks"] execVM "music.sqf";

Music.sqf

params = [_tracks];
_selecter = 0;

                _selecter = floor(random count _tracks);
                playMusic (_tracks select _selecter);

This is the simplest example I can give cause music.sqf would be on a different function that repeats and would not like to have it check\rebuild an array every time on the actual official script.

any input is appreciated

cold pebble
#

In main.sqf you don’t need the speech marks around the _tracks variable

#

And music.sqf doesn’t need = in params, go look at wiki for how it’s meant to be

cosmic lichen
#

_selecter = floor(random count _tracks);
playMusic (_tracks select _selecter);

playMusic selectRandom _tracks;
#

params = [_tracks];
this is just wrong

#

Read params command page

cold pebble
#

🙃

cosmic lichen
#

Some entries in CfgMarkers have color[] = {"color_Civilian",1}; their color defined this way. What is color_Civilian referring to?

winter rose
#

is it not the blufor/opfor/indfor/civilian profile colour?

cosmic lichen
#

That would be color[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])","(profilenamespace getvariable ['Map_BLUFOR_G',1])","(profilenamespace getvariable ['Map_BLUFOR_B',1])","(profilenamespace getvariable ['Map_BLUFOR_A',0.8])"};

#

So idk 😄

#

Feels more like a left-over from pre-arma3 times

copper raven
#

it is technically that yes, the civilian side color

#

i remember just hardcoding civilian gui color if color[] size is 2

cosmic lichen
#

Did that as well, not bothering with it any further.

glossy pine
#

its possible to create a object inside a house that always have the same dir, indepent if dir of the house is different without use the command attachto?

little raptor
glossy pine
#

ok, thanks

little raptor
# glossy pine ok, thanks

if the house is always upright (which it should be) and so is the object, you can just use _obj setDir (getDir _house + _offset)

drifting portal
#

A simple question: I got an icon at "Arma 3\Addons\ui_f_data\map\diary\signal_ca.paa"
but when I put that in```sqf
iconPicture = "Arma 3\Addons\ui_f_data\map\diary\signal_ca.paa";

 it doesn't work obviously, so what is the true way to put the path?
copper raven
#

\a3\ui_f\data\...

drifting portal
copper raven
drifting portal
copper raven
#

should

#

did you reload the mission?

#

or whatever you're doing

drifting portal
#

return to eden

#

then play again

copper raven
#

well the file path is correct, i can tell you that much blobdoggoshruggoogly

drifting portal
#

restarting the game fixed it

#

thx

copper raven
#

no, you just had the path wrong

#

i saw you edit it 😄

drifting portal
#

nah lol

#

I typo

copper raven
#

typo while copy paste? hmm okay

distant oyster
#

config changes are only applied when the mission is saved in 3den

little raptor
fervent kettle
#

Can someone help to add a vectorAdd to a createVehicle? Tried many times now, but nothing works

private _createChest = "B_supplyCrate_F" createVehicle (player getPos [10, getDir player]); 
winter rose
#

Should work

fervent kettle
#

Yea, but how 😮

#

I didn't post all my possible tryings to get it working 😅

#

Can I just add addVector in that line?

winter rose
#

IDK, but your actual code works

fervent kettle
#

I know

#

That one's working fine

#

but I would like to add an addVector

winter rose
#

then vectorAdd?

fervent kettle
#

now all I've tried dropped me an "missing )" error

winter rose
#
private _createChest = "B_supplyCrate_F" createVehicle ((player getPos [10, getDir player]) vectorAdd [0,0,5]);

won't work well because this syntax will try to spawn it on the ground, but still

fervent kettle
#

hmm i tried the exact same but with an "," between

winter rose
#
private _createChest = "B_supplyCrate_F" createVehicle ((player getPos [10, getDir player]) vectorAdd [50,0,50]);
fervent kettle
#
private _createChest = "B_supplyCrate_F" createVehicle ((player getPos [10, getDir player]), <-- here  vectorAdd [50,0,50]);
winter rose
#

yeah… but why

fervent kettle
#

to seperate I thought

winter rose
#

don't think 😛

fervent kettle
#

Yea, should stop that 😢

#

So I've tried without , but now the crate does not appear 🤔

winter rose
#

it appears where createVehicle can create it; sometimes up to 50m away iirc

so make sure to setPosATL/ASL it for precision positioning

fervent kettle
#

Usually it should be 10m in front of the player, and that space was free

#

the position should in the end not be precise, rather close to the player

#

that 10m is just for quicker testing

drifting portal
#

if I remoteExec creating a vehicle, in a server with 5 players, will it spawn the same vehicle 5 times?

copper raven
#

depends on the target

copper raven
drifting portal
copper raven
#

then it will spawn it 5 times

#

6 if dedicated

drifting portal
# copper raven then it will spawn it 5 times

I need to play a sound to all players and then a shell follows (in the same sqf) but that means if I remoteExec the sqf it will play the sound for them and then 5 shells explode, is there a workaround?

copper raven
#

create the shell on server

#

what are you using for playing the sound?

drifting portal
copper raven
#

yeah so remoteExec that, only

drifting portal
#

Thought so too

#

Thanks

winter rose
#

if a command has a global effect, running it once will have the effect on all the network machines

drifting portal
winter rose
#

meh, idk
we already have plenty

craggy lagoon
#
player addEventHandler ["Take",  {
    params ["_unit", "_container", "_item"];
    if (_item == "ace_csw_100Rnd_127x99_mag_yellow") then {
        [_item, true, [0, 3, 1], 0] call ace_dragging_fnc_setCarryable;
    };
}];

Attempting to set these ammo cans as an item that can be carried by hand. But it's not working. Can someone point out what I'm doing wrong please?

winter rose
#

you are trying to attach a string as an object? IDK, I don't know ace_dragging_fnc_setCarryable

winter rose
#

ta-daaa

copper raven
#

i don't think that's how you're suppose to use it 😄

craggy lagoon
#

Or does "Carryable" mean you can put it in your inventory not carry by hand?

winter rose
#

¯_(ツ)_/¯

copper raven
#

well its for objects

#

nothing to do with inventory id imagine

fair drum
#

@winter rose you still the wiki man? I see that "GroupCreated" and "GroupDeleted" on the missioneventhandler page have not been included yet.

spark turret
fair drum
#

ah didn't know if you gave up that role with the promotion or not

#

who has wiki edit access still? I never got to create an account since account creation was closed years ago.

fair drum
#

why are you like this lol

winter rose
#

no u 😄 I would have expected more suspicion from you hahaha

spark turret
#

hypoxic you just have to dm dwarden, wait 9 months and then miss the 2hour window where he is available

#

lou i want priviledges to summon the !rpt and !sqf bot, pls ❤️

winter rose
#

just type those

spark turret
#

!rpt

wicked roostBOT
#
Arma RPT

Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.

To get to your RPT files press Windows+R and enter %localappdata%/Arma 3

Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files

To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.

spark turret
#

woho!

#

im important!!

#

KNEEL BEFORE ME PEASANTS

winter rose
spark turret
#

since we are at wiki:
waypoints side says AI is incapable of airlifting precisely with "hook" waypoint. thats not true (anymore)

#

works 100% of the time, if the waypoint is at posASL of crate to be lifted.

winter rose
#

plz link?

craggy lagoon
#

Looking at the CSW framework page there seems to be a setting "Scope = 2;" that is missing in the current csw.pbo file. Anyone happen to know what the setting means? Is there a way that I can add or overwrite the current config with that setting to see if it fixes the issue?

class CfgMagazines {
    class prefix_100rnd_hmg_mag;
    class prefix_100rnd_hmg_csw_mag: prefix_100rnd_hmg_mag {
        scope = 2;
        type = 256;  // Must be 256 to show up in Arsenal
        count = 100;
        model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d";
        ACE_isBelt = 1; // Enables belt linking for this magazine
    };
};
spark turret
spark turret
#

❤️

winter rose
craggy lagoon
#

@winter rose Ok thank you for the help, I'm afraid a mod might be a bit out of my league at this point.

winter rose
fierce solar
#

Whats the script for insta-killing anything inside a trigger?

little raptor
fierce solar
#

thx

#

it says Condition: Local variable in global space

little raptor
#

as I said:

thisList if in one of trigger statements

#

so:

{
  _x setDamage 1;
} forEach thisList
fierce solar
#

fair enough

plush falcon
#

Can somone point me to directions on how to change the horn for a car?

#

in mutiplayer

drifting portal
#

is there a way to retract landing gear of a plane controlled by ai?

plush falcon
#

Like unmodded

winter rose
#

you are doing a modification, so a mod 😄

plush falcon
#

I mean like the player doesn't have to install addons

#

just join and play thing

#

like a texture switch

winter rose
#

you could maybe intercept and script it

drifting portal
little raptor
#

I don't remember its name

#

maybe Gear?

#

or LandingGear

drifting portal
#

oh

#

you mean that one

#

I already used it

#

LandGearUp
Description: Raises the landing gear of an aircraft. Only works on player controlled aircraft.

drifting portal
#

wiki bruh moment

little raptor
#

it does work on AI aircraft

drifting portal
drifting portal
drifting portal
cosmic lichen
novel delta
#

sorry for probably a noob question but,
Im trying to make a trigger that warns you (only the player that enters it) that you entered the area
does anyone have any suggestions on how to do this?

#

along with telling you when you leave it

novel delta
#

heres what i have right now that doesnt work

#

condition

player in thislist```
On activation
```sqf
hint "You are now entering a restricted zone.";```
On Deactivation
```sqf
hint "You are now leaving a restricted zone.";```
novel delta
#

nevermind, perhaps i simply missed it earlier but it appears to be working so i guess im just dumb lmao

frosty cairn
#

[taskName, taskState, showHint] call BIS_fnc_taskSetState
What is taskName?

#

Its not the taskID, so Im confused.

#

It's supposed to be a string

copper raven
#

it is task id

frosty cairn
copper raven
#

maybe you're setting it to the same state?

frosty cairn
#

[west, "tskrekdri", ["Got a report that a person is driving around recklessly. Find them, arrest them and bring them to the cells", "Find Reckless Driver and Arrest", ""], person, "CREATED", 1, true, "car", false] call BIS_fnc_taskCreate;

#

while {true} do { if (person inArea cellone isEqualTo true) then { deleteVehicle person; ["taskrekdri", "SUCCEEDED"] call BIS_fnc_taskSetState; }; };

frosty cairn
copper raven
#

well you clearly have a typo

#

and also don't compare a boolean to boolean

frosty cairn
copper raven
frosty cairn
#

Unless Im using it wrong.

copper raven
#

you don't need an if statement

frosty cairn
#

What?

#

What do you mean by that statement.

copper raven
#

waitUntil { sleep 1; person inArea cellone };

#

then do the rest after it

frosty cairn
#

but what do i put after?

copper raven
#

what you want to do after person is in the area cellone

frosty cairn
#

wont it just execute the next line of code anyway, disregarding the waitUntil?

copper raven
#

nope

frosty cairn
#

oh, so its like a sleep almost?

copper raven
#

waitUntil suspends further execution until the condition is true

frosty cairn
#

Ah

#

I see

#

Thank you.

late jacinth
#

when I place an object and add a texture to it, the very first time running the mission I have to move my character directly in front of the object for the texture to be applied. After the mission has been run and the textures activated, the mission can be loaded and the textures are applied at the very beginning of the mission as they should be. How do I fix this? thank you

modest nova
#

hey does anyone here have any experience with HUDs and cutRsc?

cosmic lichen
modest nova
#

i realised that sorry, i put my question in there now

Edit: i found solution to problem nvm

dusky wolf
#

Is anybody decent with setVectorDirAndUp?

#

I'm trying to get an arrow to point in the same direction a player is looking when a script is run. Getting a rotation around the z axis is easy enough with setDir, but I'm trying to get the vertical component as well

#

I'm using getCameraViewDirection to get a direciton where the player is looking

#

When keeping dir at 0, it's easy enough to tilt the arrow to match the player view direction like so

#
_up = getCameraViewDirection player;

arrow setDir 0;
arrow setVectorUp [0,_up#2,-0.5];```
#

But doing that will still tilt the arrow to the north when the direciton is to the east

#

I've tried fooling around with the setVectorUp quite a bit but I can't seem to find a method that comes close to achieving the results I'm looking for

spark turret
#

you need to get the normal of the direction the player is looking in

#

hm thats getting a bit complicated.

#

i think you can get the right facing vector of the player by getting his direction + 90°. then build the cross product of visual dir and right dir, thats your visual normal. use that as the up vector of the arrow

#

like that

dusky wolf
spark turret
#

np

spark turret
# dusky wolf Thanks, I'll give that a try. vectorUpVisual player seems to always return [0,0,...

done.
put this into a function

//gets vector up of a vector
_paramsCorrect = params[
    ["_object",objNull,[objNull]]
    ];

if (!_paramsCorrect) exitWith {
    ["incorrect params given. expects [object], given: ",_this] call Bis_fnc_error;
};

//get visual
visual = vectorNormalized (getCameraViewDirection _object);
//get up
up = vectorUpVisual _object;
//get right
right = vectorNormalized(visual vectorCrossProduct up);
//get visual up
visualUp = vectorNormalized(right vectorCrossProduct visual);

objPos =  ASLToAGL (eyePos _object);
diag_log["getVisualUP:","up",up,"right",right,"visual",visual,"visualUp",visualUp];

then call this in console`

onEachFrame { 
[myDude] call IRN_fnc_getVisualUp;
 drawLine3D [objPos,objPos vectorAdd up,[1,0,0,1]]; 
 drawLine3D [objPos,objPos vectorAdd right,[0,1,0,1]]; 
 drawLine3D [objPos,objPos vectorAdd visual,[0,0,1,1]]; 
 drawLine3D [objPos,objPos vectorAdd visualUp,[0,1,1,1]]; 
};
winter rose
#

There is a vectorFromTo thingy

rough dagger
#

most likely a stupid question, but here goes. I am trying to make stuff happen in MP using keypresses. It triggers everything from initPlayerLocal, and I am trying to get scripts to run from the server based on keypresses. Currently does not work, as I assume as it originated from initPlayerLocal, all scripts thereafter are not considered 'serverside'. I think (not sure) what I need to do is remoteExec things, but as I understand it, remoteExec manages functions and/or commands, but not scripts. So my question is - how can I call a script from player, but have it run on the server? Sorry, I hope that makes sense 🙂

spark turret
#

you can run execVM through remoteExec, but its probably easier to turn your script into a function and remoteExec that

#

for starters you can use soething like that, with execVM "myscript.sqf":

{[] exceVM "myscript.sqf";} remoteExec ["call",2]; // Statement 1

but for the long term, learning about functions is inevitable

rough dagger
#

Rgr wilco 😉 makes sense

#

thank you @spark turret 🙂

spark turret
#

np

winter rose
mental wren
#

Is there a way to get stuff from an API in-game? Like you can load and run mission files, but we've got like 10 zeus templates that all need preset loadouts that change quite often. Is there any way we can make it download that stuff just from a website?

copper raven
#

extension

mental wren
#

hmmm alright

#

I'll look into those

rough dagger
#

thanks @winter rose 🙂

winter rose
rough dagger
#

on it mate 😉

unreal scroll
#

I have a working radio system, that calculates radio contact for units. I need to override chat settings, to show chat messages only for those who can receive it. HandleChatMessage can't do it, so my idea is to block the standard chat (returning true in EH), and put the edited message string (depending on conditions) into another text message. It is very handy to use hints, but for me hints are widely used for other types of radio messages. Is there any other message functions that fit this role?

winter rose
#

HandleChatMessage can't do it
huh?

jaunty ermine
#

is there an easy way to check the player's current optic mode's iteminfo subclass or number (eg if they're using the RCO reddot or magnified optic)?

little raptor
#

not the optic type (e.g. something like "red dot" is not defined afaik)

jaunty ermine
#

don't really care if it's defined literally as "reddot" I just want to figure out which optic mode is currently active

class MyOptic{
class ItemInfo{
  class opticMode1{
    id = 1;
  };
  class opticMode2{
    id = 2;
  };
};
};```
obviously the engine knows which one of those is active currently (swapping them with ctrl + RMB), was hoping there was a way to get them through scripting since there's no standard with class names or order
unreal scroll
#

@winter rose"huh?"
As I understand, we can't filter players with this EH when displaying chat messages. If the message has been sent, it is displayed for all players, or not displayed at all, or I'm wrong?

winter rose
#

I believe you are wrong on this one, I think you can locally prevent the message to be displayed 🙂

winter rose
unreal scroll
#

Ah, thanks, I missed that "it fires clientside" 🙂

little raptor
jaunty ermine
#

that's not really helpful for what I need to do. I need to know which class or at the least id the current optic mode is to check against other params in those classes, particularly if the optic is 3d or uses model optics, and if model optics if it allows NVG

winter rose
#

what is your end goal?

jaunty ermine
#

trying my hand and finishing up a branch of ACE's nightvision that allows you to set the NVG colour through config. I'd prefer to have any NVO not copy the colour of the player's NVG since they're their own standalone NightVision device, while still allowing reddots, ACOGs and other low magnification/3d optics to just use the player's NVG, as if they were looking through the optic through the NVG. I can't find any good way to do that without kinda hacking it, like above, getting all the subclasses of ItemInfo and check if the current zoom matches any of those classes, which won't work

spark turret
#

not sure if i understand, but if you only want to allow low magnification, and can get a zoom level, than thats all you need?

#

if (zoomLevel < maxAllowedZoom) {do NVG shader} ?

jaunty ermine
#

no, I only want to check those with model optics, I don't care about the zoom I only care about what the current optic mode is, and if it uses model optics

spark turret
#

ah okay

slim lion
#

Hey guys I'm using the moveInCargo command to move AI squad into the rhs blackhawk. They all move in ok but a few of them are always standing up instead of sitting down on the bench and they're bobbing up and down. Any ideas to fix this or is it just bug.

winter rose
little raptor
slim lion
#

I'm running it under MP but just playing 1 player

#

Basically I have a script that runs by player trigger to spawn in an AI squad on the liberty but they cannot board a helicopter on the back because they would rather swim in the water or go somewhere else so I use moveInCargo to get them into the chopper so you're saying I need to remote exec on the server?

slim lion
#

ok I think I can just move all my code to execution server only

slim lion
#

ok that fixed it so I just did moveInCargo for each squad member, then have them dismount, then moveInCargo again and they all sit in

cyan dust
winter rose
#

I would guess aL or aG, eG

spark turret
#

random guess without knowing anything:
where vehicle is local.

i had issues with Helis airlifting crates where heli wasnt same locatily as crate. i could imagine that its similar with weapons

winter rose
cyan dust
#

I do understand that locality of a vehicle changes when player jumps in, but why does it stays local when empty meowsweats

winter rose
#

it is local where it has been created

#

and remains local to the PC of the last person leaving it

cyan dust
#

Thanks @winter rose appreciate the help 👍

unreal scroll
#

@winter rose About HandleChatMessage EH. If it fires locally - then I need to add this EH to each client, right? And they don't interact with each other?

winter rose
#

yep

modest nova
#

Does anyone know a way to remove a seat such as gunner seat from an armored vehicle?

little raptor
#

if you don't want anyone to use it, you can lock it

modest nova
#

wouldnt locking it make all the seats inaccesible?

#

what I want to do is make only certain seats inaccessible

modest nova
#

ok, thank you!

shadow knoll
#

so what do i need to use so a player gets an addaction when they are in a certain area?

#

im assuming some sort of trigger

winter rose
#

add the action, and in the condition of its appearance check inArea

modest nova
#

is there a way to createa sort of custom eventhandler that triggers when a certain condition is met without using a while loop with waituntil inside

winter rose
modest nova
#

is that BIS_fnc_addScriptedEventHandler? I couldnt figure ou how to use i when i looked into it before

winter rose
#

ye

unreal scroll
#

@winter rose I wonder why HandleChatMessage doesn't work with exitWith command, like

if (_person == player) exitWith {[_name,_text]};
austere hawk
#

Does somebody have an idea for an efficient/elegant way to "intercept" when a unit has a waypoint/move command into / out of a building, and insert extra behaviour into the waypoint in that case?
I have bunkers that have heavy doors that open slowly, and airlocks that only open one door at a time. I would like AI to be able to acess the buildings, but i dont want them to just run through the doors.
I could break the pathing connection if the door is closed, so they cant find a way. but this would make it frustrating for players to move their AI in/out of the buildings

ornate marsh
#

So i'm wanting to add a world marker from another script so i'm trying this, however i keep getting this error: ```22:20:33 Error in expression <0,2];
_k = 12 / (player distance _pos);
drawIcon3D
[
"\a3\ui_f\data\map\mapcont>
22:20:33 Error position: <drawIcon3D
[
"\a3\ui_f\data\map\mapcont>
22:20:33 Error 0 elements provided, 3 expected

calling the below script using this line `[wave15aMarker] remoteExec ["BEF_fnc_waveMarker",0,true];`
Script is properly defined in functions.hpp
script where the marker is created: https://pastebin.com/vJMJM8tv
unreal scroll
#

@ornate marsh _pos variable is not defined inside the function.
If you want to take a distance to marker, retrieve its coords, 'cause markers are not physical objects:
_pos = markerPos _marker;

astral dawn
# austere hawk Does somebody have an idea for an efficient/elegant way to "intercept" when a un...

I guess you could periodically get a list of all waypoints of a group:
https://community.bistudio.com/wiki/waypoints
Then get positions of all of them, put all that data into an array.
At next check you should check if the data is the same. If it isn't then someone has added a waypoint to the group and you should do your magic magic with the waypoints.
Then about checking for buildings, I think that raycasts work best here. Just cast a ray from ground and upwards, if it hits an object of house type, then the waypoint is in a house.

ornate marsh
fierce solar
#

hey, how would I go upon disabling any sort of player from dropping any inventory item?

austere hawk
astral dawn
wary needle
#

yo guys i public zues every once and awhile. And sometimes we get good scripters, they add zues addons, zombies ect. Is there a way for me to get these scripts so i can improve my ops?

#

Sorry if it sounds like im a evil hacker dude

modest nova
#

im having some trouble in my script, I have it so that in initplayerlocal.sqf it checks when the player enters the area of a marker and uses publicvariableserver to tell the server this. but for some reason it only does this for the first player who joins the mission from the lobby. anyone know why it is doin that?

tough abyss
#

Does anyone have a way to track steam 64 ID in arma to only allow specific accounts to choose a certain role

#

I can’t write it

modest nova
#

basically the script adds a hud which displays the amount of players in the area of a marker on the map

smoky grove
#

So does anyone know how to get setObjectScale to work server side? I can get it working locally but when I upload it to my server the footprints I am trying to scale down are comically large

brazen lagoon
#

Any suggestions for a revive system that works with dynamically spawned units in something like alive?

#

i get recommended AIS which doesn't really work with that super well or sunday system which as far as i can tell just flatout doesn't exist on the internet anymore

copper raven
modest nova
copper raven
#

yeah but what do you do with it?

copper raven
unique sundial
modest nova
# copper raven yeah but what do you do with it?

The client uses publicVariableServer to send a 1 or -1 depending on whether it is leaving or entering the zone, when the server receives that number, it adds that to the zones player count and then sends that back to all the clients in a list of client Id's using publicVariableClient. this count is then used on the client to display the zones player count

copper raven
#

seems correct, allthough this is arma 2 kinda thing, with the public variable event handlers

#

🤔 i mean if everything is implemented correctly, don't see how that wouldn't work

modest nova
#

yeah its been giving me an anneurism all day, i cant figure out why only the first person to get into the mission is detected when entering the zone

past wagon
#

how can I get the amount of ammo left in a vehicle's weapons

past wagon
#

what are magazineClass and turretPath?

#

and will this work for ifrit smokes?

copper raven
#

well magazine class is class of the magazine 😄

past wagon
#

ok

#

well im trying to get ifrit smokes value

copper raven
#

gonna be SmokeLauncherMag i think for smokes

past wagon
#

oh

#

ok

#

thanks

copper raven
#

turretpath will be [-1] i guess, driver

past wagon
#

what is turretPath tho?

modest nova
#

how do i put in an embed to upload my script so that it is easy to read?

past wagon
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
copper raven
# past wagon what is turretPath tho?
allTurrets [_vehicle, true] + [[-1]] apply {[_x, _vehicle weaponsTurret _x, _vehicle magazinesTurret [_x, true]]}

will get you all weapons/magazines with corresponding turret

past wagon
#

hmm

#
_ifritSmokes = _ifrit magazineTurretAmmo ["SmokeLauncherMag", [-1]]; 
#

I followed the syntax from the wiki

#

im just looking for a value; i need to know how many smokes an unarmed ifrit has left so that i can basically replace the vehicle

copper raven
#

well the usage is correct

#

like i said, don't know if thats the correct classname for the smokes mag

#

use the code i gave you to find the correct one

past wagon
copper raven
#

it returns array of arrays with [turret path, weapons, magazines]

past wagon
#

this is an example from the wiki, so I think it is the correct classname:

_tank addMagazineTurret ["SmokeLauncherMag",[0,0]];
#

ok

copper raven
#

turret path might be wrong, i don't think ifrit has a commander turret, [0,0] = commander

past wagon
#

ok

#

that is probably for strider then

#

in a strider, the commander does the smokes

#
_ifritSmokes = _ifrit magazineTurretAmmo ["SmokeLauncherMag", [-1]];
//.......
_veh setMagazineTurretAmmo ["SmokeLauncherMag", _ifritSmokes, [-1]];
#

ok so this is what I have

cyan dust
#

Good day. How do I save and load vehicle appearance? 🤔 Can't find a thing. Need this for vehicle respawn thing that defaults vehicle texture.

cyan dust
copper raven
#

works fine on my end

#

how are you using it?

cyan dust
# copper raven how are you using it?
[_vehicle, [_vehicle, "MYTAG_appearance"]] call BIS_fnc_saveVehicle;
//... and then after respawn
[_newVehicle, [_newVehicle, "MYTAG_appearance"]] call BIS_fnc_loadVehicle;
//Vars from old to new are transferred by BIS_fnc_moduleRespawnVehicle
copper raven
#

yea because you're serializing it into object's namespace

#

either pass the old vehicle in(if it still exists)

#

or use missionNameSpace

cyan dust
copper raven
#

nvm didn't read Vars from old to new are transferred by BIS_fnc_moduleRespawnVehicle part

#

well if they're indeed transferred, it should work

unreal scroll
#

@unique sundial "call {……} your whole EH code so that exitWith exits into main EH scope"
Emm...
As I understand, exitWith should also return something in this case (like return in Python), overriding EH parameters, or no?
And what I need to do exactly? To put the EH function code in code brackets and call it? 🤔 Like

addMissionEventHandler ["HandleChatMessage",fnc_ChatMessageHandler];

fnc_ChatMessageHandler = {
  [_this] call {
    params [...,"_text",...];
    if (something) exitWith {true};
    _text
  };
};
copper raven
#

he meant that yes, but omit [_this] and params

#

useless

#

well params should stay actually, if you're gonna do something with them

unreal scroll
#

Hm... It works. But why? 🙂 What is the difference between exitWith {_text} and just a _text in the end?

copper raven
#

because it's not a new script instance, local variables carry over into lower scopes, but not into new scripts

#

ah for that part i don't really know myself (ignore the above, didn't see you edited the message) 😄

cyan dust
copper raven
#

i mean just make your own function

#

you can look at the source of the other ones, and make your own

cyan dust
drifting portal
#

does playSound play the sound to all players regardless of the 3d position of sound origin? (like a radio message) ?

drifting portal
#

but I basically want it to act like sideRadio, does that work?

little raptor
drifting portal
#

no no I meant it doesn't have a point of origin

#

all players will hear it in the same volume

little raptor
#

playSound has origin? meowsweats

warm hedge
#

Then just playSound?

drifting portal
warm hedge
#

playSound is a 2D sound. No 3D origin

drifting portal
#

thanks

little raptor
winter rose
#

meowthis 👀

drifting portal
drifting portal
#
playSound "speech1";
[["Sam", "Hello", 0], 
["Sam", "and welcome", 2]] spawn BIS_fnc_EXP_camp_playSubtitles;

I'm trying to play a sound and show subtitles at the same time (apex style subtitles) but its terribly out of sync (the first message appears 5 seconds after the sound has ended playing) any fix to this?

winter rose
#

yes, use the Conversations system

#

or a custom function that you remote-execute

winter rose
drifting portal
#

No I'm testing it singleplayer

drifting portal
winter rose
#

you can use a function that will take [sound, subtitles] as arguments

drifting portal
#

true, but BIS_fnc_showSubtitle is also at desync for me

#

thanks

winter rose
#

make it play 1s before playsound then 😄

drifting portal
winter rose
#

I know 😎

drifting portal
winter rose
#

I wrote the page (some years ago) so I may still remember how to do stuff 😄

#

oh, three years ago

drifting portal
#

You wrote that?

#

Well nice lol

acoustic tangle
#

Hello i have a question, how do i script a AA missile always miss?

real tartan
#

how to set default duration to 0 ?
description.ext

    #define SOUND(NAME, DURATION = 0) class NAME\
    {\
        name = NAME;\
        sound[] = { "\sound\##NAME##.ogg", 1, 1, 50 };\
        titles[] = { 0, $STR_##NAME };\
        duration = ##DURATION##;
    };

    SOUND(mySound, 6);
warm hedge
#
#define SOUND(NAME,DURATION) class NAME\
{\
    name = NAME;\
    sound[] = { "\sound\##NAME##.ogg", 1, 1, 50 };\
    titles[] = { 0, $STR_##NAME };\
    duration = ##DURATION##;
};

SOUND(mySound,0)```
winter rose
#

no default, it's a macro, not a function 🙃

brazen lagoon
acoustic tangle
#

And i need some missile miss the aaf fighter for dramatic purpose

brazen lagoon
#

@acoustic tangle hmm this seems difficult im not sure how you'd do this

#

I would look and see how the missile AI works and try to see if you can modify it to stop tracking after some time, or something like that

acoustic tangle
#

Ok then thx

drifting portal
#

are you going

#

to place this in a sqf or what

drifting portal
# acoustic tangle Hello i have a question, how do i script a AA missile always miss?
[] spawn {
_l = (velocity vehicle player) select 0;
_z = (velocity vehicle player) select 1;
_h = (velocity vehicle player) select 2;
aamissile = "M_Titan_AA_long" createVehicle (player getRelPos [700, ([120, 240] call BIS_fnc_randomInt)]); aamissile setVelocity [_l * 3,_z *3  ,_h *3]; [aamissile, (getPos vehicle player) select 2] call BIS_fnc_setHeight;while {alive aamissile} do {aamissile setDir (aamissile getDir vehicle player); sleep 0.3; if ((vehicle player) distance aamissile < 5) then {aamissile setVelocity velocity vehicle player; aamissile setDir (aamissile getDir player getRelPos [200, ([300, 60] call BIS_fnc_randomInt)]); sleep 3; deleteVehicle aamissile;};};  
};
drifting portal
acoustic tangle
#

Ok thx

dreamy kestrel
#

Q: re: allDeadMen seems to include alive units as well?

#

huh this is curious...

_units = allunits + alldeadmen;
_units = _units arrayintersect _units;
_units apply { [_x, netid _x]; };

yields this: [[KPLIB_eden_commander,"2:2271"],[KPLIB_eden_commander,"2:1959"]]
how can there be two netid ?

#

getting positions, possibly one of those units may be the spawn system at work... i.e. with positions,
[[KPLIB_eden_commander,[23587.7,20496.8,0.00167656]],[KPLIB_eden_commander,[10,10,9.78562]]]

little raptor
dreamy kestrel
#

well, yeah, I figured that much; just trying to account for what's what there...

#

my goal there is to tell dead units from alive ones. when killed, units fall off the allUnits radar, for instance, so unless I had an accounting of those objects to begin with, I lose sight of them. but allDeadMen tells me more than what I need to know.

little raptor
#

how did you figure out it does?

winter rose
#

shouldn't it be```sqf
private _unit = allunits arrayIntersect alldeadmen;

dreamy kestrel
#

@winter rose yes I did that, see above

winter rose
dreamy kestrel
winter rose
#

yeaaah…?

copper raven
spark turret
#

youre performing an identity operation not an intersection

winter rose
#
(allunits + alldeadmen) arrayintersect (allunits + alldeadmen);
// different from
allunits arrayintersect alldeadmen;
spark turret
#

[1,2] intersect [1,2] == [1,2]

#

[1] intersect [2] = []

dreamy kestrel
#

I see, but it also does not exactly answer the question. my goal is to include dead units along with the living. allUnits only includes the alive units AFAIK.

winter rose
#

yes, but how did you get the idea that allDeadMen includes living units…?

#

more or less, "what is your issue" here 😆

#

allDeadMen seems to include alive units as well
no ^^

#
allDeadMen select { alive _x } // should return [] every time
dreamy kestrel
#

huh, maybe it is doing the right thing then, but I wonder if those remnants need to be GC... separate question.

(allunits+alldeadmen) apply { [_x, isplayer _x, alive _x] };

result: [[KPLIB_eden_commander,true,true],[KPLIB_eden_commander,false,false]]

#

thanks for clarifying.

soft panther
#

Looking at making a free cam (like Spectator and Splendid Cam) but im not sure how to get the movement done - wondering if I should continue looking at ways to move a new created camera or look into seeing if i could edit the spectator to my needs
If anyone has any ideas DM me if possible

ornate marsh
winter rose
#

it's a whole new scope, a totally different script

copper raven
#

_pos is undefined too

ornate marsh
#

yeah that pastebin hasn't been updated one sec

#

fixed the _pos, how would I pass _marker to the EH?

copper raven
#

use a global variable

drifting portal
#

and tried different values such as 1.39 or 1.3 or 1.4 etc

#

still out of sync

#

seems the subtitles get delayed because they have a "fading" time

drifting portal
sudden bear
#

Hi everyone, I would like to know why the UH-34 from the new dcl is not impact with the command : [UH, 600, 30, true, 10] spawn BIS_fnc_UnitCapture;
He move but don't shot.

brazen lagoon
#

is there a good function to get nearby friendly units?

#

as in, friendly AI within a 50-100m radius?

#

am I just gonna have to do nearEntities

spark turret
#

select {side _x == west} maybe?

copper raven
unreal scroll
#

Guys, is there any way to get rid of small map markers, like that ones for wind turbines?

plain linden
#

Is there a way I can make a blank mod that has a dependency of all the mods for my group. This way people can just use this mod and it will update when we change mods up

little raptor
spark turret
plain linden
#

^ that @little raptor

past wagon
#

if I use execVM to execute a script will it execute on the same level of the script where I used execVM?

#

so if I put it in initPlayerLocal.sqf, will the script that I execute using execVM run locally for the player?

spark turret
plain linden
#

Manually

spark turret
#

as so often, the quality of life increase for players is a QOL decrease for the admin lel

past wagon
#

thanks

past wagon
#

whats an easy way I can make it so that only players on one side can access a virtual arsenal?

cosmic lichen
#

Use the initPlayerLocal.sqf and add a side check.

sudden bear
agile cargo
#

Is there a hook that I can use to call a script when the mission ends?

#

essentially I need to make a server-side addon to activate an script on mission end

agile cargo
#

but the wiki says that exit.sqf is mission based

winter rose
#

use an EH then

agile cargo
#

MPEnded seems more like it

#

But I don't know if it's going to work for what I'm planning. I want to make an addon to call the function to save the OCAP recording

#

Guess there is only one way to find out

fierce solar
#

Say I want a players loadout to be reset every time they teleport somewhere, but the players are able to have custom loadouts, how would I have an option on the Arsenal box for them to save their loadout and whenever a certain script is ran, that loadout gets reset to what it was saved as.

unreal scroll
fierce solar
#

This doesn't answer my question, I get the basic concept of how to do it, but how would I do it without any mods such as ACE?

unreal scroll
fierce solar
#

Thats my bad I forgot the scroll actions are just in a different fashion with mods

#

if I'm not mistaken

chilly cape
#

hey guys I have a really basic question about the ARMA 1 mission editor

past wagon
#

what command do you use to set a player's primary weapon? am I missing something?

warm hedge
chilly cape
#

ah I’m just realizing it’s not dedicated to all armas

#

Anyways I was just trying to figure out how to enable my mission so when I die it automatically takes over another teammate that’s still alive - as opposed to the bird flying thing

warm hedge
#

But sure to ask. I ain't a moderator so

tough abyss
#

How can I whitelist weapons, per role in the Arsenal. I know how to whitlist roles per uid. But is it possible for me to only allow select roles to see select weapons in the Arsenal

pulsar bluff
#

yes but not easy

tough abyss
#

So you know of a way to do it or you’re just saying it’s possible?

brazen lagoon
#

is it possible to figure out if a shot is a headshot with the handledamage eventhandler?

fierce solar
#
if ( player == blue1 && !isNil BlueLoadout1 ) then {

why does it say BlueLoadout1 is a undefined variable?

ripe sapphire
#

have u done BlueLoadout1 = (something) before that line

#

you have to define it first

fierce solar
warm hedge
#

Read BIKI carefully. isNil takes a code or a string

fierce solar
#

hm, a code

#

so how else would I write it?

warm hedge
#

Read what I said carefully. Code, or String

#

So "BlueLoadout1"

fierce solar
#

BlueLoadout1 is a variable

warm hedge
#

But still

fierce solar
#

im confused

warm hedge
#

Read BIKI. It explains

fierce solar
#

kk

#

BIKI as in Wiki?

warm hedge
#

Yes. Bohemia Interactive Community Wiki, BIKI. What sharp. posts

fierce solar
#

Didn't know you guys call it that lol

#

omg you fixed everything

#

Sorry for not understanding that was kind of right in my face 😅

warm hedge
#

np. If it doesn't work, always your friend, BIKI is there

desert palm
#

hi how do you make an "array of units" and does it accept the variable name of a specific unit?

#

is it [test][test1] or ["test"]["test1"]

warm hedge
#

[test,test1]

desert palm
ripe sapphire
#

yo bros how do i freeze a chopper in position?
i used unitcapture on a helicopter to land in a specific spot, but i want it to stay there forever, but as soon as the unitplay ends, the chopper takes off immediately.

#

i tried disabling AI features on the pilots, but they still take off

spark turret
#

take away its fuel?