#arma3_scripting

1 messages · Page 203 of 1

signal drum
#

For some reason this cracked me up: Vehicles with brain cannot be created using 'createVehicle'!

stable dune
signal drum
#

Neat, that actually works

#

I'll still try implementing my own thing because it puts a little "Created" on the screen which I don't like

#

Thanks for the help!

#

Works like a charm now

#

Made a little function like this and called it in preInit:


_gmGroup = createGroup sideLogic;
gm = _gmGroup createUnit ["ModuleCurator_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];    
gm setvariable ["owner","#adminLogged"];
publicVariable "gm";  
signal drum
#

Oh I think I can steal from the ACE guys

#

Nvm I can't attach it to the owner because my owner is #adminLogged 🙁

sage heath
#

so when it comes to unit capture, if I choose to dump the unitcapture data in an sqf. (here's one as an example)

SHUC1 = [coords here];
[AFB1, SHUC1] spawn BIS_fnc_Unitplay;```
and to activate it I put this in a trigger
```sqf
execVM "AFB1.sqf"```
if I wanna put the sqf file in a separate folder, do I have to do anything different to the trigger?
#

I'm worried if I put it in a separate folder, instead of the mission's root folder, the game won't be able to find the thing

signal drum
#

Your folder needs to be within your mission folder

drifting badge
#

While having another "aim" test with a group of 3 soldiers (i.e. one leader and two soldiers), I noticed something odd: The 2 soldiers "aim" immediately at the intended target (using doWatch, knowsAbout, revealand doTarget) when I step into the repeatable trigger, BUT the leader for some reason takes his time to adjust his aim (about 2-3 seconds). I even cranked up the leader's spot time, aiming speed and spot distance to 100%, but he remains markedly slower to act than the two soldiers he commands. What could be the issue? Should he not be able to adjust his aim with the same speed just like the two others, as the target he should aim at is handed to him via the trigger?

blissful current
#

Did something change with how pilots decide to eject from planes? I've had the same SAM launcher and pilot in my mission always eject right before the missle hits. Tested this literally over 50 times over the course of making this mission. But now he just sits there and eats the missile, killing him. Is there a command that tells a pilot to eject? Maybe I could fix the issue that way...

fair drum
#

Did you have any AI mods originally? Is the AI accidentally on careless? Anyways, if you just want a fix, you can do a projectile distance check and force the pilot out when it's about to hit.

blissful current
# fair drum Did you have any AI mods originally? Is the AI accidentally on careless? Anyways...

No AI mods. Just SOG CDLC. Behavior for the group is set on safe at the moment in the editor. I've been playing with the setting the damage of the plane. At 40% damage he will eject before the missle hits. Gonna play around with this and see if it can be consistant. Just so weird that something changed. I had this on a 100% success rate before with lots of play testing. Take a break for 4 months, come back, and it's different.

regal kraken
#

If there anyway to get Civilian to be Seperate from Independent?

addMissionEventHandler ["EntityKilled", 
{
    params ["_unit", "_killer", "_instigator"];
    _killersCash = _instigator getVariable ["Cash", 0];
    _PenaltyCivilian = 100;
    
    if (side _unit == Civilian) exitwith
    {
    _killersPenaltyPLY1 = _killersCash - _PenaltyCivilian;
    _instigator setVariable ["Cash", _killersPenaltyPLY1, true];
    hint format["Killer: %1   Cash %2", name _instigator, _killersPenaltyPLY1];
    };
}];```

I have this, but everytime you kill a Independent it says you killed a Civilian
#

maybe I've been staring at it for too long, I put the hint in to confirm it and i'm not entirely sure why its picking up Independent as Civilian kills

#

should probably check for a IsKindOf rather than unit side now that i've posted it

granite sky
#

Sides are kinda weird on death.

#

I forget the exact rules. It's not documented.

#

side group may or may not work, as they leave the group at some point too.

regal kraken
#

oh because when you kill anything.. it becomes civilian? judging by Zeus

granite sky
#

Other approach is that you set a variable on them on creation.

faint burrow
#

(side (group _unit)) == civilian

regal kraken
#

Nice, its working now
cheers guys 🍻

scenic shard
#

I have a addon using a hemtt+cba template, how should i define a optional dependency? I dont need that .pbo at all if it is missing.

just check isClass (configFile >> "CfgPatches" >> "mod_name") in all the XEH_scripts and exit early?

Or is there some better way, like the requiredAddons in config.cpp but instead of a error it just gets ignored?

untold copper
tulip ridge
#

Just know that skipWhenMissingDependencies makes the whole addon not be included

graceful meteor
#

another noob question. I'm making a TP system that points to team vehicles. Is there a place I can put Y-2 so you don't TP inside of the vehicle in the following code, this a line from the original TP start point:
this addAction ["<t color='#E50000'> ALPHA 1-1", {player setPos (getPos ALPHA_11_TRNSPRT)}];
ALPHA 1-1 what shows on the menu, ALPHA_11_TRNSPRT is the variable name of the vehicle
Pleas, and thank you

granite sky
#

Y-2?

graceful meteor
#

-2 in "Y" direction of the variable

granite sky
#

oh, I think you mean like

{ player setPosATL (getPosATL 
ALPHA_11_TRNSPRT vectorAdd [0,-2,0]) };
#

if you just want them not to spawn in/on the vehicle and you don't care about the direction then setVehiclePosition with "NONE" probably works.

graceful meteor
#

ahh, perfect, I assume [0,-2,0] is XYZ. [0,0,5] would pos +5 in "Z"

granite sky
#

Yeah, positions in SQF are just three-element arrays, [x,y,z]. Some commands use different orientations though so you have to check.

graceful meteor
errant iron
#

Just double checking, the maximum load of uniforms/vests/backpacks are only adjustable in config and can't be set from SQF alone, right?

granite sky
#

setMaxLoad

errant iron
#

ooh, interesting

scenic shard
tulip ridge
#

For event handlers, you can just only add them if tfar is loaded

scenic shard
#

Ok, thanks 🙂

graceful meteor
#

@fair drum sir, I hate to bother you again, but I can't over-emphasize how new I am to this stuff, if you get a minute, could I get you to DM me, or @me, please

fair drum
graceful meteor
# fair drum you can ping me here whenever. I prefer it here so that others can take over whe...

I get that. I wasn't sure which would be better, I didn't want to be the guy that clogs the channel with nonsense and redundant information. I'm extremely new to this world. I started making Reforger stuff for my group, but Reforger really doesn't require any scripting knowledge. One of the guys who was making our A3 stuff stepped away from the group. Now I'm trying to roll back to something I don't understand. I say all that, to say, is there a good starting point to know the basics, for instance the script you made me last night goes into the mission folder as its own script file, or in an init script box of the rifle groups, or in an init box of the mission itself?

fair drum
graceful meteor
fair drum
graceful meteor
blissful current
#

I'm trying to make a second function and I've messed it up somehow. Does this look right?

{
    class FoxClub
    {
        class fnc
        {
            file = "functions";
            class Conversation {}; // this will make the function FoxClub_fnc_conversation
        };
        {
            file = "functions";
            class intelFound {}; 
        };
    };
};
granite sky
#

Remove the three lines between the two functions and it's correct.

#

As it is, it's not :P

blissful current
#

Sorry, do what?

#

I count 2 lines between the functions. Two curly brackets.

granite sky
#
class CfgFunctions
{
    class FoxClub
    {
        class fnc
        {
            file = "functions";
            class Conversation {}; // this will make the function FoxClub_fnc_conversation
            class intelFound {}; 
        };
    };
};
#

That's three lines.

blissful current
#

Ah I see. Thank you. Can I name fnc to whatever or does it need to stay?

granite sky
#

If you use file inside it then it doesn't matter what it's called.

blissful current
#

Like is that just for organizing? I could have a couple different names with stuff in each respectively right?

granite sky
#

It sets the default path, but file overrides it.

#

so yeah, if you do that then it's just for organization.

#

Normal for mods because the default path is useless there.

#

But you still want a 1:1 category to folder mapping usually.

blissful current
#

Would this work?

class CfgFunctions
{
    class FoxClub
    {
        class Conversations
        {
            file = "functions";
            class Conversation {}; // this will make the function FoxClub_fnc_conversation
            class intelFound {}; 
        };
        class OtherUsefulStuff
        {
            file = "functions";
            class Usefulstuff1 {};
            class Usefulstuff1 {}; 
        };
    };
};
granite sky
#

yes but it's degenerate

blissful current
#

What does deneerate mean?

granite sky
#

well, assuming you didn't mean to type Usefulstuff1 twice.

#

If it's worth another category then it's worth another folder.

blissful current
#

oops

#

Okay got it. So make a new folder for functions that are very different from one another.

blissful current
#

This gets an error for undefined variable _caller. My function starts with:

params ["_target", "_caller", "_actionId", "_arguments"];
         _scout = missionNamespace getVariable ["scout", objNull];
        if (_caller == _scout) then {
#

Maybe the call isn't passing _caller to the function?

#

I call it like this:

 params ["_target", "_caller", "_actionId", "_arguments"];
        [_caller] call FoxClub_fnc_intelSearch;
fair drum
blissful current
#

The code there works fine but I was trying to put it in a function for readability. I use two other functions on the on complete portion of the holdAction and they apparently pass caller successfully.

#

Yes. line 15 in the function

#

which is if (_caller == _scout) then {

fair drum
#
params ["_target", "_caller", "_actionID", "_arguments"];
[_caller] call FoxClub_fnc_intelSearch;
// intel search
params ["_caller"];
#

preferred:

_this call FoxClub_fnc_intelSearch;
// intel search
params ["_target", "_caller", "_actionID", "_arguments"];
// stuff
#

do you see the difference between these and yours?

blissful current
#

Looking over them now

#

Not really other than you removed 3 params.

fair drum
#

look at the order of them, not that they were removed

blissful current
#

Same order as I posted, no?

#

target, caller, id, arg

fair drum
#

and none of the other params exist, they are all nil

#

remember, order is what matters, not what they are named

#
[_caller] call FoxClub_fnc_intelSearch;

// for this example, is basically

[_caller, nil, nil, nil] call FoxClub_fnc_intelSearch

// your function is looking for
[
    "_target" // now has _caller in it because this is at index 0, just like your function call
    "_caller" // nil
    "_actionID" // nil
    "_args" // nil
]
blissful current
#

Hmmm... so if I wrote this it would fix it now that the function.sqf sees the indexes in the correct order?:

[_target, _caller] call FoxClub_fnc_intelSearch
fair drum
#

sure, and if you didn't care to pass target, you would do:

[nil, _caller] call FoxClub_fnc_intelSearch

what

_this call FoxClub_fnc_intelSearch;

is doing, is just bringing all the parameters from the previous scope, to the new scope, in the order they already exist in

because _this is really just [_target, _caller, _actionID, _arguments]
so its like writing

[_target, _caller, _actionID, _arguments] call SomeFunc
blissful current
#

Whoa... I'm try that now! 🤯

fair drum
#

keep in mind the brackets

[_this] // translates to [[_target, _caller, _actionID, _arguments]]
_this // translates to [_target, _caller, _actionID, _arguments]
thin fox
#

is there a way to easily sort a hashmap?

fair drum
#

hashmaps don't have "position" like arrays do

thin fox
#

it doesn't create in order

blissful current
fair drum
#

it takes a different way of thinking, yes

fair drum
blissful current
#

Oh well for sure on the holdAction

thin fox
blissful current
#

thats where there _this grabs it

fair drum
fair drum
#

the question you need to ask, is why you need them sorted

thin fox
#

I'll find another way

fair drum
#

you can use those phases (string) as keys, or you could use numbers as keys. The issue is the forEach loop. Iterating over a hashmap is slower than just using an array.

thin fox
meager granite
#
createHashMapFromArray [
     ["order", ["key1", "key2", "key3"]]
    ,["data", createHashMapFromArray [
         ["key1", 100]
        ,["key2", 200]
        ,["key3", 300]
    ]]
];
#

But you'll need to be careful when creating and editing the hashmap to keep same keys in both array and data

thin fox
grizzled cliff
#

FYI on the public ACE3 Slack we have the #intercept channel for public people to start to get to know Intercept

light badge
#

Hi all. Anyone knows how to work the setObjectScale command?

I tried typing:
conc_wall_001 setObjectScale 1.3;

into the ini of the objects, but after publishing the mission into Steam, when loaded into the game tey appear with the original size.

I also tried to attach to another object as some forums suggest, but same result.

conc_wall_001 attachTo [box, [0,0,0]];

Any help would be greatly appreciate

stable dune
#

mp environment brings its own issues with scaling

mortal folio
#

im curious - why is it illegal to start a unit's variable name (in eden) with a symbol/number, but setting a variable using setVariable to namespace or wherever else that starts with a symbol/number seems to work fine?

#

(been setting some variables to missionnamespace using hashValue which can generate numbers and symbols and was surprised that it worked)

light badge
winter rose
mortal folio
#

thanks

fair drum
light badge
#

yes, using the allSimpleObjects [className1, className2]; command.

#

now It works but if I try to change the scale of an object with position and rotation it loses the params (position and rotation)

tulip ridge
#

allSimpleObjects doesn't create simple objects

stable dune
analog mulch
#

Instead of using the ammo vics to resupply vehicles or turrets, is there a way to turn objects such as boxes into ammo vehicles in terms of them able to rearm turrets or vics in the vicinity?

analog mulch
#

i want it so i have a props nearby that rearm turrets in its vicinity

thin fox
analog mulch
#

wait, do i put that sqf in a prop and it will rearm and refuel nearby vics and turrets?

thin fox
#

but basically it checks for a x object nearby to rearm, refuel, and repair

analog mulch
#

i see

#

not too well versed in scripts but i'll see what i can learn from it and dissect

#

ty

thin fox
ivory lake
#

but yeah thats config

blissful current
#

Is there documentation on how leader player is chosen? Let's say there are 8 editor placed slots in one group for multiplayer. The game starts and slot 1-4 are human and slot 5-8 are AI and all AI outrank human players (rank set in editor). How is leader player chosen then?

#

Single player is easy to determine. The player controls the AI so thats the leader player. But in testing my MP mission I've seen it hand off leader player to the AI and I cant determine if it's chosing based on slot or rank or what.

hallow mortar
#

Rank (sometimes) determines inheritance, but the initial group leader is determined by...the leader of the group. Typically the first unit placed in the group, or the first unit in the group's config if it was placed from the Groups menu, or the unit to which other units were manually grouped, or the unit set as the leader from the right-click context menu.

blissful current
#

So if I have 8 slots and lets say just two people join. They chose slot 4 and 5 (AI disabled) who is leader player?

hallow mortar
#

I feel like we've had this conversation before

blissful current
#

We defintley have. And I've forgotten most of it. Cause it was months ago.

hallow mortar
#

Typically it will be the earlier slot (4) because that's usually the older unit (in terms of Editor placement order and therefore unit creation), but that isn't necessarily the case.

#

Specifically setting the leader, through selectLeader or the context menu, could make a different unit the leader.

blissful current
#

Hmmm I wonder then if I should always force a select leader. To avoid a situation where someone dies and AI gets passed leadership.

hallow mortar
#

If you can't guarantee that there will be no AI, and you can't guarantee that AI will always be lower rank than players, then yes you will probably need to selectLeader if you want to ensure that an AI never ends up as the leader.

#

You could use the leaderChanged group event handler to do it.

blissful current
#

Also too, I could set all units to the lowest rank? Maybe if given the choice between a player and ai of the same rank a player always wins?

hallow mortar
#

I can't decisively say that is not the case, but that's because I don't have a lot of evidence either way. It's a big assumption and I wouldn't rely on it.

blissful current
# hallow mortar I can't decisively say that is _not_ the case, but that's because I don't have a...

From a mission design standpoint, what makes the most sense as far as who gets to control the AI? In the lobby I made sure slot 1 says group leader so players will know that's who controls AI. If that player dies then I can reassaign him group leader. That seems obvious. But if that person disconnects for some reason then who gets it next? I could select random whoevers still alive but what if a player doesn't want to have to control AI. Maybe it should be an addAction to whomever wants to have control?

#

Or maybe I revaluate and force AI group members to be OFF, like in the SOG CDLC.

#

But the Spearhead CDLC has AI squad members and its fun too.

#

I'm really conflicted here lol

hushed turtle
#

You can also enable TeamSwitch and let players switch into any playable unit any time

blissful current
#

Oh thats interesting. Is that like in SP when you press 'U'? I didnt know you could do that for MP.

hushed turtle
#

It can be done in MP too, but with limitation - you can only switch to unit of the same team

#

But that's likely non issue in your case

blissful current
#

Correct. I'll have to consider this option too.

hallow mortar
graceful meteor
#

@fair drum seriously, thank you, sir. works like a charm

#

and for the next one, is there a way to do a addaction script to activate a trigger from the menu?

opal zephyr
#

Anyone remember the function for creating a class during runtime? I can't find it

hallow mortar
#

This is just a guess, but I've got a feeling that was about a different language and this was the wrong channel

opal zephyr
#

hm think_turtle I could have sworn I'd encountered something. Is there something similar and I'm just mis-remembering?

tulip ridge
#

Not really
There's the hot reload for config, but that's only meant for development purposes. It also might not work for new classes, no clue

opal zephyr
#

I'm familiar with that one and its not what I'm thinking of unfortunately. I appreciate the help

hallow mortar
opal zephyr
little raptor
#

you can only modify the config using diag_mergeConfig

opal zephyr
#

Maybe I'm thinking of addClass from vbs... ugh

graceful meteor
# fair drum Which menu?

Sorry, was trying to make that two separate messages, didn't mean to make it look like I was asking you specifically. Middle mouse, same place a addaction would be for a object like a TP or arsenal, but not tied to an object in this case, accessable anywhere

fair drum
jade acorn
#

How can I localize text in BIS_fnc_textTiles?
[format [localize "%1STR_WEID_Diary_Stash_001%2", "<t font='PuristaBold' size='1.6' color='#FFBF00'>", "</t><br />Stash location discovered"], true, nil, 7, 0.7, 0.25] spawn BIS_fnc_textTiles; does not work.

#

nvm I think I'm stupid.

#

Nope, I have no idea either way.

winter rose
jade acorn
#

yeah...

#

Ok, I guess the parseText part is a requirement for this one. sqf [parseText format ["%1 %3 %2", "<t font='PuristaBold' size='1.6' color='#FFBF00'>", "</t><br />Stash location discovered", localize "STR_WEID_Diary_Stash_001"], true, nil, 7, 0.7, 0.25] spawn BIS_fnc_textTiles; works fine.

#

i think i need a rubber duck for this.

wintry coyote
#

anyone have the eos files? forum is down so unable to get them off there

tidal idol
#

Looking for help on converting a selectionPosition value from relative model space to position ASL with respect to the same object, a
For some reason, using a selectionPosition "HUD LH" is yielding a different value than AGLToASL(a modelToWorld(a selectionPosition "HUD LH")) vectorDiff getPosASL (a)

Notably, the more complex statement is yielding a value about a meter higher than the other; this is more in-line with what I want, but for some reason it also changes when object a moves around, which drastically increases uncertainty in my results.

Am I missing something? I tried to trace all the correct position formats and "relative to" considerations by taking the "position in model space", converting it to AGL using modelToWOrld, and converting that to ASL where I do my comparison with the object.

#

Overall, I'm looking for a position of "HUD LH" that can be directly compared to a positionASL with respect to getPosASL (a); that is, the return value of this: AGLToASL(positionCameraToWorld [0,0,0]) vectorDiff (getPosASL a)

granite sky
#

selectionPosition returns a value relative to the model center and model orientation. Even if the orientation is identity, the model center isn't necessarily the same as the ASL position.

#

ASL position is typically at the ground contact point of an object, IIRC.

#

See getPosWorld.

#

Correct translation of selectionPosition to ASL should be just a modelToWorldVisualWorld (a selectionPosition "HUD LH")

meager granite
#

ASL uses XY from GetPosWorld and Z from Placing Point offset

sage marsh
#
//- - - Transition to Deploy - Fade In
titleCut ["", "BLACK OUT", 3];
3 fadesound 0;
3 fademusic 0;

Sleep 3;

//- - - Cinematic Border In
[0,0,false] spawn BIS_fnc_cinemaBorder; 
Playmusic "";

["<t font='PuristaBold' color='#f7f9fa' size='1'>- 6 Minutes Later -</t>",-1,-1,7,1,0,789] spawn BIS_fnc_dynamicText;
skipTime 0.1;

sleep 6;

//- - - Hereford Hideout Prep
{ _x setunitpos "Middle"; _x disableAI "Move"} foreach units CB_G_Hereford;
CB_Hereford_Leader setpos (Getpos WP_Leader_HideoutPrep);
CB_Hereford_Gunner setpos (Getpos WP_Gunner_HideoutPrep);
CB_Hereford_Medic setpos (Getpos WP_Medic_HideoutPrep);

CB_Hereford_Leader  setdir 190;
CB_Hereford_Gunner setdir 190;
CB_Hereford_Medic  setdir 190;

//- - - Player Deploy
CB_Player setpos (Getpos WP_Player_HideoutPrep);
CB_Player setdir 190;
CB_Player switchmove "AmovPknlMstpSlowWrflDnon";

//- - - Show - units - Hideout - Guards
{_x enableSimulation true;_x hideObjectGlobal False;} forEach (getMissionLayerEntities "Layer_Hideout_Guards" select 0);

Sleep 2;

//- - -Fade in
titleCut ["", "BLACK IN", 3];
3 fadesound 1;
3 fademusic 1;

Sleep 2;

//- - - Dialogue - Hideout
["Cpt. Liam Anderson", "Alright. This is it."] spawn BIS_fnc_showSubtitle;
["HerefordTopicChat", "MissionConversation", ["Hereford_HideoutPrep_1", "Hereford_HideoutPrep_1"], "SIDE", nil, nil, 1, true] call BIS_fnc_kbTell;

Sleep 0.5;
["Cpt. Liam Anderson", "Hold here. Let them thin out a bit. We go on my signal."] spawn BIS_fnc_showSubtitle;
["HerefordTopicChat", "MissionConversation", ["Hereford_HideoutPrep_2", "Hereford_HideoutPrep_2"], "SIDE", nil, nil, 1, true] call BIS_fnc_kbTell;

sleep 2;

//- - - Cinematic Border Out
[1,1,false] spawn BIS_fnc_cinemaBorder; 
#

Bumping this again,

Sometimes whenever i use BIS_FNC_ShowSubtitle and BIS_fnc_CinemaBorder, the subtitle is obstructed by the cinematic border.

Any remedy for this?

tidal idol
rich nexus
#

looking for a script that shows the hold space bar action when a player is inside a trigger and it must be held for 15 seconds, and then put an inventory item on the floor after the 15 seconds

stable dune
rich nexus
#

yes they do

stable dune
rich nexus
stable dune
# rich nexus ive never understood scripting 😂 thats why i was seeing if anyone has a pre ma...

Well is not complicated.
You could do something like ->

//initLocalPlayer.sqf file in your mission root
[
    player,
    "Drop Item XX",
    "", "",
    "_this inArea yourTriggerVar && 'YOURITEMCLASS' in (items _this)",
    "_caller inArea yourTriggerVar && 'YOURITEMCLASS' in (items _caller)",
    { hint "Started!" },
    {},
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
        private _item = "YOURITEMCLASS";
        private _weaponHolder = createVehicle ["GroundWeaponHolder", [0,0,0], [], 0, "NONE"];
        _weaponHolder setPosASL getPosASL _caller;
        _weaponHolder addItemCargoGlobal [_item, 1];
        _caller removeItem _item;
    },
    {},
    [],
    15,
    nil,
    true,
    false
] call BIS_fnc_holdActionAdd;
sage marsh
#

Making holdaction is extremely simple using 3den enhanced unless you want to script it directly

rich nexus
#

Yes I do have 3den enhanced I’ve figured a way to do it to get the hold action now I just need to get an eject on the ground afterwards so I’ll try the script you’ve just given me thanks

solid gale
#

Hey, I'm trying to figure out who is deleting or hiding my objects on my server. Knowing that if I played in single player, nothing would happen, I'm about 75% sure it's a mod thing. I did try placing any infostand, and all of them gave the same result. So, if anyone can help me try to figure out a method or something, I would appreciate that.
.rpt

"-------------------"
"-------------------"
"[DEBUG][RX] Deleted:  at [-78.6791,3800.13,156.843]"
"[DEBUG][RX] --- STACKTRACE START ---"
"[DEBUG][RX] --- STACKTRACE END ---"
"-------------------"
"-------------------"
"[DEBUG][RX] Moved:  from [-78.6791,3800.13,156.843] to [0,0,0]"
"[DEBUG][RX] --- STACKTRACE START ---"
"[DEBUG][RX] --- STACKTRACE END ---"
"-------------------"
"-------------------"

i did try to use something like this:

#
[] spawn {
    // --- Collect all RX_InfoStand objects
    private _objs = allMissionObjects "RX_InfoStand";

    if (_objs isEqualTo []) exitWith {
        diag_log "[DEBUG][RX] No RX_InfoStand objects found to watch.";
    };

    diag_log format ["[DEBUG][RX] Watching %1 RX_InfoStand objects...", count _objs];

    private _states = [];
    {
        _states pushBack [ _x, getPosWorld _x, alive _x, isObjectHidden _x ];
    } forEach _objs;

    while {true} do {
        {
            private _obj      = _x select 0;
            private _posOld   = _x select 1;
            private _aliveOld = _x select 2;
            private _hiddenOld= _x select 3;

            private _posNew   = getPosWorld _obj;
            private _aliveNew = alive _obj;
            private _hiddenNew= isObjectHidden _obj;

            // --- Deleted
            if (_aliveOld && {!_aliveNew}) then {
                diag_log "-------------------";
                diag_log format ["[DEBUG][RX] Deleted: %1 at %2", typeOf _obj, _posOld];
                diag_log "[DEBUG][RX] --- STACKTRACE START ---";
                diag_stacktrace;
                diag_log "[DEBUG][RX] --- STACKTRACE END ---";
                diag_log "-------------------";
            };

#
            // --- Hidden / Unhidden
            if (_hiddenNew != _hiddenOld) then {
                diag_log "-------------------";
                diag_log format ["[DEBUG][RX] Hidden state changed: %1 -> %2 at %3", _hiddenOld, _hiddenNew, _posNew];
                diag_log "[DEBUG][RX] --- STACKTRACE START ---";
                diag_stacktrace;
                diag_log "[DEBUG][RX] --- STACKTRACE END ---";
                diag_log "-------------------";
            };

            // --- Moved
            if !(_posNew isEqualTo _posOld) then {
                diag_log "-------------------";
                diag_log format ["[DEBUG][RX] Moved: %1 from %2 to %3", typeOf _obj, _posOld, _posNew];
                diag_log "[DEBUG][RX] --- STACKTRACE START ---";
                diag_stacktrace;
                diag_log "[DEBUG][RX] --- STACKTRACE END ---";
                diag_log "-------------------";
            };

            // --- Update snapshot
            _x set [1, _posNew];
            _x set [2, _aliveNew];
            _x set [3, _hiddenNew];
        } forEach _states;

        uiSleep 1;   // check once per second
    };
};
thin fox
solid gale
thin fox
signal drum
#

I want to spawn a random opfor group with my script and I have code that works for vanilla units, but I'm struggling to see how I can support groups from mod factions. This is what I currently do:

private _biFactionNames = ["CSAT", "FIA", "Spetsnaz", "CSAT (Pacific)"];
_eastFactions = [];
{
    private _factionName = getText (_x >> "name");
    if (!_ignoreBI || {!(_factionName in _biFactionNames)}) then {
        _eastFactions pushBack _x;
    };
} forEach configProperties [configFile >> "CfgGroups" >> "East", "isClass _x"];

_randomFaction = selectRandom _eastFactions;

_groupsToSpawn = "true" configClasses (_randomFaction >> "Infantry");```

The issue is that the category of the groups isn't universally "Infantry", but if I just spawn a random group I will also spawn boats and tanks and stuff. I don't see anything in the config viewer that identifies a group as infantry, but it's gotta be possible somehow. The 3den editor and zeus interface both know what is and what isn't infantry. Does anybody have any ideas?
#

How Bohemia does it:

#

How SOG does it:

hallow mortar
#

The 3den editor and zeus interface both know what is and what isn't infantry
What do you mean by this?
As far as I can see, the groups list simply reports the category name and the group icon that are defined in the category and group config. It doesn't have any ability to automatically detect what type of group it is - it just shows what it's told to.

#

btw, I'd recommend using Leopard20's Advanced Developer Tools mod, it massively improves the config browser and makes it much easier to use. It doesn't cause dependencies so it's safe to use.

cosmic lichen
#

Just Loop through all units in the group and look up their type in config

signal drum
#

Thanks for the advice, I was hoping I'd find a way around that 😂

#

Currently using spawnGroup and it's just comfy

graceful meteor
#

Is there an addaction line I can put in an object or or player character that will run a hide object command line by using the action in the middle mouse-action menu?

cosmic lichen
#

Just filter out all groups that have boats or vehicles in general first.

#

Before spawning that is.

signal drum
#

Yeah I'm actually trying that right now but I can't wrap my head around working with config entries

#

Never know when to use configClasses or configProperties

#

This is what I got:

    _groupsToSpawn = _groupsToSpawn + configProperties [_x, "(_x call Safehouse_fnc_isInfantry)"];
} forEach configProperties [_randomFaction, "isClass _x"];
#

fn_isInfantry.sqf:


systemChat format ["Group Class: %1", _groupClass];

{
    systemChat format ["Unit: %1", _x];
    private _vehicleClass = getText (_x >> "vehicle");
    systemChat format ["Vehicle: %1", _vehicleClass];
    if (getNumber (configFile >> "CfgVehicles" >> _vehicleClass >> "isMan") != 1) exitWith {false};
} forEach _groupClass;

true
#

I need to make sure that a) the first script does not get called for the property "name", but only for the groups in the faction, and b) that I can check whether each guy in a group isMan

fair drum
graceful meteor
signal drum
#

I got it to work letsgo letsgo letsgo

jade acorn
#

from my experience the first subtitle has to be started before you run the cinema border function to have them showing up in front of the borders consistently but maybe the other function does not have that problem.

placid spear
#

Trying to use CBA extended init eventhandlers to do some shenanigans. Everything works fine in SP editor, but the script doesnt run on a dedicated MP server

    class Extended_Init_EventHandlers {
        class UAV {
            class HAB_Sensor_Drone_Init {
                init = "_this call HAB_SENSOR_fnc_drone_init";
            };

        };
        };

#

script itself

params ["_drone"];
if (!isServer) exitWith {};

private _frequency = 2400 + floor (random 84);
private _freqString = format ["%1MHz", _frequency];

private _radio = createVehicle ["habSensor_elint_radio", [0,0,0], [], 0, "CAN_COLLIDE"];
_radio attachTo [_drone, [0,0,0]];
_radio setVariable ["freq", _freqString, true];
_radio setVariable ["jammed", false, true]; 

_drone setVariable ["hab_radio", _radio, true];

private _jammingPFH = [{
    params ["_args", "_pfhID"];
    _args params ["_drone", "_radio"];

    if (isNull _drone || isNull _radio) exitWith {
        [_pfhID] call CBA_fnc_removePerFrameHandler;
    };

    private _isJammed = _radio getVariable ["jammed", false];

    if (_isJammed) then {
        private _lastJamTime = _drone getVariable ["hab_lastJamTime", 0];
        private _timeSinceLastJam = time - _lastJamTime;
        private _currentEffect = _drone getVariable ["hab_jamEffect", -1];
        if (!(_drone getVariable ["hab_isJammed", false]) || (_timeSinceLastJam > 60)) then {
            _drone setVariable ["hab_isJammed", true, true];
            _drone setVariable ["hab_wasEngineOn", isEngineOn _drone, true];
            _drone setVariable ["hab_lastJamTime", time, true];
            
            private _effect = _drone getVariable ["hab_jamEffect", -1];
            if (_timeSinceLastJam > 60) then {
                _effect = selectRandom [0, 1, 2];
                _drone setVariable ["hab_jamEffect", _effect, true];
            };
            
            _effect = _drone getVariable ["hab_jamEffect", 0];

            switch (_effect) do {
                case 0: {
                    _drone engineOn false;
                    _drone setVariable ["hab_jamEffect", "engine", true];
                };
                case 1: {
                    _drone disableAI "MOVE";
                    _drone setVariable ["hab_jamEffect", "move", true];
                };
                case 2: {
                    private _driver = driver _drone;
                    if (!isNull _driver) then {
                        _driver setDamage 1;
                    };
                    _drone setVariable ["hab_jamEffect", "kill", true];
                };
            };
        };
    } else {
        if (_drone getVariable ["hab_isJammed", false]) then {
            private _effect = _drone getVariable ["hab_jamEffect", ""];

            switch (_effect) do {
                case "engine": {
                    _drone engineOn (_drone getVariable ["hab_wasEngineOn", false]);
                };
                case "move": {
                    _drone enableAI "MOVE";
                };
            };

            _drone setVariable ["hab_isJammed", false, true];
            _drone setVariable ["hab_jamEffect", nil, true];
            _drone setVariable ["hab_wasEngineOn", nil, true];
        };
    };
}, 1, [_drone, _radio]] call CBA_fnc_addPerFrameHandler;

_drone addEventHandler ["Killed", {
    params ["_drone"];
    {
        if (typeOf _x == "habSensor_elint_radio") then {
            deleteVehicle _x;
        };
    } forEach (attachedObjects _drone);
}];
sage marsh
#

That sucks for a transition

#

But i'll try that other subtitle thing first

fair drum
tulip ridge
placid spear
graceful meteor
# fair drum alright, what do you want this action to do?

Sorry hoss. There's a big fair/music festival this weekend and took the fam tonight

I am having a hard time spawning and despawning AI groups with the show hide modifiers set up to alpha and bravo channel triggers. They work once each and don't repeat, even if I have repeatable checked. It was suggested by @thin fox that a show hide command line might make more sense. So instead of requiring the people that I want to be in charge of calling AI(spawning) when needed, to know the command lines and my variables. I thought what about making a addaction, in the character, that has that command line in it.

fair drum
supple condor
#

if i use setVariable on a player on a decicated Server, set my variable to global
player has a disconnect and reconnects as the same slot, same profile etc.

is my variable persistent or does it reset/vanish?

hallow mortar
#

If the variable is set on the player object, e.g. player setVariable ..., then it is attached to the unit the player was inhabiting at the time it was set. If that unit still exists and the player took control of it again, the variable is still set. If the unit was deleted after they left, then they create a new unit and the variable is unlikely to be attached to it.

signal drum
#

You could use profileNamespace setVariable [...]; to save a variable to the player's profile so you can access it again when they reconnect

supple condor
#

how can i retrive the profileNamespace?
is that the name i see ingame?

hallow mortar
signal drum
#

You can run profileNamespace getVariable [...]; for that

#

It'll fetch variables from the profile of the client you run it on

hallow mortar
winter rose
#

my bad for not scrolling up

supple condor
#

at the end, i want to build a respawn counter. So each player can respawn like 3 times.
so each variable needs to be somehow unique and i dont want to hardcode 20-30 Player into my mission 😅

So i guess i will use one of that, decremente by one, then remoteEXEC the rest of my code
And pray that i dont fuck up locality 😅

stable dune
#

You could create missionnamespace hash, where you use player uid as key and if not set -> default 3 , and on respawn -1 from counter. and if counter is 0, -> spectace.
So if user reconnect in same mission he has counter xx , so players cannot reset counter when reconnecting etc.
https://community.bistudio.com/wiki/getPlayerUID
that is unique.

supple condor
#

uuhh thats nice. thank you 😄

pallid palm
#

this Discord program is Awsome i love it

dire island
#

Can anyone spot the error? I want to spawn a 40mm HE grenade and have it explode inside/on an object, but nothing happens. It should be the correct syntax according to BIKI, but it doesn't work with the vehicles from the example on BIKI either, but then again, it isn't throwing an error so I don't really know what's wrong.

_proj = createVehicle ["G_40mm_HE", _pos , [], 0, "CAN_COLLIDE"];
_proj setPosATL _pos;
sleep 0.01;
_proj setDamage 1;```
hallow mortar
#

You could try triggerAmmo rather than setDamage.
Removing the sleep may also help.
40mm grenades have a minimum arming distance and/or time, and it may be deciding that it has hit the object and failed to detonate (thereby being destroyed) before you can trigger it. (It's also possible that triggering within the arming distance doesn't work at all, I think I remember running into this myself previously)

#

You could also try using a 40mm HE or GPR-T autocannon round instead, those have similar-ish power but no minimum arming distance

dire island
#

Cheers!

thin fox
graceful meteor
graceful meteor
coral trellis
#

@grizzled cliff Any chance I can get an invite to the ACE3 slack? By happy coincidence I actually compiled Intercept for the first time ever myself yesterday, would be interested in the #intercept channel 😃

ionic merlin
#

would someone perhaps be able to help me out with scripting a AI to move once a player hits a trigger? I'm trying to have a Officer walk over from his post to speak to the players before they can pass through the checkpoint

sullen marsh
tough abyss
#

All Slack team requires invite unless they use some kind of tool to auto send invites

coral trellis
#

Aye, slack requires invites, unless they changed something since I last used it

fair drum
graceful meteor
# fair drum figure out how you want to structure your data. are the units you want to hide s...

I am making groups of 4. That way, if I'm the HC, I would be a proper ALPHA 1 SL, and the AI, 4 man groups, would ALPHA 1-1 and ALPHA1-2, that I could move and task independently. I am doing this more than once, and 2 teams seems a bit under whelming, so I might make a real person in charge of ALPHA 1-1, 1-2, 2-1,and 2-2. but that's the basic setup. It's a as needed basis, for support. they'll be used to hold a Phase line, or hold security why we(real players, having the real fun) move on objectives

sullen marsh
#

o

#

I can't remember ever getting an invite... I must have at one point

#

Turns out I did get an invite

#

BUT YOU DON'T HAVE TO

#

Aren't you lucky

fair drum
# graceful meteor I am making groups of 4. That way, if I'm the HC, I would be a proper ALPHA 1 SL...

well in general, if you want to hide things, you want to hide them using hideObjectGlobal which is a server command. Therefore, you need to remote exec the action to the server:

{
    [_x, true] remoteExec ["hideObjectGlobal", 2];
} forEach _myArrayOfThings;

if you want to lower the amount of network calls (when you get a lot of objects), then you would make a function in CfgFunctions, then exec that function on the server and pass the whole data set:

// myCustomFunction
params [["_thingsToHide", [], [[]]], ["_state", true, [true]]];

if (!isServer) exitWith {};

{ _x hideObjectGlobal _state } forEach _thingsToHide;
// local player action execution
[_myArrayOfThings, true] remoteExec ["myCustomFunction", 2];

its really up to you how you want to set it up from there.

graceful meteor
fair drum
#

no. do you know how to define functions in the game yet?

graceful meteor
# fair drum no. do you know how to define functions in the game yet?

Honestly, no. Up until a week ago, I was the Reforger guy for our stuff. Reforger is combining components and configuring options, correctly, more than anything. It requires almost no scripting knowledge. Everything I've learned is very situation specific. I mad a TP system. I DL'd a 4 pole TP comp mod, opened a pole, looked ad the commands, and said "oh, I get it, I can do that". But as for general knowledge, and properly understanding, no, I'm not that guy yet.

#

people, have sent me some BikI pages to look over, I've started, but I'm still very new

fair drum
#

reforger does require a ton of actual oop programming knowledge btw if you want to move away from anything base game.

so you can define functions in a multitude of ways, but the recommended way is to use CfgFunctions and using the function library https://community.bistudio.com/wiki/Arma_3:_Functions_Library

this way, your function is defined on every machine

graceful meteor
#

"your function is defined on every machine" means all players would have access to the function?

fair drum
#

yeah, say if i have a function that should run locally on a client, and me, the server wants to tell that client to do something:

// say _unit2 is a player object that someone controls
[_args] remoteExec ["myClientLocalFunction", _unit2];
// we tell whoever owns _unit2 to execute that function. if it doesn't exist on their machine, nothing happens
#

so in your case, we want to tell the server itself to do something, from a local client

#

so your action in simplest terms would be:

player addAction {
    "Hide My Things",
    {
        params ["_target", "_caller", "_actionID", "_args"];

        [myGlobalArrayOfThings, true] remoteExec ["RAG_HideObjectsOnServer", 2]; // 2 is always the server
    }
};
#

and you would make RAG_HideObjectsOnServer and register it in CfgFunctions within description.ext (if using a mission, not a mod)

graceful meteor
fair drum
#

yeah so you would modify class CfgFunctions inside of your missions description.ext file

graceful meteor
#

Roger, I'll start playing. I'm definitely behind the curve on this stuff, but I'll try getting there piece by piece. @fair drum @thin fox @granite sky thank you guys, I appreciate you guys being gentle with me, lol

fair drum
#

if you haven't learned it yet, github is a very useful thing for people to help you on things

coral trellis
#

aHA

graceful meteor
fair drum
#

its not about whats on there. its about uploading your missions, you have a problem, we can look at the entire code base, and push a fix which then you would just have to merge

steep fulcrum
#

Hello , How can i solve this problem ?
When i click Shift + T to mark while im flying with drone , it doesn't appear for my friends

steep fulcrum
winter rose
#

hmm. I wonder if it could be a server difficulty setting

steep fulcrum
#

I will check rn

#

i don't see any setting that do this thing

graceful meteor
tidal idol
#

Attempting to check if a config parameter exists within a player's helmet class. Any help on this error?

hallow mortar
#

config entries are an actual data type and isNil doesn't support them

#

(also you might need brackets to force the config path to be interpreted correctly)

tidal idol
#

I just put in parentheses to debug, I'll check out that function too, thanks

jade acorn
#

does the custom waypoint that the player can place on map with Ctrl + Left Click create any object or marker that I can get position of?

hallow mortar
blissful current
#

I have a task with a trigger that sets the task state to complete and one that sets it to failed. Even though players can complete it and it will mark as succeeded, they can also still satisfy the conditions to make it fail and thus overwrite the previous completion. I don't like this. I want it to stay complete or fail when they do so.

I've been using deleteVehicle for the opposite trigger to prevent this problem but wanted to check if there was an easier solution?

thin fox
blissful current
#

I like this variable idea. Thanks!

blissful current
#

I remeber the rule about not using player as a condition on a server-only trigger. Does this rule extend to the activation field as well? Would this work?

[wentPastInfil, [leader player]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance leader player <= 100}];
blissful current
#

Seems to work on a second client when I test the mission but that confuses me as to why the server can see leader player on activation but not as a condition.

thin fox
#

alr I think my brain stopped working on how forEach loops works.

{ 
    copyToClipboard str (_x # 0);
}forEach [[6,6,6], [[1,2,3], [4,5,6]]]

I'm getting [1,2,3], is that right in this example? I want to get the first array.

fair drum
#

Yes

#

Though if you are mixing arrays of various sizes like this, it's better to use param or params with defaults so you don't error if something doesn't exist.

thin fox
granite sky
#

why would you use forEach with copyToClipboard? :/

#

That code will write "6" and then "[1,2,3]" to the clipboard, but you only see the last one. Because clipboard overwrites.

fair drum
#

I figured he was just doing it for a theory example. But yeah you wouldn't really ever use it this way.

thin fox
meager granite
thin fox
#

but I get the whole array, and I wanted to get just the first one

#

Idk by at top of my head, to get [6,6,6] I could just do _x # 0 or using params, but I get nothing using params

meager granite
#

[[6,6,6], [[1,2,3], [4,5,6]]]
=>

[
   [6,6,6], // #1
   [[1,2,3], [4,5,6]] // #2
]
#
[[6,6,6], [[1,2,3], [4,5,6]]] params ["_array1", "_array2"];
systemChat str _array1; // [6,6,6]
systemChat str _array2; // [[1,2,3], [4,5,6]]
thin fox
#

and using forEach?

meager granite
#

First _x would be [6,6,6], second _x would be [[1,2,3], [4,5,6]]

thin fox
#

so in a forEach params ["_array1", "_array2]: _array1 == [6,6,6] and _array2 == [[1,2,3], [4,5,6]]?

meager granite
#

No, if you params the original array

meager granite
#

Inside foreach you'll end up with two numbers on first _x then with two arrays on second _x

#
{
    _x params ["_array1", "_array2"];
    systemChat str _array1; // 6, then [1,2,3]
    systemChat str _array2; // 6, then [4,5,6]
} forEach [[6,6,6], [[1,2,3], [4,5,6]]];
thin fox
#

Yeah, makes sense

steep fulcrum
#

I’ll repeat the question because I need an answer: Is there a way to make the SHIFT + T mark appear to my friends while I’m controlling the drone?

split ruin
#

do someone by chance have working convoy script ?

copper plinth
#

How can I track a player when he becomes a pilot or a UAV gunner? For some reason, I'm trying to give the player a global variable via remoteControl - that he uses a UAV, but it doesn't give me the player, but his Alpha group...

thin fox
#

you could try to attach a trigger to the leader and check distance using that, I used this method a couple of times

hallow mortar
# blissful current I remeber the rule about not using `player` as a condition on a server-only trig...

The reason you don't use player is because a dedicated server machine does not have a player unit. It doesn't have an interface, it can't have a player. So you wouldn't use player in a server-only trigger because it's likely the server will be a dedicated server - not because of anything specific to the condition field or even to triggers. You wouldn't use player in any code that's going to run only on a dedicated server machine.
If you are in a locally-hosted game, then the server is not a dedicated server, it's a player machine, and player will work on it, because there is a player unit to retrieve. So in that case, player will work in a server-only trigger, because it's running on the server which is also a player machine. But it's a bad idea to rely on that, because you can't assume that the mission won't be loaded on a dedicated server.

blissful current
hallow mortar
#

Yes. Because the code is being executed only on the server, and if it's a dedicated server, it has no player unit, so player returns objNull, which is not useful.

dire island
#

I am using player switchMove "acts_unconsciousStandUp_part1"; (run from a script on some player's machine) to have a player stand up from unconsciousness. The animation only plays for that player, so for everyone else it looks like he's just standing there. Can I do [player, "acts_unconsciousStandUp_part1"] remoteExec ["switchMove"]; to make the animation play for everyone? Specifically, if the remoteExec is run on client A, will client B interpret player as client A, or as client B?

winter rose
hallow mortar
#

player is evaluated before the remoteExec is sent.

pallid palm
#

so this would be ok on DED server right ?

if (!hasInterface) exitWith {};
hallow mortar
pallid palm
#

roger that m8

hallow mortar
#

Do you understand the purpose of that piece of code?

pallid palm
#

yes sir

#

its saying really not the server

#

only whoever has Interface with the server

#

witch would be the player

#

ofcorse

cobalt vapor
#

Is urls broken since latest update?

pallid palm
#

not that i noticed

warm hedge
#

What URLs? What latest update?

cobalt vapor
#

urls on shortcutbuttons arent working anymore

hallow mortar
# pallid palm only whoever has Interface with the server

It doesn't mean "interface with the server". It means a user interface - a display, the means by which you interact with the game. Dedicated servers do not have an interface; it is impossible to play on them. Headless clients also do not have an interface. All their processing happens invisibly, without graphics. Player clients have an interface; you can see the game running and interact with it.

pallid palm
#

hmmm interesting

hallow mortar
#

It also doesn't inherently mean that all machines with interface will execute the code. It just checks whether the current local machine has an interface, and exits if it doesn't. If the code wasn't executed on all machines to begin with, it doesn't automatically go looking for other machines with interfaces to make them run the code.

pallid palm
#

hmmm interesting again

#

so like i use the code on my RRR stations and my intro and outro sqf,s

#

(Rearm Repair Reload)

#

so like if you land in The RRR trigger then it works for that client

#

would that be correct ?

#

or is there a better way

hallow mortar
#

Well it depends how your triggers are set up. That code alone doesn't do everything you want. It's for using with other code, to ensure that code doesn't run on machines without interfaces. For example, you could use it with code that does UI or audio stuff, so that code gets skipped on machines that don't need it.

pallid palm
#

copy that i understand thx so much Nikko your the best

#

we should change that code to

#
if (!hasUserInterface) exitWith {};
hallow mortar
#

Why?

pallid palm
#

i dont know

thin fox
pallid palm
#

ok cool

#

wow thats Awsome

#

thx man @thin fox

#

lol coolfrog lol

proper bronze
#

Scripting for a Range
Hi all, hoping you can help.

I am trying to script a shooting range for a unit training map I am making, and I have put the script into a file and also put code into the laptop, but I get a Script rapidfire_single.sqf not found message when trying it out in-game.

the following is the script i used

/*
rapidfire_single.sqf
5-round sequence on ONE target, 20 seconds total
*/

private _target = t1; // variable name from target Init
private _rounds = 5;
private _totalTime = 20;
private _interval = _totalTime / _rounds;

// make sure target starts down
_target animate ["terc", 1];

for "_i" from 1 to _rounds do {
_target animate ["terc", 0]; // pop up
sleep (_interval / 2);
_target animate ["terc", 1]; // back down
sleep (_interval / 2);
};

the following is the laptop int I used

this addAction ["Start 5-Round Rapid Fire", {execVM "rapidfire_single.sqf"}];

thin fox
proper bronze
#

thanks

hollow lantern
#

is there somethnig specific needed to make fireAtTarget work? The UAV (Mk41 VLS) has both doWatch and doTarget on the LaserTargetE but when fireAtTarget executes the missile does not fire towards the target.

assignedTarget confirms the correct target is selected by the UAV gunner

fair drum
#

Do you have the right muzzle? What's your code?

hollow lantern
#
params [
    ["_vls", objNull, [objNull]],
    ["_target", [0,0,0], [[]], [3]], 
    ["_missiles", 1, [0]]
];

if (isNull _vls) exitWith { hint "No VLS specified"; };
if !(typeOf _vls == "B_Ship_MRLS_01_F") exitWith { hint "Invalid VLS type"; };

private _laserTarget = "LaserTargetE" createVehicle _target;
private _targetName = format ["VLS_LaserTarget_%1", round(random 999999)];

_laserTarget setVehicleVarName _targetName;
_laserTarget setPosASL _target;

_vls reveal [_laserTarget, 4];
_vls doWatch _laserTarget;
_vls doTarget _laserTarget;

waitUntil {(vehicleVarName (assignedTarget _vls)) isEqualTo _targetName};
waitUntil { _vls aimedAtTarget [_laserTarget] > 0 };

for "_i" from 1 to _missiles do {
    _vls fireAtTarget [_laserTarget];
    sleep 2;
};
deleteVehicle _laserTarget;
sleep 2;```
#

the VLS fires, but the missile goes directly sraight up in the air

hallow mortar
#

If all else fails you can use setMissileTarget to force the missile to do whatever you want

hollow lantern
#

do I need a firedEH to get the missile object that setMissileTarget requires?

#

(I guess so)

hallow mortar
#

Yes, or technically projectileCreated mission EH but that's a bit overkill

#

Alternatively, if no one will be actually watching, you can just create the missile directly and skip the VLS

hollow lantern
#

well the point is to not skip the VLS. I'll try the firedEH/setMissileTarget approach, thanks

hollow lantern
#

odd, that indeed changed something. Guess I also have to keep my target longer available otherwise the missile goes somewhere else mid flight.
Thanks for the links, I'll check them out in more detail

hollow lantern
#

So checked your code(s) @fair drum but for me the VLS always overshoots the target and I don't know why. I did nothing different, albeit I'm not 100% sure which position a module has when it is placed.


params [
    ["_vls", objNull, [objNull]],
    ["_targetPos", [0,0,0], [[]], [3]], 
    ["_missiles", 1, [0]]
];

if (isNull _vls) exitWith { hint "No VLS specified"; };
if !(typeOf _vls == "B_Ship_MRLS_01_F") exitWith { hint "Invalid VLS type"; };

private _laserTarget = createVehicle ["laserTargetC", _targetPos, [], 0, "CAN_COLLIDE"];
_laserTarget setPosASL _targetPos;

private _targetName = format ["VLS_laserTarget_%1", round(random 999999)];
_laserTarget setVehicleVarName _targetName;

diag_log format ["LaserTarget Position: %1", getPosASL _laserTarget];

_vls doWatch _laserTarget;
_vls doTarget _laserTarget;
west reportRemoteTarget[ _laserTarget, 480];

waitUntil {(vehicleVarName (assignedTarget _vls)) isEqualTo _targetName};
waitUntil { _vls aimedAtTarget [_laserTarget] > 0 };

for "_i" from 1 to _missiles do {
    _vls fireAtTarget [_laserTarget];
    sleep 2;
};``` I even tried to set the Z position to 0:
```sqf
_laserTarget setPosASL [_targetPos select 0, _targetPos select 1, 0];```

Guess I have to check how this works when you manually designate a target using e.g a darter and the VLS locks onto that.
But thanks for your help both so far
dawn jasper
#

I'm really new to modding in arma but not in programming and I was wondering if there's a way to send data from arma to an external application? If there is then would some be able to help me out on the weekend? Ohh and I would like to use this https://docs.rs/laminar/latest/laminar/ to send and maybe receive data

#

Also ping me when replying

dawn jasper
#

I feel like the DLL isn't being loaded in the game

exotic flame
sharp grotto
#

or just disable battleye, it's more or less useless anyway.
only causes problems with the server and drags down the performance for clients (scripts.txt) 😆
not to mention that all the better cheats can apparently bypass it.

dawn jasper
blissful current
hallow mortar
blissful current
#
units west findIf {isPlayer _x && alive} == -1;
#

But maybe isPlayer wont work either?

hallow mortar
#

Well it certainly won't work if you write it with wrong syntax

blissful current
#

Actually I think maybe im doing it the wrong approadh because this gets called in a remoteexec function:

#
["wrongWay", [leader group playergroup]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance leader group playergroup <= 100}];
#

Admittadly playergroup is probably a bad name for the variable but I dont want to change it now becaus ewho knows what else ive tied it to.

hallow mortar
#

if playergroup is a reference to a group, you do not need to use group on it. group is for using on a unit to return a reference to the unit's group; if you already have a group reference, it's pointless and probably won't work anyway.

blissful current
#

Got it. It's redundant. I'll test this out now. Thanks!

drifting badge
#

Is there any way to actually "reorder" the units in a group if some of them die, so you do not have "empty F#" spots in the lineup? (I mean besides to unjoin and rejoin all those units).

hallow mortar
#

You could try removing the dead units from the group

drifting badge
#

But are they not automatically removed once the groupleader realizes the killed ones are dead? In my experience in a player lead group (and I think it is similar in AI led groups) if some of the units die you end up with empty slots, so for example: A group of 5 soldiers -> F1 is the leader, the other soldiers are at the selectable F2, F3, F4 and F5 slots. Now if the F3 guy gets killed you end up with F1, F2, F4, F5 -> the F3 slot remains empty. What I am looking for is a way to reorder the group somehow, so the new, reordered lineup would result in F1, F2, F3, F4. Hope that made sense?

blissful current
#

Oh yeah I've noticed that too. In my mission I tested it as the leader of the group (F1) and when I died and respawned, I still had control over the AI but the F1 slot was now empty space and the icon bar started with F2.

drifting badge
#

Exactly! Same happens if you are grouped up in MP, with players and AI units -> if some of them die you end up with empty slots (seems the only way to fill those if if you recruit new AIs or disband the group and then reform it -> but there has to be a better way to do that?).

blissful current
#

Maybe if you remove then re-add all members of the group it will assign a numerical order?

drifting badge
#

yes, as I mentioned if you ungroup/unjoin all units and then rejoin the alive units to the group it reorders them (removing empty slots) - I just wondered if there is another way to achieve that

blissful current
#

Ah sorry I missed that part. I don't have a lot of SQF scripting knowledge so if there is a way I wouldn't know. Give it some time and someone else might be able to help. I've posted on here before and didn't get a response till the next day because of timezone differences.

drifting badge
#

No worries, mate! Thanks for the input :)

blissful current
# hallow mortar if `playergroup` is a reference to a group, you do not need to use `group` on it...

I'm working on this contingency. If the scout in the group is still alive the function will use him; otherwise, it grabs the leader of the group. I've tried to provide some protection against a Nil and objNull scenario. Is there anything else that's good common practice I didn't think about?

_scout = missionNamespace getVariable ["scout", objNull]; // prevents an error if Nil is returned

if (!isNull _scout && alive _scout && _scout in units playergroup && vehicle _scout == ptboat) then {
    // Scout is alive and in the group
    ["scoutSays", [_scout]] remoteExec [
        "FoxClub_fnc_Conversation",
        allPlayers select { _x distance _scout <= 100 }
    ];
} else {
    // Anyone else leading will speak
    ["anyoneElseSays", [leader playergroup]] remoteExec [
        "FoxClub_fnc_Conversation",
        allPlayers select { _x distance leader playergroup <= 100 }
    ];
};
hallow mortar
#

I'm in the middle of something right now. I'll try to come back to this later.

hollow lantern
#

Hmmm so even with setMissileTarget firedEH the missile overshoots the target...

params [
    ["_vls", objNull, [objNull]],
    ["_targetPos", [0,0,0], [[]], [3]], 
    ["_missiles", 1, [0]]
];

if (isNull _vls) exitWith { hint "No VLS specified"; };
if !(typeOf _vls == "B_Ship_MRLS_01_F") exitWith { hint "Invalid VLS type"; };

private _laserTarget = createVehicle ["laserTargetC", _targetPos, [], 0, "CAN_COLLIDE"];
_laserTarget setPosASL _targetPos;
_laserTarget setPosASL [_targetPos select 0, _targetPos select 1, 0];


private _targetName = format ["VLS_laserTarget_%1", round(random 999999)];
_laserTarget setVehicleVarName _targetName;

diag_log format ["LaserTarget Position: %1", getPosASL _laserTarget];

_vls doWatch _laserTarget;
_vls doTarget _laserTarget;
west reportRemoteTarget[ _laserTarget, 480];

private _muzzle = currentMuzzle gunner _vls;
private _currentAmmo = _vls ammo _muzzle;

waitUntil {(vehicleVarName (assignedTarget _vls)) isEqualTo _targetName};
waitUntil { _vls aimedAtTarget [_laserTarget] > 0 };

if (_currentAmmo <= 0) then {
   diag_log format ["VLS: %1 is out of ammo, cannot fire!", vehicleReceiveRemoteTargets _vls];
};

for "_i" from 1 to _missiles do {

    private _firedEH = _vls addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _thisArgs params ["_laserTarget"];
    
    diag_log format ["Missile created: %1", _projectile];
    _projectile setMissileTarget _laserTarget;
},[_laserTarget]];

    _vls fireAtTarget [_laserTarget, _muzzle];
    sleep 2;
    _vls removeEventHandler ["Fired", _firedEH];
};``` target is the radar where a laserTargetC has been created via the coordinates of the radar object. https://i.imgur.com/uTd6t9d.jpeg
fair drum
#

Is targetPos also in ASL? Because create vehicle uses atl

hallow mortar
#

laser target objects delete themselves quite quickly if left unattended. You might need to attach it to something.

fair drum
#

Yeah I don't see an attach. The scripts I linked yesterday, I attach them to a module.

hollow lantern
#

oh, yes now that you mention this I remember

#

thanks I'll check that bit

blissful current
#

is there else if in SQF? Or just nest another if statement inside the else?

fair drum
#

Latter

#

Its not super efficient in sqf. A switch or call { exitwith } is better.

blissful current
#

So this is what I have:

if (conditionA) then {
    // code A
} else {
    if (conditionB) then {
        // code B
    } else {
        // code C
    };
};

I havent used the ones you mentioned. Would one be better for this?

granite sky
#
call {
  if (conditionA) exitWith { code A };
  if (conditionB) exitWith { code B };
  code C;
};
#

Not hugely faster but it looks nicer.

blissful current
#

And I define variables before this code the same way as before?

granite sky
#

Yeah, it's functionally identical.

blissful current
#

How do I structure it so it's readable in this way though?

_scout = missionNamespace getVariable ["scout", objNull];
_leader = leader playergroup;
_unitsInBoat = crew ptboat - [_leader];
_randomUnitInBoat = if (count _unitsInBoat > 0) then { selectRandom _unitsInBoat } else { objNull };

call {
  if (!isNull _scout && alive _scout && _scout in units playergroup && vehicle _scout == ptboat) exitWith { 
        ["wrongWayCoveScout", [_scout]] remoteExec [
            "FoxClub_fnc_Conversation",
            allPlayers select { _x distance _scout <= 100 }
    ]; };
  if (!isNull _leader && alive _leader && vehicle _leader == ptboat) exitWith { 
        ["wrongWayCove", [_leader]] remoteExec [
            "FoxClub_fnc_Conversation",
            allPlayers select { _x distance _leader <= 100 }
        ]; };
  if (!isNull _randomUnitInBoat && alive _randomUnitInBoat) then {
        ["wrongWayCove", [_randomUnitInBoat]] remoteExec [
            "FoxClub_fnc_Conversation",
            allPlayers select { _x distance _randomUnitInBoat <= 100 }
            ];
        };
};
granite sky
#

The unary version of call (no parameters in front) doesn't do anything except create a child scope. So even _this passes in unchanged.

#

if your conditions and payloads are that large you'd still want to write them as

if (condition) exitWith {
  // code
};
#

In some coding styles you'd write it like that regardless, but I prefer the compressed style for some things.

blissful current
#

Sounds good. As I learn I'd like to keep things the same across the board if I can

hallow mortar
blissful current
hallow mortar
#

alive objNull always returns false. It is always dead.

pallid palm
#

is always detected as being dead if you use alive on it

blissful current
#

Got it. And if it's dead then of course it returns false too

hallow mortar
#

You can also save some performance by using lazy evaluation with && (see the wiki page)

blissful current
hallow mortar
#

You have to use the second syntax specifically, using a { code } data type as the right-side argument. It doesn't do it by default.

#

e.g.

(alive someUnit) && {triggerActivated someTrigger}```
the code within the code block is not executed if `alive someUnit` returns `false`.

Meanwhile,
```sqf
(alive someUnit) && (triggerActivated someTrigger)```
both pieces of code are always executed regardless of what the first one returns.
hollow lantern
blissful current
hallow mortar
#

&& cannot have 3 conditions. It only has 2, left and right.

blissful current
#

This is three?

if (alive _scout && _scout in units playergroup && vehicle _scout == ptboat) exitWith {
hallow mortar
#

If one of those conditions happens to contain another &&, then that is that other &&'s own business.

#

Look at each of your && there. Each of them has a condition to its left and a condition to its right. Where is the third condition for either of them?

blissful current
#

I think I see what you mean. As the code is read, it can't know about whatever is in front of what it has already read? So it only knows about left and right?

hallow mortar
blissful current
#

So this is how you would do it? If the left is returned false, then I save performance otherwise, it goes to the curly braces.

if ((vehicle _scout == ptboat) && {alive _scout && _scout in units playergroup}) exitWith {
hallow mortar
#

Yes. And if you want, you can do it to the second && as well, although you're probably not saving any worthwhile amount of performance in this case.

blissful current
#

So another set of curly braces within the curly braces then?

old owl
#

Just a note but isEqualTo will support the comparison of multiple types which makes it more error redundant. Using == can be useful in cases of string comparison where you don't want to toLowerANSI for case sensitivity but otherwise recommend isEqualTo. I suppose == might also be marginally faster but FWIW 🙂

blissful current
#
if ((vehicle _scout == ptboat) && {(alive _scout) && {_scout in units playergroup}}) exitWith {
hallow mortar
# hallow mortar https://community.bistudio.com/wiki/Order_of_Precedence

Depending on how the order of precedence works out, one of the && is evaluated first (with its left and right conditions) and then its result is used as one of the conditions for the second &&. Don't be blinded by its fancy special-character-having name; it is a binary command like any other and follows the same principles. (It's also known as and)

hallow mortar
# blissful current So another set of curly braces within the curly braces then?

What the curly braces are doing is creating a Code data type. Most SQF is executed as it's read, but a Code data type allows a piece of code to be saved for later ("later" is not necessarily an appreciable amount of time). For example:

_var = name player; // _var contains the player's name
_var = {name player}; // _var contains the code "name player" and you can call it later```
blissful current
#

On the wiki you posted is 11 the highest precedence or is 1? In my mind 11 is a higher number than 1 so the 11th example has the highest precedence.

hallow mortar
#

11 is the highest precedence

blissful current
#

11 is Braced expressions. Which makes me think those evaluate first. But in my example parentheses are supposed to come first. But maybe parentheses are considered braces?

hallow mortar
old owl
#

Also since you guys were talking about lazy eval just figured I'd also add it's worthwhile being super careful that uiNamespace and profileNamespace variables are properly sanitized. Can be super easy to add an execution exploit without even meaning too. For example:

private _var = profileNamespace getVariable ["global_bool", false];
private _food = ["burger", "pizza"] select _var;

Only time I've ever accidentally added one was because of select code syntax along with me forgetting to type check a hash map I was dealing with. Luckily I caught that in a later audit for exploits but yikes haha 😅

#

Obviously tho any case where code can be ran is where an exploit could occur. Although would not be as typically in an apply, forEach or while due to their explicit code types being harder to mistake, can really happen anywhere if you don't sanitize variables properly catnod

blissful current
#

Thanks Milo, although for me this is really over my head. I'm still learning missionNamespace😄

old owl
#

Ah okay sorry about that. We all start somewhere tho and having read your comments you seem to be getting a large enough grasp of things it was easy to mistake :)

blissful current
hallow mortar
#

The purpose is to create a sub-scope so that exitWith can exit that, but not the entire script

#

If you don't plan to have any more code after this set of if cases, then you shouldn't need it, but if you do, then you do

blissful current
#

Ah so if this is the only script in the activation field I dont need call.

#

Ah perfect!

#

This might be a hard question to answer but in VScode ctrl+z doesn't do anything for me. I checked the keybinds and it's there for undo so I'm at a loss.

#

ctrl+y for redo works just fine.

blissful current
hallow mortar
#

Try the other solutions too, and also try basic troubleshooting steps like restarting your PC and unplugging/replugging your keyboard.
Beyond that, this isn't really an Arma 3 scripting issue, so I don't want to get into thorough troubleshooting here.

blissful current
#

Of course. Thank you!

blissful current
#

Is the _scout variable here neccessary? I assume selectRandom unit playergroup would never return objNull or nil right?

_scout = missionNamespace getVariable ["scout", objNull];
_randomUnitInGroup = selectRandom units playergroup;
radiant lark
#

I wanna remove unit from car on HandleDisconnect EH.

I think that this can be done only AFTER the EH return. My question is if I can execute any code after the EH that is not explicitly inside the EH. Or shall I just spawn -> sleep -> execute code?

radiant lark
stable dune
meager granite
#

_scout is neccessary if you'll use it twice, otherwise you might as well inline that getVariable

#

Sure you can also copy paste it twice or more but that's even worse

#

Its better to lay things out properly and prioritize readability in non performance critical scripts

supple condor
#

hey,

is there a possibility to return all units inside a given area?

for example i want to know at a random time, how many players are inside a specific city/base and make a decision based on those values.

i could run a distance check for each player and each location, but i feel like there is a better solution available 😅 like ask a trigger what its current _thisList is

#

read city/base as a specific, random location somewhere in a world. so i cant use those predefined towns and locations things.
each side will be mostly custom build

#

list trigger might work. will test later 😅

meager granite
#

^ inAreaArray*

buoyant cairn
#

Sup guys, does someone remember how to make a script that adds a magazine to a weapon when the last bullet is shot?

#

if im not mistaken i was using FiredMan to do it

meager granite
buoyant cairn
#

I lost the damn code when i bought a new ssd

meager granite
#
player addEventHandler ["FiredMan", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
    if(_unit == _vehicle) then {
        if(_unit ammo _muzzle == 0) then {
            _unit addMagazine _magazine;
        };
    };
}];
#

Something like this probably

buoyant cairn
#

Let me test it out

radiant lark
radiant lark
# meager granite You mean the UI?

No, I mean that whenever a player is in a vehicle and they disconnect, the unit will remain seated in the vehicle. If you execute “crew vehicle” the unit will still be there even tho the player left.
Unit will not leave the car even after returning false on HandleDisconnect

meager granite
#

Ah

radiant lark
#

And my code on HandleDisconnect to move unit out doesn’t work

meager granite
radiant lark
#

I deleteVehicle _unit too

meager granite
#

I have disabledAI=1; so I'm guessing my units just delete on exit

#

But otherwise there is nothing special

#

If you want to keep the unit, I guess you can just order them to move out?

radiant lark
#

No intentions to keep unit whatsoever

#

I’ll take a further look today

buoyant cairn
meager granite
buoyant cairn
#

kay

buoyant cairn
#

I really don't remember how it was made back in the day

meager granite
#

Any muzzle too

rapid pivot
#

Hello

#

Can I report about bugs here?

still forum
#

Not quite, but say what the bug is so we can judge

rapid pivot
#

Ok, hold on

buoyant cairn
rapid pivot
#

idk which mod cna fix it

still forum
#

Its a bug in some mod that uses CBA

rapid pivot
#

cause it*

still forum
#

it doesn't say which mod. And its not possible to tell from that message

rapid pivot
#

How can I identify which one immediately?

#

Oof

#

Is there a way in Arma 3 Launcher to see which mod uses CBA

#

so it can be easier?

still forum
#

Yes but its not that easy
That button shows you dependencies, but clicking that button for every mod will be annoying

rapid pivot
#

Oof

#

I'll come back once I'm done seeing which mod causes that

still forum
#

But not all mods list their dependencies correctly. So it might be that you won't find it

sharp grotto
#

i think add -debug parameter and you might see the full path of the script causing the error?

rapid pivot
still forum
#

You could look at the waitUntilAndExec array in debug console and see what kinda object is actually in there, maybe that might hint to who put it there

regal kraken
#

fat chance, but does anybody have the Civilian Occupation Script? (COS)
Was the only script I could really get working with Zombies and Since Ravage doesn't work with Dedicated servers any longer i'm trying to find a replacement for spawning them - cheers in advance

buoyant cairn
meager granite
#

it will add you a mag as soon as you finish one

buoyant cairn
meager granite
#

You're doing something wrong then, this code does exactly what you need

#

Well maybe it doesn't check if you have more mags before adding a new one

atomic niche
#

try dropping 1 mag first, maybe you are already at the limit?

buoyant cairn
#

I'll take a better look at it later

#

But thank you bro

meager granite
buoyant cairn
#

Still no mag was added

atomic niche
#

only 3 doesn't mean anything, you had more free space in your vest/backpack?

dire star
#

How do i make unitcap for a boat? I've tried with LCVP and when i copy movement code i just get this []. Or if there is any script that would force AI to move straight and not strafing

quaint oyster
#

Hey guys, is it possible to disable a guns sights thermal mode?

I don't want to disable it for everyone, just a few players in a pvp zone where thermals are disabled.

Tried a few google searches but the google ai slop is ruining my searches these days.

thin fox
#

and wdym by "pvp zone"? an area?

quaint oyster
#

It would 1000% be easier not giving them to the players yeah.

I have a script I tossed together to make areas pvp zones and those players in them can't interact with others outside of it. (PvE players basically), it acts on this single variable.

I managed to come up with one for helmets like the viper helmet but the optic part for guns is throwing me off.

if (player getVariable ["pvpmode", 0] isEqualto 1) then {
private _visionMode = currentVisionMode player;
if (_visionMode > 1) then {
player action ["nvGogglesOff", player];
//player action ["NightVision", player]; // Cycle to normal vision <- cannot find this on the wiki
hintSilent "Thermal imaging is off due to PvP mode!";
};
};
#

I think "action ["NightVision"" is fake also.

thin fox
#

you can just remove the item from the player when it enters the zone (save it in a variable with setVariable), and add it to the player's inventory later when he leaves the area

#

make an array with classname of the items that you don't want players to have in that zones

#

and make a script to check the player's loadout once enters the zone

split ruin
#

how to prevent game from pausing in SP when I tab out ? (I am on linux I don't have the launcher)

#

makes testing very tedious 😔

granite sky
#

oh maybe VisionModeChanged EH instead.

#

I don't think you can block it entirely with script though. There's an action for vehicles IIRC.

hallow mortar
#

For vehicles you can use disableTIEquipment, but I don't believe it affects handheld weapon optics

granite sky
#

Another approach would be to add non-TI versions of the TI optics in config and swap them over.

rapid pivot
#

It was dzn Extended Jamming

quaint oyster
#

Ty fellas, @granite sky, @hallow mortar, @thin fox, I'll try to check out these options when I return home.

I was considering seeing if removing the players current optic and adding it back instantly if they're aiming and the thing is in thermal but not sure how viable it is, I'll see when I return home to the scripts.

If you guys can think of any alternatives between them I'm open to other ideas too.

rapid pivot
#

Thank you @stable dune , @still forum , @radiant lark for helping me

#

I'll finally be able to play arma 3 without pop - up in my way

#

Thanks for everything!

radiant lark
#

Oh 😅

#

You could have disabled show script errors in the first place

rapid pivot
radiant lark
#

Oh then yeah, the pain was inevitable

real tartan
#

does marker overlaping mission position in BIS_fnc_strategicMapOpen preventing to selecting said mission ?
e.g. if on mission position is placed marker, I cannot select mission. is it a bug or did anybody had same problem ?

blissful current
agile pumice
split ruin
#

I have the brilliant idea to make a heli (littlebird or AH-64D) support vehicles convoy, what is the best option? SAD waypoint loop on one of the vehicles? 🤔

coarse sedge
#
cia_heli setHit ["tail_rotor_static", 1, true, objNull, objNull, true];```

could anyone assist me with what could be going on here and why my setHit code appears to do nothing? It does seem to deal damage properly, but that final parameter with 'true' **should** theoretically blow off the rail rotor and play the proper sound effect, but it does not. Am I forgetting anything here? would appreciate any help 🙂
#

swappingg to setHitPointDamage doesn't seem to do anything either, doesn't even Red Out the rotor itself:

cia_heli setHitPointDamage ["tail_rotor_hit", 1, true, objNull, objNull, true];
cia_heli setHitPointDamage ["tail_rotor_static", 1, true, objNull, objNull, true];
meager granite
meager granite
#

HitHRotor - main rotor, HitVRotor, back rotor

coarse sedge
meager granite
#

HitHRotor and HitVRotor should be the same between all helis

#

for setHitPointDamage

coarse sedge
#

so I would go off the class name as opposed to the actual Name field?

meager granite
#

"tail_rotor_hit" should've worked with setHit

coarse sedge
#

ahhh - I understand

#

ok let me give it a shot, thanks!

coarse sedge
dire island
#

I am running the following from debug console:

5 fadeMusic 0;```
which should result in the music fading to 0 volume over five seconds. The music plays without issue, but it never fades out. ``hint str musicVolume;`` returns 0. ``playMusic "";`` stops the music, but I want it to fade out. Anyone got any ideas?
dire island
#

yes

fair drum
#

Ace

tulip ridge
#

Should just be doing ace_hearing_disableVolumeUpdate = true before the fade music, and then set it to true 5 seconds after iirc

#
ace_hearing_disableVolumeUpdate = true;
5 fadeMusic 0;
[{
    ace_hearing_disableVolumeUpdate = false;
}, nil, 5] call CBA_fnc_waitAndExecute;
hollow lantern
#

how exactly can I access and pass a variable to a firedEH? Tried different methods, none of them seem to work. I need to pass two variables to the EH.
Unfinished code:

[_vls, ["Fired", {
params ["", "", "", "", "", "", "_projectile"];
 (_this select 8) params ["_targetToDelete", "_mcount"];

    [_projectile, _targetToDelete] spawn 
    {
        waitUntil {
            private _isAlive = alive (_this select 0);
            !_isAlive
        };
        detach (_this select 1);
        deleteVehicle (_this select 1);
    };
}]] remoteExecCall ["addEventHandler", 0, _vls];```
hollow lantern
#

well not quite, my goal is to delete the laserTarget after the missile impacted

fair drum
#

This is just to show the set variable on the missile around line 152

#

I use a frame system for my missile collision detection.

thin fox
#

setVariable save lives

fair drum
#

But you can replicate if not frame sensitive like you are doing. Just pass around variables in the missile's namespace.

hollow lantern
#

well my object I want to delete already has a global mission namespace, only thing I then have to setVariable is the _mcount variable that is a integer

#

or the variable set with setVariable is different than setVehicleVarName

#

after reading the wiki I guess it is different

fair drum
#

Vehicle var name is just the string representation of the variable name. It isn't used much at all.

#

Each object has its own namespace you can use via set/getvariable

hollow lantern
#

yeah and my understanding of it seems odd. So jsut for clarity:
I set a variable on lets say object A with name A1. Can this variable then hold information about an object?

Meaning I can call getVariable A1 and can extract the object reference out of to delete it?
Or does this work differently

fair drum
#

Say I have an object _toilet

I can set variables like

_toilet setVariable ["waterLevel", 10]

And grab it by

_toilet getVariable "waterLevel"

thin fox
#

for "safety", leave a default value in getVariable as well

hollow lantern
#

yes but how does the EH knows about _toilet? If I get it right then I can only assign it to lets say the projectile? But how can I access the projectile before it has been fired?

#

because the projectile is only present when the weapon fires and then I require some variables from the outside

hallow mortar
#

set the variables on something you will have a reference to inside the EH - like the vehicle that is firing, for example

hollow lantern
#

ah, that would work

thin fox
#

yes that works

hallow mortar
#

e.g.

_vehicle setVariable ["myTargetObject", _target];
_vehicle addEventHandler ["fired", {
  params ["_unit", ...];
  private _target = _unit getVariable ["myTargetObject", objNull];
}];```
hollow lantern
#

if the script runs again (as it can with another target but still same ship) could there be a possibility that the getVariable receives a different target than intended and how would I avoid this? My guess is that the script runs trough so quickly that it shouldn't happen

thin fox
blissful current
#

I've been putting this as a safety measure in a condition, but then I started thinking: is it really necessary? My mission only has one group that the players could be in. If a player dies, does that mean they are no longer part of the group? There is a part later in the mission where an AI can join the players. I think I used join group or something like that. But that doesn't create a new group for the player right?

_scout in units playergroup
hollow lantern
foggy pike
#

You have this [bin\config.bin/CfgVehicles/B_MRAP_01_F] inside your array which is not in quotes so it would break on the slashes and also won't be able to find the variable it thinks is there

fallow pawn
#

Hello!
So cameraView outputs "GUNNER" when I'm ADSing, not "INTERNAL" or "EXTERNAL" as I expected.
Is there any way I can know I'm in 1st person (or 3rd for that matter) while I'm ADSing?

warm hedge
#

For what purpose, is one question

#

And no, "GUNNER" is expected result

drifting spire
#

Does anyone have/maintain a list of the old scripts lost to time with the closure of armaholic and bohemia forums?
I know about scripts like 1ncon undercover and Don's infantry recruitment, but I can't browse through random scripts anymore because the sources of those scripts are mostly dead.

ivory lake
foggy pike
#

In his code he's getting the value from the config, which would return a string

agile pumice
#

okay, well the same goes for the example from the wiki

#

the config path is in an array there too

#

so my conclusion the format would be str, arr, str, arr

foggy pike
#

Seems like an error on their end. There's no way the parser can understand that value

#

Does it post any errors?

#

Try just wrapping it in quotes and see if it works. Also see if it logs anything to the rpt

indigo snow
#

the config type is a little tricky

#

A = [configFile];

#

A is now [bin\config.bin]

#

the wiki example is most likely a return that has been parsed in the wrong way

#

ex. config.bin/CfgVehicles/C_Offroad_01_F would be configFile >> "cfgVehicles" >> "C_Offroad_01_F"

foggy pike
#

Is there such a thing as a group namespace?

indigo snow
#

the group itself is a namepsace if you use setVariable

foggy pike
#

Ah okay thanks

agile pumice
#

thanks cptnick, i didnt get a chance to read your reply before I came up with the solution haha: _airArray set [count _airArray, [( configFile >> 'cfgVehicles' >> (getText (_x >> "vehicleClass")) )]];

indigo snow
#

dont set count

#

use pushback

#

_airArray pushBack [( configFile >> 'cfgVehicles' >> (getText (_x >> "vehicleClass")) )]];

agile pumice
#

No problems opening the menu, but I just see a bunch of "Car" in the list

#

think I know why though

indigo snow
#

What class do you want to grab?

#

Just configFile >> "cfgVehicles" >> _x would suffice to grab the path to the vehicle config

agile pumice
#

resolved it

#

configFile >> 'cfgVehicles' >> configName _x was what I needed

indigo snow
#

right forgot about configName, sorry

exotic gyro
#

Is it possible to block zoomTemp? I'm using

player addAction [
"",
{
true
},
[],
1.5,
false,
true,
"zoomTemp"
]

to test and it doesn't work for that. It does work for defaultAction to block shooting, though.

agile pumice
#

no worries*

tulip ridge
#

Adding on to it since we've both tried blocking stuff
I think DefaultAction is the only one that can be blocked with addAction. addUserActionEventHandler is how I thought other actions were blocked, but that didn't seem to work either

exotic gyro
#

yeah

agile pumice
#

I can solve things myself 😃 I just like to discuss the issue while i figure it out haha

exotic gyro
#

the EH does fire though

agile pumice
#

But all seems to be working now

#

Do you know of a way to change the camera distance when the garage inits?

meager granite
#

@still forum How does setObjectTextureGlobal and setObjectMaterialGlobal work with uniforms on players? It seems to remember which uniform it was assigned to exactly even if you drop it and pick it up again! Also works properly with JIP it seems. Its not documented but I just tried to find a flaw and apparently there is none, it works properly in seemingly all cases! When was this added, what are these textures and materials tied to if weapons/mags/items are not real network entities?

still forum
#

KK did that recently

#

A uniform also remembers its contents when you drop it and pick it up again. I'd assume material is stored same way

meager granite
#

I remember it being extremely unreliable so I simply did my own algorithms with local sets, but now it suddently works perfectly

still forum
#

Weapons/mags/items are not.
But inventory containers are

meager granite
#

Was there a change log about it, did I miss it?

still forum
#

Should've been, half a year ago?

meager granite
#

I'm in awe tbh

still forum
#

uniform textured with setObjectTexture/Global will now show custom texture in weaponholder came in december
And yeah its stored in the inventory container

meager granite
#

👏

meager granite
#

If only we could recolor vests in the same way 🙏

#

They have a container too

#

I'd also wish for hat and goggles but that's stretching it

radiant lark
#

Now that we are talking about global and everything, can I create a local entity (vehicle or object) and do setObjectTextureGlobal to it? I guess only bad outcome will happen from doing this, which makes me think that global effect commands applied to local entities is the root cause of the lag that hackers manage to cause on my server

radiant lark
meager granite
radiant lark
#
Server: Object 12:15010 not found (message Type_128)
Server: Object 12:15011 not found (message Type_134)
Server: Object 12:15012 not found (message Type_128)
Server: Object 12:15013 not found (message Type_134)```

😅
meager granite
#

Two types here, could be something else

#

But yeah, similar RPT spam

radiant lark
#

I couldn't wrap my head around it at the beggining

meager granite
#

Are these really global textures/materials on local entity errors?

radiant lark
#

Any way to clear the JIP Queue?
I know remoteExec["", "id"] will do it, but idk how to get all the IDs, exportJIPMessages will do the job but it will export to a file, so not quite accesible from SQF afaik

#

Only option left might be to make an extension

meager granite
#

Just tried setObjectTextureGlobal on a local entity, no errors on client (another one)

radiant lark
#

What about server

meager granite
#

Not error after rejoin (JIP)

#

Tested with listen server though

radiant lark
#

Damn

#

Must be a command somewhere

meager granite
#

No error either direction

#

Maybe ded can hint what these types 128 and 134 are

radiant lark
meager granite
#

Guessing formation/group bullshit

radiant lark
#

Btw does Arma have its own Usermode anti cheat to prevent known blatant exploits?

fair drum
#

It's called good moderation

radiant lark
#

👍

dusk gust
radiant lark
#

Hmmm

#

Alright will take a look

still forum
radiant lark
#

That's the only logs I get from whatever the dude is doing

radiant lark
still forum
#

But lags are not a crash

radiant lark
#

Yeah, I get that in technical terms a lag is a lot different than a crash, and a crash might raise some awareness because an arma 3 server should never crash

#

But in terms of the outcome for players, it's basically a crash

#

Literally unplayable

still forum
#

Well it's easy to troubleshoot cause of a lag spike

radiant lark
#

Oh, really?

#

All the info I know is just the rpt lol

#

Idk abot the script making those rpt messages

tulip ridge
still forum
radiant lark
meager granite
#

@still forum Now that we have procedural textures, how about procedural materials? hmmyes

still forum
#

Different thing sir

still forum
#

Also what do you mean by now. That's a Arma 2 or older feature

meager granite
#
"mycoolmaterial" createMaterial createHashMapFromArray [
     ["shader", "Super"]
    ,["diffuse", [1,1,1,1]]
    ,["stage1", ...]
    ,...
];
player setObjectMaterial [0, "mycoolmaterial"];
#

something like this

#

Maybe with # prefix so quickly figure out its not a file

#

Tbh biggest feature would be allowing rvmats to use mission textures, its impossible right now without hackery

meager granite
#

Being able to script define/change materials would've been another leap forward for possibilities

still forum
#

Maybe

#

Not planned

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
regal kraken
#

Trying to make it so infantry spawn at a parker depending on variable number
however i cant seem to get the marker location to change at all

if (_where == 1) then {_ai_location = "base_spawn_ai_2"} else {_ai_location = "base_spawn_ai"};
_group1 = [getMarkerPos _ai_location, WEST,["rhsusf_usmc_marpat_d_teamleader"]] call BIS_fnc_spawnGroup;```

am i doing a dumb dumb?
faint burrow
#

_ai_location is undefined outside if,

regal kraken
#

oh

#

my

#

god

#

Cheers again Schatten

faint burrow
#
_ai_location = if (_where == 1) then { "base_spawn_ai_2" } else { "base_spawn_ai" };

or

_ai_location = ["base_spawn_ai", "base_spawn_ai_2"] select (_where == 1);
regal kraken
#

oh that looks great that way, didnt know you could do _variable = if (condition)

faint burrow
regal kraken
#

i think i've been that focus'd on trying to get it working i've became totally tunnel vision'd

thin fox
#

it happens

#

last day I had a stroke and forgot how forEach works

fallow pawn
# warm hedge For what purpose, is one question

I'm trying to save a player's view mode at the time of incapacitation to restore it when player is healed by a friendly medic. This is needed because I force 3rd person view during the incapacitation period.
But if the player is ADSing at the moment of his incapacitation I'm having difficulties knowing whether he's using 1st person or 3rd person, mainly if the ADS is happening in vehicle/static turrets.
At least on foot I can have a waitUntil and wait for cameraView to show my intended result, but while using turrets and vehicle guns this workaround is useless.

radiant lark
#

So sad it seems like I cannot get a player's custom face and do setFace to everybody to make them have that same face

oblique arrow
#

Hi peeps I need some thought power.
Is there a simple way to replace 'true' with alive' in a formatted text?
Currently working on a small reinsert tool and I'm building a vehicle status overview to show if vehicles are alive/dead, something like this:

#

Now as you can see using 'alive vehicleVarName' returns true of course, is there an easy way to replace that with alive? same goes for false/dead

#

Code:

_hintText = composeText 
[
    "Pie Simple Reinsert", lineBreak, "Vehicle Status Overview", lineBreak, 
    format["%1 is %2",PIESimpResp_RespVic_MRAP1 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_MRAP1], lineBreak, 
    format["%1 is %2",PIESimpResp_RespVic_MRAP2 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_MRAP2], lineBreak,
    format["%1 is %2",PIESimpResp_RespVic_MRAP3 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_MRAP3], lineBreak, 

    format["%1 is %2",PIESimpResp_RespVic_Transport1 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Transport1], lineBreak, 
    format["%1 is %2",PIESimpResp_RespVic_Transport2 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Transport2], lineBreak,
    format["%1 is %2",PIESimpResp_RespVic_Transport3 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Transport3], lineBreak,

    format["%1 is %2",PIESimpResp_RespVic_Helo1 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Helo1], lineBreak,

    format["%1 is %2",PIESimpResp_RespVic_Tank1 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Tank1], lineBreak,

    format["%1 is %2",PIESimpResp_RespVic_Backup1 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Backup1], lineBreak,
    format["%1 is %2",PIESimpResp_RespVic_Backup2 getVariable "PIESimpResp_RespVic_VicName", alive PIESimpResp_RespVic_Backup2], lineBreak
];
hintSilent _hintText;
#

already tried regexReplace but that only takes strings not text

tulip ridge
#
private _aliveDeadText = ["dead", "alive"];
format ["%1 is %2", player, _aliveDeadText select (alive player)];
#

Alternatively, do a regex replace and then convert to text after

#

I'd do the second personally, just didn't want to write it on mobile

winter rose
tulip ridge
#

Sounds like it has some loadout randomization script running on init

radiant lark
tulip ridge
#

Could try setting the loadout on the frame after spawning the unit

tulip ridge
radiant lark
#

Ugh, sure

radiant lark
tulip ridge
#

I don't know what you mean by "executed on local", like the uniform is correct when running the script local to the player on a server?

radiant lark
#

you just take the debug console

#

local execution will copy uniform

#

server execution will copy but instantly replace it

radiant lark
#

Shit okay I am dumb, nevermind

tulip ridge
#

What was the issue?

radiant lark
#

Nah it was definitely some code i've never seen before on server side

fallow pawn
tulip ridge
#

Yep that was said
You'd also want to save the array to a variable because they use it multiple times, that way it's only created once

fiery knoll
#

what script that making plane carpet bombing?

fiery knoll
#

what commands show class name bomb in debug console?

warm hedge
#

What is class name bomb

fiery knoll
#

the name of Bomb in the plane

arctic bridge
#

Quick question regarding post process effects - how does it determine which client to execute on? E.g. if I ran ppEffectEnable on the server it would run only on the server itself?
So I'd need to do something like remoteExec on x client?

fair drum
#

All the post process effects are on the local client that the commands are executed.

#

Make a function as if it was run locally, do all your commands there. Then, remote execute that function to the clients.

arctic bridge
#

Ty

#

Oh and one more thing, how is hasInterface handled? Also need to be run client side?

fair drum
#

It can be run anywhere. Dedi will be false, listen will be true, player client will be true, headless will be false

#

You use it for filtering out who you want to run things

arctic bridge
#

Mm, but say I want to check x client, I can't specify which client I want to check in the command itself, so to check a given client I'd have to run it on that client no?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
tender sable
arctic bridge
tame mica
#

Does anybody happen to know how to use like Cinematic Black Bars during a mission? Like a trigger or something? I want to get into more complex things and make my mission feel alive for players. Mainly for A3 Eden Editing?

warm hedge
warm hedge
tame mica
#

What about for whenever they’re ingame? You know, where the players would be able to move during the cinematic borders

warm hedge
#

You can have some your own script. Maybe I'll write one based on that fnc

valid abyss
#

is it possible to stop a unit that is doing a scripted move? I cant find anything on the wiki page for BIS_fnc_scriptedMove

stable dune
drifting spire
#

Is there a function somewhere that opens the Vehicle Customizer screen for a vehicle that's already spawned in game?

valid abyss
stable dune
agile pumice
#

So I have this in the initialization line of my zeus module, but nothing's added to the left side list when I open zeus: {this addCuratorEditableObjects [[_x],true]} forEach (allMissionObjects "");

#

tried allMissionObjects "All" as wel, nothing

native hemlock
#

Is that line being run by the server?

indigo snow
#

It's in the init line so presumably all connected clients + server

agile pumice
#

just running in the editor

blissful current
#

What would it take to get these characters to show correctly in game?
Địt mẹ! Họ thấy rồi

indigo snow
#

As an aside why loop this when the command takes an array

agile pumice
#

thats just how I seen the example

native hemlock
#

Well that could be the issue, it takes an array and you are passing object

indigo snow
#

this addCEObjects [allMissionObjects "all",true]

#

Nah hes not hes adding an array containing a single object

native hemlock
#

Oh you're right, it's an array for each of the mission objects -_-

hallow mortar
#

If the characters don't exist in the font used by the chat display, there might not be anything you can do

blissful current
# winter rose how do you use them?

I was just trying to use Vietnamese for my Vietnam mission. It's not a big deal. I can still have a voice actor speak Vietnamese and write the subtitle in English.

winter rose
blissful current
agile pumice
#

addCEObjects?

#

cant find that anywhere

blissful current
tender fossil
blissful current
native hemlock
#

I'm guessing he was just abbreviating

agile pumice
#

figured when i couldnt stick it in haha

faint burrow
#

According to v2.18 changelog:

Tweaked: Improved allPlayers script command on servers

agile pumice
#

i wasnt ruling out a command I hadnt seen yet haha

#

there we go

indigo snow
#

Yea am on mobile sorry

#

Figured it was a trivial one

agile pumice
#

Well its working for allMissionobjects, but not allMapMarkers

#

"Error position: <addCuratorEditableObjects [allMapMarkers>
18:53:13 Error Type String, expected Object" why is allMapMarkers a string?

winter rose
fallow pawn
hallow mortar
# blissful current The line is stored in `init.sqf` and is retrieved with a function. I'm afraid I ...

A stringtable is a table...of strings...which the game looks things up in to replace placeholder text. It can contain several possible values for each key, and choose from them based on the selected language.
https://community.bistudio.com/wiki/Stringtable.xml
UTF-8 is a text file encoding type. It is essentially the default standard for text encoding, and has full support for all Unicode characters. Most text editors should work in UTF-8 by default, but it is possible to select other things which don't have full Unicode support or which can't be read properly by the game.
https://en.wikipedia.org/wiki/UTF-8

indigo snow
#

Map markers are strings

agile pumice
#

okay, well then how can I add the markers to the zeus marker list?

#

I know markers individually are strings, but I figured I could throw the allmapmarkers in as an array just like allMissionObjects "all"

indigo snow
#

But allmapmarkers returns markers

#

Which are strings

#

You cant just throw a command in because it isnsyntactically similar to another one

#

But more on topic, i dont knownof a way to add existing markers to a curator

agile pumice
#

I just seen array as an input type on the wiki and figured it would take both XD

#

There's a markers section under the EDIT list for zeus, so I dont think it was too far fetched to think I could add markers in with that function >.<

indigo snow
#

Always be suspicious if the input type is array

#

Dive into the curator functions

#

See how they natively handle markers

radiant lark
#

Where can I get started with simpleVM? It seems to lack docs

granite sky
agile pumice
#

Does anyone save missions with MCC?

mellow scroll
#

Riddle me this - - - if my squad is halted via a vanilla "stop" command by the player - how can my script get a single unit back up and moving again? enableAI "MOVE"; doMove; doFollow; have all been tried.

hushed turtle
# mellow scroll Riddle me this - - - if my squad is halted via a vanilla "stop" command by the p...

Leopard20 - c
doFollow doesn't work with player-issued commands (those issued via the commanding menus). As a workaround, it is possible to use joinSilent instead, and join the unit into its current group:
[_unit] joinSilent group _unit; // return to formation
Note that the group must have at least 2 units, and not all units should be joined at once, otherwise the group will temporarily become empty and all its waypoints will be lost!
https://community.bistudio.com/wiki/doFollow

mellow scroll
#

@hushed turtle - thanks - let me look into that - much appreciated.

abstract bay
#

I have a script in which the crew assembles and disassembles static weapon depending on whether an enemy is nearby, but that's not the point, as soon as I install my script in the init of group, the mission doesn't open, i.e. the loading screen freezes. I tested it in the editor and it works normally. I'm playing in a singleplayer mission with a dedicated server. My script:

    params ["_unit"];
    private _group = _unit;
    private _pos = getPos leader _group;
    private _randomDir = random 360;

    while {true} do {
        if ({alive _x} count units _group == 0) exitWith {};

        private _groupPos = getPos leader _group;
        private _enemies = allUnits select {
            side _x != side _group && {alive _x && _x distance _groupPos < 350}
        };
        private _friendlies = units _group select {alive _x};

        private _wp1 = _group addWaypoint [_groupPos getPos [20, _randomDir], 30];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointStatements ["true", "
 group this allowFleeing 0.5;
 [group this, 'StaticWeaponUnpacked', {
  _this spawn
  {
   sleep 30;
   [_this select 0] call BIS_fnc_packStaticWeapon;
  };
 }] call BIS_fnc_addScriptedEventHandler;
 [
  this,
  this,
  this getPos [1000, random [0, 45, 315]],
  this getPos [30, 0]
 ] call BIS_fnc_unpackStaticWeapon;
"];


        };

        sleep 5;  
};```
hallow mortar
# blissful current

Notepad and Notepad++ are different.
In Notepad++, you can see the current encoding type in the bottom right status bar, or change it from the Encoding menu in the top toolbar.

#

Text encoding types and file formats aren't the same thing.

blissful current
#

Ah, in that case it says "UTF-8".

#

But I am using VScode. Is that just modifying the notepad file or is it, it's own thing?

hallow mortar
blissful current
#

Yes there are files that I created in VScode. And the notepad file has my up to date code. Interesting. I thought VScode was it's own file type or something.

#

I guess the important thing is Arma sees the .sqf extension.

radiant lark
#

I am making this thing where I setVariable to myself, but for the sake of performance I broadcast the variable to players close to me.
For this, setVariable will take an array of netIds, the deal is that my code is client sided, so I do not know how to get the players netids from client

hallow mortar
#

You can just use the player objects, you don't need to find their netIDs

radiant lark
#

I tried and it didn't work, I must've coded something wrong then 😅

#

Nah it most definitely doesn't work with the player objects

#
_broadcastTo = nearestObjects[cameraOn, ["CAManBase"], 10];
player setVariable ["SP_69", true, _broadcastTo];
//_broadcastTo = [civ_2]
//player getVariable "SP_69" = false```
hallow mortar
#

Oh, I confused it with remoteExec which does use objects. Kind of weird that they don't both use the same system.

radiant lark
#

Indeed

#

I also thought of it at first

hallow mortar
#

Other than that, you can't get other machines' network IDs on a client. You could have a server function which accepts the player objects and then gets their network IDs with owner.

thin fox
#

is just a bool?

radiant lark
#

yes it's just a bool

hallow mortar
radiant lark
thin fox
radiant lark
hallow mortar
#

It's possible/probable that the complicated workaround for network IDs will end up costing more performance than just doing it the easy way

thin fox
radiant lark
#

Gotcha, ty guys

rich bramble
#

Ok, so I'm trying to take the bobcat's gun away and so far hideTurret has worked great to make the model disappear. Now I'd ideally like to retain the 'seat' while removing the ability to operate the (now invislbe) gun. Any ideas?

blissful current
#

How can I make this condition if I can't write code in the condition spot? The wiki says that only a string can go there.

[
    ptboat,
    "<t color='#FFFF00'>Place C-4 Plastic Explosive: 15 Minutes</t>",
    "a3\ui_f_oldman\data\igui\cfg\holdactions\destroy_ca.paa", //idle icon 
    "a3\ui_f_oldman\data\igui\cfg\holdactions\destroy_ca.paa", //progress icon
    "(missionNamespace getVariable ['ActionSTABTimeBombs', false]) && (vehicle _caller != ptboat)" // condition
    "true", //condition progress
    {
        params ["_target", "_caller", "_actionID", "_args"];
        ["bomb45", [_caller]] remoteExec ["FoxClub_fnc_Conversation"];
    }, //code on start
    {}, // code every tick
    {
        missionNamespace setVariable ["ActionSTABTimeBombs", false, true];
        playSound3D [getMissionPath "sound\PlaceBomb.ogg", getPosASL ptboat, false, ptboat, 3];
        ["scripts\bomb.sqf"] remoteExec ["execVM", 2];
    }, // code on finish
    {}, // code on interuption
    [], //arguements
    3, //duration
    8, //order from top
    false, //remove on finish
    false, //show if unconcious
    false //show in middle of screen
] call BIS_fnc_holdActionAdd;
warm fern
#

U should write condition as a string, not as a code. And u shouldn't use private vars.

thin fox
blissful current
#

I'm not sure how to do what you all are saying? Is this what is meant?

_string = (missionNamespace getVariable ['ActionSTABTimeBombs', false]) && (vehicle _caller != ptboat)
"_string" // condition
thin fox
warm fern
#

@thin fox means to use

private _code = {
  // ur condition
};
toString _code; // condition
blissful current
thin fox
#

yeah I'm on mobile so I can't provide you with an example sry

blissful current
#

No worries! I'll mess around with it. I'm unclear where to put the private part and also would it be okay to put _caller in there too.

thin fox
warm fern
#

in your case in can look like this:

private _condition = {
    (missionNamespace getVariable ['ActionSTABTimeBombs', false]) && (vehicle _this != ptboat)
};

[
    ptboat,
    "<t color='#FFFF00'>Place C-4 Plastic Explosive: 15 Minutes</t>",
    "a3\ui_f_oldman\data\igui\cfg\holdactions\destroy_ca.paa", //idle icon 
    "a3\ui_f_oldman\data\igui\cfg\holdactions\destroy_ca.paa", //progress icon
    toString _condition, // condition
    "true", //condition progress
    {
        params ["_target", "_caller", "_actionID", "_args"];
        ["bomb45", [_caller]] remoteExec ["FoxClub_fnc_Conversation"];
    }, //code on start
    {}, // code every tick
    {
        missionNamespace setVariable ["ActionSTABTimeBombs", false, true];
        playSound3D [getMissionPath "sound\PlaceBomb.ogg", getPosASL ptboat, false, ptboat, 3];
        ["scripts\bomb.sqf"] remoteExec ["execVM", 2];
    }, // code on finish
    {}, // code on interuption
    [], //arguements
    3, //duration
    8, //order from top
    false, //remove on finish
    false, //show if unconcious
    false //show in middle of screen
] call BIS_fnc_holdActionAdd;
#

but in my opinion it's simpler to use string condition

blissful current
#

What is string condition?

blissful current
blissful current
warm fern
#

so u should use _this instead of _caller

blissful current
#

Ah that's probably why its not showing up in the action menu. Ima adjust that now.

blissful current
warm fern
#

i think it should work

blissful current
#

Yeah, it did. So cool! Thank you all! This opens up many more possibilities for conditions for me!

radiant lark
#

Is there any func to check if player is speaking?
I've also thought about checking if the player's mouth is moving, if it is, then player is talking. Is this possible to check using sqf or is it too much to ask for?

warm fern
radiant lark
#

yeah I mean VON, arma 3 doesn't have the command but it does have that sort of functionality added. Because players move their mouth when they talk

#

if I could check the animation state of the mouth, that would make me an easy isSpeaking command

blissful current
#

The TFAR mod has an option to let AI know if players are speaking near it. Maybe you ask what they did?

warm fern
#

tfar has tf_isSpeaking var on player

hallow mortar
radiant lark
#

This works, thanks

broken pivot
#

Hey there 😄
Ive got a problem that my publicVar dont work like expected.

You can see my math. I simply try to add +1 to the existing value "EBER_AA_COUNT".
It does work in editor. But dont work on the server.

Do I have to localize my execVM via remoteExec to global so my publicVariable "EBER_AA_COUNT" can be changed from another script?

warm hedge
#

How do you run this code. How do you check it doesn't work on the server

granite sky
#

Each machine has its own value of each variable.

#

publicVariable "varname" publishes the local value of that variable to every machine at the point when it's called.

#

Every time you change the value, you have to publish it again if you want other machines to have the same value.

broken pivot
broken pivot
#

Ill show you - 1sec. Im still here

open star
#

@rich bramble In a real quick test I was able to physically remove the turret from the bobcat with bobcat animate ["HideTurret",1], and then remove the weapon with bobcat removeweapon "LMG_RCWS"

broken pivot
#

Im on it

#

There it is. (available in one sec)

#

I realize it got no sound. Lovely

open star
#

'bobcat' being what I named the bobcat

broken pivot
#

But you can see how things are done.
So I just would have to insert a publicVariable again in the script in the moment the value had changed?

broken pivot
warm hedge
broken pivot
#

Ive published it once by its creation.
If Im "up" again Ill try to also publish it after any changements.
So in the document with +1 as well

Because I hadnt know that Ill have to publish the changed version as well.
The more I think about the more self understanding it becomes haha

warm hedge
#

publicVariable will transmit the variable and its content once when it is executed. It is not going to automatically updated once the variable is updated in your local computer, if this is the question

broken pivot
#

Now Im confused again because both scripts run on the same server via execVM. (We also use headlessclients)
But there need to be a chance to loose the var in this system. Because the enviroment is the only diffrence

warm hedge
#

Why you run this script twice on different computer when the concept of the script is about to transmit one variable?

broken pivot
#

knowledge gap and I generate wich AA will spawn at first and then do the details in a second script

warm hedge
#

No. That's not what I ask, I ask why you run the same script on two different computeres, which means, it runs twice

broken pivot
#

ouuu now Ive got

#

I never wanted to do. I tested in the Editor without headless clients and when I decided to test on our server it spawned the AA 900 times because the add to the total amount wont happen

warm hedge
#

Okay, I'll try not to figure out your intention

broken pivot
#

(I dont know how to get headless clients in editor to simulate the enviroment of our server)

warm hedge
#

I'm saying because publicVariable will transfer the variable to everyone, using the local variable, regardless it is run on your client computer or your server

#

If you server runs it, it transfers the variable that is stored in the server locally, if client runs, it transfers the variable that is stored in the local computer

#

This is the concept

#

You are running the same code in two different clients, is one possible issue

broken pivot
#

Since Ive started with programming/ scripting the localization is a hard thing.

At first to understand (I would say I did)
At second the usage (Thats my current state)

And people like you help a lot to understand and get clearance about the ongoings
Meanwhile I do lough about people who cry about the "bugged Arma" because Ive understood where most of the issues are created...
A real honest and big thanks to you <3

its half passed 7am in germany, I havent slept. Today is GameDay. Im the host...
Ill do the script manually for this week and will attend your tips after I got the chance
Because now I need a break and sleep

torn jungle
#

Anyone familiar with ACE? Any way to disable ACE medical for a mission (for that mission only, i dont want to delete the pbo from the server), so that i can use FAK revive instead just for that mission. Cant seem to find it in the modules.

signal drum
#

Does anybody have experience with Arma 3 sector modules? I want to change the capture time of a sector that I dynamically created through code, however I can't get it to work. This is my current code (the cost does not apply):

private _sector = _group createUnit ["ModuleSector_F", _safehousePosition, [], 0, "CAN_COLLIDE"];

_sector setVariable ["sides", [west], true];
_sector setVariable ["name", "Safehouse", true];
_sector setVariable ["designation", str _wave, true];

[_sector] call BIS_fnc_moduleSector;


private _area = createTrigger ["EmptyDetector", _safehousePosition];
_area setTriggerArea [10, 10, 0, false];
_area setTriggerActivation ["ANY", "PRESENT", false];
_sector setVariable ["areas", [_area], true];

missionNamespace setVariable ["sector", _sector];

sleep 1;
[_sector, EAST] call BIS_fnc_moduleSector;```

This is what I found in the docs: https://community.bistudio.com/wiki/Arma_3:_Module:_Sector
warm hedge
#

Post the entire code

austere granite
#

I don't think you can disable it entirely, however just disabling revive might work which should be possible

broken pivot
#

Im back.
Slept 1-2 hours.
Got lvl. 1.000 on motivation

Im that <----> close to finally succeed

signal drum
#

Also very weird that I had to sleep 1 before assigning the sector to EAST

#

I assume it was a race condition somewhere

#

The sector works, but the capture time does not change