#arma3_scripting

1 messages Β· Page 575 of 1

haughty fable
#
_bed = _this select 0; 
_bedPos = getPos _bed;
_playerPos = getPos player;
_playerLoadOut = getUnitLoadout player;
player setPos _bedPos;
player setDir(getDir _bed + 180);
[player, "PRONE_INJURED", "NONE"] call BIS_fnc_ambientAnim;
sleep 1; 
player setPos _playerPos;
[player, "STAND1", "NONE"] call BIS_fnc_ambientAnim__terminate;
#

In this, script, how can i remove all the items placed in the _playerloadout and then add them back after the animation?

rustic plover
#

Can I close the game via command?

winter rose
#

@haughty fable getUnitLoadout/setUnitLoadout

OR use switchMove as previously mentioned.

#

or playAction "Unconscious"

#

or so many other ways

#

anyway, I'm off πŸ‘‹

haughty fable
#

Great, again thank you 😁 good night

exotic tinsel
#

is there a way to remove the inventory icon from all objects? i know of how to prevent accessing inventories but i want to get rid of the provided inventory action all together so only our custom one shows up.

rustic plover
winter rose
#

@exotic tinsel nope, unless you use simple object or mod something

#

@rustic plover then you cannot

exotic tinsel
#

anyway to make the action call my custom inventory script?

finite jackal
#

InventoryOpened Event handler can open yours and overwrite vanilla

ornate pasture
#

Hi everyone, is there anyway to know if curator has placed any unit or structure yet ?

cyan dome
#

hello i need to activate a trigger one at a time is there a code or a way to make other triggers wait while the other one is playing

young current
#

It is possible. MP execution just is a bit different.

still forum
#

@winter rose init.sqf
if (player == unit1) then {
init.sqf might run BEFORE player is initialized, meaning player can still be objNull. Thats why you so often see waitUntil {player == player} in init.sqf sleep 1 might work in most cases but is not eliable.
@rustic plover no you can't close the game, didn't you ask that already? if not someone else asked the same recently

winter rose
#

true that, especially in JIP

young current
#

Why would there even be need to close the game from mission?

winter rose
#

To troll other players!

cosmic lichen
#

if you wanna close the game just use airportSidecommand πŸ˜„

winter rose
#

Stahp πŸ˜‚

cosmic lichen
#

πŸ˜›

cyan dome
#

i need a script that will add a marker after specified amount of time

still forum
#

spawn, sleep, createMarker
there have fun

#

He said specified amount of time waitUntil would be unspecified, unless you do a stupid waitUntil on time.

cyan dome
#

hehe thanks

unique sundial
#

waitUntil {this_is_over};

winter rose
#

wake you up when it's all ooover 🎡

sacred slate
#

how can i do this? when i get killed, teamswitch to next soldier in squad

winter rose
#

selectPlayer?

winter rose
#

we shall never know if this worked Β―_(ツ)_/Β―

haughty fable
#

xD

unique sundial
#

@sacred slate you need to set other units as playable in editor, then use teamSwitch command

#

But if you want option in the death menu I think it matters which respawn type you set

worn forge
#

Is there an engine variable that gets set to true when BIS_fnc_endMission is run? I'm looking to perfect some variables for a debriefing screen after the mission ends.

winter rose
#

@worn forge exit.sqf is called at the mission's end, but check in the Function Viewer, I believe such global BIS var exists

worn forge
#

That'll work! Thanks Lou.

worn forge
#

I'm liking exit.sqf as the mission I'm adapting has a few different methods where endMission is called, so I don't have to bother tracking each one.

winter rose
#

an "Ended" missionEH exists too iirc

#

just realising now ^^"

worn forge
#

Yup, same behaviour

uncut sphinx
#

am I correct in understanding the wiki that addPublicVariableEventHandler only works in multiplayer? So do I need a workaround for singleplayer environment?

#

i.e MP mission in SP

winter rose
#

I most likely believe you would need to tell us why/how you are using this EH and why it would not be working in SP (meaning that a player-hosted game would not either)

uncut sphinx
#

I want it on server to execute code when the clients publicVariableServer some stuff

winter rose
#

but here, client and server are the same, so you don't need to "tell" the server

uncut sphinx
#

Yeah, but my question is, if that command doesn't work in SP, does that mean the EH will never fire?

#

i.e. the code will never be executed

winter rose
#

I think it means that yes

uncut sphinx
#

should I just remoteExec a function then?

winter rose
#

oh yes, much better than using the old PV system

uncut sphinx
#

ah ok

#

is there anything specific I need to do in CfgRemoteExec to allow clients to do this?

winter rose
#

by default, all clients can. for security reason though, you could restrict that

uncut sphinx
#

ok

#

Thank you

harsh vine
cosmic lichen
#

Looks good !

ebon ridge
#

i want to get AI unit in player group to follow sqf commands (doMove), but they won't do it. seems to work okay if they are not in player group, is there some trick?

#

alternatively is there a perfect "recipe" for "unit go here no ifs-or-buts"?

#

i've seen people say disable various bits of AI or set different skills or bravery, is there a actual minimal and complete known requirement though?

haughty fable
#

Is it possible to respawn doing an animation?

winter rose
#

what do you mean? if animation == "theAnim" then player setDamage 1?

haughty fable
#

No

#

When i select a respawn position, i want the player to respawn doing an animation

#

Is that possible?

winter rose
#

yes

haughty fable
#

Can you tell me how, please 😁

winter rose
#

use an Event Handler, "respawn" or "MPrespawn"

steady terrace
#

is it possible to change the variable name of a unit inside 3den? or better yet, create a new unit with where you define the variable name?

cosmic lichen
#

Or onPlayerRespawn.sqf

still forum
#

double click the unit, there is a variable textbox at the top?

cosmic lichen
#

Variable names are not available in 3DEN

steady terrace
#

my bad.. I mean in a script, woops

still forum
#

MyNewVariable = MyUnit
Done, you have a new variable with the unit inside

steady terrace
#

damn terminology.

when you drag a unit into 3den, you can double click it and add a variable name. the tooltip calls it a "unique system name". I want to create characters in 3den(using create3denentity) but give the unit one of those variable names.

cosmic lichen
#

set3DENAttribute

worthy willow
#

Is the -init param still broken?

cosmic lichen
steady terrace
#

ooh! thanks @cosmic lichen

cosmic lichen
#

@worthy willow How do you know it's broken?

worthy willow
#

It doesn't fire at all

still forum
#

why is that list of 3den attributes not linked on the set3DENAttribute page :U

steady terrace
cosmic lichen
#

Good catch @still forum It's linked now.

still forum
#

Thanks ❀️

cosmic lichen
#

These lists are not even up do date =/

still forum
#

have fun updating them. If you have questions about stuff I'm here (from time-to-time, for example not now)

cosmic lichen
#

Gonna look into it tomorrow.

spice flame
#

Does anyone already have a finished Ace Interaction for loading (Attachto) and unloading (detach) a box on a vehicle?

still forum
#

you mean ACE Cargo?

spice flame
#

No, the box should remain visible, so without Ace Cargo

still forum
spice flame
still forum
#

Yes, thats what I just sent you

#

That is vehicle cargo, Vehicle in Vehicle cargo.

surreal peak
#

Dedmen did u get a new role?

#

just noticed

spice flame
#

Yes, but it doesn't work for my project.
Because the truck does not support vehicle in vehicle.
Hence my idea to load and unload the crate using the ACE Interaction Menu on the truck via https://community.bistudio.com/wiki/attachTo

haughty fable
#

use an Event Handler, "respawn" or "MPrespawn"
@winter rose Where should i put that?

winter rose
#

ideally in a script file

haughty fable
#

I tried it but it doesnt seem to work

cyan dome
#

is any body here know what is the code when player is taking fire playsound"takingfire";

winter rose
#

@cyan dome it is an in-game sentence, not just a single file

cyan dome
#

sorry i am new with the scripting

#

totally had no idea how it works

#

i already have the cfg sounds ready and also the files needed.

what i need is how the trigger will activate once

player is fired upon.

winter rose
#

what i need is how the trigger will activate once player is fired upon
there is no easy trigger for this, and an Editor Trigger clearly won't do

haughty fable
#
player addEventHandler ["Respawn", 
{
    if (typeOf _this == "B_Helipilot_F") then 
{
    _this setpos (getmarkerpos "PilotRespawn"); 
}
else
{
    hint "5";
}

]; ```
#

Should that work?

sacred slate
#

can some one tell me how to add the player as object and 1000 as amount: [<object>, <amount to add or remove>] call HALs_money_fnc_addFunds;

winter rose
faint fossil
#

hey so uh

#

is there a way to get the names of the skins of vehicles

#

for example

#

this setObjectTextureGlobal [0, "A3\Air_F\Heli_Light_01\Data\Skins\heli_light_01_ext_speedy_co.paa"];

round nymph
#

Would anyone know how to script the vision mode of my gunner optic to be Black & White instead of β€œNormal” (colour)?

faint fossil
#

makes a helicoptor with a specific skin

#

but i cant seem to find anything about the path of skins for jets or tanks and stuff

#

i want to be able to respawn with a specific livery

austere sentinel
#

Afaik, it's just extract everything and search by hand/with regex @faint fossil

faint fossil
#

x_x

#

okay rip

#

ty for the advice but that's a dead end for me

austere sentinel
restive leaf
#

(1) Never ping everyone in a discord with thousands of people (thankfully it is turned off here); (2) Completely wrong channel... read the descriptions and go to #creators_recruiting ; (3) if you are "dev-ing" a server and need someone to code it for you then you are not "dev-ing" a server for someone...

rugged acorn
#

Hello everyone. Does anyone here may know if the BIS_fnc_taskPatrol will create an infinite patrol or the patrol will eventually come to a halt after some waypoints have been ended? Thanks in advance everyone!

worthy willow
#

@round nymph Do you mean thermal?

round nymph
#

No, I already know how to set Vision mode to Ti, I just want the Normal vision to be B&W like a B&W tv

worthy willow
round nymph
#

@worthy willow thank you, now all I need to figure out is where do I place the: setPiPEffect [3,1,1,0.4,0,[0,0,0,0],[1,1,1,0],[1,1,1,1]];

obsidian violet
#

@rugged acorn

//Cycle back to the first position.
private ["_wp"];
_wp = _grp addWaypoint [_pos, 0];
_wp setWaypointType "CYCLE";
_wp setWaypointCompletionRadius 20;

This is the last line of code in the BIS_fnc_taskPatrol, that means the last waypoint is set on Cycle

from the wiki
"A cycle type waypoint can be used to make the group move in an infinite loop"
reference
https://community.bistudio.com/wiki/Waypoint_types

bright flume
#

patrol == loop, move would be a oneway path and end.

#

while on a similiar topic, anyone know where the addactions are defined for UAV op loiter?

winter rose
#

@faint fossil see getObjectTexture

still forum
#

@faint fossil

is there a way to get the names of the skins of vehicles
I assume by "names" you mean paths, here is a way to get the current textures of a vehicle. So if you already have one that looks like what you want, use this to get the texture paths.
https://community.bistudio.com/wiki/getObjectTextures

#

AW cmon Lou

winter rose
#

lemme sleep

warm storm
#

Hi, does anyone know how to make an ai face a specific direction?
My current code is hunter1 setVectorDir [0,0,200];
This sets bearing in relation to last direction
Is there a way I can set the specific rotation?

cosmic lichen
#

setDir

spark kiln
#

So I got 2 things I cant figure out.

  1. making a darter invisible
    I used
    this setObjectTexture [0, "#(rgb,0,0,0)color(0,0,0,0)"];
    and it hides everything apart from the rings that protect the motors.
    Same for teh ED1 it doesnt hide the tracks.
    Hide object disables it so it doesnt work for me.

  2. can I use the attach to command to attach something to the ED1D pelters gun arm instead of the drone itself?

worn forge
#
  1. this hideObjectGlobal true
  2. it's not perfect, but you can modify the exact placement of the attachment in two ways: either a manual XYZ offset: thing attachTo [ED1D, [-0.8, 1.2346, 0.34732]] or with a defined memory point thing attachTo [ED1D, [0,0,0], "peltersGunArmNamedMemoryPointThingy"]
spark kiln
#
  1. unfortunately doesnt work.
    Could you explain two ? is there a namebd object for pelters gunarm?
winter rose
#

@spark kiln try with other indexes

this setObjectTexture [0, "#(rgb,0,0,0)color(0,0,0,0)"];
this setObjectTexture [1, "#(rgb,0,0,0)color(0,0,0,0)"];
this setObjectTexture [2, "#(rgb,0,0,0)color(0,0,0,0)"];

// or
{ this setObjectTexture [_x, "#(rgb,0,0,0)color(0,0,0,0)"]; } forEach [0,1,2];
```if it fails, you can't without a mod
worn forge
#

For setting the darter invisible, where are you running the code? If you're running it from the init box, it's far easier to just change the attributes in Eden and uncheck the box that says "Show Object" in the "Special states" section.

winter rose
#

yes but as he said, hideObject disables simulation too

#

he wants a predadrone πŸ˜‰

worn forge
#

ooooooooh.

#

Only thing I can think of would be to create the vehicle locally on the server, and playSound3d of the rotors, attach to the local darter's location...?

twin steppe
#

Hello. Just wondering if anybody knows a script that recognizes the outfit a player is currently wearing and automatically switches it's texture. Like: if player has "U_B_CombatUniform_mcam" then player settextureglobal player setObjectTextureGlobal [0, "\a3\characters_f\BLUFOR\Data\clothing_wdl_co.paa"];" but on a constant loop.

exotic flax
#

why in a loop?

twin steppe
#

So when he takes it off it automatically turns into the camo when he puts it back on

exotic flax
#

would make more sense to put it on event handlers like InventoryClosed

winter rose
#

@twin steppe there is a full example especially for this case πŸ˜‰

twin steppe
#

Will that work if there are several equipments involved?

exotic flax
#

because checking every frame or second (or any time) will just kill the client/server

twin steppe
#

haha yeah I don't wanna do that

#

Yeah it's just there are so many different cool camouflages but I don't know how to permanently set something to that camo without causing a big frame drop. You said something about inventory close?

#

I checked what Lou posted: player addEventHandler ["Take", { (getObjectTextures player + [uniformContainer player getVariable "texture"]) params ["_texUniform", "_texInsignia", "_texCustom"]; if (isNil "_texCustom") exitWith {}; if (_texUniform == _texCustom) exitWith {}; player setObjectTextureGlobal [0, _texCustom]; false }]; I'll try it out.

exotic flax
#

there are different event handlers which COULD work...
Take will work best for inventory items, since it triggers the moment someone picks it up.
Put works when someone drops an item.
InventoryClosed (or Openened) is best for triggering when using "I" or a crate/vehicle

twin steppe
#

Thanks @exotic flax I'll check em out. Is there any function that immediately executes a script once it notices a specific vehicle? Thinking of doing the same camo idea but for vehicles instead. Automatically turn them into a texture when they are spawned in.

exotic flax
#

I wanted to say Init, although vanilla EH only works through configs (since you can't add a script to an object which doesn't exist).
If you include CBA XEH, you could use an init event handlers on vehicles.

twin steppe
#

Alright. Thanks a lot for the information Grezvany.

spark kiln
#

@spark kiln try with other indexes

this setObjectTexture [0, "#(rgb,0,0,0)color(0,0,0,0)"];
this setObjectTexture [1, "#(rgb,0,0,0)color(0,0,0,0)"];
this setObjectTexture [2, "#(rgb,0,0,0)color(0,0,0,0)"];

// or
{ this setObjectTexture [_x, "#(rgb,0,0,0)color(0,0,0,0)"]; } forEach [0,1,2];
```if it fails, you can't without a mod

@winter rose

Thanks for the answer unfortunately that didnt work either

#

I am trying to make little servo skulls

#

@haughty steeple any idea if there is a object name i can call to attach the something to the gun arm?

#

Montana I stand corrected the code you wrote worked on the ED1 just not the darter

#

thats still helpful

#

It hides the texture but only if i get close to it which is somewhat weird

winter rose
#

must have something to do with LODs, yeah

spark kiln
winter rose
#

hahaha dat look, nice πŸ˜„

spark kiln
#

i attached a pelter under so it fires aswell (with a second operator)

cosmic lichen
#

Any idea why typeOf returns "" for 158887: uwreck_fishingboat_f.p3d (terrain objects of type wrecks)

#

Seems to work fine for all other terrain objects like radars and so on. Are wrecks configured differently?

still forum
#

not all terrain objects have classnames

cosmic lichen
#

Any work around for that?

still forum
#

use the p3d filename?

cosmic lichen
#

Not an option. I need the display name of the object from config.

bright flume
#

display name?

cosmic lichen
#

yes

bright flume
#

example?

still forum
#

What is the display name of that object?

#

didn't know terrain objects have one, but on the other hand I remember it displaying "Tree" on a tree in A2

cosmic lichen
#

Most of them have, except wrecks

faint fossil
#

(Thank you so much Dedmen and Lou for helping me with getObjectTexture, it's exactly what I'm looking for!!)

cosmic lichen
#

@bright flume sqf configFile >> "CfgVehicles" >> "Tuna_F" >> "displayName"// Thuna

faint fossil
#

Sorry to ask the real dumb questions but how do I use getObjectTexture to get the texture, like, is there a way to display it in game so I could write it down?

winter rose
#

hint str getObjectTextures theObject

hint str getObjectTextures theObject
// hint or systemChat
#

@faint fossil ^

faint fossil
#

Ah okay thanks again!

still forum
#

please copyToClipboard, you don't want to write each path down by hand

faint fossil
#

πŸ‘€

#

will do that, ty!

bright flume
#

diag_log also for hardcopy

cosmic lichen
#

please copyToClipboard, you don't want to write each path down by hand
@still forum But he asked for it πŸ˜„

karmic flax
#

How do I calculate hit value when bullet speed is below typicalHit? Is it just speed/TypicalHit?

haughty fable
#

Is it possible to get the name of the unit (B_Helipilot_F) on a script?

#

Instead of 1cc15e72d00# 41: coveralls.p3d

bright flume
#

what is typicalHit and yeyay what 'name'? player's? role name?

cosmic lichen
#

typeOf

haughty fable
#

what is typicalHit and yeyay what 'name'? player's? role name?
@bright flume No, the name that appears on the 3den editor (B_Helipilot_F for example)

bright flume
#

believe if you scroll up 10 lines R3vo was talking just about that if thats what you mean

haughty fable
#

typeOf
@cosmic lichen But its posible to hint the name of the unit instead of 1cc15e72d00# 41: coveralls.p3d ?

bright flume
#

I think eir was saying typeOf is what its gonna give

cosmic lichen
#

Hint typeOf OBJECT

bright flume
haughty fable
#

ohh now i get it, thank you 😁

bright flume
#

if there is no config class it will not report anything remember so that doesnt work on everything.

haughty fable
#
_player = _this select 1;
_PlayerUnit = typeOf _player;``` What can i do to save what's inside of the variable ("B_Helipilot_F") but without the ""?
still forum
#

what?

#

That code above is saving it without extra quotes

worn forge
#

What's the best way to determine whether a group has completed all its current waypoints and are just standing around?

haughty fable
#

That code above is saving it without extra quotes
@still forum But if i try to do _Something = _PlayerUnit _something is going to be "B_Helipilot_F" with those ""

still forum
#

no

haughty fable
#

Is there something i can do to avoid that?

still forum
#

that's.. how to explain that

#

there are no quotes in there

#

it just displays that to you

#

they don't really exist

haughty fable
#
_player = _this select 1;
_PlayerUnit = typeOf _player;
_bed = _PlayerUnit;
_BedPos = getPos _bed;``` Then, if i had a bed called B_Helipilot_F this should work?
#

Or is there any way to save whats inside of _bed (_PlayerUnit) as a text?

still forum
#

no

#

B_Helipilot_F is a classname

haughty fable
#

and then get the position of that object?

still forum
#

a classname is not a object

haughty fable
#

Thats what i mean, i cant save the "B_Helipilot_F" as a text? (B_Helipilot_F)

still forum
#

it is already text

haughty fable
#

No, but without the ""

still forum
#

If it doesn't have quotes then its not text

worn forge
#

Yeray, you've said you want to 'save' it, where do you want to save it to

still forum
#

As I said, the quotes are NOT stored, they are just put around when you look at it. They are not actually part of it

haughty fable
#

I think im not explaining good 😩

worn forge
#

yup, explain the problem you want to solve, perhaps

still forum
#

yep

#

most of what you're saying doesn't really make sense

haughty fable
#

ok

cosmic lichen
still forum
#

I'll just reject your reality and substitute my own...
You want to save a object in a variable?
YER_PlayerUnit = _player
and then later get the position of it?
_playerPos = getPos YER_PlayerUnit

No idea what you want names for or classnames.

cosmic lichen
#

I guess he thinks the classname is a reference to the object

haughty fable
#

Give me a second

#

What i want to do is to set an event handler of respawn: (already did it)

 true spawn {
   waitUntil {player == player};

   player addEventHandler ["Respawn", {
    _this execVM "scripts\playerRespawn.sqf"
   }];
};  ``` then, inside of playerRespawn.sqf: ```cpp
_player = _this select 1;
_PlayerUnit = typeOf _player;
_bed = _PlayerUnit;
_BedPos = getPos _bed;
_PlayerNewPos= setPos _BedPos;``` What im trying to do (TRYING, im the worse scripting) is to, if a player is the unit B_Helipilot_F, then i would only have to change the name of any bed to B_Helipilot_F and that would be his respawn point (of the soldier B_Helipilot_F). That way if i have 4 different units, i would only have to put some beds and call them the name of those units
#

Does that make any sense at all? I repeat, im new at this of scripting 😁

cosmic lichen
#

How many B_HeliPilot_F are in your mission?

haughty fable
#

One

#

But im "doing" this script to put many different types of soldiers

still forum
#

place the beds in 3DEN?

haughty fable
#

What?

still forum
#

are you palcing the beds in 3den

cosmic lichen
#

_PlayerNewPos= setPos _BedPos; This won't work

haughty fable
#

are you palcing the beds in 3den
@still forum Yes, and calling them the way of the units

still forum
#

_PlayerNewPos = setPos _BedPos; that also is syntax error, check setPos wiki page

#

Then here

_player = _this select 1;
_playerUnitType = typeOf _player;
_bed = missionNamespace getVariable _playerUnitType;
_BedPos = getPos _bed;
#

then you name your bed in 3DEN B_Helipilot_F

haughty fable
#

Then here

_player = _this select 1;
_playerUnitType = typeOf _player;
_bed = missionNamespace getVariable _playerUnitType;
_BedPos = getPos _bed;

@still forum That should work?

still forum
#

Why would I send you something that doesn't work?

haughty fable
#

Hahaha sorry

still forum
#

i removed the setPos cuz yours was broken

haughty fable
#

But whats the difference between that code and the one i did?

still forum
#

put them side by side and look at it

haughty fable
#

I still don't understand them, but I suppose I will when I get a little more knowledge. Anyway, thanks for the help 😁

#
_playerUnit = _this select 1;
_playerUnitType = typeOf _playerUnit;
_bed = missionNamespace getVariable _playerUnitType;
_BedPos = getPos _bed;
player setPos _BedPos;
player setUnitLoadout (configFile >> "EmptyLoadout");
player setDir(getDir _bed + 180);
[player, "PRONE_INJURED", "NONE"] call BIS_fnc_ambientAnim;
sleep 10; 
[player, "STAND1", "NONE"] call BIS_fnc_ambientAnim__terminate;
``` Will this script work good on a player hosted server? Or i need to change the code or something?
worn forge
#

how will this code be run?

haughty fable
#
true spawn {
   waitUntil {player == player};

   player addEventHandler ["Respawn", {
    _this execVM "scripts\playerRespawn.sqf"
   }];
};  ```
> how will this code be run?
@worn forge  When a player respawns
worn forge
#

So the code you have posted is found in scripts\playerRespawn.sqf

#

And this spawn you have, where is that run? In the player object's init field?

runic quest
#

onButtonClick = "playMission['','\A3\Missions_F_Bootcamp\Scenarios\Arsenal.VR']"; is not work. i need help please!

worn forge
#

amazing, what's your problem?

haughty fable
#

And this spawn you have, where is that run? In the player object's init field?
@worn forge No, in the init of the mission

runic quest
#

@worn forge When I repaired the module code, the button to open the virtual arsenal (onButtonClick = "playMission ['', '\ A3 \ Missions_F_Bootcamp \ Scenarios \ Arsenal.VR']"; ) It stands to reason that this button will open the arsenal, but it has no effect. I do n’t know why.

worn forge
#

Yeray, you mean init.sqf?

haughty fable
#

Yeray, you mean init.sqf?
@worn forge Yes

worn forge
#

amazing I don't even know where to start

runic quest
#

okey,tks!

worn forge
#

Yeray that looks like it will work locally but I think you're over complicating it

haughty fable
#

What?

worn forge
#

You could just pack the code in your playerRespawn.sqf file into the engine file onPlayerRespawn.sqf, which will automatically run during player respawn

haughty fable
#

And that will work on multiplayer too?

worn forge
#

Yup

haughty fable
#

Ok, thank you! I'll try it

waxen tendon
#
while (sleep 6) do {
            1 cutText ["Restarting Mission.","PLAIN DOWN",1,true];
            sleep 0.5;
            1 cutText ["Restarting Mission..","PLAIN DOWN",1,true];
            sleep 0.5;
            1 cutText ["Restarting Mission...","PLAIN DOWN",1,true];
        };```
is there any way to make this work?
cosmic lichen
#

Remove the while part and it works

waxen tendon
#

lol

#

i want it run for 6 seconds

still forum
#

While time - _starttime < 6

#

And read wiki, you have syntax error

waxen tendon
#

ah, the good old wiki

unreal scroll
#

Does anyone have a fix for Krya Nera Airstrip for AI? Is it possible to fix it using Dynamic Airport Configuration system?

exotic flax
#

What isn't working? Since the terrain config has the airstrip configured completely

waxen tendon
#

is it possible to load another mission from a mission

#

(mp compatible if possible)

winter rose
#

not that I know of - but you could do an MP campaign?

worn forge
still forum
#

is it possible to load another mission from a mission
make a campaign

#

if your mission ends, the next one in campaign auto starts

#

if configured correctly

waxen tendon
#

how can i do that?

winter rose
#

see Campaign_Description.ext on the wiki, it is explained (at least the description.ext part)

waxen tendon
#

thanks

worn forge
#

The #monitor command - it's reporting more information than previously. Specifically it has readouts for "NG", and "G", does anyone know what these figures mean?

still forum
worn forge
#

πŸ‘

worn forge
#

NG = non-guaranteed traffic, G = guaranteed traffic

haughty fable
#

What can i do to activate a script only if an object from a variable exists?

young current
#

if (condition) stuff that happens

haughty fable
#

But how do i tell if the object is created in the map?

young current
#

possibly check if its alive

tough abyss
#

you can assign it to a variable from the properties tab

#

and then use that to check if its not null

#
if (!isNull obj1) then {
do stuff...
};
still forum
#

how would the object not exist?

#

never spawned in 3den?

#

variable never set? object has been deleted since the variable was set?

tough abyss
#

could get deleted at some point

winter rose
#

isNull it is

still forum
#

There are different definitionns of "not exist", I can think of 3 variants, that would all need different script commands

#

never spawned/var not set will not work with isNull

tough abyss
#

well that is not that the object does not exists just that the variable is nil

haughty fable
#

Wait

#
_playerUnitType = typeOf player;
_bed = missionNamespace getVariable _playerUnitType;

_BedPos = getPos _bed;
player setPos (getPos _bed);
player setDir(getDir _bed + 180);
[player, "PRONE_INJURED", "FULL"] call BIS_fnc_ambientAnim;
sleep 5; 
[player, "STAND1", "FULL"] call BIS_fnc_ambientAnim__terminate; ``` If _bed exists then do the code
#

How could i do it?

tough abyss
#
_playerUnitType = typeOf player;
_bed = missionNamespace getVariable _playerUnitType;

if (!isNull _bed) then {
  _BedPos = getPos _bed;
  player setPos (getPos _bed);
  player setDir(getDir _bed + 180);
  [player, "PRONE_INJURED", "FULL"] call BIS_fnc_ambientAnim;
  sleep 5; 
  [player, "STAND1", "FULL"] call BIS_fnc_ambientAnim__terminate; 
};
``` assuming `_bed = missionNamespace getVariable _playerUnitType;` actually works
haughty fable
#

Yes, it does

#
_playerUnitType = typeOf player;
_bed = missionNamespace getVariable _playerUnitType;

if (!isNull _bed) then {
  _BedPos = getPos _bed;
  player setPos (getPos _bed);
  player setDir(getDir _bed + 180);
  [player, "PRONE_INJURED", "FULL"] call BIS_fnc_ambientAnim;
  sleep 5; 
  [player, "STAND1", "FULL"] call BIS_fnc_ambientAnim__terminate; 
};
``` assuming `_bed = missionNamespace getVariable _playerUnitType;` actually works

@tough abyss Still says varible _bed not defined

tough abyss
#

"assuming _bed = missionNamespace getVariable _playerUnitType; actually works"

haughty fable
#

If the player is B_Helipilot_F then, the bed is going to be called B_Helipilot_F

young current
#

that does not look right

haughty fable
#

What?

#

The code itself works

young current
#

do you have missionNamespace variable for players unit types?

haughty fable
#

I dont know, dedmen was the one who helped me doing it

still forum
#

if (!isNull _bed) then { no, thats exactly what I just said above

#

if (!isNil "_bed") then { is correct

young current
still forum
#

yes he has

young current
#

is this stuff defined?

#

k then

still forum
#

he sets var name with that in 3den

haughty fable
#

if (!isNil "_bed") then { is correct
@still forum Works perfect, thank you!

tough abyss
#

but its not that the object does not exists, its that his variable is undefined

#

if there was an object assigned to the variable and it went null the variable would return objNull and isNull would work fine

still forum
#

the variable is undefined BECAUSE the object does not exist

#

Thats why I said he needs to define his question better, because otherwise you cannot know what he means

tough abyss
#

pretty much

#

technical answers require technical questions

unreal scroll
restive linden
#

Hi, how force AI to switch magazine ? ( AP to HE on cannon )

unreal scroll
winter rose
#

sorry, wrong tag Max's πŸ˜† @restive linden ^

unreal scroll
#

Of course, the same. Without any mods. Both common and dev versions. Also, while modding, I've noticed that differnt versions have different behaviour. I.e., english and german versions can't handle this command (most of players reported about it): https://community.bistudio.com/wiki/setTriggerInterval - it just throw an error. In russian it works fine.
I wonder - if it is still unknown, maybe there'is another difference in versions?

winter rose
#

isn't it between dev and release branch?

#

setTriggerInterval is still on dev

unreal scroll
#

Oops... There're no info on the page, sorry. But I switched to dev not so long ago, just because of falling weapons fix. No difference between dev (1.99) and normal version a (tested in december).

winter rose
#

dev should be 1.97 πŸ€”

unreal scroll
#

For me it is 1.99.146224

winter rose
#

I will have to believe you on this one, I didn't visit it recently

#

as for the wiki page it states the Arma 3 Dev by the icon πŸ˜‰

unreal scroll
#

Aa-ah. It's hiding well. Anyway, is doesn't matter. I noticed that bug last year, as I'm making Overthrow fork, open campaign at Altis. The resistance starts from north part of Altis, so the Krya Nera Airstrip (Abdera) is the only airstrip they can have at beginning, and I wasn't able to use it with AI all the time... Can anyone confirm this bug in english version?

winter rose
#

will try right now. so Altis, Krya Nera airstrip

unreal scroll
#

Yeah, thanks.

bright flume
#

anyone know how to activate/deactivate smoke module still cant figure if there some way script or otherwise

winter rose
#

@unreal scroll confirmed

unreal scroll
#

Thanks God. I hope we'll have an aviation soon πŸ™‚

tough abyss
#

how do i make a dialog open when i hit a certain key

bright flume
#

you could make a airport in the middle of nowhere dynamically if you wanted...

unreal scroll
#

@bright flume Yes, I read about it, but it's new for me, and I think if it is a bug, then it has a cause, and it should be found.

restive leaf
#

Is that the airport side bug @winter rose ? Or something else

tough abyss
#

how do i make a dialog open when i hit a certain key

winter rose
#

something totally new (unrelated to side) @restive leaf

restive leaf
#

Ah, thanks

bright flume
#

think it depends on the aircraft also make sure aircraft approach from bearing 53? technically its a light aircraft airfield. runway only 350m long

winter rose
#

tried with the civilian airplane, he's all "yup, starting well" then "OH LOOK a penny to the left"

bright flume
#

well civi planes are the worse cuz they float like forever....

winter rose
#

not up to the point where they do a 90Β° left I hope πŸ˜„

restive leaf
#

I remember the first time we flew with autopilot landing in ARMA... My player character had to change uniforms after landing

bright flume
#

you dont even wanna see the shitstorm that happens when you get 6 grouped helos being told to land...

#

not sure if I recorded it but I was messing with that for like 2 days I gave up cuz they just cant do it gotta issue individual orders to each guy

restive leaf
#

Best one was an Unsung helo where they'd messed up the mesh in a release and the AI basically couldn't see out and flew up, up and away πŸ™‚ But sort of O/T

exotic flax
#

@bright flume you could place the module down with scripts:

_logicGroup = createGroup sideLogic;
_module = _logicGroup createUnit ["ModuleSmoke_F", position player, [], 0, "CAN_COLLIDE"];

and if you check \a3\modules_f\Effects\functions\fn_moduleEffectsSmoke.sqf you will see the variables you can set to make changes to it

bright flume
#

I was hoping the old man init modules would make it appear but apparently that module is immune to working with the OM init modules

#

guess I can try it that way but gotta wait till later got work today

acoustic abyss
#

Oops already answered. Stream was slow :S

viral basin
#

Hey there, i try to load my own loadout config with setUnitLoadout and it works well, but some items like Rangefinder, muzzles or optics won't be linked to the slot. i can only put them into the container using the items[] array. Is there another attribute for that or did i do anything wrong?

cosmic lichen
#

Did you get the loadout from config?

viral basin
#

yes i tried to put the muzzles/optics into linkedItems[] but it doesn't work

class TestLoadout
{
    uniformClass = "U_B_CombatUniform_mcam";
    backpack = "B_Bergen_hex_F";
    linkedItems[] = {"muzzle_snds_acp","optic_MRD","11Rnd_45ACP_Mag","V_TacVest_blk_POLICE","G_Combat","NVGoggles_OPFOR","H_Beret_gen_F","Rangefinder","ItemMap","ItemRadio","ItemCompass","ItemWatch"};
    weapons[] = {"hgun_Pistol_heavy_01_F"};
    items[] = {"ToolKit","ToolKit","ToolKit"};
    magazines[] = {"11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","SmokeShellYellow","SmokeShellYellow"};
};
cosmic lichen
#

The order in linked items is important

#
linkedItems[] = {"V_PlateCarrier2_tna_F","H_MilCap_tna_F","G_Tactical_Black","ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGogglesB_blk_F","muzzle_snds_65_TI_blk_F","","optic_ico_01_f","","","","",""}; ```
#

See the empty string "" between muzzle and optic

viral basin
#

is there a wiki site for that information? how do you know? xD

cosmic lichen
#

I don't know, I just checked the format and made a wild guess.

#

If my assumption is correct I am gonna create a biki page

viral basin
#

i tried it but it didn't work :/

exotic flax
#

I believe the main issue is that using configs requires a fully named weapon class (with attachments?), while getUnitLoadout/setUnitLoadout have the attachments separated.

#

To add attachments to a unit you need an entry in CfgWeapons for it to work, eg.

class CfgWeapons {
   class rhs_weap_m4a1;
   class TAG_rhs_weap_m4a1_acog: rhs_weap_m4a1 {
        class LinkedItems {
            class LinkedItemsAcc {
            slot = "PointerSlot";
                item = "rhsusf_acc_anpeq16a";
            };
            class LinkedItemsOptic {
                slot = "CowsSlot";
                item = "rhsusf_acc_ACOG_RMR";
            };
        };
    };
};
#

otherwise the attachments will simply be added to your inventory and NOT the weapon

viral basin
#

oh okay, well maybe i stay with sqf switch cases then. the getUnitLoadout array just works fine πŸ˜…

ebon ridge
#

Why does parseText on this only generate the first sentence?

<t font='EtelkaMonospacePro' align='left'><t color='#AAAAAA'>The enemy is resupplying a location with building resources. Intercept the transport, or attack the location they are headed to once they have arrived, and capture some building resources.</t><br><t color='#FFFFFF' font='EtelkaMonospacePro' align='left' underline='1'>Schedule</t><br><t color='#FFFFFF'>1</t><t color='#AAAAFF'>Saint Louis</t><br><t color='#AAAAAA'>Saint Louis</t><br><t color='#FFFFFF'>2</t><t color='#AAAAFF'>Larche</t><br><t color='#AAAAAA'>Larche</t><br><t color='#FFFFFF'>3</t><t color='#AAAAFF'>Arudy</t><br><t color='#AAAAAA'>Arudy</t><br><t color='#FFFFFF'>4</t><t color='#AAAAFF'>Saint Jean</t><br><t color='#AAAAAA'>Saint Jean</t><br></t>```
still forum
#

br tag never closed

ebon ridge
#

<br> is fine according to docs

still forum
#

not fine according to my rememberance

ebon ridge
#

well i can try it, the docs are clear tho

still forum
#

But I guess I'm wrong then

ebon ridge
#

i would expect it to be <br/> tho

#

as the short version

#

well you right, switching to <br/> worked, docs are wrong

#

thanks

tough abyss
#

hate to ask a stupid question but ive been here for awhile trying to figure this out, but can anyone else find a duplicating group or classname? https://pastebin.com/3h6DZtLK

uncut sphinx
#

Why does case require a colon afterwards but not default? I hate switches

queen cargo
#

Because case is an unary command, preparing the following value for the actual colon

#

Aka: colon is the actual operator

#

And default needs nΓΆ value

#

Thus nΓΆ colon

#

Could be implemented with a colon though... That decision is on BI

uncut sphinx
#

yeah, I know, I just spent 15 minutes looking for where I made a mistake

#

but it was just a colon next to default

rustic plover
#

Can I lock e. g. driver seat only for the unit locally?
I mean remove all actions with current seat only for player X

young current
#

run some animation on him that prevents user action

#

or disableUserInput

bright flume
#

nvm doesnt check seat changes...

#

actually that would work add in a check for locality change as if someone else starts driving vehicle locality will switch?

rustic plover
#

@worthy willow they are works locally?

worthy willow
#

Top left on wiki πŸ™‚

rustic plover
#

I see that it's global. I looking for local way

worthy willow
#

It is both

#

If it is called on the player while on a dedicated server it will only effect that player

rustic plover
#

100%?

#

Ok, I'll try

cosmic lichen
#

@ebon ridge Which docs are wrong?

winter rose
#

ooooooh this one might be on me
I batch replaced line returns but it has impacted the structured text examples too! <br> vs <br />

cosmic lichen
#

Blame Lou for any inaccuracies

#

Biki was correct once again πŸ˜„

winter rose
#

@jade abyss I need an :angrypepe: please

jade abyss
#

there you go.

#

@winter rose

winter rose
#

You're awesome. Thank you

#

@cosmic lichen ^

jade abyss
cosmic lichen
#

πŸ˜„

winter rose
#

I knew I would be quote-mined πŸ˜„

jade abyss
cosmic lichen
#

πŸ˜„

winter rose
#

okaaay you're both awesome

jade abyss
#

I mean, i know i am. That's no news.

winter rose
jade abyss
#

(okay, enough now^^)

winter rose
#

I'm editing structured text… and looking for potential examples I broke. Thanks for the report @ebon ridge

winter rose
#

@ebon ridge examples should be fixed now
(@cosmic lichen)

cosmic lichen
#

No need to mention me, I trust you with that πŸ˜„

winter rose
#

Blame Lou for any inaccuracies
Liiies!1!

tough abyss
#

is there any way to define macros with variable arguments such as __VA_ARGS__ in c?

still forum
#

no

tough abyss
#

that is a shame, i am trying to pass an array to a macro but you cannot have commas

still forum
#

you can

#
#define COMMA ,

MY_MACRO([a COMMA b COMMA c])

#define ARR_3(a,b,c) a,b,c

MY_MACRO(ARR_3([a,b,c]))
#

the most common (ACE,CBA,TFAR,ACRE) is the ARR_N variant

tough abyss
#

😯

dusk sage
#

Parenthesis works, no?

viral basin
#

does lbAdd doesn't work dynamically on CT_TOOLBOX (GUI) if you use it in sqf? it just adds a new entry but no text or image - instead the text will be shown in a tooltip box

distant oyster
ebon ridge
#

We use ARG instead of COMMA, at some point we tried [foo]+[bar] as well. In the end though we just use parameter count macro variants as the readability is better

#

(SQF-vm catches our macro parameter count mismatches, thanks @queen cargo !)

queen cargo
#

Np

still forum
#

It also caught dozens of them in ACE πŸ˜„

queen cargo
#

If some one just would craft corresponding unit Tests using sqf-vm πŸ€” πŸ€”

viral basin
#

@distant oyster a pitty that they didn't make it more dynamic via SQF...i really liked the onToolBoxSelChanged EH πŸ˜„

exotic tinsel
#

any documentation or features or theories that exist to enable me to submit data from in game to a web based API?
i know we can execute urls and i am currently sending simple data from the server to our website but id like to submit more complex data to the website and some stuff you cant do via the URL.

winter rose
#

no can do

#

use an extension and db

exotic tinsel
#

na dont need a db for the server. just wanted to be able to send more than player count and players names. would like to be able to send player states in a list. but cant do that via url only post.

winter rose
#

you could, one query/player for example

exotic tinsel
#

yeah that was an example. you are correct for the scenario i provided. being about to post lists/data chunks would be nice.

#

its all good ill just do the one/query per thing for simple things that arent too big.

exotic flax
#

Technically you can send everything over an url (GET data)

uncut sphinx
#
        params ["_array", "_number"];
        if (_number > (count _array)) then {
            _number = count _array;
        };
        private _selection = [];    
        while {count _selection < _number} do {
            _selection pushBackUnique (selectRandom _array);
        };
        _selection
    };```
#

is there a faster way to do this?

#

this function selects x objects at random from an array

still forum
#

would like to be able to send player states in a list. but cant do that via url only post.
huh? why not? base64 encode and plug in as url param.

#

@uncut sphinx

if (_number > (count _array)) then {
            _number = count _array;
        };

->
_number = _number min count _array;

cursive whale
#

Anyone know of a technique which will reveal if a config value is explicitly set in a class (vs being inherited)?

still forum
winter rose
#

compare with configClasses which doesn't support inheritance, and you are good

cursive whale
#

thanks both

sacred slate
#

hello when the player get killed, he should automatically team switch to the next squad member, but i dont know how to syntax it.
player addEventHandler ["killed", {teamSwitch;}]; and some how: do _from selectLeader player

winter rose
#

see selectPlayer

#

@sacred slate ^

#

@sacred slate ?

sacred slate
#

well yeah

#

thx

potent depot
#

Anyone happen to know a good way way of accomplishing the code array[i] = array[i] + num; in sqf? Using select syntax as a replacement for array[i] directly apparently isnt valid. Im hoping to avoid requiring an additional temp variable if possible.

still forum
#

array = array apply {_x + num}

potent depot
#

apply?

still forum
#

assuming you are iterating the whole array?

potent depot
#

negative, singular index

still forum
#

if only single element then
array set [i, (array select i) + num]

potent depot
#

sorry should have clarified that

#

huh, thought i had tried that

#

guess not

#

Thanks

polar anchor
#

hi, im trying to get into arma scripting (rpg in particular). i download the framework from altisliferpg.com and i've seen that databases are used for almost everything. should i learn how to use them before start scripting? also, do i need to run a server via steamcmd and all that stuff before testing my scripts or i can just go to -> multiplayer -> server browser -> host server -> <<new 3d editor>> and put my scripts into mpmissions? any tip to get started?

cunning crown
#

Before trying any framework you should probably learn the basics of vanilla scripting.

or i can just go to -> multiplayer -> server browser -> host server -> <<new 3d editor>> and put my scripts into mpmissions?
You can do that too, you can even go in the editor, make you script here and launch the server from the editor

still forum
#

you can run your scripts everywhere where you've written them to work for.
If the script is written such that it can only run on a dedicated server, then you obv can't test it locally. I don't know why anyone would do that though.
But considering they are your scripts, you should already know where they run

polar anchor
#

ok, thank you. do you guys have any good guide to suggest me to get started?

#

and what about databases?

harsh vine
#

is it ok if i post now??? dont wanna interrupt u guys

young current
#

post away

#

thats the nature of these channels

harsh vine
#
//init.sqf
end_time = {
0 = [] spawn {

private ["_eastTickets", "_westTickets"]; 
    while {true} do { 

        _eastTickets = [east] call BIS_fnc_respawnTickets; 
        _westTickets = [west] call BIS_fnc_respawnTickets; 

        if (_eastTickets < _westTickets ) exitWith { 
            if (side player == east) then { 
                "lose" call BIS_fnc_endMissionServer;
            } else { 
                "win" call BIS_fnc_endMissionServer;
            } 
        }; 
        if (_westTickets < _eastTickets) exitWith { 
            if (side player == west) then { 
                "lose" call BIS_fnc_endMissionServer;
             } else { 
                   "win" call BIS_fnc_endMissionServer; 
            } 
        }; 
Sleep 0.1;
};  
};
};

//initServer.sqf
private "_endtime";
[] spawn {
_endtime = _this select 0;
_endtime = 600;

while {_endtime > 0} do {
_endtime = _endtime - 1; 

if (_endtime < 1 ) exitWith {call end_time;};
Sleep 1;
};
};
still forum
#
_endtime = _this select 0;
_endtime = 600;

first thing is useless as overwritten by second thing

#

if (_endtime < 1 ) exitWith {call end_time;};
huh? just put it after the while loop

#

private ["_eastTickets", "_westTickets"];
don't do that
private "_endtime"; don't do that either, thats bad in every possible way to look at it

jade abyss
#
while {_endtime > 0} do {
_endtime = _endtime - 1; 
//if (_endtime < 1 ) exitWith {call end_time;};~~
};
call end_time;```
still forum
#

spawn end_time is better

#

cuz while true loop runs for ever anyway

#

also why not just sleep 600? instead of 600 times sleep 1?

jade abyss
#

*uiSleep 600

#

or do stuff like that:

_endTime = diag_tickTime + 600;
waitUntil{uisleep 1; (_endTime < diag_tickTime)};
call end_time;
still forum
#

πŸ‘€ no

#

uuugh

#

leaves

jade abyss
#

shaddapp

#

:angrypepe:

still forum
#

make me :coronapepe:

jade abyss
#

where the f is my coughing pepe

harsh vine
#

ok thanks guys i will be right back gonna try it ...the problem im having is that it doesnt end correctly for each player side.

tough abyss
#

Alright gents, I need a little help correcting an error in whatever im doing wrong.

So, the first video of me flying, is what i'm trying to achieve from an AI pilot. The second video at 0:41 was me trying to have AI do it. I set a "Move" waypoint behind the drop zone. Right about where i turned the aircraft while I was flying. I then had an invisible helipad on top of the DZ with a "Transport unload" marker attached. This mod doesnt have a proper transport function so i gad to go into the init and set an attachto script. On transport unload, i had detach on the init although the pilot would prematurely drop the transport then go in for it.

In the third video at 1:30, i set limitspeed on the first move waypoint, exchanged "Transport unload" with another move waypoint with limitspeed 0. Then on top of that was a third move waypoint with detach. Played scenario and as you can see, the pilot dropped transport early again but didnt move this time. There is a 4th move3 waypoint out of map for the aircraft to move to.

What am I doing wrong? How do i get the pilot to drop the vehicle right where i want it? https://youtu.be/4cB_1EEu8LY

golden storm
#

Hello there, i'm currently having a problem with a Diary:
I have added the line in the Init.sqf, i have also added the "Briefing.sqf" file and called it from init (i wan't it to be shown since the start of the mission)

Yet, when i test the mission, it won't be shown, here's my code:

 
#

@tough abyss Had this problem today, seems that when they use different kind of seats or there's too many in the vehicle, the leader will constantly issue the 'Disembark' order, hence, forcing the vehicle to stop and drop units.

Try to play from the Squad leader slot, you won't have the issue, i had to disable AI (MP Mission) and delete the AI altogether for it to work in SP

tough abyss
#

@golden storm Why would the leader try to disembark if he still has waypoints to hit? And shouldn't disembark be separate from dropping the vehicle since I have the vehicle scripted (attachto /detach) to the aircraft?

#

Arma 3 is so weird lmfao

golden storm
#

Try to add a new Waypoint for the Squad leader at the LZ to "Get Out", that might help him

tough abyss
#

i'll give it a try. Is there a way to force the landing gear up? When detaching the tank with the landing gear down, the tank will hit the landing gear and both vehicles will explode

golden storm
#

Yes, search for the action in the Config Viewer of the Heli, there you'll find all the posible actions to set it up the way you want

#

Right Click the Helo -> View in Config Viewer -> Actions -> Landing Gear

tough abyss
#

Awesome. I'll give it a try in a little. clan wars going on in World of Tanks lol

tender fossil
#

How can I check whether a value is SCALAR NaN?

tough abyss
#

@golden storm Do you know how to add to the quick scroll menu? So instead of having to use the init to attachto and detach, I can just use the mouse scroll?

#

Or is that a lot more complicated

tender fossil
#

Also, why doesn't this work?

// ...
_player = _this select 0;
_side = _this select 1;
_uid = getPlayerUID(_player);
missionNamespace setVariable [format ["WFBE_CO_VAR_SIDE_UID_%1", _uid], _side];

When I try to read the variable, it has value <NULL> in debug line in RPT

#

The script above is execVM'd when player joins the game, and the local variables are used elsewhere in the script where they work normally, so I think the error can't be caused by the local variables

amber basalt
#
"[WFBE (INFORMATION)] [frameno:9376 | ticktime:181.918 | fps:45.4545] Server_PlayerDisconnected.sqf: Player [Net_2] [76561198053533958] has left the game"
"[WFBE (INFORMATION)] [frameno:9376 | ticktime:181.918 | fps:45.4545] OnPlayerDisconnected.sqf: Player [Net_2] [76561198053533958], side [<null>] disconnected from game, OLD_SCORE_UID...: [8], CURRENT_SCORE_UID...: [8], TOTAL score sent to database: [84]"
"[WFBE (INFORMATION)] [frameno:9376 | ticktime:181.919 | fps:45.4545] Server_PlayerDisconnected.sqf: Player [Net_2] [76561198053533958] units are now being removed for AI Team [B 1-1-A]."

The rpt error we're getting with @tender fossil

#

Or not error

#

but it just makes the side <null>

tender fossil
#

That's from another script @amber basalt

#

But yeah, the value of variable is <null> there

amber basalt
#

πŸ€” k

still forum
#

well maybe the variable is not set then?

#

ah, just re-read the code.
Uh.. Β―_(ツ)_/Β―

queen cargo
#

How is that Code working at All? Should error like hell

still forum
#

I don't see error if _this is correct

queen cargo
#

Ohh... No... You are right

#

Should get my morning Coffee πŸ˜…πŸ˜…

vague geode
#

Is it possible to only allow "Fast travel to seized sector" for sectors that are linked to the base and let both sides only spawn outside of the sector when fast traveling to a contested sector (so that the defenders can't just fast travel into the middle of a sector but have to walk in just like the attackers) or disable "Fast travel to contested sector" completely?

thorn shale
#

how do i decrease AI damage to players?

cosmic lichen
#

Depends. There is a difficulty setting for reduced damage

ebon ridge
#

setBehaviour vs setBehaviourStrong what is the difference? They both set the behaviour on the group as per the docs.

thorn shale
#

Thanks

obtuse crypt
#

Guys is there a possibility to make a script wich checks wich side is controling more sectors/triggers and define winner of mission. I am ussing sector modules from game, but i dont want to use ticket bleeding system, i want mission to be time limiter, and to define winner in the end.

vague geode
#

Is it possible to only allow "Fast travel to seized sector" for sectors that are linked to the base and let both sides only spawn outside of the sector when fast traveling to a contested sector (so that the defenders can't just fast travel into the middle of a sector but have to walk in just like the attackers) or disable "Fast travel to contested sector" completely?

hot hull
#

Hello there ! I have a little question .. πŸ™‚

Basically, I want to make sure I fall into unconscious state rather than my character dying. I thus trigger the "handleDamage" event except that in certain cases, I die before even going through the handleDamage event. Do you have some leads on this? thank you πŸ˜„

cosmic lichen
#

@hot hull ```sqf
_unit addEventHandler ['handleDamage',
{
params ["_unit","_selection","_handleDamage","","","_hitIndex"];
if (_handleDamage < 0.1) exitWith {0};//From BIS Revive
if (!alive _unit) exitWith {0};//From BIS Revive
if (lifeState _unit isEqualTo "INCAPACITATED") exitWith {0};
if(_selection == "" && _handleDamage >= 0.95) then
{
_unit setUnconscious true;
_handleDamage = 0;
};

_handleDamage min 0.95

}];```

hot hull
#

Oh perfect, it worked ! Thanks a lot 🀩

burnt cobalt
#

hi guys - anybody have an idea how to hide only the HUD-cursor, while leaving the rest in place?

#

using showHUD 's 'hud' or 'cursors' values disables all drawn 3d icons

#

if i'm not mistaken the control is within (configfile >> "CfgInGameUI"). I am struggling finding a way to adress that specifi control. I found a bit of code that can catch the "RscIngameUI" controls but I can't seem to adapt that to "CfgInGameUI"

#
//-- works
_classes = "true" configClasses (configfile >> "RscInGameUI");
{
    private ["_rsc","_idcs"];
    _rsc = configName _x;
    _idcs = [configfile >> "RscInGameUI" >> _rsc, 1, true] call BIS_fnc_displayControls;
    {
        ((uiNameSpace getVariable _rsc) displayCtrl _x) ctrlSetTextColor [1,0,0,1];
    } forEach _idcs;
} forEach _classes;



//-- does not work (empty IDC's)
_classes = "true" configClasses (configfile >> "CfgInGameUI");
{
    private ["_rsc","_idcs"];
    _rsc = configName _x;
    _idcs = [configfile >> "CfgInGameUI" >> _rsc, 1, true] call BIS_fnc_displayControls;
    {
        ((uiNameSpace getVariable _rsc) displayCtrl _x) ctrlSetTextColor [1,0,0,1];
    } forEach _idcs;
} forEach _classes;
cunning crown
#

You might be able to use the "allControls" command and then loop trough each of them and find the one you're searching for

burnt cobalt
#

i tried this: sqf [] spawn { sleep 1; { _d = _x; {_x ctrlSetTextColor [1,1,0,1]} foreach (allControls _d); } foreach alldisplays; } no dice

cunning crown
#

What is the cursor you trying to hide?

young current
#

picture with red pointy arrow might be useful to understand the context

burnt cobalt
#

I am trying to hide the main movement cursor - if I identified it correctly it's configfile >> "CfgInGameUI" >> "Cursor"

#

i used the 'iconMove_ca.paa' image to find that

young current
#

movement cursor?

burnt cobalt
#

sorry i should not be making up names >> this thing https://imgur.com/a/XvOViju. the cursor comes up when you have squad-units selected and consists of the circle (move_ca.paa) and a context dependent center icon

#

if i understand correctly, the context based icon in the middle is defined in the configs of configfile >> "CfgInGameUI" >> "Cursor"

#
iconMove = "\A3\ui_f\data\igui\cfg\cursors\iconMove_ca.paa";
iconRepairVehicle = "\A3\ui_f\data\igui\cfg\cursors\iconRepairVehicle_ca.paa";
[...]
grim coyote
#

So I was told something like this was required for arma 2 DB stuff.

private _positionasl = getPosASL _object;
private _position = getPosATL _object;
private _positionType = 1; 
if ((_positionasl select 2) < (_position select 2)) then {
    _position = _positionasl;
    _positionType = 0;
};```
Does anyone know if "problem" still exists, or can I just use ATL only?
(This is position that gets saved to DB)
(And yes, http://killzonekid.com/arma-scripting-tutorials-float-to-string-position-to-string/ is going to be used)
vague geode
#

@cosmic lichen You seem to know a lot about scripting so do you know a way to disable any fast travel to a warlords sector when it is contested, sort of like with BLUFOR Base and OPFOR Base which neither the attackers nor the defenders can fast travel to once it gets targeted?

cosmic lichen
#

No clue actually πŸ˜„ Might be possible if you dig through the warlords code, but that's probably a lot of work.

vague geode
#

@cosmic lichen Ok, thanks.

tough abyss
#

@vague geode in the warlords init module I think

#

I haven't looked at the mission file on my wl server inawhile so i might be wrong (lazy ik) but this is more of a #warlords_discussion topic

vague geode
#

@tough abyss I only know that you can disable all fast travel in the warlords init module but I only want to disable all fast travel to contested sectors but for the others fast travel should work like usual...

tough abyss
#

Look again im pretty sure you can disable to contested sectors independantly of seized

#

On one of my maps i have it disabled and no one can fast travel to contested but to seized they can

#

@vague geode

vague geode
#

@tough abyss There's only an option to prevent the attackers from fast traveling to a contested sector but I would like to disable it for the defenders as well so that they can't fast travel into a seized sector while it is targeted by the enemy...

tough abyss
#

Ohh i see what your saying thats a bit difficult

vague geode
#

@tough abyss What is currently happening and what I would like to prevent is that when you kill a defending player he/she will just reappear in the same sector 30 sec. later and will spawn on the groud which gives you no window of opportunity to attack him/her or prevent him/her from getting into the sector and hide there.

tough abyss
#

I see what you mean, that is difficult to script(impossible at least for me) IMO your best off looking at the warlords files and taking inspiration from there to achieve what you want to do with a script

vernal venture
#

Anyone know an easy way to automate changing a group from careless to aware after they take fire?

winter rose
#

make them "SAFE" instead, and ```sqf
waitUntil { sleep 1 ; behaviour _theGroup != "SAFE" };
_theGroup setBehaviour "AWARE";

vernal venture
#

Well, if they're on Safe, they'll switch out to combat automatically anyway when it starts.
The problem is a somewhat scripted event, I'm looking to keep them passive even when they see enemies, until they take fire.

winter rose
#

use maybe a "FiredNear" EH, but it only triggers as far as ~50m iirc

vernal venture
#

Hmm. DisableAI has an "autotarget" option. I wonder if that could be worked into what you suggested.

winter rose
#

you can't really know when there are bullets flying around them ("shot at" being very wide definition)
you could add a "Fired" EH to the attackers, for example

vernal venture
#

Yeah, that might be a better way to do it, from the other end.

grizzled lagoon
#

Hello, I start in the script and I don't know how to call DB information to output it on a dialog. Can you help me?

vagrant urchin
#

Hi, I'm trying to run a script in onPlayerRespawn.sqf

#

but it works only when spawning the first time and not when respawning after being killed

#

What am I doing wrong here?

grim coyote
#

Trying to return the offset of a object. Hovever vectoriDiff doesent get the real position.

B attachTo [A, [0,-3,3]];
offset = ((position A) vectorDiff (position B));
// offset = [-0.000732422,2.99976,-3.25736]

Does anyone know what "position" type, attachTo uses?

young current
#

modelspace

grim coyote
#
B attachTo [A, [0,-3,3]];
offset = (A modelToWorld [0,0,0] vectorDiff (B modelToWorld [0,0,0]));
// [-0.000732422,2.99976,-3.00016]```
#

This was the closest i could get

lean furnace
grim coyote
#

Ive tried now almost everything

young current
#

@lean furnace cant scale objects

#

@grim coyote I dont understand what you are oing there

#

why do you need the offset?

grim coyote
#

Do save it to DB

young current
#

but why

#

if you just attach it to [0,-3,-3]

#

it goes in to the same place

grim coyote
#

:/

#

I need to read the value from the object, then i need to save the value to DB. On restore I need to read the value FROM db, and then apply it

#

But I guess the only way for now is to create its own function and save it as a variable

young current
#

you could save the attachTo offset value to it when you use the attachTo command

grim coyote
#

yeah but the idea is that the server admins dont have to do that for their own system

young current
#

if you get A modeltoworld (getposWorldVisual B) what does that give you

#

or using the other modelToWorld commands

grim coyote
#

noope

#

no where near

swift yacht
#

Why can I skin a backpack and not a vest?

grim coyote
#

backpacks are "vehicles"

#

but selections should include vest

young current
#

vests and helmets are item types that cant be accessed with script commands

#

they require modded classes for new textures

bold kiln
#

I keep getting a Generic error in this expression

...
_vehicle setVariable ["tcw_laat_is_boosting",true,false];
_isBoosting=_vehicle getVariable["tcw_laat_is_boosting",false];    

while {{_isBoosting}} do...

I can post the rest if it might be caused by something else

cunning crown
#

why {{ ? Just while {_isBoosting} do... should work

still forum
#

and the above does not work

bold kiln
#

Can I get an example of something similar that should work?

still forum
#

was already posted above

bold kiln
#

ah I see. Well must be another issue. still getting a Generic error.

If (!Local (_vehicle)) ExitWith {};
    
_vehicle setVariable ["tcw_laat_is_boosting",true,false];
_isBoosting=_vehicle getVariable["tcw_laat_is_boosting",false];    

_fuel=fuel _vehicle;
if(_fuel<.05) exitWith {hint"gfuel";};
    
while {_isBoosting} do
{
  _vehicle setVelocityModelSpace [0,100,0];
    if ( fuel _vehicle > 0) then {
      _oldFuel = fuel _vehicle;
      _fuelDelta = (1 / _fueldrag) * (_throttleSetting * _fuelUsageMultiplier *_frametime);
      _vehicle setFuel (_oldFuel - _fuelDelta);
    };
  _vehicle setVariable["tcw_laat_is_boosting",true,false];
  hint "Activated impulse";
}
else
...
still forum
#

which line?

#

what exact error, its usually not only generic

#

check log

bright flume
#

this is a lovely example of a generic error... 18:47:32 unable to save config variable to: repeated over and over... πŸ™„ wish I could find that thing...

still forum
#

no its not

#

you are talking about something completely unrelated

bright flume
#

yes hence why I said example of a generic. wasnt being specific sorry for the misunderstanding there. script error that is just generic I was saying and logs dont help.

still forum
#

he meant literally "generic error" not "some generic error"

#

The log message "generic error"

bright flume
#

yeah I got that after you said 'unreleated'

bold kiln
#

I've been using the Extended Debug Console for this. Where can I find the logs? Same path as the Crash logs?

still forum
#

yes

bold kiln
#

ok yeah there was more than one

16:49:53 Error in expression <int"gfuel";};  while {_isBoosting} do { _vehicle setVelocityModelSpace >
16:49:53   Error position: <do { _vehicle setVelocityModelSpace >
16:49:53   Error do: Type Array, expected code
16:49:53 Error in expression <int"gfuel";};   while {_isBoosting} do {  _vehicle setVelocityModelSpace >
16:49:53   Error position: <do {  _vehicle setVelocityModelSpace >
16:49:53   Error Generic error in expression
still forum
#

do: Type Array, expected code
aha
you do {} else {} you can't do that on a while

sacred slate
#

is it possible to switch to next squad member on player death?

#

switch to next unit would suffice

cosmic imp
#

Hey everybody, been at this for hours on what seems super miniscule to my overall project. I'm trying to have an AI walk up to a guardhouse and have the door open so they can go in. I cant seem to get it to open using a trigger or the open/close module. Any suggestions?

ripe juniper
#

so i might be stupid but idk where to ask this.
I read somewhere (cant find it now) that in the dev build you can edit configs in game, is this true? and if so how is this accomplished

young current
#

Filepatching and diag exe from dev build

ripe juniper
#

ty

karmic flax
#

How does typical speed determine damage?

#

Is it just speed/typicalspeed = hit value?

young current
#

speed of what?

#

speed affects penetration

dark ocean
#

private _player = param [0];

private _iU = getItemCargo uniformContainer _player;
private _aU = getWeaponCargo uniformContainer _player;
private _mU = getMagazineCargo uniformContainer _player;
private _iV = getItemCargo vestContainer _player;
private _aV = getWeaponCargo vestContainer _player;
private _mV = getMagazineCargo vestContainer _player;
private _iM = getItemCargo backpackContainer _player;
private _aM = getWeaponCargo backpackContainer _player;
private _mM = getMagazineCargo backpackContainer _player;

_return = [_iU, _aU, _mU, _iV, _aV, _mV, _iM, _aM, _mM];
_return

#

this get items

#

_items = [player] call dev_fnc_itemsplayer;
{

} forEach _items;

karmic flax
#

Speed of the bullet, Im trying to calculate how much damage a bullet will do at a certain distance

bright flume
#

believe mass is involved...

karmic flax
#

Theres no mass property listed in the ammo configs

worthy willow
#

@dark ocean Do you get the items then remove it?

young current
#

theres hit, caliber and speed

bright flume
#

velocity[m/s] * caliber * penetrability / 1000. Penetrability is a material property (for RHA steel it is 15, for concrete 80, for meat 250). ? atleast for armor pen?

young current
#

and the object itself can have X amount of mass thats not listed anywhere

dark ocean
#

and once they are removed, the ctrlgroup cleans me and returns to get it clear, if you look the second time I double click if it updates but with one delay @worthy willow

dark ocean
#

fine found

ripe juniper
young current
#

all you need is the diag exe from dev

#

and unpacked data in your Arma 3\ folder

#

so what your P:\yourstuff\ becomes arma 3\yourstuff

#

and then you load diag exe with -filepathing and your mod

ripe juniper
#

OOOOOOO

#

ty

ripe juniper
#

do i have to restart arma each time i make an edit?

west grove
#

i'm trying to have an ai shoot the vorona missile launcher at a vehicle... but he always overshoots it. anyone has any ideas for how i can fix this?

#

i've set the ai to watch and to target the vehicle

#

he looks into the general direction, but he's not pointing the launcher directly at the vehicle, thus the missile will miss

cosmic lichen
#

@west grove BIS_fnc_EXP_camp_guidedProjectile πŸ˜„

west grove
#

problem is the player can see the ai shoot

#

so i can't just spawn a missile out of the air

cosmic lichen
#

I think this will worked fine with an fired EH

#

Delete the old missile and spawn the new one at muzzle position

#

That's how it's done in APEX campaign

west grove
#

meh. i still remember a time where all this fuzz wasn't necessary

cosmic lichen
#

It might be possible without, but it's certainly not reliable, otherwise they would have done it without function.

#

It would indeed be nice if you could just give the AI a target and they'd not behave like idiots

west grove
#

as far as i can tell, the issue is the same i have in my old mission - for some reason dotarget / dowatch doesn't work reliable anymore if the object is > x away

#

they will not point their guns at the target anymore, only in its direction. really makes me wonder what caused the change

cosmic lichen
#

Did you use reveal command?

west grove
#

yes, but it won't change a thing

cosmic lichen
#

and if you use a position instead of an object?

west grove
#

old thread now :p

#

spawning the red dot works for missiles that can track em, at least

#

sadly it doesnt work with the vorona

#

guess i will just spawn the missile. i've already spend more time on this than i originally wanted

#

ok, works.

#

so much stress for such a little detail

orchid sable
#

Hello, I am looking for a script that will check if playing as west and if yes it would allow them to play siren on any vehicle, would this be possible?

#

If yes can someone help me?

vagrant urchin
#

Hello, we're trying to make multiplayer units get insignia programmatically by their UID.
We have an array of UIDs and then we check if the player UID is in the array.

_usPlayers = ["21312321312313"]; 
if((getPlayerUID player) in _usPlayers) then 
{
    [player, ""] call BIS_fnc_setUnitInsignia;
    [player, "us"] call BIS_fnc_setUnitInsignia;
}; 

We first unassign and only then reassign the insignias because there's something weird with insignias where you can't assign the same insignia if it was already already assigned.
We run this code in onPlayerRespawn.sqf.

It works when first joining the server, however when respawning players can only see their own insignias.
If a player goes back to the lobby and reloads the mission, he'll see the insignias of those who respawned.
I hoped you'll be able to help me figure it out.

uncut hollow
#

Is it possible to set an ACE unit trait to a whole class of units? Like for example whenever a "B_Soldier_F" is on the server he'll be a medic.

still forum
#

Yes it is.

uncut hollow
#

@Dedmen so how? B_Soldier_F setVariable ["ace_medical_medicclass",1, true];? in what file would I put that?

still forum
#

You crossposted, I don't help crossposters. Just wait I'm sure someone will tell you soon.

uncut hollow
#

I'm new to this discord and deleted my message as soon as someone told me? Kinda rude for no reason.

still forum
uncut hollow
#

Funny it doesn't mention crossposting

still forum
polar anchor
#

how can i disable channels? i tried to put this disableChannels[] = {0, 1, 2, 6}; into description.ext but its not working.

winter rose
#

@polar anchor it does, but there is a bug where it doesn't apply to JIP players

still forum
#

ticket, someday

winter rose
#

@polar anchor you ok with this?

polar anchor
#

@winter rose not really, i started yesterday learning how to script and im not sure where everything goes. i put 0 enableChannel false; 1 enableChannel false; 2 enableChannel false;
into my init.sqf, disableChannels[] = {0, 1, 2}; into description.ext and the side and side and command channels are gone, but global channel its still there

winter rose
#

try maybe (in init.sqf)

[] spawn {
  sleep 0.1;
  { _x enableChannel [false, false] } forEach [0,1,2];
};
#

else, I don't know another solution.

polar anchor
#

should i remove disableChannels from description.ext?

winter rose
#

also note:

If the user is admin, global channel is fully enabled, regardless of this command.

polar anchor
#

oof .. so i think thats the reason

winter rose
#

should i remove disableChannels from description.ext?
you could, but it doesn't matter - I would keep them

#

yes the admin has to talk to everyone…
so he has to play along πŸ˜‰

polar anchor
#

thank you @winter rose πŸ™‚

winter rose
#

you're welcome! GL

restive leaf
#

Can you use manual scripted enableChannel in initPlayerLocal to get around the JIP failing?

winter rose
#

yep

bold kiln
#
13:26:53 Error in expression <speed), (_vel select 2)   ];  };  sleep 0.5; }; >
13:26:53   Error position: <sleep 0.5; }; >
13:26:53   Error Generic error in expression
```What does this mean by suspension. I've assumed it's the sleep for 0.5 seconds, but any way to get around it?
still forum
#

sleeping is suspending

#

you cannot sleep in some types of scripts

#

put a spawn around it, generally is the solution

bold kiln
#

The sqf is being spawned by a UserAction class. Is there a different way to spawn this?

still forum
#

as I said above

#

or as lou already demonstrated in the last properly colored sqf snippet here

potent depot
#

Anyone able to shed some light on the cause of this? It appears to not see the string as a string?
Error:


if (!(_color isEqualTo [])) then { 
drawIcon3D [
"\a3\ui_f\data\map\vehiclei>
14:23:47   Error position: <drawIcon3D [
"\a3\ui_f\data\map\vehiclei>
14:23:47   Error Type Any, expected String```

Relevant Code Block:
```sqf
if (!(_color isEqualTo [])) then { //Not a player group so draw
                drawIcon3D [
                    "\a3\ui_f\data\map\vehicleicons\iconvirtual_ca.paa",
                    _color,
                    [(getPos _leader select 0), (getPos _leader select 1), (getPos _leader select 2) + 2],
                    1,
                    1,
                    0,
                    _text,
                    0.5,
                    0.02,
                    "EtelkaNarrowMediumPro",
                    "center",
                    false
                ];
            } else {
still forum
#

not relevant code block

#

show code before relevant code block

#

_text is probably undefined

potent depot
#
_leader = leader _x;
            _color = [];
            _name = "";
            _name = (_x getVariable [QGVAR(OwningClient), "None"]);

            if (typeName _name == "STRING") then {
                if (_name == "Server") then {//server
                    _color = [COLOR_SERVER, ICON_TRANSPARENCY];
                    _text = "On Server";
                };

                if (_color isEqualTo [] && _name == "None") then {//none
                    _color = [COLOR_UNTRANSFERRED, ICON_TRANSPARENCY];
                    _text = "Untransferred";
                };
            } else {
                if (_color isEqualTo [] && str _name == (str player)) then {//local
                    _color = [COLOR_LOCAL, ICON_TRANSPARENCY];
                    _text = "Local";
                };

                if (_color isEqualTo [] && _name in GVAR(HeadlessArray)) then {//HC
                    _color = [COLOR_HEADLESS, ICON_TRANSPARENCY];
                    _text = "On: " + str _name;
                };

                if (_color isEqualTo [] && _name in GVAR(ZeusArray)) then {//Zeus
                    _color = [COLOR_ZEUS, ICON_TRANSPARENCY];
                    _text = "On: " + name _name;
                };
            };
still forum
#

your leader getpos stuff should be a simple vectorAdd

#

yep. _text is undefined

#

your typename thing there has been replaced by isEqualType

potent depot
#

how is _text not defined? If _color is filled, _text should be also

still forum
#

_text variable goes out of scope

potent depot
#

ah yep

#

and im assuming it will be a getPos _leader vectorAdd [0,0,2]?

#

TY

potent depot
#

Additional Question. If I have a remoteExec on a list of clients all of which need to put there data in the same array. What would be a good way to make sure there is a delay between them so as prevent the overwrite of data on top of each other?

winter rose
#

…?

#

I am going to go out on a limb here and say publicVariable?

potent depot
#

Im trying to use publicVariableClient and publicVariableServer. But even with publicVariable, if they are all executed at the same time, some data will be overwritten by other clients broadcasting.

winter rose
#

just broadcast from the server?

#

@potent depot what are you trying to do? it will be faster

potent depot
#

HC system. HCs need to report their local unit counts

#

currently using publicVariableClient and publicVariableServer to send data firectly between the two as clients dont need it.

#

and using remoteExec

#

And I wish to store the local unit counts in a singular array

bright flume
#

wouldnt it just be simpler to actually count the units when that info is needed by what needs it only instead of relying on something stored that might be not even accurate?

winter rose
#

^

potent depot
#

Thats what im trying to do?

winter rose
#
count (allUnits select { owner _x == _HCid });
potent depot
#

That works

winter rose
#

should Β―_(ツ)_/Β―

potent depot
#

Yeah it should

#

Thanks

#

fortunately, I already have an array of HC units and client IDs for this purpose

tender fossil
#

@still forum Do you have an example database implemented with Intercept?

bright flume
tough abyss
#

Ight so

#

I got a question, how do you spawn weapons inside a crate in game via the debug console?

#

Particularly the M76 from one of the RHS modpacks

bright flume
tough abyss
#

Thanks. Would you happen to have some sort of list of all the names of RHS items or something along the lines of that?

bright flume
#

all that would be in your config viewer

tough abyss
#

Waaaaaaa this is so cool

#

Hmmm, so the process of doing it in this situation, sorry for being an absolute noob but how would you go about doing it?

#

I will dm you a picture

queen cargo
#

@tender fossil there is the DB plugin for intercept ( https://forums.bohemia.net/forums/topic/222595-intercept-database-sql-database-extension/ )
Just Look in #arma3_tools

mint sand
#

Hello, i keep getting this error on antistasi, and it is messing up the zone placement. I have been going through and fixing things in it for my takistan port of it, and this does not make sense why it is getting this error.

The code that is throwing the error is this

lados setVariable [_mrk,malos,true];
And malos = west

#

and it is saying the error is that there is a reserved variable in the expression setVariable

bold kiln
#

So I have a script and it runs fine in the debug console. but within the user class (that shows up on the custom vehicle), it doesn't seem to want to work. nothing happens
Any idea why?

still forum
#

@tender fossil its just SQL code. No I don't

winter rose
#

@bold kiln yes: something must be wrong

#

@mint sand use another name

reef grove
#

Can I make it so people won't swim and instead walk on the sea floor?

winter rose
#

@sharp stirrup Star Wars?

#

@sharp stirrup unfortunately these mods are illegal so supporting or even mentioning them will not be seen kindly here, on the official Discord.

#

@reef grove not that I know of… maybe a heavy anim and pos override but nothing I heard that already exists

reef grove
#

damn

#

@winter rose do you have any suggestions of where I can start? I'm sure theres gotta be some way to do it

winter rose
#

@sharp stirrup ANY Star Wars mod is illegal, actually

#

Intellectual Property issue - see #ip_rights_violations for more details.

@reef grove see setPosATL for "sticking" to the ground… and switchMove ? to force the anim

#

then IDK; do you mind if I ask a mod here?

still forum
#

@sharp stirrup star wars is illegal, not just SWOP.

winter rose
#

Disney cares

still forum
#

who cares? It violates disneys copyright.

#

and said Legion base was fine.
Hah. Certainly not.

winter rose
#

therefore, it's legal!

still forum
#

Why are the police not preventing serial killers from killing people hm? Serial killers being a thing must mean its legal

winter rose
#

-_-

still forum
#

As you were told, any star wars mods are illegal and their discussion is not permitted here

winter rose
#

sorry for respecting IP and the #rules dude

#

setPos/getPos should help

#

yep, looks like a teleport issue

#

VCΒ ?

#

oh! no sorry, I'm working rn (and also usually only do text support)

#

As you were told, any star wars mods are illegal and their discussion is not permitted here
again, any Star Wars mod is illegal because Disney is a PITA about IP. I am not happy about it, but again that's how they roll.

#

and you're welcome here for Arma scripting.

#

Β―_(ツ)_/Β―

#

(though he gone)

bright flume
#

are they ever really?

still forum
#

!purgeban @sharp stirrup 90d IP rights violations, trying to deceive people and telling them wrong facts about IP rights

lyric schoonerBOT
#

*fires them railguns at @sharp stirrup* Γ’_Γ“

bright flume
#

stares and blinks after waking up more and scrolling back

#

btw anyone know how to find the right angle intersection of a point if extended to a known ray/line/plane?

still forum
#

That's just a math question right? I know there is a math answer to that.. somewhere

bright flume
#

Ive searched I was hoping someone in coding/scripting might know it off hand. it is kinda a difficult topic alone for that. if it was 2 points yeah but only one and knowing its perpendicular to the target at the intersection is where Im getting totally stumped

reef grove
#

Anyone know how I might be able to disable fall damage?

winter rose
#

unit allowDamage false

reef grove
#

I want to disable fall damage not all damage

#

Does that stop bullets from hurting?

winter rose
#

yep

#

you would then have to deal with the HandleDamage EH, which is a mess

reef grove
#

Okay

#

Luckily though I got the player to walk on the sea floor

mint sand
#

@winter rose why would malos be restricted?

winter rose
#

@mint sand what is the value of _mrk?

lados setVariable [_mrk, malos, true];
#

@mint sand?

latent epoch
#

How would i make a decon shower activate with [this, 4, 3, 1] call BIN_fnc_deconShowerAnim;(spray) on trigger actvation and turn off again on trigger deactivation

worn forge
#

Destiny are you in the Contact environment? The BIN functions will only work (assuming they're fully working, some aren't) if you're running the Contact DLC

still forum
#

some of them are in enoch

latent epoch
#

[this, 4, 3, 1] call BIN_fnc_deconShowerAnim; is working in the init of the shower but thats constant my issue is how to sync an activation and deactivation trigger to it so its only running when an entity is close

still forum
#

put the decon shower into a variable

#

use that var instead of this

#

the use trigger onActivation/onDeactivation

latent epoch
#

that seems to work when it comes to activate it but not deactivation

mint sand
#

_mrk is a marker @winter rose

still forum
#

didn't answer the question I think.
He asked about value not type

#

Yeah, I read up on your issue. What is the value inside _mrk

mint sand
#

Hmm, one second I’ll go look

winter rose
#

@mint sand any update? ^^

mint sand
#

here we go

#

_mrk = createmarker [format ["%1", _nombre], _pos]; _mrk setMarkerSize [_size, _size]; _mrk setMarkerShape "RECTANGLE"; _mrk setMarkerBrush "SOLID"; _mrk setMarkerColor colorMalos; _mrk setMarkerText _nombre; _mrk setMarkerAlpha 0; ciudades pushBack _nombre; spawner setVariable [_nombre,2,true]; _dmrk = createMarker [format ["Dum%1",_nombre], _pos]; _dmrk setMarkerShape "ICON"; _dmrk setMarkerType "loc_Ruin"; _dmrk setMarkerColor colorMalos; if (_nroads < _numVeh) then {_numVeh = _nroads}; lados setVariable [_mrk,west,true];

#

and the error comes from the end at lados setVariable blah bblah

still forum
#

can you hint/systemChat/diag_log the marker name to make sure it actually contains something valid?

mint sand
#

and basically what this script does, is it spawns a patrol to go investigate when you attack bluor forces

#

is that in the arma 3 directory?

still forum
#

diag_log would go into RPT

mint sand
#

im sorry, what would the file directory be for that?

cosmic lichen
#

C:\Users\YOURNAME\AppData\Local\Arma 3

winter rose
#

what is _nombre value yes?

mint sand
#

_nombre = [text _x, true] call A3A_fnc_fn_location;

#

i am trying to find what you said @still forum but i do not see any file called diag_log

winter rose
#

value plz

mint sand
#

there is no cache for this, as i have been running it in the editor, so there it did not save a log file for that mission

#

i am trying to find the value of the _x there

signal kite
#

In 3DEN trigger areas are visible in 3D.
Is there any way to create this effect ingame by script?

winter rose
#

systemChat _mrk should do

mint sand
#

So _x is chosen from spawnPoint with a number from 1-10 after, or aeroporto with a number, or airSpawn with a number

winter rose
#

@mint sand you cannot setVariable [aNumberAsString, value]

mint sand
#

So if you remove all the variable names and just ise their values, the code should be

Lados setVariable [[spawnPoint1,rest of marker data],west,true]

#

I’m not sure

winter rose
mint sand
#

The variable being setVariabled is not a number as string though

still forum
#

"155" is actually valid.

winter rose
#

wait, wha'?

#

@mint sand if it equals a command name it won't work (should not work?) anyway

still forum
#

I assume its empty string

winter rose
#

I am surprised about the "155" being valid though.
I did check "_var" and it worked hehe

mint sand
#

I will run it in mp so it saves a log in mpmissioncache and investigate the diag_log logs

winter rose
#

ooor use systemChat format ["_mkr = %1", _mkr] ?

mint sand
#

What would that do? As far as i understand, _mkr in this goes through a ton of different values as it creates all the zones

winter rose
#

so rpt it is

still forum
#

RPT has nothing to do with MP or mpmission cache

faint oasis
#

anyone have an idea for how to remove the dead body in a vehicle ? because when i delete the dead body i see always the dead body in the vehicle

winter rose
mint sand
#

Right, but before i was running it in the editor and it would not save the file that has the file with diag_log. But all the mp missions save a file that has diag_log

#

Will get back soon with it

bright flume
#

can someone explain the difference between pushback and append?

jade abyss
#

pushback returns index, at wich the entry was added in
append returns nothing

#

Also check the Examples. append adds the entrys of an array to the existing array, while pushback would add the whole array to the existing one

bright flume
#

yeah append adds a element regardless what the element is why I didnt grasp why there a difference unless its just an arma thing.

jade abyss
#

nono

#

append needs an array

#

pushback can add anything

#

array pushBack element
array1 append array2

bright flume
#

I got the page up I didnt see exactly the difference other then one supporting appending lists and append didnt mention why I asked.

#

so append 4 strings only, pushback is for appending arrays. got it.

jade abyss
#

wat?

bright flume
#

append in my world dont matter what the element is, appending is appending. list string matrix or otherwise.. python for example.

cunning crown
#

append combines 2 array together, pushBack pushes the add the elements to the array.

bright flume
#

yeah I got it append here only supports adding the whole array at the end of an array, pushback allows an array appending into another array as a new element (ie subnested).

cunning crown
#

yes

bright flume
#

yeah I didnt see nothing stating append was only for that why I asked cuz there def other languages this dont apply. ^_^ thanks everyone.

jade abyss
#

@bright flume Just forget/ignore everything from other languages πŸ˜„

bright flume
#

yeah... thats the hard part. πŸ˜…

devout brook
#

Running into a problem with my respawn portion of description.ext:
I am using respawn = 3; and have the marker down named respawn_west. I am also using respawnTemplates[] = {"MenuInventory", "MenuPosition"}; When I respawn (either via death or via menu) , the death animation plays, and the inventory/location select UI shows up. After the timer, I can click the respawn button. When I do that, a random unit from the group the player was in becomes the focus in spectator mode and a message appears saying "Respawn in progress" but then nothing happens. Any ideas?

bright flume
#

did you set it for custom respawn point

winter rose
#

I am not sure, but I think the respawn_west marker is not automatically added to the menu's respawn position.

devout brook
#

@bright flume I did, and there was no change.

@winter rose Interesting. The marker does show up in the menu but I’m not sure I have this function anywhere. I’ll have to look.

ebon ridge
#

What are the full set of requirements for making a mission persistent? Specifically the requirements for the mission.sqm and sqf if there are any. We got reports that our mission is ending as soon as the last player leaves, even though autoinit and persistent are being used.

harsh vine
#
//Hey im Trying to REMOVE individual respawn position for each units. 
//for example...
//if theres an enemy within 50m of the player then remove respawn position and add back repawn position once enemies are out of range  ...

//[west,_this select 0] call BIS_fnc_addRespawnPosition; // this adds respawn position for all units.I think.

//This is a WORKING example:

myRespawn = [west, HQ, "Mobile HQ"] call BIS_fnc_addRespawnPosition; //car i placed on the map 

new = {
myRespawn = [west, HQ, "Mobile HQ"] call BIS_fnc_addRespawnPosition; // this is the line i use to add back the respawn position on the car.
};

Check_Trigger = createTrigger ["EmptyDetector", position player, FALSE];
Check_Trigger attachTo [player, [0, 0, 0]];
Check_Trigger setTriggerArea [50, 50, 0, FALSE];
Check_Trigger setTriggerActivation ["ANY", "PRESENT", TRUE];
Check_Trigger setTriggerStatements [
    "{(side group _x) != side group player && (side group _x) in [EAST, WEST, RESISTANCE]} count thisList > 0",//this line checks if  enemies are in trigger range.
    "hint 'respawn disable',myRespawn call BIS_fnc_removeRespawnPosition;", // this line removes the respawn position on the car when enemies are within trigger range.
    "hint 'respawn enable ready to spawn ', call new;"// this line adds back the respawn  position on the car once enemies are out of trigger range. 
];```
#

i tried organizing but discord dont seem to like that ☹️

winter rose
#

organizing
?

#

@harsh vine is it on a dedicated server? where is the code executed

harsh vine
#

initserver,sqf

winter rose
#

dedi ?

#

player is null on a dedicated server

#

you could also simplify with ```sqf
MAR_createHQRespawn = { [west, HQ, "Mobile HQ"] call BIS_fnc_addRespawnPosition; };

MAR_respawnPoint = call MAR_createHQRespawn;

harsh vine
#

oh sorry ...its nondedicated

winter rose
#

do the hints work?

distant egret
#

Is there an way of using getMissionConfigValue with config paths? ("class">>"subclass">>"value")
Or another way of knowing what type the config entry is with for example typeName.
typeName and then config path just shows "CONFIG" which is correct πŸ˜› But I want to know what the entry of that config is. (Array, String, Number)

still forum
#

just try

#

isArray, isNumber, isString

#

there is no configType command

distant egret
#

isText*, but works like an charm thx!

distant oyster
harsh vine
#

@winter rose Yes, everything works in the script above ...i sent that as an example

still forum
#

Still no configType command

#

a script function that does isArray, isNumber, isText like I wrote above yes.

burnt cobalt
#

hi guys - i am having issues selecting multiple entries of a CT_Tree with tvSetCurSel - what's the procedure here? I am trying to open the tree with certain rows having the highlighted/selected color

#

I can only manage to select one entry - but not multiples

distant oyster
#

afaik CT_TREE does not support multiple selections

#

@burnt cobalt

#

WAIT IT DOES

burnt cobalt
#

multiselectEnabled = 1; is what i'm using πŸ˜‰

distant oyster
burnt cobalt
#

wait I might have a general misundrstanding here

#

ah nevermind - i was hoping the difference between say lbSetCurSel and lbSetSelected would hold a clue

#

The CT_Tree has two different shades of 'selected-color' - there's the full orange that corresponds with tvCurSel - but then there's also a less bright shade of orange for the 'other' selected entries - those are the ones I'd like to autp-select when opening the interface

tough abyss
#
//---Target  hostage

_x = bis_target
 {   
    waituntil {player distance _x  < 5 };  then
 
 player addAction [
    "Hands Up",     
     {    if (side _x == east) then 
    
         
         { _x switchMove "Acts_ExecutionVictim_Loop";
        
        };    
        };
    }forEach allUnits;
];````
still forum
#

```sqf
Code
```

#

Syntax Error at then

#

Just remove the then

tough abyss
#

I had found it in the pinned message, but thanks! Thats all or is there more wrong?

distant oyster
#

Dont use _x as a variable. It will only get overwritten by the magic variable

#

Well there is acutally quite a lot more wrong with the script. Give me a minute

burnt cobalt
distant oyster
#

@tough abyss ```sqf
//_x = bis_target
{
_x addAction [
"Hands Up",
{
params ["_target", "_caller", "_actionId", "_arguments"];
if (side _target == east) then
{
_target switchMove "Acts_ExecutionVictim_Loop";
};
},
[],
1.5,
true,
true,
"",
"alive _target && alive _this",
5
];
} forEach (allUnits select {side _x == east});

tough abyss
#

@distant oyster Thanks!

distant oyster
#

@burnt cobalt It seems that there is no command for that :(

karmic flax
#

What impact does supression have on Ai's abiliity to aim? I cant seem to find what effect it has on AI

#

I know supression is a value between 0 and 1 but I cant seem to find how that value affects ai

burnt cobalt
#

@distant oyster seems so, kinda unexpected - thanks though, I appreciate the help!

ebon ridge
#

Why does a group sometimes have an extra waypoint and sometimes not? I know that all groups have to have 1 waypoint minimum, but surely if I add an explicit waypoint then that extra one should be consistently removed. Yet it sometimes seems to remain such that the first real waypoint is waypoint 2 instead of one.

#

This is messing with my ability to determine what the real current waypoint target position is

devout brook
#

Does BIS_fnc_addRespawnPosition need to be called in Description.ext?

winter rose
#

you… can't call anything in Description.ext?

devout brook
#

Sorry, confused myself.

#

You linked that function to me but I'm not sure if I need to call it since my respawn point already appears in the respawn UI.

winter rose
#

and you can click, etc it's interactable?

devout brook
#

Yeah everything works as expected until the player actually presses the respawn button. Then the UI goes away like normal, but then the player enters spectate mode on a random group member and nothing happens.

#

and a message is displayed saying "Respawn in progress"

winter rose
#

then IDK; try using only a "normal" added respawn point, not respawn_west maybe?

#

either that, or your respawn template combination is not valid and "interfere", but I am absolutely not knowing about what I am talking about here πŸ˜…

devout brook
#

😦 This same script worked in another mission I wrote it for, I'm not sure what step I've missed

winter rose
#

indeed, the issue lies in the (config, most likely) difference between these two missions

devout brook
#

Anything obvious I should check first?

winter rose
#

Description.ext:

respawn = 3;
respawnTemplates[] = {"MenuInventory", "MenuPosition"}

marker "respawn_west"…
hmm, respawnDelay maybe? or Eden attributes, too

devout brook
#

Yeah they're all the same:

respawn = 3;
respawnButton = 1;
respawnDelay = 15;
respawnDialog = 0;
respawnOnStart = 0;
#

It's the Description.ext itself that I am re-using

slim oyster
#

Can you can change compileFinal in another addon? Addon with dependency from addon that defines something with compileFinal, you can redefine that in subsequent addon with another compileFinal?

#

hmm

#

or setting up a compileFinal before the original addon's compile

exotic flax
#

In both cases it will return an error when it tries to compile while something is already compiled as final.

#

I guess the only way to hook into existing functions is when it supports events you can hook into.

slim oyster
#

alright so to redefine a function I am looking at using compileFinal to define it as my function before the original addon's load

#

but how to determine load order

#

It uses the CBA compilefinal functions, which load it in the ui namespace