#arma3_scripting
1 messages Β· Page 646 of 1
π€ this event fires after they download the mission though.
it should work, ive used it with remoteexec call before.
makes no sense
are you checking the log on the client?!
yea
try spawn instead of call and see if it logs?
it doesnt matter, spawn or call
try something else then
like ```sqf
[[],{systemChat "somde"}] remoteExec ["call",_owner];
see if it works
because it should
itl be too early for systemchat i think
ok, then maybe spawn it with sleep
[[],{sleep 1; systemChat "somde"}] remoteExec ["spawn",_owner];
maybe the same thing with diag_log?
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.
Also "Sample text" remoteExec ["diag_log", _owner]; 
why do people never believe me? π€£
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.
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
it has though. i use remoteexeec call _owner through this event one of my mods
so the server does do the call properly, but the client doesn't know his number is being used
yea, nah. thats not correct.
could be a timing issue
Pics Code or it didn't happen
@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.
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.
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?
uhhh I think you just use ' call '
this addAction ["Campaign Report",call fn_campaignreport];??
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?
MyObject addAction ["Action", {call TAG_fnc_someFunction;}];
```It should be done (and should work) like that.
https://sqfbin.com/ejexeveluletohayiwuf excuse me, i run this code,but the the list box does not display these three names. Does anyone know why?
Does not display how?
format["%1", _x];
why format?
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"]
@little raptor Thank you, but isn't _playername an array?
ok bro tks!
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
thanks for the help
so i altered my code to what you put and i keep getting "Error Undefined variable in expression: tag_fn_campaignreport". any ideas?
what is the name of your function?
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
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];
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}];
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
i will try it
well then see what tag he's using
probably DMP
@jade tendon read this if you don't know what a function is:
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Adding_a_Function
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?
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
you can post your issues here
if it's a script and it's too long for discord, use sqfbin or pastebin
Not the post's link but images
click on the image and post its link (it must end in .jpg or .png)
What is βthisβ? { alive _x } count units sector1 == 0;?
Hey there
Does setObjectTexture cache textures?
I am using it with jpgs and I get not updated textures...
there's no such thing as units sector1 
Yes
its from a previous help
and a tutorial vid
I never said use units
I don't even see you did followed Leopard's guide?
what I said is that use a trigger that executes your code when the trigger deactivates
well most vids are not good
@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
also, this question was related to #arma3_editor
{_x setDamage 1} forEach (allUnits select {side _x == opfor})
thank you
its working! thank you again.
please post a shakey portrait mode of a mucky screen from 6 feet away to show it working
https://youtu.be/k6tXYufgthk
(that was the easiest way to show its work)
easiest for who?
What?
never mind
here is the mission
https://steamcommunity.com/sharedfiles/filedetails/?id=2363535090
1-5 player, 26 enemy (ai)
its not complicated, but i think its fun to play.
This function keeps giving me an error but works as intended.
Error is #_returnArray generic error in expression
Does vehicle event handlers have to be executed on the server?
and how exactly do you call that function?
no, but depending on what you want to do, you might wanna do that
call fncName
I know. what do you do with the return value?
// 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;
there's nothing wrong with that file
When the function inits it errors with that.. strange
Error is #_returnArray generic error in expression
_VTT_fnc_VTT_ what kind of naming is that?!
what do you mean inits? preInit = 1?
I don't use any of those (perhaps I should be)
class VTT_defaultFileText{};
I'll tackle it another day then, functionality is working just wanted to remove the error notice
could always just return the array instead of setting it to a variable first
variable cant error if it doesnt exist π
and use params 
Poorly written... you'd hate my other functions π But yeah will give that a go ty guys
An engine evh that when turned on it checks if the vehicle has a var set
Sqf - java transpiler when
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;
maybe setvariable works for that? https://community.bistudio.com/wiki/setVariable
Player getvariable ["theName",defaultRetzrnValue]
Something like player setVariable ["undercover", false, true];
Just found that, but I could've sworn I tested it before to no avail
(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
I'd guess I'm able to address them since all of them have custom variable names themselves
Ahh yeah then
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
player setVariable ["undercover", false, true]; Doesn't appear to be working
how are you addressing the player?
Multiplayer or singleplayer?
MP, that's where it needs to work
"Player" doesnt work in MP. Gotta replace it with the players var name
If thats how you access the variable
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
Tried it without the ""? Logan should be a public objevt then
Yeah, no "" in the code itself
no, _ makes a variable local to that scope. you don't do that.
The variable exists across all computers everywhere if set with public:true
Tried getting the variable with Logan getVariable?
For debug
whats your goal here?
.
ty i'll read it
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
πΌ
Tested Logan getVariable "undercover"; and it returned false after the other tests, at mission restart it doesn't return anything.
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 ?
Well you set it to "false" with:
player setVariable ["undercover", false, true];
Exactly
So its working
It wasn't the same undercover variable, as at mission start it's true
But in this case it didn't return any value
but that is just stupid if you want to be able to read that value from the server...
Then your implementation is wrong and your script doesnt set the variable correctly
You should be able to use the Functions Viewer in 3den to see what is written in there π
tried that not listed
The only reason I want to see and use the variable via server is to manually fix issues that may come with it. It's basically so that I can call and change the variable whenever I need to change it due to a situation that isn't accounted for within the .sqf file itself.
tried search configfile all/all for setragdoll not listed
I meant "it's stupid if you don't make the value global when you want to read it from the server"
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
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
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
sytemchat format ["does this object exist %1",Isnil"Objectvarname"];
also at the start of your script add something like systemchat "My script running";
systemchat "It has got this far in the script";
that depends where the EH would executes
The script has hints that activate, now the problem is simply that undercover is undefined
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
π
The script itself worked flawlessly, I just need to change the undercover variable to make it public, that's all pretty much
It obviously does not π
so you would put a debug line just before and just after the line that adds the setvar
Check var with debug, change it, check again if it worked
Arma 3 vm with stepper when
i would use systemchat all the time instead of a hint, you can scroll up systemchat, hint can get overwritten in an instant
yes doaglog if you want to look through the rpt, onscreen is much quicker for basic stuff
Imagine starting A3 without -nologs...
Through debug, the value does work and getVariable returns true, as it should, but the script doesn't recognise undercover as an existing variable
Impossible :insert meme:
so these are the type of things that can screw you over....
- 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
Just post your code in hatebin or sqfbin and show us
never assume always verify
Very true
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/
It was suggested by Tankbuster that the following may be of use to you.Zeu Debugging Tutorial & Foundation TemplateLast updated 17th September 2014IntroductionEveryone that writes code suffers from bugs and we all get frustrated trying to trace the cause.This tutorial is an attempt to walk yo...
oh nice
I guess now I just need to ask, how do I make a variable that can also be called with getVariable/setVariable through server
anyway can anyone actually read the code for this, as it doesnt appear in the config viewer for me.. https://community.bistudio.com/wiki/BIN_fnc_setRagdoll
@hollow plaza the answer to that is setvariable to define and getvariable to read
dude setVariable ["thisIsMyPublicVar","this is a value",true];```
I tried only using setVariable to define it, but it later said that a variable by the name of undercover does not exist
//Script 1:
private _var = "Sample text";
player setVariable ["Var", _var, true];
//Script 2:
private _var = player getVariable ["Var", "Default value"];
if you dont show your code, we cant help
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
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.
you are still going to be checking an object on a dedi server called player
i think you should show your code
That somehow works with player, even in MP
im betting two whole cookies that its a logic error
how many player slots in the mission ?
[_player] execVM "Disguise.sqf";
This is the initPlayerLocal.sqf and this is what makes 'player' work in the script
player always works in initPlayerLocal.sqf and anything execVM'd from there...
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
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.
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
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.
this is sqf right ?
Yeah
been doing this since 2002 and first i ever heard that, what was the reason behind it
uh
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
that doenst look right. never seen a comma
sqf commands are always terminated with a semi colon mate
Understandable, neither have I before coming into Arma scripting
For the love of god, please use syntax highlighting 
```sqf
[CODE]
```
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
Yeah, I do understand that much from my 3 years of doing Java.
I assume it was not at fault here though
https://community.bistudio.com/wiki/SQF_syntax
An SQF expression has to be terminated via either
;(preferred by convention!) or,.
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

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.
so why do you need to check the player object setvar on the server, am not sdeeing any reason in the code
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
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?
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=
The thing is, there are also scripts that happen without having you use the action itself.
Like the weapon checker, it prevents you from using addAction while you have a weapon equipped
if the objective of the script is to stop AI shooting your player when he is unarmed, then there are better methods
Like the addAction condition parameter?
addaction copnditions loop very fast, much better to remove and readd actionsa
excuse my typos fat hands on a small keyboard
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
I'll keep that in mind, although in future I doubt I'll even use these kinds of variables.
Luckily I only use mods I require, nothing too extra.
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
also this may be better for your undercover system./... https://community.bistudio.com/wiki/setCaptive
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
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
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
well you can get around that by using an OnRespawnEH and setpossing them to wherever you need them
What if there are multiple spawn points that I also need to change from time to time?
If you run the game with the Contact DLC enabled, you can see the function in the functions viewer π
https://imgur.com/a/RDujsit
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
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
Yeah, the OPFOR spawn is respawn_east, but that's the only respawn marker
why dont you add them to resistance and just setcaptive true/false
Can't do resistance because there's hostile AI on both West and Ind and they also fight each other.
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
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
i would switch that have resistance as civ friendly which they are, unfriendly to both east and west
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
ok still dont understand why you need to read a setvar placed on a player, from the server node,
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.
ok so why do that on the server, fired EH locally on player could be used for that
and much more efficient
How does that work from my standpoint as a Zeus?
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
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
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.
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.";
};
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
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
^ there ya go
remember to credit π
I did consider that, but stealing scripts just doesn't seem right if I don't understand jack about them.
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,
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.
"better to steal something working, than making something broken yourself" π€£
It's not about stealing code, it's about learning how they do it π
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
I'm way too stubborn to change my ways
I guess I'm just used to learning via trial and error
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
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.
Are the blood spots on a body hardcoded? Can I recreate it with a script, not hurting the character?
I guess they are engine-side, but maybe somebody else knows more.
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/
How can I found the hit selections regions in graphics?
sorry what?
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.
you can obtain all their names with getAllHitPointsDamage (https://community.bistudio.com/wiki/getAllHitPointsDamage)
https://community.bistudio.com/wiki/selectionPosition for selection positions
and https://community.bistudio.com/wiki/selectionNames for selection names
I'm not asking about names, I can retrieve it via the EH π
then this is what you are after
(there is no "hitpoint position" afaik)
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.
β¦I don't know? π¬
I want to know where on the model it is exactly.
Arma only allows to grab selection position or hitpoint names
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.
ah, yes
but no, not available from within the game afaik
Sad. Need to hurt AI soldiers again.
Is there any way to restrict taking something from a box? Like a uniform?
remove uniforms from the box π¬
none I know, Google will know better than I do that's for sure
"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.
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
that's selection locations, not hitboxes he wants
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
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?
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.
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
can you call a .sqe just like a .sqf?
what is .sqe?
it is what a eden editor composition is written to
ah thanks, I don't know then
what does it look like inside?
(if you can pastebin it)
thanks - nope, you cannot
it is a config, with angle, (relative) position etc
ok ty
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
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.
I guess you could use a script to extract the data from it to create the comp. But that's entirely needless I think.
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?
@steep coral There is no such feature sadly
You can use particles however, but not an ideal solution
@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
What you could try is to create fog when players enter the area.
ah nevermind
fog has global effect
I assume your usage of the particles is not in a proper density
particles for this is insane
Uh, well 3km by 3km? Ahem forget what I said
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
@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?
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
addItemToUniform command doesn't work for dead bodies? π₯΄
anyhow it's kind of a moot point since you can't control fog per client anyway
dunno
maybe try these instead?
https://community.bistudio.com/wiki/uniformContainer
https://community.bistudio.com/wiki/addItemCargoGlobal
@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(((
@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?
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
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...
excuse me, if i want to watch my friend after i dead, what command i should use? tks!
maybe this is what you are looking for https://youtu.be/TupQGLPy0Lo
@steep coral
Is there method/script to drop leaflets without the use of the drone?
https://community.bistudio.com/wiki/Arma_3:_Leaflets
they're just "bombs"
so create that and explode it
does anyone have good earplugs script ?
they're easy to make.
all you need is an addAction, and fadeSound
https://community.bistudio.com/wiki/fadeSound
https://community.bistudio.com/wiki/addAction
ok i will try thx
@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
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
}`;
thank you
- sqf syntax highlighting pls (see the pinned messages)
- that function doesn't tell me anything. give me
dre_fnc_CL_GetRandomMarkerPos
actually nevermind
you said you wanted the center of the marker
so just use:
_pos = getMarkerPos _markerName;
thx, I will try that!
Not sure why i didn't think of that, thanks very much man!
np.
remember to create the ammo, not the magazine!
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
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 π
{{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?
Double curly bracket on opening
the actual reason is unclosed curly braces
the first one never closes
also missing ]
that's why you should always indent your code properly
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
also missing
]
yeah gotcha that too
Something must have gone wrong when copying from my original script
leaned on my keyboard or something
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 ?
do you use CBA?
No
how do you create the vehicles?
I have a script for spawning vehicles
and the vehicle types can vary right?
for example
qilin -> qilin texture
slammer -> slammer texture?
Yes i can select them and then i press spawn
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
}
Ok thanks
Can I use B_Qilin_01_FsetObjectTextureGlobal [0, texture.paa];
For example
Mhm ok i will try
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?
@queen junco Can you post the full BIS_fnc_holdActionAdd call?
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?
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.
okay, I will try that. thx for the effort ^^
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.
I just found my error. I used "alarm.sqf" instead of "Scripts\alarm.sqf" -.-
Thanks for your help
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.
So on regular killed eventhandler, does it trigger only on the client where the killed object is local? https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed
Would "MPKilled" work otherwise?
Only need it to check two units on a server.
yeah you can use that one too
yup, not isMultiplayer = isSingleplayer
there is also isMultiplayerSoloβ¦
oh dangit, wrong button. hope you didn't hear that, accidentally hit text to speech
too late, you are banneded!
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
need addon config, yes.
but you can give them an Identity
Blahhh. Yeah, I got them named and ID'd so the player name doesn't overwrite them and all, but I want that snazzy '
Sgt. Rahman' when you're looking at them.
(Really, there's no generic Hexagon emote?)
(π«π· β there is π)
o.0 I may be missing something, but that's the french flag, no?
yes, and France is nicknamed the Hexagon, because of its shape π
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.
that would be #arma3_config, and it is not my turf either. but you could script a hover text though, if you want π
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
sorry for the slow response - basically I want fire near an enemy to make the enemy panic and respond. rn they just seem to freeze up?
might try just using vcom and not lambs
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
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 π€
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
@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.
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?
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.
yeah I have a lot of HCs
so this is just run local on the machine that the AI is on I assume?
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
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
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 π
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
#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];
};
};
}];
wouldn't it be better to do it based on stance?
cuz this will just panic over and over no matter the stance
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
you can change this on if(panicCount < 5) and if(panicCount >= 5)
what is _x?
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?
baby don't hurt me π΅
https://www.youtube.com/watch?v=1HB3FOk8h8M look in the youtube comments section to see the script and add script to vehicle you would like to be a mobleFob
https://www.youtube.com/watch?v=lb6lBox3Se4 Testing a script i put together to drop supplies by throwing green smoke grenade (m18) for IFA3 mod
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
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?
myTruck = createVehicle ...
I suppose https://community.bistudio.com/wiki/setVehicleVarName could be used if you aren't handling deletion in the same function
no, not ideal at the very least.
certainly not.
if I don't want to disableUserInput, how can I disable a player from moving and just allow them to look around?
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
do the playmove/switchmove series block inputs but allow viewership?
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
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.
no idea π€· the wiki says the music parameter is only for fade out, and the function header says it only works with fade in.
yeah, wiki kinda confusing here.
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;
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.
fade in doesnt turn music volume up
run this before you call it to fade in _duration fadeMusic 1;
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
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?
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
Oh yeah that'll work too, much neater
does netId work in SP? iirc it doesn't
it does not
This will be for MP so it will work for my applications
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
Not sure if is even faster than Connor's solution, but can we just do nearestTerrainObjects [getPosATL _obj, [], <a very small number>]; and check if _obj is returned?
0.0012ms vs 0.0033ms
Which is which?
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.
Mmmm-aybe we just need to make a ticket for isTerrainObject?
Seems pretty niche
not that I use it, but it sure prevents to use nearestTerrainObjects with a 0.0001 radius on said object's position
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 π
Spoiler: that's how Dedmen did it in the engine too
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
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
ideally any of them. dont really need them for scripted, but Zeus is what i wanna catch
Dunno. But I know that the alternative syntax works.
You can try that too. If it returns an empty string as well, check your code, otherwise make a ticket on FT.
I think you simply need the init.
The syntax was something like :
[class, "init", code] call CBA_fnc_addClassEventHandler
Not sure
Also not sure about a group version
will look into it.
Have you tried using a different IDC? Maybe something else is using 1092 already.
The code that gets executed by addPublicVariableEventHandler on triggering. Is that called or spawned?
dunno. you can try this:
varName addPublicVariableEventHandler {systemChat str canSuspend}
it's not spawned
Alright thanks
and a good thing too, that would be an absolute disaster
spawn/execVM is almost always a mistake
Yeah I thought it was called, but I saw some weird snippet somewhere where someone was sleeping in the code
so i was confused
doubly true since most people think:
call = unsch
spawn = sched
the spawn part is correct tho! π
AnimDone doesn't work on actions/gestures correct?
no
Didn't think so
the best you can do is use an each frame EH with a timer
that sounds awfull
it is
hah this describes the whole engine
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?
"the execVM" ?
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
are these happening on different clients?
alarm_trg_1 == false -> !alarm_trg_1
@little raptor that looks deceptively like a finger pointing up, as if to say you agree π
since when does middle finger mean agree?! π
i only figured out it was a middle finger by hovering over it and reading the name
@lyric schooner How is this possible

!purgeban or something! π
if he misspelled 'triggers', he's going to be so embarrased
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;
!purgeban @drowsy pecan 0 racist
*PewPewPew!!*
RIP @drowsy pecan

Please always be mindful of your scripts :/
https://forums.bohemia.net/forums/topic/219506-hafm-navy-ships-v20/?do=findComment&comment=3427946
incidentally, i recently did some server performance profiling for dayz mod in a2 and also found global setVariable to be the biggest single contributor
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.
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
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
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...
@queen junco likely your execVM executes before init or before those publicVariable calls' effects are observable on another client
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
Actions from a vehicle seat are self actions.
I meant use a simple missionNamespace getVariable to make sure you don't get an error
even if your vars don't exist yet
while {!(missionNamespace getVariable ["alarm_trg_1", false]) || !(missionNamespace getVariable ["alarm_trg_2", false]) || !(missionNamespace getVariable ["alarm_trg_3", false])}}
that's the simple version
This is also (going to become) a problem, every player joining is going to reset the variables.
all I did was use define to make it shorter:
#define getMVar(x) (missionNamespace getVariable [#x, false])
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;
};
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
Quick lesson in boolean logic:
if (_val) //Same as if (_val == true)
if (!_val) //Same as if (_val == false)
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.
the channel is made for that!
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
So what enableInside does?
I don't think I've noticed that Β―_(γ)_/Β―
not true. being able to remotely call functions/execute code and synch variables is a lot of sugar arma provides
arma MP synch isnt easy but its as easy at it gets.
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
Answering my own question, it should look like this
_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", 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
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
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
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.
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
Open a FT ticket. Otherwise discussing this here makes not sense.
it seems to fit the channel description perfectly, don't you think?
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?
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
I don't understand your question in relation to your problem π€
sample script:
waitUntil {
sleep 1;
_p = player;
allUnits findIf {_x distance player < _radius} != -1
};
//doSomething
or if you want something to happen constantly when the player is near them:
while {true} do {
{
if (player distance _x < _radius) then {
//do something
};
} forEach allUnits;
sleep 2;
};
not generalized, not good either. but it gives you an idea as to what you need
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 [])).....
your function doesn't return anything
it's returning void
_shortList pushBack _x select 2;
could result in an error anyway
use:
_shortList pushBack _x#2;
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
well that is returning something
it returns _this - 1
what do you want to return from your function?
The array generated in "_selection".
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
I don't have good reason for most things I am doing, but this is no longer returning the same error. Thank you.
np
addAction isn't synced in MP, right?
Nope, need to be executed on all clients
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.
you have a random " in there
@random tendon
also you have a missing bracket
also, are your cords in ATL, AGL, or ASL?
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
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.
are you using a programming environment? they usually catch silly mistakes like that
that doesn't mean anything
they're probably AGL
so are Eden coords
Okay I'll try all the iterations of setPos there is pertaining to different coords
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
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.
btw and for my knowledge, do you know if AGLS or AGLSW?
Not sure.
I think AGLSW
I can test
gimme a sec
u r da man π€
according to wiki: setPos => PositionASL = ASLW on sea and ATL on land
although it also says that getPos = AGLS
That's to be expected tho with so many commands they'd be so vague with their documentation
if Lou doesn't know, how is the wiki supposed to know? π€£
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
@winter rose it's AGLSW
yeah. it's wrong. we lately discovered that! π
it's a combination of AGLSW and AGL 
thankie!
if you want I can share a test script
so I can safely say that getPos is AGLSW on the wiki right?
AGLSW = Above Ground Level inc. Surfaces and Waves?
sorta! π
yeah, but it has a slightly different behavior than the getPos
(to anyone entering the channel - this is a normal conversation)
which is AGLS
β¦I am talking about getPos?
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
offset from ATL?
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
you do need setDir, so you will need to calculate the direction based on their position relative to their position
something to do with getRelDir. maybe this?
_unit setDir (getDir _unit + (_unit getRelDir _pos));
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
thanks ^^ so getPos and setPos, same fight?
AGLS above ground/terrain, ASLW above water
@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
- 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
no. getPos returns the AGLS height to the nearest surface below (sometimes above). and it is consistent
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?
define an origin and calculate the relative positions in an array format: [className, RelPos, RelUpAndDir]
the origin should ideally be the average position
alright ill try that
actually, if you use one of the objects as the origin, it'll be way better
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
https://community.bistudio.com/wiki/Example_Code:_Get_Center
Positions centre example π
yeah but using an object as the center is better βοΈ
no u!
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?
Are there any sqf that plug-ins that will format to ace standards ? Or at least auto-format long arrays ?
For vscode ^
Anyone here mind helping out in terms of figuring this out? Trying to set up a teleporter to one location and back, but apparently I did something wrong, and I don't know what
https://cdn.discordapp.com/attachments/610496692558495762/800939859505184818/unknown.png
https://cdn.discordapp.com/attachments/610496692558495762/800940217291767818/unknown.png
Here are some screenshots of the other side of the teleporter couple
https://cdn.discordapp.com/attachments/610496692558495762/800941363171819560/unknown.png
https://cdn.discordapp.com/attachments/610496692558495762/800941409216626738/unknown.png
first of all you can shrink both of those actions {player setPosATL getPosATL SE_int;}
second, how is it broken?
And what is the result? How it didn't work?
If you check the first link, the option to teleport never popped up on the scroll wheel menu
What is the base there?
I assume you need to write this instead of base? @minor osprey
Use the joinSilent command in the waypoint completion statement.
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
];
};
"" in _x?
or if you mean detect if all elements are empty then isEqualTo like Merlijn said.
Thanks guys π
@sharp grotto
_array - [""]
```removes all the `""` from the array (I'm assuming that's what you wanted?)
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;};
};
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.
do you need to convert it in a script or you just need literally that but as a config path?
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
so it may not always be that exact path?
no the path will always be exact to the group
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?
I need a script to do that for any config path
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
how did you get that in the first place?
are you using str?
although I think str gives \ at start?
is possible. just trimming the start bin\config.bin/CfgGroups/West/BLU_F/Infantry/BUS_InfSquad
Unfortunately BIS_fnc_configPath can't handle config.bin and similar =/
@little raptor configClasses
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
"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]
because you use str
you can use those individually with bis_fnc_spawnGroup
that's the stringized version
eh? I don't quite follow
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
str [1,2,3] will run to_string on every element eventually
even what the console returns to you is the Stringized version
Ok, that explains it
also freaky stuff, if you use debug console to spawn AI in the editor they will move around π
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?
well... the action code will only execute on the player doing the action so you dont need to send hints anywhere.
if you look at the wiki you may notice _caller in some of the code arguments refers to the unit doing the action.
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
So if I refer to _caller in the codeComplete it would only act to the player that did the holdAction?
yea
noice, thx ^^
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 
There's also candy! π
in a white van? I'm in!
*waves
Are you serious?! I can't tell! π
meh, I guess I raised expectations on your side sooo⦠big mod? I am on perf branch if that's ok?
steep learning curve colt
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
It was suggested by Tankbuster that the following may be of use to you.Zeu Debugging Tutorial & Foundation TemplateLast updated 17th September 2014IntroductionEveryone that writes code suffers from bugs and we all get frustrated trying to trace the cause.This tutorial is an attempt to walk yo...
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
my link explains how you figure out why your code doesnt work, basic skill set you need to learn
debugging doesn't help if it's not supported on public servers π€¦ββοΈ
yeah... expect him to get banned soonβ’οΈ
have cinematic cameras
well, in case you don't want to get banned as well (including this Discord), I wouldn't ask such questions...
Yeah I suggest you stop before you need to be removed
alright then
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.
idk i found a forum
about that stuff if u wanna look?
I've seen mods, like antistasi and overthrow like that. Sure
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
why dont you just add a crate with exactly what you want in it
Probably space limitations but you can have seperstre crates for uniform and stuff
Is there a way for βforceWeaponFireβ to last a certain duration?
uh
Since when I use it in a trigger for an AI, they only fire 1 shot/burst
You can probably make a loop
Not as an sqf file but within the trigger
Call on a sqf file?
Or put SQF in trigger πΈ
That works too
However, you can try to change the muzzle to full auto and see if that works
I did the muzzle on full auto
But it only fires 1 shot
But with burst, it does the standard 3
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
How do I overwrite what arma thinks is a full Arsenal is ie I want to effect all virtual arsenals placed with the true option full script is https://github.com/509th-PIR/02_Future_Operations/blob/master/Mission_base.vr/Unit/Limited_Arsenal/Arsenal.sqf
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
it is possible, but my main question would be "why?" ^^
I am designing a system using CBA waitUntil commands
Basically waitUntil only works on one variable once so I need multiple variables
e.g```sqf
for "i" from 1 to 15 do {
missionNamespace setVariable [format ["TAG_var%1", _i], false];
};
No, waitUntil { var1 && var2 && var3 } works
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
(I may be off topic but) do you know scripted event handlers?
What other versions are there that do the same thing?
And Iβve never really worked with them Lou
why?
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
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
can you explain what you're trying to achieve with that?
I might be able to give you a better way to do it
Will dm to try to further explain in case anyone else has other questions here
ok
Does anyone know what is the pbo of the rhs configuration menu?
MFW I create a flagpole to teleport players and it teleports the flagpole. 
mfw somebody posts something like that 
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...
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
I thought it was funny.
'twas, it's part of what makes Arma great π
is this not quite what you need?
https://community.bistudio.com/wiki/Arma_3:_Actions#LadderUp
(works for me)
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
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 ?
there is such a value in the weapon config iirc
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?
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?
[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;
@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
Thank you
lineIntersectsSurfaces does the job. still no idea why the other two are borken
Conner's method where I would have to go in Description.ext or e where or what file would I have to create is that I'm new to this
Connor's method would go in an sqf file during the mission init. so perhaps initPlayerLocal.sqf
You better patent it right now Connor! π€£
tracks thanks is that I want this button to do this function [objNull, player] call ace_medical_treatment_fnc_fullHeal
cure drive in init
[objNull, this] call ace_medical_treatment_fnc_fullHeal but I don't know how or if it is well written
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;
}];
@robust hollow The location which you recommend or I leave it like this 0.0.0.0
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;
@robust hollow this gives me an error with this part of the script
call BIS_fnc_addScriptedEventHandler;
whats the error?
there I tell you
you've said where but not why. the error log will say why. find it in your rpt file.
@robust hollow I can't find the place of the error, but I already copied the command again
paste the whole snippet of code then. there might be something wrong with it.
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
paste the whole snippet of code then. there might be something wrong with it.
@robust hollow Well there is a photo of how I have the script
Don't do your troubleshoot in private since you asked to public. Just post the link to the image here
@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;
Check the pinned message to format it
there you have the complete command and running with ace
- what is the exact error you get?
- where did you put this script?
(it works now)
@exotic flax a line of text was missing that was the title or something like that
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
@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
rip, so only way is to constantly shove it back in their bag if they get rid of it?
Yes
I mean you could always disable inventory access, but that is probably not going to be acceptable for most use cases
but can i set it to only work with a very specific bag
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
i.e check for idk ilbe_something_something ?
What's that
backpack classname
Yeah
huh
if ((backpack _unit) isEqualTo "ilbe_something_something" && {_itemRemoved isEqualTo "ItemICareABout"}) then { _unit addBackpackCargoGlobal ["ItemICareAbout", 1]; };```
is that literally it
Yes
where do i put this
Well, minus the eventhandler setup code
playerlocalinit.sqf?
Depends on your mission setup but absolute barebones throw a addMissionEventHandler into the init.sqf
its a merge thing and I haven't got around to fixing