#arma3_scripting

1 messages · Page 624 of 1

little raptor
#

@solid raptor Are you talking about the while loop or waitUnitl loop?

solid raptor
#

while loop

#

I think the waituntil is there to block the loop from running again until the condition is true, so it sleeps and checks every 2 seconds before continuing

little raptor
#

@proud carbon Are you sure? If so, you can try using an object that is hidden by default (i.e. no resolution lod)

proud carbon
#

yeah. im using a football that I made hidden.

little raptor
#

what are you trying to achieve, if you don't mind me asking?

proud carbon
#

ok. I a demon chases the player around. you can't see the demon but you can hear the demon.

#

once it gets close enough it'll kill the player

little raptor
#

why does it have to face toward you?!

proper sail
#

@solid raptor are you doing a waituntil IN a while loop? Seems like you would be better off just doing sleep at the end of the while loop and then instead of doing while true -> while {condition}

solid raptor
#

no because the intent here isn't to sleep for a pre-determined time

#

its to sleep until a condition is met

proud carbon
#

the player is running away from it.

solid raptor
#

though I wonder if theres a better way to do that

proper sail
#

a waituntil in a while loop is basically double just saying

proud carbon
#

by face you mean direction yeah?

little raptor
#

yes

proud carbon
#

well im trying to get it so you can hear it's position. I'm using getRelPos and setpos to achieve the moving aspect of this

#

if that makes sense?

little raptor
#

I recommend vectorFromTo and setPosWorld/getPosWorld instead.
I still don't understand where direction comes into play

#

The good thing about the world pos is that you can achieve the desired velocity for your "demon"

#

As for making it closer:

_p1 = getPosWorld _demom;
_p2 = eyePos player;
_demon setPosWorld (_p1 vectorAdd (_p1 vectorFromTo _p2 vectorMultiply (_speed*diag_deltaTime)));
proud carbon
#

yeah and that would work if it wasn't for the fact making the object hidden for some reason stop the object from getting a vector.

little raptor
#

It doesnt

proud carbon
#

i've tried it

little raptor
#

It still has a position

ripe sapphire
#

its to sleep until a condition is met
@solid raptor isnt that basically the waitUntil command?

little raptor
#

@proud carbon Try a hidden object

ripe sapphire
#

Suspends execution of scheduled script until the given condition satisfied.

little raptor
#

Do you have CBA?

solid raptor
#

yeah but the loop is needed because theres more stuff inside it than just the waituntil

#

sorry if I didnt make that clear

proud carbon
#

No sadly.

solid raptor
#

I just didn't want to spam the channel with a block of code

#

the structure though is
while loop
code
waituntil

ripe sapphire
#

You can post it to a pastebin

#

And send link

solid raptor
#

doubt it'd make much sense without all the context

little raptor
#

@proud carbon I'm not in the game right now. But you can go to B_TargetSoldier in config viewer (under cfgVehicles). Use its model to create a simple object

#

You can then use this hidden object

#

It doesn't have a res lod, so its hidden by default

ripe sapphire
#

That just checks the condition every 2 seconds instead of each frame

#

I think the reason is performance

proud carbon
#

ok. i'll be right back and i'll give it a test.

ripe sapphire
#

Waituntil by default checks condition every frame

solid raptor
#

it waits until the track is done and then processes the next one

little raptor
#

Nearly every frame. Depends on the number of scripts in the scheduler and their execution time

proper sail
#

with one less loop

solid raptor
#

i'll try it out next restart

little raptor
#
    for "_i" from 0 to (count _categories min 10) do {
        _curr_cat = _categories select _i;
        _catName = _curr_cat select 0;
        if (_catName == _item) exitWith {
            _tracks = _curr_cat select 1;
            if (count _tracks > 0) then {
                //Pick the first one from the list
                _new_track = _tracks select 0;
                _track_duration = _new_track call fsh_getTrackDuration;
                //Update the list for next time
                _tracks = _tracks call fsh_arrayCycle;
                _curr_cat set [1, _tracks];
                _categories set [_i, _curr_cat];
            };
            
        };
    };
#

That bit of code was essentially saying this

#

Not sure what the point of that weird method was anyway

#

it can still be written in a better way

#

but meh

ripe sapphire
#

Hey guys, if i remoteExec a hint command and set the JIP parameter to true, will JIP players still see a hint if they join after the script has finished executing?

#

Or only if they join while its still executing

winter rose
#

first case

ripe sapphire
#

Thx lou 👍

little raptor
#

@proud carbon

createSimpleObject ["A3\Structures_F\Training\InvisibleTarget_F.p3d", _pos];
#

Use that as your hidden object
I've tested it and it works

solid raptor
#

can arma read sounds from a pbo? or do they need to be stored in a folder

little raptor
#

yes

solid raptor
#

sweet

proud carbon
#

ok I am back.

#

how do i go about using that?

loud python
#

I just tried putting a unit in the middle of nowhere and it really does work as it should wtf

#

does setWaypointPosition take into account buildings or something?

little raptor
#

@proud carbon
Test this in editor

demon = createSimpleObject ["A3\Structures_F\Training\InvisibleTarget_F.p3d", getPosASL player vectorAdd [0,0,10]];
onEachFrame {
_speed = 1;
_p1 = getPosWorld demon;
_p2 = eyePos player;
demon setPosWorld (_p1 vectorAdd (_p1 vectorFromTo _p2 vectorMultiply (_speed*diag_deltaTime)));
}
#

@loud python Are you trying to have the group move about randomly?

proud carbon
#

jesus that is fast man

#

I had to set the speed to 0.002; just so the player doesn't insta dies lol

#

Thanks man

little raptor
#

np

loud python
#

@loud python Are you trying to have the group move about randomly?
@little raptor exactly. Well, not a group, a single unit, but same thing.

little raptor
#

And the wp position is within a set radius?

loud python
#

?

#

which one?

#

I want the unit to move around within the radius, if that's what you're asking

little raptor
#

The random position

loud python
#

yes

#

pick random position within radius, go there, repeat

#

but it doesn't do that; instead it just picks random positions within a very small area to one side of the center position

little raptor
#

one thing I should point out is that whether the unit moves there depends on whether a path can be generated to that point

loud python
#

hmmm...

#

well this is all within a village, so I don't see that being the problem

#

and there's plenty of space all around the area

little raptor
#

If the position falls inside a building, it may not work

#

anyway, something you can do is:

_angle = random 360;
_r = random _radius;
_center resize 2; //2D pos; in case it's not AGL
_randomPos = _center vectorAdd [_r * cos _angle, _r * sin _angle, 0];
[group this, 1] setWaypointPosition [AGLtoASL _randomPos, -1];

you have to define _center and _radius

wispy cave
#

About the new HandleChatMessage EH, if I just want to log some messages to the RPT of the server, do I need to add the EH only to the server and what exactly do I have to return? Just [from, text] with the original from and text I presume?

robust hollow
#

depends what channel you want to capture. for example, the server will fire for global chat, but not side chat (from what i've noticed).

wispy cave
#

mmh, all channels because I want to check who's running #login So on all clients and remote exec diag_log then I guess

robust hollow
#

login already logs to the rpt though doesnt it? shows successful and failed attempts

wispy cave
#

yea, we want to know what passwords they're trying with

robust hollow
#

ah, well the event wont help you

#

you need to capture the text on the chat input before it closes

wispy cave
#

Yea, that's what I'm doing now, using longbow's chatcom

robust hollow
#
private _ctrlText = findDisplay 24 displayCtrl 101;
if (_ctrlText find "#login " == 0) then {
    // log _ctrlText to server
};
still forum
#

@wispy cave quite sure the EH is local on client. Didn't test on server.
It gets chat messages that are SHOWN in chat, #login is not

wispy cave
#

Mmh, I guess I'll keep using what I'm using then, thanks for the help

river sphinx
#

I am trying to make a trigger that when activated spawns an enemy and a helicopter and then puts the enemy in the helicopter this is what I'm putting in the activation box of the trigger.
It is spawning the enemy and the helicopter but is not putting the enemy in the helicopter.
I think the broken part is the enemy's name is not getting assigned properly so its not putting him in the helicopter with "enemy1 moveInDriver helione;"
I don't know this coding stuff very well but any help is appreciated cheers.

 
_sol = "O_Soldier_unarmed_F" createUnit [getMarkerPos "spawn1", group eastt]; // I make a soldier on my marker "spawn1"
_sol setVehicleVarName "enemy1";                                                //   I try to give the soldier a name?
enemy1 = _sol;                                                                //   I try to give the soldier a name?

_veh = createVehicle ["O_Heli_Light_02_dynamicLoadout_F", getMarkerPos "spawn1", [], 0, "NONE"]; // I make a chopper at my marker "spawn1"

_veh setVehicleVarName "helione";                                     // I name the chopper
helione = _veh;                                                     // I name the chopper
enemy1 moveInDriver helione;                                         // I try to move the soldier into the chopper
_veh setVehicleVarName "";                                             // I clear the name for next time it spawns
_sol setVehicleVarName "";                                             // I clear the name for next time it spawns```
little raptor
#

why do you set vehicle varname then clear it?

#

It's pointless

river sphinx
#

I don't know tbh

little raptor
#

and when you paste code here, please use

code
#

sqf has to be next to the three `
not in the next line

river sphinx
#

is there a way to change it now?

little raptor
#

yes, edit it

river sphinx
#

oh there we go

#

so would you happen to know how I can move the player I spawn into the chopper I spawn?

winter rose
#

setVehicleVarName is not especially useful
also, moveInDriver

little raptor
#
_sol = (createGroup east) createUnit ["O_Soldier_unarmed_F", getMarkerPos "spawn1", [], 0, "NONE"];
_veh = createVehicle ["O_Heli_Light_02_dynamicLoadout_F", getMarkerPos "spawn1", [], 0, "FLY"];
_sol moveInDriver _veh;
loud python
#

anyway, something you can do is:

_angle = random 360;
_r = random _radius;
_center resize 2; //2D pos; in case it's not AGL
_randomPos = _center vectorAdd [_r * cos _angle, _r * sin _angle, 0];
[group this, 1] setWaypointPosition [AGLtoASL _randomPos, -1];

you have to define _center and _radius
@little raptor I will try that later when I'm back in the editor, but thanks a lot for the code 😄

#

I had though of doing something like that but didn't want to look up the commands for all the vector math

little raptor
#

@winter rose

'setVehicleVarName' is not especially useful
It is useful in a way. If you want to stringinze the object, it will work:

_veh setVehicleVarName "Somename";
call compile format ["%1 setPos [0,0,0]", _veh];
winter rose
#

I know, I meant here

little raptor
#

ok 😅

river sphinx
#

thanks leopard that makes heaps more sense than the gibberish I had

proud carbon
#

so I have a script that plays audio. but for some reason the audio clip repeats 3 times. the other lines work and aren't different from the other spawn calls.

//here it is
[_RD, ["RD_part_of_the_first_team", 150]] remoteExec ["say",0];
//this one works fine
[_RD, ["RD_Yes_Weird_Things", 150]] remoteExec ["say",0];
winter rose
#

most likely comes from:

  • your sound file that is 3× what you want (unlikely)
  • you remoteExec'ing a script that remoteExecs the sound, multiplying by the number of connected players + server
proud carbon
#

I've checked the sound file. we're good on that front.
it also does the same thing in SP with the remoteExec.

winter rose
#

then you trigger it multiple times?
tried to replace this specific sound usage with another one in the exact same conditions?

languid oyster
#

Got a problem regarding animations. I have a little function

NIC_HealMePlayAnim = {
    params ["_unit", "_anim"];
    _unit playMove _anim;
    waitUntil {animationState _unit == _anim || !alive _unit};
    waitUntil {animationState _unit != _anim || !alive _unit};
};```

Which I call like so:
```sqf
[_x, "AinvPknlMstpSnonWnonDnon_medic_1"] call NIC_HealMePlayAnim;    
[_x, "AinvPknlMstpSnonWnonDnon_medic_2"] call NIC_HealMePlayAnim;

Problem: The animation is stuck after 1. call. What am I doing wrong?

proud carbon
#

they all activate with the same condition.

#

I still get the issue.

little raptor
#

@languid oyster First of all, you can do this using event handlers.
second of all, what do you mean stuck? The unit doesn't move at all?

languid oyster
#

Yes, the unit remains stuck at the end of 1. animation and will not move until switchMove "";

little raptor
#

Is it an AI?

languid oyster
#

yes

little raptor
#

Have you used disableAI "ANIM"?

languid oyster
#

uhm. No

little raptor
#

Then it's an interpolation/connection issue.

languid oyster
#

and how to resolve this issue?

little raptor
#

You can't.

#

I recommend that you use a differenet function

#

That passes the animations as a sequence

#

And use event handlers

languid oyster
#

Could you give me the link to an example?

little raptor
#

I don't have one. But I can write a quick example

languid oyster
#

That would be very nice

little raptor
#
if (_unit getVariable ["TAG_AnimDone_EH", -1] == -1) then {
    _EH = _unit addEventHandler ["AnimDone", {
        params ["_unit", "_anim"];
        _anims = _unit getVariable ["AnimSequence", []];
        _anims deleteAt 0;
        if (count _anims > 0) then {
            _unit switchMove _anims#0;
            _unit playMoveNow _anims#0;
        } else {
            _unit removeEventHandler ["AnimDone", _thisEventHandler];
            _unit setVariable ["TAG_AnimDone_EH", -1];
        };
    }];
    _unit setVariable ["TAG_AnimDone_EH", _EH];
};
_sequence = _unit getVariable ["AnimSequence", []];
_sequence append  ["AinvPknlMstpSnonWnonDnon_medic_1", "AinvPknlMstpSnonWnonDnon_medic_2"]; //add the new animations
_unit setVariable ["AnimSequence", _sequence];
_unit playMoveNow _sequence#0; //play the first anim from the list
#

this works (according to my tests)

#

and you only need one event handler. don't mistakenly pile them up

languid oyster
#

Many thanks, will test this immediately

little raptor
#

I updated the code to the full version.

proud carbon
#

I fixed the problem. I don't know how though.

#

it just works

torpid pewter
#

I'm trying use the script below to make a mod to place a 3D marker when using shift+left click, and it works fine in singleplayer, however in multiplayer the mission never loads. It just gets stuck on the loading screen with the green bar progress all the way to the right. Any idea how to fix this?

if (hasInterface) then { waitUntil {!isNull (findDisplay 12)};
_mapDisplay = findDisplay 12;
_mapControl = _mapDisplay displayCtrl 51;

_mapControl ctrlAddEventHandler ["MouseMoving", {
    TRN_var_mainMapMouseOverCustomMark = "customMark" in (ctrlMapMouseOver (_this select 0));
}];

 ["TRN", "onMapSingleClick", {
    if (_shift) then {
        TRN_var_customMarkLocation = _pos;
    };
}] call BIS_fnc_addStackedEventHandler;

_mapDisplay displayAddEventHandler ["KeyDown", {
    if (!isNil "TRN_var_mainMapMouseOverCustomMark" && {TRN_var_mainMapMouseOverCustomMark} && {(_this select 1) == 211}) then {
        TRN_var_customMarkLocation = nil;
    };
}];

addMissionEventHandler ["Draw3D", {
    if (!isNil "TRN_var_customMarkLocation") then {
        drawIcon3D ["\A3\ui_f\data\igui\cfg\cursors\customMark_ca.paa", [1,1,1,0.8], [TRN_var_customMarkLocation select 0, TRN_var_customMarkLocation select 1, (TRN_var_customMarkLocation select 2) + 2], 1.5, 1.5, 0, "", 1, 0, "TahomaB", "", true];
    };
}];
};```
languid oyster
#

@little raptor it works 😃 ! Many thanks! You're awesome!

#

Cool, I even added more animations, and everything works. Why this is not working 'out of the box' like stated here https://community.bistudio.com/wiki/playMove by placing multiple playMoves, is beyond me. On the other hand, I lack knowledge to tell any better way. Once more, any thanks for the solution.

sonic linden
#

hi, is there a way to get the type of roadway (from an object roadway lod) on which the player is standing ?

oblique arrow
sonic linden
#

is it still dev branch only ? have dev installed and it would take some time to pach back and forth

warm hedge
#

Oh excuse me. It does included in current public, forgot to update the article

oblique arrow
#

Added: New command getRoadInfo - FT-T147630
Dont think its dev branch

#

Ye its in stable now

sonic linden
#

thanks will try it

warm hedge
#

I'll update the article ASAP

#

Updated. Thanks for heads up

sonic linden
#

thanks

languid oyster
#

When playing with ACE mod, and a helicopter is hit by some AA, it often occurs, that people only get unconscious,. I am trying to do some 'rescue' thing in case the player gets unconscious, and there is a medic aboard. The idea is: The medic grabs the unconscious player, and jumps out of the destroyed heli. Here the part of my script doing this.

unassignvehicle _medic;
_medic allowDamage false;
moveout _medic;
unassignvehicle player;
player allowDamage false;
moveout player;
waitUntil {vehicle player == player && vehicle _medic == _medic};
player attachTo [_medic, [0, 0, -1]]; 
sleep 2;
_medic allowDamage true;
player allowDamage true;
waitUntil {getpos _medic select 2 < 120};
private _backpack = backpack _medic;
private _backpackcontents = backpackItems _medic;
if (_backpack != "" && _backpack != "B_Parachute") then {
    removeBackpack _medic;
    sleep 0.1;
};
_medic addBackpack "B_Parachute";

Problem: The player is not attached to the medic. He falls to his death. How do I attach the player to the falling medic?

oblique arrow
#

Hm is it possible to display hints in the main menu?

cold cloak
#

@little raptor Sorry to ping you again but the script you helped me with doesnt work for me anymore

#

the heli just yeets itself back to air once it lands

little raptor
#

@languid oyster

Why this is not working 'out of the box' like stated here https://community.bistudio.com/wiki/playMove by placing multiple playMoves, is beyond me
The AI have their own movement system. It's like when you press WASD. So what you added using playMove gets overridden.

#

@cold cloak I'm not sure what's wrong. The script should work if implemented correctly.
Did you get it to work?

cold cloak
#

I mean

#

I use a different trigger now but

#

I fixed that in the sqf file

#

and put the line of script to the wanted triggers activation

little raptor
#

what about the heli?

cold cloak
#

its the MY_HELI

little raptor
#

So no changes?

cold cloak
#

Yeah

#

other than the trigger name

#

but it didnt even work when I had it with the original names

little raptor
#

and you spawn the code?

cold cloak
#

task4d
On activation:
_WP = (group MY_HELI) addWaypoint [getPosASL thisTrigger, -1];

_WP setWaypointStatements ["true", "[] execVM 'land.sqf'"];

MY_HELI enablesimulationglobal true;

little raptor
#

what was the script again?

cold cloak
#

_landPad = createVehicle ["Land_HelipadEmpty_F", ASLtoAGL getPosASL task4d];

MY_HELI land "GET OUT";

waitUntil {
sleep 1;
units group player findIf {alive _x && !(_x in MY_HELI )} == -1
};
deleteVehicle _landPad;
MY_HELI land "NONE"; //take off

little raptor
#

what about task4d?

cold cloak
#

To make the heli not take off until the player group is in

#

task4d is the trigger that activates it

little raptor
#

is everyone in the player's group?

cold cloak
#

Ive tried it only with one player

#

wait lemme add a friend

little raptor
#

no need

cold cloak
#

the heli is a separate group

little raptor
#

that's not related.

cold cloak
#

ah

little raptor
#

So the heli lands

#

But doesn't wait?

cold cloak
#

yeah

#

I just put the landing waypoint to the helipad with no changes to it and a move marker after the land

little raptor
#

it's because the helicopter might have a move order or waypoint after that

cold cloak
#

BrUh

#

then how do I get it to move after everyone is in

little raptor
#

How do you add the waypoint?
After landing

cold cloak
#

I just add the waypoint from the menu

#

like

#

yk in a chain

little raptor
#

Add it using a script

cold cloak
#

ah

#

how?

little raptor
#

@cold cloak
basically:

_landPad = createVehicle ["Land_HelipadEmpty_F",  ASLtoAGL getPosASL task4d];

MY_HELI land "GET OUT";

waitUntil {
sleep 1;
units group player findIf {alive _x && !(_x in MY_HELI )} == -1
};
deleteVehicle _landPad;
MY_HELI land "NONE"; //take off

_WP = (group MY_HELI) addWaypoint [_extractionZone, -1]; 
#

_extractionZone is a position

#

You can either define it in the script, or use a helper object and get its position (like getPosASL helperObj)

#

And of course, if you want more waypoints, you can add them using the same technique. Just add them in a chain one after the other.

cold cloak
#

@little raptor So is the extractionzone where it will go or?

little raptor
#

yeah. just a position

cold cloak
#

aigh

#

now my brain bummer is how do I make the position?

little raptor
#

I explained

cold cloak
#

oh

#

wait nvm

little raptor
#

You can just use some objects with enableSimulation false

cold cloak
#

I just have a invisible helipad with the enablesimulation false

little raptor
#

that works too

cold cloak
#

Im like completly noob with the scripting, so

#

and I cant find any tutorials

#

fekh

little raptor
cold cloak
#

do I need to add the waypoint script to the object itself or?

little raptor
#

Just put it at the end of land.sqf like I showed you above

cold cloak
#

ah

#

i put the variable name as _extractionZone

#

idfk

little raptor
#

which variable?

#

For the object?

cold cloak
#

the invisible helipad

little raptor
#

Never put _ at the beginning of variables if they're global

cold cloak
#

ah

little raptor
#

Name it: helperObject1

_WP = (group MY_HELI) addWaypoint [getPosASL helperObject1, -1]; 
cold cloak
#

ok done

#

im getting some error code

little raptor
#

what

cold cloak
#

like the black box

#

when loading the mission

little raptor
#

i mean whats the error

cold cloak
#

something like 0 elements provided

#

3 expected

little raptor
#

Which script gives you that error? None of them run at startup

cold cloak
#

eh tf

#

it didnt give it to me before

#

just after I changed the invisible helipad

little raptor
#

what did you change it to?

cold cloak
#

helpedobject1

little raptor
#
  1. helperObject1
  2. It still doesnt explain the error
cold cloak
#

lemme dm u

#

ill send u screenshot

#

oh yeah

#

i had actually misspelled the thin

#

wait

#

error message is no more

minor tulip
#

When I script a spawned squad to board a player vehicle/aircraft, they get it but then immediately get out. How to I get them to stay in?

little raptor
#

how do you tell them to get in?

minor tulip
#

I have them get in using:

S1W1 = Squad1 addWaypoint [_Pickup1, 1];
S1W1 synchronizeWaypoint [Raven1P];
S1W1 setWaypointType "GETIN";
little raptor
#

do you add any other waypoints after that?

minor tulip
#

I've tried both. Added additional waypoint or left blank for later trigger.

little raptor
#

if they have any additional waypoints, they'll get out to continue to that waypoint (unless they can drive the vehicle)

minor tulip
#

I see. So should I delete the waypoint at the end?

little raptor
#

the get in one?

minor tulip
#

Yes. Like:

S1W1 = Squad1 addWaypoint [_Pickup1, 1];
S1W1 synchronizeWaypoint [Raven1P];
S1W1 setWaypointType "GETIN";
deletewaypoint [S1W1];
little raptor
#

apart from what you wrote being wrong (deletewaypoint S1W1) I don't think it's necessary. It should delete automatically

minor tulip
#

Thanks. I'll try to make it a simple as possible with no additional waypoints for the group or player and see is they still get out. I appreciate the help and responses.

little raptor
minor tulip
#

That is interesting. Thanks!

little raptor
#

You can also create a manual get in order using that (put a waypoint near the vehicle, then have them mount it using a script)

minor tulip
#

I ended up with one script for the spawn and loading of the AI squad. A trigger that detects the player and squad in the aircraft with a deactivation script to assign new waypoint to GETOUT for the AI. Work ok so far. Maybe not the best approach but it works.
Thanks again @little raptor .

little raptor
#

np

digital jacinth
#

Question, did any one get lip files working with say3d? So far I have generated them and they are right next to the ogg files, same name except the file extension.
however them lips ain't moving

winter rose
#

yup, I believe it has been broken somewhere during Arma 3's lifetime

exotic flax
#

I believe .lib files only work with KBTell.
Only thing that you can use with say/say2D/``say3D` is ```sqf
unit setRandomLip true;

trail wedge
#

any idea why

backpackcontainer player setObjectTextureglobal [0, ""];```
no longer works, but
```sqf
backpackcontainer player setObjectTexture [0, ""];```
does work, but it only to the player it is executed on.
#

was fine before update

little raptor
#

They probably broke it. Report it

still forum
#

@unique sundial ^ ?

#

@trail wedge what u trying? reset to default?

#

u sure that worked before?

little raptor
#

Doesn't it make it invisible?

#

Other textures work tho

winter rose
#

yep - and indeed, setObjectTextureGlobal doesn't work, even in Eden SP

#

(with "")

little raptor
#

Yes

digital jacinth
#

re lip files, man i really wanted to avoid setRandomLip...

ionic anchor
#

@still forum Yep it worked for ages before update, backpacks for police and nhs were invisible for immersion on our altis life server 😄

winter rose
#

use kbTell… sadly the "less" trouble (@digital jacinth)

little raptor
#

@ionic anchor immersion?! You can still see the shadow!

winter rose
#

negative 🤨

digital jacinth
#

(i also am using say3d return value, so kbtell is a nono) oh well

#

funny lip movement it is

winter rose
#

@little raptor it hides the shadow as well (just tested)

little raptor
trail wedge
#

@unique sundial ^ ?
@still forum its supposed to make things invisible

winter rose
little raptor
#

Maybe yours doesn't have any shadow lod

winter rose
#

it's a vanilla one and yes, it casts a shadow on the ground.

little raptor
#

I'm using the carryall backpack MTP

trail wedge
#

either way, global is broken now for invisible

winter rose
#

^ yup

#

(@little raptor I used the kitbag)

little raptor
#

yeah that one looks fine for me too

winter rose
#

and I can concur, the carryall keeps its shadows

#

(booo, BI!)

#

(…wait)

unique sundial
#

because “” is not a texture so it can’t find it since we forced it to look for textures properly to avoid missing texture errors in mp. Easy to replace “”. with transparent procedural texture , can do this directly inside command as special case

little raptor
#

That's reasonable

trail wedge
#

Is there a pre-existing transparent procedural texture?

little raptor
#

procedural textures can be generated by yourself

trail wedge
#

oic

little raptor
trail wedge
#

yes, i tried the alpha and it made it black 😆

#

let me look more

little raptor
#

@unique sundial He's right. 🤷‍♂️

trail wedge
#

i'm never right, let me look further.... 😆

#

even a basic backpackcontainer player setObjectTextureglobal [0, "#(rgb,1,1,1)color(1,1,1,0)"]; (or even 0,0,0,0) just do black the alpha attribute does not apply

winter rose
#

tried rgba argb?

trail wedge
#

yup

#

didnt work, sorry

winter rose
#

well I believe because the backpack will not be (semi-)transparent
so set texture "" is an exception for "don't show this texture"

trail wedge
#

this latest update caused this issue, the problem is applied tosetObjectTextureGlobal, it works fine in setObjectTexture

little raptor
#

Just create an empty png and be done with it!

trail wedge
#

png works local, not global

#
20:49:34 Warning Message: Cannot load texture mpmissions\__cur_mp.altis\rr_textures\misc\backpack.png.```
still forum
#

png?

#

didn't know png was supported...
Only knew paa and jpg

little raptor
#

I meant paa. Create an empty png and convert it to paa. I thought that's self explanatory

still forum
#

but not png

ionic anchor
#

yeah thats the first thing i tried this afternoon, still turns black

#

ill give it another try

amber lantern
#

What are the proper setting to implement escape-like spawning?

#

I can't seem to be able to move the respawn marker

amber lantern
#

that or getMarkerPos is broken (or there's some context that I don't know of)

naive osprey
#

based on the script presented on this page: http://killzonekid.com/arma-scripting-tutorials-forced-ragdoll/
why does this not work?

my_unit = cursorObject;
if (player distance my_unit > 2) exitWith {}; 
   private "_rag"; 
   _rag = "Land_Can_V3_F" createVehicle [0,0,0]; 
   _rag setMass 1e10; 
   _rag attachTo [my_unit, [0,0,0], "Spine3"]; 
   _rag setVelocity [0,0,6]; 
   my_unit allowDamage false; 
   detach _rag; 
   0 = _rag spawn { 
       deleteVehicle _this; 
       my_unit allowDamage true; 
   }; 
little raptor
#

because it's attached

#

attached objects attain the same velocity and position as the "attachee"

winter rose
#

setUnconscious true/false triggers a ragdoll

naive osprey
#

oh! but it works on player... will try setUnconcious

trail wedge
#

.png -> paa still black

little raptor
#

@winter rose The unit immediately switches back to the animation tho

winter rose
#

maybe give it half a second then

little raptor
#

Still, not a true "ragdoll"

#

I mean, when you get hit, the unit stays down for a couple of seconds.

amber lantern
#
_groupPos = [[spawn_area], ["water"]] call BIS_fnc_randomPos;
{
    _x setPos ([_groupPos, 0, 10, 1, 0, 0.5, 0, nil, [_groupPos, _groupPos]] call BIS_fnc_findSafePos);
    _x setDir (random 360);
} forEach (units survivors);

"respawn_west" setMarkerPos _groupPos;

null = [] spawn
{
    _count = 0;
    _pos = getMarkerPos "respawn_west";
    {
        _pos = _pos vectorAdd (getPos _x);
        _count = _count + 1;
    } forEach (units survivors);
    if (_count isEqualTo 0) then
    {
        _count = 1;
    };
    _pos = _pos vectorMultiply ( 1 / _count);
    _pos deleteAt 2;
    "respawn_west" setMarkerPos _pos;
    sleep 10;
};
winter rose
#

hmm, I believe it used to last longer than the set sleep time though 🤔 did the behaviour change now…

amber lantern
#

Any idea why this results in spawning in the ocean?

#

It's defined in initServer.sqf

#

marker with variable name respawn_west of course exists

winter rose
#

did you check the value of _groupPos ?

amber lantern
#

Yeah that works just fine

winter rose
#

_pos = _pos vectorAdd (getPos _x); ??

#

vectorDiff?

amber lantern
#

No I want to calculate the average position

little raptor
#

the average should start from [0,0,0]

winter rose
#

oh true; my bad, getting exhausted lately

#

and yes

#

^

amber lantern
#

@little raptor I want to weight it by the marker pos a bit

#

but hmm

little raptor
#

what are you trying to achieve?

amber lantern
#

A respawn point that follows the squad

little raptor
#

and why did you add a sleep at the end?

amber lantern
#

God damn it, beautiful arithmetic error 😄

#

@little raptor so that it's not consuming CPU all the time

little raptor
#

A respawn point that follows the squad
What do you mean follow?

amber lantern
#

@little raptor literally that? A respawn point that follows the squad around

little raptor
#

God damn it, beautiful arithmetic error 😄
SO fixed now?

amber lantern
#

Hmm, not quite

#

the location doesn't seem to update

little raptor
#

so that it's not consuming CPU all the time
It's at the end of your script. You're making it last for no reason

amber lantern
#

@little raptor ... it's spawn

little raptor
#

so?

amber lantern
#

You think that's the only thing I have running?

little raptor
#

It's pointless anyway. Spawn doesn't run all the time

#

It terminates after 3ms

#

The sooner it gets done the better

amber lantern
#

eh

#

I'm not sure whatcha mean but spawn runs as long as it does

#

If you mean there's a maximum time to yield that's a different thing

little raptor
#

keeping a spawned code in the scheduler only because "you don't want it to consume CPU" is wrong. If it's not "heavy" get it over with.

amber lantern
#

wat

little raptor
#

did you even measure its performance?

amber lantern
#

Ah lol I'm missing the fucking while loop

little raptor
#

@amber lantern Also, if you're trying to add "weight" to your average the first position must have a weight too

#

_count = 0;

#

You're starting at 0 weight

#

_count = 1;

amber lantern
#

You didn't read further :3

#

Anycase, here's the shit as it probably should

#
null = [] spawn
{
    while {true} do
    {
        _count = 0;
        _pos = [0, 0, 0];
        {
            _pos = _pos vectorAdd (getPos _x);
            _count = _count + 1;
        } forEach (units survivors);
        if (_count isEqualTo 0) then
        {
            _pos = getMarkerPos "respawn_west";
            _count = 1;
        };
        _pos = _pos vectorMultiply ( 1 / _count);
        "respawn_west" setMarkerPos _pos;
        sleep 1;
    };
};
little raptor
#

You didn't read further :3
that's what I said in the first place

amber lantern
#

hmm, and apparently [leader this, getPos (leader this), 100] call BIS_fnc_taskPatrol; doesn't work with dynamically simulated enemies/groups?

#

or is it super important to place the code into the group leader instead of into the group?

minor tulip
#

Is it possible to find a marker that a player placed? For example, I would like a player to put down a marker with specific description and have a script use it for a waypoint.

winter rose
#

try allMapMarkers, user-defined ones start with a _USER_DEFINED

minor tulip
#

Thanks. I'll give it a go.

winter rose
#

allMapMarkers*, edited.

solid raptor
#

why do some mods have stuff like z\ and x\ as prefixes in their includes?

amber lantern
#

ah I just suck

#

Hmm my vehicles aren't moving

#

Waaait

#

is there a simulation limit?

slim oyster
#

@solid raptor a byproduct of setting up with filepatching from the work folder in mind

#

ace/acre/mmfw/etc all use a prefix folder and a link to point to the work folder of say a github directory so built pbos can point to the loose files within the same dir

drifting sky
#

Arma2OA, me host and player MP. After respawning, a function is not able to get the correct value for a variable with getVariable. It only appears to be able to get the value of that variable from before I respawned, even if it has since been set to a different value. The function is called by a player from a radio trigger.

cold glacier
#

@drifting sky This is pure speculation, but is the variable set on the player that respawns? It might be something like you're accessing the variable on the old unit, but setting the variable on the new unit.

Unfortunately, A2 was before I got into Arma scripting, so can't offer much more of a suggestion than that!

unique sundial
#

@trail wedge We are going to allow "" again, but I have a question for you, why dont you use hideobject/hideobjectglobal with backpack to hide it? Looks like it works fine

finite jackal
#

You can use the same “” method to hide parts of a vehicle or clothing with multiple hiddenSelections

still forum
#

why do some mods have stuff like z\ and x\ as prefixes in their includes?
@solid raptor
Just a standard that was devised more than a dozen years ago.
Arma has a3/

#

Not really about filepatching

quartz pebble
#

And why lots of classes in the game config end with _F ?

unique sundial
#

F- Futura - internal name for Arma 3

oblique arrow
#

Huh, nifty

#

Hm, any chance anyone knows how I can figure out the names of the standard main menu spotlight tiles?

#

As in the ones that are added by the game/dlcs

dusk gust
#

I would assume you could find them in the config of "RscDisplayMain" >> "controls" >> "InfoDLCs"

oblique arrow
#

Ah I found it under "CfgMainMenuSpotlight", thank you @dusk gust bongocat

dusk gust
warm hedge
#

How about to delete them?

oblique arrow
#

I've tried delete but that didnt seem to do the trick either

#

Didnt work

warm hedge
oblique arrow
#

Ooh yeah true

slim oyster
#

Condition = "false"

tight narwhal
trail wedge
#

@trail wedge We are going to allow "" again, but I have a question for you, why dont you use hideobject/hideobjectglobal with backpack to hide it? Looks like it works fine
@unique sundial many servers will really appreciate this, and as someone else stated, it is used In more places than just a backpack. I will test that method out though.

proper sail
#

@tight narwhal where is your publicvariableserver

#

i see the eventhandler but not the trigger

#

or publicvariableclient

tight narwhal
#

I don't have one, so I guess thats's my problem. On the wiki now, but the description is a bit sparse. How and where should this be used?

naive osprey
#

trying to write a push script, a sort of melee action. staggers target with a small chance of ragdolling. been trying to setvelocity on ragdoll (should fall away from player pos) but i can't get any effect out of it.

#

both by direct call to setvelocity on target after setUnconscious and creating object, attaching it to target and set ITS velocity (and mass)

tight narwhal
#

@proper sail To my understanding the servers missionNamespace setVariable ["playertorespawn", _name, true];will make the variable public for the client's addPublicVariableEventHandler to catch?

proper sail
#

unsure

#

i forgot

#

try manually to see if it fires with publicvariable(client/server)

#

also as its a3, isnt that depreceated anyway and shouldnt you use remotexec

#

im only familiar with a2

whole light
#

Does anyone know how to make an invisible unit that can still be shot? Until the latest patch I was using _spook setObjectTextureGlobal[0,""];

winter rose
#

@whole light same, but with remoteExec and setObjectTexture

ornate sky
#

doesn't setObjectTextureGlobal do that for you?

winter rose
#

not since 2.00

#

the "" support has been removed, might be re added

ornate sky
#

So the problem is in the empty String, not the command itself?

#

I'm asking because I tend to rely on global commands when they exist instead of calling a global remoteExec

winter rose
#

the problem is in the command's behaviour change

#

to hide a backpack, you can still use hideObjectGlobal

whole light
#

@winter rose God bless you man, I was tearing my hair out. Thank you. I'm about to release and suddenly things stopped working.

little raptor
#

@whole light There are also invisible men in Arma: VirtualMan_F

hybrid moss
#

I'm attempting to create a dynamically updating scoreboard that would show up in-game on a billboard or something similar. I have a web backend that generates an image of the scoreboard, is there any way to have that displayed in-game? I was able to use the Example 3 in htmlLoad biki page to show a fullscreen webpage but I'd prefer it to be visible for all players in the 3D world. I don't have much experience in working with custom displays, would somehow be possible to make that into a texture on a billboard? Alternatively, I would be able to place the image file on the root of the arma server and load it from there, but I wasn't able to figure out a way to transfer the texture from the server to the clients. TL;DR: I'd like to show a dynamic image from the internet on a billboard, is that possible?

whole light
#

@little raptor If they are using the invisible uniform, unfortunately they can't be shot or otherwise damaged. The empty textures method allows them to still take damage.

little raptor
#

Right. Didn't realize that

cinder fern
#

Would anyone be able to tell me how to write a script that would hide roads? I about the nearestTerrainObjects command, but I can figure out how to script it so it only hides roads.

winter rose
#

well, how do you call it?

little raptor
#

nearRoads?

#
[worldSize/2,worldSize/2] nearRoads worldSize/2 apply {_x hideObject true}
#

This probably only works with bridges

hot kernel
#

may I have a little help formatting this,

_buildingARR = [_buildingARR, [], {_x distance _centre}, "ASCEND",{ (count _x buildingPos)>2 }] call BIS_fnc_sortBy;

_buildingARR is an array of nearby buildings. I want to filter out buildings with no building position and sort by nearest. Any ideas?

little raptor
#
_buildingARR = [_buildingARR, [], {_x distance _centre}, "ASCEND",{count (_x buildingPos -1) == 0}] call BIS_fnc_sortBy;
#

You mean you want to exclude buildings with no pos? The above includes them.

#

If so:

_buildingARR = [_buildingARR, [], {_x distance _centre}, "ASCEND",{count (_x buildingPos -1) > 0}] call BIS_fnc_sortBy;
hot kernel
#

right, so I'm left with an array of nearby buildings with available building positions

little raptor
#

Use the second one

hot kernel
#

thanks so much!

cinder fern
#

Yes, how do you call it. I’ll try your script @little raptor. Thank you.

little raptor
#

You should be able to call it in the init.sqf

#

Only call it once

#

It's slow

cinder fern
#

Okay will do. Much appreciated!

grizzled lagoon
#

Hello i have question for delete word in the string, I have look compile or split string but that does not solve my problem

#
_tomate = "sauce ketchup mayonaise";```
#

and i want to delete just ketchup

unique sundial
#

splitString deleteRange joinString or toArray deleteRange toString or select + select

grizzled lagoon
#

thanks @winter rose

#

Thanks @unique sundial but for my script i want delete name player in public variable and is not position is name

winter rose
#

you can find in string (but a replace command would be nice 😛 *hint, hint*)

robust brook
#

did addAction get changed after 2.0? Or ever had issues working with default mission objects?
seems to be working flawlessly with spawned in objects via createVehicle/createVehicleLocal tho.

winter rose
#

I don't think so, why?

robust brook
#

I'm trying to use an addAction on a default mission object, doesn't seem to work at all. Then I tried using createVehicle/createVehicleLocal with the same object classname and it worked perfectly.

#

even when I return the cursorObject on the default mission object, it returned the same classname I was wanting? so idk

winter rose
#

default mission object
terrain object? editor object?

robust brook
#

terrain

winter rose
#

maybe that one is a simpleObject? IDK

robust brook
#

returns false for isSimpleObject tho hmmm

winter rose
#

@robust brook if typeOf cursorObject returns "" you cannot add an action.

robust brook
#

It doesn't, but I already found the issue, thanks for your help. 🙂

winter rose
#

(coding issue?)

robust brook
#

side check 🤦‍♂️

winter rose
#

🔨😄

minor elbow
#

How to add the menu which provides to the player: Virtual Arsenal, Repair vehicle, rearm, refuel, etc ?

minor elbow
#

Where must I add them ? @little raptor

quartz pebble
#

Any way to reliably detect player changing his view from 1st_person to 3rd_person?

robust hollow
#

possibly this

findDisplay 46 displayAddEventHandler ["KeyDown",{
    if (_this#1 in actionKeys "personView") then {
        // view changed
    };
}]
quartz pebble
#

And what if tricky player maps the 3rd_person key to a mouse?

robust hollow
#

i guess you could use a loop.

quartz pebble
#

That's definitely a bulletproof solution, but I was hoping for something more elegant

robust hollow
#

i thought there was an event for changing view but i cant seem to find anything 🤷

quartz pebble
chilly wigeon
#

Anyone know if isNotEqualTo made it into 2.00?

robust hollow
#

it did not

chilly wigeon
#

TIL

#

ty for the info

compact maple
#

Hi, what is the cmd to select an item in a combo box ?

#

found it > lbSetCurSel

unique sundial
#

@quartz pebble you can try using inputAction instead inside onkeydown and onmousedown ehs

tough abyss
#

hello i want to add a jump function to my server so i can jump when i press space does someone have a good script for this?

little raptor
#

I once wrote something for fun. But you shouldn't use it as it is. It is just something to help you get started.
Call this in the debug console:

initV = (velocity player select [0,2]) + [0]; 
onEachFrame { 
 if !(isTouchingGround player) exitWith { 
  onEachFrame { 
   if (isTouchingGround player || velocity player select 2 <= 0) exitWith { 
    onEachFrame ""; 
    player setVelocity ( velocity player vectorDiff [0,0,0.5]); 
    player playMoveNow "amovpercmstpsraswrfldnon" 
   }; 
  } 
 }; 
 player setVelocity (initV vectorAdd [0,0,5.5]); 
}; 
player switchMove "afalpknlmstpsraswrfldnon";
unique sundial
#

@unique sundial new command “getAllUnitTraits”
@tough abyss @still forum <----

quartz pebble
#

@unique sundial I could not make inputAction work with mouse. I.e. if someone binds an action to RMB, then inputAction always returns 0 when RMB pressed.

unique sundial
#

let me check. what is the action?

#

@quartz pebble

quartz pebble
#

it was personView

tough abyss
#

ok thx

compact maple
#

If I want to receive a control (combobox) in param, by what should I replace ""

params [
  ["_comboboxTexture", "", [""]]
];
#

is there a type for controls?

little raptor
#

typeName controlNull

compact maple
#

Thank you.

minor elbow
#

Hello everyone, how to add a menu which provides to the player: Virtual Arsenal, Repair vehicle, rearm, refuel, etc ?

distant oyster
little raptor
distant oyster
#

oh

minor elbow
#

Thanks a lot but where do I add these codes ?

little raptor
#

Do you even know any SQF?

minor elbow
#

Nop

little raptor
#

So how do you hope to use them anyway?

#

What you ask for requires writing code in sqf. Without knowing any sqf, you can't do it.

minor elbow
#

Thanks a lot, I'll learn that

still forum
#

@tough abyss is there a command to get the value of a custom trait?
can you show example of getAllUnitTraits output how it looks like when your value is missing?

little raptor
#

@still forum Custom traits are broken anyway.
example:

player setUnitTrait ["Trait", 1, true];
player getUnitTrait "Trait"; //-> Returns: true
getAllUnitTraits player //-> contains ["Trait", "Custom"]
player setUnitTrait ["Trait", true, true];
player getUnitTrait "Trait"; //-> Returns: true
getAllUnitTraits player //-> contains ["Trait", "Custom"]
player setUnitTrait ["Trait", false, true];
player getUnitTrait "Trait"; //-> Returns: false
getAllUnitTraits player //-> Misses "Trait"
still forum
#

Yeah I'm pretty sure they are only stored as "set"/"not-set"
and don't actually have any value

fluid wolf
#

Oh my god I am losing my mind. Does rscTitles not work with Ace?

still forum
#

But somehow i still have faith in people it seems. I should stop that

little raptor
#

Yeah. You can always use setVariable to have real "custom traits" .

#

But I think if it returned true instead of "custom" it would be better.

still forum
#

how do you differentiate from bool traits that are not custom then

#

and now is a bit late for that

little raptor
#

Aren't they (vanilla ones) always constant? Every time I test I get:

getAllUnitTraits player apply {_x#0};
//gives:
["Medic","Engineer","ExplosiveSpecialist","UavHacker","CamouflageCoef","AudibleCoef","LoadCoef"+custom traits]

So the first 7 ones are vanilla. In that exact order.
anyway, I don't use them so it doesn't matter to me either way.

astral dawn
#

Does RV game loop update physics of objects at fixed or varied time step?

#

Just wondering

tender fossil
#

Hey! Why does this script complain about the last then ("No syntax for 'VARIABLE then'" error)? (NOTE: Arma 2: OA v1.64)

private ["_unit","_weapon","_rocket","_ammo","_missile","_currentMag","_ammoCount"];

_unit = _this select 0;
_weapon = currentWeapon _unit;
_muzzle = currentMuzzle (gunner (vehicle _unit));
_ammo = _this select 4;
_rocket = nearestObject [_unit,_ammo];

if (isNull _rocket || ({isPlayer _x} count (crew _unit) == 0)) exitwith {};

_missile = ["M_AT5_AT","M_AT13_AT","M_TOW_AT","M_TOW2_AT"];

if (!(_ammo in _missile)) exitWith {};

_unitStartZDeg = atan ((vectorDir _unit) select 2);
_rocketStartZDegDiff = ((atan ((vectorDir _rocket) select 2)) - _unitStartZDeg);

_rocketZDegDiffMax = -500;

if (_rocketStartZDegDiff > 25) then {
    while {!isNull _rocket} do {
        sleep 0.1;

        _currentRocketZDeg = atan ((vectorDir _rocket) select 2);
        _currentRocketZDegDiff = _rocketStartZDegDiff - (_currentRocketZDeg - _unitStartZDeg);

        if (_currentRocketZDegDiff > _rocketZDegDiffMax) then {
            _rocketZDegDiffMax = _currentRocketZDegDiff;
        };
    };

    if (_rocketZDegDiffMax > 25) then {
        ["WARNING", Format["Player with UID [%1] was detected to be possibly missile glitching. (Max angle difference in [Z,(X,Y)] plane: [%2°]", srt (getPlayerUID _unit), _rocketZDegDiffMax]] Call WFBE_CO_FNC_LogContent;
    };
};
robust hollow
#

dunno about any issues with then, but i do notice in that scope you have srt instead of str

tender fossil
#

I'm using the IntelliJ IDEA SQF plugin, so it might be the syntax checker itself that's faulty

#

@robust hollow Oh ffs lol! It fixed the issue 😄

#

Thanks!

brave jewel
#

Sometimes the dumbest things make stuff crash notlikemeowcry

little raptor
#

such as?

winter rose
#

…the user 😄

tough abyss
#

Lol

latent crystal
#

Not necessarily related to scripting but this looks like the most relevant channel. But anyway i am in need of a developer to help me start my arma 3 server/altis life i think. can anyone help me?

warm hemlock
#

Hello, I am currently working on a simple mission that spawns the enemys when you are close to the area. This is the code i have https://pastebin.pl/view/07498808 works in SP but not on my dedicated server. Also i am not a star at scripting so i dont know what the problem is, i think its to do with the waitUntil {player distance area1 < 1000};

#

Can somone see the issue here?

little raptor
#

@warm hemlock Why don't you simply use triggers?

#

The issue is what you said. Player is not defined on a dedicated server

warm hemlock
#

I would need to place down a lot of tiggers, wanted to try it this way

#

How would i define it so that when any player gets close it will activate

little raptor
#

I would need to place down a lot of tiggers,
There's only one area (?!)

warm hemlock
#

for now there is

#

there will be a lot more

little raptor
#

I still recommend triggers.
But if you insist:

 waitUntil {allPlayers findIf {_x distance area1 < 1000} != -1};

Unless your players can move at 500~1000 m/s (1800 - 3600 km/h!), you're wasting way too much performance there. I recommend that you add delay to the code:

waitUntil {
  sleep 1;
  allPlayers findIf {_x distance area1 < 1000} != -1
};
#

The area is big enough for that sleep number.

warm hemlock
#

Okey, check it out. Thank you!

little raptor
#

@warm hemlock the same thing goes for the loop at the end

#

Use an event handler or something. You don't need loops to know when a unit is dead

finite sail
#

The wonderful thing about tiggers, is tiggers are wonderful things

#

Yes, I'm a father of young children

warm hemlock
#

I know i would normaly use triggers, but for this i wanted to try it this way

little raptor
#

@warm hemlock You know you can create triggers dynamically right? You don't have to place them down in the editor

warm hemlock
#

I did not

little raptor
#

You can do everything you do in the editor with these scripting commands, and even more

warm hemlock
#

Cool, ill us this then

tiny wadi
#

Is it possible to check if a rope is tight or if it has slack?

winter rose
#

You can still ask her?

tiny wadi
#

Seems what I can do is check if the ropeLength minus the distance from the end positions is greater then some threshold

#

Haha

trail smelt
#

Hi, i using "player setPos (getMarkerPos "tele_1");" for teleport in trigger zone but i need teleport all people from blufor after some one step in trigger zone how to change it this code ? thanks.

exotic flax
#

Loop over all players, and TP them one by one

trail smelt
#

eh in this trigger zone is more events like skipTime ..

drifting sky
#

Does deleteGroup count toward reducing the total group count for a faction? It seems my groups stop respawning after a while, even when deleting the empty groups.

robust hollow
#

yes it does

drifting sky
#

Actually, reading the wiki suggests I may have been making the error of trying to delete the group before dead units had been removed from it.

#

I presume that means that units group_name must have a count of zero

#

and that there aren't any other requirements, such as assigned vehicles.

robust hollow
#

you can set groups to delete once they are empty

drifting sky
#

you mean where count units _group == 0?

#

is that the exact definition of empty?

brave jewel
#

Is there a way to reduce the knowsAbout value ?

drifting sky
#

Sorry, I'm in Arma2OA

robust hollow
#

oh

brave jewel
#

I am thinking about something like ```sqf
_unit reveal [player, 0];

robust hollow
#

yea just wait for count units group == 0 then

drifting sky
#

alright, thanks

obtuse gulch
#

Hi! I was wondering if there was a way that I can have a trigger loop through and turn on and off a red light until someone steps out of the trigger area. I Googled it and I couldn't really find too much. I would also want to make sure that every player can see the light changing and that it's not just client side. How would I go about this? Thanks!

forest ore
#

Is it somehow possible to retrieve vehicleClass info of an object? For example the vehicleClass of a vest (that should be "ItemsVests")

unique sundial
#

typeOf

forest ore
#

Thanks KK. I was already playing with typeOf but guess I'm just using it the wrong way in my case. And the wrong way in this case is that I'm using it to compare to a string and yeah, the game already told me that🥲

winter rose
#

@forest ore BIS_fnc_returnParents ?

light badge
#

Hi all, is it any way to rotate an object created with the "createSimpleObject" command?

forest ore
#

@winter rose Was looking a way to pull information from object configs. While there are ways it occurred slowly to me that it's difficult to pull info that isn't there to begin with

winter rose
#

@light badge setDir?

#

ah yes, for the type of "item" (vest/helmet/accessory/etc) you have to check other values in the class @forest ore

light badge
#

@winter rose great, ll tru later

forest ore
#

Lou, indeedly seems to be so. Going to have to find another approach to do the comparing I'm looking to do

winter rose
#

which is?

forest ore
#

Complicated? ☺️ (as per usual)

little raptor
#

Maybe if you explained what you're trying to do you could get more help. Maybe you want something extremely simple and you're just making it harder for yourself because you don't know where to look.

sleek sail
#

Is there any good tutorial how to write custom editor modules?

winter rose
#

not really, because a module can really be whatever you want it to be!

sleek sail
#

I mean for the internals, how to setup simple module to just print hello world on load for all synced units for example.

winter rose
#

if you want to create a module, you have to know scripting
only then can you check module functions to see how to organise your code

little raptor
#

Creating the module object itself (what is shown in editor) is easy tho

sleek sail
#

But I'm not sure if I need to make it addon, is it possible to create it in mission only first (for faster development)?

#

Describe module in description.ext for example.

little raptor
#

A module is essentially an object that executes its predefined codes when placed down

winter rose
#

why make it a module, if you can script it for the mission?

little raptor
#

So for "testing" you just need to make a function that works

sleek sail
#

sure, that's what I can prepare

#

But I would like to get some insight how the synced objects are passed in modulized version.

#

for example

little raptor
#

synchronizedObjects _module?

sleek sail
#

ahh, so it is not passed anywhere, you need to get it like that

#

👍

#

Anyway any idea if you can use mission description.ext to define module or do you need to make addon with config.cpp?

winter rose
#

addon mandatory

little raptor
#

I'm not sure, but I don't think so. If you're using the dev build, they have introduced an import function that allows you to modify the config. But I'm not sure if it's compatible with cfgVehicles.

#

what do you think Lou?

sleek sail
#

that import seems javascriptish/pythonish 😮

winter rose
little raptor
#

is CfgModules a thing?!

winter rose
#

might actually not be 😄

little raptor
#

I couldn't find anything on it! Not even in the game config!

winter rose
little raptor
#

I mean does the vehicle "register"? As in can you actually create it?

sleek sail
#

Actually the reason I'm trying to go without addon for now is code reloading.

#

But as I see it could be not problem if you have proper setup. 🤔

little raptor
#

code reloading
?

winter rose
#

you can import, but you cannot create a new vehicle class in description.ext no

little raptor
#

hmm. What I thought

sleek sail
#

Once I change some sqf file in addon I would like to prevent repacking pbo and restarting game.

winter rose
#

@sleek sail mission scope = function (CfgFunctions)

little raptor
#

^

winter rose
#

an addon is a dependency for clients that then have to download it, you have to update it etc
just clutter, when everything could be compacted into one pbo, the mission one

sleek sail
#

That's ok actually. We do have custom addon for our missions already.

little raptor
#

Also, if you're not trying to create something for someone else (as in a mission creator, like ALIVE), don't use modules. Just use normal code

winter rose
#

modules are for easy Eden usage, but are heavier than just functions

#

they create a Logic entity, etc

sleek sail
#

I think for my purpose I can actually create empty markers and sync them together. That could be possible as well.

willow hound
#

You could develop your sqf code against arbitrary dummy module values (some hardcoded position instead of module position for example) until your code works and then introduce the actual module after that.

sleek sail
#

Later I can pack it as an addon modulized.

little raptor
#

what are you trying to do, if you don't mind me asking?

sleek sail
#

I'm from Warfare RE community, my plan is to rebuild a simple CTI using as much as possible from modules in game.

#

I was looking at Warlords modules.

winter rose
#
params [
  ["_markers", [], [[]]]
];
if !(_markers isEqualTypeAll "") exitWith { ["Arguments must be marker names"] call BIS_fnc_error };

// code
``````sqf
// calling
[["marker1", "marker2", "marker3"]] call RET_fnc_myFunction;
#

you can make the function first, and make the module use it then

sleek sail
#

yup, I'll do that, thanks for the insight

winter rose
#

we didn't know from outside if your goal was to create a module set or if it was a way to reach your goal ^_^

sleek sail
#

My goal is to make it possible for non-scripting guys to create another map layout easily later. They usually add a lot of objects (bunkers, outposts, ...) to map to make it more immersive regarding our theme on the map.

My idea was to introduce main game logic module and "sub-modules" synced to main module for fighting sectors (cities) with ability to select (for example) resistance strength (infantry only or light vehicles, tanks, helis) from module custom options (dropdown).

#

But yeah, I can start with markers and passing options as a parameters to executed functions onInit for example.

#

That's how we do it right now actually. It is probably still too soon to make it modules.

compact maple
#

Hi, I have in a dialog class :

onLBSelChanged = "[_this] call test_onLbSelChanged;";

and in my function

params ["_control", "_selectedIndex"]; //according to wiki
diag_log format ["index [%1]", _selectedIndex];

But _selectedIndex is undefined ?

#

Am I supposed to add an event handler on the ctrl to use these variables ?

little raptor
#

@compact maple ```sqf
onLBSelChanged = "call test_onLbSelChanged;";

#

or ```sqf
onLBSelChanged = "_this call test_onLbSelChanged;";

This one is redundant tho
#

you're putting the params (aka _this) in an array

#

also, when not sure, log _this too

#

You could've figured it out if you simply tried:

diag_log str _this;
compact maple
#

Got it, I am giving this a try

#

its working! ty 🙂

little raptor
#

Is it possible to get a list of all folders in the missions folder? (similar to the dialog that opens when you want to open/save the mission)

winter rose
#

directory browsing is not a thing afaik

#

could be very dangerous too I think 👀

little raptor
#

I just want to see the folders that the game sees there! aka mission folders

little raptor
astral dawn
#

file access is impossible without extensions unfortunately

little raptor
#

Have they changed the unscheduled environment error handling?
To my surprise I don't get an error with:

waitUntil {true}

in debug console (?!)
Basically, if the condition is satisfied immediately, it doesn't throw an error.
Like

waitUntil {time > 0}

Was it like this before?

astral dawn
#

Basically, if the condition is satisfied immediately, it doesn't throw an error.
I think I've read somewhere a long time before that waituntil works like this in unscheduled

little raptor
#

Huh. I always thought that the game will freak out as soon as it sees waitUntil in unscheduled environment!

torn juniper
#

Where do I put function suggestions monkaThink I would enjoy an infantry version of addWeaponWithAttachmentsCargoGlobal - perhaps addWeaponWithAttachments 😄

little raptor
meager granite
#

@torn juniper You can do that with several already existing commands, unlike addWeaponWithAttachmentsCargoGlobal which wasn't possible before its introduction (without insane bs)

torn juniper
#

@meager granite just for a cleaner implementation is all, my main trouble is adding in specific ammo count to a weapon.. if they already have that type in their inventory it will use the other mags first when adding a weapon

#

Reworking my mod with updated commands does help with removing a lot of duping methods it caused though lol

meager granite
#

It lets you specify ammo count

torn juniper
#

Yes

#

But if you add the weapon first, it takes inventory ammo

#

So you lose a mag since on fail it doesn’t add to inventory

#

(Fail being ammo already there)

meager granite
#

Well you can just create it back

#

More extra steps though, I guess

torn juniper
#

I currently do a check to see if the weapon has a current mag then add it in inv if so, weapon if not

meager granite
#

Btw, you can use trickery we had to use before addWeaponWithAttachmentsCargoGlobal

#

But the other way

#

Have some local container somewhere, create weapon there, then do TakeWeapon action

#

Alternatively use some existing uniform\vest\backpack container

#

Though if is already such a weapon there it might take wrong one

#

Downside is that player plays "take" animation

#

but maybe you can break\prevent it with some another trickery

#

(Before that command we had to spawn AI that was creating a weapon with needed attachments and magazines and then DropWeapon it into needed container lol)

torn juniper
#

Oof

#

Yea I see what you mean

#

I was leaning towards using setplayerloadout

#

Read in current inventory and just replace it as a whole

#

Hopefully there isn’t much shock change with setting a new loadout, but I will test it a bit

#

Plus that way it stays in the same format as addweaponw/attachment to cargo

#

My whole mod is a hack of how arma works, one other thing wont hurt

unique sundial
#

Was it like this before?
@little raptor was always this way

grave stratus
#

hey guys, how do i make this work on MP server for every client?

_aiai = [a1,a2,a3,a4,a5]

for "_i" from 0 to (count _aiai - 1) do {
    _this = _aiai select _i;
    _this playAction "Salute";
};            
sp1 Say3D ["lagunegaraku",350];
sp2 Say3D ["lagunegaraku",350];
sp3 Say3D ["lagunegaraku",350];
sp4 Say3D ["lagunegaraku",350];

It is executed by addAction. Problem is the say3D only run on the client that click on it and not for every client.

And the salute doesnt happen on dedicated server but is okay on 3den's mp

little raptor
#

Execute say3D globally
Execute playAction on the appropriate target machine
These commands are the exact opposite of each other (in terms of locality)

slim oyster
sharp grotto
#

For me say3d is global even without remoteexec thonk

little raptor
#

It can't be

sharp grotto
#

nvm it was playsound3D

grave stratus
#

thanks guys i got the say3D remoteExec thing but executing playAction for every player? i need to loop every player?

grave stratus
#
_allPlayers = call BIS_fnc_listPlayers;

{
    for "_i" from 0 to (count _aiai - 1) do {
        _this = _aiai select _i;
        _this playAction "saluteOff";
    };
} forEach _allPlayers;

this does not work either

robust hollow
#

playAction needs to execute on the machine where the unit is local.

    for "_i" from 0 to (count _aiai - 1) do {
        _this = _aiai select _i;
        [_this,"saluteOff"] remoteExec ["playAction",_this];
    };
grave stratus
#

ohhh so target it using remoteExec, cool. thanks again

robust hollow
outer fjord
#

Is there a way to make a attach item follow the drawer animations in the rugged desk?

outer fjord
#

I noticed if I just do the usual attachto, it just stays in it's specific spot even if animations played

nova sage
#

what is the most efficient workflow for playing around with custom scripting on a dedicated-server? It seems there's gotta be something better than make change -> export -> upload .pbo -> restart server -> join -> fail -> redo..I'm pretty new with doing this on a server so sorry if its a super simple question

robust hollow
#

depends on what you're doing exactly.

if you use a local dedicated server for testing you don't need to upload the pbo, just move it to the server mpmissions folder.
if you dev with filepatching enabled you only need to recompile functions instead of repacking the pbo and starting the mission again.
or alternatively you can use debug console to execute changed code until you have it right.

nova sage
#

I'm working on a remote server, it seems like the best option would be to setup a local dev environment and work there, but to be honest I don't know much about filepatching

unique sundial
#

@tough abyss utils 5

still forum
#

Huh. I always thought that the game will freak out as soon as it sees waitUntil in unscheduled environment!
@little raptor
The game freaks out when you try to suspend in a non-suspendable environment. You are skipping the suspend here, thus no error.

little raptor
#

@still forum Yeah. I realized that after seeing it throws no error. I always thought that the suspension part occurs before the condition. So waitUntil {condition} is essentially the exact equivalent of this, right?

while {!condition} do {uiSleep 0.001};
still forum
#

i guess so yeah

still forum
#

I'd imagine the force to be in newtons

jade abyss
#

Yep

jade abyss
quartz pebble
#

how do I make an AI to continue following waypoints after stop/doStop/commandStop etc ?

warm hedge
#

commandFollow or doFollow I believe

quartz pebble
#

its syntax is unitName doFollow unitName2 so I don't believe this is it

warm hedge
#

Also is used to resume unit formation after doStop, just doFollow leader even if it is the leader himself you want to resume (see Example 2).

digital plover
#

Players who want to connect to the server cannot connect to the server due to the missing mode and they get this error. http://prntscr.com/v2erc5 Is there a script that notifies the player when the mod is missing? A custom missing mod warning script that will appear instead of the error in the photo ?

little raptor
#

no

digital plover
#

For example: You have the missing mod. Please try again by adding the @BreakingPointWeapons mod

winter rose
#

yeah, but no ^^
because of file loading
you could do it by checking with configFile / isClass

little raptor
#

You'd have to query the allowed mods on the server. There's no command for that

astral dawn
#

How often does dedicated server has language set to non-english actual local language? How does it work? Or is DS always english? i am wondering how good it is to localize strings server-side.

winter rose
little raptor
#

@winter rose

You'd have to query the allowed mods on the server. There's no command for that

winter rose
#

not on the server, no
client-side only compared to a hardcoded list, yes

#

also, one can make a function to get server mods 🙂

digital plover
#

Can you help me how to do this? @little raptor

#

I don't have much code knowledge.

#

If you show an example I can edit it for myself

little raptor
#

also, one can make a function to get server mods 🙂
How? @winter rose

#

I don't know myself. Lou is the one who said it's possible. I say it's not.

digital plover
#

Does this code work for me?
https://community.bistudio.com/wiki/getLoadedModsInfo

_loadedMods = getLoadedModsInfo;

    [
        ["CUP Units DEV Version r710 (r710-r710 UNITSSVN) (12|Jun|2020)","@[DEV] CUP Units",false,false,"GAME DIR","f3fb8a4c62443ac799c7c0e00f645b1f32cf1376","c96577b4","F:\Steam\SteamApps\common\Arma 3\!Workshop\@[DEV] CUP Units",0],
        ["CUP Weapons DEV Version r1486 (r1481-r1486 WEAPONSSVN) (12|Jun|2020)","@[DEV] CUP Weapons",false,false,"GAME DIR","6dbd7c052ce2ae68803e10f6a3653d0b046881d8","bb1c4965","F:\Steam\SteamApps\common\Arma 3\!Workshop\@[DEV] CUP Weapons",0],
        ["Community Base Addons v3.15.1","@CBA_A3",false,false,"GAME DIR","33eef5c0ed583d1222319460b184090513193287","131bbb64","F:\Steam\SteamApps\common\Arma 3\!Workshop\@CBA_A3",0],
        ["Arma 3 Contact (Platform)","enoch",true,true,"GAME DIR","a4ee0aa9675b9578de2c2742dfa75f14b463b311","2c003588","F:\Steam\SteamApps\common\Arma 3\enoch",1.02179e+006],
        ["Arma 3 Tanks","tank",true,true,"GAME DIR","f20f91e6d4de2f912c9aef10440b9f7cdd9186ba","ee2006c9","F:\Steam\SteamApps\common\Arma 3\tank",798390],
        ["Arma 3 Tac-Ops","tacops",true,true,"GAME DIR","e173f6dac22cbfba9a80f06ab6274f283a79ccf1","99fbe961","F:\Steam\SteamApps\common\Arma 3\tacops",744950],
        ["Arma 3 Laws of War","orange",true,true,"GAME DIR","483d1b17bba31a73aca3382baca90726e5fb3b27","85779468","F:\Steam\SteamApps\common\Arma 3\orange",571710]
    ]
winter rose
#

@little raptor @digital plover
save the output of server-side allAddonsInfo in a global variable and publicVariable it, or use BIS_fnc_getServerVariable, or maybe many other ways

little raptor
#

What about someone who's not connected to the server yet?

warm hedge
#

What do you mean by work in this context?

winter rose
#

@little raptor I am only talking about someone that is connected; outside of the server, no can do (but parse the -addons server parameter)

little raptor
#

well I think that's what he's asking (and what I mean by not possible)

winter rose
#

then indeed - that's game-side, nothing scriptable

#

I thought it was about a sudden "this mod is required" in a mission that does not list its dependencies (e.g modded vehicle created with createVehicle)

little raptor
#

And why would you want to know if you're missing mods if you're already connected?!

#

The server wouldn't let you join in the first place!

digital plover
#

I am asking exactly this.I want to give a missing mode warning for someone who has never connected to the server

winter rose
#

in a mission that does not list its dependencies (e.g modded vehicle created with createVehicle)
@little raptor
some servers are weirdly configured…

#

@digital plover anyway - join using the launcher, it will d/l the mods for you

little raptor
#

from the server? I actually never tried that. I always join in-game

winter rose
#

from Steam

little raptor
#

what about non-Steam mods?

winter rose
#

no cigar

digital plover
winter rose
#

yeah, but no

little raptor
#

If you want to change that message, you can simply remove the control and place a new control there!

digital plover
#

I cannot explain this to the players.

#

Can't say they should use A3 Launcher

winter rose
#

¯_(ツ)_/¯

#

you can make an html mod list to be loaded in the launcher

little raptor
#

If you want to change that message, you can simply remove the control and place a new control there!

#

I don't know the IDD of that display/IDC of that control tho

digital plover
#

ok i will ask another question

winter rose
#

runs away 😄

digital plover
#

how @winter rose

winter rose
#

by using your legs, one step after another?

digital plover
#

what ?

#

I have html information

winter rose
#

yeah…?

#

I don't get what you are asking

digital plover
#

sorry i misunderstood

little raptor
#

I think you guys are both misunderstanding each other!

digital plover
little raptor
#

I don't know the IDD of that display/IDC of that control tho
If I did I would help you get rid of the message in the first place!

winter rose
#

change the background? …with a mod 😄

little raptor
#

long story short, find the IDD, replace the background image (a control) with another image

digital plover
#

I wish I had more knowledgeable players 🙂

#

Most players trying to connect to my server try to login without downloading mods.

winter rose
#

yeah well, if you need a mod to tell them to get a mod… you see the issue I suppose

little raptor
#

They can see the list of mods in the server browser too!

digital plover
#

Only 1 mod seehttp://prntscr.com/v2fhol

#

Why doesn't she list the other two mods here?(

winter rose
#

scroll up?

digital plover
#

not see

little raptor
#

mods are always at the bottom afaik

digital plover
#

only 1 mod appears at the bottom @Exile

#

I don't have two other modes

little raptor
#

But it should still show the mod. That's weird

digital plover
#

Do I have to write special code into my server mode to show it here?

#

My Own Server Mod..

winter rose
#

nope

compact maple
#
[_vehicle,(_vInfo select 8)] remoteExecCall ["colorVehicle",_unit];
[_vid,_pid,_vehicle,_unit] remoteExec ["spawnVehicleColor",2];

is it possible that the second line is finished before the first one end ?

still forum
#

shouldn
z

#

but your function names are missing their prefix it seems

compact maple
#

I shortenen them because they are so long

#

it shouldnt ? but it is possible ?

#

The first line apply a texture to a vehicle, the second line apply custom color to the vehicle if the custom color exists.
It happens than the second line is executed before the first line end, so the texture override the custom color, Idk if I'm clear.

crisp turtle
#

I have a question: Is it possible to change vehicleconfig values via script? Specifically the maxspeed variable, which (If my understanding is correct) only forces a maximum speed to the AI driving the vehicle?

still forum
#

no

winter rose
still forum
#

do yo uwant a speed limiter for players?

crisp turtle
#

Not players

winter rose
#

limitSpeed then?

crisp turtle
#

I'm working on a "one man" tank, so i need to limit the AI crewman under the player's control

#

I think limitspeed should do the trick, thank you!

still forum
#

AI obeys limitSpeed

crisp turtle
#

I'll tie that to to a bunch of actions with different speeds, should work as a "max speed" selector of sorts

vernal venture
#

Trying to set Dynamic Simulation on via script.

if (side _x == INDEPENDENT) then {
_x setskill ["aimingAccuracy",0.1];
_x setskill ["aimingShake",0.5];
_x setskill ["aimingSpeed",0.5];
_x setskill ["spotDistance",0.2];
_x setskill ["spotTime",0.2];
_x setskill ["courage",1.0];
_x setskill ["commanding",1.0];
_x setskill ["reloadSpeed",0.2];
_x allowFleeing 0;
_x enableDynamicSimulation true;
};```
Should that work, or do I have to get the group of _x and set it that way?
hollow thistle
#

dynsim works on group level for units.

vernal venture
#

So then I'd need a couple extra lines to get the group and set it that way. As simple as

_xy = group _x; 
_xy enableDynamicSimulation true;
``` I hope?
winter rose
#

most likely yes
use allGroups if needed, faster than allUnits

vernal venture
#

Can I setskill on groups? If not, I think I need to stick with forEach allUnits;

winter rose
#

you can setSkill forEach units _group

vernal venture
#

https://pastebin.com/HcXY8QUF is what I'm working with. Would it be as straightforward as changing the forEach there, or would I need to redo it a bit more than that?

little raptor
#
{
  _x enableDynamicSimulation true;
  {
    _x setSkill [....];
  } forEach units _x;
} forEach allGroups;

What's the point of the sleep 10 at the end?

vernal venture
#

Even 10 is probably shorter than it needs to be, really.

little raptor
#

I mean it's not even a loop or anything. (?!)
Is that a small part of the whole script?

#

Also:

if (side _x == _side) exitWith {...}

Why do you keep checking the side?
Of course, the more optimized version is to use call ([{...},{...},{...},{...}]#(_sides find _side)) , (with both arrays pre defined instead of making it like this) but meh

vernal venture
#

It's a script being called with execVM in the init script. The idea is to give the settings to any new AI that get spawned in later.

tropic summit
#

is there a reliable way to use handleDamage EH without manipulating damage at all? Alternatively, is there a more efficient MP friendly EH I can use that returns hitpoint, damage, and projectile data?

winter rose
#

you can return a passed value in handleDamage to prevent overriding any normal behaviour

tropic summit
#

I was under the impression returning any numerical value would override normal behavior

winter rose
#

yes - but if you return the provided damage value, no changes

#

return _damage and that's it

tropic summit
#

ah so if i simply return the _damage value it will apply as normal?

winter rose
#

yep

tropic summit
#

gotcha

winter rose
#

(dang, I have negative ping)

tropic summit
#

is there a better method than just exitwith?

winter rose
#

exitWith doesn't really work properly in EH iirc
use if then else

tropic summit
#

hmm

hollow thistle
#

exitWith inside handle damage body clousure will break the chain of handlers

#

and stop other handlers from execution

tropic summit
#

yeah def dont want that

hollow thistle
#

wrap in call

tropic summit
#

I have two if statements evaluated and then the function is complete so ill probably just use else on the latter statement and return that

hollow thistle
#
_object addEventHandler ["HandleDamage", {
  call {
    params ["_whatever"];
    if (something) exitWith {123};
  };
}];
#

just don't "exitWith" the handler scope and you will be fine.

tropic summit
#

so if my function is executed using spawn, can I still use call inside of that function?

hollow thistle
#

yes, call is blocking spawn creates a new thread. But if you spawn the function inside the handler you will not be able to get the return value.

tropic summit
#

now that I'm looking at it, I should probably switch to call anyways, seems inefficient using spawn in conjunction with HandleDamage

#

ty for the quick assistance guys

winter rose
#

@tough abyss don't ask to ask, just ask

tough abyss
#

well i am kind of brand new in scripting

#

sooooo....need help with the basics

#

of scripting

winter rose
tough abyss
#

oh,thank you very much

#

i will go thru it

tropic summit
#

ok im back with one more HandleDamage question

#

I managed to resolve my issue by simply returning _damage at the end of the function

#

but I want to make sure that wont interfere with other HandleDamage EHs (like ACE Medical specifically)

little raptor
tropic summit
#

is there a way for me to prioritize ACE's HandleDamage over my own?

harsh vine
#
_HvT = player getVariable ["xpcash",0] >= 100000 && alive player;
        if (_HvT) then
        {
if (side player == playerSide) then {
_marker =  createMarker [_markerName, getPosWorld player];
            _marker setMarkerColor "Colorgreen";
            _marker setMarkerText format ["HVT - PROTECT : %1",_markerName];
            _marker setMarkerSize [.60,.60];
            _marker setMarkerShape "ICON";
            _marker setMarkerType "mil_warning";
            
        }else {
            _marker setMarkerColor "ColorRed";
            _marker setMarkerText format ["HVT - ELIMINATE : %1",_markerName];
            };
};

```i would like the following: if hvt is on player side then the map marker will show (protect) and  if the hvt is an enemy then show (eliminate).
winter rose
#

_hvt is a number boolean here

little raptor
#

it's a bool (?!)

winter rose
#

I stopped at getVariable… I is tired.

#

@harsh vine where is your HvT on which we could get the side value?
also, your variable name _HvT is misleading (assuming HvT is an object)

little raptor
#

side player == playerSide wat?

harsh vine
#

lol be nice mr leo

winter rose
#

can be different actually ^^

#

(renegades, etc)

little raptor
#

Yeah. I just realized

winter rose
#

but still, inappropriate code in this context here

little raptor
#

lol be nice mr leo
I meant it doesn't have anything to do with what you're asking ^

faint oasis
warm hedge
#

You need to make one

faint oasis
#

Ok but why the game have an "RscTreeSearch" ?

warm hedge
#

...?

#

Excuse me, I don't get it

faint oasis
#

because in the config we have "idcSearch = -1;"

#

oh so i need to create an "RscEdit" and i need to put his "idc" ?

warm hedge
#

idcSearch = 645;

faint oasis
#

so i need to have an rscedit with idc 645 ?

warm hedge
#

Yes

faint oasis
#

oh ok i will test it

little raptor
#

so i need to have an rscedit with idc 645 ?
any idc is fine

warm hedge
#

But have to be the same with the idcSearch value

#

(amirite?)

little raptor
#

🤷 never heard of it

solemn citrus
#

Can anyone help me with a respawning respawn vehicle? I am using "Simple Vehicle Respawn Script v1.81 for Arma 3" and am trying to get it to also use [west, this, "HMMWV M1151 M2"] call BIS_fnc_addRespawnPosition on it.
Vehicle.sqf says :
If you you want to set the INIT field of the respawned vehicle, first set all other values, then set init commands.
Those must be inside quotations.
Like this:
veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf"
but when i try
veh = [this, 15, 10, 5, TRUE, FALSE, "[west, this, "HMMWV M1151 M2"] call BIS_fnc_addRespawnPosition"] execVM "vehicle.sqf"
i get missing ] error

#

hope this is the right place!?!

warm hedge
#

Never heard of the script but HMMWV M1151 M2 is not the right value to pass

faint oasis
#

@warm hedge thx it worked we need to create an RscEdit with "idc 1896" example and put "1896" in idcSearch 1896 so yes and thx

little raptor
#

@solemn citrus
probably what they meant:

 [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf";
[west, this,  "HMMWV M1151 M2"] call BIS_fnc_addRespawnPosition
warm hedge
#

(replace ? with your something)

little raptor
#

Actually I think it is ok

#

Wiki says it's a respawn name

solemn citrus
#

That is the Name it will show in the respawn Menu and that works

warm hedge
#

Ahm, is that a marker?

little raptor
warm hedge
#

Ups, forget my post

#

So well, apparently you can't use " in "

solemn citrus
#

so that part is ok i guess?!

#

ah

warm hedge
#

If there's a string like: "abc "def""
the engine will recognize it like a string "abc " and the rest def"" can't be recognized as anything, so it's an error

little raptor
#

String inside a string requires two "

warm hedge
#

Or, '

little raptor
#

Yup

solemn citrus
#

[this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf";
[west, this, "HMMWV M1151 M2"] call BIS_fnc_addRespawnPosition

warm hedge
#

(I prefer ' tho)

winter rose
#

shame on you

warm hedge
#

Wha-

winter rose
#

😄
linting throws errors!

solemn citrus
#

will the part after the ; be set into the init when the vehicle respawns?

little raptor
#

(I prefer ' tho)
Me too. But if there's more than two inner strings (string within a string within a string) you have to use that

solemn citrus
#

From what i understood it has to be part of the text calling vehicle.sqf to be set again

#

sorry if i sound strange, english is not my native language

warm hedge
#

Neither 🙂

solemn citrus
#

k

little raptor
#

@solemn citrus

 [this, 15, 10, 5, TRUE, FALSE, "[west, this, 'HMMWV M1151 M2'] call BIS_fnc_addRespawnPosition"] execVM "vehicle.sqf" 
solemn citrus
#

gonna try

#

It works! Thanky you all.

#

Is there any way to disallow AI to enter the vehicle. I am using ALIVE and everytime i start the server there is 1 AI spawning into the gunners seat...

#

solution so far is to kill him, but ...

winter rose
#

lockTurret? deleteVehicleCrew?

solemn citrus
#

this deleteVehicleCrew Gunner?

#

gunner

oblique arrow
solemn citrus
#

that why i came up with that "this deleteVehicleCrew gunner". Is that the right way?

#

can i put a sleep in front of that?

winter rose
#

beware, gunner is a command

solemn citrus
#

sleep 5; this deleteVehicleCrew gunner; [this, 15, 10, 5, TRUE, FALSE, "[west, this, 'HMMWV M1151 M2'] call BIS_fnc_addRespawnPosition"] execVM "vehicle.sqf"

winter rose
#

so it could be gunner this (as in "get this vehicle's gunner")

solemn citrus
#

sleep 5; this deleteVehicleCrew gunner this; [this, 15, 10, 5, TRUE, FALSE, "[west, this, 'HMMWV M1151 M2'] call BIS_fnc_addRespawnPosition"] execVM "vehicle.sqf"

#

this is so confusing. i am quite new to this stuff

winter rose
#

hi new to this stuff, I'm dad!

solemn citrus
#

😄

solemn citrus
#

i don't get it, guees i'll have to live with killing him

#

guess

oblique arrow
#

Hi peeps, any chance anyone knows if its possible to open a link from within arma?

still forum
#

you can open some stuff in steam browser

#

I think just YT

#

structured text probably

oblique arrow
#

theres a command to open youtube videos

#

But thats not what I want to do

still forum
#

structured text maybe, extension can definitely do it

oblique arrow
#

Yeah structured text has hyperlinks but I'm not sure if I can generate text on the main menu, propably not

#

ideally I could press the spotlight button and that opens the link in a browser

cunning crown
modern moon
#

Hello there. I have a problem with a script adding a dialog. I make createDialog and the Dialog got opened (said by debug lines) but it wont show up for the player. No Errors in the logs. ctrlVisible and ctrlShow are returning true. Position of the Dialog is in the area of the player, so im confused why it wont show up. Anyone an idea? If you need more infos, then feel free to ask 🙂

#
19:53:00 "_display1: Display #468220"
19:53:00 "_control1: Control #46923"
19:53:00 "_pos1: [0.207484,0.6092,0.294992,0.06]"
19:53:00 "_visible1: true"
19:53:00 "_shown1: true"
19:53:00 "_display2: Display #468220"
19:53:00 "_control2: Control #46923"
19:53:00 "_pos2: [0.207484,0.6092,0.294992,0.06]"
19:53:00 "_visible2: true"
19:53:00 "_shown2: true"
19:53:00 "Dialog Overview is opened"```
These are my debug lines. _1 is directly after the createDialog and _2 means at the end of my function
I do this whole script in a fuction executed by the initPlayerLocal.
little raptor
#

that doesn't tell us anything. Post the display config too

modern moon
#

ive found a workaround, but first i want to test it in the next hours and give you feedback on how ive done this 👍

patent agate
#

Question probably simple but I am a tad new. Is there a way to export the contents of a cargo box to a script that uses addItemCargo or at least get all of the Item numbers from the inentory of a crate

#

Apologies if this is easily answered but I have only found ways to export the load outs of players or copy contents not get the specific codes

#

Right now I have to copy them all manually while viewing in zeus enhanced

astral dawn
patent agate
#

Thanks sparker I keep running into you

#

GetItemcargo worked perfectly

torpid glacier
#
comment "Remove existing items";
removeAllWeapons player;
removeAllItems player;
removeAllAssignedItems player;
removeUniform player;
removeVest player;
removeBackpack player;
removeHeadgear player;
removeGoggles player;
comment "Add weapons";
_rifle = ["rhs_weap_m4a1_blockII", 0.48, "rhs_weap_m4a1_blockII_KAC", 0.48, "rhs_weap_m4a1", 0.02, "rhs_weap_mk18", 0.02] call BIS_fnc_selectRandomWeighted;
player addWeapon _rifle;```

How am I suppose to find the variable names of items that I don’t know?
violet gull
#

Is there a way to hide player names from popping up when they're talking on VON? VonID difficulty setting doesn't seem to do anything on my server.

copper raven
#

🤔 it should

violet gull
#

Weird. I have a custom difficulty setup on the server which has VonID=0; and the server.cfg also uses ForcedDifficulty="Custom"; but I still see VON ID. Maybe a bug?

unique sundial
#

@violet gull what
hint str (difficultyOption "vonid");
shows?

violet gull
#

I'll check now

#

1

unique sundial
#

there you go you don’t have difficulty set as you think

#

there is also stream friendly option you can try if this is for you and you don’t want it shown on video

violet gull
#
class DifficultyPresets
{
    class CustomDifficulty
    {
        class Options
        {
            groupIndicators=1;
            friendlyTags=0;
            enemyTags=0;
            detectedMines=0;
            commands=1;
            waypoints=0;
            tacticalPing=0;
            weaponInfo=1;
            stanceIndicator=1;
            staminaBar=1;
            weaponCrosshair=0;
            visionAid=0;
            thirdPersonView=1;
            cameraShake=1;
            scoreTable=0;
            deathMessages=0;
            vonID=0;
            mapContent=0;
            autoReport=0;
            multipleSaves=0;
        };
        aiLevelPreset=3;
    };
    class CustomAILevel
    {
        skillAI=0.2;
        precisionAI=0.2;
    };
};```