#arma3_scripting

1 messages · Page 84 of 1

wary sandal
#

@still forum what does 🫂 mean 🤨

still forum
#

Hug

little raptor
#

how do you know they're ommited?

#

maybe you're logging a nil value?

#

e.g. diag_log nil doesn't work. diag_log [nil] does

void carbon
#

wojtek check pm

wary sandal
#

for example, this is what happens when i click on a button I have

#

(the WRITE macros just translate to call {params ["_content"]; diag_log _content; })

#

so yeah i clicked on the button that triggers that logging but nothing

little raptor
#

which might fails as I said

little raptor
#

that one shouldn't produce a nil ever

wary sandal
#

it sometimes doesn't fail, and it sometimes fails elsewhere in the script

#

I'm very confused

little raptor
#

does it skip some of them? or just not log anything at all after some point?

wary sandal
little raptor
#

until now? are you using profiling branch? or dev branch?
if not, "until now" doesn't make sense because the game hasn't been updated for a while

stark fjord
wary sandal
#

none

#

well i've been getting new messages in the rpt such as

19:25:38 No speaker given for 'Samuel O'Connor'

but i think it's normal

wary sandal
little raptor
#

well the game hasn't been updated for several months so unless your issue started happening since then the problem is in your code

wary sandal
#

there's no substance to debug because the issue constantly changes

little raptor
#

just do diag_log [_this] in that function for now

little raptor
#

if that solves your issue you know what you've been doing wrong

wary sandal
#

so I guess no nil values on the horizon

granite sky
#

I'm gonna guess that the logging code isn't always executing due to bugs further up.

wary sandal
#

to see if the issue has to do with my code

#

what else can i use? systemChat? the history is too short

winter rose
#

diag_log or systemChat, or dll that writes in a txt file

wary sandal
#

the dll is my ultimate goal but it will take some time for me to learn rust
for now i think i will quickly setup a list UI and log it there

#

Avoiding repetitive code by shrinking it to a single word or two

#

as far as my knowledge goes, the scripts are first preprocessed (resulting in macros being processed) and then compiled

#

so it'd make no difference in performance

hallow mortar
#

A macro might actually (slightly, if it was a big macro/used a lot) reduce performance if you were preprocessing and compiling the file every time you executed it (e.g. execVM, preprocessFile). Otherwise, no impact; at runtime, the game is seeing the code as if it were typed out in full, because the macros were already done during initial loading.

wary sandal
#

it appears that it is the diag_log command failing

#

everything works as expected... so far

#

I'll see how it develops tomorrow

abstract gust
#

Delete marker when unit is looted?

pliant stream
#

macros are stupid

#

they'll often end up evaluating the same expression multiple times

fleet sand
#

Hi guys I have a question about scope. so I have this code:

LEG_createFireRune = {
    params ["_pos"];
    //Place Fire Rune Picture on Surface
    private _surfaceNormal = surfaceNormal _pos;
    private _textureObj = createVehicle ["UserTexture1m_F",[0,0,0],[],0,"None"];
    _textureObj setObjectTextureGlobal [0,"Img\Rune_01.paa"];
    _textureObj setPosASL _pos;
    _textureObj setVectorDirAndUp [_surfaceNormal vectorMultiply -1, vectorDir _textureObj];
    private _dir = getDir _textureObj;

    //Create light
    private _light = createVehicle [ "#lightPoint", _pos, [], 0, "CAN_COLLIDE" ];
    _light setLightAmbient [ 0,0,0 ];
    _light setLightBrightness 10;
    _light setLightColor [ 1,0.6,0.4 ];
    _light setLightIntensity 10000;
    _light setLightAttenuation [0,0,0,2.2,500,1000];
    _light setLightDayLight true;

    //createTrigger
    private _trigger = createTrigger ["EmptyDetector",_pos,true];
    _trigger setTriggerArea [2,2,_dir,true,2];
    _trigger setTriggerActivation ["ANY","PRESENT",false];
    _trigger setTriggerStatements ["this", "
    systemChat 'BOOM!';
    {deleteVehicle _x} foreach nearestObjects [position thisTrigger,['UserTexture1m_F'],2];
    deleteVehicle thisTrigger;
    ", ""];
};```
What would be best practice for me to delete the light in the trigger. Also NOTE: i also could have N number of FireRunes in a scene.
still forum
#

_trigger setVariable ["mylight", _light];

deleteVehicle (thisTrigger getVariable 'mylight')

onyx raven
#

I feel like this has probably been made already, is there a script for reporting over system chat a player killing civilians?

"As in (player name) has killed a civilian"

open fractal
#

I would encourage you to learn to read the docs and figure this one out if you're in the business of making missions but if you've never coded before and this is literally all you want then I'll write it up when I have a minute

#

you can either remoteExec or add the mission event handler locally to every client

onyx raven
#

dont worry about it, it was more of a if it had already been made sort of question

open fractal
#

it's already been made in my mind 🧠

onyx raven
#

thats ok, thanks though

agile pumice
#

Anyone know how to change the ACE3 nametag?

#

for an AI unit for example

torn hemlock
#

Just look at the script

#

:)

open fractal
#

ok

agile pumice
#

I have the drawnametagsicon function right now

#

I think this is the important bit //Set Text: _name = if (_iconType in [ICON_NAME, ICON_NAME_RANK, ICON_NAME_SPEAK]) then { [_target, true] call EFUNC(common,getName) } else { "" };

#

I thought ` was used for code tags?

proven charm
#

what's the correct way to check if extension is installed?

agile pumice
#

anyways, couldnt find out how to find the macro for EFUNC(common,getName)

sullen sigil
#

fileExists, no?

proven charm
#

I have extension in arma3 main folder so not sure if that works

#

aah seems to work but I have to use the DLL name like "ArmaTools_x64.dll"

#

that's a problem

winter rose
#

make a valid call, if it returns empty string then it's not installed

proven charm
#

yeah was thinking about that

tough abyss
#

ace_common_fnc_getName

wary sandal
#

Is there a command to retrieve the items (or the amount) in a listbox?

tough abyss
#

for code blocks use tripple `

still forum
fleet sand
#

Hi guys question is there a way to Push a player in a direction with out setting him Unconscious ?

stark fjord
#

setVelocity, but you might wanna add a small nudge in z axis

proven charm
#

setVelocity can be deadly

stark fjord
#

Because players are stuck to ground quite hard, and just pushing them wont make them move, unless you use high amounts of force

sullen sigil
#

setposasl vertically by a bit first

#

like .005m

stark fjord
#

You mean atl?

sullen sigil
#

doesnt matter

#

oh i forgot the increase setposasl part

stark fjord
#

If they are on a hill, you will sink them into da ground

sullen sigil
#

increasebeight by .005m

fleet sand
#

Ty guys very much and also by any chanse do you guys know how to get the player facing vector. Basicly i want it to push a player in direction he is facing.

stark fjord
#

something like this player setVelocity (((vectorDir player) vectorMultiply 5) vectorAdd [0,0,2])

agile pumice
#

found this little bit in the setName function:: _unit setVariable ["ACE_Name", _name, true];

fleet sand
# stark fjord something like this ```player setVelocity (((vectorDir player) vectorMultiply 5)...

Ty very much i got it to work a bit diffrent here is the code:

    player allowDamage false;
    player setPosASL [getPosASL player select 0, getPosASL player select 1, (getPosASL player select 2) + 10];
    _vel = velocity player;
    _dir = direction player;
    _speed = 100;
    player setVelocity [
    (_vel select 0) + (sin _dir * _speed),
    (_vel select 1) + (cos _dir * _speed),
    (_vel select 2)
    ];
    sleep 3;
    player allowDamage true;
winter rose
#
player allowDamage false;
player setPosASL (getPosASL player vectorAdd [0,0,10]);
player setVelocityModelSpace [0, 100, 0];
sleep 3;
player allowDamage true;
fleet sand
acoustic yew
#

Ello,
Can I check if wp1 (waypoint - 1) exists?

granite sky
#

Uh, you use something like _waypointIndex < count waypoints _group

acoustic yew
#

okay...

granite sky
#

A waypoint is [group, index]

acoustic yew
#

what's the output of that?

dreamy kestrel
#

Q: how can player be an object and yet not isPlayer?
the scenario is MP joining but not yet 'spawned' or deployed.
my guess is still in the 'slot' object...

acoustic yew
#
if (waypoint 1 exists) then {
add another one 
} else {
//do nothing
};```
granite sky
#

What's the actual input data?

#

Like where are you getting this "waypoint 1" from?

acoustic yew
#

adding it with a script

#

    playerLocation = [player, 5, 7, 5, 0, 0.5, 0] call BIS_fnc_findSafePos;
    hint "meow_1";

    if (leader team_1 distance player > 10) then {
        if ( check if wp1 exists ) then {
            wp = team_1 addWaypoint [playerLocation, 0];
            hint "meow_2";
        };
    };

    if (!isNull objectParent player) then {
        {
            _x assignAsCargo vehicle team_1
        } forEach units team_1;
        {
            _x orderGetIn true
        } forEach units team_1;
    } else {
        team_1 leaveVehicle vehicle player;
    };
#

6th line

#

I want to check if wp1 exists

#

or wp0 exists (but yk)

granite sky
#

What makes you think that either of these waypoints would or wouldn't exist?

acoustic yew
#

uh

#

I dont want it to add another wp

#

I just want 1 waypoint

#

if its finished then add another one

granite sky
#

Ok, waypoints don't get deleted/removed when they're finished.

acoustic yew
#

hmmm

granite sky
#

If a group has two waypoints then it still has two waypoints after they're completed.

acoustic yew
#

hmmm

granite sky
#

You can tell that a group has finished it's waypoints because currentWaypoint _group >= count waypoints _group

acoustic yew
#

can I just have one waypoint to a group?

granite sky
#

If you like, yes.

acoustic yew
#

how

#

:D

granite sky
#

Delete any others, change that one. Use setCurrentWaypoint to switch back to it after completion & editing.

acoustic yew
#

example??

granite sky
#

no

acoustic yew
granite sky
#

setWaypointPosition is the only other command that you probably need.

dreamy kestrel
#

it's not hard rtfm

acoustic yew
#

for my wee brain it is

dreamy kestrel
acoustic yew
#

how big do u think a cat's brain is?

dreamy kestrel
#

felines have god brains, surely you can figure it out

acoustic yew
#

ah... I have the peasant brain lol

#

okay, what if I can check if there is a waypoint (counting) and if there is a waypoint like less than 2 then add another one (or something)

dreamy kestrel
winter rose
acoustic yew
#

I got it working

dreamy kestrel
# winter rose I take `player` is `objNull`

no it's not, it actually has a value, I get a name from it and everything...

12:09:35 [...] [2429.52] [INVENTORY] [fn_inventory_onAceVirtualItemsAdded] Entering: [_name, _uid, _playerIsPlayer, count _virtualItems]: ["<name>","",false,13296]
#

I am passing it as a CBA EH argument, not sure what is happening to the object through that plumbing though...

winter rose
#

this log tells me nothing, I don't speak ACE

dreamy kestrel
#

my params are:

params [
    [Q(_player), objNull, [objNull]]
    , [Q(_virtualItems), [], [[]]]
];
#

_player has a value, I got the name, but reporting isPlayer getPlayerUID, false ""

granite sky
#

Otherwise maybe a timing thing. I'm not sure on the exact order of how player units are constructed.

dreamy kestrel
#

sprinkling in some logging to verify the sequence of events

#

so for purposes of these events, local events client side, no need to pass any player object as an argument.
somehow it is an issue with argument passing, players lose their information.

#

but if I always start from player, seems 'okay'

winter rose
#

¯_(ツ)_/¯

fleet sand
#

Question is there a way for me to overlay texture with another texture. For example When I aim at person, I would like to put a custom image over his clothes and face Overlaying those texture with a texture.

winter rose
#

no

hallow mortar
#

You might be able to fake it using a UI-to-texture with the original texture as a background. Bit advanced though - and any scripted texturestuff will only work on parts of the person that can actually be retextured with setObjectTexture, which is not necessarily all of them

winter rose
#

if object texture,
if PiP is enabled,
so not for everyone and definitely not something to count on

agile pumice
#

Yep, that worked

hallow mortar
#

Does UI-to-texture require PiP? I know video R2T does but I've not heard about it for UI2T

winter rose
#

oh wait, perhaps not
but still couldn't do it, because I believe he wants some decal system out of it

winter rose
#

a different material perhaps

jade acorn
analog inlet
jade acorn
dreamy kestrel
#

what happens to player (_player) objects crossing a mission start boundary? I am observing odd behavior isPlayer getPlayerUID reporting false "". I know isNull _player is false because I have a valid name _player. but I wonder there is something going on there, I have a callback in progress when the mission start happens.

fleet sand
sharp grotto
jade acorn
#

missionProfileNamespace is separate to single missions. If you save missionprofilenamespace in mission #1, you can't load it it mission #2, because mission #2 has a separate missionprofilenamespace

sharp grotto
#

i know, i just need to know what the identifier is.
I guess it's missionName but im not sure.

jade acorn
#

identifier?

sharp grotto
#

nvm it's written there "the variables are saved into missionName.vars"

dreamy kestrel
runic warren
#

that worked! thank you so much!

wary sandal
#

no need for disableSerialization in non scheduled environments (event handlers like onEachFrame) right?

wary sandal
#

does uisleep work with saving?

#

when I save my mission and restart, the state of the script skips to after the uisleep (even tho the 30 seconds I specified have not elapsed)

#

I hope I made some sort of sense, it's not easy to explain

winter rose
#

IDK, use sleep

wary sandal
winter rose
#

why do you want this?

wary sandal
#

everytime I click on the button it changes the text, waits a couple seconds (should work both in game pause and while playing) and then makes the button clickable again and change the text

#

I came up with this workaround

private _startTime = time;
waitUntil { time - _startTime > 5 };
#

I know it's bad but uisleep's behavior is weird

winter rose
opal zephyr
wary sandal
jade acorn
opal zephyr
#

Thanks!

wary sandal
#

animated markers... never thought about that

jade acorn
#

basically you can make a video or a gif, cut it into frames with any free or paid software allowing this and paste into an array through which script goes every frame

opal zephyr
#

Ive always wanted an overlay system, would be cool if the ui2texture addition could manage that somehow

jade acorn
#

dunno, this would have to be a question to @robust hollow whether he had time and willingness to play with that stuff

winter rose
#

sorry, I realise it is unrelated but this popped in my mind

#

what does the fox doc say?

wary sandal
#

can a CT_LISTBOX have both a vertical and horizontal scrollbar?

#

I can't get a horizontal bar to appear

class screen: RscListBox
{
    x = safeZoneX + safeZoneW - 0.5 - 0.025;
    y = 0;
    w = "pixelW * 500";
    h = 0.8;
    style = "0x10 + 0x20 + 0x200";
    font = "RobotoCondensed";
    sizeEx = GUI_GRID_H * 0.80;
    colorSelectBackground[] = {1,1,1,0.85};
    colorSelectBackground2[] = {1,1,1,0.85};
    class ListScrollBar: ScrollBar
    {
        color[] = {1,1,1,1};
        autoScrollEnabled = 1;
    };
};
winter rose
wary sandal
#

doesn't make a difference, with or without the quotes

analog inlet
#

this is not working for me

sharp parcel
#

hey guys can I just check the syntax pls

if (({player isKindOf B_mas_aus_recon_M_F_mas} count _opticsAllowed)

it did read

if (({player isKindOf _x} count _opticsAllowed)

cheers

warm hedge
#
  1. mismatched brackets
  2. B_mas_aus_recon_M_F_mas is a variable not a string
sharp parcel
#

ok thanks

#

@warm hedge thanks for your enhanced arsenal btw 🙂

proven charm
#

dunno about that :/

still forum
#

every network object gets a unique ID before its creation

wary sandal
still forum
#

its just a incrementing counter

wary sandal
still forum
cosmic lichen
#

#define IS_BOX_EMPTY(arg1) ((weaponCargo arg1 + itemCargo arg1 + magazineCargo arg1 + everyContainer arg1) isEqualTo [])
Is there a better way of checking if a vehicle's cargo is empty?

manic flame
#

Hi, I am currently trying to make a "pseudoitem" in arma, here's what my description.ext looks like;

class CfgWeapons
{    class ItemCore;
    class InventoryItem_Base_F;
        class HL_Item: ItemCore {
        type = 4096;//4;
        detectRange = -1;
        simulation = "ItemMineDetector";
    };
    class HL_TestItem: HL_Item {
        scope = 2;
        picture = "\A3\ui_f\data\map\markers\flags\Spain_ca.paa";
        displayName = "Testing Item";
        descriptionShort = "A testing item.";
        descriptionUse = "";
        class ItemInfo: InventoryItem_Base_F {
            mass = 10;
        };
    };
};

For some reason, the item does not appear in the arsenal. Any idea why?

little raptor
#

you can't add weapons in description.ext

manic flame
#

Oh, so i must make it a mod?

manic flame
#

Is there any way I can add an item to the arsenal through mission?

little raptor
manic flame
#

The item doesnt have a model or functionality

#

even so?

warm hedge
#

Even so

manic flame
#

aw

#

alright

cosmic lichen
little raptor
#

instead of summing the arrays and counting the total

#

because that would be slower (if there are items in there) 😛

cosmic lichen
#

weaponCargo box isEqualTo [] && itemCargo box isEqualTo [] && magazineCargo box isEqualTo [] && everyContainer box isEqualTo []

#

This seems to be a wee bit faster.

#

Too bad that there is not simple isCargoEmpty box command

#

oh, there might actually be one

#
load box
#

Ah yes. That's kinda new

winter rose
#

beware of weightless items :p

cosmic lichen
#

Well. Fix that damn config then

winter rose
#
weaponCargo box isEqualTo [] && {
  itemCargo box isEqualTo [] && {
    magazineCargo box isEqualTo [] && {
      everyContainer box isEqualTo []
    }
  }
}
```if performance is of the essence
cosmic lichen
#

looks slower

#

but thanks for putting the correct var name in it so I can just copy paste it ❤️

#
Result:
0.0062 ms

Cycles:
10000/10000

Code:
weaponCargo box + itemCargo box + magazineCargo box + everyContainer box

Result:
0.0051 ms

Cycles:
10000/10000

Code:
weaponCargo box isEqualTo [] && itemCargo box isEqualTo [] && magazineCargo box isEqualTo [] && everyContainer box isEqualTo []


Result:
0.0062 ms

Cycles:
10000/10000

Code:
weaponCargo box + itemCargo box + magazineCargo box + everyContainer box


Result:
0.0051 ms

Cycles:
10000/10000

Code:
weaponCargo box isEqualTo [] && { 
  itemCargo box isEqualTo [] && { 
    magazineCargo box isEqualTo [] && { 
      everyContainer box isEqualTo [] 
    } 
  } 
}

Result:
0.0003 ms

Cycles:
10000/10000

Code:
load box
#

I go with the last one, taking the risk of having items in it without weight.

winter rose
#

fair enough

cosmic lichen
#

Given that I know what classes can be in the box I'd say that's a well calculated risk 🤣

twin oar
#

Is there a way to script tasks to show up after another task has been completed?

wary sandal
#

or maybe there are performance implications?

little raptor
cosmic lichen
#

Well...

#
Result:
0.005 ms

Cycles:
10000/10000

Code:
(count weaponCargo box + count itemCargo box + count magazineCargo box + count everyContainer box) == 0
#

Aint much better 😄

little raptor
#

are you using Dedmen's simpleVM?

cosmic lichen
#

Nope

#

I can't

winter rose
#
count weaponCargo box == 0 && {
  count itemCargo box == 0 && {
    count magazineCargo box == 0 && {
      count everyContainer box == 0
    }
  }
}
```:D ?
cosmic lichen
little raptor
#

well I mean do you use Dev or Profiling? 😅

cosmic lichen
#

Neither

calm charm
#

Hey. I've go a problem: I attach a player to an object and try to rotate him. But setDir and setVectorDirAndUp don't change anything.
Any idea? (tested on local MP server)

player attachTo [_table, [0,0,-0.54], format["seat_%1",(_seat+1)],false];

warm hedge
#

Make it true and see

still forum
still forum
# cosmic lichen I can't

[0] apply {(count weaponCargo box + count itemCargo box + count magazineCargo box + count everyContainer box)}
😄
But pretty sure that'll still be slower, even just the array creation

cosmic lichen
#

Uff the sight of that.

wary sandal
#

Is there an event fired when the mission is reloaded?

#

I have a display KeyDown EH that toggles a control. The issue is when I reload the mission, the event isn't disconnected resulting in the event triggering two times after a reload, 3 times after 2 reloads, etc...

stark fjord
#

DisableSerialization in that function?

wary sandal
stark fjord
#

Ok 😦

wary sandal
#
    private _mainDisplaycode = 46;
    waitUntil { !isNull (findDisplay _mainDisplaycode) };

    (findDisplay _mainDisplaycode) displayAddEventHandler ["KeyDown", {
        params ["_display", "_key", "_shift"];

        switch (_key) do {
            case 33: { // 33 keycode corresponds to the F key
                if (!_shift) exitWith {};
                systemChat "Screen opened";
                logs_screen_opened = !logs_screen_opened;

                if (!logs_screen_opened) then {
                    private _devLogs = _display displayCtrl 49124;
                    private _devLogsBorder = _display displayCtrl 49125;
                    if (!isNull (_devLogs)) then { ctrlDelete _devLogs; ctrlDelete _devLogsBorder };
                } else {
                    _devLogs = _display ctrlCreate ["WTK_DEVLogScreen", 49124];
                };
            };
        };

        false // indication that the input is not meant to be intercepted
    }];
#

code ran at mission startup (postinit)

little raptor
little raptor
#
if (findDisplay 46 getVariable ["myEH", -1] >= 0) exitWith {};
_EH = findDisplay 46 displayAddEventHandler ["...", ...];
findDisplay 46 setVariable ["myEH", _EH]
wary sandal
#

I will also note getVariable ["var", -1] >= 0, it looks better than when wrapped in isNil

sleek skiff
#

evening o/

molten yacht
#

Hmm, will this work at all like I hope it will?

while {conditionVariable} do {
delay = (timeleft * 50) max 300;
sleep delay;
playSound3D [proper sound arguments etc]
}```
#

specifically, it'll play the sound more and more often up until it gets lower than 300, and then 300 will be returned instead?

winter rose
#

seems so

molten yacht
#

Okay, cool.

#

For while scripts that are meant to be running all mission - they are the entire focus of the mission - where should they be called from, and how?

#

They should only be evaluated on the server, to avoid duplication.

#

But playSound3D should fire on all clients even if the thing is only evaluated on the server... right?

#

Maybe a trigger ingame that fires the script once the mission is triggered to start.

winter rose
molten yacht
#

right, I'm just trying to figure the best time to invoke a thing that's gonna be silently looping literally all mission

#

and needs to work for JIP

flat oasis
#

what does this mean?

warm hedge
#

while does take a code not a boolean

warm hedge
#

Is not a code

flat oasis
#

?

warm hedge
#

{} <- a code
() <- just a bracket

agile pumice
#

good evening

acoustic yew
#

Ello, sorry for interjecting.
How do I check if a specific player joins the server and is in a specific slot?
OR
If any player is in a specific slot?

Like if there is a slot in a server with name Slot-A, I want…
if (PlayerInSlowA) then (execute script). I want to check if a player is in a specific slot :)

granite sky
#

That sort of stuff is usually allUsers + getUserInfo but I'm not sure if it's possible to detect slot presence.

acoustic yew
#

Hmmm that’s sad

#

Can I check if a slot is controlled by Ai or player tho?

#

Or like if player is ai or a player?

#

If u know what I mean

granite sky
#

playableUnits maybe.

#
  • isPlayer check.
acoustic yew
#

I found this

granite sky
#

oh yeah, variable per slot might work.

acoustic yew
#

Yeah

wary sandal
#

has anyone ever written a function that converts a base10 number to base16 (hex)?

#

it'd save me some time

sleek skiff
#

Orgo_Andy pointed me here because i'm stuck!!! I have a question.. which i hope i simple and just not seeing it... XD.. . What is the most efficient way for fire a script on a client or capture the event of a client exiting a vehicle. ANY vehicle. could have been server spawned, other player spawned, ect. i have thought of several ways.. but all seem to have major downsides... event handler spam... or dealing with server event handler ping lag. Thanks in advance for your time everyone.. i see some legends in the arma world in here o_0 :bows:

ionic talon
#

Hello everyone,
Is there a method that allows, on buildings where chairs are already implemented in 3D, to make a script to sit on them?
I looked a bit to try to do it, but without success so far!

flat oasis
granite sky
#

Operator precedence. That's effectively if ((!player) inArea _x), which is obviously not the intention.

#

You need to write it as if (!(player inArea _x)). if !(player inArea _x) is also valid.

#

Oh wait, it's a while.

flat oasis
#

yeah

granite sky
#

while takes code, not bool. So while { !(player inArea _x) }

flat oasis
granite sky
#

The code is completely wrong still though.

flat oasis
#

yeah its still now working

#

but i struggled with while syntax

granite sky
#

Looks like you need a while loop on the outside of the forEach, and an if on the inside.

#

while just executes until the condition is true. So in your loop there it just sticks on the first while and doesn't check the other areas.

#
while {true} do {
  sleep 1;
  {
    if !(player inArea _x) then {
      _x setMarkerAlpha 0;
    };
  } forEach TRA_AreaMarkersMilit;
};
#

Depending on how you're launching this code, it may need a spawn as well.

#

Also I'm just guessing what you're trying to do.

#

It should have a check for the current alpha value and only set when changing, because setMarkerXXX commands are network-spam.

sleek skiff
#

even looked into client side animdone eventhandler... which would mean finding every vehicles get in anim... for every seat... which also fires 2-3 times during the action... doesn't seem efficient. .. someone slap me for missing the obvious here :D

jaunty drift
#

you can't just use the 'GetOut' eventhandler?

sleek skiff
#

think about 80 players... and all the vehicles that could be on the map... you would have to have an event handler on each vehicle for each player

#

doesnt seem right

#

the getout only fired on the client that runs the event handler.

#

if the server runs the event handler there is ping lag.... it needs to happen right on get out.. no lag... so client side

jaunty drift
#

you can try running a per frame event handler on each client that checks if (vehicle player != player) then {inVeh = true;}; and then if (inVeh) then {call script};

sleek skiff
#

i have not made any per frame event handlers.... and i stay as far away from loops as possible... is that an efficient way to so this? would this cause any noticeable client lag?

jaunty drift
#

not sure, somebody more knowledgeable will have to chime in

#

as long as you keep the code in the event handler minimal i think it should be fine though

#

probably better than having 100 getout eventhandlers on each client

sleek skiff
#

thanks for the reply at any rate,,.. gave me one more option to think about... i have come up with 3 and i dont like them

#
  1. event handler spam every veh. 2) server event handler every veh (ping lag) 3) client eventhandler animdone and getting every animm for every vehicle and seat(bleh!)
#
  1. from robthread: per frame eventhandler to check vehicle player != player.
#

thanks to all who reply!

sudden yacht
#

In the zues module set costs you able to set the cost of objects such as humanitarian, and military, ect ,ect. Is there a way i can check to see if the OBJECTS nearby are military, or fall under HUMANITARIAN in say a script? Maybe something close to this list = player nearEntities ["Man", 1000]; Count list;?

sudden yacht
#

I dont understand... MySimpleTask = player createSimpleTask ["simple task title"]; MySimpleTask setSimpleTaskDestination (position player); MySimpleTask setSimpleTaskDescription [ "simple task long description", "simple task title", "attack" // this should be the task label ]; MySimpleTask setTaskState "CREATED"; where do i find the waypoint label name? It only gives me the default label instead.

dusk gust
acoustic yew
#

Ello, How to continuous check of if condition instead of continuous loop :D

sudden yacht
#

@dusk gust Thanks for the reply i ended up finding another way.

acoustic yew
fleet sand
acoustic yew
#

So let me tell you my plan,
I want something to check if the condition is true or not once in a while, if it is true and script under it is running then dont run the script again (if using while loop), if it is not running then run the script once (if conditions are met) and keep checking if the condition is right

wary sandal
#

can I unlocalize a value from config?

calm charm
hallow mortar
little raptor
# acoustic yew So let me tell you my plan, I want something to check if the condition is true o...

What does the script do? In general what you said can be done like so:

while {true} do {
 if (condition) then {
     call someFunction;
 };
 sleep 1; // check the condition 1 second later
}

The other function can have loops, etc. (it should check the condition itself and exit if it's not met)

If the condition you're checking can be triggered by an event, you can use event handlers as Legion said. They don't use a loop and don't waste resources all the time

acoustic yew
#

the mod I was working on lol

#

so what's the difference with call and without?

#

even if I wont use Function

little raptor
#

What did you want to use instead of call?

little raptor
acoustic yew
#

So

#

The thing is, when I am using my script in multiplayer with playableUnit the script wouldnt work, script wont load. No bugs it's just script inits when server starts (as it should) and tries to find the player that is supposed to use the convoy. Now as it takes a while for player to join and occupy the "playable unit" the script checks if the specified unit is there or not and it cant find it (as Im not in there) and it will just close the thing and wont work, now what I want is that script should check if player exists (or player == playableslot(yk) and if it is then launch script once, if not then keep checking if the player is there and once player disconnects or leaves slot (aka check if player is alive if found and then scripts checks again and if no player is found then wait for the player to join and once player does join (after script finds out that player was not in but was before (im shit at explaning anything) the script will call function once).

#
while {!isNull curatorName} do {
        if (player == curatorName) then {
            // code
            if (true) then {
                // script
    };
  };
};
#

also script = mod

acoustic yew
wary sandal
jade abyss
#

That small one (vehicle player != player) needs: 0,0029ms

#

just4Info :)

hallow mortar
#

Yes, that is the unlocalized content of the config property

#

If you wanted "localized to English" you should have said that, not "unlocalized" :U

#

Someone might correct me, but there doesn't seem to be any way to force localisation in a given language. It will always localise to the player's selected language.

stark fjord
#

That is sorta the whole point. If you wanna force localization, dont localize at all, just write the text.

sullen sigil
#

does anyone have any bright ideas for adding acceleration into a setvelocitytransformation? in my head modifying how quickly the interval passes is the best approach however i'm not quite sure how to manage that

#

nvm, interval = interval + (diag_deltaTime/3)*(time-6); works (just obviously dont do it like that). wasnt working before so guess i made a typo

tender fossil
sullen sigil
#

it's just for a couple destruction effects in a mission for static objects so not overly fussed 😅

tender fossil
#

Yeah, didn't mean your implementation, just happened to remember my script and thought I'd add my warning in case of someone else has the same idea than me back in the day 😄

sullen sigil
#

Yeah I gave up using SVT a while ago for my capital ships mod and just resorted to setposasl + setvectordirandup on each frame 😅

#

easier to use SVT here now though

fair drum
#

are custom scriptedEventHandlers listened for every frame?

winter rose
#

they are triggered by a call on event, apparently

sullen sigil
#
systemChat "hello";
//whatever the command for triggering an event would be here to tell you that a "hello" systemchat has happened```
sullen sigil
#

anyone know why nearestObject [(getPosASL _bob), typeOf _bob] is returning objNull when there's the same type of object right beneath bob? thonk

#

no errors or anything, just returns objnull

little raptor
#

Because you're using asl pos

#

Wait returns objNull?! Wut?

sullen sigil
#

what should i be using? wiki just says position: Object or Array format Position2D or Position3D - position to start search at

sullen sigil
little raptor
little raptor
sullen sigil
#

ah swapping to object finds a match
except its transforming to the wrong place

#

wait i think it may be finding itself??

little raptor
#

It is

sullen sigil
#

ffs

little raptor
#

What are you trying to do? Why use nearestObj?

sullen sigil
#
private _cell = nearestObject [this, typeOf this];
this setVariable ["KJW_Destructive_EndObject", _cell];
``` in object init so i dont manually have to do this crap
#

EndObject is where this ends up at the end of its destruction transformation

little raptor
#

Use nearestObjs

sullen sigil
#

does that exclude itself?

little raptor
#

No but at least you can easily do it using -

sullen sigil
#

wait that works for arrays?

little raptor
#
nearestObjs [...] - [this]
sullen sigil
#

oh array of just this

#
private _cell = nearestObjects [this, [typeOf this],20, true];
_cell = _cell - [this];
this setVariable ["KJW_Destructive_EndObject", _cell];
``` so that should work right
little raptor
#

_cell becomes an array

#

And you should use param

sullen sigil
#

im so confused

little raptor
#
_obj = _cell - [this] param [0, objNull]
dusk gust
#

The fact you didnt group that together gives me eye aids

sullen sigil
#

roger i'll give that a punt ty

little raptor
#

Just making sure you don't get nil if you do _cell#0

sullen sigil
#

ah

#

i didnt even realise you can do that with arrays ive always been doing find and deleteAt

little raptor
#

Well they're different things

#

- returns a copy. deleteAt modifies the original

sullen sigil
#

ah fair

#

all working good now, thanks 🙂

grand idol
#

How can you access a trigger's name from within a spawn block in "On Activation"? In this simplified example I have a trigger with:
Condition:
(vehicle player) in thisList
On Activation:

h = [] spawn {

    _playersInArea = count (allplayers select {_x inArea thisTrigger}); 
    hint format ["Players: %1", _playersInArea];

};

thisTrigger comes back as an undefined variable. This example doesn't need to be in a spawn block, but the code I'm using does.

fleet sand
#

You can pass variables to spawn here is a simple Example:

["test"] spawn {
    params ["_var"];
    hint format ["%1",_var];
};
grand idol
high tendon
#

i am trying to make a script for a weapons work bench and i need guided to some sort of command that will move the players weapon from their body to the table top of the workbench

#

not sure if setVehiclePosition is the right command for a weapon

torn hemlock
#

What about isEqualTo ?

hallow mortar
#

A weapon currently equipped by a unit is a proxy controlled by their animations, not a real object you can control

#

Options:

  • create a fake weapon based on their current weapon, using createSimpleObject. Doing attachments may be a challenge; the placed weapon will be non-interactive.
  • copy the player's current weapon and attachments to a groundWeaponHolder, using createVehicle and addWeaponWithAttachmentsCargoGlobal. You'll definitely be able to do attachments, but the placed weapon will be interactive.
    In either case, the position of the placed weapon/the groundWeaponHolder containing it should be controlled with setPosASL or setPosATL.
high tendon
#

awesome ill play with it and see what happens. Thxs

dreamy kestrel
#

Q: about container objects, uniforms, vest, backpacks and such... trying to get a handle on which config they might reside in... one reference suggests unforms vest may be "CfgWeapons", whereas backpacks are "CfgVehicles"? or perhaps I have my wires crossed there?

Also, if they are "CfgVehicles", not sure I can verify the "type" it is, as given from its config, if that is even necessary, i.e. whether specifically uniform or vest.

Some sample code snippets doing my background on...

_y = player;
_u = uniformcontainer _y;
_v = vestcontainer _y;
_b = backpackcontainer _y;
[_u, _v, _b];
_b_cfg = configfile >> 'CfgVehicles' >> (typeof _b);
_v_cfg = configfile >> 'CfgWeapons' >> (typeof _v); // weapons? or vehicles?
_u_cfg = configfile >> 'CfgWeapons' >> (typeof _u); // weapons? or vehicles?
// [_b_cfg, true] call bis_fnc_returnparents;
// [_u_cfg, true] call bis_fnc_returnparents;
// [_v_cfg, true] call bis_fnc_returnparents;
getnumber (_u_cfg >> 'type');
// getnumber (_u_cfg >> 'iteminfo' >> 'type');
// getnumber (_v_cfg >> 'iteminfo' >> 'type');

Thanks...

dreamy kestrel
# dreamy kestrel Q: about _container objects_, _uniforms_, _vest_, _backpacks_ and such... trying...

The feedback I am getting is that they are more like "CfgVehicles", or maybe that is a confusion over the article being worn by the player object, player being the vehicle ... i.e.

_y = player;
_u = uniformcontainer _y;
_v = vestcontainer _y;
_b = backpackcontainer _y;
[_u, _v, _b];
_b_cfg = configfile >> 'CfgVehicles' >> (typeof _b);
_v_cfg = configfile >> 'CfgVehicles' >> (typeof _v);
_u_cfg = configfile >> 'CfgVehicles' >> (typeof _u);
// [_b_cfg, true] call bis_fnc_returnparents;
[_u_cfg, true] call bis_fnc_returnparents; // yields classes, whereas 'CfgWeapons': []
// [_v_cfg, true] call bis_fnc_returnparents_returnparents;
// getnumber (_u_cfg >> 'type');
// getnumber (_u_cfg >> 'iteminfo' >> 'type');
// getnumber (_v_cfg >> 'iteminfo' >> 'type');
cosmic lichen
#

For an Arsenal you usually need these

(CONDITION configClasses (configfile >> "CfgWeapons")) + (CONDITION configClasses (configFile >> "CfgMagazines")) +
                          (CONDITION configClasses (configFile >> "CfgGlasses")) + (CONDITION configClasses (configFile >> "CfgVehicles"));
dreamy kestrel
#

right I understand the configs, broadly speaking... what I am trying to understand better is for uniforms vests in paritcular... at least acording to ACE virtual arsenal, their buckets suggest uniforms, in particular, may be weapons, but evidently they are not, or I cannot verify it as such, they are considered vehicles, according to this?

configOf _u; // bin\config.bin/CfgVehicles/Supply40
#

Similarly vests

configOf _v; // bin\config.bin/CfgVehicles/Supply140
#

maybe it does not matter as long as I can land on its config, inspect some class parents, etc. i.e. barking up the wrong tree there...

hallow mortar
#

The uniform and vest class that you would assign to a player, or get as a return from uniform is a weapon (and a proxy, no unique instance of it exists as an object).
The container object is a dynamically-created vehicle, like a ground weapon holder, which is secretly connected to the unit.

south swan
#

uniforms/weapons in CfgVehicles are generally a weaponholder with said piece of gear inside blobdoggoshruggoogly

dreamy kestrel
#

ah okay starting to understand the difference there

#

class versus object instance

#

can you get to the original class name from the weapon holder? i.e. presumably "Supply40" "Supply140" those are weapon holder proxies. but I may have the class name in some cases, or need to bridge the gap.

#

so that's even funnier:

gettext (configof _v >> 'displayname'); // "Ground"
#

even though equipped on player

south swan
#

Supply40/Supply140 are general inventories with capacity of 40/140 units. And are likely used by multiple types of gear blobdoggoshruggoogly

hallow mortar
#

Config lookups get the base config, not the current result of any dynamic overrides it may have, so even if the displayed name was changed depending on what object it was connected to, that wouldn't show it

dreamy kestrel
#

thanks for the insight...

hollow plaza
#

I'm wondering if there's any reason as to why addMagazineGlobal and removeMagazineGlobal function differently when executed through server. I noticed that removing magazines through server does cause them to disappear from the inventory, but executing magazines player through server would still show the removed magazines as if they were still in the unit's inventory.

#

I'm confident I can fix the issue by just remoteExecuting the code instead, but it'd be nice if I knew as to why this happened and whether there's any point in using removeMagazineGlobal instead of removeMagazine if I have to remoteExec it globally anyway

graceful kelp
#

I need some help, im trying to get an elvataion from a vehicle to a target, relative to the vehicle

zealous heath
#

AI Skill level keeps resetting to between 3 and 19%, pls help

jade acorn
#

Disable AI mods

zealous heath
#

not running any

zealous heath
zealous heath
sullen sigil
#

do you have it enabled for ai?

#

is there any way to change a player unit's name in MP?

winter rose
#

@sullen sigil not really/fully

sullen sigil
#

ah, rip -- guess i have to ask very nicely for people to change them properly then

granite sky
snow pumice
#

To which extent can I modify the damage handling without scripting something in the damage handle EVH?
To elaborate further, I only know the entry in the Server Profile reducedDamage , is there something else?

I found this, but how would I change the Damage Modeling?
https://community.bistudio.com/wiki/Arma_3:_Revive#Damage_Modeling

granite sky
#

Arma 3 revive itself overrides the handleDamage EH, I'd guess.

#

Maybe it's engine-level but I doubt it.

snow pumice
#

So without modifications or scripts changing what happens when I get damage, I can't really change the damage behavior?
(That I only can change the damage behavior through scripts / EVHs is my understanding, I just want to know if there is some other way)

hallow mortar
#

You can choose which of the BI damage model presets to apply. That's about it without the use of a mod to change config values or a handleDamage EH.

#

If you want to use a handleDamage EH on a player and don't want to completely turn off the BI Revive system, you'll need to first remove BI Revive's own handleDamage EH and then pass your handled damage back into the BI Revive system yourself.

Example:

waitUntil { !isNull player };
    [] spawn {
        // Look for and remove BI revive event handler, timeout after 15 seconds
        for "_timeout" from 1 to 15 do {
            if (!isNil {player getVariable "bis_revive_ehHandleDamage"}) exitWith {
                player removeEventHandler ["HandleDamage",player getVariable "bis_revive_ehHandleDamage"];
                player setVariable ["bis_revive_ehHandleDamage",nil];
            };
            sleep 1;
        };
    };```
Then in your EH, the last return would be:
```sqf
[_unit, _selection, _newDamage, _source, _projectile, _hitIndex, _instigator, _hitPoint] call BIS_fnc_reviveEhHandleDamage```
Otherwise, your damage results will be applied directly without going through Revive processing, and various parts of the Revive system will not work.
jade abyss
#

should be faster, hm, lets take a look

#

same

quartz blade
#

What's up guys. I have a question regarding addAction. I copied an action which is supposed to call a script when triggered. I called this action "Show Generators". How can I create an action to cancel the "Show Generators" action? Thanks in advance for the answer!

meager granite
dreamy kestrel
#

how do I tell if an object legit supports an inventory? programmatically I mean.

dreamy kestrel
jade acorn
dusk badger
#

Can someone help me there is an animation in 3den enhanced called HANDS_HELD_HIGH I want to know the name of that animation but cannot find it in the animation viewer

cosmic lichen
#

That anim. name is just an alias for an animation set.

vivid bridge
#

How to bind a unit to an object? i.e. I set, for example, the radius of the bunker placement, but for the unit to appear together with the bunker in a certain radius.

graceful kelp
#

i need some help doing some vector maths
trying to get the relative elevation from a vehicle to a target

    _heliPos = getposasl _heli;
    _targetASL = getposasl _target;
    _vWorld = _heliPos vectorFromTo _targetASL;
    _vector = _heli vectorModelToWorld _vWorld;
    _vector call fza_fnc_vectorElevation params ["_magnitude", "_elevation"];
    if (_elevation > 25 && _fcrMode == 1) exitwith {};

fza_fnc_vectorElevation

params ["_x", "_y", "_z"];

private _magnitude = vectorMagnitude _this;
private _elevation = 0;
if (_magnitude > 0) then {
    _elevation = asin (_z / _magnitude);
};

[_magnitude, _elevation];
#

hmm

#

il have a look thanks

graceful kelp
#

yh im not good with vectors, i cant convert it to my use case

#

im trying but i need a degrees output

tropic mirage
#

Question. I am using extDB3 to retrive data from a database. The returned value is of a string datatype and looks like this

"[1,[[sdasd]]]"
When using parseSimpleArray it returns a format error... any ideas why?

hallow mortar
#

parseSimpleArray can only handle arrays containing numbers, strings, bools, and arrays containing the previous 3 things. It cannot handle variable names, in your case sdasd.

#

You can get around this by storing the variable name as a string, and then using getVariable to translate the string into the actual variable once retrieved.

manic fox
#

Does it have any disadvantages to put an if-Clause in an If-Clause? like: (_isGarage or if !(isNil "_typeOf") then {_objType iskindOF _typeOf} else {false})

winter rose
#
_isGarage || { !isNil "_typeOf" && { _objType isKindOf _typeOf } }
manic fox
#

Ok, i thank you! ❤️ the second part after "||" doesn't have to get "called" or something? I think i have to a bit more research regarding Data Types ^^

winter rose
manic fox
#

Ahh ok. This will simplify things alot! meowawww Thx again 😄

fleet sand
#

Woudn't this throw error as well ?

_isGarage || { !isNil "_typeOf" && { _objType isKindOf _typeOf } }

Should it be like ?:

_isGarage || { !isNil "_typeOf" && { _objType isKindOf _typeOf; true; } }
fleet sand
#

{ _objType isKindOf _typeOf } dosent return bool ?

winter rose
fleet sand
#

oh shit nvm

zealous heath
zealous heath
jade acorn
sullen sigil
#

it has cba options for recoil for ai which is enabled by default

zealous heath
jade acorn
#

and I am not surprised something does not work as it should in it.

zealous heath
#

*know

drifting portal
#

is there a reliable way to get fighter jets/CAS classnames from config?

twin oar
#

Having issues with the support requester module not showing up on a live server any idea?

dreamy kestrel
# little raptor maxLoad

so not so much, turns out more false positives... but I did a bit more verification...

_y = cursorobject; // HQ building
maxload _y; // 0, false positive
getcontainermaxload typeof _y; // -1, cooking with oil
cosmic lichen
analog inlet
#

is there a way to to grab the display name of everything in this array? [[],[],[],["TLRP_PugsNotDrugs",[["CUP_20Rnd_556x45_Stanag",1,20]]],[],["B_Carryall_oli",[["ToolKit",1],["hlc_30rnd_556x45_EPR",1,30],[["CUP_hgun_Glock17","","","",[],[],""],1],[["CUP_arifle_M16A1","","","",[],[],""],1]]],"TLRP_StaffSergeant_Beret","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_fadak_8","ItemCompass","Itemwatch","NVGoggles"]]

dreamy kestrel
#

side note, I thought for sure that the NATO Arsenal box (bin\config.bin/CfgVehicles/B_supplyCrate_F) supported inventory load. is that not the case any longer, or is it something that folks added later on? is it possible to add inventory support into objects in game?

analog inlet
granite sky
#

@analog inlet It's not trivial code because some of them are CfgWeapons, some are CfgMagazines and one is CfgVehicles.

cosmic lichen
#

flatten -> BIS_fnc_itemType -> guess config -> BIS_fnc_displayName

#

Would be my first guess

#

Remove anything that's not string*

granite sky
#

If you can't be bothered dealing with the format properly then I guess there's flatten + isClass.

analog inlet
#

flatten works a treat but i ned to now remove the numbers from the array

cosmic lichen
#

flatten _array select {_x isEqualType ""}

analog inlet
granite sky
#

so make the obvious change?

cosmic lichen
#

I fixed that 😄

analog inlet
cosmic lichen
#

(flatten _array select {_x isEqualType ""}) - [""]

analog inlet
#

youre a legend

#

thanks a bunch

drifting portal
granite sky
#

Did you get as far as getting aircraft?

#

"configName _x isKindOf 'Plane'" configClasses (configFile >> "CfgVehicles") apply { configName _x}

#

probably scope = 2 for stuff that's supposed to be usable.

#

proper way would use simulation instead.

dreamy kestrel
# dreamy kestrel so not so much, turns out more false positives... but I did a bit more verificat...

correction, rechecking it, yes, I see maxLoad now... container max load reporting -1 ubiquitously, which leads me to believe it is something else entirely. sorry for confusion...
although odd, I am not getting any Inventory in my action menu. when I enter a vehicle and disembark, then I start getting Inventory again...
I do have ACE loaded, so I wondering if that is an oddball ACE interaction going on?

granite sky
#

Inventory is often a pain on vehicles. Only shows up in specific areas.

dreamy kestrel
#

once I jump out, I get the action in proximity, then can see the object as its 'crate'. but not before I jump in and out.
also I thought there was an ACE interaction thingy for inventory, but I could be mistaken there.

#

although I do vaguely recall the Polaris models being a bit stubborn where inventory is concerned. but I can't be positive about that.
usually I am in a server that supports RHS, HUMVEE models, and tend to prefer those over the vanilla choices, so...

#

so just checking, is it me, maybe ACE vehicle locks behaving strangely, or it is what it is... leaning toward the latter...

#

but still odd even the NATO arsenal box not giving me any inventory actions...

granite sky
#

You have to get quite close to that one.

dreamy kestrel
hallow mortar
#

What is the exact name of the box you're using?

indigo wolf
#

So I set the variable name in the Editor to a desk and then exported it into SQF to import in game. However, while exporting it does not export the variable name for this desk (but it does export the variable name for markers and units)

_object2 = createVehicle ["Land_PortableDesk_01_black_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_object2 setVectorDirAndUp [[-0.000584831,1,-0.000731616],[0.000140539,0.000731699,1]];
_object2 setPosASL [14629.2,16743.4,17.9103];```
#

I want this Land_PortableDesk_01_black_F to have the variable name set as Audit_Desk_0

dreamy kestrel
#

hmm I am thinking maybe it is an ACE thing...

dreamy kestrel
#

super weird... if I stand on the object I can see its inventory...

granite sky
#

I did say you have to get close...

dreamy kestrel
#

wonder is it a config range issue maybe?

indigo wolf
granite sky
#

Like uncomfortably close.

dreamy kestrel
#

cuz in a 'virgin' editor scenario I get the inventory action just fine

granite sky
#

I regularly use B_SupplyCrate_F in both ACE and non-ACE setups and I haven't noticed any difference.

dreamy kestrel
#

or let me rephrase, is there a command or function that can effect that range?

hallow mortar
dreamy kestrel
#

yeah I am comparing the mod I got in the works, and a separate test scenario... the test works fine for whatever reason. hence I am asking about commands or functions that could effect that. or maybe it is an obscure ACE thing, I don't know.

cosmic lichen
#

You can search it by class

hallow mortar
cosmic lichen
#

Type "class <classname>"

hallow mortar
#

Outstanding, thanks

cosmic lichen
#

if you hover over the search icon it shows you that

#

The entity browser on the left has similar options

hallow mortar
#

I have never hovered over or even clicked on the search icon in my life

cosmic lichen
#

😄

warm coral
#
civilian setFriend [west, 1];

if this is executed will it work globally or does it have to be done via remoteexec?

#

if its remoteexec how

#

cant seem to figure it out

cosmic lichen
#

Should be executed on the server

#

See icon top right

warm coral
#

ohh thats handy to know in the future thank you

cosmic lichen
#

You're welcome

dreamy kestrel
#

Q: when during vehicle lifetime are inventories populated with defaults?

hallow mortar
granite sky
dreamy kestrel
dreamy kestrel
#

probably... looking into one plausible scenario right now, thank you...

drifting portal
granite sky
#

Yes, it's a starting point.

kindred tide
#

i have a modding question. so, the game logic class has its simulation set to "invisible", where can i find the definition of it?

#

what i need is a class that is just like game logic but able to move (directly through walls and terrain)

snow pumice
#

Can i somehow set the Activation in a way that it only triggers if the player runs into it?
Is the Only way to let it trigger at ANYPLAYER and filter for the player in the TriggerStatement?

little raptor
kindred tide
#

yeah im trying to figure out how to make such an object that would be:
1 invisible
2 invincible
3 teleport or move very quickly to where you order it to

little raptor
kindred tide
#

gameLogic is invisible and invincible and allows itself to be given orders just like any other unit, but it doesnt move.

little raptor
#

teleport or move very quickly to where you order it to
if you want it to teleport you can use setPosASL

#

there's no need for "ordering" it to go there

kindred tide
#

it's an utility intermediary object. what i tried so far was inherit from Civilian class, give it a custom movesCfg with extremely high animation speed, and hide its model

#

setPosASL requires knowing the position, is there a way to extract it from unit's given orders?

little raptor
#

expectedDestination

kindred tide
#

god, i've spent 10 hours today trying to hack together something with that invisible civilian npc, thanks

little raptor
#

btw that one takes AGL pos. you have to convert it to ASL using AGLtoASL before using setPosASL/setPosWorld

little raptor
#

it gives you the calculated path for an AI unit

kindred tide
#

still though, if i wanted to make like, spooky ghosts that move in a straight line to where you order them (noclip), would i have to code a custom simulation type?

#

like one that gameLogic uses ("invisible") but with movement

little raptor
#

no. you can use any object you want and move it every frame using setVelocityTransformation

split nebula
#

almost by definition such a check would be in scheduled meaning depending on circumstances it could not trigger instantly as the person gets out of the vehicle which seems to be a requirement for @sleek skiff

little raptor
#

well if the object has collision it might collide when you use that command tho

#

you can attach them to a logic object

#

and move the logic instead

kindred tide
#

my sonic-like civilian died from hitting terrain when moving so fast btw

little raptor
#

do allowDamage false

kindred tide
#

could i disable all collisions though?

#

with terrain and buildings

snow pumice
little raptor
little raptor
high tendon
#
[player, player, independent, ["LOP_NAPA_Infantry_Rifleman", "LOP_NAPA_Infantry_AT", "LOP_NAPA_Infantry_Rifleman_3", "LOP_NAPA_Infantry_Prizrak", "LOP_NAPA_Infantry_Rifleman_2", "LOP_NAPA_Infantry_TL", "LOP_NAPA_Infantry_GL", "LOP_NAPA_Infantry_Marksman", "LOP_NAPA_Infantry_GL_2", "LOP_NAPA_Infantry_MG_Asst", "LOP_NAPA_Infantry_Corpsman", "LOP_NAPA_Infantry_Engineer", "LOP_NAPA_Infantry_MG"]] spawn BIS_fnc_spawnEnemy;

AI wont stop spawning in even when the trigger isnt active

fleet sand
little raptor
#

not 100% sure because terrain objects get streamed. assuming that's irrelevant you could yes. but for 1 object at a time

fleet sand
kindred tide
#

so, the thing i needed this for was to allow player to command entire teams of units, without micromanaging. e.g you command just 3 of these invisible units. and each of them in turn forwards the commands to larger teams of 20 units

split nebula
#

although saying that you could do that check on a per frame handler and skip an arbitrary amount of frames with some sort of counter. although i have no idea if thats a good idea :)

twin oar
#

Is there a way to make civilians have IEDS strapped to them with deadman’s switches?

#

Like in a case of truly check your fire, and if they kill a civilian they get like points deducted

drifting portal
# granite sky Yes, it's a starting point.

Sorry for the ping

"(configName _x isKindOf 'Plane') && (getText (_x >> 'simulation' ) == 'airplanex') && (getNumber (_x >> 'transportSoldier') == 0)" configClasses (configFile >> "CfgVehicles") apply { configName _x}

I thought of trying to find vehicles which can host 1 pilot only, but 'transportSoldier' is only for cargo infantry right? how can I check how many crew can sit in a vehicle?

granite sky
#

Tricky from a classname. See BIS_fnc_crewCount

drifting portal
#

Nice

#

was there a isUAV attribute?

#

yep there is

fleet sand
#

What would be the best way to register players Left click + hold action. While player is holding mouse do something every x amount of seconds ?

jaunty drift
#

maybe he wants to attach a cow to the player as soon as he exits the vehicle and it would look weird if the cow was suddenly attached a noticible time after the player exits the vehicle

split nebula
#

it doesn't necessarly have to happen the exact next frame, but if you are in sheduled it could take several seconds if there is a lot of scripts running + load etc

jaunty drift
#

but in many cases he probably doesn't need it to be that precise

minor grotto
#

why am i getting generic error in expression with this code? _side = civilian; if (side player != _side) exitWith {hint "You cannot use this loadout at this time!";};

little raptor
analog inlet
#

i diag_logged both vars, side player and _side, they both return the same value but if you are on as west or civilian then it still doesnt let you use the script

hallow mortar
#

I tested that code on its own and there is no error. So the error is being caused by something else.
You say the error happens if the player is west or civilian. This code exits if the player is not west or civilian, so that indicates that the error is in whatever code comes after this, because that code is only run when the player is west or civ.

winter rose
#

@minor grotto @analog inlet same person?

fair drum
#

can I terminate a FSM outside of the FSM itself?

opal zephyr
#

I haven't had any luck finding an answer on google, but I thought id check here if anyone knew. Is there a way to get texture position? Specifically a vector position in the 3d world

dreamy kestrel
#

oh cargo space, nvm...

molten yacht
#

Any good way to randomize if a given person has a map marker or not

#

i.e. some people should and some people shouldn't

hallow mortar
tough kernel
#

so im relatively new to scripting in arma. the issue is in my description.ext, i have my respawn loadouts set up but when i add a money script it then says that the loadouts cannot be found

hard haven
#

we'd need to sure your code and the actual error message though

#

you can share it here for example

analog inlet
analog inlet
stark fjord
#

How are you passing side?

#

Oh, like that... that should work...

winter rose
analog inlet
#

Fairs. Tbh I wasn’t paying attention to which account I was on, usually use it to live test permissions. I don’t suppose you know my issue? I can upload the full file soon

tough abyss
#

i have a question, whenever i do a scenario about exploding a vehicle which there is a soldier or character inside,
when the vehicle exploded the soldier didn't died inside the car, but they get out of the car,
so how can i make a scenario about that i mean when the car exploded the soldier inside is dead too

little raptor
#

That's caused by a mod

#

Probably ACE

tough abyss
#

how to solve this

little raptor
#

Don't use mods blobdoggoshruggoogly
Or remove the soldier's event handlers

#
soldier removeAllEventHandlers "killed";
soldier removeAllEventHandlers "handleDamage";
tough abyss
#

wait

tough abyss
little raptor
#

You can try it there. Just replace soldier with this

#

I doubt it would work there tho

tough abyss
#

thanks

#

how to make 2 car explode on trigger , i try this script at trigger - call{car1 setDammage 1;} call{car2 setDammage 1;} - but only car1 explode, why

little raptor
#

Remove the call {}s

#

The actual problem is missing ; after the first }

#

But those calls and {} are useless

tough abyss
#

it works, thanks

fleet sand
#

Hi sorry for asking this question again. I asked this yesterday late then went to bed.
What would be the best way for me to register left click + hold. And then while player is holding left mouse button call a fnc every x amount of seconds ?

warm hedge
fleet sand
# warm hedge Pro tip: you can use Ctrl+F to retrive your old post

Thank you didn't know.
So this is the code i have so far. Counter increses but increses everyFrame and not every second. And its just a ugly way of doing if there is any other way to do this ?

counter = 0;
EH_EF = addMissionEventHandler ["EachFrame",{
    if(inputMouse "65536") then {
        0 spawn {
            while {inputMouse "65536"} do {
            hint format ["%1",counter];
            counter = counter + 1;
            sleep 1;
            };
        };
    };
}];
warm hedge
#

Ugly? Not even ugly, this is a game breaker

winter rose
wary sandal
#

so I wrote a function that converts decimal numbers to base16 (hexadecimal) numbers based on a javascript function. It produces correct results, until we reach numbers with 6 zeros or more. For example, when I pass 999999001, it returns 55D4A80 and not 55D4A81 on Arma. The javascript function on the other hand produces the correct result.

#
    ["fnc_base10num_to_base16hex", {
        // Self-explanatory, turns decimal values into hexadecimal values
        params ["_num"];

        _chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
        _hexa = "";
        while { _num != 0 } do {
            private _temp = 0;
            _temp = _num % 16;
            _hexa = _hexa + (_chars select _temp);
            _num = floor (_num / 16);
        };

        if (_hexa == "") then {
            "0"
        } else {
            reverse _hexa
        };
    }],
winter rose
#

also private your vars

wary sandal
winter rose
#

nope

wary sandal
#

ah...

#

I guess there's no workaround, it's an engine limitation

winter rose
#

range 1..3999 😄

wary sandal
#

I stumbled across an issue with this with a for loop

#

where a var annoted with "private" couldn't be reached from the loop

wary sandal
#

I wonder if anyone ever used this function in arma history

winter rose
wary sandal
wary sandal
#

i'm accessing _chars and _hexa from the while scope

winter rose
#

(and the lovely, colourful graph below)

little raptor
wary sandal
winter rose
#

and the first one is missing a closing "

wary sandal
wary sandal
#

I don't understand the difference

winter rose
wary sandal
#

oh, that's when we want to edit the variable inside without actually editing in the "outer" scopes

winter rose
#

yesss

wary sandal
#

basically creating a new variable with the same name

winter rose
#

yep
making sure it doesn't use the above one

wary sandal
#

I don't do that in my code so I can add private to every local variables i have without fearing it would break

winter rose
#

if your code was thought well, yes

wary sandal
indigo wolf
#

Can someone point me the way to remoteExec inline functions?

winter rose
#

ideally, don't remote exec code like that

indigo wolf
#

Now obviously running the code in the object init field of the table has worked fine but does not work on JIP players.

winter rose
#
[[arguments], { code }] remoteExec ["call"];
```but that's ***awful*** and dirty - just sending a huge payload in network traffic
indigo wolf
winter rose
#

not to do it 😄

spark turret
#

Hello, i am currently looking into the cba scripting macros, because its a quality standard i finally want to use/reach.
in the ACE3 repo, the cba scripting macros.hpp file is "hardcoded"/copied in the repo and then included in the ace's own hpp files:
#include "\x\cba\addons\main\script_macros_common.hpp" in ace/main/script_macros.hpp

is that the preferred way to use the cba macros?
I kind a thought that the macros are somehow globally available, as cba is a dependency mod to ace 3?
so why hardcode them and include them manually?

#

(couldnt find any CBA contacts so im asking here)

fair drum
#

You have to always #include to get access to the macros. What ACE does is take the macros, then modify them to their needs after the #include. But you'll see they always #include their main macro file in every single one of their files.

still forum
#

All macros/preprocessor is per-file
So they can't be globally available (besides the hardcoded engine macros), you have to include it into every file

spark turret
#

But i can use the cba mod provided files instead of having to hardcode them in my own peroject right?

stark fjord
#

Yeah, you can include them directly in your sqf

still forum
little raptor
# wary sandal didn't quite udnerstand the alternative approach <:meowsweats:707626030613135390...

Well I didn't really explain it. For that you basically need to implement math meowsweats
For what you need you have to implement division, like you (probably) did in elementary school 😅
i.e you start from the most significant digit, and start dividing by 16, in baby steps... meowsweats
Let's use an easy string as example: "2340"
e.g. 2340/16 would be

  1. 23/16 = (1)x16 + 7
  2. 740/16
  3. 74/16 = (4)x16 + 10
  4. 100/16 = (6) x 16 + 4 => 4 is the remainder and thus the last hex number "....4"
  5. Now you'll be dividing 146 by 16, which gives you the next hex number, and so on
#

An easier way would be just passing the string to an extension, parse it and let it do native math for you meowsweats

winter rose
#

couldn't the extension could use double 😄

little raptor
#

Well that's what I mean yeah (in this case uint64 is needed tho)

wary sandal
#

or even just once each frame, I think it would still be slow

wary sandal
#

something is brewing

winter rose
#

dun-dun-dunnn

little raptor
#

The other one you posted is slowish too

wary sandal
#

dunno what else I can do to make it run faster

queen cargo
#

simple solution:

    while{vehicle player == player} do
    {
        sleep 1;
    };
    vehicle player addEventHandler ["GetOut", {
        <yourCodeGoesHere>;
        <DontForgetToRemoveTheEHAgain>;
        [] spawn foo;
    }];
}```
stark fjord
#

But why exactly do you need such high precision?

winter rose
#

I am not even feeling suspenseful, just ready to be disappointed by the answer tbh 😂

#

why do you need that @wary sandal , whyyy 😄

wary sandal
#

to publicly show my debt (the engine can't even process the number)

winter rose
#

use power of 10 😄

wary sandal
#

ok, removed the unnecessary check

#
        params ["_num"];

        private _hexadecimalChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
        private _hexa = "0";

        while { _num != 0 } do {
            private _temp = 0;
            _temp = _num % 16;
            _hexa = _hexa + (_hexadecimalChars select _temp);
            _num = floor (_num / 16);
        };

        reverse _hexa
#

it should now run 0.1 nanosecond faster

winter rose
#

minor performance thing

params ["_num"];

private _hexadecimalChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
private _hexa = "0";
private _temp = 0;

while { _num != 0 } do {
    _temp = _num % 16;
    _hexa = _hexa + (_hexadecimalChars select _temp);
    _num = floor (_num / 16);
};

reverse _hexa;
```the `_hexadecimalChars` might be faster were it an argument instead of a constant creation, perhaps
little raptor
#

300x0.011 is slow

#

Over 3ms

#

It'll most likely cause an FPS drop

winter rose
wary sandal
#

i'm generating a file in a format used by an external program

fair drum
#

@little raptor can ADT show included defines while in the function viewer at all?

wary sandal
#

this is why I need hexadecimal numbers, instead of decimal numbers

winter rose
wary sandal
#

you were really curious lol blobcloseenjoy

winter rose
#

if we spend brain cells and in the end you are all "yeah I convert all positions to hexadecimals cuz I think it's cuter lol" there will be blood

wary sandal
little raptor
#

Tho you need the abs path meowsweats

#

I might make a vscode / vs feature where you ctrl+lclick to see the file

#

Tho the function viewer might not support it (it's very basic, unlike the editor)

wary sandal
fair drum
#

but mainly so that I don't have to search through all the BI files to find the included file

stark fjord
wary sandal
#

didn't know numbers were crunchy

stark fjord
#

They are, and every time it crunches fps goes down

#

Also why would you compute players money per frame? You making arma3 stock market simulation?
Calculate money once per change and then just display variable on each frame

wary sandal
#

tried to think of a very bad practice

stark fjord
#

Ah

winter rose
#

he, too, likes to live dangerously

winter rose
wary sandal
#

if my Intel I3 can run this with ease, every computers can

winter rose
#

watch me with my i7 930 from 2010

stark fjord
#

It adds up with other stuff too

wary sandal
#

somehow you have... more cores

#

people still buy i3s 💀

wary sandal
sullen sigil
#

lou is ancient

flat oasis
#
 params ["_trigger"]



{
    private _pos = getPos _trigger;
    private _marker = _x inAreaArray _pos;
    if (!(isNull _marker)) then {
        if (_marker in TRA_AreaMarkerName) then {
            deleteMarker _x;
            TRA_AreaMarkerName deleteAt _forEachIndex;
        };
    };
} forEach TRA_AreaMarkerName;
#

why, edit: how?

sullen sigil
#

first line

#

error message is telling you whats wrong quite clearly

flat oasis
#

god

#

yea i see

winter rose
#

@still forum possibility to replace Error Missing ; by Error: missing semicolon ';'?

#

devs have a tendency to read "Error Missing " 😄

still forum
#

Translations big chore

winter rose
still forum
#

🤔 They should be

winter rose
#

ah
oh
perhaps 🐮

still forum
winter rose
#

I keep my game in English since A2, I didn't know 😄

#

maybe just quoting the semicolon would be enough then

sullen sigil
#

anyone know why the particles here are turning to a slight blue before disappearing?

//groundwave
private _groundwave = "#particlesource" createVehicleLocal _pos;
_groundwave setPosASL _pos;
_groundwave setParticleCircle [1, [-50, -50, 0]];
_groundwave setParticleRandom [0, [0, 0, 0], [5, 5, 0], 0, 0, [0, 0, 0, 0], 0, 0];
_groundwave setParticleParams [["\A3\data_f\cl_basic",1,0,1],"","Billboard",1,10,[0,0,0],[0,0,0],13,1.5,1,0,[300,300,300,250,200,150,100,50,25],[[0.7,0.7,0.7,0.5],[1,1,1,0]],[1,0.5],0.1,1,"","",_logic];
_groundwave setDropInterval 0.01;```
#

they shouldn't be meowsweats

winter rose
#

environmental lighting?

sullen sigil
#

uhhh, good point. will look on altis + modded map

#

currently only been testing on vr

winter rose
#

but tbh, IDK

sullen sigil
#

it's not a huge issue as its mostly in the ground by the time it turns blue and anyone in the area will be dead
but i still think it looks shit

winter rose
#

btw, you provide _logic here

sullen sigil
#

ya thats just a logic thing created for the particles to b at

#

was happening when i had it on a different obj too

#

ah, you were correct; hadn't thought of that, thanks 😄

sullen sigil
#

ya

winter rose
#

yey ^^

sullen sigil
#

works fine on altis 😅

#

nearly finished the capital ships mod now, just got to do a couple things with variables being checked for piloting/throttle then its complete 🙂

cedar kindle
#

CBA_fnc_addPerFrameHandler takes delay as parameter. so you could enter that the code should only run every second

queen cargo
#

ye
or you could directly throw your framerate away

cedar kindle
#

lol

molten yacht
#

any way to allow windows on a structure to break but not allow it to enter a Destroyed state

little raptor
#

if they support it ofc

analog inlet
#

@hallow mortar i cannot see any reason why this script does not work.

_side =_loadout select 5; // returns CIV

side player would return CIV also, it still does not let me complete the script

hallow mortar
#

Does _side contain civilian or "CIV"?
The command civilian does not actually return a string, it returns a data type Side, which is represented as CIV in text output but will not be treated as a string by the game.
If your stored _side value is a string, the comparison will fail because you're trying to compare a data type String and a data type Side.

analog inlet
#

when i diag logged it, it printed CIV i have it calling from a database which works fine. i have tried with CIV and civilian but no luck

granite sky
#

dangerous code too, should use params or at least private vars.

#

oh, I guess it's not actually taking this stuff as direct inputs at least...

#

Storing code as text in UI :D

hallow mortar
#

Let me phrase it another way.

"CIV" isEqualTo civilian; // FALSE
"CIV" isEqualTo (str civilian); // TRUE
"civilian" isEqualTo civilian; // FALSE
(str side player) isEqualTo civilian; // FALSE
(side player) isEqualTo civilian; // TRUE```
#

There are a lot of data types which the game will happily display as text in the returns it presents to you, but are not strings. Side is one of them. It is its own thing, like an Object, and cannot be directly compared to a String.

#

If the player's side is stored in your database as the string "CIV" or even the string "CIVILIAN", you cannot compare it to the return from side or any of the side reference commands, because they are different data types.

analog inlet
#

That is how it’s stored

granite sky
#

you're missing a layer or two there...

analog inlet
#

would that return "CIV"

#

when its inserted into DB its using side player

granite sky
#

diag_log the _loadout value before the call compile line and you'll find out.

hallow mortar
#

I don't know how the database insertion handles it. I suspect it is storing it as a string and not as a data type Side.

granite sky
#

Somehow these rows are ending up as a piece of SQF code stored in a listbox UI anyway.

#

So there is certainly some... translation going on.

analog inlet
hallow mortar
#

Yes, that is the variable you are passing, but it then gets passed into whatever encodes it into the external database, and it's impossible to tell what that does to it (from here)

granite sky
#

That's the storage not the retrieval.

winter rose
analog inlet
#

basically used playerSide isEqualTo playerSide and it dont work 🤦‍♂️

winter rose
#

like, how?

hallow mortar
#

I feel like "basically" is concealing a lot of things that would be enlightening to know

analog inlet
#

it saves playerSide into db

#

i pull it and it fails the playerSide isEqualTo _side

winter rose
#

TA-DAAA

#

exactly what we tell you
format, when fed with a side, returns a string value of this side
civilian (a Side type) is different from "CIV" (a String type)

hallow mortar
#

Something in the process of encoding into and retrieving from the DB is changing it from a Side into a String containing the text representation of the side

#

Compare the return from your database to (str side player) instead of (side player) and I think you'll see a different result

analog inlet
#

i used the vehicleCreate script as reference from altis life

winter rose
#

not pertinent

manic fox
#

Want to save player information in ProfileNameSpace, on server side. Is it better to have multiple variables, in that namespace, for each player (like: My_Garage_UID, My_Inv_UID) , or should i use one hashMap where "My_Garage" for Example is a key or even an Array? Does it make any Difference? I imagine, the bigger the hashmap, the slower code. And the more Variables, the slower everything?

winter rose
sullen sigil
#

I've done that before and used hashmap, much easier

manic fox
#

Ah ok, thanks alot 😄

analog inlet
#

I just logged everywhere _side is set and being called, they all return CIV this also matches what is in the db, i must be fully dim or something just aint working

analog inlet
winter rose
analog inlet
#

im not looking for a string anywhere

winter rose
#
hint blufor; // error
hint str blufor; // ok - displays "WEST"
winter rose
analog inlet
#

atm i have _side = civ i have also tried _side = civilian both do not pass playerSide isEqualTo _side

winter rose
#

"CIV" is the string representation of civilian

analog inlet
#

nowhere am i saving or returning "CIV"

winter rose
analog inlet
winter rose
#

what does the db store then?

winter rose
#

because format will turn civilian into "CIV"

analog inlet
#

if i log playerSide it returns CIV

winter rose
#

I don't care

winter rose
sullen sigil
analog inlet
#

th db stores playerSide

analog inlet
winter rose
#

the db USES format WHICH RETURNS A STRING
this is what we all try to tell you here

#

so you have "CIV" in your db
and if you want to compare sides, try str side player == _side

sullen sigil
#

this is like trying to get my gran to write an email

analog inlet
#

if its "CIV" in the db then why does it show CIV and return CIV when i pull it from db

winter rose
#

because it's a pure string

sullen sigil
#

because its a string meowfacepalm

winter rose
#

ok, hold it a second.

analog inlet
#

ive always seen strings in the db with " around

#

im self taught, youre talking to me and im not understanding, then you take the piss

winter rose
#

the db does not know what a "side" is; it stores numbers, characters, etc
you use format on a side, the game converts the side (civilian) to a string, "CIV".
the db receives "CIV", the db stores "CIV".

in-game, if you do hint str side player, you will also get "CIV" - it is a stringified side

now when you receive the value from the db, it's a string, "CIV"
now to compare if you have the same "value", you cannot compare a side and a string, they are two different things

so you get the string version of the player's side (str side player = "CIV") and compare that

analog inlet
#

now to compare if you have the same "value", you cannot compare a side and a string, they are two different things i understand that

i did not know this was the case the db does not know what a "side" is; it stores numbers, characters, etc you use format on a side, the game converts the side (civilian) to a string, "CIV". the db receives "CIV", the db stores "CIV".

analog inlet
sullen sigil
#

maybe stop arguing with lou then when hes telling you what is happening

analog inlet
#

dunno what arguments youve had, i was merely sharing what i knew and telling you guys what was happening

winter rose
spark turret
#

can someone confirm or deny that moveToCompleted does not work for doMove?
At least it does not for me (opposed to what the docu says)

#

"DreadedEntity
Posted on Apr 02, 2022 - 20:31 (UTC)
This command can also check the status of doMove and commandMove (A3 2.08.149102) This is handy to make your script wait until a unit has moved to some position:
waitUntil {moveToCompleted _unit};"

winter rose
spark turret
#

will do

#

for once in my life i thought "oh nice, a quality of life feature in sqf!"

winter rose
#

there also is unitReady for this 🙂

spark turret
#

aaah ffs its working

#

why

#

okay now to test again with ace and cba

winter rose
#

you answered your own question 😄

spark turret
#

this script here confirms it. "completed sleep" is never triggered

[] spawn {AIJoe doMove getPosATL player; 
  sleep 0.5; 
  systemChat "starting"; 
  [] spawn {
    waitUntil { moveToCompleted AIJoe }; 
    systemChat "COMPLETE no sleep";
  }
  waitUntil { sleep 1; moveToCompleted AIJoe }; 
  systemChat "COMPLETE many sleps";
}
winter rose
#

(2× "no sleep" btw)

spark turret
#

oh yeah lol

#

seems that its only "True" for ~ 0.02 seconds

storm field
storm field
#

in the veh.sqf i have _veh = "rhsusf_M978A4_BKIT_usarmy_d," createVehicle getMarkerPos "groundspawn";
in init for the board is board1 addAction ["Spawn Vehicle","scripts\veh.sqf"]
Marker is named "groundspawn"

pliant stream
#

onEachFrame { while { true } do {}; };

spark turret
#

that should work tho

#

also your classname has a , in it

oblique summit
#

what?

#

why

pliant stream
#

why not!

oblique summit
#

oneachframe with another loop inside

#

makes no sense

split nebula
#

it'll only loop what 10000 times each frame? ;)

pliant stream
#

doesn't it mizzle? doesn't it?

oblique summit
#

lmao

storm field
#

class CfgFunctions {
    #include "modules\grad-vehicleSpawner\cfgFunctions.hpp"
};

_spawnLand = [20054.7,18756.9,0];
_spawnTracked = [[20054.7,18756.9,0],[20040.8,18756.9,0]];  // tracked vehicles will spawn max 5m from the first position - if first position is full, second position will be used
_spawnAir = [20052.6,18840.5,270];  // spawndirection is 128 >> in direction of my imaginary runway

[
    _board1,
    "GRAD Vehicle Spawner",
    {true},
    [],
    [_spawnLand,_spawnLand,helipad_1,_spawnAir,"spawnmarker_water_1"],
    {diag_log ["Vehiclespawner opened. Display:",_this select 0]},
    {diag_log format ["Vehiclespawner closed. Was open for %1s seconds.",CBA_missionTime - (_this select 1 select 0)]},
    [CBA_missionTime],
    {(_this select 0) disableTIEquipment true}
] call grad_vehicleSpawner_fnc_addInteraction;```
#

any ideas?

#

line 10 is this

oblique summit
#

if anything i think the while will slow it down

storm field
#

@ me if you know tf is goin on

still forum
#

That is SQF script

#

thats not config

#

scripts go into script files.
Config into config files

#

can't mix both

oblique summit
#

will*

storm field
#

ahhhh

#

so on the readme it says to put all this in the description.ext

still forum
#

Nop

oblique summit
#

wait yeah while will

still forum
#

it only says that about specifically these parts

#

It then assumes that you know where scripts go

#

you could put it into init.sqf

storm field
#

right

#

thanks

still forum
#

_board1 is undefined variable also

storm field
#

so what would I name the variable. vehiclespawnerboard work?

still forum
#

whatever you set in game, the variable on the object

storm field
still forum
#

yes

storm field
#

alright got it

#

so this stuff in init.sqf

still forum
#

yes

oblique summit
#

its gonna do oneachframe and then check if its true and then run the script in a loop

storm field
#

alr

#

now im getting this

oblique summit
#

instead of just using oneachframe so it just loops on eachframe

#

would slow it down i think

robust brook
pliant stream
#

are you sure though.. you should test it in game

storm field
#

alr

#

OMG THANK YOU!!!

split nebula
#

haha, my thoughts exactly :)

storm field
#

works cleanly

oblique summit
#

where is grim in here he would call us all muppets

pliant stream
#

is your icon an eve character

oblique summit
#

no

pliant stream
#

leshrack

split nebula
#

he is probably talking to me :) yeah it is

oblique summit
#

ah

pliant stream
#

cool

#

i want to get back into it but plex is too expensive QQ

split nebula
#

yup, i stopped playing like 3 years ago but it sort of became my identity during the 6 years i played eve so i use this avatar everywhere now. anyhoo /offtopic

pliant stream
#

i see

graceful kelp
#

need some vector help,


    _vehiclepos = getposasl _heli;
    _targetpos = getposasl _target;

    _distance = _vehiclepos distance _targetpos;
    _vector = _heli vectorModelToWorld [0,1,0];
    _direction = _vehiclepos vectorFromTo _targetpos;
    _angle = (_vector vectorDiff _direction) # 2;

    _relativeElevation = _distance * sin(_angle);
    hint str _relativeElevation;

trying to get relative elevation, which this does but it dosent take into account bank angle which i need it to

granite sky
#

You'd need to define "relative elevation".

#

I'm not sure why bank angle would be relevant.

graceful kelp
#

im trying to script variable elevation into a radar output, so if im in a 20degree bank i want the elevation relative to the aircraft centerline

granite sky
#

hmm, you just want the actual distance above the plane of the aircraft? You don't need the angle?

graceful kelp
#

no i want the relative angle from the nose center line respective of bank angle to the target