#arma3_scripting

1 messages Β· Page 77 of 1

torn hemlock
#

What thing are you trying to attach?

molten yacht
#

Question

#

is there a way to force everyone's characters to override their existing identities - in this case, assigned randomly by the mission - and load the face they have in their profile instead

warm hedge
#

setFace command does

spice kayak
#

just a trigger to a marker.

#

Well, that's what I was hoping for anyway.

molten yacht
#

Right, but how would I get the face from their profile

#
{ _x setFace ?Profile.MyFace? } forEach units player;```
#

or thereabouts, there's an easy way to get just the players out of the units list, I know

fair drum
#

you grab the face at the start before changing their faces in the mission the first time with face

#

1.) Grab faces
2.) Assign randomly by mission
3.) Re assign saved face that was initially loaded by the profile

torn hemlock
#

Well, you can just set position for your trigger to a marker position

#

_trigger setPos (getMarketPos "Extraction_1");

spice kayak
#

Ah, alright. I swear I tried using setpos getpos, but went away from that for a reason. Not sure why though.

molten yacht
#

Is there a different way to do this?

#

Rather, is there no way to grab the face out of the profile, server-side?

torn hemlock
#

And of course now you dont need to compile your string, because getMarkerPos accepts marker names in string.

opal zephyr
#

It doesn't look like it, the closest thing is this command: getUserInfo but it doesn't get face info. The way Hypoxic suggested seems to be the only way, unless you store it in the profile namespace of the player, but that seems redundant

spice kayak
#

Ugh, I feel like a damn idiot now. I'm not sure why I went down the attachTo route. I even knew setpos getpos was a thing I could use.

#

Thanks, man. Sorry for all the annoyance haha.

molten yacht
#

So, to be blunt, my friends are having fun playing Vindicta

#

but they want their custom faces and the mission keeps setting it back to Generic Random Face

#

it sucks that there's not a way to grab the face from the profile but meh, what can you do

meager granite
#

Change mission behaviour to stop assigning scripted faces perhaps?

#

Ctrl+F setFace and see which function does it

#

See if there is a way to stop it, otherwise overwrite it somehow

molten yacht
winter rose
#

but in MP, this is the default behaviour!
so either there is a script that replaces the default custom face with another one, or eventually the used soldier models have a static (non-random) face that cannot be changed

molten yacht
#

Who knows what Vindicta is doing. It saves the loadout you log off with, but not the face, giving you a new random one when you come back in. I should pry it open and look it over.

molten yacht
winter rose
#

ah, no, when you mentioned custom faces I thought "the custom face one can have", my bad

molten yacht
#

it's both

#

but thank you

#

this does give me something to think on

stark fjord
#

In arma3 tools you have bankRev that can depbo pbos, so you can depbo vindicta, find where it changes face, and bypass it. My guess would be some respawn event handler

#

On that topic, im a little confused as to what exactly lockIdentity is supposed to be?

winter rose
#

perhaps preventing any identity change, whether game-generated identity or logging player entity replacement, but I do not know

stark fjord
#

Like so it cant be changed later, in lets say ace arsenal?

#

This will disable default identity.
This is whats mostly confusing me, what default?

winter rose
#

no idea at all, sorry
there is no unlockIdentity, there is no lockedIdentity, so it seems quite… isolated

winter rose
stark fjord
#

Ugh.

wary sandal
#

can i force structured text to be displayed on one line only (even if the text is too small)?

#

the ST_SINGLE style doesn't do this

wary sandal
#
class WTK_ExcludeGroundLabelPath: RscStructuredText {
    style = "0x00 + 0x0C";
    colorText[] = {1,1,1,1};
    class Attributes
    {
        font = "RobotoCondensed";
        color = "#ffffff";
        colorLink = "#D09B43";
        align = "left";
        shadow = 0;
        size = 0.85;
    };
    text = "text";
    w = 0.375 - 0.018;
    h = GUI_GRID_H * 1;
    colorBackground[] = {1,0,0,0.5};
};
stark fjord
#

Wdym it doesnt show as structured text?

#

From what i understand you need to parseText, not just put in xml as a string

stark fjord
hallow mortar
#

You could probably regex remove the line breaks

little raptor
#

there are no line breaks

#

the text is just wrapping

#

and there's no solution for it with structured text ctrls

#

except for stretching it

little raptor
# wary sandal

but for this you don't even need structured text. it can be shown with a normal text box

stable dune
#

Hello.
If I have two different .p3d models, can I use somehow 2nd color in 1st object.
Objects are
empty_barrel_f.p3d and
Empty_barrel_grey_p3d.
because only thing what I want to do , is change color of object (without deleting old and re creating new at position of old)

muted fox
#

anyone got an SQF that brings down natural lighting down?

open hollow
#

(Post prosess no actually pp)

meager granite
#

Then you could do setObjectTexture

little raptor
#

static

wary sandal
#

anyway I moved onto a simpler and better solution

#

simply allowing another line to be drawn

#

like so

#

perhaps in the future I could make it one line by increasing the width but i'm fine with what i have for now

#

plus it only affects players with their game set to french so, not a big issue

quiet geyser
#

Is onPlayerKilled.sqf executed locally or on the server whenever a connected player dies?

quiet geyser
#

Excellent, thanks

wary sandal
#

do I need to disable serialization if I define a button with params?
this way

addMissionEventHandler ["OnEachFrame", {
    _thisArgs params ["_button"];
}, [_button]];
wary sandal
winter rose
#

every time you have a variable holding a UI element (display, button, etc) disable serialisation in the code block

wary sandal
#

does the disableSerialization statement location in the script matters?

winter rose
wary sandal
#

I don't want it to be saved

winter rose
#

I have no idea what you mean

wary sandal
#

I don't want any of what my addon does to be saved

winter rose
#

what I mean is that if you have a script running, e.g```sqf
while { sleep 1; true } do
{
hintSilent format ["Health: %1/100", damage player * 100 toFixed 2];
};

this is an issue as UI elements are _not_ saved, hence why disabling the serialisation of the script is done - there is no way to restore a UI, it has to be re-created on load
agile flower
#

daft question - how can I createVehicle with a variable name, but also tell all clients what the variable name is for the vehicle?

wary sandal
winter rose
wary sandal
#

I can move this to a while loop tho, like the code you just sent

winter rose
#

your call depending on your structure
otherwise, disableSerialization is used correctly here

agile flower
#

now have this issue

#

player addEventHandler ["InventoryClosed", {
    params ["_unit", "_container"];
    _containerString = format ["%1", _container];
    Hint format ["%1", _containerString];
    if ("deadBag_" in _containerString) then
    {
        if (count (items _container) == 0) then {
            deleteVehicle _container;
        };
    };
}
];
#

The container just gets deleted anyway

#

just testing something actually

agile flower
#

I'm not sure, I'll have a play, but basically, any container that has "deadbag_" in it is just deleted, empty or not

#

will feed back

stark fjord
#

Can someone explain disableSerialization to me like im 5 years old.
What exactly does it mean by "disable saving of script"?

agile flower
agile flower
stark fjord
stark fjord
#

I see. So for non saving ones, you could just toss disableSerialization out to begin with

#

Ah yeah i see in the comments. Only if you store display elements into variables, since displays are recreated and element would not be the same.

Does it play role anywhere else except loading save?

winter rose
#

nope

#

really, disableSerialization is just "do not save/load this script as it will have variables pointing to UI elements"
use it when you refer to UI elements with variables, otherwise don't use it, there is only that to it

stark fjord
#

Gotcha...

stark fjord
#

Well then it plays absolutely no role in multiplayer env since you cant save or load anyways. All other functions handling players would also fail if they were stored in vars

winter rose
#

you can save in MP when player-hosted

#

Arma is moddable and not just dedi-MP, don't forget! πŸ™‚

stark fjord
#

Yes but: save with 10ppl on, load with 1, where are we then xD?

#

Like idk you have global var on server lets say "my_commander =playerObj".
You save, then load but player that was commander isnt there or is but diffrent object. What would my_commander be then? Nil or would it somehow be objNull?

winter rose
stark fjord
#

Uhh so how does it save player positions (if at all), if players are set to be deleted. By slot in role selection?

winter rose
stark fjord
#

Ah. So if someone then jips, straight back to original spawn?

winter rose
#

most likely
the slot still exists, the unit doesn't until someone connects

#

of course, if you have variables pointing to these units, the references will be objNull (like when someone disconnects, too)

stark fjord
#

Okay. I thunk its a bit more smarter and restores position when role is taken again.
But oh well. I never messed with vanilla* saving anyways.

eager prawn
#

Anyone know of a way that I could modify an optics resolution for a UAV? My unit uses the AR-2 darter with a custom config. I currently have the IR camera on it disabled because Arma IR is very high-resolution/futuristic, and makes the Zeus's life hell cause they can see everything (real sUAS IR is usually max 320p and short distance).

Wondering if there is a way I could artificially degrade the video quality on the Darter's turret and/or artificially reduce the max view distance with it.

stark fjord
#

Reducing view distance you could maybe setViewDistance while in camera and reset it when exiting

hallow mortar
eager prawn
#

You 3 are my heroes, congrats

sullen sigil
#

is it possible to make an entire side forget about a player without having to iterate through all its groups? meowsweats

#

nvm, need to iterate through all groups regardless so is ok

sullen sigil
#

ya i got it now
cba server event for every group making them forget about the player on postinit meowsweats

stable dune
agile flower
#

what is the syntax for "next" in a forEach please?

hallow mortar
#

continue

agile flower
scenic shard
#

is it possible to add your own custom building positions by script (or editor), so i can have units automatically fortify for example walls of sandbags bunkers etc?

winter rose
scenic shard
#

Ok, I wanted to add new points behind a line of sandbags for example. So that garrison scripts would pick those up. Guess that is not possible then?

winter rose
#

I have no idea what those garrison scripts are nor what they use, so I cannot tell you

scenic shard
#

As far as I know they use the buildingPos of nearby buildings

wary sandal
#

Is it possible to retrieve this setting programmatically ?

#

(translation: UI size)

little raptor
#

(it's not really needed if you use GUI_GRID to position your ctrls)

little raptor
wary sandal
#

because the debug window UI and my UI collide

#

so I'd essentially like to move the UI to the left if the scale is set on large or higher

plucky crater
#

Is there a way to modify a certain function of a mod with my own function in another mod file?

#

and would it be possible to do that through mission scripting without having to add another mod file?

scenic shard
broken forge
#

Will this command work to check if a function has completed? scriptDone (i.e. [_missionParams] spawn fnc_missionExample;)

meager granite
#
private _thread = [_missionParams] spawn fnc_missionExample;
waitUntil{scriptDone _thread};
little raptor
#

That's absolutely pointless tho

little raptor
meager granite
little raptor
#

Collision is only checked locally afaik so I guess wiki is wrong

#

But wiki does say local arg

#

No

#

That's never what local arg means anyway

#

It means the vehicle must be local to where you execute the command
The target vehicle can be remote

real tartan
#

Looking for a function to compare 2 unsorted arrays for duplicates and return a difference;

// examples
private _one = ["a", "a", "b"];
private _two = ["a", "b", "c", "a", "c"];

private _diff1 = [_two, _one] call TAG_fnc_getDiff; // return ["c", "c"]
private _diff2 = [_two, _one] call TAG_fnc_getDiff; // return []
real tartan
#

hmm, I guess simple _array1 - _array2; would do

sweet zodiac
#

That definitely looks like the best solution

smoky roost
#

why do i keep getting thrown out of the helicopter when i paste this script into the helicopter h1 setHitPointDamage["HitEngine", 1];

wary sandal
#

How do I prevent macro definitions from removing my commas in my string?

#
#define WRITE(arg) arg call _fnc_stream_append_line
// WRITE("16,02,2022") -> 16022022
manic sigil
smoky roost
#

yes

smoky roost
manic sigil
#

I dont think so, but I use that so rarely I couldnt say.

#

But if I were to guess, you have a mod installed that forces occupants of a disabled vehicle out, and its reacting to you destroying the engine.

smoky roost
#

but when i destroy the tail rotor i am not getting kicked out

#

and the other passengers are also still inside

smoky roost
manic sigil
#

Are you the subordinate of a group, or a leader?

#

Eh, even of you were getting quiet ordered out, itd just as likely kick everyone out. Still betting on mod issues

wary sandal
#

all this does is add 2 additional double quotes to the strings

broken forge
#

@meager granite @little raptor it's a mission handler and I'm trying to implement not allowing more then one mission to be accepted until the current mission is complete. #arma3_scripting message

meager granite
broken forge
#

Thanks

winter rose
#

try perhaps escaping them, e.g \,

wary sandal
wary sandal
#

this is exactly the issue i'm facing, i'm passing an argument that contains commas

winter rose
#

(commas* btw, I should fix that)

#

don't use commas?

meager granite
#

!quote 6

lyric schoonerBOT
graceful juniper
winter rose
broken forge
broken forge
#

Just the mission handler that I'm working on

meager granite
dusty mulch
#

@still sedge Is there a way to the game time when server loads in... In your admin tools?

modern meteor
#

Hi, I am trying to add markers on the map by clicking. The objective is that the markers are unique and do not overwrite each other. Unfortunately my code overwrites markers. What am I doing wrong?

markercount = 1;
openMap [true,false]; 
addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
        _markerName = format ["_USER_DEFINED #%1", markercount];
        createMarker ["_markerName",[0,0,0]];
        "_markerName" setMarkerType "mil_objective";  
        "_markerName" setMarkerPos _pos;
        markercount = markercount + 1;
        hint format ["%1", _markername];
}];
hint "EH active";

wary sandal
#

so much hate towards commas

#

anyways this works

#define WRITE call _fnc_stream_append_line

(...stuff) WRITE;
#

it makes a bit less sense because it's after the arg but whatever

modern meteor
hallow mortar
# modern meteor Any idea why it is overwriting the markers?

You are not creating a marker with the name "_USER_DEFINED x". You are creating a marker with the name "_markerName". When creating the marker, you're providing a string containing the exact text _markerName - not the variable called _markerName.

graceful juniper
#

I want to save loadout and position on disconnect how would I do that?

modern meteor
hallow mortar
#
createMarker ["_markerName",[0,0,0]];

"_markerName" is a string - plain text - not a variable name. It is the literal exact text "_markerName". The name of the marker is now "_markerName". Not the string you generated, that would be contained in the variable _markerName.

#

You are not using a reference to the variable _markerName. You are using the plain text "_markerName".
Direct comparison:
_markerName
"_markerName"
See the difference?

modern meteor
#

Oh I see

#

but when I use

createMarker [_markerName,[0,0,0]];

...then no marker gets created.

hallow mortar
#

You may need to set its colour as well to make it visible

#

Also, you don't need to setMarkerPos, you can just use _pos as the position when you create it

boreal parcel
#

how could I go about getting currently loaded ammunition in a players primary, secondary, and launcher slots?

hallow mortar
modern meteor
#

setmarkertype should make it visible, no?

hallow mortar
boreal parcel
south swan
#

https://community.bistudio.com/wiki/createMarker

tirpitz

When creating a marker with the name format: "_USER_DEFINED #n1/n2/n3". n1 can be used to set the owner, n2 I think is an incrementing index to ensure markers are unique, to this end also mangle some more characters onto the end of the string, and n3 is the channel ID the marker is in.
pikachusurprised

modern meteor
#

Last question, is there an easy way to delete all these markers in one go?

hallow mortar
#

Add the names to an array when you create them. Then you can deleteMarker forEach the array.

boreal parcel
#

I have two more questions
How does the params syntax like this work? I seen this being used in another script, is there a group object I should put instead of bool/objNull?

and if I want the ability for this param to not be used, do I need to change anything for the params or can I just check if the variable exists and not use it if it doesnt?

params[ ["_group", false, [false]] ];
boreal parcel
#

ah thanks thanks

#

would player be a correct datatype to have passed in? I plan to use the player to get all units in his squad

hallow mortar
#

player is just a command that returns the player object. So if you do [player] call my_fnc_whatever, it will evaluate the command and then pass the resulting object to the function.
And object is a perfectly valid data type.

boreal parcel
#

alright thank you

broken forge
#

How would I convert my function to run for each player in a player's group on mission complete?

["advance", 1500, player] call sog_server_contract_fnc_handleRating;
params ["_condition", "_amount", "_unit"];

private _unitRating = rating _unit;
private _companyRating = companyRating;

switch (_condition) do {
    case ("advance"): {
        if (!isNil "_unit") then {
            _unitRating = _unitRating + _amount;
        } else {
            _companyRating = _companyRating + _amount;
        };
    };
    case ("deduct"): {
        if (!isNil "_unit") then {
            _unitRating = _unitRating - _amount;
        } else {
            _companyRating = _companyRating - _amount;
        };
    };
    case ("reset"): {
        if (!isNil "_unit") then {
            _unitRating = _amount - _unitRating;
        } else {
            _companyRating = _amount - _companyRating;
        };
    };
};
broken forge
#

will do thanks

boreal parcel
#

is there a way to check if an array index actually exists? could I just do (_array select _i) isNotEqualTo null ?

broken forge
#

So this should work then? ```sqf
["advance", 1500, (units player)] remoteExecCall ["sog_server_contract_fnc_handleRating", 2];

grizzled lagoon
grizzled lagoon
broken forge
#
["advance", 1500, player] remoteExecCall ["sog_server_contract_fnc_handleRating", (units player)];
boreal parcel
boreal parcel
broken forge
#

I'm looking for just the players in a player's group

boreal parcel
#

oh

#

then yours should work yeah

south swan
#

inb4 sog_server_contract_fnc_handleRating function is server-only

broken forge
#

If a group decides to do a mission and succeed then only the players of that group get rating added. The whole mission module/system is on the server not in the mission or client side

south swan
#

oof

broken forge
#

I know it's not pretty but that's just the way I have my framework structured, lol

sullen sigil
#

never used remoteexec in my life, never will

little raptor
south swan
#

i mean. If the function is in servermod (sounds like it?) and, probably, mission success is checked on the server as well... then just sqf { ["advance", 1500, _x] call sog_server_contract_fnc_handleRating; } forEach (units _winnerGroup); wherever mission success is defined?

#

at least that's how i read "on the server not in the mission or client side" meowhuh

hallow mortar
broken forge
#

So would the forEach loop that artemoz mentioned work then if not then how would I go about this?

hallow mortar
#

artemoz's solution is probably right, unless you finish by plugging that calculated rating stuff into addRating. That's a Local Argument command, so it needs to be executed on each player's machine to take effect. If you don't, then it should be fine.

wary sandal
#

does the CfgFunctions postInit function run on both client and server ?

broken forge
little raptor
boreal parcel
#

anyway I've come to the conclusion of doing it this way, and while I have it posted is this a decent way of doing what im doing, any suggestions to improve it?

if ((typeOf _projectile) isEqualTo "Box_NATO_AmmoVeh_F") then {
    if (_group isNotEqualTo false) then {
        _primaryAmmo = [];
        _handgunAmmo = [];
        _secondaryAmmo = [];
        {
            // Current result is saved in variable _x
                _primaryAmmo pushBack ((primaryWeaponMagazine _x) select 0);
            _handgunAmmo pushBack ((handgunMagazine _x) select 0);
            _secondaryAmmo pushBack ((secondaryWeaponMagazine _x) select 0);
        } forEach ((units _group) select { isPlayer _x });

        for "_i" from 0 to (count _primaryAmmo) do {
            _projectile addItemCargoGlobal [_primaryAmmo select _i, 6];
            if ((count _handgunAmmo) > _i) then {
                _projectile addItemCargoGlobal [_handgunAmmo select _i, 3];
            };
            if ((count _secondaryAmmo) > _i) then {
                _projectile addItemCargoGlobal [_secondaryAmmo select _i, 2];
            };
        };
        _projectile addItemCargoGlobal ["rhs_weap_M136", 5];
        _projectile addItemCargoGlobal ["rhs_weap_fim92", 2];
        _projectile addItemCargoGlobal ["rhs_fim92_mag", 5];
        _projectile addItemCargoGlobal ["ACE_elasticBandage", 100];
        _projectile addItemCargoGlobal ["ACE_epinephrine", 12];
        _projectile addItemCargoGlobal ["ACE_morphine", 12];
        _projectile addItemCargoGlobal ["ACE_salineIV", 12];
        _projectile addItemCargoGlobal ["ACE_splint", 15];
        _projectile addItemCargoGlobal ["ACE_tourniquet", 15];
        _projectile addItemCargoGlobal ["1Rnd_SmokeRed_Grenade_shell", 5];
        _projectile addItemCargoGlobal ["1Rnd_SmokeGreen_Grenade_shell", 5];
        _projectile addItemCargoGlobal ["rhs_mag_M585_white", 5];
    };
};
#

basically adding ammo to a crate based on the squads currently loaded ammunition when the script is called

#

oh, apparently the weaponMagazine functions return an array, I didnt realize this

south swan
boreal parcel
#

bro thats actually been annoying me lately

south swan
#

also, why not just run 3x forEach loops? I doubt that would be slower

boreal parcel
#

thanks for pointing that out, im literally gonna need add this to the respawn handler so people stop complaining that their binos dont have batteries

boreal parcel
winter rose
#

better than an unrequired if check + less readable code

#

make it work, make it readable, then optimise (if needed!) πŸ˜‰

south swan
#
  • a possible bug where there are more secondary/handgun mags than primary ones
boreal parcel
south swan
#

don't mind me, the way the arrays are constructed should prevent that

boreal parcel
#

ah ok. Oh I actually didnt think about what would be returned if the player doesnt have a secondary or handgun

south swan
#

although it should prevent you from needing the count > _i check as well

boreal parcel
#

actually I did think, just not hard. Thats why I had the count > _i check

#

assuming nothing would be appended to the array if they didnt have anything

south swan
boreal parcel
#

I see now it would just be full of empty strings

south swan
#

well, isNil {secondaryWeaponMagazine player select 0} is True when no secondary is available, so the array lengths wouldn't be consistent after all

winter rose
#
{ _projectile addItemCargoGlobal [_x, 6] } forEach _primaryAmmo;
{ _projectile addItemCargoGlobal [_x, 6] } forEach _handgunAmmo;
{ _projectile addItemCargoGlobal [_x, 6] } forEach _secondaryAmmo;
```neater
#

no?

boreal parcel
south swan
#

inb4 "just run addItemCargoGlobal in the first forEach loop without storing intermediate result"

boreal parcel
# south swan well, `isNil {secondaryWeaponMagazine player select 0}` is True when no secondar...

im thinking replace that part with

{
    // Current result is saved in variable _x
    _primary = (primaryWeaponMagazine _x) select 0;
    _handgun = (handgunMagazine _x) select 0;
    _secondary = (secondaryWeaponMagazine _x) select 0;

    if (_primary isNotEqualTo "") then { _primaryAmmo pushBack (_primary); };
    if (_handgun isNotEqualTo "") then { _handgunAmmo pushBack (_handgun); };
    if (_secondary isNotEqualTo "") then { _secondaryAmmo pushBack (_secondary); };
} forEach ((units _group) select { isPlayer _x });
south swan
#

i'm talking about how it isn't "", it's straight up Nil when the weapon slot is empty

boreal parcel
#

oh really

#

hmm, ah wait

#

then is it "" if the weapon doesnt have a mag?

#

well, I doubt players would toss away their mags even if empty, so I shouldnt need to check for empty string then

south swan
#

seems to also be nil (?question mark?)

boreal parcel
#

I was looking at example 2, so I assumed

#

oh

#

thats primaryWeapon

#

balls

#

ok, ill look for nil then

winter rose
#

it's nil because [] select 0 is nil yeah

boreal parcel
#

then it should be fine to just check isNotEqualTo nil right?

winter rose
#

there is an "empty array" check

south swan
#

and probably default to the first compatibleMagazine of the weapon if the mag isn't there notlikemeow "How to featurecreep in 2 easy steps"

sullen sigil
#

foreach [1,2,3]

boreal parcel
#

oh so itll just grab a compatible mag if the player doesnt have one loaded, thats neat I guess. wont have to handle that myself

south swan
#

no it wouldn't

#

"and probably default" as in "you should probably write a logic for that"

winter rose
#

I am worried about if (_group isNotEqualTo false) then {
why not grpNull

boreal parcel
#

oh, I misunderstood

boreal parcel
#

guess I could change it to grpNull default

winter rose
#

it is more natural to have if (isNull _group) exitWith {}; yes πŸ™‚

boreal parcel
#

actually that var name kinda lies, im just returning the player object so I can get his group from him

winter rose
#

booo
liar!

#

name it _groupMember then ^^

#

w/ objNull

boreal parcel
#

makes more sense, done that

winter rose
#

you from the future thanks you for that πŸ˜„

boreal parcel
#

ngl I kinda wish object was just obj

winter rose
#

?

boreal parcel
#

the name, idk seeing objNull makes me want to be able to use obj rather than object

winter rose
#

well, where do you use object? this command was deprecated in ArmA 1.08 πŸ˜„

boreal parcel
#

oh

#

err

#

definitely not as an expected datatype

winter rose
#

angry SQF noises

boreal parcel
#

whats uh, whats the object datatype?

south swan
#

objNull

#

isEqualType objNull πŸ™ƒ

boreal parcel
#

now your confusing me

#

so I should make the expected datatype in the params array, objNull ?

sullen sigil
#

yes

#

it confused me initially as well

little raptor
#

expected datatype
objNull is not a datatype

#

it's an object that is null (non existing object)

#

in params you provide "sample" data

#

it takes the data types from them

#

e.g. if you want a number, you can put 0:

params [["_myNum", -1, [0]]]
boreal parcel
#

alright then, makes a little sense then

boreal parcel
south swan
#

if you don't expect to run it every frame (or every second) then it's probably acceptable even if it is a bit slow. It's guaranteed to be faster than BIS_fnc_compatibleMagazines at least. And "just get the first entry from compatible magazines array of weapon's config" is apparently not a best solution?

boreal parcel
#

hmm alright, ill test this in a bit, I dont think itll affect the mod its going into much but we shall see

#

actually you know what, I should probably do all of this after the crate has landed anyway, not mid flight

wary sandal
#

what method should I use to make sure my script is only running on client?

#

there are too much functions to choose from

little raptor
#

!isServer

sullen sigil
#

if (!hasInterface) exitWith {};

little raptor
#

tho if the server is not dedicated you might want to combine it with hasInterface

sullen sigil
#

!isServer will cause issues if player hosted mp

wary sandal
#

mhmm

sullen sigil
#

so check for interface instead

wary sandal
#

I might have a misconception on player hosted servers

sullen sigil
#

or just isDedicated to solve player hosted servers

wary sandal
#

are we running it separately like a normal server and separate scripts for the client and the server or nah?

sullen sigil
#

no

#

the client is the server

wary sandal
#

makes sense

sullen sigil
#

so all createVehicle objects are local to the hosting client until locality is changed

#

as an example

wary sandal
#

doesn't it create a lot of load on the client since it knows everything that is happening on the server?

sullen sigil
#

eh, i host antistasi myself for me and like 2 friends and get on "fine"

south swan
#

wouldn't having a server that knows all and a client that only knows part create more load overall?

sullen sigil
#

gets a bit shit if i forget to garbage clean every half hour or so but /shrug

#

what's the use case here anyways?

wary sandal
wary sandal
#

that should work

#

wait

sullen sigil
#

or just !hasInterface lol

#

and youd also want && isDedicated not && !isDedicated

#

as that's if is server and not dedicated (so just player hosted lol)

wary sandal
sullen spear
#

Hi, is there a way to hide the playerlist on the Map or shorten it to count only players by Opfor/Blufor... ?

granite sky
#

(not including headless clients. Because they don't have an interface)

winter rose
drifting onyx
#

Hi,
it's the first time that I make an addon (but I already know the principles of programming) and I would like to be able to create a mod which executes a script at the beginning of each game (which for the moment displays the angles pitch roll and yaw I'm in a plane or helicopter). I didn't quite understand the tree structure to use, especially in config.cpp and also how to properly use addon builder (source and destination).
thanks

the tree

Mod Inclinaisons v3
β”‚   config.cpp
β”‚
└───fnc
        fn_getInclinaisons.sqf

config.cpp:

class CfgPatches {
    class MyInclinationMod {
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {};
        author = "Autrucheverte";
    };
};

class CfgFunctions {
    class SQF
    {
        class fnc
        {
            class getInclinaisons { postInit = 1 };
        };
    };
};

fn_getInclinaisons.sqf:

while {true} do {
    if (vehicle player isKindOf "Air") then {
        private _pitch = round(vehicle player call BIS_fnc_getPitchBank select 0);
        private _roll = round(vehicle player call BIS_fnc_getPitchBank select 1);
        private _yaw = round(direction vehicle player);
        private _angles = format ["Tangage: %1\nRoulis: %2\nLacet: %3", str _pitch, str _roll, str _yaw];
        hint _angles;
    };

    sleep 1;
};

addon builder source: C:\...\Mod Inclinaisons v3
addon builder destination: C:\...\@Mod inclinaison v3\addons

winter rose
drifting onyx
winter rose
#

but why

drifting onyx
# winter rose _but why_

because it is displayed to me as a hint the angles of pitch roll and yaw and my goal in the long term will be to make an IRL model move like the plane or the helicopter that I pilot in game

cosmic lichen
#

you might wanna use hintSilent

cosmic lichen
drifting onyx
cosmic lichen
#

you need to define the path in CfgFunctions

drifting onyx
little raptor
drifting onyx
cosmic lichen
#

Your config is currently pointing too <ROOT>\fnc\fn_getInclinaisons .sqf

little raptor
#

e.g if your addon prefix is test :

class CfgFunctions {
    class SQF
    {
        class fnc
        {
            file = "test"; // if fn_getInclinaisons.sqf was in a subfolder: test\subfolder
            class getInclinaisons { postInit = 1 };
        };
    };
};
drifting onyx
#

ok I will test that

little raptor
#

also you should not name your function tag SQF meowsweats

#

(for testing it's fine tho)

drifting onyx
#

Must I relaunch Arma 3 when I rebuild my mod ? (because that is what I'm doing)

little raptor
#

yes

#

the game locks the pbos

drifting onyx
#

ok

little raptor
#

but you should test your stuff before building them to reduce dev time
you can make a test mission, place your addon folder in the mission folder then add:

#include "addonprefix\config.cpp"

in description.ext

little raptor
#

what is your addon prefix?

drifting onyx
#

mod_inclinaisons

little raptor
#

set up in addon builder options correct?

drifting onyx
little raptor
little raptor
#

did you use this for file?

file = "mod_inclinaisons\fnc";
drifting onyx
#

no

little raptor
#

file = "test"; // if fn_getInclinaisons.sqf was in a subfolder: test\subfolder

drifting onyx
cosmic lichen
#

file = "<modname>\<subfolder>\<subfolder2>\"

#

Discord eating my backslashes =/

little raptor
#

\\ (use it twice to escape)

inland iris
#

\

drifting onyx
cosmic lichen
#

It likes yours too πŸ˜›

cosmic lichen
#

file = "3denEnhanced\functions\GUI\VIM";
Mod name = 3denEnhanced
First subfolder: functions
Second subfolder: GUI
third subfolder: VIM

inland iris
#

I asked a question in #arma3_editor but I guess its really more like a scripting question so I guess ill ask here as well

little raptor
inland iris
#

I need help working with triggers and respawn points

  1. if a vehicle is not in a trigger it will check if its in another trigger if its in none of those triggers it will respawn an empty vehicle (without pilot and co-pilots basically)
  2. if an infantries friendly (Lets say OPFOR) are in a trigger area a respawn will be activated otherwise that respawn wont be active (this can be with multiple respawn points at a time)
little raptor
#
  1. when should it respawn? based on a timer?
winter rose
cosmic lichen
inland iris
drifting onyx
#

I rephrase my question:
I want to try a mod who execute a script when I spawn.

while {true} do {
    if (vehicle player isKindOf "Air") then {
        private _pitch = round(vehicle player call BIS_fnc_getPitchBank select 0);
        private _roll = round(vehicle player call BIS_fnc_getPitchBank select 1);
        private _yaw = round(direction vehicle player);
        private _angles = format ["Tangage: %1\nRoulis: %2\nLacet: %3", str _pitch, str _roll, str _yaw];
        hint _angles;
    };

    sleep 1;
};

What should be my map folder tree ?
What should be written in config.cpp ?

And then how to build it ?

cosmic lichen
#

What you had so far was correct. Just something wrong with the path.

little raptor
wary sandal
cosmic lichen
#

He had that already (postinit)

wary sandal
#

my bad, I can't read

drifting onyx
wary sandal
#

here's my setup if you are interested

class CfgFunctions
{
    class WTK {
        class InitScripts
        {
            file = "Arma3ModTest\addons\main\functions";

            class init { postInit = 1 };
        };
    };
};
little raptor
wary sandal
#

I have a folder inside my main addon called functions
any sqf file named fn_<function class name> (fn_init in my case) will be executed upon mission start if it has postInit in it

cosmic lichen
#

zero experience I tried with the basic

drifting onyx
#

and now to build it ?

wary sandal
drifting onyx
wary sandal
#

download Arma 3 tools on steam

little raptor
wary sandal
#

it's by far the easiest solution

drifting onyx
#

no

wary sandal
#

so you want to build your mod without having to restart your game?

#

I don't really get it

little raptor
#

whatever you want 🀷

drifting onyx
drifting onyx
wary sandal
little raptor
#

well you should just make your own mod folder

#

then add it to launcher

drifting onyx
wary sandal
#

that's how it meant to be right?

#

hemtt does it that way so

little raptor
#

well depends which addons folder you meant

#

I figured you mean the one in the root of the game folder

drifting onyx
# wary sandal

and in arma launcher I select the parent of addons (build for you)?

wary sandal
drifting onyx
#

ok ok

wary sandal
# drifting onyx ok ok
Mod <--- you select this folder in the arma launcher
β”‚   mod.cpp
β”‚
└───addons
    β”‚
    └─── whatever mod
          └─── config.cpp
          β”‚
          └─── fnc
                β”‚
                └─── fn_getInclinaisons.sqf
drifting onyx
#

next to whatever mod folder

little raptor
drifting onyx
#

😒

little raptor
#

did you delete/replace it?

wary sandal
drifting onyx
#

I overwrite it

wary sandal
#

nice to know

little raptor
stark fjord
#

One suggestion id make is keeping stuff in lowercase, because of linux servers and case sensitivity

#

Idk if its still such an issue, but i had to make scripts to lowercase everything

#

Things outside pbos that is.

drifting onyx
#

when I open it with PBO manager I have this. Is there any problem ?

stark fjord
#

Oh

#

How do you compile addon?
Arma3 tools?

drifting onyx
#

yes

#

addon builder

stark fjord
#

You may wanna add .sqf to allowed extensions

#

In options

drifting onyx
#

It seems way better

stark fjord
#

Yup

drifting onyx
#

must I restart arma 3 laucher to

stark fjord
#

If you use any other extensions you need to list them there

#

No, just need to restart arma.
You are adding it as local mod, yeah?

drifting onyx
#

yes

#

ok

#

It's working, thank you, see you tomorrow for new adventures πŸ˜„

sudden bear
#

Hello everyone, I would like some help to understand a bit more scripting in this game (I just begin with the editor). My question is... How to made plane drop bomb with this script : null = this spawn {_this dotarget t6; sleep 0.5; while {alive t6 and alive _this} do {sleep 4; gl action ["useweapon",vehicle _this,_this,0]; }};

stark fjord
#

This script gives target t6 to plane, waits 0.5 seconds then starts looping the following code until either plane or t6 are destroyed:
Wait 4 seconds, then It makes plane fire its current weapon.

#

So how would you make THIS exact script make plane drop bombs? I guess if only weapon plane had is bombs it would drop them? given that object g1 IS the plane.

sudden bear
#

gl is a game logic

#

I use a script found a on video to made AI fire on object

stark fjord
#

Ah right it uses logic, then ignore last part

sudden bear
#

I try to made a CAS with RHS plane but the SU-25 don't drop any bomb even with pylon full of FAB-250 or 500

stark fjord
sudden bear
#

How does it work ? Like I say
I'm just starting πŸ˜…
Could you give me a exemple ?

stark fjord
#

scroll a bit down, has a few examples below

sudden bear
#

Thank you very much I will take a look and return if I need help. Thanks again

broken forge
#

I'm trying to create a waitUntil loop that skips setting the private variable _result equal to 1 if the number of captured hvts have been met. (If the private variable _result is equal to 1 then mission fails). So will this work: ```sqf
_startTime = floor(time);
waitUntil {
sleep 1; // Use sleep on server side!

// Check if hvts are killed
_hvtsAlive = ({ !alive _x } count _hvts);
if (_hvtsAlive >= _limitFail) then { _result = 1; };

// Check if hvts are in extraction zone
_hvtsInZone = ({ _x inArea _extZone } count _hvts);

// Check if hvts are captive
_hvtsCaptive = ({ captive _x } count _hvts);

// Timeout check
_currTime = floor(time);
if ((_hvtsCaptive >= _limitSuccess) && (_currTime - _startTime <= _time) || (_hvtsCaptive >= _limitSuccess) && (_currTime - _startTime >= _time)) then { _result = 0; } else { _result = 1; };

// Trigger Conditions
(_result == 1) OR (_hvtsInZone >= _limitSuccess) OR (_hvtsAlive >= _limitSuccess);

};

stark fjord
broken forge
#

The return value is if one of the Trigger Conditions are met, or did I code that wrong?

stark fjord
#

remove ; in trigger conditions line

broken forge
#

ok, and I haven't tested it yet because it one small part to an entire system and it's within my server addon, lol. I guess I could create a quick test mission though

winter rose
stark fjord
winter rose
#

why did you say that?

stark fjord
#

cause // Trigger Conditions (_result == 1) OR (_hvtsInZone >= _limitSuccess) OR (_hvtsAlive >= _limitSuccess); <---- That?

winter rose
#

keep it
it is a 22yo false idea that a semicolon prevents returning a value

#
private _value = call { 0; }; // _value == 0
#

though I have to admit… now I am unsure regarding waitUntil

stark fjord
#

The hell? Was i living a lie? so
_var = if (true) then {123;} esle {321;}; works too?!

winter rose
#

yep

granite sky
#

other than the else typo :P

winter rose
#

trololo

stark fjord
#

but all the examples on wiki seem to amplify that lie

winter rose
#

…no?

stark fjord
#

there is never ; in last-return line

granite sky
#

It's a 50/50 convention in Arma whether you bother with the trailing semicolon on one-liners.

winter rose
#

tested```sqf
0 spawn {
waitUntil { speed player > 0; };
hint "OK";
};

sullen sigil
#

or if youre me, 50/50 usage

winter rose
stark fjord
#

well im throwing my pc into the toilet

winter rose
#

make a backup first!

stark fjord
#

this is as much as a revelation to me, as the time when i first learned that vehicles actually do have brakes (x) and braking doesnt "just suck" in arma....

granite sky
#

I lost that keybind somewhere, don't really miss it :P

hallow mortar
#

X is the handbrake specifically. Normal brakes is just pressing backwards (S) while going forwards.
The handbrake doesn't trigger the brake lights, doesn't count as braking for things like disableBrakes, and doesn't work on tracked vehicles.

stark fjord
#

True but some vics just have bad brakes, but when you handbrake it, they stop almost on a dime.

ashen ridge
winter rose
ashen ridge
winter rose
#

perhaps

grim cliff
#

anyone know if i can get the side that a uav terminal belongs to?

meager granite
grim cliff
meager granite
#

There are more sides but I don't think there are terminals of other sides, it would make no sense

grim cliff
#

can i get the same type of number from a unit for a conditional statement? i cant find ItemInfo in the config for the GPS either

meager granite
#

Yes you can get same side number from unit

#

side but units might be in a group of different side so getting number from config is not gameplay-reliable

#

UAV crew is created by vehicle's config side (but again you can change UAV crew sides during gameplay)

thick arrow
#

Ive been looking and looking for a way to implement xenos ammoload script into my own mission file but just cant seem to find it nor find something like it if anyone is able to help id be much appreciative! If you dont know what im talking about its a script that sets a certian helipad to have the option of loading an ammobox into a cargo oriented vehicle or air type vehicle. basically you land on it open the cargo option of the vehicle and it says load box etc etc.

grim cliff
#

can someone please explain this? am i just not seeing this or am i losing my mind?

switch (playerSide) do 
{ 
 case west: { hint "You are BLUE"; }; 
 case east: { hint "You are RED"; };
 case guer: { hint "you are GREEN"; };
default {hint "WHAT ARE YOU!?";}; 
};

so if i have a NATO unit it works
if i have an OPFOR unit it works
if i have a GUER unit it fails or errors out.

manic kettle
#

Yeah it's resistance not guer

sweet zodiac
#

I wouldn't use playerSide personally since it doesn't update if you change sides mid mission

#

Depends on the use case I suppose

grim cliff
sweet zodiac
#

Makes sense

grim cliff
#

resistance still returns GUER ao what am i missing here?

sweet zodiac
#

instead of guer in your case use resistance

#

Like Prisoner laid out further up

grim cliff
#

OK. . . . that works all I want to know is why. im trying to understand the code instead of just accepting "it is what it is"

manic kettle
#

It's a decades old engine and it's held together by duct tape and glue

sweet zodiac
#

^ Pretty much, resistance is the actual hardcoded Side while guer is merely a string output.

#

funnily enough independent also works

meager granite
#

CIV is string name for civilian

grim cliff
meager granite
#

resistance, independent, civilian, blufor, etc. are scripting commands returning side value

#

When you turn SIDE type into STRING type, you get these WEST, EAST, GUER strings

grim cliff
sweet zodiac
#

Yes

grim cliff
#

so i dont have to have both independent and resistance in the same switch because they are going to both match?

sweet zodiac
#

Yes

grim cliff
#

does it not use lazy itteration?

sweet zodiac
#

Switch's look for the first matching case

#

You can also use it like so

_i = 1;
Switch (true) do {
  case (_i == 1): {hint "_i equals 1"};
  case (_i == 2): {hint "_i equals 2"};
  case (_i == 3): {hint "_i equals 3"};
  default {};
}

A more concise version of this would be

_i = 1;
Switch _i do {
  case 1: {hint "_i equals 1"};
  case 2: {hint "_i equals 2"};
  case 3: {hint "_i equals 3"};
  default {};
}
grim cliff
#

yes, do something corespoding to value

#

i tought i got lucky and had found a fucntion that would activate twice like

jhonShoots = true;
sleep 1;
TimShoots = true;
//the distance the bullets must travel is at least 2 seconds 
switch (true) do {
 case TimShoots: { John setdammage = 1; };
 case jhonShoots: { Tim setdammage = 1; };
default {};
};

but NoOoOoO, only Jhon dies because lazy evaluation

sweet zodiac
#

It would exit out at the TimShoots case

#

I would use two If statements for something like that.

winter rose
sweet zodiac
#

Just thinking of how many of my own functions would break if a switch executed everything 😬

sharp parcel
#

hi there guys, having some problems when respawning. We're keeping most of our gear, but losing odd bits or all first aid kits. I've tick store load out in eden editor, plus I'm using spyder addon loadout manager. I also have a:

onPlayerKilled.sqf

player setVariable ["Saved_Loadout",getUnitLoadout player];

and

onPlayerRespawn.sqf

player enablestamina false;
player addEventHandler ["Respawn", {player enablestamina false}];

player setCustomAimCoef 0.2;
player addMPEventhandler ["MPRespawn", {player setCustomAimCoef 0.2}];

player setUnitRecoilCoefficient 0.3;
player addEventHandler ["Respawn", {player setUnitRecoilCoefficient 0.3}]; 

player addEventHandler ["Respawn", {player setUnitTrait ["medic",true]}];

player addEventHandler ["Respawn", {player setUnitTrait ["engineer",true]}];

player addEventHandler ["Respawn", {player setUnitTrait ["explosiveSpecialist",true]}];

player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

am I missing code that should be in the one of the init files? cheers

sweet zodiac
#

I think you can wrap a lot of those into one handler instead of that many

winter rose
sweet zodiac
#

initPlayerLocal.sqf would suit better for these, since it only fires once locally on each player when they connect

winter rose
#

(you don't need all these event handlers as the file itself is one and you apply the wanted changes already)

sharp parcel
#

I can work with out the setunit and stamina stuff.. agree I'll ditch all that.. Would you just have this for onPlayerRespawn.sqf

player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

or would you put that in the initPlayerlocal.sqf? cheers

sweet zodiac
#

Forget what I said I had a brain lag, putting those in the onPlayerRespawn should be sufficient, since as Lou said it basically functions like the Respawn Eventhandler

sharp parcel
#

thanks @sweet zodiac andf @winter rose legends πŸ™‚

sweet zodiac
#

onPlayerRespawn.sqf

player enablestamina false;
player setCustomAimCoef 0.2;
player setUnitRecoilCoefficient 0.3;
player setUnitTrait ["medic",true]
player setUnitTrait ["engineer",true]
player setUnitTrait ["explosiveSpecialist",true]
player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
#

However If the scenario has Respawning At start turned off they may not apply, but I would need to double check that.

sharp parcel
sweet zodiac
#

It happens to everyone, I wouldn't worry.

Just yesterday I nigh on had a fit because one of my Functions was complaining about a Variable not being defined, of course the game was right but my brain didn't agree for an hour.

sharp parcel
#

@sweet zodiac all looks good.. What should I add to that script so my respawn loadout = my stored loudout.. At this point I am respawning with the current loadout and ammunition I die with.. i.e If I have used half a clip then, I respawn with the remainder of that clip only? cheers

sweet zodiac
#

Well you would have to change separately when the Loadout gets "saved" to really solve that

sharp parcel
#

I'm using the spyder addon for loadout manager and saving and respawning with loadout

sweet zodiac
#

I'm not too sure what spyder addon is so I'm not sure how to help you

sharp parcel
#

yeh ok cool.. thanks mate. I think I am really close.. I'll play with some previous scripts and see if I can rectify πŸ™‚

#

appreciate your help

winter rose
#

you are grabbing player's loadout on death (onPlayerKilled.sqf) so it is normal you get the loadout with which you died πŸ™‚

sweet zodiac
#

You could add something basic like an Action on an Arsenal Crate if you want, It's a little bootleg but should serve the purpose.

//Init of Box
this addAction ["Save Loadout", {player setVariable ["My_CoolLoadout", getUnitLoadout player]}];

//If Executed from Debug Console while looking at it
cursorObject addAction ["Save Loadout", {player setVariable ["My_CoolLoadout", getUnitLoadout player]}];

//Lastly if done from Zeus
_this addAction ["Save Loadout", {player setVariable ["My_CoolLoadout", getUnitLoadout player]}];

//Modified Respawn Snippet
player setUnitLoadout (player getVariable ["My_CoolLoadout",[]]);

Use one of the three options that best fits.

#

Note that addAction is local so this would need to be executed for Everyone.

your best bet is giving the box a Variable name in the Editor and putting

BoxVariableName addAction ["Save Loadout", {player setVariable ["My_CoolLoadout", getUnitLoadout player]}];

Inside initPlayerLocal.sqf

sharp parcel
#

makes sense, thanks mate.. will make the adjustments now

sweet zodiac
#

Double Edit once again, the Init of an Object in the Editor is executed for everyone so using that Top option will do just fine

novel basin
#

Hello
How Can't die from fire ?
I try with addEventHandler damage but i dont fine a good solution πŸ€”

sweet zodiac
#

I don't think there is an easy way to stop fire damage, I haven't found a reliable way to detect if the damage is from a fire without making it check many things inside the handler

inland iris
sweet zodiac
#

Do you mean something like that?

inland iris
#

I wanted the notification like the mission marker but I got it thanks

#

lets say

#

a certain area has been cleared of OPFOR now I want to send a Notification saying "Area Secured" and send another one

sweet zodiac
#

So once a zone has been cleared of Opfor you want it to send a Notification that it's clear?

#

The absolute simplest method is just a trigger, set for Opfor to Not be Present

inland iris
#

I gotit

#

I wanted to do it like this basically

sweet zodiac
#

That's a little more complicated to do but very possible

inland iris
#

it uses the BIS_fnc_showNotification

sweet zodiac
#

That should fill in the blanks

#

You will need to add to CfgNotifications for that

inland iris
#

Off topic but how is vscodium as a enviornment?

sweet zodiac
#

It's basically just VSCode

#

It does the job

inland iris
#

Does the VSC Addons work on it ?

sweet zodiac
#

Yup

inland iris
sweet zodiac
#

Place a Area marker and just change it's alpha to 0 when the Trigger activates for clearing the zone.

"AreaMarker" setMarkerAlpha 0
inland iris
#

Lets say Snoppy chose to go Cedras
so after they capture cedras it will trigger to capture ambergris

sweet zodiac
#

description.ext

class CfgNotifications
{
    class TAG_SectorCleared
    {
        title = "Sector Cleared";
        iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIconDone_ca.paa";
        description = "You Cleared a Sector";
        color[] = {0.7,1,0.3,1};
        priority = 7;
    };

    class TAG_SectorClearedRespawn
    {
        title = "Sector Cleared";
        iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIconDone_ca.paa";
        description = "You Cleared a Sector, A New Respawn has been Activated";
        color[] = {0.7,1,0.3,1};
        priority = 7;
    };

    class TAG_SectorLost
    {
        title = "Sector Lost";
        iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_ca.paa";
        description = "You Lost a Sector";
        color[] = {1,0.3,0.2,1};
        priority = 7;
    };

    class TAG_SectorLostRespawn
    {
        title = "Sector Lost";
        iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_ca.paa";
        description = "You Lost a Sector, Respawn Deactivated";
        color[] = {1,0.3,0.2,1};
        priority = 7;
    };
};
inland iris
inland iris
sweet zodiac
inland iris
#

so I do call descriptiom.ext instead of call BIS_fnc_showNotification;

sweet zodiac
#
"TAG_SectorCleared" call BIS_fnc_showNotification
#

the description.ext is a way for you to load configs into missions without the need of a Mod

#

It however doesn't work for everything

inland iris
#

so I put the description.ext in the MPMissions Folder yeah?

sweet zodiac
#

No it goes along side the mission.sqm

inland iris
#

i got it thanksss

sweet zodiac
#

When you export to multiplayer from the editor it will include all the files inside the missions folder

sweet zodiac
inland iris
pastel pier
#

Is this a bug? But when deactivating an UXO the "delete" event handler for projectile doesn't trigger.

sweet zodiac
inland iris
#

@sweet zodiac so when all 4 of the Sectors has been captured I want to than remove all the markers in those sectors and only show the markers in black

sweet zodiac
#

Having a standalone trigger with this in the condition

triggerActivated trigger1 && triggerActivated trigger2 && triggerActivated trigger3

trigger1, trigger2 and so forth should be the Variable names of the 4 Triggers you want, then you can make it just hide all 4 markers.

tough abyss
#

Could anyone write a script that uses removeCuratorEditableObjects for all npc's every second? Because i honestly can't do Arma 3 Scripting.

#

I tried like 6 different approaches now, all didn't work at all

sweet zodiac
#

This is more a Editor Question if anything but having this Option NOT ticked should solve that, unless you are playing a mission which has a script that adds them to the Curator.

tough abyss
#

My goal is just to remove a certain side from the zeus

#

basically allow the zeus to edit BLUFOR, move em, etc

#

but not see REDFOR units

#

even if they are spawned in by a script

#

@sweet zodiac

sweet zodiac
#

I see

tough abyss
#

Yeah, so help on that matter would be appreciated

inland iris
#

wait is the Notification Visible to all the players in the Server ?

sweet zodiac
#

Yes

#

Oh wait, the Function is actually Local, but it being Called by a Trigger would make it global yes

tough abyss
#

Ok so i came up with:

while {true} do {
    sleep 1; {
            if ((side _x) == east) then {
                _this removeCuratorEditableObjects[[_x],true];
            };
    }foreach allUnits;
};    

But it gives me "Type Array, Expected Object"

sweet zodiac
#

Not sure what _this is, that's probably your Array

#

replace _this with the variable name of the Zeus Module

tough abyss
#

alr

sweet zodiac
#

Also let me stop you from bricking your System

cosmic lichen
#

Better use an entityCreated Event handler

#

This is about spawned units, isn't it?

sweet zodiac
#

I believe he wants all Units of a Side, including ones spawned by Scripts and not Zeus

tough abyss
#

Spawned via other zeus, spawned via script, spawned in eden

sweet zodiac
#

EntityCreated Looks like it would work actually let me test

novel basin
tough abyss
sweet zodiac
#
addMissionEventHandler ["EntityCreated", {
    params ["_entity"];
    
    if ((side _entity) == east) then {
           ZeusModuleVariable addCuratorEditableObjects [[_entity],true];
    };
}];

That does the trick

#

putting that in the initServer.sqf will work fine

#

You can add this along side it as a one time run to add all Opfor

{
    if ((side _x) == east) then {
           curatorModule addCuratorEditableObjects [[_x],true];
           sleep 1;
    };
} foreach allUnits;
#

You can change the sleep if you want it faster.
The Result was the Opfor were added to my Curator without me doing anything

brisk lagoon
#

Hey guys, a friend made a script for me, but he is busy and can't answer me, it's basically an MQ-9 fuel tweak the value he set is fuelCapacity=14000; but I don't know how does the 14000 convert in game, anyone knows?

drifting onyx
#

Is it possible to communicate variables from an sqf script to an arduino or to a python script, with sockets or by bluetooth?

My goal is to give in real time the pitch, roll and yaw angles of my plane/helicopter to an arduino card (by blutooth?) or if this is not possible to a raspberry pi (with sockets recovered by a python script?) .

The script to get the angles is already done.

winter rose
drifting onyx
winter rose
#

basically, the game can call an extension (a custom dll)
the dll can then do whatever you want it to do, provided you know what you are doing with it

distant egret
drifting onyx
lethal cave
#

for some reason cameraEffectEnableHUD true doesn't help to drawIcon3D over camCreate effect, an I doing something wrong here?

little raptor
#

Basically you can write one yourself by using CreateFile (see win32 api) on the COM port and adjusting the BaudRate, etc.. But don't connect the Serial Monitor at the same time obviously.

#

Ah you said Bluetooth didn't see that. Never used Arduino with Bluetooth so no clue meowsweats

slender olive
#

Hey guys, my addAction isn't showing up at all and its just telling me something like 'this **|#|**addAction ["Switch Lights On"...' Expected Error Type Code, Expected String

#

Its in a black box on the top of the screen

#

Im extremely novice in scripting so I barely even know what that means. Im trying to make it so that the player can use a laptop in the base to turn on and off the halogen lights set up around.

#

@ me if you have a response to this plz

slender olive
#

Alright wait one

little raptor
#

What the error means is you've placed code {} in a place that needed string ""

slender olive
#

Oh ok

#

Ill post in a second

#

this addAction ["Switch Lights Off",{Halo1 switchLight "OFF"},{Halo2 switchLight "OFF"},{Halo3 switchLight "OFF"},{Halo4 switchLight "OFF"},{Halo5 switchLight "OFF"},{Halo6 switchLight "OFF"},{Halo7 switchLight "OFF"}];```
#

Most of this is guesswork to be honest

#

This is placed in the laptop's init

sweet zodiac
#

Uhh

little raptor
#

Well yes it's wrong

slender olive
#

I assumed so lol

sweet zodiac
slender olive
#

I've gone thru that wiki page so much, I just don't understand it really

winter rose
#

see the examples, they will help

slender olive
#

I did though, thats how I ended up doing this

#

Ive gone to it over and over and I just dont understand wtf a string and a statement and all that are

sweet zodiac
#

From what I can understand you just want to turn a bunch of lights on and off?

slender olive
#

Yeah on and off

#

All the halogen lights are named "Halo1" to "Halo7"

stark fjord
#

issue is you are giving it too many scrip params
so addAction takes [string - name, script, arguments, number - priority, etc...
and you are giving it [string -name, script, script, script, script, etc

slender olive
#

Ah okay

#

Should i make a script.sqf for it to run?

stark fjord
#

what you wanna do is convert these multiple script blocks into one single one like so:
your code: {Halo1 switchLight "ON"},{Halo2 switchLight "ON"},{Halo3 switchLight "ON"}, etc
becomes: {Halo1 switchLight "ON"; Halo2 switchLight "ON"; Halo3 switchLight "ON"; all others}

slender olive
#

Oh okay

#

Testing it rn

#

Oh and heres the real kicker: will it be able to run in multiplayer? I havent had issues with addAction running in multiplayer before but I dont understand much abt scripting so idk

sweet zodiac
#

addAction has a local Effect, meaning it needs to be executed on each persons machine

stark fjord
#

addAction should. Im not sure about switchLight as it has localEffect. SO one guy will be switching lamps on off. But effect will be visible only to him

slender olive
#

Ah damn

#

Is there a way to make that work? Is there another global light switch? Lol

#

And it doesnt even work in single player anyway lol. The addactions show up but the lights dont activate. Theres no error code tho

stark fjord
#

infact there is πŸ˜„ but not so obvious one.
You could always use remoteExec to run the script globally on all clients. But for sake of simplicity
setDamage has global effect and light will turn off if sufficient damage is dealt to it.
So you can light setDamage 0.99; - Turn light off and light setDamage 0; light on πŸ˜„

#

you dont wanna destroy the lamp with setDamage 1 (1 means 100%), because you cant bring it back to life after

slender olive
#

Oh thats creative

sweet zodiac
#

Note I haven't tested anything but this might help

lights.sqf

params ["_target", "_caller", "_actionID", "_arguments"];
_lightList = [Halo1,Halo2,Halo3,Halo4,Halo5,Halo6];

switch (_arguments) do {
    case "ON": {
        {
            [_x, "ON"] remoteExec ["switchLight", 0];
        } forEach _lightList;
    };
    case "OFF": {
        {
            [_x, "OFF"] remoteExec ["switchLight", 0];
        } forEach _lightList;
    };
    default { };
};

Init of Light Switch

// PathToScript needs to point to lights.sqf or whatever you name it
this addAction ["Switch Lights On","PathToScript", "ON"];
this addAction ["Switch Lights Off","PathToScript", "OFF"];
#

Oh typo

slender olive
#

Thanks guys, Ill try both and see what I like best. If the damage one works ill probably use it cuz it seems very simple

nocturne bluff
#

is the player dead?

slender olive
#

THE DAMAGE ONE WORKED!

#

Im adding that to my limited scripting vocabulary now lol

lethal cave
#

oh wait, if i add cameraEffectEnableHUD true; right before drawIcon3d on each frame it works

worthy raft
#

Hi there, would anyone be willing to hop in a call and answer some very nooby questions? Just started looking into scripting today and struggling a lot

stark fjord
#

why not ask them here?

worthy raft
#

I could for sure but feel it would be easier to just talk through them, I'll post them if no one bites though!

ashen ridge
#

There is a way to destroy buildings instantly, with no dust, particles, destruction sounds and animations?

#

Just change them direct into destroyed state.

granite sky
#

setDamage alt syntax with useEffects = false

#

However IME nearby objects still take damage from the destruction, which feels like a bug.

#

So we still use the stupid buggy createRuin hack.

thick arrow
#

So im trying to set certain respawn points to certain groups within my unit for example say I want reaper 1-1 to spawn only at the markerPos ReaperSpawn(using the marker text not variable name) how would i do so cause the code I've used isn't working and im assuming its due to the lack of scripting knowledge I have here's my code so far. Any help would be greatly appreciated! Ive placed the code in my initPlayerLocal.sqf note this is for my multiplayer server https://sqfbin.com/ixihagowelequdoxajuv

#

not sure if my method is a proper way of going about this

ashen ridge
winter rose
thick arrow
#

@winter rosedo i just paste the code there and share it?

winter rose
thick arrow
#

ok gotchya!

#

@winter rosethanks for that tip

sweet zodiac
#

I cant really test anything at the moment but I bet you probably could use Markers as the respawns and depending on the unit you selected, what group its in you could locally create Markers through code, that is under the assumption that respawn positions can be local, I will have to test it tomorrow

thick arrow
#

@sweet zodiacthanks appreciate it no rush ive got other things i can work on within the mission files in the meantime! If you figure out a way lmk in dm!

manic kettle
fair drum
#

has anyone made a multiplayer campaign utilizing disableMP = 0; in their campaign description file?

winter rose
#

(most likely someone did)

fair drum
#

to use as reference when setting it up since it really isn't referenced well on the wiki if its possible or does anything. referencing the EXP campaign, it looks like they just define the missions and then have a normal server cycle through the mission levels instead.

#

if no one has made a functioning mp campaign utilizing a campaign description file, then I'll just go run head first into it and see what works and then make a post later

winter rose
#

disableMP = 0 is the default setting

#

the Arma 2 campaign is a (player-hosted) MP campaign
the Apex campaign is a (dedi-compatible) MP campaign

sooo I would say it has already been done?

fair drum
#

I guess the question is, has someone made a arma 3 campaign that is player-hosted out of the campaign menu vs hosting it out of the mp menu (like apex)

upbeat valve
#

When I destroy a building, the building's ruins appear, but the building itself is still there as well. I'm trying to remove the original building by placing an Edit Terrain Object module on it, and putting this in the module's "Object Init":

_buildings = vehicles select {_x isKindOf "Building"} inAreaArray _this; 
if (count _buildings > 1) then { hideObjectGlobal _this };
}```
The first line should see if there's any other objects around the original building (which should be referred to as _this according to the module) and then the second line should remove the original if there's any other structures (the ruin) detected in the area.
It's not working, nor is it giving me any errors. What did I do wrong?
fair drum
#

don't use the module

upbeat valve
# fair drum don't use the module

Where would i use the code instead? Im planning to use this on multiple buildings so I dont want to have to copy and paste over and over, can i make this a function

fair drum
#

actually, you shouldn't even need to clone, nor hide the terrain object you grab. just set its damage right there

#

its something with the edit terrain object module that is just wonky

upbeat valve
#

But without the module, how would i assign this function to a terrain object?

#

Or is this supposed to apply on all of them at the same time

fair drum
#

let me see if i can dig up something from an old terrain modification that I did via script rather than builder to show you

upbeat valve
fair drum
outer ocean
#

I have questions about scripting for respawn position. Is it possible for having different respawn position for different player on same side ?

For example, Person1 sees the available respawned point is Respawn1 . But Person1 does not see Respawn2 (as it is only available for Person2). Anh vise versa

fair drum
fallen locust
#

"_object = call compile "Extraction_1";"
@torn hemlock
Dont, use missionNamespace getvariable ["Extraction_1",objNull];

sudden yacht
#

How can i change the probability of presence using a script within a modules init? Any idea to the code to that? Maybe this setVariable ["#probabilityofpresence",1]; ???

sullen pulsar
#

But mom, we like compiling things.

fallen locust
#

I know right, its quick and easy

#

and slow :P

indigo snow
#

might as well compileFinal :D

sullen pulsar
#

^ this guy has the right idea.

fallen locust
#

a = compileFinal "a"; << game crash in last version :P

sullen pulsar
#

akward.

fair drum
fallen locust
#

woah its actually afaster and more secure :P

winter rose
fallen locust
sudden yacht
#

@fair drum yeah but i want to do it via a script. modify it on the start of the mission.

#

long story... just can it be done?

fair drum
fair drum
sudden yacht
#

i suppose i could justtt make my own and then delete the module.

#

But im pretty lazy

#

hahaha

young current
#

If both original and ruin show up it indicates botched configs that break destructioneffects class

upbeat valve
sullen pulsar
#

Gotta save that 0.00100000ms

upbeat valve
#

which I'm thinking about

winter rose
fallen locust
#

its more of a securty thing then a speed thing

#

but 0.001 by 0.001 it can add up

ashen ridge
#

I'm using setParticleParam to change some params on a particle source, but my changes are ignored. This is what i do:```sqf
_source = "#particlesource" createVehicleLocal _pos;
_source setParticleClass "HeavyBombExp1";
_source setParticleParams _myParams;

#

For example, i change size to [30,60] (original is [12,26]), but the change is ignored, the particle stays with the original size.

sweet zodiac
#

I have a custom mod for my group that adds a button to the multiplayer drop down to connect straight to the server, so Im sure you probably could find some way to host a thing like Apex

stark fjord
sweet zodiac
#

Don't all Objects in the editor have a presence probability attribute?

stark fjord
#

He wants to do it by script

#

But they do, yes

winter rose
sullen marsh
#

I think 0.001ms is within the bounds of error...

pulsar bluff
#

cant remember if i asked weeks ago ... is there a way to get vehicle mass from config/class?

ivory lake
#

probably not? it's stored in the models geo lod

pulsar bluff
#

:\

ivory lake
#

so only way I know of is getMass on an actual vehicle

stark fjord
#

Is there a way to return relative position of a weapon attachment?

pulsar bluff
#

dont think so

stark fjord
stark fjord
zealous heath
#

anyone know how to make the AI talk to you in sidechat?

stark fjord
agile flower
#

Hello, me again, having Syntax issues and I can't work it out

This is what I've coded and this is the result:

natoPlayers = allPlayers select {alive _x && side _x == west};
natoPlayersInArea = allPlayers select {alive _x && _x inArea sleepArea && side _x == west};
missingPlayers = [];

if (natoPlayers isEqualTo natoPlayersInArea) then{
["True"] remoteExec ["hint", 0];
}
else
{
    {
        if(natoPlayersInArea find _x == -1)then{
        missingPlayers pushBack [(name _x)];
        };
        
    } forEach natoPlayers;
    
    missingCount = count(missingPlayers); // to be used in further dev
        

missingString = missingPlayers joinString ", ";
format ["Can't sleep, \n%1 is not in the bunk room", missingString] remoteExec ["hint", 0];
};```
#

This is good, but obviously, missingString looks like an array, I want to format this array to be more eye friendly

It appears composeText does what I want it to do, but when I use like this:

missingString = missingPlayers joinString ", ";
missingHint = composeText missingString;
format ["Can't sleep, \n%1 is not in the bunk room", missingHint] remoteExec ["hint", 0];

I get composeText: Type String, expected Array

#

when I do this:

missingString = missingPlayers joinString ", ";
missingHint = composeText missingPlayers;
format ["Can't sleep, \n%1 is not in the bunk room", missingHint] remoteExec ["hint", 0];```

I get `composeText: Type Array, expected String, Text`
#

Any help on this please?

winter rose
#

you don't need composeText

digital hollow
#
missingPlayers pushBack [(name _x)];

that results in

[["player 1"], ["player 2"]]

You should just select {!(_x inArea sleepArea)} in the first place.

winter rose
#

pushback _element
append _array

sullen sigil
#

composeText takes an array anyways where joinString returns a string

#

but as lou said you dont need it

agile flower
#

Sorry, maybe I've not made myself clear

#

In my hint that pops up the player's name appears in the hint as ' ["player's name"] '

stark fjord
#

yep, its cause what Ampersand said

agile flower
#

I'm trying to remove the quotation marks and square brackets that have come from the srray

sullen sigil
#

you have an array of arrays so _arr#0 is ["iamaplayername"]

stark fjord
#

What you are doing is:
missingString = [["MyMan"], ["MyMan2"]] joinString ", ";
which return [MyMan], [MyMan2]

agile flower
#

Makes total sense now, thanks

stark fjord
#

sry edited

agile flower
#

fixed, thanks @stark fjord for bringing the help from @digital hollow and @winter rose to life

#

thanks for the tip on the not in area select too, didnt think of it that way

sullen sigil
#

bad idea to read/write to/from a .json file on arma server whilst it's running or would the performance difference be unnoticable?
havent a clue how a3 server runs and whether little more than another rpt would be detrimental to its performance

proven charm
sullen sigil
#

writing a string to a json file

proven charm
#

how big string?

sullen sigil
#

not very

#

something you could type by hand in a second or two

proven charm
#

doesnt sound like a problem then, you can run speed tests in the debug console

sullen sigil
#

does callextension work for debug console speed tests thonk

proven charm
#

well callextension returns a value so yes

sullen sigil
#

guess im figuring out how on earth i make my code run with unmanagedcallersonly

stark fjord
#

with callextension it shouldnt be a problem anyhow. Well depends how extension is written

proven charm
#

yeah DLLs are faster than SQF

#

I believe πŸ™‚

sullen sigil
stark fjord
#

yes but with dll you can just do it in separate thread, where you just pass params to it.
So all you do from arma perspective is give function the string and forget about it.
Unless you wait for return.

sullen sigil
#

thats true tbf

#

in which case it'd just be waiting for return for the functions that need a return value... i think

agile flower
#

quick sense check please

[.sqf to be executed] remoteExec ["execVM", params to pass];

is this correct?

#

no

winter rose
#

no.

stable dune
agile flower
#

[.sqf to be executed] remoteExec ["execVM", locality,params to pass]; ??

stark fjord
#

if you define a function in cfgFunctions all you need is
[paramters] remoteExec ["TAG_FNC_myfinefunc", <remote target>];

#

also paramters are not <remote target>

sweet zodiac
#
// Lets remove A Specific Weapon from Everyone
[player, "WeaponClassName"] remoteExec ["removeWeapon", 0];

// Another example lets run a function that needs 2 Arguements
[_object, ["Weapon1","Weapon2"]] remoteExec ["TAG_fnc_removeCertainWeapons", 2]
// the First argument _object is the player or Unit we want
// The Next argument is an Array containing all the Weapons we want to remove
// I also set the execution target to 2 so it only executes on the server
sweet zodiac
#

?

#

Actually let me Clean it up to remove ambiguity

winter rose
#

to [first, second] yes ^^

proven charm
#

can you sort array filled with systemTime/s somehow?

sullen sigil
#

awful performance but if you can convert to just numbers i would imagine you could just use regular sort in a new array and iterate through that and find in the old array and so on? polpox requested sort command that takes code but until then think there's no easy way meowsweats

proven charm
#

hmmm well I know there is BIS_fnc_sortBy but IDK if it can be used with this

winter rose
proven charm
#

And the array is [systemTime, systemTime, systemTime]

winter rose
#

I don't see why BIS_fnc_sortBy would not fit?

sullen sigil
#

strings

winter rose
#

BIS_fnc_sortBy β†’ algorithm argument

sullen sigil
#

oh
nice πŸ˜„

proven charm
winter rose
#

ur mom

sweet zodiac
#

Oh damn

proven charm
#

I have used it before but not with this

winter rose
#

{ _x select { str _x } joinString "" } I guess?

winter rose
proven charm
#

yes

proven charm
#

making it a string? it can read that?

winter rose
proven charm
#

hard to believe πŸ˜„

stark fjord
proven charm
#

lucky for Lou mothers day was yesterday πŸ˜„

sullen sigil
#

yeah i know i spent some time with her

winter rose
#

GC8's MOM???

#

…ok, let's stop the offtopic *slaps his own hand* πŸ˜„

proven charm
#

this is weird, Im looking at the code in fn_sortBy.sqf and it seems to take only scalar for the algorithm

#
    _this select 2: sorted algorithm (Code) [optional: default {_x}]
    - code needs to return a scalar
    - variable _x refers to array item
winter rose
#

that's the comment, not the code

proven charm
#

i know....

sullen sigil
#

needs to only return a scalar

#

so just turn ur array of time info into a long number

proven charm
#

would that really work? Im so bad at this...

sullen sigil
#

yes because lucky for us all time (currently) flows linearly

#

2024042403040506 is a day before 2024042503040506 so will be ordered in the order they are in this message

stark fjord
sullen sigil
#

i sense another mother joke incoming

proven charm
#

so this ```sqf
_v = ""; { _v = _v + (str _x) } foreach systemTime; _v

#

or ```sqf
_na = systemTime apply {if (_x < 10) then {"0" + (str _x)} else {str _x}}; _v = ""; { _v = _v + _x } foreach _na; _v

sullen sigil
#

please dont name your variables like that

proven charm
#

that was just quick console test

winter rose
#

2nd

proven charm
#

ok

sullen sigil
winter rose
#

you want 2023051519025900001

sullen sigil
#

fuck

sweet zodiac
#

Slight side note, if all the systemTime's are inside one array why wouldn't systemTimeMegaArray sort false not suffice?

#

[systemTime1, systemTime2]

winter rose
sullen sigil
#

because its array of arrays of strings

sullen sigil
winter rose
#

rawr x d

sweet zodiac
#

systemTime Returns an array of Numbers and sort can sort Multidimensional Arrays assuming they have the same elements which systemTime will always return consistently

winter rose
#

oh true
"RTFM" then πŸ˜„ runs away

#

so just sort is fine indeed

granite sky
#

That's what sortBy does. It builds the array for you and calls sort on it.

sweet zodiac
#

just using Sort lets you skip the middle man essentially

#

Just to note if you need to save anything alongside it lets say messages or anything else that's a string, just append an Array with your Info to the systemTime output when you run it
example

_time = systemTime;
_time pushback ["Stuff1", "Stuff2"];

This way Sort will always have the subarrays all being the same amount of elements.
Adhering to the Wiki's Warning Subarrays should be of the same structure. Subarray elements other than String or Number will be ignored during sorting.

proven charm
#

sort's not working 😦 but BIS_fnc_sortBy does

sweet zodiac
#

I tested it just a second ago and it worked are you sure you are using sort correctly? Β―_(ツ)_/Β―

stark fjord
#

So sort's sorta not working but other sort sorts?

proven charm
#

probably doing something wrong I got only the BIS_fnc_sortBy to work

cosmic lichen
#

That some hell of a mess to sort out

sweet zodiac
#

Badum ting

#

Well if you got it to work jobs done

proven charm
#

ya thx πŸ™‚

brisk lagoon
#

how do I make specfic spawn positions for specific groups (eg. Alpha 1-4)?

#

I got like 3 groups on blufor, and I want each group to spawn on a specific spot

sweet zodiac
#
[_Group, _spawnPosition, "Respawn Name"] call BIS_fnc_addRespawnPosition
wise frigate
#

Anyone know of a way to "Count" time since a script was executed? Using diag_tickTime returns the time since the mission was executed

winter rose
sweet zodiac
#

Fantastic Variable name

wise frigate
#

🀘

open hollow
sweet zodiac
#

If you write a novel for a variable name anyone else who reads it will throw hands, unless it's funny

winter rose
#

the more characters the more time spent parsing, but tbh below 100-200 chars would be unnoticeable, that's a guess πŸ˜„

#

and yes, always name your variables as if the code maintainer is armed and knows where you live 😁

brisk lagoon
sweet zodiac
#

Give the group itself a variable name and slap that in there

brisk lagoon
#

Thanks!

leaden ibex
#

Hey there, is it possible to "reexecute" the init box of a unit? Or is the code stored somewhere?
I looked at all variables of the unit but wasn't able to find it. Any ideas would be appreciated!

thorn saffron
#

Is there a way to get all what ground texture is assigned to a particular cfgSurface? Basically I want to go through each surface for a map as defined in the cfgSurface and get what is the ground texture that particular surface is using.

little raptor
#

but if you made the init field yourself just turn it into a function and call it later

leaden ibex
molten yacht
#

Is there a way to stop a specific vehicle from dropping below a certain amount of health?

granite sky
#

In all circumstances and with all mods? Tricky at best.

molten yacht
#

More "I want them to take a missile that is sure to damage the chopper but not kill them"

#

even if it's an "on damage taken" event handler for the chopper

#

that immediately sets the damage to what I want

granite sky
#

It has to be, really. HandleDamage, attached locally to the chopper.

#

If it's a player vehicle and it's for a special case then maybe best to add the EH to all players.

molten yacht
#

It's AI-piloted.

#

So, eventhandler on the chopper.