#arma3_scripting

1 messages ยท Page 613 of 1

fair drum
#

help.. is there a way to login as admin if all the chat channels are disabled and i dont have the debug console because im not admin?

thin owl
#

go to lobby

#

pretty sure that works

peak plover
#

@thin owl Cameraview changes AFTER reaching the scope zoom.
I need to determine when the player has stareted to attempt to ADS.

Cameraview changes too late.

short flame
#

i "updated" an existing mod to use backpacks of another mod and want to know if i can use an if() so that these bagpacks are only visible when the mod is installed

#

@young current

young current
#

no

#

what does "updated" mean?

digital jacinth
#

@peak plover intercept the mouse / key press

short flame
#

ad the extra textures for the backpack
@young current

digital jacinth
#

CBA has an event for cameraView changes. but that is too late you just stated

peak plover
#

@digital jacinth How to know all the keybinds for ADS?

#

Is there a way to determine when an action is used like ADS or such?

digital jacinth
#

I am unsure how to retrieve base game set buttons in sqf

peak plover
#

Okay, thanks , I will give it a go

digital jacinth
tame portal
#

every frame, however my solution already sounds like the way worse option :P

#

Getting the bound keys and using a keypressed handler is the best solution

digital jacinth
#

the action names for it are
optics
opticsTemp

peak plover
#

Okay, thank you fellow gamers

short flame
#

i "updated" an existing mod to use backpacks of another mod and want to know if i can use an if() so that these bagpacks are only visible when the mod is installed
@young current is it possible to make this if then in a .sqf and overwrite the scope of an config.cpp class

pliant stream
#

actionKeys won't give you mouse though will it?

digital jacinth
#

nope. that is why i suggested actionKeysNames, as it might return which buttons it is bound to. No other idea how to get vanilla keybinds

versed belfry
#

anyone knows if there is a script to stop NVGs from working even when the players are wearing it? like they are wearing it but it just won't work.

young current
#

@short flame no

#

why not just run the mission so that both mods need to be run together?

#

keep it simple

short flame
#

yeah i always think complicated

sonic thicket
#

Hey everyone, Being as confused as I am I came here in search of help for the following problem;

I have a onPlayerRespawn.sqf & the following line in my description.ext;
respawnOnStart = 0;

Within the onPlayerRespawn.sqf I have;
systemchat "hey";

I have completely shut down arma and started it up again to be absolutely sure it loaded description.ext properly. And it still returns absolutely nothing.
What is going on here?

sonic thicket
#

Hmm well it works in my main world so guess its fine

fair drum
#

any way to keep AI from shooting at aircraft with small arms?

#

@sonic thicket did you recently edit description.ext and not fully back out and then try? it only loads if you preview from the editor itself, not if you just click restart or something

sonic thicket
#

I did a full exit, usually re-loading the scenario is enough though

#

it looks quite cool

#

Well, except for the error I just got upon walking in the actual radiated zone

#

And i messed up putting stuff from another scripting luangage there. all fixed and working now ๐Ÿ˜„

fair drum
#

those custom icons?

sonic thicket
#

Yeah, as shown in the image.png i shared with the link ( Cant share screens here, which is understandable)

fair drum
#

they look good

sonic thicket
#

spend a full day making those ๐Ÿ™‚ I've made them to fit with the vandersons mod

#

or well a full day after work, so couple of hoursa

#

I've used ALIAS radiation script for inspiration and added the icons, made the radiation gradually increase towards the center and also made it so radiation equipment fully protects until you get too close and dependant on how much protection you wear

fair drum
#

if driver returns the driver of a heli, how do i return the copilot?

sonic thicket
digital hollow
#

_heli turretUnit [0]

leaden summit
#

Is there any obvious reason why ```SQF
_unit addMagazine "CUP_200Rnd_TE4_Red_Tracer_556x45_M249";
_unit addWeapon "CUP_lmg_M249_E2";

supple leaf
#

mag is too big and can't fit the vest?

leaden summit
#

Does it have to fit into the vest first?

supple leaf
#

try giving it a large backpack

#

I think there has to be enough space

leaden summit
#

Well that's a pain in the hole when it comes to machinegunners because if it takes it out of the vest then there's a lot of empty space left

#

But no just tried it with plenty of room in the vest and pack and it still loads in empty

supple leaf
#

put it into a crate and try how big it is

#

does it work if inventory is completely empty?

leaden summit
#

I'll give that a shot

#

Nope completely empty uniform, vest and backpack and still ```SQF
_unit addMagazine "CUP_200Rnd_TE4_Red_Tracer_556x45_M249";
_unit addWeapon "CUP_lmg_M249_E2";

#

Ok must be a mag size thing I switched out the classnames for the M240 and it's box mag, still no go but then I swapped it out for an M16 and Stanag and that worked fine

#

Also M249 with 30 round STANAG loaded = works fine

winter rose
#

@leaden summit there is some "add magazine to primary weapon", it could circumvent the issue

leaden summit
#

Trying to find that in the wiki to no avail

winter rose
#

Oh, try maybe linkItem? (after having added the weapon of course)

leaden summit
#

OK got it sorted.
Unlike every other gear script I've used where the weapons come first, if I move those 2 lines to the end then I spawn with ammo loaded

potent dirge
#

Morning fellas. I have a small problem I hope someone can help me with.
I've written a function to force a given helicopter to land at a destination because the "LAND" waypoint just doesn't work.

params ["_helicopter", "_destination"];


_helicopter move (getPos _destination);
[] spawn {sleep 3};

if (alive _helicopter) then { 
    waitUntil {unitReady _helicopter};
    _helicopter land "LAND";    
};

Where _helicopter is any given helicopter-type vehicle and _destination is well where you want it to land.
Unfortunately waitUntil {unitReady _helicopter}; keeps returning a generic error which I don't understand why because if I try running the command in the debug console it runs fine.

#

The helicopter lands fine (surprisingly) but I would like to know what exactly is causing this error

winter rose
#

@potent dirge depending on where your code is called from, suspension (waitUntil, sleep) is not allowed

potent dirge
#

Oh I thought only sleep needed to run in a scheduled environment. So I guess I can put in spawn safely?

#

Somehow placing waitUntil inside spawn breaks the function and causes the heli to take off again after touching down๐Ÿคฆโ€โ™‚๏ธ

spark sun
#

You wrote [] spawn {sleep 3};

potent dirge
#

Is there anything wrong with that?

spark sun
#

Well, the spawn is doing nothing than just sleep 3 second and nothing else

#

You wanted to put the waitUntil inside the spawn statement

potent dirge
#

Yeah I wrapped the waitUntil in a different spawn statement under the if

#

Like this now

_helicopter move (getPos _destination);
[] spawn {sleep 3};


if (alive _helicopter) then { 
    [_helicopter] spawn {waitUntil {unitReady _this}};
    _helicopter land "LAND";
};
#

Or is this better:

_helicopter move (getPos _destination);
[_helicopter] spawn {
    sleep 3;
    waitUntil {unitReady _this};
};


if (alive _helicopter) then { 
    _helicopter land "LAND";
};
spark sun
#

watchout spawn don't wait for the code inside the spawn statement

potent dirge
#

Oh thanks for the heads up, maybe that's what's breaking the function

spark sun
#
[_helicopter] spawn {
    params ["_helicopter"];
    sleep 3;
    if (alive _helicopter) then { 
        waitUntil {unitReady _helicopter};
        _helicopter land "LAND";    
    };
};

potent dirge
#

I think this might be better. Wonderful

spark sun
#

the code now spawn a "tread" then wait for 3s, check if the heli is alive, waituntil the heli is realldy and order land. All those step are done in the order you want

potent dirge
#

Thanks a lot, you just saved me a few hours of rigorous head-scratching

winter rose
#

indeed - spawn is creating a "parallel" script that knows nothing of the first one
you are in good hands I see! ๐Ÿ‘

potent dirge
#

Just tested and works like a charm blobcloseenjoy

vague geode
#

I need help with a big project. I am trying to save player scores not only beyond a mission or server restart but also add them up to get the total score each player has achieved on the server to give them ranks according to it.

I figured the only way to do it is to have one database with the total player score and one with the current resp. last player scores. The database with the last player scores would save the current score of every player in the mission every 15 minutes or so and whenever someone disconnects and on mission start all scores from that last player scores database would be added to the total player scores database and then the last player scores database would be completely wiped for the starting mission. I figured that that was the best way to prevent any miscalculations or problems in case the server should ever crash or something like that.

Maybe someone that has worked with those Arma databases alot could send me a basic code structure and I could fill in the details...

winter rose
#

if you trust your players, you could always store their info in their own profile, but a tricky player could edit that

#

(also, if they lose their local profile they start from scratch)

no db xp on my side though

austere granite
#

Then you could "database" hoewver the hell you want, either using actual DB, or just using simple jsons or whatever

vague geode
#

Is there an easy way to find out whether or not someone has a toolkit with them?

thin owl
#

if ("ToolKit" in _items) then {

// script

};```
#

might be an old one tho

vague geode
#

@thin owl Nope, still works. Thanks alot.

fair drum
#

Keep in mind that in is case sensitive

vague geode
#

Two more questions:

  1. Is there a way to enable players to carry their incapacitated comrades to safety?
  2. Does anyone know some welding animation that I could use to "disassemble" Czech hedgehogs and how could I implement it?
fair drum
#

You using Ace at all?

vague geode
#

Not sure what you mean but I am not using any mods.

versed belfry
#

Is there a way to stop a sound from playing after executing this script?:

[N1, player] say3D ["Nuke", 500];
#

couldn't find anything to do so

earnest storm
#

Het I was wondering if any one had a base Config for making a vest. Like a template?

warm hedge
#

Just realized the channel topic:

IF (script == true) THEN {chat here};
๐Ÿ”จ(for now)

earnest storm
#

Thx

vague geode
#

@winter rose Do you think this would work if I put it into the initServer.sqf?

playerScores_database = ["#PLAYERS",[]];
totalPlayerScores_database = ["#PLAYERS",[]];

_playerScores_database = profileNamespace getVariable "playerScores_database";
_totalPlayerScores_database = profileNamespace getVariable "totalPlayerScores_database";

if (!isNil _totalPlayerScores_database) then {
    totalPlayerScores_database = _totalPlayerScores_database;
};

if (!isNil _playerScores_database) then {
    playerScores_database = _playerScores_database;

    classes_playerScores_database = [playerScores_database, ["players"]] call BIS_fnc_dbClassList;

    _lastScore = 0;
    _oldScore = 0;
    _newScore = 0;

    {
        if !([totalPlayerScores_database, ["players",_x]] call BIS_fnc_dbClassCheck) then {
            [totalPlayerScores_database, ["players", _x], ["&SCORE", 0]] call BIS_fnc_dbClassSet;
        };
    
        _lastScore = [playerScores_database, ["players",_x,"score"], 0] call BIS_fnc_dbValueReturn;
        _oldScore = [totalPlayerScores_database, ["players",_x,"score"], 0] call BIS_fnc_dbValueReturn;
        _newScore = _oldScore + _lastScore;

        _null = [totalPlayerScores_database, ["players",_x,"score"], _newScore] call BIS_fnc_dbValueSet;

        _lastScore = 0;
        _oldScore = 0;
        _newScore = 0;
    } forEach classes_playerScores_database;
};

playerScores_database = ["#PLAYERS",[]];

addMissionEventHandler ["HandleDisconnect", {
    params ["_unit", "_id", "_uid", "_name"];

    _null = [playerScores_database, ["players",_uid,"score"], (score _unit)] call BIS_fnc_dbValueSet;
    true;
}];```
versed belfry
#

welp actually found the way to do so, if anyone is intersted just delete the object that the Say3D sound is coming from by

deleteVehicle N1;
winter rose
#

@vague geode perhaps

vague geode
#

@winter rose perhaps?! ๐Ÿคจ

winter rose
#

๐Ÿฎ Perhaps

#

@vague geode won't work, HandleDisconnect is server-side only

#

for the rest, I let you script however you want
don't forget to save the profile as well

vague geode
#

@winter rose I know that HandleDisconnect is only server-side. The code I sent is meant to be in the initServer.sqf so it would be executed server-side, wouldn't it?

My intention is to save the scores on the server itself that way making it harder for players to temper with them.

winter rose
#

oh, my bad, I didn't process the whole message at once

#

then yes, should work (save the server's profile as well)

vague geode
#

@winter rose Like this?

playerScores_database = ["#PLAYERS",[]];
totalPlayerScores_database = ["#PLAYERS",[]];

_playerScores_database = profileNamespace getVariable "playerScores_database";
_totalPlayerScores_database = profileNamespace getVariable "totalPlayerScores_database";

/* here is where the magic happens */

playerScores_database = ["#PLAYERS",[]];

profileNamespace setVariable ["totalPlayerScores_database", totalPlayerScores_database];
profileNamespace setVariable ["playerScores_database", playerScores_database];

saveProfileNamespace;


addMissionEventHandler ["HandleDisconnect", {
    params ["_unit", "_id", "_uid", "_name"];

    _null = [playerScores_database, ["players",_uid,"score"], (score _unit)] call BIS_fnc_dbValueSet;

    profileNamespace setVariable ["playerScores_database", playerScores_database];
    saveProfileNamespace;

    true;
}];```
winter rose
#

don't post your whole code every time ๐Ÿ˜…

but save to profileNamespace in a MissionName_playerScores variable, use saveProfileNamespace when you change data, that's it

vague geode
#

@winter rose Like this?

playerScores_database = ["#PLAYERS",[]];
totalPlayerScores_database = ["#PLAYERS",[]];

_playerScores_database = profileNamespace getVariable "WL_custom_playerScores_database";
_totalPlayerScores_database = profileNamespace getVariable "WL_custom_totalPlayerScores_database";

/* here is where the magic happens */

playerScores_database = ["#PLAYERS",[]];

profileNamespace setVariable ["WL_custom_totalPlayerScores_database", totalPlayerScores_database];
profileNamespace setVariable ["WL_custom_playerScores_database", playerScores_database];

saveProfileNamespace;


addMissionEventHandler ["HandleDisconnect", {
    params ["_unit", "_id", "_uid", "_name"];

    _null = [playerScores_database, ["players",_uid,"score"], (score _unit)] call BIS_fnc_dbValueSet;

    profileNamespace setVariable ["WL_custom_playerScores_database", playerScores_database];
    saveProfileNamespace;

    true;
}];```

Or can I use `briefingName` in the variable name somehow?

Also which would you advise me to use to change the players' ranks:
A: `player setRank "COLONEL";`
B: `player setUnitRank "COLONEL";`
C: `[ vehicle player, "Colonel" ] call BIS_fnc_setRank;` (also is this one global?)
topaz field
#

Does anyone have any know of any particular mods interfering with scripts executing themselves? EG I am trying to execute "camera.sqs" & "intro.sqs" (yes I know they are old and obsolete) with a set of mods (RHS, CUP and a few others) and it wont load both of the two actions. But when I recreate the environment in vanilla it works hands down like a charm.

#

Any ideas?

exotic flax
#

Waituntil is afaik the only solid method (combined with CBA XEH postInit)

#

Unless you force a respawn through the respawn framework and use the Respawn EH

winter rose
#
time > 1

there is also a getClientState @tough abyss

#

maybe a waitUntil not isNull findDisplay 46, but I can't guarantee it

#

you will have to, eventually

vague geode
winter rose
copper raven
#

lots of things, cba_fnc_waitUntilAndExecute, displayload XEH etc

oblique lagoon
#

Can we inherit rsc~~~ in main config file?

#

like rscMap

winter rose
#

@tough abyss or don't use init fields in MP ๐Ÿ™‚

thin owl
#

Anyone know of a good Slot Whitelisting script? I wanna whitelist Bluefor slots to certain UIDs

oblique lagoon
vague geode
#

Is it possible to put some kind of progress bar into a diary record?

winter rose
#

more or less yes, iirc you can edit them now

vague geode
#

Yeah, I knew that but if it possible to put a progress bar into it?

coarse willow
#

so I'm setting up a rifle range using pop up targets and need to to reset them as needed after they are shot. I have googled a bunch and see some old videos. the newest option is global reset. My desire is to have the ability to bring targets back up on one range as a separate range is being use.

winter rose
#

edit it little by little - with an image for example @vague geode but there is no native progress bar

vague geode
#

Ok, thanks anyways. Also I tried to put in an image once but it didn't work for some reason...

coarse willow
potent dirge
#

Evening fellas. When nesting forEach, and you want to refer to the _x from the bigger forEach is assigning a local var to that _x a wise way of doing so?

finite sail
#

thats how I do it @potent dirge

potent dirge
#

Thanks for the feedback guys. Enjoy your evening

finite sail
#

๐Ÿ™‚

#

๐Ÿป

thorn saffron
#

Is there any way to catch changes to squad composition (units join and leave), without having a loop that constantly checks it?

high marsh
#

@potent dirge you mean like this?

{
    firstOne = _x;
    {
        hint firstOne;
    } forEach ["Blaaaaah","Blaaaaaaa"];
} forEach ["Blah","Blahblah"];
crude needle
#

@thorn saffron Nope.

potent dirge
#

EH?

#

@high marsh yeah, I knew it was possible I just wanted to know if it was a good way of doing so

high marsh
#

๐Ÿ‘

potent dirge
#

Is it possible to get the side a class belongs to

winter rose
#

you can at least easily find its faction

#

what is the use case @potent dirge?

potent dirge
#

I'm trying to create a small QRF function using BIS_fnc_spawnGroup

winter rose
potent dirge
#

Thanks

#

Interesting, even though I gave the class names wrapped in quotes it still returned the correct side albeit with an error

winter rose
#

ah no, it's an object it is expecting, not a classname

#

and "east" might be the default return value too ๐Ÿ™ƒ

potent dirge
#

Yeah I figured that out, I'm just surprised it was still able to return the correct value

winter rose
#

yeah, input errors make Functions magic happen ๐Ÿ˜

potent dirge
#

Yeah I think I'll use configProperties for that instead. Now all I need is a neat way to get the path to said config

winter rose
#

getNumber*

potent dirge
#

Sorry I meant class name not config

winter rose
#

that's exactly it @tough abyss

potent dirge
#

Thanks this is much simpler than sifting through the entire config class for one value

thorn saffron
#

Is it possible to get a list of all event handlers that are applied to a unit?
I have an AI revive script that works pretty well, except for Warlords, where it breaks for some reason. I'm trying to figure out if Warlords is somehow overriding event handlers, like handle damage, or something

potent dirge
#

I don't think there's a way to. Unless the EHs are added in via config

exotic flax
#

As for Warlords AI; there are no EH's that I can see, although there are some FSM's running which can override your scripted behaviour.
As for players; I've seen some EH's on 'Killed' and 'Respawn', besides the spawn protection and friendly fire protections (basically ignoring damage).

topaz field
#

Does anyone know anything about mods that interfere with scripts properly executing themselves?

cunning crown
#

There's a lot of way that a mod can interfer with other ones (changing global variables, terminating script in the scheduler, removing event handlers, deleting objects, ...). Also, just a mod changing it's function can break other script that relly in these

pliant stream
#

The most likely thing to break your script is the bugs in your script

potent dirge
#

Does anyone know the width of the widest vehicle in game. I'm trying to spawn vehicles in a row side to side and I don't want collisions

#

Or at least if there's any vehicles wider than 5m

young current
#

Planes are pretty wide

#

You can calculate the space needed from the bounding box

obtuse quiver
#

Is there a script that rearms the player on respawn?

winter rose
#

argh, I can't find a failsafe way to spawn vehicles; there is always one that seems to like spawning in the middle of the house

exotic flax
#

BIS_fnc_findSafePos with a slightly larger 'objDist' set?

fair drum
#

@obtuse quiver you doing a editor mission or a default Zeus mission?

obtuse quiver
#

editor

winter rose
#

BIS_fnc_findSafePos with a slightly larger 'objDist' set?
I tried it with sizeOf _class * 2, I tried findEmptyPosition, IDK anymore ๐Ÿ˜ญ ๐Ÿ˜ฅ

#
[_home, 3, 50, sizeOf _vehicleClass * 2, 0, 0.25, 0, [], []] call BIS_fnc_findSafePos;

maybe I should put the min radius as sizeOf typeOf _home, but still

exotic flax
#

So is the building in question a custom building, or in terrain?
Is it the only building with problems, or does it happen with multiple ones?
Does it happen with all vehicles you try to place?

winter rose
#

all vanilla

#

and trying to spawn a civilian flatbed truck.

exotic flax
#

btw... it remember a similar issue (although with trees) where the solution was a mix of different checks to be 100% sure

winter rose
#

I also tried to create the truck in the air then use setVehiclePosition on the obtained spawnPos, to be double sure

#

(to no avail)

exotic flax
#

To make sure position is not inside a building, increase distance to nearest object param.
by KK in wiki notes ๐Ÿ˜‰

#

although 2x object size SHOULD be enough

winter rose
#

I mean, yes o_o

#

but sometimes it spawns right in the middle of the building, if I don't set the "3" min radius parameter

obtuse quiver
#

@fair drum i wanted to create a scenario where players can pickup weapons from the ground and in case they die they respawn with ammo

exotic flax
#

I do know that some vehicles has some weird bounding boxes, which don't match their actual size. You could try to use (boundingBox _vehicle) select 2

exotic flax
#

@winter rose
hmm.... currently testing something and I'm baffled...

// 3 dot markers placed on top of buildings
_markers = ["home_1", "home_2", "home_3"];
{
   _vehicle = "I_E_Truck_02_transport_F";
   _pos = [(markerPos _x), 1, 10, sizeOf _vehicle * 2, 0, 0.25, 0, [], []] call BIS_fnc_findSafePos;
   createVehicle [_vehicle , [_pos#0, _pos#1, 0], [], 0, "CAN_COLLIDE"];
} forEach _markers;

It does create 3 vehicles, but not even close to the markers and actually all at the same place resulting in colliding into each other ๐Ÿคฃ

#

so my results are even worse than yours

winter rose
#

bah, I did set a hardcoded distance, and if a car explodes or flies once in a while "it's Arma"

obtuse quiver
#

i cannot find a rearm script, i think i will use an arsenal but it's a very bad option

#

i know it's possible but i don't know how to do it

fair drum
#

a few ways @obtuse quiver .

1.) you can place all the player units and set their kits to have said ammo in their inventory with a starting weapon. you can then go to attributes/multiplayer and click "save loadout" which will respawn any player with the kit defined in the editor when you place the unit.

2.) you can add onPlayerRespawn.sqf to your mission file and define a player additem "magazine" or other various add magazine commands, it will then fire when they respawn.

3.) you can define a respawnMagazines[] = { "magazine","magazine" }; and a respawnWeapons[] = { "weapon" }; in the description.ext

4.) you can define a CfgRoles and a CfgRespawnInventory in your description.ext then add a BIS_fnc_addRespawnInventory to your units via script

#

pick one and I'll show you

obtuse quiver
#

@fair drum so, the player will have different weapons, do i need to specify every type of weapon and every type of mag?

fair drum
#

you saying they will respawn with the weapon they pick up?

obtuse quiver
#

yep, but with a normal save loadout on death they will respawn with the ammo they had at death

fair drum
#

number 1 will only revert the save loadout of the unit that the game initially initialized from the editor. so if i place a man with a pistol in the editor, run the mission, he goes and picks up a rifle and dies, he will respawn with that pistol setup i gave him in the beginning

obtuse quiver
#

that's fine too

fair drum
#

then try out number 1, its the most simple. just set what you want their initial and respawn setups to look like, then checkmark the "save loadout" under attributes/multiplayer

obtuse quiver
#

oh, so i don't need onplayerrespawn and onplayerkilled?

obtuse quiver
#

using the first metod i respawn with the default loadout

oblique arrow
#

Hm okay I'm working on the quick join button again and trying to figure out how EventHandlers work smart
thus far I think I need to use findDisplay to find the button I want to add the eventhandler to, then use displayAddEventHandler to add an onButtonDown(/ButtonDown) EventHandler to the button which then when it fires executes the connectToServer command, I just havent quite figured out if thats correct and if it is how I transfer that into actual working code

oblique arrow
#

Hm I've got something that pboProject is fine with now which is
config.cpp:

class CfgMainMenuSpotlight 
{
    class ACQuickJoin
    {
        text = "Join the ACServer"; 
        textIsQuote = 1; 
        picture="acqj\aclogo.paa";
        video = "";
        action="(findDisplay 46) displayAddEventHandler ["buttonDown","_this call cts.sqf"];";
        actionText = "AC";
        condition = "true";
    };
};

cts.sqf:

connectToServer ["192.168.0.2", 2302, "test"];

But with that Arma throws a Generic error in expression when I press the button
http://prntscr.com/u4imt7

rain mural
#

If it is a GUI button element you can just call onClick straight on it like so:

        class freezePlayer: RscButton
        {
            idc = 1604;
            onMouseButtonClick = "(lbCurSel 1500) call JC_fn_freezePlayer;";

            text = "FREEZE"; //--- ToDo: Localize;
            x = 1 * GUI_GRID_W + GUI_GRID_X;
            y = 7 * GUI_GRID_H + GUI_GRID_Y;
            w = 7 * GUI_GRID_W;
            h = 1 * GUI_GRID_H;
        };
copper raven
#

_this call cts.sqf

#

this obviously won't work

oblique arrow
#

Why not? Sorry I dont know a lot about scripting with sqf yet awe

copper raven
#

call takes code as right argument

oblique arrow
#

oooh okay

copper raven
#

look at example 5

oblique arrow
#

Ah okay gonna try that, thanks bongocat

cunning crown
#

@oblique arrow

action="(findDisplay 46) displayAddEventHandler [""buttonDown"",""_this call cts.sqf""];";
//                                               ^^          ^^ ^^                  ^^

You also forgot to escape the quotes too, and yeah, call is with a function/codeblock, not a file (you could also do (findDisplay 46) displayAddEventHandler ['buttonDown','_this call cts.sqf']; )

potent dirge
#

Hi there fellas, I have a small issue with a script using BIS_fnc_spawnGroup:

...
_qrfGroup = [_position, _qrfSide, _qrfTeam, _relPosArray] call BIS_fnc_spawnGroup;
_qrfGroup deleteGroupWhenEmpty true;

_qrfGroup addWaypoint [_destination, 0] setWaypointType "SAD";

systemChat format ["Group count is: %1", count units _qrfGroup]; 

systemChat ends up returning as 0. Meaning BIS_fnc_spawnGroup doesn't return group to _qrfGroup var.

#

The parameters for BIS_fnc_spawnGroup are properly filled because it spawns units without errors, so don't bother about those

copper raven
#

do systemChat str [_position, _qrfSide, _qrfTeam, _relPosArray] just incase

#

need to take a look at what that function does exactly in function viewer, and go from there

potent dirge
#

I ran it and they returned expected values

#

Do I need to post the whole function?

obtuse quiver
#

@fair drum sorry if i bother you again, i did a pause and now im back working on this mission, i still can't figure it out, i tried the first method but i respawn with the default class loadout.

potent dirge
#

Strangely enough running BIS_fnc_spawnGroup directly from the debug console and filling in the exact same parameters it returns a group

copper raven
#

it returns group either way...?

#

problem is it doesn't have units, or what is the issue again

potent dirge
#

It returns group when I run it from the debug console but doesn't when from a script

copper raven
#

run systemChat str [_qrfGroup] then, and see what you get there, from the script

potent dirge
#

I figured out the problem. As I added in your above test command, on a whim I decided to comment out _qrfGroup deleteGroupWhenEmpty true; and it works.
Somehow deleteGroupWhenEmpty is running before the units are placed in a group??

fair drum
#

@fair drum sorry if i bother you again, i did a pause and now im back working on this mission, i still can't figure it out, i tried the first method but i respawn with the default class loadout.
@obtuse quiver

Standby at lunch. Pm me and I'll walk you through it later

oblique arrow
#

Btw peeps is there a good way to figure out which UI element has which Display ID? I know there's a list on the wiki but I'm not sure which one of those is the spotlight button

winter rose
#

the wiki as usual :3

oblique arrow
#

I know there's a list on the wiki but I'm not sure which one of those is the spotlight button
๐Ÿ‘€

winter rose
#

I didn't know if you knew where this list was =)

oblique arrow
#

heh I know where it is and I've looked at it but yeah I'm not sure which ID is the spotlight button

winter rose
#

otherwise, you can browse configFile within the gameโ€ฆ and hope to find it quickly

oblique arrow
#

browse confiFile ConfusedDog ?

winter rose
#

Config Viewer

oblique arrow
#

man why do event handlers have to be so hard to use heh

winter rose
#

UI is kinda hard to use

oblique arrow
#

Hm do hints work in the main menu?

#

Because it seems like it only shows errors but not actually hints

sudden yacht
#

Would it be even remotely possible to spawn a light source during the day say inside a shaded building?

oblique arrow
#

propably, yeah

sudden yacht
#

Any idea how? Like if i spawn a light source during the day, it just appears not to be there until night

winter rose
sudden yacht
#

i think i got it thanks guys, thanks to some folks...

surreal peak
#

@winter rose in your (well made and simple to follow) tutorial you listed, you said Light colour does not affect AI, but ambient does. how does light effect AI?

winter rose
#

they e.g spot you at night

surreal peak
#

ahhh

#

how does the colour change the fact?

#

like, does blue light make it easier to see you than red?

#

or am I missreading this

winter rose
#

ambient colour*
I don't know about such specifics though, I don't think it is simulated that far

candid cape
#

Hi, is there any way to spawn a car with a specific rotation?

young current
#

no the rotation/direction needs to be set after it is spawned

candid cape
young current
#

@candid cape is there a question there?

candid cape
#

Look, I have set the spawn point looking in the S direction and the car spawns in the N direction

#

Idk why

#

Here are the graphical tests

winter rose
#

@candid cape ```sqf
_veh setDir 180

candid cape
#

ok thanks

reef monolith
#

hey yall i was wondering if i could get some help with working out how to do triggers

#

i use a starship troopers mod and so far I have managed to spawn in a group of ai with the triggers

#

however i have no idea how to trigger them to move and attack players once they spawn. Can anyone help me out?

exotic flax
#

After you spawned the group, make sure you get the group variable or the leader of the group.
With that, simply give them waypoints with addWaypoint

reef monolith
#

hmmmmmm

#

i'll have to get back to this later tonight but thank you

warm blaze
#

I need to spawn objects in certain locations (can be around 50) if some enemy entered it. What is the best approach to trigger spawn in terms of performance: triggers (event driven approach ??) or loops (while, waitUntil ...) ?

winter rose
#

to "wait", an event handler is better (it doesn't wait, it gets triggered by something)

warm blaze
#

can't find it in docs

#

any links please ?

winter rose
#

wait, I thought you had an EH in mind already.
if not, waitUntil

warm blaze
#

kk, thx a lot

warm blaze
#

sorry, but I did not find any suitable EH that could trigger an event when some enemy has entered a certain location

#

I guess , waitUntil is only one option comparing to triggers

winter rose
#

you can do waitUntil { sleep <duration>; <condition> }; so the game only checks the condition every duration seconds

#

so it's not "too often"

warm blaze
#

while {condition} do {sleep} does the same. Does it work worse towards wait?

winter rose
#

it's more readable with waitUntil

#

(a trigger checks every 0.5s by default)

#

I was just pointing info, no critics here ๐Ÿ™‚

warm blaze
#

that is what I am trying to figure out: what is cheaper. readibility and complexity of conditions is a second question for me ๐Ÿ™‚

winter rose
#

(@tough abyss no I meant that I did not mean what I said as a critique ^^ hahaha we're both on the same page then)

warm blaze
#

my focus is performance now

#

promise to write a good doc base in case major goal will be reached ๐Ÿ˜›

winter rose
warm blaze
#

^ this, also sure..a while loop with a long sleep will be the most performant I suppose. Then it's mostly a question of how "fast" do you need to detect that x is close to x
@tough abyss in terms of 3-5 seconds I guess

#

I would prefer to follow event driven approach and exclude any loops on server side

#

however mentioned task above can't be solved so easily by events as far as I can see

#

only loops can deal this

#

or I am missing something

winter rose
#

no events exist about "closeness" of something compared to something else, so I guess waitUntil { sleep 3; leader _group1 distance leader _group2 < 100 };

#

that's what I would do ๐Ÿ™ƒ
you can also use waypoints, but be wary that WP effects are executed on every network machine

warm blaze
#

could CBA help me with this? I heard they have some extended EHs

winter rose
#

I guess they would have scripted EH, but that would be the same

though I think if it is a distance check, the waitUntil is only a fraction of a pebble in your shoe; "don't optimise prematurely", make things work first ๐Ÿ˜‰

warm blaze
#

ok, I see. Thanks for recommendations ๐Ÿ™‚

peak bridge
#

is it possible to transform a direction from 360ยบ to a vector dir?

exotic flax
#
[sin _azimuth, cos _azimuth, 0]

???

peak bridge
#

thanks

clear roost
#

Hello, when testing this vehicle flip script on single player and multiplayer, everything works fine. However, when I try the script on a dedicated server it doesn't work at all. Does anything stick out that may be causing the problem?

_vehicle addAction ["Flip vehicle",{ params ["_vehicle", "_caller", "_actionId", "_arguments"]; _normalVec = surfaceNormal getPos _vehicle; if (!local _vehicle) then { [_vehicle,_normalVec] remoteExec ["setVectorUp",_vehicle]; } else { _vehicle setVectorUp _normalVec; }; _vehicle setPosATL [getPosATL _vehicle select 0, getPosATL _vehicle select 1, 0]; },[],1.5,true,true,"","(vectorUp _target) vectorCos (surfaceNormal getPos _target) <0.5",5];

tough abyss
#

you mean the action doesn't show up at all or setVectorUp has no effect?

#

on a side note i ran into a similar problem a while ago with locally hosted server. setVectorUp and remoteExec just refuse to work. you can try remoteExec ["setVectorUp", 0] (it worked for me)

clear roost
#

@tough abyss The action is not showing up at all ๐Ÿ˜ฆ

tough abyss
#

have you double checked the action is indeed added for the player?

hallow mortar
#

addAction is a local command. Where are you executing that code?

velvet merlin
young current
#

Whats the full syntax you have tried for that @velvet merlin

velvet merlin
#

player selectWeapon (currentMuzzle player)

young current
#

hmm did you mean gun fired grenades or handgrenades?

winter rose
#

@velvet merlin it might be possible it is a special case,
before A3 the grenade was a weapon selected with "F", since A3 it is "G" (Ctrl+G in my case, to prevent happy little accidents ^^)

velvet merlin
#

the underlying issue is that if you have two grenade types, throw the last one of one type, it may not auto select the muzzle of the other

#

as grenades are not shown as weapons in top right (unless you use them), you also dont know whats up

#

to fix it you have to switch the grenade muzzle via the extra action

exotic flax
#

selectWeapon "Throw"?

#

still doesn't allow you to change the exact grenade type, but it should switch to the grenades

peak plover
#

If we are by any chance ever getting createNamespace can we get the option to get a parameter or something to have a local only one and a public one, shared on all clients + server

winter rose
#

I don't think we will ever see such a thing, honestly! remoteExec and setVariable (public) ftw

still forum
#

If we are by any chance ever getting createNamespace
unlikely, and if, then local only in form of a hashmap

exotic flax
#

CBA_fnc_createNamespace works perfectly fine

fair drum
#

Anyone know how Eden enhanced actually adds it's attributes and things to the description.ext? I never see any overwrites or anything.

exotic flax
#

it adds it to mission.sqm, either as an Attribute or as an CustomAttribute

#

or what kind of attributes are you talking about?

#

eg. stuff which you can add to your description.ext are by default in mission.sqm as well, under class ScenarioData

fair drum
#

things like save loadout, or when it adds respawn templates and such. just always wondered.

hollow thistle
#

CBA_fnc_createNamespace works perfectly fine
it does but it does not mean it's kinda hacky on the insides.

fair drum
#

oh okay. didn't know you could do description.ext stuff in the .sqm

hollow thistle
#

you can't, it's using mission attributes

#

and some stuff can be set in them too.

fair drum
#

if I wanted to remoteExec to only players that are in say... a helicopter at that point, how should I go about collecting the arrays of the clientIDs in that heli currently so that I can place them in the remoteExec? I know I have owner to work with, just haven't figured it out yet.

hollow thistle
#

why do you need ids?

#

you can just use objects for remote exec

fair drum
#

OOHHHH NOOOOO I'm a dumb dumb. ty

winter rose
#

๐Ÿ˜

dim owl
fair drum
#

why what you running into?

dim owl
#

I want to copy a backpack inventory to another backpack. Unfortunately I cannot add a backpack to a backpack with that command.

fair drum
#

just get an array of all the items of the current back pack
delete that backpack
create new backpack
add items to new backpack

warm hedge
#

Meant backpacks in backpack?

winter rose
#

you cannot put a filled backpack into another one

#

but you can put an empty one, for sure

dim owl
#

but you can put an empty one, for sure
@winter rose Thats what the purpose of this is

#

Get the bigger backpack of those two and copy the inventory of the smaller backpack to the bigger one

winter rose
#

no, wait, are we mixing two things here?

dim owl
#

Get the bigger backpack of those two and copy the inventory of the smaller backpack to the bigger one
@dim owl + the backpack itself

winter rose
#

you can copy backpack 1 content into backpack 2, no problem
you want to add backpack 1 inside of backpack 2, ok - but add an empty one

dim owl
#

yeah that's what I'm trying to do

fair drum
#

is this new backpack going to be something the players pick up off the ground?

dim owl
#

Let's assume backpack 1 content contains an empty backpack. It cannot be added with the mentioned command.

{player addItemToBackpack _x;} count _itemsBackpackBackup;
#

is this new backpack going to be something the players pick up off the ground?
@fair drum No, it's directly added to the player

fair drum
#
private _items = backpackitems player;
removebackpack player;
player addBackpack "backpack";
{ player addItemToBackpack _x } forEach _items;

something like this?

dim owl
#

Yeah but in that _items array there is a backpack

winter rose
#

have you tried addBackpackCargo?

fair drum
#

so.... player has a backpack that is FILLED. you then have to take out those items, put them in the new backpack, and THEN add the now empty backpack.

#

is that what you want?

dim owl
#

have you tried addBackpackCargo?
@winter rose Would that work with all the other items to?

#

is that what you want?
@fair drum Yes

winter rose
#

nope, but you can make an exception for the backpack

dim owl
#

I've tried adding that backpack with that command and it worked. Thanks!

fair drum
#
private _oldBackpack = backpack player;
private _items = backpackitems player;
removebackpack player;
player addBackpack "newbackpack";
private _newBackpack = backpack player;
_newBackpack addBackpackCargoGlobal [_oldBackpack,1];
{ player addItemToBackpack _x } forEach _items;

well guess you got it to work, just did this so might as well hit enter

dim owl
#

Okay thanks, yeah it's the same command for the backpack to work

onyx gust
#

Is there a script of some sort to allow helicopters to not explode when they touch an object slightly. You know to keep them a bit realistic and some survivability? Please @ me if you do have something.

fair drum
#

could do something like set the vehicle to invunerable at a certain height off the ground

#

but if its tapping a tree while at flying speed, I'm afraid you're dead lol

winter rose
#

@onyx gust โ†‘

fair drum
#

so when I use titleFadeOut, it doesn't seem to work. it just instantly disappears.

    params ["_group"];
    
    sleep 10;
    [["<t size='2.0'>Welcome to Virolahti</t>","PLAIN DOWN",2,false,true]] remoteExec ["titleText",_group];
    sleep 5;
    [5] remoteExec ["titleFadeOut",_group];
onyx gust
#

Thank you!

fair drum
#

well it looks like i need a sleep after the titlefadeout because the next line runs too fast

#

which is why it looks like its skipping

winter rose
#

most likely because remoteExec order is not guaranteed*

fair drum
#

maybe a way to waitUntil?

#

or actually, what's that other text command where you can set specific times to it?

winter rose
#

or if it is intro, put it in init.sqf
that or make a function and remote call it

fair drum
#

does playSound3D have the same attenuation problems as say3D?

pure blade
#

hello guys, does anybody know how to disable the automatic getout command if the vehicle get damage?

fair drum
pure blade
#

nice thanks

finite sail
#

@pure blade note that unless they are in combat mode, the crew will often turn out when that command is true

pure blade
#

alright thx for the information tankbuster

finite sail
#

๐Ÿ™‚

calm bloom
#

Hey, comrades, have anyone invnted a way to remove vest with the gear or put something inside?

crisp cairn
#

Hey all, I was wondering if there is anyway to execute a function and then have it wait until the function is completed to continue on down

fair drum
#

@calm bloom look a few messages up, same thing but with back packs

@crisp cairn place a global variable in your function that you can have the last line make it true, then do a waitUntil { globalvariablechosen} in the original script (probably not efficient at all)

winter rose
#

@crisp cairn call? ^^

calm bloom
#

backpacs are objects and vests and uniforms are not(

#

Ok but thanks

#

i think i can create vest on player

#

or add items into it

fair drum
#

??? you just use addvest instead of addbackpack

#

and additemtovest

high marsh
#

event handlers added to objects are destroyed upon death/respawn right

#

say the player has a fired event handler attached, it gets destroyed after dying?

topaz field
#

Im currently in the midst of converting one of my files to SQF and Im not sure if im on the right track or not

#

Does this look right to someone?

#
_camera = "camera" camcreate [3695.91,3610.04,2.00]
_camera cameraeffect ["internal","back"]
//=== Create Camera End

//=== Intro Start

//comment "shot1";
"_camera camPrepareTarget [98811.75,31889.47,-17641.03]";
"_camera camPreparePos [4344.96,4351.77,5.35]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0"
@camCommitted _camera

sleep 3;

//comment "ots shot2";
"_camera camPrepareTarget [99630.33,-20204.76,-17641.36]";
"_camera camPreparePos [4345.74,4353.17,5.18]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0
@camCommitted _camera

sleep 3;

player cameraEffect ["terminate","back"]
camDestroy _camera
warm hedge
#
  • Missing ; (semicolon)s
  • "_camera ~~~" remove these quotation marks
  • @ isn't a thing in SQF. Use waitUntil
topaz field
#

Just in general where am I missing semi colons? Im not exactly sure where to distribute them

still forum
#

you are missing them after each statement

#

end of every line

winter rose
#

@topaz field (see pinned message to see how to format in Discord)

//=== Create Camera Start
_camera = "camera" camcreate [3695.91,3610.04,2.00]
_camera cameraeffect ["internal","back"]
//=== Create Camera End

//=== Intro Start

//comment "shot1";
"_camera camPrepareTarget [98811.75,31889.47,-17641.03]";
"_camera camPreparePos [4344.96,4351.77,5.35]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0"
@camCommitted _camera

sleep 3;

//comment "ots shot2";
"_camera camPrepareTarget [99630.33,-20204.76,-17641.36]";
"_camera camPreparePos [4345.74,4353.17,5.18]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0
@camCommitted _camera

sleep 3;

player cameraEffect ["terminate","back"]
camDestroy _camera
```you have quotes all over the place ๐Ÿ™‚
quasi rover
#
[bns_vars,...] spawn bns_fnc_aaa;  //bns_vars: public var.
//fn_aaa.sqf
_array = this select 0;    //bns_vars
...
publicVariable "bns_vars";  //used in other scripts
....

{ 
 ....
      } forEach _array;  //forEach bns_vars

This script is run by server side. Any difference btw forEach _array and forEach bns_vars?

winter rose
#

a "faster" access to the value (local var is faster than global var, no other scopes to explore)

#

also, _this select 0โ€ฆ use params ๐Ÿ™‚

#

and coding-wise, the code is not dependent anymore on the variable name
so you can rename it bns2_vars and it will still work!

#

@quasi rover โ†‘

quasi rover
#

Thanks, please tell me what it means in detail?

and coding-wise, the code is not dependent anymore on the variable name
so you can rename it bns2_vars and it will still work!
@winter rose

winter rose
#

if you send a parameter to a function, the function doesn't have to know/doesn't care about what its name is

if you renamed bns_vars to e.g bns2_vars, you would have to rename it everywhere! whereas this function can work with all the functions you want if you use params

quasi rover
#

you mean,

//fn_aaa.sqf
params ["bns2_vars"];   //bns_vars
...
publicVariable "bns2_vars";  //used in other scripts
....

{ 
 ....
      } forEach "bns2_vars";  //forEach bns_vars
winter rose
#

no
I mean```sqf
params ["_myIterationVar"];

{

} forEach _myIterationVar;

which you can call with
```sqf
[bns_var] spawn BNS_fnc_myFunction
```or```sqf
[anotherVar] spawn BNS_fnc_myFunction
```or```sqf
[["my", "own", "array"]] spawn BNS_fnc_myFunction
still forum
#

params ["bns2_vars"]; invalid, params needs to be local variables

#

forEach "bns2_vars" invalid, forEach doesn't take string

winter rose
#

he is a real-life compiler

quasi rover
#

it's just mis typed.

#

thanks, guys.

quasi rover
#
//fn_aaa.sqf
params ["_myArray"];  //public var.
...
["uniqueID", "onEachFrame", {
    {
        drawIcon3D [
        ];
    } forEach _myArray;
}] remoteExec [ "BIS_fnc_addStackedEventHandler", -2, true];

Is it work for every client? do clients know the _myArray value? @winter rose

winter rose
#

nope, it's a new scope

still forum
#

No they don't, undefined variable

#

but I think to StackedEH you can pass parameters? So you can probably pass it as param

quasi rover
#

So in this case, forEach bns_vars is right? because it was publicVariable "bns_vars"

winter rose
#

then yes, for an eachFrame

quasi rover
#

Thanks guys. ๐Ÿ‘

queen cargo
#
#define CONCAT(ARGA, ARGB) ARGA ## ARGB
CONCAT(A,B)```
What is this actually inflating to?
`AB` or `A  B`?
winter rose
#

(CONCAT(ARGA, ARGB) no space before ARGB though?)

queen cargo
#

not sure what you try to tell me ๐Ÿ˜…

still forum
#

with spaces

winter rose
#

I used spaces once (with this voice thing I posted in #arma3_config) and it added a space before the text ๐Ÿค”

random loom
#

Is there any way to get the player profile goggles/face?

#

Alternatively, check if you're in the main menu

topaz field
#

//=== Create Camera Start;
_camera = "camera" camcreate [3695.91,3610.04,2.00];
_camera cameraeffect ["internal","back"];
//=== Create Camera End;

//=== Intro Start;

//comment "1";
_camera camPrepareTarget [-17086.25,-92052.84,-18439.74];
_camera camPreparePos [4351.45,3820.57,2.16];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};


sleep 3;

// comment "2";
_camera camPrepareTarget [-17086.25,-92052.84,-18439.58];
_camera camPreparePos [4369.57,3829.97,1.49];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};


sleep 3;

player cameraEffect ["terminate","back"];
camDestroy _camera;
#

@winter rose Thats how you want it to look?

queen cargo
#

kk
so the code outputted is correct

topaz field
#

That format for when I next do it?

winter rose
#

@topaz field it is properly formatted in Discord,
and it seems functional for Arma 3 yes? ๐Ÿ™‚

#
player cameraEffect ["terminate","back"];
// โ†“โ†“โ†“ I think
_camera cameraEffect ["terminate","back"];
topaz field
#

I tested it hours ago. I havent touched it since but when i ran that current version I had no errors pop up upon me loading in on my character

#

I'll have a fiddle again

#

But essentially no errors but didnt work

tawdry harness
#

No such thing as client public variable?

winter rose
#

client global* variable is possible

#

@topaz field it works for me

topaz field
#

Does it enter the cutscene mode and cut between the two shots? @winter rose

winter rose
#

yes

#

where did you put this code?

topaz field
#

I put it in my mission file that runs on stratis and im calling it through a player int sqf this execVM "intro.sqf";

#

I just ran it and it just went into the player view (just the standard one with your firearm)

#

not the cinematic view

winter rose
#

don't put it in the init, or set some delay in the script (like sleep 0.01) @topaz field

topaz field
#

you think It would be fine it put it in activation of a trigger? @winter rose

winter rose
#

yes, but you would have a 0.5s delay

topaz field
#

I would have? or need to implement a 0.5s delay?

#

I just removed it an executed it from a trigger and unfortunately no cigar

winter rose
#

then something is wrong - not intro.sqf.txt by all chances?

topaz field
#

You asking if I have the incorrect file type?

#

maybe*

#

file directory states it as a SQF File so I dont believe so

winter rose
#

wrong directory maybe? not the good mission loaded?

topaz field
#

I have it in the correct mission

#

Let me check if

#

Let me see if it works when I dont have CUP units, weapons and vehicles loaded

#

I doubt like everyone has said but best to try

#

Okay thats odd

#

It works now

#

But thats when those mods are not loaded

#

Also doesnt work when I call it through a trigger (via a radio ) only works when I call it in the int

#

So trigger isnt working but it works when called via int

topaz field
#

Good old cup the culprit :)))

winter rose
#

*magic* it is then
I will have to try one day

topaz field
#

You think If I repair the mods and verify my game data it will do anything?

winter rose
#

๐Ÿฎ perhaps
I have no idea what causes this behaviour

topaz field
#

one of the people in the cup discord recommended I do that before I came here a couple of days ago

#

I'll take it back to them

tawdry harness
#

@winter rose How would i go abt making one?

winter rose
#

making oneโ€ฆ?

#

a global variable?

MY_GlobalVariable = ["it", "works"];
```ta-daa
#

@tawdry harness โ†‘

tawdry harness
#

No thats no what i mean

#

That's global to everyone in the mission

#

I want it global to the client

#

same variable but different for each client

winter rose
#
MY_GlobalVariable = ["it", "works"];
```is global on the client. It is not *public*
tawdry harness
#

Ahh gotcha, maybe i messed something up then

#

Thanks

finite sail
#

same variable but different for every client?

#

public wont do that

queen cargo
#

is

#ifdef something
  #ifdef something else
  #endif
#endif```a thing nowadays? just saw some a3 file that actually had an include guard and additionally more includes later down the line
pliant stream
#

a working preprocessor? inconceivable

queen cargo
#

more like: would mean i have to remove the restriction from sqf-vm

#

can still remember that i have had added that due to bugs with empty files caused by this

verbal rivet
#

Did anyone else have a problem that if the first call to extension is RVExtensionArgs, the argsCnt argument to it is incorrect?

still forum
#

Didn't notice that and haven't heard about it

verbal rivet
#

I'm trying to develop an extension in Rust.
If I make the first call to extension as:
"dynops" callExtension ["echo",[123,123]];
argsCnt is given some random value, e.g: 1679332212738
All subsequent calls are fine.
If I make a non-parameterized call (e.g. "dynops" callExtension "echo"), then call the parameterized version, everything is fine too.

#

Ok, figured it out - int argsCnt is 32-bit in Windows 64-bit build, I have expected 64. Case closed

fair drum
#

there a EH for when a player changes from FPP to TPP?

tough abyss
#

is it possible

#

to mount static weapon with attacho on top of tank,so commander can use it?

#

while he is turn out

grim coyote
#

directly no, you can't... But I might have an idea...
Try to spawn ai inside the turret and make the ai invisible, then use takecontrol of that ai, you also need to add the support to "leave" from the turret

#

Another way would be to create client mod that would make the turrets so that you can remote control them via uav functionality

tough abyss
#

dammit,thanks anyways

winter rose
#
[] spawn {
  while { sleep 0.5; true } do
  {
    private _grenade = createVehicle ["GrenadeHand", ASLToATL eyePos player, [], 0, "CAN_COLLIDE"];
    _grenade setPosATL ASLToATL eyePos player;
    _grenade setVelocity (vectorNormalized  
    getCameraViewDirection player vectorMultiply 50); // set speed here
    _grenade spawn { sleep 4; deleteVehicle _this };
  };
};
```@humble bridge
#

not the best optimised script, but will do the job nicely

humble bridge
#

I simply have to copy-paste it in the console?

winter rose
#

yyyup

#

throws a grenade every 0.5s

humble bridge
#

and which grenade type it will use?

winter rose
#

typical boom grenade
(and doesn't explode)

#

the RGO one

#

use "GrenadeHand_stone" if you want to throw rocks ๐Ÿ˜„

humble bridge
#

is it possible to make it always a RGN grenade?
since they fly in "better" trajectory and further than RGO

winter rose
#

yes; use "mini_Grenade" instead of "GrenadeHand"

humble bridge
#

AH, ok thx

#

will try it now

#

sleep 4 is 4 secs interval?

winter rose
#

no, the interval is in the while {}

#

4s is the grenade lifetime

humble bridge
#

ah, ok

#

thx very much

#

works nice )))))))

#

even too fast

#

between each grenade

oblique arrow
#

use "GrenadeHand_stone" if you want to throw rocks ๐Ÿ˜„
@winter rose Huh that exists?

winter rose
#

oh yes ๐Ÿ˜‰

humble bridge
#

for cave men

winter rose
#

they don't deal damage, but civilians can even throw them iirc

oblique arrow
#

Do they exist as an actual inventory item or can they just be spawned by a script?

winter rose
#

they do exist; crate addMagazineCargo ["HandGrenade_Stone", 50];

oblique arrow
#

๐Ÿ‘€ boots up arma

humble bridge
#

this will simplify my life a lot

winter rose
#

(or for "_i" from 1 to 10 do { player addMagazine "HandGrenade_Stone" }; @oblique arrow)

oblique arrow
#

jeez Lou the fancy scripter heh

#

Btw since I'm already here, any chance anyone knows if the connectToserver command shows errors if the server isnt avaible/the password doesnt match or something like that?

winter rose
#

they sound "cling" when thrown, and make a "boom" sound without damage nor smoke though ^^

oblique arrow
winter rose
#

with scripting you can prevent the explosion by deleting them

the stones were better in Arma 2 though

still forum
#

it doesn't show errors

oblique arrow
#

it doesn't show errors
awe oki

#

they do exist; crate addMagazineCargo ["HandGrenade_Stone", 50];
huh, they're quite janky but yeah they do exist heh

high marsh
#

There are major redundancies I know that much, but I don't know how I would go about cleaning it up or what the fastest solutions are

#

so far everything runs fine with no major hickups on the client. But I know this can be better and faster. That's kind of what I'm aiming with this. Clean and fast code, runs well with lots of players.

still forum
#

So sad ๐Ÿฅบ, already in bed. I'll try to remember tomorrow, can't pass up a chance to complain about code ๐Ÿ‡ฉ๐Ÿ‡ช

high marsh
#

Oh god, please go easy Dedmen. You'll definitely smite me for this

humble bridge
#

@winter rose, thx again for your grenades script!

#

simple thing for you, yet very important for me and for whole community, if after considerable help of this script, a lot of objects get fixed by devs

brave jewel
#

Hey everyone, I have a problem again. So.. While running an outro scene with cams etc I want to activate a trigger with createunit in the trigger area. But somehow the trigger does not fire while in the camera. Without the camera the trigger works perfect. sqf if (isServer) then {_unit3 = (createGroup [WEST,true]) createUnit ["mac_private",getMarkerPos "hidemrk3", [], 2, "NONE"]};

#

The thing I want to achieve is: The trigger fires and a show module unhides some stuff

winter rose
#

if you are scripting, why not use hideObjectGlobal?

brave jewel
#

Well it's a lot of units and objects :x

#

or can I unhide stuff inside a trigger with hideObjectGlobal?

winter rose
#

sure thing

high marsh
#
activation:
blahUnit hideObjectGlobal true;
deactivation:
blahUnit hideObjectGlobal false;
#

ยฏ_(ใƒ„)_/ยฏ

#

or the reverse however

brave jewel
#

sure but how does one implement a triggerArea in this?

high marsh
#

you mean like, get the size of the triggeR?

brave jewel
#
 triggerArea trg1 hideObjectGlobal false;```
high marsh
#

thisTrigger is a variable that can be used in any of those fields to reference the trigger

brave jewel
#

might this be the way? xD

high marsh
#

you trying to hide everything in the trigger? because that's not what triggerArea does

brave jewel
#

Everything inside the trigger will be hidden at mission start. Then when the outro runs, I have 3 areas where I need stuff to show again

high marsh
#

or rather, unhide everything in the trigger? Lol

brave jewel
#

yea exactly ๐Ÿ˜›

#

I have tried syncing the objects to the show module and syncing the show module to a trigger but nothing I have tried worked

high marsh
#
{
    _x hideObjectGlobal false;
} forEach thisList;
brave jewel
#
{
    _x hideObjectGlobal false;
} forEach triggerArea trg1;
``` ?
high marsh
#

nada.
thisList contains anything inside the trigger based on activation

brave jewel
#

thing Is I don't activate the trigger

#

the trigger will only be there to "select the objects" inside the trigger

#

If you know what I mean

high marsh
#

is the objects inside the trigger always the same?

#

in that case, just make an array of objects to unhide when the intro starts.

brave jewel
#

Yep, they don't move or will be added or deleted or whatever

#

It's about 100 objects ๐Ÿ˜„

high marsh
#
if(intro_started) then {
  {
    _x hideObjectGlobal false;
  } forEach [obj_thingy1,obj_thing2];
};
#

๐Ÿ˜ฎ

brave jewel
#

it's kind of a flashback of the campaign my milsim unit played

#

like 3 missions out of 14

#

there has to be a way to unhide all objects inside a trigger area right? we just need to figure out how ๐Ÿ˜„

winter rose
#

yep

high marsh
#
{
    _x hideObjectGlobal false;
} forEach (list trg1);

list does the same thing when you're not using the fields.

winter rose
#

objects as in mission objects, or units too?

brave jewel
#

objects like h-barrier and units

high marsh
brave jewel
#

I'll try your option quickly, brb !

high marsh
#

run that on the server btw.

brave jewel
#

will do

#

oh one more thing, if I have a helipad (invisible) inside the area and have the camera target set to it, will it screw it up? xD

high marsh
#

should be able to tell where it is, even if it's not visible.

brave jewel
#

ok thats great

#

I'll give a try

brave jewel
#

Well, that didn't work. FYI all the units inside the trigger are synced to a hide module in the editor

#

Might this be bad?

#

Do I have to set the Act Cond to Anybody?

high marsh
#

I think if you have them synced to units they become the only activation? Idk forsure.

#

I would just hide them all at the start with a script instead of the module

brave jewel
#

yea I'm hiding them now with ```sqf
{
_x hideObjectGlobal true;
_x enableSimulation false;
} forEach (list scene1trg);

 and unhide them with
```sqf
     { 
      _x hideObjectGlobal false;
      _x enableSimulation true; 
     } forEach (list scene1trg);
#

I will try it and report back

high marsh
#

disable object collision in addition to rendering. , don't think enablesimulation is necessary

brave jewel
#

I tried ```sqf
{
_x hideObjectGlobal false;
} forEach (list scene1trg);

high marsh
#

so what exactly needs to happen before they become visible again?

#

the camera passing over?

brave jewel
#

I'll check if it works and send it to you then

high marsh
#

๐Ÿ‘

brave jewel
#

So I had to change it to ```sqf
enablesimulationGlobal

broken forge
#

does anyone know how to update credits after it's already called? I want to players to be able to return supplies back to base and have the factory (created from AdvLog_fnc_factoryInit) update by adding credits.

[flagfac, credits] call AdvLog_fnc_factoryInit;

brave jewel
#

Okay Midnight, it works very well now, except I think something with the simulation is wrong. since when the scene starts, all enemy units are already dead

#

I put ```sqf
{
_x hideObjectGlobal true;
_x enableSimulationGlobal false;
} forEach (list scene1trg);

      { 
  _x hideObjectGlobal true;
  _x enableSimulationGlobal false; 
 } forEach (list scene2trg);
 
      { 
  _x hideObjectGlobal true;
  _x enableSimulationGlobal false; 
 } forEach (list scene3trg);
in the initserver.sqf. Is it necessary to be put in the initplayerlocal as well? or would the init.sqf be enough?
high marsh
#

hmm, no. initPlayerLocal is only local to player

#

disabling and enabling simulation wouldn't kill the units either

#

they just freeze

brave jewel
#

somehow they just killed each other while hidden

high marsh
#

yeah it might be that your AI behavior is still running despite simulation being disabled

brave jewel
#

so they are fighting each other while hidden? xD

high marsh
#

yeah probably lol

brave jewel
#

HAHAHA

rich anvil
#

could someone help me a bit with trigers?

brave jewel
#

So I guess I'll disable the damage for all of them lol

#

Describe your problem Ukraine

rich anvil
#

im trying to get a triger to activate when bluefor enters it, when activated, it makes some csat boyoes get into a truck and go to a locaton

#

i cant send screenshots

#

can i send in DMs?

brave jewel
#

Set your Trigger as following:

Cond: this
Type: Skip Waypoint
Act Condition: BLUFOR

Then rightclick the trigger, select Set Waypoint activation and click on the waypoint that has to be skipped

rich anvil
#

what part?

#

the type,activation, activation type?

brave jewel
#

exactly

#

and disable the checkbox at Server Only

rich anvil
brave jewel
#

Choose Skipwaypoint

brave jewel
#

yup

rich anvil
#

how would i make some csat get into a truck?

tough abyss
#

Why not just put them in the truck from the start?

rich anvil
#

good idea

#

btw whats the waypoint to make them leave the truck?

haughty bone
#

Greetings everyone. I have been told this is the place to ask for help when it comes to scripting in arma3. I am quite new to the scripting & mission making side of arma 3 and at the moment i am working on a mission where i want new tasks to show up when the players find specific intelligence folders. I got the intelligence folders working already and the folder itself will despawn once it has been searched. Basically what i want to add to that is a trigger that looks if the specific folder is still on the map and if the folder is gone, it adds a new task on the map but i am not sure how this would work script wise and if it is even possible? Could anyone possibly help me with this? Thank you in advance!

exotic flax
#

If you use BIS_fnc_holdActionAdd on the object you can use createTask in the 'codeCompleted' parameter to create a new task (see example 2 on the wiki).
It is possible to use triggers for this, but that would require even more (complex) coding.

high marsh
#

plus holdActions have nice looking UI

haughty bone
#

Thanks for the fast replies. Would it be possible to create multiple tasks with that? Right now i have it so that 3 tasks should get created with that single intel pickup

exotic flax
#

you can use createTask as much as you want ๐Ÿ˜‰

high marsh
#

wonder how many tasks you can create without it hitching on performance. Especially the ones that have 3D Markers.

haughty bone
#

great. Kinda silly question but which wiki are you referring to. I am looking at the wiki of Bistudio.com right now but am a bit clueless on what to exactly look for

haughty bone
#

and all of this should be put in the codecompleted?

#

right now i have this in the completion: hint"You have found information about 2 new resource nodes, and an military outpost. These have been marked on your map."; deletevehicle intel01;

#

so after the deletevehicle intel01 i put in the createtasks

#

Would it be okay for me to DM you @exotic flax I'd like to show you something and explain it a bit better of what i am trying to do

#

as to prevent me spamming this channel

open star
#

Does anyone know where I can find the weapon modes for weapons? Like "SemiAuto" "FullAuto" "GL" "Safety"
I'm using CBA and I'm trying to force the player weapon mode in a certain trigger area to be locked on safety, until they leave the area.

high marsh
#
hint str (getArray (configFile >> "CfgWeapons" >> currentWeapon player >> "modes"));
#

could always just override firing the weapon when in an area.

timid olive
#

Would it be possible to script a timer that deletes ACE arsenals after itโ€™s expired? How would I go about doing that?

high marsh
#
/* add all your arsenal stuff here*/

_yourBox spawn {
    sleep 120; //two minutes 
    [_this, true] call ace_arsenal_fnc_removeBox; //remove arsenal from box
};
open star
#

Sleep command

#

oop

#

What markdown are you using to make yours work?

high marsh
#

https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-

#

discord supports sqf

open star
#

I've been lied to this entire time

high marsh
#

ยฏ_(ใƒ„)_/ยฏ

open star
#

Ahhh crap I was afraid of what I'd see when I debugged the weapons modes.

#

welp cool cool.

high marsh
#
if(canSuspend) then {
    waitUntil{!isNull (findDisplay 46)};
    (findDisplay 46) displayAddEventHandler["KeyDown",
    {
        params["_disp","_key"];
        if(_key in actionKeys "Fire") then {
            if(player inArea "nofirezone") then {
                if(currentWeaponMode player isEqualTo "FullAuto") then {
                    true;
                } else {
                    false;
                };
            };
        };
    }];
};
#

something like this idk

#

make a marker named "nofirezone". Should work.

#

basically just overrides the key if they have full auto and are in the no fire zone

open star
#

Well the thing is I'm trying to prevent my cuckhold friends from shooting each other and throwing grenades at each other while we're doing briefings and what not :D

high marsh
#

yep, just place a marker named "nofirezone" (not the text, the variable name) over the briefing area

#
if(canSuspend) then {
    waitUntil{!isNull (findDisplay 46)};
    (findDisplay 46) displayAddEventHandler["KeyDown",
    {
        params["_disp","_key"];
        if(player inArea "nofirezone") then {
            if(_key in inputAction "Fire" || _key in inputAction "Throw") then {
                true;
            };
        };
    }];
};
#

this'll cover it completely.

open star
#

I mean, beats what I was gonna do, I'll give er a try.

open star
#

You ever go into BI inputActions and wonder why they named the things they did?

#

Fire Weapon, class name is "defaultAction"

high marsh
#

ยฏ_(ใƒ„)_/ยฏ

#

likely a button to do whatever action in the context of another

open star
#

No because the action "fire" is for commanding your team.

#

Oh I'm getting a generic error in expression..

#

Where though

high marsh
#

name is defaultAction though you're right

#

probably: if nothing else. Shoot at it.

open star
#

Yeah, changed all that however whenever I press G or Shoot now, the error pops up

high marsh
#

what error.

open star
#

generic error in expression, it's in the if statement for input actions.

high marsh
#

oh, duh. Hold on

#
if(canSuspend) then {
    waitUntil{!isNull (findDisplay 46)};
    (findDisplay 46) displayAddEventHandler["KeyDown",{
        params["_disp","_key"];
        if(player inArea "nofirezone") then {
            if(_key in actionKeys "defaultAction" || _key in actionKeys "throw") then {
                true;
            };
        };
    }];
};
open star
#

That's exactly what mine looks like.

high marsh
#

actionKeys or inputAction, I don't see anything wrong.

open star
#

Well now, I haven't tried actionKeys

high marsh
#

inputAction was wrong, that just returns the state of the key. 0 for not pressed, 1 for pressed

#

actionKeys I feel is better because someone can bind their weapon fire button to something else but you can still script functionality to whatever they bind it to

open star
#

fair enough.

#

Well it's stopped me from throwing grenades, as for shooting my gun, nada.

high marsh
#

Oh, of course. Because the mouse isn't a KEY. AAAh. my brain

open star
#

Yeah....

#

I just realized that too lmao

#

I was like "wait mouse isn't a key"

#

MouseButtonDown?

high marsh
#

yes

#

not sure if you can override input though

#
if(canSuspend) then {
    waitUntil{!isNull (findDisplay 46)};
    (findDisplay 46) displayAddEventHandler["KeyDown",{
        params["_disp","_key"];
        if(player inArea "nofirezone") then {
            if( _key in actionKeys "throw") then {
                true;
            };
        };
    }];
    (findDisplay 46) displayAddEventHandler["MouseButtonDown",
    {
        params["_disp","_button"];
        if(_button isEqualTo 0) then {
            if(inputAction "defaultAction" > 0) then {
                true;
            };
        };
    }];
};

would look like this

#

doesn't look like you can override it like you can with KeyDown and KeyUp

open star
#

Yeah... hmm..

#

Can I force an action then perhaps?

#

ACE has the Safety keybind keys, I can just force that fnc while they're in the zone.

high marsh
#

https://github.com/acemod/ACE3/blob/master/addons/safemode/functions/fnc_lockSafety.sqf something in here idk

#

Nah

open star
#

Well I have to check if they're in the zone.

timid olive
#

Thanks @high marsh

high marsh
#

๐Ÿ‘

#

@open star

player addAction["",{},[],0,false,true,"DefaultAction","player inArea 'nofirezone'"];
#

works great

open star
#

That's hilarious.

fair drum
#

why not do a disableUserInput that has a addaction attached to whoever is doing the briefing? then they can reenable it

high marsh
#

because that disables, ALL. user input.

fair drum
#

ah i see, can't put it on specific people

#

bummer

high marsh
#

yes, yes you can

#

why hold them hostage though.

open star
#

I don't care if they run around or do stupid animations.

#

I'm just trying to stop them from killing each other.

high marsh
#

I mean, if you don't care about ammo. Just disable damage.

fair drum
#

even better, just disable damage, and if they waste ammo, don't give them more

#

make them suffer

high marsh
#

ยฏ_(ใƒ„)_/ยฏ

open star
#

They have access to the Arsenal anywhere at any given time while at base.

#

I made a Self Interaction to open the Arsenal RubySmile

fair drum
#

if i did that, ops would take an additional 2 hours lol

open star
#

Barbie Doll?

fair drum
#

my playerbase is pretty dumb

open star
#

I mean, I can show you how I did it, it's pretty great if I do say so myself

thick chasm
#

any script to respawn in aircraft carrier well? because if I put a repsawn I will spawn in the water..

timid olive
#

Raise the respawn up on the Z axis

thick chasm
#

no, it isn't easy

#

i need scripts

open star
#

If you're using Custom Respawn with something be called "respawn_west" there is only way I know how.

#

You need some sort of object, that has a Vertical Positional Data, make the Variable Name respawn_west or whatever side you want to respawn.

#

Then in the special states, you can uncheck, simulation, show model, and damage. then you'll have an "invisible" object that is only there for Positional Data.

winter rose
#
private _marker = "respawn_marker";
private _altitude = 15;
_marker setMarkerPos (getMarkerPos _marker vectorAdd [0,0,_altitude]);
``` @thick chasm
thick chasm
#

thanks @winter rose

still forum
#

@high marsh
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/initServer.sqf#L2
forEach (allUnits - [allPlayers]) might/should work
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_addBlitz.sqf#L2
ParamsArray? wuht?
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_boundary.sqf#L2
add a sleep, checking every 2 seconds is probably fine?
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_nameTags.sqf#L3
Recommended to not be used anymore, use addMissionEventHandler instead, also use Draw3D for icon drawing.

name _x != "Error: No unit"
That bug will get fixed afaik.
nearObjects should be fine, you don't need them sorted.
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_playerLoadout.sqf#L10
comment does nothing but waste performance, just use //

winter rose
#

(use BIS_fnc_getParamValue @high marsh)

high marsh
#

@winter rose @still forum Thank you! ๐Ÿ‘

pliant stream
#

@still forum there's a nice transform for your optimiser: strip comment <constant-expression> :p

queen cargo
#

some binary sqf format > sqf optimizer (as then optimization can be done during binarization)

still forum
#

yeah I'd like sqfc support, but thats very unlikely to happen

queen cargo
#

thats sad tho

#

but again, I could easily use SQF-VM to generate code that is optimized

open star
#

So @high marsh we've run into an issue >:D

#

When you respawn or die, the action no longer activates.

high marsh
#

Right, addAction won't persist. You need to add it on respawn.

open star
#

Aye, how would I do that.

high marsh
#

simplest. Create a file in your mission called onPlayerRespawn.sqf . Its an event script. It'll run whenever a player respawns.

open star
#

I see.

potent dirge
#

Hi guys, of what use is BIS_fnc_taskAttack? I can't see any difference between this and simply doing _group addWaypoint [_pos, 0] setWaypointType "SAD"

winter rose
#

check if there are any in the Function Viewer? From the wiki, it seems not a lot of difference indeed

potent dirge
#

Yeah I read the details in the function viewer, I'm just wondering why BI added a seemingly redundant function or maybe they were planning to add more to the function and forgot?

open star
#

DLC func

#

It's just awkward redundancy

winter rose
#

not DLCโ€ฆ it was Arma 2

potent dirge
#

Makes me wonder if there are other "pointless" functions in Arma's library think_turtle

warm hedge
#

Look at BIS_fnc_selectRandom ๐Ÿ™‚ (I know this was still a thing because of backward compatibility)

peak plover
#

Hello, I tried to use inputAction 'optics' and it never returns anything other than 0

#

I am unable to determine when the player is attempting to ADS

#

I need to know when the player is starting to ADS, right when they press RMB, before cameraView changes to GUNNER

warm hedge
#

Tried opticsTemp?

peak plover
#

This is an issue with RMB

#

Yes, tried all


        systemChat str (inputAction 'optics');
        systemChat str (inputAction 'opticsTemp');
        systemChat str (inputAction 'opticsMode');
warm hedge
#

Ahh, so this is an issue then? Didn't noticed

peak plover
#

I just found out :(, this is extremely disturbing

warm hedge
#

And looks they're not interested with

peak plover
winter rose
#

ah yes, iirc inputAction on mouse is not followed

peak plover
#

Any alternative way to detect when player has started to ADS (before cameraview)

gleaming mural
#

@warm hedge I really like the idea of your "Plane Loadout Everywhere"
But I were wondering if it would be possible to make it compatible with any kind of vehicle (air/ground/water). With the possibility to choose the weapon's loadout from a position ( gunner / cannon / chief crew etc..) like Zeus Enhanced's vehicle loadout but without the charge of being in zeus and making it more consistant in the logistic procedure.

tough abyss
#

I've got a quick question with a little backstory, I started looking into a negative towards the body armor in my unit's modpack, all of our armor is modified to the point where bullets deal bruises and pain (if that specific body armor can stop the round that's fired at it), but the person usually caries on, even when hit by some really heavy-hitting rounds, keep in mind we use ACE like most other units.

Now, I've thought of a knockback mechanic, that it would do the trick, I want to know if it's doable to create a mechanic such as that.

I figured theoretically, I could link it so that if the caliber is > x, then it would turn the player/AI into a ragdoll state, and bring them back after 3-5 seconds.

Since I primarily do config editing, retexturing and modelling, I was hoping to get an answer from you scripters if such a system is possible, and if you have any tips for creating such a thing, thank you in advance

warm hedge
#

make it compatible with any kind of vehicle (air/ground/water)
No

gleaming mural
#

Argh, painful, but thanks for the quick response

#

Have a great day

winter rose
#

no u

#

(and don't tell me how to live my life!!1!)

potent dirge
#

@tough abyss there's a stagger mechanic used in Project Injury Reaction that is triggered when you are near explosions, maybe you can look into that. Also, isn't there something like a knockback mechanic when someone gets hit by a vehicle and doesn't die? Although it may need some physics tampering to work for your needs

tough abyss
#

Hm, didn't know that, will look into, and there is a 'Realistic Unit Ragdoll' mod out there, but it doesn't work as for my unit's needs really

potent dirge
#

@peak plover maybe add an EH for cameraView that stops camera change, run your script then change cameraView for player? It sounds like a bad idea but it's all I can offer

fair drum
#

should I be making functions instead of execVM everything?

winter rose
#

if you execVM them once, no issue.
if you do it many times, yes, definitely

#

execVM reads from the HDD, preprocesses, compiles then runs the code, every time
a function does it all once and only runs the code on further calls

fair drum
#

so for something like a script that forces players back into fpp except for when they are in vehicles should be a function if its called in the initPlayerLocal?

#

since its going to be run a bunch of times?

winter rose
#

whatever it does
is it execVM'd multiple times, or not?

#

or is there a while do loop in there

fair drum
#
while { sleep 0.5; true } do {

    if ((cameraOn == player) and (cameraView == "EXTERNAL")) then {
        player switchCamera "INTERNAL";
    };
};
winter rose
#

so it is execVM'd once

fair drum
#

but i'll have to run it on initplayerlocal and in onplayerrespawn right? does it go away in the initplayerlocal if they die?

open star
#

Isn't there a setting specifically for what you're doing.

fair drum
#

only in dev branch

open star
#

That allows third person in vehicles, but is forced first person otherwise.

fair drum
#

its not out yet i don't think

open star
#

I definitely believe it's out, and been out for 2 some years..

#

It's what I've been doing at least.

fair drum
#

thirdPersonView = 1; // 3rd person view (0 = disabled, 1 = enabled, 2 = enabled for vehicles only (Since Arma 3 v1.99))

we are still 1.98 i believe

open star
#

Mate... we're on 3.0 something.

winter rose
#

1.98 release, 2.01 devBranch

fair drum
#

Required game version: 1.98.0 is what the up to date server is currently running without dev branch

open star
#

I garuntee you even on 1.98 that thirdPersonView = 2 ยฏ_(ใƒ„)_/ยฏ

#

has worked for 2 years.

#

and I'm not running dev branch.

#

nor is probably any of my playerbase.

fair drum
#

if it did, there would be an option in the custom difficulty menu, right now 3pp is toggle on or off. no sense making it only available to a server config when there are plenty of people that leave their servers on regular then the admin switches to his custom difficulty he set up in the menus

open star
#

Well if it's any consolation I just checked, and I can only access thirdPerson while in the vehicle, and that's using the custom difficulty setup in server.cfg

#

Running the latest build, I'm not saying you're wrong I'm just saying it works for me.

winter rose
#

vanilla?

#

Running the latest build
release branch I take, not dev?

open star
#

Aye.

#

1.98.34-

fair drum
#

my server is 1.98.0

potent dirge
#

Is there a way to check if any unit within a group has had behaviour changed to combat. Emphasis on any.
Currently the only way I can think of is creating multiple waitUntil threads for each member of the group, but that seems very performance intensive

winter rose
#
units _group findIf { behaviour _x == "COMBAT" } != -1
```@potent dirge
potent dirge
#

Never heard of findIf till now. Thanks ๐Ÿ‘

finite sail
#

findif is brilliant

winter rose
#

takes some time to get it, but it's brilliant, needed, performant and now irreplaceable

finite sail
#

ya

#

ar you missing a select command from that line?

#

no, you'r e not

#

just checking ๐Ÿ™‚

#

๐Ÿป

#

note that Lou's code will return the first group member that is in combat mode

#

not all of them

#

units group select {behaviour _x == "COMBAT}

#

will return all

winter rose
#

my code will return true or false, that's it

potent dirge
#

Thanks alot guys really made my life easier

potent dirge
#

One more thing can breakTo be used in a switch-do structure?

winter rose
#

omg

#

what exactly are you trying to do? (it should work, but should you do it this wayโ€ฆ)

finite sail
#

ive never used breakto and once said it was bad practice. killzonekid told me off

potent dirge
#

Trying to evaluate the typeName of a parameter and execute a code block depending on what type it was. I'm guessing breakTo is a bad idea

winter rose
#

use isEqualType

finite sail
#

yep

winter rose
#
if (_var1 isEqualType 0) then
{
  hint "number";
} else {
  hint "NaN";
};
potent dirge
#

Thanks

#

Quick question. In a case where I had more than two possible cases how would I use breakTo without chaining ifs

finite sail
#

use select like i wrote earlier

#

that will return an array of all the group units who are in combat mode

broken forge
#

When i try to add tickets to the players with "[west, 5] call BIS_fnc_respawnTickets;" it works completely fine but if they're out of tickets and it says "no respawns available" and then i add the tickets they still can't respawn... Anyone know a fix?

#

it comes up with an error saying something about _deathtime being missing

#

and when I try to use setPlayerRespawnTime 5; it ignores tickets completely, letting you respawn even if you have none

potent dirge
#

@finite sail oh no this isn't concerning the group behavior it's evaluating a function parameter whether the parameter is of type group or type object/unit and running a particular code block depending on which

finite sail
#

ok

potent dirge
#

I think I might be using breakTo like goto which is why it's not working. Can breakTo jump to code that is ahead of it?

finite sail
#

surely you can only breakto a code that already defined?

#

so, not ahead of it

#

or are you using it in a loop?

potent dirge
#

No not in a loop

finite sail
#

it cant be defined than

winter rose
#

@potent dirge breakTo goes to a scope, not a specific line

potent dirge
#

Is there a goto alternative for sqf?

winter rose
#

ab-so-lutely NOT

#

like, don't.

#

Think of the raptors!

potent dirge
#

There really is an xkcd for everything

winter rose
#

but yeah, don't use goto, 99.9999% of the time it is not needed

#

structure the code in a better way instead ๐Ÿ™‚

potent dirge
#

Alright I'll figure something out

finite sail
#

you should structure your code

#

coming from 1990s BASIC, it was a heard lesson to learn

potent dirge
#

QBASIC was my first language, so I know your pain kind of

broken forge
#

could someone help me with tickets plz ๐Ÿ™‚

winter rose
#

no bump every 10 minutes! derpWolf
add the tickets before they reach 0, I suppose
I don't think this system has been thought to work the way you want to

broken forge
#

I've seen other groups have it work this way but just don't know how to work arount it myself

#

also it was 26 minutes after my first message

winter rose
#

still
Well, wait for people who know how, because I don't

potent dirge
#

I figured it out. I used a function within the function, works great. Thanks guys

fringe yoke
#

Does anyone know if it is possible to change the player's name in the top right of the map?

winter rose
#

it might be, through idd 12
what do you want to set?

fringe yoke
#

I want to change the players name to a custom string

#

I tried

class RscDisplayMainMap {
    class controls {
        class TopRight: RscControlsGroup {
            class controls {
                class CA_PlayerName: RscText {
                    onDraw = QUOTE(_this call FUNC(mapPlayerName));
                };
            };
        };
    };
};
#

but no luck so far

#

tried onDraw and onLoad

#

The function is just

params ["_control"];
_control ctrlSetText "My String";
winter rose
#

wait, where did you put this

fringe yoke
#

config.cpp in an addon

winter rose
fringe yoke
#

ah ok, so do I repost this there then?

willow hound
#

unit setName [name, firstName, lastName]; changes that name (the one on the map too), but not the rank.

winter rose
#

let's delete everything from here then

fringe yoke
#

setName doesn't work in multiplayer

willow hound
#

?

fringe yoke
#

In Arma 3 this can be used to set name of a person but only in single player.

willow hound
#

Curious and unfortunate.

fringe yoke
#

Very

fringe yoke
#

Is there a way to get the local player's steam ID without having a player object? Like from the main menu

winter rose
#

getPlayerUID only

fringe yoke
#

darn, Seems kinda weird to have profileNameSteam but no way to get the ID

hollow thistle
#

yeah. Maybe @still forum can help bloblurkinglenny

still forum
hollow thistle
#

๐Ÿƒ

still forum
hollow thistle
#

I also wanted to use it for something in main menu and was bit disappointed it's not a thing.

still forum
#

should just always return local steamid if not in MP

hollow thistle
#

returns _SP_PLAYER_

#

and "" for objNull, there can be no player in main menu ๐Ÿค”

winter rose
#

create one?

#

there is a scene behind

hollow thistle
#

There can be none.

winter rose
#

createUnit + selectPlayer = player unit

hollow thistle
#

And how does it help? you still can't get the steam uid

winter rose
#

ah yeah, doesn't work in SP

#

tru tru

hollow thistle
#

yeah :<

fringe yoke
#

It would be nice to have a profileIdSteam command or something

#

ยฏ_(ใƒ„)_/ยฏ

winter rose
#

mod the main menu so it starts a local MP server

fringe yoke
#

๐Ÿ˜

#

Not too worried about it though, I was able to get my thing working

#

The name is set by the engine, couldn't get it to change. So I just hid it and put my own RscText where it was

#

ez

winter rose
#

Hide by putting the control in front of it?

fringe yoke
#

fade = 1;

winter rose
#

and while you had a reference to it, you could not change it?

fringe yoke
#

Yeah, I could do ctrlSetText "test" then ctrlText would report "test"

#

but it would be unchanged

#

seen it before, it's weird

winter rose
#

Weiiird, but hey

fringe yoke
#

ah nevermind no I didn't, but I had to do it somewhere before ยฏ_(ใƒ„)_/ยฏ

stark granite
#

Hey boys me again, having a little trouble wrapping my head arround some stuff. So. Is there any way currently, to add options to the respawn menu screen, then rather than calling CfgRespawnInventory running a script to add a custom loadout instead? So still use cfgRoles I did notice cfg respawn templates on the wiki but wasn't sure if myTag_beacon referred to role or not. Otherwise I could use on player killed and on player respawn for those selected roles.

I did discover another option, which was to have them select roles based Purley on the name, spawning them with a random item or weapon, then using a script to detect that item to choose which script to run to deppy the custom loadout, as seen here: https://youtu.be/3-igwA8JBm4.

Though ideally the above method, if possible, would be prefered.

Put simply, I'd like to use the loadouts exported from the virtual arsenal, in my missions, avilable from the loadout selection menu on respawn, without having to join and use the zeus feature to add avilable loadouts.

I have ofc discovered using add actions to do this in onPlayerRespawn, but its buggy and rather inconvenient

severe vapor
#

I am hoping someone here can save me some sanity. I am trying to give all players in my mission an addAction. I have not had much luck getting it to work though. I found BIS_fnc_MP online and even on the wiki for the function it shows adding action for players.

[[player,
[  
  "<t color='#0000FF'>Play Bonus Song</t>",  
  {  
     ROOK_bonus1 = true;  
     publicVariable "ROOK_bonus1"; 
  },  
  nil,  
  1.5,  
  true,  
  true,  
  "",  
  "!ROOK_bonus1",  
  50,  
  false,  
  "",  
  ""  
]], "addAction", true, true] call BIS_fnc_MP;

When I execute this running locally it works for me, but no other players see the option. I also see the option again if I look at the other players. It behaves exactly like just calling the addAction locally. Also this mission will eventually be hosted on a dedicated server if that effects things. Any Ideas on how to get this to show up for all players in the game?

solemn gorge
#

Need help with Warlords! I'm looking to use _truck setAmmoCargo 0.5; to balance out ammo truck spam . Anyone know how this is done from within the mission?

open star
#

Well, you need to either run the script locally on all clients or globally

severe vapor
#

I tried all the options in the debug console and they all had the same effect. No one else was able to see the option. The ultimate goal is to have a trigger add it

open star
#

I for one am confused.

#

The way this is setup does not follow at all, BIS_fnc_MP

exotic flax
#

Does this work?

[
   player,
   [
      "<t color='#0000FF'>Play Bonus Song</t>",  
      {  
         ROOK_bonus1 = true;  
         publicVariable "ROOK_bonus1"; 
      },  
      nil,  
      1.5,  
      true,  
      true,  
      "",  
      "!ROOK_bonus1",  
      50,  
      false,  
      "",  
      ""
   ]
] remoteExec ["addAction", -2, true];
open star
#

In hindsight mine isn't going to work for what you want to do, I believe.

#

*I didn't see that you wanted it added via trigger.

severe vapor
#

Thank you both. I'll give that a try when I can get my friend to join up to test it

graceful kelp
#

this is a script for a fletchet hydra does anyone have a script that i could use in a similar way for thermobaric hellfires

`_m255 = _this select 0;
_heli = _this select 1;

sleep 0.5;

if(alive _m255) then
{
_rand = 30;
_offset = _rand / 2;
_burstdist = 500;
_counter = 0;
_rocketposX = (getpos _m255 select 0);
_rocketposY = (getpos _m255 select 1);
_rocketposZ = (getpos _m255 select 2);
_velm255 = velocity _m255;

if(player in _heli && !(isNull fza_ah64_mycurrenttarget)) then {_burstdist = (fza_ah64_mycurrenttarget distance _heli) - 150;};

waituntil{(_m255 distance _heli > _burstdist)};

_rocketposX = (getpos _m255 select 0);
_rocketposY = (getpos _m255 select 1);
_rocketposZ = (getpos _m255 select 2);
_velm255 = velocity _m255;

drop [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 9, 1], "", "Billboard", 0.5, 5, [0,0,0], [0,0,0], 0, 0.7, 0.5, 0, [8,16,24,32,36], [[0.4,0,0,0.8],[0.4,0,0,0.7],[0.4,0,0,0.6],[0.4,0,0,0.5],[0,0,0,0]], [0], 0.1, 0.2, "", "", _m255];

while {(_counter < 70)} do
{
_mpsm = "fza_flec_cluster" createVehicle [_rocketposX + ((random 30) + (random -30)),_rocketposY + ((random 30) + (random -30)),_rocketposZ + ((random 5) + (random -5))];
_mpsm setdir (direction _m255);
_mpsm setvelocity _velm255;
_counter = _counter + 1;
sleep 0.003;
};
};`

frigid oracle
#

I have an issue where addacitons are duplicating themselves and not syncing it's current state to other clients. Im not experienced at all with arma scripting so I can only assume im using remoteExec/ExecVM incorrectly

fair drum
#

show me what you got

frigid oracle
#

in my init.sqf I have

_handle = execVM "scripts\dd1\dd1_generic_actions.sqf";

and here is one of the addactions from the sqf im refrencing in the init.

[dd1_multibox_close01, ["Open", {
    dd1_multibox_open01 hideObjectGlobal false;
    dd1_multibox_close01 hideObjectGlobal true;
    (_this select 0) say3D "container_case_open", 5;
    (_this select 0) removeAction (_this select 2);
  },  [], 6, false, true, "", "", 2]] remoteExec ["addAction", 0, true];
#

I'm now thinking I'm probably doing some sort of redundancy with exec. (also if this type of script is men't to go to #arma3_scenario please correct me.)

fair drum
#

alright give me a sec to look it over

#

so why are you remote exec this?

frigid oracle
#

what im trying to find out is how to sync the status of the action to other clients

#

and addaction is local so I guess im trying to find a roundabout way to making global

#

the effect I'm trying to do is for example if one person presses a button and it makes a sound everyone else hears the sound

fair drum
#

so you want a player to walk up to said box, and when it opens, does a custom sound that everyone can hear?

frigid oracle
#

well more than that but yeah

#

am I not being specific enough?

fair drum
#

nah its fine. doing some other stuff rn as well. so the addaction on the box is going to be global. so do your addaction as normal, but with the say3d, that is what you want to remoteExec

frigid oracle
#

i see, and making the whole addaction not exec would remove the duplication issue?

fair drum
#

yes so here is what is happening. placing the addaction on the object is global so that is one instance. now when you remote exec it, you are doing "0" which means runs on server AND clients. so now you have 1 instance for the server, and x amount of instances for however many clients there are

#

so with 20 players, you get 21 addactions the way you do it

frigid oracle
#

i see makes sense

fair drum
#

now if you placed the addaction on a player, that would be local

#

so try rewriting your addaction as normal, explained on the wiki, then when you get to the say3d, put that as your remote exec

frigid oracle
#

Thank for you the lead will do

orchid stone
#

There a way to make this ignore DLC weapons?

orchid stone
#

or perhaps another way with this approach?

#

found it after refining my discord search-foo. _x >> "DLC" is the answer

warm hedge
#

"DLC" doesn't refer to actual DLC requirements though

fair drum
#

post your final line zacho. i like to see answers on here

quaint oyster
#

What would be the best way to make a timer which executes something if its not extended??
For example, I'm making a script which is similar to UT2004 and Overwatch etc that say "double kill, triple kill, quad kill" etc, I have that part working, but I need to make a timer that resets the killstreak count after X amount of time, but I'd like to extend said timer when you actually get a kill, that way 3 minutes later you're not getting a triple kill off someone you killed a while ago.

fair drum
#

you using the "killed" event handler?

quaint oyster
#

I have a killed event handler in use in another file which will call the script below that I'm going to add to the comment. Currently it works like this, you get a kill, kill handler launches an external file which has the code below in it, I'm trying to make the code have a timer that gets started after every kill, which will eventually reset the killstreak variable, that all works fine currently, but I'm not sure how to make a timer which can be extended....

//adds to the killstreak variable
_killamounttotalupdated = player getVariable ["killstreakcount",0];
player setVariable ["killstreakcount",(_killamounttotalupdated + 1)];
_killchainsfx = player getVariable ["ALREADYrunningsfx", 0];

//resets the killstreak variable
if(_killchainsfx isEqualTo 0) then {
player setVariable ["ALREADYrunningsfx", 1,true];
sleep 15;
player setVariable ["killstreakcount", 0,true];
player setVariable ["ALREADYrunningsfx", 0,true];
};

//killstreak sound effects that change based on kill number
if (_killamounttotalupdated isEqualTo 1) then {
    playsound "killsound_original_kill2";
};

if (_killamounttotalupdated isEqualTo 2) then {
    playsound "killsound_original_kill3";
};

if (_killamounttotalupdated isEqualTo 3) then {
    playsound "killsound_original_kill4";
};

fair drum
#

check out diag_tickTime

#

and store them separately in their own variables

quaint oyster
#

is there by chance any scripts that you know of using that function that I can look at and study? the wiki entry doesn't tell me a whole lot

fair drum
#

I'm not amazing at it either, but its something to at least get an idea going

quaint oyster
#

interesting.. i'll see if i can't mess around with that and repurpose it at the very least