#arma3_scripting

1 messages Β· Page 621 of 1

tough abyss
#

Why must he be so inconvenient

amber lantern
#

100%

tough abyss
#

Just make a script modual

#

P l e as e like just make a trigger that triggers at the game starts

amber lantern
#

Hngh

#

The editorcategory does not seem to work

little raptor
#

You're using it wrong

amber lantern
#

Highly likely

#

So I'd like to get all unit type names from Zombies -> Medium Zombies and Zombies -> Slow Zombies

#

so basically I want to find all units under Zombies and then filter based on subcategory

little raptor
#

So look up the zombie in the config and learn their editor cats

amber lantern
#

but editorCategory does not give me those names

little raptor
#

Problem solved

amber lantern
#

It's just either empty or EDCAT_THINGS

little raptor
#

So search in their names

#

There's also editor sub cat

amber lantern
#

Since the editor can display the units just fine I really feel I should also be able to

#

What does the editor use to categorize units?

winter rose
#

some editorCategory config something

amber lantern
#

Is there a remote debugging capability?

#

Using the 3den debug console is pain

amber lantern
#
"true" configClasses (configFile >> "cfgVehicles") select {_name = configName _x; "RyanZombie" in _name && "Opfor" in _name && ("slow" in _name || "fast" in _name)} apply {configName _x}
#

That's the best I could come up with

winter rose
#

you could move the conditions in the "true" string, but it works yes

amber lantern
#

Changed, thanks

#

Another thing I'm trying to do is spawn vehicles around buildings

#
[] spawn
{
    _houses = nearestTerrainObjects [[9000, 9000], ["House"], 13000, false];
    for "_i" from 0 to 100 do
    {
        _pos = getPos (selectRandom _houses);
        _safe = _pos findEmptyPosition [3, 25, "C_Offroad_01_F"];
        createVehicle ["C_Offroad_01_F", _safe, [], 0, "NONE"];
    };
};
#

But this sometimes blows up the vehicles ":D"

#

even if there's plenty of space around the building, ie findEmptyPosition somehow fails to get a position where the vehicle doesn't clip

winter rose
#

Yep, had that issue too
Because you need quite the checks to find a proper position - I had it sometimes find empty space in a house

amber lantern
#

yeah same

winter rose
#

use the BIS_fnc

amber lantern
#

you mean findsafepos?

#

but that doesn't take into account the to be spawned item size

#

hmm I would need to convert the size of the spawned item to objdist

#

oh well yeah sizeOf works

winter rose
#

spawn some place safe ([random 1000, random 1000, 5000+random 5000]) then use sizeOf or boundingBox πŸ˜‰

amber lantern
#

What's annoying though is that the search starts away from the building instead of close to it

winter rose
#

and then you spawn a car on the middle of the road, yep

amber lantern
#

What's the generic error here?

(( count (( units survivors) select { !(_x in thisList) })) + 1 ) >= ( count survivors)
#

ah

#

it's count units survivors of course

robust hollow
#

you could simplify that a little. dont need select

(({!(_x in thisList)} count units survivors) + 1) >= (count units survivors)```
amber lantern
#

oh cool

#

I also need to play with the logic a bit

#
_playing = count (units survivors);
_escaped = {!(_x in thisList)} count (units survivors);
_escaped >= 0.75 * _playing
#

wtf BIS_fnc_findSafePos can be returning a single value πŸ˜„

exotic flax
#

it always returns a single value, it's either the position it found or the default position πŸ€” although the value is always an array with x and y

quasi cobalt
#

Hey guys, what's the best way to just mess around with scripting? Just the debug menu in game?

#

"mess around" as in, test different commands, test syntax etc

#

I have another mission I Want to make but I have zero idea where to start so I gotta do some testing. Going in and out of the editor is getting annoying to change one thing and test -.-

amber lantern
#

@exotic flax _safe = [_pos, 0, 15, (sizeOf "C_Offroad_01_F"), 0, 1, 0, [], _pos] call BIS_fnc_findSafePos;

#

literally returning a number instead of an array πŸ˜„

#

(well a scalar according to typename)

#

whatthefuck

quasi cobalt
#

Is there a "Gettype" style function for this?

exotic flax
#

if _pos is a single number instead of a position array, than it works like that

little raptor
#

Test the code speed in Debug Console.
Use an action menu to test sqf

amber lantern
#

@exotic flax according to the documentation it will always return an array

#

so something really fishy is going on

quasi cobalt
#

Is it an array of tuples?

#

Or just ints?

#

I just ran it using a player and it returned a single number for me as well.

#

3 to be exact.

exotic flax
#

If I run the following in the debug console:

_pos = getPos player;
_safe = [_pos, 0, 15, (sizeOf "C_Offroad_01_F"), 0, 1, 0, [], _pos] call BIS_fnc_findSafePos;
_safe;

The result is [2903.4,5407.24] (random pos in VR)

quasi cobalt
#

Can you do like _safe[0] or whatever the equivalent syntax is

amber lantern
#

@exotic flax try

[] spawn
{
    _houses = nearestTerrainObjects [[9000, 9000], ["House"], 13000, false];
    for "_i" from 0 to 100 do
    {
        _originPos = getPos (selectRandom _houses);
        systemChat (format ["%1", typeName _originPos]);
        _safePos = [_originPos, 0, 15, (sizeOf "C_Offroad_01_F"), 0, 1, 0, [], _originPos] call BIS_fnc_findSafePos;
        systemChat (format ["%1", typeName _safePos]);
        createVehicle ["C_Offroad_01_F", _safePos, [], 3, "NONE"];
    };
};
#

(I tried renaming to see if there would be some freaky collision, nope)

#

The map is virolahti

#

@quasi cobalt _safe select 0

#

and to filter _safe select {condition}

exotic flax
#

hmm... it does sometimes return a single number (float), but it's really random

amber lantern
#

It seems someone else has noticed it also

#

but no response

#

so this be a bug!

#

Hmm seems like short circuiting isn't a thing either

exotic flax
#

I see...

#

defaultPos needs to be a double array

#
_safePos = [_originPos, 0, 15, (sizeOf "C_Offroad_01_F"), 0, 1, 0, [], [_originPos, _originPos]] call BIS_fnc_findSafePos;
#

because if it can't find any position, it will return either the landPosition (1st) or seaPosition (2nd)

#

so wiki is correct, just a bit unclear

#

@amber lantern ^^

amber lantern
#

@exotic flax thank you!

#

What did you use to figure that out?

exotic flax
#

checking the code of bis_fnc_findSafePos and re-reading the wiki πŸ˜‰

#

example 2 on the wiki page is the correct way to use defaultPos

amber lantern
#

Is the code available to everyone?

exotic flax
#

you can use ArmaTools (or better Mikero's Arma2P) to setup a P drive with all Arma 3 PBO's extracted, which contains all functions

amber lantern
#

cool

#

Well gotta go to bed

#

Thanks for the help!

lean furnace
#

Is there a way to cancel a camCommit?
For example. The camera will instantly change to _target2 as expected but the camCommited command will not return true because the first camCommitPrepared is still running.

_cam camPrepareTarget _target1;
_cam camCommitPrepared 30;

_cam camPrepareTarget _target2;
_cam camCommitPrepared 0;

waitUntil {camCommitted _cam};

I was expecting running camCommit or camCommitPrepared being ran a second time to reset camCommited. This is important to me because I have a function that creates a camera that orbits around a target and I gave the function the ability to change variables such as target and rotation speed. So going from a close in camera with a slow camCommit speed to a far out faster camCommit speed is an issue.
To be clear I do have a waitUntil that checks for the camera to be updated and skip the camCommitted.

while {true} do {
  ZKB_MenuCam_CamUpdated = false
  _camPos = ZKB_MenuCam_Target getPos [ZKB_MenuCam_Radius, _camAngle];
  _camPos = (AGLtoASL _camPos); 
  _camPos set [2,ZKB_MenuCam_Height+ZKB_MenuCam_HeightAdjust]; 
  _camPos = ASLToAGL _camPos;
  ZKB_MenuCam camPreparePos _camPos;
  ZKB_MenuCam camPrepareTarget ZKB_MenuCam_Target;
  ZKB_MenuCam camCommitPrepared ZKB_MenuCam_Speed;
  waitUntil {camCommitted ZKB_MenuCam or ZKB_MenuCam_CamUpdated};
};
exotic flax
#

so you want to have the camera at target1 which takes 30sec to get there, and only after you set a variable it should go directly to target2

#

tbf... I'm not familiar with the difference between cam* and cam*Prepared, but as far as I can tell it works exactly the same πŸ€”

#

and I wouldn't be surprised if camCommit takes all active (and running) commands since the last commit

lean furnace
#

@exotic flax I have a function that creates a camera that orbits around a target at a set speed and within that function is the ability to change parameters such as the target, height, radius, and rotation speed.
So lets say It is currently focused on target1 at a speed of 10 seconds (very slow rotation speed) and I want to move that camera to target2 at a speed of .1 (fairly quick rotation speed), while the function see's I've updated the camera parameters and continues the while loop and updates the camera with the new parameters as soon as it gets to waitUntil {camCommited... it will still be waiting for the original delay of 10 seconds to finish. Because the camera updated to the new parameters in .1 seconds the longer delay of 10 seconds is being waited on to commit so the camera stops rotating until that happens.

exotic flax
#

although you could simply have the while loop to rotate around target1 until it needs to switch to target2

while { !ZKB_MenuCam_CamUpdated } do {
   // keep rotating target1
};
// switch to target2

This way it just keeps rotating till you set the variable.

#

or you can have a timer in there, so it will switch when the var updates OR the time has ran out

lean furnace
#

https://pastebin.com/1SMghchV
The function will change targets and do everything exactly how I want, the problem I'm trying to solve is how to either cancel a camCommit or get camCommitted _cam to only look at the last camCommit command all without destroying the camera and recreating it.

exotic flax
#

You can't cancel camCommit (or camCommitPrepared ) except by overwriting the camera and committing again. Same should apply to camCommitted, but I have no idea how this reacts with camCommitPrepared (which obviously takes all prepared stuff in account).

lean furnace
#

That's what I figured, just curious if someone may have had a workaround.

undone dew
#

Hi, so I'm trying to set up the SimpleShops script (adds money and shops) for Zeus compability, and I'm stuck on trying to make it affect every unit on the map so that the Zeus can spawn AI enemies and players can kill them for money. I'm going off of this page on the SimpleShops github (https://github.com/Ppgtjmad/SimpleShops/wiki/Kill-Rewards) where it says to call a function "[this] call HG_fnc_aiUnitSetup;" from a map editor unit's init box, but I need to extend this to work on all newly spawned units since it'll be for Zeus.

I have a thread going on the Bohemia forum (https://forums.bohemia.net/forums/topic/230885-calling-a-function-on-all-units-on-the-map/) to try to get this working using a repeating trigger that encompasses the whole map, but so far I haven't had any luck.

#

it also can only run once on each unit, because if the function is called more than once on a unit the cash rewards stack so the longer the unit's alive the more money you'll get. so this is the code in the trigger that I'm trying to get working:

`{

if(!(_x getVariable ["aiSetupDone",false])) then
{

_x call HG_fnc_aiUnitSetupο»Ώο»Ώ;

_x setVariable ["aiSetupDone",true];

};

} forEach thislist;`

cold glacier
#

Firstly: I suspect it's not a great idea to use a map-wide trigger. It's an innovative solution, sure, but I suspect it would absolutely hammer performance.

#

Bear in mind that only applies to placed objects in Zeus, not existing ones on the map.

#

Thirdly: make sure you run HG_fnc_aiUnitSetup on the server. Yes. It's filed under the client folder for some reason. But it'll only work on the server.

#

Fourthly: If you want to apply a function to all units, try something like:

allUnits select {side _x == east}
#

@undone dew

#

Not sure you were getting the semicolon error on the forums though. Could be you need a space between if and the first bracket? Pure speculation though.

undone dew
#

thanks, i'll check that out tonight

undone dew
#

@cold glacier I think that might be a perfect solution, but where should I add the eventhandler for it to work? would putting it in my init.sqf do the trick?

versed belfry
#

I am trying to use the command addMagazineTurret to add magazine to an empty mortar/artillery piece but it is not doing anything, am I using the wrong command or doing something wrong?

D1 addMagazineTurret ["ML700_M_32Rnd_260mm_Scattershot",[0,31]];
#

Also is there any script or command that forces the AI to reload?

winter rose
#

reload maybe

quasi cobalt
#

Hey, can someone point me in the right direction for setting up a "lout out" screen before the mission starts?

#

I've seen it done on a few missions, you get an arsenal screen before the mission deploys.

versed belfry
#

@winter rose works on units, not vehicles

#

Unless I am doing something wrong, which is very possible

young current
#

Vehicle weapons reload only when empty I think

winter rose
#

you can add a full mag, remove/add weapon - it should do the job

versed belfry
#

A'ighty will try

compact maple
#

is there a built-in function to pass a number like 10000 and it returns "10 000" ?

winter rose
#

none I know, but it is doable

compact maple
#

okay thanks

#

will try to write it

robust hollow
winter rose
#

@compact maple ↑ beep beep!

#

we have a winner πŸ˜ƒ

compact maple
#

eey thank you 😁

versed belfry
#

Is there a script that I can use to delete all objects/units in a radios of a point without having to have a delete command for every single object?

winter rose
#

nope, but you can deleteVehicle forEach

versed belfry
#

Oki doki, thanks

turbid zenith
#

Heya everyone, is there a script that changes spawned units from Independent to OPFOR?
For example: We have the Project OPFOR mod with the Iranian Army, and I want them to be OPFOR (Red guys) instead of Independent, but only the Iranian Army

warm hedge
#

If you can use createUnit or such, you can use the desired side's group via createGroup, that'll help, maybe

tough abyss
#

Hello, is it possible to insert buttons in the listBox? I need to insert 2 buttons on the right and left (- and +)

warm hedge
#

Just like Arsenal?

tough abyss
#

Yep

warm hedge
#

How about to use ListNBox?

tough abyss
#

Can I change the text from < > to + and - ?

warm hedge
#

You can replace the character as you want

tough abyss
#

ok thanks

hallow mortar
#

I have a position, and I have a 3D vector from that position. I want to find the coordinates of a point x metres from that position, along that 3D vector. How would I do this?

warm hedge
#

vectorNormalized and vectorMultiply?

hallow mortar
#

And that would return a usable world position?

winter rose
#

well, yes

hallow mortar
#

sorry, I'm just having a lot of trouble getting my head around this

#

I think there may be multiple problems, too, which isn't helping

winter rose
#
private _oneMeter = vectorNormalized _vectorDirection;
private _threeMeters = _vectorDirection vectorMultiply 3;
startPos vectorAdd _threeMeters;
```πŸ™‚
hallow mortar
#

What I'm trying to do is force a searchlight turret (the GM one) to look at the same place the player (a vehicle gunner) is aiming at (well, a point 600m in the direction the barrel is pointing).
I have:

  // this bit works, verified by other means
    _dir_gun = [_veh_armed selectionPosition _veh_turr_beg,_veh_armed selectionPosition _veh_turr_end] call BIS_fnc_vectorFromXToY;
// ???
  _normgun = (vectorNormalized _dir_gun) vectorMultiply 600;
  _lightTarget = (_veh_armed selectionPosition _veh_turr_beg) vectorAdd _normgun;
  if (_veh_armed in [vehNATO_IFV1]) then {
    [unitNATO_SL1,_lightTarget] remoteExec ["doWatch",unitNATO_SL1];
    [unitNATO_SL1,_lightTarget] remoteExec ["lookAt",unitNATO_SL1];

End result: the spotlight doesn't move, and I can't tell why

winter rose
#

selectionPosition is relative, no?

#

yep, in model space

hallow mortar
#

so...I need to run it through modelToWorld or something first?

winter rose
#

if you want to watch 600m away, the position can be the vehicle itself, it wouldn't matter that much, right? πŸ€”

hallow mortar
#

....I....maybe? I don't know.

#

I think I want to try to reduce parallax as much as possible, because the searchlight turret and gun turret are a bit offset, and the player will want to also aim at things that are closer than the 600m convergence point

#

the more I look at this problem the less my head works, so...

winter rose
#

don't look at it!

hallow mortar
#

I added:

_lightTarget = (_veh_armed modelToWorld (_veh_armed selectionPosition _veh_turr_beg)) vectorAdd _normgun;```
the searchlight still doesn't move. If the vector/position is wrong, it should still move but the aim point would just be wildly wrong, right? So if it's not moving maybe the problem is also with some kind of refusal to behave on the part of the searchlight AI
winter rose
#

Create some object at the destination position so you can debug visually

hallow mortar
#

it seems that not only is the vector still wrong, it is moving with the gun direction as expected but the searchlight isn't following it

#

it's based on ALIAS' searchlight script (https://www.armaholic.com/page.php?id=31779), but I realised that that was a bit too hacky and not quite effective enough for my mission needs, and long story short now I'm here with something that's even more hacky and also doesn't work properly

little raptor
#

@hallow mortar First of all, what are _veh_turr_beg and _veh_turr_end?
second of all, the resulting direction vector is in model space. I don't know what you're trying to do with it

#

You said you wanted to specify a position for the AI to watch?

#

Try this

#
_dir_gun = _veh_armed vectorModelToWorld ((_veh_armed selectionPosition _veh_turr_beg) vectorFromTo (_veh_armed selectionPosition _veh_turr_end));
// ???
  _normgun = _dir_gun vectorMultiply 600;
  _lightTarget = (_veh_armed modelToWorld (_veh_armed selectionPosition _veh_turr_beg)) vectorAdd _normgun;
  if (_veh_armed in [vehNATO_IFV1]) then {
    [unitNATO_SL1,_lightTarget] remoteExec ["doWatch",unitNATO_SL1];
    [unitNATO_SL1,_lightTarget] remoteExec ["lookAt",unitNATO_SL1];
  }
#

This should work

#

Test it

hallow mortar
#

First of all, what are _veh_turr_beg and _veh_turr_end?
Config selections on the vehicle model. That part is retained from the original script and does work.

little raptor
#

Ok. I think I got it right then

hallow mortar
#

as far as I can tell, the debug objects are now being created almost (but not quite) directly behind the player's aim....and the searchlight still doesn't move

little raptor
#

The player's aim?

#

So _veh_armed is a player vehicle?

hallow mortar
#

To summarise (and I do recommend checking the example mission, I think it will help):

  • player M113 with a searchlight turret strapped to it
  • the searchlight should aim at the same position, approximately, as the vehicle's gun is pointing
  • this is a hack to get around the inability to simply spawn a searchlight light cone and directly attach it to the gun
little raptor
#

so try this

 //_dir_gun = _veh_armed vectorModelToWorld ((_veh_armed selectionPosition _veh_turr_beg) vectorFromTo (_veh_armed selectionPosition _veh_turr_end));
// ???
  _normgun = getCameraViewDirection gunner _veh_armed vectorMultiply 600;
  _lightTarget = (_veh_armed modelToWorld (_veh_armed selectionPosition _veh_turr_beg)) vectorAdd _normgun;
  if (_veh_armed in [vehNATO_IFV1]) then {
    [unitNATO_SL1,_lightTarget] remoteExec ["doWatch",unitNATO_SL1];
    [unitNATO_SL1,_lightTarget] remoteExec ["lookAt",unitNATO_SL1];
  }
hallow mortar
#

I don't want it to be affected by free look. And that might break if the gunner gets out.

little raptor
#

so try this

 //_dir_gun = _veh_armed vectorModelToWorld ((_veh_armed selectionPosition _veh_turr_beg) vectorFromTo (_veh_armed selectionPosition _veh_turr_end));
// ???
  _normgun = (gunner _veh_armed weaponDirection "") vectorMultiply 600;
  _lightTarget = (_veh_armed modelToWorld (_veh_armed selectionPosition _veh_turr_beg)) vectorAdd _normgun;
  if (_veh_armed in [vehNATO_IFV1]) then {
    [unitNATO_SL1,_lightTarget] remoteExec ["doWatch",unitNATO_SL1];
    [unitNATO_SL1,_lightTarget] remoteExec ["lookAt",unitNATO_SL1];
  }
#

if you have specified your _veh_turr_beg and _veh_turr_end correctly, it should've worked with the first code. If it was reversed, reverse the vectors

#
_dir_gun = _veh_armed vectorModelToWorld ((_veh_armed selectionPosition _veh_turr_beg) vectorFromTo (_veh_armed selectionPosition _veh_turr_end));
// ???
  _normgun = _dir_gun vectorMultiply -600;
  _lightTarget = (_veh_armed modelToWorld (_veh_armed selectionPosition _veh_turr_beg)) vectorAdd _normgun;
  if (_veh_armed in [vehNATO_IFV1]) then {
    [unitNATO_SL1,_lightTarget] remoteExec ["doWatch",unitNATO_SL1];
    [unitNATO_SL1,_lightTarget] remoteExec ["lookAt",unitNATO_SL1];
  }
#

Maybe this will work? (I just reversed the vector)

hallow mortar
#

if you have specified your _veh_turr_beg and _veh_turr_end correctly
They appear to be correct. Like I said, this was part of the original searchlight script from ALIAS and worked correctly in that context, where it was used for...approximately the same thing

little raptor
#

What about the new code? You said the target was "behind" you now right? So it must've been a reversed vector.

hallow mortar
#

I mean, I guess, I just don't see how that could have happened.

#

switching to weaponDirection now has the correct position. I'm just left with the problem of the searchlight not moving.

little raptor
#

Does the searchlight have an AI?

hallow mortar
#

Yes. The AI is set to:

Hide model
Do not allow damage
Careless
Forced Hold Fire```
little raptor
#

Also, by strapped to, do you mean attachedTo?

hallow mortar
#

Yes

little raptor
#

It doesn't work that way

#

AttachTo fixes the gun

#

You cant rotate it

hallow mortar
#

That's a little odd, because I've attached static weapons to other vehicles before and been perfectly able to use the gun

little raptor
#

Try detaching the searchlight, see if it works

hallow mortar
#

Detached; no change.

little raptor
#

I think what I said is only true about men (I'm sure if you attach a unit to another object, they cant rotate)

#

Ok I was wrong about that

winter rose
#

turrets can rotate, not objects

little raptor
#

Can the spotlight even watch a direction normally?

winter rose
#

a guy can aim left/right if he has a deadzone

little raptor
#

Like spotLight doWatch player

#

a guy can aim left/right if he has a deadzone
Yeah, I realized it later

winter rose
#

a spotlight should doTarget I believe

little raptor
#

good point

#

But it requires a fake target

normal monolith
#

hi guys,

sorry for interrupting, is there a function or command that add an item in the inventory that has 0 (noSlot) as type ?

winter rose
#

addItem?

normal monolith
#

already tried, it doesn't work

winter rose
#

what is noSlot?

#

nvm, found it

#

it's for weapons, not items, right?

#

so addWeapon

little raptor
#

Now let me ask a question:
Does anyone know where you can get the list of all commands and their syntax in the game?
Basically, I want to know where the debug console autoComplete feature gets those parameters from.
Like:
createVehicle [type, position, ...]

winter rose
#

the wiki?

little raptor
#

Lol

#

No, I want them in the game

winter rose
#

utils 5 iirc

little raptor
#

Yeah, but it doesnt show the parameters

#

All it shows is :
createVehicle ARRAY

hallow mortar
#

Mondkalb 27/05/2019
a addWeaponTurret ["fakeweapon", [0]];
a dowatch player

doWatch doesnt work normally because the AI needs some weapon assigned to the turret. Adding a fakeWeapon enables this.
I would like to purchase a larger screaming emoji to properly convey my state of mind

winter rose
#

no accessible commands Config as far as I know

little raptor
#

There should be something...
When you get an autocomplete hint, and press F1, you get a dialog that shows you the command, plus a description

winter rose
#

I know that

little raptor
#

Most of the time, dialogs are filled by functions...

winter rose
#

but you don't want to reverse-engineer anything πŸ™ƒ
it's somewhere, but not in config

little raptor
#

Yeah. I was hoping I could find a function or something

#

I already did with utils 5

hallow mortar
#

I've added the SEARCHLIGHT weapon to the Searchlight and now the AI can use doWatch properly. Problem solved!

little raptor
#

Nice

#

I didn't know that! πŸ“

winter rose
hallow mortar
#

yes, I assume it's used by the Hellcat turret in vanilla. When I saw it earlier I figured it was just for the UI or a remnant of an older system, but now I know why it's actually needed.

#

It's mildly aggravating that GM searchlights don't have it by default, but that's not a scripting problem.

little raptor
#

FOUND IT:

supportInfo

SWEEEEEEEEEEEEET

civic pebble
#

@torpid quartz Try:

this addAction ["Full Heal", { [player, player] call ace_medical_treatment_fnc_fullHeal; }];

so i was trying to make a medical/healing tent... i used this and it works perfect.

I was wondering if there is a way to alter it so it heals people if they are carried or dragged into the tent?

willow hound
#

Use a trigger.

finite sail
#

backpackItems doesn't return classnames

#

not what I expected

#

it returns a string

little raptor
#

Yes it does

#

They are class names

finite sail
#

if i spawn Item_money on the ground using createvehicle

#

pick it up

#

backpackitems returns "money"

#

a string

#

doing it again now

little raptor
#

It returns an array (?!)

finite sail
#

well yes.. an array of strings rather than an aray of classnames

still forum
finite sail
#

ok.. spawned "Item_SmartPhone"

#

on the ground

#

pick it up, in the inv screen, drag it to my backpack

#

baclpackitems player returns

#

["MineDetector","Binocular","SmartPhone"]

#

this is to do with groundweaponholders and stuff isn't it?

little raptor
#

It's because it was a "vehicle" (object) before

finite sail
#

yeah

little raptor
#

Now it's an item (probably a mag)

finite sail
#

yes, an item

#

i wanted to get classnames of the contents of a backpack

#

--- lokking in the config

#

its not displayname

little raptor
#

It becomes a mag

#

It's not the display name

finite sail
#

no

little raptor
#

It's the classname of the mag

#

isClass (configFile >> "cfgMagazines" >> "smartphone")

#

Return true

finite sail
#

right

#

the biki example does have backpackItems returning an array of classnames

little raptor
#

It's an array of "magazine" classNames

#

Not "vehicle"

finite sail
#

yes, i see that now

#

configfile >> "CfgVehicles" >> "Item_SmartPhone" >> "TransportItems" >> "SmartPhone" >> "name"

little raptor
#

Exactly

finite sail
#

returns the text

little raptor
#

Remove everything after smartphone

finite sail
#

yes

little raptor
#

It should be:

"true" configClasses (configfile >> "CfgVehicles" >> "Item_SmartPhone" >> "TransportItems")
#

I'm not sure if you can do the reverse (get vehicle className from mag)

finite sail
#

its not a problem, i can workaround, thanks for help

little raptor
#

no problem

finite sail
#

what does thonk mean? was dedmen talking to us?

little raptor
#

He was confused by what you wrote

finite sail
#

hes not the only one lol

little raptor
#

well yes.. an array of strings rather than an aray of classnames

finite sail
#

ah yes

little raptor
#

It was classnames

finite sail
#

ive had some beer

#

the text backpackitems returns is basically the classname minus the characters "Item_"

#

so I can take that text, add "Item_" to the front of it and get the classname back

little raptor
#

not always true

finite sail
#

it is for the items im using

little raptor
#

ok

finite sail
#

ive checked

little raptor
#

But if you use mods it wont be

finite sail
#

good point, though I'm only using items and I'll only be using vanilla ones at that

#

Item_AntimalaricumVaccine
Item_ChemicalDetector_01_watch_F
Item_SecretFiles
Item_FlashDisk
Item_Keys
Item_Laptop_closed
Item_SmartPhone
Item_Money
Item_SatPhone
Item_C_UavTerminal

#

players have to ninja into an enemy town and deliver one of these

#

Anyhoo, thanks @little raptor , you're a gent πŸ™‚

little raptor
#

Does anyone know if it's possible to get a list of files in the mission path?

exotic flax
#

Open Explorer...

#

But no, there are no commands to list files

finite sail
#

i was convinced killzonekid had done something similar but can't find it

little raptor
#

It might be possible with extensions, but I was trying to avoid that

still forum
#

there are commands to list files

#

there will be

#

not sure if they work right for missions tho

little raptor
#

In 2.0?

still forum
#

ye

little raptor
#

great

finite sail
#

mmmm

still forum
#

addonFiles or what its called

little raptor
#

Oh

#

I thought you meant another one

finite sail
#

i was looking at that just now

little raptor
#

Yeah I know that one

#

addonFiles [""] or addonFiles [getMissionPath ""] dont work (for missions)

hallow mortar
#

just to be sure I'm not going insane, this:

!(o_tower1 getVariable [""stage2"",false])

should return true if the variable stage2 is false or undefined, right?

little raptor
#

To Dedmen
I know, I thought you meant it works!

#

Why two "?

#

It's wrong

#

You can even see it!

hallow mortar
#

it's in a holdAction condition which is passed as a string, so I have to escape the quotes

little raptor
#

oh

#

Ok

#

Yeah, it should

agile pumice
#

so I'm trying to get a unit (M1) to fire on the location of a trigger (arty1) via a mortar but he won't fire off any rounds

#

M1 doArtilleryFire [position arty1, "8Rnd_82mm_Mo_shells", 8];

hallow mortar
#

Try using inRangeOfArtillery to make sure the unit can hit that target

agile pumice
#

Its saying false when the default range is set to short

ebon citrus
#

Dedmen just got me really excited

#

Any eta on 2.0 yet?

cold glacier
#

Not sure, but it's on Release Candidate branch and Dev branch if you want to test @ebon citrus

daring sentinel
#

is there anyway to make particle effect come out smoothly not pop up??

warm hedge
#

Put an element with 0 alpha to the color section

#

@daring sentinel Show me your current ParticleArray BTW

daring sentinel
#

here

warm hedge
#

And what do you mean by pop up?

daring sentinel
#

it just pop out instantly
looks doesn't like blow by the wind

warm hedge
#

It doesn't seem so

daring sentinel
#

😢 ??

warm hedge
#

Because I just tested

daring sentinel
#

I want to make dust effect under the Jets
and I did it
but it looks not good enough for me

#

like this

warm hedge
#

My test never behaves like that. Show me your entire script

daring sentinel
#

because of the sleep time?

warm hedge
#

No. Because you literally throw me the wrong script to investigate

#

I changed every 0.12 alpha to 0.0 at every particle effects' color's first element, and works fine

daring sentinel
#

πŸ€” let me try it

#

oh s*** it works πŸ˜„

#

thank you @warm hedge

fair drum
#

are artillery shells actual objects when they are fired? Like I can try to see if a fired shell enters a trigger zone?

warm hedge
#

Yes

undone dew
#

hey, I found this script to spawn a group in a random spot around a map editor marker, but I'm getting "Error Zero Divisor" when I try to implement it. I've got a map marker called zuluMarker and am calling the .sqf with a trigger.

zuluDefense.sqf:
`_spawnCenter = getmarkerpos "zuluMarker";

_radiusX = 100;
_radiusY = 100;

_randomX = random _radiusX;
_randomY = random _radiusY;

_randomPositionSelect = random 9;
if (_randomPositionSelect >= 5) then {_randomX = _randomX; _randomY = _randomY}else {_randomX = _randomX - (2*_randomX); _randomY = _randomY- (2*_randomY);};

_spawnPos = [_spawnCenter select 0 + _randomX , _spawnCenter select 1 + _randomY, _spawnCenter select 2];

_group = [_spawnPos, EAST, "NVA_68heavyweaponsquad1"] call bis_fnc_spawnGroup;
_waypoint = [_group, _spawnCenter] call BIS_fnc_taskAttack;`

The error is:
_spawnPos = [_spawnCenter |#|select 0 + _randomX, _spawnCenter selec... Error Zero divisor

robust hollow
#

thats a precedence issue. it is basically reading that element as _spawnCenter select (0 + _randomX).
change the line to _spawnPos = [_spawnCenter#0 + _randomX , _spawnCenter#1 + _randomY, _spawnCenter#2];
or wrap your selects like this _spawnPos = [(_spawnCenter select 0) + _randomX , (_spawnCenter select 1) + _randomY, _spawnCenter select 2];

undone dew
#

awesome, the second option fixed it

#

tyvm

undone dew
#

so I'm trying to make these newly spawned units editable by Zeus, I've added this line at the end curatorMod addCuratorEditableObjects [[_group],true]; (with the Zeus game master module named curatorMod) but I'm getting Error Type Group, expected Object. How do I refer to the curator object properly?
(https://community.bistudio.com/wiki/addCuratorEditableObjects)

cosmic lichen
#

Check the right hand side of your command.

#

Something is wrong there πŸ˜‰

undone dew
#

is it that _group shouldn't have the extra [ ]? I tried without already but it didn't work either, I just added it since they do so on the wiki page

little raptor
#

You need an array of objects

#
curatorMod addCuratorEditableObjects [units _group,true];
undone dew
#

ohh I see what you mean now

#

yea cause the wiki says units "returns an array with all the units in the group or group of the unit"

#

so that would be sense if it's looking for that array.. man this stuff gets so complicated xD

cosmic lichen
#

You will get better at it, don't worry

undone dew
#

hey, I'm getting better already. I just figured out how to add a function to each of the units as well (that makes it so players earn the kill reward from SimpleShop's exp/money system)
{_x call HG_fnc_aiUnitSetup} forEach units _group;

I'll call this a success for tonight, I got everything set up how I want it, thanks a ton guys

still forum
#

Any eta on 2.0 yet?
yes, but not for you muhahahahahahahaha

winter rose
#

I actually never tried, does someone know if an exitWith will simply leave the then-block it is in, or one level above? e.g

if (alive player) then
{
  if (damage player == 0) exitWith {};
};
// will it continue here?
compact maple
#

think it will simply leave the then scope, because I had to do _exit = true inside the exitWith{} then check for _exit value in some scripts

winter rose
#

thanks - I will test it soon, will let you know

compact maple
#

nevermind

#

better forget what I said xD

winter rose
#

I'll give it a try rn :p

#
systemChat "0";
if (alive player) then  
{ 
  systemChat "1";
  if (damage player == 0) exitWith {}; 
  systemChat "2";
};
systemChat "3";
// displays 0, 1, 3
compact maple
#
if (true) then {
  if (alive player) then {
    if (damage player == 0) exitWith {};
    systemChat "foo"; //doesnt show
    };
  systemChat "bar"; //shows up
};
warm storm
#

hey how do I make it so when a player kills someone it executes this script

#
life_cur_task setSimpleTaskDescription [format ["You have killed a player"],"Kill",""];
life_cur_task setTaskState "Assigned";
player setCurrentTask life_cur_task;```
winter rose
#

add a "Killed" event handler πŸ™‚

warm storm
#

yeah i looked into it but i dont understand how too

winter rose
#

the wiki explains it all

warm storm
#

to the init.sqf?

winter rose
#

wherever - this kind of question is best asked on the L*fe Discord

warm storm
#

life

#

?

#

im just making an attack and defend bro xd

winter rose
#

why the l*fe_ variables then?

warm storm
#

idk my friend life dev help me

#

do i not need life variable

still forum
#

probably thought all script variables have to be prefixed with life_ to work

warm storm
#

hahaha

#

so i just remove life_

#

cur_task = player createSimpleTask [format ["Kill"];
cur_task setSimpleTaskDescription [format ["You have killed a player"],"Kill",""];
cur_task setTaskState "Assigned";
player setCurrentTask life_cur_task;

#

so would i put this in a script

#

and then on the init say

#

this addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];

#

bro arma confusing as fuck someone please help

smoky rune
#

Is there any way to force vanilla AN/MPQ-105 radar to scan horizon (rotate the radar block)?

winter rose
#

what do you want to achieve?
you could disable its simulation, or place it empty

warm storm
#
    params ["_unit", "_killer", "_instigator", "_useEffects"];
}];


cur_task = _instigator createSimpleTask [format ["Kill"];
cur_task setSimpleTaskDescription [format ["You have killed a player"],"Kill",""];
cur_task setTaskState "Assigned";
player setCurrentTask cur_task;```
#

this is what i ran

#

in a onPlayerKilled.sqf

#

then in the init.sqf i called onplayerkilled

#

i doesnt work

#

please help me

smoky rune
tough abyss
#

what's the difference between an idc and a control?

#

the wiki isn't exactly clear on that datatype

copper raven
#

idc is the id of the control (id-control), scalar, a control is a control

winter rose
#

the wiki isn't exactly clear on that datatype
πŸ‘€

idc: Number
ctrl: Control

you can click on types to get a definition πŸ˜‰

tough abyss
#

Description: Control UI object.

#

damn

#

its a ui object? 😳

warm hedge
#

What did you expected? meowhuh

tough abyss
#

but no seriously, the idc is an idc of a ui component, what value is control?

#

as in idc is defined in an hpp file as idc=2481859459

warm hedge
#

What do you mean?

tough abyss
#

idc is a defined number in an hpp file
how do you refer to a control? Is it the name of the UI class or?

warm hedge
#

_ctrl = _display displayCtrl _idc

tough abyss
#

breh

#

thank you

warm hedge
#

So basically you shouldn't have the same idc for more than two controls

tough abyss
#

I figured that out yes

#

its the most obvious part of this

#

the part i was confused about is how do you get a control instead of the idc

#

that answers it ty

tough abyss
#

is it possible to store code in a listbox?

warm hedge
#

Use lbSetData

tough abyss
#

problem is, it's string

#

I'd need to store some variables in it aswell

#

which i'm not sure if its possible

warm hedge
#

Just need to compile it

tough abyss
#

in a string

#

@warm hedge wait, is it possible to use a variable in a string?

warm hedge
#

What?

tough abyss
#

i'd guess not because it doesn't make sense

warm hedge
#

call compile "smth = 1;"; will make smth 1

tough abyss
#

"[45, 71] call function"
"[_variable, 71] call function"

#

this i what I mean, how would I go around doing this? @warm hedge

warm hedge
#

What is _variable?

tough abyss
#

its just an example

#

what I need to do is put a variable in a string

#

thats the problem

warm hedge
#

Not sure what you wanted to achieve

tough abyss
#

its fine

#

found what i needed

warm hedge
#

Just trying to proofing concept, is there any EH to get if an object's parent has changed? The thing I wanted to do is, check if a backpack (which is a vehicle)'s owner has changed (= detects if an unit has picked up/dropped), and add the EH to the backpack, not an unit

knotty kayak
#

Looking for some assistance, wanting to create a script for a Milsim where players can go up to an object and use the scroll menu to select a kit from the available options, I have folders with the kits already made but unsure of how to set up an object with the loadout list.

The loadouts are exported from the Virtual Arsenal and are all put into a main "Loadouts" folder to go into the mission file for the server.

tough abyss
little raptor
#

@warm hedge Nope. You might be able to use put/take event handlers (but it requires adding this to all units, and I'm not sure if it triggers if you use addBackpack)

warm hedge
#

Hmm, thanks

rain mural
#

Can anybody assist me with getting textures to display on a Rugged Large Screen?
So I am able to get the textures to display and show up on the screens... only if I have the image placed in the editor on a photo first. Without a photo of these textures, it simply won't render. Whether it be via the init.sqf or the object's init itself. Do they have to be "cached" first or something? I am grabbing the images from an images folder inside the mission's root

little raptor
#

I'm not sure, but maybe try:

getMissionPath "myfolder\myimage.paa"
#

To get the texture

rain mural
#

Ok I will give that a shot and see, thanks.

little raptor
#

@rain mural If it's in the mission root, it's simply:

getMissionPath "myimage.paa"
rain mural
#

It is in a sub-folder. I think that worked. I am going to try it for the other 3 images quick and see

#

Ok I think that solved it. Thank you πŸ™‚

little raptor
#

np

neon wind
#

Need helo

#

Help

#

I have followed a tutorial on adding a script that would spawn a random injured person however I don't know where I should be putting the the SQF file

#

Its to be used I'm multiplayer

#

And I cannt find the answer anywhere

hallow mortar
#

It's hard to say without seeing the script. There's no universal "this is where you put scripts that spawn random injured persons" answer.

tough abyss
#

@neon wind usually the main directory of where the mission is saved

neon wind
#

Iit keeps saying not found script folder or summit about bios

#

I'll screen shot it in a bit

#

Just about to eat

#

Doing my head in haha

tough abyss
#

send a screenshot of it then mate

neon wind
#

Will do give me a a bit Sunday dinner time

tough abyss
#

anyways, how would go about using the define macro for IDCs?

#

I've tried doing it in the description.ext file, however they still get identified as unknown variables

winter rose
#

use a macro parameter

tough abyss
#

@winter rose ^what i said second

#

and also is it possible to use the macros themselves in code?

#

instead of the idc values themselves

little raptor
#

@tough abyss

and also is it possible to use the macros themselves in code?
Yes.
Where do you even put the defines?

tough abyss
#

defines file i used for the gui control types and shit

little raptor
#

Do you include it?

#

in the script and the GUI file

knotty kayak
#

so I have the menu popping up via scroll menu but when used it doesn't give the loadout, anyone know how to fix it?

Init:
this addAction ["Officer Commanding", {"/PWRR-Loadouts/Blue-Tiger/PWRR-BT-Coy-OC.sqf"}];

tough abyss
#

ah there's my mistake

#

didn't include in the sqf files

little raptor
#

@knotty kayak Remove the { } (provided everything else is set up correctly)

ashen warren
#

hello everyone, I am trying to pass along variables to a different SQF but get a return value as error in expression and error position, would anyone know what I might be doing wrong here?

here is the RTP error

10:14:31 Error in expression <t ("Stress = " + (str _stress));
 
 
_nil = [_lowerstress, _stress, _maxstress] ca>
10:14:31   Error position: <= [_lowerstress, _stress, _maxstress] ca>
10:14:31   Error Generic error in expression

SQF

// Compile
cheif_stressCheck = compileFinal preprocessFileLineNumbers "APT_Adapt\stress.sqf";

//Parameters list
 
isMusicActive = 1;
 
debugging = 1;
 
 
//Stress modes
//stress represents min and will be main changer
private _stress = 0;
 
private _maxstress = 100;
 
//How much is lowered each second.
private _lowerstress = -1;
 
 
private "_nil";
 
//Every second
while{true} do
{//Main Loop
    if(isMusicActive isEqualTo 1) then
    {
      //debug - show stress  
        hint ("Stress = " + (str _stress));
 
        //lower stress and pass values
        _nil = [_lowerstress, _stress, _maxstress] call cheif_stressCheck;
    };
 
    sleep 0.2;
};

little raptor
#

first of all, add syntax highlighting to your code:

ashen warren
#

how do i do that

#

oh

little raptor
#

What is the contents of the other file?

ashen warren
#

Give me a sec. apparently it is too long for discord

little raptor
#

you can use sqfbin

ashen warren
#

stress.sqf

#

forgot to remove the old comments from this so excuse the commented sections

little raptor
#

_stress is not changing in the current script

#

Due to params

#

why do you use uiSleep

#

It's pointless

ashen warren
#

i honestly forgot

little raptor
#

You've already used the command

ashen warren
#

it was left over from an old loop i removed

little raptor
#

Plus you only need findIf

#

Not count

ashen warren
#
findif ((getPosATL player) nearObjects ["AllVehicles",30])
#

like that

little raptor
#
_enemy = ((getPosATL player) nearObjects ["AllVehicles",30]) findIf {
    _relation   = (side player) getFriend (side _x);
    (_relation < 0.6) 
} != -1; 
#

Like this

#

And you don't need all vehicles

ashen warren
#

ok

#

interesting

little raptor
#

You have an undefined variable

#

stress

#

line 38

ashen warren
#

DANG MISSED ONE

little raptor
#

And last, return _stress in the end to use in the other code

#
while{true} do
{//Main Loop
    if(isMusicActive isEqualTo 1) then
    {
      //debug - show stress  
        hint ("Stress = " + (str _stress));
 
        //lower stress and pass values
        _stress = [_lowerstress, _stress, _maxstress] call cheif_stressCheck;
    };
 
    sleep 0.2;
};
#

put a _stress in the end of stress.sqf

knotty kayak
#

@little raptor hasn't changed anything removing the {} any ideas?

little raptor
#

Is everything else set up properly?

#

Are you sure the path to your script is correct?

#

Are you sure the script works?

knotty kayak
#

it should be, testing on a server with the loadouts in the pbo, file paths are correct

little raptor
#

does it throw any errors?

knotty kayak
#

No errors, just doesn't do anything

little raptor
#

then your script path might not be valid

neon wind
#

@tough abyss

#

you about buddy

#

or anyone who is good with scrpits

#

scripts

tough abyss
#

im not good lol you should post the screenshot to someone else

neon wind
#

Oh lol

#

I just need to know where I'm putting it to be honest

#

@here anyone able to chat though with me scripts

#

I'll screen share

little raptor
#

@knotty kayak Try:

this addAction ["Officer Commanding", {_this execVM "PWRR-Loadouts/Blue-Tiger/PWRR-BT-Coy-OC.sqf"}];
#

Let me know what errors you get

#

@neon wind You can just ask your question here

neon wind
#

{if ((typeOf _x == 'b_survivor_F') && (!isPlayer _x)) then {deleteVehicle _x}} forEach allUnits;

[MedicalData,3] call BIS_fnc_dataTerminalAnimate; //activates the animation for opening the terminal.
sleep 5;

_group1=createGroup west;

'b_survivor_F' createUnit [getmarkerPos 'Patient1', _group1,'pat1=this; dostop pat1'];

[pat1, selectRandom[0.3,0.5,0.7,0.9], "leg_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,0.5,0.7,0.9], "leg_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,0.5,0.7,0.9], "body", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,0.5,0.7,0.9], "head", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,0.5,0.7,0.9], "hand_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,0.5,0.7,0.9], "hand_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1] call ace_medical_fnc_handleDamage_advancedSetDamage;

[MedicalData,0] call BIS_fnc_dataTerminalAnimate; //activates the animation for closing the terminal.

hint 'Your patient is ready';

//the first selctrandom chooses a random damage from a small one to a large one, the second selectrandom chooses the type of damage.

#

thats the script but i have no clue why its not working

smoky verge
#

is there a way to detect if its raining or not?

knotty kayak
#

@little raptor no errors but still not working

winter rose
#

@smoky verge overcast > 0.7 && rain > 0 I believe

smoky verge
#

oh thanks

ashen warren
ashen warren
#

Still gettting the same error

14:43:52 Error in expression <"Stress = " + (str _stress));


_stress = [_lowerstress, _stress, _maxstress] ca>
14:43:52   Error position: <= [_lowerstress, _stress, _maxstress] ca>
14:43:52   Error Generic error in expression
still forum
#

That is the whole error? nothing else?

ashen warren
#

that is the whole error

still forum
#

what is in "cheif_stressCheck"

#

ah nvm

#

cheif_stressCheck never returns anything

#

you are assigning the result of cheif_stressCheck to _stress
but cheif_stressCheck doesn't have any result

#

put
_stress at the end of Stress.sqf, into the last line

ashen warren
#

so just put _stress at the very end

still forum
#

Yes, and that's also what @little raptor already told you

put a _stress in the end of stress.sqf

ashen warren
#

i didn't understand what that ment exactly at the time

#

wow, that actually fixed it. I guess I have to remember to return the value now on the next portion

#

thanks @little raptor @still forum

keen folio
#

How do I get the reveal function to constantly update the known position of a unit?
I'm trying to make a mission where I constantly have to outrun an enemy vehicle in a high-speed chase

winter rose
#

loop it

keen folio
#

I tried that on a trigger (should repeat every 0.5s, yeah?)

aaf forgetTarget fia;
fia forgetTarget aaf;

aaf reveal [fia, 4];
fia reveal [aaf, 4];
winter rose
#

no

keen folio
#

oh

winter rose
#

how did you set up this trigger?

keen folio
#

Set up a repeatable trigger and put the above code in On Activat-

#

oh, i need to set it to actually trigger...

winter rose
#

😬
yup πŸ˜‰

keen folio
#

Thanks, im just a fool

winter rose
#

nope, sometimes more eyes are helpful. google rubber duck debugging πŸ˜‰

keen folio
#

Oh yeah

#

Do I need to sleep between these commands, since it still doesn't work how i'm expecting it to

#

Since in Spectator, it shows that known position of the unit doesnt change

finite sail
#

note to self.. dont misspell Lou's google search suggestion

winter rose
#

@keen folio no sleep possible in triggers

keen folio
#

Oh, hecc

winter rose
#

you could have a trigger that trigger once (or better, a script)
and have```sqf
while { sleep 1; alive aaf && alive fia } do
{
aaf reveal [fia, 4];
fia reveal [aaf, 4];
};

keen folio
#

Ohhh that makes sense

undone dew
#

hey guys, I'm trying to adapt the script I got help with yesterday to spawn vehicles as well as infantry. It's spawning the vehicle fine, but I'm getting an error on the last two lines because of "units _group3", which works on infantry but not on a vehicle. I'm just not sure what to change this to, I tried crew and didn't have any luck.

`_group = [_spawnPos, EAST, (configfile >> "CfgGroups" >> "East" >> "UNSUNG_E_NVA" >> "NVA68Infantry" >> "NVA_68heavyweaponsquad1")] call bis_fnc_spawnGroup;
_waypoint = [_group, _spawnCenter] call BIS_fnc_taskAttack;

curatorMod addCuratorEditableObjects [units _group,true];
{_x call HG_fnc_aiUnitSetup} forEach units _group;`

----This one does not work (yet) check the last two lines where I tried using "crew"

`_group3 = [_spawnVehPos, 293, "uns_Type63_mg", east] call BIS_fnc_spawnVehicle;
_waypoint3 = [_group3, _spawnCenter] call BIS_fnc_taskAttack;

curatorMod addCuratorEditableObjects [crew _group3,true];
{_x call HG_fnc_aiUnitSetup} forEach crew _group3;`

stuck rivet
#

how do I turn something like this [[5072.01,755.634,7.03117]] into something that can be accepted by something that expects three parameters, like this [5072.01,755.634,7.03117]?

finite sail
#

[[5072.01,755.634,7.03117]] is a known as a nested array

#

its an array that contains another array

#

[5072.01,755.634,7.03117] looks like it is a position array - the position of an object in the game world

#

[5072.01,755.634,7.03117] select 0

#

will return 5072.01

#

it selects the first element of the array (arrays are zero based, the first element is called 0

#

the second is called 1

#

so with your original array,

#

[[5072.01,755.634,7.03117]] select 0

#

will return

#

[5072.01,755.634,7.03117]

stuck rivet
#

i see, that is indeed a game world coordinate, thanks

finite sail
#

in your case, element zero of your original array is another array

ashen warren
#

Hi all, I'm trying to get a fired near player script to change the value of _stress for the player. Getting this error on RTP. Any suggestions?

RTP

16:21:17 Error in expression <s"];

_unit = _this select 0; 



_unit addEventHandler
["firedNear",
{
_unit    = >
16:21:17   Error position: <addEventHandler
["firedNear",
{
_unit    = >
16:21:17   Error addeventhandler: Type Number, expected Object
16:21:17 File APT_Adapt\firenear.sqf..., line 10

parameters.sqf

// Compile
APT_stressCheck = compileFinal preprocessFileLineNumbers "APT_Adapt\stress.sqf";
APT_firenearCheck = compileFinal preprocessFileLineNumbers "APT_Adapt\firenear.sqf";
 
 
//Parameters list
 
isMusicActive = 1;
 
debugging = 1;
 
 
//Stress modes
//stress represents min and will be main changer
private _stress = 0;
 
private _maxstress = 100;
 
//How much is lowered each second.
private _lowerstress = -1;
 
 
private "_nil";
 
//Every second
while{true} do
{//Main Loop
    if(isMusicActive isEqualTo 1) then
    {
      //debug - show stress  
        hint ("Stress = " + (str _stress));

        //fired near player
        _stress = [_stress] call APT_firenearCheck;
 
        //lower stress and pass values
        _stress = [_lowerstress, _stress, _maxstress] call APT_stressCheck;
    };
 
    sleep 0.2;
};

firednear.sqf

//To elivate stress if you are being shot at.


params ["_stress"];

_unit = _this select 0;


_unit addEventHandler
["firedNear",
    {
        _unit    = _this select 0;
        if ((_unit getVariable "_stress") < 100) then
        {
            _unit setVariable ["_stress", (_unit getVariable "_stress") + 1];
        }
    }
];

_unit addEventHandler
["hit",
    {
        _unit    = _this select 0;
        _unit setVariable ["_stress", 100];
    }
];

_stress
willow hound
#

@ashen warren In this line

//fired near player
_stress = [_stress] call APT_firenearCheck;

you pass the number _stress (which is 0) to the script, which you then try to use here

_unit = _this select 0;

to get a unit. The end result is you attempting to execute ```sqf
0 addEventHandler [...];

ashen warren
#

ok, I guess im confused on how to correct that

little raptor
#

what was unit to begin with?

ashen warren
#

apparently nothing if i look ait it.

willow hound
#

Write

player addEventHandler [...];
ashen warren
#

ahh

#

so every line that uses _unit use player instead?

willow hound
#

Only outside of the Event Handler code.

#

I also suggest using

_unit getVariable ["_stress", 0]

because right now, that variable should give you errors.

brave jewel
#

Very dumb question here: My hold action is showing twice in the scrollwheel, I had no success using "isServer" or "hasInterface" yet

willow hound
#

We'll need some more context to aid with that.

ashen warren
#

@willow hound this what you mean?

//To elivate stress if you are being shot at.


params ["_stress"];

_unit = _this select 0;

_unit getVariable ["_stress", 0]

player addEventHandler
["firedNear",
    {
        _unit    = _this select 0;
        if ((_unit getVariable "_stress") < 100) then
        {
            _unit setVariable ["_stress", (_unit getVariable "_stress") + 1];
        }
    }
];

player addEventHandler
["hit",
    {
        _unit    = _this select 0;
        _unit setVariable ["_stress", 100];
    }
];

_stress
willow hound
#

Yes

ashen warren
#

ok

little raptor
#

@brave jewel
use a variable to avoid that.
Like:

if (_unit getVariable ["MyActionAdded", false]) exitWith {};
_unit addAction [...];
_unit setVariable ["MyActionAdded", true, true];

In general you should be careful where you execute your code. If you don't know how, just use this for now.

willow hound
#

I also suggest using

_unit getVariable ["_stress", 0]

because right now, that variable should give you errors.
Don't forget this or you'll probably get different errors.

brave jewel
#

Well I fixed it @little raptor. Seems like I've just been misspelling "hasInterface" notlikemeowcry

little raptor
#

Still it depends on where you execute your code. hasInterface doesn't necessarily avoid that.

And use an editor with syntax highlighting. That way you won't misspell

brave jewel
#

Roger Roger

ashen warren
willow hound
#

Fixing firenear.sqf is easy:

//To elevate stress levels if you are being shot at.
player addEventHandler
["firedNear",
    {
        _unit = _this select 0;
        if ((_unit getVariable ["_stress", 0]) < 100) then
        {
            _unit setVariable ["_stress", (_unit getVariable ["_stress", 0]) + 1];
        };
    }
];
player addEventHandler
["hit",
    {
        _unit = _this select 0;
        _unit setVariable ["_stress", 100];
    }
];

Fixing the whole system is not so easy, it needs a healthy amount of redesign.

ashen warren
#

so I don't need to send a return value?

yea, im completly redoing this from scratch with limited knowledge.

mortal steppe
#

hi everyone, is it possible to script loading a vehicle into a vehicle (VIV) by adding an action?

#

i want to create an action so i dont have to get into the vehicle driver seat

ashen warren
#

so error is gone but adds +1 every second rather than reacting to fired near

#

i'll have to look into this

willow hound
#

@ashen warren Without trying to offend you, I believe this project is a bit too much for your current level of knowledge. We could spend the night fixing the code until it stops throwing errors but then you will probably discover that the code does not do what you want it to do. I recommend getting more practice with SQF files, functions, scopes and namespaces before revisiting this.
@mortal steppe Try combining the addAction command with the setVehicleCargo command.

mortal steppe
#

cheers il start doing some reading

restive shadow
#

so im new to running a server and the web console says theres a cfg error after i added a custom difficulty script to it. can someone please help me, i have no idea what im doing here

ashen warren
#

@willow hound I believe I found the issue. Looking over some other projects of mine that worked before, don't like how it operates cause its not as optimized but I think it will do the trick. I appreceiate your assistance as much as you have provided

winter rose
#

@restive shadow try asking with a formatted config in #server_admins πŸ™‚

restive shadow
#

will do thank you

fair drum
#

lets say you have a flag with the variable flag1 how would you go about creating a new flag with the variable flag2 etc etc if the previous exists?

#

trying to figure out some sort of rally system that you can spawn additional flags for different squads and delete the previous ones, all in one script

robust hollow
#

something like this perhaps. in this example you might have up to 10 flags


private _prefix = "flag";
for "_i" from 1 to 10 do {
    private _var = _prefix + str  _i;
    if (isNil _var) exitWith {missionNamespace setVariable [_var,_flagObj]};
};
#

another way that removes the loop


// _flags = array of flag objects
private _index = _flags pushback _flagObj;
missionNamespace setVariable ["flag" + str _index,_flagObj];
#

if it is in an array you probably wouldnt need the individual variable though.

#

can do it a few ways.

fair drum
#

well I have 3 flags at base which are the base of the teleport script. flagA,flagB,flagC which I can then plug into the script... this is what I have so far...

params ["_squadLeader","_initalFlag"];

if (isNil "rallyTimer" || {!rallyTimer}) then {

    if (isNil ("flag" + str _initalFlag)) then {

        private _rallyFlag = createVehicle ["flagClassName",_squadLeader,[],5,"NONE"];
        missionNamespace setVariable ["flag" + str _initialFlag,_rallyFlag];
    };
};

rallyTimer = [60,false] call BIS_fnc_countdown;

basically I hope this makes a variable of flagAlpha, flagBravo, flagCharlie, so the rally script can keep track of them all individually without me having to write a new script for every single base flag.

#

the above would be on a addaction for a SL

tough abyss
#

how do I turn the total amount of listbox entries into an index array? Something like lbSelection but for every row of a listbox?

robust hollow
#

!rallyTimer || isNil "rallyTimer" should be isNil "rallyTimer" || {!rallyTimer} otherwise it will error on the first condition when rallyTImer is nil

tough abyss
#

lbSize just gives a number of how many

robust hollow
#

like this?

private _sel = [];
for "_i" from 0 to lbSize _ctrlListBox - 1 do {
    _sel pushback _i;
};
tough abyss
#

ye thats it thank you man

robust hollow
#

@fair drum !rallyTimer needs the {} around it so it doesnt evaluate if it is nil.

tough abyss
#

@robust hollow One more question, how do i get the value off of an editable textbox?

robust hollow
#

ctrlText _ctrlTextBox

tough abyss
#

ty

robust hollow
#

@fair drum as for the rest of the script the only issue i see is you use rallyTimer as a bool in the if statement, but that usage of bis_fnc_countdown returns a number (i think)

winged thistle
#

Is there a way to check who placed a UAV?

#

I tried owner but it returns 0 for UAVs I placed and also UAVs teammates placed.

#

I don't immediately see an event handler I can use to assign it myself.

fair drum
#

assembling UAVs count as weapons

winged thistle
#

I saw that but wasn't sure.

#

Thanks. I'll give it a whirl and post back.

#

Sure wish I could just check it live, though...

#

Wishful thinking, I know.

fair drum
#
player addEventHandler [

    "WeaponAssembled",
    {
        params ["_unit","_assembled"];
        if (typeOf _assembled == "UAVClassHere") then {
            blah blah blah
        };
    }
]
fair drum
#

@robust hollow
and if I wanted to delete the previous flag, would I use getVariable in this way?

params ["_squadLeader","_initalFlag"];

if (isNil ("flag" + str _initalFlag) || placeAgain) then {

    placeAgain = false;
    private _oldFlag = missionNamespace getVariable ["flag" + str _initalFlag,objNull];
    deleteVehicle _oldFlag;
    private _rallyFlag = createVehicle ["Flag_AAF_F",_squadLeader,[],5,"NONE"];
    missionNamespace setVariable ["flag" + str _initialFlag,_rallyFlag];

    private _time = time + 60
    waitUntil { time >= _time };
    placeAgain = true;
};
winged thistle
#

I got it working. UAVs are now deleted per player upon respawn. Thank you, @fair drum.

robust hollow
#

@fair drum yes that is correct

#

you'd just need to make sure placeAgain is defined somewhere before evaluating it in the if statement, or use getvariable to define true as default. it will most likely error if nil.

fair drum
#

yeah i typically do a preinit function of all the t/f variables I end up using

thorn saffron
#

Is it possible to have a mission function that runs on init on every man unit? I only did something like that a couple of times in a mod using configs and Extended_InitPost_EventHandlers.
Would it be possible to add an init function to all units using description.ext or something? I'm not familiar at all with using description.ext for stuff like that

fair drum
#

@thorn saffron

//Place in your init.sqf

{
    if (_x isKindOf "Man") then {

        [] call yourfunctionhere;
    };
} forEach allUnits;
winter rose
#

CAManBase* no? I don't remember why but it's "closer" to soldiers, and "Man" could return some unwanted things

vague geode
#

Where would I have to put the command finishMissionInit for it to work and also what exactly does it do, what are the benefits?

neon wind
#

Hi all so I managed to get the script working but need some advice is there way to edit this script so it edit a type of AI id spawned example a Civilian

winter rose
#

@neon wind ```sqf please (see pinned message)

thorn saffron
#

@fair drum Not gonna work for what I want. I have units getting spawned during the mission. What you posted will only run once at start

#

that is why I want something that runs on init of every man, that spawns during the mission

cold glacier
#

@thorn saffron - If they're Zeus'd in, you can hook into the CuratorObjectPlaced event handler.

If they're spawned by your code in your mission, you can create a custom function that spawns a unit, then runs the initialisation you want.

If they're spawned by someone else's code, you need an infinite loop that checks all the units, and inits any that haven't been initialised, then marks them as initialised so they get ignore on the next loop.

#

Because Arma doesn't have an 'Object spawned' event handler, tragically.

thorn saffron
#

I was suggested to use this:

// init.sqf
["CAManBase", "Init", {systemChat str _this}, true, [], true] call CBA_fnc_addClassEventHandler;
neon wind
#

Need help with this script. It spawns a casualty with random injury/injuries. How do I have it so the casualty is a set model. For example a Civilian

{if ((typeOf _x == 'b_survivor_F') && (!isPlayer _x)) then {deleteVehicle _x}} forEach allUnits;

[MedicalData,3] call BIS_fnc_dataTerminalAnimate; Β //activates the animation for opening the terminal.

sleep 5;

_group1=createGroup west;

'b_survivor_F' createUnit [getmarkerPos 'Patient1', _group1,'pat1=this; dostop pat1'];

[pat1, selectRandom[0.3,0.5,0.7,0.9], "leg_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1, selectRandom[0.3,0.5,0.7,0.9], "leg_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1, selectRandom[0.3,0.5,0.7,0.9], "body", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1, selectRandom[0.3,0.5,0.7,0.9], "head", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1, selectRandom[0.3,0.5,0.7,0.9], "hand_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1, selectRandom[0.3,0.5,0.7,0.9], "hand_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;

[pat1] call ace_medical_fnc_handleDamage_advancedSetDamage;

[MedicalData,0] call BIS_fnc_dataTerminalAnimate; Β //activates the animation for closing the terminal.

hint 'Your patient is ready';

//the first selctrandom chooses a random damage from a small one to a large one, the second selectrandom chooses the type of damage.```
compact maple
#

which command should I use to kick a player from the server (i.e he's afk too muchtime)

winter rose
#

@neon wind change B_survivor_F to the class you want. also, try formatting with ```sqf thanks

compact maple
#

Thanks, seems it has to be executed on the server

winter rose
#

everything sensitive should be done server-side yes πŸ˜‰

#

the server is the main referee of the game!

compact maple
#

Y Im trying to write sensible things server-side, always.

btw, if the client call the server function to be kicked, isn't it "hackable" ? could he kick someone else by sending false information ?

winter rose
#

unless the Arma client is edited, no

#

SQF-wise, no way

compact maple
#

alright

winter rose
#

although, even then, I don't think so

compact maple
#

instead of sending the player object to the server, I remember there is a command server-side to get who called the server function, right?

cunning crown
#

remoteExecutedOwner (or something like that)

compact maple
tough abyss
#

I got a broblem, the state of a checkbox doesn't change when ticked

#

do I have to add something to the header file?

unique sundial
#

@tough abyss what do you mean? the tick mark doesn’t stay?

tough abyss
#

it does, but when I do
hint str (ctrlChecked UNCONCHECK);
it always returns false

#

even when ticked

#

UNCONCHECK is just a macro

compact maple
#

(what is the macro you are using?)

unique sundial
#

there are 2 types of checkboxes you might use wrong command for yours

tough abyss
#
class cbSetUncon: RscCheckbox
#

@compact maple

#define UNCONCHECK   (MENUDISPLAY displayCtrl IDC_IM_SETUNCON)
unique sundial
#

what type is it?

tough abyss
#

don't have a type set in the actual class

#

that could be it

unique sundial
#

what type rsccheckbox is?

tough abyss
#

oh in the defines file

#

1 sec

#

type = 77;

unique sundial
#

you have to use cbChecked with type 77

tough abyss
#

ah ok

#

ty

unique sundial
#

always check wiki

tough abyss
#

yep didn't know there was a different function

tough abyss
#

is there something akin to a return statement in sqf?

#

so I don't need to put an entire statement within brackets if I want to check a few things before continuing

winter rose
#

breakOut may be the closest you can get, along exitWith @tough abyss

tough abyss
#

hm ok, thank you

robust brook
#

is there any way to add to existing params or do I have to redefine each param every time I use params?

winter rose
#

@robust brook unsure what you mean?

robust brook
#

// This Works
["_testNumberCase"] spawn {
  params ["_testNumberCase"];

  switch (_testNumberCase) do {
    case 1: {
      params ["_testNumberCase", "_playerObject"];
    };
    case 2: {
      params ["_testNumberCase", "_vehicleObject"];
    };
  };
};

// Dosen't work (messes up order of params)
["_testNumberCase"] spawn {
  params ["_testNumberCase"];

  switch (_testNumberCase) do {
    case 1: {
      params ["_playerObject"];
    };
    case 2: {
      params ["_vehicleObject"];
    };
  };
};

#

@winter rose

winter rose
#

ah, sure

#

case 1, not #2

#

you can also ```sqf
params ["", "_secondParam"];

robust brook
#

but what If I want to have different types of variables being passed through each case?

#

specific to each case

#

just wanting to add params to already existing params instead of redefining them all again in each case

winter rose
#
// first
params ["_testCase"];
// then
params ["", ["_valueNum", 0, [0]]];
// or
params ["", ["_valueStr", "", [""]]];
#

or better, make the second variable an array - and use```sqf
params [
["_switchStuff", "", [""]],
"_data"
];
// and then
_data params [/* the formats you want */];

robust brook
#

ty

velvet merlin
#

possible to hide all vanilla assets in Arsenal but keep the modules?

warm hedge
#

Modules?

karmic spade
#

IDK if this question belongs here, but im curious on mods used by a Specific unit. Their gear (Mostly RHS) all has maxed storage space, allowing for them to look proper but also not be limited on having a full kit. Im just wondering if there is a way to mimic that without completely configing the gear and needing to know how to script it, or if rescripting and posting a unit mod is the only way

#

Or if one already exists publicly, instead of their private mod, it has RHS backpacks and many other mods

winter rose
#

yes, you can script the unit's ability to carry weight

karmic spade
#

I should make a correction, its not the weight, but the phsyical room in their gear is maxed

winter rose
#

mod it is then

#

try editing the loadCoef, it might do wonders

karmic spade
#

ok

cold glacier
#

Wonder if you can script it to give backpacks infinite capacity. You can definitely overload backpacks with gear using scripts, trick would be hooking it into the inventory UI...

tough abyss
#

hey guys i have a problem
so basically i have one headquarters entity named DFDD
and i sync it to a trigger
and on the activation pannel i write this
variable1 sideChat "hello there";

sleep 5;

variable1 sideChat "nono not like this"
is this correct?

winter rose
#

what is variable1 ?

tough abyss
#

the headquarters variable name

#

i just named it variable 1

winter rose
#

@tough abyss and don't crosspost πŸ‘€

tough abyss
#

yeah sorry for that sorry

winter rose
#

you cannot use sleep in a trigger directly

#
0 = [] spawn {
  variable1 sideChat "hello there";
  sleep 5;
  variable1 sideChat "nono not like this"
};
```should do
tough abyss
#

oh so that's how it is done

#

trying it now

#

yes it works like a charm

#

thank you for this, i'm new in scripting

winter rose
#

hi new, I'm dad!

little raptor
#

@velvet merlin

possible to hide all vanilla assets in Arsenal but keep the modules?
If you mean Zeus, yes

stuck rivet
#

how do i refer to a player that intered a trigger area? say to make a teleporter or instant kill zone

little raptor
#
thisList

Or

list _trigger

Gives all units that have activated the trigger

#

thisList must be used in trigger statements and not in other scripts

stuck rivet
#

is it an array, do I need to use a for loop to access everything in it?

winter rose
#

yes, array

little raptor
#

use forEach

stuck rivet
#

got it thanks

karmic spade
#

Does a serverside Dual-primary script exist?

#

like not a mod, can it just be done with scripting in a mission file

winter rose
#

wat

exotic flax
quasi cobalt
#

Is it viable to place units, setup the variable names, camps, makers, etc and then script an entire mission?

exotic flax
#

why not?

quasi cobalt
#

Do you have as much flexibility with triggers if you are purely scripting?

winter rose
#

MUCH more

quasi cobalt
#

I guess you'd be using EH mostly.

#

Ok, awesome. New challenge for myself πŸ˜„

#

Thanks guys ❀️

velvet merlin
#

@warm hedge @little raptor sorry meant Zeus (not Arsenal)

There's attribute "Default addons" in Game Master module which is now set to "Addons present in the scenario".
However when I disable/restrict vanilla content I've noticed that it'll hide all modules from Zeus panel but I have no idea how to add them back.

little raptor
#

@karmic spade

Does a serverside Dual-primary script exist?
like not a mod, can it just be done with scripting in a mission file
I think you mean dual primary weapons, as in having two primary weapons where one goes in launcher slot?
If you intend to script it without modding, it requires awkward attachTo and onEachFrame to work, and you'll have to fake the inventory menu to look like you have a 2nd primary weapon there. The alternative method is to create a list of weapon duplicates that go into the launcher slot, which obviously needs a mod.
I don't know about existing scripts. You can google. It's not hard to make one yourself (at least a basic version)

little raptor
#

@velvet merlin I recommend a script:

this addEventHandler ["CuratorObjectRegistered", { 
    _cfgVeh = configFile >> "CfgVehicles";
    _this#1 apply {
      if (gettext(_cfgVeh >> _x >> "vehicleClass") == "modules") then {[true,0]} else {[false, 0]}
    }
}]
#

You can restrict addons using:

removeAllCuratorAddons _curator;
_curator addCuratorAddons _allowedAddons;

I'm not sure if the removing addons part is needed. I just put it in case

quaint oyster
#

What would be the best way to make the player who launched this script below to appear on screen using %1? Currently this is what i have made up so far, using the method its displaying the player who sees that as their own name, and not the person executing the script. I tried making "name player" private and outside of the bis_fnc_mp but it displayed "any" on other machines other than the person executing it.

[{titleText [format ["<t color='#OAOAOA' size='3'font='RobotoCondensed'>%1 has saved their character!</t>",name player
], "PLAIN DOWN",-1, true, true];
},"BIS_fnc_spawn",true,true] call BIS_fnc_MP;
robust hollow
#
[
  [name player],
  {titleText [format ["<t color='#OAOAOA' size='3'font='RobotoCondensed'>%1 has saved their character!</t>",_this#0], "PLAIN DOWN",-1, true, true];}
] remoteExec ["BIS_fnc_spawn",0];

give the unit name as a parameter before remote executing

#

also use remoteExec instead of BIS_fnc_MP as it is old and obsolete.

quaint oyster
#

i had remote before funny enough but that bis_fnc_mp seemed shorter to remember lol thanks for the help i'ma try it out

robust hollow
#

i believe the function uses remoteExec in the end. the wiki says it only exists for backwards compatibility.

quaint oyster
#

interesting well thats good they left it in there

#

but this functions flawlessly, just need to have another player execute it to see it from my end

#

thanks m8 @robust hollow

#

so is it _this#0 that's differentiating which player called it?

#

or is it the name player grabbing it correctly? i guess i'm confused, is that the remoteexec storing it or how does that function exactly for future refrence?

#

NVM i got it figured out by playing around with it. I was trying to do a secondary %2, i now understand that the first bracket are params or sorts, and i was able to figure it out.

[ 
  [name player, player getVariable ["killstreakcountSTREAK",0]],  
  {titleText [format ["<t color='#OAOAOA' size='2'font='RobotoCondensed'>%1 has a killstreak of %2</t>",_this#0,_this#1], "PLAIN DOWN",-1, true, true];} 
] remoteExec ["BIS_fnc_spawn",0];```
vague geode
#

Does anyone know what exactly finishMissionInit does, what the benefits are and where I would have to put the command for it to work?

#

Also can I use format together with preprocessFileLineNumbers?

BIS_fnc_function = compileFinal preprocessFileLineNumbers format ["functionslibrary\%1\fn_function.sqf", missionName];
warm hedge
#

Latter, true. The string is just a string

vague geode
#

Ok, thanks.

sharp grotto
#

Is it possible that BIS_fnc_typeText2 has a length limit ? For me it looks like that since after a certain message length an error appears

"font/" is not a class ("fonts" accessed)

robust hollow
#

technically yes on two points. strings are limited to 9,999,999 chars (unlikely you are reaching that), and typeText2 uses format which is limited to output ~8Kb (i believe thats per line in this function). can you share the strings you are trying to use?

little raptor
#

if the latter is the case, you can break the string into multiple parts and after modification combine them using joinString.

sharp grotto
exotic flax
#

That is far from 9,999,999 characters (even with markup), and shouldn't be close to 8Kb (can't remember this limit, but could be). So either there is something wrong with your coding, or something wrong with the BIS function.

robust hollow
#

there is a lot of XML parsing error... logs when you use this function πŸ€”

sharp grotto
#

i just reduced it (HH:MM instead OF HH:MM:SS) "Days alive" instead of "Days survived" and BIS_fnc_trimString for the location name and no error anymore

robust hollow
#

it is the format limit

#

after adding all the structured text formatting (which is done for every character) the last line ends on this
...<t color = '#00000000' shadow = '0' align = 'center' size = '0.45' font='PuristaSemibold'>r</t><t color = '#00000000' sha"
and is 8191 characters long

#

i'd say your options are to have less characters per line, or to duplicate the function and modify it to not use format. or write your own replacement function of course.

sharp grotto
#

should have asked ealier. was debugging for two hours πŸ˜…

robust hollow
#

the function is really quite unoptimized. it appears to add the attributes you provide on every character individually, instead of the line as a whole. would make much more sense to have it like <t provided attributes + shown char color>abc<t hidden char color>xyz</t></t> or something like that.

cinder fern
#

Hey is there a really simple script to change the radio communication to carrier pigeons?

undone dew
#

hey guys, I'm trying to write a script to add random inventory items to Zeus placed units using the eventhandler "CuratorObjectPlaced". I'm calling the script like so

this addEventHandler ['CuratorObjectPlaced',{ { [_x] remoteExec ["HG_fnc_aiUnitSetup", 2] } forEach crew (_this select 1); {0= [] execVM "randomItem.sqf";} forEach crew (_this select 1); }];

randomItem.sqf:

`private ["_unit", "_items"];

_unit = _this select 0;
_items = ["uns_item_bugjuice","uns_item_bugspray","uns_item_dong", "uns_item_P38", "uns_item_smokes","uns_item_zippo"];

//_pItem = _items select (random (count _items - 1)); example1
//_pItem = _items select floor random count _items; example2
_pItem = selectRandom _items;

_unit addItem _pItem;`

Problem is, I'm getting an error saying _unit is an undefined variable. How do I fix? 😦

robust hollow
#

[_x] execVM "randomItem.sqf";

#

you could put that execvm in the same loop as the remoteexec to make it a little cleaner.

#

also dont need 0=

exotic flax
#

replace private with params in randomItem.sqf

undone dew
#

awesome I think those two things did the trick, gonna test some more

#

tyvm

#

also if I want there to be a random chance to find something, would adding some empty "" work for the _items = array?

#

like

_items = ["uns_item_bugjuice","uns_item_bugspray","uns_item_dong", "uns_item_P38", "uns_item_smokes","uns_item_zippo", "", "", "", ""];

robust hollow
#

that is one way. another would be to do a percentage check first. eg 70% chance of finding an item
_item = if (random 1 <= 0.7) then {selectRandom _items} else {""};

undone dew
#

awesome, it's working great

little raptor
#

Hey is there a really simple script to change the radio communication to carrier pigeons?
wat?!

undone dew
#

hahahaha

#

that'd be awesome

harsh vine
#
{
_x setObjectTextureGlobal [0,"icon\s1.paa"];

[
    _x,                                            // Object the action is attached to
    "Scavenger Contract",                                        // Title of the action
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",    // Idle icon shown on screen
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unloaddevice_ca.paa",// Progress icon shown on screen
    "_this distance _target < 3",                        // Condition for the action to be shown
    "_caller distance _target < 3",                        // Condition for the action to progress
    {},                                                    // Code executed when action starts
    {},                                                    // Code executed on every progress tick                        
    {
    player playActionNow "PutDown";
    [] execVM "ContractSearch.sqf";                      // Code executed on completion
    deleteVehicle _x;
    },                
    {},                                                    // Code executed on interrupted
    [],                                                    // Arguments passed to the scripts as _this select 3
    1,                                                    // Action duration [s]
    10,                                                    // Priority
    false,                                                // Remove on completion
    false                                                // Show in unconscious state 
] remoteExec ["BIS_fnc_holdActionAdd", 0,_x];    // MP compatible implementation

} forEach [scav1,Scav2,scav3];

#

Is it possible to just remove the one that has be interact with for example: if i interact with "scav1" it will just delete that one... i dont want to make the same script for each of them just to add the deletevehicle part.

robust hollow
#

for where you have deleteVehicle _x;? change it to deleteVehicle (_this#0);
_x is not available in the code completed scope

harsh vine
#

thanks mr connor ...πŸ‘ every thing is possible in arma 3

compact maple
#

is # faster than select ?

robust hollow
#

i dont believe so. it is higher in precedence though, so you can sometimes go without () around it.

#

as an example

[1] select 0 * 2; // 1
[1] # 0 * 2; // 2
compact maple
#

Thank you.
can also work like this ?

[[0]] # 0 # 0 // 0
robust hollow
#

yes

compact maple
#

ok, ty !

harsh vine
#
sav_id = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", 
{
{
    _this select 0 drawIcon 
    [
        MISSION_ROOT + "icon\s.paa",
        [1,0.804,0, 1],
        getPos _x,
         25,
         25,
        0,
        "",
        1,
        0.05,
        "TahomaB",
        "right"
    ]
    }forEach [sav1,sav2,sav3];    
}];

findDisplay 12 displayCtrl 51  ctrlRemoveEventHandler ["Draw", sav_id];
#

same concept like the pervious one i dont want it to remover all on the map icons just the one being interact with ...or am i gonna have to make a special id for each??

robust hollow
#

sav1,sav2,sav3 these are objects?

harsh vine
#

yeah little tablets

robust hollow
#

could put a if (!isNull _x) {...} inside the foreach

#

and the drawicon would go inside the if

compact maple
#

each time you'll be drawing, icons will be created ?

harsh vine
#
sav_id = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", 

{
{
if (!isNull _x) then {_this select 0 drawIcon 
    [
        MISSION_ROOT + "icon\s.paa",
        [1,0.804,0, 1],
        getPos _x,
         25,
         25,
        0,
        "",
        1,
        0.05,
        "TahomaB",
        "right"
    ]}
    }forEach [sav1,sav2,sav3];    
}];```  tbh im pretty sure it was working,  then i reloaded the mission and it wasn't anymore...or maybe im just imagining things
robust hollow
#

looks correct to me.

winter rose
#

@harsh vine is MISSION_ROOT getMissionPath-related?

harsh vine
#
MISSION_ROOT = call {
    private "_arr";
    _arr = toArray __FILE__;
    _arr resize (count _arr - 8);
    toString _arr
};
```guess there is no need for this anymore πŸ˜”
harsh vine
#
// i would like to get a scatter effect by using this, but if i use this method they all spawn at one location.
randomLocation_mw0 = selectRandom["b1","b2","b3","r1","r2","r3","s4","s5","s6","s7","s1","s2","s3"];//map markers
Sav1 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos randomLocation_mw0, [], 1, "none"];
sav2 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos randomLocation_mw0, [], 1, "none"];
sav3 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos randomLocation_mw0, [], 1, "none"];
```i knw i can make another select random ...but i just wanna see what can be done πŸ™ˆ
oblique arrow
#

Isnt the selectRandom only executed once at the start?

#

that then sets the randomLocation which is used by all three commands

winter rose
#

@harsh vine do you want the chance the next random might be the same?

#
private _markers = ["pos1", "pos2", "pos3"];
Sav1 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos selectRandom _markers, [], 1, "none"]; // etc

// OR:
(_markers call BIS_fnc_arrayShuffle) params ["_marker1", "_marker2", "_marker3"];
harsh vine
#
private _markers = ["pos1", "pos2", "pos3"];
Sav1 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos selectRandom _markers, [], 1, "none"];
```i think this one works fine ...thanks again πŸ‘
jolly bone
#

Why aren't we required to declare the length of an array in sqf? The few "real" programming languages I've used* force you to, so the computer knows how much memory to allocate think_turtle
*Used meaning done a university course

winter rose
#

js doesn't need either

#

but again, is js a "real" language…

#

@jolly bone see Arma arrays more as C# Lists

dusk sage
#

The answer to your question lies in understanding why you need to specify array size in languages like C

still forum
#

Why aren't we required to declare the length of an array in sqf?
its a vector, or dynamic array. not a static array

jolly bone
#

Alright thanks. I just got interrested in this question recently after hearing a drunk dicussion between some programmer friends and that'll tell me what to look up for reading. (I'm afraid I have never used JS πŸ˜… )

harsh vine
#

hey lou is there a work around this...if position is already taken then find another selectrandom position, just so they dont stack on each other ...

winter rose
#

that's why I asked that

do you want the chance the next random might be the same?

#

use the second solution then

astral dawn
#

Why aren't we required to declare the length of an array in sqf? The few "real" programming languages I've used* force you to, so the computer knows how much memory to allocate think_turtle
*Used meaning done a university course
@jolly bone Lots of modern languages have dynamic arrays. Some have both dynamic and static.

jolly bone
#

Yeah sorry if I spoke too decisively, I'm very much feeling my way forward through the dark when it comes to computer science

astral dawn
#

It's all right. Static array size is preferable if you know the array size and it will be fixed, because then it can be allocated on stack and not heap. Dynamic arrays are heavy since they allocate on the heap, and need to resize and thus reallocate once in a while if they grow larger and larger.

#

Although, dynamic vs static allocation... if it heap allocation happens only once then it's irrelevant

winter rose
compact maple
#

where should I post it ?

winter rose
compact maple
#

done ty !

peak plover
#

Yup πŸ‘

brave jewel
#

Does anyone know if sqf BIS_fnc_UnitPlay is working on dedicated server by now? Or is it still crap?

oak peak
#

anyone experienced in altis life development?
because im getting this error when i tried to add the opfor faction

18:48:22 Error in expression < displayCtrl 38502),1,0.1,getMarkerPos (_sp select 0)] call life_fnc_setMapPosit>
18:48:22   Error position: <_sp select 0)] call life_fnc_setMapPosit>
18:48:22   Error Undefined variable in expression: _sp
18:48:22 File dialog\function\fn_spawnMenu.sqf [life_fnc_spawnMenu]..., line 34
#
[((findDisplay 38500) displayCtrl 38502),1,0.1,getMarkerPos (_sp select 0)] call life_fnc_setMapPosition;

this is the line of code

#

anyone got any ideas?

winter rose
oak peak
#

which one is it? @winter rose

#

nvm, think i found it

delicate maple
#

hi,
I cant add BIS_fnc_holdActionAdd to flag pole while addAction works fine. Any Idea?

winter rose
#

a mistake in your arguments most likely @delicate maple

granite summit
#

Hey all...I've never really coded, so I'm trying to learn.

So I'm writing a scenario using ALiVE. I'm incorporating Drongo's Air Operations, which I love. The only problem I'm running into - the aircraft I put down like to start rolling forward and taxiing toward the runway before the mod gets control of them. Then they stop, canopies go up, etc, until they get orders. Then the taxiways are blocked by shutdown aircraft which are now arrayed in a nice straight lien.

I put some concrete barriers in front of the planes to just keep them in place, which worked, but then I want them to despawn after 30 seconds or so.

I tried putting
if (time>=_future) then (deleteVehicle BARRIER1)

into the barrier init field, but it doesn't do anything. I realize this is basic and stupid, but when it comes to scripting, I'm basic and stupid.

little raptor
#
this spawn {sleep 30; deleteVehicle _this}

will delete the barrier after 30 seconds
And obviously, this goes into the init field

granite summit
#
this spawn {sleep 30; deleteVehicle _this}

will delete the barrier after 30 seconds
And obviously, this goes into the init field
@little raptor Son of a bitch. That worked like a charm. Thank you so much

rain mural
#

Anybody able to help me out with this error please? No clue what is causing it. I'm pretty sure the syntax is correct and I have checked the wiki. Tried using the stackable version of the EH as well as the non-stackable version and get the same error each time.
This is my code activated by an addAction:

    _casReq = player addEventHandler ["onMapSingleClick",{
        openMap true;
        params ["_units","_pos","_shift"];
        addMissionEventHandler ["Draw3D", {
            drawIcon3D ["\A3\ui_f\data\map\markers\handdrawn\objective_CA.paa", [1,0,0,1], _pos, 1, 1, 45, "CAS REQUEST", 1, 0.05, "TahomaB"];
        }];
        player removeEventHandler[_casReq, 0];
    }];
    openMap false;

The error is:
_casReq = player [#]addEventHandler ["onMapSingleClick", { Error Foreign error: Unknown enum value: "onMapSingleClick"
and with the other EH it is the exact same just with MapSingleClick in the error

little raptor
#

You can't add that to player

#

And it is not onMapSingleClick, it's mapSingleClick

#

When using event handlers outside configs, remove "on"

#

The stackable version is different

rain mural
#

The wiki says the difference is one is stackable (MapSingleClick) and the other (onMapSingleClick) isn't stackable.
I'll amend it now

#

Other way round, my bad

little raptor
#

The wiki says the "command" is not stackable

#

Not the event handler

#

All event handlers are stackable

rain mural
#

Oh right ok. I am getting confused πŸ˜„

little raptor
#

onMapSingleClick itself is a command. Command versions are not stackable

#

Use event handlers instead

#

And the event handler can only be added to controls and displays

#

If you want to add it to the main map, use BIS_fnc_addStackedEventHandler

rain mural
#

Right ok. If I add it to the map will it be run on all clients or solely the client which runs the addAction?

little raptor
#

You can also use the mission variant:

addMissionEventHandler ["MapSingleClick",{}]
rain mural
#

Which is why I wanted to just use addEventHandler. I thought that was the case with missionEH. Ok thanks for clarifying

little raptor
#

@rain mural * corrected the code

rain mural
#

seen, thanks πŸ˜„

little raptor
#

Hold on

#

I forgot it's a control!

winter rose
rain mural
#

Yeah I was just having a look and tripping up on it πŸ˜›

little raptor
#

Are they

winter rose
#

yep, afaik

little raptor
#

I figured since they are "mission" event handlers they affect all clients

#

The wiki doesn't say anything

winter rose
#

eL

little raptor
#

Oh it's at top!

#

Yeah

#

@rain mural so use that

winter rose
#

yep πŸ˜„
maybe I should add it to addMissionEventHandler as well

rain mural
#

Ah sweet. I know how to use missionEHs then

little raptor
#

addMissionEventHandler ["MapSingleClick",{}]

rain mural
#

Yup nice and easy! πŸ˜„

#

So I am guessing I can't parse down _pos from the above EH into the Draw3D EH at least not directly? Is there a work around for this or am I being dumb again?

addMissionEventHandler ["MapSingleClick",{
    params ["_units","_pos","_shift"];
    addMissionEventHandler ["Draw3D", {
        drawIcon3D ["\A3\ui_f\data\map\markers\handdrawn\objective_CA.paa", [1,0,0,1], _pos, 1, 1, 45, "CAS REQUEST", 1, 0.05, "TahomaB"];
}];
winter rose
#

(but you only need _pos anyway)

#

@rain mural nope, you have to work with global variables or set variables on a certain object

#

it's a new scope every time

rain mural
#

Ugh that sucks, thanks!

#

So drawIcon3D recognizes that it is an array but apparently it is providing 0 elements when 3 is expected. I am in over my head πŸ˜‚

unique sundial
#

you can use string for code then format position in but you will create EH every time you click on map

rain mural
#

Ah ok. That would cause performance issues down the line, no?

unique sundial
#

what adding new event handler with every click? obviously

rain mural
#

πŸ˜„

#

_pos returns an empty array πŸ€”

winter rose
#

no, _pos simply doesn't exist in onDraw3D EH

rain mural
#

I have made it a global variable. Even when I hint str _pos in the MapSingleClick EH it is an empty array

winter rose
#

now that's weird

rain mural
#

Yeah πŸ˜„

#
    openMap true;
    addMissionEventHandler ["MapSingleClick",{
        params ["_pos"];
        markerPosition = _pos;
        hint str _pos;
        addMissionEventHandler ["Draw3D", {
            drawIcon3D ["\A3\ui_f\data\map\markers\handdrawn\objective_CA.paa", [1,0,0,1], markerPosition, 1, 1, 45, "CAS REQUEST", 1, 0.05, "TahomaB"];
        }];

        openMap false;

        removeMissionEventHandler ["MapSingleClick", _thisEventHandler];
    }];
winter rose
#

of course

#

you are taking the first param, not the second

#

params ["", "_pos"]

#

with that done, you're good

#

@rain mural ↑

unique sundial
#

don’t need params

little raptor
#

What is that supposed to mean?

#

Why not just add it outside the EH?

unique sundial
#

pos = _this select 1

#

pos is now global can be used everywhere

rain mural
#

Ah that makes sense. Thanks both of you!

little raptor
#

Or even better:

addMissionEventHandler ["Draw3D", {
            {drawIcon3D ["\A3\ui_f\data\map\markers\handdrawn\objective_CA.paa", [1,0,0,1], _x, 1, 1, 45, "CAS REQUEST", 1, 0.05, "TahomaB"];
} forEach ICON_POS;
        }];
#

You can draw multiple icons now

#

Obviously, ICON_POS is an array, so on click:

ICON_POS pushBack _pos
#

This one doesn't throw errors about undefined vars either
If pos wasn't defined like previous case

rain mural
#

Ooh thanks! I'll have to save that one for a rainy day. I feel the feature is already pretty OP if used correctly.

#

Then again, the marker is only a rough idea for the CAS pilot πŸ€”

winter rose
#

if it is for another player, make sure to publicVariable

#

(or missionNamespace setVariable with a target parameter)

#

if player A clicks the map for player B, the pos has to be transferred

#

with a parametered function, it's doable

rain mural
#

I only need the Draw3D marker to be shown by all so I could just move all the executed code out to a separate function.sqf and remoteExec it

winter rose
#
[_pos] remoteExec ["TAG_fnc_myFunction"];
```hop! done πŸ˜„
#

*some magic needed*

rain mural
#

Boom!

ashen warren
#

Hi all,

Would anyone happen to know what the right way is to make an array based on a sub array parameter?

config.cpp

class CfgMusic
{
    class Track1
    {
        sound[] = {"APT\Music\track1.ogg",1.0,1.0};
        duration = 100;
 
        parameters[]    = {"day", "rain"}; //I want to put each track into arrays specified by parameters
                                                   
    };
 
    class Track2
    {
        sound[] = {"APT\Music\track2.ogg",1.0,1.0};
        duration = 100;
 
        parameters[]    = {"night", "fog"}; 
 
    };
 
 
    class Track3
    {
        sound[] = {"APT\Music\track3.ogg",1.0,1.0};
        duration = 100;
 
        parameters[]    = {"rain"};
 
    };
 
    class Track4
    {
        sound[] = {"APT\Music\track4.ogg",1.0,1.0};
        duration = 100;
 
        parameters[]    = {"fog"};
 
    };
 
 
};

I know how to pull the duration but unsure on what method I should use?

exotic flax
#

what should the array look like?

ashen warren
#

So the way that the array should look.

For all songs with parameter say "rain", it gets categorized as rain, some audio files might get classified as "day" and "fog" based on what is listed in parameters.

It is to autoselect from an array at random if the contitions are met in the ifthen statement

So im redoing this completely cause it was very tedious to setup 400 sound files and have to type in the duration and class ID a second time.

#

For example, this is what the old version would look like since it was defined in the same sqf a second time with the fogtracks and duration specified



if(fog >= 0.3) then
{
  //playing fog music
    wasInCarBefore = 0;
    _selecter = floor(random count _fogTracks);
    playMusic (_fogTracks select _selecter);
    duration = (_fogDurations select _selecter);
    currentTrack = (_fogTracks select _selecter);
              
    if(debugging == 1) then
    {
        hint format ["Changed music to Fog Music Trackname: %1", (_fogTracks select _selecter)];
    };

};
robust hollow
#

if you are hardcoding it like that you could just do

"'rain' in getArray(_x >> 'parameters')" configClasses (configFile >> "CfgMusic")
ashen warren
#

ok, I tried that but didn't do that correctly apparently if thats what that is, Think i was using isarray

#

@robust hollow is this what you mean


_raintracks = "'rain' in getArray(_x >> 'parameters')" configClasses (configFile >> "CfgMusic")

//=======================================================
if(rain >= 0.3) then
{
  //playing fog music
    wasInCarBefore = 0;
    _selecter = floor(random count _rainTracks);
    playMusic (_rainTracks select _selecter);
           duration =  getNumber (configFile >> "CfgMusic" >> _selector >> "duration");
    currentTrack = (_rainTracks select _selecter);
              
    if(debugging == 1) then
    {
        hint format ["Changed music to rain Music Trackname: %1", (_rainTracks select _selecter)];
    };

};

exotic flax
#

you could do something like this:

_fogTracksObjects = "'fog' in getArray (_x >> 'parameters')" configClasses (configFile >> "CfgMusic");
_fogTracks = _fogTracksObjects apply {
   [
      getText (_x >> 'name'),        // track name
      configName _x,                 // classname
      getNumber (_x >> 'duration')   // duration
   ]
};
ashen warren
#

i just copied fog when u put in rain lol

robust hollow
#

you would need to use configName and could simplify it a bit but yes pretty much

#
    _selecter = configName selectRandom _fogtracks;
    playMusic _selecter;
    duration =  getNumber (configFile >> "CfgMusic" >> _selector >> "duration");
    currentTrack = _selecter;
              
    if(debugging == 1) then
    {
        hint format ["Changed music to Fog Music Trackname: %1", _selecter];
    };
ashen warren
#

ok

#

getarray BI page was vague on this subject, Thanks. didn't think you could skip a layer to find a parameters. thought it had to be Configfile >> cfgmusic >> and some sort of black magic after it

winter rose
#

@robust hollow _selecter/_selector* πŸ˜‹

robust hollow
#

😱

#

oh nah im ok. it was like that in the source 😌

winter rose
#

BI source?? πŸ™€

winter rose
#

oh πŸ˜„

tough abyss
#

is it possible to include a file before the folder where the script is defined?

#

/folder1/folder2/script.sqf
/folder1/headerfile.hpp
something like this

copper raven
#

../ will move one directory back

tough abyss
#

#include "../GUIdefines.hpp"
I get this error:
Error missing ;
On line 138 in the defines file
Line 138 is
class RscText

#

am i not able to include the file with gui defines?

robust hollow
#

you wouldnt include a config into an sqf script

tough abyss
#

ah ok, so i'll have to make another macro file then

#

ty

tough abyss
#

is there a way to create a subdialog of a dialog?

#

as in both exist at once

winter rose
#

maybe with createDisplay

tough abyss
#

@winter rose it requires a parent display though

#

not sure how to get that

winter rose
#

the first display you create is the parent, the second the child

tough abyss
#

@winter rose oh createdisplay ontop of the createdialog?

winter rose
#

I believe so (not too sure about UI stuff)

#

but only one can be active at a time - the parent won't be accessible as long as the child is open

tough abyss