#arma3_scripting

1 messages · Page 623 of 1

obtuse sigil
#

unless that _vehicles variable is actually passed in to something in your script, it can only be seen inside that script file since a) you use "private <variable>" and b) your variable starts with __

digital plover
#

the code is working. but if i lock (obfuscated) the pbo file the code doesn't work

obtuse sigil
#

if you think your are CHANGING a variable with that name, it wont work

#

I dont think you can obfuscate .sqf

digital plover
#

ok i will ask a question. what can i do to protect this file i created?

#

I want to prevent someone else from stealing

obtuse sigil
#

seriously speaking, nothing

#

there will ALWAYS be a way for people who want to look inside, to do so

grave torrent
#

spawn the ojbects server side.

digital plover
#

how can I do that ?

#

So how can I call sqf from within the server?

grave torrent
#

take your initserver.sqf and call it server side...

#

this is why I suggested you join the exile discord. Plenty of info, and help.

digital plover
#

Okey. Thank you for help @obtuse sigil @grave torrent

#

I will have one last question

#
0 execVM "RD\RD_Client\data\Traders\NPCs\BMCapeZefyrisTraderObjects.sqf";```
#

What is the difference between these two codes?

obtuse sigil
#

on the last one you pass 0 as a parameter into the script

#

inside the script you can use params command to read what is passed in there

#

or _this

digital plover
#

ok thanks

obtuse sigil
fresh frigate
#

Hi noob here trying to get enemy ai spawn when enemy unit count is <5.
My code has been edited so many times I need to start again.
I so wish to work it out but hitting a wall, help

winter rose
#

what is your issue?

fresh frigate
#

Either code spawns 300 or not at all
Count enemy ai
Enemy ai - player
Remaining < 5 then spawn etc

cosmic lichen
#

300 Oo

fresh frigate
#

Will have to switch pc on to get code

winter rose
#

Well yes, could help ^^

#

300 Oo
THIS. IS. SPARTAAA !! @cosmic lichen

fresh frigate
#

Damn loop

winter rose
#

pseudocode:

wait until count enemies < 5
spawn enemy
loop

fresh frigate
#

Is there an sqf editor that highlights errors and or gives alternatives

robust hollow
#

sqflint identifies syntax errors, if thats what you mean.

fresh frigate
#

👍

#

this is what i ended up with and doesnt work at all

#

if (_enemy_left == _player) then (true) else (false);
while {true} do { _grp = createGroup east;
"O_IS_Team_Leader_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "SERGEANT"];
"O_IS_Veteran_Grenadier_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "SERGEANT"];
"O_IS_PKM_Gunner_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "SERGEANT"];
hint "heres your men";

robust hollow
#

wrong brackets on that if:
if () then {} else {}

#

then it can be simplified to just the condition

#

while {true} do { a loop that never ends?

winter rose
#

what you are doing:

  • nothing (+ script error)
  • then while always true, spawn an enemy
    why it doesn't work 😉
fresh frigate
#

simplify please

robust hollow
#

is that the entire script?

fresh frigate
#

init file

#

[] ExecVM "Reinf.sqf";

while {true} do
{
total_count = {alive _x} count allUnits;
player_count = {alive _x} count units group player;
enemy_left = total_count - player_count;
hint format ["Enemies Left: %1", enemy_left];
sleep 5;
};

robust hollow
#

ok... so is there any more code or is that all of it?

fresh frigate
#

that bit in init works fine

#

so other code in reinf.sqf does nothing, but it did spawn 300 till i edited it now nothing

winter rose
#

while { true } do { spawn enemies }
do you see the issue?

fresh frigate
#

bracket??

robust hollow
#

while {true}
true

#

the loop has no end condition

#

but in the snippet you pasted it also doesnt have an end bracket so idk how its looping at all

fresh frigate
#

if {_enemy_left == _player} then (true) else (false);
while {true} do { _grp = createGroup east;
"O_IS_Team_Leader_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "SERGEANT"];
"O_IS_Veteran_Grenadier_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "SERGEANT"];
"O_IS_PKM_Gunner_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "SERGEANT"];
hint "heres your men";

#

does not work at all now deleted many lines hence to start again

winter rose
#
if {_enemy_left == _player} then (true) else (false); 

this line does nothing but a compile error

fresh frigate
#

if enemy left = # then spawn??

winter rose
#

no, no

#

pseudo code again:```sqf
while { true } do // while the mission runs
{

  • wait until there are only 5 enemies
  • spawn enemies
    };
fresh frigate
#

ah?

winter rose
#

the while will then loop back to the wait

fresh frigate
#

until condition is met?

#

=5

winter rose
#

wait until there are only 5 enemies
yes

#

thought I would recommend checking if inferior to six

#

so, what does your code look like? ^^

fresh frigate
#

{alive _x && (side _x) == east} count allUnits <= 2

while {true} do { _grp = createGroup east;
"O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
hint "heres your man"; sleep 30;
};

#

while {true} do { _grp = createGroup east;
"O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
hint "heres your man"; sleep 30;
};

#

{alive _x && (side _x) == east} count allUnits <= 5

winter rose
#

the - first - line - does - nothing!

#

plus, you forgot ;

fresh frigate
#

'''sqf while {true} do
{alive _x && (side _x) == east} count allUnits <= 5;
{ _grp = createGroup east;
"O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
hint "heres your man"; sleep 30;
};

little raptor
#

First of all, add syntax highlighting to your code

#
code
#

It's the tilde key

#

`

#

Next to 1

robust hollow
#
private _grp = createGroup [east,false]; 
while {true} do { 
    waitUntil {{alive _x && (side _x) == east} count allUnits <= 5};
    "O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
    hint "heres your man";
};
fresh frigate
#
{alive _x && (side _x) == east} count allUnits <= 5;
{ _grp = createGroup east; 
"O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
hint "heres your man"; sleep 30; 
};
#

total noob

robust hollow
#

😐

winter rose
#

line return after sqf is the trick 😉

#

(edit your message)

fresh frigate
#
while {true} do 
{alive _x && (side _x) == east} count allUnits <= 5;
{ _grp = createGroup east; 
"O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
hint "heres your man"; sleep 30; 
};
#

hooray

winter rose
#

proper indent reveals:```sqf
while {true} do
{
alive _x && (side _x) == east} count allUnits <= 5;
{ _grp = createGroup east;
"O_IS_Fighter_01" createUnit [getMarkerPos "mark1", _grp, "", 0.6, "PRIVATE"];
hint "heres your man";
sleep 30;
};

#

there is a misplaced {
also, you are not waiting until the condition is met

fresh frigate
#

so

#

while true

#

wait until east < 5

#

if true do

#

if false ignore

little raptor
fresh frigate
#

thanks i really want to learn but some of the scripts i open up are far too advanced i need baby language first

winter rose
#

@faint oasis don't crosspost #rules

faint oasis
#

@winter rose ok np

vague geode
#

tried to set license plate number?
@winter rose Nope, that doesn't do anything.

winter rose
#

ah welp.

languid oyster
#

How to find out, if a certain ai unit is a medic?

willow hound
languid oyster
#

many thanks

light badge
#

Hi all, I'm making a custom mision with the editor and I want to put a weapont but I dont want to interact with it at any way.
Anyone knows if there's any way to put it completely static and non interactable?

winter rose
#

you could create a simple object with the model path @light badge 🙂

light badge
#

but a weapon item doesn't let you to put as a simple item...

winter rose
#

you mentioned a weapon, not a weapon item ^^

exotic flax
#

createSimpleObject doesn't care what it is, as long as the .p3d is valid 🤷‍♂️

light badge
#

sorry, I just want to place some item weapons to decorate and the player shouldn't be able to interact with them.

winter rose
#

yeah, createSimpleObject can do that

light badge
#

great, Ill try it.
Thank u so much

ebon citrus
#

whya re attachment-slots called "cows"?

#

class CowsSlot;

winter rose
#

because fArma

fair drum
#

is there a command I can use to force a keystroke of a player? or force a specific control like "CBA Next Optic State"?

winter rose
#

@ebon citrus I would get w.s as weapon slot, but idk about c.o

runic edge
#

Hello there, i want to get the players variable name to execute scripts on them later on, should I use getVariable ? I'm not really sure what the return value is in there

winter rose
#

player returns the player; see allPlayers or BIS_fnc_listPlayers maybe?

cold glacier
#

@fair drum - rather than simulating a keypress, you probably want to find the CBA function that does what you want and call that.

runic edge
#

allPlayers with a forEach seems to works ! great help as always Lou 🙏

winter rose
#

mind that allPlayers also grabs Headless Clients, if there are any 😉

tough abyss
#

If I need to run a local function globally on vehicles (and their respawns) how should I do that?

fair drum
#

@tough abyss what function you doing?

tough abyss
#

One I wrote

#

I found the answer though, remoteExec should work

copper needle
#

I am trying to make a turn script. I need a script that runs disableUserInput on all players in an array then selects the first player in the array, enables it for fives seconds, disables input once again, and then does the same for the next player and so on until it gets to the last player in the array and enables input for all

#

Any suggestions?

winter rose
#

it is not recommended to disable user input… they cannot even alt-tab or escape-quit the game

agile pumice
#

Hey Lou, do you remember my issue with the mortar thing from a few nights ago? Well I got it resolved mostly. I can get a unit to move to a waypoint and then deploy a mortar and fire from there, but when I try to add a vehicle in the mix with a get out -- > move waypoint scheme it breaks.

[M1] spawn {
    _unit = _this select 0;
    _pos = _unit modelToWorld [0,1,0]; 
    _unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; 
    removebackpack _unit; 
    _mortar = "O_Mortar_01_F" createVehicle _pos;
    sleep 2; 
    _unit moveInGunner _mortar;

    _pos = [[[getpos arty1, 50]],[]] call BIS_fnc_randomPos;
    _unit commandArtilleryFire [
        getpos arty1, 
        (getArtilleryAmmo [vehicle _unit]) select 0, 
        ((magazinesAmmo (vehicle _unit)) select 0) select 1
    ];
};

The unit will get out of the vehicle, move to the waypoint, deploy the mortar and get on, but then quickly get off and move around for a short duration. Between the mortar being created and the unit getting on the mortar, the unit moves a few meters or so. This only happens when the vehicle is involved at all.

winter rose
#

assign as gunner and allow getin maybe

agile pumice
#
    _unit assignAsGunner _mortar;
    [_unit] orderGetIn true;
    _unit moveInGunner _mortar;
``` doesn't work either. Unit still gets on and gets off and runs around for a short bit before coming to a halt
#

First waypoint is hold, then get out, then move

#

the code is executed in the on activation of the move waypoint

#

When I remove the vehicle and the get-out waypoint, it all works fine

#

when I remove the move waypoint and put the code in the on activation of the get out marker, the behavior changes. the unit gets on the mortar and doesn't get off but he won't fire.

upper seal
#

its there a script that will keep a door from opening cause the door im using doesnt have the little lock option in the ace menu

fair drum
#

could be a door for a modded building?

upper seal
#

yea modded hallway

fair drum
#

some of them just aren't set up for that

tough abyss
#

Is there a way I could find all vehicles with a class name and do code on each of them in initplayerlocal?

slim oyster
#

init eventhandler?

tough abyss
#

That sounds perfect

ebon citrus
#

You can also do it in an addon config, but regardless you'll have to use a mod. CBA or your own

copper needle
#

can you remoteExec closeDialog?

robust hollow
#

i assume you could, but you would be better off remote executing code that finds and closes the specific display you want closed.

cold cloak
#

@little raptor Ok so Im asking this but how can I make the script so it has two parts, insertion and extraction

#

The insertion is on the very start of the mission but the extraction comes in the very end

fossil yew
#

How to force a human player to start the mission in prone position?

#

setUnitPos works for AI, but not for players. There is no action.

#

switchMove is forcing him to do animation but ... then he is stuck in it.

little raptor
#

@fossil yew
put this in the init field:

this switchAction "PlayerProne"
fossil yew
#

Thx.

little raptor
#

@fossil yew Use the updated code

#

@cold cloak Execute the codes at different times. If you use triggers, put them in different On Activation fields. You can do a similar thing for tasks as well.

cold cloak
#

aigh

#

also I need few lines of script because I got no clue how to script lmao

#
  1. Heli take off once its emtpy
  2. Yeet all the passengers out once the heli lands
little raptor
crude stream
#

Hey guys, can anyone point me in the right direction to use addAction to make a vehicle delete itself and spawn a vehicle on its exact position?

#

I essentially want to turn an SUV into an armored SUV through an action

#

I know I've gotta use createVehicle and deleteVehicle but I don't really want to have to run it from a script in the mission file

little raptor
#

You can put them directly in addAction

crude stream
#

I thought addAction could only do one?

little raptor
#

You can put code in it

#
object addAction ["Respawn", {
  params ["_target"];
  isNil {
  _respawnPos =  _target getVariable ["RespawnPos", [0,0,0]]; //AGL position
  _newVeh = createVehicle [typeOf _target, _respawnPos];
  _newVeh setPos _respawnPos;
  deleteVehicle _target;
  }
}];
#

You need to set the respawn pos for the vehicle (when it initializes)

#
object setVariable ["RespawnPos", ASLtoAGL getPosASL object];
crude stream
#

If I set the respawn as the vehicle the action is performed on will the new vic just spawn and explode before it gets deleted?

little raptor
#

I don't think so

#

The code is unscheduled

#

Hold on

#

No

#

It's scheduled

#

Updated the code

crude stream
#

Sweet. Thanks heaps man this is really helpful

little raptor
#

Np. You might need to save the orientation of the vehicle as well

tough abyss
#

So. I'm a pretty newbie to scripting. in our unit someone made a super awesome template that unfortunately hampers some of our efforts. He left, but we're trying to minimize the use of backpacks. Right now. All items are being dropped in a backpack at mission start using the following:

    // LOADOUT: RIFLEMAN
      case "r":
      {
        _unit addweapon _rifle;

        if (isNull (unitBackpack _unit)) then {_unit addBackpack _bag};
        (unitBackpack _unit) addMagazineCargoGlobal [_riflemag, 11];
        (unitBackpack _unit) addMagazineCargoGlobal [_riflemag_tr, 2];
        (unitBackpack _unit) addMagazineCargoGlobal [_grenade, 5];
        (unitBackpack _unit) addMagazineCargoGlobal [_mgrenade, 5];
        (unitBackpack _unit) addMagazineCargoGlobal [_smokegrenade, 5];
        (unitBackpack _unit) addMagazineCargoGlobal [_ARmag,1];
      };

I tried looking up similar things for unitBackpack to make all that stuff drop into the vest instead, but I can't seem to find the equivalent of unitBackpack.

little raptor
#

There's none

tough abyss
#

Darn.

little raptor
tough abyss
#

Alright. Thanks. I'll fiddle with it.

little raptor
#

Also, if the backpack is already on the unit, why don't you just use the addItemToxxx commands?

tough abyss
#

.. Yes.

#

Not sure. This template was made by old clan staff like.. 3/4 years ago. We're finally getting around to change things. Keep walking into hoops to jump through, Yay for versatility I guess..

lethal bay
#

Is there an event that fires when vehicle gear shifts? Or an eventhandler that can be used when that happens?

unique sundial
#

I tried looking up similar things for unitBackpack to make all that stuff drop into the vest instead, but I can't seem to find the equivalent of unitBackpack.
@tough abyss vestContainer _unit

tough abyss
#

Oh, nice. thanks!

unique sundial
#

there is also uniformContainer and backpackContainer which is same as unitBackpack

tough abyss
#

Awesome. That's good to know.

little raptor
#

where did those come from?! 😄

tough abyss
#

Yeah. I get it. Back in the day this template was made to safeguard any missionmakers from doing weird loadouts to make sure we all get proper gear and don't forget anything. And while it works wonderful, it is kind of weird to work with now we decided to change out the large backpacks (Everybody was getting carryalls) to smaller onces we want to add more items to the vest (Because somebody thought it was nice to just dump everything into a carryall leaving the vest empty)

#

But. With addItem instead I think it'll overcome some issues. I'm already pissed we can't have no backpack without rewriting litterally half the base of the loadout system.

#

Thank you for your help, I really appreciate it.

#

We do, yeah.

#

Hah. Willdo.

languid oyster
#

I got a question. I want to rewrite a loop to something event driven.
When a vehicle reaches 10% fuel, the driver should look for some fuel source, move to the source, then refill the fuel tank.
What event handler can I use to achieve this?

unique sundial
#

there is no such even only when you deplete completely or refil from 0. You can set a trigger and set interval to check every minute to save performance

crude stream
#

@little raptor Sorry dude, I'm getting absolutely nowhere with your code, still super new to this

#

Where should I be putting in the classname for the armored suv?

little raptor
#

nowhere

#

Wasn't the vehicle an armored SUV already?

crude stream
#

Nah it was an SUV, I wanted the script to delete the SUV and replace it with an armored SUV

#

Sorry, should've been more clear on that

little raptor
#

replace typeOf _target

#

with armored SUV class name

crude stream
#

I KNEW it would be one of those. Cheers again mate. I'll give it a crack

digital plover
#

CfgNetworkMessages.hpp:

{
    module = "RdGaming";
    parameters[] = {"OBJECT"};
};
class packVehicle
{
    module = "RdGaming";
    parameters[] = {"STRING"};
};```
what does this code mean?
little raptor
digital plover
#

oke

languid oyster
#

@unique sundial thanks for reply. This is the way I am currently doing it. Just wanted to ask in case I overlooked something.

crude stream
#

@little raptor Hey dude back again - please don't feel obligated to help if you're sick and tired of me 😂 I've got everything working, but I can't get it to spawn on the same location as the original SUV.

#

Testing out with spawning on player works fine, the orientation is good also

#

I just can't figure out how to get it to spawn on the same pos as the SUV the action is being activated on

little raptor
#

where do you want to spawn it?

crude stream
#

On the same location as the SUV the action is being done on

#

Sorta like the SUV is transforming into a new vehicle

#

So the new SUV needs to spawn on the same place as the one that's getting deleted

little raptor
#
object addAction ["Respawn", {
  params ["_target"];
  isNil {
  _respawnPos = getPosASL _target; 
  _newVeh = createVehicle [typeOf _target, [0,0,0]];
  _newVeh setVectorDirAndUp [vectorDir _target, vectorUp _target];
  _newVeh setPosASL _respawnPos;
  deleteVehicle _target;
  }
}];
crude stream
#

Still not working unfortunately, here's what I'm working with

  params ["_target"]; 
  isNil { 
  _respawnPos = getPosASL _target;  
  _newVeh = createVehicle [CUP_I_SUV_Armored_ION, [0,0,0]]; 
  _newVeh setVectorDirAndUp [vectorDir _target, vectorUp _target]; 
  _newVeh setPosASL _respawnPos; 
  deleteVehicle _target; 
  } 
}];```
naive osprey
#

hi. when using player attachTo vehicle, the aiming for the player is restricted. im creating a script to hold on to vehicles, enabling players to lie down on top of slow moving vehicles and fire

#

is there a way to unlock player aiming after a call to attachTo?

ebon citrus
#

anyone remember how to export cfgPatches?

little raptor
#

@naive osprey The only way is to create a fake vehicle with FFV position, put the player in the vehicle, then attach that vehicle to the vehicle you want.
@ebon citrus What do you mean?

ebon citrus
#

export all of cfgPatches

little raptor
#

@crude stream "CUP_I_SUV_Armored_ION"

#

You want to export the config or their names?

ebon citrus
#

ALL of cfcPatches

#

in whatever text format

little raptor
#

I mean with the whole contents right?

ebon citrus
#

yes

little raptor
#

Not just their names

ebon citrus
#

i dont know which part of all is not translating over

#

but i mean "all"

#

as in all

little raptor
#

ok

#

and

#

Is what you want

#

(I'm not sure what you intend to do with it because cfgPatches is useless)

naive osprey
#

oh, thanks. could you point me in the right direction regarding creating a vehicle? (assuming i have to create a custom vehicle type)

little raptor
#

The guys at #arma3_model can help you out. I don't have much experience in creating vehicles.

crude stream
#

That did it!! Thank you so much Leopard20!

languid oyster
#

Guys, I would like to add an event handler to players only. This is what I currently got:

class Extended_Hit_Eventhandlers {
    class CAManBase {
        hit = "_this execVM '\NIC_HealMe\functions\HealMe.sqf'";
    };
};

Inside the script, I can filter out any non player. But is there a better way doing this?

little raptor
#

I don't think so.

#

Also, create a function instead of that

#

One last thing. I assume that's a code that contains some loop isnt it?

languid oyster
#

yes, there is a loop

little raptor
#

How big is the mission?

#

I mean number of players

languid oyster
#

I'm alone atm, but publishing on steam, there could be more

little raptor
#

If the number is just a few, it doesn't matter.
If you converted that code to a fucntion, it could save you more performance than the minor performance cost for the condition inside the code.

naive osprey
#

oh, so i need to use object builder?

languid oyster
#

Roger, will do. Many thanks for the advice!

daring wolf
#

So if I'm making a custom scripted mission which I want to have custom inventory items or weapons, can all of this be created inside of the mission file itself which players download when they join the server (as opposed to having to download a workshop mod) or where is the limit with that? I've already made some good progress with custom gui and scripted functionality as well and I would prefer for my players to not have to download any mods to join.

little raptor
#

Afaik, yes. You can create a config.cpp in the PBO and patch the config to add your new items and vehicles.

ebon citrus
#

@little raptor you can?

little raptor
#

I've seen campaigns that do that

#

Missions shouldn't be any different

ebon citrus
#

i wanna know too

#

no, because campaigns can load addons

#

so can missions

#

i thought CfgWeapons, CfgVehicles, CfgItems, CfgPatches and some others were outside the scope of the mission

#

there is a missionconfigfile scope

#

but im unsure how much that can actually do

little raptor
#

Except you wouldn't be modifying them in a "mission"

#

You put them in the PBO, along with your mission files

ebon citrus
#

so you make an addon?

#

Afaik, yes. You can create a config.cpp in the mission folder and patch the config to add your new items and vehicles.
@little raptor

#

this part confuses me

little raptor
#

I meant in the PBO

ebon citrus
#

ah, gotcha

#

so the addon

#

pbo is just a format

little raptor
#

I think you can't

#

Maybe I'm wrong

#

I'm trying to see if it's possible

ebon citrus
#

afaik all configs have to be loaded during startup. but you can add cfgSounds, cfgFunctions, etc. in description.ext

#

would be cool to have a list of what the missionconfigfile scope can add

little raptor
#

I've never done this. Hopefully someone with more mission making experience could let us know

ebon citrus
#

found it

#

so inventory items would have to be done through an addon, as predicted

#

@little raptor ^^

young current
#

👆

crude stream
#

Can anyone tell me why this just makes the action still available to those not in the driver seat, and just displays it twice for the driver?

  params ["_target"];  
  isNil {  
 _respawnPos = getPosASL _target;   
  _newVeh = createVehicle ["CUP_I_SUV_Armored_ION", [0,0,0]]; 
  deleteVehicle _target;   
  _newVeh setVectorDirAndUp [vectorDir _target, vectorUp _target];  
  _newVeh setPosASL _respawnPos;  
[], 7, true, true, "", "driver vehicle player == player"; 
  }  
}];```
#

Its almost like its creating the action twice, once for the driver and once for everyone else

#

Because the radius doesn't change either

little raptor
#

I'm not even sure how that works for you!

crude stream
#

Ah okay I see my mistake

little raptor
#
this addAction ["<t color='#FF0000'>CODE RED", {  
  params ["_target"];  
  isNil {  
   _respawnPos = getPosASL _target;   
    _newVeh = createVehicle ["CUP_I_SUV_Armored_ION", [0,0,0]]; 
    deleteVehicle _target;   
    _newVeh setVectorDirAndUp [vectorDir _target, vectorUp _target];  
    _newVeh setPosASL _respawnPos;
  }
  }  
[], 7, true, true, "", "driver vehicle player == player";   
];
crude stream
#

Yeah cheers again man

#

Think it just takes someone pointing out the obvious to realise how stupid you're being 😅

naive osprey
#

hey, how do i properly translate player coordinates to the vehicles model coordinates? player worldToModel position _veh puts me on the floor... (_playerpos select 2) - (_vehpos select 2); puts me a few meters above the model

winter rose
#
vehicle worldToModel getPosATL player```?
naive osprey
#

thats just the z value, get the height difference

#

trying to get player attachTo _vehicle at the current position, meaning world position for the player remains the same before and after attachTo

#

but maybe im doing it wrong. this language is completely new to me!

winter rose
#

just do attachTo? 🙂

#

without position parameter, it takes the current relative position

naive osprey
#

haha damn... i missed that

#

thank you

winter rose
zinc sorrel
#

does this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] Still work? tried adding it to units in zeus but they still seem to run out of ammo

brave jewel
#

Is it possible to add more sub categories for ACE3? Something like
Animations -> Briefings -> More Briefings -> Briefing 1 Animation

exotic flax
#

if you're talking about ACE Interaction Menu, than yes, you can make sub-sub-submenus

#

just be aware that if you add too much that it might be impossible to use

winter rose
#

@zinc sorrel setVehicleAmmoDef, or setAmmo too

brave jewel
#

How do I do that @exotic flax ? 😄

brave jewel
#

I read that but I don't see anything that mentions sub categories 😦

#

Or wait is it

["Tank_F", 0, ["ACE_MainActions", "CheckFuel"], _action, true] call ace_interact_menu_fnc_addActionToClass; ```
#

so that "CheckFuel" part?

zinc sorrel
#

@winter rose will try that, thankyou

exotic flax
#

ace3 documentation even has an example for sub actions:

// Adds action to check fuel levels for all land vehicles
_action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction;
["LandVehicle", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;

// Adds action to check external fuel levels on tanks.  Will be a sub action of the previous action.
_action = ["CheckExtTank","Check External Tank","",{hint format ["Ext Tank: %1", 5]},{true}] call ace_interact_menu_fnc_createAction;
["Tank_F", 0, ["ACE_MainActions", "CheckFuel"], _action, true] call ace_interact_menu_fnc_addActionToClass;
brave jewel
#

Then it's that, thanks a bunch

copper needle
#

What can I use to prevent people from closing a dialog with Esc? I need the dialog to only close when a button is pressed

robust hollow
#
_display displayAddEventhandler ["KeyDown",{_this#1 == 1}];
copper needle
#

@robust hollow Will that stop all key presses from registering while the dialog is open??

robust hollow
#

only if the pressed key code is 1 (esc)

copper needle
#

Okay perfect thanks!

warm hedge
#

If it returns true, it overwrites the default behavior (in this case, close dialog)

ebon citrus
#

also stops people from opening the esc-menu

#

so keep that in mind

winter rose
#

wat

ebon citrus
#

if you capture and overwrite the default esc-behaviour with an EH, you wont be open the escape menu

robust hollow
#

not if the event is added to an open dialog

ebon citrus
#

so this doesnt mean the dialog isnt closed by hitting esc, it means esc wont do anything so long as the EH is in place

robust hollow
#

it would only block the escape menu if you blocked esc on display 46 (and maybe child menus?)

ebon citrus
#

displayAddEventhandler can be only added to displays, not dialogs, iirc

robust hollow
#

dialogs are displays

ebon citrus
#

oh, never mind then

robust hollow
#

yea, adding it to a control would not block esc closing the display

ebon citrus
#

i was in the belief that dialogs are dialogs

#

displays are displays

#

since a dialog can be added ontop of a display

#

but i guess it's just a weird naming convention

#

no, it seems that dialogs are dialogs on displays

#

so you'd still have to add the displayEH to the display

#

whichever it is

#

usually 46

#

do correct me if im wrong

#

creating a dialog doesnt seem to return any kind of object

#

well, it returns a boolean

#

but no reference to a display either

robust hollow
#

right, but you still find it with finddisplay or whatever variable you set in the onload event

ebon citrus
#

yes, but if you set that EH, you need to remember to remove it aswell

#

just closing the dialog wont remove it

#

since the EH is not tied to the dialog, but the parent display

#

just be careful when overwriting default behaviour

#

always leave yourself a way to open the esc-menu

#

might get infuriating otherwise

#

like painting yourself intoa corner

#

i have personally blocked myself out of the esc-menu a couple times and having to restart the whole game gets stale

winter rose
#

since the EH is not tied to the dialog, but the parent display
Are you sure about that? that an EH added to a child display is added to the parent and staays even after the child is closed? 🤨

ebon citrus
#

sec

#

i can findDisplay on a dialog?

#

with its IDD?

#

and no, im not sure

#

i had a hunch

#

that's why i said, PLEASE correct me if im wrong

#

so that im not only misleading others, but also so that im not misleading myself

robust hollow
#
createDialog "RscDisplayEmpty"; 
private _display = allDisplays select (allDisplays findIf {ctrlIDD _x == -1});
_display displayAddEventHandler ["KeyDown",{systemChat str _this}];
#

when the dialog is open it systemchats every key you press. when you close it, the systemchats stop

winter rose
#

you didn't even say "please", you said "do" 😜

ebon citrus
#

yep

#

it seems im wrong

#

just took a look at MY OWN CODE

#

and i do it

#

guess i need to double down on those dementia pills 😅

#
(findDisplay 5730) displayAddEventHandler ["Unload", {...}

];```
#

like a total jackass i am

robust hollow
#

from what I can tell, the main differences between dialogs and displays are:
createDialog force creates on display 46 (or the newest child dialog of), and blocks player movement.
closeDialog assumes you want the newest child dialog closed.

whereas with displays you choose what the parent is and what display specifically to close.

ebon citrus
#

so what makes a display different from a dialog?

#

The notable difference between createDisplay and createDialog is that with createDisplay the player would be able to move whilst having control of the mouse pointer.

#

there, i answered myself

#

oh yeah, i remember using createdisplay back in like 2019 now

#

welp, fortunately i wont have to be here for much longer bothering you

#

Good job on correcting me Lou!

winter rose
#

clarifying* ^^

#

the thing of which I am not sure is "can we create a dialog by scripting, and reference it"

ebon citrus
#

can you create a dialog by scripting in the first place?

ebon citrus
#

i mean, but like from the ground up

#

since a dialog needs to be referenced from the description or another resource

robust hollow
#

that method of referencing it would not always be reliable, but for the test it is enough.

winter rose
#

@robust hollow stop face-palming me!!1! 😄

#

but yeah, for dialogs idd's are kind of a "must have"

ebon citrus
#

i found it incredibly easy to start using cutRsc though

#

what's the engine side difference between cutRsc and dialog?

#

like is there a performance gain

#

i dont see why you couldnt add a config option to make a dialog without any interaction (mouse included)

#

or im jsut not seeing it

robust hollow
#

well... dialogs are meant for interacting with, while cutrsc is for making hud layers just meant for show.

ebon citrus
#

yep, i got that

#

but what's the big deal?

#

like there must be a better reason to make such a large divide between dialogs and cutrsc

#

or is it just incremental changes that caused incremental issues and required new solutions

#

the usual "the guy who made it no longer works here, so nobody wants to touch it"

robust hollow
#

presumably limitations of the time 🤷

ebon citrus
#

or is it the fact that a hud obviously doesnt need the same kind of support that a dialog needs

#

and thus it's handled so much differently from a dialog on creator and presumably engine side

#

i dont know what is going on behind the binary wall, but i guess they have their reasons

#

i jsut hope arma 4 sees a script overhaul

#

whether it be Enforce script or otherwise

#

Arma 3's script base and all the other creation tools are like a labyrinth

#

or a maze

#

i dont remember which one is which

#

many ways to correct, but different solutions

#

for the same purpose

winter rose
#

anyway, we won't know right now

ebon citrus
#

well, you're right

#

i just wish i'll get to see the day

cosmic lichen
#

Arma 3's script base and all the other creation tools are like a labyrinth
or a maze
That's the downside of backwards compatibility.

austere silo
#

will the scripts work in 2040 when Arma4 will be released?

warm hedge
naive osprey
#

hey, waitUntil {time > _x} throws error if false... what am i doing wrong

#

but works if its true

robust hollow
#

what does the error say?

#

if it works when true then my first guess would be it is running in an unscheduled environment and only errors on false because thats when it attempts to suspend the script.

naive osprey
#

running it in debug console generates generic error, waitUntil {time |#|> _x}

robust hollow
#

is _x defined?

naive osprey
#

wrote _x here but actually im using 1

#

if i look at the watch in game, pause just before say 30 seconds, run the script: generic error, then just after 30 seconds it works...

robust hollow
#

generic error in waituntil is usually because it is executing in unscheduled (which debug is)

naive osprey
#

hmm... also running in init.sqf:
class Extended_PostInit_EventHandlers { class Man { init = "_this call (compile preprocessFileLineNumbers 'holdon\functions\init.sqf')"; }; };

little raptor
#

spawn it

robust hollow
#

yea that will be unscheduled too. make sure you spawn it, or spawn the part of the code within that needs delaying.

winter rose
#

also, aren't you preprocessing the file for every unit? you should rather use a CfgFunctions

little raptor
#

Yeah what lou said

#

I think you meant "CAManBase"?

#

Does "Man" even work?

winter rose
#

it does exist, but it is parent to more than just "human"

little raptor
#

Yeah I know. But I remember I was trying "Land" once and it didn't work

#

So I had to break it into "Car", "Tank" etc.

naive osprey
#

it does execute at start... i just want it to run for players

little raptor
#

Also, _this call Func is not needed. You can simply say call Func (spawn still needs it)

#

Because _this is still defined in Func (they're in the same handle)

naive osprey
#

okay. man this is a big step away from c++

#

or anything else i touched

little raptor
#

If you didn't understand why, don't worry about it. What you wrote was correct. But redundant.

naive osprey
#

hehe i kind of get that, but i mean in general, this language, the way of executing etc

unique sundial
#

class Extended_PostInit_EventHandlers
you will be getting native postinit EH which would fire after vehicle creation

little raptor
#

SU EAT

brave jewel
#

Hey guys, anyone knows why this ```sqf
_action = ["Anims","Briefing listening","",{player playMove "Acts_Briefing_SB_Loop";},{true}] call ace_interact_menu_fnc_createAction;
[(typeOf player), 1, ["ACE_SelfActions", "Animations"], _action] call ace_interact_menu_fnc_addActionToClass;

doesn't show up as sub category but this ```sqf
_action = ["Animationen","Briefing zuhoeren 1","",{player playMove "Acts_Briefing_SB_Loop";},{true}] call ace_interact_menu_fnc_createAction;
[(typeOf player), 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass;
``` does?
slim oyster
#

Does "Animations" exist as a class in the "ACE_SelfActions" class?

exotic flax
daring wolf
#

I have a quick question regarding client/server relationships. Let's say I have this:

// initServer.sqf

TAG_fnc_buttonAction = {
    closeDialog 1;
};

and then in an HPP file which contains an RscButton I have this:

class ExampleButton: RscButton
{
    idc = 1500;
        
    text = "Example";

    x = 0.463906 * safezoneW + safezoneX;
    y = 0.588 * safezoneH + safezoneY;
    w = 0.0721875 * safezoneW;
    h = 0.044 * safezoneH;

    action = "call TAG_fnc_buttonAction";
};

In this scenario, the function inside of the action IS called for myself (the host) but not for my other clients. Am I doing something wrong here?

copper raven
#

you define the function on the server, and call it, what's wrong?

daring wolf
#

I explained what is wrong in the last line of my message @copper raven

copper raven
#

its working how its supposed to, if you want clients to know about the function, you should define it for them aswell

daring wolf
#

So I have to include it in initPlayerLocal.sqf?

copper raven
#

what you're saying is, pressing the button in the gui works for the host, but not the others, yes?

daring wolf
#

Yes

copper raven
#

well yeah, gui stuff should be client side(player-host is also technically client), take the definition away from the initServer and put it in initPlayerLocal

daring wolf
#

Awesome, I'll give it a shot, thank you

exotic flax
#

why not use CfgFunctions to define the function? This will make sure it's always available

daring wolf
#

I'm relatively new to the way Arma 3's scripting works. What is CfgFunctions?

exotic flax
daring wolf
#

That seems like a great solution. Does it matter where I create the class CfgFunctions?

exotic flax
#

Mission and campaign specific functions can be configured in Description.ext, while addon functions are defined in Config.cpp. Configuration structure is the same in both cases.

daring wolf
#

Thank you

daring wolf
#

Can someone please correctly layout the process for delcaring a missionNamespace variable, editing it, and broadcasting it to all clients? From what I understand it is a very simple process but I think I've messed something up in my code and I would like to see a correct example

robust hollow
#

if the code is executing in the missionnamespace (it usually is by default) you can do

myVar = 1;
publicVariable "myVar";

or from any namespace you can do

missionNamespace setVariable ["myVar",1,true];
#

you then repeat the process when you want to update the variable value and broadcast again.

sly mortar
#

I am trying to parse the config and pull out all the class names for stuff that I want to use and categorise it. I've been using BIS_fnc_itemType and BIS_fnc_objectType. What I am looking for is a way to get the "content" for a given class name so I can categorise which class names require which content. So I can for example say give me all vanilla content and GM content. Does anyone know how I can get this information from a class name? The only data I see in the config is the "author" field, is there another way to achieve what I am looking for?

naive osprey
#

my addon works fine, except it is necessary to be admin (not host) on a server or the script wont fire... do i need to do something serverside?

robust hollow
#

how are you trying to execute the script?

naive osprey
#

firstly from:
class Extended_PostInit_EventHandlers { class CaManBase { init = "_this call (compile preprocessFileLineNumbers 'holdon\functions\init.sqf')"; }; };
(i know, run only for players instead, will change that eventually, unless this is the actual problem)
init.sqf (this code is not run):
PlayerSpawned = [] spawn { waitUntil {time > 1}; systemChat "holdon initialized"; HoldingOn = 0; moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown", {if ( inputAction "User10" > 0 && HoldingOn == 0) then { _nul = [] execVM 'holdon\functions\holdon.sqf'; HoldingOn = 1;}}]; moduleName_keyUpEHId = (findDisplay 46) displayAddEventHandler ["KeyUp", {if (inputAction "User10" == 0 &&HoldingOn == 1) then {detach player; HoldingOn = 0;}}]; };

robust hollow
#

@naive osprey and you say it only executes if you are logged in admin? 🤔

naive osprey
#

just tried with friend, i was admin, it worked immediately for me, but he had to log in as admin and call init.sqf through console

robust hollow
#

sounds like being admin is just a coincidence as it shouldnt effect how scripts execute at all. try adding diag_log everywhere and see how far it makes it. add one in the init event itself, and then through the init.sqf before the spawn, before the waituntil, after the waituntil, and in the eventhandlers before, inside of and after the if.

naive osprey
#

thanks! alright... and it couldn't be a JIP thing?

robust hollow
#

shouldnt be. i havent used cba so dont know how it works but in vanilla post init fires for everyone, so i assume xeh postinit events do too.

violet gull
#

Using deleteVehicle on an Object automatically resets all variables set on that object as nil, right? Or is it better practice to set all variables as nil manually prior to deleting the object?

cold glacier
#

You don't need to worry about setting variables on an object to nil @violet gull. What's your main concern? Garbage collection/deallocation of resources?

violet gull
#

The reason why I ask the dumb question is because back when I used to use attachTo for objects in my furniture script, even after deletion, the attachedTo command still returned an array of objects/objNulls.

#

The attach bug was fixed eventually a few updates ago, but was just curious

cold glacier
#

Ah, yeah, that definitely was a bug!

daring wolf
#

Do I have to do something special to access missionNamspace variables from files outside of the regular Event Scripts? I'm currently trying to use a missionNamespace variable inside of a function which I have in a separate file and is also defined in CfgFunctions

#

And what about BIS functions?

robust hollow
#

not usually. scripts usually execute in missionnamespace by default so you can return them raw or with getvariable

exotic flax
#

missionNamespace is available in the mission namespace, so it doesn't matter where you access it

#

as long as its inside a mission 😉

robust hollow
#

can you share code to show specifically how you're trying to do it?

violet gull
#

missionNamespace setVariable ["MyGlobalVariable","Yay!"];
Is kind of the same as doing:
MyGlobalVariable="Yay!";

#

They return the same thing

daring wolf
#

Sure @robust hollow. I'm specifically trying to execute this database call from within my function but when I try to output this variable into systemChat the systemChat command doesn't appear in chat for some reason

_health = [DRTO_DB_PLAYERS, [_uid, "HEALTH"]] call BIS_fnc_dbValueReturn;

["Health: " + str(_health)] remoteExec ["systemChat", 0, true];

And I know the database exists because I can output that as a string and it is as it should be

violet gull
#

setVariable lets you make it JIP/persistent though

robust hollow
#

is systemchat allowed to be remoteexec'd?

daring wolf
#

Yes it is

#

Actually hold on I may have found the issue

#

Lol I forgot to uncomment something, I've been working on this too long today. Thanks for the help anyway guys

daring wolf
#

Alright so I'm almost done with this, I have one more question. On this page https://community.bistudio.com/wiki/DialogControls-Buttons#CT_BUTTON.3D1 the action states

The variable "this" is available, and contains the unit that pressed the button, but unlike User Interface Event Handlers no "_this" information about the current control is passed.

but when I try to access it it says this is undefined. How do I correctly access it?

robust hollow
#

presumably like this params ["_unit"]; or similar

daring wolf
#

@robust hollow I tried this params ["_unit"]; as well as just params ["_unit"]; and neither of them worked for some reason

robust hollow
#

params uses _this by default so defining this in front should have worked. give me a moment i'll try to test it myself.

daring wolf
#

Thank you Connor, you are a huge help

robust hollow
#

yep, i get undefined variable too. guess the wiki is wrong.

daring wolf
#

hmm, well regardless, I need to be able to access the unit somehow

#

I wonder if there is a resource with better information about this

robust hollow
#

you can use player. the event will only ever fire if you have pressed the button yourself.

daring wolf
#

why didn't I think of that 🤦‍♂️

stable wedge
#

Is there a script anyone has handy to attach a logo to a side of a vehicle?
I would like to add solid numbers to some tanks to allow easy identification

robust hollow
#

usually you would only do this with vehicles that have a texture selection intended for showing numbers (like ships), or if thats not an option you'd apply numbers on the texture directly, but if you need to you can attach one of the image tile objects and apply the number texture to that. probably won't look great but it'll work.

stable wedge
#

I think that makes sense? I will try things

#

TY

robust hollow
#

UserTexture_1x2_F or UserTexture1m_F is the object im thinking of

stable wedge
#

ok

#

thanks

violet gull
#

Is it redundant to enableSimulation false simple and super-simple objects?

robust hollow
#

yes. pretty sure simple objects dont simulate anyway.

unique sundial
#

yep, i get undefined variable too. guess the wiki is wrong.
@robust hollow it adds script to the scheduler (hence undefined errors) but it is not spawned. The argument is _this but it is just empty string is passed as argument.

violet gull
#

I can't seem to figure out how to force my intro script to waitUntil the client isn't displaying the default loading screen (https://imgur.com/a/WpCcHKH). After I host the mission or even connect on a dedicated server, the mission hangs in the above loading screen immediately after clicking Continue but proceeds to play the intro in the background. The following code doesn't help in this case:
waitUntil{scriptDone _this};waitUntil{!isNull(findDisplay 46)};waitUntil{!isNull player};waitUntil{getClientStateNumber>=10};

#

_this is the init.sqf

unique sundial
#

waitUntil is as good as sleep

violet gull
#

So in other words, have my init.sqf call the code within a custom loading screen and exit it to play the intro when all code is loaded?

unique sundial
#

No idea but you are better off spawning scripts from init sqf, you can wait until in them without problem

#

@robust hollow button script is sqs as well inserts Connors avatar

robust hollow
#

well there you go 🙂👍

little raptor
#

Any idea why ctrl+backspace gives me the Delete character (Unicode 127) in an RscEdit box?!

#

To see the character, open the debug console and type: toString [127]

unique sundial
#

your keyboard is FUBAR?

little raptor
#

no! 😄

#

The weird thing is, it works fine in debug console when I'm writing code (so does in other programs).
It appears that only RscEdit with autocomplete="" are affected

#

Oh and I've added a "keyDown" event handler to my display as well, if it matters (it returns false for backspace, so it's not related)

#

Could be a game bug

#

I'll investigate

unique sundial
#

Cant reproduce so check your windows

little raptor
#

Only Arma is affected

#

I'll check again

unique sundial
#

your arma

little raptor
#

Yeah you were right!

#

Can anyone else reproduce this?
Run the mission, pause, run this in debug console, unpause:

_txt = findDisplay 46 ctrlCreate ["RscEdit",-1];
ctrlSetFocus _txt
#

Then simply press ctrl+backspace

cunning crown
#

Yeah I'm able to repo that

little raptor
#

@unique sundial There
Also, according to that SuperUser page:

So it sounds like if the application does not use SHAutoComplete it will not support the feature unless it has been explicitly added by the application's author.

unique sundial
#

Then simply press ctrl+backspace
@little raptor did exactly that no probs

little raptor
#

Your Arma is special! 😛

warm hedge
#

Maybe your IME issue?

little raptor
#

I'm not using that right now

#

Hold on let me disable it

little raptor
#

Nah that wasnt it. Disabled all input methods besides English. Didn't help.

oblique arrow
#

Hm is there a way to display text on a screen that can be changed rather than a picture?

cunning crown
#

Yes? Not sure what you meant but yeah, you can dispaly text on screen.

oblique arrow
#

Not sure what you meant
I mean just giving the game a text "x" to display on an ingame model (like a screen) rather than a pre-made picture @cunning crown

cunning crown
#

Ah, then I think it's not really possible but I'm not 100% sure

snow badge
#

Hey I've got some issues with a small setIdentity script I want to do.
When using the following code:

class CfgIdentities
{
    class Spooky
    {    
    face="Deerface3";
    pitch=0.8;
    };
};```and
```// unit init
this setIdentity "Spooky";```It gives this error:
```No entry 'C:\Users\thoma\OneDrive\Dokumente\Arma 3 - Other Profiles\Northgate-O\missions\spooky-test.VR\description.ext/CfgIdentities/Spooky.name'.```
This is pretty annoying as it blanks out the name and all, which isn't optimal. Otherwise it 'works'. I want to use this in multiplayer so players need names. Is anyone able to help me with this one?
little raptor
#

It clearly says that you need to define a "name" property for the identity.

snow badge
#

Yeah I saw that. But I can't define a name since it's multiplayer, and I don't want to make everyone be called the same name.

little raptor
#

Save the name, set indentity, set name

snow badge
#

Thanks, but it's multiplayer. How can I make it so that a player who joins doesn't get their name changed by the identity script?

winter rose
#

@snow badge use setFace and setPitch, not setIdentity since you obviously don't want to use identities

snow badge
#

Oh, thanks! I'll try that.

cold cloak
#

@little raptor sorry to ping you

#

but the script you helped me with

#

isnt working in a new mission

snow badge
#

Let me just annoy you one last time: I found this script in https://community.bistudio.com/wiki/setFace:
if (isServer) then {[_unit, "AsianHead_A3_02"] remoteExec ["setFace", 0, _unit]};
If I replace "_unit" with "player", will this script persisently apply on any player who joins?

winter rose
#

no.

snow badge
#

Oh deer. Is there any way without having to give every unit an individual name, that it applies that script to every playable unit?

unique sundial
#

player is null on the server

winter rose
#

(dedicated*) 🙃

#

@snow badge yes, see allPlayers or BIS_fnc_listPlayers.

snow badge
#

Thanks, I'll check that out. Man, sometimes I wish my monkey brain understood SQF

winter rose
copper needle
#

I switched it over thanks!

snow badge
#

I've been looking at allPlayers but I still haven't been able to understand a thing. How can I make it so that allPlayers are set to that face whenever they join / respawn?

winter rose
#

in init.sqf:

player setFace "theFace";
player addEventHandler ["Respawn", {
  params ["_unit", "_corpse"];
  _unit setFace "theFace";
}];
snow badge
#

Jesus, thank you so much. So this works when someone joins and respawns? What does "_corpse" mean by the way?

winter rose
#

the respawn corpse of when player died?

#

So this works when someone joins and respawns?
well yes, that's what you asked 😎

snow badge
#

Boss, thanks so much.

#

I want to do a spooky operation where everyone has a special face, now with October around ;) This helps greatly.

karmic flax
#

How do I make one players camera shake? if I use addCamShake will it shake the whole server?

exotic flax
#

addCamShake is local, so it would only apply to the client where it is run

karmic flax
#

thanks

inner shard
#

im trying to set up ai spawners that send units to a waypoint using this command _mrk = ["mrk1","mrk2","mrk3","mrk4"] call BIS_fnc_selectRandom;
wp =(_this select 0) addWaypoint [(getMarkerPos _mrk),0]

#

but when i start scenario even though i have markers set up they don't move

agile meteor
#

So I'm trying to do a little scripting, my original goal was to add a function to a post that when activated, would announce in global chat that the post had been touched
this addAction ["Touch Post", [west,"HQ"] remoteExec ["globalChat",0]];
Is what I've begun with
I'd ideally like it to announce who touched it but I think that's a little out of my league

I know I've probably gone ridiculously wrong with it, but I honestly have no idea what I'm doing, I appreciate if anyone can point me in the right direction.

robust hollow
#

second element of addaction should be wrapped in {}

this addAction ["Touch Post", {[west,"HQ"] remoteExec ["globalChat",0]}];
#

also, globalChat expects an object as the first argument, so west is incorrect.

agile meteor
#

Ah right, hugely appreciated. Looks like I wasn't too far off. Should I just put the variable name instead of 'west' then?

robust hollow
#

if the variable is a unit, yes. The first argument is the unit sending the message, the second is the message.

agile meteor
#

Okay, got it. cheers.

ripe sapphire
#

in init.sqf:

player setFace "theFace";
player addEventHandler ["Respawn", {
  params ["_unit", "_corpse"];
  _unit setFace "theFace";
}];

@winter rose lou, wouldn't running player setFace "theFace" on an onPlayerRespawn.sqf be simpler?

drifting sky
#

Are arrays automatically removed from memory when there are no remaining references to them? I'm on Arma2OA.

unique sundial
#

@tough abyss could you make a FT ticket with request please

#

@drifting sky thats the idea

brave jewel
#

Anyone got a time calculator or smh for while loops? I would like to raise an object via setPosATL in 10 seconds from Z = -2 to Z =0.

unique sundial
#

better to use setVelocityTransformation for these sort of tasks

naive osprey
#

hey, is there a good editor for sqf? to get syntax highlighting etc?

robust hollow
#

vscode, atom, sublime, notepad++

naive osprey
#

oh, i have np++... set it to smalltalk or something?

exotic flax
naive osprey
#

wow, i should really just have googled that instead... thank you!

digital plover
#

Hello !

#

The Notification Code:

while {alive player} do
{
    _wages = (player getVariable ["ExileMoney", 0]);
    if((player call ExileClient_util_world_isInOwnTerritory) or (ExilePlayerInSafezone)) then
    {
        _wage = 0;
        [parseText format["<t size='0.4' shadow='2' color='#3FD4FC' shadowColor='#131718' font='RobotoRegular'>You did not earn poptabs while at base or trader</t>"],0,-0.35,5,1] spawn bis_fnc_dynamictext;
        uiSleep 900;
    }
        else
    {
        _wage = 500;//awards a player 500 poptabs every 900 seconds whilst not in trader or their territory
        _wages = _wages + _wage;
        [parseText format["<t size='0.4' shadow='2' color='#3FD4FC' shadowColor='#131718' font='RobotoRegular'>You received %1 poptabs, you now have %2 poptabs - Remember to bank it or, gone at restart!</t>",_wage,_wages],0,-0.35,5,1] spawn bis_fnc_dynamictext;
        player setVariable ["ExileMoney",_wages,true];
        uiSleep 900;
    };
};```
#

I asked the Exile support forum but got no answer.

exotic flax
#

instead of calling bis_fnc_dynamictext you should call the function which displays the "nice" text

digital plover
#

Below is a code that does the same.

#

This is exactly the way I want it. However, there are some differences.

#

Can you edit my code by looking at this code?

#
private _waitTime = 15;
private _wage = 500 + (missionNamespace getVariable ["perk_inmateWages", 0]);
if ((player call ExileClient_util_world_isInOwnTerritory) || ExilePlayerInSafezone) then
{
    ["ErrorTitleAndText", ["<t color='#C62551'>INMATE WAGES</t>", format["<t size='20' color='#E9E9E9' font='PuristaMedium'>Total Earned:</t> <t color='#C62551'>ERROR</t><br/>Can't be earned here!<br/>%2 Minutes until next wage!", _wage, _waitTime]]] call ExileClient_gui_toaster_addTemplateToast;
    systemChat "INMATE WAGES: Total Earned: ERROR!";
    systemChat "INMATE WAGES: Can't be earned here!";
    systemChat format ["INMATE WAGES: %1 Minutes until next wage!", _waitTime];
}
else
{
    ["SuccessTitleAndText", ["<t color='#9FDE3A'>INMATE WAGES</t>", format["<t size='20' color='#E9E9E9' font='PuristaMedium'>Total Earned:</t> <t color='#3ED3FB'>%1</t><img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='25'/><br/>%2 Minutes until next wage!", _wage, _waitTime]]] call ExileClient_gui_toaster_addTemplateToast;
    systemChat format ["INMATE WAGES: Total Earned: %1 Poptabs!", _wage];
    systemChat format ["INMATE WAGES: %1 Minutes until next wage!", _waitTime];
    ["addWageRequest",[str(_wage)]] call ExileClient_system_network_send;
};
#

@exotic flax

exotic flax
#

well, instead of doing it for you, which won't teach you anything, I can tell you how to do it yourself

digital plover
#

ok. i am listeningg you

exotic flax
#

like I said, instead of calling bis_fnc_dynamictext you should call the function to display the nicer version, which in this case is ExileClient_gui_toaster_addTemplateToast (parameters are different, but it's easy to se where the text and values go)

#

so:

[parseText format["<t size='0.4' shadow='2' color='#3FD4FC' shadowColor='#131718' font='RobotoRegular'>You did not earn poptabs while at base or trader</t>"],0,-0.35,5,1] spawn bis_fnc_dynamictext;

has to look the same as

["ErrorTitleAndText", ["<t color='#C62551'>INMATE WAGES</t>", format["<t size='20' color='#E9E9E9' font='PuristaMedium'>Total Earned:</t> <t color='#C62551'>ERROR</t><br/>Can't be earned here!<br/>%2 Minutes until next wage!", _wage, _waitTime]]] call ExileClient_gui_toaster_addTemplateToast;

(since it's an error message)

digital plover
#

There is no "_waitTime" code in the overall code.

#

so it's not in my code.

#

is this a problem ?

exotic flax
#

it's probably the same as uiSleep 900;

#

although I don't know the full code of ExileClient_gui_toaster_addTemplateToast, so can't tell

digital plover
#
/**
 * ExileClient_gui_toaster_addTemplateToast
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

private["_template","_placeholders","_placeholder1","_placeholder2","_placeholder3","_placeholder4","_templateConfig","_color","_templateText","_rawText"];
_template = _this select 0;
if !(isClass (missionConfigFile >> "CfgExileToasts_SG" >> _template)) exitWith
{
    systemChat format ["UNKNOWN TOAST TEMPLATE: %1", _template];
};
_placeholders = param [1, [""]];
_placeholder1 = _placeholders param [0, ""];
_placeholder2 = _placeholders param [1, ""];
_placeholder3 = _placeholders param [2, ""];
_placeholder4 = _placeholders param [3, ""];
_templateConfig = missionConfigFile >> "CfgExileToasts_SG" >> _template;
_color = getArray (_templateConfig >> "color");
_templateText = getText (_templateConfig >> "template");
_rawText = format [_templateText, _placeholder1, _placeholder2, _placeholder3, _placeholder4];
[_rawText, _color] call ExileClient_gui_toaster_addToast;
exotic flax
#

that still doesn't tell me anything

#

I would suggest to just follow the functions that are being called to see how stuff works, or simply try out some stuff to see if it works or not

#

best way to learn it is by trying to break it 😉

digital plover
#

🙂 ok i try now

digital plover
#

Wages.sqf:

while {alive player} do
{
    _wages = (player getVariable ["ExileMoney", 0]);
    if((player call ExileClient_util_world_isInOwnTerritory) or (ExilePlayerInSafezone)) then
    {
        _paycheck = 0;
        ["ErrorTitleAndText",["Activity reward", format ["You do not earn Activity rewards in Safezones and your Base!"]]] call ExileClient_gui_toaster_addTemplateToast;
        playSound "addItemFailed";
    }
    else
    {
        _paycheck = 250;
        _pay = (player getVariable ["ExileMoney", 0]);
        _pay = _pay + _paycheck;
        playSound "readoutClick";
        ["SuccessTitleAndText", ["Activity reward", format ["You received +%1 <img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/><br/>You have now %2 <img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/>", _paycheck, _pay]]] call ExileClient_gui_toaster_addTemplateToast;
        player setVariable ["ExileMoney",_pay,true];
        call ExileClient_object_player_stats_update;
    };
};
#

initPlayerLocal.sqf:

//#include "initServer.sqf"

if (!hasInterface || isServer) exitWith {};
0 call compileFinal preprocessFileLineNumbers "MarXet\MarXet_Init.sqf";

// NPC Traders
[] execVM "Traders\NPCs\BMCapeZefyrisTraders.sqf";
[] execVM "Traders\NPCs\ExileTraders.sqf";

//StatusBar
[] execVM "ClientCode\StatusBar\StatusBar.sqf";

ExileClient_cratedump_network_receiveMoneyAndRespect = compileFinal preprocessFileLineNumbers "ClientCode\R3F_LOG\objet_deplacable\ExileClient_cratedump_network_receiveMoneyAndRespect.sqf";

//Wages
execVM "ClientCode\Wages\wages.sqf";
execVM "ClientCode\Wages\announcepay.sqf";

_wages = compileFinal preprocessFileLineNumbers "ClientCode\Wages\wages.sqf";
[60, _wages, [], true] call ExileClient_system_thread_addtask;
exotic flax
#

if it works you're done 🙂

little raptor
#

Wages.sqf:
while {alive player} do
{
no sleep?

digital plover
#

ah..

#

Correct? @little raptor ```c++
while {alive player} do
{
_wages = (player getVariable ["ExileMoney", 0]);
if((player call ExileClient_util_world_isInOwnTerritory) or (ExilePlayerInSafezone)) then
{
_paycheck = 0;
["ErrorTitleAndText",["Activity reward", format ["You do not earn Activity rewards in Safezones and your Base!"]]] call ExileClient_gui_toaster_addTemplateToast;
playSound "addItemFailed";
uiSleep 900;
}
else
{
_paycheck = 250;
_pay = (player getVariable ["ExileMoney", 0]);
_pay = _pay + _paycheck;
playSound "readoutClick";
["SuccessTitleAndText", ["Activity reward", format ["You received +%1 <img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/><br/>You have now %2 <img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/>", _paycheck, _pay]]] call ExileClient_gui_toaster_addTemplateToast;
player setVariable ["ExileMoney",_pay,true];
call ExileClient_object_player_stats_update;
uiSleep 900;
};
};

little raptor
#

900s?

digital plover
#

yes

little raptor
#

Put both outside the scope. at the end

#

Doesn't make any difference. It's just redundant

digital plover
#

what is superfluous?

little raptor
#
while {alive player} do
{
    _wages = (player getVariable ["ExileMoney", 0]);
    if((player call ExileClient_util_world_isInOwnTerritory) or (ExilePlayerInSafezone)) then
    {
        _paycheck = 0;
        ["ErrorTitleAndText",["Activity reward", format ["You do not earn Activity rewards in Safezones and your Base!"]]] call ExileClient_gui_toaster_addTemplateToast;
        playSound "addItemFailed";
    }
    else
    {
        _paycheck = 250;
        _pay = (player getVariable ["ExileMoney", 0]);
        _pay = _pay + _paycheck;
        playSound "readoutClick";
        ["SuccessTitleAndText", ["Activity reward", format ["You received +%1 <img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/><br/>You have now %2 <img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/>", _paycheck, _pay]]] call ExileClient_gui_toaster_addTemplateToast;
        player setVariable ["ExileMoney",_pay,true];
        call ExileClient_object_player_stats_update;
    };
    uiSleep 900;
};

and use sqf for syntax highlighting. Not C

digital plover
#

which syntax highlighting code ?

winter rose
#

```sqf
```

digital plover
#

ah ok tyhank y ou.

little raptor
#

Is it possible to change the mouse cursor icon in displays (other than map)?

#

Just what I thought

winter rose
robust hollow
#

i dont believe so.

dusty dawn
#

Hey guys i have a pretty easy question with a possibly very difficult solution:
Is it possible to readout the IP of the server instance(either directly or from any other place) via SQF?
My current appraoch for a extension needs to know the IP(for a REST API on same IP but different port), but i cant use a cfg file for the extension as all instances run from the same Arma installation

#

From the extension would be an option too, but from SQF would be easier to adapt in the curremt system

robust hollow
#

no, i dont think there is a way for a server to know its own ip using sqf alone.

dusty dawn
#

Is there a way to readout the server.cfg?

robust hollow
#

you probably could with filepatching if the config is in the right directory.

dusty dawn
#

Hmm, thats a bummer

#

(Its for a rework of my rework of ASM, cause i need some higher FPS values XD)

#

I have a functioning extension but the GUI needs an update(i use some unknow version of the old ASM)

#

I think i can make use of saveProfileNamespace

As all instances have seperate profiles

cold glacier
#

@dusty dawn - You could probably load up the config file in your extension, and also search the list of processes on the current machine for Arma, checking for the -port parameter in its startup arguments. If there's no -port, use the default.

Not exactly a nice way of doing things thoug.

naive osprey
#

read a post somewhere about triggering ragdoll, do you still need to push the unit with something? or have they implemented a command for it?

winter rose
#

setUnconscious?

exotic flax
naive osprey
#

yeah that post. alright!

dusty dawn
#

@dusty dawn - You could probably load up the config file in your extension, and also search the list of processes on the current machine for Arma, checking for the -port parameter in its startup arguments. If there's no -port, use the default.

Not exactly a nice way of doing things thoug.
@cold glacier thx for that idea, i foundd a good way, would be to make a single CFG that has the Servernames from server.cfg as 1 entry and a IP as second entry

quartz pebble
#

Does inputAction work with findDisplay 46 displayAddEventHandler ["mouseButtonDown", {...}] ?

exotic flax
#

it should

#

although in the comments on the wiki it states:

inputAction does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0.

#

guess you'll have more luck with actionKeys

quartz pebble
#

So far have a feeling inputAction works only with keyboard. At least, if I map action to the RMB, input action returns 0.

celest token
#
_anyveh = selectRandomWeighted [
opfor_ARMED_CAR1_X,0.5,
opfor_COVERED_TRUCK_X,0.1,
opfor_TRANS_TRUCK_X,0.1,
opfor_AMMO_TRUCK_X,0.1,
opfor_REPAIR_TRUCK_X,0.1,
opfor_APC1_X,0.5,
opfor_APC2_X,0.5,
opfor_AA_APC_X,0.9,
opfor_MBT_TANK1_X,1.0
];
#

does anyone know what the numbers to the right of those units are?

#

is that spawn chance?

exotic flax
#

it's basically a percentage (0.5 = 50%, 0.1 = 10%, etc.), although combined they don't have to add up to 1

celest token
#

right

#

what if i put them all to 1.0 would that mean each one spawns in?

exotic flax
#

in that case they will all have the same chance of being selected

celest token
#

okk

#

appreciate it

#

_faction = _this select 0;
_vehClass = _this select 1;
_position = _this select 2;
_radius = _this select 3;

// DETERMINE LA FACTION

_side = EAST; 

// Find a safe location FAR FROM ZONE CENTER (keeps buggy zone selection from surprising BLUFOR)
_vehpos = [[(_position select 0)+10, (_position select 1)+0],400,600,15,0,0.5,0,[],[]] call BIS_fnc_findSafePos;

// ARRAY of Random Vehicles

_car = selectRandomWeighted [
opfor_ARMED_CAR1_X,1.0
];

_anyveh = selectRandomWeighted [
opfor_ARMED_CAR1_X,0.5,
opfor_COVERED_TRUCK_X,0.1,
opfor_TRANS_TRUCK_X,0.1,
opfor_AMMO_TRUCK_X,0.1,
opfor_REPAIR_TRUCK_X,0.1,
opfor_APC1_X,0.5,
opfor_APC2_X,0.5,
opfor_AA_APC_X,0.9,
opfor_MBT_TANK1_X,1.0
];

_airveh = selectRandomWeighted [
opfor_TRANS_HELI_X,1.0,
opfor_ATTACK_HELI_X,1.0,
opfor_MISC_AIR_X,0.5
];

_createdVehFnc = [];
if (_vehClass == "car") then {
    _createdVehFnc = [_vehpos,0,_car,_side] call bis_fnc_spawnvehicle;
} else {
    if (_vehClass == "air" && AttackHeli == 1) then {
        _createdVehFnc = [_vehpos,0,_airveh,_side] call bis_fnc_spawnvehicle;
    } else {
        _createdVehFnc = [_vehpos,0,_anyveh,_side] call bis_fnc_spawnvehicle;
    };    
};

_veh = _createdVehFnc select 0 ;// vehicle object
createVehicleCrew _veh;

if (_vehClass == "air" && AttackHeli == 1) then {
    _veh setPos [_vehpos select 0, _vehpos select 1, 300];// set height
    _veh setvelocity [0,0,300];
};

_vehGroup = _createdVehFnc select 2;
_vehGroup deleteGroupWhenEmpty true;

{
    _x setSkill opfor_ai_skill_random;
} foreach units _vehGroup;

// Set the waypoints
//hint format["%1",_patrolRadius];
_opf_patrol = [_vehGroup] execVM "WARCOM\WARCOM_wp_opf_patrol.sqf";
#

this is the entire script

winter rose
#

check the command's wiki page

daring wolf
#

Hey guys, quick question. I already asked this in the model_makers section but perhaps it would be better to ask it here. I'm making a custom mission and I know I can have custom audio / images without the players having to download any mods but can I also have custom 3D models just contained within the mission or is that beyond the scope of what is possible without mods?

robust hollow
#

yes you can, but they can sometimes cause issues (at least in mp). you can use createSimpleObject to spawn models from a mission file.

daring wolf
#

What sort of issues exactly?

robust hollow
#

in my experience it was kicks without a reason, but more recently i think i've been told it can blame bad signatures. not 100% sure on that but the point is it may cause being kicked off when you go near the object. it is possible that is a fault of the model though. i havent tried it in a long while.

daring wolf
#

That's interesting. I'm pretty meticulous when it comes to things like this so if there is a right way to do something like this I want to understand it. I will look into it and try to create some simple objects

unique sundial
#

that should be addressed in 2.00

winter rose
#

hmm question about remoteExec/remoteExecCall; is it "better" to use remoteExecCall for a command (e.g hint) or does it make no difference at all (no new scope, etc)?

robust hollow
#

i suspect it starts a new scope either way

winter rose
#

one scheduled, the other not yeah… perf-wise, the same? 🤷‍♂️

robust hollow
#

commands are unscheduled for both arent they?

winter rose
#

ah, very well might be

robust hollow
#

wiki seems to think so

winter rose
#

dang, I should really read it 😄

winter rose
#

So yeah, just matters for functions? I guess

digital plover
#

Hi all !

#

i have a question

#

I want the gun on a dying AI to be removed.

#

mission config.sqf:

DMS_RemoveLMG1  = true;
#

fn_OnKilled.sqf

if (_unit getVariable ["DMS_RemoveLMG1",DMS_RemoveLMG1]) then
{
    _unit removeWeapon "MMG_01_hex_F";
};
#

this is correct ?

robust hollow
#

possibly. have you tried it?

digital plover
#

yes i tried However, the weapon is not deleted after the AI dies

robust hollow
#

is _unit the dead body?

digital plover
#

yes

robust hollow
#

how does fn_onKilled.sqf execute?

#

(needs to execute on the owner of the AI as removeWeapon expects a local argument)

grave torrent
#

@digital plover look at how dms does it for launchers

winter rose
#

also, maybe the unit's weapon is not its weapon since the gun gets dropped

digital plover
#

The code did not work on my first try. but now it worked when I try again. Strange

#

I looked at the code for the launcher. However, it was a little confused, I did not understand @grave torrent

#

actually I better use that code

#

Can you help me about how to edit it?

winter rose
#

do you want to remove all weapons from said unit @digital plover?

little raptor
#

also, maybe the unit's weapon is not its weapon since the gun gets dropped
The event handler fires before that

digital plover
#

yes @winter rose

winter rose
#

See removeAllWeapons then 🙂 @digital plover

digital plover
#

I tried this but it doesn't work

#
if (_unit getVariable ["DMS_RemoveLMG1",DMS_RemoveLMG1]) then
{
    removeAllWeapons _unit;
};```
#

Correct ? @winter rose

winter rose
#

incorrect, wrong syntax - check the wiki 😉

digital plover
#

i edited.. this is correct ?

#

removeAllWeapons _unit;

winter rose
#

should work 🙂

digital plover
#

i try now 🙂

winter rose
#

*boom*

vague geode
#

I am executing the following line of code in my initServer.sqf-script but it doesn't seem to work. Any idea why?

[_vehicle,"addVehicleActions.sqf"] remoteExec ["execVM",0,_vehicle];
digital plover
#

not work 😦 @winter rose

#

config.sqf:

DMS_RemoveLMG1                        = true;
#

if_onKilled.sqf:

if (_unit getVariable ["DMS_RemoveNVG",DMS_RemoveNVG]) then
{
    _unit unlinkItem "NVGoggles";
};
if (_unit getVariable ["DMS_RemoveLMG1",DMS_RemoveLMG1]) then
{
    removeAllWeapons _unit;
};
robust hollow
#

yeah, those weapons are in weaponholder containers

digital plover
#

what ?

robust hollow
#

they are on the ground, not on the unit

digital plover
#

falls to the ground when they die. guns in hand before they die.

robust hollow
#

sure, and onKilled executes after the unit dies so it appears you need to delete the weaponholder container object instead of using removeallweapons (or similar).

winter rose
#

The event handler fires before that
not according to @little raptor?

robust hollow
#

hmmmm, the picture disagrees 🤔

digital plover
#

I can't solve this problem somehow

robust hollow
#

I dont think the classname is correct but something like this might work

private _containers = nearestObjects[_unit,["WeaponHolderSimulated"],5];
{deleteVehicle _x} forEach _containers;
winter rose
#

(2 should do, if it is right on death) but yup

digital plover
#

Where should I write this code exactly?

robust hollow
#

😐

#

the code for launchers has what you need with container removal

#

lines 65-79

#

duplicate and modify it slightly for the weapon you want and itl work

digital plover
#
if ((_unit getVariable ["DMS_ai_remove_launchers",DMS_ai_remove_launchers]) && {(_launcherVar != "") || {_launcher != ""}}) then
{
    // Because arma is stupid sometimes
    if (_launcher isEqualTo "") then
    {
        _launcher = _launcherVar;

        diag_log "sneaky launchers...";

        _unit spawn
        {
            uiSleep 0.5;

            {
                _holder = _x;
                {
                    if (_x isKindOf ["LauncherCore", configFile >> "CfgWeapons"]) exitWith
                    {
                        deleteVehicle _holder;
                        diag_log "gotcha";
                    };
                } forEach (weaponCargo _holder);
            } forEach (nearestObjects [_this, ["GroundWeaponHolder","WeaponHolderSimulated"], 5]);
        };
    };

    _unit removeWeaponGlobal _launcher;

    {
        if (_x isKindOf ["CA_LauncherMagazine", configFile >> "CfgMagazines"]) then
        {
            _unit removeMagazineGlobal _x;
        };
    } forEach (magazines _unit);
};
#

I'm going to duplicate and change this code, right?

robust hollow
#

yes

digital plover
#

my english is not very good. therefore I have difficulty understanding.

#

Ok so how do I edit this code for snipers?

robust hollow
#

i dont know exactly, ive never used dms before. from what i can see there you would change some of the classes (LauncherCore, CA_LauncherMagazine) to the class you need, and instead of _launcher you would look for the weapon(s) you want.

digital plover
#

_launcherVar = Is that a variable?

robust hollow
#

probably

digital plover
#

I guess I should arrange these one by one for snipers

robust hollow
#

_launcher will be defined in that file though

little raptor
#

Does anyone know how to reference classes from configFile inside mission config?
in other words:

class SomeConfigFileClass;

doesnt work when I put it in description.ext
SomeConfigFileClass is a class defined in configFile

#

Never mind. Found it:

import SomeConfigFileClass
winter rose
#

Since 1.99 😉

little raptor
#

Damn that was close! notlikemeow

robust hollow
quaint oyster
#

What would be the best route to keep someone alive inside of a destroyed vehicle? Or a vehicle that explodes without playing with allowdamage false?

winter rose
#

allowDamage false

#

temporarily, but allowDamage

quaint oyster
#

yeah i'm trying to figure out the best route to kick it on, tried an event handler with a detection for the vehicle player but it still kills em

winter rose
#

well yeah, it has to happen before

quaint oyster
#

that's what i'm stuck on

#

i think i'm doing it after it happens

#
if (player getVariable ["slaysrevivesystemisrunningalready",0] isEqualTo 0) exitWith {
player setVariable ["slaysrevivesystemisrunningalready",1];
sleep 1;
systemchat "Revive system running!";
player addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    _unit = _this select 0;
    _damage = damage _unit;
    if (_damage > 0.9) then {
    _damage = 0.9;
    _unit setVariable ["reviveable",1];
    _unit setVariable ["canbehealed",1];

  //[player] call slay_injured;
  //player call slays_bleed_screensfx;
  _unit setCaptive true;
  0 fadeSound 0.3;
  _unit allowDamage false;
  moveOut _unit;
  systemchat "player killed";
  if (_unit == vehicle _unit) then {moveOut _unit};
  systemchat "godmode enabled";
  _unit setUnconscious true;
  systemchat "player knocked unconscious";
  _unit setCaptive true;
  systemchat "player set captive";
  0 fadeSound 1;
    };
_unit setDamage _damage;
}];

};

if (player getVariable ["slaysrevivesystemisrunningalready",0] isEqualTo 1) exitWith {
systemchat "Already running revive system!";
};

#

i'm assuming this method is already far too late?

#

the players die in the vehicles it trigger death mechanics, must respawn etc.
It works flawlessly if they get injured outside of a vehicle however, would i need to do an eventhandler akin to his but for their vehicle, then trigger allowdamage false on each passenger?

torn juniper
winter rose
#

using latest dev?

torn juniper
#

I assumed it was on stable since there has been an arma update since KK's post of fixed in next dev

winter rose
#

huh… when did 1.98 come out?

torn juniper
#

April 14th

#

his post was on the 9th

robust hollow
#

it likely wouldnt have made it into the 1.98 build if it was only just being added to dev (1.99)

torn juniper
#

either way both Warning Message: Cannot load texture mpmissions\mission.altis\custom\ and Warning Message: Picture mpmissions\__cur_mp.altis\custom\

#

shouldn't one of them work even without the fix?

#

but yea I suppose so if it was marked as resolved on 18th of May

#

I'll play with it or make a work around if its not fixed until update.. I was scratching my head on it

#

work around like pbo'ing my mission PepeHands

#

Thanks guys, Ill make do 😄

unique sundial
#

@torn juniper have you tried release candidate? anyway too late now as next stable is not far away

velvet merlin
#

how to convert these old A2 remote execution code to A3 best?

[nil,_unit,rSPAWN,[_unit,ger_tank0,"commander"],_fnc] call RE;```

```sqf
[nil,nil,"per",rSPAWN,[],{
     sleep 0.01;

     "colorCorrections" ppEffectAdjust [1,1,0,[0.1,0.05,0.0,0.02],[1.2,1.0,0.8,0.666],[0.5,0.5,0.5,0.0]];
...

     while {true} do

    {
         waitUntil {vehicle player == player};
         _ps setPos position vehicle player;

         sleep 0.1;
     };
 }
] call RE;```
winter rose
#
[[], { /* the code */ }] remoteExec ["spawn", 0, true]```
#

but the best would be of course to use color correction template in description.ext, and use the corresponding BIS_fnc @velvet merlin

#

also attachTo 😬

robust hollow
#

that uhh.... that remoteexec spawn would require an argument too [[],{ /* the code */ }]

winter rose
#

Fixed! I woke up 5 minutes ago and you can see that 😁

robust hollow
#

trying to think within an hour after waking up is always a terrible idea 😪

#

wouldnt recommend

winter rose
#

I don't think s— ooooooh

cosmic lichen
#

You are already browsing arma 3 discord 5 mins after you woke up? You addicted mate? 😄

velvet merlin
#

[[param1,param2], {_this spawn LIB_fnc_moveIntoVehicle}] remoteExec ["spawn", 2];

#

does this look right?

#

or rather

[param1,param2] remoteExec ["LIB_fnc_moveIntoVehicle", 2];

robust hollow
#

personally i'd go the latter, but either way works

velvet merlin
#

the latter would need this, right?

functionName: String - function or command name.
While any function can be used, only commands and functions defined in CfgRemoteExec will be executed.

robust hollow
#

yes. it is better for security to do the latter but if that isnt a big deal the former would work just as well

velvet merlin
#

yeah for a basic TDM conversion

winter rose
#

You are already browsing arma 3 discord 5 mins after you woke up? You addicted mate? 😄
There are principles to follow!1!

#

remoteExec'ing spawn or call is a door open to potential hacks too - some peeps may want to disable it

cosmic lichen
#

@velvet merlin I was told to always rather create a function and remoteexec that instead of using spawn or call. I think there is even a note on the remoteExec page about that.

robust hollow
#

the only time a call or spawn is acceptable is when the remoteexec is sent from the server, and that is only because it bypasses the restrictions anyway.

winter rose
#

so you trust functions and not the passed code 🙂

little raptor
#

Hey guys.
Does anyone know a way to clear the "texture cache" or whatever it is that prevents the game from properly reading the updated .paa files (in mission folder)?
I mean besides renaming the files or restarting the game! 🙂

winter rose
#

nope

little raptor
#

😦

warm hedge
#

Use Diag exe

#

I used the Diag when I do a small project to retex weapons

vague geode
#

I am trying to execute a script that adds actions to certain vehicles using the addAction-command and because the effect of said command is only local I am trying to execute the script on every connected client machine and (as long as that vehicle is alive) on every JIP machine as well.
To do this I am using the following line of code in my in my initServer.sqf-script but it doesn't seem to work.

Any idea why?

[_vehicle,"addVehicleActions.sqf"] remoteExec ["execVM",0,_vehicle];
still forum
#

Is it possible to change the mouse cursor icon in displays (other than map)?
@little raptor
mod config yeah.

winter rose
#

2.02 wen?

torn juniper
#

@unique sundial glad I waited until I woke up to download.. Next stable was not very far away at all 😛 I will test and verify that the fix is in stable and if not will take a poke at the ticket again. Thanks much!

#

@winter rose @robust hollow I guess I only had to wait barely 12 hours for a (hopeful) fix - thanks for the help earlier though pepehype

little raptor
#

2.02 wen?
aRmA 5 v1.0 wEn?

little raptor
#

Wait. I thought they merged all changes up to v2.01.xxx into v2.00.xxx. I just realized that half the commands are missing! notlikemeow
Going back to dev...

little raptor
#

@still forum

mod config yeah.
I mean temporarily. Similar to ctrlMapCursor

tiny wadi
#

Another day another update

#

Anyone know how this can be used? I can't think of how it may be safer

#

What would be the difference between just having a global variable on the clients mission

little raptor
#

variables cannot be broadcast out of or into this namespace in multiplayer
Global variables can be replaced. This one can't (apparently)

#

And also:

will not be serialized when game is saved. UI variables can be safely stored in this namespace

still forum
#

Temporarily I'm quite sure no

#

nah 1.99 into 2.00
2.01 into 2.02

We branched off early, I think back in August. And after that only fixes or important stuff gets merged back.
So the last months of stuff is all 2.02 basically

#

localNamespace cannot be messed with via publicVariable.
people would need to remoteExec whole scripts to change values there.

little raptor
#

Global vars need disable serialization right?

#

But this one doesn't

still forum
#

explain?
yes missionNamespace will not save stuff like ui displays and such, might even complain with warnings

little raptor
#

If you define:

MyCtrl = _displ displayCtrl ID;

It won't work anywhere else right? (unless you put disableSerialization)

#

I've never done it but I assume it won't

winter rose
#

it will but complain with a messagebox

little raptor
#

ah ok

still forum
#

it will complain, and it will work, until you save+load the game.
or if you send it via publicVariable to others

little raptor
#

Is it possible to localize text in a language other than what the user has selected in game options?

winter rose
#

not as far as I know, nope - why?

little raptor
#

To create a "select UI language" option!

#

I guess it's not necessary

winter rose
#

not necessary at all?

<Key ID="STR_lang_en">
  <Original>English</Original>
</key>
<Key ID="STR_lang_fr">
  <Original>Français</Original>
</key>
<Key ID="STR_lang_de">
  <Original>Deutsch</Original>
</key>
#

…nvm, my mind is boggled @ work

granite zealot
#

Any Idea how to force calculatePath to stay on roads even if routes are longer ? Maybe a vehicle with horrible terrainCoef ? No idea how AI pathfinding considers that.

exotic flax
#

When using this command to get the predicted path of vehicles driving and having them stay on roads (not go cross country) is important, the best vehicle to use is "wheeled_APC" and careless behaviour.

minor tulip
#

I'm having difficulty getting a script spawned AI group to board a player aircraft. I created a script to create the squad and addwaypoint. The squad does not board the aircraft unless I use waypointattachvehicle. Also, once they board, I can't get them to use a new waypoint to get out.
Main goal is to have a billboard with an add action that a player land in front of, call the squad to board, and take them to a player specified LZ.

_Squad1 = [
    (getMarkerPos "BFS1S"), West, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad")
        ] call BIS_fnc_spawngroup;
_Squad1 deleteGroupWhenEmpty true;

_Pickup1 = getMarkerPos "Squad1Pickup1";
_DropOff1 = getMarkerPos "Raven1 Deploy Alpha";
_S1Attack = getMarkerPos "S1Attack";
_Squad1Units = (units _Squad1);

_Raven1P = group player addwaypoint [_Pickup1, 0];
_Raven1P setwaypointtype "LOAD";
_Raven1P waypointattachObject BFS1HP;
_S1W1 = _Squad1 addWaypoint [_Pickup1, 0];
_S1W1 setWaypointType "GETIN";
_S1W1 waypointattachVehicle Raven1;
granite zealot
#

@exotic flax Sadly doesnt work, still wants to go up 80 degree inclined cliffs instead of the road around the cliff

astral tendon
winter rose
#

rum all you want!

smoky rune
#

maybe it's a stupid question, but - does setTimeMultiplier command affects time call result? Is time function operates with "real", not multiplied seconds?

unique sundial
#

setTimeAcc affects time, not sure about the other one maybe just date is affected, test it

hollow thistle
#

setTimeMultiplier only affects the speed of in-game daytime simulation.

#

so it won't affect time.

amber lantern
#

Hey

#

How can I view all icons that I could use for respawn loadouts?

#

like "a3\missions_f_exp\data\img\classes\assault_ca.paa" and "\A3\ui_f\data\map\VehicleIcons\iconManLeader_ca.paa"

#

I downloaded PBO manager but apparently the files don't follow any logical paths...

loud python
#

I'm having trouble with setWaypointPosition

#

I want a unit to move abut randomly

#

so I just update a waypoint every time it is completed

#

and I set its position with setWaypointPosition to the 0th waypoint (the spawn position) with a radius of 100

#

but for whatever reason it only moves the waypoint within a very small area and just to one side of the center

#

I also placed some arrows at the exact coords to make sure that the center is, indeed, the units spawn position and doesn't change

#
[group this, 1] setWaypointPosition [waypointPosition [group this, 0], 50];
[group this, 2] setWaypointPosition [waypointPosition [group this, 1], 0];
arrow_1 setPos waypointPosition [group this, 0];
arrow_2 setPos waypointPosition [group this, 1];

That's the on activation code for waypoint 1 (type: move) and waypoint 2 is just a cycle waypoint

#

any ideas?

#

also, if I change the radius to 10, it just snaps to a nearby building and doesn't change at all anymore

#

oh, after like 30 waypoints I just got one on the other side

#

still looks pretty broken though, does setWaypointPosition try snapping to buildings or something?

#

or, idk, apply some weird heuristics to figure out where to send units or something

#

because this certainly isn't "a random position within the radius"

robust hollow
cosmic lichen
#

@little raptor I was just about to write an example 😄

#

Also, enjoy the new command groups 🙂

amber lantern
#

Hmm

#

I'm trying to update a respawn location

#

but I'm getting "init local variable in global space"

#

is ```sqf
"respawn_west" setMarkerPos _pos;

not supported?
robust hollow
#

probably wants you to hardcode the pos instead of using _pos local variable

quaint oyster
#

Anyone able to see what I'm doing wrong? Trying to slap allowdamage false onto the player, then the vehicle when it hits a specific damage amount. It doesn't seem to be working at all for me sadly. I did a similar script with players outside of vehicles that functions, but it doesn't seem to work the same for the vehicles.

player addEventHandler ["GetInMan",
{
params ["_unit", "_role", "_vehicle", "_turret"];
_systemchat = format ["Vehicle script running on players vehicle, %1",_vehicle];
systemchat _systemchat;
_unit = _this select 0;
_damage = damage _vehicle;
if (_damage > 0.7) then {
  moveOut _unit;
  _damage = 0.7;
  _vehicle allowDamage false;
  _unit allowDamage false;

  };
  _vehicle setDamage _damage;
  _unit setDamage _damage;
}];
amber lantern
#

@robust hollow so how should I go about having the spawn follow the group?

south rivet
#

Quick question, am I correct in saying configOf and isNotEqualTo were not added in the 2.00 release and are still only on dev?

cosmic lichen
#

Yes @south rivet

slim oyster
#

@quaint oyster That eventhandler would only fire for getting into the vehicle, you would need to add say a handleDamage EH to the vehicle within the getInMan EH, you also do not need to use _unit = _this select 0; as it is already defined in the params

#

GetInMan EH -> check variable of veh if it has a handledamage EH, if not assign it -> handledamage ignores damage over 0.7 and kicks out players
also an EH for getting out and checking if there are any players left in the vehicle, if not, remove handledamage EH

cosmic lichen
#

@south rivet I take that back, configOf made it into 2.00 even thought he biki says otherwise

#

isNotEqualTo didn't make it though

quaint oyster
#

you would need to add say a handleDamage EH to the vehicle within the getInMan EH
@slim oyster

Something like this?

player addEventHandler ["GetInMan",{
params ["_unit", "_role", "_vehicle", "_turret"];

    _vehicle addEventHandler ["HandleDamage", {
        params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
      //code
    }];
    
}];
south rivet
#

@cosmic lichen thanks for the info, I didn't see configOf in the changelog when I checked, so I checked wiki and that confirmed the changelog. So I thought it was left out

cosmic lichen
#

I thought so too but the debug console says it's in 2.00

fathom tusk
#

Is setcombatunitmode/unitcombatmode still on dev branch? Thought it was going to be part of 2.0.

robust hollow
#

introduced in 2.01

fathom tusk
#

For real?

#

Cool

cosmic lichen
#

That means it's not yet on stable ;D

fathom tusk
#

I gathered that.

drowsy axle
#

Is there a command to unload/delete a units magazine. I cannot seem to find one..

winter rose
#

removeMagazine?

drowsy axle
#

im dumb...

rustic plover
#

Who knows how to close system dialog? (eg "Steam Overlay is disabled...", with buttons "website" and "close"). closeDialog doesn't work and this has no display

karmic flax
#

I found a small bug on one of the scripting examples on the wiki, missing [ causing errors, I tried to make an account so I could report it but wiki says that new accoutns is temporarily suspended

robust hollow
#

what page

karmic flax
#

example 1

#

call BIS_fnc_rotateVector2D takes one argument, but bc of missing semicolon it gives script error

#
_y = 45; _p = -80; _r = 0;
BRICK setVectorDirAndUp [
    [sin _y * cos _p, cos _y * cos _p, sin _p],
    [[sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D
];```
#

thats what it should be

robust hollow
#

fixed

rustic plover
#

Who knows how to close system dialog? (eg "Steam Overlay is disabled...", with buttons "website" and "close"). closeDialog doesn't work and this has no display
I mean this dialog https://i.imgur.com/meyaRvi.png

exotic flax
#

press "cancel"?

rustic plover
#

Via script

#

I searched for emulating ESC key, but I didn't find anything about it in Arma

exotic flax
#

it should be a simple BIS_fnc_guiMessage, so ```sqf
uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];

rustic plover
#

it should be a simple BIS_fnc_guiMessage, so ```sqf
uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];

@exotic flax thanks! I'll try it now...

robust hollow
#

status is the result from the button you click

exotic flax
#

false aka "pressed cancel" 😉

robust hollow
#

ah yes

exotic flax
#

unless it's BIS_fnc_3DENShowMessage, because than I have no idea, other than manually trying to find the messages somewhere in findDisplay 313

robust hollow
#

nah that uses 3den style controls.

astral dawn
#

Sorry I missed the enableUnicode discussion, only saw some part of it.
Is this command relevant only for copying text to clipboard or for other things too?

robust hollow
#

at least these i believe

copyToClipboard
copyFromClipboard
count
select
find
in
astral dawn
#

Because as I recall arma's strings are UTF-8 encoded, so they should be able to handle non-standard characters too.

#

Oh wow, how? Are they not working with non-english characters? :O

robust hollow
#

not quite. count for example does this
count "привет" == 12

astral dawn
#

😟

#

Insane! Wiki says that strings are indeed Unicode with UTF-8 encoding. I have no idea how this was done this way 😳

rustic plover
#

it should be a simple BIS_fnc_guiMessage, so ```sqf
uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];

@exotic flax doesn't work :(

astral dawn
#

So I guess that if I do select on a string with non-ascii characters, I will get total nonsense?

#

Since it would cut out bytes which might be in the middle of a UTF character? 🤔 but UTF should resynchronize after that so it's not so bad.

rustic plover
exotic flax
#

If the user has Steam overlay disabled, the command will display appropriate message to the user and return false.
So solution is to enable Steam Overlay

#

because since it's a command, and not a function, being used, it's all handled by the engine

rustic plover
#

I need to detect steam overlay using :) It means that no visual effects need to be

#

It's only way to do this, isn't?

exotic flax
#

it seems to be hard coded, so I'm afraid it's either having the message or not using the command

#

which only applies out of a game anyway (eg. main menu), for which other solution can be made

amber lantern
#

Hey I'm trying to use BIS_fnc_taskPatrol

#
[group this, getPos this, 200] call BIS_fnc_taskPatrol;
#

But I'm getting

Error group: Type Group, expected Object
#

Is there a way to find out what causes this error?

robust hollow
#

reading it

#

group this group expects an object to get the group of, but this is a group already so it cant get the group of a group

amber lantern
#

aah

#

so I'll have to move it to the group leader of all

#

fuuuuqqq

#

well I suppose I can edit the file manually

#

@robust hollow thank you!

#
_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;
};
#

Why would this result in me being spawned in ocean

#

It's in initServer.sqf

#

Basically just getting a random position on land within a certain area and spawning everyone there

#

setting the respawn marker there also

#

and then continuously updating that respawn marker

#

wait, it's showing [0, 0, 0] as the marker location even in editor debug window

#

But getting the position through "log -> log position to clipboard" I'm getting the correct thing 😮

quaint oyster
#

Anyone able to help me with this event handler stuff? I got it to this point, but it still applies damage higher than 0.7, and even stacks it on the player, eventually killing them. I'm stumped badly.

player addEventHandler ["GetInMan",{
params ["_unit", "_role", "_vehicle", "_turret"];
_systemchat = format ["Player entered vehicle, %1",typeOf _vehicle];
systemchat _systemchat;
_alreadyrunningrevivesystem = player getVariable ["slaysvehiclegodmode",0];

//if the vehicle doesn't have the variable, launches the event handler.
if (_vehicle getVariable ["slaysvehiclegodmode",0] isEqualTo 0) exitWith {
_vehicle setVariable ["slaysvehiclegodmode",1];
systemchat "Vehicle entered, script ran.";

//event handler to stop vehicle / player death
    _vehicle addEventHandler ["HandleDamage", {
        params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
      _systemchat = format ["%1 damage level: %2",typeOf _vehicle,_damage];
      systemchat _systemchat;

//not working, still applying damage higher than 0.7???
      if (_damage > 0.7) then {
        _vehicle setDamage _damage;
        {_x  allowDamage false;
          _unit setDamage _damage;
        moveOut _x;} forEach crew _vehicle;
        _vehicle allowDamage false;
        _unit allowDamage false;

        _systemchat = format ["%1 damage level: %2",typeOf _vehicle,_damage];
        systemchat _systemchat;
        };
    }]; //end of vehicle damage watcher
  };//end of vehicle var check

  if (_vehicle getVariable ["slaysvehiclegodmode",0] isEqualTo 1) exitWith {
    systemchat "Already running vehicle damage system!";
    };

}];//end of player getin handler
jade abyss
#

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage

If code provided returns a numeric value, this value will overwrite the default damage of given selection after processing. Return value of 0 will make the unit invulnerable if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling). If no value is returned, the default damage processing will be done. This allows for safe stacking of this event handler. Only the return value of the last added "HandleDamage" EH is considered.

#

Simply return the max. dmg

#

e.g.

_vehicle addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
  _damage = 0.2;
  _damage
  }];
#

==
0.2 damage, no matter what

quaint oyster
#

interesting

celest token
#

sooooo

#

i need some help

#

im using drongo's map population mod and it has a built in "run this script on a vehicle when it is spawned" init script

#

and i want to create a script that checks how many seats are free and populates the vehicle with a certain unit type fully

#

is that possible with arma?

winter rose
#

otherwise, for a "specific" type of unit, see also fullCrew to get filled and empty seats

celest token
#

thanks brother

little raptor
#

@cosmic lichen @robust hollow Thanks a lot guys! 👍

still forum
#

@astral dawn in 2.02 KK will provide a solution for that.
You will need to probably enable it per-command where you need it.

solid raptor
#

I have a question about loops
if I have a while(true) do loop, with something like this at the end

#

WaitUntil{sleep 2; condition};

#

what does that mean, that it will sleep for 2 seconds and then check the condition?

warm hedge
#

True. It should check the condition every each 2 seconds

solid raptor
#

does it not matter whether or not the condition is true

#

thats what i'm wondering

#

trying to understand someone elses code

#

is it just a NOOP?

proud carbon
#

I have an object the is meant to slowly move towards the player, it is an invisible object. But i have an issue where the object is rotates in isn't in the same bearing as it was once was. meaning it'll be 270 instead of 180 and such.
How do i get the logic to a point where it stays a consistent direction to the player it is getting closer to?

little raptor
#

if condition is true, it will exit the waitUnitl, otherwise it waits until it's true

solid raptor
#

ahhh

little raptor
#

if you just want to wait 2 seconds, use sleep

solid raptor
#

well, no that doesn't explain it

#

so it doesn't do anything in a loop

little raptor
#

that depends on what you're trying to do

#

it may be redundant

solid raptor
#

oh wait I think I get it, it won't loop over if the condition isn't true

little raptor
#

@proud carbon Use setVectorDir. If the surface is not flat, you should use setVectorDirAndUp

proud carbon
#

but setVectorDir only works with objectives that have a simulation enabled.

#

hiddenObjects do no not