#arma3_scripting

1 messages ยท Page 667 of 1

past wagon
#

guys, how can I make it so that civilian vs civilian is not deemed friendly fire

#

i need to do that without making it so that civilians are not able to access crates

#

when I do civilian setFriend [civilian, 0];, it makes it so that they cannot open boxes because they are on the civilian side

covert shoal
#

I've just tried using BIS_fnc_SpawnGroup in two separate instances and got the same error. Verified my game files, no mods and no betas

#

21:32:23 Error in expression <private ["_pos", "_side"];
_pos = _this param [0, [], [[]]];
_side = _this param>
21:32:23 Error position: <param [0, [], [[]]];
_side = _this param>
21:32:23 Error Type Object, expected Array
21:32:23 File A3\functions_f\spawning\fn_spawnGroup.sqf [BIS_fnc_spawnGroup]..., line 38

fleet stirrup
past wagon
#

@fleet stirrup i basically have a battle royale type game where gear is stashed in crates around the map and civilians are fighting each other

#

I want players to always be able to access crates, and I want players to be able to kill each other without it saying friendly fire

#

since objects such as containers are all on the civ side, making civs enemies with each other causes them to not be able to access crates

torpid quartz
oblique arrow
copper raven
torpid quartz
tough abyss
#

unitcaptured a Gorgon, how do i save my player's hearing
awful tire screeching

winter rose
tough abyss
#

i will make an in-mission note to apologize to my players

winter rose
#

0 fadeSound 0 for the travel time ๐Ÿ˜„

tough abyss
#

doesn't that mess with the player's actual ingame settings

#

as in setting it to 1 might be catastrophic while they have it set to 0.5 in their settings or something

winter rose
#

nope, their setting is the "100%" of the command

tough abyss
#

oh wow

#

i wish i knew that earlier

#

like maybe 2019 earlier

winter rose
#

you cannot force a setting upon the client ๐Ÿ™‚

tough abyss
#

thanks bud

#

odd
fadesound isn't working
using fadeeffect and cinemaborder if that has to do anything with that

tough abyss
#

time to write an apology

cosmic lichen
winter rose
#

true, many still have the wrong idea

#

fadeSound/fadeMusic etc

cosmic lichen
#

I'll do that

#

Pages need a revamp anyway

winter rose
#

you are a lovely [insert the species of your choice]

vague geode
#

I am getting an error saying that Suspending not allowed in this context for the waitUntil-lines but the whole thing is spawned which should allow suspension so does anyone got any clue why it's throwing that error?

{
    _null = _x spawn {
        waitUntil { !isNil "WL_fnc_function" };

        if !(_this in [BIS_WL_base_WEST,BIS_WL_base_EAST]) then {
            waitUntil { sleep 1; _this getVariable ["BIS_WL_sectorActivated",false]; };
            _nil = _this call WL_fnc_function;
        };

        waitUntil { sleep 1; _this getVariable ["BIS_WL_guardSpawned",false]; };
        _nil = _this call WL_fnc_function;
    };
} forEach BIS_WL_sectors;
willow hound
#

Where does this code block live and when is it executed? Some kind of init field?

winter rose
#

initServer.sqf allows for suspension

spark turret
#

functions which are called cant always suspend

#

not sure if that depends on the environement or the "call" execution

vague geode
cosmic lichen
#

_null =
Don't do that. That's pointless

winter rose
vague geode
cosmic lichen
#

There will be no problems if you don't use them.

cosmic lichen
little raptor
tough abyss
#

ive got a high command module that i want a certain group in the middle of the mission to be added to HC subordinates, possible?

vague geode
cosmic lichen
#

Yep, so you are fixing bad code practices with another bad one ๐Ÿ˜„

vague geode
little raptor
cosmic lichen
#

We need more details

cosmic lichen
#

Have you checked the biki commands?

tough abyss
little raptor
#

instead of _x spawn use [_x] spawn

#

and then params ["_something"]

#

inside the code

winter rose
#

ah an array param thing, might be

cosmic lichen
#

black sqf magic again notlikemeow

willow hound
vague geode
still forum
still forum
radiant yacht
#

is there a variant of the unit capture script that allows me to record fireing weapons (talking about a helicopter)

little raptor
radiant yacht
#

rec = [heli1,300,120] spawn BIS_fnc_UnitCapture; rec = [heli1,300,120] spawn BIS_fnc_unitCaptureFiring;
^so i put that into the trigger?

#

and this into the sqf โฌ‡๏ธ

#

[heli1, wp1] spawn BIS_fnc_Unitplay; [heli1, wp1] spawn BIS_fnc_unitCaptureFiring;

#

?

tough abyss
#

need group to hide from appearing on map when player is using HC interface
how do

oblique arrow
#

Hm odd

#

that should work?

torpid quartz
#

wait hang on

oblique arrow
#

thats how the basegame endgame missions do it

torpid quartz
#

i forgot the ] lmao

#

yup no, all good you were right

opal sand
#

Two very simple questions people ๐Ÿ˜„

  1. How do i make a unit crouch upon reaching waypoint?
  2. How do i make a unit play multiple animations upon reaching waypoint (e.g kneelin, kneelloop)?
opal sand
willow hound
#

What does the wiki say?

willow hound
#

!wiki when

opal sand
halcyon oar
#

How do I make it so a script I made applies to all the billboards in my game? Is it with typeOf? I've tried some stuff but I guess I'm just not proficient enough to get it to work. I'd love if someone could show me how to make something apply to all objects of the same class name

willow hound
#

First you need to gather all the billboards, so depending on what you mean with all the billboards that will probably have to be done with allMissionObjects. That already has a type parameter, but I'm not sure if that works with config classes. Either way, there are probably several classes of billboards which you want to retrieve, so in case they all share a common parent class you can possibly use that parent class with allMissionObjects (but not sure about that) or you can use it with isKindOf to filter for your desired objects.
typeOf could also be used, but not with a possible parent class; isKindOf works with both, the actual class and parent classes.
Ah, yes, you can figure out if there is a common parent class shared by all billboards in the config viewer, it shows all parent classes of the current config in the bottom.

#

If your script has to run multiple times, you should probably buffer the result of the process described above to avoid using allMissionObjects again.

halcyon oar
#

I only want a single class name

#

So I guess typeOf is enough right?

#

I just don't know how to properly apply it

willow hound
#

How to apply it? typeOf MyObject

#

"MyObjectClass"

exotic flax
halcyon oar
#

I'm going to sound really stupid, bear with me

#

Is it like the example in the wiki?

#

typeOf vehicle == "classname";

#

?

exotic flax
#

the examples always work when executed in game, but most likely will need some modifications based on your usage

exotic flax
#

if used in an if statement

halcyon oar
#

I tried that before and it throwed an error

#

Might be something else then

#

That caused it

#

do I have to make a for with allMissionObjects to check every classname?

exotic flax
#
{
   if (typeOf _x == "classname") then {
      hint "vehicle is typeOf classname";
   };
} forEach allMissionObjects;
halcyon oar
#

Seems about right

willow hound
#

Unless you find a common parent class...

halcyon oar
#

It's what I did

#

So

#

Thanks for clarifying my doubts

#

๐Ÿ™‚

wooden plaza
#

Anyone Know How I Can Make Scenario Into A Mod? Thanks.

wooden plaza
#

That only puts it onto steam workshop and as a scenario I want make the scenario into a mod for others to use on there servers

#

I got it all on steam workshop just want it turned into a mod and not set as a scenario

cosmic lichen
#

Then read the page

#

You can also export as pbo

wooden plaza
#

Ok thanks

clever radish
#

Why won't this work on servers?

#

`_gen = _this select 0;
_loc = nearestObject [_gen, "Logic"];

{_x switchLight "OFF"} forEach ((getPos _loc) nearObjects ["Land_Lampadrevo",150]);`

#

The lights will not turn on. Trying this in singleplayer the lights turns on. If start a LAN server, only I will be able to exec the script successfully

winter rose
clever radish
winter rose
#

lol Land_Lampad@cosmic lichen

cosmic lichen
#

What?

winter rose
#

"Land_Lampadrevo"

cosmic lichen
#

Oh the config name

shadow sapphire
#

Is there such a thing as a three state trigger, or would I have to write it myself? Would it be more performance efficient to write a three state detector of my own or would it be more efficient to use two triggers to reach the three states?

cosmic lichen
#

three states?

#

true false maybe?

winter rose
#

(what do you need, seriously? ^^)

#

true false perhaps ๐Ÿฎ

shadow sapphire
#

Like "East Occupied," "West Occupied," "Unoccupied."

winter rose
#

since a trigger is an object, you could use setVariable?

#

set side west, east, civilian?

shadow sapphire
#

Oh, man! That might do it! Dang. That sounds good, but I'm not sure I know how to set the conditions for it.

I guess the conditions are another hangup, because it would have to be like:

"If East > West, then True;"
"If West > East, then Also True;"
"If Civ > East AND West, then False;"

Or something. I'm sure I'm just on the wrong track.

I know how I would do it with two triggers. Maybe I need to work through that first and it'll click later.

winter rose
#

yep, write in e.g notepad the human logic first ๐Ÿ˜‰

shadow sapphire
#

Haha, will do, thanks!

upper siren
#

Hello ๐Ÿ™‚ is there an easy way to call a certain script only on the first HC that connects?

Right now I'm using this in the init.sqf
if (!isDedicated && !hasInterface && isMultiplayer && local HC1) then with the headless client slots being called HC1 and HC2.

Problem is they don't populate the slots top to bottom so if I'm running only one HC it sometimes connects to slot 2 (HC2) and not calling the script.

radiant yacht
#

hey lou, you happend to know how i can make a helicopter fly and shoot off of pre recorded data?

winter rose
#

BIS_fnc_unitPlay?

radiant yacht
#

that covers the movement part, but what about the shooting part

little raptor
exotic flax
#

No idea how to use it (properly) though

little raptor
#

just set firing to true meowsweats

radiant yacht
little raptor
#
if (_captureFiring) then
{
    [_unit, _duration, _timeOffset] spawn BIS_fnc_UnitCaptureFiring; // Starts the weapon fire recording script
    hint "Starting Capture, including weapon fire data...\n\nPress ESC to stop capture.";
}
else
{
    hint "Starting Capture...\n\nPress ESC to stop capture.";
};
```![meowsweats](https://cdn.discordapp.com/emojis/707626030613135390.webp?size=128 "meowsweats")
#

seems like it just spawns the other script

#

@radiant yacht do this:
for recording:

[heli1, 300, 120, true] spawn BIS_fnc_unitCapture;

after it's captured:

[heli1, _Data] spawn BIS_fnc_unitPlay
#

_data is the recording data (which is copied to clipboard)

radiant yacht
#

well there are 2 recorded data things

little raptor
#

no

radiant yacht
#

movement and fire

#

^sorry my brain has been melted, these are the 2 things i can copy now

#

one with F1 and another with F2

little raptor
#

yeah nvm

#

it copies both data to clipboard simultaneously

radiant yacht
#

say what now

#

won't it overwrite?

little raptor
#

yes

#

if you have a clipboard manager or something you might be able to get both data

radiant yacht
#

could i not just copy them seperate, and past them after one another?

little raptor
#

you'd have to record separately then

radiant yacht
#

no thats what i mean, so you are saying that i need to put the movement and weapons data as the _Data, so doesn't that mean that i can just go _data = (movement data) (fire data)?

little raptor
#

no

#

I recommend you do this:
record the movement
copy it to clipboard
play the movement data and this time record firing
copy the firing data to clipboard

radiant yacht
#

wait

#

_moveData =; _firingData =; [heli1, _moveData] spawn BIS_fnc_unitPlay; [heli1, _firingData] spawn BIS_fnc_unitPlayFiring;

#

that would work, no?

little raptor
#

the best thing to do tho is to forget those nonsense functions meowsweats

little raptor
#

if you mean exactly like that then absolutely not

radiant yacht
#

oh, i see, yea

little raptor
#

I could write a far better unitCapture in 10 minutes

#

I don't know what they were smoking meowsweats

shadow sapphire
#

Holy shit. A few years ago, I'd have paid twenty bucks for a decent unit capture and playback function.

radiant yacht
#

idk what they smoked, but i need some of it

#

a quick sitrep xD

i'm at the point where i have the BIS_fnc_unitCapture data, which is movement and weapons
the thing is those 2 are seperate data sets
and the problem is that the BIS_fnc_unitPlay only accepts one data stream
[ vehicle player, _unitCaptureData ] spawn BIS_fnc_unitPlay
^i need to combind the 2 data sets somehow

little raptor
#

I have to go rn but when I'm back I'll write a better captureData function.

upper siren
manic sigil
#

I need an .sqf program to end at a specific point, following an if-statement. I've tried Terminate, but it doesn't seem to be working :/

winter rose
#

exitWith?

manic sigil
#

Hrn... I'd mucked with exitWith before but didn't have much luck. Looking at it now, maybe I was laying it out wrong.

unique sundial
#

if you are in the main scope then exitWith, if deep in child scopes can try breakTo/breakOut

manic sigil
#

That is an interesting point, because of how I structure my scripts :/

#

I use an InitServer to set up variables, weather, etc, then end with execVM "Staging.sqf".

Staging.sqf execs the mission's sqfs in sequence; T1 = execVM "Task1.sqf";, etc etc

#

So in this case;

if (triggerActivated _AAFRain) then {TasksDone = TasksDone+1; terminate T37}; 
if (triggerActivated _AAFRain) exitWith {TasksDone = TasksDone+1;};
#

What I had before, what I'll try next.

unique sundial
#

there is no guaranteed order of execution if you use execVM or spawn, you know that, right?

manic sigil
#

I'm vaguely aware, or at least know that the scheduler is something to be concerned with, but each one is tailored around the objective; waitUntil {sleep x; player distance objective <300}, etc.

#

At least, in my current mission, which is less linear than my other project

unique sundial
#

try
terminate _thisScript;
inside the scheduled script you want to exit

manic sigil
#

๐Ÿ˜ฎ didn't know that was a magic word

unique sundial
#

_thisScript contains script handle

shadow sapphire
#

Is setTriggerInterval broken?

willow hound
#

Not for me at least.

shadow sapphire
#

Then I wonder what I'm doing wrong.

#

In InitServer.SQF, I've got this:

If (isServer) then
{    
    _Flag = createMarker ['', markerPos 'Sector'];
    _Flag setMarkerType 'mil_objective';

    _SectorFIA = createTrigger ["EmptyDetector", markerPos "Sector", false];
    _SectorFIA setTriggerActivation ["ANY", "PRESENT", true];
    _SectorFIA setTriggerArea [100, 100, getDir this, true];
    _SectorAAF setTriggerInterval 5;
    _SectorFIA setTriggerStatements
    [
        "East countSide thisList < 0.4*(West countSide thisList);",
        "DeleteMarker '';
        Hint 'Zone Occupied';
        _Flag = createMarker ['', markerPos 'Sector'];
        _Flag setMarkerType 'Flag_FIA'",
        "Hint 'Zone Empty';"
    ];
};```
#

Everything is working just fine except that interval.

willow hound
#

_SectorFIA _SectorAAF tanking

shadow sapphire
#

Hahaha, of friggin course. Okay!

Dammit, always something dumb.

It's also not registering in the syntax here or on VSC for some reason, which furthered my doubt.

willow hound
#

initServer.sqf only runs on the server, no need for if (isServer) ๐Ÿ™‚

shadow sapphire
#

*I'm fairly certain this script will not be run from the server init in the final product.

#

Yep! You found the problem. Thanks so much!

mighty vector
#

sqf to mariadb/mysql extension/mod/whatever recommendation ?

dreamy kestrel
#

Is there a way to determine of a player object is still "active" i.e. connected?

exotic flax
#

isPlayer _player ?

warm blaze
#

how could I make armed civilian infantry group hostile to west, east, resistance simultaneously without sideEnemy (renegade approach) ? Is it doable by scripting or modding ?

cosmic lichen
dreamy kestrel
#

perhaps _player in allPlayers (?)

#

LINQ style selectMany

params [
    ["_source", [], [[]]]
    , ["_resultSelector", { (_this#0); }, [{}]]
    , "_collectionSelector"
];
private _retval = [];
{
  private ["_z"];
  private _alpha = _x;
  private _alphaIndex = _forEachIndex;
  {
    private _a = _x;
    private _i = _forEachIndex;
    if (isNil "_collectionSelector") then {
      _retval pushBack ([_a, _i, _alphaIndex] call _resultSelector);
    } else {
      private _bravo = [_a, _i, _alphaIndex] call _collectionSelector;
      {
        private _b = _x;
        private _j = _forEachIndex;
        _retval pushBack ([_a, _b, _i, _j, _alphaIndex] call _resultSelector);
      } forEach _bravo;
    };
  } forEach _alpha;
} forEach _source;
_retval;

unless there's an easier way?

warm blaze
#

renegade style looks most suitable but the problem is civs start killing each other staying in one/few group(s)

little raptor
#

it's a bit crude but it'll do

#

it also captures the firing data

wary lichen
#

Hello, guys. How to make the Heavy to fire continuously at any target?

#

and he has to make a recoil correction

#

in other words, he should shoot at one point and try to suppress recoil, as he does when shooting at a normal target

golden smelt
#

hey, I am having trouble with the ATM_Halo jump script. I have placed everything the proper way and even downloaded another copy of the script from ARMAHOLICS. Anyone available to help me with this problem?

dreamy kestrel
mighty vector
mighty vector
still forum
#

unlikely

mighty vector
#

๐Ÿ˜• ๐Ÿค”

dusty whale
#

is there a command to convert world-direction to model-direction?

still forum
#

search for "worldTo"

#

on the script commands list page on wiki

winter rose
mighty vector
#

inside entitykilled EH...shouldn't getPlayerUID _instigator work?

exotic flax
#

yes, _instigator is the object (and thus player) which killed the entity

mighty vector
#

and it's empty, cause....?

exotic flax
#

just check the example on the wiki regarding weird conditions like UAV's and vehicle kills

mighty vector
#

in which page?...getPlayerUID neither EntityKilled say anything

exotic flax
mighty vector
#

im definetively blind xD sorry. i had the page open and looking the example...

#

the upper example xD

#

although arma is arma, this time was a simple headshot, no vehicles related

#

hence it shouldn't have failed (IMHO)

#

anyway, i'll check tomorrow what's going on

#

thanks @exotic flax

exotic flax
#

although it's always a good idea to check if the instigator is actually a player

mighty vector
#
 if (isPlayer _instigator) then {
    private _steamUID = getPlayerUID _instigator;
    //...
#

instigator is not null, that's what drives me crazy.

exotic flax
#

hmmm...
I use ```sqf
// Player killed/destroyed AI
if (isPlayer _instigator && !(isPlayer _unit)) then {
[getPlayerUID _instigator, "KillAI", 1] call FUNC(updateData);
};
// Killed friendly!
if (isPlayer _instigator && (isPlayer _unit)) then {
[getPlayerUID _instigator, "KillFriendly", 1] call FUNC(updateData);
};
// Player died
if ((isPlayer _unit) && !(isPlayer _instigator)) then {
[getPlayerUID _unit, "Died", 1] call FUNC(updateData);
};

mighty vector
#

...

#

scenario:
friend killed dummy IA by headshot, getPlayerUID _instigator was blank

dusty whale
#

can we get a command to alter the attached position of an object?

#

attachTo again is cancer

#

Infact, what i find most troubling about it is that it's so slow if run rapid succession

dusty whale
#

maybe i shouldnt be doing that

#

but maybe it wouldnt be so hard to fix the command

alpine night
#

any ideas for how i could go about setting up a script so that you can unload ace cargo to a base and have it be converted to respawn tickets or other items like guns/ammo?

tough abyss
#
["respawn_5","respawn_6","respawn_7","respawn_8","respawn_9"] joinSilent (group player);
#

how do i make this work?

warm hedge
#

Never. This just won't work

tough abyss
#

xD

#

something similiar?

warm hedge
#

IDK what is your goal

tough abyss
#

i have a group of hostages which are players, its a respawn system so when you die you respawn as a hostage and wait for friends to rescue you

#

but i cant just let them respawn as the same side and group because opfor will just shoot them

#

so im trying to figure out a way to get them back in the same squad when they get rescued

warm hedge
#

What are "respawn_5" thru "respawn_9"?

tough abyss
#

variable names of the player hostages

warm hedge
#

Are they units?

tough abyss
#

yes

warm hedge
#

Then remove quotation marks

tough abyss
#

trying right now

#

huh

#

thats all it took

#

thanks polpox

tough abyss
#

[respawn,respawn_1,respawn_2,respawn_3,respawn_4] joinSilent (group player);

#

[respawn,respawn_1,respawn_2,respawn_3,respawn_4] setCaptive false;

#

how do i combine these two?

warm hedge
#
[respawn,respawn_1,respawn_2,respawn_3,respawn_4] joinSilent (group player);
{_x setCaptive false} forEach [respawn,respawn_1,respawn_2,respawn_3,respawn_4];```Always Wiki is your friend
tough abyss
#

man what would i do without this discord

warm hedge
dreamy kestrel
#

Q: does netId player tell me the client identifier for use with remoteExec?

#

I see, so netId says something like "2:12345", so I could potentially split ':' and parseNumber the first element for the clientOwner?

warm hedge
#

You want to do remoteExec on some players?

dreamy kestrel
#

yeah... actually, can I just notify the player objects themselves?

warm hedge
#

Maybe just dosqf remoteExec ["smth",[unit_1,unit_2,unit_3]]?

dreamy kestrel
#

beauty, that worked. thank you.

supple cove
#

hey hey, I hope someone can help me with this one,
I'm doing an animated evac via helicopter using the unitcapture/unitplay
helicopter comes -> wait for players -> helicopter fly
the issue is that once the first animation ends, the helicopter gets some height, probably from the engine's physics turning on again

#

Is there a way to set the engine rpm to a low value?

#

or a better way to make the helicopter sit still, like a trained dog.

#

i've disabled the AI, but sadly it still takes off

warm hedge
#

Probably flyInHeight

supple cove
#

well, sadly the AI ignored that (activated it again)

#

going to try to set the pilot unconscious

supple cove
#

welp, land "LAND" almost nails it, the pilot shuts down the engine

#

the "GET IN" mode is also ignored

#

as funny as it is, it works perfectly with the pilot dead

#

alright, disabling the simulation and killing the pilot seems to break the AI enough to it act properly meowsweats

wind sparrow
#

hi, why setObjectScale can be used directly in single player mode, while must be first be treated as a simple object using attachedTo in multiplayer mode?

still forum
#

@wind sparrow it also only works on simple objects or with attachTo in singleplayer.
There is only a exception for Eden editor to let artists do what they want.
But everything except simple objects and attachTo are not supported

desert lily
#

@supple cove Have you tried using the doStop command?
This is what I have in one of my scripts:

doStop _helo;
_helo land "GET IN";
{_helo animateDoor [_x, 1]} forEach ["door_back_L","door_back_R","door_L","door_R"];
waitUntil {sleep 1, player in _helo};

I had the same problem where the helicopter would just fly off but using doStop solved it

winter rose
#

sleep 1, player in _helo ๐Ÿ‘€

#

,

#

๐Ÿ‘€

little raptor
#

that's what the ๐Ÿ™€ was all about!

torpid quartz
#
    while{true} do { 
        { 
            if(side _x == WEST && _x distance (getMarkerPos "WESTBASE") < 100) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles; 
        sleep 1; 
    }; 
};

0 = [] spawn { 
    while{true} do { 
        { 
            if(side _x == EAST && _x distance (getMarkerPos "EASTBASE") < 100) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles; 
        sleep 1; 
    }; 
};```

Trying to make safe zones for a PvP thing. should this work still or?
#

it's in the mission Init.sqf

little raptor
#

what do you mean still?

#

and why two spawns?

winter rose
#

(unless in init/trigger field)

little raptor
#

it was fixed already

#

at least according to dedmen

torpid quartz
#

wait went back over the thread and tried some other ones


0 = [] spawn { 
    while{true} do { 
        { 
             if(side _x == WEST && _x distance (getMarkerPos "WESTBASE") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles; 
        sleep 1; 
        { 
            if(side _x == EAST && _x distance (getMarkerPos "EASTBASE") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles;
    }; 
};

this works fine now, not for vehicles but that's fine, when the first one didn't work I thought something code wise might have been made redundant since it's from 2017

#

thanks for jump in so fast though, really appreciate it.

little raptor
#

scripts never "outdate" in Arma

winter rose
#

it rots, that's different

#

you have to rewrite SQF every 18 months so the file doesn't outdate; sometimes a simple Ctrl+S to refresh the file last save's date is enough, but not always

cyan dust
#

Good day. I'm struggling with something quite simple I hope - VSCode IntelliSence for local variables is not working, and it's really annoying (= Can someone help?

cyan dust
little raptor
#

it doesn't seem related to those plugins
maybe related to your VSCode settings

willow hound
#

I use Armitxes' extension too and I don't get autocompletion for custom functions and variables either. Not sure if there is a fix for it, but it doesn't bother me nearly as much as the missing keyword highlighting for new commands and such. Unfortunately the extension has not received updates in more than a year; there is activity in the GitHub repo though, not sure what's going on.

winter rose
little raptor
#

which means just don't use VSCode at all

winter rose
#

I use it, it is just not that necessary to me ๐Ÿ™ƒ

willow hound
#

VSC is way too good to use something else ๐Ÿ˜›
And suggestions and autocomplete work for other languages / plain text files, so I guess it has got something to do with the extension ๐Ÿคทโ€โ™‚๏ธ

little raptor
winter rose
willow hound
#

Oh no, I couldn't go back to N++ and Explorer

little raptor
#

You can update N++ yourself
and not rely on someone to update it for you

Plus all the features like linting are stupid in SQF
sqf is not statically typed
half of the linting info is garbage

willow hound
#

VSC saves my workspace, gives me Git (Hub) integration, a beautiful darkmode and endless settings, options and extensions.

little raptor
#

I said N++ is better for SQF
not for everything

willow hound
#

Oh no, all those apply to SQF as well ๐Ÿ˜„

cyan dust
winter rose
#

ah yep, N++ and dark modesโ€ฆ

cosmic lichen
#

I heard Notepad is the best for any language ๐Ÿ˜„

dusty whale
#

is there a way to get an sqf function(the actual script) because the script is not listed in CfgFunctions due to the config viewer cutting out (not showing all entires)

little raptor
#

everything works fine

willow hound
little raptor
#

except for the garbage linting stuff meowsweats

willow hound
#

That is why I don't use the SQF-VM extension (by X39) but the pure syntax highlighting extension (by Armitxes). Downside is, as mentioned, it doesn't have commands like setTriggerIntervall yet and for some reason autocompletion for variables and custom functions doesn't work.

little raptor
#

I don't use sqf-vm either

#

it's the sqflint that shows those nonsense stuff

cosmic lichen
#

Ignore the python stuff. But the rest is very good

#

and SQFLint works fine for me

cyan dust
little raptor
cyan dust
little raptor
#

not the extension

winter rose
little raptor
#

I don't know what it is blobdoggoshruggoogly

#

@cyan dust btw, you should save the document

#

maybe that's why

#

(yet another reason why VSCode sucks - it actually needs a file, and you can't edit on the fly)

winter rose
cyan dust
little raptor
winter rose
little raptor
#

@winter rose

#

without saving the file the variable names don't appear

#

@cyan dust โ˜๏ธ

torpid quartz
#

oh uh ok actually do have a problem.


0 = [] spawn { 
    while{true} do { 
        { 
             if(side _x == EAST && _x distance (getMarkerPos "EASTBASE") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles; 
        sleep 1; 
        { 
            if(side _x == WEST && _x distance (getMarkerPos "WESTBASE") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles;
    }; 
};

only the first marker works.
if I switch the east and west lines around then the one that goes first always works and the second does not.
any ideas how I'd get the second one to be read?

little raptor
torpid quartz
#

yeah I tired putting sleep 1 after both or just on the last if but yeah didn't quite work haha. putting your one in now

hollow thistle
little raptor
#

@torpid quartz updated the code again

torpid quartz
#

yeah was going to say it made the wrong side invincible lmao

willow hound
#

What's wrong with using ||? ๐Ÿ˜›

little raptor
#

|| ? meowsweats
you mean else?

cyan dust
little raptor
#

yes you can do it with a trigger

willow hound
little raptor
#

but the trigger needs a loop too

#

so it's pointless

#

(a trigger only triggers once)

cyan dust
#

OK, got it

little raptor
#

or independent

willow hound
#

Then it becomes true or not?

little raptor
#

yeah meowsweats

willow hound
#

Isn't that the goal? think_turtle

little raptor
#

maybe
but I'd say doing that is slower

#

you're evaluating everything

#

with some lazy eval it'll be better

little raptor
#

@cyan dust if you still can't get it to work, search this in VSCode settings:
editor.wordBasedSuggestions

fading dust
#

hello i want to ask is their a script that let soldiers roam around specific area ( camp or base ) in safe mode , and if they get attacked they go take cover and fight

cosmic lichen
hollow thistle
#

I'll be happy to help when I'll finish my 1337 other projects so... 2035 I guess?

cosmic lichen
#

Same here ๐Ÿ˜„

#

Every time I am done with one thing, another wild project pops up

hollow thistle
#

The one from X39 has the most potential but sadly it's not in "production" ready state yet imo.

cyan dust
#

The option you mentioned was enabled all the time, btw

wary lichen
#

How to make the Heavy to fire continuously at any target?
and he has to make a recoil correction
in other words, he should shoot at one point and try to suppress recoil, as he does when shooting at a normal target
Any ideas?

little raptor
#

but anyway, you can just use a loop + forceWeaponFire
add a FiredMan event handler and guide the bullet to where you want

winter rose
#

you can create a bullet by script too ^^

supple cove
distant oyster
# cyan dust Good day. I'm struggling with something quite simple I hope - VSCode IntelliSenc...

had the same problem too. sometimes the sqflinter will stop autocompletion for variables. it seems to be related to indexing the workspace and parsing certain files. What I did to solve it was to exclude all files from the indexing. then i readded the files one by one until the linting didn't work again. then i excluded that file (or files) from the indexing. ofc you can do it the other way around too but you can exclude entire folders as well. the setting for that is called sqflint.exclude

shadow sapphire
#

How do you dump a BIS function so you can read its script?

willow hound
#

Open it in the functions viewer and copy-paste it from there if needed.

shadow sapphire
#

That'll work, but I swear there was another way that I liked. This is what I get for being away for so long.

winter rose
#

just typing the function name and "EXEC" in debug console (and it's awful)

fading dust
#

No help disappointed โ˜น๏ธ

winter rose
#

happens

little raptor
#

functions_f (I think)

#

and you get 90% of the functions

#

but finding the function in the game is always the better choice
there are also many alternative function viewers that do a better job

little raptor
#

or just Google

shadow sapphire
#

I used to type the function name in debug and it would stick it in my clip board somehow. Don't remember.

little raptor
#

it gives you the preprocessed function

#

it may not be as readable as the function file

shadow sapphire
#

Interesting.

still forum
wary lichen
#

I use arma 2

#

doFire doesn't work

wary lichen
supple cove
#

Does a command to deploy the helicopter wheels exist?

little raptor
#

but it must be called every frame if the helicopter is piloted by AI

supple cove
#

something like this?
_pilot action ["Gear", vehicle _pilot];

supple cove
#

yup! it nailed what i needed! thank you very much

wraith cosmos
still forum
#

sqflint

wraith cosmos
#

Thank you very much๐Ÿ˜‰

still forum
#

Oh no sorry

#

"SQF Debugger" its called

wraith cosmos
#

OK, thanks

mighty vector
#

PLEASE, tell me there's a better way to do this...
systemTime to YYYY/MM/DD HH:mm:SS

private _date = format ["%1/%2%3/%4%5 %6%7:%8%9:%10%11", 
 systemTime select 0, 
 ["", "0"] select (systemTime select 1 < 10), 
 systemTime select 1, 
 ["", "0"] select (systemTime select 2 < 10), 
 systemTime select 2,
 ["", "0"] select (systemTime select 3 < 10), 
 systemTime select 3,
 ["", "0"] select (systemTime select 4 < 10), 
 systemTime select 4,
 ["", "0"] select (systemTime select 5 < 10), 
 systemTime select 5
];
little raptor
mighty vector
#

two-digits....if seconds=5, return "05"

little raptor
#

so you're to blame for that monstrous code?! ๐Ÿ˜›

winter rose
#

now if you have better, I'm all ears ๐Ÿ˜›

little raptor
#

not sure if it works

#

let me try

#

@winter rose yep, it works! (for 2 or less digit numbers only)

#

I'm goooood! ๐Ÿ˜„

mighty vector
#

please, working code demo xD

winter rose
#

is it least awful though ๐Ÿ˜†

#

more performant though

winter rose
little raptor
#

want me to adjust it?

mighty vector
#

but i still dont get it...why /100 would convert 5 to "05" ?

winter rose
#

because 0.05

#

so it takes the last two digits

#

20 โ†’ .20
5 โ†’ .05

little raptor
mighty vector
#

but wheres the trim? (selecting 2 digits)?

winter rose
#

select [2]

little raptor
#

select [2] means select from the third char in string

#

it trims the "0."

mighty vector
#

ok...but then is not _x, but str(_date select 5/100) select [2]

#

pita

little raptor
#

_x is just a placeholder for anything

#

and what you wrote is wrong

mighty vector
#

[_date select 5] ?

little raptor
#

hold on let me just improve that thing of mine

#

I'll show you how it's done later!

winter rose
#
(_date select 5) // e.g 8
/100 // 0.08
select [2] // 08
#

so () parentheses play a role here too

#

(_date select 5/100) is _date select 0.05, which is wrong
(_date select 5)/100 is correct @mighty vector

little raptor
#

@mighty vector

_time = systemTime;
_date = (_time select [0,3] apply {
  if (_x < 100) then {str (_x/100) select [2]} else {str _x}
} joinString "/") + " " + (_time select [3,3] apply {str (_x/100) select [2]} joinString ":");
#

oh wait

mighty vector
#

:suicide:

little raptor
#

I forgot something @winter rose
numbers like 10, 20 etc. won't work ๐Ÿคฃ

mighty vector
#

:i_want_to_die:

#

xD

little raptor
#

I have to use toFixed

winter rose
#

true

#

or padding with 0 :D

little raptor
#
_time = systemTime; 
_date = (_time select [0,3] apply { 
  if (_x < 100) then {(_x/100 toFixed 2) select [2]} else {str _x} 
} joinString "/") + " " + (_time select [3,3] apply {(_x/100 toFixed 2) select [2]} joinString ":");
#

@mighty vector here's an alternative:

_time = systemTime;
_date = format (["%1/%2/%3  %4:%5:%6"] +
(_time select [0,3] apply {if (_x < 100) then {(_x/100 toFixed 2) select [2]} else {str _x}}) +
(_time select [3,3] apply {(_x/100 toFixed 2) select [2]}))
mighty vector
#

@winter rose seems simpler

little raptor
winter rose
#

he's cheating, he is using commands I did not have at the time!

little raptor
#

it's semi-slow apparently not

winter rose
#

but I like the /100 idea, it is elegant

mighty vector
#
  private _date=systemTime; 
  _date = format ["%1/%2%3/%4%5 %6%7:%8%9:%10%11", 
    _date select 0, 
    ["", "0"] select (_date select 1 < 10), 
    _date select 1, 
    ["", "0"] select (_date select 2 < 10), 
    _date select 2,
    ["", "0"] select (_date select 3 < 10), 
    _date select 3,
    ["", "0"] select (_date select 4 < 10), 
    _date select 4,
    ["", "0"] select (_date select 5 < 10), 
    _date select 5
  ];
mighty vector
#

i'll try a mix, will "str(_x/100) select [2]" work, or all that toFixed/apply is needed?

winter rose
#

@little raptor```sqf
format ["%1%2", _value / 100, 0] select [2, 2];

#

returns either 0.080 or 0.10

little raptor
little raptor
winter rose
little raptor
#

let me see if it's faster

winter rose
#
_date = systemTime;
toFixed 2;
private _result = format ["%1/%2/%3  %4:%5:%6", 
_date#0,
(_date#1/100) select [2], 
(_date#2/100) select [2],
(_date#3/100) select [2],
(_date#4/100) select [2],
(_date#5/100) select [2]
];
toFixed -1;
_result;
little raptor
#

messes up the year

#

2021.00

winter rose
#

select [0, 4] ๐Ÿ˜„

#

it's getting dirty!

little raptor
#

it makes almost 0 difference in terms of performance

mighty vector
#

whats _date#0 ?

#

why tofixed?

winter rose
#

_date select 0

mighty vector
winter rose
#

toFixed to "fix" the number of characters after the period: 0.10 instead of 0.1

mighty vector
#

ok

little raptor
#

toFixed = number of decimal places

#

in stringized numbers

mighty vector
#

that last one seems great. im sorry @winter rose , seems u lost the competition xD

verbal saddle
#

It also changes the accuracy of the engine commands.

#
str getPos player; "[3231.05,171.802,0.00143862]"
toFixed 8;
str getPos player; "[3231.04882813,171.80192566,0.00143862]"
exotic flax
#

hmm... would be interesting to see if mapGridPosition also works with that to get 8 or even 10 grid references instead of the standard 6 ๐Ÿค”

little raptor
#

that's different

#

it's string by default

#

plus it doesn't return 6 digits because of "inaccuracy"
that's just how it's designed internally

#

so you can neither increase nor decrease the number of digits

exotic flax
#

Well, in our unit we use 8 grid for a lot of stuff because of accuracy, so it would make sense to have this increased as well.
And since toFixed is handling numbers in the back it doesn't matter what the output type is

formal brook
#

Anyone know how to force a AI to turn on Helicopter searchlights?

fair drum
#

welcome to one of the oldest annoying things in arma.

#

you can change their combat stance and sometimes it will work

#

enableGunLights is hit or miss
setCollisionLight sometimes works

exotic flax
#

setPilotLight?

fair drum
#

I find its easier to just create a lightpoint on the helicopter instead

#

depending on the mod set, that sometimes works or doesn't too. I think its when the searchlight is a gunner posiiton

formal brook
#

I put this in the init correct?

exotic flax
#

Yes

fair drum
#

CUP searchlights won't work with all of the above as well

exotic flax
#

lightOn should also work, but depends on AI behavior (combat or stealth will force it off)

acoustic vortex
#

This is a bit of an unusual application but does anyone know in ArmA 2 how to disable player movement BUT allow aiming within the Floating Zone? Any script lines that would help me wit this?

I am building an M4 controller that I want to use a gyro for mouse inputs to aim the M4 around the screen to move the players point of aim.

astral tendon
#

Is there a better way to do this? checkVisibility is very slow, I need to check if there in nothing blocking the view from the AI to the target

//remove targets that are not in the radar but highly know for the AI and remove non air targets
private _AcurateTargets = [];

///get targets that the unit got in the radar
private _UnitTargets = (allunits select {[(side group _x), (side group ConnectedAWACS)] call BIS_fnc_sideIsEnemy});
private _RadarRange = getNumber ((configOf ConnectedAWACS) >> "Components" >> "SensorsManagerComponent" >> "Components" >> "ActiveRadarSensorComponent" >> "AirTarget" >> "maxRange");

{
    if (
        (_x distance ConnectedAWACS) < _RadarRange and
        ([(vehicle ConnectedAWACS), "FIRE",(vehicle _x)] checkVisibility [(getPosASL _x), (getPosASL ConnectedAWACS)]) > 0
    ) then {_AcurateTargets append [_x]};
} forEach _UnitTargets;

winter rose
#

lineIntersect* commands?

astral tendon
#

harcoded to 1000m

winter rose
#

you can do multiple ones, divide the distance in multiple 1km segments

astral tendon
#

doesn't that defeats the purposed if the target is really far?

winter rose
#

if you take your distance of e.g 3km
divide it in 1km segments

check segment 1 line is clear - OK
check segment 2 line is clear - OK
check segment 3 line is clear - ah, NOK, therefore the whole line is not clear

cosmic lichen
#

You can also use units <side> which is quite a bit faster

#

just a minor overall improvement though

astral tendon
#

the vehicle side can change

cosmic lichen
#

so?

astral tendon
#

hard code it to only find one side breaks it.

winter rose
#

(it is checking w/ BIS_fnc_sideIsEnemy)

warm hedge
#

Pro tip: you can Edit your post

thin galleon
#

Hello! I am trying to make a radiation script for my chernobyl op, but when i paste it in to a trigger i get following error message: On activation:

warm hedge
#

Report only an error message does nothing with troubleshoot, please post what you've done

winter rose
thin galleon
winter rose
#

your whole code if the issue is a sleep or a waitUntil

thin galleon
#

I have both of those so that makes sense

willow hound
warm hedge
#

ยฏ_(ใƒ„)_/ยฏ

winter rose
#

yet still a valid advice ^^

wanton swallow
#

Hi guys. Can i get control on group with remoteControl on squad leader?

thin galleon
#

@winter rose im still not getting it to work, can i send you the script in dms if you can look over it?

winter rose
thin galleon
#

alright

#

one sec

tough abyss
#

(!alive HVT or !alive HVT_SCARED) && units FOXHOUND findIf { not (_x inArea theTrigger) } == -1

#

whats wrong with this? (the right side doesnt work and i dont fully understand it) lol

winter rose
#

just remove first and last characters and it's good

#

(or it should be)

thin galleon
#

first and last character? sorry for being really dumb but yeah which ones?

winter rose
#

[

(...)

]

cosmic lichen
#

๐Ÿ˜„

winter rose
#

the [ ] characters

#

character = "letter" or number or symbol

thin galleon
#

well thats what i started off with, still got that error message saying: On activation

winter rose
#

after removing []
try putting 0 = before everything thenโ€ฆ?

thin galleon
#

nope still doesnt work

#

is there anything else that could break it inside the code?

winter rose
#

well yes, the first _x is not defined

opal sand
#

Is there a way to make a large group of units play animations and have random loadouts without having to orderly name each single unit?

winter rose
#

anyway, try having this code in a sqf file instead of a trigger

opal sand
winter rose
#

โ€ฆmayhaps?

#

if you do a foreach on the trigger's list, yeah

willow hound
opal sand
# winter rose if you do a foreach on the trigger's list, yeah

This is my first attempt at having 90 random csat and aaf soldiers have;

  1. play between these animations at random
  2. Have randomised loadouts (*mainly headwear and facewear will suffice) (will do it manually if need be)
foreach;
[
'Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_6_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_7_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_8_loop',
'Acts_AidlPercMstpSlowWrflDnon_warmup01',
'Acts_AidlPercMstpSlowWrflDnon_warmup02',
'Acts_AidlPercMstpSlowWrflDnon_warmup03',
'Acts_AidlPercMstpSlowWrflDnon_warmup04',
'Acts_AidlPercMstpSlowWrflDnon_warmup05'];

this addEventHandler ["AnimStateChanged", { 
 params ["_unit", "_anim"]; 
}];
hint "BRUH am i close? lol
winter rose
#

";

tough abyss
#

@willow hound yeah its that!

#

but when they are it wont go off

winter rose
#

again and again and again, ```sqf
this addEventHandler ["AnimStateChanged", {
params ["_unit", "_anim"];
}];

#

@opal sand

opal sand
#

forget it then, will just do it all manually, will probably do it quicker, coding knowledge is non-existant

willow hound
#

forEach; :-(

#

Just read the wiki pages krtecek

opal sand
#

*its not that i cant be arsed to not learn coding, but prioritising the workload, and right now, learning code even part time is counter productive and more time and results are lost than found

#

will probably just hire a scripter dude very soon instead, my only motive is to know enough coding to be able to record video cinematics

willow hound
#

Selecting 90 random CSAT and AAF units to run some code on them is definitely more satisfying, productive and adaptable (imagine you want to change something later!) when done via a single code block than when done by hand.

willow hound
tough abyss
#

the what now?

little raptor
#

90 random
Are you paying attention to the performance too?!

#

90 AI in SP = crappy performance

opal sand
#

also, negative reinforcement after a first attempt without a solution offered in the same moment/message t 'again and again and again does nothing' is not productive, counter productive, and frankly, annoying, so id rather just not ask again and either seek help elsewhere or do it myself.

@little raptor yeah, scenes are isolated to only whats close/local, and whats required for that one shot

willow hound
tough abyss
#

i tried it again and it just triggers when the hvt dies

#

it must be busted

winter rose
# opal sand also, negative reinforcement after a first attempt without a solution offered in...

negative reinforcement after a first attempt without a solution offered in the same moment/message t 'again and again and again does nothing' is not productive, counter productive, and frankly, annoying
I am sorry, but I think it is not a "first attempt" on this one, unless I am mixing up with another user ๐Ÿคจ we have been through this at least three times

this channel is for scripting assistance, if you need a scripter then #creators_recruiting (paid or free) is a thing that no one will blame you for using

opal sand
tough abyss
#

can someone with 5 more iq points than me fix my script real quick

winter rose
#

(I really don't mean to sound/be rude, even though I might)

opal sand
winter rose
#

so, forEach:```sqf
{ } forEach _list;

// we need a list
private _list = list theTrigger;
{ } forEach _list;

// we need an animation list
private _animations = [
'Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_6_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_7_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_8_loop',
'Acts_AidlPercMstpSlowWrflDnon_warmup01',
'Acts_AidlPercMstpSlowWrflDnon_warmup02',
'Acts_AidlPercMstpSlowWrflDnon_warmup03',
'Acts_AidlPercMstpSlowWrflDnon_warmup04',
'Acts_AidlPercMstpSlowWrflDnon_warmup05'
];
private _list = list theTrigger;
{ } forEach _list;

// what do we do with that
private _animations = [
'Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_6_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_7_loop',
'Acts_AidlPercMstpSloWWrflDnon_warmup_8_loop',
'Acts_AidlPercMstpSlowWrflDnon_warmup01',
'Acts_AidlPercMstpSlowWrflDnon_warmup02',
'Acts_AidlPercMstpSlowWrflDnon_warmup03',
'Acts_AidlPercMstpSlowWrflDnon_warmup04',
'Acts_AidlPercMstpSlowWrflDnon_warmup05'
];
private _list = list theTrigger;
{
// random for every item of the list
private _randomAnimation = selectRandom _animations;
_x playMove _randomAnimation;
} forEach _list;

#

@opal sand โ†‘

willow hound
# tough abyss i tried it again and it just triggers when the hvt dies
(!alive HVT or !alive HVT_SCARED) && units FOXHOUND findIf { not (_x inArea theTrigger) } == -1
```Well your conditions are linked through `&&`.
Essentially what you have is `result = (a || b) && c;`, so for `result` to become `true`, there are two conditions, and both have to be fulfilled:
1) Either `a` or `b` or both must be `true`
2) `c` must be `true`
As such, `HVT` or `HVT_SCARED` must be dead and all Foxhound group members must be in `theTrigger` to make the whole expression `true`.
#

Are you familiar with the truth tables of logical NOT, AND and OR? Aka do you know when their result is true and when it is false?

opal sand
# winter rose so, `forEach`:```sqf { } forEach _list; // we need a list private _list = list ...

Error on Act: Local Variable in Global Space (https://imgur.com/hQIXLMD)

{ } forEach _list;

private _list = list theTrigger;
{ } forEach _list;

private _animations = [
  'Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_6_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_7_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_8_loop',
  'Acts_AidlPercMstpSlowWrflDnon_warmup01',
  'Acts_AidlPercMstpSlowWrflDnon_warmup02',
  'Acts_AidlPercMstpSlowWrflDnon_warmup03',
  'Acts_AidlPercMstpSlowWrflDnon_warmup04',
  'Acts_AidlPercMstpSlowWrflDnon_warmup05'
];
private _list = list theTrigger;
{ } forEach _list;

private _animations = [
  'Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_6_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_7_loop',
  'Acts_AidlPercMstpSloWWrflDnon_warmup_8_loop',
  'Acts_AidlPercMstpSlowWrflDnon_warmup01',
  'Acts_AidlPercMstpSlowWrflDnon_warmup02',
  'Acts_AidlPercMstpSlowWrflDnon_warmup03',
  'Acts_AidlPercMstpSlowWrflDnon_warmup04',
  'Acts_AidlPercMstpSlowWrflDnon_warmup05'
];
private _list = list theTrigger;
{
  private _randomAnimation = selectRandom _animations;
  _x playMove _randomAnimation;
} forEach _list;
hint "good!";
little raptor
#

Error on Act: Local Variable in Global Space
you've probably named something _blabla

willow hound
#

Lou's code contained a step-by-step explanation of the code building process (combining different commands), half of the code has to be omitted for it to run. Leopard is right, _animations and _list can't be used in the On Activation of a trigger.

little raptor
#

_animations and _list can't be used in the On Activation of a trigger
They can (afaik). I meant he probably named the object _blabla (variable name)

still forum
#

did you literally copy that above script into there? with the duplicate, useless, not doing anything code in there too?

mighty vector
#

is there a bbeter alternative, including extensions, to invoke HTTP ? (seen one extension, but ill prefer native)

little raptor
#

it doesn't matter whether you spawn it or call it

mighty vector
#

but, and please correct me if Im wrong, spawn is like running a new thread, so it won't affect main program...isn't it?

little raptor
#

each individual command will behave the same in scheduled and unscheduled environments

#

spawn simply "suspends" execution if execution time has exceeded 3 ms

mighty vector
#

yet reading, but does what you said mean the scheduler only has 1 script running at a time, and hence the script (blocking function) would have impact on the other scripts waiting to run, right?

little raptor
#

not 1 script at a time
it just goes through its queue
it picks the script that hasn't been executed for the longest time
then starts running its commands sequentially
if execution time exceeds 3 ms, it won't execute any more commands
if it doesn't, it moves to the next script

mighty vector
#

but the request itself could take up more than 3ms...how it handles "suspending a http request"?

#

anyway, let me quote the second part of my question...

is there a bbeter alternative, including extensions, to invoke HTTP ? (seen one extension, but ill prefer native)

little raptor
#

it doesn't
the game execution will be blocked until that command is done (so if the command takes a long time, the game freezes)

mighty vector
little raptor
#

yes

mighty vector
#

that explain a lot about "unscheduled" and "non-warranted" execution times

#

i wanted to make HTTP requests... ๐Ÿ˜ฆ

little raptor
#

I'm not familiar with that. maybe someone else can help

mighty vector
#

thx. seems KK used them long time ago

karmic flax
#

Im trying to use setDriveonpath to make AI drive over user created bridges (Just a series of objects, such as concrete blocks). I brainstormed an algorithm using the calculatePath eventHandler, the issue is that I realized that the EH wont fire if the AI cant calculate a path. Any ideas on how to make something like this work?

Algorithm:

Add PathCalculated to every player controlled unit in the drivers seat of a vehicle

Break map into different "Zones" that could be optimized or crossed by a bridge
Create bridges, defined as a series of waypoints, First and last point are entry points
Wait until PathCalculated event handler fires
    If return is null, path cannot be calculated, find nearest bridge that goes to island  //Return will never be null, EH wont fire
        Recalculate path to nearest bridge
            [path] = [path] + [bridge]
            [path] = [path] + (path_from_bridge_endpoint to destination)
    Else check starting point and ending point of path
    If they are in different zones calculate the Path Length
        For each bridge, calculate the length of start --> bridge --> dest
            if new path is shorter, reroute
    Else do nothing because there is no need to cross a bridge
cold pebble
#

Currently looking at making some ambient air for a mission; looking to fly aircraft between airports. The allAirports command gives me the static airport ID's, but is there an easy way to turn these into positions that I can spawn an aircraft at, or will I need to go into the config from the world and pull some values?

copper raven
#

config only im guessing

#

on tanoa though you can use nearestLocations, as they have "Airport" location type

#
private _fnc_getAirportPositions = {
  private _config = configFile >> "cfgWorlds" >> worldName; 
  ("true" configClasses (_config >> "SecondaryAirports")) + [_config] apply {getArray (_x >> "ilsPosition")}
}
cold pebble
#

Yeah thought that might end up being the case

#

Just to add to the inconvenience factor, I'll have to grab the 'main' airport

#
ilsPosition[] = {7920.78, 9515.73, 0};
            ilsDirection[] = {0, 0.08, -1};
            ilsTaxiOff[] = {7920.78, 9800, 7920.78, 10775, 7930.53, 10793, 7951.76, 10795.8, 8002.91, 10766, 8027.65, 10738.1, 8037.74, 10700, 8059.3, 10508.6, 8069.24, 10405.6, 8075.34, 10232.9, 8054.85, 10230.2, 8046.79, 10218.7, 8046.79, 10194.9, 8046.79, 10142.8};
            ilsTaxiIn[] = {8046.79, 10142.8, 8046.79, 10094, 8035.38, 10088.4, 8002.87, 10088.4, 7994.4, 10080.6, 7994.4, 9846.88, 7994.4, 9646.85, 7993.03, 9629.61, 7984.71, 9617.25, 7965.14, 9607.53, 7946.52, 9600.64, 7930.45, 9606.08, 7921.45, 9621.13, 7921.45, 9638.23};
            drawTaxiway = 0;
            class SecondaryAirports
            {
                class Airstrip_1
                {
                    ilsPosition[] = {600, 12285, 28.93};
                    ilsDirection[] = {-1, 0.08, 0};
                    ilsTaxiOff[] = {700, 12285, 1165, 12285, 1190, 12285, 1200, 12275, 1195, 12258, 1185, 12246, 1167, 12239, 835, 12162, 782, 12167, 700, 12200};
                    ilsTaxiIn[] = {700, 12200, 669, 12224, 646, 12243, 637, 12250, 626, 12263, 623, 12274, 635, 12285, 650, 12285};
                    drawTaxiway = 0;
                };
            };
#

As the first airport has a slightly different path

mental prairie
#

Do you guys know how to make a side get points from captured sector every 30 seconds?

hushed tendon
#

I'm making an extraction script for a friend (MP mission) and I just wanna make sure this will work.
initServer.sqf-Game timer so your extraction script will execute

if (isServer) then {
PUB_gameRunning = true;
publicVariable "PUB_gameRunning";
sleep 300; //Change 300 to however many seconds the playtime is
PUB_gameRunning = false;
};```

**Trigger**-*Extraction Zone*
Type = None
Activation = Any Player
Repeatable = true
Server Only = true

Condition 
```sqf
this```

Activation
```sqf
if (PUB_gameRunning == true) exitWith {};
execVM "playerExtract.sqf";```

On Deactivation
*Nothing*

**playerExtract.sqf**-*Extract process*
```sqf
if (PUB_gameRunning == false) then {
{
[_x, "AcinPercMrunSnonWnonDf_death", "NONE"] call BIS_fnc_ambientAnim; 
//Fancy way to make them suddenly dissapear
_x setPos [0, 0, 0];
//Removes the player from the playing field (AKA should be debug/bottom left of map)
_x allowDamage false;
//Allows them to look at their inventory and screenshot their kit without dying
_x addAction ["<t color='#FF0000'>Switch to Spectator</t>", {_x setDamage 1;};
//Kills them switching them to spectator after death
} foreach thislist;
};```
willow hound
# hushed tendon I'm making an extraction script for a friend (MP mission) and I just wanna make ...

initServer.sqf only runs on the server, no need to check if (isServer).
It's better to use ! instead of == false.
== true is always unnecessary.
You need to pass thisList to playerExtract.sqf as a parameter, otherwise you can't use that variable in there.
addAction has local effect, this code only runs on the server, so you need to remote execute addAction.
But it's the trigger that should break this first. It behaves like this:
Any player enters the trigger area, the trigger fires. From this point on the trigger will remain activated as long as there is any player within its area. Additional players entering the area will not activate the trigger again because it is still activated. Only after there are no more players in the trigger area will it deactivate, reset and fire again upon any player entering it.
This means that if any player(s) enter the trigger while PUB_gameRunning is true, the On Activation code runs once, quits on the exitWith statement and never executes again until all players have left the trigger area. So if the player(s) don't leave and the time runs out in the meantime, then PUB_gameRunning becomes false but nothing happens because the On Activation code doesn't run because the trigger doesn't fire because it is still activated.

little steppe
#

Does anyone know of a piece of code to load the Device onto a flatbed truck?

willow hound
little steppe
#

I should've known it'd be attach to. Thanks

hushed tendon
#

I'm not particularly good with scripting so how exactly would I be able to get the player as a param?

willow hound
#

The player as a param? Where?

hushed tendon
#

"You need to pass thisList to playerExtract.sqf as a parameter, otherwise you can't use that variable in there."

#

I meant that

willow hound
hushed tendon
willow hound
#

Syntax: arguments execVM filename
Parameters: arguments: Anything - arguments accessible as _this in the script
You can just do [thisList] execVM "playerExtract.sqf";. Then you can access the content of thisList as _this # 0 or _this select 0 in playerExtract.sqf. It looses its variable name thisList, but the content is still the same array. Because _this # 0 is a bit annoying to write, we can use params to give the parameters of our script variable names of our choice by using params ["_playersInTrigger"]; in the first code line of the script.

#

In the end, with parameter and remote execution, playerExtract.sqf looks something like this:

params ["_playersInTrigger"];

if (!PUB_gameRunning) then {
  {
    [_x, "AcinPercMrunSnonWnonDf_death", "NONE"] call BIS_fnc_ambientAnim;
    //Fancy way to make them suddenly dissapear
    _x setPos [0, 0, 0];
    //Removes the player from the playing field (AKA should be debug/bottom left of map)
    _x allowDamage false;
    //Allows them to look at their inventory and screenshot their kit without dying
    [_x, ["<t color='#FF0000'>Switch to Spectator</t>", {_x setDamage 1;}]] remoteExec ["addAction", _x];
    //Kills them switching them to spectator after death
  } forEach _playersInTrigger;
};
```I don't know if `BIS_fnc_ambientAnim` works in MP or if it requires some remote execution as well.
The problem with the trigger possibly getting stuck in activation still persists.
hushed tendon
#

Iโ€™ll remote exec the animation to be safe.

grim wing
#

bois

#

is there a BIS function to disable damage

#

like _animal setVariable ["allowDamage", false];

little raptor
#

just use the command

grim wing
#

well im trying to make animals fallow you arround

#

and I used the function

#

but after shooting them they stop fallowing you

willow hound
#

@hushed tendon Luckily for you, I've previously encountered the trigger problem myself:
I had a trigger that was supposed to apply a full ACE heal to every player entering that area. Needless to say, the first player to enter blocking the players coming in a second later from getting healed until everyone leaves again is rubbish, I don't want to force them to go in one by one so that everybody gets to activate the trigger once to receive their full heal.
However triggers are far to comfortable to work with, so I uhh... repurposed the Condition field so that the code I want to run is executed every time the condition is checked:

{
  [_x] remoteExec ["ace_medical_treatment_fnc_fullHealLocal", _x];
  "You have been restored to full health." remoteExec ["systemChat", _x];
} forEach thisList;
false
```The trigger condition is evaluated every now and then (in this case I set the trigger interval to 10 seconds), but it is always `false` (because that code block always returns `false`), so the trigger never activates and can never get stuck in the activated state.
little raptor
#

๐Ÿ™„
I mean just use _animal allowDamage false

grim wing
#

i did that

#

and after shooting the animal the fallowing the player stops

#

and the animal sits still

little raptor
#

if it sits still it isn't dead

grim wing
#
SF_petFollow = {
  params["_src", "_animalType"];

  private["_animalClassname"];
  if ( _animalType == "Dog" ) then {
    _animalClassname = "Fin_random_F";
  };
  if ( _animalType == "Sheep" ) then {
    _animalClassname = "Sheep_random_F";
  };
  if ( _animalType == "Goat" ) then {
    _animalClassname = "Goat_random_F";
  };
  if ( _animalType == "Rabbit" ) then {
    _animalClassname = "Rabbit_F";
  };
  if ( _animalType == "Hen" ) then {
    _animalClassname = "Hen_random_F";
  };
  if ( _animalType == "Snake" ) then {
    _animalClassname = "Snake_random_F";
  };

  _animal = createAgent [_animalClassname, getPos _src, [], 5, "CAN_COLLIDE"];
  _animal setVariable ["BIS_fnc_animalBehaviour_disable", true];

  nul = [_src, _animal, _animalType] spawn {
    params["_src", "_animal", "_animalType"];
    _animalGoMove = _animalType + "_Run";
    _animalIdleMove = _animalType + "_Idle_Stop";
    if ( _animalType == "Dog" ) then {
      _animalGoMove = "Dog_Sprint";
    };
    if ( _animalType == "Rabbit" ) then {
      _animalGoMove = "Rabbit_Hop";
    };
    if ( _animalType == "Hen" ) then {
      _animalGoMove = "Hen_Walk";
    };
    if ( _animalType == "Snake" ) then {
      _animalGoMove = "Snakes_Move";
    };
    _animalMoving = true;
    _moveDist = 5;

    while {alive _animal} do
    {
      _animal allowDamage false;

      if (_animal distance _src > _moveDist) then {
        if ( !_animalMoving ) then {
          _animal playMove _animalGoMove;
          _animalMoving = true;
        };
      } else {
        if ( _animalMoving ) then {
          _animal playMove _animalIdleMove;
          _animalMoving = false;
        };
      };

      if ( _animalMoving ) then {
        _animal moveTo getPos _src;
      };    
      sleep 0.5;
    };
  };
};

[player, "Dog"] call SF_petFollow;
little raptor
#

why on earth do you use allowDamage in a loop??

grim wing
#

because im dumb

#

@little raptor so even after remove it from the loop it still stops the following loop after i shoot it

hushed tendon
# willow hound <@!403666052019650560> Luckily for you, I've previously encountered the trigger ...

If I understood everything correctly this should be right.
initServer.sqf-Game timer so your extraction script will execute

if (isServer) then {
PUB_gameRunning = true;
sleep 300; //Change 300 to however many seconds the playtime is
PUB_gameRunning = false;
};```

**Trigger**-*Extraction Zone*
Type = None
Activation = Any Player
Repeatable = true
Server Only = true
*Run every second*

Condition 
```sqf
if (!PUB_gameRunning) then {
[thisList] execVM "playerExtract.sqf";
};
false

Activation
Nothing

On Deactivation
Nothing

playerExtract.sqf-Extract process

params ["_playersInTrigger"];

if (!PUB_gameRunning) then {
  {
    [_x, "AcinPercMrunSnonWnonDf_death", "NONE"] remoteExec ["BIS_fnc_ambientAnim", _x];
    //Fancy way to make them suddenly dissapear
    _x setPos [0, 0, 0];
    //Removes the player from the playing field (AKA should be debug/bottom left of map)
    _x allowDamage false;
    //Allows them to look at their inventory and screenshot their kit without dying
    [_x, ["<t color='#FF0000'>Switch to Spectator</t>", {_x setDamage 1;}]] remoteExec ["addAction", _x];
    //Kills them switching them to spectator after death
  } forEach _playersInTrigger;
};
willow hound
#

PUB_gameRunning doesn't need to be publicVariable as far as this is concerned.
Move the Activation code into the condition field and leave Activation empty.
Use the playerExtract.sqf I provided somewhere above, because _playersInTrigger is an array and the remote execution (and a ]) for addAction is missing here.

dreamy kestrel
#

Q: if we've got some HUD related variables to set for each player, could we set them with the public option, then clients monitoring for that situation, where clients would see the variable in the respective 'player' object (?). would be better than connecting unnecessary server client events, probably. thoughts?

willow hound
#

If you want to remoteExec BIS_fnc_ambientAnim, you can do it like this:

[_x, "AcinPercMrunSnonWnonDf_death", "NONE"] remoteExec ["BIS_fnc_ambientAnim", _x];
hushed tendon
#

Alright

#

@willow hound Thanks for all the help! I learned some too.

willow hound
dreamy kestrel
#

@willow hound thanks, appreciate the feedback. since we would be targeting specific players, we do not need for the variables to be "public", is setting them at all sufficient? or do we need the public boolean for the client to "see" it?

willow hound
#

You need the public parameter for them to be sent over the network, yes. Without it, the variable remains local.

dreamy kestrel
#

ah okay I see. the goal in this instance is for us to relay HUD overlay related bits. so we do need the public flag.

astral wigeon
#

hey I was wondering if anyone can help me with tfar jamming?

#

I am creating an op during the cold war and insurgents need to be near a static radio on a table to use their radios

#

I was thinking there might be a way to jam all radio communications outside a given are

#

would that be possible?

#

or am I dreaming too much

fresh wyvern
#

Do anyone know how to ban Titan Launchers from the arsenal?

fresh wyvern
vapid wadi
#

Hey guys, when I do this formatting, the string comes out as this:

_str = format["getBanking:%%1%", getPlayerUID _player];
17:07:38 "getBanking:76561198119367976"

How could I make it doesn't strip the %'s from the front and back of my UID?

winter rose
vapid wadi
#

Thank you, is it possible to repeat like this: %1%2%1?

winter rose
#

in your case,```sqf
private _str = format["getBanking:%1%2%1", "%1", getPlayerUID _player];

vapid wadi
#

Thank you so much, been bashing my head off the table haha

winter rose
#

been there done that (decades ago), so if I can save the painโ€ฆ

vapid wadi
#

Yeah, getting back into SQF from coding on LUA for months, has been strange. I swear I forgot 85% of the syntax :/

winter rose
#

it's like bicycle, you always forget how to then hurt yourselfโ€ฆ wait no

exotic flax
#

had to do an assessment for PHP and Javascript... started to write SQF instead...

vapid wadi
#

Weirdly it's doing this now?

17:14:09 "getBanking:%176561198119367976%1"
#

im dumb

#

nvm

#

LOL

exotic flax
#

looks correct to me ๐Ÿคฃ

tough abyss
#

What is the command to disable a unitโ€™s detection?

warm hedge
#

In what terms? disableAI?

tough abyss
#

I guess?

#

I want it to move around but not detect players

#

Itโ€™s an OPFOR unit but I need it to do the thing

winter rose
#

then disableAI what you want yes ๐Ÿ™‚

tough abyss
#

I just donโ€™t know the thing that goes in โ€œ____โ€;

#

Like how itโ€™ll be โ€œMOVEโ€; if I wanted move

warm hedge
#

Wiki is always your friend :)

tough abyss
#

I didnโ€™t find it but Iโ€™ll try again

#

Perhaps my search parameters were off

fresh wyvern
#

Hi, anyone who know how to script a restriction to arsenal items?

fresh wyvern
#

Seems like this adds weapons and that it do not remove.

fresh wyvern
warm hedge
#

Huh

#

My very best guess is you don't have BIS_ammobox, your question's too vague

fresh wyvern
#

Good point. I use the regular Warlords Arsenal.

#

The only thing I want to disable is the titan launchers.

#

Tried this to:

player removeSecondaryWeaponItem "launch_B_Titan_F";

didn't work.

warm hedge
#

Huhh... then probably you need to do some workaround using scripted eventhandlers. I'm not available to write some codes though

fresh wyvern
# warm hedge Huhh... then probably you need to do some workaround using scripted eventhandler...

This was the best I came up with. Looks a bit silly.

addMissionEventHandler ["Map", {
    params ["_mapIsOpened", "_mapIsForced"];
            player removeWeapon "launch_B_Titan_F";
            player removeWeapon "launch_I_Titan_F";
            player removeWeapon "launch_O_Titan_F";
            player removeWeapon "launch_Titan_F";
            player removeWeapon "launch_B_Titan_short_F";
            player removeWeapon "launch_I_Titan_short_F";
            player removeWeapon "launch_O_Titan_short_F";
            player removeWeapon "launch_Titan_short_F";
            player removeWeapon "launch_B_Titan_tna_F";
            player removeWeapon "launch_B_Titan_short_tna_F";
            player removeWeapon "launch_O_Titan_ghex_F";
            player removeWeapon "launch_O_Titan_short_ghex_F";
            player removeWeapon "launch_I_Titan_eaf_F";
            player removeWeapon "launch_B_Titan_olive_F";
    }
];

But it does in a way fulfill it's intention. "You want to read a map? Well, no titan for you x)"

cyan dust
#

Good day. Is there a way to get an array of all civilian human classes?
The closest thing I found on the internet so far is this
(configfile >> "CfgVehicles") call BIS_fnc_getCfgSubClasses
But it's not quite it

warm hedge
torpid quartz
#

Is there a way to get an AddAction to execute on server like there is with hold action?

warm hedge
#

Pardon?

torpid quartz
#
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop];    // MP compatible implementation

Hold action has this in one of it's examples but nothing like this is on the add action page.
not sure exactly how i'd copy that to an AddAction either

#

I mean maybe it doesn't need it like hold action does, I've never had a problem with add action but I thought it would be safer to make it execute on server rather than client if that's what it is doing.
I've always had problems with Hold action not working properly in MP (because I probably just used the enhanced eden editor one and not actually scripting it in with MP compatibility)

warm hedge
#

remoteExec and remoteExecCall work with every commands/functions. To implement some commands there, use this method: A command B -> [A,B] remoteExec ["command",...]Soplayer addAction [...] -> [player,[...]] remoteExec ["addAction",...]

torpid quartz
#

i'll give it a whirl thanks!

#

hmm, ok yeah sort of getting it, there is actually an example with it I now see I should be able to figure it out with these thanks!

oblique arrow
#

Hey is there a command to disable an objects/players collision without hiding that object/player?

warm hedge
#

disableCollisionWith but unreliable

oblique arrow
#

Hm okay

hollow thistle
#

setMass 1

#

Extremely small mass objects do not collide.

#

But it will only work for physx objects.

opal sand
#

Howcome everytime i change Millers

  1. Unit name
    His face changes and is no longer millers face?
cedar field
#

Did killzone shutdown his site perma? @ me to reply

split coral
deep halo
#

Hi, I need some help with a script. Busy with a multiplayer Coop mission and need to have one of the players start as a hostage. I've got that part pretty much sorted. Player starts off handcuffed (Make Unit Handcuffed under Ace Options). The problem is that he has no interaction with menus or anything else. I need him to be able to trigger a custom action in some way (scroll menu/radio/something). Is there a way to give him some kind of interaction/action that he can do while handcuffed?

cedar field
winter rose
#

but I can access it

winter rose
split coral
zenith edge
#

leh gasp

hushed tendon
#

Is it possible to change the titletext font?

exotic flax
hushed tendon
#

Ty. Dang just looked at that page, must of missed it.

winter rose
#

haaave

fair drum
#

if [] means any data type in param for expected data types, then how do I declare only arrays to be accepted?

warm hedge
#

[[]]

fair drum
#

kk thx

fair drum
#

if given the wrong data type, it states it will display an error. is this a hard stop error? or will the rest of the script continue to function?

winter rose
#

will show error + continue with default value iirc

hushed tendon
#

I have a player activating a trigger which will then execVM the sqf this code is in. Is the code for the MP titleText right?

#
{titleText ["<t font='LCD14'>Toresk Island</t><br/><t font='TahomaB'>Welcome to</t>", "PLAIN", 3, true, true];} remoteExec ["call", -2];
#

Because it's not showing up. Not even an error is popping up

warm hedge
#

Because you're the server?

hushed tendon
#

I don't understand

warm hedge
#

If you're hosting it, you won't see this

hushed tendon
#

I'm testing it in SP right now

#

won't even show up there

warm hedge
#

Still, you're the server (considered so)

hushed tendon
#

But it will still work for all players?

warm hedge
#

Other than you. Why not just use 0?

hushed tendon
#

oh yeah

#

I see now. I'm technically the server and -2 is running only for clients

warm hedge
#

Basically that's what you're doing

hushed tendon
#

Thanks

winter rose
warm hedge
#

โ˜๏ธ This is why it didn't worked

hushed tendon
winter rose
tidal ferry
#

Hey, what's the best way to execute code on player machine on disconnect from server?

distant oyster
tidal ferry
#

Basically working on a system that can save loadouts to be automatically loaded up on mission init

#

It's set to store the loadout on mission end, but I'd like to add a disconnect function in case a player leaves before mission end

#

Plan B is to add an event handler or something that executes once every 5 mins but I figure it'll be a little more messy

hallow mortar
#

The usual way of doing this is to require the player to manually save their loadout

#

That said, doing it on the server is probably the best approach. The server can match loadouts to player IDs (in theory, don't ask me to code it), and can also check the loadout of the disconnected player's surviving AI.
You'll not have much luck trying to get it to work playerside, as by the time the client knows it's disconnected, well.....it's disconnected and isn't in the mission any more, so can't check its loadout or run mission scripts

tidal ferry
#

Outstanding, thanks!

balmy creek
#

What's the script/init to increase a vehicle's top speed?

robust tiger
#

Anyone knows the name of the function that draws the camera icon and vision cone in the 2D editor? Or is that inaccesible.

wispy pond
#

Have a question about the setcaptive script. Is there anyway to do the following two things: Make enemies shoot at the captive if he starts to shoot them and 2 have enemies target the captive if hes in a vehicle with other blufor.

#

Trying to set a blufor as captive so he can be a ww2 medic and enemies wont target him only issue is if the person playing as a medic shoots people they wont shoot back and if the medic is in a vehicle with other bluefor enemies will not shoot at that vehicle

fair drum
#

will createDialog pull from a addon's config.cpp that I created that has the RscTitles definition in it?

#

or only a mission/campaign's description.ext

little raptor
#

only the root

fair drum
fair drum
little raptor
#

(config.cpp or description.ext)

fair drum
#

okay gotcha will try

wispy pond
#

side note if there is a better way of doing this im open to changing strategies

exotic flax
#

Set medic as captive, add EH to see if he shoots and set to BLUFOR again.
Could have a timer (since last time shooting) to set captive again.

Should work with vehicles as well, although I believe only if the medic would be driving.
tbf it's hard for enemies to see if a medic is in a vehicle (IRL). So would be realistic if vehicle stays BLUFOR

dusk shadow
#

Evenin'

#

I'm looking at disabling player access to a number of UAVs, 3 destroyers and a carrier's full complement to be precise.
Am I correct in saying I have only these two options to disallow connections from any player?

  1. Monitor the player's inventory for changes and disable the connection with "disableUAVConnectability"
  2. Spawn AI units and connect them to said UAVs using "connectTerminalToUAV"
willow hound
#

@dusk shadow You can lock the driver / gunner seat(s) of the UAV(s), then the UAV AI can still use them normally but the player can't take control of them. I think the player can still (un-)tick the Autonomous checkbox though.

dusk shadow
#

hmm that's an idea, not being able to connect at all would be preferable though

grim wing
#

can someone tell me why this isnt working? "Whiskey_Pilot" countType units player;

#

its displaying 0

#

but I have 3 guys in that classname slot

warm hedge
#

Are you sure that "Whiskey_Pilot" is the actual className?

grim wing
#

yes

warm hedge
#

The desired unit's typeOf returns Whiskey_Pilot?

grim wing
#

yep

#
_WhiskeyPilot = "Whiskey_Pilot" countType units player;
_WhiskeyLead = "Whiskey_Lead" countType units player;
_WhiskeyCount = _WhiskeyPilot + _WhiskeyLead;
#

this is the context

#

i want to add the total number of active players in these className slots

#

but even just

#

"Whiskey_Pilot" countType units player; is displaying 0

#

when there are 3 guys in it

warm hedge
#

Highly doubt that "Whiskey_Pilot" is the actual classNamesqf "B_Soldier_F" countType units playerWorked really fine for me

grim wing
warm hedge
#

Hmm. Are they in your group?

grim wing
#

nope

warm hedge
#

That's why

grim wing
#

same faction blufor

warm hedge
#

Use units blufor

grim wing
#

wtf it worked

#

why arma

#

why...

warm hedge
#

Returns an array with all the units in the group or group of the unit.
Read the wiki carefully

#

tldr units player returns all units from the group that player belongs. Not an Arma logic, that's how it does

manic sigil
#

I just need to finish and publish this mission T_T

In my outro, an AI dismounts an APC and runs up to the players to give the outro. Alls good, except he starts spinning on the spot.

#

Seems to happen with any unit I use a doMove command for.

lean anchor
#

hey all,
if i was to execVM something with a 30min sleep, is this gonna kill performance?

lean anchor
#

sick, i didnt think so but im not massively confident in how the scheduled to unscheduled environments

fair drum
#

currently working on a module creation and I've made my lovely GUI and am now working on getting it functional. I have a global variable HYP_TELEPORTERS that contains all the static objects synced with the module. this is so far on my onLoad function for the display...

private _mainDisplay = findDisplay 6969;
private _listbox = _mainDisplay displayCtrl 6903;

_index = 0;
{
    _grid = str (mapGridPosition _x);
    _string = "Grid " + _grid;
    _listbox lbAdd _string;
    
    _markerName = "hyp_marker_" + str _index;
    _marker = createMarkerLocal [_markerName, getPosATL _x];
    _marker setMarkerTypeLocal "mil_dot";
    _marker setMarkerShapeLocal "icon";
    _marker setMarkerTextLocal _grid;
    hyp_markers pushBackUnique _marker;
    _index = _index + 1;
} forEach HYP_TELEPORTERS;

_listbox ctrlAddEventHandler
[
    "LBSelChanged",
    {
        params ["_control", "_selectedIndex"];
        _control setVariable ["hyp_currentSelection", _selectedIndex];
        systemChat str _selectedIndex;
    }
];

I'm currently thinking of a way to grab the current selection on the list, find it's object it points to, then add it to another ctrl event handler for a button down confirmation. If LBSelChanged only gives back the index, how could I go about doing this?

fair lava
#

i'm trying to add a "VehicleDriverDisplay" to an aircraft via a patch mod, specifically to the left display manager, however when running the game with my patch mod, the left sensor panel no longer opens at all, right one still works tho

#

how would i diagnose this issue myself? the .rpt file is quite long and i've tried searching for relevant class names but see no errors

torpid quartz
#

Is there a way for "respawn on start" to be different for each faction?

ie this in the description.ext
respawnOnStart = -1;
Have a VIP in a gamemode that won't re-spawn on Indi, blufor escort and can respawn as well as opfor which try and stop the vip.

fair drum
torpid quartz
#

alright, might try some funking bools being true and triggers to get around this

fair drum
#

im not exactly sure what you are trying to do. rephrase it

torpid quartz
#

blufor can respawn, opfor can respawn, independents cannot.
blufor and opfor start in the repsawn screen, independents go straight into the game.

cerulean cloak
#

Is there any scripting command to bring back a vehicle that's been damaged by going through water too deep?

little raptor
#

Recreate it!

cerulean cloak
#

Spawn a new one in?

little raptor
#

That's one way to do it

#

I don't know if there's more

cerulean cloak
#

There's not like a variable or something?

little raptor
#

ยฏ\_(ใƒ„)_/ยฏ

torpid quartz
#

wait it works lmao

#
respawnTemplatesWEST[] = {"MenuPosition","MenuInventory","Spectator"};
respawnTemplatesEAST[] = {"MenuPosition","MenuInventory","Spectator"};

by having this people on the independent team do no go through the respawn screen and just start on the map

#

ah thanks, yeah that looks like a pretty good way to do it too

cerulean cloak
#

I found the properties of "waterLeakiness" and *"waterdamageengine"*being mentioned in the context of config vehicles, is there any way I could change this from an init/script?

fair drum
#

why don't you want to respawn it?

#

or rather, you could make it invulnerable when its posASL z value goes < 0

bronze tulip
#

Hi I'm really really new to scripting. What I want to happen is to make an AI soldier move in an arc around a "center" object. I looked around the internet and found out that you can't make AI change the direction while they are playing a walk animation. (Is this true?). So to implement the arc movement, I tried to make the AI soldier move a small amount horizontally and look at the "center". These are the contents of initialization of the AI soldier. The sleep line doesn't work as intended. What should I replace it with? Also, is it possible to check if the AI soldier could fire at an enemy?

this playMove "AmovePercMtacSrasWrflDl" //horizontal movement; 
sleep 0.5; //stop after 0.5s of moving. doesn't work as intended
this lookAt center; //look at the center of the circle```
fair drum
bronze tulip
#

Would it theoretically stop the animation 0.5s in and proceed to the the lookAt or would it continue the animation after 0.5s?

fair drum
bronze tulip
#

Ah I see. you can add a spawn to make it scheduled

#

Thanks for the help, man! Much appreciated.

wary hill
#

What do I put in deactivation field using setTriggerStatements command if I don't want anything on deactivation, since "An array with three arguments is mandatory for this function."?

#

I figured it out, apparently its "null"

hallow mortar
#

An empty string "" would probably work too

low berry
#

Any way to make smokes more visible ?

#

CautionSpecialProfilingAndTestingBranchArma3

#

Also, does anyone exactly know what this command does?

paper idol
#

hey guys im at a loss i have been trying to do some "modding" but im terrible at it, so i have a mission/mod called Kp liberation, i have been trying to make/change some units of RHS but i dont know how to do it, Simple words. I want to make/change my own units that i can then use in the mission. 2 questions I have made compositions of the units in the editor is there a simple and easy to way to make them actual units somewhere so i can use them in the mission ? 2nd question can i just simply go into lets say RHS units somewhere and simply change their outfits/gear ?

exotic flax
#

All have to do is edit kp_liberation_config.sqf and change the factions used. RHS is already supported.

manic sigil
#

I can't stop my AI spinning T_T

paper idol
#

@exotic flax i said i want to make my own units :/ i already know that i can simply change to rhs in kp

manic sigil
#

Ugh, got it... had to disableai everything but MOVE and ANIM

hallow mortar
mortal steppe
#

Hi guys, im really new to scripting and after a little bit of help, how do you pass a variable from one script to another

#

im trying to write a reload script for my tank that allows me to select 1 of 6 round types

hallow mortar
#

If the first script is spawning/calling/execVMing etc. the second, you can pass variables as arguments e.g. [_variable1,_variable2] execVM "script.sqf"

#

and then use the params command to access them in the second script

mortal steppe
#
private ["_vehicle","_roundselect"];
_vehicle = nearestObject [player, "afuk_challenger2_base"];
//hint "Selected L31A7 Hesh HE";
removeAllActions _vehicle;
_roundselect = "afuk_l31a7";


_vehicle addAction ["<t color='#00FF00'>Load L31A7 Hesh HE</t>", {[_roundselect] call afuk_cr2_fnc_cr2reload;} ,    nil, 1.5, true,    false, "", "true", 5, false, "", "gunneraction"];
_vehicle addAction ["<t color='#FF0000'>Select L3A2 Smoke/WP</t>", {(_this select 0) call afuk_cr2_fnc_load2;} ,    nil, 1.5, true,    false, "", "true", 5, false, "", "gunneraction"];
_vehicle addAction ["<t color='#FF0000'>Select L23A2 APFSDS T</t>", {(_this select 0) call afuk_cr2_fnc_load3;} ,    nil, 1.5, true,    false, "", "true", 5, false, "", "gunneraction"];
_vehicle addAction ["<t color='#FF0000'>Select L27A1 APFSDS DP</t>", {(_this select 0) call afuk_cr2_fnc_load4;} ,    nil, 1.5, true,    false, "", "true", 5, false, "", "gunneraction"];
_vehicle addAction ["<t color='#FF0000'>Select L32A6 Hesh Squash Head/Practice</t>", {(_this select 0) call afuk_cr2_fnc_load5;} ,    nil, 1.5, true,    false, "", "true", 5, false, "", "gunneraction"];
_vehicle addAction ["<t color='#FF0000'>Select L29A1 APFSDS Training</t>", {(_this select 0) call afuk_cr2_fnc_load6;} ,    nil, 1.5, true,    false, "", "true", 5, false, "", "gunneraction"];
#

this is what i have currently

#

where i want to pass _roundselect to another script

#

iv tried {[_roundselect] call afuk_cr2_fnc_cr2reload;}

#

to try pass it but it doesnt work at the other script

#

the other script currently just does hint str _roundselect;

hallow mortar
#

You need to use the params command in the other script to interpret the variables passed as arguments

mortal steppe
#
params[_roundselect];

hint str _roundselect;
#

so if i just do this ^^

hallow mortar
#

Probably

warm hedge
#

params needs string, keep it mind

hallow mortar
#

Oh yes, that too

#

params ["_roundselect"];

#

On a wider note, it looks like you're designing an individual reload function for every round type? This seems....horrible. You should be able to make one function that's completely type-agnostic and just loads whatever you pass it as an argument

#

Also also.........why are you making special functions to switch ammo types? This is handled perfectly well by the game already

mortal steppe
#

i want to have a functional loader position

#

and make it so the gunner cant reload

#

also so it takes rounds from the inventory as apposed to the default way

#

so the reload will be handled one script but those other functions are to change the colour of the add action

hallow mortar
#

I would not necessarily recommend this as a first project if you're new to scripting, it's likely to be quite complicated

#

In fact, this is something that is probably best done as a mod to create a completely new version of the vehicle that's configured to do this

mortal steppe
#

im taking it in stages

hallow mortar
#

for example, removeAllActions doesn't remove engine actions such as reload, so I think you're going to have trouble preventing the gunner from reloading

mortal steppe
#

dont need to worry about thats as all it loads are 1 round magazines

hallow mortar
#

also so it takes rounds from the inventory as apposed to the default way
This relies on the existence of vehicle magazines as inventory items, which, er......test that first

mortal steppe
#

i have an idea how to do that

#

i just want to be able to select a round type then pass that to the reload script

#

for starters

hallow mortar
#

Well, now you know how to do that. But I think you're approaching this from the wrong end - the reload script working at all is going to depend on underlying mechanics you need to develop first, if they're even possible

mortal steppe
#

i know they are possible as there is another mod that does something similar

hallow mortar
#

If I do this:

[{
    _x addCuratorEditableObjects [units _grp, true];
},allCurators] remoteExec ["forEach",2];

will it work, or will it fail because _grp isn't defined on the machine it's being remoteExec'd to?

exotic flax
willow hound
hallow mortar
#

For various reasons that's not possible. But I have another solution, I just needed to know where the variable locality fell on that one.

cyan dust
#

Good day. There isn't "elseif" operand in SQF? Some analog maybe? (apart from "switch")

willow hound
#

No ๐Ÿ˜ฆ

cyan dust
tough abyss
#

im not sure if im in the right place but i assume i need scripting ๐Ÿ™‚ What i want to do is set my Ingame Time at mission Start=My Local Time ๐Ÿ™‚

#

i would be glad for any pointer since i have not yet learned how to script in arma ๐Ÿ™‚

#

or is that not possible ?

hallow mortar
#

Yes, you can use systemTime to get your local time and setDate to apply it to the mission (after trimming off the last two elements of the array, since setDate doesn't do seconds and milliseconds)

#

You must take care to only check systemTime on one client if this is a multiplayer mission, otherwise every client will use their own local time which could cause desync if there are clients in different time zones

tough abyss
#

i never play with other people ๐Ÿ™‚ i use arma purely as a singleplayer sandbox ^_^ Thank you at least i know that it works not now i just need to figure out how i do it ๐Ÿ™‚ can i also apply the same concept to the Date ?

hallow mortar
#

Both commands include the date, it's all the same thing

tough abyss
#

ok so it will set Date and time ? ๐Ÿ™‚

hallow mortar
tough abyss
#

ye i have those pages open ๐Ÿ™‚ just need to put it together thank you for confirming i can do it

#

i would put those into a empty trigger right ?

#

or the mission init ?

hallow mortar
#

You could use either. Obviously the trigger can't be completely empty, it must have a condition set so that it actually activates. Init.sqf is the best way, though.

tough abyss
#

ye i use Eden advanced and the general settings have a Init field i assume thats that

hallow mortar
#

I would assume it's either the same thing or has the same function.

tough abyss
#

ok thank you i just found the get started page ๐Ÿ™‚ time to learn scripting i guess

#

its not like C++ right ?

hallow mortar
#

Arma 3 uses its own language called SQF. It probably shares some elements with other languages, but I don't know them well enough to say which.

#

For this particular purpose, all the code you actually need is:

// Save the current system time
_currentSystemTime = systemTime;
// Cut the saved array down to the size needed for setDate
_currentSystemTime resize 5;
// Plug the resized array into setDate
setDate _currentSystemTime;
tough abyss
#

the one without _ is the Variable correct ?

#

no wait the _ has to be variable

hallow mortar
#

Variables can be with or without _. It indicates a local variable, which is only saved in the context of the current instance of the current script. A variable without it is a public variable, which is available to - and can be overwritten by - other scripts.

tough abyss
#

ah ok ๐Ÿ™‚ thats why it complained about a local variable in the global space when i put it into the init ^^ in a trigger it works just fine tho ๐Ÿ™‚

hallow mortar
#

Well that's interesting. Clearly the 3den Enhanced "init field" is not directly equivalent to init.sqf, because local variables are fine in init.sqf

tough abyss
#

i mean to be fair it might be me fucking up ^_^ but if so thats interesting i guess

potent dirge
#

Afternoon fellas, I'm having a little issue with a kill scoring mission I wrote. In summary, the script records vehicle kills only, either if all crewmen are dead (CREWKILL) or if the vehicle is destroyed (CATKILL). I also added a check to prevent double scoring when a vehicle crew is already dead and the vehicle is later on destroyed.

The scripts and functions work fine when using autocannons, they are able to tell that a vehicle's crew is dead and destroying the vehicle grants no extra points. However, things get out of hand when using any of the big guns which kill a vehicle and its crew in one shot. It records the crew kills three times.

tough abyss
#

im just glad i dont need to set the time manually now each time i play a senario ๐Ÿ™‚

#

thanks ill try to figure out further things myself and ask for advice not solutions ^_^

potent dirge
# potent dirge Afternoon fellas, I'm having a little issue with a kill scoring mission I wrote....

I have been at it for hours and cant figure out why. Here is the important code:
Triggers when any entity is killed based on "EntityKilled" Mission EH:

params ["_killed", "_killer", "_instigator"];



if !(_instigator in units player) exitWith {};
if (_killed getVariable ["alreadyDead", false]) exitWith {};


if (_killed in vehicles) then {
    systemChat "Running fn_killLand";
    _this spawn VVV_fnc_killLand;
    };

if (_killed in allDeadMen) then {
    systemChat "Running fn_killMan";
    _this spawn VVV_fnc_killMan;
    };
willow hound
#

@potent dirge MP or SP?

potent dirge
#

SP

#

but I am working on MP compatibility later

willow hound
#

The problem could be spawn.

#

I assume fn_killLand and fn_killMan set the alreadyDead flag at some point?

potent dirge
#

yes they do

willow hound
#

spawn is the problem.

potent dirge
#

Okay I will try call

willow hound
#

EH runs unscheduled, the code can't be paused by the scheduler. spawn runs scheduled, so your EH fires for the destroyed tank, spawns some code, the scheduler doesn't execute that code yet, the EH fires again for some crew member of the tank and also spawns some code. At some point later the scheduler decides that the time to run the code has come, but at this point you already have code for both the tank and the crew member(s) executing or awaiting execution.

potent dirge
#

Wow I think it works now. I replaced spawn with call and added two more checks for the deathflags.