#arma3_scripting

1 messages · Page 677 of 1

drifting portal
#

ok

fair drum
#

you said it was the t-14 right?

drifting portal
#

yes

#

RHS

fair drum
#

yay since I don't want to load that up and go config searching, you need to find the magazine that vehicle holds, once you have that, find the turret and match that magazine, THEN get me the classname of the cfgAmmo value

#

or actually to make it easier on you give me a sec

drifting portal
#

DUDE

#

I already have the game loaded

#

give the code

#

lol

fair drum
#

i need a class name of the projectile that comes out of the turret when that weapon is fired. you can either start searching for me or wait lol

drifting portal
#

so

fair drum
#

its is not the magazine class name, or the ammo class name

drifting portal
#

as far as I know you could copy pylon settings

#

would that help?

fair drum
#

just... hold on lol

drifting portal
#

idk I would like to help

#

and not get trolled by a french developer lol

hushed tendon
#

notlikemeowcry No one has any advice for me

fair drum
# drifting portal idk I would like to help

put this in the vehicle init box, and fire the weapon. then paste the result

ammoProjectiles = [];

this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

    ammoProjectiles pushBack typeOf _projectile;
    copyToClipboard str ammoProjectiles;
}];
drifting portal
#

ok

#

but before I do that

#

I found something

#

428099: shell_tracer_red.p3d

winter rose
#

gotcha

drifting portal
#

thats what I got several times

#

fragments?

#

well

#

it printed the same thing

#

with different id this time

drifting portal
#

but simpler

#

lol

winter rose
#

@hushed tendon```sqf
private _players = allPlayers;
if (_players isEqualTo []) exitWith {};
_players = [_players] call BIS_fnc_arrayShuffle;
private _lurker = _players deleteAt 0;
private _runners = +_players;

fair drum
drifting portal
#

oh well

#

["rhs_ammo_3of26"]

#

thats boring

#

literally the same thing on display screen

#

lol

#

["rhs_ammo_3of26","rhs_ammo_3of26","rhs_ammo_3of26"]

#

I think it repeated itself because I shot 3 times

copper raven
#
private _runners = allPlayers;
if (_runners isEqualTo []) exitWith {};
private _lurker = _runners deleteAt floor random count _runners;
drifting portal
winter rose
dreamy kestrel
#

Q: I am looking for nearestObjects of "Building" classes. That is all well and good.
I can use configOf for the objects themselves and gain knowledge of their 3D dimensions? Height, width, etc?

hushed tendon
copper raven
#

So this is defining the _runners , selecting one to be the _lurker, and removing the _lurker from the _runners array?
yep

hushed tendon
#

Maybe I just need to give a sleep so it can process the code

hushed tendon
#

Nope. Even with a sleep and that new bit of code the person who is supposed to be the _lurker (I can tell by them being dressed up) is still getting killed when I kill all _runners.

copper raven
#

can you send some code? because that can't happen

#

_lurker is not in _runners

hushed tendon
#

I know it's weird

copper raven
#

so unless your "players" array isn't unique, it's nonsense

winter rose
#

Or you are running the code multiple times.

#

dun dun dunnn

hushed tendon
#

I have it in a function here, it could just be the function. Wait one for the whole bit of code

fnc_definePlayers = {
params ["_runners"];
if (_runners isEqualTo []) exitWith {};
private _lurker = _runners deleteAt floor random count _runners;

sleep .5;

hint str(_runners);
{_x setDamage 1;}forEach _runners;
};

private _players = [p1,p2,p3];
[_players] call fnc_definePlayers;
hushed tendon
drifting portal
winter rose
fair drum
# drifting portal thank you

try this

private _buildings = nearestTerrainObjects [[0,0,0], ["HOUSE"], 100000];

_buildings apply {

    _x addEventHandler ["Dammaged", {
        params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"];
    
        private _skipProjectiles = [ //array of ammo classnames that have fragmentation
            "rhs_ammo_3of26"
        ];

        _skipProjectiles = _skipProjectiles apply {
            toUpperANSI _x
        };

        if ((toUpperANSI typeOf _projectile) in _skipProjectiles) exitWith {diag_log format ["%1 projectile skipped", typeOf _projectile]};

        if !(gunner _shooter isEqualTo []) then {
            if (_damage > 0.5 && isPlayer (gunner _shooter)) then {
                counter = (counter + 1);
                publicVariable "counter";
                systemChat ["%1 shot %2",name (gunner _shooter)];
            };
        };
    }];
};
drifting portal
fair drum
#

i figured you're going to run into more fragmentation based projectiles so i made a section so you can add them

drifting portal
#

yes I would

#

thanks

#

its russian army, everything is frag

hushed tendon
copper raven
#

wait what

hushed tendon
copper raven
#

so if you run the code in debug, does it work as you expect it to, or no?

drifting portal
hushed tendon
#

It works but I still run into the same problem of the person dressed as the _lurker sometimes dying

copper raven
#

that has nothing to do with the function

hushed tendon
#

even though I'm only killing off those who are in the _runners array

fair drum
copper raven
#

you also don't return the lurker from the function, instead you run selectRandom later at line 19

#

so you roll the dice again, which obviously has a small chance of matching what the function randomly picked

fair drum
drifting portal
#

yes

fair drum
drifting portal
#

["rhs_ammo_3of26","rhs_ammo_3of26","rhs_ammo_3of26","rhs_ammo_3of26"]

#

look

drifting portal
hushed tendon
fair drum
#

place in "run" windows line

drifting portal
fair drum
copper raven
# hushed tendon Dammit. Was not checking any other parts of my code
fnc_definePlayers = {
    params ["_runners"];
    if (_runners isEqualTo []) exitWith {};
    private _lurker = _runners deleteAt floor random count _runners;
    { _x setDamage 1 } forEach _runners;
    _lurker // return
};
 
private _players = [p1,p2,p3];

private _lurker = [_players] call fnc_definePlayers; // use it now
 
_genSpawn = selectRandom [genSpawn_1,genSpawn_2,genSpawn_3];
_gen = createVehicle ["Land_Portable_generator_F", getPosATL _genSpawn, [], 0, "CAN_COLLIDE"];
_gen enableSimulationGlobal false;
drifting portal
#

is at 5pm

#

the last file

#

f

fair drum
#

thats fine

#

open it. its based on when you open the game

hushed tendon
drifting portal
#

no project destroyed

fair drum
#

skipped

drifting portal
#

yes

#

nothing

#

:(

#

don't bang your head

fair drum
#

eh it is what it is. go finish the rest of your mission and we might revisit it later. I'm going out.

drifting portal
#

alright thank you

#

hope I didn't raise your blood pressure lol

fair drum
#

pm me exactly what you copy pasted

#

cause there were a few edits I made since I first posted it. don't know if you got those

elder sail
#

Would BIS_fnc_storeParamsValues & BIS_fnc_getParamValue be the correct way to call upon a mission parameter value? I'm trying to make a script conditional on whether a parameter is set to on/off and I'm a little confused as to how to pull the value from the parameter. Been looking for examples without much luck

robust hollow
#

you would only need to use BIS_fnc_getParamValue, BIS_fnc_storeParamsValues runs automatically

elder sail
#

Edit: I'm incredibly dumb.
I had quotation marks in the wrong place.
It all works now. blobcloseenjoy

hushed tendon
#

I'm trying to make the name of the spawned generator change based on the number of the for loop. I'm almost certain this won't work so I'm looking for advice.

_generators = []
fnc_setupGenerators = {
    params ["_numGenerators","_genSpawns"];
    for "_i" from 1 to _numGenerators do { systemChat str _i; 

    _genSpawn = selectRandom _genSpawns;
    _gen = "_gen_" + _i;
    _gen = createVehicle ["Land_Portable_generator_F", getPosATL _genSpawn, [], 0, "CAN_COLLIDE"];
    _gen enableSimulationGlobal false;

        _generators = _generators + _gen; 
    };
};

The first time the loop runs I'm hoping for _gen to equal _gen_1, with the second run making _gen be _gen_2. This is so I can name each generator spawned a different name so I can manipulate each one individually.

fair drum
#

kinda interesting to see another person making a dead by daylight game. I saw another earlier this week that was looking for help on one too. grabs popcorn may the race begin!

fair drum
robust hollow
fair drum
#

is there a way to test network load on a server? trying to see how network intensive some of my scripts that contain public variables are.

drifting portal
#

for all ACE 3 guys out there
is there a way to find how many fragments does a shell produce? according to there variables:
ACE_damageType = "shell";
ace_frag_charge = 3200;
ace_frag_gurney_c = 2440;
ace_frag_gurney_k = "1/2";
ace_frag_metal = 16000;
ace_rearm_caliber = 125;

hushed tendon
robust hollow
#
_generators = [];
fnc_setupGenerators = {
    params ["_numGenerators","_genSpawns"];
    for "_i" from 1 to _numGenerators do { 
        systemChat str _i; 

        _genSpawn = selectRandom _genSpawns;
        _gen = createVehicle ["Land_Portable_generator_F", getPosATL _genSpawn, [], 0, "CAN_COLLIDE"];
        _gen enableSimulationGlobal false;

        missionNamespace setVariable ["_gen_" + str _i,_gen];
        _generators pushBack _gen; 
    };
};
foggy hedge
#

Can someone explain why and how addWeaponGlobal is broken (especially since addMagazineGlobal was apparently fixed in 2.00) and whether to use addWeapon or addWeaponGlobal if I'm doing a forEach allPlayers?

warm hedge
#

How did you do, I said?

foggy hedge
#

Right now I'm just wondering why the wiki page for it has a big "broken" sign on it, came across it as I was learning inventory commands since I want to wipe player inventories for a deathmatch race event at the end of the mission

#
private _headlessClients = entities "HeadlessClient_F";
private _humanPlayers = allPlayers - _headlessClients;
{
    removeAllItems _x;
    removeAllWeapons _x;
    _x forceaddUniform "Dominos_Uniform";
    _x addVest "V_PlateCarrierSpec_blk";
    _x addWeapon "hgun_test_pistol_f";
    _x addMagazine "TAS_6Rnd_00Buck";
    _x addMagazine "TAS_6Rnd_00Buck";
    _x addMagazine "TAS_6Rnd_00Buck";
    _x addMagazine "TAS_6Rnd_00Buck";
    _x addMagazine "TAS_6rnd_Slug";
    _x addMagazine "TAS_6rnd_Slug";
    _x addMagazine "TAS_6rnd_Slug";
    _x addMagazine "TAS_6rnd_Slug";
    _x addMagazine "TAS_6rnd_Slug";
    _x addMagazine "TAS_6rnd_Frag";
    _x addItem "FirstAidKit";
    _x addItem "FirstAidKit";
    _x addItem "FirstAidKit";
} forEach _humanPlayers;

this seems to work but not sure if it'll work in dedi, also not finished

warm hedge
#

Those commands are all global AFAIK so will work

foggy hedge
#

hmm alright thx

worthy spade
#

How do I get the name of the current terrain?

digital jacinth
#

That however is the internal name and not the one the user sees

worthy spade
#

What is the internal name? Is is the same as the ending on mission files?

digital jacinth
#

correct

worthy spade
#

Okay, thanks. I'll write a name converter.

winter rose
#

something like```sqf
getText ("CfgWorlds" >> worldName >> "displayName")

worthy spade
#

Oh yeah, that's brilliant.

winter rose
#

"description" seems to be used instead of "displayName"

tough abyss
#

is it possible to disable the global ban list for a arma 3 server without disable complete battleye

#

?

tough abyss
#

Because my friends account has global ban

winter rose
#

disable BE, that's it

tough abyss
#

yes i know but i need battleye for rcon control

winter rose
#

then your friend cannot play with you 🤷‍♂️

tough abyss
#

but i think there is a way because i played on a other server and there he also can join and they have also activated battleye

winter rose
tough abyss
#

ok thanks

worthy spade
#

Any way of looping something every one in-game second? This solution is bad as it eventually drifts away from the actual time:

while {true} do {
  sleep 1;
}

After being called a thousand times, there's a difference of a second or two from time.

proven charm
#

Use "EachFrame" EH

exotic flax
#

And instead of sleeping a full second, only sleep 0.1 seconds and check the time difference since the last time you needed the execute code.
This way you counter the fact that a frame takes longer to run.

If I recall correctly there's also a function in CBA which handles that 🤔

worthy spade
#

I want simulation time in this case, not system time which uiSleep uses.

worthy spade
# proven charm Use "EachFrame" EH
interval = 1;
counter = 0;

addMissionEventHandler ["EachFrame", {
  counter = counter + (["delta"] call BIS_fnc_deltaTime);
  if (counter < interval) exitWith {};
  systemChat format ["%1", time];
  counter = counter - interval;
}];

Outputs

1.003
2.005
3.012
4.009
5.004

This seems to work. No longer drifts away. Thanks.

vernal mural
#

is there a way to check if there is a unit seated on a given cargo position of a vehicle ? Something like _veh getUnitCargo 4, which would return objNull if the seat is unoccupied or the relevant unit otherwise ?

proven charm
#

there is the getCargoIndex command, you can use that to figure out if the position is taken

vague geode
#

Does anyone happen to know the name of the function that kills you depending on the vehicle you are in meaning it kills you with an AA missile when you are in a jet or helicopter, with an AT mine when you are in a vehicle and with an APERS mine when you are on foot.

I stumbled upon it couple of weeks ago but can't remember the name.

Edit: Found it, it's BIS_fnc_neutralizeUnit.

vernal mural
#

not very efficient

proven charm
#

no but should work

copper raven
little raptor
drifting portal
cyan dust
#

Good day. Is there any event handler for weapon change? Like "OnWeaponChanged"?

winter rose
#

nope

cyan dust
#

Pity. Thanks.

spark sun
viral basin
#

Hey there, hope you're all doing well. Does any1 know how to set a tooltip on a controls table? i can't get it to work

viral basin
#

Maybe, thank you

fluid wolf
#

This is probably pretty easy to see but I'm missing it, does anyone see what's wrong with

{_x moveinany dropship2;} foreach (group group2lead);

finite sail
#

units group group2lead

fluid wolf
#

AH ok. Right

copper raven
#

units group2lead should work too, no need for group 😉

fluid wolf
#

Awesome. Thanks!

hushed tendon
# robust hollow ```sqf _generators = []; fnc_setupGenerators = { params ["_numGenerators","_...

I'm trying to get the name of the generator in the addAction and I don't really understand how to do so.

fnc_setupGenerators = {
    for "_i" from 1 to PUB_numGenerators do {

        _genSpawn = selectRandom PUB_genSpawns;
        PUB_genSpawns = PUB_genSpawns - [_genSpawn];
        _gen = createVehicle ["Land_Portable_generator_F", getPosATL _genSpawn, [], 0, "CAN_COLLIDE"];
        _gen enableSimulationGlobal false;

        [_gen] call fnc_addActionGen;

        missionNamespace setVariable ["_gen_" + str _i,_gen];
        PUB_generators pushBack _gen; 
    };
};

fnc_addActionGen = {
    params ["_gen"];
    _gen addAction [
    "Repair", {
        systemChat str _gen; 

    }, nil, 1.5, true, true, "", "true", 15, false, "", ""];
};
robust hollow
#

systemChat str (_this#0); in the action code

hushed tendon
robust hollow
#

why?

#

_gen_1 would return the object the action is added to, same as _this#0

hushed tendon
#

I'm trying to get the generators name. Pretty much trying to find what generator it is, like if it's _gen_2.

#

I realize the systemChat str was wrong.

robust hollow
#
        private _genName = "_gen_" + str _i;
        missionNamespace setVariable [_genName,_gen];
        _gen setVehicleVarName _genName;
...
        systemChat vehicleVarName(_this#0);

this then?

#

or, maybe set a variable with the name, or parse the string as an argument to the action, or format it into the action code, etc etc?

hushed tendon
robust hollow
#

yea...

lean anchor
#

hey all having issuees getting all the compatible muzzle attachments names. I am trying with the MX and it is returning an empty array.

_pWeap = primaryWeapon player;
diag_log _pWeap;
_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _pWeap >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
diag_log _MuzzleSlot;

this outputs
19:52:51 "arifle_MX_pointer_F"
19:52:51 []

my end goal, is to after i have this array of compatible muzzle items, i would run through the players inventory and remove any that are there. im doing this to stop people having suppersorrs

#

can anyone give me a heads up as to what im doing wrong?

robust hollow
#

compatibleItems does not appear to be an array

#
configProperties[configfile >> "CfgWeapons" >> "arifle_MX_pointer_F" >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems","true",true] apply {configName _x}```
lean anchor
#

sorry for being dense

robust hollow
#

it is a config class, not an array, so that returns all property names of that class (attachment names)

warm swallow
#

Small question. Is this:

{PUB_genTotalScore = PUB_genTotalScore - 3}sqf

and this:



 {PUB_genTotalScore - 3} ```sqf

the same thing?
warm hedge
#

To use syntax highlighter, check the pinned

warm swallow
#

i tried 😦

#

its fine tho its not very large

warm hedge
#

sqf, and put Enter(break line)

fair drum
warm swallow
#

im trying to change the var, thanks @fair drum and @warm hedge

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
warm swallow
#

hey POLPOX I have a small question actually. You made a small mod that changes the VR skybox for screenshot use. Do you know if that mod is able to be played in multiplayer?

#
thanks
warm hedge
#

It does only changes the skybox/lighting. nothing should conflicts with something

warm swallow
#

thanks

warm hedge
#

So yes. Never tried tho

lean anchor
#

@robust hollow your a genius thank you man

fair drum
#

there a way to get the chosen element when a player is selecting their respawn inventory with the respawn inventories template? matter of fact, is there a way to get the selected element when a player chooses a respawn location? I typically find their spawn location through distance comparisons to each other.

lofty rain
#

There was a fairly new command to put for example a briefcase to units hand, wasn’t? Or did they just tweak some memory point stuff? Can’t find anything related...

warm hedge
#

Isn't. If you meant attachTo, maybe...?

lofty rain
#

I'm not sure... I saw this video where unit was walking around with briefcase in his hand and it was looking much better than it used to look.

warm hedge
#

That's just an attachTo

lofty rain
#

Allright. Thanks.

fleet plaza
#

I have a really stupid question, but idk how to do it

#

{
if (side _x == east) then
{
null = _x spawn INF_fnc_infecthim; };
} forEach (allUnits);

#

i want this to loop every second

warm hedge
#

while is the command

robust hollow
#
while {true /* some better condition */} do {
    sleep 1;
    {_x spawn INF_fnc_infecthim} forEach units east;
};```
fleet plaza
#

tnx

static roost
#

alright scripting gurus I am running into some trouble. I am building a mission that will have set kits based on player slot/role. I can get the player slot to start with the kit I made. Respawn gives the base units stuff not the custom kit. I am a novice at all this so can use some direction. Also running into an issue with a script line not sure if there is a better way to put this or swap function. Of course the sqf thing doesnt work...

#

if ("DemoCharge_Remote_Mag" in _itemsPlayer) then {_playerRole = "SEAL_AMMO";};

cosmic lichen
static roost
#

ty

proven charm
#

can you somehow create object if you only know the file name? ("walkover_01_f.p3d")

little raptor
proven charm
little raptor
#

but you can't create the full object with just the model (an object needs a config)

little raptor
#

unless you search in the config to find it

#

(but there's no guarantee it's defined in the config)

willow hound
#

And there could be multiple configs using the same model

little raptor
#

but how do you have just the name?

#

if you have the name you probably have the path too?

proven charm
little raptor
#

so use getModelInfo and get its path

proven charm
#

I already found the config so no problem, was just curious of other ways

#

thx

digital torrent
#

anyone know if it is normal that on dedicated server, the hold action is doubled and the trigger associate to it is not working?

eg: i put a hold action with deletevehicle on the object. Then a trigger with !alive . it work well on multiplayer and singleplayer but on dedicated, the holdaction, get doubled and the trigger dont activate

fair drum
#

lets see the code for the adding of the hold action

#

it sounds like your execution location or which computers you are executing it on is messed up

digital torrent
#

@fair drum what was the website to paste the code?

fair drum
digital torrent
#

i changed the link, the prior one was a mistake sorry

fair drum
#

so that object's init box gets fired on every machine already. meaning if you remote execute it to every machine, you get 1 full send to everyone for the server, then n amount of sends for every client that connects. if you had 60 players, you'd have 61 actions

digital torrent
#

omg

fair drum
#

so what you want to do is add a if !(isServer) exitWith {}; before the code so that it ignores any clients

digital torrent
#

i see

#

thank you, i will try it now

fair drum
#

if you want other code that the client will see, its better to just put the server code block in a if (isServer) then {//code}; block

#

or even more simply, you can just call the hold action without remote executing it at all, which will then fire on the client when that object loads for them

willow hound
#

Bonus points for both code structure and your sanity as the mission grows if you move that code from the init box into initServer.sqf 🙂

fair drum
#

i like to have a debug line that berates me in every single function that if I end up calling the function on the wrong machine, it yells at me calling me an idiot

scenic kestrel
#

Anyone know how to properly delete tasks?


[player, ["task1"], ["Task description", "Task title", "Task"], objNull, true, -1, true] call BIS_fnc_taskCreate;
["task1", player] call BIS_fnc_deleteTask;```
The task remains in the map menu. 

Any help appreciated
fair drum
#

single player, multiplayer, dedicated, where you calling it?

little raptor
#

if it's for everyone just put it in initPlayerLocal.sqf

fair drum
#

it was a basic fix for the immedate problem he was having

#

he can move everything outside the editor if he wants

digital torrent
#

@fair drum i tried what u suggested of adding the is server and the exith with but it is still doubling

scenic kestrel
#

I am testing single player, but will be MP. everything says global so didnt think it would matter

digital torrent
fair drum
#

nope, that exitWith was meant to be a blank scope {};

little raptor
#

if !(isServer) exitWith {}; ** before the code **

fair drum
#

it reads, if the machine isn't the server, leave silently now and never come back 😉

digital torrent
#

sorry i dont get this blank scope and before the code. i put the is server before the code no?

digital torrent
fair drum
#
if !(isServer) exitWith {}; //if the machine isn't a server, do nothing and leave.

//code if it passes the server check
digital torrent
#

so this is what u mean?

fair drum
#

yeah. but like leo and ansin mentioned, you need to start moving things outside of the editor. its easier to manage.

#

and say your editor save becomes corrupted, you don't lose EVERYTHING.

#

you at least get to keep your scripts

scenic kestrel
fair drum
digital torrent
#

the current reason as to why i prefer to keep things on editor is bc some of my script is not reflected into the server's editor object and trigger.

Most likely bc of the local vs global variable and all. still learning but thanks for the tips

scenic kestrel
#

A long a glorious road brother, keep going! Im curious what your working on, i like collecting things

digital torrent
scenic kestrel
#

sounds awesome, looking forward to seeing it live

digital torrent
digital torrent
fair drum
little raptor
fair drum
#

start playing left4dead in 2021?

digital torrent
scenic kestrel
#

yea trying to get individual units

#

i'll check if group works, thatd be good

little raptor
fair drum
#

not that there's anything wrong with that lol

scenic kestrel
#

Hypoxic is the man, thank you. Groups work and testing the various types shoulda been happening. thanks for answer and lesson. woot problem solved

digital torrent
#

yea tbh medical school is hard. who care if it take a bit more time. as long as u can become wha tu want

fair drum
#

a lot of people start it later in life. you end up doing something else like nursing or paramedic, end up liking it and want to go farther. some people have left engineering to do it as a career change.

#

i don't have family or kids so it was a no brainer.

digital torrent
#

Yea it is often the case nowadays where i am. people like to switch major a bit to make sure that what u want before pursuing it

#

btw, @fair drum the code work, but the trigger is not fired. do you know why?

fair drum
#

you are using a separate trigger right?

digital torrent
#

yes

little raptor
#

just do whatever you want when you delete it

digital torrent
#

to set a task to complet

little raptor
#

you can do that too

fair drum
#

and avoid the trigger all together

little raptor
#

in other words: when you know "when" something happens, why do you loop to find when?!

#

it's like knowing that the store opens at 8AM, but keep going there from 12AM every minute to check!

dreamy kestrel
#

Q: about triggers, what is "EmptyDetector"? Is that a class/config somewhere?

crude vigil
#

It is an object specifically for Triggers

#

Since it is an object, yes it is a class/config inside cfgVehicles

surreal peak
#

Is there a way to disable a certain PBO with a script? There is a mod that my community wants to use, but a PBO inside breaks some weapons

#

I want to write a quick compat mod for it since I believe the author has stopped supporting

fair drum
#

theres always deleting it, repacking it, and distributing it to the people as a local mod

cosmic lichen
#

Not a good idea

surreal peak
#

I dont like stealing from those who dont deserve it

cosmic lichen
#

Create a mod and overwrite the changes or use the delete keyword

surreal peak
cosmic lichen
#

Yeah it's hidden

surreal peak
#

so i would make a PBO which has a class file which deleted the bad PBO? Or the classes in that PBO?

cosmic lichen
#

The classes

#

If it's a vanilla class you wanna reset the class to the default values though, not just delete it 😄

surreal peak
#

someone said it changes the value of an RPG shot so ill need to figure out how to set it to default. To make sure it loads after another mod, I would make this mod dependant on the bad mod right?

cosmic lichen
#

requiredAddons of your mod needs to contain the broken mod.

#

To find out the default values, just start vanilla a3

dreamy kestrel
cosmic lichen
#

Yes, through modding you can inherit from it or modify it

still forum
#

select isn't copying anything

fluid wolf
#

Out of curiosity does anyone know if this is set right? It's not triggering and I dont know if its inside the SQF that its failing or its not even loading it

#

"Intro.sqf" remoteExec ["Execvm", -2];

winter rose
#

note that if the mission is player-hosted, he won't see the intro

fluid wolf
#

Ahhhhhhhhhhhhhhhhhh ok

#

So on a dedicated server that should work for the players?

winter rose
#

remoteExec 0, no -2

fluid wolf
#

Got it. and -2 if I dont want the host to see it, correct?

winter rose
#

or, as some like to do,```sqf
[0, -2] select isDedicated

winter rose
fluid wolf
#

That's even better! Brilliant man! Thanks!

dreamy kestrel
#

oh ok never mind... I see, it was another typo... 🙂

fair drum
#

apparently spawned bombs have a damage source as the player that died when the handleDamage event occurs. interesting...

#

alright what am I missing...

[
    player,
    [
        "HandleDamage", {
            params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];

            if (_source == _unit) then {
                _damage = 0;
            };
            diag_log str _damage;
            _damage;
        }
    ]
] remoteExecCall ["addEventHandler", (allPlayers select {_x distance _carrier <= 300})];

currently everything is working as wanted but the unit still dies. the diag_log is returning 0 when the player is killed by one of the scripted bombs (_source for a scripted bomb is the unit that died apparently). I have a return of damage which according to the wiki should give the resulting ending damage. Does something that has the potential to instagib a unit not work with this?

#

looking to make the unit invuln to any of the gbu bombs I'm using for scene explosions but still damaged by any players that shoot at them.

copper raven
#

first of all, why remote exec? the handler will fire locally only

fair drum
#

This EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on.

copper raven
#

the bombs can be the source itself iirc

fair drum
#

anytime I return the source, it always gives me back my unit object

#

if I return the str _projectile, I get ""

copper raven
#

can be splash damage

fair drum
#

hmmm. so to figure out a way around this...

#

well. the diag_log returns a TON of 0s so its at least picking up the fragmentation

#

okay so I changed some stuff for the diag_log, apparently it was just too much for me to even see.
https://sqfbin.com/uneguloxixinefutetid
looks like the bomb does have a projectile triggering at start with a null object source then all the fragmentation counts as the player

copper raven
#

save the projectile name, deny damage until it changes

#

not to empty string ofc

fair drum
#

at what size of a block of code would you consider, hey I should put this in another file?

robust hollow
#

the general rule for me is if something is used in more than one place then it becomes its own function (and file). code size is irrelevant.

fair drum
#

I'm just in the cleaning up code part of the project. its all working but man is it a mess in organization.

copper raven
#

code that is constantly recompiled(e.g eventhandler code), boilerplate code

fair drum
#

all of my code currently is in different functions besides files added to init.sqf. Just decluttering by making even more functions now lol

dusky wolf
#

Has anyone figured out how to change the decals on the RHSUSAF vehicles? They have documentation up for the AFRF vehicles, but the same does not seem to work for USAF

fair drum
#

there a faster/cleaner way to do this?

private _side = [west, east];
private _northowner = selectRandom _side;
_side = _side - [_northowner];
private _southowner = _side # 0;
daring nova
#
private _sides = [west, east];
private _north = (floor random 2) % 2;
private _south = (_north + 1) % 2;
private _northOwner = _sides select _north;
private _southOwner = _sides select _south;

probably works

fair drum
#

Mine
Execution Time: 0.0026 ms | Cycles: 10000/10000 | Total Time: 26 ms
Yours
Execution Time: 0.0033 ms | Cycles: 10000/10000 | Total Time: 33 ms

Never thought of using modulo tho. Interesting

daring nova
#

suprising time difference honestly, I would of thought array modification would be slow

#

probably due to modulo arithmetic in floating point numbers

winter rose
#
  • more SQF commands = slower
  • would have please :sob:
#
private _northOwner = selectRandom [east, west];
private _southOwner = [west, east] select (_northOwner == west);
```maybe
#

@fair drum is performance really important here?

warm hedge
#

What a hacky solution :P

winter rose
fair drum
#

nah, more clean is what I want. your use of select is what I was looking for. Something that picks one, then picks the opposite

daring nova
#

- more SQF commands = slower
in that case, "mySideSelector" callExtension "selectSide" 😛

winter rose
#

for moar perfz

peak pond
#

Hi, I am working on a script to restrict map markers to only be shared with players that are close by. It works by subscribing to the "MarkerCreated" mission event, then creating a local copy of the marker with createMarkerLocal if player is close enough to the marker owner, then later deleting the non-local marker. It seems to work, however I noticed the player cannot later delete the scripted marker from their map (i.e. using the Delete key). This would be important, for example in case the player needs to delete markers during the planning phase or during the mission.

It seems the markers my script create are immutable by the player, similar to markers that are part of the mission file. Is there any way to convert these markers to be editable by the player, i.e. such that player can delete them if needed?

willow hound
peak pond
#

Ah ok thanks, let me give that a try.

#

Yep that did the trick, thanks.

fair drum
#

is there an equivalent of publicVariableServer for setVariable? Global on that gets fed to every other client as well. I just want server.

#

I guess I could just remoteExec it. just wondering if there is another way

winter rose
still forum
#

you probably just want to keep the marker name you got.
Not rename it to some custom _USER_DEFINED thing. That way the players name will also show properly on the marker

cyan dust
#

Good day. Is there an event handler to check if player layout changed? I tried "Put" but it is working in half of the cases (for example picking up a backpack does not trigger it)

still forum
#

loadout, no

#

"for example picking up a backpack does not trigger it"
yes because "Put" is put down, wheras "take" is take.
If you only take one of the two you won't get all of it

cyan dust
still forum
#

yes

peak pond
# still forum you could also recreate the marker in direct chat channel

Interesting, I wasn't sure if it was possible to create markers in direct channel from a script, as it does not seem to be allowed by the in game map GUI.

I think I've got a working script that works by copying the source marker locally with a unique suffix in the name. Since each player gets their own local copy of the marker, they can alter or delete it as they please independently from other players. This is what I was looking for, as I want to be able to distribute markers to leaders during briefing, then they can independently work with the markers during the mission.

#
addMissionEventHandler ["MarkerCreated", {
    params ["_marker", "_channelNumber", "_owner", "_local"];
//    systemChat format ["Vanilla marker: %1, channel: %2, owner: %3, local: %4", _marker, _channelNumber, _owner, _local];
    if (_marker find "LOCAL" != -1) exitWith {}; // Break recursive loop

    if (player distance _owner <= 7) then {
        _markerChannel = markerChannel _marker;
        _markerColor = markerColor _marker;
        _markerDir = markerDir _marker;
        _markerPolyline = markerPolyline _marker;
        _markerPos = markerPos _marker;
        _markerText = markerText _marker;
        _markerType = markerType _marker;

        _localMarker = createMarkerLocal [
            format ["%1 LOCAL %2", _marker, getPlayerID player],
            _markerPos,
            _markerChannel,
            _owner
        ];
        _localMarker setMarkerColorLocal _markerColor;
        _localMarker setMarkerDirLocal _markerDir;
        if (count markerPolyline _marker >= 4) then {
            _localMarker setMarkerPolylineLocal _markerPolyline;
        };
        _localMarker setMarkerTextLocal _markerText;
        _localMarker setMarkerTypeLocal _markerType;
    };

    [_marker] spawn {deleteMarkerLocal (_this select 0);} // Schedule to fix crash
}];
still forum
#

Actually, if all your local markers have the same name in MP. I think it might also delete the remote local markers if player goes to mal and deletes his own marker

peak pond
#

Yes I got that issue. This script gives each one a unique name by appending the player's Client ID.

cyan dust
proven charm
#

I already asked this in the forums but I want to be absolutely sure... is there a fast way to reload new magazine to mortar? I am deleting all mags and adding just one, but the reload takes time

#

If it's not possible maybe a feature request could be made?

proven charm
warm hedge
#

That is THE command. You probably did it wrong

proven charm
#

maybe

#
 
[] spawn 
{ 
m = vehicle player; 
 
{  
  m removeMagazines _x;  
  
} foreach (magazines m);  
 
 
m addmagazine "8Rnd_82mm_Mo_shells";  
 
 
m setWeaponReloadingTime [gunner m, currentMuzzle (gunner m), 0.0]; 
 
}; 
#

that's the code I have

#

but it loads slow

ivory lake
#

setweaponreloadingtime is for the reload time between shots within a magazine not when switching magazine/loading a new one

#

confusing i know

ivory lake
#

I don't think there's an easy way to do it for a vehicle, infantry you can

#

this used to work but i havent tried it recently but you can try removing the vehicles weapon and readding it after you have the magazine you want loaded available, it should load the first available magazine immediately

cosmic lichen
#

If it's an AI vehicle and not player just delete it and create a new one

proven charm
proven charm
still forum
#

Uhm.. FYI.. HashMap forEach is not savegame compatible.
If you save during forEach, and load the save it'll crash 🙃

winter rose
hollow thistle
still forum
#

yeah. don't sleep in forEach loop (in general there is barely any reason to use HashMap foreach anyway :U)
using keys and forEaching over them would work fine too

winter rose
#

no possible fix?

#

I mean, engine-wise

still forum
#

not for 2.04

#

I'm fixing it for 2.06

winter rose
#

yay!

little raptor
still forum
#
private _southOwner = selectRandom [west, east];
private _northowner = [west, east] select (_southOwner == west);
#

someone do benchmark plox

little raptor
still forum
#

not with bytecode optimizer :U

little raptor
winter rose
little raptor
#

that's weird. original was also 0.0028 meowsweats ms

still forum
winter rose
#

then one day in release?

still forum
#

I'll update it today already

winter rose
#

also, can FSMs be bytecoded too?

still forum
#

no

winter rose
proven charm
#

I guess hashmaps dont have null?

winter rose
proven charm
winter rose
#

as keys?

#

oh you mean, something like HashMapNull? I don't think so

proven charm
still forum
#

createHashMap == hashMapNull

#

maybe we should make a wiki page with a redirect 🤣

copper raven
#
Result:
0.0014 ms

Cycles:
10000/10000

Code:
private _sides = [west, east];
private _southOwner = _sides deleteAt random 1; 
private _northOwner = _sides # 0;
Result:
0.0018 ms

Cycles:
10000/10000

Code:
private _side = [west, east]; 
private _random_id = round random 1; 
private _southowner = _side # (1 - _random_id); 
private _northowner = _side # _random_id;
Result:
0.0017 ms

Cycles:
10000/10000

Code:
private _southOwner = selectRandom [west, east]; 
private _northowner = [west, east] select (_southOwner == west);

heh

still forum
#

🤔

#

bigsad

proven charm
#

isnt random 1 in range of 0 ... 0.99 ?

warm hedge
#

random 1 could be 1 but most unlikely

proven charm
#

yeah

#

I recall testing this, it never is 1

copper raven
#

yeah, so?

#

deleteAt should round anyway

#

that means [0,1] deleteAt 0.51 should return 1

#

no need for explicit round

proven charm
#

i thought it takes index

copper raven
#

it does

#

there is no integers in sqf

#

they're floats

proven charm
#

right but you still get error if you do something like "select 0.7"

#

right?

copper raven
#

no?

#

don't recall it throwing for that

proven charm
#

ok I tested it and you are correct

#

learning new things here 🙂

faint oasis
#

someone know why the mk41 vls don't detect the "hand laser designator" ?

fair drum
#

the VLS doesn't have its own detection of data net. If you don't have another unit that provides the data net info, you have to use reportRemoteTarget

#

its weird, but thats the solution I found if you don't have another data net unit like a rhino/aa or something

little raptor
#

as sharp said all numbers in sqf are floats

fair drum
#

when should I be using compile final?

copper raven
#

when you don't need to recompile? 😄

still forum
fair drum
#

the catch is that I cannot change that variable in later code correct?

still forum
#

ye

fair drum
#

so this would be good for things like variables that won't change that are put into a init.sqf for example

still forum
#

for functions

fair drum
#

oh you mean variables that have stored functions? do I have to worry about that if all the functions are declared in cfgFunctions then? I thought I remember reading that cfgFunctions is a safe place and people can't mess with it

still forum
#

CfgFunctions uses compileFinal

#

function == variable of type CODE

copper raven
#

would be nice to have final unary command tbh

proven charm
little raptor
#

that's why they're called floating point meowsweats

proven charm
#

was mainly referring to the selection by floating point

lilac heath
#

hi, I have a "simple" script that allows the player to control the impact point of a Titan AT turret. But I don't know why the setPos does something strange on hills. Does setPos make some checks when moving vehicles? Or how could I ensure that I move it where I want it? The fact is that I'm not sure I understand why that happens so I'm a little lost XD.

You can see the code in the link that follows with a video (minute in the video 01:00). https://forums.bohemia.net/forums/topic/234346-setpos-working-strange/

fair drum
#

watching that linked video as a not very good at math person made me nervous at what went into that

little raptor
#

use an absolute position format

#

such as setPosWorld or setPosASL

lilac heath
#

ok thanks, I'll take a look at it 😍

little raptor
#

and definitely don't use getPos

lilac heath
#

thx for your help

lilac heath
little raptor
#

np

fair drum
#

are hash maps case sensitive for the keys as a string?

ember frost
#

Hey not be best with scripting here but is there a way I could make Respawn Button on Escape menu only visible/functional when lifestate = Incapacitated if not then thats fine I can make other things work 🙂

fair drum
ember frost
#

would it matter if I got the respawn manually box checked in respawn settings on the mission editor itself at first?

fair drum
#

anything in description.ext overwrites anything in the editor attributes area, so it shouldn't matter

ember frost
#

hm ok ill check that out quick

#

ah perfect, thanks

fair drum
#

JIP queue is guaranteed to fire in the order JIP IDs were created right?

undone dew
#

hey guys i'm having a very strange issue with a loot spawning script where identical code is working in one place but not another. I've been messing with this since last night and I still can't get the loot to spawn on the uniform or backpack slots, only the vest portion is working. There are also other loot arrays that are successfully spawning into uniform and backpack slots with no issue, it's specifically the ACE medical stuff that isn't working for me:

_MedicalLoot_uni1 = selectRandom [        
            "ACE_fieldDressing",
            "ACE_packingBandage",
            "ACE_elasticBandage",
            "ACE_quikclot",
            "ACE_morphine",
            "ACE_epinephrine",
            "ACE_splint",
            "ACE_tourniquet",
            "ACE_bloodIV"
            ];    

_MedicalLoot_vest1 = selectRandom [        
            "ACE_fieldDressing",
            "ACE_packingBandage",
            "ACE_elasticBandage",
            "ACE_quikclot",
            "ACE_morphine",
            "ACE_epinephrine",
            "ACE_splint",
            "ACE_tourniquet",
            "ACE_bloodIV"
            ];    

_MedicalLoot_back1 = selectRandom [        
            "ACE_fieldDressing",
            "ACE_packingBandage",
            "ACE_elasticBandage",
            "ACE_quikclot",
            "ACE_morphine",
            "ACE_epinephrine",
            "ACE_splint",
            "ACE_tourniquet",
            "ACE_bloodIV"
            ];

_uniform    = uniformContainer _unit;

    if (floor (random 5) < 4) then {    
_uniform addItemCargoGlobal [_MedicalLoot_uni1, _Random_Amount_1];
};    

_vest        = vestContainer _unit;

    if (floor (random 5) < 4) then {    
_vest addItemCargoGlobal [_MedicalLoot_vest1, _Random_Amount_1];
};

_backpack    = BackpackContainer _unit;

    if (floor (random 5) < 3) then {    
_uniform addItemCargoGlobal [_MedicalLoot_back1, _Random_Amount];
};```
little raptor
#

see the pinned messages

undone dew
#

ah

fair drum
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
fair drum
#

allllllmost there...

undone dew
#

oh i have the sqf backwards lmao

little raptor
fair drum
#

HOT

undone dew
#

bingo

undone dew
#

oh sorry i left that part out, it is

#

the whole script is giant so i didn't want to post it

#

for example what's happening, i have this section to spawn from four different arrays and everything is defined properly, but for some reason the medical one is being left out. I even went and copy/pasted all the parts of the working vest lines over the uniform and backpack slots and renamed and it's still not spawning them strangely

    if (floor (random 5) < 4) then {    
_uniform addItemCargoGlobal [_addItemCargoGlobal_Array_uni1, _Random_Amount_1];
};

    if (floor (random 5) < 4) then {    
_uniform addItemCargoGlobal [_addItemCargoGlobal_Array_uni2, _Random_Amount_1];
};

    if (floor (random 60) < 3) then {    
_uniform addItemCargoGlobal [_CashChance, _Random_Amount];
};    
    
    if (floor (random 5) < 4) then {    
_uniform addItemCargoGlobal [_MedicalLoot_uni1, _Random_Amount_1];
};    ```
fair drum
#

why not just use

addItemToBackpack
addItemToUniform
addItemToVest
#

I bet if the others are working, and the medical is being left out, you probably ran out of space

#

since medical is the last one called

undone dew
#

i tried putting it at the front as well as playtesting enough, i'm finding enemies with empty enough inventories and still no medical stuff spawning 😦

#

but also i think (i might be wrong) i have to use addItemCargoGlobal so that it works server-side and everyone sees the same loot?

#

okay, the uniform inventory i had spawning 80% of the time, the vest is 80%, and the backpack is 60%

fair drum
#

and do you care where the items end up on the body?

undone dew
#

nah order is irrelevant

#

it's a survival gamemode so really there just needs to be some degree of ACE medical items spawning for players to loot lol

#

if you want i'll send you the script i'm using

fair drum
#

wait one

undone dew
#

okay, i just realized I did a stupid and got the backpack working


_backpack    = BackpackContainer _unit;

    if (floor (random 5) < 3) then {    
_uniform addItemCargoGlobal [_MedicalLoot_back1, _Random_Amount];
};``` 

it was still set to add the item to _uniform after I copy/pasted.. BUT, uniform still isn't working. could it be that it's getting canceled out by me trying to spawn too many possible items in the uniform inventory?
undone dew
#

yeah that looks like it might work better since my current script isn't checking for inventory space

#

thanks a ton, i think that will solve the problem

fair drum
#

or at least get you in the ball park

undone dew
#

yeah definitely, but if I set the else {}; (where you have the diag_log format) to do nothing will it just continue on to the next attempt to spawn an item, like I have it in my original? There's like 3-5 chances to spawn an item from different arrays for each inventory

#

or does it interrupt it and make it skip the rest (which is what it seems to be doing with the uniform? if it can't load in something heavy then it also doesnt seem to load in a light bandage or cash item afterwards either)

fair drum
#

yeah it just chugs along until it encounters an error

undone dew
#

nice, i'll try this out, thanks

#

luckily i think i only need to adopt the canAdd check for the uniform since the loot spawns aren't big enough in the other slots to even cause an issue apparently

austere hawk
#

is there a way to get all vehicles that have been addVehicle 'ed to a group?

fair drum
#

if not, guess you could just add the vehicle object to the groups namespace with setvariable

austere hawk
#

that means i would have to detect every case where some AI script appropriates a vehicle? That sounds tricky...

leaden haven
#

How do mission makers deal with fog? After a while of my dedicated server running, it gets foggy and rainy. How can I stop this? It is supposed to be an arid climate. I am running Alive mod, but the weather module still lets it get rainy and foggy. Thanks.

fair drum
little raptor
#

there's an option in eden than disables weather changes in a mission

#

afaik

leaden haven
#

Thanks, I will try that.

#

Maybe that will force it to use Alive module instead of vanilla.

cosmic lichen
#

Turn manual overwrite on and set the fog to 0

little raptor
#

I think it's manual override! 😄

meager epoch
#

How can I go back in time with the skipTime thing?

winter rose
#

negative value?

meager epoch
#

Tried that but didnt work

#

Or i did it wrongly

#

Can u give me an example

#

Lets say from 10am to 5 am

#

5h behind

winter rose
#

how would you go 5h later?

meager epoch
#

Uh

#

What

#

Lol

winter rose
#

Tried that but didnt work
how would you go forward in time with skipTime?

meager epoch
#

The bohemia page says skipTime time in seconds here

winter rose
#

oh really?

meager epoch
#

I think

winter rose
#

don't think, read?

meager epoch
#

Yeah ive read it

#

I either understood it wrong or its like that

#

Lemme recheck

#

duration: Number - Hours to skip.
A positive value will create a forward time jump, a negative value will jump backwards.
One second is roughly 0.00026 hours.
Any calculations must be enclosed in parentheses, e.g. skipTime (_seconds/3600)

#

Guess its hours after all :p

#

So

#

Skiptime -5

#

?

winter rose
#

yyyup, you got it!

meager epoch
#

Great thanks :)

winter rose
#

you did all the work ^^ gg!

little raptor
#

and if it doesn't work you have setDate

meager epoch
#

It worked all g

#

Thanks

#

Quick question tho

#

Is it possible to change the position of the title

#

titleText

fair drum
#

is there an event handler for detecting lifeState changes?

hollow thistle
#

No

fair drum
#

hmmm back to the think tank. trying to write something that removes squad leader respawns on incapacitation and then re-add them (or disable enable).

copper raven
hollow thistle
#

Or just a loop blobdoggoshruggoogly

#

It's not really expensive command iirc

little raptor
#

yeah it's cheap

#

but no need to do it every frame! 😄

hollow thistle
#

Or write your own respawn that does not work on incapacitated, as I assume you're using BI respawn position.

fair drum
#

which one, the add/remove respawn or the respawnmenudisableitem

#

is cheap

fair drum
little raptor
fair drum
#

oh okay

fair drum
#

is there a way to get VSC to ignore an error? the SQF language hasn't been updated in 2 years and it's missing the hashmaps + insert commands

copper raven
#

which extension are you using?

fair drum
#

SQF Lanuage 2.0.3 - Armitxes
SQF-VM Lanuage Server 0.1.20 - SQF-VM
Arma 3 CfgFunctions 1.1.9 - Hakon R Rydland

copper raven
#

it is getting updated appereantly, up until 2.00 even

torpid quartz
#

I've got this trigger off the workshop that is supposed to go off when you put something in a box

"FirstAidKit" in (itemCargo medBox);

this works fine but I'm trying to do it with a money roll.
I've tried the display name with no spaces, the class name, and the loadout export name. so far nothing. Any ideas what the money roll would be called in this case?
Money(Roll), Item_Money_roll, Money_roll

warm hedge
#

Money_roll it is

torpid quartz
#

hmmm i'll try this again then

"Money_roll" in (itemCargo medBox);
#

hmm ok weird. loading the workshop comp without mods has the code in a call{} function.

After putting the mods i'm using back on it's gone.

#
call{"FirstAidKit" in (itemCargo medBox);}

yeah looks like this without mods, didn't think they could change scripts like this

#

hmm ok, still nothing with

call{"Money_roll" in (itemCargo medBox);}
#

using this is anyone wants to try this too

cosmic lichen
#

The call{} is created by the editor, it's hidden by default but I guess this is just a bug.

torpid quartz
#

ah right

cosmic lichen
#

"Item_Money_roll" in itemCargo medBox;

torpid quartz
#

ok well yeah the first aid one works, but the Money_roll or Money_Roll is no good. I'll try Item_Money_roll again

cosmic lichen
#

Your class name was wrong. That's it

winter rose
torpid quartz
#

na Item_Money_roll is no good either

#
call{"Item_Money_roll" in (itemCargo medBox);}

currently this, i'll remove the call but it worked fine with the first aid kit

warm hedge
#

Ah okay. Now I get why it's not working, it's a magazine not item

cosmic lichen
#

yeah

#

Just noticed

warm hedge
#

So magazineCargo

cosmic lichen
#

So weird

torpid quartz
#

yeah no dice. could be a thing like with the flash disk. I remember trying to do something with that, like checking if people had it in their inventory and it not liking it, but working fine with map

#

i'll try magazineCargo, thanks

cosmic lichen
#

it's in CfgVehicles but is a magazine... Good job

warm hedge
#

No it's a CfgMagazines item

#

Because you can insert those moneys into your wallet, it's obviously a magazine 😛

torpid quartz
#
"Item_Money_roll" in (magazineCargo medBox);

?

cosmic lichen
#

configfile >> "CfgVehicles" >> "Item_Money_roll"

torpid quartz
#

actually wait Money_roll, brb

warm hedge
#

As we already told "Money_roll"

#

configfile >> "CfgMagazines" >> "Money_roll"

cosmic lichen
#

Ah yeah. In the editor it's item_ and when picked up it turns into "money_roll"

#

Love that system

torpid quartz
#
"Money_roll" in (magazineCargo medBox);

yup that's on the money

winter rose
torpid quartz
#

thanks again everyone

cosmic lichen
#

Too bad BIS_fnc_itemType doesn't return a proper category for these items.

#

Was about to read that 😄

winter rose
# cosmic lichen Was about to read that 😄

Hi everyone. Can someone give me a good and reliable command for getting a helo to land, wait 30 seconds for the players to get out and then start again (engine on when on the ground). Also for the extraction the opposite way. I googled a lot and there a a lot of combinations but they won't work. At the moment I use: - waypoint "load" and waypoint time settings "30 seconds" -invincible helipad But the helo just keeps hovering in the air above the helipad, waiting 30 seconds and then fly away. I also tried the command "heli1 land helipad1" (variable names). Same problems. If I use the waypoint "cargo unload" it works, but I want the players to get out manually. Hiw do you guys solve this landing problem? Thanks for answers. (I'm writing here because most of the posts in the inet are from 2017 or older. And we know arma changes...)
- Anonymous
here you go :p

cosmic lichen
#

I've answered him already. 🥷

dusk gust
#

I feel this has probably been asked time and time again, and the answer is probably obvious but ¯_(ツ)_/¯.
Does using the third parameter with setVariable have the same network impact as a publicVariable?

cosmic lichen
#

yes

tough abyss
#

Does anyone know how to make players drown... outside of the water?

winter rose
tough abyss
#

Oof, poetic.

#

No, simulating no air. Either a burning house, or in the future, a mission on another planet, where players are required to keep their suits on/damage results in decompression, and such things.

half moon
#

Guys. Can you offer me a hand here? How would you go about having a script that places a marker when someone is ACE-unconcious? It's a script for a purpose to do evacuations on AI.

austere granite
tough abyss
#

Make sure this local function, leads to a globally executed createMarker.

#

@austere granite The BIKI states, and I can confirm via testing, that setOxygenRemaining has no effect outside of the water. How would we do this? Do we need to create a separate Mod?

winter rose
tough abyss
#

OK truly I don't expect or want a pre-made solution. Just asking for brainstorming from someone who maybe knows how the dive mechanics work 😄

winter rose
#
private _oxygen = 100;
while { sleep 1; true } do
{
  _oxygen = _oxygen + ([+1, -1] select _isInSmoke);
};
#

if _oxygen < 1 then setDammmmmage

#

you would have to script the post-processing effects if you want them though

cosmic lichen
#

Might also wanna consider respirators and such, but that's easy to do

tough abyss
#

Agreed, that is a kind of drowning mechanic. But as you say it ignores the post processing and players will immediately start bleeding.

cosmic lichen
#

_oxygen = (_oxygen + ([+1, -1] select _isInSmoke)) min 100

#

guess you don't wanna have 110% oxygen

tough abyss
#

Yup respirators and the "if" conditions can come later. Just wondering how to activate the drowning condition.

austere granite
#

The point i made and also Lou... is that there's not really a need to lock yourself into the quite limited SQF command, and better to just do a properly scripted solution, which means you won't suddenly get stuck due to the command not doing what you want.

winter rose
#

you can't have the vanilla drowning outside of water

#

best luck = script your solution yes

austere granite
#

I do believe the oxygen gets used for "damage effects" FSM by default... but meh i never liked those anyway.

tough abyss
#

I will assume you have access to a higher power Lou :D. So I guess my open question is two-fold

#

Can this be modded in any way? ... Or maybe

#

Where in the game PBO's can I find the oxygen functions, so we just recreate them ?

#

It was at game release, so that rules out DLC PBO's.

austere granite
#

its engine stuff, nothing in PBOs

tough abyss
#

So I guess the ... relatively... straightforward solution would be to recreate a bleeding system as in ACE3, making custom ppEffects and sounds to simulate lack of oxygen (and return to normal). Hmmmm.

cosmic lichen
#

Yes

tough abyss
#

@cosmic lichen Thank you! So this controls the suffocation timer, the ppEffects, and scales them with the Oxygen level. At least if I can read this hairball of code correctly.
Especially love this part under the "suffocating" check:
&& !(player isKindOf ""Animal_Base_F"")
Like would a remote controlled chicken not drown?

#

But why is this an FSM file? 🤨
Is it to simplify the "if => then" and case logic?

cosmic lichen
#

Yes

#

FSMs have the advantage that the logic can be display as a diagram which makes it easier to comprehend

tough abyss
#

Ah, with FSM editor. Thanks

patent goblet
#

How can we check if a player has visited "Diary: Record7" diary subject?

cosmic lichen
#

Did you write the record yourself?

patent goblet
#

yep

cosmic lichen
#

You can add an expression to it when you create it. That expression could then define a variable.

pulsar bluff
#

@cosmic lichen on the wiki, when i click on the arma version icon (in script command page)

#

it takes me to general arma info instead of list of other commands released in same version

pulsar bluff
#

i see

#

that is quite unclear

still forum
#

Ye it's annoying

cosmic lichen
#

You know who to blame 😉

dusk gust
#

Did diag_activeSQFScripts get updated with this update but isnt in the changelog? Noticed that one of the scripts I made based on it went haywire after updating the server

still forum
#

Afaik no

dusk gust
#

Hm. Alright.

pulsar bluff
#

imagine if diag_activesqfscripts would generate an alternative handle for the scripts listed, so we could terminate scripts that dont belong

#

and have only whitelisted scripts running

severe ravine
#

Would someone give me some tips on how to alter stamina? I'd like to change it to be 150% of existing. I've placed this in description.ext but notice no change, even if I make it ten fold.
class CfgMovesFatigue { staminaDuration = 90; //total amount of stamina // REMOVED FOR BREVITY };

proven charm
wispy idol
#

How does the new sqf bytecode functionality work?

still forum
#

You can compile your sqf scripts to .sqfc files, and if you have the .sqfc file next to your .sqf and use CfgFunctions or compileScript command, it will load the bytecode from the .sqfc file

wispy idol
#

How does one create an sqfc file?

#

and there's only support for running bytecode from sqfc files? You can't remoteExec or call compile bytecode?

still forum
#

No remoteExec, no compile.
There's ArmaScriptCompiler on github

proven charm
#

does that mean you can release your mission without .sqf files?

still forum
#

No

#

you need to put the .sqfc next to the source .sqf which will be used as fallback in case of issues

proven charm
#

ok thx

#

so the benefit is faster compile or what?

still forum
#

No compile at all

proven charm
#

right

still forum
#

The bytecode was already compiled

#

And also some script optimizations to make some things run faster

proven charm
#

cool

winter rose
still forum
#

ArmaScriptCompiler on github

sharp grotto
#

Would this also work if i use this for example (That's how the Exilemod does it).
So i can just place the sqfc in the same folder ?

private ['_code', '_function', '_file'];
{
    _code = '';
    _function = _x select 0;
    _file = _x select 1;
    _code = compileFinal (preprocessFileLineNumbers _file);
    missionNamespace setVariable [_function, _code];
}
forEach
[
    ['ExileClient_gui_safeXDialog_event_onDepositButtonClick','custom\SafeX\ExileClient_gui_safeXDialog_event_onDepositButtonClick.sqf'],
    ['ExileClient_gui_safeXDialog_event_onDropDownSelectionChanged','custom\SafeX\ExileClient_gui_safeXDialog_event_onDropDownSelectionChanged.sqf'],
    ['ExileClient_gui_safeXDialog_event_onInventoryListBoxSelectionChanged','custom\SafeX\ExileClient_gui_safeXDialog_event_onInventoryListBoxSelectionChanged.sqf'],
    ['ExileClient_gui_safeXDialog_event_onListBoxSelectionChanged','custom\SafeX\ExileClient_gui_safeXDialog_event_onListBoxSelectionChanged.sqf'],
    ['ExileClient_gui_safeXDialog_event_onWithdrawButtonClick','custom\SafeX\ExileClient_gui_safeXDialog_event_onWithdrawButtonClick.sqf']
    
];
bright coral
#

plus a compiler to build the ArmaScriptCompiler exe

still forum
#

There is CI on that repo where you can download prebuilt exes from

bright coral
#

Cool

#

I haven't tried the update from yesterday but some scripts do not compile to sqfc. Will make a ticket in the next days (GitHub)

still forum
#

Yesterday just added some Lua script config work, no changes on compiler itself

bright coral
#

Ok

surreal peak
#

Will compiling before hand have much significance for missions with only a few dozen scripts? Or are they more for altis life situations with a metric heck load of scripts?

still forum
#

Depends on what the scripts ri

#

Do

#

They load faster, and might also execute a bit faster

#

For scheduled scripts in general, it probably doesn't matter

#

But when you have hundreds of functions that need to load and also run in unscheduled, it matters more

winter rose
#

worth for EH too I guess

noble flint
#

hey guys

#

why isn't this simple script working in zeus

#

this land "LAND";

dreamy kestrel
#

Q: when we spawn objects like phones, tablets, laptops... these are objects like any other... can they suffer damage as well and be 'killed' per se?

dreamy kestrel
winter rose
noble flint
#

A helicopter I put in

winter rose
#

it may be too early to trigger

noble flint
#

You can't make units land like that in zeus?

winter rose
#

I don't really know how Zeus works

#

actually 😄

noble flint
#

daaaang

past wagon
#

Is there anything wrong with this script? I cant figure out why it isnt working. nothing gets added to the crate

_weaponArrayOne = [
    ["srifle_EBR_F", "20Rnd_762x51_Mag"], 1, 
    ["arifle_Katiba_F", "30Rnd_65x39_caseless_green"], 2, 
    ["arifle_MXM_F", "30Rnd_65x39_caseless_mag"], 1, 
    ["srifle_DMR_03_multicam_F", "20Rnd_762x51_Mag"], 2, 
    ["arifle_AK12_F", "30Rnd_762x39_AK12_Mag_F"], 1, 
    ["arifle_ARX_hex_F", "30Rnd_65x39_caseless_green"], 2, 
    ["SMG_03_TR_khaki", "50Rnd_570x28_SMG_03"], 2, 
    ["", ""], 3];

for "_i" from 1 to 4 do {
    _weaponAndMag = selectRandomWeighted _weaponArrayOne;
    _weapon = _weaponAndMag select 0;
    _mag = _weaponAndMag select 1;
    AirdropCrate addWeaponCargoGlobal [_weapon, 1];
    AirdropCrate addMagazineCargoGlobal [_mag, 3 + (round random 4)];
};

_weaponArrayTwo = [
    ["LMG_Mk200_F", "200Rnd_65x39_cased_Box"], 2, 
    ["LMG_03_F", "200Rnd_556x45_Box_F"], 2, 
    ["launch_RPG7_F", "RPG7_F"], 1, 
    ["V_HarnessOGL_brn", ""], 1, 
    ["",""], 4];

for "_i" from 1 to 2 do {
    _weaponAndMag = selectRandomWeighted _weaponArrayTwo;
    _weapon = _weaponAndMag select 0;
    _mag = _weaponAndMag select 1;
    AirdropCrate addItemCargoGlobal [_weapon, 1];
    AirdropCrate addMagazineCargoGlobal [_mag, 1 + (round random 1)];
};

_itemArray = [
    "HandGrenade", 1, 
    "optic_Arco_blk_F", 2
    "optic_Hamr", 2];

for "_i" from 1 to 2 do {
    _item = selectRandomWeighted _itemArray;
    if (_item == "HandGrenade") then {
        AirdropCrate addItemCargoGlobal [_item, 1 + (round random 3)];
    }
    else {
        AirdropCrate addItemCargoGlobal [_item, 3 + (round random 2)];
    };
};
#

it is in init.sqf and I am testing on singleplayer

winter rose
#

*initServer.sqf

#

otherwise it will dupe 😄

past wagon
#

oh

#

ok

#

what do you mean dupe?

winter rose
#

every connecting player will add weapons to the crate
(but that's not the issue)

past wagon
#

ok

winter rose
#

I don't see an issue I'm afraid

past wagon
#

yeah thats what im confused about

#

did I do the variables correctly?

tough abyss
#

Hi guys, i have some problem with moving a spawned group into a vehicle - it always complains, that 3 elements are provided, 2 are expected

little raptor
tough abyss
#
// Execute Position
private _destPos = _this select 0;
private _spawnPos = _this select 0;
private _cargoVehicle = "CUP_B_MH47E_GB";
private _infantrygroup = "CUP_B_USMC_InfSquad";

// Spawn Reinforcmentgroup
_reinforcementgroup = [
    [_spawnPos select 0, _spawnPos select 1, 0], 
    WEST,     
    (configfile >> "CfgGroups" >> "West" >> "CUP_B_USMC" >> "Infantry" >> _infantrygroup)
] call BIS_fnc_spawnGroup;

// Spawn Chopper
private _veh = [_spawnPos, 0, _cargoVehicle, west] call BIS_fnc_spawnVehicle;

// Move Group into Helicopter
{
    _x moveInCargo _veh;
    //systemChat format["pos is %1", _x select 0];
} forEach (units _reinforcementgroup);
//{ _x moveInCargo _veh } forEach (units _reinforcementgroup);
//_reinforcementgroup moveInAny _veh;
little raptor
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
past wagon
little raptor
past wagon
#

havent tried

little raptor
#

then you know what to do

past wagon
#

ok

#

thx

little raptor
digital torrent
#

Anyone know what command i should look for?
I want to put blood on the units? to make it look like a zombie and a not a civ walking around

little raptor
#

damage them?!

digital torrent
severe ravine
winter rose
severe ravine
winter rose
#

you can disable stamina though.

little raptor
severe ravine
# dreamy kestrel Any ideas?

I've checked alive Target_Building for missions with a building that needs to be blown up. I've used that for scripted objects and stuff just thrown down in Eden.

dreamy kestrel
#

@severe ravine no, not the buildings themselves. alive, damage, etc, yes... the other bits, phones, tablets, laptops.

#

okay, so if player can find the bits among rubble, broken ruins of a building, more power to them, for immersive effect
perfect, fair enough, thank you

undone dew
#

hey guys what would be the proper way to check a cargo container for a weapon and spawn a set ammo type for it if it exists? I'm working with this but it's not working right (_itemcrate is defined already just in a different part of script):

        _mk200check = getWeaponCargo 
_itemcrate;        

        if ("LMG_Mk200_F" in _mk200check) then {
            _itemcrate addItemCargoGlobal ["200Rnd_65x39_cased_Box_Tracer", 1];
        };
dense galleon
#

@undone dew ok so two things

#

getWeaponCargo is going to return [["riflename"],[1]] , so i would use just WeaponCargo since it returns ["rifle1","rifle2","etc"] just an array of strings not nested

#

also the big thing is you need to use addMagazineCargoGlobal for mags

undone dew
#

i see, i'll test it out real quick

dense galleon
#

i already did i got you fam

#

here ill post the code

#

`` _mk200check = WeaponCargo
bbox1; hint format ["%1",_mk200check];

    if ("arifle_Mk20_plain_F" in _mk200check) then { 
        bbox1 addMagazineCargoGlobal ["200Rnd_65x39_cased_Box_Tracer", 1]; 
    }; ``
#

just change the rifle and box name back to yours

undone dew
#

it works, thank you so much!

dense galleon
#

yep yep np

undone dew
#

its for a randomized weapon crate script so if it selects a weapon from an array it gives it ammo 😄

dense galleon
#

oh got you , iv got something that might help you there .. one sec

#

_mags = getArray (configFile >> "cfgWeapons" >> _weap >> "magazines"); ///returns an array of all compatible mags for weapon///use select to isolate one///

#

_weap is what ever weapon you want to use and it will give you an array of mags it can use

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
undone dew
#

oh i see

dense galleon
#

you can {bbox1 addMagazineCargoGlobal [ _x , 1]; }forEach _mags; /// or _oneMag = _mags select 0;

undone dew
#

oh i just thought of something, will the original work if it detects multiple of the same item? or will it only give magazines to the first instance of the weapon?

winter rose
#

@dense galleon see my post above ^^

dense galleon
#

@undone dew yea it will only give one mag but ive got some code that will help you

#

sorry @winter rose im gonna try and do the `` right this time 😁

#

    
    for [{ _i = 0 }, { _i < 2 }, { _i = _i + 1 }] do {
            
   _weaps = "getNumber( _x >> 'scope' ) isEqualTo 2 && { getNumber( _x >> 'type' ) isEqualTo 1 }"configClasses( configFile >> "CfgWeapons" ) apply { configName _x };
                
    _weap = selectRandom _weaps; 
    
    _mags = getArray (configFile >> "cfgWeapons" >> _weap >> "magazines");
    ///returns an array of all compatible mags for weapon///use select to isolate one///    
                
        _box addWeaponCargoGlobal [_weap, 1];
        
        {_box addMagazineCargoGlobal [_x, 1];}forEach _mags;
    
                                                        };
                ```
undone dew
#

hehe the sqf goes right after the 3 `

#

it should turn green once you type it in

dense galleon
#

lol thanks i look like a doof there

undone dew
#

ok i think i see how this works, thank you times a million, i'll see if i can implement it.

dense galleon
#

but that will give you 2 random weapons and all the mags that go with them in a box

#

you just gotta handle the spawning the box part

undone dew
#

right

copper raven
#

use ranged for https://community.bistudio.com/wiki/for example 1
_weaps = "getNumber( _x >> 'scope' ) isEqualTo 2 && { getNumber( _x >> 'type' ) isEqualTo 1 }"configClasses( configFile >> "CfgWeapons" ) apply { configName _x };
meowsweats you're looking up entire cfgWeapons every iteration, that's not needed

dense galleon
#

thanks @copper raven , im new to using the getNumber code above with configClasses , i know mostly how it works but i could use some advice on making it more efficient

copper raven
#

define it outside the loop

dense galleon
#

oh wow yeah 😁 that so obvious now

#

thanks again

undone dew
#

hmm, only obstacle i'm hitting is i don't need to worry about the random weapon spawning, just spawning magazines for the weapons that are in the cargo. I'm modifying this script as a base and it already handles the weapon spawning with random chances: https://www.armaholic.com/page.php?id=24196

#

so i think i just need to use WeaponCargo at the end of the script to get the array of weapons that are in the cargo and then spawn appropriate magazines for each iteration

dense galleon
#

oh i see , yeah i was using the bit above because i use mod weapons and want to get all without having to input them manually

undone dew
#

right, i'm trying to use some specific weapons because the intention was to make the boxes spawn specific (heavy) weapons

#

LMGs and snipers

dense galleon
#
       
            {
       _mags = getArray (configFile >> "cfgWeapons" >> _x >> "magazines");
            _oneMag = _mags select 0;
            _box addMagazineCargoGlobal [_oneMag, 1];

                    }forEach _magscheck;                                   ```
#

idk how efficient this is but this would work for spawning 1 mag for each weapon in the box

#

you could spawn more of one type of mag or all of the compatible mags

undone dew
#

hmm i'm getting an error if i put it at the end of the script:

Error >>: Type array, expected String```
dense galleon
#

it because it returns an array like this ["compatiblemag","compatiblemag2","compatiblemagTracers","compatiblemag","compatibl mag", ect.]

undone dew
#

i see

dense galleon
#

you have to select one of the mags like _oneMag = _magArray select 0;

#

or all of them with a forEach loop

dense galleon
#

@copper raven could you help us out again here im not sure why this doesnt work now

undone dew
#

yeah it's beyond me xD

copper raven
#

not array of strings

undone dew
#
_magscheck = getWeapon _box; 
       
            {
       _mags = getArray (configFile >> "cfgWeapons" >> _x >> "magazines");
            _oneMag = _mags select 0;
            _box addMagazineCargoGlobal [_oneMag, 1];

                    }forEach _magscheck;
#

like so?

dense galleon
#

omg that is 100 percent my fault sorry

winter rose
#

😄 j/k, happens

dense galleon
#

i was pasting from my notepad and went back to getWeaponCargo / facepalm

#

@undone dew no use weaponCargo

undone dew
#

OH

dense galleon
#

@winter rose thank you for your mercy 😅

undone dew
#

i think it works o_o

dense galleon
#

i actually came to the channel for a question of my own 😅 im using player nearSupplies 10; to find weapon containers near the player but i need to exclude the players own inventory from the search and im having a hard time , any ideas ?? thanks

#

my thought was to try something like this but no joy

                         
itemsList = (player nearSupplies 10) select {(_x in (everyContainer player)) == false};                           
                                
winter rose
#
private _nearSupplies = player nearSupplies 10;
private _nearSuppliesNoPlayer = _nearSupplies - everyContainer player;
#

I guess

dense galleon
#

@winter rose thanks i just tried and no joy but that is a good thought ill play with , also i swear im trying to do the sqf highlighting here but it doesnt wanna work right i may need to update my discord or something

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
winter rose
#

` ` ` s q f 😉

fair drum
#
hint "God gave us cone cells for this reason!"
sharp grotto
#

Linebreak is important, otherwise it won't work

true frigate
dense galleon
#
  if(linebreak)then{works};
#

got it now 😅

winter rose
little raptor
#

just put all player containers manually

#

backpack, vest, etc.

dense galleon
#

got it ill try that out thanks @little raptor

little raptor
#
private _nearSupplies = player nearSupplies 10;
private _nearSuppliesNoPlayer = _nearSupplies - [player];
copper raven
#

i was thinking the same thing 😄 reading the command description(don't have arma open) 😄

dense galleon
#

My Duuude!! @little raptor got it , thanks a ton

#

that works perfect ive been trying to work that out for while thanks guys

sonic thicket
#

Hello everyone, Could anyone tell me why the hint within this add action does not work (anymore) It's been a month or two but i am pretty sure it worked before:

this addAction ["<t size='1.5'>Pickup Key 1</t>", { 
hint "You picked up a key!";
},[],1.5,true,true,"","alive _target",10,false,"",""];

I can pick the key up but it does not show the hint ( or does anything within the brackets ) anymore

robust hollow
#

works for me 🤷

kindred lake
#

any one know how to make a prop interaction that full heals the player?

sonic thicket
robust hollow
kindred lake
#

thanks

sonic thicket
#

That's weird, the script doesnt works for me even when loaded without mods in a new scenario

copper raven
#

don't see why that wouldn't work

sonic thicket
#

Hmm, it seems that it doesnt works on certain items anymore where they did before

#

it works fine on a keyboard, sadly not on any of the default arma keys

sonic thicket
#

I am not sure if this is the right place to ask but I've been trying to add a add action to a key object however the only key like object this seems to work on is the inventory item key which already has a default pick up action assigned to it. Disabling simulation on the item in question does not seem to help and I can not turn it into a simple object.

A possible way would be to look for a event handler for picking up things and match the keys but I'd really rather have a addaction on the object itself. Do any of you have any ideas on how to make this work?

dense galleon
#

@sonic thicket that is strange your addaction works on other item objects but when i try to use it on the key object "Land_Key_01_F" no joy , question tho what do you want to happen once you "pickup" the key ? since an object like that doesnt really go in your inventory, are you planning to make a virtual/scripted key in a virtual inventory?

#

if so you could always put the key on a desk or shelf and add the addaction to the desk/shelf object

meager epoch
#

Is it possible to change someones callsign mid-mission?

#

With a trigger or something

warm hedge
#

Yes. setGroupId IIRC

sonic thicket
dense galleon
#

@sonic thicket ok so using the inventory item version "Item_Keys" i can give it your addaction and it works, but like you said it still has the default "Take Keys" addaction as well. I do know that if you setDamage on the keys to 1 (dead) the model wont change but it will take away any addactions it has. im not finding other ways to remove that "Take Keys" default action rn sorry

sonic thicket
#

im currently trying out removeaction and removeallactions

dense galleon
#

looks like those are for user added actions, i tested and no change

#

i would consider maybe doing the whole check if the item is in the players inventory and if yes satisfy a condition, or place the Non inventory key item somewhere and then place a less noticeable object underneath and put the addaction on it, for example ive used the Oil spill and trash objects before for similar reasons and you wouldnt notice they were there

#

or an invisible helipad or helper object

sonic thicket
#

I was just about to write that one down, some replacement for addaction. But yeah, oil spills might be a better idea

dense galleon
#

it will at least get you going until you find another solution

sonic thicket
#

Tried the spills, they didnt worked, currently trying out the invis helipad but will need to go after trying that one

plain vale
#

Ok i think this is the right channel to ask, im using unitcapture for the 2nd time, and im trying to capture both a units movement and firing data, I have setup both init.sqf and wp1.sqf files properly, i do the route i want, hit esc, use f1 to capture the movement and f2 to capture the firing data, and as ive read up in tutorials, pasted f1 data into a spawn BIS_fnc_UnitPlay; and the f2 data into a spawn BIS_fnc_UnitPlayFiring;

So far i have no scripting error warnings pop up, but for some reason the unit won't fire the weapons at all, ive tried basic syntax fuckery like moving the unitplayfiring above unitplay but for some reason its not reading the data

#

any idea what could be causing this? I feel like its something very simple, but im not sure what

#

i've also checked and made sure basic stuff like unit name is right in both functions (the vehicle moves according to the set path but just won't fire)

sonic thicket
dense galleon
#

no prob ill try some of them out for you

sonic thicket
dense galleon
#

yeah that sounds like a good plan, and you were right the trash objects didnt work for the addaction, although the luggage ones did

#

you could do addaction "Search Luggage" and find the key , would be simple but with a little more work the eventhandler would be great

lean anchor
#

hey all, i have this in an external script that is called from initserver and im curious why _allplayers comes out to be nothing even though I have myself and 2 HCs connected

"testpw" serverCommand "#lock";
_allPlayers = call BIS_fnc_listPlayers;
diag_log _allPlayers;
{
_allplayer = _x;
"testpw" serverCommand format ["#kick %1",name _allplayer];
}foreach _allplayers;
sleep 150;
"testpw" serverCommand "#unlock";
fair drum
#

that function only gets human players btw

#

you should use allPlayers to include HCs

lean anchor
#

i dont really need the HCs, i chose that function as im just looking to kick players anyway

#

and to my knowledge that function is the earliest way to get players but im now not sure

fair drum
#

well let me review what you are trying to do. you want the game to lock the mission, then kick all the players, then wait, then unlock the mission?

lean anchor
#

exactly

#

im running this at the beginning of a server restart to give the server enough time to spawn stuff and init

fair drum
#

tell me, load in, get to playable state, then call the function in your code

#

just the listplayers

#

It runs fine for me

lean anchor
#

the script does work

#

im just worried that im firing it to early meaning that the _applayers isnt working

fair drum
#

add a waitUntil {time > 0} then?

#

or however many seconds after the mission loads?

#

also to clean your code up a bit do:

//Old
_allPlayers = call BIS_fnc_listPlayers;
diag_log _allPlayers;
{
_allplayer = _x;
"testpw" serverCommand format ["#kick %1",name _allplayer];
}foreach _allplayers;

//New
private _allPlayers = call BIS_fnc_listPlayers;
_allPlayers apply {
    "testpw" serverCommand format ["#kick %1", name _x];
};
lean anchor
#

thanks for that "apply" bit of knowledge. useful command

fair drum
#

only downside I find is not being able to use _forEachIndex when wanting to do some array manipulation

plain vale
#

Can i get some help please? I'm pretty sure the issue is something with:
wp1 = (firing data);
[vehicle, wp1] spawn BIS_fnc_UnitPlayFiring;
I don't have any issues so far with getting the unit to execute the movement side of the data with the f1 copy, its just the firing of its weapons that it does not seem to want to do

lean anchor
#

ill add a delay, thanks man

fair drum
little raptor
#

I don't think there's much you can do. I think the firing thing is buggy anyway.
But you can post it nonetheless. It might be caused by your own code.

fair drum
#

i forgot how big chonky boi these files get. Hope it didn't crash the website for me lol

plain vale
#

yeah im noticing its pretty slow on my end as well

fair drum
#

and how are you calling these and where?

plain vale
#

its only like 3 minutes of data so its not even as bad as it can get from what some people stuff into these things

#

uh what do you mean?

#

for calling im using radio linked trigger

#

lemme get the code one sec

#

rec = [] spawn wp1;

fair drum
#

whats the first few lines in wp1?

#

ignore all the data array

plain vale
#

um what first few line? Im not sure exactly what you mean

fair drum
#

like I'm expecting a bis_fnc_unitPlay or bis_fnc_unitPlayFiring somewhere

#

you got that anywhere?

plain vale
#

?

#

maybe the link did not work

fair drum
#

nah it didn't won't load the second one

#

delete the data array and repost

plain vale
#

kk one sec

fair drum
#

too chonky

plain vale
#

try that

#

it seems to be smoother

fair drum
#

your heli flies around fine?

plain vale
#

yup

#

even mirrors the movements of when i did the strafing runs

fair drum
#

its unitplay being buggy then. its not reliable enough

plain vale
#

damn really?

#

could it be like

#

vehicle specific?

#

im using a CUP heli not a base game one, i was wondering if that was theoretically causing the issue

fair drum
#

try using a base game one then to test it

plain vale
#

there is one other notable change

#

the steam page that suggested the BIS_fnc_UnitPlayFiring had both functions use wp1

#

wp1 =(array here, this part works fine);
[HELI1, wp1] spawn BIS_fnc_Unitplay;

wp1 = (weapon data array here);
[HELI1, wp1, true] spawn BIS_fnc_UnitPlayFiring

#

but that was not working so i thought maybe having both use wp1 might be a source of the issue

#

so i changed wp1 to _shoot for the weapon data

#

i will rig up a quick custom mission and test with a base game helo

fair drum
#

I'm headed to bed for the night. hopefully someone else will help you through the rest of it but its getting late.

pulsar bluff
#

@still forum groupcreated is mission event handler, not object/group event handler right?

brazen lagoon
#

is it possible to request all ai in the area come to heal you?

#

or does this only work if you're the group leader?

#

I guess I could have it remotExec something to the group leader requesting that the whole group heal that unit

little raptor
#

I've never heard of it but judging from the name it's a mission EH

little raptor
brazen lagoon
#

well thats kind of what i mean like

#

can i script an AI reviving me

#

from my googling you'd do something like ai_medic action ["heal", player_unit];

dense galleon
#

Yeah ive seen people script medics in many different ways