#arma3_scripting

1 messages · Page 132 of 1

neon crystal
#

alright

#

thank you

#

for all this

fair drum
#

if you get severely stuck, we can walk you through further tomorrow.

neon crystal
#

i think ill be able to figure this out

#

you've gotten me to a far enough point that i should be

fair drum
#

just read the wiki carefully when you run into errors

neon crystal
#

havent been able to get past this point sadly

manic kettle
neon crystal
manic kettle
#

Could be "weaponholdersimulated" not sure. Either way reread the syntaxe
_pos nearObjects ["objectclass", 10];

neon crystal
#

im not sure how to make the script work tho

#

i need an object for deleteVehicle and that's an array

formal stirrup
#
{
deleteVehicle _x
} forEach array
neon crystal
#

ah

manic kettle
#

An array is like a row of objects. If you want the first object in the array it's just _obj = _array select 0

neon crystal
#
addMissionEventHandler ["EntityKilled", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    private _pos = getPosATL _unit;
    private _obj = _pos nearObjects["GroundWeaponHolders", 10];                    
    systemChat _obj;                                                      
    {
    deleteVehicle _x
    } forEach _obj                          
}];

that look about right or am i still messing something up

formal stirrup
#

Remove the select 0 if you are gonna use forEach

neon crystal
#

you see other mistakes

#

?

stable dune
hallow mortar
#

systemChat only accepts inputs of type String. _obj contains an object reference, which is of type...Object, so you have to do something to translate it into a String
*sorry, _obj contains an Array of Objects. Different but still not a String

neon crystal
#

can you see anything else with the rest because i dont know how to make it work

proven charm
#

couple qs, can object scripts running be delayed (due to lag)? and is the script of Land_ClutterCutter_large_F available somewhere, or is it hardcoded?

viral canyon
#

Hey all, anyone know how to fix an error I'm getting when running this script

// Example usage: Filter objects by type and name
// Function to calculate QDR (Quadrant Distance and Bearing) between two positions
QDRBetween = {
    

    _playerPos = getPosASL player; // Position of the player
    _ndbPos = getMarkerPos "NDB_Location"; // Position of the target object (ndb_location)

    // Calculate the distance
    _distance = _playerPos distance _ndbPos;

    // Calculate the bearing
    _bearing = getDir _playerPos;
    _bearing = _bearing - (getDir _ndbPos);
    _bearing = _bearing mod 360;
    if (_bearing > 180) then {
        _bearing = _bearing - 360;
    };

    // Output the distance and bearing in the system chat
    hint format ["Distance to NDB: %1 meters, Bearing: %2 degrees", _distance, _bearing];
};

// Loop for 5 seconds
private ["_endTime"];
_endTime = time + 5;
while {time < _endTime} do {
    // Call the function to calculate QDR and display
    call QDRBetween;
    // Pause execution for a short duration
    uiSleep 1; // Adjust the duration as needed (in seconds)
};```
proven charm
#

change getDir _playerPos; to getDir player;

#

@viral canyon ^^^

viral canyon
#

will try now thank you @proven charm

proven charm
#

unless you meant something like _playerPos getDir _ndbPos

viral canyon
#

yeah i want to get a magnetic heading from the station

viral canyon
#

got it working nice

#

got a question tho if I wanted to create an UI or an image of this in the cockpit of a plane I jumped inside is there any documentation on how to do this ?

fair drum
#

Unbelievably bad. It's so bad, if you are new you are actually worse off than with nothing lol.

open hollow
#

its funny that can identify chatGPT code bc is too bad lol

winter rose
#

see pinned messages

formal stirrup
#

I think its funny that if you give chatGPT examples of how SQF works and then ask it to repeat said code given to it, It will fail and break the code

old owl
#

I'm NGL sometimes I kind of don't mind ChatGPT for SQF. It fails to understand basic syntax and will entirely forget semicolons however I feel like for me, it is a good way to find scripting commands I want to use for something. Especially for things like Unit Inventory, where the is just a vast so many and I am not sure which may be the best way of doing things.

winter rose
#

use it with caution is all we say 🙂

#

like any tool, going blindly is a recipe for disaster 😄

still forum
#

"it is a good way to find scripting commands I want to use for something"
Well it will make up script commands that don't exist 😢

old owl
#

@winter rose I 100% agree with you. I liked what you linked too, understanding is important. For the beginners I don't think it's a bad tool but only if used as a tool 🙂

Also @still forum I can definitely tell you've got your experience with using it because definitely feel that haha. Sometimes it prints stuff all-too convenient and you're just like:

winter rose
#
if (canFinishMission) then
{
  { endMission } forEach allPlayers;
};
```_huehuehue_
formal stirrup
#

lmao

wind flax
flint topaz
#

Cause if so you can just assign a variable to the player stating as such

wind flax
#

Yeah, I was looking for something more elegant

flint topaz
#

There is likely a way by detecting displays but you’d have to find out what the blackout display’s ID is

#

Like I guess my question is why you want to know

wind flax
#

Made a mod that uses blackscreens, and it's diag errors in singleplayer, midly annoying to see at the bottom

grizzled cliff
#

C++11 is god like sometimes, i swear, best language ever...

            game_value_array<4> line_intersects_args({
                game_value_vector3(start_pos_),
                game_value_vector3(end_pos_),
                *ignore_obj1_,
                *ignore_obj2_
            })
#

that allocates all the needed arguments to lineIntersects on the stack automagically.

#

no heap allocations like normal SQF arguments in SQF itself.

open hollow
#

@wind flax it should appear on alldisplays or as a control in display 46

granite sky
#

IIRC createMarker is a no-op if the marker already exists.

#

And putting a string into _groupName is not gonna work.

#

In addition to the obvious vector fails.

neon crystal
storm arch
#

On the map you can spawn trees with a script, but they arent listed anywhere in the eden editor. Is there somewhere I can find a list to these classnames? Ive looked at the sub-categories of the arma 3 asset page without any luck.

fair drum
neon crystal
#

o

fair drum
#

You can check typos like that using isClass

granite sky
#

If you want the death drop ones then it's WeaponHolderSimulated.

neon crystal
#

alr

#
addMissionEventHandler ["EntityKilled", { 
    params ["_unit", "_killer", "_instigator", "_useEffects"]; 
    private _pos = getPosATL _unit; 
    private _obj = _pos nearObjects["WeaponHolderSimulated", 10];           
    systemChat str _obj;                                            
    { 
    deleteVehicle _x 
    } forEach _obj;                           
}];

now im here and still confused

#

systemChat doesnt turn up with anythin

#

im not sure what i am still doing wrong

granite sky
#

The classname is still wrong.

#

I don't know if this works anyway. Trouble is that EntityKilled might fire before the weapon holders are created.

neon crystal
#

how might i go about delaying it

granite sky
#

Probably better to start from EntityCreated.

#

Check the classname with isKindOf, check the corpse with getCorpse, delete it.

#

I'm not sure what locality the weapon holders are created with, so the timing might be unpredictable.

neon crystal
#

alright sooo

#

i did that and now cant even open the inventory

#

so i did somethin wrong

#

i think it actually deleted the primary weapon though

#
addMissionEventHandler ["EntityCreated", {
   params ["_entity"];
   _entity isKindOf "WeaponHolderSimulated";
   getCorpse _entity;
   systemChat str _entity;                                               
   deleteVehicle _entity;                                             
}];

this is probably very wrong but im not sure what i did

hallow mortar
#

You are returning the values for whether the created entity is a weaponHolderSimulated, and what corpse it belongs to (if any), but you're not actually checking what those results are. The script continues regardless of whether it's a weaponHolderSimulated or not. So you're just instantly deleting literally every entity that gets created ever.

neon crystal
#

ah

#

how do i check what is there

hallow mortar
grim cliff
#

Not sure if this is the right place:
Can i use a server mod to add actions to players via remote exec?

hallow mortar
#

Yes, you can add a function to the server's CfgFunctions (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) that auto-runs in the post-init phase (or pre-init probably) and remoteExecs stuff to the players.
Try not to remoteExec huge walls of code though, it does have to be sent over the network when people join.

neon crystal
#

alr im still a bit confused

hallow mortar
grim cliff
neon crystal
#

how would i make it apply to both

neon crystal
#

pretty sure thats dev only rn

hallow mortar
#

It is

neon crystal
#

whats a different way i could do it then

#

idk how im supposed to make it apply to all weapons

granite sky
#

hmm. getCorpse doesn't have a link on the secondary?

grim cliff
neon crystal
#

i dont want people to pick up enemy weapons

#

i have one of those scripts that saves their loadout

#

thats why

neon crystal
hallow mortar
#

Perhaps you'd better post what you did so we can find out

neon crystal
#
addMissionEventHandler ["EntityCreated", {
   params ["_entity"];
   _bool = _entity isKindOf "WeaponHolderSimulated";
   getCorpse _entity;
   if (_entity iskindof "WeaponHolderSimulated") then {deleteVehicle _entity} else {};
   systemChat str _bool;                                             
   }];

rn im here

hallow mortar
#

You're doing getCorpse _entity but not doing anything with the result. So what getCorpse does or doesn't detect is actually irrelevant!
This means the script should actually be more aggressive than you expect - it will delete any weaponHolderSimulated, regardless of its origins.

neon crystal
#

i dont know if thats what i want or not

#

i dont want anyone to drop their guns on death

hallow mortar
#

This suggests that the secondary weapon might not be stored in a weaponHolderSimulated. It might be (and I haven't confirmed this) that holstered secondaries are placed in a static container along with the other equipment on the body itself.

granite sky
#

wait, you mean the handgun, not the secondary?

neon crystal
#

handgun in secondary spot

hallow mortar
#

Oh right, "secondary" is actually the launcher because Arma

neon crystal
#

o h

hallow mortar
#

When I say "secondary" I've been talking about the handgun. When John says "secondary" he's been talking about the launcher

neon crystal
#

how do i just delete all three

granite sky
#

Yeah, handgun doesn't get dropped like that. Only primary and launcher.

neon crystal
#

if there is all three

hallow mortar
#

Launchers will be eaten by the script you have now, since they get dropped in a separate physics holder

neon crystal
#

how would i delete the handgun then

#

if its still on the body

hallow mortar
#

probably either removeAllWeapons or clearWeaponCargoGlobal depending on what kind of inventory space a corpse counts as

granite sky
#

I think it's removeAllWeapons but I could be wrong.

#

Or _unit removeWeapon handgunWeapon _unit, but removeAllWeapons should be fine.

neon crystal
#

so do i just do _unit removeAllWeapons somewhere in there

hallow mortar
grim cliff
#

Would it be better to use the killed event handler for that?

neon crystal
#

already tried entityKilled

hallow mortar
hallow mortar
neon crystal
#

alright all works well now

#

thanks guys

neon crystal
#

am i able to have triggers set off user actions like opening a door

#

the boat passes inside this trigger and the door opens, not just the animation plays

neon crystal
#

up to this point ive been having it hit the trigger and only play the animation but the mod it comes with has expanded the amount of units able to leave at a time which doesnt work when only the animation plays

tulip ridge
#

How do you prevent the pop up targets from popping back up again?
I vaguely remembered it being something like noPop = false, but doesn't seem to be working when testing

warm hedge
#

noPop = true

tulip ridge
#

Appreciate it, tried true and false but I was apparently using the wrong target objects

tulip ridge
#

I was manually animating the targets to reset them, but that seems to make them unable to be shot back down again.

_object addAction [
    "Reset Targets (100m)", {
        params ["_console"];
        _targets = nearestObjects [_console, [
            "Target_Swivel_01_left_F", 
            "Target_Swivel_01_right_F", 
            "Target_Swivel_01_ground_F", 
            "Land_Target_Swivel_01_F"
        ], 100];
        
        {_x animate ["Terc", 0];} forEach _targets;
    }
];
#

Also somewhat related, what is the normal standing target that can be shot down? I could only find the "Target Human (Simple)" (TargetBootcampHumanSimple_F) one, but that target did not respond when shot.

#

I don't want the one that opens a menu when placed because that pops up on its own and (seemingly) doesn't use noPop.

cosmic lichen
#

I wrote a biki pge about popup targets a long time ago. It should show up on Google

#

Found it.

vocal chasm
#

Can I ask a little question about the init for the ai?

I want to setup a trainingcoarse with them. This means i want to be able to shoot the ai without them moving or shooting back. And when they they they respawn at the same place again.

Does somebody know the init code or how to do it?

hallow mortar
#

Without moving or shooting would be disableAI and setting their group behaviour to careless/force hold fire

meager mist
#

Hey, I have a group dynamically spawned in once BLUFOR steps into a trigger. And that works fine, but I would like to delete this group again once BLUFOR steps out of the trigger. But that's where I'm struggling. I've been trying a couple of methods but so far no luck.
Code for spawning used in OnActivation:

_grp1 = [getMarkerPos "spawn1", east, ["O_Soldier_SL_F", "O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],0] call BIS_fnc_spawnGroup; 
 
_wpt1 = _grp1 addWaypoint [getMarkerPos "move1",5]; 
_wpt1 setWaypointType "MOVE";

code for deletion added to onDeactivation

{ deleteVehicle _x }forEach units _grp1;

I've tried some other snippets too but no luck so far. Anyone able to help out with this?
For context: It's supposed to react to heli's staying in 1 position too long on a point and AI wanting tto investigate what this heli is doing... and this would repeat over and over.

proven charm
meager mist
#

If I change that, does that mean the group will have grp1 as it's variable?

proven charm
#

yes, grp1 is global variable then

meager mist
#

Great! I'll test that you. I'm guessing wpt1 can stay the same and it wouldn't matter

proven charm
#

it shouldnt matter

meager mist
#

Works! Also funny how 1 character makes a difference :p Thanks for the help!

proven charm
#

yes _var is local and without _ its global variable

#

thx Lou 🙂

sweet vine
#

I'm looking for a way to remove cursor in splendid camera/zeus?

I can't quiet isolate the control for the cursor to hide it, anyone know how to approach this, or better yet a solution...

fair drum
#

Mouse cursor? Or the ui grid with the center cursor?

sweet vine
#

Mouse Cursor, which also happens to be visible when overlay is toggled

sweet vine
meager granite
warm hedge
#

I'd ask what is your intention first

west portal
#

Is it possible to define an existing group on the map as a variable?

meager granite
west portal
#

thanks!

wind flax
#

Does anyone know of a way to get a hidden selections current texture?

#

Not the one in the config, what it's presently set to?

warm hedge
#

getObjectTextures?

wind flax
#

The documentation says it'll return an array of textures

#

I need to know what a specific selection on the object is set to

warm hedge
#

find select and getObjectTextures

wind flax
#

Thanks, figured it out

sweet vine
# warm hedge I'd ask what is your intention first

Simply, video recordings without the cursor
I know I could use gcam, but I'd like a solution that doesn't require a mod

When screenshots are taken, using GeForce Experience, cursor Isn't captured
When videos are taken, cursor is captured
there's some sort of integration ofc, figure I'd try and hide it for when I'm recording videos as well

warm hedge
#

I do believe it is a part of recording software, not game's something

sweet vine
#

Could be, cursor's still a control, certainly It can be hidden, can it not?

flint topaz
#

I know you might want to avoid a mod but the quality improvement just with control is probably worth it using GCam but the suggestions above are good alternatives

hallow mortar
#

is the cursor a control? I have some doubts

#

Steam screenshots also don't capture the cursor, for example. I think it's separate and partly OS-level.

tough abyss
#

Looks interesting. How do I "learn" c++ for arma? Should I just learn normal c++ ? I only know SQF.

sweet vine
#

Unfortunately doesn't seem to work, but good lead, I'll take a look for solutions similar to that

sweet vine
meager mist
#

Second scripting question of the day 😅

I found a tracker script on the web and adjusted it a little bit to only be from the SLs. I’ve had this running a couple days ago but now I cannot terminate it anymore. And I’m quite confused why. Any ideas?

Tracker code:

sqf

tracker = 0 spawn {
    while {true} do {
        // Check if the player is a squad leader
        if (leader group player == player) then {
            // Player is a squad leader, play the sound
            _pPlayer = getPosASL player;
            _pTarget = getPosASL target;
            _offset = vectorMagnitude (_pPlayer vectorFromTo _pTarget) / 20;
            tracker = playSound3D [
                "a3\sounds_f\sfx\Beep_Target.wss",
                player,
                false,
                _pPlayer,
                0.5 + _offset,
                0.8 + _offset,
                0
            ];
            sleep ((sqrt (_pPlayer vectorDistance _pTarget) / 5 - _offset) max 0.05);
        } else {
            // Player is not a squad leader, do nothing
            sleep 1;
        };
    };
};

Code on radio alpha trigger:

sqf
terminate tracker;

Ideally I’d only want the code to be local to anyone who has a mine detector.. but I couldn’t figure that one out

#

Forgot to mention this is on an MP setting. Dedicated server

still forum
#

If you start more than one, terminate will only terminate the most recently started one

#

maybe youre starting it multiple times

granite sky
#

tracker gets set to the return value of playSound3D in the middle. This seems very wrong.

#

Also that's a really bad name for a global variable. Be a bit more specific when naming globals.

winter rose
#

like myTracker

meager mist
hallow mortar
#

It's not about the position of the playSound3D, it's about the fact that it overwrites the tracker variable, which was previously storing the script handle for the spawn scope, with the sound ID it returns

#

I believe the sound you're using is only a single beep, and you don't try to stopSound it anyway, so there's no reason to store the return from playSound3D at all

west portal
#

I'm getting into arrays for the first time, and I don't really understand how they work. I'm trying to hide and unhide multiple markers, but I don't know how the syntax works

_natoinvasionmarkers = ["natoinvasion1","natoinvasion2","natoinvasion3", "natoinvasion4", "natoinvasion5"];

_natoinvasionmarkers setMarkerAlpha 0;
hallow mortar
#

Your array is correct, but your application of the command is wrong. setMarkerAlpha only accepts a single marker as an input (on the wiki, note that its marker input data type is listed as String, not Array).
You need another command, forEach, to iterate over each element in the array.

west portal
#

Would this work?

(forEach _natoinvasionmarkers) setMarkerAlpha 0;

winter rose
#

no

#

stop using ChatGPT or whatever 😳

west portal
#

huh?

#

I'm just reading the wiki

winter rose
hallow mortar
winter rose
#

{ code } forEach listOfStuff

hallow mortar
#

_x is a magic variable available within a forEach's code. It represents the current element the forEach is iterating on.

west portal
#

alright thanks so much

gray bramble
#

I suggest making sure you don't learn C first. That's a bad way to learn it because it forces you to grasp huge complications to understand what is actually fairly basic concepts. Plus it forces you to unlearn stuff later. Unfortunately most c++ courses to this day seem to start there.

flint topaz
#

All of the information they provided you is on the wiki you were reading

west portal
restive parrot
#

hey guys

tough abyss
#

So basically intercept is only for professionals...

rare ether
#

hi

restive parrot
#

do you know a way where I can make some vehicles whitelist for some people, like infantry soldiers can't use drones, artillery etc?

#

like a whitelisting vehicles for spectific player

sudden yacht
#

help.... works in single player but not dedicated server.... ```this addAction
[
"EDIT TEAM MEMBER 1 LOADOUT",
{ params ["_target", "_caller", "_actionId", "_arguments"]; ["Open",[true,player,A1]] call BIS_fnc_arsenal;

},
nil,
1.5,
true,
true,
"",
"true",
3.5,
false,
"",
""
];```

fair drum
restive parrot
#

it's for military simulator server.

fair drum
#

do you want them filtered by player name or uid? or by the slot they choose in the lobby?

restive parrot
#

hypoxic is there any chance i talk to you later in dm about that, sorry for distrubing though

#

just kind of busy with some

fair drum
#

yup, whenever

gray bramble
#

All I'm saying is you need to find a book or course that does not try to toss you off the best they can like a rodeo.

#

I gave the first edition of ISBN 978-0-321-99278-9 (stroustrup) my stamp of approval. It's made for learning C++ as a first (programming) language, and it keeps the complications for later, but it is quite comprehensive.

#

Just scanned the table of contents, and it's encouraging (in terms of not starting with C) that pointers aren't mentioned until page 588.

#

That book will also teach you a style of programming that will prevent several classes of bugs.

exotic flame
#

How do i get the content of a backpack inside a container ?

gray bramble
#

It is written with the assumption of a higher education setting, meant to be done over a semester, and being able to "ask for help from instructors or friends" if you get stuck.

exotic flame
exotic flame
#

Is it possible to animate a weapon, a uniform, or a helmet ?

warm hedge
#

Via script? No

exotic flame
bleak mural
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
clear leaf
#

hey im having a promblem with the enableAI "Move"

#

if (alive Sp3) then { CPT disableAI "MOVE"; } else { CPT enableAI "MOVE"; };

#

i dont know bu its first time i have a problem where my ai dosent move he just stand still and no mather what i do he wont go to the nexst check point

hasty pond
#

Hmm I wonder what did the newest 1 minute Arma 3 update do because my arma 3 server stopped working...

proven charm
oblique arrow
#

Hm helloh I need help again, trying to create a diary entry with an image in it, however the image just shows up completely white

player createDiaryRecord [
    "Diary",
    ["Objective", "
This is what the crate looks like: <img image='crate.jpg' width='400' height='250' />"],
    taskNull,
    "",
    false
];
winter rose
#

it might be a snow crate

oblique arrow
#

it isnt 😄

winter rose
#

use paa

knotty gyro
#

correct path to the file?

oblique arrow
#

should be yeah, the image is directly in the mission file

#

tried it with an images folder first but simplified it to debug

winter rose
#

MP?

#

nvm, shouldn't matter

oblique arrow
#

cräte

#

it was dem image sizes

#

gotta be power of 2 even with jpg

#

TIL

knotty gyro
#

So, why is this not working?

if ([player, "tools"] call BIS_fnc_hasItem) then {hint "Yes"} else {hint "No"};

It returns no in both cases. the tools are a named toolkit (item_ToolKit). Oh, and no it doesn't work with the classname either. What am I doing wrong?

#

Ackording to biki it should return true if the player has the tolls, but it doesn't.

#

*tools

winter rose
#

where is this code run?

knotty gyro
#

for testing purposes I have it in a radio trigger onAct

#

I'm just trying to figure out how to check inventory

winter rose
#

it might be case-sensitive, try Item_ToolKit

knotty gyro
#

I did... No cigar

#

The [player, "tools"] call BIS_fnc_hasItem should eval true as far as I understand it, but apparently it isn't satisfying the if condition

knotty gyro
#

oo... I see..... I'll try that

winter rose
#

and don't make me start Arma 3 again for assistance è.é 😄

knotty gyro
#

Worked.

#

So, not the classname then, but "name"

winter rose
#

classname is "ToolKit"

#

item_toolkit might be the placeable toolkit, aka a "weapon holder"

knotty gyro
#

in eden it says Item_ToolKit thogh

#

oh yeah. Ofc

winter rose
#

you got Arma'd 😄

knotty gyro
#

doh... Kepps forgettin the convoluted ways of arma

knotty gyro
#

So how do I do the same check with a magazine? The usb disk registers as a magazine in the the inventory. (item_FlashDisk)

hallow mortar
#

BIS_fnc_hasItem works for any kind of inventory item, as far as I know

#

item_FlashDisk is likely to once again be the ground holder object, though. I'm pretty sure the inventory item itself is FlashDisk, but you can check by placing the holder object, rightclick > find in config viewer, expanding the class on the left, and opening its TransportItems or TransportMagazines subclass

hallow mortar
# knotty gyro So, not the classname then, but "name"

Inventory items can only be referred to by their classname, they can't be given unique variable names. This is because they aren't unique objects. The game doesn't know which ToolKit you have, it just knows you have a ToolKit.
(Magazines actually are unique in some ways and have unique IDs, but there aren't any commands to work with those so...)

knotty gyro
#

You were correct sir. Thanks.

topaz compass
#

Sorry guys I was working on something (Kinda New To Modding) and I dont kn0w how to get ride of these lines in the mission? they apear out of no wear and not sure how to get rid of them (The Red Line) (It starts to point out what the units are doing in the Scenario

#

any help would be most appreciated

#

then it looks like this

hallow mortar
#

If you're running the A3 Diagnostics exe (you would have to deliberately choose to do this, so you'd know) then try "All" diag_enable false in the debug console.
If you're not, then it's a mod, god help ye

topaz compass
#

this guy had the same problem

#

no mods that would do this

#

like 5 mods

hallow mortar
#

Please try it without mods. I think you will be surprised.

topaz compass
#

but I need them for this senario

#

it said you required them

#

have you not scene these lines before?

#

I just bought the game

#

it looks like some editing tool being pressed

#

but im not in editor

hallow mortar
#

The purpose of launching without mods is to quickly verify that for sure. You don't have to load this specific scenario; you can just open the Editor, place a few AI and a playable unit, and try it. That will immediately show whether the overlays are still present.

topaz compass
#

Thankyou.. would ace do this?

fair drum
#

not by default. lets see the modlist

hallow mortar
#

It's pretty plausible that ACE has a tool like this in it, though it wouldn't be turned on by default for obvious reasons. I don't know for sure though.

topaz compass
#

I see, also I got the DLCs are you suppose to activate them together (I have all of them)

hallow mortar
#

Standard DLCs (Apex, Marksmen...) are always installed and active. You can uninstall them through Steam, but shouldn't. Creator DLCs (Global Mobilisation, Western Sahara...) work like mods. Servers may or may not allow them, and compatibility between them isn't guaranteed. Some of them work together very well, some of them probably shouldn't be put together (mostly SOG + anything else).
Not really a scripting question though, try #arma3_questions if you have more general issues

proven charm
#

do the helis have points for rappel ropes or should I just figure them my self?

half sphinx
#

600 dollars for a stolen mission is pretty funny

#

or sad, I'm not really sure

bleak mural
#

does Arma3 support any way for you to cycle the command bar instead of simply selecting F1 to F12 keys?

fair drum
bleak mural
#

also is there any way (much like get in nearest) to use an "assign nearest" type of command?

#

such as, alpha1 assign nearest vehicle. alpha can then enter the vehicle closest

#

thats crewed obviously,like a transport heli

half sphinx
clear leaf
# proven charm is the AI the CPT? disableAI "MOVE" makes them not moveable

On the arma 3 wiki it says enableAI “MOVE” is a command to make Ai walk to nexst watpoint if its nit walking becouse of the diableAI . I just need my Ai to walk when my enemy Ai is death an only walk when is death. So i ide the if and else command: that again is an arma command and the alive is of the enemy is alive. I did something like this but like when i killed a specefic Ai then my frindly Ai would kill another Ai for a theam sniper mission and i used the same tactic with if alive or Else and it worked. But if the diableAI move and the enable witch one Can i use then. Becouse when i just use it like disableai” move” and then sleep 5; and then enableAI”move” then it works, why? I used what it Said in the arma 3 code wiki?

#

The CPT is the name of the specefic AI

analog mulch
#

hello,
wanna know if there is a script i can use and how to use it that enables these same multiplayer settings but in SP when playing with AI

basically if AI in my group gets hit they get incapacitated so that medic has time to get to them, ty

winter rose
#

the Revive system does not work for AIs.

drowsy geyser
kindred zephyr
#

Hello fellas,

Does anyone knows if Animate happens to be JIP compatible?
Im doing some animations for door oppening purposes in one of my missions but it doesnt always does it for every player, as it seems to affect only JIPs.
This is problematic since im also locking said doors (which do lock for all properly).

This is done during mission start in initServer

round scroll
#

can I somehow access the 'DESCRIPTION' field of an object placed in the editor via SQF?

hallow mortar
analog mulch
hallow mortar
#

There are internal parts of the revive system that simply do not work even if you force it to run on an AI (notice how it stops working on player units when the player leaves, for example)

#

You could use a handleDamage event handler to make your own revive system for AI, but it will be complicated

still forum
round scroll
#

thanks, will try that!

frail vault
#

Hello, I been bashing my head in with this issue for a bit now
I have the code

informant switchMove "Acts_ExecutionVictim_Loop";

which should realistically put the civilian with the variable name "informant" in the animation

I even tried

this switchMove "Acts_ExecutionVictim_Loop";

Am i doing something wrong?

warm hedge
#

It does not work in very first frame of the game. Use spawn to wrap it up

frail vault
#

sorry, where would put that?

warm hedge
#
informant spawn {_this siwtchMove "Acts_ExecutionVictim_Loop"};``` and it makes the code executed a very bit later
frail vault
#

oh, i was putting this in the civilian's init area, would i be putting your code in a trigger then?

warm hedge
#

No

#

If you're in trigger, without spawn is enough

frail vault
#

oh thanks this worked

exotic flame
#

Is there any trick to make a properly walkable ship ?

bleak mural
#

Its the best revive for player and AI script imo. good customisability and lightweight. can be configured for side, playable,all etc etc

#

AI can also heal AI without oyur input(but if in your group u must as leader order them to heal man)

bleak mural
#
randomPoint= selectRandom ["AO", "AO"];       
       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];       
_wp setwaypointtype "GETOUT";       
_wp setWaypointSpeed "NORMAL";       
Alpha1 setBehaviour "Aware";       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "CYCLE";     randomPoint= selectRandom ["AO", "AO"];   ;
#

can someone help with the above

#

everything is fine however im trying make the first waypoint the current waypoint,thus attempting to delete all pre assigned waypoints

#

i tried using "setcurrentwaypoint"

#

i tried using deletewaypoint

#
private _group = group _unit;
for "_i" from 0 to (count waypoints _group - 1) do
{
    deleteWaypoint [_group, 0];
};;
#

where i changed _group name to Alpha1

hallow mortar
#

Well, save the first waypoint to a unique variable instead of overwriting it every time you add a new one, then setCurrentWaypoint should work fine

#
private _randomPoint = selectRandom ["AO", "AO"];
myGetOutWaypoint = Alpha1 addWaypoint [getmarkerpos _randomPoint, 1000];
myGetOutWaypoint setwaypointtype "GETOUT";
myGetOutWaypoint setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
for "_i" from 1 to 5 do {
  private _wp = Alpha1 addWaypoint [getmarkerpos _randomPoint, 1000];
  _wp setwaypointtype "SAD";
};
private _wp = Alpha1 addWaypoint [getmarkerpos _randomPoint, 1000];
_wp setwaypointtype "CYCLE";
// ...
Alpha1 setCurrentWaypoint myGetOutWaypoint;```
frail vault
#

I just wanted to ask, is there a way to add NVG capability onto a helmet?
ie) have a certain helmet to have NVG ability, even though you may not have an NVG

warm hedge
#

Via script? No, via config, yes. Special Purpose Helmet from Apex does it

bleak mural
warm hedge
bleak mural
#

_wp Alpha1 cancel all waypoints for example

bleak mural
#

it isnt working

warm hedge
#

Then you're doing something wrong

bleak mural
#

i tried adding syntax after the command and at start

#

clearly

warm hedge
#

We have no chance to understand you by just told it isn't working

bleak mural
#

and i attempted to incorporate them at the beginning of the syntax

#

applying Alpha1 name where needed

warm hedge
#

And... where is your attempt code? Any errors?

bleak mural
#

yet when i call the syntax,it just keeps adding 7 new waypoints instead of deleting are giving 7 new ones

#

no code error

#

let me show examples..one moment

#
randomPoint= selectRandom ["AO", "AO"];       
deleteWaypoint [_Alpha1, 2];       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];       
_wp setwaypointtype "GETOUT";       
_wp setWaypointSpeed "NORMAL";       
Alpha1 setBehaviour "Aware";       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "CYCLE";     randomPoint= selectRandom ["AO", "AO"];  ;
#

randomPoint= selectRandom ["AO", "AO"];       
private _group = group _Alpha1;
for "_i" from (count waypoints _Alpha - 1) to 0 step -1 do
{
    deleteWaypoint [_Alpha1, _i];
};      
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];       
_wp setwaypointtype "GETOUT";       
_wp setWaypointSpeed "NORMAL";       
Alpha1 setBehaviour "Aware";       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "CYCLE";     randomPoint= selectRandom ["AO", "AO"];  ;
#
randomPoint= selectRandom ["AO", "AO"];       
private _Alpha1 = group _Alpha1;
for "_i" from 0 to (count waypoints _Alpha1 - 1) do
{
    deleteWaypoint [_Alpha1, 0];
};      
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];       
_wp setwaypointtype "GETOUT";       
_wp setWaypointSpeed "NORMAL";       
Alpha1 setBehaviour "Aware";       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "CYCLE";     randomPoint= selectRandom ["AO", "AO"];  
;
#

Above are the three examples i incoprorated from the wiki to no avail

warm hedge
#

_Alpha1 vs Alpha1?

bleak mural
#

iv also tried to modify them to the end of my original syntax rather than the start

#

i corrected the Alpha in editor, iv tried both _ and without

#

your saying these should work?

warm hedge
#

I'm just trying to hunt what exactly you want and error there

bleak mural
#

to give further full context, the syntax is run from radio trigger. it generates the 7 waypoints. im trying to hit trigger again,have it cancel original 7 and generate 7 new wp's

#

make sense?

warm hedge
bleak mural
#

rather than add to 14 21 28 etc

warm hedge
#

14 21 28??

bleak mural
#

7 waypoints then multiply if i hit the trigger again

#

additive

bleak mural
#

is any syntax i have written correct?

#

on act of radio trigger

warm hedge
#

No error means the syntax is correct

bleak mural
#

yes so im not sure why my first waypoints arent deleting

warm hedge
#
randomPoint= selectRandom ["AO", "AO"];       
private _Alpha1 = group player;
{deleteWaypoint _x} forEachReversed waypoints _Alpha1;
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];       
_wp setwaypointtype "GETOUT";       
_wp setWaypointSpeed "NORMAL";       
_Alpha1 setBehaviour "Aware";
for "_i" from 0 to 6 do {
    _wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
    _wp setwaypointtype "SAD";
};    
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "CYCLE";```Worked perfectly fine for me
#

This makes WPs for player group

bleak mural
#

hmmmm why not the AI group

warm hedge
#

How do you confirm it doesn't remove WPs

bleak mural
#

High command / zues show current waypoints

#

i changed "player" with _Alpha1 and get an error

#

"Alpha1" no error but not working

#

variable name of unit not group i guess

#

yes it works IF i name Alpha1 group leader

#

and change "group player" for "group tom"

#

but i need it running off the group name as leader may die

bleak mural
#

tom , is the name of Alpha1's leader

#

following so far?

#

and then it works ok

#

but as said,i need to run it off group variable and not individual

#

"group this" work here?

#

as Alpha1 is the reference?

#
randomPoint= selectRandom ["AO", "AO"];        
private _Alpha1 = group Alpha1; 
{deleteWaypoint _x} forEachReversed waypoints _Alpha1; 
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];        
_wp setwaypointtype "GETOUT";        
_wp setWaypointSpeed "NORMAL";        
_Alpha1 setBehaviour "Aware"; 
for "_i" from 0 to 6 do { 
    _wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];      
    _wp setwaypointtype "SAD"; 
};     
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];      
_wp setwaypointtype "CYCLE";;
#

type group expected object

#

is there a way to make it recognise the group?

warm hedge
#

Alpha1 there already is a group

bleak mural
#

yeah im following

#

some "group leader" syntax?

warm hedge
#

Again, Alpha1 is already a group. There is no way to convert group into group

#

group Alpha1 == trying to convert a group into a group which is invalid

bleak mural
#

i understand,im trying to suggest a way for it to detect the current alive leader

#

tom dies, harry takes over for example

warm hedge
#

Why?

bleak mural
#

because leader tom may be killed,if he is,wouldnt this syntax fail to run?

#

wont fnd his name so group doesnt get new waypoints

warm hedge
#

No. If a group leader has been updated, the group remains the same

bleak mural
#

ohhhhh?

#

let me see..

#

no i tested

#

if tom dies, and syntax called again, no new waypoints are given

#

I GOT IT

#
randomPoint= selectRandom ["AO", "AO"];       
 { deleteWaypoint _x } forEachReversed waypoints Alpha1;      
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];       
_wp setwaypointtype "GETOUT";       
_wp setWaypointSpeed "NORMAL";       
Alpha1 setBehaviour "Aware";       
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "SAD";    
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];     
_wp setwaypointtype "CYCLE";   ;
#

forEachReversed

#

all that was needed

bleak mural
#

so now the result with syntax above= when called Alpha1 will have 7 waypoints randomly generated in a zone,ending with a cycle,then if called again,all aypoints are removed and fresh ones given. Sweet

#

Another observation and sth i wasnt expecting is that the AI,even currently on a waypoint to say grid 0,0,0 ,after having new wp's given,essentially stop,and disregard the 0,0,0 waypoint. An old arma3 issue with "cancel" waypoints noT actually cancelling the previous until destination was reached.

bleak mural
#

for example how i was setting entire platoon up

rich bramble
#

@tough abyss Intercept is probably more for people that are good at programming. Programming isn't some kind of magic, being a good programmer is about as hard as becoming a good musician.

You can get a taste for it by playing the recorder in kindergarden (=mixing other peoples code snippets into mission scripts) and a lot of it is just down to plain old spending time playing (programming) but at the end of the day you'll need some kind of education to really go above and beyond. Think learning to read sheet music, learning basic music theory, learning specialist techniques for your instrument, studying other artists and composers to get a feeling for what's possible, learning other instruments to broaden your horizon, etc. In programming this means stuff like understanding C-like language syntax, learning about basic datastructures and algorithms, learning the ins-and-outs of a language, studying programing concepts and paradigms, learning different langauges (not just C/C++/Java/C# but truly different stuff like ML/Haskell/etc), etc.

To get to that level, both in music as well as programming, you don't need to be a professional, but most people at that level will be professionals (which makes sense when you think about it).

The easiest way to achieve these high levels is to go and get a formal education in music/computer science from a university, however many great musicians and programmers have taken different paths, teaching themselves through books/videos/etc. However even those people will usually hit a point where they'll want to attend courses, seminars, classes or find a mentor/tutor in order to develop their skills to that level of real mastery.

proven charm
drowsy geyser
#

is it possible to set a injured face without applying damage to the player?

drowsy geyser
#

okay just figured out

player setHitPointDamage ["hithead", 0.5]; //injured head, player overall damage is 0
player setHitPointDamage ["hithead", 1]; // player overall damage is 1, dead
round scroll
#

hmm, the roleDescription seems to work for players, but not for arbitrary objects, like empty helopads ...

edgy dune
#

so afik there is no event handler to detect when a player a player changes zoom level correct? is there any good way to detect that a player has changed zoom? (not change optics mode with crtl+right click)

warm hedge
#

So... holding right click or numpad + and -?

bleak mural
#

POLPOX, I was going to ask you one more question eralier regarding the example i showed,i think this is an easier answer but i get errors if i try any syntax variation

#
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint,1000];       
_wp setwaypointtype "GETOUT";  ;
#

the 1000

#

How can i go about removing an actual distance from the centre point,and instead,just selcting any random pos in the marker area?

hallow mortar
bleak mural
knotty gyro
#

how do I adress the init of a spawned vehicle? MP compat

#

setVehicleInit ?

hallow mortar
#

There is a syntax for createVehicle that has an "init" parameter, but it doesn't really work the same way as an Editor init field.
Object inits are something that's only needed for Editor-placed objects (and even then not really needed, just convenient). If you're spawning a vehicle by script, you're already in a position to just.....do stuff to the vehicle. You have a reference to the vehicle.

private _vehicle = createVehicle ["someClass",[0,0,0]];
_vehicle allowDamage false;
_vehicle addItemCargoGlobal ["FirstAidKit",4];
// etc```
knotty gyro
#

I want the new vehicle to become the arsenal, with ["AmmoboxInit", [this, true]] spawn BIS_fnc_arsenal; How wold I do that if I can't get to the vehicle init?

hallow mortar
# proven charm anyone know?

Part 1:
Anything can be delayed by lag if it's sent over the network.
Anything running in Scheduled can be delayed if the Scheduler is overloaded.
Anything running in Unscheduled can't be delayed as such, but poor performance can make the entire frame happen slower.
Part 2:
I'm pretty sure grasscutters are not scripted, they're enginestuff. Most static objects have a grasscutting effect to stop grass growing through them; grasscutters just use that but have no visible model.

proven charm
hallow mortar
# knotty gyro I want the new vehicle to become the arsenal, with ```["AmmoboxInit", [this, tru...

Nothing in this requires a vehicle init. The function follows this syntax:

["mode", [_objectReference, bool]] spawn BIS_fnc_arsenal;```
When you use `this`, you're just using the object reference variable that's provided by the init field. If you have an object reference available by other means - for example, because you just did `createVehicle` and saved the object reference it returns - then you can use that instead.
hallow mortar
proven charm
#

they do

hallow mortar
knotty gyro
#

aha

#

ty

wind flax
#

Hey guys. Does anyone know of a way to play a reload animation? I'm trying to support 2 different reload animations, from what I've read, you can play the animation, but if it's not the main reload action, the mag proxy won't work

golden ore
#

Hello, I have a simple cold weather script that ticks while the player is not near a heat source. I would like to add a frosty overlay over the screen as the player gets progressively colder.

However, because these overlays fade in slowly, the effect repeats each time the condition is met. How can I make it so that the overlay is activated for each cold level only once, once the condition is met?

hallow mortar
#

I'd say set a variable when an overlay state begins/ends, and also check that variable when the condition is met and don't reapply the effect if the variable is already true

#

example:

if (missionNamespace getVariable ["vuo_frosteffect_state1",false]) then {continue};
missionNamespace setVariable ["vuo_frosteffect_state1",true];
// apply effect```
sullen marsh
#

Given how abstract Intercept is, you don't need to be a master programmer to use it

#

The API is pretty simple, even more intuitive than SQF is really

#

f.e. object setHit [part, damage] turns into set_hit(obj_, part_, dammage_);

clear leaf
fair drum
#

You should be using PATH. Disabling move makes it so they can't even turn.

sullen marsh
#

But beginner programmers could certainly struggle

minor viper
#
_this addAction ["Action Title Here",{
    params ["_target", "_caller", "_actionId", "_arguments"];

    _actionId1 = _target addAction ["Action 1",
    {
        {_target removeAction _x} forEach _actionId1234;
    }
    ,[_actionId1234],1.9,false,true,"h","_target getCargoIndex _this == 3"];

    _actionId2 = _target addAction ["Action 2",{},[_actionId1234],1.8,false,true,"q","_target getCargoIndex _this == 3"];

    _actionId3 = _target addAction ["Action 3",{},[_actionId1234],1.7,false,true,"w","_target getCargoIndex _this == 3"];

    _actionId4 = _target addAction ["Action 4",{},[_actionId1234],1.6,false,true,"s","_target getCargoIndex _this == 3"];

    _actionId1234 = [_actionId1, _actionId2, _actionId3, _actionId4];

},[],1.5,false,true,"","_target getCargoIndex _this == 3"];
#

I've been struggling with this code all day, I'm trying to make a sort of interation menu, where when you use one action, it creates some new actions and deletes the old selection.

#

Issue is that the ID for the next action is created after the arguments for the second action are passed

#

so I have no idea how to make one action remove the other actions that were already there...

cosmic lichen
#

Maybe you can use that

warm hedge
#

So, how does logNetwork work? I've wrote a code like this while I'm in a server I run:sqf 0 spawn { _handle = logNetwork ["myLog.txt", [""]]; systemChat str _handle; sleep 3; logNetworkTerminate _handle; };And no worky, it says _handle is a nil

fleet sand
warm hedge
#

Diag branch doesn't support MP, so there is no chance to have it

#

I'm in Stable right now

fleet sand
#

Did you try to run it in Unsceduled enviormente ?

warm hedge
#

Yes but same. It returns nil handle

#

Tried in Profiling even, it still doesn't work

fleet sand
#

And on what server did you run this command hosted or dedicated ?

warm hedge
#

Trying in my local dedi

#

Server Exec doesn't do it too

fleet sand
#

Then it has to be broken command.

warm hedge
#

Thing is I have never tried this command very recently, even after 2.16

fleet sand
warm hedge
#

No, it is a invalid syntax

fleet sand
#

in the utils it says its like that if you run utils 5

warm hedge
#
supportInfo "u:logNetwork*"```
> `["u:lognetwork ARRAY"]`
sullen marsh
#

But I imagine the struggling would be mainly due c++, not intercept

#

Lost the keys?

#

I've not heard of it being broken, but who knows

agile pumice
#

nvm, i figured it out :)

#

not a problem with the lockturret command

barren summit
#

Hi all, I'm currently running into a shared resource problem with race conditions. I have an array that is modified by multiple objects, but it's critical that only one object can modify it at once. Does SQF have any sort of mutex or semaphore that can be used to create critical sections of code? Are there other ways of handling this problem?

warm hedge
#

One thing I would say is: firstly make sure your concept is correct. Having multiple instances of SQF (Scheduled environment, to be exact) that controls one object, is it actually necessary to do?

#

What kind of control/set commands you need to use in your situation?

barren summit
#

The shared resource problem being:

  • Task 1 accesses array and reads element "A", which is false
  • Task 1 begins a subroutine
  • Task 2 accesses array and reads element "A", which is (still) false
  • Task 2 begins a subroutine
  • Now there are two separate tasks performing two subroutines that end up conflicting with each other
  • Task 1 finishes and sets element "A" to true
  • Task 2 does the same
#

Note that even setting the element to true right after reading it still leaves a period of time another task can access it in it's false state

unkempt marsh
#

are there any commands for checking if an array is a subset of another array?

agile pumice
#

how can i add an action to a player thats attached?

#

my actions aren't showing until i detach myself

fair drum
#

@meager granite #arma3_scripting message

Currently working on doing this with server profilenamespace. When you go to sync data to the server, do you update the server after every local event change to the data? Or do you update at regular intervals.

meager granite
#

if client says update is important (money spent, etc.), instant update

#

Otherwise there are some thresholds

#

up to you to decide

fair drum
# meager granite up to you to decide

this is just my first draft so far: https://pastebin.com/s1TSRAEd

I don't think the hash is going to be big enough to worry about it being sent over network too much as I'm just pulling the player data from the main hash. So I could probably do it on every unlock/kill/death/capture change. Until I figure out what else I want tracked.

meager granite
#

_playerData get _playerUID will be nil if there is no data for uid

#

but otherwise you get the idea, its all really simple

bleak mural
#

Guys does this syntax look correct to run to all blu units?

#
{
  if (side _x isEqualTo WEST) then
  {
      _enableAttack false;

  };
} forEach allUnits;
#

or am i missing a curly bracket after "false"?

#

trying to run this from a radio trigger also so wanted to ask if it should be in any way written differently

fair drum
bleak mural
fair drum
bleak mural
#

isnt local? referring to host machine?

#

this is for SP

fair drum
#

then you are fine. only matters in MP

bleak mural
#

OK if i wanted to again,reenable atack to true, can i run that on the same repeatable trigger through on deactivation by chance?

#

just a thought. i never tried any thing with on deact before

fair drum
#

you can, just make sure your conditions allow for that

bleak mural
#

radio is repeatable

fair drum
#

the condition at some point has to return false for it to be deactivated

exotic flame
#

Is it possible to get the game volume for comunications ?

bleak mural
#

how would i make the condition return false?

fair drum
#

i'm not exactly sure if using the radio part of it allows it to return false. I don't use triggers at all so I don't play with them enough. try running with what you have so far and see if it deactivates

fair drum
bleak mural
#

Il try thanks.

fair drum
#

just put in some logging to see when things turn true/false

proven charm
#

could it be a bug that when you want to see head camera of other player you can only see from the camera that player is using atm? like: _camMan switchCamera "INTERNAL"; may show third person camera if player is using that. or is it intended behaviour?

clear leaf
proven charm
velvet merlin
#

is there a way to have (add)actions work for units inside a vehicle?
or you have to either add the action to the vehicle (or the player when he is inside the same vehicle too)

granite sky
#

If you can see out of the vehicle then they just work by default.

#

Hence in Antistasi you can capture flags while sitting in a car, because we forgot to block it.

proven charm
#

i think you just need long distance for the addaction

granite sky
#

Long enough, yes.

granite sky
#

You can use isNil { // check and lock } if aborting instead of waiting is acceptable.

#

It is also possible that the myLoadoutVar method does work because you get at least one statement after the waitUntil returns. Difficult to test.

#

Also adding a sleep before the waitUntil may have different behaviour.

velvet merlin
#

hm i am trying have revive crew from within the vehicle - for each unconscious crew

#

atm we have the action to the player, and you revive a random one (if there is more than one) and you cant have the name as part of action

#

however that seems not to work if you are inside the same vehicle

hallow mortar
#

I believe addAction generally requires line of sight to the object it's added to, so if you can't actually see the unit when it's in the vehicle, you'll definitely need a different solution

granite sky
#

Ah, the trouble there is that crew aren't real.

#

cursorObject on crew wouldn't work, for example.

velvet merlin
#

(on a sidenote the holdAction implement doesnt support above from what i understand as it does: _target = _originalTarget; instead of _target = vehicle _originalTarget;)

#

do you happen to know if BI supports getting out multiple unconscious from a vehicle? or also just one at a time

#

(eject any vs eject dude1 and eject dude2)

hallow mortar
#

I'm pretty sure the vanilla unload unconscious action just unloads all of them at once....but I'm not completely sure

hallow mortar
dire star
#

anyone knows why my video isn't synced with audio whe i play it with playVideo?

clear leaf
# proven charm dont know then

But is my scrip correct thoug How i used the if Else on the enemy Ai Sp3 maby its the problem or should i just try completely use a new Ai?

proven charm
frozen seal
#

hi all. I'm trying to get a list of all objects (units, vehicles, mission objects etc) within a trigger. I can use this to get all vehicles and units, but how do I get all the props I have placed in eden?

allUnits inAreaArray thisTrigger;
vehicles inAreaArray thisTrigger;
#

I tried using allObjects instead of allUnits but I think it's not working

#

ok nvm I think this did it. It works, but is it the best way?

allMissionObjects "All" inAreaArray thisTrigger;
wicked sparrow
#

Is there a way to read out the params a users used to launch arma?

fleet sand
wicked sparrow
fair drum
fleet sand
#

I am guessing its for the main menu mod or something like that. Its possible but with extension and unfortunately not with a command in SQF. Myb you could put a ticket on Feedback Tracker and myb one day you get that feature where you can have access players startup params. But I can see that as a Huge risk. If a mod is changing startup parameters.

fair drum
#

Main menu mods are okay and don't require extensions so that's why I'm wondering what they are wanting.

And yes, it would be a HUGE risk forcing startup parameters on clients.

queen junco
#

Hey, I seem to struggle with a createUnit - waitUntil line. For some reason the _vehicle is never assigned or for whatever reason the waitUntil-Loop is never finished. Any ideas?

    _group = createGroup civilian;
    _vehicle = _className createUnit [(getMarkerPos _spawnPoint), _group, /*this is for unit init*/"", 0.5, "PRIVATE"];
    waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Can't leave loop
fair drum
#

since you have the group already, you want to use the primary syntax

eternal spruce
#

how do you loop a script indefinitely?

fair drum
queen junco
slim lion
#

Trying to increase damage on webknight smasher but it doesn't seem to respond to the setDamage command like everything else does. Would be nice if there was a way to reduce its power a bit.

fair drum
slim lion
#

rgr

eternal spruce
#

for example like this ?

[] spawn {

while {true} do {

< code>

    };

};

fair drum
eternal spruce
#

@fair drum thank you it worked

wicked sparrow
# fair drum Main menu mods are okay and don't require extensions so that's why I'm wondering...

Thing is that -skipIntro is not working how it is described in wiki. I want users to force disable if they load it so I can edit main menu to be consistent.
See, if users have this enalbed then they get a initial background image when launching game for the first time, but the second they join a server / load any mission arma breaks and will never return to a static image in the main menu. It will always load a weird map at xyz 000 and display water (that is why you even hear water sound when initial background is displayed, mission is loaded but not shown) so after joining any mission arma loads this as main menu background all the time. And due to the command prohibiting any "real" mission from being loaded you are stuck with a stupid water screen you can't do anything about. Forcing disables -skipIntro would solve that (at least for main menu, not multiplayer background).

wicked sparrow
terse tinsel
#

Can someone help me write a script so that the player, as an individual, can listen to the radio conversations of the group called grp1 (ai)?

little raptor
#

unless the radio conversations are scripted, it's not possible

#

if they're scripted (using bikb), you can just join on the same conversation channel

terse tinsel
little raptor
#

no

terse tinsel
bleak mural
#

is it possible to create an exact location for a side to flee to?

small gyro
#

How to decrease delay between unit get in vehicle and fire at some target ?
trying these but find out that it won't work without some 0.1-0.2s delays

loadAgent = createAgent ["C_man_1", [0,0,0], [], 0, "NONE"];
loadAgent disableAI "ALL";
loadAgent moveInTurret [_vehicle, [0]];

[
    {
        vehicle loadAgent fireAtTarget [objNull];
        [
            {
                loadAgent moveOut (vehicle loadAgent);
            },
            [],
            0.1
        ] call CBA_fnc_waitAndExecute;           
    }, 
    [], 
    0.2
] call CBA_fnc_waitAndExecute;

As for condition before fireAtTarget also tried this one but with no success. Unit getting in vehicle but won't fire

loadAgent in _vehicle && {unitReady _vehicle && {loadAgent == assignedGunner _vehicle}}
small gyro
fair drum
#

that's the smallest amount of delay you can possibly get if that is what you are asking

small gyro
#

i am actually asking about smallest amount of delay and also working solution. You are right about CBA_fnc_execNextFrame but unit won't fire with it for some reason

fair drum
#

oh I see what you are asking. try a different fire command instead, there are multiple, and even bis_fnc_fire as well.

small gyro
#

no success. Tried

BIS_fnc_fire
fireAtTarget
forceWeaponFire
bleak mural
#

was there a class name change to "hide" in game(referncing misc objects)

#

for example: map objects:

#
// hide (delete) terrain objects for better map performance
// percentages for deletion
_rock_perc = 50;
_tree_perc = 25;
_bush_perc = 25;
_fence_perc = 5;
_wall_perc = 5;
_hide_perc = 25;

_rock_fac = round (100 / _rock_perc);
_tree_fac = round (100 / _tree_perc);
_bush_fac = round (100 / _bush_perc);
_fence_fac = round (100 / _fence_perc);
_wall_fac = round (100 / _wall_perc);
_hide_fac = round (100 / _hide_perc);

// get all specific terrain objects
// 3,513
_rocks = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["ROCK"], (worldSize * 1.41) , true, true];

// 101,960
_trees = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["TREE"], (worldSize * 1.41) , true, true];

// 288,461
_bushes = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["BUSH"], (worldSize * 1.41) , true, true];

// 11,189
_fences = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["FENCE"], (worldSize * 1.41) , true, true];

// 14,190
_walls = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["WALL"], (worldSize * 1.41) , true, true];

// 192,325
_hides = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["HIDE"], (worldSize * 1.41) , true, true];

//delete given percentage of terrain objects (not randomly cause it will be done on each machine locally and should be the same)
{
 if((_forEachIndex + 1) % _rock_fac isEqualTo 0) then {_x hideObject true;};
} forEach _rocks;

{
 if((_forEachIndex + 1) % _tree_fac isEqualTo 0) then {_x hideObject true;};
} forEach _trees;

{
 if((_forEachIndex + 1) % _bush_fac isEqualTo 0) then {_x hideObject true;};
} forEach _bushes;

{
 if((_forEachIndex + 1) % _fence_fac isEqualTo 0) then {_x hideObject true;};
} forEach _fences;

{
 if((_forEachIndex + 1) % _wall_fac isEqualTo 0) then {_x hideObject true;};
} forEach _walls;

{
 if((_forEachIndex + 1) % _hide_fac isEqualTo 0) then {_x hideObject true;};
} forEach _hides;
#

refers to piles of logs,power lines etc etc

molten yacht
#

Any way to delay a cruise missile's sensor activation so it goes up higher before starting its turn?

graceful meteor
#

i am really new to all of this. how did you do this? I've been looking for days for somthing just like this

exotic flame
#

Is there a command to get the attachments of a weapon in the backpack of the player ?

exotic flame
little raptor
#

I didn't say use it on the unit. use it on the backpack

fleet sand
#

Like: sqf weaponsItemsCargo backpackContainer player

warm hedge
#

I wish there is a comprehensive getter/setter of inventory anyways, like set/getUnitLoadout

fleet sand
exotic flame
exotic flame
warm hedge
#

Current way can lose attachments very easily yeah. Especially vehicle inventory

simple stone
#

Hello! Happy easter!
I had a stupid Idea. And decided to make an addAction script for on up coming OP for my unit. One player (the interpeter) can interact with civilians to question them. Problem is im runing into a lot of problems.
First the game responds on loading that the script has an invalid number in expression. I have no Idea what its talking about.
Second the "Greet" add action should create the following add actions. and remove the greet add action, so the player dosent spawn an infinite amount of add actions.
Third there are no called responses, eaven though there are array's created to call them in.

I know this is a lot of problems. But im just learning arma 3 scripting. Any help is appriciated.

warm hedge
#
  1. In which line?
  2. Yeah this is not great anyways
  3. Well most likely because your code is actually running nothing

Give me a few to point up your things

#
  1. _RES1 is only defined in the script. RES1 is not equal to _RES1 - global variable vs local variable.
  2. call some_fnc_function usage there in _RES1 and so fourth, is actually executed at these lines which means nothing is going to happen or something you don't intend will happen
  3. execVM requires a script file to run, while greet there is just a Number (which is returned by addAction)
queen junco
granite sky
#

LA -> must be executed locally.

#

(locally to the unit)

tough abyss
#

I am looking for either a pre existing way to generate basic profiling information for existing mods/scripts that I don't control, ie I want diag_time on a per frame basis. Any ideas?

vapid scarab
indigo snow
#

.... run diag_time from an onEachFrame EH?

tough abyss
#

That will give me an idea of frame time, but I guess what I am more looking for is "script abc.sqf took 4ms in this frame" sort of answers. As it stands I know ace is bleeding 4+ms a frame but its a big mod with a lot of places to look. So I am either missing how to use onEachFrame for that purpose or I have not explained well what I am trying to do.

#

diag_captureFrame for example shows the engine time, the mod total is somewhere in there (still haven't really worked out where!). Gives me the sort of output I would like to have about the script time.

#

So for example http://imgur.com/47NeVW6 shows the output of diag_captureFrame, it shows the breakdown of time for a frame so you can say confidently 30% of the time is spent simulating and 40% rendering. I kind of want a way to do the same but for mods. Make more sense?

#

I don't currently know of anything that does it and the only idea I have about how to is to use diag_tickTime and then write a parser to go through all the files in all the mods and generate wrapping statements so I capture the times of everything and then have the community run the debug versions of the mods that output logging information on the times for a frame. Its a lot of work to do that, parsing the script files to inject is non trivial!

bleak mural
#

Is there a list of waypoint statements? i cant find any on biki

#

wondering if theres a wp statement to turn engine off. anyone know?

#

got an attack helo on some simple move wp's with a cycle at end,they repeat 20 mins later. i was trying to get them out of vehicle at last wp,no problem but they then ignore the first wp which was GET IN NEAREST. Really confused me,so im settling for the last wp to be TR unload, but i want at least engine off

bleak mural
bleak mural
fair drum
#

For engine off stuff, just throw that into the waypoint completed statement.

bleak mural
#

thanks man,still its not what i meant. dont waypoints have special statements _wp setwaypointstatement engine off

#

for example above. things to modify the wp besides speed ,behaviour etc

#

here , im not using editor wp's:

#
randomPoint= selectRandom ["AO", "AO"];           
 { deleteWaypoint _x } forEachReversed waypoints Ugly1;          
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];           
_wp setwaypointtype "MOVE";           
_wp setWaypointSpeed "NORMAL";           
_wp setWaypointBehaviour "AWARE";          
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];         
_wp setwaypointtype "MOVE";    
_wp setWaypointBehaviour "COMBAT";   
_wp setWaypointTimeout [1, 2, 3];        
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];         
_wp setwaypointtype "MOVE";   
_wp setWaypointBehaviour "CARELESS";  
_wp setWaypointTimeout [1, 2, 3];     
_wp = Ugly1 addWaypoint [position pad, 0];         
_wp setwaypointtype "TR UNLOAD";  
_wp setWaypointBehaviour "SAFE";       
_wp setWaypointTimeout [300, 330, 344];        
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];         
_wp setwaypointtype "CYCLE"; 
fair drum
#

A waypoint statement is just a condition script and a completion script that tells the game engine that a waypoint is completed. Once it is, the statement can run the completion code.

bleak mural
#

Trying to make an AH patrol and attack a zone...RTB,land and turn engine off.. engine off part i am unsure of

fair drum
#

So for instance, you use setWaypointStatements on your last waypoint. In the completion string is where you put your engine off command.

#

On my phone at work so I can't write you a full example

bleak mural
#

i do understand

fair drum
#

Using toString can help clean up the look of your statements as well.

#

And use the engineOn command instead of the action version.

bleak mural
#

so im just gona use GETOUT to chill the crew out until timer counts down. thanks though

#

you know your brain is fried from a day of Arma when after 4 years you forget how a cycle wp works

#

🤦‍♂️

#
 randomPoint= selectRandom ["AO", "AO"];            
 { deleteWaypoint _x } forEachReversed waypoints Ugly1;           
_wp = Ugly1 addWaypoint [position pad, 0];            
_wp setwaypointtype "GETIN NEAREST";            
_wp setWaypointSpeed "NORMAL";            
_wp setWaypointBehaviour "AWARE";           
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];          
_wp setwaypointtype "MOVE";     
_wp setWaypointBehaviour "COMBAT";    
_wp setWaypointTimeout [1, 2, 3];         
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];          
_wp setwaypointtype "MOVE";    
_wp setWaypointBehaviour "CARELESS";   
_wp setWaypointTimeout [1, 2, 3];      
_wp = Ugly1 addWaypoint [position pad, 0];          
_wp setwaypointtype "GETOUT";   
_wp setWaypointBehaviour "SAFE";        
_wp setWaypointTimeout [300, 330, 344];         
_wp = Ugly1 addWaypoint [position pad1, 0];          
_wp setwaypointtype "CYCLE";   
#

thats it if anyone is interested.

junior moat
#

so i have this line which creates a task for the player to complete which is working fine. but i want to call it multiple times during the mission and have each time its called be a new task and not the same one that is just set to assigned again. how would i go about doing that?

[west, "Assault", ["One of our recon teams has found the location of an FIA location. Go to the coordinates and elimited the Insurgents stationed there.","Assault the FIA Outpost", ""], _OutpostSpawnPosition, "AUTOASSIGNED", 0, True, "attack", False] call BIS_fnc_taskCreate;
graceful meteor
fair drum
fallen locust
#

1000/diag_Fps = frame time

junior moat
fair drum
junior moat
#

got it o7

fair drum
fallen locust
#

average frame time*

junior moat
knotty gyro
#

Is it even possible to make this work? ```sqf
{onMapSingleClick "player setpos _pos"} forEach units group player;

#

Where do I put the _x for it to work? I can't figure it out

hallow mortar
#

There are several ways in which this is wrong. Allow me to explain:

knotty gyro
#

Well, basically I want an AI with me as I teleport around the map. Thought it would be simple

hallow mortar
#

onMapSingleClick is a single thing. There can only be one onMapSingleClick active at a time. When you set onMapSingleClick, it overwrites all previous onMapSingleClick. So assuming you managed to get the references to the individual units correct, you would only end up with an onMapSingleClick referencing the last one that the forEach operated on.

#

player refers to the unit the player is currently controlling. Your code, player setPos _pos, only sets the position of that unit. If you want the AI to teleport with you, that won't do it.

#

I haven't finished.

knotty gyro
#

ofc... Can't be simple :/

hallow mortar
#

You can use a Mission Event Handler to make a stackable map-click detector that won't overwrite others.

#

You need to think a little harder about the structure of the code and what it does. Teleporting the AI with you is actually pretty simple, but it should be obvious that player setPos _pos won't teleport anyone except the player.

knotty gyro
#

What I thought, but I was hoping...

proven charm
proven charm
hallow mortar
#
addMissionEventHandler ["MapSingleClick", {
  params ["_units","_pos","_alt","_shift"];
  if !(_shift or _alt) then {
    {
      _x setPosATL _pos;
    } forEach units player;
  };
}];```
knotty gyro
#

thanks guys, but no need to overengineer a stick

#

im just teleporting around while designing missions

#

function wont work when done anyways

hallow mortar
#

I don't remember if the Editor preview teleport requires holding Alt. If it does, then change if !(_shift or _alt) to if (_alt && !_shift)

cosmic lichen
austere nymph
#

Evening gents - not really sure where to ask this. I've tried using UnitCapture on a CUP helicopter (a Little Bird) unfortunately BIS_fnc_UnitPlayFiring doesn't seem to work. I've done some trial and it seems to be able to record and replay gunner playfiring perfectly fine. I also can do so with a Pawnee as a pilot perfectly fine as well. Do you guys have any tips or workaround to record and replay the pilot's firing sequence?

jolly goblet
#

Hi! Attempting to attach a building to another building for the purpose of an animation as the building I'm using comes in 3 parts. I have been using BIS_fnc_attachToRelative however when the other parts are attached they lag behind the animation and it looks pretty terrible. Anyone know a solution to this?

winter rose
jolly goblet
winter rose
#

attach everything to the logic

jolly goblet
#

Just to clarify this is using BIS_fnc_attachToRelative for everything.

fair drum
jolly goblet
jolly goblet
#

Think I've found a solution for this. I've placed a kart at the bottom of the building and animate the kart instead and attached everything to that. So far it appears to be working great - thanks for your suggestions though, was very helpful in figuring out the problem.

molten yacht
#

Is there a way to lock a cruise missile onto a new target after launch?

molten yacht
#

Actually, maybe easier question

#

does anyone know the right code to send a hint to a player who walks into a trigger zone

#

I guess triggers are locally executed, even though I barely use non-server executed triggers

#

I'm overcomplicating things in my head....

edgy dune
#

with CBA_fnc_addPerFrameHandler, does the added Eh stay after respawning?

fair drum
median nimbus
#

you can have more than one displayAddEventHandler of the same event type right?

#

say event is MouseButtonDown

meager granite
#

Yes

median nimbus
#

weird, I'm overwriting another mod's somehow, will have a fresh look tomorrow, ty

hallow mortar
#

In EHs where the return value matters (e.g. handleDamage applying the returned number as damage), only the return from the most recently added EH is considered. MouseButtonDown isn't documented as having a return value override, but its keyboard counterpart does, so it's possible MouseButtonDown actually does too. If it does, and the other EH uses it, your EH being added later could break it.

gentle zenith
#

Does anybody know a way to disable the church bells sound effects? I already tried deleting the church but the sound still plays from that location.
This is on Malden, no mods.
It's very annoying during the night when time is sped up 😂

meager granite
#

Try destroying it, maybe then it will stop?

gentle zenith
meager granite
sullen marsh
#

over 16 frames

meager granite
#
f1 = {player weaponAccessories currentWeapon player};
f2 = {primaryWeaponItems player};
[
     call f1
    ,diag_codePerformance [f1]
    ,call f2
    ,diag_codePerformance [f2]
]
```=>
```[
     ["","acc_pointer_IR","optic_KHS_blk","bipod_02_F_blk"]
    ,[0.00203617,100000]
    ,["","acc_pointer_IR","optic_KHS_blk","bipod_02_F_blk"]
    ,[0.000510821,100000]
]```
#

Why is weaponAccessories so much slower than say primaryWeaponItems? 🤔

sullen marsh
#

I don't think you'll be able to get the fidelity you want without wrapping the script

#

You could try something like that if you're trying to find what script is causing problems

#

Record active scripts and the frame time, do that every frame and find out what scripts correlate with higher frame times

grizzled cliff
#

the simple answer if you are not using a per-frame handler is each script is taking less than or equal to 3ms per frame

#

because that is the hardcoded limit to how much sqf can process over the duration of each interframe processing

drowsy geyser
#

Is it possible to get the [10] call BIS_fnc_bloodEffect; to stay permanently?

warm hedge
#

Just use 10e30 or such?

drowsy geyser
#

unfortunately it fades away after a few seconds

granite sky
meager granite
granite sky
#

You'd get nearly x3 just from the unary vs binary + unary.

austere nymph
unkempt marsh
#

Does anyone know how to make a function that has can make an array of a groups members?

fair drum
fair drum
unkempt marsh
fair drum
unkempt marsh
#

Cheers

clear leaf
manic kettle
#

Does anyone know how to add diary entries only for zeus or admins? I want to be able to write to entries and monitor certain triggers that have happened on the mission

proven charm
#

"Only first zeus sees this hint!" remoteExec ["hint", owner _curatorUnit ];

cosmic lichen
#

no need for the owner command there. Engine does that

proven charm
#

good point I had some issues getting switchmove set locally without the owner command, not sure what it was

maiden glade
#

i am try to do somthing along the lines of this to saving having 10 plus lines of this add action in the init box of an object, i not sure where or how to start

If variable name on an object = Heavy_Veh than excuted Heavy_Veh sqf

inside Heavy_Veh sqf

this addAction ["somename", "folder\classname.sqf"];

meager granite
#

Init fields of any objects you need:

this execVM "somescript.sqf":

somescript.sqf:

if(vehicleVarName _this == "Heavy_Veh") then {
    _this addAction ["Whatever", ...];
};
if(vehicleVarName _this == "Not_Heavy_Veh") then {
    _this addAction ["Whatever 2", ...];
};
#

or execute yet another script instead of addAction

drowsy geyser
#

i ran into a problem, when i create a cutscene and assign an animation to the player, everything works without any issues but after a few seconds the player goes into prone position, this issue does not happen with ai.
this is how i set the animation:

[player, "ALL"] remoteExec ["disableAI", 0];
[player, "Acts_Explaining_EW_Idle02"] remoteExec ["switchMove", 0];

also tried like this:

[player, "ALL"] remoteExec ["disableAI", 0];
[player, "Acts_Explaining_EW_Idle02"] remoteExec ["switchMove", 0];
[player, "Acts_Explaining_EW_Idle02"] remoteExec ["playMove", 0]; 
#

the player performs this "amovppnemstpsraswrfldnon" animation after a few seconds

#

idk if this is a bug or im doing something wrong

#

i tried also without disableAI as it does nothing for players but its still the same issue

proven charm
drowsy geyser
#

no this happens with all animations i have used its an array of animations and none of them have prone in it, they are mostly for cutscenes

proven charm
#

hmm ok but you should know the correct way to use switchMove is run it where the target object is local. so with player/client you dont even need remoteExec

drowsy geyser
#

i think i fixed it, it was because i have setPos the player and immediately after it play/switch the animation but now after adding a delay of 1 second it does not happen meowhuh

austere nymph
fleet sand
cursive tundra
#

Hey, im trying to make a script that draws the path from a starting position to a destination (in this case cities). It works kinda, as in it does draw the markers, however, it doesnt do so consistently / it seems to be unable to draw it completely for more than 1 city. If theres a second in the radius it checks for it only draws the markers that have an index number that hasnt been used already drawing the way to the previous city. How do i fix that?

//////// find cities
_cities = nearestLocations [getMarkerPOS _centerAO, ["NameCity"],_radius];
    {
    _markerpos = locationPosition _x;
    _marker = createMarker ["City" + str _forEachIndex, _markerpos];
    _marker setmarkertype "hd_dot"; 
    _marker setMarkerText  "City" + str _forEachIndex;
    _marker setmarkercolor "ColorYellow"; 
    
    } forEach _cities;
//////// draw path
{
        _path = (calculatePath ["man", "safe", getMarkerPos "HQ_US", locationPosition _x]) addEventHandler ["PathCalculated", 
        {
         _points = _this select 1;   
         _markername = "AoA" + (str (_forEachIndex +1)), _x;
         ["_markername"] call {
         _markername = _this select 0;
                {        
                        private _marker = createMarker [_markername + str _forEachIndex, _x];
                        _marker setMarkerType "mil_dot";
                        _marker setmarkercolor "ColorRed"; 
                        _marker setMarkerAlpha 0.6;
                } forEach (_points);
            };
    }];

} forEach _cities;
granite sky
#

Looks like you have marker name collisions

#

_marker = createMarker ["City" + str _forEachIndex, _markerpos];

#

This will generate the same marker names for each run of the outer loop, right.

#

Also _forEachIndex doesn't exist inside the PathCalculated event handler.

quaint oyster
#

Can someone remind me, is it possible to stop a number from going below a specific number? I'm trying to do something that constantly subtracts till it hits 0 and won't go negative.

#

Is it "floor"?

flint topaz
#

You’d just check if it’s 0 then not reduce typically

#

Or have your loop stop at 0 depends how you are using it

quaint oyster
#

Ty for the reply

warm hedge
#

Or just max

proven charm
#

i guess the order of multiple remoteExec is not guaranteed?

hallow mortar
#

It is, provided they were sent by the same machine

#

obviously if two remoteExecs from different machines cross in midair, neither of them would've known about the other before sending, so the order in that case is down to network conditions

proven charm
#

dont know which one arma uses

hallow mortar
#

Packets can get lost, but there are methods for knowing when a packet has been lost and re-sending the missing packets until the message is complete

proven charm
#

right

hallow mortar
#

Guaranteed messages, like remoteExec, are called guaranteed messages because....they're guaranteed to arrive

proven charm
#

ok thx

analog mulch
#

Want to make a SP mission where at the beginning the commander briefs the player using the map and the markers move accordingly. There is this in the BIKI:
https://community.bistudio.com/wiki/Arma_3:_Animated_Briefing
but absolutely have no idea how to use it. If someone knows a tutorial or a guide somewhere I would appreciate it

warm hedge
#

What you've got is the guide actually. You can check Tac-Ops missions for more examples anyways

analog mulch
#

tac-ops the dlc?

warm hedge
#

Yes

analog mulch
#

but how would i know how the animated briefing was implemented in that

warm hedge
#

By checking the mission?

winter rose
#

but he may not have the DLC ^^

warm hedge
#

Isn't Tac-Ops first party DLC and PBO already?

winter rose
#

it is pbo now

#

though I don't see Missions*.pbo anywhere

analog mulch
#

no i have that DLC

winter rose
#

you can open Tacops\missions_f_tacops.pbo then 🙂

#

you will need a PBO viewer to extract the data and see the scripts

cosmic lichen
#

You just place markers in the editor and create a timeline as shown on the biki

#

On every step of the timeline you manipulate the markers.

analog mulch
#

i'm really code illiterate need like someone to break it down visually

#

this thing aint easy if ure not a coder

cosmic lichen
#

I don't think there is a good tutorial for it.

analog mulch
analog mulch
zenith stump
#

Is it possible to activate a trigger through a script?If so, how?

cosmic lichen
#

Set its condition to true

zenith stump
#

I wish I understood that page.

analog mulch
cosmic lichen
#

You need to open the pbos inside the root folder of Arma 3

#

Not the save folders in your profile folder.

still forum
# fleet sand Quick question if i want to make a modded keybind with this: https://community.b...

Easiest way is to look for existing keys in your keybinds.
You can check your name.Arma3Profile file, it lists all your current keybinds.
Bind CTRL+W to something and look it up in there

I can't see where you got your 512 from, that's not listed anywhere on that page.

I just bound a user action to CTRL+W, that becomes keyUser1 in my Arma3Profile file.
And Left CTRL+W ends up as 487784465 Which is hex 0x1D130011
Which https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding#Additional_documentation_on_key_bitflags_(CfgDefaultKeysPresets)
and https://community.bistudio.com/wiki/DIK_KeyCodes (This page is not linked on the keybinding page, probably should be)
Decodes as
comboKB = 0x1D (DIK_LCONTROL)
deviceType = 0x13 (INPUT_DEVICE_COMBO_KB + INPUT_DEVICE_MAIN_KB (Keyboard key combined with keyboard key))
doubleTapInfo = 0x00
keyId = 0x11 (DIK_W)

#

So its basically the first example of A+2xB, without the doubletap and with different keys

drowsy geyser
#

i have noticed that the sleep command is not very reliable in mp and wanted to ask if this version for example would be more reliable:

private _future = serverTime + 1;
waitUntil {serverTime >= _future};
drowsy geyser
#

i noticed that sleep in MP is not synchronous between clients

meager granite
#

Both sleep and waituntil will not be 100% accurate

#

It depends on current scheduler load on whatever client is doing the check

#

But its not just about the scheduler either, MP by design is only approximate due to many reasons.

#

What are you trying to do anyway?

cyan dust
maiden glade
#

@meager granite so i got execVM but it saying that the sqf is not found?
Init sqf
execVM "assetsSpawn/core.sqf"

Core sqf

    _this addAction ["M1A2C", "assetsSpawn\assetsSpawnHeavy\M1A2C_TUSK_II_Desert_US_Army.sqf"];
    _this addAction ["M1126 M2", "assetsSpawn\assetsSpawnHeavy\M1126_ICV_M2_Desert_Slat.sqf"];
    _this addAction ["M1126 MK19", "assetsSpawn\assetsSpawnHeavy\M1126_ICV_MK19_Desert_Slat.sqf"];
    _this addAction ["M1128 MGS", "assetsSpawn\assetsSpawnHeavy\M1128_MGS_Desert_Slat.sqf"];
    _this addAction ["M1129 MC", "assetsSpawn\assetsSpawnHeavy\M1129_MC_MK19_Desert_Slat.sqf"];
    _this addAction ["M1130 CV", "assetsSpawn\assetsSpawnHeavy\M1130_CV_M2_Desert_Slat.sqf"];
    _this addAction ["M1133 MEV", "assetsSpawn\assetsSpawnHeavy\M1133_MEV_Desert_Slat.sqf"];
    _this addAction ["M1135 ATGM", "assetsSpawn\assetsSpawnHeavy\M1135_ATGMV_Desert_Slat.sqf"];
};

if(vehicleVarName _this == "Light_Veh") then {
    _this addAction ["Whatever", ...];
};

if(vehicleVarName _this == "Air_Veh") then {
    _this addAction ["Whatever", ...];
};```
meager granite
#

Your have wrong paths then

maiden glade
meager granite
#

Also you need to send this into execVM, not just execute it

#
this execVM "assetsSpawn\core.sqf"
#

this in vehicle init field is the vehicle itself (magic local variable without the _)

#

(Magic = 25 years old crap)

maiden glade
#

now i geting Undefined variable in expression: this, line 1

meager granite
#

post full error

#

Also make sure its vehicle init field and not init.sqf file

maiden glade
#

got it working

bleak mural
#

im not finding alot of information on how to do this,its a quite complicated function to achieve as the groups variable names cant be used at least in a traditional sense... what im trying to achieve is to set a small repeatable trigger area, inside it,if there is a group,and new units that enter that trigger area automatically join the first group already there

#

i understand id need something with count and inthislist

#

join etc

#

but what im unsure of is how to factor in the group variable,as they will always be random and different mission to mission

#

one group variable must remain aswell,i cant create a new group in this context.

rich frost
#

is this the right channel to ask questions about particles?

warm hedge
#

By script? Yes

rich frost
#

i mean, i script the spawner, but i use the config style params

warm hedge
#

Depends on your actual question then

bleak mural
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
bleak mural
#
this addEventHandler ["CombatModeChanged", { 
 params ["_group", "_newMode"]; 
  
 if (_newMode == "COMBAT") then  
  { 
   leader _group sideChat "Contact,We're engaged with enemy!"; 
   
   _soundFile = selectRandom ["showcase_infantry_01_enemy_spotted_pap_0.ogg","showcase_infantry_01_enemy_spotted_alp_0.ogg","showcase_infantry_01_enemy_spotted_alp_2.ogg","showcase_infantry_01_enemy_spotted_alp_1.ogg","showcase_infantry_01_enemy_spotted_poi_0.ogg"]; 
    
   playSound3D ["\a3\dubbing_f\showcase_infantry\01_enemy_spotted\" + _soundFile, player]; 
    
   [] spawn  
    { 
     sleep 3; 
      
     _soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"]; 
    
     playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player]; 
    }; 
  }; 
}]; 
 
this addEventHandler ["UnitLeft", { 
 params ["_group", "_oldUnit"]; 
  
 if !(alive _oldUnit) then  
  { 
   leader _group sideChat "Man down,we've Lost one!"; 
    
   _soundFile = selectRandom ["showcase_infantry_x01_medic_dead_alp_0.ogg"]; 
    
   playSound3D ["a3\dubbing_f\showcase_infantry\x01_medic_dead\" + _soundFile, player]; 
    
   [] spawn  
    { 
     sleep 3; 
      
     _soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"]; 
    
     playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player]; 
    }; 
  }; 
}];
#

the script above i threw together a year ago, i just recovered it and tried using it on the init of a group but i keep getting errors with the eventhandler "combatmodechanged"

#

has something changed in Arma with this? iv no understanding why its not working,it used to work flawlessly

meager granite
#

sure its init of a group and not unit?

bleak mural
#

i tried with a unit too

meager granite
#

if unit change this to group this

bleak mural
#

let me try

bleak mural
meager granite
#

post full error

bleak mural
#

....his addeventhandler ["combatmodechanged"|#|, { params ["_group","_newMode"];... " ERROR Missing ]

#

this is whats displayed when attempting to enter in init of either group or group leader

#

pretty sure its meant to be in init of the group,not leader,but error shows on "unit left" event handler sometimes too

#

from what i can guess,the structure coming after the initial calling of EH is wrong

#

hmmm i entered it again,no changes,and im not getting the error(so a copy n paste language error) ,its working

#

although im not hearing any ogg sounds

meager granite
#

move it into a separate file and call it

bleak mural
#

i did that at first

#

3rd time worked

#

the ogg section looks ok?

meager granite
#

I didn't check what code does

#

so far it looks like you messed up with copying somewhere

#

because of missing ] error

bleak mural
#

ye its really weird tho

#

heres full :

#
this addEventHandler ["CombatModeChanged", { 
 params ["_group", "_newMode"]; 
  
 if (_newMode == "COMBAT") then  
  { 
   leader _group sideChat "Contact,We're engaged with enemy!"; 
   
   _soundFile = selectRandom ["showcase_infantry_01_enemy_spotted_pap_0.ogg","showcase_infantry_01_enemy_spotted_alp_0.ogg","showcase_infantry_01_enemy_spotted_alp_2.ogg","showcase_infantry_01_enemy_spotted_alp_1.ogg","showcase_infantry_01_enemy_spotted_poi_0.ogg"]; 
    
   playSound3D ["\a3\dubbing_f\showcase_infantry\01_enemy_spotted\" + _soundFile, player]; 
    
   [] spawn  
    { 
     sleep 3; 
      
     _soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"]; 
    
     playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player]; 
    }; 
  }; 
}]; 
 
this addEventHandler ["UnitLeft", { 
 params ["_group", "_oldUnit"]; 
  
 if !(alive _oldUnit) then  
  { 
   leader _group sideChat "Man down,we've Lost one!"; 
    
   _soundFile = selectRandom ["showcase_infantry_x01_medic_dead_alp_0.ogg"]; 
    
   playSound3D ["a3\dubbing_f\showcase_infantry\x01_medic_dead\" + _soundFile, player]; 
    
   [] spawn  
    { 
     sleep 3; 
      
     _soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"]; 
    
     playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player]; 
    }; 
  }; 
}];
#

ok so the sections for SIDECHAT work

#

but im not hearing any ogg audio. i think the syntax is correct though

#

the ogg files are all from vanilla Arma3 campaign

#

"playsound3D" should just play in any location and audible

meager granite
#

Change it to this execVM "somefile.sqf" and have your stuff there in the file instead

bleak mural
#

sorry i dont follow, you mean write this syntax in a new . sqf file, and call that sqf file from the init.sqf?

#
this addEventHandler ["CombatModeChanged", {
    params ["_group", "_newMode"];
  
 if (_newMode == "COMBAT") then  
  { 
   leader _group sideChat "Contact,We're engaged with enemy!"; 
   
   _soundFile = selectRandom ["showcase_infantry_01_enemy_spotted_pap_0.ogg","showcase_infantry_01_enemy_spotted_alp_0.ogg","showcase_infantry_01_enemy_spotted_alp_2.ogg","showcase_infantry_01_enemy_spotted_alp_1.ogg","showcase_infantry_01_enemy_spotted_poi_0.ogg"]; 
    
   playSound3D ["\a3\dubbing_f\showcase_infantry\01_enemy_spotted\" + _soundFile, player]; 
    
   [] spawn  
    { 
     sleep 3; 
      
     _soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"]; 
    
     playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player]; 
    }; 
  }; 
}]; 
 
this addEventHandler ["UnitLeft", { 
 params ["_group", "_oldUnit"]; 
  
 if !(alive _oldUnit) then  
  { 
   leader _group sideChat "Man down,we've Lost one!"; 
    
   _soundFile = selectRandom ["showcase_infantry_x01_medic_dead_alp_0.ogg"]; 
    
   playSound3D ["a3\dubbing_f\showcase_infantry\x01_medic_dead\" + _soundFile, player]; 
    
   [] spawn  
    { 
     sleep 3; 
      
     _soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"]; 
    
     playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player]; 
    }; 
  }; 
}]; 
#

finally got it working

#

tweaked it a little

#

also copy pasted many times,and rewrote some syntax. the special code messes up the syntax on BIS forums and other formats maybe

sharp grotto
winter rose
#

use Notepad++ and "show special characters" to view them (e.g non-breakable spaces / nbsp)

knotty gyro
#
// List of units allowed to eff around with the crate
private _bluengi = ["B_T_Engineer_F","B_Engineer_F","B_D_Engineer_IxWS","B_W_Engineer_F"];

spawnres = createvehicle ["gm_fortification_crate_05", position bluebeach];
[[west, "blu"], "Mobile spawnpoint resources landed. Good luck."] remoteExec ["sidechat"];

// Do semthing useful with the crate
if (typeof player in _bluengi) then {
[spawnres, ["<t color='#FF0000'>Construct spawn point</t>","s\setupspawn.sqf"]] remoteExec ["addaction"];
[spawnres, ["<t color='#8888cc'>Load resources on a boat</t>","s\b_loadspawnres.sqf"]] remoteExec ["addaction"];
[spawnres, ["<t color='#8888cc'>Load resources on a truck</t>","s\loadspawnres.sqf"]] remoteExec ["addaction"];
};

Why is my unit check failing? I've been fighting with this for a few days now and I just can't figure out what I'm doing wrong! Please help? (The rest is fine, anf if I remove the unit check it's fine too... )

winter rose
#

in is case-sensitive, maybe it's that

#

also if that's running on the server, player is objNull

timber bison
#

Hey, has someone a tutorial to add a sqf file as an function in a mod. with the official wiki its dont work. i have tried with the cfgFunction, ther is every time the error fil not found.

winter rose
#

what exactly have you tried?

#

(please use pastebin)

knotty gyro
granite sky
#

If it's in a mod then the addon prefix matters. That usually trips people up.

#

Addons without a prefix apparently get an automatic prefix which is undocumented.

timber bison
granite sky
#

..what

winter rose
timber bison
zenith stump
granite sky
winter rose
#

you may have to create a diary subject

timber bison
#

i have set the addonPrefix in den Addonbuilder to GRU an have set the filtpath to: GRU\Equipment\Arsenal, is a leading \ requiert for this path?

little raptor
#

No

timber bison
#

i still have the error file not found. have i todo more than put a sqf file in the mod and the cfgFunction in the config.cpp?

fleet sand
#

Other then that big thanks for explanation.

still forum
#

but 512 is not the integer for left ctrl.
left control is 0x1D, which is 29

still forum
#

Ah I see you were looking at INPUT_CTRL_OFFSET instead of DIK_LCONTROL

granite sky
still forum
#

Mh maybe 512 could also work then 🤷 but thats not what the game does when you set a CTRL+W keybind, so I wouldn't trust that

timber bison
granite sky
#

Nope.

#

If you zip up your addon and send it to me then I'll check it.

#

Too many tiny ways that this can go wrong to keep suggesting stuff.

fleet sand
# timber bison i have a CfgPatch entry and a CfgVehicle entry and the units i have insert will ...

Here is a simple way you can put your fnc in a mod:
Mod structure:

MyFile      // Addon folder
|__config.cpp
|__fn_Test.sqf

In config.cpp:

class CfgPatches
{
    class MyTestMod
    {
        name = "MyTestMod";
        author = "Legion";
        url = "";
        requiredVersion = 1.60;
        requiredAddons[] = { "A3_Data_F_Decade_Loadorder"};
        units[] = {""};
        weapons[] = {};
        skipWhenMissingDependencies = 1;
    };
};

class CfgFunctions
{
    class LEG
    {
        tag = "LEG";
        class Category
        {
            file = "\MyFile";
            class Test {};
        };
    };
};

In fn_Test.sqf:

params ["_text"];

hint format ["This is my Test Text: %1", _text];
delicate cedar
#

Hi guys! im creating a map in ArmA 3 and i want to know how to make some of my editor placed markers just visible to one side

winter rose
delicate cedar
#

Thank you Lou!, I'll try it just now

fleet sand
# delicate cedar Hi guys! im creating a map in ArmA 3 and i want to know how to make some of my e...

You could do something like this but you will have to name your markers correcly:
CIV_MyMarker1, CIV_MyMarker2 -- Civ markers WEST_Marker1, WEST_Marker2 -- West Markers EAST_Marker1, East_Maker2 -- East Markers GUER_Marker1, GUER_Marker2 -- Ind Markers

//Init.sqf
0 spawn {
    waitUntil { !isNull (findDisplay 46)};
    {
        private _arr = _x splitString "_";
        private _pre = _arr select 0;
        if(_pre in ["WEST","EAST","GUER","CIV"]) then {
            if(format ["%1",side player] == _pre) then {
                _x setMarkerAlphaLocal 1;
            }else {
                _x setMarkerAlphaLocal 0;
            };
        };
    }foreach allMapMarkers;
};
delicate cedar
#

I tried Lou one and it worked perfectly, also thank you Legion!

winter rose
#

Legion's version allows for an "automated" system so you can Ctrl+C/Ctrl+V markers
if you only have a handful, go for the simple version

drowsy geyser
#

how to exclude a control from being delete using the below?

_allControls = allControls findDisplay 46;  
{ctrlDelete _x;} forEach _allControls; //tried following but didn't work: {ctrlDelete _x;} forEach _allControls - [_exampleCtrl1,_exampleCtrl2, etc];
#

it works for allCutLayers though

_allLayers = allCutLayers;   
{_x cutFadeOut 0.01;} foreach _allLayers - [_exampleCtrl1,_exampleCtrl2, etc];
fleet sand
drowsy geyser
#

yes

#

i want to exclude 2 controls from being deleted but the command deletes every control

winter rose
#

now if these controls are sub-controls… don't delete the parent(s)

knotty gyro
#

is there a tool to quickly figure out the door number in a building?

drowsy geyser
hallow mortar
knotty gyro
#

How do I acess the Edit Terran Module?

hallow mortar
#

You might be surprised to learn it's in the Modules tab

knotty gyro
#

sarcasm isn't helpful...

#

but thanks

hallow mortar
#

Editor > right panel (Assets) > Systems > Modules > searchbox > "Edit Terrain Object"

knotty gyro
#

I go tit

formal stirrup
#

What value with vector3Ds let you just point straight up?

#

Or nvm I guess, Why is it when I use drawLaser, the vecor of [0,0-1] shows the laser in the ground, but [0,0,1] doesnt show anything?

sturdy basalt
#

hey all quick question!

for this scripting:

reducedDamage = 0; // Reduced damage

what are the values? 0 means no reduced damage. is 1 fully invincible or is 100 fully invicible. if i wanted to reduce the damage players take from AI to 80%, what would be the value for example? 0.8 or 80?

fair drum
#

post the whole thing

sturdy basalt
#

sorry! its setting the server settings for AI damage dealt to players

#

so how much damage AI do to human players

sturdy basalt
#

some say its just on or off, 0 = no reduced damage and 1 = reduced damage with no ability to control “how much reduced damage” others say you can control the amount of damage reduction

hallow mortar
sturdy basalt
#

do you happen to know if “AI” damage is only from AI units like infantry, tanks, aircraft etc or do things like IED, traps count as well?

hallow mortar
#

According to the documentation, it reduces damage taken by the player and members of their group - no specific source is mentioned, so presumably all sources.
(* not scripted damage. setDamage or setHit will bypass the reduction.)

sturdy basalt
#

ohhh interesting! thanks nikko 🙂

frozen seal
fair drum
abstract bay
#

How to prevent AI vehicles from using jungle footpaths on map Tanoa? Vehicles often drive straight into jungles and get stuck because they want to take the shortest route. How to prevent it? I tried to block the paths with walls and the like, but the vehicles manage to bypass the walls and go onto the paths

frozen seal
molten yacht
#

Is there a way to lock a cruise missile onto a new target after launch?

#

I'm concerned it'll just fly into the hillside otherwise

quaint oyster
#

Is there a way to check an items classname to figure out what kind of item it is like what can be done with a vehicle?

#

I'm trying to figure out if a classname is a uniform. Goal is to count and remove all uniforms from a container.

NVM Solved it.

molten yacht
errant iron
#

Has it been heard before that addWeapon can cause the gun to be silent to other clients? ive switched missions on a dedicated server and found that we couldnt hear most of the AI weaponry, and ive isolated it down to this: ```sqf
private _grp = createGroup east;
private _unit = _grp createUnit ["O_Soldier_F", getPosATL player, [], 0, "NONE"];

{_unit removeMagazine _x} forEach magazines _unit;
removeAllWeapons _unit;

private _weapon = "arifle_akm_f";
_unit addWeaponGlobal _weapon;
private _mags = getArray (configFile >> 'CfgWeapons' >> _weapon >> 'magazines');
{_unit addMagazineGlobal _x} forEach _mags;``` if the unit's weapon gets replaced then we cant hear it, even if we pick up their gun and shoot it (the shooter can hear it, but not others)

#

curiously it sounds fine with setUnitLoadout...

meager granite
#

Thought: Swap around addMagazineGlobal and addWeaponGlobal order?

#

So you first add the magazine, then the weapon

#

Since you create the unit right in this script, use normal addWeapon/addMagazine instead?

errant iron
#

oop addWeapon/addMagazine is what i originally tested before their global variants

#

swapping their order didnt work

meager granite
#

Do you use any mods/addons btw?

errant iron
#

yes, a few on the server - notably RHSUSAF, RHSAFRF, and Project SFX: Remastered - and unrestricted for clients, but this set of mods was used before 2.16 and we didn't have this issue

meager granite
#

We had similar issues with JSRS breaking some of RHS stuff, some guns were silent for non-JSRS players

errant iron
#

yup, im familiar with that

meager granite
#

It could be sound mods breaking the gun somehow if its created on their side?

#

Or the other way around if gun is created on non-sound mod side and then used by sound modded clients

#

Test same script without any mods at all

errant iron
#

i tried unloading RHSUSAF+RHSAFRF and Project SFX: Remastered without success (though technically not all three at once), and some of us tried joining completely vanilla without luck either

#

i guess ill go all the way then

meager granite
#

Try having it all vanilla for dedi and players

errant iron
#

one sec

#

oh hey, we hear it now

meager granite
#

Yeah, looks like sound mod is at fault

errant iron
#

so having SFX and no RHS didnt work, having RHS and no SFX didnt work, but removing both fixed it...

#

joining with those mods again (server being vanilla) i can't hear them firing anymore...

errant iron
#

the last time we ran this gamemode (no changes related to the usage of addWeapon) was Jan 22, so definitely during arma v2.14, which means this is probably a regression in 2.16?