#arma3_scripting

1 messages Β· Page 646 of 1

umbral oyster
#

@little raptor correct

robust hollow
#

πŸ€” this event fires after they download the mission though.

#

it should work, ive used it with remoteexec call before.

little raptor
#

are you checking the log on the client?!

umbral oyster
#

yea

robust hollow
#

try spawn instead of call and see if it logs?

umbral oyster
#

it doesnt matter, spawn or call

little raptor
#

try something else then
like ```sqf
[[],{systemChat "somde"}] remoteExec ["call",_owner];

#

see if it works

#

because it should

robust hollow
#

itl be too early for systemchat i think

little raptor
#

ok, then maybe spawn it with sleep

#
[[],{sleep 1; systemChat "somde"}] remoteExec ["spawn",_owner];
little raptor
robust hollow
#

just found the code where i do it. yea i think it happens in a small window where they both dont work. try setting a variable and seeing it if exists once you load in.

willow hound
#

Also "Sample text" remoteExec ["diag_log", _owner]; krtecek

exotic flax
robust hollow
#

well, in this case out of all the things that dont work before the player has a unit, i wouldnt expect logging to be one of them.

exotic flax
#

I believe it's more the fact that the client is signing in at the server the moment that EH happens, the server creates an "owner ID", but the client hasn't received it yet

robust hollow
#

it has though. i use remoteexeec call _owner through this event one of my mods

exotic flax
#

so the server does do the call properly, but the client doesn't know his number is being used

robust hollow
#

yea, nah. thats not correct.

exotic flax
#

could be a timing issue

willow hound
#

Pics Code or it didn't happen

exotic flax
#

Arma works in mysterious ways

#

or not...

coarse sedge
#

@willow hound I don't think I thanked you for for your help last night it was very much appreciated and help me a lot with understanding what I was doing.

raven harbor
#

I'm trying to apply the Catapult launch system from the carrier on another object, the code I've used inside the init box in EDEN is
[this] call BIS_fnc_AircraftCatapultLaunch;
Is there more that I have to do beyond this? I'm mildly new to arma scripting, but not arma configs.

jade tendon
#

I'm trying to call a function from a mod through an addAction. Is it something like "_object addAction ["Action", {["argument", 25] call BIS_fnc_someFunction}];" or do i need to expand the function to include the file structure of the mod?

raven harbor
#

uhhh I think you just use ' call '

jade tendon
#

this addAction ["Campaign Report",call fn_campaignreport];??

jade tendon
#

so i opened up the mod and looked at the function in question and it itself actually execVM's an .sqf file. Should i just run the .sqf instead or use the function?

willow hound
runic quest
warm hedge
#

Does not display how?

little raptor
#

they're already strings
you could just write: _ctrl lbAdd _x

#

also, are you sure the IDD and the IDC are correct?

#

I use onLbSelChanged run this code
If you use the EH, it already gives you the ctrl

#
params ["_ctrl", "_sel"]
runic quest
#

@little raptor Thank you, but isn't _playername an array?

willow hound
#

It is, but _x is not.

runic quest
#

ok bro tks!

tough abyss
#

quick question, if I want to create an ace interaction trigger that, when player activates it, will get disconnected from the server, what approach should I try ? Since Servercommand is not a thing anymore if I understands correctly

jade tendon
little raptor
#

it definitely isn't tag_fn_campaignreport

#

how did you set it up?

#

if via cfgFunctions, TAG is what you chose for the class name (or if you defined a custom tag using tag property, that's what your tag will be)
and the name of your function would become: TAG_fnc_campaignreport

jade tendon
#

i am trying to run a addAction on a object in a composition. so far i am at fob_mr addAction ["Campaign Report",{call TAG_fn_campaignreport;}];
I had it sort of working at
fob_mr addAction ["Campaign Report",call fn_campaignreport];

little raptor
#

that's not the question

#

what is the real name of your function?

#

if it's fn_campaignreport, then use this:

fob_mr addAction ["Campaign Report",{call fn_campaignreport}];
jade tendon
#

i am trying to call campaign report module from Drongos Map Population.
I have a laptop linked to the module in editor but i want to call it on a laptop the is spawned in later with said composition when i create a MHQ.
Function inside mod is called fn_campaignreport.sqf
Path is DMP\functions\fn_campaignreport.sqf

little raptor
#

probably DMP

hidden heron
#

Hello! I have some problem whit my mission script and i dont know why (maybe the that i dont have any script in the SetTaskState). I have 4 pictures about, so someone can write my in private to discous the issue?

warm hedge
#

Public preferred. Post your images here via imgur or some other link services, or post your pictures in private Discord place and post the links

little raptor
#

you can post your issues here
if it's a script and it's too long for discord, use sqfbin or pastebin

hidden heron
warm hedge
#

Not the post's link but images

little raptor
#

click on the image and post its link (it must end in .jpg or .png)

warm hedge
#

And well, F12 is your friend

#

So what's the question?

warm hedge
#

What is β€œthis”? { alive _x } count units sector1 == 0;?

neon snow
#

Hey there
Does setObjectTexture cache textures?
I am using it with jpgs and I get not updated textures...

little raptor
#

there's no such thing as units sector1 meowsweats

hidden heron
#

its from a previous help

little raptor
hidden heron
#

and a tutorial vid

neon snow
#

Damn it

#

Thx

warm hedge
#

Just rename the textures

#

Or, use diag exe

little raptor
#

I never said use units

warm hedge
#

I don't even see you did followed Leopard's guide?

hidden heron
#

i think that was the vid what i watched

#

thats the vid

little raptor
#

what I said is that use a trigger that executes your code when the trigger deactivates

little raptor
#

@hidden heron
instead of that use something like this:
set your trigger activation to OPFOR (whatever side you use for the terrorist)
activation type NOT PRESENT

#

that way it'll trigger when no OPFOR are present in it

hidden heron
#

sorry, my bad.

#

how can i kill all the units whit code, to test faster?

warm hedge
#

{_x setDamage 1} forEach (allUnits select {side _x == opfor})

hidden heron
#

thank you

hidden heron
#

its working! thank you again.

finite sail
#

please post a shakey portrait mode of a mucky screen from 6 feet away to show it working

finite sail
#

easiest for who?

warm hedge
#

What?

hidden heron
#

its not complicated, but i think its fun to play.

brave jungle
timid niche
#

Does vehicle event handlers have to be executed on the server?

little raptor
little raptor
brave jungle
#

call fncName

little raptor
brave jungle
#
// set defaults:
_defaultsArray = call VKN_VTT_fnc_VTT_defaultFiletext;
_ctrl_init_edit_text = _defaultsArray select 0;
_ctrl_initplayerlocal_edit_text = _defaultsArray select 1;
_ctrl_initplayerServer_edit_text = _defaultsArray select 2;
_ctrl_initServer_edit_text = _defaultsArray select 3;
_ctrl_onplayerKilled_edit_text = _defaultsArray select 4;
_ctrl_onplayerRespawn_edit_text = _defaultsArray select 5;
_ctrl_description_edit_text = _defaultsArray select 6;
little raptor
brave jungle
#

When the function inits it errors with that.. strange

Error is #_returnArray generic error in expression

little raptor
#

_VTT_fnc_VTT_ what kind of naming is that?!

brave jungle
#

PES3_Shhh its a merge thing and I haven't got around to fixing

#

its awful though I know

little raptor
brave jungle
#

I don't use any of those (perhaps I should be)
class VTT_defaultFileText{};

little raptor
#

no, you shouldn't

#

all I know is that there's nothing wrong with that script

brave jungle
#

I'll tackle it another day then, functionality is working just wanted to remove the error notice

robust hollow
#

could always just return the array instead of setting it to a variable first

#

variable cant error if it doesnt exist πŸ™‚

little raptor
#

and use params meowsweats

brave jungle
#

Poorly written... you'd hate my other functions πŸ˜„ But yeah will give that a go ty guys

timid niche
spark turret
#

Sqf - java transpiler when

hollow plaza
#

If it's possible, how could I call and change a player-specific variable which is locally generated for each player?
Basically everyone in the server runs an .sqf file which gives them the variable undercover (in the textfile, it's undercover = true; nothing else). I'd like to know whether I can use the admin debug console to change it to false for a specific player in this fashion:
player.undercover = false;

oblique arrow
spark turret
#

Player getvariable ["theName",defaultRetzrnValue]

oblique arrow
#

Something like player setVariable ["undercover", false, true];

hollow plaza
#

Just found that, but I could've sworn I tested it before to no avail

oblique arrow
#

(note that I'm assuming that the variable is in the players varspace)

#

Although I'm not sure how you'd address the specific player

hollow plaza
#

I'd guess I'm able to address them since all of them have custom variable names themselves

oblique arrow
#

Ahh yeah then

spark turret
#

You can selevt a player by its name and then either overwrite the var by using public: true or yoi remoteexec the whole thing on his machine

hollow plaza
#

player setVariable ["undercover", false, true]; Doesn't appear to be working

oblique arrow
#

how are you addressing the player?

hollow plaza
#

By their variable name

#

But I'd guess that ain't how it works

spark turret
#

Multiplayer or singleplayer?

hollow plaza
#

MP, that's where it needs to work

spark turret
#

"Player" doesnt work in MP. Gotta replace it with the players var name

#

If thats how you access the variable

hollow plaza
#

I know, I had replaced the "player" with "Logan" in this case, since that's one of the players' variable name.

#

I'd guess that the problem is that the variable simply exists within the .sqf file and not outside it

spark turret
#

Tried it without the ""? Logan should be a public objevt then

hollow plaza
#

Yeah, no "" in the code itself

brave jungle
spark turret
#

The variable exists across all computers everywhere if set with public:true

#

Tried getting the variable with Logan getVariable?

#

For debug

brave jungle
#

whats your goal here?

brave jungle
#

ty i'll read it

exotic flax
#

tbf... the answer has been give already; unit set/getVariable ["key", value]; is exactly what you're looking for.
How you implement it is something else

brave jungle
#

πŸ”Ό

hollow plaza
#

Tested Logan getVariable "undercover"; and it returned false after the other tests, at mission restart it doesn't return anything.

slim verge
#

bit of an odd question, am wanting to look at the code for https://community.bistudio.com/wiki/BIN_fnc_setRagdoll to see how they do it in comparison to the way Killzone kid did his, which was basically to createvehiclelocal a small item give it a lot of mass and setvelocity to it when attached to a body part.
I know the function is most likely in Contact/addonsfunctions_f_contact.ebo which is binarised and i cannot open it well, unless i went to the dark side to find a tool which am not particularly interested in doing, so if someone has the ability to see the code for thios function can then advise me if BI do the ragdoll call any differently ?

spark turret
#

Well you set it to "false" with:
player setVariable ["undercover", false, true];

hollow plaza
#

Exactly

spark turret
#

So its working

hollow plaza
#

It wasn't the same undercover variable, as at mission start it's true

#

But in this case it didn't return any value

exotic flax
#

but that is just stupid if you want to be able to read that value from the server...

spark turret
#

Then your implementation is wrong and your script doesnt set the variable correctly

exotic flax
slim verge
#

tried that not listed

hollow plaza
slim verge
#

tried search configfile all/all for setragdoll not listed

exotic flax
slim verge
#

setvariable attaches itself toi an object setvariable["varname", value, true]; broadcasts it across the network to all nodes so if you want to read the value you can do it from anywhere

spark turret
#

Correct

#

If you cant read it on the server, you did sth wrong setting it

slim verge
#

as long as the object is notcreated local (and even if it is you can broadcast the object globally) then there is no reason you would not be able to pick the object vars up from another node, try first debugging if the object isnil or not

hollow plaza
#

I added player setVariable["undercover", true, true]; to the .sqf file, which can be called from within the debug console. Now the value existed in the server as well, however, it threw me an error when the script was meant to do something with the variable

slim verge
#

sytemchat format ["does this object exist %1",Isnil"Objectvarname"];

spark turret
#

Diag_log[myValue,and, more];

#

Then check .rpt file

slim verge
#

also at the start of your script add something like systemchat "My script running";

systemchat "It has got this far in the script";

little raptor
hollow plaza
#

The script has hints that activate, now the problem is simply that undercover is undefined

slim verge
#

basic debugging, prove the script runs, prove it runs as far as you need to check and prove the values that you think should exist and what value they are

spark turret
#

πŸ‘

hollow plaza
#

The script itself worked flawlessly, I just need to change the undercover variable to make it public, that's all pretty much

spark turret
#

It obviously does not πŸ‘€

slim verge
#

so you would put a debug line just before and just after the line that adds the setvar

spark turret
#

Check var with debug, change it, check again if it worked

#

Arma 3 vm with stepper when

slim verge
#

i would use systemchat all the time instead of a hint, you can scroll up systemchat, hint can get overwritten in an instant

spark turret
#

Diag_log is even better

#

Write into the log file

slim verge
#

yes doaglog if you want to look through the rpt, onscreen is much quicker for basic stuff

willow hound
#

Imagine starting A3 without -nologs...

hollow plaza
#

Through debug, the value does work and getVariable returns true, as it should, but the script doesn't recognise undercover as an existing variable

spark turret
#

Impossible :insert meme:

slim verge
#

so these are the type of things that can screw you over....

  1. You add a debug line t the start of the script so you know it is running, however before the line of code that is causing you a problem, you have a while loop that is not terminated correctly eg no '}' or a continuous loop, so it never gets to line 31 your setvar line... so always debug just the line before and the line after then at least you know the line has run, at that point you can debug the line itself
spark turret
#

Just post your code in hatebin or sqfbin and show us

slim verge
#

never assume always verify

spark turret
#

Very true

slim verge
#

I wrote this 6 years ago, always worth a read and one of the most basic skill you need to master.. https://forums.bohemia.net/forums/topic/166233-zeu-debugging-tutorial-foundation-template/

spark turret
#

oh nice

hollow plaza
#

I guess now I just need to ask, how do I make a variable that can also be called with getVariable/setVariable through server

slim verge
#

@hollow plaza the answer to that is setvariable to define and getvariable to read

spark turret
#
 dude setVariable ["thisIsMyPublicVar","this is a value",true];```
hollow plaza
#

I tried only using setVariable to define it, but it later said that a variable by the name of undercover does not exist

willow hound
spark turret
#

if you dont show your code, we cant help

slim verge
#

am assuming the server has problems understanding the object player , as that is not an object on a dedi server so try attaching it to the unit the player is taking in the init field of the unit

#

again though no code snippet all guesswork

#

give the unit character a variable name such as P1 and then attach the setvar to the p1 object not the player

#

think of it this way if you have a 40 player coop how will the server know which object Player is, it will most likely return player as objnull, never actually tried to test that

hollow plaza
#

I think I should just edit the code so that instead of having it see whether the player's undercover status is true/false, it checks whether they're civilian or guerilla with side. I likely just made it too complicated for myself and everyone else.

slim verge
#

you are still going to be checking an object on a dedi server called player

spark turret
#

i think you should show your code

hollow plaza
#

That somehow works with player, even in MP

spark turret
#

im betting two whole cookies that its a logic error

slim verge
#

how many player slots in the mission ?

hollow plaza
#
[_player] execVM "Disguise.sqf";

This is the initPlayerLocal.sqf and this is what makes 'player' work in the script

willow hound
#

player always works in initPlayerLocal.sqf and anything execVM'd from there...

slim verge
#

well the player object is local on the node it runs which is the client, so it will recognise player, the server however wont

#

You need to give the object the player is running the setvar on an id/varname

hollow plaza
#

Don't worry about the fact that the setVariable is currently a comment

#

Basically, at the current form it works completely fine, I just can't call and/or change the variable undercover. It's not the world's end for me as I know how to fix that problem by just getting rid of the variable in it's entirety.

slim verge
#

ok some basic concepts first.

#

mm shouldnt If(primaryWeapon player + secondaryWeapon player + handgunWeapon player != "" && a)Then{
//undercover = false,
[player] joinSilent Rebel,
hint "Cannot be undercover due to visible weapon",
player removeAction _undercover0,
player removeAction _undercover1,
a = false,
b = true,
c = true
};

BEIf(primaryWeapon player + secondaryWeapon player + handgunWeapon player != "" && a)Then
{
//undercover = false;
[player] joinSilent Rebel;
hint "Cannot be undercover due to visible weapon";
player removeAction _undercover0;
player removeAction _undercover1;
a = false;
b = true;
c = true
};

#

notice termination of lines with semicolon not a comma

hollow plaza
#

That's how I've always done it, the reason why I use a comma here is because I originally saw someone much more experienced using it instead.

slim verge
#

this is sqf right ?

hollow plaza
#

Yeah

slim verge
#

been doing this since 2002 and first i ever heard that, what was the reason behind it

spark turret
#

uh

hollow plaza
#

I've previously only really worked with Java, JavaScript, HTML and CSS so this is all mostly new. I think one of my scripts in the past didn't work when I had a semicolon instead of a comma

spark turret
#

that doenst look right. never seen a comma

slim verge
#

sqf commands are always terminated with a semi colon mate

hollow plaza
#

Understandable, neither have I before coming into Arma scripting

willow hound
#

For the love of god, please use syntax highlighting krtecek
```sqf
[CODE]
```

slim verge
#

ok so go with semi colon unless someone like dedmen can explain the reasonming behind that, maybe it was done in a different contextr that you didnt quite grasp, commas are used to seperate array entries

hollow plaza
#

Yeah, I do understand that much from my 3 years of doing Java.

#

I assume it was not at fault here though

willow hound
slim verge
#

and the second thing i noticed is your if statement
if(A and B and C and D)
You can optimise this more by
If(A)then
{If B) then

The way the engine works with an if statement it processes the full line checking all A,B and C in one pass, if Not A it still checks B and C so nest the if's

willow hound
hollow plaza
#

Ah, I tried to find if there was an 'else if'-type of a thing I could use but didn't find any, guess that'd work as well.

slim verge
#

so why do you need to check the player object setvar on the server, am not sdeeing any reason in the code

hollow plaza
#

That's exactly the problem, the script does not include every scenario when the player should have their undercover status set to false

#

So I decided that it'd be better if I can manually do it when needed

willow hound
#

Is nobody going to point out that this entire complicated construct is unnecessary because the relevant code should be placed inside the addAction instead of a while loop?

slim verge
#

oh and 1 more thing, you are using global vars such as A, B and C, if you sare running badly coded stuff from other content developers and they are not using tags you may get a conflict. it is common practice for any content developer to use global tags on their global vbars, for example for A=, mine would be TXU_A=

hollow plaza
#

Like the weapon checker, it prevents you from using addAction while you have a weapon equipped

slim verge
#

if the objective of the script is to stop AI shooting your player when he is unarmed, then there are better methods

willow hound
slim verge
#

addaction copnditions loop very fast, much better to remove and readd actionsa

#

excuse my typos fat hands on a small keyboard

hollow plaza
#

This is all a learning experience for me either way, this being the second functioning script I've ever done on my own.

#

First one was a speed boost that is much more simple

hollow plaza
#

Luckily I only use mods I require, nothing too extra.

slim verge
#

global vars are great for player objects on local node, much quicker to grab abd set that setvar, but not as good for networking vars for an object, setvar much better

hollow plaza
#

I checked that as well, but decided not to use it yet, as doesn't that not actually change your side?

#

I'm pretty sure setCaptive makes you seem like a civilian for everyone, but doesn't consider you as one? Not 100% certain though

slim verge
#

it stops the ai from seeing you as a threat and not engaging you, there was no context in your script as to the reason for joining a group, just thought it might be easier

hollow plaza
#

Oh right, I kept it this way since I don't want players being on OPFOR side to prevent them from using OPFOR spawn

#

Currently they become civies on mission start, upon using the undercover script and when they die.

#

So they'll always use the civi spawn points

slim verge
#

well you can get around that by using an OnRespawnEH and setpossing them to wherever you need them

hollow plaza
#

What if there are multiple spawn points that I also need to change from time to time?

exotic flax
hollow plaza
#

Currently at mission start there's only OPFOR spawn and civi spawn will be added via Zeus, since I also need to be able to remove it when needed

slim verge
#

well that makes it more complicated. As far as i can tell, you basically want a player to join an enemey to the AI group when they take their weapons out and leave the group when they hide their weapons so that they dont get engaged, on respawn you are most likely using a bis respawn template with multiple respawn_side_X markers

#

Thx Grezvany13, afaik i am running the dlc will need to recheck

#

so i dont know why you need to read a setvar on a player on the server node

hollow plaza
#

Yeah, the OPFOR spawn is respawn_east, but that's the only respawn marker

slim verge
#

why dont you add them to resistance and just setcaptive true/false

hollow plaza
#

Can't do resistance because there's hostile AI on both West and Ind and they also fight each other.

slim verge
#

so you have 3 sides on the map ? already not inclusing the player

#

and every side is hostile to the player ?

#

civ is always friendly to resistance afaik

hollow plaza
#

Basically West are the main threat, Ind are the ones that attack everyone, East are the player's allies and who they join. Civies are there as collateral and as a neutral group to go undercover as

slim verge
#

i would switch that have resistance as civ friendly which they are, unfriendly to both east and west

hollow plaza
#

I have to do it this way due to the fact how a modded faction I'm using is made

#

West are Combine, East are Rebels, Ind are Headcrab zombies.

#

I could switch 'em around, but I likely need to spawn in some of my own through Zeus and would then have to change their side immediately

slim verge
#

ok still dont understand why you need to read a setvar placed on a player, from the server node,

hollow plaza
#

Basically, if a player throws a grenade, they should lose their undercover status

#

There are hundreds of scenarios where they'd be engaged, but I don't have the time to script all of them in.

slim verge
#

ok so why do that on the server, fired EH locally on player could be used for that

#

and much more efficient

hollow plaza
#

How does that work from my standpoint as a Zeus?

slim verge
#

that i dont know

#

why would a zeus need to monitor that ?

hollow plaza
#

That's exactly my problem, I feel that I couldn't script in everything I need, either due to a lack of time or expertise

slim verge
#

ok so what exactly do you want to happen when
A) A player arms himself with a weapon,
B) throws a grenade
c) fires any weapon

hollow plaza
#

They lose undercover status and become OPFOR. I will script those in later, but I always gotta have a plan B

#

There's situations that I couldn't do without Zeus management, like having AI search someone's inventory, making them surrender, cuffing them and bringing them to a jail or shooting them if they run away.

willow hound
#

Rough sketch without loop:
initPlayerLocal.sqf:

player addAction ["Go undercover", {_this call JMAN_fnc_undercover;}];
````fn_undercover.sqf`:
```sqf
if (/*has a weapon*/) exitWith {
  systemChat "You can not go undercover because you are carrying a weapon.";
};

player removeAction (_this # 2);

if (player getVariable ["JMAN_undercover", false]) then {
  /*do more stuff here if you need to...*/
  player addAction ["Go undercover", {_this call JMAN_fnc_undercover;}];
  player setVariable ["JMAN_undercover", false, true];
  systemChat "You are no longer undercover.";
} else {
  /*do more stuff here if you need to...*/
  player addAction ["Stop being undercover", {_this call JMAN_fnc_undercover;}];
  player setVariable ["JMAN_undercover", true, true];
  systemChat "You are now undercover.";
};
slim verge
#

ok if i were to create such a system, i would probably just use a fired EH to reveal myself as an enemy and join the rebel group. I would have an addaction to hide my weapons in my rucsack, or some way of virtually hiding them, using a setvar on the player to keep track on the weapons virtually hidden.

#

If i wanted to change my threat status on tasking equipment i would then use a Take event handler. All this is done locally on the player machine.

#

If you wanted to check if the player was undercover or not i would add him to a global array that is publicvariabled and removed the same way.... if you need to check remotely if that player is revealed or not

exotic flax
#

I would start looking at scripts which already have it, instead of trying to reinvent the wheel πŸ€·β€β™‚οΈ

#

Antistasi already has a perfectly fine working undercover system in place

slim verge
#

^ there ya go

brave jungle
#

remember to credit πŸ˜„

hollow plaza
#

I did consider that, but stealing scripts just doesn't seem right if I don't understand jack about them.

slim verge
#

if you were to credit correctly nearly every script you read is an evolvement from back in OFP days where you will be crediting the true creators like BN880 and Killswitch and so many other names i have forgotten, very little of todays scripting is truly unique and also it is the way the community has and should be to openly allow use of their content, unless of course you are from the Life servers who think it is all their own unique content,

hollow plaza
#

I looked into a few scripts others have made, but it always seemed like they had way too much or they were way too complicated for me to be able to edit them into my own usage.

exotic flax
#

"better to steal something working, than making something broken yourself" 🀣
It's not about stealing code, it's about learning how they do it πŸ˜‰

slim verge
#

i made something a long long time ago called TX_Utils, which was basically a set of scripts, there is a framework that exiosts today, a very popular one that uses or used a lot of that content to create their first frameworks, no credit given to me, am not bothered in the slightest because it is getting used to create content for what i think is a great game and great community, that in itself is more gratitude than i could ever ask for

hollow plaza
#

I'm way too stubborn to change my ways

#

I guess I'm just used to learning via trial and error

slim verge
#

well you can check the scripts out, it gives you insight into how it can be done and maybe you can make an improved version of it for your mission that someone will later use, further develop etc and the chain goes on into Arma4, win win for me

#

so yeah look at the antistasi system it will be a copy of someone elses and most likely improved upon as new commands are made available

hollow plaza
#

Oh well, I guess I'll just edit my script to check side instead of undercover status for now, but thanks ya'll for the help either way, I've definitely grabbed a few things that'll come in handy later from our conversations.

unreal scroll
#

Are the blood spots on a body hardcoded? Can I recreate it with a script, not hurting the character?

willow hound
#

I guess they are engine-side, but maybe somebody else knows more.

unreal scroll
#

Shortly: players in my free campaign use mostly the captured german uniform. I want them to use mostly allied uniform.
I've already done with the script that make allied AI units to accidentally shoot player in german uniform, but I need to lower the amount of loot which could be used. I can't remove the uniform from a body, because it would look odd.
Ideally, the uniform should be changed to something similar, but with the blood spots. But, as the number of different uniforms is large enough, it can't be the only one uniform type.
Hm, maybe there is a way to restrict the player to grab the uniform from the dead body? Like blocking the uniform slot, like it could be done with radio/GPS/... slots?
P.S. Oh, seems like I found it: https://forums.bohemia.net/forums/topic/178628-lock-uniforms-and-helmets-so-they-cannot-be-removed/

unreal scroll
#

How can I found the hit selections regions in graphics?

winter rose
unreal scroll
#

The HitPart EH has the hitselection parameter, the names of body regions are the "spine1", "spine2" etc.
I want to know where on the model it is exactly.

unreal scroll
#

I'm not asking about names, I can retrieve it via the EH πŸ™‚

winter rose
#

(there is no "hitpoint position" afaik)

unreal scroll
#

Don't you think it is much better to just hit the part and see the hitselection name with the hint, than to seeing the relative coords? πŸ™‚
The colmesh with the parts would be very handy.

winter rose
unreal scroll
#

Seem like you don't understand.
There are some regions on collision mesh, which are related to hit region names.
So no matter where you hit exactly inside this region, it should be, i.e., "spine1".
There are images for some 3D games which allow do see the collision mesh regions, or "hitboxes" - to know where you need to aim.

winter rose
#

ah, yes
but no, not available from within the game afaik

unreal scroll
#

Sad. Need to hurt AI soldiers again.

Is there any way to restrict taking something from a box? Like a uniform?

winter rose
#

remove uniforms from the box 😬
none I know, Google will know better than I do that's for sure

unreal scroll
#

"remove uniforms from the box"
Not an option, it contains items. If I would even remove it, keeping the items, then it will be dropped into the ground (if the container itself is the dead body) - not good.

tiny wadi
#

If you want to visualize the "hitboxes", im pretty sure you could just draw icons on all of the units parts

#

This video is an example of what I mean

#

@unreal scroll

winter rose
#

that's selection locations, not hitboxes he wants

tiny wadi
#

Right, wont be exactly true

#

Also, for restricting things from boxes you can use the inventory event handler and check what was moved, if it was something you don't want then move it back

finite sail
#

that video is cool plato

#

i like that

tiny wadi
#

Yeah that video is a great as well. I had issues where I was trying to draw stuff but was getting a weird jumpiness, it had to due with drawing visual vs simulation?

finite sail
#

yes

#

you can see how visual is less 'lagged'

meager gust
#

Would anyone be able to get into a call with me to help with editing buy menus and such? Im not too familiar but I want to edit a buy menu from a mod I got, if anyone can help me out with this, I would really appriciate it.

exotic flax
#

if you have specific scripting questions you can ask them in this channel by providing the issue you have and the part of the code where the issue is.

#

one-on-one support is usually not possible, plus thousands of people looking at your problem is better than only one

jade tendon
#

can you call a .sqe just like a .sqf?

winter rose
jade tendon
#

it is what a eden editor composition is written to

winter rose
#

ah thanks, I don't know then

#

what does it look like inside?

#

(if you can pastebin it)

jade tendon
#

1 min

winter rose
#

thanks - nope, you cannot
it is a config, with angle, (relative) position etc

jade tendon
#

ok ty

brazen lagoon
#

Not sure if this goes in here or #arma3_scenario but its kind of in between - anyone know of a good way to make AI panic when fired on by unseen troops?

#

i've tried LAMBS and while it should do what I want it doesn't seem to

high marsh
#

What exactly do you want to do? there is an event handler called firedNear which you can use to detect how close the firer was to the unit. Could use that.

high marsh
steep coral
#

good day dear gurus. please tell me how I can make a fog in a certain place by coordinates? is there any pos parameter for setfog?

cosmic lichen
#

@steep coral There is no such feature sadly

warm hedge
#

You can use particles however, but not an ideal solution

steep coral
#

@cosmic lichen Sorry, but do not tell me in which direction to dig? I need a territory in the size of 3000x3000 to do with fog, tried through the particles, but the fps is very much pid (((it is expected that the server will be about 80-90 people online... I don't know what to do((((

#

@warm hedge unfortunately, the particles do not fit, a very large loss of fps

cosmic lichen
#

What you could try is to create fog when players enter the area.

#

ah nevermind

#

fog has global effect

warm hedge
#

I assume your usage of the particles is not in a proper density

pliant stream
#

particles for this is insane

warm hedge
#

Uh, well 3km by 3km? Ahem forget what I said

pliant stream
#

even if you could control fog per client it might not give you the effect you want, depending on map

#

fog in games is generally non-directional, so e.g. if the fog is only in a valley that is accessed by some winding canyons you could seamlessly apply more fog as the player traverses the canyon

steep coral
#

@pliant stream this is understandable, but after all, in order for the fog to originate, you need a point from which you need to do this? Or don't I think so?

pliant stream
#

this is the situation you get into if you apply fog based on player location

#

done like this it would work because you can force the player to go through a narrow corridor where you can seamlessly appy the fog

unreal scroll
#

addItemToUniform command doesn't work for dead bodies? πŸ₯΄

pliant stream
#

anyhow it's kind of a moot point since you can't control fog per client anyway

steep coral
#

@pliant stream I understand all this perfectly... thank you very much for the explanation and for the help.... it is a pity that it will not work out planned(((

unreal scroll
#

@little raptor Maybe you know how to remove items from a deadbody?
Short description: when I try to restrict changing the uniform from a dead body, I restore the uniform and its items from a saved variable. But, after uniform change (inside the Take EH) my old uniform doubled in a body inventory. How can I delete it?

little raptor
#

Why don't you just lock its inventory?

#

I'm not sure if it works, but if it does it's way better and safer than what you're doing right now

unreal scroll
#

The inventory need to be opened for loot, except for the uniform. Ah, no, my uniform container is dropped to the ground πŸ™‚ So just need to remove it...

runic quest
#

excuse me, if i want to watch my friend after i dead, what command i should use? tks!

pliant stream
#

@steep coral

crystal rune
#

Is there method/script to drop leaflets without the use of the drone?

tough abyss
#

does anyone have good earplugs script ?

little raptor
tough abyss
#

ok i will try thx

little raptor
#

@tough abyss

TEST_fnc_earPlugs = {
    params ["_target"];
    _target addAction ["Earplugs on", {
        params ["_target", "_caller", "_actionId", "_arguments"];
        
        0 fadeSound 0.35;
        
        _target removeAction _actionId;
        
        _target addAction ["Earplugs off", {
            params ["_target", "_caller", "_actionId", "_arguments"];
            0 fadeSound 1;
            _target removeAction _actionId;
            [_target] call TEST_fnc_earPlugs;
        }, [], 0, false];
    }, [], 0, false];
};

[player] call TEST_fnc_earPlugs;
#

just something crude I made rn

viral nebula
#

Hello, ehm. I have a question. I was using Enigmas Patrolled Areas for a mission to reduce FPS Problems in a city. The script works pretty good and it solved my FPS issues. Problem is. The enemys Spawn somewhere in the markers Area and not in the centre. And so, when my group tested the mission yesterday, enemys spawned often right into our face. or Back. or in us. or in our MRAPs. I found out so far that enigma used a custom script command "dre_fnc_CL_GetRandomMarkerPos" to determine the postion of the groups within the marker area, so I know want to replace this, that the AI spawns in the centre of the Area. I thank you for your help in advance

#

the enitre script command for the spawn position:

#

`PATAREAS_GetRandomMarkerPos = {
params ["_markerName"];
private ["_pos"];

_pos = [_markerName] call dre_fnc_CL_GetRandomMarkerPos;
while {surfaceIsWater _pos} do {
    _pos = [_markerName] call dre_fnc_CL_GetRandomMarkerPos;
    sleep 0.02;
};

_pos

}`;

little raptor
#

actually nevermind

#

you said you wanted the center of the marker

#

so just use:

_pos = getMarkerPos _markerName;
viral nebula
#

thx, I will try that!

crystal rune
little raptor
little raptor
# crystal rune Not sure why i didn't think of that, thanks very much man!

it appears it can't be done like that! πŸ˜…
you might be able to create a helper drone

_drone = createVehicle ["B_UAV_01_F", getPosASL player vectorAdd [0,0,100]];
_drone hideObjectGlobal true;
createVehicleCrew _drone;
_drone addMagazine "1Rnd_Leaflets_West_F"; 
_drone addWeapon "Bomb_Leaflets";

_drone fire "Bomb_Leaflets";
sleep 1;
deleteVehicle _drone
crystal rune
#

Oh, i appreciate the update and suggestion.
This was my train of thought previously on how to do it, thanks for sending that. I'll give it a shot πŸ™‚

umbral nimbus
#

{{if (side _x == west) then { _x addEventHandler["Hit",{ hint "FRIENDLY WAS HIT"; }; }; }forEach allUnits;

#

anyone has a clue why I dont get the hint when I hit Bluefor?

austere granite
#

Double curly bracket on opening

little raptor
#

the actual reason is unclosed curly braces

#

the first one never closes

#

also missing ]

#

that's why you should always indent your code properly

umbral nimbus
#

the indent happend with the copy paste

#

the wrong indent

#

Just got blind staring at it

#

funny thing is that I got no error as usual and the sqf just continued at it should.

#

Thanks it was the extra accolade indeed

little raptor
umbral nimbus
#

yeah gotcha that too

#

Something must have gone wrong when copying from my original script

#

leaned on my keyboard or something

tough abyss
#

Hello i want to create a script that changes the object texture from a vehicle for example when i spawn a qilin it should load texture for the qilin. Can someone help me ?

little raptor
#

do you use CBA?

tough abyss
#

No

little raptor
#

how do you create the vehicles?

tough abyss
#

I have a script for spawning vehicles

little raptor
#

and the vehicle types can vary right?

#

for example
qilin -> qilin texture
slammer -> slammer texture?

tough abyss
#

Yes i can select them and then i press spawn

little raptor
#

you can use an array for that
for example:

_objectTextures = [//pairs in format: [vehClass, Texture]
  ["B_MBT_01_F", "path\to\slammer\texure.paa"], 
  ["B_QILIN_01_F", "path\to\qilin\texure.paa"]
];
_veh = createVehicle [_vehClass, _pos];
_vehID = _objectTextures findIf {_x#0 == _vehClass}; //does the veh class exist?
if (_vehID != -1) then {//exists
  _veh setObjectTextureGlobal [0, _objectTextures#_vehID#1]; //select the texture from the array
}
tough abyss
#

Ok thanks

#

Can I use B_Qilin_01_FsetObjectTextureGlobal [0, texture.paa];

For example

little raptor
#

no

#

it has to be an object

tough abyss
#

Mhm ok i will try

queen junco
#

Hey, I have an issue with my script. I am trying to cancel a execVM. According to bohemiawiki it should work with terminate.
Basically I got a holdaction what executes another execVM with the following code:

hint "test";
_alarm = [] execVM "alarm.sqf";
sleep 5;
terminate _alarm;

The hint shows up, so the script runs just fine. But I get an error message telling me "_alarm" is not defined. Does anyone knows what my mistake is?

willow hound
#

@queen junco Can you post the full BIS_fnc_holdActionAdd call?

queen junco
#

Used the EdenEnhanced interface, so I dont really got the code for it...

#

It says the error is in line 4 though. Is it possible the terminate command is no longer usable?

willow hound
#

I doubt that. Can you post a screenshot (use either #screenshots_arma or an image host) of your Eden Enhanced hold action?

#

I see. With that setup, _alarm is not available in cancel_alarm.sqf because it is a local variable (indicated by the _). It needs to be a global variable (something like Alarm) to work in this case.

queen junco
#

okay, I will try that. thx for the effort ^^

willow hound
#

Unless you need that trigger for something else too, you can put execVM "Scripts\cancel_alarm.sqf"; directly into the Code Complete box of the hold action.

queen junco
#

I just found my error. I used "alarm.sqf" instead of "Scripts\alarm.sqf" -.-

#

Thanks for your help

fair drum
#

if I want a check to see if the mission was loaded only in singleplayer, I use isMultiplayer right? not some combination of isServer etc etc. Just looking to make it force quit if started in singleplayer.

random loom
#

Would "MPKilled" work otherwise?

#

Only need it to check two units on a server.

fair drum
#

yeah you can use that one too

winter rose
#

there is also isMultiplayerSolo…

fair drum
#

oh dangit, wrong button. hope you didn't hear that, accidentally hit text to speech

winter rose
#

too late, you are banneded!

manic sigil
#

Is it possible to create unique units for missions, such that they have their proper name and not '5: Recon Marksman' when you look at them, within the mission, or does it have to be an addon? Or am I confused as to what an addon is? o_o

winter rose
#

but you can give them an Identity

manic sigil
#

Blahhh. Yeah, I got them named and ID'd so the player name doesn't overwrite them and all, but I want that snazzy 'CSAT Sgt. Rahman' when you're looking at them.

#

(Really, there's no generic Hexagon emote?)

winter rose
manic sigil
#

o.0 I may be missing something, but that's the french flag, no?

winter rose
#

yes, and France is nicknamed the Hexagon, because of its shape πŸ˜‰

manic sigil
#

Huh. TIL.

#

Anyways - is there a handy guide for making the... I think it's config.cpp file, and how to call it? I think I have the wiki articles, but it's still a bit much to wrap my head around.

winter rose
#

that would be #arma3_config, and it is not my turf either. but you could script a hover text though, if you want πŸ™‚

manic sigil
#

Oh boy, a new channel to bother πŸ˜›

And yeah, I tried the built in named hex thingum, but didn't like the look of it :x

brazen lagoon
#

might try just using vcom and not lambs

manic sigil
#

It is possible to change the color and alpha of BIS_fnc_EXP_camp_IFF? It'd be perfect if it wasn't squinty-eyestrain light blue T_T

robust hollow
#

color yes, alpha no. it sets BIS_iconColor = [0,125,255]; at the start of the function, and hardcodes the alpha when drawing icons.

#

didnt realise 256 color worked in drawIcon3D, thought the wiki said only 0-1 worked πŸ€”

manic sigil
#

It is percentile based, not 256.

#

That's better, though while red would be appropriate, without the alpha it's still hard to read T_T

high marsh
#

@brazen lagoon I don't really know if you would consider this a "panic" function. But this is how you would start.

#
params[
    ["_unit",objNull,[objNull]] 
];
_unit addEventHandler["FiredNear",{
    params["_unit","_firer","_distance"];
    if((side _unit) != (side _firer)) then {
        if(_distance < 50) then {
            _unit doMove ([_unit,1,5,0,0,0] call BIS_fnc_findSafePos);
        };
    };
}];
#

it's a little tricky, as if they see you or know where you are they'll just try an engage you. Which you would use the disableAI command for.

brazen lagoon
#

yeah its more like

#

i want them to run for cover when fired upon by an unseen enemy

#

lambs is supposed to do this but i haven't seen it work correctly, they seem to just freeze

#

I didn't know about the FiredNear eventhandler. is this something that's going to be a performance problem?

high marsh
#

not inherently no. But when you add something like this to a couple of big groups it might hit a little bit. Thankfully since we're talking AI these can be created on a HC to offload that a bit.

brazen lagoon
#

yeah I have a lot of HCs

#

so this is just run local on the machine that the AI is on I assume?

high marsh
#

yeah, you would pass the AI object as your first parameter.

#
[blahUnitBlah] call mid_fnc_enemyPanic;
#

so yeah it seems that the enemy insist on trying to find the shooter before moving. So you would need disableAI

brazen lagoon
#

thats probably the issue that's happening

#

they're probably supposed to panic, but because the knowsabout is too low, they try to find where the shots are coming from before actually doing anything

high marsh
#

yep. The above function disables the related AI functions and moves them to a safe pos first then re enabling. However, this example is seriously flawed. If you fire again, they panic and do the same thing over. So they endlessly panic πŸ˜„

brazen lagoon
#

right

#

so you'd want to do something like

#

check the stance, if it's idle or safe, then panic

#

in the panic set the stance to combat

#

so the next time you fire near them they're in combat already and won't panic again

high marsh
#
#define panicCount (_unit getVariable["panicCount",1])
params[
    ["_unit",objNull,[objNull]] 
];
_unit addEventHandler["FiredNear",{
    params["_unit","_firer","_distance"];
    if((side _unit) != (side _firer)) then {
        if(_distance < 50) then {
            hint format["%1",panicCount];
            if(panicCount < 5) then {
                hint format["%1",panicCount];
                _curPanicCount = panicCount + 1;
                _unit setVariable["panicCount",_curPanicCount];
                _unit disableAI "checkvisible";
                _unit disableAI "AUTOCOMBAT";
                _unit disableAI "TARGET";
                _unit disableAI "SUPPRESSION";
                _unit setSpeedMode "FULL";
                {_unit forgetTarget _x} forEach (_unit targets []);
                _unit doMove ([_unit,1,5,0,0,0] call BIS_fnc_findSafePos);
                _unit spawn {
                    waitUntil{unitReady _this};
                    _this enableAI "checkvisible";
                    _this enableAI "AUTOCOMBAT";
                    _this enableAI "TARGET";
                    _this enableAI "SUPPRESSION";
                };
            };
        };
    } else {
        if(panicCount >= 5) then {
            _unit setVariable["panicCount",0];
        };
    };
}];
brazen lagoon
#

wouldn't it be better to do it based on stance?

#

cuz this will just panic over and over no matter the stance

high marsh
#

nope. it counts up everytime a enemy has fired near the unit. The limit being 5. So after it hits 5. It'll stop all panic functionality

brazen lagoon
#

ahhh

#

i misread how the panicCount var worked

#

yeah cool

high marsh
#

you can change this on if(panicCount < 5) and if(panicCount >= 5)

high marsh
#

haha. Im slow today. should be _unit

#

Boom fixed

tough abyss
#

So, I've tried to script carpet bombing using the tutorial of a youtuber called day z medic, and I did it, it worked
Now, could it be possible to script 2 or more Attack helicopters with move way points and those move way points to contain weaponForceFire and selected type of weapon to be fired at a certain position, like a strafe run basically. Is it possible?

winter rose
tired viper
calm badger
#

Hey does disableAI affect vehicle AI?

#

i'm trying to get a helicopter to stop bouncing up and landing again whenever AI try getting in

storm arch
#

Hey I have a simple addaction which spawn a tempest. When it spawns, how would I name the truck so it can be deleted layer on?

robust hollow
#

myTruck = createVehicle ...

high marsh
winter rose
high marsh
#

certainly not.

fair drum
#

if I don't want to disableUserInput, how can I disable a player from moving and just allow them to look around?

robust hollow
#

something like this

findDisplay 46 displayAddEventHandler ["KeyDown",{
    [
        "MoveForward",
        "MoveBack",
        "TurnLeft",
        "TurnRight",
        "MoveLeft",
        "MoveRight"
    ] findIf {inputAction _x > 0} != -1
}];
#

obviously you would have some extra conditions with it so it isnt always blocking

fair drum
#

do the playmove/switchmove series block inputs but allow viewership?

robust hollow
#

some animations do yea. i dont know if it is a result of the command or the animation.

#

you should look into the campaign missions to see if they do anything more than just playing an animation

gray hull
#

Howdy gamers, quick question regarding BIS_fnc_fadeEffect. Lets say, theoretically, I have two seperate callings of this, one to fade in, then one to fade out.

Why is it that, if I have it fade in first, the fade in overrides any music that might play from the fadeout. .

(I'm genuinely not certain if this is GUI or scripting, since this is being ran as a script, but I know the effect itself is related to the GUI. The issue is more related to the functions killing of music that should be included via fadeout.)

#

Before you ask, theoretically speaking, the fade in and out shouldn't be overlapping.

robust hollow
#

no idea 🀷 the wiki says the music parameter is only for fade out, and the function header says it only works with fade in.

gray hull
#

yeah, wiki kinda confusing here.

robust hollow
#

well... fade out doesnt even play music. it turns down all sound too.

#
        if (_BIS_music != "") then
        {
            ["Music track ""%1"" defined for fading out.",_BIS_music] call BIS_fnc_error;
        };
        
        _BIS_fadeDuration fadeSound 0;
        _BIS_fadeDuration fadeMusic 0;
        _BIS_fadeDuration fadeSpeech 0;
gray hull
#

I know that it works with fade in perfectly, HOWEVER, starting with a fade out, (waiting for it to finish), then doing a fade in still results in dead music

#

And, I'm not quite certain as to why.

robust hollow
#

fade in doesnt turn music volume up

#

run this before you call it to fade in _duration fadeMusic 1;

gray hull
#

I knew i was being stupid

#

thanks homie

fair drum
#

also, if you are using ace you have to disable its control over volume if you want to use that command first @gray hull

#

ace_hearing_disableVolumeUpdate = bool local

tiny wadi
#

Is this an okay way for checking if an object is a terrain object?

private _netID = parseNumber (((netId _obj) splitString ":") select 1);
private _terrainObject = _netID < 0;```
#

I tested a few objects and saw that map objects were negative, is this always true?

robust hollow
#

you could probably get away with just trying to find the 1. the first number is the owner id, and no one ever occupies 1 in mp so this should be enough

netId _obj find "1" == 0
tiny wadi
#

Oh yeah that'll work too, much neater

little raptor
robust hollow
#

it does not

tiny wadi
#

This will be for MP so it will work for my applications

spring vigil
#

what is the missionNamespace global arsenal

#

Unit\Limited_Arsenal\Arsenal.sqf

example_weapons = [
    "rhs_weap_hk416d10",
    "rhs_weap_hk416d10_LMT",
    "rhs_weap_hk416d10_m320",
    "rhs_weap_hk416d145",
    "rhs_weap_hk416d145_m320",
    "rhs_weap_M107",
    "rhs_weap_M107_d",
    "rhs_weap_M107_w"
];
[missionNamespace, example_weapons, true] call BIS_fnc_addVirtualWeaponCargo;

init.sqf

[] execVM "Unit\Limited_Arsenal\Arsenal.sqf";

init of box

null = ["AmmoboxInit",[this]] spawn BIS_fnc_arsenal;
#

I know I can use a variable for the box and make it work. I want to make it effect every VA spawned

warm hedge
robust hollow
#

0.0012ms vs 0.0033ms

warm hedge
#

Which is which?

robust hollow
#

netid first

#

also i dont think nearestTerrainObjects is as reliable for some objects

#

maybe if you did like nearestTerrainObjects [getPosATL _obj,[],1,false,true], but still slightly slower than the netid method.

warm hedge
#

Mmmm-aybe we just need to make a ticket for isTerrainObject?

tiny wadi
#

Seems pretty niche

winter rose
austere granite
#

private _corners = (boundingBoxReal _object);
private _distanceObject = (_object modelToWorld (_corners select 0)) distance (_object modelToWorld (_corners select 1));

private _objectModelPath = (getModelInfo _object) select 1;
private _testObject = createSimpleObject [_objectModelPath, __TESTPOS];
private _corners = (boundingBoxReal _testObject);
private _distanceReal = (_testObject modelToWorld (_corners select 0)) distance (_testObject modelToWorld (_corners select 1));

// -- This value could be cached with _objectModelPath if you want, seeing it won't change
deleteVehicle _testObject;
if (_distanceReal == 0) then {
    1
} else {
    (_distanceObject / _distanceReal)
}

heres the amazing way to get terrain object scale right now as well πŸ˜„

winter rose
#

Spoiler: that's how Dedmen did it in the engine too

dusk gust
#

Does anyone know if the primary syntax to "tvData" is working properly right now?
It seems that it always returns an empty string for me, even if it should have something.
https://i.imgur.com/dlVoC7z.png

spark turret
#

is there a "group spawned" or "unit spawned" eventhandler ?

#

xeh included

exotic flax
#

spawned by what?
3den, Zeus, scripted, magic?

#

because the first 2 have EH's, the third one... you can do yourself and the last one doesn't exist

spark turret
#

ideally any of them. dont really need them for scripted, but Zeus is what i wanna catch

little raptor
little raptor
#

Not sure

#

Also not sure about a group version

exotic flax
#

will trigger for all objects (and for each object in a group) when spawned by Zeus

spark turret
#

will look into it.

willow hound
proper sail
#

The code that gets executed by addPublicVariableEventHandler on triggering. Is that called or spawned?

little raptor
proper sail
#

im on a2

#

but ill see what happens if i sleep

#

if i get an error

pliant stream
#

it's not spawned

proper sail
#

Alright thanks

pliant stream
#

and a good thing too, that would be an absolute disaster

#

spawn/execVM is almost always a mistake

proper sail
#

Yeah I thought it was called, but I saw some weird snippet somewhere where someone was sleeping in the code

#

so i was confused

little raptor
timid niche
#

AnimDone doesn't work on actions/gestures correct?

little raptor
#

yeah

#

nothing works on them

timid niche
#

Any alternative?

#

ohhh

little raptor
#

no

timid niche
#

Didn't think so

little raptor
#

the best you can do is use an each frame EH with a timer

timid niche
#

that sounds awfull

little raptor
#

it is

pliant stream
queen junco
#

Hey quick question: I got a variable in a script that needs to be defined at the mission start. I tried defining it in the init.sqf but when the execVM executes the script it says "alarm_trg_1 not defined".

alarm_trg_1 = false;
publicVariable "alarm_trg_1";
alarm_trg_2 = false;
publicVariable "alarm_trg_2";
alarm_trg_3 = false;
publicVariable "alarm_trg_3";

This is my init.sqf.

Any idea what I did wrong?

pliant stream
#

"the execVM" ?

queen junco
#

I got a trigger that executes an execVM. So a separate .sqf. In there it refers to alarm_trg_1

#
while {alarm_trg_1 == false || alarm_trg_2 == false || alarm_trg_3 == false} do {
    playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", speakers];
    sleep 5;
};

This is the sqf I was talking about

pliant stream
#

are these happening on different clients?

cosmic lichen
#

alarm_trg_1 == false -> !alarm_trg_1

pliant stream
#

@little raptor that looks deceptively like a finger pointing up, as if to say you agree πŸ‘€

little raptor
#

since when does middle finger mean agree?! πŸ˜„

pliant stream
#

i only figured out it was a middle finger by hovering over it and reading the name

willow hound
#

@lyric schooner How is this possible

lyric schoonerBOT
little raptor
#

!purgeban or something! πŸ˜„

finite sail
#

if he misspelled 'triggers', he's going to be so embarrased

astral tendon
#

this is a ACE related question, I am trying to add this action to all planes in the mission but the action still on the outside, what is wrong here? their wiki is very incomplete.

_action = ["RadioToAWACS", "Request Bogey Dope", "", {[] spawn RTG_fnc_RequestBogeyDope}, {true},{},[],[0,0,0],4,[false,true,false,false,false]] call ace_interact_menu_fnc_createAction; 
["Plane", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
winter rose
#

!purgeban @drowsy pecan 0 racist

lyric schoonerBOT
oblique arrow
still forum
pliant stream
#

incidentally, i recently did some server performance profiling for dayz mod in a2 and also found global setVariable to be the biggest single contributor

still forum
#

Its nice that ArmaScriptProfiler displays that, else I wouldn't have seen that setVariable issue.
I was actually looking for a different issue of nearObjects being called and tanking FPS, but that setVariable issue caught my eye, and just so happened to also show me the place of the nearObjects problem

#

My game has been running for 7 minutes, and HAFM sent roughly 100MB of traffic in that time, And I was only in the briefing screen, the mission didn't even start yet.

pliant stream
#

does the script profiler track only time spent executing the command itself? in my case the biggest individual contributor on the server seemed to be propagation of the setVariable messages

still forum
#

It checks time spent running script functions, and bytes sent via network in setVariable/publicVariable/remoteExec and such.

#

Not the time spent processing the network bytes

queen junco
#

Thanks for the effort, but to be honest I dont understand it. I am not that experienced with these kind of things. I thought it was simpler...

pliant stream
#

@queen junco likely your execVM executes before init or before those publicVariable calls' effects are observable on another client

queen junco
#

But looking at the loadorder the init.sqf should be the very first thing to load. While the execVM is activated by a trigger by a player

digital hollow
little raptor
#
while {!(missionNamespace getVariable ["alarm_trg_1", false]) || !(missionNamespace getVariable ["alarm_trg_2", false]) || !(missionNamespace getVariable ["alarm_trg_3", false])}}
#

that's the simple version

willow hound
little raptor
#

all I did was use define to make it shorter:

#define getMVar(x) (missionNamespace getVariable [#x, false])
queen junco
#

I just worked out like this. It works for me but not sure if it might cause any issues

while {isNil "alarm_trg_1"} do {
alarm_trg_1 = false;
alarm_trg_2 = false;
alarm_trg_3 = false;
};

while {alarm_trg_1 == false || alarm_trg_2 == false || alarm_trg_3 == false} do {
    playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", speakers];
    sleep 5;
};
little raptor
#

it will

#

use what I said

#
while {!(missionNamespace getVariable ["alarm_trg_1", false]) || !(missionNamespace getVariable ["alarm_trg_2", false]) || !(missionNamespace getVariable ["alarm_trg_3", false])} do {
    playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", speakers];
    sleep 5;
};
#

and as many people explained to you before, don't use alarm_trg_1 == false

#

alarm_trg_1 == false -> !alarm_trg_1

willow hound
#

Quick lesson in boolean logic:

if (_val) //Same as if (_val == true)
if (!_val) //Same as if (_val == false)
queen junco
#

Alright, thanks for all that help and staying calm with me. I am sorry I stole your time but I barely script so it is always a little difficult for me with all the commands I have no clue how they work.

pliant stream
#

also arma does little to help you with mp synchronisation. if you actually want things to work reliably you end up having to build a lot of infrastructure that should really be provided by the base game and it's not something a beginner can do

astral tendon
digital hollow
#

I don't think I've noticed that Β―_(ツ)_/Β―

spark turret
#

arma MP synch isnt easy but its as easy at it gets.

pliant stream
#

if anything those "easy" remote exec and public variables are doing you a disservice, because while yes they are easy to use, they are not easy to use correctly and reliably

#

arma provides this awkward mid level api, which is neither at the low level you want for building abstractions on top of, or at the high level which you actually want to use for gameplay programming

astral tendon
exotic flax
#

I have no problem with MP coding, and yes; by default it's a lot to swallow, but when you use CBA Events its as easy as 1-2-3

pliant stream
#

i'm sure there's some good community made abstractions, but that's sort of the point. those don't come with the base game. instead it comes with these mid level primitives that seem easy but actually hurt you more than they help. instead it should either provide primitives so low level that they're not usable for gameplay programming directly (think sockets) forcing you to find a community abstraction, or just provide those high level abstractions directly

#

providing good high level abstractions in the base game directly is the better solution for many reasons

#

though that shouldn't be done at the expense of the low level interface

exotic flax
#

It's no rocket science to use MP commands/functions in SQF, the wiki explains exactly how it works and is as simple as it can get.
The fact the we, the community, try to program beyond the engine is something else and that is where the community jumps in to make it easier to use for the masses.

pliant stream
#

i'm not proposing to expose OS sockets, though that would be fine on the server at least. instead you might provide "SQF sockets" for sending a stream of SQF objects between client and server

cosmic lichen
#

Open a FT ticket. Otherwise discussing this here makes not sense.

pliant stream
#

it seems to fit the channel description perfectly, don't you think?

calm badger
#

is there a script i can use to execute something if the player is within a raidus of an entity?

#

i think i can do something with nearEntities?

exotic flax
#

you can use triggers

#

although those are static

calm badger
#

yeah that's the problem

#

since the ai that gets spawned for some reason will not spawn at the exact placed location

#

it looks like it spawns within a radius of where it is in the editor

exotic flax
#

I don't understand your question in relation to your problem πŸ€”

little raptor
#

not generalized, not good either. but it gives you an idea as to what you need

grim mica
#

I want to get a value (array) from a function, but I can't find what I am doing wrong.

select_target = {

    _ciws = _this;
    _shortList = [];
    _c_side = side _ciws;
    {
        if(_x select 1)then{
            _shortList pushBack _x select 2;
        };
    }forEach ShooterArray;

    _selection = ( _shortList select { (([_x , "VIEW", _ciws] checkVisibility [(eyePos _ciws), (eyePos _x)]) > 0) && side _x != _c_side } );
    hint format ["Array is %1", _selection];
    _this = _selection;
};

_closePlayers = _Turret call select_target; //generic error in expression.

if (!(_closePlayers isEqualTo [])).....  
little raptor
#

it's returning void

#

_shortList pushBack _x select 2;

#

could result in an error anyway

#

use:
_shortList pushBack _x#2;

grim mica
#

I was going by this example from the wiki.

my_fnc = {
    if (_this > 0) exitWith {
        _this + 1
    };
    _this - 1
};

hint str (5 call my_fnc); //6
hint str (-5 call my_fnc); //-6
little raptor
#

well that is returning something

#

it returns _this - 1

#

what do you want to return from your function?

grim mica
#

The array generated in "_selection".

little raptor
#

so just put _selection at the end

#

like this:

#
_select_target = {

    _ciws = _this;
    _shortList = [];
    _c_side = side _ciws;
    {
        if(_x select 1)then{
            _shortList pushBack _x#2;
        };
    }forEach ShooterArray;

    _selection = ( _shortList select { (([_x , "VIEW", _ciws] checkVisibility [(eyePos _ciws), (eyePos _x)]) > 0) && side _x != _c_side } );
    hint format ["Array is %1", _selection];
    _selection;
};

_closePlayers = _Turret call _select_target;
#

I also corrected that other error

#

plus you didn't need a global var for the function

#

so I just replaced it with _select_target

#

( I don't know why you're using a function in the first place, but I'm assuming you have a good reason)

#

also you didn't need select

#

you could've just created _selection from the ShooterArray

grim mica
#

I don't have good reason for most things I am doing, but this is no longer returning the same error. Thank you.

little raptor
#

np

wild prairie
#

addAction isn't synced in MP, right?

exotic flax
#

Nope, need to be executed on all clients

random tendon
#

So I'm trying to get an ammo box to spawn randomly INSIDE of buildings at different heights and the solution I've come to is using this in it's init:
akCACHE setPos (selectRandom [[3158.96,5770.6,3.36632],[3444.22,5934.86,6.1],[3487.09,5941.93,5.83216]]);

It doesn't give me any errors how ever the box does NOT select a random position and get moved to it. Any ideas on what I'm doing wrong? I am %100 sure the variable name is correct. There is roughly 29 different positions I'm using in that array how ever I don't wanna post a text wall if I don't have to. I got the xyz by placing the object in eden exactly where I want it with out rotating and logged the 3d location.

fair drum
#

you have a random " in there

#

@random tendon

#

also you have a missing bracket

#

also, are your cords in ATL, AGL, or ASL?

random tendon
#

Aight fix those two things. As far as I know they should be ATL I'm getting the coordinate from eden so when I right click the object and log the posistion

#

Let me look up what it gives you. I'm assuming ATL because some of them have a "0" Z coordinate since its on the ground

fair drum
#

then use setPosATL

#

setPos is in AGL

random tendon
#

I did try that earlier. It didn't work but I'll go ahead and double check my brackets and shit to try again. Making sure they're cleaned up.

fair drum
#

are you using a programming environment? they usually catch silly mistakes like that

little raptor
#

so are Eden coords

random tendon
#

Okay I'll try all the iterations of setPos there is pertaining to different coords

little raptor
#

setPos is not AGL
it's AGLS

#

there's no setPosAGL
if your position is on land, you can use setPosATL

#

because on land ATL = AGL

random tendon
#

Legendary. Thanks y'all. I was thinking I had to use ATL, I tried it once before but I must've fucked something else up when I did it. ATL worked.

winter rose
little raptor
#

I can test

#

gimme a sec

winter rose
#

u r da man 🀎

exotic flax
#

according to wiki: setPos => PositionASL = ASLW on sea and ATL on land
although it also says that getPos = AGLS

random tendon
#

That's to be expected tho with so many commands they'd be so vague with their documentation

exotic flax
#

if Lou doesn't know, how is the wiki supposed to know? 🀣

random tendon
#

Dude I'm just so glad it works tho

#

I was worried about having to use some other completely over the top absurd script to make it work

little raptor
#

@winter rose it's AGLSW

little raptor
winter rose
little raptor
#

if you want I can share a test script

winter rose
#

so I can safely say that getPos is AGLSW on the wiki right?

exotic flax
#

AGLSW = Above Ground Level inc. Surfaces and Waves?

little raptor
#

sorta! πŸ˜„

winter rose
#

Sea+Waves

#

AGL+ASLW

little raptor
winter rose
#

(to anyone entering the channel - this is a normal conversation)

little raptor
#

which is AGLS

winter rose
little raptor
#

I mean it's not strictly AGLSW

#

for example, if you use player setPos [_x, _y, _z]
and _z is directly on a surface, the player will be placed exactly at that position
if no surface is found, it is treated as an offset

winter rose
#

offset from ATL?

little raptor
#

wait no I think I was wrong meowsweats

#

It's always AGLSW πŸ˜…

fair drum
#

If I'm teleporting units in a circle w/ radius using:

_unit setPosATL getPosATL positionhere getPos [10, random 360];

, which command do I use to make them all face the center? setDir looks to only use headings

exotic flax
#

you do need setDir, so you will need to calculate the direction based on their position relative to their position

robust hollow
#

something to do with getRelDir. maybe this?

_unit setDir (getDir _unit + (_unit getRelDir _pos));
little raptor
#

but I could swear I was using setPos in an old script, and it didn't add offset to my position even when I was on top of another object
but now that I test, it always adds an offset

fair drum
#

oh boy... math 😦

#

alright i'll mess around with some of those commands

winter rose
#

AGLS above ground/terrain, ASLW above water

little raptor
#

@winter rose okay so check this out:
1.when in land, standing exactly on the surface of a building:

player setPos ASLToAGL getPosASL player
```puts you almost exactly where you are (so Z is treated as AGL height, not offset)

2. if you are ~2.5 meters above a surface, and use that command, it now treats Z as an offset (relative to the closest surface below)! 
```sqf
player setPosASL (getPosASL player vectorAdd [0,0,2.5]);
player setPos ASLToAGL getPosASL player
  1. and if you test it on water, it always treats Z as an offset, even if you're exactly touching a surface
#

for the first two tests, you can use place yourself on top of a building
for the third test, you can use the carrier

little raptor
spark turret
#

i want to have a template of a small camp which i randomly place along a patrol route. whats a good way about saving the prebuilt camp objects and their relative positons?

little raptor
#

the origin should ideally be the average position

spark turret
#

alright ill try that

little raptor
#

because you can save yourself all the calculations

#

plus you can use engine commands which are way faster than their sqf alternatives

#

like worldToModel

#

and vectorWorldToModel

winter rose
little raptor
winter rose
#

no u!

calm badger
#

I've got a little problem with the join waypoint, it takes a pretty long time to complete for some reason. Is there a script I can use to make it go faster?

#

The context I'm using it in is that after one ai gets off a helicopter, it skips it's hold waypoint and instead goes to a join waypoint that's attached to the player

#

But it always takes maybe 20 seconds to actually join the AI to the player group?

spring vigil
#

Are there any sqf that plug-ins that will format to ace standards ? Or at least auto-format long arrays ?

#

For vscode ^

minor osprey
robust hollow
#

first of all you can shrink both of those actions {player setPosATL getPosATL SE_int;}

#

second, how is it broken?

warm hedge
#

And what is the result? How it didn't work?

minor osprey
#

If you check the first link, the option to teleport never popped up on the scroll wheel menu

warm hedge
#

What is the base there?

#

I assume you need to write this instead of base? @minor osprey

minor osprey
#

I will try that, and see if it works

#

Yep, that was the issue

little raptor
sharp grotto
#

Stupid question. How would one detect empty elements in an array like this
["","","",""]

Count obviously doesn't work πŸ€”

if (_itemClassName isEqualTo (primaryWeapon player)) then
        {
            {
                if(count _x > 0) then
                {
                    _add = false;
                };
                
            }
            forEach 
            [
                primaryWeaponItems player,
                primaryWeaponMagazine player
            ];

        };
proper sail
#

_x == ""; ?

#

or isequalto

robust hollow
#

"" in _x?

#

or if you mean detect if all elements are empty then isEqualTo like Merlijn said.

sharp grotto
#

Thanks guys πŸ‘Œ

little raptor
#

@sharp grotto

_array - [""]
```removes all the `""` from the array (I'm assuming that's what you wanted?)
sharp grotto
#

Yea. I just did

        if (_itemClassName isEqualTo (handgunWeapon player)) then
        {
            if((count handgunMagazine player) > 0) then {_add = false;};
            if!((handgunItems player) isequalTo ["","","",""]) then{_add = false;};
        };
        
        if (_itemClassName isEqualTo (primaryWeapon player)) then
        {
            if((count primaryWeaponMagazine player) > 0) then{_add = false;};
            if!((primaryWeaponItems player) isequalTo ["","","",""]) then{_add = false;};
        };
thorn saffron
#

How do can I turn this config.bin/CfgGroups/West/BLU_F/Infantry/BUS_InfSquad into proper config path that works with BIS_fnc_spawnGroup?
I tried out BIS_fnc_configPath, but I was unable to turn that string path into proper config path.

robust hollow
#

do you need to convert it in a script or you just need literally that but as a config path?

thorn saffron
#

That as a config path. I'm making a script for spawning groups and I hit a snag when I have to pass the path down the line and then turn it into working config path so the spawnGroup function works

robust hollow
#

so it may not always be that exact path?

thorn saffron
#

no the path will always be exact to the group

robust hollow
#

right, but does it help if I give you configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad" or do you need a script to do that for any config path you might use?

thorn saffron
#

I need a script to do that for any config path

robust hollow
#
private _configPath = "config.bin/CfgGroups/West/BLU_F/Infantry/BUS_InfSquad";
private _configArray = _configPath splitString "/";
_configArray set [0,"configFile"];
private _config = [_configArray] call BIS_fnc_configPath;
_config
little raptor
#

how did you get that in the first place?

#

are you using str?

#

although I think str gives \ at start?

robust hollow
#

is possible. just trimming the start bin\config.bin/CfgGroups/West/BLU_F/Infantry/BUS_InfSquad

cosmic lichen
#

Unfortunately BIS_fnc_configPath can't handle config.bin and similar =/

thorn saffron
#

@little raptor configClasses

little raptor
#

configClasses gives configs

#

not that

#

CONFIG is a data type in sqf

#

in case you didn't know

#

so "true" configClasses configFile returns an array of CONFIGs

thorn saffron
#

"true" configClasses (configFile >> "CfgGroups"); gives me this
[bin\config.bin/CfgGroups/West,bin\config.bin/CfgGroups/East,bin\config.bin/CfgGroups/Indep,bin\config.bin/CfgGroups/Empty]

little raptor
#

because you use str

robust hollow
#

you can use those individually with bis_fnc_spawnGroup

little raptor
#

that's the stringized version

thorn saffron
little raptor
#

what connor means is that this works:

  {
    [_pos, _side, _x] call BIS_fnc_spawnGroup
  } forEach ("true" configClasses (configFile >> "CfgGroups"))
#

because each element is a CONFIG

#

but when you use str, you convert it to strings

thorn saffron
#

I didn't use str

#

maybe it was used automatically, but I didn't

copper raven
#

str [1,2,3] will run to_string on every element eventually

little raptor
#

even what the console returns to you is the Stringized version

thorn saffron
#

Ok, that explains it

#

also freaky stuff, if you use debug console to spawn AI in the editor they will move around πŸ˜„

queen junco
#

Hey, I have tried working with the holdAction command and I am curious if you can refer to the player that executes the holdAction. For example if you have a MP mission and one player uses a holdAction. I'd like to refer to the very player that did this so I could send a hint to just him, add something to his inventory, etc.

#

I don't think there is something similar to thisList that triggers have right?

robust hollow
queen junco
robust hollow
#

yea

queen junco
#

noice, thx ^^

little raptor
#

Hey guys

Does anyone want to volunteer to test my mod on the stable branch?

I'm doing some stuff in the game right now and I can't switch branches notlikemeow

little raptor
#

There's also candy! πŸ˜‹

winter rose
finite sail
#

*waves

little raptor
winter rose
little raptor
#

not too big

#

but it's cool! πŸ˜„

#

yeah perf is fine

tough abyss
#

yo

#

im trying to get into scripting

#

such as pub zeus ops and stuff

#

any tips

slim verge
#

steep learning curve colt

tough abyss
#

yea ik

#

all i wanna be able to do is enable zeus enhanced etc

#

give pub zeuses or my self the tools we dont get bc bohemia doesnt want to do it

slim verge
exotic flax
#

on the official servers you can't run scripts or mods, so that won't work

#

on your own server, simply add ZEN (or any other mod) to it and feel free to do whatever you want

slim verge
#

my link explains how you figure out why your code doesnt work, basic skill set you need to learn

exotic flax
#

debugging doesn't help if it's not supported on public servers πŸ€¦β€β™‚οΈ

#

yeah... expect him to get banned soonℒ️

tough abyss
#

have cinematic cameras

exotic flax
#

well, in case you don't want to get banned as well (including this Discord), I wouldn't ask such questions...

still forum
#

Yeah I suggest you stop before you need to be removed

tough abyss
#

alright then

balmy birch
#

I am trying to add a virtual arsenal to an ammobox but with limited ammo/items. Not to whitelist or blacklist certain items but like there is only X amount of items of an item inside of it that you can put stuff in and take stuff out of.

tough abyss
#

idk i found a forum
about that stuff if u wanna look?

balmy birch
#

I've seen mods, like antistasi and overthrow like that. Sure

tough abyss
#

kk bet

#

its a steam forum

#

they gloss over it tho so im not to sure

balmy birch
#

It seems to only add a virtual arsenal. I need a virtual arsenal that will only have x amount of y, if you understand what I mean

slim verge
#

why dont you just add a crate with exactly what you want in it

bold mica
#

Probably space limitations but you can have seperstre crates for uniform and stuff

worthy rivet
#

Is there a way for β€œforceWeaponFire” to last a certain duration?

bold mica
#

uh

worthy rivet
#

Since when I use it in a trigger for an AI, they only fire 1 shot/burst

bold mica
#

You can probably make a loop

worthy rivet
#

Not as an sqf file but within the trigger

bold mica
#

Call on a sqf file?

exotic flax
#

Or put SQF in trigger πŸ“Έ

bold mica
#

That works too

exotic flax
#

However, you can try to change the muzzle to full auto and see if that works

worthy rivet
#

I did the muzzle on full auto

#

But it only fires 1 shot

#

But with burst, it does the standard 3

finite sail
#

I guess I was hoping too much

#

{"Sign_Arrow_Cyan_F" createVehicleLocal _x} foreach (nearestbuilding player call BIS_fnc_boundingboxcorner)

#

doesnt put arrows at the corner of ma building

spring vigil
tough abyss
#

Trying to dynamically create variables. I need to create variables named var_1 up to var_15. Is there any quicker way to do that with some type of a loop or something rather than typing each one out?

#

They’re all Booleans if that means anything

winter rose
tough abyss
#

I am designing a system using CBA waitUntil commands

#

Basically waitUntil only works on one variable once so I need multiple variables

winter rose
#

e.g```sqf
for "i" from 1 to 15 do {
missionNamespace setVariable [format ["TAG_var
%1", _i], false];
};

winter rose
tough abyss
#

Right but it only works once and I need it to monitor the same variable the whole mission if I am to only use one

#

It needs to run every time it switches to true

little raptor
#

If that's what you want to do, don't use the CBA version

#

it's unscheduled

winter rose
tough abyss
#

And I’ve never really worked with them Lou

little raptor
#

what's the point of creating so many named variables

#

you can do it using loops, yes, but I think you don't need them

tough abyss
#

Because I don’t know how to monitor just one Boolean to do the thing I want with CBA

#

Since as you said the CBA waitUntil is unscheduled

little raptor
#

can you explain what you're trying to achieve with that?

#

I might be able to give you a better way to do it

tough abyss
#

Will dm to try to further explain in case anyone else has other questions here

little raptor
#

ok

polar saffron
#

Does anyone know what is the pbo of the rhs configuration menu?

leaden haven
#

MFW I create a flagpole to teleport players and it teleports the flagpole. meowhuh

little raptor
#

mfw somebody posts something like that meowfacepalm

austere hawk
#

is it possible to teleport players/units onto a ladder (as in - somewhere in the middle, in climbing mode) ? I wouldnt expect so, but you never know...

little raptor
#

I don't think so
is the player initially on the ladder?

#

because afaik, the game uses a helper or something to do the ladder climb thing
which you can't do using sqf

#

now if the player started on the ladder, you might be able to change their pos and it might work

#

not sure cuz I've never tried that

#

you can make a similar helper mechanism for the AI, but it's not ideal

#

but at least it works

leaden haven
#

I thought it was funny.

winter rose
#

'twas, it's part of what makes Arma great πŸ˜„

robust hollow
#

(works for me)

little raptor
#

interesting

#

I didn't know it also accepts an offset

austere hawk
#

I have a tower with a vehicle on top (a turret) - would have been cool if the unit would climb the (long) ladder first to near the top (without exiting the usual clunky way) and then directly transition to the vehicle, without stepping off the later, But it sounds like its too much hazzle for just the eye candy. I could do it with vehicle exit/entry animations, but then i need a different animation for every possible length of ladder i plan to use. I think ill give it a pass then

spark turret
#

whats an easy way to figure out if my sniper can fire at the player?

#

doing lineInteresect atm

#

any way to get the maximum engagement range ?

winter rose
spark turret
#

im getting tons of false positives on the "terrainIntersect" between positions

#
    _hasLOS = false;
    {
        (group _sniper) forgetTarget _x;
        _sniper reveal [_x,4];
        _hasLOS = (((getPos _sniper distance getPos _x) < 1000) && !(terrainIntersect [eyePos _sniper, eyePos _x]) && !(lineIntersects [eyePos _sniper, eyePos _x, _x, _sniper]));
        
        diag_log ["terrain:",terrainIntersect [eyePos _sniper, eyePos _x],"objects:",lineIntersects [eyePos _sniper, eyePos _x, _x, _sniper],"hasLOS:",_hasLOS];
        if (_hasLOS) exitWith {
            _sniper doTarget _x;
            _sniper disableAI "path";
            _sniper setVariable ["sn_status","direct LOS"];
            systemChat "direct LOS, stopping";
            sleep 120;
        }
    } forEach allPlayers;
#

its returning true even tho the effing sniper is sitting behind a hill and has no way of seeing the player

#

is maybe the sniper glitching his eyepos into the terrain and no backculling = seethrough from inside?

polar saffron
#

hello anyone knows how to add one more button or option to the game pause menu and that button does the job

#

Can you help me please?

robust hollow
#
[missionNamespace,"OnGameInterrupt",{
    params ["_display"];

    private _ctrlButton = _display ctrlCreate ["RscButtonMenu",-1];
    _ctrlButton ctrlSetPosition [0,0,0,0]; // The position you want it at 
    _ctrlButton ctrlAddEventhandler ["ButtonClick",{
        // The action you want it to do when clicked 
    }];
    _ctrlButton ctrlCommit 0;
}] call BIS_fnc_addScriptedEventHandler;
little raptor
#

@polar saffron it's called the RscDisplayInterrupt display

#

if you want to do it using the config

#

but using conner's method might be better and more flexible

polar saffron
#

Thank you

spark turret
#

lineIntersectsSurfaces does the job. still no idea why the other two are borken

polar saffron
robust hollow
#

Connor's method would go in an sqf file during the mission init. so perhaps initPlayerLocal.sqf

little raptor
#

You better patent it right now Connor! 🀣

polar saffron
robust hollow
#

im going to pretend i understood all of that and say you want this?

    _ctrlButton ctrlAddEventhandler ["ButtonClick",{
         [objNull, player] call ace_medical_treatment_fnc_fullHeal;
    }];
polar saffron
#

@robust hollow The location which you recommend or I leave it like this 0.0.0.0

robust hollow
#

you need to change it to where you want the button to be

#

i cant really recommend a position because there is always another mod that will use the same spot on the esc menu

#

if you arent sure just do this i guess.

_ctrlButton ctrlSetPosition ctrlPosition(_display displayCtrl 2);
_ctrlButton ctrlSetPositionY safezoneY + 0.25*safezoneH;
polar saffron
#

@robust hollow this gives me an error with this part of the script
call BIS_fnc_addScriptedEventHandler;

robust hollow
#

whats the error?

polar saffron
#

there I tell you

robust hollow
#

you've said where but not why. the error log will say why. find it in your rpt file.

polar saffron
#

@robust hollow I can't find the place of the error, but I already copied the command again

robust hollow
#

paste the whole snippet of code then. there might be something wrong with it.

polar saffron
#

The error is no longer there but the button does not appear

#

@robust hollow There I sent you a request and I give you a photo of how the pause menu appears

robust hollow
#

paste the whole snippet of code then. there might be something wrong with it.

polar saffron
#

@robust hollow Well there is a photo of how I have the script

warm hedge
#

Don't do your troubleshoot in private since you asked to public. Just post the link to the image here

polar saffron
#

@warm hedge [missionNamespace,"OnGameInterrupt",{
params ["_display"];

private _ctrlButton = _display ctrlCreate ["RscButtonMenu",-1];
_ctrlButton ctrlSetText "Button Text";
_ctrlButton ctrlSetPosition ctrlPosition(_display displayCtrl 2);

_ctrlButton ctrlSetPositionY safezoneY + 0.25*safezoneH;
_ctrlButton ctrlAddEventhandler ["ButtonClick",{
[objNull, player] call ace_medical_treatment_fnc_fullHeal;
}];
_ctrlButton ctrlCommit 0;
}] call BIS_fnc_addScriptedEventHandler;

warm hedge
#

Check the pinned message to format it

polar saffron
#

there you have the complete command and running with ace

exotic flax
#
  1. what is the exact error you get?
  2. where did you put this script?
robust hollow
#

(it works now)

polar saffron
#

@exotic flax a line of text was missing that was the title or something like that

bold mica
#

does anyone know a way to force players with a specific (x) backpack to have a item (y) that they cannot remove y item from their kit?

#

or if they do remove it, itll be added back

tiny wadi
#

@bold mica There are a few different eventhandlers you can use:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryClosed

You could do it when the close their inventory is closed and readd it if it doesn't exist in the backpack. Or you could run an eventhandler on the "Put" eventhandler and check if the item that was moved is equal to the item you don't want removed and then remove it from where it went and put it back in their bag

#

I dont believe there is an actual way to stop them from being able to remove it though

bold mica
#

rip, so only way is to constantly shove it back in their bag if they get rid of it?

tiny wadi
#

Yes

#

I mean you could always disable inventory access, but that is probably not going to be acceptable for most use cases

bold mica
#

but can i set it to only work with a very specific bag

tiny wadi
#

Just check that the player's current backpack is the one you want

#

So your code would be if the current backpack is the one I care about AND the item is the one I didn't want removed, then readd the item to the backpack

bold mica
#

i.e check for idk ilbe_something_something ?

tiny wadi
#

What's that

bold mica
#

backpack classname

tiny wadi
#

Yeah

bold mica
#

huh

tiny wadi
#
if ((backpack _unit) isEqualTo "ilbe_something_something" && {_itemRemoved isEqualTo "ItemICareABout"}) then { _unit addBackpackCargoGlobal ["ItemICareAbout", 1]; };```
bold mica
#

is that literally it

tiny wadi
#

Yes

bold mica
#

where do i put this

tiny wadi
#

Well, minus the eventhandler setup code

bold mica
#

playerlocalinit.sqf?

tiny wadi
#

Depends on your mission setup but absolute barebones throw a addMissionEventHandler into the init.sqf

bold mica
#

kk

#

i dont mind the extra files since i save them in a folder which i copy and paste over

#

if i want multiple backpacks to be checked do i do "ilbe_something_something","ilbe_something_something2"