#arma3_scripting

1 messages · Page 583 of 1

smoky verge
winter rose
#

as for the first question I would say "why not", but better to confirm with experts there yes

smoky verge
#

I'll delete the question here

merry glen
#

Hey guys I'm in need of some scripting help... I set a scenario where the player can be "disguised" when mounting enemy vehicles

#

I found something that works for that

#

but I don't want the player to be able to do that when enemies are around

#

and I can't find something that accomplishes this

queen cargo
#

@loud python long Story short: Code is no lambda but only some data type
Scoping is pretty much, if the local scope of a Variable leaves, the variable disappears

loud python
#

sooo... dynamic scoping?

merry glen
#

knowsAbout has memory throughout the mission and doesn't work with the setting, nearestEnemy only provide grid position and and nearTargets can have a null component

queen cargo
loud python
#

targetKnowledge

#

@merry glen

#

that returns the last time the target was seen by the unit

merry glen
#

so something like side targetKnowledge player

loud python
#

@queen cargo can't read that article right now, but damn that seems interesting :)
Thanks for posting!

merry glen
#

ok thanks I'll try that

loud python
#

it takes a single unit as first argument though

#

so I guess you have to combine that with some other stuff

merry glen
#

there's a targetsAggregate but I'm not sure I understand what it's for exactly

queen cargo
#

Yeah... Dynamic scoping pretty much

ebon ridge
#

It appears that
nearestObjects [_posWorld, [_type], 0.25, true]
doesn't return the same list of objects as
nearestObjects [_posWorld, [], 0.25, true] select { typeOf _x == _type }
This appears to be the case if the objects are simple objects, but why isn't really obvious, and the documentation doesn't mention it.

still forum
#

what does not the same mean?

#

hows it different?

#

actually

#

yeah obviously it doesn't

#

because your select does a different thing

#

your select variant returns fewer objects

#

because you check if the type equals what you want, thats not what nearestObjects is doing

ebon ridge
#

no, the first one returns 0 objects, the second one returns the correct set in the case i am testing

#

sorry I didn't explain clearly

still forum
#

huh

#

it sohuld be doing isKindOf

#

not a typeOf check

ebon ridge
#

yeah

#

but x isKindOf x == true right?

still forum
#

I think so

ebon ridge
#

so in my case i placed picnic tables, the ones marked simple object doesn't appear in the first call, only the second one

still forum
#

simple objects don't have a classname

#

they are just spawned as the model

ebon ridge
#

they appear in the second call

still forum
#

Think nearestObjects just shouldn't return the simple objects

#

send me the link to the FT ticket I'll take a look next week

ebon ridge
#

well for me its ideal that they do

#

so i don't want that "fix" 😄

wraith cloud
#

Same ^ pls don't fix :c

daring pawn
#

Using CBA or Vanilla functions, is there a way to add an eventhandler for when CursorObject changes?

Or is there an efficient way rather than just a CBA PerFrame handler? I don't want to be unnecesserillaly checking something so regularly

fleet bear
#

is there any way for a client (admin) get the list of scripts (via diag_activeSQFScripts) on dedicated server?

dim owl
#

Hey guys, has anyone experienced a wrong value for ctrlTextHeight? I am just confused because my structured text height is too high

astral dawn
#

@daring pawn if there was a cba event handler for this (maybe it exists, I didn't check) it would have been implemented in the same way

grim wing
#

is there a way to make all placed objects in the editor have no damage instead of going into each object and setting it to disable damage

spring lodge
#

select them all and check disable damage?

smoky verge
#

can I post youtube links regarding my problem?

spiral fractal
#

to set vehicle color I must use setObjectTexture?

#

the color that can be set in appearance menu

smoky verge
#

uhm
you said it yourself
to set a vehicle color you need to use the appearance menu

spiral fractal
#

in code

#

setObjectTexture has [0 - n, ...] I dont want to set all this, I want to set the color itself

smoky verge
#

alright so
what setObjectTexture does is let you apply a texture onto an hiddenselection if an object doesn't have an hiddenselection you can't retexture it

#

what do you mean exactly by color?

spiral fractal
#

I just checked all the available textures and used switch...

smoky verge
#

I don't follow sorry?
what are you trying to do and what do you need?

winter rose
#

for? forEach?

winter rose
#

@spiral fractal

simple moat
#

Good day, I am new here and in Arma 3 Scripting. I would like to ask help in regards to the MP mission I am trying to make.

I am trying to add a custom loadout for a medevac vehicle's cargo, by putting this addItemCargoGlobal ["ACE_fieldDressing", 50]; on the init field of the vehicle.

Also I put this setvariable ["CS_TYPE","CAS"]; in the init field of some of the vehicles I placed to include it as the ALiVE Combat Support, and since I am using VCOM AI I also added this setVariable ["NOAI",1,false]; into the units init fields of the combat support, following the ALiVE's FAQ. (http://alivemod.com/wiki/index.php/FAQ)

Every time I run my MP Mission, it loads initially and then loads a 2nd time, I'm not exactly sure why, but it respawns these vehicles and cancel out the scripts I've put in them, rendering all of it useless.

Here's a 5 min. video I recorded to show what I am trying to say. https://youtu.be/3nxOfavKnBY

I've been trying to figure this one out myself by trying to execute the scripts at a delayed time but with my skills, I don't think I have the capability to do it. I feel like I've reached a dead end.

I'm sorry for a long post, I just wanted it to be detailed and clear. But thanks in advance if someone manages to help me.

Edit: I have ACE, ALiVE, MCC, RHS, VCOM AI(Script).

surreal peak
#

@simple moat dont do ".." for showing code, look at pinned message. need to structure it using `

#

makes it much easier to read

simple moat
#

@simple moat dont do ".." for showing code, look at pinned message. need to structure it using `
@surreal peak My bad, I didn't know how to do it.

surreal peak
#

np, you dont need to repost it, you can just edit your current post to update it

simple moat
#

np, you dont need to repost it, you can just edit your current post to update it
@surreal peak Will do. Thank you. 🙂

round scroll
#

@simple moat what does it loads initially and then loads a 2nd time exactly mean? Do you start the mission twice or do you start the mission, it stops and restarts?

simple moat
#

@simple moat what does it loads initially and then loads a 2nd time exactly mean? Do you start the mission twice or do you start the mission, it stops and restarts?
@round scroll As seen on the video, I get into the lobby > briefing (map) pressed continue > loads into the game, then couple of seconds later another loading screen pops up and loads something and once finished it respawns the vehicles in some way and all the scripts no longer work as if the vehicles are back at its default state w/o the scripts.

round scroll
#

@simple moat looks quite weird, can you run the mission without alive and also in another test without vcom to rule out that one of those mods respawn the vehicles?

simple moat
#

@round scroll I did, I tried it by putting the modules one by one and a version without the VCOM AI, it actually worked but I think what causes this is the AI modules of ALiVE which I need.

In my assumption, the 2nd loading screen initializes all the scripts coming from the loaded modules, ALiVE in particular to recognize the objective placements such as towns and military bases and to start spawning AI. That's my guess, so I think I definitely need that to occur, only thing I need now is to either have a script stopping the vehicle to respawn or have the scripts in the vehicles to execute at a latter time, prolly after the 2nd load.

round scroll
#

if it's Alive, then your best bet is to check out alive.com website and their wiki for a solution

simple moat
#

if it's Alive, then your best bet is to check out alive.com website and their wiki for a solution
@round scroll I'll give this a go. Thanks.

vague geode
#

Is it possible to use modified Arma functions in a custom mission without forcing all players to download/install anything before playing the mission?

simple moat
#

Good day, I am new here and in Arma 3 Scripting. I would like to ask help in regards to the MP mission I am trying to make.

@simple moat I have found the culprit that is making my problem. I found out that the ALiVE Virtual AI system profiling is doing it, so I switched it off and everything is now working.

Thank you for all the suggestion and help.

thorn saffron
#

I gave a string "64 + 128" and I want to turn it into a number that I can feed into the bitflag function. However since it's a string I cannot do that.
How can I get what number is in there? It can be individual numbers or the sum, either is fine.
I tried the call compile but I don't quite get how to use the resulting code

#

derp, I forgot to actually put in the call before the compile, call compile "64 + 128" returns the proper sum

proud carbon
#

Hey! for scripting with ace, is there a list for all the commands and scripts ace has?

winter rose
#

ACE doesn't add any command, only functions.

urban tiger
#

anyone know a way to get userTexture to be flat on the ground and NO 'setvector' doesn't work

round scroll
#

The Nimitz sports a populate carrier script, which places F/A-18E/F aircraft or other planes on the Nimitz at parking positions. For the F/A-18E/F I check the classname (JS_JC_FA18E and F) to set specifics textures for different carrier names (E.g. Nimitz has different squadrons than Roosevelt than Reagan and so forth). Now the beta of the F/A-18E/F sports different textures and I'm wonder if there's a smart way to support both versions. Probably checking for the contrib squads in CfgPatches (JS_JC_FA18_CONTRIB_SQUADS2019 and such) ?

spiral fractal
#

How can I override function from mod?

winter rose
#

no can do

spiral fractal
#

?

winter rose
#

you cannot

spiral fractal
#

why?

winter rose
#

safety reasons

spiral fractal
#

can I disable it then?

winter rose
#

nope

spiral fractal
#

what is that??

winter rose
#

nope = no

spiral fractal
#

I mean why its blocked, where is Duda?

winter rose
#

who is Duda?

spiral fractal
#

Duda is the creator of advanced sling load mod

urban tiger
#

More of a question if its a function you don't want just // it out in the files? lol

winter rose
#

I mean why its blocked

safety reasons

spiral fractal
#

if BE is off, its still impossible?

winter rose
#

yup

#

if you don't want a mod, don't use it - that's all there is about that

spiral fractal
#

server has it and I am not an admin...

winter rose
#

¯_(ツ)_/¯

surreal peak
#

@spiral fractal so you are not the adminn of a server and you want to disable a server side mod?

winter rose
#

…see how it could be a security issue?

surreal peak
#

why are you trying to do this

#

may be another solution

spiral fractal
#

Advanced sling load mod cant lift wrecks, I made some changes to allow lifting wrecks

surreal peak
#

did you edit the config or make a script for it?

spiral fractal
#

I paste the edited function to debug console and it "override" it

surreal peak
#

do you have achillies?

#

if you are zeusing you can use execute code module

spiral fractal
#

I want to make it work without additional actions

winter rose
#

look:

  • the server you don't own nor manage uses a mod of which you are not the author
  • you are trying to override a server-side mod behaviour

simply, drop it - if you want to edit the mod, ask the mod author
if there are certain settings that need server administration, ask the server owner

all the rest is copyright infringement or hacking

surreal peak
#

What Lou said, the solution I gave is a bit of a grey area, and does require achilies to work. Also requires you to be zeus

spiral fractal
winter rose
#

I get it - it's frustrating
that doesn't make it more valid

surreal peak
#

and if you somehow manage to find a way to execute code without being admin/ server owner. BIS would be very interested

spiral fractal
#

I thought that because the mission executed by the server it will have more "rights" to execute code

winter rose
#

it is not doable - let's close the topic now.

urban tiger
#

@spiral fractal simple question here.. are you trying to change a function for your OWN server or a 'server' you play on..

Advance sling license agreement is

The MIT License (MIT)

Copyright (c) 2016 Seth Duda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

spiral fractal
#

what I understood from it is that I can modify it

winter rose
#

let's close the topic now.
@urban tiger

@spiral fractal edit the script as the license allows you to (so INCLUDING CREDITS), and run your own server with it.

urban tiger
#

@winter rose My apologizes my post was 5 seconds after.

oblique arrow
#

BIS would be very interested
I dont think BIS would be that interested, but BI propably would be heh @surreal peak

surreal peak
#

thought BIS stood for Bohemia Interactive Studio

#

What does the S standfor?

oblique arrow
#

Nop, BIS is BISim

surreal peak
#

ahhh

oblique arrow
#

as in Bohemia Interactive Simulations, a now seperate and autonomous studio

winter rose
#

BI was BIS
BIS was BIA

oblique arrow
#

they make stuff like VBS

winter rose
#

BIS → BI (Bohemia Interactive)
BIA → BIS (aka BISim)

surreal peak
#

so why are the functions still BIS_? Is it just cause they dont want to change all of them

oblique arrow
#

ConfusedDog Havent heard BIA mentioned before

winter rose
#

backward compatibility @surreal peak

#

@oblique arrow Bohemia Interactive Australia

oblique arrow
#

Ah okay

surreal peak
#

they have a place in Australia? Never realised that

oblique arrow
#

They had, thats BIS now

winter rose
oblique arrow
#

Also yeah if you changed all the BIS functions to BI functions you'd break lots of scripts that arent being worked on anymore

winter rose
#

now we even have BIN_ prefix (BI Netherlands I assume), "thanks" to Contact…

oblique arrow
winter rose
#

That's painful for the wiki okay??

#

Dedmen, do something from Germany and make it BIG_ 😄

surreal peak
#

Wait Dedmen works for BI? When did that happen?

#

or did he always work there

cunning crown
#

A few weeks ago already iirc

still forum
#

I don't count the weeks

winter rose
#

he found a way to change his avatar colour, then they hired him

surreal peak
#

damn, GZ to him. MAKE BIG_

still forum
surreal peak
#

what about you Lou? I always see you on here helping out people

winter rose
#

I help people for free, I don't see why in their right mind they would send me monies for that 😄

surreal peak
winter rose
#

but I can hold help code hostage until all of ya send me Paypalz 👀 😅

surreal peak
oblique arrow
#

Oh god dont give Dedmen the idea of starting a 1-man BI division in germany, he's gonna do it and go down to max 1 hour of sleep a night

surreal peak
#

sounds like 1 more hour of sleep than he usually gets

winter rose
#

like he needs sleep anyway

oblique arrow
surreal peak
#

Which scripting related question: Whats the name of the software you can use to make sure your code doesnt throw errors at you so you dont have to constantly go to Arma to check

winter rose
#

brain.exe

#

with the wiki extension of course

surreal peak
#

sometimes brain.exe crashes and doesnt look for a single , hecking me over

winter rose
#

@queen cargo made a wonderful SQF-VM that allows for proper debugging

surreal peak
winter rose
#

looks like it

cunning crown
#

Looks like it

surreal peak
#

thanks, will give it a shot

still forum
#

SQFVM, or a linter. There is a linter thing extension for VSCode

#

That would catch the missing commas/semicolons

oblique arrow
#

Theres also a style set for Notepad++ for simple stuff

surreal peak
#

got the notepad++ one, has saved me many hours of my life

still forum
#

style will show you missing string quotes, but no semicolons n stuffz

cunning crown
#
"skacekachna.sqflint",
"armitxes.sqf"

Yep, these are the extensions for VSCode altough new scripting commands are missing

winter rose
#

and they don't prevent my coding errors

pure brook
#

Hey guys, little trouble with a teleport script. During testing it seemed to teleport all players rather than just those within the trigger.

player setPos _pos;```
winter rose
#

because player yes

#

I believe your trigger is configured as "once triggered, move player there"

#

you should teleport units in thislist

pure brook
#

Yea I thought that might have been the case.

So;
thislist setpost _pos;
will do what I need?

winter rose
#

nope.

pure brook
#

Sorry not 100% with this stuff

winter rose
#
{ _x setPos _pos } forEach thislist
oblique arrow
#

something like
players in thisList setpos _pos; no?

cunning crown
#

thislist is probably an array so you would need to foreach setpos Lou!

oblique arrow
#

ah

pure brook
#

Ok, thanks @winter rose

#

Oh, second question.

Say player B moves into the trigger 30 seconds after player A, would they both teleport when it fires after player A started the timer?

oblique arrow
#

Does the script fire when the timer is triggered or after the timer ends?

cunning crown
#

It will teleport every player that are in the zone at the moment of the script execution

oblique arrow
#

as in when are people teleported, since it'll teleport every player that is in the trigger area when its executefd

pure brook
#

Also hi @oblique arrow !!

It's currently on 'countdown'. So will activate when Any player is present

oblique arrow
pure brook
#

(With a timer)

oblique arrow
#

you should come join us on almonds discord

pure brook
#

So I am correct in thinking that after X time, "on activation" fires, which will teleport anyone present?

#

Well there's an invite to mine (mostly empty

oblique arrow
#

But ye as Heyoxe said it'll teleport every player that is inside thisList (so the trigger area) when that script line is executed

winter rose
#

therefore, you could make the trigger player-side (not server-side) and have in conditions ```sqf
this && player in thislist

pure brook
#

Nah I want all players in the trigger after X time (it's a reinsertion after death).

I've been fiddling with a whole bunch of stuff, but looks like I was starting to think too complicated for a simple thing.

winter rose
#

the hardest part in coding is simplifying, indeed

simple moat
#

Hello guys, I'm back again for another scripting question.

I am trying to remove the vanilla fatigue on my MP mission so that only ACE fatigue works once its initialised, because the gun sway is affected when player loads due to the player being encumbered and the gun sway stays with the ACE Fatigue when the mod is initialized.

I have added this script on my initPlayerLocal.sqf

_unit = _this select 0;
_isJIP = _this select 1;

if (!_isJIP) then {

   _unit setFatigue 0;
   _unit enableStamina false;

};

if (_isJIP) then {

   _unit setFatigue 0;
   _unit enableStamina false;

};```

But I don't think it's working... Any suggestions?
still forum
#

huh

#

you are doing the same things whether JIP or not, why even check

winter rose
#

if something do X
if not something do X

why not "just do X"?

still forum
#

I think ACE fatigue should be disabling vanilla fatigue on its own, atleast that would be a logical thing to do

simple moat
#

I think ACE fatigue should be disabling vanilla fatigue on its own, atleast that would be a logical thing to do
@still forum True, but initially when the game loads the modules takes time to initialise. And since my Medic loadout has a lot of stuff in the inventory, it makes the character encumbered, so when the missions loads my medic character will be fatigued and have so much weapon sway, until the ACE Fatigue kicks in, then fatigue becomes fine but the weapon sway stays.

Because in my understanding, when the mission loads all vanilla settings kicks in and you can move your character and then couple seconds later the mods initializes, then ACE kicks in and replaces the vanilla settings.

winter rose
#

can a Simple Object be added an Event Handler? 🤔

simple moat
#

can a Simple Object be added an Event Handler? 🤔
@winter rose I don't know, since I am a rookie when it comes to scripting in Arma. That's why I only tried the most straight forward way of doing it by putting those scripts but it isn't working.

I just want to disable the vanilla fatigue so that when mission starts and player joins in, the vanilla fatigue won't have any effect on the characters until the ace kicks in. That's why I put it in both ```sqf

if(!_isJIP) {};

if(_isJIP) {};

still forum
#

That's why I put it in both
both doesn't make any sense tho

simple moat
#

both doesn't make any sense tho
@still forum I see. I just thought that, all players joining in servers has that buffer time for them to initialize mods whether their JIP or not. Meaning the ACE system won't take effect until that happens.

#

But the thing is, the script is not working whether I put it in init.sqf, initPlayerLocal.sqf or initPlayerServer.sqf. which is weird.

still forum
#

and you're not too heavy for ace fatigue?

winter rose
#

can a Simple Object be added an Event Handler? 🤔
apparently, nope

simple moat
#

and you're not too heavy for ace fatigue?
@still forum Nope, it drains the stamina, but I still start at full at least compared to the vanilla fatigue wherein it doesn't even allow the character to walk until the ACE Fatigue kicks in.

#

apparently, nope
@winter rose I see, although I don't really understand what are "Simple Object" and "Event Handler" does, since I'm not that familiar with all the scripting stuff. Still trying to learn it.

winter rose
#

it was a question, I answered myself 👍

lofty anchor
#

how can i turn the following into an array of doors to lock for civilians

if (!isDedicated && {playerSide == civilian}) then {this setVariable ["bis_disabled_Door_1", 1, false];}

iv tried

if (!isDedicated && {playerSide == civilian}) then {this setVariable ["bis_disabled_Door_1", "bis_disabled_Door_2", "bis_disabled_Door_3", "bis_disabled_Door_4", "bis_disabled_Door_5", "bis_disabled_Door_6", "bis_disabled_Door_7", "bis_disabled_Door_8",  1, false];}

&

if (!isDedicated && {playerSide == civilian}) then {this setVariable ["bis_disabled_Door_1", 1, false];}
if (!isDedicated && {playerSide == civilian}) then {this setVariable ["bis_disabled_Door_2", 1, false];}
//and so on up to door 8 

non of those work im not good with arrays

still forum
#
if (!isDedicated && {playerSide == civilian}) then {
{this setVariable [_x, 1, false]} forEach ["bis_disabled_Door_1", "bis_disabled_Door_2", "bis_disabled_Door_3", "bis_disabled_Door_4", "bis_disabled_Door_5", "bis_disabled_Door_6", "bis_disabled_Door_7", "bis_disabled_Door_8"];
};
lofty anchor
#

@still forum thanks ill give that a try now

#

thanks @still forum works perfect

spiral fractal
#

when I delete vehicle that has attached object what happens to that object?

oblique arrow
#

it unattaches itself iirc

spiral fractal
#

its seems like it

high horizon
#

Any function to kick players to lobby different from failMission, endMission and forceEnd??

merry glen
#

If anybody can tell me what's wrong with my string... I'm trying to set several activation statements for the same trigger without using the Eden interface: sqf triggerActivated capboss; bcuff=(boss getVariable ["ace_captives_cargoindex", false]); capboss setTriggerStatements ["bcuff !=-1", "titletext [""Hard to believe, but we did it. Let's go home Alistaire."", ""PLAIN DOWN"", 5]" + "titleFadeOut 2" + "playSound [""p6"", true]", ""];

#

The engine doesn't like my "+", but I can't find another way to concatenate the strings

still forum
#

syntax error

#

Why even concatenate at all?

#

I don't see any reason to concatenate?

#

just put all in a single string?

#

maybe then you'll also see what you did wrong, try it

winter rose
#

@high horizon …why?

merry glen
#

@still forum Arghf you're right. The activation statement is a single string...

#

Thanks

still forum
#

Uh

#

with the + you also had a single string

#

you were just missing the semicolons, and the + didn't really make sense

#

and btw you can just use single quotes inside strings

#

instead of having to ""

merry glen
#

This works:
sqf bcuff=(boss getVariable ["ace_captives_cargoindex", false]); setTriggerStatements ["bcuff !=-1", "titletext [""Hard to believe, but we did it. Let's go home Alistaire."", ""PLAIN DOWN"", 5]; titleFadeOut 2; playSound [""p6"", true]", ""];

#

I put double "" because I have quotes in there originally

#

"If you want to include double quotes (") in strings enclosed by double quotes, the inside double quotes have to be written twice.

_string = "my string ""with"" quotes"
_string2 = 'my other string "with" quotes'"

still forum
#

This would also work

"titletext [""Hard to believe, but we did it. Let's go home Alistaire."", ""PLAIN DOWN"", 5];" + "titleFadeOut 2;" + "playSound [""p6"", true]"

or this

"titletext ['Hard to believe, but we did it. Let's go home Alistaire.', 'PLAIN DOWN', 5]; titleFadeOut 2; playSound ['p6', true];"
merry glen
#

I see 👍

wind hedge
#

Guys, any way to simulate a key stroke locally via script either natively or via CBA or something?

still forum
#

real keyboard stroke no

wind hedge
#

So if I want the player to salute I will have to use the playAnim "_anim" option?

#

I wanted to simulate the key stroke (salute) because the keystroke already deals with sending the animation to all other clients

#

Now I will have to remoteExec the switchMove

still forum
#

its a gesture afaik

tough abyss
#

Does anyone have a smarter way of doing ```sqf
_cardinalDir = switch (true) do {
case (getDir player <= 22 || getDir player >= 348): {"north"};
case (getDir player <= 347 && getDir player > 303): {"north west"};
case (getDir player <= 302 && getDir player >= 248): {"west"};
case (getDir player <= 247 && getDir player >= 203): {"south west"};
case (getDir player <= 202 && getDir player >= 158): {"south"};
case (getDir player <= 157 && getDir player >= 113): {"south east"};
case (getDir player <= 112 && getDir player >= 68): {"east"};
case (getDir player <= 67 && getDir player >= 23): {"north east"};
};

still forum
#

getDir player <= 302 && getDir player >= 248
That range is incorrect, thats 54, not 45

#
_cardinalDir = ["north", "north east", "east" , "east", "south east", "south east", "south", "south", "south west", "south west", "west", "west", "north west", "north west", "north", "north"] select (((getDir player)/45-0.5)*2)

meh could be better, the duplicates are crap because the north thing.. But probably..

wind hedge
#

Do you guys think this fnc could fix the current bug where for EDEN EDITOR placed Ai units who were edited with the EDIT LOADOUT option disable the player's ability to pick up their weapons?

#

`vAiInventoryFix = { // Potential fix for the bug where players can't pick up items from Ai units equiped via EDEN EDITOR EQUIP UNIT OPTION.
params [
["_editorPlacedAiUnit", objNull, [objNull]]
];
if !(Local _editorPlacedAiUnit) exitWith {};
if (isPlayer _editorPlacedAiUnit) exitWith {};

[_editorPlacedAiUnit, [_editorPlacedAiUnit,name _editorPlacedAiUnit], [], false ] call BIS_fnc_saveInventory;
_editorPlacedAiUnit spawn {
sleep 2;
[_this, [_this,name _this]] call BIS_fnc_loadInventory;
};

};`

#

I know that manually removing and re adding the items via script works in fixing the issue but perhaps BIS_fnc_loadInventory does exactly that

still forum
#
_cardinalDir = ["north", "north east", "east", "south east", "south", "south west", "west", "north west", "north"] select ((getDir player)/45-0.5)

try this @tough abyss

wind hedge
#

Ok I accept the indifference 😔

winter rose
#

Good.

#

@wind hedge j/k, but do you have the smallest repro ever?

wind hedge
winter rose
#

thanks
I didn't know about this one. is it about "loading a custom loadout" or simply editing the loadout?

wind hedge
#

Editing the loadout via Eden is enough to cause the bug

#

Doesn't happen for all players and certainly not for the host/server

#

I am not entirely sure it happens just for the EDEN edited units, I believe it could happen for any unit placed via EDITOR even if you did not customized his LOADOUT

#

Can be pretty game breaking for the players suffering from it

winter rose
#

maybe for player-hosted missions? I could see a locality issue

#

as for the original question "could it fix the issue", well… hard to tell given the (lack of) info.

exotic flax
#

I guess the main issue is that repro is not 100% sure...

wind hedge
#

as for the original question "could it fix the issue", well… hard to tell given the (lack of) info.
@winter rose I was actually trying to know if that BI func was doing the whole

#

removeBackpackGlobal player;
player addBackpackGlobal _backpackClass;

#

etc etc

#

I mean, units that get their loadouts via script do not suffer from this it seems

exotic flax
#

BIS_fnc_loadInventory is removing all items/gear and putting new items/gear back to unit

winter rose
#

you can check function's code in the Functions viewer too
can player 2 see the items, but not take them?

wind hedge
#

player 2 can see the items, interact with them even

#

but moving for example the ai's primary weapon to their inventory (primary weapon slot) will cause the inventory to be bugged

#

Now player 2 is unable to pick up weapons nor drop his

#

droping his bugged primary weapon results in it being duplicated on the ground

winter rose
#

ah well, I can't say much more about solving that - besides perhaps

wind hedge
#

The work around fnc I made will probably do the job

#

will test it soon

tough abyss
#

@still forum thanks for the help but it seems like I can't find any smart solution that would be as accurate as the ugly switch. I've looked in different libraries and a lot of people come up with similar solutions as yours but they're off by at least a couple of degrees if not in the double digits.

wind hedge
#

@tough abyss what are you using that fnc for?

tough abyss
#

Getting a cardinal direction from bearing. IE [getDir player] call fnc_degree2Cardinal

#

more specifically for ATC chatter when AI is flying planes

wind hedge
#

@tough abyss I use this for my 3D compass and it is accurate in getting true cardinal directions onEachFrame:

#
            
if (alive player && "ItemCompass" in (assignedItems player)) then {

                 _infrontDistance = 1; 
                 _compassRadius = 0.25; 
                  
                 _cameraPos = AGLToASL positionCameraToWorld [ 0, -0.5, 0 ]; 
                 _compassCenter = _cameraPos vectorAdd ( getCameraViewDirection player vectorMultiply _infrontDistance ); 
                   
                 {
                  _x params[ "_text", "_dir", "_size", "_color" ]; 
                   
                  AGLToASL( _compassCenter getPos[ _compassRadius, _dir ] ) params[ "_offsetX", "_offsetY" ]; 
                   
                  _offsetPos = ASLToAGL[ _offsetX, _offsetY, _compassCenter select 2 ];
                  
                  drawIcon3D[
                   "",
                   _color,
                   _offsetPos,
                   1,
                   1,
                   0, 
                   _text,
                   0,
                   _size,
                   "PuristaMedium",
                   "center",
                   false
                  ]; 
                  
                  if (_x select 3 isEqualTo [1,1,1,1]) then {
                    drawLine3D[ ASLToAGL _compassCenter, _offsetPos, [ 1, 1, 1, 0.2 ] ];
                  };
                  
                 } forEach [ 
                  [ "N", 0, 0.07, [1,1,1,1] ],
                  [ "ne", 45, 0.05, [1,1,1,0.5] ],
                  [ "E", 90, 0.07, [1,1,1,1] ],
                  [ "se", 135, 0.05, [1,1,1,0.5] ],  
                  [ "S", 180, 0.07, [1,1,1,1] ],
                  [ "sw", 225, 0.05, [1,1,1,0.5] ],
                  [ "W", 270, 0.07, [1,1,1,1] ], 
                  [ "nw", 315, 0.05, [1,1,1,0.5] ]
                 ];
                 
                }; 
#

Perhaps you can adapt it to your needs... and to Ais because this is currently for players

cunning crown
#

you can use
```sqf
/* your code */
hint "Amazing!";
```
to get a better code block:

/* your code */
hint "Amazing!";

😉

still forum
#

@tough abyss does my version. Not work?
You are splitting up into 45° sections. So you can totally math it down like I did.

#

My test cases all looked fine

#

And if you want "rough" cardinal directions, why does one or two degrees off matter?

#

Your switch case is also wrong, like I told you.
All sections should be 45° but for some reason you have a 54° in there

tough abyss
#

@still forum Yeah I mixed ut 4 and 5 there, fixed that after sending it. Putting it all at 22.5+45 indefinitely was the most accurate solution as of yet for me.

winter rose
#
private _strDir = switch (round getDir player) do
{
  case 0;
  case 1;
  case 2;
  (...)
  case 23: { "North" };

  case 24;
  case 25;
  case 26;
  (...)
};
unique sundial
#

Need to have default or true will be returned if no match is found

winter rose
#

true dat - after that, best code ever

urban tiger
#

anyone know a way to make a trigger be 'very' accurate as in ONLY if the unit is inside. weird as that is to say. but ive noticed even if i make the trigger '1m' and attach it to a unit, it will still trigger when the player is outside of it.

winter rose
#

@urban tiger sorry, what?

urban tiger
#

Yes it confusing to even explain lol

#

So if i make a trigger that is say '5m by 1m' and attach it infront of the unit. It will sometimes cause the conditions of the trigger to happen when im not actually in the trigger yet.

winter rose
#

using attachTo?

urban tiger
#

yep

winter rose
#

maybe the trigger's simulation is slow and updating every 0.5s or so, check with a hintSilent position trigger
if the unit moves, the trigger may lag behind

urban tiger
#

Yeah i think its just a weird bug in the engine.

#

if i make the trigger 0.5 its 'more' accurate at 1m. weird

#

actually i think ive found why.. the trigger 'size' are not in meters

unique sundial
#

Trigger size is in metres

urban tiger
#

then the classnames are wrong?

unique sundial
#

What class names

urban tiger
#

look at the image KK

unique sundial
#

Tell me what Im looking at

crude vigil
#

I think he means 5m fence is not actually 5 meters

urban tiger
#

that wall is defined as '5m' same gones for the '1m' cube however if i placed 5 1m cubes, and move them in increments of 1m in eden

unique sundial
#

Do you realise that trigger A B and C are half sizes, so A 5 will make it 10 m wide

urban tiger
#

so what i just said? lol

unique sundial
#

Don’t know

urban tiger
#
if i make the trigger 0.5 its 'more' accurate at 1m. weird
unique sundial
#

You said many things, one of them is that sizes are not in metres, they are

urban tiger
#

ive moved five 1 metre boxes and moved them in increments of 1m. and you have this https://imgur.com/a/fCOhcvj that.

So to have a trigger as 5 its actually 10m. not '5m'

winter rose
#

it's "radius"

#

so yeah, the wall class states 5m where it is actually 10.

urban tiger
#

Yeh its fine, just that triggers are tooltipped as 'area size' not "radius"

unique sundial
#

Do you realise that trigger A B and C are half sizes, so A 5 will make it 10 m wide

wind hedge
#

Can anyone tell me why this isn't showing both the 3D icon nor the markers:

#
vPARAMS_3Dhelpers = 3;
v3Dhelpers = {
 vWoundedMarkers = [];
 if (vPARAMS_3Dhelpers > 0) then {
 addMissionEventHandler [ "EachFrame", {
   if (diag_fps > 15) then {
   {
    if (side _x isEqualTo side group player && {alive _x} && (_x distance player < 500) && (lifeState _x isEqualTo "INCAPACITATED")) then {
  private _dist = (player distance _x);
  private _color = [1,0,0,1 - (_dist / 200)] ; // COLOR RED
  drawIcon3D [
   'a3\ui_f\data\revive\medikit_ca.paa',
    _color,
    [
    visiblePosition _x select 0,
    visiblePosition _x select 1,
    (visiblePosition _x select 2) +
    ((_x modelToWorldVisual (
    _x selectionPosition 'body'
    )) select 2) + 0.28 + _dist / 4.5
    ],
    0,
    0,
    0,
    "WOUNDED " + name _x,
    2,
    0.033,
    'PuristaMedium'
    ];
//Wounded Marker
if (count vWoundedMarkers > 0) then { {deleteMarkerLocal _x} forEach vWoundedMarkers;};
private _marker = createMarkerLocal ["vWoundedMarker_" + format["%1",_forEachIndex], position _x];
vWoundedMarkers pushBack _marker;
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "hd_join";
_marker setMarkerTextLocal ("WOUNDED " + name _x);
_marker setMarkerColorLocal "colorBLUFOR";
};                   
} count playableUnits - [player];
};
}];
};
};
[player] call v3Dhelpers;```
winter rose
#

not reading that indentation Oo

wind hedge
#

Cannot do better because of Discord 2000 char. limitation

winter rose
wind hedge
winter rose
#

I see a { } count playableUnits - [player]; thonk

potent granite
#

Can someone help me with setPylonLoadout
whenever I use this the old weapon remains in the list for the vehicle with 0 ammo - how do i make it go away so only the weapons that are actually on the vic are present in the list

winter rose
potent granite
#

i have been googling this for 5 hours now

#

I have only come here because I couldn't find my answer there

winter rose
#

and what does it show and not show?

#

@potent granite show us what you got! 🌞

wind hedge
#

it shows a 3D icon over incapacitated playable units and also a marker

winter rose
#

I just changed the indentation and count → forEach

#

it shows a 3D icon over incapacitated playable units and also a marker
isn't it what you want?

potent granite
winter rose
#

your code

#

please

wind hedge
#

isn't it what you want?
@winter rose That is what I want but it is not working at all

potent granite
#

in the init of the vehicle (for testing purpose and then will be moved to sqf using _this)

this setPylonLoadout ["Pylon1", "FIR_Hydra_M247_P_19rnd_M",false]; 
this setPylonLoadout ["Pylon2", "FIR_SUU23_P_1200rnd_M",true];
#

[["RHS_UH1Y"], {_this setPylonLoadout ["Pylon1", "FIR_Hydra_M247_P_19rnd_M",false]; _this setPylonLoadout ["Pylon2", "FIR_SUU23_P_1200rnd_M",true];}],

#

@winter rose ^

winter rose
#

@wind hedge do you use show script errors?

#

(I am leaving for tonight though 🌜 beep me in 10h)

wind hedge
#

yes, no script errors

#

kk, I am also posting on the forums now

#

thanks

winter rose
#

Also, you are creating/deleting markers every draw, I am not sure this is a great thing

#

Oh! Also, you are using modelToWorldVisual altitude, where drawIcon3D takes AGLS @wind hedge

#

so your icons must be high up in the sky 😄

cunning crown
#

Yeah I wouldn't add a marker creating/deleting on each frame, maybe on the mapdraw / howerer it's named but each frame is useless

exotic flax
#

we love them burn

#

but please stay ontopic and keep illegal content out of this Discord

#

still offtopic...

glass zinc
#

anyone have any idea how to change

    if ((_vehicle isKindOf "Tank" || _vehicle isKindOf "TrackedAPC") && _special isEqualTo "FORM") then {
        _pads = nearestObjects [getPos _vehicle, [_pad_heavy], 200];
//        _pads = nearestObjects [getPos _vehicle, [_pad_heavy], 200];
        _pads = [getPos _vehicle] nearObjects ["_pad_heavy", 200];

im trying to make it use near objects instead of nearest
but i cant seem to get it to work

#

bottom part is what i tried changing to to

robust hollow
#
_pads = (getPos _vehicle) nearObjects [_pad_heavy, 200];
glass zinc
#

ok thanks ill give that a try

cloud thunder
#

Anyone know the difficulty config setting equivalent of enableStressDamage?

exotic flax
cloud thunder
#

yes that command equivalent

robust hollow
#

maybe stressDamageEnabled[]={1,0};

#

thats in the old veteran difficulty flags 🤷‍♂️

cloud thunder
#

hmm not seeing an example of that in wiki. Do you have a link?

robust hollow
#

yea, its for the old difficulty configs though, so i dont think it is any use now.

cloud thunder
#

so then does anyone have any experience with enableStressDamage command ? I could not make it work.

exotic flax
#

I assume you have enabled AFM... so isStressDamageEnabled should return true.

cloud thunder
#

yes

#

and yes

exotic flax
#

tbf... I haven't played with AFM a lot, especially not in a scripted way. But the only thing I can think of is that the vehicle doesn't support RotorLib itself, meaning it will still use the default behaviour.
Unless the function is broken, although in that case the settings should work.

glass zinc
#

@robust hollow worked! thank you!

thorn saffron
#

Question: can inline functions go outside the scope of an SQF file they are defined in?

cloud thunder
#

Short answer, yes. Are the inline functions defined by a global variable? For example you want to call on function defined in one script from another function defined in another?

queen cargo
#

There is no actual function in sqf
There is the code data type, that can push scopes in conjunction with call and etc.

thorn saffron
#

For example you want to call on function defined in one script from another function defined in another?
No, that is exactly what I want to avoid. I just want the inline function to exist only in the SQF file it's defined in.

#

It does not matter now as I decided to make a proper function from that inline one

queen cargo
#

Private _whatever = code

cloud thunder
#

^

shrewd bough
#

I found a post on Reddit from about 4 years ago about changing the horn sound of a vehicle. I tried using the script in the comments, but it only disables the horn, instead of playing the sound I put in it.

Would someone be able to help me with this? Here's the Reddit post I found: https://www.reddit.com/r/arma/comments/4e47no/scriptinghelp_car_horn/

Is it because I'm using an .ogg? The comments mentioned a .wss filetype.

plain linden
#

hey, so i just started to script and im running into an issue

im in the Eden editor and editing the "init" section.

basically if someone has a laptop in thier inventory, I want an action to pop up,,,heres what i got and it doesnt seem to work

if ("Item_Laptop_closed" in items player) then {
player addAction ["Download Intel", {}];
};

spring lodge
#

take a look at the optional params for addAction

#

there is a condition field

plain linden
#

ah ok. i see thgat now. lets see

spring lodge
#

just make sure to fill the previous arguments correctly for your case

plain linden
#

player addAction ["Download Intel", {if ("Item_Laptop_closed" in items player) {};}]

#

i dont think thats right lol

spring lodge
#

object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

#

player addAction [“Download Intel”, “your code.sqf”, [], 1.5, true, true, “”, “‘Item_Laptop_closed’ in items player”]

plain linden
#

ahh, ok, see i thought that if theyt were optional, like command line, you could omit them

#

thank you

fallow gazelle
#

So I am trying to make a training arena, or some type of area with less than lethal, or blanks. I saw a BAF (British Forces) mod with weapon BFA's (Blank Firing Adapters). How would I script in, or create a BFA for weapons in game?

plain linden
#

odd we have the same name

fallow gazelle
#

@plain linden Noice. Lmao I might change it soon

smoky verge
#

yeah lol
anyway @fallow gazelle modded adapters can change a weapon damage, they probably modify weapons to have 0 damage

spring lodge
#

you can use the handle damage event handler to remove any damage

fallow gazelle
#

@spring lodge Is that done in Eden Editor?

spring lodge
#

Nah, scripted

smoky verge
#

is there a way to add multiple amounts of the same object with addItemToBackpack

fallow gazelle
#

How would I start with that? Or are there any tutorials online for editing damage in game?

spring lodge
#

Sanchez just do a simple for loop?

smoky verge
#

I've read that I could do addItemToBackpack [ "GrenadeHand" , 20 ];
would that work? nevermind it doesnt

plain linden
#

@spring lodge
sadly didnt work

I dont have a script to run yet, so im just trying to make it pop up

This is what I have
player addAction ["Download Intel", "", [], 1.5, true, true, "", "'Item_Laptop_closed' in items player"];

I go to the drone without the laptop, it doesnt show...thats good
I pick up the laptop, go back to the drone..it still doesnt show

spring lodge
#

Is the class name correct?

smoky verge
#

checked from cfgMagazines
arma isn't giving me any error
but even if I try adding 1 it doesn't give me
so not sure

plain linden
#

when i hovered over the laptop in the eden editor thats the name it gave me

spring lodge
#

Ahh the problem is items

#

It returns special items, so like your compass, watch etc

#

Not what is in your inventory

plain linden
#

AHHHH

smoky verge
#

so it should be addMagazine?

#

weird that answer helped us both

spring lodge
#

Lmao

plain linden
#

i thought that was assignedItems that was for those special items

spring lodge
#

‘Item_Laptop_closed’ in ((vestItems player) + (uniformItems player) + (backpackItems player))

#

I’m honestly not sure what the difference is

plain linden
#

same

#

weird, when i load in, it keeps saying "invalid number expression"

#

player addAction ["Download Intel", "", [], 1.5, true, true, "", "‘Item_Laptop_closed’ in ((vestItems player) + (uniformItems player) + (backpackItems player))"];

#

and still no dice

smoky verge
#

so apparently I can't add grenades to inventory
the classnames seem correct
and it does work for chemlights
but I can't get neither RGO and RGN

plain linden
#

maybe i have to assign a variable to the player?

winter rose
#

@smoky verge code…? also, has enough storage space…?

smoky verge
#

it does have space
code is
player addmagazine "GrenadeHand";
which doesnt work
but
player addmagazine "Chemlight_red";
does

#

btw congrats for the profile

winter rose
#

thanks

it's "HandGrenade"
GrenadeHand is what is throw iirc, the bullet itself

smoky verge
#

they should fix the biki cfg magazines then
what about the mini_Grenade
that doesnt work either

winter rose
#

take the FIRST COLUMN class Oo I mean

#

HandGrenade
MiniGrenade

#

@smoky verge you don't addMagazine "B_65x39_Caseless", you addMagazine "30Rnd_65x39_caseless_mag" 👀

smoky verge
#

oh completely didn't notice
took the chemlights as reference
which have it identical

winter rose
#

That's a paddlin'

cosmic lichen
#

The chemlights through me once off as well 😄

vague geode
#

I like the singleplayer death screen alot but if I use it in a multiplayer mission everyone would need to abort the mission and rejoin every single time they die.
I think I have found the singleplayer death screen function under P:\a3\functions_f\respawn\fn_respawnnone.sqf.

Can someone tell me how I would need to modify the code of this function so that I can use it in a onPlayerKilled.sqf script?
My mission has the respawn type 3 ("BASE") so what I hope to achieve is that when you die the score board appears (just as it does by default) but in the background you would have the "singleplayer death screen" (with KIA:, ENY:, TOD: etc.) but without the "Team switch"-, "Abort"-buttons etc. in the bottom left corner and after the respawn delay is over the "singleplayer death screen" would disappear and you would just respawn like you would normally do without the need to abort the mission. Basically an imitated singleplayer death screen.

Sadly I don't really understand this function exactly so I would really appreciate your help.

winter rose
#

@wind hedge got it working?

spiral fractal
#

I have function that run on the server, it is called inside init_server.sqf and run in loop, it moves marker using setMarkerPos command, do I have to use remoteExec to see the marker position updated as player?

winter rose
#

@teal mirage you could also be banned for promoting illegal content (and language), too
I recommend you to read our #rules

delicate lotus
#

@spiral fractal setMarkerPos is global.

winter rose
#

the f in lmfao

round scroll
winter rose
#

you shouldn't play with moderators*, nor #rules

#

moderators*

spiral fractal
#

@delicate lotus but for some reason I dont see the marker pos updates

winter rose
#
    this includes harassment, name calling, racism, sexism, homophobia, other derogatory remarks (profanity) or any insults.```indeed
#

profanity does not mean insult.
thanks, Dedmen

delicate lotus
#

@spiral fractal How do you call the function?

winter rose
#

!mute @teal mirage 7d

lyric schoonerBOT
#

Silence!! ò_ó
...
I keel u, @teal mirage!!
Ò_Ó

winter rose
#

got your back

delicate lotus
#

Thanks for muting him

#

@spiral fractal Can you show me a snippet or the whole function where you call setMarkerPos ?

spiral fractal
#

is there faster way to test mission or dedicated server?

round scroll
#

I want to check for a variable to be true in a condition of a userAction. Should I add the variable to the object in question ((this getVariable 'ttt_nimitzParent') getVariable ['ttt_nimitz_hangarGarage', false];) or rather go with a global variable ttt_nimitz_hangarGarage ?

winter rose
#

better with the object variable, let's not "pollute" mission namespace

#

also, what if you have two Nimitz ^^

round scroll
#

yes, that's the reason why I moved all the old global variables into the object namespace originally, thanks for reminding 🙂

winter rose
#

the closest, the bestest

urban tiger
#

there isn't any way to use keyframe animation on a walkable unit is there?

winter rose
#

they would be floating I think

urban tiger
#

once its played if the unit is alive they just stand still doing a weird shuffle. once the unit is dead they'll slide along to floor like super man 😂 Although it seemingly works fine in the editor minus the walking animation. Best to use BIS_fnc_UnitCapture; for accurate patrolling?

winter rose
#

nope, it is meant for aerial vehicles

urban tiger
#

shame, guess ive got to do the old school way of lots of 'setpos' with unitcapture and a while loop doing a walking animation

winter rose
#

it depends on what you want to do yes

urban tiger
#

just accurate repeatable patrols. that have the same path every time.

winter rose
#

waypoints?

high horizon
#

I gotta a error with dialogs, it says Resource not found, they are on a .hpp defined on desc.ext and inside that .hpp there is another dialog working

#

Any solution? quite weird

astral dawn
#

I've found that IFA Liberation ACE is causing this, specifically ifa3_ace_placeables.pbo, but it has nothing special in it, it just adds some ACE interaction entries, I don't understand 🙈

urban tiger
#

@winter rose waypoints are not accurate when doing very tight movement where they hit the same point every time. think of it as 'cinematic'

winter rose
#

setPos + switchMove then, yes

#

MGS-like patrols I see ^^

urban tiger
#

well lou..

winter rose
#

\o/
not going to lie, you got me a strong flashback vibe here!

urban tiger
#

also got the animated background on the floor and walls nicely!

winter rose
#

I got the music in my head now… thanks

urban tiger
#

I'm remaking all the music too 😂

Nothing else to really do during lockdown, i can automate all my work remotely. so decided to get back into modding on arma, granted i've gotten very rusty since 2015...

high horizon
#

I gotta a error with dialogs, it says Resource not found, they are on a .hpp defined on desc.ext and inside that .hpp there is another dialog working
@high horizon Anyone?

winter rose
#

it might not be a #arma3_scripting matter @high horizon
you should show your config and script here, and if it is not a scripting issue you are banned go to #arma3_gui for config help 🙂

smoky verge
#

why are you tagging yourself?

winter rose
#

Discord's quote function does that

still forum
#

He's just bumping, just as he does in my DMs, and on feedback tracker

high horizon
#

it might not be a #arma3_scripting matter @high horizon
you should show your config and script here, and if it is not a scripting issue you are banned go to #arma3_gui for config help 🙂
@winter rose Yep true, i always forgot it sorry

winter rose
#

and don't bump so frequently as said above ↑

smoky verge
#

anyway I'm trying to detect if all pop up targets are down at the same town
I'm not sure how to do that since there is no way (to my knowledge) to detect the animation status of an object

winter rose
#

really?

young current
#

animationPhase. animationSourcePhase

#

😜

winter rose
#

Paddlin' combo ×2

smoky verge
#

thonk maybe I like the paddle

young current
oblique arrow
smoky verge
#

anyone can help me?
so as I've understood Animation Phase returns somewhere a value between 0 and 1
how can I use that value inside a trigger for example?

winter rose
#

place code inside the condition field?

smoky verge
#

if I do that how would the trigger know what value to activate to?

young current
#

if phase <> x then do stuff

#

trigger fires when condition is true

smoky verge
#

oh so I can specify which value to have
something like
if
target animationPhase ["terc", 1];
then

#

because the syntax in the biki just says
object animationPhase animationName
so not sure if the above is correct

cunning crown
#

and returns a number, which you can just compare to 0 or 1

winter rose
#

e.g animationPhase > 0.5

exotic flax
#

please read correctly ;)

_building animate ["maindoor",1]; // <--- animate
_p = _building animationPhase "maindoor";  // <--- animationPhase
winter rose
#

it would be better to use animationSourcePhase though 👀 🙂

smoky verge
#

oh didn't copy from that
just though it would be the way to specify the phase

winter rose
#

do you want to set it, or get it…

smoky verge
#

I want to use it as an activation trigger for a script to run
so I think it would go
target animationPhase "terc" == 1;?

exotic flax
#

^^ that will return true when target is down

smoky verge
#

exactly what I need
McThankies from Mcspankies

young current
#

best to not use absolute values in the phases though

#

= 0.99 would be safer

smoky verge
#

oh ok thanks

#

last thing
is there a way to have multiple Vnames inside the object parameter?

young current
#

something something float precision thing

#

no

smoky verge
#

so I'll just have to make a bunch of &&

young current
#

yes

smoky verge
#

better than nothing I guess

young current
#

could be some sort of forEach check could be done

winter rose
#
[target1, target2] findIf { _x animationPhase "terc" < 0.99 } == -1
cunning crown
#

And if you only care about all targets being down, you could probably do something like (_trg1phase + _trg2phase + ...) >= (0.99 * (count _target)), that would atleast avoid puttings 3000 &&

winter rose
#

My word is the one and only :p

cunning crown
#

I mean it works ¯_(ツ)_/¯

smoky verge
#

the book says orange is better than pink
sorry @cunning crown

cunning crown
#

The book is wrong then 🙃

vagrant urchin
#

Hi

#

Is there a way to get who activated a trigger?

#

Like a variable name or something

#

I want to make an action work only for a specific player

#

More specifically. I'm showing subtitles when entering a trigger, but the subtitles are visible for everyone even if they're on the other side of the terrain

smoky verge
#

maybe
thatguy in thislist

still forum
#

thisList has the list of units inside the trigger

#

if the trigger was activated by a unit, the unit will be in there

winter rose
#

you can make your trigger client-side too (depends on the usage)

vagrant urchin
#

Yeah client side might work

#

How can I do that?

winter rose
#

there is a checkbox in the editor, "Server-side" - untick it

vagrant urchin
#

oh

#

it is

winter rose
#

it all depends on the code you run in it, too

vagrant urchin
#
[  
 ["Chief of Security", "Hey Commander!", 0],  
 ["Chief of Security", "I need to talk you.", 2] 
] spawn BIS_fnc_EXP_camp_playSubtitles;
#

The subtitles are visible for everyone

#

I want them to be visible only for the ones entering the trigger

winter rose
#

ah, in condition you should set this && player in thislist

smoky verge
#

@winter rose doesn't seem to work

cunning crown
#
(count (_targets select { _x animationPhase "terc" >= 0.99 })) isEqualTo (count _targets)

That maybe then? (That will return true if every target in _targets are down, if 1 is the down state)

smoky verge
#

is _targets a trigger area?

#

oh wait no

cunning crown
#

Nop, _targets is an array with all your target objects (_targets = [obj1, obj2, obj3]

smoky verge
#

yeah was about to say that

winter rose
#

@cunning crown would do array isEqualTo number

#

forgot to throw a count in there

cunning crown
#

It was to see if you would catch it 😉

smoky verge
#

and I guess the array is in the init?

winter rose
#

not the init of the trigger no

smoky verge
#

I mean init.sqf

winter rose
#

then it would be a global variable, so maybe yes

smoky verge
#

what heyoxe suggested gives me an error if put in a trigger

#

local variable in global space

winter rose
#

and what I suggested you?

#

local variable in global space

then it would be a global variable

smoky verge
#

no errors but doesnt work

winter rose
#

…did you even change [target1, target2] ?

smoky verge
#

yeah of course

vagrant urchin
#

So setting the trigger to work client side, will show the subtitles only clientside for those entering the trigger?

winter rose
#

and if you set the player in thislist condition

vagrant urchin
#

so this && player in thislist && pltHq in thislist?

winter rose
#

@smoky verge ```sqf
targetsList findIf { (_x animationPhase "terc") < 0.99 } == -1

#

@vagrant urchin wasn't it this?

vagrant urchin
#

oh yeah might be lol

#

sorry

cunning crown
#

It works fine on my end Sanchez (

systemChat str ((count ([trgt1, trgt2, trgt3] select { _x animationPhase "terc" >= 0.99 })) isEqualTo (count [trgt1, trgt2, trgt3]) 
); true
```)
winter rose
#

so only guys in the area will have the subtitle yes (@vagrant urchin)

vagrant urchin
#

and also only pltHq will be able to activate it right?

smoky verge
#

so what I'm using is pop up target
which get hit
go down, then I guess they have a 3 seconds sleep then pop back up

#

shouldn't be an issue with grenades considering one pops them all down istantly

winter rose
#

@vagrant urchin if both the local player and pltHq are in the trigger, it will fire on the player's machine. even if the player enters later.

cunning crown
#

That's what I used too @smoky verge and it works with grenades

smoky verge
#

mhmm could have messed the array
I'll try again

winter rose
#

if you want the player to have subtitles only if the player is in the area, and never after, you can use ```sqf
OnCondition:
this && pltHq in thislist
OnActivation:
if (player in thislist) then { /* your subtitles go here */ };

vagrant urchin
#

My issue is that the subtitles are also visible for those not in the trigger. I think it's the way the subtitles work not the trigger

winter rose
#

when do you want them to display?

#

if pltHq enters the area and the player is in the area, or "close" to the commander?

#

you can check the distance

vagrant urchin
#

When entering the trigger.. The problem is that even if only one player enters the trigger, the subtitles are visible for everyone

winter rose
#

I get the issue you have
I am trying to see the conditions you are trying to set

if the player is in the area then pltHq enters, should it trigger?
if the player drives the pltHq, should it trigger?
if the player is 1m out of the area and the pltHq enters, should it trigger?

#

if pltHq enters the area, then 5 min later the player enters it, do you want it to trigger, too?

vagrant urchin
#

pltHq is a player.
The trigger should trigger once only when the player with the variable name pltHq is in the trigger.
The code (subtitles function) in the activation event should work only for pltHq, so only that player should see those subtitles

winter rose
#

set ```sqf
if (player == pltHq) then { /* subtitles */ };

exotic flax
#

afaik are subtitles shown to all players which are "local", and since triggers execute for all players (even when not in the trigger area), it will execute on all machines.
The suggestion by Lou might work

winter rose
#

might

spiral fractal
#

trigger can be set to local as far as I understood from the docs, it has 3rd param makeGlobal

spiral fractal
#

I managed to fix my markers issue, I had to pass the global array to the function, but now for some reason when marker change pos its title disappear 🤨 what can cause it?

winter rose
#

btw, initServer.sqf should be the name of your file, not init_server.sqf @spiral fractal

setMarkerPos is global effect

what is your issue again?

spiral fractal
#

I am editing existing mission, and this is how the author called it, when marker change pos its title disappear, only the marker type is visible

winter rose
#

what is the code? because moving a marker does not change text (unless there is a bug I don't know)

open tendon
#

I'm having a problem where my AI wont fire at me when point blank range. I give an AI civilian a weapon and add him to an EAST group to make him hostile. anyone has advice?

#

they aim at me and when i walk away they start shooting, but at point blank/close range they wont shoot

round scroll
#

for my virtual garage hack for the Nimitz I now face the problem that some vehicles are too big for the space on the elevator. I can check the size with boundingBoxReal and geo clip on a spawned object, but ideally I would need to know the size before I spawn it. Any way for that? Otherwise I will just add a blacklist and disallow spawning of some classes

winter rose
#

sizeOf?

cunning crown
#

Any way for that?
I don't know any way to do it without spawning the vehicle atleast once

winter rose
#

spawn it at 10km altitude, get bounding box, delete :\

#

(be sure to use createVehicleLocal)

round scroll
#

ok

mighty vector
#

hi

#

unit "init" has

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

when/where would be executed? in every client? server+local?

still forum
#

init is executed for every client server and local

mighty vector
#

is there a way to print "who is currently running script"?

#

eg: using "systemchat", it would be useful to read "server says: ...and client_1 says:..." to help me debug

winter rose
#

which context, through remoteExec?

#

you have e.g clientOwner @mighty vector

mighty vector
#

hmm...doesnt seem to work

#

both lines return 0

#

what i would like to see is something like "0" for server, and "x" for every client

winter rose
#

code context?

mighty vector
#

that would mean im running that multiple times

#
this addEventHandler ["Killed", { 
 params ["_unit", "_killer", "_instigator", "_useEffects"]; 
 systemchat format ["%1 says hello",clientOwner];
}];
#

this is unit's init

winter rose
#

systemChat is local, so it won't trigger anywhere but the local machine

#

code in init field runs for every client (even connecting ones), so yes it is run multiple times

mighty vector
#

that's the point. the systemchat is printed twice

#

i would like to know who is printing each message

#

both seem to have have clientOwner=0

winter rose
mighty vector
#

on my way...im testing it on editor, so that could be the reason

winter rose
#

if this is offline Eden, yes

#

@mighty vector workingz?

mighty vector
#

sorry, kids xD

#

on eden, both say 0

winter rose
#

of course again, if it is the offline editor

mighty vector
#

to ensure this is only executed once, and considering the ia is handled by server/hc

#

should i add a condition before that? (handle event only on server)

winter rose
#

if in Eden offline you already have two runs of one init field, there is something wrong

mighty vector
#

that's what im trying to figure out

#

a unit, that code, 2 systemchats. first with params, 2nd null

#
this addEventHandler ["Killed", { 
 params ["_unit", "_killer", "_instigator", "_useEffects"]; 
_id=clientOwner;
 systemchat format ["normal %1 hello %2 %3 %4 %5", _id, _unit,_killer,_instigator,_useEffects];

 [format ["remote %1: hello", clientOwner]] remoteExec ["systemChat"];
}];
#

this ends with 4 messages written on chat

winter rose
#

in MP Eden or in "normal" Eden?

#

@mighty vector

#

if in "normal" Eden, it is obviously not a matter of client, so clientOwner is useless.

would you happen to be running the runInitScript command anywhere? 👀

mighty vector
#

the mission is stored on mpmissions...if that is what u ask. Im not aware of any runintiscript...

vague geode
#

Is it possible to get the weapon that killed a player in the onPlayerKilled.sqf?

winter rose
#
params [
    "_oldUnit",
    "_killer",
    "_respawn",
    "_respawnDelay"
];
``` @vague geode 
You could however add a killed EH that would setVariable on the dead unit the weapon used
#

(and get it through onPlayerKilled)

mighty vector
#

@winter rose within editor, tried playing in mp, and still 4 messages were print. remote this time was 2.
im not sure, but i think for some reason its being invoked twice...

exotic flax
#

"Killed" EH also doesn't return weapon... I believe the only (semi-)reliable method is to use the "HandleDamage" EH's to log the projectile (which can then be checked with weapons) of the last person who damaged the player (aka killer), and then use set/getVariable to retrieve that data in the "Killed" EH.

winter rose
#

the "Killed" EH returns the _ammo though my bad

#

I don't get all the cases in your last message@mighty vector

with only one systemChat ```sqf
[format ["remote %1: hello", clientOwner]] remoteExec ["systemChat"]; // this one

how many messages appear:
- in Eden Singleplayer
- in Multiplayer, you hosting, no other person
- in Multiplayer, you hosting, one other player (nvm if you cannot have someone else connecting)
mighty vector
#

@winter rose

this is the unit init:

this addEventHandler ["Killed", { 
 params ["_unit", "_killer", "_instigator", "_useEffects"]; 
 [format ["im %1, say %2 %3 %4 %5", clientOwner, _unit,_killer,_instigator,_useEffects]] remoteExec ["systemChat"];
}];

from eden>play in multiplayer (MP) option
when unit is killed, the systemchat is shown twice. first time with params, 2nd with null-object. both times client=2.
Do you want an screen cap?

winter rose
#

another reason not to add anything to an init field

and from Eden > preview (no MP), I bet it works fine?

mighty vector
#

i dont think so, but going to check

#

playing in SP at camera position also fails

#

(i dont have a preview option)

#

hmm....starting to blame ace....

winter rose
#

…thanks for mentioning the usage of mods

#

(although I don't see why they would do anything, but maybe)
try in vanilla and report?

mighty vector
#

...guess what?

#

damn ace

winter rose
exotic flax
#

99% of all computer issues are actually the user

mighty vector
#

¬¬

#

going to try MPKilled to see if that behaves better...

winter rose
#

don't put stuff in the init field (without knowing what it does), use an init.sqf or initServer.sqf

mighty vector
#

just testing

exotic flax
#

if you're just testing, then why do you need support for something that obviously isn't working...

mighty vector
#

cause is not working as expected. just confirmed is an ace issue

#

once things are working as expected, it would make sense to write them on init.sqf

#

otherwise, you should review ur programming habits 😛

winter rose
#

Burn the init fields 🔥 , I always said it 😄

exotic flax
#

It's not an ACE issue... CBA/ACE did make a workaround for the bug which triggers certain EH's multiple times and since ACE is already adding a lot of EH's the issue is most likely that yours are being overridden...
Which is not ACE's fault, but not knowing how CBA/ACE works 😉

plain linden
#

while {_time > 0} do {
_time = _time - 1;  
hintSilent format["Time Left: \n %1", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring];    
sleep 1;
}; ```
#

so i have this code for a timer, and it works, but the hint box doesnt go away after

#

how can i make it go away after

thorn saffron
#

woops wrong channel

winter rose
#

@plain linden```sqf
hintSilent ""; // this?

smoky verge
#

so back on that pop up target issue
we've managed to identify how to use the downed targets as a trigger activation
and I can run some checkup scripts to see that it works
but I can't find a way to keep them down
with the other scripts I've made a simple animate ["terc", 1]; does the job
but not in this case apparently

plain linden
#

lol ya i just came back to say i figured it out lol

smoky verge
#

so if I use a sleep and let them pop back up the script works
looks like I can't stop them from staying down, only pull them down once up again

ebon ridge
#

Regarding removeEventHandler, it says "Removes event handler added by addEventHandler. When any handler is removed, all handler indices higher than the deleted one should be decremented.".

How can event handlers in different addons work if removing one event handler invalidates the handles of all others? This can't be right...

wraith cloud
#

@vague geode currentWeapon _killer

fleet condor
#

Anybody know where I could find a full list of the base classes like "Tank", "Plane", "LandVehicle", and "SoldierWB"? Am I just not looking hard enough on the asset config page?

winter rose
#

@smoky verge I think there is a "noPop" variable to set, but I can't remember which one nor where

potent depot
#

Hey, So im working with setGroupOwner and have run into the issue of, if the group is in a vehicle and it is idle, It will dismount the squad leader(likely due to the dummy waypoint used in transferring by the command). Now I can remount the unit via moveInDriver however, if this is in the dismount animation, it will not work. Another problem is the unit is determined as no longer in the vehicle at the start of the dismount process/animation. Anyone got a potential solution to get around this? I need the unit to either never dismount or to be immediately remounted upon the completion of its dismount animation.

winter rose
#

@fleet condor SoldierWB is… OFP era
try B_Soldier_F

smoky verge
#

I recall that nopop was somewhat global and I had to do extra fiddling to make it target specific
sadly I don't remember what exactly

winter rose
#

try a setVariable, either "noPop" or "BIS_noPop" maybe?

#

the global noPop = true was in A2 yep

#

@potent depot have you tried locking the vehicle until transfer is done maybe?

potent depot
#

doesnt locking only prevent mounting not dismounting? I believe it states that in its documentation

#

also does that work with AI?

winter rose
#

blocks everything, and should work with AI

potent depot
#

yeah had looked at lockDriver not just lock

#

they have different functionality

#

as well as locality restrictions so had assumed it was the same across

#

ill try it out

ebon ridge
#

Sorry repeating cos I really need an answer to this, it seems an obvious problem:

How can event handlers in different addons work if removing one event handler invalidates the handles of all others?
There must be something I'm missing or I didn't read the documentation correctly?

potent depot
#

The handler returns an ID upon creation you can use that to remove it later if needed

#

that way it doesnt remove all of that type

ebon ridge
#

Okay but removeEventHandler docs say "When any handler is removed, all handler indices higher than the deleted one should be decremented."

#

(thanks for replying)

winter rose
#

I believe this is falsehood though (I hope)

ebon ridge
#

So if I add an openInventory handler, and some other mod does, then I remove mine, other mod can't remove its?

#

I really hope so as well because its a major design error if it works like this imo

potent depot
#

yeah I would think that would break the purpose of that command. So i would hope that would be false as well. I have not experienced any issue with this.

ebon ridge
#

I will test now hopefully docs can be updated (I didn't get write access yet)

winter rose
#

can you try and confirm? so I update the biki

ebon ridge
#

ye

potent depot
#

that would be a problem if it is true

winter rose
#

maybe it was this way in the old days though

#

like OFP/ArmA

#

ouch, this wiki sentence indeed dates back to OFP era (2006)

potent depot
#

dear lord thats old

#

That worked btw Lou

#

ty

#

should have checked rather than assuming

winter rose
#

w00t w00t!

ebon ridge
#

so add and remove event handler seem to work as we would hope, however removeAllEventHandlers, does reset the index to 0, so the next add returns 0

#

which it shouldn't really

potent depot
#

nice

winter rose
#

well, there are pros and cons I would say

#

removeAllEventHandlers is a reset, so "why not" - although I admit, if someone calls it and the other scripts are not aware of it… big damages ahead

no real reason to reset though

#

thanks for the test, updating the page now

ebon ridge
#

only con is if you hit max int with your event handlers right? if that happens you already got other problems, con is that all other code needs to know about you calling removeAllEventHandlers (which i guess people should never do basically)

potent depot
#

The main con would be residual single removes with the old indexes if the indexes get reset if could hit a different one than intended

winter rose
#

updated

ebon ridge
#

i would say a warning on removeAllEventHandlers to not use it would be appropriate. There is no way for contentious addon writers to protect themselves in this case.

winter rose
#

updated removeAllEventHandlers as well

ebon ridge
#

thanks!

winter rose
#

thanks to you too, random citizen!

potent depot
#

So why is account registration suspended for the wiki? Wanted to add a note to setGroupOwner about the dismounting issue/feature. Not that many people use the command tbh.

exotic flax
#

to prevent spam and people (willingly or unwillingly) break it

potent depot
#

shame

#

though understandable

exotic flax
#

although feel free to share your thoughts in #community_wiki so it can be added

potent depot
#

can do

mighty vector
ebon ridge
#

Hmm interesting, I am trying to debug something now where Killed EH will not run at all on first death, but only on second (or something like this, trying to narrow it down and make some kind of repro)

mighty vector
ebon ridge
#

Hopefully I can expect that if I execute

player addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    systemChat format ["KILLED EH: %1", _this];
    _unit removeEventHandler ["Killed", _thisEventHandler];
}];

in script box while alive and then hit respawn button KILLED EH should be immediately printed right?

winter rose
#

as long as you don't use an init field 😄

ebon ridge
#

no no using the Execute window

#

sadly I don't get the behavior we would expect, trying to work out why :/

marble basalt
#

anyone know how to generate a classname list of weapons from a cargo

ebon ridge
winter rose
#

that has a typo in return value btw

ebon ridge
#
_id = player addEventHandler ["Killed", { 
 params ["_unit", "_killer", "_instigator", "_useEffects"]; 
 systemChat format  ["== %1 KILLED %2", _unit, _thisEventHandler];
 _unit removeEventHandler ["Killed", _thisEventHandler]; 
}];

So if I run this say 10 times before I press respawn, it will execute every second one of them. e.g. 1,3,5,7,9 only :/
The others will be executed if I then respawn again.

winter rose
#

…in vanilla?

ebon ridge
#

Trying it now in an empty mission, then in vanilla. However how could a mod interfere with an event handler like this? Seems it should be impossible?

#

You can't intercept other peoples event handlers can you?

#

confirmed it happens in empty mission now

#

mods are cba, ace and some others

winter rose
#

confirmed in vanilla

ebon ridge
#

yep just did as well

#

wow

winter rose
#

I had 0, 2, 4
then 1
then 3

ebon ridge
#

yeah same

winter rose
#

on a local exec, of course.

#

MPEventHandler = 0-1-2-3-4 then "x was killed"

ebon ridge
#

weird

plain linden
#

Noob question

What does 1%

#

Mean

ebon ridge
#

%1 you mean?

plain linden
#

Yea
My bad

ebon ridge
#

Something is quite broken with respawn: the event handlers appear to be staying on the player unit, but only some of them. If I just execute that code once and hit respawn, and then repeat that a few times, I end up with each respawn printing multiple messages.

winter rose
ebon ridge
#

lol

winter rose
#

ninja'd 😢

ebon ridge
#

I need to report this EH bug? I can do that or only some people?

winter rose
#

you can head towards the feedback tracker, but be sure to search before creating one

ebon ridge
#

yeah i did, i can't see one about this, only about it firing twice

#

So is it intended that Killed EH travels with player after respawn or not?

#

As in even if I don't re-add these EH they still fire (every second one) if I respawn multiple times?

#

Actually no its obviously broken, I am calling removeEventHandler in the callback, so it shouldn't fire again.

#

Okay if I don't try and remove them in the callback it executes every single one

winter rose
#

so maybe the index is jumping around…

ebon ridge
#

More like the event calling code is not copying the callback list before executing the callbacks (a classic mistake in event systems). When I remove the event handler it is removing it from the list that is actually being iterated, so item 1 becomes item 0, and the next iteration executes on item 2.

tough abyss
#

Does anyone know why I can't use alive with waitUntil?

waitUntil {
  sleep 1;
  !alive player;
};

"Generic error in expression |#|!alive player"

exotic flax
#

you can use alive, just not with an ! in front of it...

#

try !(alive player); instead

tough abyss
exotic flax
#

there's a big difference between !alive and not alive!

tough abyss
#

No it's not? and neither works for me.

exotic flax
#

does the player even exist the moment you run that code?

tough abyss
#

Yes..

#

It just seems that you can't use !alive in a waitUntil

exotic flax
#

the whole wikipage is has examples full of them... so I'm sure it's possible...

tough abyss
#
waitUntil { 
    if !(alive player) then {true} else {false}; 
};
waitUntil { 
  if !(alive player) exitWith {true};
  false;
};

both give me generic error

#

100% vanilla arma in the editor after lauching and walking around for a bit I use the debug menu and run

waitUntil {
    !alive player;
};
exotic flax
#

and what happens with

waitUntil { not alive player };

???

tough abyss
#

same result

#

doesn't work on any objects neither. IE a vehicle or w/e

#

can you try it real quick in the debug menu if you're on arma rn? Just so I know I'm not going crazy.

exotic flax
#

starting her up right now 😉

#

only thing I can think of is scheduled/unscheduled...
so;

[] spawn {
   waitUntil {
      !alive player;
   };
   hint "you dead";
};
#

^^ this works

tough abyss
#

hmm yeah it's probably because I'm using the debug.. I feel stupid now. thanks!

exotic flax
#

same applies for regular scripts, although usually it's already scheduled

tough abyss
#

yeah debug calls a temp function I think. I appreciate the help and insight haha 🙂

exotic flax
#

the console is great for small things, but does require some knowledge on how scripts are executed... been there, done that notlikemeow

sage flume
#

So I've tried numerous ways to respawn with "current" loadout when killed but I can't get it to work. Can I ask for any examples to try

exotic flax
#

"current" as in "anything I had the moment I died", or as in "the loadout I had the moment I spawned in"?

sage flume
#

hey, I just now got it !

#

lol

#

never fails, work all day,....finally give in and ask somebody and then bam, got it

#

thanks anyway

sage flume
#

ok, so 2 player coop,..I respawn and my body disappears, that good. The AI or other player get killed and respawns but dead body stays. How to remove?

#

That's actually what I started to research way back this morning

exotic flax
#

and I already answered that question last week to you...

sage flume
#

yup I just read where BI AI (non-player) will not get body removed

#

I think

#

Only live players

exotic flax
#

corpseManagerMode

0 = None - None of the units are managed by the manager
1 = All - All units are managed by the manager
2 = None_But_Respawned - Only units that can respawn are managed by the manager
3 = All_But_Respawned - All units are managed by the manager with exception of respawned (opposite to mode 2)

sage flume
#

does that go into the init?

exotic flax
#

if you put it to 1 it should remove all dead bodies when the limit is reached

#

it's in description.ext, part of the mission files

sage flume
#

got ya

#

thanks !

#

my mission already has a fuction to "clean up dead bodies"

#

I just need to know if when my coop buddy dies, he respawns and his body will be gone

exotic flax
#

again; keep in mind that it only works in combination with the other garbage settings (like limit and time), so it doesn't de-spawn directly (unlike players who respawn)

sage flume
#

k

#

btw, are you a SP type player?

exotic flax
#

no, MP only

sage flume
#

rog

manic sigil
#

Is there a problem with remoteExecing a bunch of 'unit setpos getpos x's?

#

I'm trying to parse a cutscene and it would be a lot easier if I didn't have to divide the scripting up so much at this point :x

hallow sphinx
#

is there a way to assign the spectrum analyzer frequency signals to object in the platform version? im using the script from the wiki but cant figure out if i can assign the signals to an object "missionNamespace setVariable ["#EM_Values", [141.8,-30, 140.85,-50, 141.12,-40]];"

queen cargo
#

To Clarify something:
! == not and UNARY UNARY NULAR == UNARY (UNARY NULAR) aka !alive player == not alive player == !(alive player)

spiral fractal
#

in MP when player enter as driver server cant setFuel on that vehicle?

winter rose
#

…yyyes.

spiral fractal
#

usually server is the authority

#

if I execute function on server that should set fuel I have to use remoteExec and set owner _veh as second parameter?

winter rose
#

so from the server, use```sqf
[_vehicle, 0.5] remoteExec ["setFuel", _vehicle];

#

@spiral fractal ^

spiral fractal
#

ah so I dont have to do owner _vehicle I can send the _vehicle itself, I thought it should be player who is the owner of the object.

#

so when I want to execute function that is located on the server only, I use remoteExec and pass the vehicle, will it work?

winter rose
#

what I said above

spiral fractal
#

I did like 3 times already... it didn't answer all my questions

vague geode
#

@vague geode currentWeapon _killer
@wraith cloud The thing is that it only shows the current weapon of the killer but if you get killed my a granade or mine it doesn't show it properly.

winter rose
#

targets: Object - the function will be executed only where unit is local

maybe these explanations should be rewritten then

vague geode
#
params [
    "_oldUnit",
    "_killer",
    "_respawn",
    "_respawnDelay"
];
``` @vague geode 
You could however add a killed EH that would setVariable on the dead unit the weapon used

@winter rose My problem is that I don't know how to properly work with event handlers...

runic edge
#

hello guys, I'm not sure I understand the BIS_fnc_spawnObjects function : i cant give as arguments both coordinates and "sitting on the ground" ?

winter rose
runic edge
#

yeah

#

oh ok

#

the question was dumb sorry

winter rose
#

np 😄

runic edge
#

feels weird tho ^^

winter rose
#

you could always use createVehicle @runic edge

runic edge
#

in the "main syntax" of createVehicle : type createVehicle position
Is the simulation enabled ?

winter rose
#

yes

#

otherwise, there is BIS_fnc_createSimpleObject

runic edge
#

and BIS_fnc_createSimpleObject allow me to place vehicles as well via the "array" input ?

winter rose
#

Check the wiki!!1! :@

vague geode
#

Is it possible to use dynamic loadouts in warlords meaning is it possible to have the same vehicle in the list of buyable vehicles but with different loadouts?

winter rose
#

What is it that you want to do? 😅 place an object by pos, by array, by random, by Jove? @runic edge

runic edge
#

I m not sure 😬
I'd say I try to create a mission where a crate will spawn on a random position

#

I guess that the best way to do it is something like

#
private _markerArray = ["marker_0","marker_1","marker_2","marker_3","marker_4","marker_5"];
private _randnumb = floor random 5;

private _loc = markerPos (_markerArray select _randnumb);
//hint str(_loc);

"rhs_weapons_crate_ak" createVehicle _loc; ```
spiral fractal
runic edge
#

oh

#

this is good

winter rose
#

or the alternative createVehicle syntax 😄

runic edge
#

mh yes indeed

winter rose
runic edge
#

oops that s accurate !

winter rose
#

:p
a hard part of coding, indeed

runic edge
#

or the alternative createVehicle syntax 😄
@winter rose if I may, is there a way with the markers to avoid picking the same marker position twice. Like in random draw without replacements ?

winter rose
#

you cannot have a "random" that is "random without the previous random" unless you store the previous one somewhere

astral dawn
#

you can write your own random nubmer generator

winter rose
#

that's the long way, no? 😅

#

there is BIS_fnc_arrayShuffle, too

private _positions = [getMarkerPos "abc", getMarkerPos "def", etc];
_positions = _positions call BIS_fnc_arrayShuffle;

private _pos1 = _positions select 0;
private _pos2 = _positions select 1;
private _pos3 = _positions select 2;
#

@runic edge ^

runic edge
#

yeah thank you, i'm looking at the wiki

#

ok so i got it and i understand why your code is doing what i want but how on earth did you make that up: i mean its quite a tricky way to say it !

winter rose
#

am I good or am I good 😎

runic edge
#

yeah but how can i make it up by myself next time ^^

winter rose
#

what do you mean?

my brain processed it this way:

  • you want a random, but not a random that has been chosen before
  • therefore, one pick for each entry
  • therefore, randomise and pick in order
runic edge
#

That s what I meant

smoky verge
#

if I make a custom taskType would the icon appear in the slider on the module?

winter rose
#

I don't think so, but trials could prove me wrong

smoky verge
#

yeah doubted that too
also where are the default ones located?

winter rose
#

configFile >> CfgTaskTypes

smoky verge
#

oh I can just click on them to get the source file

spiral fractal
#

if he wants random from array, maybe remove the item that was chosen so it will not even exits anymore in the array?

winter rose
#

that is a solution too

#

@runic edge you could also resize the randomised array so you don't "pick" from it, too - many ways to do it 🙂

spiral fractal
#

what programming language sqf is most similar to?

surreal peak
#

rather similar to C++ IIRC

still forum
#

SQF? Maybe Javascript

spiral fractal
#

hmm from my little experience with it, I though its more like JavaScript

#

was just typing it 😄

runic edge
#

I 'll try your first method after lunch then I 'll look into the resize method @winter rose

sage flume
#

(Co-op) been working with things like save loadout on respawn, clean up corpse on respawn, movable respawn marker,...all work great now. Last thing I'm looking for is, when a player dies and does all of the above, primary weapon is still on the ground. How to clean that up, if possible?

winter rose
#

you could try to detect nearestObject(s) of "WeaponHolderSimulated" @sage flume

sage flume
#

...heading to Google

winter rose
#

the wiki would be better

#
private _weaponHolders = nearestObjects [getPos _unit, ["WeaponHolderSimulated"], 5];
{ deleteVehicle _x } forEach _weaponHolders;
sage flume
#

that def' saves time! 😉

#

creating is so much more fun than troubleshooting !

sage flume
#

I tried it in onplayrespawn, initplayerlocal, onplayerkilled, but doesn't work. 😟

winter rose
#

if you want to remove all the weapons immediately, you could do a removeAllWeapons

#

if it is on deletion, maybe use a mission EH

sage flume
#

is one of the files I mentioned the proper one to work it in?

#

onplayerrespawn?

#

or killed?

#

right now I have this

#

removeAllWeapons player;
removeGoggles player;
removeHeadgear player;
removeVest player;
removeUniform player;
removeAllAssignedItems player;
clearAllItemsFromBackpack player;
removeBackpack player;
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);

#

in playerrespawn

#

and alll that works as it should

#

sooo Ill try that

vague geode
#

@winter rose Which of the following parameters of the "MPKilled" event handler is the weapon which killed the player? params ["_unit", "_killer", "_instigator", "_useEffects"];

winter rose
#

none, I was mistaken
you would have to use a "hit" EH, but this one doesn't (always) trigger on killed

vague geode
#

Ok, but what's the difference between "_killer" and "_instigator"?

winter rose
vague geode
#

But how can those differ from one another?

runic edge
#

@winter rose made it works with a sexier typo :

private _positions = [0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] apply {getMarkerPos ("marker_" + str(_x))};

_positions = _positions call BIS_fnc_arrayShuffle;
_positions resize 6;
{"rhs_weapons_crate_ak" createVehicle _x} forEach _positions;
#

thanks for the tipSSSSSS !

winter rose
#

@vague geode _killer = UAV, _instigator = the guy that remote controls the UAV

vague geode
#

Ah, ok.

winter rose
#

(I think)

urban tiger
#

anyone know a way to make the AI completely 'not see/ ignore' any other units?

smoky verge
#

@urban tiger careless?

urban tiger
#

tried that, it then completely ignore the move point and walk through the wall 😂

winter rose
#

disableAI 🙂

urban tiger
#

there is careless and then.. there is that 😂

#

what AI parts would you even disable?

winter rose
#

what do you want to do?

urban tiger
#

ill send you a pm of what it does

winter rose
urban tiger
#

pm'd you what the AI does when it see any unit close to it

round scroll
#

is there a framework/script only solution to simulate injured loading into a vehicle, like a helicopter? I know AIS and ACE have something like this, but would look for a more lightweight solution. Basic idea is that you're the pilot, land near the injured, task a crew member to get the wounded aboard, crew member exits, supports/transports the wounded and both board the helo

winter rose
#

@urban tiger how is it walking around? waypoints?

urban tiger
#

Move.

winter rose
#

maybe AUTOTARGET & CHECKVISIBLE ?

urban tiger
#

tried that. still go 'nah' and yeets itself off the side

winter rose
#

"ALL" 😄

round scroll
#

@urban tiger if you want to have an AI that does not engage in combat, maybe try an Agent instead? AFAIK it doesn't have the combat state machine

urban tiger
#

@round scroll combat isn't the problem. The ai works perfectly fine but once a unit is close it refuse to work correctly. even if you disableAI

urban tiger
#

update ONLY does it if its a player is close. if it an ai unit and the player is no where close it works perfectly as attented

manic sigil
#

My AI pilot suddenly began skipping all the way to his last waypoint in the mission... worse, that waypoint doesn't even exist anymore, or does but has changed in number @_@

#

Does disabling and enabling simulation of a unit reset the group's waypoints?

winter rose
#

should not

manic sigil
#

Does setCurrentWaypoint account for the first scripted point being #0?

winter rose
#

it should?

#

but really, if you can avoid waypoints, do 😅

manic sigil
#

It's getting to that point, but I'm scared of the alternatives.

#

And apparently not, still going to waypoint 14 out of 13

#

:/

winter rose
#

0,0,0 I presume

manic sigil
#

No, actually where 13 is located; an arbitrary 'head in this direction, end mission on extraction' area.

#

Except now it's 'Mission's beginning, immediately leave base and stop in midair' :/

#

Fah... What would be the recommended way of doing waypointless AI guidance for more than simple actions?

#

What's weird is that I have a Pilots SetCurrentWaypoint [Pilots, 2] script that runs right after I re-enable the driver's simulation and "MOVE" ai, it just speedballs through all it's waypoints :c

#

Okay, instead of calling the group by name, I just passed Group Driver Vehicle instead and that... seems to have worked? o.0

#

... right there in the notes, "Using this command forces the last waypoint to complete. Any code in the on Act of that waypoint will run. " ... :c

winter rose
#

make a dummy last waypoint maybe?

manic sigil
#

I mean, there's no scripting in the last waypoint, but I feel like that may have been related? I don't know anymore @_@

#

Looking into doing 'get to waypoint, wait until action I want is done, pilots addwaypoint to next thing I want done'

#

Don't give them more than one waypoint at a time

winter rose
#

rewind to the very beginning of this and answer:
what is it that you want to do?

manic sigil
#

Fair

#

The players start in a base next to the pilots; the pilots run to the helicopter and start it up and open the ramp, while the players go to the armory and quick-load their inventory.

#

The pilots wait until all units of the player group including AI are aboard, then take off and head to the next waypoint.

#

I've had all kinds of issue with the waiting-for-everyone-to-get-aboard, however... from just straight taking off and heading away, to taking off and hovering 20m in the air, to the most recent - going just enough to light the wheels, then kinda drifting across the helipad.

#

I've done all manner of variations; disabling the pilot simulation, disabling their moveAI, tying a Hold waypoint to wait until the count of players inside is equal to the count of players, etc

#

It was... 'working', up until I started trying to simplify it, since there were so many code snippets from various attempts :/