#arma3_scripting

1 messages Β· Page 755 of 1

fair drum
#

I'd slap a man who names a marker that lol

pine saddle
#

Hey ! If you have like a box in the backpack that you can put in on the ground with ace, is it possible to put things in and pick it up back in your backpack and it save the items in ?
Like a backpack in the back pack ?

fair drum
pine saddle
#

okay it's mostly for medical equipment. Do you have a link where i can look

clever radish
#

Anyone know what might be wrong here? Says expected object, type nothing under MoveinDriver

AirDropper = "B_T_VTOL_01_vehicle_F" createVehicle [0,0,0];
AirDropper setPos (getpos Drop_Plane_Spawner);

_grp2 = CreateGroup west;
_grp2 addvehicle AirDropper;
_unit2 = _grp createUnit ["B_CREW_F", [0,0,0], [], 0, "CARGO"];
_unit2 moveInDriver AirDropper;
_unit2 domove Drop_plane_Waypoint;
crude vigil
clever radish
fair drum
pine saddle
# fair drum tell me exactly what you are trying to do

So i have a ''bag'' that i can carry in my backpack. with ace i can put it on the ground and it has an inventory. I would like to be able to use this inventory and add things in it and then bring it back in my backpack and i want the inventory to be saved if it's even possible

fair drum
pine saddle
fair drum
#

issues with when the take eventhandler is firing

pine saddle
fair drum
#

good puzzle. i will figure it out

pine saddle
#

so if it's too complicated to be done well i guess we'll just keep putting things randomly in the inventory lmao

pine saddle
#

well we don't use vanilla interaction so it wouldn't be much of an issue technically

fair drum
pine saddle
fair drum
# pine saddle Damn i created a work monster lmao. I would love that you keep me in touch abou...

so I got this for you so far...

player addAction [
    "Stack Nearest Backpack",
    {
        params ["_target", "_caller", "_actionID", "_arguments"];

        // Find nearest groundholder
        private _nearGround = nearestObject [_caller, "GroundWeaponHolder"];
        if (isNull _nearGround) exitWith {systemChat "No Nearby Ground Holder"};

        // Find nearest backpack
        private _nearbp = everyBackpack _nearGround;
        if (_nearbp isEqualTo []) exitWith {systemChat "No Nearby Backpacks"};
        if (count _nearbp > 1) then {
            // Sort by item amount
            _nearbp = ([
                _nearbp,
                [],
                {count itemsWithMagazines _x},
                "ASCEND"
            ] call BIS_fnc_sortBy) select 0;
        } else {_nearbp = _nearbp select 0};

        // Grab player backpack
        private _playerbp = backpackContainer _caller;
        if (isNull _playerbp) exitWith {systemChat "You Have No Backpack Equipped"};

        // Grab items in nearest backpack
        private _items = itemsWithMagazines _nearbp;

        // Add bp to current bp
        _playerbp addBackpackCargo [typeOf _nearbp, 1];

        // Add items to stacked bp
        _items apply {
            backpackContainer _nearbp addItemCargoGlobal [_x, 1];
        };

        // Delete near bp
        clearBackpackCargo _nearGround;
    },
    nil, 1e-2, false, true, "",
    "private _obj = nearestObject [_target, 'GroundWeaponHolder'];
    (!isNull _obj) && {(_target distance _obj < 10)}",
    -1, false
];

only issue is that it deletes every backpack in that specific ground weapon holder. will mess with it more later, but this is functional for what you need

#

currently it grabs the most filled backpack in the nearest ground holder (not counting weapons, can add that later)

pine saddle
fair drum
pine saddle
jovial steeple
#

I'm making a holdAction that has the condition of the player having a Tool Kit, Item_ToolKit isnt working.
From a previous issues I found that to check for an Explosive Charge I need to look for 'DemoCharge_Remote_Mag', what is the best way to find an item's inventory name?

fair drum
#

"'ToolKit' in items _this" for your hold action condition

open fractal
#

Item_ToolKit
i've been there

fair drum
#

there an up to date list on all the reserved variables?

warm hedge
#

Every script commands are reserved

fair drum
#

oh i see what happened. i missed something and tried to overwrite a script command lol

winter rose
#

worked until some version in A2… not anymore πŸ˜›

warm hedge
#

true = false πŸ˜›

fair drum
#

you know what would be cool? an event handler for when a group changes combat behaviour, passing the group and mode.

warm hedge
#

You're lucky

#

It's happening in 2.10 πŸ˜„

fair drum
#

awwwwwwwwwww yes, no more triggers or loops for detection!!!!

#

where do you find the upcoming changelog?

winter rose
proven silo
#

can someone help me I got a question and i know it should be easy i just dont know how to do it

winter rose
#

not if you don't ask

#

don't ask to ask, just ask πŸ˜‰

proven silo
#

Okay so i have an arsenal in my mission and it works fine its a whitelisted one, the problem is the scroll menu option pop up even when people arent looking at the arsenal.

warm hedge
proven silo
#

i found this online this addAction ["<t color='#0099FF'>Access Arsenal</t>",{["Open", true] spawn bis_fnc_arsenal},[false],1,false,true,"","(_target distance _this) < 4"]; but that only opens up the regular arsenal i need to find out how i can run an execvm with the target distance

#

this is what i use currently this addAction["Open Virtual Arsenal", {null = [_this] execVM "whitelisted_arsenal\virtual_arsenal_init.sqf";}];

fair drum
#

don, stop for a sec. use the formatting on discord

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
proven silo
#

thank you

#
this addAction ["<t color='#0099FF'>Access Arsenal</t>",{["Open", true] spawn bis_fnc_arsenal},[false],1,false,true,"","(_target distance _this) < 4"];
#
this addAction["Open Virtual Arsenal", {null = [_this] execVM "whitelisted_arsenal\virtual_arsenal_init.sqf";}];   ```
fair drum
#

its because you haven't given addAction a radius argument yet (it defaults at 50m)

winter rose
#

(and you should add the action to the box, not the soldier)

proven silo
#

I was reading that but Im new to scripting and I don't know how i would type it in the second code

#

Yes I currently have it on an ammo box.

#

I just dont know how to type the code to add the target distance to execute the arsenal.

fair drum
#
this addAction [
    "Open Virtual Arsenal",
    {
        [_this] execVM "whitelisted_arsenal\virtual_arsenal_init.sqf"
    },
    nil, 10, true, true, "", "true", 4
];
#

that "4" is the radius

proven silo
#

Im going to test it right now thank you so much

fair drum
warm hedge
#

Every programming starts from reading something! πŸ˜„

proven silo
#

Thanks! ya i read that and thats where i found out the first code example #2 i just couldn't find anything examples on it with distance

#

works perfect your the man hypoxic

fair drum
#

@proven silo

proven silo
#

@fair drum i just tested my arsenal and i got this message

#

What you sent me works to launch a regular .sqf command, but for my whitelisted arsenal Im getting an error l

fair drum
#

[_this] execVM "blah"

proven silo
#

That fixed it, thank you again πŸ™‚

clever radish
#

Have anyone tried spawning units using Createunit, where the unit did not target enemy faction?

winter rose
#

you could either createAgent (to have a really dumb AI / no AI) and/or use disableAI "all" on it in order to not consider its brain

clever radish
clever radish
#

No mods beside 3den enchanted

winter rose
#

@cosmic lichen you might want to frame this one ^.^

clever radish
#
 _Hgrp1 = CreateGroup EAST;    
 _Hgrp1 addvehicle Helicopter_1;    
 _HUnit1 = _Hgrp1 createUnit ["O_CREW_F", [0,0,0], [], 0, "NONE"];  
winter rose
#

well, the code seems right
I suppose you then moveInDriver _hUnit into Helicopter_1

clever radish
#

Correct

winter rose
#

nothing should be "wrong" here
can you try such script in an empty Eden mission?

also maybe check that OPFOR are set as enemies to INDFOR (if these are your targets)

pulsar bluff
#

so what exactly is this "awake" command doing ... compared to "enableSimulation" ?

winter rose
pulsar bluff
#

what do you mean, like when dead bodies remain in mid-air even after a building is destroyed/deleted, or something else

#

or detaching a crate (like with carry scripts) and having it not fall to ground until using setdamage

winter rose
clever radish
#

Ground units will not attack either

winter rose
clever radish
pulsar bluff
#

maybe @unique sundial can let us know exactly what "awake" command does and is useful for πŸ™‚

winter rose
tender fossil
clever radish
winter rose
winter rose
granite sky
#

Do the created units actually have enemy visible in front of them?

ebon citrus
#

ok, so can someone replicate this issue:

Dedicated multiplayer environment
Command: removeItemFromUniform
Expected behaviour: Removes item/magazine from the unit's uniform. Global effect, global argument
When an item is added to a unit's uniform in the mission.sqm, removeItemFromUniform won't update the result to the client where the unit is local if run on the server-side. This means that requesting a list of items in the player's inventory doesnt include the item on the server-side, but does include it on the client-side.

If the item is NOT added in the mission.sqm, but after the mission has initialized, removeItemFromUniform works as expected

#

The issue isnt critical, as i can avoid thid by setting the unit loadout after the unit has initialized, but it is slightly inconvenient and took me some time to figure out what was wrong

granite sky
#

What if the item is part of a unit's default gear from the config?

hallow mortar
ebon citrus
jovial steeple
open fractal
#

can someone help me understand what I'm doing wrong?

#
_camera = "camera" camCreate [0,0,0];
_camera camSetFOV _fov;
_camera attachTo [_heli, [2,0,0]];
_camera setDir (getdir _heli) + _dir;
switchCamera _camera;
#

everything works but FOV

#

it's always the default fov no matter what I input

#

oh my bad, didn't read the description for camSetFOV

fair drum
#

i see no commit either

#

is there a way to start a game outside of APEX where isMultiplayerSolo will return true? Playing a hosted mp game by yourself causes a false flag.

open fractal
#

yeah I was using switchCamera instead which works for camera postion/direction but not the camera settings themselves

open fractal
#

when I call this function

params ["_heli"];
private _cameras = [];
_camera1 = "camera" camCreate [0,0,0]; 
_camera1 attachTo [_heli, [1.5,-1,-1.5 ]];  
_camera1 setDir (getdir _heli) - 150; 
_camera1 camsetFOV 0.6;
_camera1 setvectorUp [0,0.4,1];
_camera1 camCommit 0;
_cameras pushBack _camera1;

_camera2 = "camera" camCreate [0,0,0];  
_camera2 attachTo [_heli, [-1,2.2,-0.8 ]];   
_camera2 setDir (getdir _heli) + 100;  
_camera2 camsetFOV 0.85; 
_camera2 setvectorUp [-0.2,0,1]; 
_camera2 camCommit 0;
_cameras pushBack _camera2;

_cameras

there is no return value. Am I going about this wrong?

#

oh nevermind something is going wrong with the script

slender beacon
#

is setVehicleLock global?

#

would be very annoying if it wasn't

slender beacon
#

sadly I do not see any comments or details regarding networking in that page

slender beacon
#

I see

#

That opens a whole new window

#

thanks a ton!

open fractal
#

bear in mind that vehicles are local to the driver

#

so you would need to remote exec if the script isn’t being run on the driver’s end

slender beacon
#

got it

tough abyss
#
Tex_fnc_respawn_HQ =
{
    private ["_HQ"];
    _tele =_this select 0;
    _caller = _this select 1;
    
    if (isnil {
        alreadyTeleporting
    }) then {
        alreadyTeleporting = 0;
    };
    alreadyTeleporting = 1;

    switch (true) do
    {
        case !((HQ isEqualTo objNull) && (!alive HQ)):
        {
            _HQ = HQ;
        };
        case !((HQ2 isEqualTo objNull) && (!alive HQ2)):
        {
            _HQ = HQ2;
        };
        case !((HQ3 isEqualTo objNull) && (!alive HQ3)):
        {
            _HQ = HQ3;    
        };
        case !((HQ4 isEqualTo objNull) && (!alive HQ4)):
        {
            _HQ = HQ3;    
        };
        case !((HQ5 isEqualTo objNull) && (!alive HQ5)):
        {
            _HQ = HQ3;    
        };
        default:
        {
            hint "You cannot Reinsert at this time."
        };
    };

    [0, "BLACK", 10, 1] spawn BIS_fnc_fadeEffect;
    sleep 10;
    private _spawnPosHQ = _HQ getRelPos [1, random 360];
    _caller setPos _spawnPosHQ;
    [1, "BLACK", 0, 1] spawn BIS_fnc_fadeEffect;
    sleep 100;
    alreadyTeleporting = 0;
};```

Hi guys I have made this tp function to tp a player to another players location. 

Im pretty sure the code is self explanatory but what I want to do is have 5 player slots named (HQ - HQ5). However, for some reason it only works when the player slots are filled. 
When they are not, i get an error message saying theres undefined variables.

Ive been trying to fix for ages, but cant figure it out?
distant oyster
#

does the error give more info as to what variable is undefined?

tough abyss
#

I got it working with the error. but ofc, I would like my code to be error free, not just working πŸ˜„

open fractal
#
    private _HQs = [HQ,HQ1,HQ2,HQ3,HQ4,HQ5];
    private _HQ = _HQs select (_HQs findIf {alive _x});
    if _HQ == -1 then {
        hint "You cannot reinsert at this time."
    };
#

@tough abyss have you considered findIf

#

oh shit

#

i did it wrong hold on

tough abyss
open fractal
#
    private _HQs = [HQ,HQ1,HQ2,HQ3,HQ4,HQ5];
    private _HQindex = _HQs findIf {alive _x};
    private _HQ = objNull;
    if (_HQindex < 0) then {
        hint "You cannot reinsert at this time."
    };
    else {
        _HQ = _HQs select _HQindex
    };
#

here we go

#

there's even better ways than that i bet but i dont have the brain power beyond this

tough abyss
open fractal
#

_HQindex not _HQ on the first one

open fractal
#

except at the end

distant oyster
#

the missing ; are okay syntax wise but are triggering me, just like the missing () around the if condition notlikemeowcry

open fractal
#

the missing () is just a brain fart ngl

#

im not that crazy dude

#

been jumping between a python bot and arma 3 getreal

tough abyss
distant oyster
#

leaving out the ; is usually used for indicating return values, like

_fnAdd = {
  params ["_a", "_b"];
  private _sum = _a+_b;
  _sum
};
open fractal
#

you see, i'm an absolute madman

open fractal
tough abyss
#

just getting undefined variable in expression : hq

distant oyster
#

alrighty lets take a step back. how are you defining the HQ variables?

tough abyss
#

Eden.

open fractal
#

is it HQ or HQ1

tough abyss
#

and with all of them listed, i get a different error, saying type object, expected number, not a number

distant oyster
#

check the rpt and post the whole error

tough abyss
#
0:08:52 Starting mission:
 0:08:52  Mission file: testing%20TP%20STUFF
 0:08:52  Mission world: VR
 0:08:52  Mission directory: C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\
 0:08:52 EPE manager release (0|1|0)
 0:08:54  Mission id: 3d2d15b54f9c9868f10649635811c8121ba0e703
 0:08:55 Error in expression < {alive _x};
private _HQ = objNull;
if (count _HQ < 0) then {
hint "You cannot r>
 0:08:55   Error position: <count _HQ < 0) then {
hint "You cannot r>
 0:08:55   Error count: Type Object, expected Array,String,Config entry,HashMap
 0:08:55 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 18
#
 0:07:18  Mission world: VR
 0:07:18  Mission directory: C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\
 0:07:18 EPE manager release (0|1|0)
 0:07:21  Mission id: 567b5b4a6f00f2eeb7d08467846d69aea4977819
 0:07:22 Error in expression <ive _x};
private _HQ = objNull;
if (_HQ < 0) then {
hint "You cannot reinsert at>
 0:07:22   Error position: << 0) then {
hint "You cannot reinsert at>
 0:07:22   Error <: Type Object, expected Number,Not a Number
 0:07:22 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 18```
open fractal
tough abyss
#
    private _HQs = [HQ,HQ2,HQ3,HQ4,HQ5];
    private _HQ = _HQs findIf {alive _x};
    private _HQ = objNull;
    if (_HQ < 0) then {
        hint "You cannot reinsert at this time.";
    } else {
        _HQ = _HQs select _HQ
    };
open fractal
#

you're getting that error because that's the version where I forgot to swap out _HQ for _HQindex in the if check

tough abyss
#

ohh

#

0:14:18 Mission file: testing%20TP%20STUFF
0:14:18 Mission world: VR
0:14:18 Mission directory: C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR
0:14:18 EPE manager release (0|1|0)
0:14:20 Mission id: 0756d4059452075aa6536dd7d0e91e0f451f6c23
0:14:21 Error in expression <ert at this time.";
} else {
_HQ = _HQs select _HQ
};
0:14:21 Error position: <select _HQ
};
0:14:21 Error select: Type Object, expected Number,Bool,Array,code
0:14:21 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 20

open fractal
#

um

#

same thing

#

the other _HQ

#

_HQ = _HQs select _HQindex

#

not
_HQ = _HQs select _HQ

tough abyss
#

πŸ€¦β€β™‚οΈ

#

yeah, no your right

open fractal
#

thats on me for makign HQ one thing and then changing my mind

#

but yeah i think my most recent code block is the ticket

tough abyss
#

private _HQs = [HQ,HQ2,HQ3,HQ4,HQ5];
private _HQindex = >
0:16:54 Error position: <HQ,HQ2,HQ3,HQ4,HQ5];
private _HQindex = >
0:16:54 Error Undefined variable in expression: hq
0:16:54 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 14

^ Happens when the player / AI is not there.

open fractal
#

alright we can do this

distant oyster
#
private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};
open fractal
#

yeah what he said

crude vigil
tough abyss
#

Mission name space, that was it

distant oyster
tough abyss
#

0:20:44 Error in expression <Effect;
sleep 10;
private _spawnPosHQ = _HQ getRelPos [1, random 360];
_caller s>
0:20:44 Error position: <_HQ getRelPos [1, random 360];
_caller s>
0:20:44 Error Undefined variable in expression: _hq

😒

#

0:21:36 Error in expression <t;
sleep 10;
private _spawnPosHQ = _HQs getRelPos [1, random 360];
_caller setPo>
0:21:36 Error position: <getRelPos [1, random 360];
_caller setPo>
0:21:36 Error getrelpos: Type Array, expected Object
0:21:36 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 56

distant oyster
crude vigil
distant oyster
open fractal
#

because _HQ should be defined regardless in this case

distant oyster
#

except when he is calling the function without returning the value

tough abyss
# open fractal ```sqf private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {m...

What i have is:

Rifle_fnc_respawn_HQ =
{
    _tele =_this select 0;
    _caller = _this select 1;
    
    if (isnil {
        alreadyTeleporting
    }) then {
        alreadyTeleporting = 0;
    };
    alreadyTeleporting = 1;

    private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};

    private _HQindex = _HQs findIf {alive _x};
    private _HQ = objNull;
    if (_HQindex < 0) then {
        hint "You cannot reinsert at this time.";
    } else {
        _HQ = _HQs select _HQindex
    };

    hint "You are being Reinserted to the HQ Section... Please Wait...";
    [0, "BLACK", 10, 1] spawn BIS_fnc_fadeEffect;
    sleep 10;
    private _spawnPosHQ = _HQs getRelPos [1, random 360];
    _caller setPos _spawnPosHQ;
    hint "You Have reinserted to HQ Section";
    [1, "BLACK", 0, 1] spawn BIS_fnc_fadeEffect;

    alreadyTeleporting = 0;
};
#

and this is the error πŸ˜„

sleep 10;
private _spawnPosHQ = _HQs getRelPos [1, random 360];
_caller setPo>
 0:27:34   Error position: <getRelPos [1, random 360];
_caller setPo>
 0:27:34   Error getrelpos: Type Array, expected Object
 0:27:34 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 58```
open fractal
#
    if (isnil {
        alreadyTeleporting
    }) then {
        alreadyTeleporting = 0;
    };
    alreadyTeleporting = 1;
#

what does this do anyway

distant oyster
#

private _spawnPosHQ = _HQs getRelPos [1, random 360]; should be private _spawnPosHQ = _HQ getRelPos [1, random 360];

open fractal
#

cant it just be

alreadyTeleporting = 1;
tough abyss
#

until its finished.

open fractal
#

i don't understand how this does what you describe

tough abyss
#

just removed it to keep the text short

open fractal
#

i see

tough abyss
#

Rifle_fnc_respawn_HQ =
{
    _tele =_this select 0;
    _caller = _this select 1;
    
    if (isnil {
        alreadyTeleporting
    }) then {
        alreadyTeleporting = 0;
    };

    if (alreadyTeleporting == 1) exitwith {
    hint "You are already Teleporting... Please Wait...";
    alreadyTeleporting = 0;
    };

    alreadyTeleporting = 1;

    private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};

    private _HQindex = _HQs findIf {alive _x};
    private _HQ = objNull;
    if (_HQindex < 0) then {
        hint "You cannot reinsert at this time.";
    } else {
        _HQ = _HQs select _HQindex
    };

    hint "You are being Reinserted to the HQ Section... Please Wait...";
    [0, "BLACK", 10, 1] spawn BIS_fnc_fadeEffect;
    sleep 10;
    private _spawnPosHQ = _HQ getRelPos [1, random 360];
    _caller setPos _spawnPosHQ;
    hint "You Have reinserted to HQ Section";
    [1, "BLACK", 0, 1] spawn BIS_fnc_fadeEffect;

    alreadyTeleporting = 0;
};
#

thats it in full

tough abyss
open fractal
#

wouldn't that make it run twice if it is called 3 times?

tough abyss
#

both of ya

open fractal
#

yw

distant oyster
#

you could shorten that check to

if (!isNil "areadyTeleporting") exitWith {
  hint "You are already teleporting";
};
alredyTeleporting = true;
...
alreadyTeleporing = nil;
tough abyss
#

i just realised

open fractal
#

Terra with the πŸ“ 

tough abyss
#

nvm. me retardo

#

thanks all πŸ™‚

distant oyster
#

yw

waxen tendon
#

is there a formal specification of the language written up somewhere?

fair drum
#

and every page listed under "scripting topics" at the top of that page

waxen tendon
#

that is hardly a formal spec

round crystal
#

Is there a fast way to check if an array of strings are in another string?

open fractal
round crystal
#

["airport","airstrip","airfield","terminal","airbase","aerodrome"] in (toLower (text _x))

#

etc.

open fractal
#

like

#

what's your goal

#

what are you trying to output

#

if any of them are in the string? which one is in the string?

round crystal
#

I'm trying to grab locations from a given map and dump them into arrays, so that the mission is portable

#

Yeah if any string is in there

#

I could do it forEach of those strings, but this is already in a forEach of the nearestLocations and nesting like that seems wrong

open fractal
#
(["airport","airstrip","airfield","terminal","airbase","aerodrome"] findIf {_x in (toLower (text _testedString))}) > -1
round crystal
#

that's much better, it doesn't continue the check if it finds something

open fractal
#

why text?

round crystal
#

_x is a location from nearestLocations

open fractal
#

oh i see syntax 2

warm hedge
#

IIRC toLowerANSI is faster. I'm not sure how different between two tho

winter rose
#

Code Perf page has a comparison

#

also… may only work in English!

open fractal
#

finally

#

lowercase mandarin

ebon citrus
copper raven
pliant stream
ebon citrus
#

can i stop the player from recovering from ragdoll (i.e. when driven over by a vehicle)?

winter rose
ebon citrus
#

i cant find a state for ragdoll

winter rose
#

they will remain in "hurt on the ground" state

coarse dragon
#

Anyway to make a AI gunner fire helicopter miniguns for 4 minutes?

coarse dragon
#

Interesting

ebon citrus
hushed tendon
winter rose
ebon citrus
#

yeah

#

is there a version of setHit or similar that takes a global argument?

#

i dont really want to enabled setHit on the client through my BE filters

#

This script run on client side causes the player to take 60%damage but still be able to run:

allPlayers#0 setDammage 0.6;
allPlayers#0 setHit["legs", 0.4];```

where as if run on the server-side it doesnt allow the player to run
#

the hit is not set if run on the server

#

presumably because the player is not local to the server

winter rose
#

remoteExec

#

local argument, global effect

ebon citrus
#

not sure if i like the idea of allowing the client to set their hit-status

winter rose
#

no, it's the server that remote execs it on them I believe
I think they cannot execute the script command itself

ebon citrus
winter rose
#

I do think so yes
don't quote me on that and make some tests, but I believe the server can always run what it wants/needs

ebon citrus
#

i see

winter rose
#

Dedmen/KK might know better πŸ‘€

granite sky
#

I was staring at this and I'm not 100% sure what it means:

CfgRemoteExec defines rules for the remote execution of functions and commands. These rules only apply to clients. The server is not subject to any limitations, everything is enabled and allowed for it.

#

But letting the server remoteExec anywhere would make sense assuming that you can't spoof.

ebon citrus
solid ocean
#

question for you all so was running an op yesterday and made a custom object using attachTO however when i ran the op the objects did not attach to the object and were stationary?

heres an example of the sort of script i ran:

if (isServer) then {
LTr1 attachTO [Chimbody,[0,0,0]];
};

#

for context in single player eden testing it worked fine

winter rose
#

we need context of this code
if you put this in e.g an addAction, the code is run on the client's machine, not the server

winter rose
#

I don't know where your code is run

solid ocean
#

OH

#

its input from the init line of the object but judging from what you said it sounds like its doing the clientside thing not the server

winter rose
#

it may work from the init, unsure why it does not
try delaying it a bit

solid ocean
#

how would i add a delay whats the code structure for that never used one before

#

i did read from the Bohemia wiki that sometimes codes using attachTo can be a bit iffy so it might not properly initialise upon server startup or something or when the objects in question are placed into the world

#

would putting the code twice as like a backup help the issue so if it doesnt read it the first line of code itll read the second line?

noble zealot
#

I need to set prefix on all my PBO files?

#

Not the mission. But server only stuff.

winter rose
solid ocean
#

non functioning of course just purely for looks

winter rose
#

so Eden-placed objects, hmm
but no need to attach them if they are to be static? place them, make them simple objects and save perf?

solid ocean
#

the body is a vehicle (unarmed) the weapons are all turret emplacements

#

the rest is props to kind of flesh out the body and look

#

so yes unfortunately they do need to move which is why im so stumped

ebon citrus
#

is there a method for removing default actions from containers? I would like to remove the intentory-action from a dead body container

warm hedge
#

lockInventory

ebon citrus
#

i tried both locking the individual clothing containers and the unit as a whole

ivory lake
#

might have to use an inventoryOpened eventhandler

ebon citrus
#

yeah, trying to stay away from that

#

too many loopholes

#

are the actions defined engine-side

ebon citrus
#

Done it

#

i managed to do it through config

granite sky
#

@ebon citrus How, out of interest?

ebon citrus
#

probably more proofed than eventhandlers

granite sky
#

thx

ebon citrus
#

@granite skynote, it is going to remove the action, albeit doesnt block just pressing "i" to open the inventory

#

ok, so removing Rearm and adding this to override with my own inventory works:

player addEventHandler ["InventoryOpened", { 
 params ["_unit", "_container"];
 (_container isKindOf "Man");
}];```
west grove
#

oi fellas. situation: i have weapon X in my hands .... can i somehow via script predict where that weapon will hit if i fire it? :x

#

maybe some funny math with bullet speed and power of the weapon?

#

a bit like those grenade-throwing markers that i have seen ages ago, but for generic rifles

ebon citrus
#

Ace probably has them

granite sky
#

Depends how accurate you want it, and also whether you're running ACE ballistics. Because targets can change direction during the flight time you can't be sure either.

ebon citrus
ebon citrus
granite sky
#

targets do.

ebon citrus
#

he was asking about CCIS

#

not lead indicator

granite sky
#

Oh, air vs ground stuff?

ebon citrus
#

no, just continuously calculated impact

#

oi fellas. situation: i have weapon X in my hands .... can i somehow via script predict where that weapon will hit if i fire it? :x

#

where the bullet will hit has nothing to do with your target

granite sky
#

I'm not following. It certainly affects it if it hits your target.

#

I figured he was talking about some sort of target lead / range / wind adjustment trainer.

hallow mortar
#

No, he wants to predict the impact point. It's not "where do I aim to hit point x", it's "where do I hit if I fire now". I think it was pretty clear.
You certainly could use this to assist with drop and wind training, but not target leading.

west grove
#

the idea is to script a hit / impact indicator on the players hud

#

currently we can add ballisticsComputer = BallisticsTargetLead + BallisticsCCIP; to a weapon config to enable it. but i need it more ... general, and outside of config

ebon citrus
#

@west grove since you dont ha e real terrain-data, you'd need to calculate the arc, then sample the terrain height along said arc at reasonable intervals until the height of the terrain matches/exceeds the arc point Z value

fair drum
#

infinite samples only acceptable

granite sky
#

I can't find a reference for how often Arma samples or what integrator they use. I guess you could check the projectile position per-frame and reverse-engineer it :P

#

ACE advanced ballistics & wind are per-frame but Arma's still simulating behind that.

limber panther
#

Hello! Can i ask for a help? I would like to create a warning for pilots to warn them about possible collision with terrain. For testing purpose i made it with just a hint. But it's giving me some error about boolean. Here's the script: ```sqf
private _ahead1 = createVehicle ["Sign_Sphere200cm_F", [0,0]];
_ahead1 attachTo [_vehicle, [0, 500, 0]];
private _ahead2 = createVehicle ["Sign_Sphere200cm_F", [0,0]];
_ahead2 attachTo [_vehicle, [0, 600, 0]];
while {alive _vehicle} do {
if terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2] == true then hint "Terrain ahead, pull up!";
sleep 5;
};

limber panther
winter rose
#

not for if, also no code brackets {} for then

limber panther
#

thank you @winter rose

copper raven
limber panther
granite sky
#

The () in an if are technically optional if the contents don't run into precedence issues, so you can do if isServer then { code here } for example, but not if _var == 2 then { code here }. Really not worth saving the two characters though.

limber panther
#

allright, so i did what you all suggested and that works but now i have a new problem, the script is following: ```sqf
private _ahead1 = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_ahead1 attachTo [_vehicle, [0, 500, 0]];
_ahead1 hideObjectGlobal true;
private _ahead2 = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_ahead2 attachTo [_vehicle, [0, 700, 0]];
_ahead2 hideObjectGlobal true;
private _ahead3 = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_ahead3 attachTo [_vehicle, [0, 900, 0]];
_ahead3 hideObjectGlobal true;
while {alive _vehicle} do {
if (terrainIntersectASL [getPosASL _vehicle, getPosASL _ahead1]) then {hint "whoop whoop - pull up!"};
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2]) then {hint "Terrain pull up"};
if (terrainIntersectASL [getPosASL _ahead2, getPosASL _ahead3]) then {hint "Caution terrain"};
sleep 1;
};

limber panther
#

but it doesn't

hallow mortar
#

For testing purposes, try it with systemChat instead of hint and see what happens

limber panther
hallow mortar
limber panther
#

ok

#

hold on

hallow mortar
#

There's also a structural problem which is that multiple of your conditions can be true at the same time

#

Terrain is big. There can be an intersection between _ahead1/_ahead2 and an intersection between _ahead2/_ahead3. And since _ahead3 is the last in the sequence, that hint gets created last so that's the one it always shows

limber panther
hallow mortar
#

That's the same problem

limber panther
#

how do i set it, so that only 1 of them is active at a time? (let's count a case with just 1 terrain intersection)

#

is there a way to deliver false into if condition when another if has true condition?

#

never mind i got an idea

hallow mortar
#

Someone can probably make a more compressed version but here's how to adapt what you already have:

// Initialise our variables
private _warning = "";

// First make the lowest-priority check and set the warning state for that
if (terrainIntersectASL [getPosASL _ahead2, getPosASL _ahead3]) then {
    _warning = "far";
};

// If a higher-priority warning is also true, replace the warning state with the higher one
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2]) then {
    _warning = "close";
};

// etc
if (terrainIntersectASL [getPosASL _vehicle, getPosASL _ahead1]) then {
    _warning = "TOO CLOSE";
};

// If any warning state has been set, display the warning
if (_warning != "") then {
    hint _warning;
};```
limber panther
hallow mortar
#

For what purpose?

limber panther
limber panther
#

am i right?

hallow mortar
#

No

limber panther
#

oh i think i got it now

hallow mortar
#

The variable _warning contains the content of the hint (or the string of the sound file in your final version). Each condition changes the content to the appropriate text for the level it's checking, with the closest condition last so that the closest true condition is the final text passed to hint/playSound.

#

If I thought one universal warning was fine I'd have left you with what you originally had, since that's all it did :U

limber panther
limber panther
# hallow mortar The variable `_warning` contains the content of the hint (or the string of the s...

so with the play sound, it's done this way? ```sqf
// Initialise our variables
private _warning = "";

// First make the lowest-priority check and set the warning state for that
if (terrainIntersectASL [getPosASL _ahead2, getPosASL _ahead3]) then {
_warning = [getMissionPath "sound\far.ogg", _vehicle];
};

// If a higher-priority warning is also true, replace the warning state with the higher one
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2]) then {
_warning = [getMissionPath "sound\close.ogg", _vehicle];
};

// etc
if (terrainIntersectASL [getPosASL _vehicle, getPosASL _ahead1]) then {
_warning = [getMissionPath "sound\too_close.ogg", _vehicle];
};

// If any warning state has been set, display the warning
if (_warning != "") then {
playSound3D _warning;
};

hallow mortar
#

Yes, or if you really wanted to save on characters like some kind of nerd, _warning would be only the string and the final output would be playSound3D [getMissionPath _warning, _vehicle]; (same effect, just slightly shorter overall)

#

That being said, playSound3D is not necessarily the best way to have a "cockpit alert" sound. playSound3D sounds don't follow moving objects, they remain at the position the object was at when the sound started. They will also be audible from outside the vehicle, for other players.

#

You should probably use playSound, just make sure it's only executed where the pilot is local.

limber panther
limber panther
hallow mortar
#

say3D doesn't have the same issue, but it has certain other peculiarities that make it less good for this case than playSound

#

as for locality...where is this script being executed? Server, all clients, etc.?

limber panther
#

on a noticeboard

#

oh you mean...

#

sorry

open fractal
#

frank do you mind if i clean up some of your code as practice

#

or try to rather

limber panther
limber panther
open fractal
#

nah shorten it

limber panther
# open fractal nah shorten it

understood, it would be a waste of your time right now, tomorrow i'll finish the final script so i can ping you if you like and you can clean the final version

hallow mortar
#

Okay, so this is already being executed locally to whoever uses the action. If you're certain this person will always be the pilot, locality is fine. If the plane could change pilots, then you would just remoteExec the playSound, using driver _vehicle as the locality parameter

#

Also, because hideObjectGlobal is server exec, you need to remoteExec it using 2 as the locality parameter or it won't work in multiplayer

open fractal
#

numbers are wrong hold on

#

there

limber panther
hallow mortar
#

I can't see what else I could mean

limber panther
#

allright, tomorrow i'll try my best to get that working, thank you for your help @hallow mortar have a good night

digital jacinth
#

is it possible to interfere with the vanilla data link? basically looking for a way to add EW to a mission.
in short, jam the datalink, do not allow sharing of information or targeting even using the rooikat

west grove
#

should be possible to disable datalink via script, no? in which case you would just need to cycle through all vehicles in the area and run it

digital jacinth
#

yeah that is basically the only one i found and if i want to enable them receiving or sending.

#

was really hophing that you can fiddle around with accuracy and such of the data being sent

coarse dragon
#

_movementdata = <mdata> ; _firingdata = <fdata> ; _sequence = [VehicleName, _movementdata] spawn BIS_fnc_UnitPlay; [VehicleName, _firingdata] spawn BIS_fnc_UnitPlayFiring;

I've been told that Unitplayfiring doesn't work anymore. Does anyone know if this is true

hollow thistle
#

it's not

coarse dragon
#

Ah ok

stuck inlet
#

Hello Everyone, im new here and i have few questions
is it possible to modify Health, Stamina and shield ?

ebon citrus
stuck inlet
warm hedge
#

Isn't that health aka?

stuck inlet
winter rose
#

aka stronger armor

stuck inlet
#

Maybe in Arma its the same, but in other games its not

ebon citrus
stuck inlet
ebon citrus
#

I dont think you can change armor values in script

#

You can intercept incoming damage with eventhandlers

#

But i advice against that if youre worried about cheating

warm hedge
#

Guess HandleDamage can handle both health and shield, you call?

stuck inlet
#

what if i wanted to hire someone to develop scripts / mods ? does it work this way here ?

ebon citrus
#

Yep, handleDamage is real handy

warm hedge
ebon citrus
#

But also gives me the creeps of allowing clients to dictate how much damage they take

stuck inlet
warm hedge
#

I honestly don't think using Arma 3 is a good idea for this ambitious idea

stuck inlet
#

thats why im asking as im trying to add as much games as i can ..
its going to be free, trying to help people adapt to a healthier lifestyle and help fighting gaming addiction and disorder by using games itself
however, its a new technology i am developing and trying

ebon citrus
#

And those arent really super mp compatible

stuck inlet
ebon citrus
#

The problem is that each server would have to run your script

#

For it to take effect

#

Otherwise you'd have servers that dont and servers that do

#

And i'd say that most dont

stuck inlet
ebon citrus
#

And what is stopping people from spoofing their physical activity for ingame gains

stuck inlet
ebon citrus
stuck inlet
ebon citrus
stuck inlet
#

i'd really appreciate any suggestion to make my search for a dev easier

ebon citrus
#

Look in the pinned messages for a template

stuck inlet
stuck inlet
ebon citrus
stuck inlet
#

Well thank you anyway

ebon citrus
#

Received

spark turret
#

how do i find out what the correct prefix is for a qvar?
QGVAR(openLogistikMenu)
dont know how that works

#

For ACE this is done automatically through the usage of the GVAR macro family.```
so i need the addon + the component, is this the component then?
```#define COMPONENT ace```
spark turret
#

aaah thank you πŸ‘

#

is the whole QVAR ordeal a CBA macro or something else?

ebon citrus
spark turret
#

i want to define a list of "whitelisted" player(slots), that will on JIP get added an ace action for an arsenal

#

but i cant figure out how to properly do that, the player objects dont exist until they have joined.

#

if i save an array of whitelisted playerobjects to a variable, its saved as [any,any,..].

spark turret
#

give the units a variable name, and then in the crates init call [player1,player2] call makeMyArsenal;

spark turret
#

missionNamespace setVariable ["whitelist",_whitelist];
im literally just saving the [player1, player2] array to global, but it turns into [any,any] if the players havent joined

#

and it doesnt turn back on join either

#

i set the variable for the player now instead, this setVariable ["isWhitelisted",true], that seems to work

steel fox
steel fox
spark turret
#

still very annoying honestly.

hollow thistle
#

you could store strings in array and use missionNamespace getVariable ["playerN", objNull] and fetch the object when you're checking if the player is one of those.

coarse dragon
#

Can you not get the AI gunners to just fire missles ect when you tell em too without having to use a code

granite sky
#

@coarse dragon forceWeaponFire

#

and fireAtTarget

coarse dragon
#

I'm not able to get that to work notlikemeow

granite sky
#

what exactly are you trying to use it with?

tough parrot
#

what is the format of frameTime in unitCapture?

limber panther
winter rose
#

but it seems correct, yeah

limber panther
hallow mortar
#

No, it's correct as it is

limber panther
#

but i'm not sure

#

great, thank you @hallow mortar and @winter rose πŸ™‚

#

to our previous conversation, something came to my mind

#

we were discussing warnings for pilots as they fly the aircraft but what if they land and leave the plane?

#

in case the plane is landed near terrain ahead, it might trigger the warning, will it keep sounding for the pilot even when he leaves the plane untill someone else gets in as a new pilot or will it silence the alarm when he gets out?

#

i'll send the script again

#

i hope i made the rest of the code correctly

#

i was wondering about the condition in the while because it returns true as long as the plane is alive

#

but what if the pilot leaves? will the pilot still hear the warning?

limber panther
crude vigil
limber panther
crude vigil
#

if (!(isTouchingGround _vehicle)) then {check warnings};

#

if it is NOT touching to ground, check warnings.

limber panther
crude vigil
limber panther
fading magnet
#
_index1 = player addEventHandler ["Hit", {
    player setDamage 0;
    systemChat "I'm hiiiiit!!!";
}];


_index2 = player addEventHandler ["Killed", { 
    playerPos = getPos player;
    player_className = str typeOf player;
    systemChat playerPos;
    systemChat player_className;
    newUnit = group player createUnit [player_className,playerPos,[],0,"FORM"];
    addSwitchableUnit newUnit;
    SelectPlayer newUnit;
    systemChat "YAY! new life!";
    }];```

I'm writing this code ,which tries to make player invulnerable, as a practice. the first EH works fine but the second one doesn't work at all. I dunno what im doing wrong. :(((
winter rose
#

also, if you are in singleplayer it will trigger the "you are dead" screen unless you add a file in your mission dir

fading magnet
#

I wrote all these lines in a sqf file in mission directory. I'm gonna remove str and see if it works

#

nope, still won't trigger :'((

granite sky
#

systemChat playerPos needs to be systemChat str playerPos

#

Still won't work but at least it prints :P

fading magnet
#

Ohh I see, it was an array. Silly me. Thanks 😊

granite sky
#

When you're scripting you should tick "show script errors" in the launcher parameters. That one will show up then.

coarse dragon
#

How does fire at target ment to look like for a AI gunner? Do I need the missle name config

lucid linden
#

Hey guys! Does anybody know how to attach the Offroad Police Lightbar to other vehicles?

lucid linden
#

Oh wait

#

I think I'm in the wrong channel

limber panther
#

Can i ask for a help? the script doesn't work - i can not hear those warning sounds (playSound) but the hint shows up fine πŸ˜• any idea what could have gone wrong? (i did place those sounds in mission file and i did define them in cfg sounds) https://www.sqfbin.com/lajurulitizaloludico

winter rose
#

also, why remoteExec if it is a local script?

#

but yeah your indentation is all over the place 😬 can't read where is what

#

so yeah the var may be defined, but idk how where what

limber panther
limber panther
limber panther
limber panther
#

also if it's caused by undefined variable, why i don't see any error?

tough trout
#

If I wanted to make something sway gently and/or rotate slowly, because it's a heavy item attached by a cable, where would I start?

austere granite
#

setVelocity

tough parrot
#

what does -1#IND mean? I got that result from a math expression.

granite sky
#

It's a NaN. Something like 0/0 or sqrt(-1)

coarse dragon
#

!Alive t1;

#

why wont this trigger me frigging escape task, when i blow the object t1 up

#

ive put it into the conditions

winter rose
#

Β―\_(ツ)_/Β―

coarse dragon
#

Wrong box?

distant oyster
#

whats t1?

coarse dragon
#

A empty object that blows up

#

It's some big AA missle thing in SOG

#

I may or may not have forgot to select. All playable units notlikemeow

tough parrot
#

With problems like that you need to log or systemchat every step in the procedure to see where it is going wrong.

coarse dragon
#

Yep

#

I forgot to set the tasks to all playable units

#

I'd be a terrible game designer notlikemeow notlikemeow

tough parrot
#

Everyone does that. You just need good error detection procedure.

coarse dragon
#

Hmm how to get a dude to join your squad when you reach a trigger?

open fractal
#

make sure you have brackets around the unit since join takes an array

#
[_unit] join (group player);
coarse dragon
#

😩

open fractal
#

?

coarse dragon
#

I probably done it wrong

open fractal
#

it should work as long as the trigger is firing and _unit is the variable for the unit you want to join the player's squad

coarse dragon
#

OK me play. I gave SQ1. I gave the guy Who I wanna join SQ2

#

Think it works actually

#

.
Holy shit. It worked

#

I done a thing with minimal help.

solid ocean
#

question for you all

#

how do i force a face onto a player slot

#

i.e.

ebon citrus
#

so satisfying getting back into extDB3

solid ocean
bitter jewel
#

all the ai in my group seem to be stuck, they wont move or change pose regardless of what i command them to do, they will just rotate around. can i somehow "reset" their ai?

hallow mortar
granite sky
#

@bitter jewel That sounds like disableAI "PATH".

#

Unless your entire group is somehow in a building that they don't know how to path through.

bitter jewel
#

there might be something wrong with the map actually

#

its a custom made map

tough parrot
solid ocean
bitter bough
#

[cargo1 addAction ["<t color='#FF0000'>Standard Issue</t>"]];
Might be bad at reading documentation, or could just be a moron
basically just making it so that cargo1 (variable name for cargo container) will have a simple addAction to identify it.
Where'd I go wrong?

Figured it out, apparently you have to have the final element included facepalm

ebon citrus
bitter bough
#

Ah, yes, reading
Helps if I do that more
Thanks!

open fractal
#
cargo1 addAction ["<t color='#FF0000'>Standard Issue</t>",{}];
#

the [] brackets have a specific use in sqf

bitter bough
#

Cause I was being dumb and kept testing various things. Now that I've learned exactly what it's supposed to do I've fixed it on my end

bitter bough
#

Alright, so now my next task is with event handlers which, I'll be honest, I've never messed with.
Using HandleScore
I should be able to run a small script each time a player's score increases correct?

open fractal
bitter bough
open fractal
#

dedicated box
that's not relevant, server is the machine hosting the mission regardless of whether it's dedicated or not

#

When you're scripting for multiplayer executing on the server just means the script is running on the host/dedicated server's end

bitter bough
#

Ah, right, I forget that with locality and whatnot

pseudo chasm
#

So I have text fields a player has to fill out, how can I convert those text fields into something like:

CAS, this is <player name>, standby for 6-line.
My position <player grid>.
Direction to target <bearing>.
Distance to target from my position <distance>.
Target description <description>
Mark type <mark type>.
Additional info <remarks>
pseudo chasm
open fractal
#

this will generate a string using variables if that's what you're looking for

pseudo chasm
#

for the

player, side player

im not sure what to replace that with

open fractal
ebon citrus
#

Actually, it seems format takes anything as input

#

So go wild

ebon citrus
open fractal
#

I'd just make a local function to create a structured text (for line breaks, maybe color coding as well) string with format and then remotexec hint

#

that seems like it'd be the least fuss

#

oh looks like you can just use \n for line breaks without structured text

#

even better

ebon citrus
#

Hate that bing sound

open fractal
#

i like the funny little sound

#

sue me

ebon citrus
#

I will

pseudo chasm
#

Sorry for the delay. testing now

ebon citrus
#

More accurately

"the use of weapons (...) of such a nature as to cause superfluous injury or unnecessary suffering is prohibited"```
pseudo chasm
pseudo chasm
ebon citrus
#

Dont jsut paste code wherever

pseudo chasm
#

Am confused

ebon citrus
pseudo chasm
#

Theyre in a dialog, yes.

ebon citrus
#

Then get the idc

#

And slap it where you have the idc#

pseudo chasm
#

then that was right

ebon citrus
#

And make sure this script executes when the dialog is still active

#

If you locse the dialog and then run the script, you will cause a big booboo

pseudo chasm
#

Can you show me an example, because i'm not understanding

ebon citrus
ebon citrus
#

I am in bed, it is 6am and i am tired

#

Just bind it as an action to a button or something

pseudo chasm
#

So i'm trying to do this with onButtonClick = so what am I using after that to display it in a hint?

ebon citrus
#

The idc is the idc you define the controls with

ebon citrus
pseudo chasm
#

That's where i'm stuck

open fractal
pseudo chasm
ebon citrus
pseudo chasm
open fractal
#

how are you making the dialog

pseudo chasm
#

in a dialog.hpp file

open fractal
#

can't you tell it to call a function in that config?

#

i dont know gui stuff

pseudo chasm
#

idk i havent used sqf in 4 years

pseudo chasm
#

still confused- if not more

ebon citrus
#

Notice that if you assign your events in script, the "on" part of the EH name is left out

ebon citrus
#

The biki is the bible

#

It goves youa full example

#

Study it

#

πŸ’

pseudo chasm
#

For keystrokes, yeah

ebon citrus
#

Monkey it

pseudo chasm
#

I'm not trying to do aynthing with keystrokes

#

onButtonClick = ???????????

ebon citrus
#

Read the docs

#
The event property value (string) is executed as a line of code. 
An example line (this would be put within a control or dialog class): 

onMouseDown = "hint str _this"; 
#

Try it

#

You can only fail so hard

#

Modding Arma is like a roquelite

pseudo chasm
#

Limited time.

ebon citrus
#

You hit your head against the wall until one or the other breaks

ebon citrus
pseudo chasm
#

so it would be

onButtonClick = "TEXT _dialogClass TEXT _dialogClass2"
```?
ebon citrus
pseudo chasm
#

i'm fucking trying ok lol

ebon citrus
#

And im sweating

#

Give me the idc's of your controls

pseudo chasm
#

100-106

ebon citrus
#

That's 7 numbers

#

I want 2

pseudo chasm
#

100 101

ebon citrus
#
onButtonClick = 
"
private _txt = format ["CAS, this is %1, standby for 6-line. My position %2.", ctrlText 100, ctrlText 101];
hintSilent _txt;
";
#

Have fun

pseudo chasm
#

._. I was close though

ebon citrus
pseudo chasm
#

_ encountered instead of =

ebon citrus
#

It needs to be one-line

#

No linefeeds

#

Im not doing that on the phone

#

Fix it yourself

pseudo chasm
#

I put it on one line and same error

#
onButtonClick = "private _txt = format ["CAS, this is %1, standby for 6-line. My position %2.", ctrlText 100, ctrlText 101]; hintSilent _txt;";
ebon citrus
#

Please read your code

pseudo chasm
#

lmao

#

after fixing that same error

warm hedge
#

You cannot use " in "

#

Also wut why you put two onButtonClick

ebon citrus
#

Oh yeah

#

Double quotes

#
onButtonClick = 
"
private _txt = format ['CAS, this is %1, standby for 6-line. My position %2.', ctrlText 100, ctrlText 101];
hintSilent _txt;
";
warm hedge
#

String in string must be done by different quotation mark

ebon citrus
#

Or double quotes

#

"string ""in"" string"

warm hedge
#

Shouldn't we call double double quotes? meowsweats

ebon citrus
#

But i prefer inverted comma or whatever you call it

pseudo chasm
#

omg I did it all by myself

#

thank you @ebon citrus

ebon citrus
still forum
#

Quadro quotes

#

Nvidia Quadro Quotes 12090 Ti

wet shadow
#

So a question concerning manipulating a curator module. My aim is to have a curator who cannot place down any units but is free to move curator camera around the map. Should be simple enough enough with the following commands (omitting other restrictions for the sake of brevity):

_module addCuratorEditingArea [4,[0,0,0],0];
    _module addCuratorCameraArea [11,[worldSize/2, worldSize/2,0],worldSize];

My current problem is that while this allows 'flying around' with the curator camera in 3d world without any restrictions, (using middle mouse click) setting curator camera position via the map screen seems to be governed by the editing area.

Is this WAD, am I missing something and/or has anyone tried any workarounds?

nocturne garden
#

Hi guys, i have a string from a config file which has parentheses in it, how can i get rid of them?

#

the string looks like _str = '"test"'

still forum
#

Just checked this.
That can only happen if a player goes back to role selection, and then joins back into the game. He will rejoin with the same ID
But he will also stay the same player

hallow mortar
vague geode
#

I found the following in my logs a couple of time but everything is seemingly still working just fine. Does anyone have an idea what this log-entry could mean and how I could avoid whatever is causing it?

2022/03/30, 17:29:03  βž₯ Context: Trigger "OnActivate" name "1707947: <no shape>" at [12700.000000,8.379982,3300.000000]

Thanks in advance.

granite sky
#

You need the lines before that. That's just the context, not the actual error.

quick peak
#

hey is it possible to make something like deep snow or something? what i mean is lowering lower body parts animation speed an, maybe, lowering player model a bit into ground? but thats not possible i think

west grove
#

nop

#

if one wants to go very hacky, it might be possible to read current surface texture and then replace animations. but i doubt this is going to look nice

quick peak
#

i mean i was thinking about setAnimSpeedCoef if player is not on the road or building

#

not perfect solution but should work

livid wraith
#

how would one get the player unit based on remoteExecutedOwner, if even possible ?

might be easier to just supply that with the RE ?

copper raven
#

might be easier to just supply that with the RE ?
if you can do that, then yes

#

otherwise, yes it is possible, but only on the server machine, or well, on clients too, but it would add overhead etc

livid wraith
#

this will execute on server, yes, and not a big issue supplying the calling unit ....

but for prosperity, how would you translate machineId to a the player unit that made the call ?

granite sky
#

allPlayers + clientOwner, search

night grove
#

Is there a way to set what a curator (zeus) has selected? We have curatorSelected to retrieve the current selection but is there a way to select something?

granite sky
#

There's an event handler, curatorSelectedChanged.

#

err, curatorGroupSelectionChanged and curatorObjectSelectionChanged

#

Ah never mind, need more sleep.

ebon citrus
#

Holy phuck, does anyone know extdb3 here?

#

ok, so i have an sql command which WORKS as an sql command if i query it directly, but extdb3 just tells me it's invalid

pseudo chasm
#

So if i'm trying to get a players grid number and bearing, how would i get it to display in a text field? I currently have:

onButtonClick = "ctrlSetText [101, PlayerGridNumber player];";
pseudo chasm
ebon citrus
pseudo chasm
#

Awesome thank youuu

ebon citrus
#

no worries

#

why is regexReplace weird?

#
'"' regexReplace ['"', '""'];```
returns 
```""""""```
#

makes no sense

#
'1' regexReplace ['1', '11'];```
returns
```"11"```
#

so like this

'"' regexReplace ['."', '""'];```
ebon citrus
#

ok, so i run sqf '"strong"' regexReplace ['"', '""'];
and i expect
""strong""
but i get """""strong"""""

#

heh

#

so the solution is

'"strong"' regexReplace ['"', '"'];```
#

that makes no sense what so ever... but ok

#

never mind, it's Advanced developer tools

#

that's causing the weird results

fair drum
ebon citrus
sudden yacht
#

How can remote Exec and teleport all players to a specific object that has a variable name? "LocationOne'? How is that formated?

fair drum
fair drum
sudden yacht
#

TY

tough abyss
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
tough abyss
#

wasnt directed at anyone just trying something

ashen hawk
#

hi all, i've been struggling with this for a bit now, but how do I execute a code that works in MP when you put a pistol in a crate?

#

i'd like to have an effect that detects the one desired pistol and then executes the code

mortal saffron
#

can someone help me to create a lock vehicle script to stop a west player from entering an east vehicle, so far the folowing works in the editor but is unreliable when on a dedicated server.

#

this addEventHandler ["GetIn", { _unit = _this select 2; if (side _unit != west) then { _veh = _this select 0; _fuel = fuel _veh; _veh setFuel 0; _unit action ["eject", _veh]; [_unit,_veh,_fuel] spawn { waitUntil {sleep 1; vehicle (_this select 0) == (_this select 0)}; (_this select 1) setFuel (_this select 2); }; }; };];

#

I have placed this in the vehicle init and its unreliable

little raptor
little raptor
still forum
still forum
tough abyss
#

ive asked this before but had a hard disk failure with my script folder on it what is the command to find positions on a normal infantry person like eyepos etc?

pulsar bluff
#

selectionPosition

tough abyss
#

thanks and also thank you for making invade and annex

lime frigate
#

So I'm trying to add an action to a supply box created by the SupportProvider_Virtual_Drop module to open ACE Arsenal for a mission that is running on a dedicated server. The support modules all seem to be working, I can call in a supply drop and have it land where I call it etc. However, when trying to implement the code provided below in the Crate init: field, the supply drop doesn't have the added action.

{_this addAction["<t color='#FFFFFF'>Open Ace Arsenal</t>"} [arsenalBase, player] call ace_arsenal_fnc_openBox},nil,10,true,false];} remoteExec ["call", -2];

I have a supply box with the ACE arsenal items I want to be made available called arsenalBase which is being accessed by the action put onto other items using the above code. I'm confident the code should work as intended as I have a second supply box called testBase, and using advanced developer tools (linked below) whilst in the mission on the server, I can run the above code with testBase instead of _this and it adds the action which allows the player to open ACE arsenal with the items present in arsenalBase available to them. However, putting the code into the Crate init: field with _this instead, the supply drop doesn't have the action.

https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168&searchtext=advanced+developer

Additionally, to ensure that the Crate init: field is being called, I have tried using the below code instead which worked fine and as intended, removing all items from the crate.

clearWeaponCargoGlobal _this;
clearMagazineCargoGlobal _this;
clearItemCargoGlobal _this;
clearBackpackCargoGlobal _this;

I know that the addAction command is usually ignored on dedicated servers, however I'm attempting to use remoteExec to execute the code, the -2 flag indicating that it should be run on all client machines but not the server. And again, this works fine on testBase when using the advanced developer tools on the dedicated server with other people also being able to see and use the action.

Any advice is appreciated. πŸ™‚

little raptor
#

don't remoteExec "call". Just remoteExec "addAction"

#

Or if you want to remoteExec call, you must use the binary syntax and pass the box as argument (_this)

#

But that's slow and not recommended

lime frigate
# little raptor _this is not defined

I may be misunderstanding your meaning but in the editor, the tooltip for the Crate init: field states Code executed upon crate spawn (affected crate: _this). and again the codes to clear the inventory which also reference _this all work.

little raptor
lime frigate
little raptor
#

You've put it in a code

#

It's not "processed" anymore

#

Except where the code is executed, which is not "there"

lime frigate
#

that's fair, sorry I'm kinda new to this and at this point have spent over 20 hours trying to feel my way through the dark debugging this aha

little raptor
#

See the pinned messages for examples

#

There's one for addAction

lime frigate
#

so would I be able to just get rid of the _this, or do I need to somehow assign the crate a variable name when it's created, which I then use to refer to it in the script being remotely executed?

little raptor
#
[_this, ["<t color='#FFFFFF'>Open Ace Arsenal</t>", { [arsenalBase, player] call ace_arsenal_fnc_openBox},nil,10,true,false]] remoteExec ["addAction", -2];
#

Took me forever to type... meowsweats

#

Also your brackets were wrong as I just noticed...

lime frigate
#

absolute king shit thank you aha

#

holy shit it worked, thank you so much πŸ˜„ I appreciate it, and the time you took, thanks!

fleet sand
#

Hi guys so i am messing with a wind a bit in arma 3 with Ace mod on and this is the script that i have for just showing the direction of the wind.

[] spawn {
    _arrow = createVehicle["Sign_Arrow_Direction_F", position player];
    while {true} do {
    _arrow setDir windDir;
    sleep 0.01;
    };
};``` But as soon i try to change direction of a wind with SetWindDir the wind just resets to initial position. Also when i am trying to change wind direction in zeus also resets to initial position is there any reason why is this happening ?
coarse dragon
#

Is there a code to get Aircraft to fly at a fixed altitude for a low flying flypast?

coarse dragon
#

Thank you kindly

fleet sand
little raptor
#

Also afaik you also need forceWeather or whatever it was called

little raptor
fleet sand
# little raptor Use setWind instead

setwind[100,10,false];
forceWeatherChange; i am executing this arrow changes direction for a second and returns back to initail position again.

little raptor
ebon citrus
fleet sand
little raptor
#

Mods such as ace change the weather themselves

fleet sand
granite sky
#

Is this problem specific to running with a DS or could you also replicate in localhost and/or SP?

little raptor
ebon citrus
little raptor
#

That prints the actual string

#

I show the stringified string
That's why there are more quotes

ebon citrus
#

It's going to be missing the outer msot quotes

ebon citrus
#

How is that "stringified"

#

That's inconsistent behaviour

little raptor
granite sky
#

" escapes to "", + outer quotes, I guess

#

So "" -> """"""

ebon citrus
#

Right, so it clnverts the single quotes to double quotes to escape the single quotes

#

I'd rather it didnt, but that makes it fair

#

My opinion doesnt matter

winter rose
#

same between hint "test", will display test
but "test" in debug console will output "test" πŸ™‚

little raptor
#

If it's different from mine I'll fix it

#

Otherwise it's not related to my mod

ebon citrus
#

It probably is, i dont use the vanilla debug console because Advanced developer tools is arquably better

#

I wish it didnt stringify strings, is all im saying

#

But only for this very minor small thing

little raptor
ebon citrus
#

Maybe a tick box to enable/disable stringify the tesult

little raptor
#

It removes the outer ""

ebon citrus
#

Give me a sec, i'll take a look at this

#

Yeah, youre right

#

Looks reasonable for the task

#

I'll need to test it in-game but it looks fine

#

Wait... how come it needs to escape double double quotes when stringifying?

#

Shouldnt """strong""" be correct already?

#

Like display that instead?

#

If my string is ""strong""

#

Then shouodnt it be fine to just clap quotes around that?

granite sky
#

nah, because that would print as "strong" if you put quotes around it.

ebon citrus
#

I'm probably having a small brain moment here, but i dont see how that's in any way relevant

#

It shouldnt matter what it prints as

#

The data structure should be retained if possible

#

And it should be possible

#

I dont get it

#

Well, it is what it is

granite sky
#

It's a reversible conversion, right. Stringify: Escape everything that needs escaping, then add double quotes. De-stringify: Remove double quotes and then de-escape.

still forum
#

if you write _var = """test"""
Then _var will contain the string "test"

ebon citrus
still forum
#

so they are correctly turned back when you do _var = """test"""

little raptor
ebon citrus
#

Im not critizising ADT, im just wondering why they need to be escaped agaim

#

Despite being already escaped

little raptor
#

I know. I'm trying to explain the escaping
If you don't escape them, the string will become "unclosed". You can write it out in a text editor that supports syntax highlighting and see what happens

granite sky
#

Consider that someone might actually want to have a double quote inside a string for some goddamned reason :P

granite sky
#

And you want stringify + de-stringify to preserve that.

ebon citrus
#

Regularly need it for the nightmare that is the loadout array

#

Nah, i wanted to edit all the single double wuotes to double double quotes

#

And i got confused by the results given by the debug console

#

Since they dont match what i was getting as output from the extdb3 log and diag log

granite sky
#

I mean if someone wanted to preserve a double double quote.

ebon citrus
#

Then it would become a triple double quote

#

It you stringify it

#

I dont understand whya double double quote becomes a quadrupple double quote

granite sky
#

because escaping is per-character.

ebon citrus
#

I dont get it

#

From both software standpoint and infirmational value, this seems like a load of unnecessary bs to me. But it is what it is. I dont need to dwell into it further

cold pebble
#

Quick question for anyone

#

If I:

[localize "STR_DT_Group_Disbanded"] remoteExecCall ["hint",_group];

Thats gonna localize it to whoever is sending the message, not to the person receiving?

patent lava
#

Most likely πŸ‘€

winter rose
#

the localize will happen on the sender's machine

cold pebble
#

Surely then its yes to the question, but answers it either way πŸ˜›

#

So I have to make a function just to localise a hint on a receivers machine, yey

winter rose
fair drum
wet geode
#

Is there a way to attach stuff to a heli with the AI still being able to fly it?

fluid wolf
#

should still be able to use Attachto, no?

#

or does that break the AI's ability to see pathing

calm charm
#

Anyone an idea for making street names? Like you drive through the city and get an info "you are now on road ..."

winter rose
kindred zephyr
steel fox
wet geode
steel fox
#

Ah. I assumed you were attaching a small object or something. What are you trying to attach?

granite sky
#

hideObject might work but not necessarily useful.

#

disableSimulation maybe worth trying

#

but they're probably doing a raycast at the ground and I don't think that'd care about disableSimulation.

calm charm
coarse dragon
#

hey umm

#

[bomber, BLU-1/B 750lb Napalm, 6] call VN_ms_fnc_dropOrdnance

#

any tips on fixing?

ashen hawk
open fractal
coarse dragon
#

fixed it

#

[bomber, BLU-1/B750lbNapalm, 6] call VN_ms_fnc_dropOrdnance;

open fractal
#

well no

coarse dragon
#

but it works

open fractal
coarse dragon
#

tested it works great

open fractal
#

do you have a link to the docs for that function

coarse dragon
#

no someone gave me it

open fractal
#

I don’t understand how that works without quotes

coarse dragon
#

[]?

open fractal
#

no I’m confused why the second argument works

coarse dragon
#

turns out it doesnt drop the bombs from the jet. they just appear in a nice line lol

open fractal
#

Oh well there it is

open fractal
coarse dragon
#

still need a jet tho

open fractal
#

Wait it drops the right bomb?

coarse dragon
#

yea napalm

#

6 of them

#

the jet poops them out, but looks like it doesnt use its own bombs

open fractal
#

that’s probably what the function is for

#

you don’t need a SOGPF function to have a jet drop its own bombs

coarse dragon
#

well its easy so im happy lol

granite sky
#

Function probably has a default, so it does the same thing as [bomber, nil, 6]

#

Although I'm a bit surprised SQF gets past the / without dying :P

coarse dragon
#

Well I tried it with 100 bombs and it worked aswell lol

open fractal
#

which is the only thing that makes sense here in my mind

#

if you don’t put quotes around the classname it’s an undefined variable

coarse dragon
#

Na I tried napalm and a jet with daisy cutters aswell

open fractal
#

Have you tried something that’s not napalm

#

what happens if you just write nil

open fractal
#

I’ll bet it’ll still be napalm

hollow thistle
#

Default is snake eyes or napalm, randomly selected.

coarse dragon
#

Just looked like bombs. But haven't used snake eyes so dunno what it looks like

hollow thistle
#

And yeah, no way BLU-1/B750lbNapalm works as expected.

#

It's basicaly variable BLU minus 1 divided by variable B750lbNapalm

#

so... nil

coarse dragon
#

Must have got lucky with it selecting napalm my 1st try lol

hollow thistle
#
[bomber, ["vn_bomb_500_blu1b_fb_ammo"], 6] call vn_ms_fnc_dropOrdnance;

should work

coarse dragon
#

yea me copied wrong name for it lol

hollow thistle
#

You also haven't passed it as a string, actually the function expects an array of strings.

coarse dragon
#

hmmm do missles work for that aswell

hollow thistle
#

Not really, it spawns the ammo with downwards velocity.

#

I guess it will work but it's kinda not expected for missiles to shoot straight down.

coarse dragon
#

ah well

hollow thistle
#

That function was quick and lazy attempt to have some sort of reliable bombing. But it does not look very good. blobdoggoshruggoogly

coarse dragon
#

i think its fine for bombs

hollow thistle
#

There's also vn_ms_fnc_casAirstrike

coarse dragon
#

now i dont have to use Unitcapture for all me stuff

hollow thistle
#

which uses that function to bomb stuff but it spawns the plane for you.

coarse dragon
#

oh my

#

wait where would i put that then if i dont spawn a bomber

hollow thistle
#

Somewhere where you trigger the bombing run. blobdoggoshruggoogly
Depends on how you script your missions, could be trigger, FSM, some scheduled script waiting for something...

coarse dragon
#

oh i just put that code in the jets Move waypoint lol

#

Thanks for the Help AF, you have saved me 900 hours of unit capture lol

hollow thistle
#

AF is just my clan tag, lol. You're welcome.

coarse dragon
#

How big does Movedata in Unit capture need to be before it could cause problems?

#

πŸ€”

distant oyster
#

the first limt that comes to mind is the 10,000,000 elements limit

#

for an arma array

open fractal
#

I think you'll only have issues if you try to call the function globally

coarse dragon
#

1,456 KB is the size

#

of the file

open fractal
#

I think the largest unitcapture array I've had was 500 KB but that worked just fine

#

what are you doing to require that much data?

#

also, are you 100% certain you are only calling the function server-side?

coarse dragon
#

A long ass helicopter ride

open fractal
#

is there anything special happening beyond take-off and landing?

#

because you can, for example, have the ai fly itself for a while and then have unitplay take over

#

not that it's strictly necessary, it'll just save you some time getting the unitcapture right

#

and cut down on the file size

coarse dragon
#

Hmm I don't trust the AI

severe ravine
#

Can anyone give me tips on how to find the paths for playing sounds? I want to play a built in sound from Arma from here:

C:\Program Files (x86)\Steam\steamapps\common\Arma 3\Addons\sounds_f_characters.pbo\human-sfx\P02\Breath_Aiming_1.wss

I'm calling it with:

playSound3D ["A3\sounds_f_characters\human-sfx\P02\Breath_Aiming_1.wss", player]

I get the error that it cannot find the sound file. I've tried the examples from the wiki and they fail the same way.

open fractal
#

oh my bad

#

you did

#

no wait

#

you did not

severe ravine
#

Typo on my part, yes I did it without .pbo and without .wss

#

Well I tried it with and without to be honest

#

I also tried @A3 for the start

open fractal
#

I've tried the examples from the wiki and they fail the same way.
do you have an example

severe ravine
#

Sure, I can get a screen capture of my test trigger and the error

distant oyster
#

the PBOPREFIX determines the path of the addon

open fractal
#

just slapped that in the console and that works for me