#arma3_scripting
1 messages · Page 91 of 1
For some reason this seems to execute on every person not just the people in the group. Any idea on how to make it work on just the units in the group?
{ [0, "BLACK", 10, 1] remoteExecCall ["BIS_fnc_fadeEffect"]; } forEach units group player;
@finite bone this should work as an example of getting the coordinates manually (kinda)
Ooh
you don't have anything that limits the execution to the group's units. You remoteExecCall it everywhere N times, where N is the unit count of said group
check target params at https://community.bistudio.com/wiki/remoteExec
a bit of context: BIS_fnc_attachToRelative didn't work there because it attaches to target's origin and doesn't do bones with following rotation. But for non-skeleton-animated objects that function should be super good enough
hey all having issues with ghost riders extraction script (https://github.com/Ghostrider-DbD-/Config-Extraction-Tools)
its not pulling any magazines for primary weapons like rifles etc anyone got a fix?
ive found it misses items ive removed things from the exclusion but that didnt help.
Theres the loot table generator (https://steamcommunity.com/sharedfiles/filedetails/?id=785410905) as well but id rather have it just grab all items and export them to clipboard
i just want to pull things for the loot tables traders and what not want to pull everything from addons as well i dont know sqf sadly so yeah
last commit: 6 years ago, whew
yeah ahahah
i really want to fix it but yeah dont know sqf if someone could point me what to do or other options or fix it or anything youd be a life saver
Hey all,
i am trying to get a trigger to fire when the combined numbers of two enemy groups falls below a certain figure. i am just unsure how such code would be written.
could someone demonstrate to me how such code would be written please. any help is greatly appreciated!
ah. Retro.
On a more serious note, have you edited a GRG_Root variable? By default it only seems to search for classnames that start with "CUP"
yeah i rmeoved it and removed the exclusions
and yeah, it doesn't seem to use weapon magazines anywhere
genius
private _units = units group1 + units group2;
count (_units select {alive _x}) < 10;
so that would be camagazine? ive been looking at it all day trying to find something thatd help
Thank you kindly Command, i will make great use of this "my attempt looks completely different" ... many thanks and i hope you have a great day 🇼
try to replace magazines.sqf contents with https://sqfbin.com/umewozaxiburoyujabup (only infantry magazine output added, i haven't checked other logic)
yeah, sqfbin's page has some extras. There's a button to get raw contents there
it leads to https://sqfbin.com/raw/umewozaxiburoyujabup
looks like it might be working though
god i could fucking shove my tongue down your throat right now it worked my god thank you
that's some logic error, but it doesn't prevent the script from getting the output
idk if the other options are working as well i know weapons isnt pulling attachments like optics etc could you look at the others just to have aquick check for me please only if youre free and want to
weapons.sqf, line 184, change private _include = false; to private _include = true; 
testing
it worked i was timed out for sending a kiss gif ahahha
did you look at the others and notice anything?
the thing that i've noticed the most is that i don't really like to dig that code, sorry 😛
thats fine thanks for your help
Hello and I'm sorry for interjecting, I've been trying to kick the player off the server if they are in an invalid slot. I figured out some code that does the kick but I'm getting an error when executing the kick (error in the server console).
** The code (ofc Hypoxic rewrote it for me and made it really nice and lot of others helped me) :**
[] spawn {
scriptName "Unit Authorization Script";
private _allowedUIDs = [
["SL_1", ["76561198105370015", "76561198846755720"]],
["SL_2", ["76561198105370015", "76561198846755720"]],
["RTO_1", ["76561198105370015", "76561198846755720"]],
["RTO_2", ["76561198350976093"]]
];
private _index = _allowedUIDs apply {
_x select 0
} find vehicleVarName player;
if (_index == -1) exitWith {};
private _accepted = (getPlayerUID player in (_allowedUIDs select _index select 1));
if (_accepted) then {
sleep 10;
hint "Welcome";
} else {
sleep 1;
hint "Unauthorised slot!";
sleep 1;
password = "BigPPAdmin";
password serverCommand format ["#kick %1",name player];
};
};
Error in the console:
13:19:31 Failed attempt to execute serverCommand '#kick SgtDevRupesh_MW' by server.
Make sure your pasword is defined in the server.cfg
under serverCommandPassword
and that the serverCommand command is server executed
Oh it needs command password?
yhea, you cant define it like this
Ah, okay ^^ thanks I'll try using the command password
so if you put in server.cfg as "test" on your server executed file you can just do ```sqf
"test" serverCommand format ["#kick %1",name player];
Oh okay ^^
and since it has to be server executed make sure you replace player
my gues looking at how you set it up is you need the client to send a request to the server and the server "answers" back with a kick or no kick
That sounds complicated lol
just RE the servercommand function in replace of what you had.
did you put the password in server.cfg?
did you even read the servercommands wiki page? you just figured you could add a server password like this? gotta use that serverconfig to do that
I searched for kick in this channel and found that script :D
Gave it a try and well it was a progress cuz now things were showing up in server console 😅
if (_accepted) then {
sleep 10;
hint "Welcome";
} else {
sleep 1;
hint "Unauthorised slot!";
sleep 1;
["BigPPAdmin", (format ["#kick %1",name player])] remoteExec ["serverCommand", 2];
};
Something like this
why did you remove the remoteexec that was in my example before
you have to send the command to the server
oops
what did I copy then?
I copied something else-
The code I copied did not came with remoteExec lol
Idk my wee brain is making me dizzy lol
I'll use remoteExec
you must have copied it before we talked about remoteexecuting just slightly below that message
Yeah
I did
I was up for 22 hours when we were talking about it lol
yesterday ig
yeah 14 hours ago lmao
Btw just reconfirming I need command password right? (what is difference between command and admin?).
Oh, thank you so much!
admin is for when you want to log into admin
and command for scripts
yes
Isnt there a function that checks which mods write into a class? Does anyone know what its called
Instead of remoteExec kick you can just do this on the client side.
endMission "end";```
failMission maybe in order to not delete potential saves
Not sure about function, but if you get Advanced Deloper Tools
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://steamcommunity.com/sharedfiles/filedetails/%3Fid%3D2369477168&ved=2ahUKEwjj5dmft46AAxVQhP0HHS-MANwQjjh6BAgSEAE&usg=AOvVaw2085XztFC4wLNqxEnsDiAn
You can easily use the config viewer, it's listed at the bottom.
I think the vanilla one also shows it, but it's just pain to use.
Ya I have those tools, not seeing what I want though
Find the class you want to get the info from, open it, look at bottom
That list of all PBOs that edit it
You could also use Battleye filters to kick a client with setting a publicVariable on the client side if he is in a wrong slot (https://community.bistudio.com/wiki/publicVariable)
this should be it, if I understand you correctly
hmm
I wish there was a way to check the actual name of the pbo, that might be more helpful in this case, thanks
I was using this yesterday to find out which addon edits one class and it did show me the exact pbo 
that addons name is the class name the addon has in cfgPatches. The pbo could be something entirely different. It sounds like you just got lucky
I see. Lucky me then 
I hope this can at least help you narrow down which PBO it could be
Hello , I'm looking for some help with an eventHandler , specifficly - "SlotItemChanged" . I can't seem to get it to work.
what game version are you using? It'll not yet available in the regular release 
im not using save :)
and its going to end mission (or fail) just for the client right?
yes
okay ^^
and I should remoteExec it right?
["END1"] remoteExec ["endMission", 0, true]; // Arma 3```
that would end it for everyone
oh
<remote> <exec>
failMission "END1";
this will end just for the client?
The command has local effect, meaning it only takes effect on the machine it's executed on. This is why it only affects the one client. By remoteExecing it with target 0, you are sending that instruction to every machine...where it will have local effect for all of them.
y y y e s

OHH
Okay understood :)
tysm
please read the answers 😛
12.2 , yeah , so waiting for patch to come so i can update.
I did lmao but was wondering if its 'that easy' lol
Me waiting for WW2 DLC pff
fret not, for sometimes it is as simple as that!
it's not before you become confident that SQF stabs you in the back 😄
Hahaha yeah SQF does stab in the back sometimes ;)
I hope Enfusion doesnt, I havent touched it 'yet'.
we're busy getting stabbed ourselves 😁
nah the language is very fine, it's network scripting / component organisation that can be tricky. but #enfusion_scripting will be here for assistance when the time comes!
Ooo, tysm if I get issues I will bring stabbing wounds in that channel lmao
@tough abyss please write A3FT bug report and PM me the URL
PM ideally on skype than on Discord, for now until Discord gets friendlist
I am going through my mod pack trying to resize it size and I just found a pbo called "baseconfig.pbo"
any clue what could it be?
contains something called "$PBOPRFIX$"
and config.bin
If it's your own mod you should know that. Sounds more like you try to re-upload mods, which most likely violates copyright 
Thanks for the assumptions but no, this is a mod pack from an old unit me and 20 other dudes been in and we just copy pasted the mod pack we had back then and we trying to cut it down cause its full of shit, thanks anyways.
Is there any scripted method of having depth of field? Cannot seem to find any
Trying to make objects close up appear blurred
most likely a mixture of PP, i dont think cameras itself have scripted dof
It seems the FOW sherman has abysmal forward acceleration
is there any way possible to increase its acceleration?
There aren't any good ways through scripting.
You can make an EH that gives it a little setVelocity boost when moving forward, but this is a dangerous game to play with Arma physics. You could reduce its mass, but this may have unexpected side effects if overdone.
Keep in mind that it may be accurate; 1940s tanks were nothing like the speedy MBTs of today.
Does anyone know of a way to set a ui elements image (ex. background image) through script?
I want to provide it a new paa path when conditions are met
Most likely using format
So you can make premade paths and then in the script.you cycle through them and put it in one string.
^im going to move this to #arma3_gui , but I need it to be dynamic, cant have preset
Is it possible to script an option for the player to choose different times(day/night/morning) when clicking middle mouse(not sure what that menu is called) on an object?
yes, it is.
The scroll wheel menu is called the action menu
And to add things to it, you use https://community.bistudio.com/wiki/addAction
Got it, thanks
Other than skipTime is there a command that allows me to change the time to a certain point?
_blackbox apply
{
_dummy = createVehicle [typeOf _helicopter, _x select 0,[],0,"CAN_COLLIDE"];
{_dummy disableCollisionWith _x} foreach vehicles;
_dummy setdir _x select 1;
_dummy setVectorDirandUp [_x select 2,_x select 3];
_dummy allowDammage false;
_dummy enableSimulation False;
}
_blackbox is a private array of arrays, each with four elements captured from a helicopter in flight - position, heading, vectorDir and vectorUp.
While a systemchat _x select 0 for instance reports the correct position from the first element, the whole thing hangs when attempting to createVehicle, stating that 0 elements of 3 have been supplied.
setDate
no, the only other time related command which can modify time is setTimeMultiplier (speeds up the time)
Got it, thanks
@manic sigil If systemchat _x select 0 reports the correct position then the array is busted, because that's just outputting _x, not _x#0.
systemChat is a unary command so it has higher precedence than select.
... you may be right, I think I removed a layer of the array without thinking it through.
Lemme check.
This line is busted for similar reasons but also pointless: _dummy setdir _x select 1;
And the disableCollisionWith part won't work as intended because only one disabled-collision reference is stored per object. Plus it doesn't work on physX objects.
Alright, that got a step closer, it creates the first helicopter dummy... then it spits out the entire rest of the array while trying to set it's heading, freaks out and exits, like it forgets its supposed to be working with the first element alone T_T
Damn. I just want them to be phantom helicopters; I got them working once and it looks nice but they're absolutely lethal to any moving vehicles.
simple objects maybe?
I think I gave that a try previously and it wasn't working out, but I'll give it a go when I've got the spawning figured.
Got it sorta working, it creates the dummies with a pleasant delay, but complains the whole time that one of the numbers it's using isn't right.
Ah feck I forgot I was collecting speed info and hadn't implemented it yet
😎
Alright, now to get simpleObjects to work.
Simpleobjects still have collision :reducedToAshes:
is there a way to get a list of all vests? or a category of items?
configClasses will do
Can you help me out with that?
Like what am i looking for when trying to figure what the class type is of vest?
Wait till I'm home
Hey! I'm trying to make a spooky operation and am wanting to know how to do the following.
If a player enters a trigger, then the objects with the variable names of 'lamp11' through 'lamp20' will play the same sound file called 'dalliminn' at the same time. Is there a way to do this?
vests have an itemInfo type of 701.
What determines which crewmember gets control of a vehicle weapon, when added by addWeaponGlobal?
I had thought it was always the driver/pilot, but I've now encountered a helicopter (CSLA MH-60 DAP) where it goes to the copilot instead. For double the puzzlin', this vehicle has a pilot-controlled weapon by default, and this is defined as normal for pilot-controlled weapons, in the weapons property of its top-level config.
I can't find any config properties that appear relevant and different between this and vehicles that behave normally. And I can't see any reason why its default weapon would be assigned differently to an addWeaponGlobal weapon.
HI im lookking to make a script that moves an item from a players inventory to the vehicle they are in. Anyone have an idea of how?
Weird how helicopters land, hope in reforger it’s realistic and not this weird
Hey, I used to land like this back is A1 >:p
Its just... simple. Takes no consideration for distance to target and how to flare.
I did work out some ways of easing it; you just have to limitSpeed slowly down to something reasonable. It wont make the top KOTH POG videos, but you also wont join the Chernarus Space Program.
LimitSpeed works in MP?
Afaik yes, but you also have to lobotomize the AI or theyll ignore it when theres enemies around.
Lobotomise…
Uhhh
do yk I’m dumb?
Time to Google
I wonder if https://community.bistudio.com/wiki/forceSpeed will work
removeItem and addItemCargo
for "_i" from 11 to 20 do {
_lamp = missionNamespace getVariable ["lamp" + str _i, objNull];
_lamp say3D "dalliminn"
};
dalliminn should be a defined sound in cfgSounds class
probably configOf _vehicle >> "primaryObserver" (at least the only 2 vehicles i can see it set on the main config itself are CSLA H-60 and AH-1, and both add weapons to the first turret (copilot/gunner) by default) 
is it possible to deny placing men in zeus when you want to place static weapons? if I disallow men to be listed then also the static guns gets removed from zeus list
empty static guns are listed in yellow/neutral side 
weird not in my zeus
mission that only has playable unit, following code, result on screenshot
[[player], {
params ["_player"];
_grp = createGroup sideLogic;
_new = _grp createUnit ["ModuleCurator_F", [1,1,1], [], 0, "NONE"];
removeAllCuratorAddons _new;
_new addCuratorAddons ["A3_Static_F", "A3_Static_F_AA_01"];
_player assignCurator _new;
}] remoteExec ["call", 2];```
what's the code? Where is it tested? What's the result you get?
I tried your code from console in new mission but still not working
im on prof branch
perf/prof branch, perf binary. 3DEN -> single playable unit -> preview -> code above into debug console -> works
same mission -> enable debug console to all -> exported to MP -> game restart -> multiplayer -> host server -> start -> same code in debug console -> works
#canNotReproduce
aaah, its some mod doing it
probably zeus enhanced
@south swan thx man , working now. still have equipment in zeus for some reason
fixed the equipment with iskindof "AllVehicles" filter in CuratorObjectRegistered
Can I give Items in May inventory specific variables to identify Thema Forum example. If the Player buys a weapon in my shop ist get a serial number?
As far as I know, items in inventory are just references to their configs.
With the exceptions of weapon holders that have container objects associated with them.
Albeit, TFAR does assign unique frequency sets to radios, but those also become their own, unique objects.
Thank you! This worked very well! I'm new to scripting, is there a way to make the song repeat?
For locking the seats, lockCargo and lockDriver would be what you want.
For hiding the interior, ??? and bear in mind it may not be possible. Note that you also cannot hide the shadows cast by the "hidden" parts of the vehicle.
You do not need to remoteExec setObjectTextureGlobal. As the name implies, it is already a global command. remoteExecing it to everyone is unnecessary duplication of what the command already does.
In fact, object init fields are already executed on all machines, so you don't need setObjectTextureGlobal at all. Normal setObjectTexture without any remoteExec will do fine.
Look in its config under hiddenSelectionsTextures. Any texture listed there, you can remove or replace; if those don't cover it, there's nothing you can do.
No, the commander (if it has one) will be covered by either lockCargo or lockTurret, depending on whether the commander has a turret.
Cameras are turrets, just without any guns on
Depending on whether this is placed with Zeus, what I said here isn't strictly true. Object init fields are executed on all machines when Editor-placed, but only on the machine that placed them when Zeus-placed.
So if this is meant for Zeus, you should either remoteExec setObjectTexture, or use plain setObjectTextureGlobal. (Definitely don't remoteExec setObjectTextureGlobal though.)
I had a question about the missionProfileNamespace and when it's loaded/reloaded for a mission. I have a framework I'm developing and I had the inventory persistence saving on the missionProfileNamespace, but despite saveMissionProfileNamespace running whenever all players disconnect, or the MP session ends, saved changes don't seem to be reflected until the server turned off and turned on.
Does a mission, or mission group's, missionProfileNamespace only load once on the server, instead of each time the mission is init'd? I switched over to the server's profileNamespace, and I no longer have this problem, but I was wondering if this behavior is intended.
If it helps, my server is running on Debian 11.
Oh, bother
For inline code, just use one `
Thank you!
You can either use a timer (if you know the length of the song) or check if sound object is null. If so replay it
_lamps = [];
for "_i" from 11 to 20 do {
_lamp = missionNamespace getVariable ["lamp" + str _i, objNull];
_lamps pushBack _lamp
};
_lamps spawn {
while {true} do {
{
_x say3D "dalliminn"
} forEach _this;
sleep soundDuration;
}
}
Replace soundDuration with the duration of the song (in seconds)
There's no need for DMs, this is the channel for solving scripting confusion
Rightclick on the vehicle, select "find in config viewer", and then scroll to the line that says hiddenSelectionTextures - it's in alphabetical order
the lines are, not the textures -- to clarify
The list of textures is in the same order as the selection indices used with setObjectTexture; first one is selection 0, etc. (actually I think you can also see the full list of selections in the hiddenSelections property)
Those selections are the only parts of the vehicle that can be retextured with scripting. Everything not included in a selection is part of the model and can't be changed at this level.
There are more, you can see the start of one and there are more in the hiddenSelections list above
you can copy the entire entry with Ctrl+C 
and then paste it somewhere more comfortable to read
You can also install this and gain the ability to double-click on config entries to see them in full: https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168
None of those look like interior textures so you're probably out of luck
i haven't posted anything about "not here", mind you 😛
i was only meaning "in-game config editor can really be difficult to read"
Actually, it looks like the interior is covered by selection 2...but this texture also appears to include the turret ring and gun mount. So you can try selection 2, but don't be surprised if it also hides things you want to keep.
...same way you're hiding selections 0 and 1 already
Precisely
No, 3 is the camo net optional component
4 is the slat cage and 5 is the camera mast
Then that's it. The interior isn't set up for retexturing, so there's not really anything to be done.
The numbers are the order of the selections as listed in the config (starting at 0).
Because I'm using Advanced Developer Tools, I can look at the texture files and see what they look like (flat, not applied to the model, at least). But you can also get a rough idea by looking at the names of the textures and selections, and also by just trying them all and seeing what changes.
btw, the reason this isn't an issue on the Panther and Marshall is because you can't see inside them from the outside. Their interiors only exist in the first-person model, not the third-person. The Marid has windows so the interior is present (in low detail) in the third-person model.
why are you remoteexec'ing it 
Zeus placement. Zeus-placed object inits are only executed on the machine that placed them.
the functions tag can't start with numbers, right?
as opposed to setObjectTextureGlobal? 
i believe it is possible to but is very bad practice
so, no
😦 thx
The difference in this case is essentially none.
(Also, I've had issues with setObjectTextureGlobal not always working)
ditto, though just was wondering if there's any specific reason
As far as I can tell, missionProfileNamespace works as intended on Windows but we had reports of issues on Linux.
Thank you! At least it saves, somewhat.
hence Antistasi community still supports profileNamespace saves :P
I imagine it'd get fixed if someone put together a proper bug report, but I don't run Linux personally.
Where could I put that in?
Additionally, would you happen to know if mission.vars files are swappable? In it's current state, it's not good for persistent states, but sometimes our missions get swapped between servers, and it might be nice to copy and past a mission-specific variable file to have it initialized on another server.
Thank you!
I assumed they were swappable. I don't think I've actually tested it though.
Give me a sec and I'll check :P
Thank you again!
yep, vars file swapping works fine.
Excellent, at the very least, I can use it as a back-up and memory card.
When i add a script to mission, and use that mission on multiplayer, is the code only runs on server?
Or is it shared with client
the client also downloads the mission so the client can read the code, whether or not it gets exeucted on there depends on how you run it
(init/initserver/initplayerlocal) etc
what about for events
lets say i want a death counter
where does it run
that I don't know
depends which event you're talking about
generally speaking events run where they're added, and only if the target is local to that computer
except for MP events
huh wdym
for example see:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Explosion
t can be assigned to a remote unit or vehicle but will only fire on the PC where EH is added and explosion is local, i.e. it really needs to be added on every PC and JIP and will fire only where the explosion is originated.
Is there any way to use a string as a variable name? Want players to put object variable name into module attribute and use that in a function
missionNamespace setVariable ["myString", _val]
I'm confused
the string is the value, that is the name already
so module gets "myfunnyobject" as the value
where myfunnyobject is an object
private _object = missionNamespace getVariable ["myfunnyobject",objNull];```
oh wait
yes i understand
guh
thanks
private _varString = _logic getVariable ["KJW_CapitalShips_Module_Interior", objNull];
private _ship = missionNamespace getVariable [_varString, objNull];```
don't like it but who does 🙃
Are local variables per execution basis?
like if I use a local variable, complete the execution and in the same machine/player i run another sqf with the same local variable, would it work?
Local variables are "isolated" in a sense that they exist only in the scope they're defined in, also temporally. So if I understood your question, yeah, you're correct. Even if you ran two instances of the same function/script in parallel, the local variables would stay independent from each other as long as they've been defined as private e.g. with params
is there a function I can call to get the callsign of a group (as displayed in the slot selection)? It's different from the groupname itself.
Defined like so
CBA feature, ignore me
Would what work?
Is it possible to stop the landAt after a plane touches the runway? It seems that it's not waypoint based 🤔.
What I'd like to do is to stop the plane from doing a full taxi procedure.
I think there is an EH to detect if a plane lands. You may want that
Yeah, there is. But I don't think that there's a way to interact with landAt tho.
Tried doing disableAi with "MOVE" but didn't work.
Ezcoo answered my question thanks!
If I would say make a own pretty basic damage system. Would it be good to calculate the damage over Hit eventhandler since it gives out the damage or with damage eventhandler
Hey guys, where should i start scripting?
Any good tutorials to make myself familiar with editor and sqf?
Does anyone here know if there's a way to attach a spotlight relative to a players facing direction?
unit or camera facing?
Camera
you could potentially use an EachFrame mission EH + camera direction
https://community.bistudio.com/wiki/getCameraViewDirection for cam dir
https://community.bistudio.com/wiki/positionCameraToWorld for camera's pos (if needed)
anyone know how to script it so every time an action is done via the scroll wheel it will have a different result
specifics?
random
Or selectRandom
thanks
Im having some trouble with an event handler, im using the "Hit" one, and its calling consistently, but the _damage value is returning 0 almost everytime. Im shooting a unit with a rifle
Are you running any mods?
yup
I could see how ace medical might affect that
I thought id tested it with ace loaded and had fine results, but now it doest work. Ill test it again
What is the best way to call playSound for every player on a dedicated server? Should I just yeet it into remoteExec and execute it globally (target param set to 0)?
Had some trouble with this last time I did so - not every player heard it.
[["fogEntrance", 1]] remoteExec ["playSound"];
Yeah, I was thinking of using -2. Perhaps it would be even more efficient?
They are both the same only thing is with 0 is that itll still work on a non dedi server without issue
Hmm, is there any way to prevent AI from sway their turret while aiming? Expect a stupid workflow like use lockCameraTo slowly, but similar to how they aim an arty
Attempted to make a CIWS but it is very stupid to see a mechanical turret sways like there is a human in it
huh, didn't figure that was a thing. What if you setCustomAimCoef to 0 on the AI?
Nope, it doesn't do anything
when you say "make a CIWS" you mean a custom weapon and turret or what?
Currently using vanilla Praetorian and script the entire system. More like just trying to proof the concept
One thing I can try is removing the entire engine-driven turret animation and let animateSource do everything
is there a way to disable the zeus ping behavior without disabling the Y button?
is there any way to place some bushes from Tanoa?
So I've been looking for a while on how to save data from a played mission and use the data within another mission on a dedicated server. What I've found so far...
I looked into using InidBi2 but from what it seems, you're unable to save and not meant to save large quantities of data. Which sadly is what I need so it doesn't seem viable from what I've found.
Another option I've found is to use the saveVar command where you can save data into a campaign space. This option seems more viable but requires you to make a campaign, but it doesn't seem to work on a dedicated server
Idk what to do or if this is possible :/
You can save what you like in profileNamespace, although there is a reasonable limit to the quantity.
isn't the profileNamespace different for each mission? or would the namespace be the dedicated server?
profileNamespace is attached to the profile. It's written to the [profilename].vars.arma3profile file.
Any code can read anything from it.
Hence you should tag whatever you put there so that collisions don't happen. And be a bit careful about the quantity of data.
There is also missionProfileNamespace, which can actually be shared cross-mission.
You mean for AI or players?
only plausible one although I vaguely recall that it doesn't work: https://community.bistudio.com/wiki/Arma_3:_Actions#TakeVehicleControl
enableCopilot just controls whether the copilot action is available, I think.
Not sure if AI copilot can take over whenever they supposed to
You can probably:
- Force eject the dead pilot
- Switch the seat
- Let the dead get in again
Of course in scripts
Should
@queen cargo in OOS, what are the semantics of the SQF statement/operator/whatever it is?
there is an ebnf in the git
can someone please help me? I am trying to create a execVM command using a string from a variable.
my variable is formmated as a string "string" and I would like to run the execVM like this execVM string.sqf" but not sure how to do this?
thanks
Thanks!
You mean something like:
execVM format ["%1.sqf", _myVar]
?
yes, would that work or would _myVar inlude the ""?
Yeah the "" around string is not included
awesome, thank you very much.
What does SQF return? The return of the SQF inside it?
I'm trying to create a particle effect at 4 sites and then delete them later to create a different particle effect. However, I can't seem delete it after its execution. sqf _emitters = []; { _li = format ["_li%1", _x]; _li = "#lightpoint" createVehiclelocal (getPosASL _x); _li setLightBrightness 100; // Rest of code _emitters pushBack _li; _ps1 = format ["_ps1%1", _x]; _ps1 = "#particlesource" createVehicleLocal getpos _x; // Rest of code _emitters pushBack _ps1; } forEach [site_1, site_2, site_3, site_4]; _time = diag_tickTime; while{ count _emitters > 0 } do { { if ( diag_tickTime > _time + 4 ) then { deleteVehicle _x; _emitters set[ _forEachIndex, objNull ]; }; } forEach _emitters; _emitters = _emitters - [ objNull ]; };
later @rich bramble midgam
In other words, is it possible to attach a particle effect to an existing object and when the object is deleted the effect also goes away? (If the above doesn't work)
(the first line serves no purpose (_li = string))
and use waitUntil or sleep 🙂
I would store the emitters in a variable on the object itself, then use the Mission Event Handler "EntityKilled" (we don't have "EntityDeleted" afaik)
although you could use a simple Deleted EH
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Deleted @finite bone
I'm trying to execute this in an unscheduled environment so uiSleep and waitUntil wouldn't work. Ill look into the EH, and if nothing else works convert the code to be run in a scheduled environment.
your while will do 10k loops then stop
that's why
why do you need this unscheduled anyway?
I'm not sure why I am getting this error, could someone advise please?
error '...yerLocal.sqf" private _player = [player |#|name, getplayerUID player]; private _nam...' Error Mission ] File {path to file} line 1
This is the sqf file contents
private _name = _player #0;
private _uid = _player #1;
if (_uid !in allowedPlayers) then { // need to check this before we look for UID in "players" else error
endMission 3;
} else {
private _index = players find _uid; // returns index of element that contains UID
private _element = players #_index;
private _medic = _element #1;
private _engineer = _element #2;
private _eod = _element #3;
private _rank = _element #4;
private _role = _element #5;
_this setVariable ["ace_medical_medicClass",_medic,true];
_this setVariable ["ACE_IsEngineer",_engineer,true];
_this setVariable ["ACE_isEOD",_eod,true];
_this setUnitRank _rank;
execVM format ["%1.sqf", _role];
};```
again thanks
Executed in zeus multiplayer via debug console 😅
https://sqfbin.com/jehuwesezaloruzucite you awful person!
player name throws the error, can you get why?
see https://community.bistudio.com/wiki/name for a hint 🙂
is it round the wrong way?
yep
name _obj so name player
stupid mistake, I thing it was late when I contrived this idea lol
don't code when tired 😛
I get my best ideas when I am falling asleep lol
now for some reason starting a multiplayer in Eden editor is still giving me role selection screen even though I set auto role selection in the settings grrr sometimes this annoys me
ah I see, I only have 1 playable side. is it possible to skip role selection in this situation?
Wow thanks! I actually was complicating it even further by adding in unnecessarily long time delays of stupid kinds 😅 . But hey I got to learn something new from you though!
yeh, in unscheduled it's really not meant to be stuck in loops so while and other for loops are maxed @ 10k iterations, after that the loop breaks even if the condition is not met
are you still hiring? 😄
YES 
I'm looking at description.ext but was assuming the line skipLobby = 1; // 0: disabled - 1: enabled. Default: 0 does the same as Attributes -> Multiplayer ¬ Lobby - Auto Assign Slots?
Whats the correct way to use this code?: while { getMarkerPos "enemy1" distance player < 1500} do
depends - moar info please
I want a script to work if a player is x distance from a marker. Like spawn enemies
define "a script" - because everything you put in a while will either run every frame or so, or wait until its whole execution, then check again so it's important
while { getMarkerPos "enemy1" distance player < 1500} do {
_pos = [getMarkerPos "enemy1", 50, 500, 0, 0, 100 , 0] call BIS_fnc_findSafePos;
_eastGrp = createGroup west;
for "_i" from 0 to random 4 do {
_type = ["vn_b_men_sog_06",
"vn_b_men_sog_21"] call BIS_fnc_selectRandom;
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Do i paste on that?
Im pretty sure that whole code works fine except the first line “while…etc”
now i got time
interesting.
anyone able to help me with this last bit for now I think
private _player = [name player, getplayerUID player];
private _name = _player #0;
private _uid = _player #1;
if (_uid !in allowedPlayers) then {};
is giving an error "Type String, expected Bool" not sure how to do the check I am trying.
sorry, missed it off.
execVM "DM_Scripts\playerList.sqf";
sleep 1;
allowedPlayers = [];
{
allowedPlayers pushBack (_x #0);
} forEach players;
It is players not allowedPlayers
Well anyways I've pointed out that !in
yep, thank you what would be a work around please?
!(_uid in allowedPlayers)
thank you 🙂
Good day.
Is there a way to assign units placed in the editor to a specific headless client ? Маybe some command in squad init with HC name.
i fixed the code just had to switch some words : D // while {true && player distance getMarkerPos "enemy1" < 1500;} do
true &&
Huh
@rich bramble which "SQF return"?
You should always prefix your variables.
If any mod or script uses players then either your or their stuff might randomply break
So like DM_players
yep, will do. thanks I am just in testing of ideas with basically vanilla arma
((also you might want to join https://discord.gg/0arQM0FX6xt0iWm3 to keep it away from here so nobody gets confused too much))
Thanks, didn't know there was a server for OOS :)
is there a benefit in converting a cpp file to bin file?
maaaybe the loading time (but that would be more #arma3_config)
Am I right in assuming that detach will also work on objects attached with BIS_fnc_attachToRelative?
ok, so I thought I was done but I was wrong.
problem seems to be the _index is not returning anything at all.
Any suggestions?
// UID, Medical (0 = none, 1 = Combat Medic, 2 = Doctor), Engineer (0 = no, 1 = yes), EOD (0 = no, 1 = yes), Rank ("PRIVATE" · "CORPORAL" · "SERGEANT" · "LIEUTENANT" · "CAPTAIN" · "MAJOR" · "COLONEL"), Role ("Commander", "PlatoonLead", "SquadLead", "Rifleman")
DM_allPlayers = [
[ "76561198001748042", 0, 0, 0, "COLONEL", "rifleman" ], // Dungeon Master
[ "76561198436075493", 0, 0, 0, "COLONEL", "commander" ] // Nez
];
private _allowedPlayers = [];
{
_allowedPlayers pushBack (_x #0);
} forEach DM_allPlayers;
private _player = [name player, getplayerUID player];
private _name = _player #0;
private _uid = _player #1;
if !(_uid in _allowedPlayers) then { // need to check this before we look for UID in "players" else error
endMission "END1";
} else {
private _index = DM_allPlayers find _uid; // returns index of element that contains UID
private _element = DM_allPlayers #_index;
private _medic = _element #1;
private _engineer = _element #2;
private _eod = _element #3;
private _rank = _element #4;
private _role = _element #5;
if (_medic == 1) then {
_this setVariable ["ace_medical_medicClass",1,true];
};
if (_medic == 2) then {
_this setVariable ["ace_medical_medicClass",2,true];
};
if (_engineer == 1) then {
_this setVariable ["ACE_IsEngineer",1,true];
};
if (_EOD == 1) then {
_this setVariable ["ACE_isEOD",1,true];
};
// _this setUnitRank _rank;
execVM format ["DM_Scripts\DM_Loudouts\%1.sqf", _role];
};
This is being run from initPlayerLocal.sqf and works up to the _index point
Thanks for all your help so far guys
correct
you don't check if the index is correct or not, you assume it is 🙂
how do I check it is correct? I have tried running that code then with hint str _index; and it returns nothing
I am really struggling with nested arrays
hasmap 😄
or
private _index = DM_allPlayers apply {_x #0 } find _uid;
afaik apply dont change change the order
correct
if the index is -1, it is invalid
please tell me this is being tested in mp too
thats next step
also for readability is better to use params (https://community.bistudio.com/wiki/params)
private _medic = _element #1;
private _engineer = _element #2;
private _eod = _element #3;
private _rank = _element #4;
private _role = _element #5;
_element params ["", "_medic", "_engineer", "_eod", "_rank", "_role"];
getplayeruid doesnt work as you want it to in sp
I've tried to understand how params work but couldn't figure it out. Right now I just want it to work.
I've been testing using eden multiplayer but now going to package it and put it on my private server
oh right yeah 3den multiplayer will work fine
when I took my UID out of the list and ran it the end mission function worked
Does negative velocity cause objects to decelerate (accelerate backwards) or simply stop?
velocity goes the way you tell it to go, instantly
Velocity is speed with direction. Negative velocity is speed in the opposite direction
So in a scenario where an object is travelling at 200 velocity and I execute setVelocity [0,0,-200]; will it immediately go to the other end or take time (even smaller amounts) to switch from +200 to -200 like a wave
Then 0 is an instant stop
Is it possible to ensure random returns value based on bimodal distribution than a bell curve?
I saw but it was bell curve though
I'm looking for an inverse bell curve
with min and max preferred over mid
use the other syntax
everything you can do is listed on the page, that's it
if you want something between 10 and 20 don't use [10, 15, 20], use 10 + random 10
random [-200, 0, 200] weighs towards 0 as stated - but what if i want it to be within the defined range yet weigh towards the extremes than 0
maybe lerping or subtracting
wait so you mean to say that mid being higher than the extremes will make it weigh towards the extreme its close to?
if you subtract the curve, you have your two poles
Couldn't you just do 1 - RESULT? (Edit. if normalized)
(otherwise, hire a couple of Polish people)
0.5 * (random [-200,-200,0] + random [0,200,200]) ^^
In case where a variable is undefined, it would indeed skip all the commands and prints nothing.
But you can
hint str [_index]
which will print [any] if its a undefined variable
findIf exists, this is just a more complex less efficient findIf
thanks guys, I got it working fully now and tested on dedicated server.
Just fleshing it out now 🙂
The only way _index could be undefined though, would be if DM_allPlayers is (but its not, you define it above) or the _uid is, which I don't see how that can happen, getPlayerUID never returns nil
does setPos### sync across network every time it is run?
i.e if i have server local object and setposasl oneachframe do i need to be concerned about network performance or just let the game do its thang
The effect is global so yeah I guess
but setvelocitytransformation has global effect too and is meant to be used oneachframe 
I would imagine that it's quite optimized on engine side (idk really, just guessing), server sends network updates quite often anyways
DM_allPlayers = [
[ "76561198001748042", 0, 0, 0, "COLONEL", "rifleman" ], // Dungeon Master
[ "00000000000000000", 0, 0, 0, "COLONEL", "commander" ] // Other Player
];
private _allowedPlayers = [];
{
_allowedPlayers pushBack (_x #0);
} forEach DM_allPlayers;
private _player = [name player, getplayerUID player];
private _name = _player #0;
private _uid = _player #1;
if !(_uid in _allowedPlayers) then {
endMission "END1";
} else {
private _index = DM_allPlayers apply {_x #0 } find _uid;
private _element = DM_allPlayers #_index;
private _medic = _element #1;
private _engineer = _element #2;
private _eod = _element #3;
private _rank = _element #4;
private _role = _element #5;
if (_medic == 1) then {
_this setVariable ["ace_medical_medicClass",1,true];
};
if (_medic == 2) then {
_this setVariable ["ace_medical_medicClass",2,true];
};
if (_engineer == 1) then {
_this setVariable ["ACE_IsEngineer",1,true];
};
if (_EOD == 1) then {
_this setVariable ["ACE_isEOD",1,true];
};
player setUnitRank _rank;
execVM format ["DM_Scripts\DM_Loudouts\%1.sqf", _role];
};
Thats the final code I managed to get working if you want to take a look and play with it
private _index = DM_allPlayers apply {_x #0 } find _uid;
->
private _index = DM_allPlayers findIf {_x#0 isEqualTo _uid };
But you probably don't care about performance
i need to keep in mp in consideration or the entire project is pointless
but ive only just thought setPosASL & setVectorDirAndUp oneachframe may not be the vest
however i know some other people who do dirandup oneachframe fine for network
('twas a joke I hoped obvious ^^)
but that takes local args, setposasl does not
ya i know im just stressed about the past 5 months of work being possibly pointless because of network moment lmao
nah, dw too much
at worst, well one feature is going to eat network from time to time
at best, you can local SimpleObject your way 😉
sweats profusely
its my capital ships one 😄
im taking static objects and turning them into things that fly 😄
updated, thanks for the tip 🙂
TIL findif exist 
just need sortIf now 🙃
yea, that will be usefull AF lol
i currently have to apply distance check then sort which i do not like at all
how did you survive 'til then 😄
tbf i only found out about it a few days ago too
guys, follow the path of Enlightenment
keep this tab pinned and open at all cost
https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
There is currently no text in this page
therefore I assume there are none 🤷♂️
😱
fr though, a commonly used commands page would be useful or something similar rather than having to scroll through all the commands and figure out what they do 😅
i have more hours on that screen than the game itself lol
I should add a counter there that would compare with Steam's! 😄
yea.. but seeing that have spend like 3 month of your life on a wiki will be painful to know lol
same could be said about some college educations LOL
I'll keep a fair price for online wiki access guys, you know me
tuition free wiki
regarding
setVelocityTransformation
is interval representing begin and end over certain minimal time or over a frame?
I see it being executed OEF to calculate a transition over time but i cant picture it working wihtout a frame loop
it's the intermediate 0..1 position you want between from and to
all setVelocityTransformation does is set the objects stuff accordingly based on the interval that it currently is
for smoothness, yes it needs a frame loop
is it possible to script a player to either create a group or join a group if the group already exists based on my script above?
I would like to set each players squad using the top section of the code and then have them create or join a group based on the squad.
I would also like to set the leader of the group based on two variables, if there is nobody in the group with the SquadLeader role then the highest ranking member to be leader.
Is this possible?
is it possible to change the speed of the sound being played? (for example play a sound at 2x speed)
playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset, local];
soundPitch: Number - (Optional, default 1)
1.0 → normal
0.5 → Darth Vader
2.0 → Chipmunks
pitch is the speed? that's weird
That's natural. Changing pitch without speed or vice versa is hard.
well its it possible to go past 2x?
try
I am trying to add the objects found by nearObjects command into an array to delete it later. This is my code:
private _objs = [];
{
if (_x == restricted_object) then { continue; };
diag_log _objs;
_objs pushback _x;
} forEach _nearbyObjects;
[_objs] spawn {
sleep 3;
{
deleteVehicle _x;
} forEach _this;
};```
When I execute it, it says ``Error: Type Array, Expected Object``. I checked the logs and this is what I have in ``_objs``:
[21cdd2e5890# 561068: a_tvtower_base.p3d,21cdd2e5000# 561070: a_tvtower_mid.p3d,21cdd2e6120# 561071: lighthouse_03_red_f.p3d,220d1b088e0# 561072: portablehelipadlight_01_f.p3d,21cdd2e69b0# 561073: scf_01_chimney_f.p3d]```
Thanks in advance!
i think this: [_objs] spawn { should be without the [] _objs spawn {
otherwise, it's an array of array [ [el1, el2] ]
guys
can someone explain
why some commands take parameters before command
and some after
like
player setDamage 0
and name player
is it really inconsistent or is there a meaning to that
0.5..2?
if say I put 5 or 20 or anything past 2, it will cap to 2 regardless
explain
why you
are
talking like
that?
😄
it's inconsistent, that's it
Some people type like they would a conversation, short bursts followed by a pause or new line.
habit
guessing for some it might also make more sense at a glance because to someone with little idea of code languages etc setdamage [player,1]; would look a bit wack
Christ it's how many people used to use msn
<what you are doing it to> setDamage <damage you want to set>
<object you want to scale> setObjectScale <scale of object you want>
for those who knows programming language
it is confusing
insert read the wiki link here
it's a 20yo+ API that has been expanded over time without clear guidelines, so yeah
nah big bohemia trying to destroy my brain with hashmaps
BI turned my dog into a hashmap :/
well now you are BI-curious
my first thought is how that would be defined lol
_hm = [[doggyVar, ["woof"]]];
_hm = [[:dog: , ["woof"]]];
but
why is second item is a list?
just because, it can be anything. I use HM a lot to contain isolated arrays
easier to get larger datasets
really gonna socially isolate the array like that? arrays need social interaction and a lot of sleep
lmao
btw, is it possible to make a http request in scripting
they use to do that to BI-curious ppl too, now they just publicly declare themselves
it would be cool to make a permission system for multiplayer
just like in minecraft
something like ```
if([player, "some.some"] hasPermission)
yes, the database system can be managed in multiple ways. Its not uncommon to do so in larger persistent gamemodes like exile
yes and now
you can create a GET request by loading HTML in UI (https://community.bistudio.com/wiki/htmlLoad, URL max 255 chars)
for anything else you will need a custom DLL extension
TIL stopSound is a 2.14 feature after trying to troubleshoot it for an hour or so 😃
idk how its taken up to now to get stopsound
can't you just delete the sound object?
playsound3d returns id not object
and cant iterate through allmissionobjects for performance
can't you delete soundSource?
maybe move soundSource away when done with it?
you don't need "a http request" for that
you can use remoteExec with callback
oh as in just create a different object for the sound source?
yeah invsibile helipad
im stacking sounds so not optimal with how slow createvehicle is
average invisible helipad enjoyer
can't it be a simpleobject?
redgull can > invisible helipad
pretty sure playSound3D doesn't actually care about the source. it creates its own source so if I'm correct even deleting that object won't help
can you use simple objects as sound sources? 
oh damn wiki is kinda vauge
either way its just a matter of waiting for 2.14
dont want to shit about with sounds when its not needed
"I don't need it, I don't need it, I DEFINITELY NEED IT"
is there any commands that replicate createvehicle and arent as laggy as it? im imagining createunit is a bit better (not making a simple object/agent)
. . . what are you doing?
just curious is create unit less laggy than createvehicle?
i need it if i want it to be permenant and dynamic
so i can just type something like
.addpermission <player_name> <permission> inside game
I don't know what you mean by "permenant and dynamic"
it needs to be same after restart
still can use remoteExec
can someone help me with this?
I have a trigger area, i just want to deletevehicle of any kind that enters that area. Not the people in it tho
naw
what would the filepath to the .rpt file for a local ran mission be located? im digging through local appdata arma 3 and cant see anything of use
do i need a dedicated server to get logs of code executed in missions? at the fun stage of debugging where nothng happening hints show things work and but no result
triggers might not be the most suitable thing for that. because they only trigger once as soon as the first object enters it. so let's say an object and a unit enter. you delete the object, but the unit is still in, so trigger remains active. now if a second object enters it won't get deleted because the trigger was already activated
ah good to know. what else can i try?
you can use a trigger as the "area" but you need another loop to check it
_list = getpos trigger nearEntities 20;
{
if !(_x isplayer) then {deletevehicle _x};
}foreach _list;
``` should theoretically work trigger is the init name of your trigger and the 20 at the first line is the range in metres that units are deleted in
i saw it
did you?!
once i pressed enter and looked back
then why is it still bugged?! 😛
i see it v2 eletric boogaloo
i just read this on https://community.bistudio.com/wiki/drawEllipse
Draws an ellipse on the map. Just like with marker or trigger area, negative a and b will result in hexagon.
this is new?
that specific text on the wiki seems to be added in 2016 https://community.bistudio.com/wiki?title=drawEllipse&diff=94186&oldid=90608 
well... i needed that infomation a few... years ago.
i did all that using drawTriangles 
i dont know if there is some performance gain using drawEllipse, but yea... i spend more hours than necesary lol
Well, one ellipse[agon] shape is probably slightly more performant than however many separate triangles it takes to make a hex. Not necessarily through anything inherently different about the command, just from using less of them
Hello! Im trying to use this event handler
this addEventHandler ["SlotItemChanged", {
params ["_unit", "_name", "_slot", "_assigned"];
}];
but im getting the error "Unknown enum value", I have no clue why as im using it the same as the wiki
Have a look at the version number just to the left of the SlotItemChanged section title on the wiki
Then have a look at the version number displayed in the bottom right corner of the Editor UI/pause menu/main menu
Hello,
Is there an easy way to get all roads from the area of the module?
I know nearRoads , but if my module is rectangle.
nearRoads , and then inAreaArray to filter the results down to the ones in the rectangle?
Yeh. This sounds simple.
Thanks 🙏
JBOY Bean Bag Shotgun - Heres a fun script for yall! Combine this with @beno_83aus breaching script and @phronks flash bang script, and weve got Swat 4-like less lethal action covered in ARMA 3! Yeehaw! Links: Download demo mission to try in Editor and get the scripts Playable Steam demo mission ...
im trying to get this to work in my mission, but for some reason it wont work
Guys, i just saw a system in a server which msde vehicles "activatable". Unless you activate them, they are nothing more than static objects but once you activate they become interactable. Any idea how that works?
Before activation, vehicle wasnt shown in map as well. So i know it is not just restricting actions you can do
either it was using simple objects which would get replaced with actual vehicles, or just disabled simulation
tho not sure if disabling sim would also hide the action
There's a table in the comments at the bottom here:
https://community.bistudio.com/wiki/fireAtTarget
Making a unit fire in an arbitrary direction is a pain and I'm not sure if any of the commands work directly with a building.
is there a way to export a functions code?
the Functions Viewer in the debug console
is there a 100% way to determine which hitpoint got hit by the bullet?
because handledamage for example triggers all parts which got effected by the damage
I don't think so. Only slow and shitty heuristics.

Can hashmaps be created in profileNamespace?
Specifically, a variable populated by a hashmap that can be accessed from the client in different scripts.
You can store hashmaps in profileNamespace. Not sure what you're talking about with the second bit.
point of profileNamespace is that it's persistent outside the current mission.
I may be misunderstanding something. I have scripts that create hashmaps as global variable so that all clients have access to the same data. I want to do something similar but have them unique to each client. They don't need to be persistent, but I want multiple client side scripts to have access to the specific client's data.
No variables are network-published by default. That only happens when you use publicVariable or setVariable [x, y, true].
If you want a variable to remain client-specific, just don't publish it.
Global variable as a term might confuse you here, as it's really global "just" on the client on which it was defined (i.e. it can be accessed from anywhere in the given client's code)
Got it. I was under the impression that any variable that lacked the underscore in from would be public.
So,
clientVar createHashMapFromArray [ ["A", 1], ["B", 2], ["C", 3]];
will hang around and be available to any scripts run on the client side.
And
publicVariable "clientVar";
will broadcast it.
Is that correct?
That's exactly right. I was taking 'globally' too literally.
Yeah, you can also have more granular control of publicVariables too if necessary
Cool. thanks.
Example
missionProfileNamespace setVariable ["My_HashMapVar",createHashMap];
My_HashMapGlobalVar = missionProfileNamespace getVariable "My_HashMapVar";
Is there an estimated release for 2.14?
No, but you can play 2.13 already
Cool. I was playing with that but didn't have createhashmap as the 2nd arg in the variable. That makes sense. Thanks.
Most likely late August, if everything goes fine
Thanks
what about addon functions?
Same thing
no changed weapon eventhandler? i.e changing from primary to secondary?
There isn't even a lifeStateChanged :P
rip
at that point would key down be borderline more efficient?
If you only care about players it's fine regardless
This stuff only gets expensive if you're dealing with 200 AIs on one machine.
fair ..
thanks
People can prefer Action Menu instead, so it won't make a 100% case
animation version should work regardless. Probably.
But then for just players you could eachFrame it.
that's a good point ..
I'll investigate, i might just take the easy way out anyway
Worst case for the animation version is that the final animation change happens before currentWeapon does, but that seems unlikely.
How would one spawn a waypoint 15m infront of the player?
Not sure how i would get the waypoint to be infront
(getPosATL player) getPos [15, getDir player];
Just for the position. I'll leave the waypoint part to you.
Ballin, tysm
Lou, wanna see something even awful? https://sqfbin.com/movupedumehalivikaba 
This is also "nice" https://sqfbin.com/ilekasocofukifiqariq
woah
I wake up and chose rage
I didn't even zoom in
so they are disabling simulation, adding an action to everybody and when someone calls it, server activates sim?
It Just Works™️ 
I am trying to addAction to an object for all players to enter / exit a tunnel. Is this code correct and would this work even when the player respawns / reconnect without any duplicates?
{
mine_entrance_door addAction[
"Enter the Tunnel",
{
params ["_target", "_caller", "_id", "_args"];
1 cutText ["","BLACK OUT",1];
_mine_exit_spawnpos = [((getPosASL mine_exit select 0) + random (3)), ((getPosASL mine_exit select 1) + random (3)), (getPosASL mine_exit select 2)];
sleep 2;
_caller setPosASL _mine_exit_spawnpos;
_caller setDir 333;
1 cutText ["","BLACK IN",1];
enableEnvironment false;
sleep 0.4;
},
nil,
1.5,
true,
true,
"",
"true",
5,
false,
"",
""
];
} remoteExec ["call", [0, -2] select isDedicated, true];```
Yes.
Guys, i am learning about locality. If i am not wrong, this means it take an object that is global (everybody can see it) and has an effect of global. And must run in server side
am i correct?
it means global locality -- vehicles that players are driving are local to the players for example, so local args wont work if the server is running the code on a vehicle not driven by server-controlled ai
Is there a way to get what is output in chat, without BE?
So the effect and server effect are simple to understand. But the global/local argument is not so obvious. For example, a unit is local to the client controlling it. player units are local to the player's client. AI are local to the server OR the headless client controlling (if you have one). A vehicle is local to the server if it isnt being driven. It is local to the player driving it if its being driven (i dont know what the case is when players are in the passenger but not driver seat, I assume local to server). And I think there are a few other wierd scenarios.
Another one that comes to mind is that a player unit is not local until control of the unit is given to a client. Meaning on mission start and DURING JIP, init functions that take local arguments and that are being passed a player's unit on mission start or JIP might run into this.
Point being, test your shit or read a bunch of shit. Either Or, but probably both. I also recommend learning how to open two instances of arma and testing stuff in multiplayer between the two clients. (Idk how with vanilla launcher, I use Swifty).
Hello 👋
There's something wrong and i don't know what, can i ask for a little help?
I have a trigger set to be activated if a civilian enters it and in the "on activation" field i have this script:
["Silentalarm"] remoteExec ["playSound", west];
It sot of works. The problem is, that the sound is played twice at the same time and since they don't start playing exactly at the same second, they overlap and sound terrible. Why is it playing twice and not just once? Thank you
You are hosting by your self?
no, i pay for server hosting, i believe it's a dedicated server or something like that
is there a way to create a runway AI can land on in Eden?
I know that Dynamic Airport exists but don't know if it's possible to implement in Eden
https://community.bistudio.com/wiki/Arma_3:_Dynamic_Airport_Configuration
thanks, is there a quick way to place that down in eden?
it doesn't show up in the search bar
create3DENEntity
thank you bery much
any idea?
is west even a valid target?
sure is
is trigger set to "Server only"?
Is the trigger activating once on client and once on server? I dont think that is how triggers work, but.... ^
I havent looked at triggers in a while
triggers are activated once in each machine, they do not sync
editor-placed triggers have independent instance on every client and on the server
^
no it's not
there ya go
thank you for the tip, i'll check it out
setting a trigger to server only warranties that executions and checks are done only in the server. Is it intended to be only used once too? If so remove the repeatable checkbox too.
Thanks Artemoz more.
IIRC, the checkbox is to make the trigger re-activatable, typically the trigger only activates once.
no it should be used repeatedly, but on single activation i don't want that sound to be played twice
@limber panther Make sure you check that closely to make sure you get the behavior you want
is there any way to make the glide slope steeper? the plane hits a hill before the runway
so as mentioned above, make it server only and make sure your condition can only be fulfilled only when you want it to.
Make a Mod
ah well, thanks anyway
i'm going to check it out right now but i belive the suggested check box "server only" should do the desired trick
Problem fixed, thank you guys
"output"?
anyone know how to lock the gamma setting? i need a way to detect if it has been moved
Gamma is one of the things you can check with getVideoOptions. There's no way to change it through script commands.
It's fine imma just kick the player if they turn it up
private _videoOptions = getVideoOptions;
/*
[
["aspectRatioName", "Auto (Stretch)"],
["brightness", 1],
["cloudQualityName", "VeryLow"],
["displayModeName", "Window"],
["dynLightsCount", 4],
["dynLightsQualityName", "VeryLow"],
["gamma", 1],
["guiScale", 0.55],
["guiScaleName", "Small"],
["hdrQuality", 16],
["hdrQualityName", "Normal"],
["monitorResolution", [0, 0, 2304, 1440]], // presence not guaranteed
["objQualityName", "VeryLow"],
["objectVisibility", 800],
["overallPresetName", "VeryLow"],
["overallVisibility", 1000],
["particleQualityName", "Low"],
["pipQuality", 512],
["pipQualityName", "VeryLow"],
["pipVisibility", 835],
["ppBloom", 0],
["ppBrightness", 1],
["ppCausticsQualityName", "Disabled"],
["ppColorPresetName", "Default"],
["ppContrast", 1],
["ppDOF", 0],
["ppFSAA", 1]
["ppPPAAQualityName", "Disabled"],
["ppRadialBlur", 0],
["ppRotationBlur", 0],
["ppSSAOQualityName", "Disabled"],
["ppSaturation", 1],
["ppSharpenFilter", 0],
["refreshRate", 60],
["samplingPercentage", 100],
["shadowQualityName", "Low"],
["shadowVisibility", 100],
["terrainQuality", 25],
["terrainQualityName", "Low"],
["texQualityName", "VeryLow"],
["vramInfo", ["5.8 GiB", "7.9 GiB", "0 B", "231 MiB", "5.5 GiB"]], // presence not guaranteed
["vsync", false],
["waterReflectionQualityName", "Disabled"]
];
*/
_gamma = _videoOptions select 7;
if (_gamma > 1) then
{
hint "gamma is to high lower it now!";
};
is this a good way to write it?
gamma is # 6
_videoOptions = getVideoOptions;
_gamma = _videoOptions select #6;
if (_gamma > 1) then
{
hint "gamma is to high lower it now!";
};
now im getting an invalid number in expresion
It is a HashMap not an Array
Return Value: HashMap
so
_videoOptions get "gamma"
_videoOptions = getVideoOptions;
_gamma = _videoOptions get "gamma";
if (_gamma > 1) then
{
hint "gamma is to high lower it now!";
};
i dont think its working as i am not getting a hint. any ideas?
Because 1 > 1 is false
i changed my gamma setting
to 1.5
im a dumbass
i turned my brightness up lmao
it works lol
Instant kick 🔨
I would recommend picking a threshold value higher than just the default. Aside from its use as a nighttime cheating option, gamma is a real accessibility option, and people may have it set a reasonable amount higher than default, to account for differences in screen brightness/quality, room lighting, and their own eyesight.
yeah ill make it 1.2 or 1.1
[] spawn {
while {true} do {
_videoOptions = getVideoOptions;
_gamma = _videoOptions get "gamma";
if (_gamma > 1.2) then
{
titleCut ["", "BLACK FADED", 999];hint "gamma is to high lower it now!"; sleep 5; titlecut [" ","BLACK IN",5];
};
sleep 1
};
};
People will just use NVIDIA filters or the equivalent from AMD (or even ReShade).
At least we will slow em down ok
[] spawn {
while {true} do {
_videoOptions = getVideoOptions;
_gamma = _videoOptions get "gamma";
if (_gamma > 1.2) then
{
titleCut ["", "BLACK FADED", 999];playSoundUI ["Alarm", 10000, 1.9];playSoundUI ["Alarm", 10000, 1.9];playSoundUI ["Alarm", 10000, 1.9];playSoundUI ["Alarm", 10000, 1.9];titleText ["<t color='#ff0000' size='5'>GAMMA IS ABOVE 1.2, LOWER IT TO PLAY!</t><br/>", "PLAIN", -1, true, true]; sleep 5; titlecut [" ","BLACK IN",5];
};
sleep 1
};
};
Good thing volume gets capped at 5
if you play serveral sounds it will earattack you
it will just play it once louder. try it
[] spawn {
while {true} do {
_videoOptions = getVideoOptions;
_gamma = _videoOptions get "gamma";
if (_gamma > 1.25) then
{
titleCut ["", "BLACK FADED", 999];playSound "AlarmCar";titleText ["<t color='#ff0000' size='5'>GAMMA IS ABOVE 1.2, LOWER IT TO PLAY!</t><br/>", "PLAIN", -1, true, true]; sleep 5; titlecut [" ","BLACK IN",5];
};
sleep 1
};
};
here is the new version
You're evil
use the systemChat command
Hello gentlemen
how would i go about writing a custom module?
because the official documentation for it is shit at best
Have you been through this? https://community.bistudio.com/wiki/Modules
Are you familiar with creating a config for an addon?
no
this would be my first addon
@opal zephyr im guessing i should learn how to make an addon first?
Eh theres always gotta be somewhere to start, this one isnt the worst
roger
The "Creating a Module" part of that wiki, very near the top, actually directs you on which files to create and what to put in them (config.cpp). I suggest following that
I've got the config.cpp in the root directory
In the root directory of what? The game?
nono
the module folder
so myTag_testModule/config.cpp
should that folder be inside of an addon or is it ok on its own?
Ok, it tells you to then make the cfgPatches, and cfgFactionClasses
got them already
its good on its own, that folder will turn into the pbo
ok... what part are you struggling with then?
oh nothing
i just thought the file structure looked a bit odd
thanks for your help!
No problem :)
_
Does anyone know why this waitUntil might be stuck looping?
_unit setObjectTextureGlobal [_forEachIndex, format ['#(rgb,%1,%2,1)ui("RscDisplayEmpty","%3")', _texSize#0, _texSize#1, _uniqueUIName]];
waitUntil {
systemChat "loop";
!isNull (findDisplay _uniqueUIName);
};
I was having an issue where the display wasnt creating instantly, so the loop is there to fix it. Wait until works for the first 2ish (succesfully moves through it) but then just get stuck loop after that. No idea why, any help is appreciated
If a player if typing something in chat, I want to be able to retrieve that text through code
Maybe its because the waitUntil pauses the execution of that script, including the creation of the display in the background...?
Systemchat types to the chat
I've got a scripting Question. I have a trigger that should activate when any independent forces are in its area, except the drone u_scoutdrone (unit variable name). This code doesn't exclude the drone, any idea why?
this && (u_scoutdrone != thisTrigger)
Basically I want to log what is being typed, without using BE
Try this && !(u_scoutdrone in thisList) 🙂
that was quick, thanks.
I'm worried that the trigger won't work with the other units while the drone is inside. I'm going to mitigate that by limiting the trigger height agressively
how would I test an object to see if it has an inventory?
Hmmm in that case ({ _x != u_scoutdrone } count thisList) > 0 might be what you're looking for (counts how many objects that are not u_scoutdrone are in the trigger area).
Hey guys!
Is there a way to "Save" info from a mission that is part of a campaign? I think I have some ideas for how to do it, but thought it might make sense to consult y'all.
I want to build a campaign for my players where one mission, they have to go behind enemy lines and takeout logi depots/enemy artillery positions. I want to somehow save that info, so in the next mission in the campaign, the next op starts with those arty positions/logi depots destroyed
One option I was thinking was creating arrays with the destroyed positons' info and saving it to my profilename space/dediserver's or something, but not sure if there's an easier way.
2 ways. if you want completely premade missions, you will have to somehow save and export information about objects. If you want to do the same mission in the same mission file, you can save stuff to mission namespace, but you need to be careful about what you use to end a mission as one function will erase the save data.
2 suggestions:
look into the persist mod and/or how it works
Rebuild the remains of previous missions during zeus setup or in eden.
I recommend rebuilding stuff as its the simplest solution.
How do I trigger a zeus notification?
Like the Global Hint?
I just recently worked on something similar to this. If you really want to code a solution, I recommend using getAllHitPointsDamage and setHitIndex. Assign everything that needs to be tracked a variable name, and then run getAllHitPointsDamage on them to grab the damageValuesArray, and then run those arrays on the same objects at the next mission start with setHitIndex.
To give them unique variablenames, you can use missionProfileNamespace setVariable [vehicleVarName object + "damage", _theDamageArray].
And then run similar code to get the unique variable at mission start.
Ohhh, good calls. I wasn't aware of missionProfileNamespace. If I'm going to have two separate mission files, will I be able to pull info from one mission to the other?
That's why I was thinking just profileNameSpace, since I'll be the Zeus both times, I can just save that info to my profile and pull next time.
You need to set a description.ext parameter so that they use the same missionProfileNamespace.
missionGroup
ohhh thank you. I'm looking now into https://community.bistudio.com/wiki/saveMissionProfileNamespace
which is going exactly into that. Thanks to you both!
So, just to check I'm understanding correctly, each separate mission folder will have, in its description.ext, an entry to say which mission group they are in?
It probably won't unless you add it.
missionGroup defaults to some form of the mission name if you don't specify it.
Soo.. I may be in the middle of writing a persistence mod...
Trying to decide if I get allVehicles and save them, or just ones with players in
make sure if you're doing this, you save the stuff in the right namespace, ie Server Profile or players profile
If you have the script launch through initServer, for the mission, at least, it will only save the items to the server.
Also, keep in mind, if your server is linux based, that missionProfileNamespace won't be quite as reliable for saving/loading.
initially yes. and beware that listen servers (Localhosted) behave completely differently to MP servers with it
Does anyone know what the size limit is for profilenamespace? I'm assuming it'll be os dependent
i asked that the other day, think it was commy who said there's no command for it, but the chat text is a rscText so it should be possible to access it if you find the display # and then ctrlText - i've not had time to test yet
can I assume that "sethitindex" is a non-0 starting index?
if you figure it out, post back pls
Talking about ressource id's. Is there any logic to them? Does BI have an internal tool to make sure they don't accidentially use an id twice in the same context?
As in the arguments? Or the damageArray?
getAllHitPointsDamage results in a non Zero index
hmm
The text up top at the center
How do I trigger/call that hint?
I've got a suspicion it's https://community.bistudio.com/wiki/BIS_fnc_showCuratorFeedbackMessage
You could try logging the preceding values and see which one of them is faulty/nil
try (count (_pDMG select 0)) - 1
Count will start at 1 if it exists, where select will start at 0. (One index vs Zero index)
Say you have
_array = [0,1,2,3,4];
_count = count _array; // 5
_lastCountIndex = _array select 5; // will return nil because there are only 5 values in the array (0 is the first element, where 4 would be the last)
Basically the last loop you have will return nil for both _a and _b due to the bad array index.
OI! Thank you!
Confusing question. Ive tested the results and this doesnt break anything. So to be clear, everything works fine for me.
I copied a loadout from a default unit in arma. Idk if this is legacy arma code that works or what, but I noticed the gun name is arifle_MX_Hamr_pointer_F.
The MX rifle is normally named arifle_MX_F.
When importing arifle_MX_Hamr_pointer_F with no attachments in the appropriate slots in the loadout array, it imports as if it is arifle_MX_F.
What is going on here and why?
It's the same base weapon, just with attachments. Not sure if the attachments listed in the loadout override that or it just doesn't run the attachment code. Either way it'd be pretty weird if it did come out with attachments.
Yeah, some tool is called: Excel or .txt file with note, wich range is beeing used by whom :P
The weapons with pre-linked attachments get automatically converted into the base version + attachments when actually added to a unit
i doubt that @jade abyss
most likely they just hope nothing collided and add ~100 to their last submission
just like i usualy just take something around 30k
and hope nothing collides with it
AND, mostly it doesnt realy matters, wich one is in there.
Since CreateDialog will create that thing, with those IDs, even when another one exists, it won't be loaded.
For example: We got 2 Dialogs, with the same IDs/IDC etc blabla, just with different names. soo... pff, who cares.
P.S.: Klaatu Verata Nektu
Does anyone know a way to disable RMB zoom (eagle eye) functionality in a nice way?
FLG_wReady or FLG_eReady or FLG_iReady anything wrong with this condition?
is this Reforger scripting?
Is there any way of stopping a uav from appearing in the uav terminal list? 
delete its crew?
but i need the player to still be able to remote control it via script 🙃
create said crew on script
and in some instances the uav has no crew (createvehicle but no createvehiclecrew) and still appears and functions normally 😮
¯_(ツ)_/¯
of course, the simple solution is for me to not use drones as cameras 🙃
oh wait i can just createvehiclelocal
This is arma 3
I assume
https://community.bistudio.com/wiki/createVehicleCrew
doesn't have args/effects listed because of local vehicles? 🤔
it was simply not filled; never assume arg/eff
what are the w/e/i prefixes?
ah, assumed arg/eff was an automatic thing when creating a page
i am however unable to test it i think 
Will detach make the object retain the position it was prior to detaching?
try and find out 🙃
time to find out what happens if you createvehiclecrew into a local vehicle
i hope something explodes
rip CPU
the things i do to avoid using scripted cameras
it creates the unit but the vehicle does not appear globally 
i guess it'll have to do for my applications but it's quite peculiar
is there any way one could make similar effects to that in apex campaign where the map has two lines that enhance or is that something made out of game with a pprogram like adobe video maker pro or paid effects?
or any idea of the name of the effect
wat
sounds similar to the og star wars battlefront loading, though ive never played apex campaign
better vid: https://www.youtube.com/watch?v=wjVGjDoX3JQ
lyrics :
boop boop boop boop boop
beep beep beep beep beep beep
blap
(lines just zooming in)
2 lines go on a map and have a small square then they zoom into the square guessing it is an external effect not a command and just play video any idea where I might find something like it
Will get a thing of the effect in 5 or so Min guessing this is better for some cinematic channe
Yeah like that
it's a variable for each faction, it's for a trigger that should fire when one of the variable is true, the others are undefined
undefined is not bool then
private _a = true;
// private _b = true;
// private _c = true;
if (_a || _b || _c) // error
``````sqf
private _a = true;
// private _b = true;
// private _c = true;
if (_a || (not isNil "_b" && { _b }) || (not isNil "_c" && { _c })) // OK
yyyes buuut
do you want each client to have a version of these variables?
now you say it, only the server needs to know them
but every client having their own version won't be a problem
initServer.sqf then
I'm not sure if I haven't figured it out yet, but why do the getXCargo commands return [[item],[amount]] vs [[item, amount],[],[],etc.]? Is there a method that makes the translation to addXCargo simple or is it just purely for efficiency?
are you trying to duplicate a cargo container or something? not quite sure what the use case is here
I mean, the addCargo commands take an argument of [[item, count]], butthe getCargo commands return [[item],[count]]. I was wondering if we were meant to figure out the translation for bulk items or if there's something I'm missing.
its just... the same thign
why
less arrays to create, faster result
Thank you
private _box1 = boxymcboxface;
private _box2 = otherbox;
private _items = getItemCargo _box1;
{
_box2 addItemCargo [_x, _items#_forEachIndex];
} forEach _items#0;```
I thought that might be the case.
Augh now that I think about it, it's much easier to check if an object is in something if you only have to check one array vs thirty-four arrays
still no arrayTranspose for arbitrary arrays 
Is there any way to create an infared Light to show in nvd/tvds?
just a local light source is how it tends to be done that's disabled when no nv/ti on
Any other methods?
Lights don't show in TI whatever you do. For NV only, use setLightIR
Nectar... Necktie...
lets pivot on excel at this point haha
if you have multiple nested arrays and want to have a single one you can always use flatten, although I really find it to be use-case on dynamically created arrays
Hello!
Recently i've been thinking about triggers and i got an idea for a new feature on my server but first i need to do a little trick with triggers and i would like to ask, if it's possible. First, when trigger gets activated, the command , let's have a hint as an example gets executed on every client. Therefore, although hint has local effect, everyone is going to see it. So, is it possible to actually give the hint to only the player who triggered the trigger? Secondly, would it be possible to have triggers working individually for each player? For example player (1) enters the trigger and gets a hint but player (1) is still in there and now a player (2) comes in too. Can he get that hint as well since the player (1) never left the area and therefore trigger remained activated?
["hi!"] remoteExec ["hint", thisList select 0]; I guess this should work for the first part (didnt test tho)
^ in the On Activation
The second part looks kind of like it would be solved by keeping the triggers local and not server-side.
trigger triggerAttachVehicle [player]; in initPlayerLocal.sqf would change the trigger on player's machine to only react to them 
For triggers based on players being in them, using player in the condition will ensure they activate on the machine of the client that enters them, since player refers specifically to the local player. e.g.
(vehicle player) in thisList```
means the trigger will only activate on the client of players who enter the trigger
How can I retrieve this vehicle icon thingy that is visible in the editor?
this icon?
should give the path to imagegetText (configOf _vehicle >> "picture")
Isn't it editorPreview
thanks guys, ill check em out ❤️
necbrcoughcoughcough
thank you
Eat cornflakes!
Anyone have experience with ExtDB? Can it handle two tables? (I'm pretty familiar with SQL just in designing what I'm working on, realizing it needs a database and a CSV isn't going to cut it)
I'm probably in the wrong place, I'll ask tools
can one replicate the laser's used under night vision via code? not in an ai or anything, checked draw3d and can't see anything that would let me make it for nvg's
If you really mean Tables and not separate Databases, then yea it can.
Yeah the documentation is whack for it! That's great to see.
Thank you!
drawLaser
there's also vis lasers as of 2.12 iirc
I'm localizing my mission to be in multiple languages. Creating diary entries in init.sqf with:
0 = player createDiaryRecord ["Diary", [localize "$STR_D_Execution_title", localize "$STR_D_Execution"]];
and Stringtable.xml:
<English>Execution</marker>.</English>
<German>Ausführung</German>
</Key>
<Key ID="STR_D_Execution">
<English>Your mission today is to advance to <marker name='mCÄSAR'>phase line Cäsar</marker>.</English>
<German>Ihre Mission heute: Rücken Sie zu <marker name='mCÄSAR'>Phasenlinie Cäsar</marker> vor.</German>
</Key>
In the diary entry, it only shows phase line Cäsar how do I get the html tags to work?
what do I do with that?
I'm going off this resource: https://forums.bohemia.net/forums/topic/172833-cannot-use-html-in-localize-in-creatediaryrecord-briefing/?do=findComment&comment=2701533
Hi all, I want to create a briefing in my init.sqf. I want to use the localization feature (stringtable.xml) and would like to use HTML in the breifing text. So basically I need something like this: player createDiaryRecord[Diary, [localize smotrans_briefing1Title, toString [parseText localize sm...
You look at the part where it explains how to use (substitute) HTML tags in the stringtable. It has a nice orange box to catch your eye.
got it, thanks
I have a headless client named Egbert.
Can someone please help me with the code that I can add to the init of the units placed in the editor to transfer them to HC.
Someone mentioned setGroupOwner, but I know very little about scripts and do not know how to apply it correctly.
Thank you !
In the init of one unit in the group:
if (isServer) then {
(group this) setGroupOwner (owner Egbert);
};
Might not work for various undocumented timing reasons.
You would certainly need the headless client to be connected before the mission starts.
Maybe a spawned wait until Egbert is non-local.
Thank you very much, will try it !
so im writing a script for a mission I plan to run with my group.
I am going to try to make spawning of the ai as un-noticeable as possible by only spawning friendlies every few seconds on the vietnam spider holes and immediately having them start running.
I am currently having a small issue where some of the ai spawned will not move as if they are stuck, and if I move them in zues and let them continue on their current waypoint some just keep running in place and others will run forward like 10 feet and then run in place again, stop and repeat. Any idea whats up with that?
TRA_SIEGE_FINISHED = false;
TRA_MAX_AI_OPFOR = 80;
TRA_AI_OPFOR = 0;
TRA_OPFOR_INFANTRY = [
"vn_o_men_vc_local_28"
];
while {!TRA_SIEGE_FINISHED} do {
private _basePos = getPosATL hill_881;
private _playerList = allPlayers apply {[_basePos distanceSqr _x, _x]};
_playerList sort true;
private _closestPlayer = (_playerList select 0) param [1, objNull];
private _spawnPoints = (getPosATL _closestPlayer) nearObjects ["Land_vn_o_trapdoor_01", 100];
{
private _grp = createGroup east;
// Current result is saved in variable _x
[_x, _grp, _basePos] spawn {
params ["_posObj", "_grp", "_basePos"];
private _pos = getPosATL _posObj;
if (TRA_AI_OPFOR >= TRA_MAX_AI_OPFOR) exitWith {};
_grp createUnit [selectRandom TRA_OPFOR_INFANTRY, [_pos select 0, _pos select 1, (_pos select 2) + 1], [], 0, "NONE"];
TRA_AI_OPFOR = TRA_AI_OPFOR + 1;
if (TRA_AI_OPFOR >= TRA_MAX_AI_OPFOR) exitWith {};
sleep 1;
_grp createUnit [selectRandom TRA_OPFOR_INFANTRY, [_pos select 0, _pos select 1, (_pos select 2) + 1], [], 0, "NONE"];
TRA_AI_OPFOR = TRA_AI_OPFOR + 1;
[leader _grp, _basePos] spawn lambs_wp_fnc_taskAssault;
};
sleep 2;
} forEach _spawnPoints;
sleep 5;
};
I was also looking for suggestions on way to improve my code
Is there any method of increasing a vehicle's max speed via script? Trying to make a "turbo" but don't really want to setvelocitymodelspace a bunch 
Yes, I think there needs to be a slight delay, maybe 30 seconds before transferring to HC. What will the code look like with a little delay?
It works if I add this code to the unit spawner I'm using, but not with editor placed units
Thank you !
Can try:
if (isServer) then {
this spawn {
waitUntil { sleep 1; !local Egbert };
(group _this) setGroupOwner (owner Egbert);
};
};
actually I'm not even sure if it switches the ownership of the HC logic object, but hopefully it does...
Working on a mod that currently uses ACE's ace_firedPlayer event handler, but I want to either rework it so that it works with and without ACE, or have a vanilla version as well.
if isClass (configFile >> "CfgPatches" >> "ace_common") then
{
// ACE version
["ace_firedPlayer",
{
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
if !(_magazine isKindOf ["HandGrenade", configFile >> "CfgMagazines"]) exitWith {};
// End early if not a grenade
private _nearbyUnits = nearestObjects [player, ["Man"], 30];
[player, "[vl-ThrowGrenade]Grenade Out!"] remoteExecCall ["CWR_fnc_SendLocalMessage", (_nearbyUnits)];
}] call CBA_fnc_addEventHandler;
};
I call this script in a Extended_PostInit_EventHandlers, since I only need it to run once to create the EH.
I did also try using CBA's Extended_FiredBIS_Eventhandlers with an initClient and an init, but that didn't seem to do anything
There's a vanilla Fired EH. It just doesn't catch some ACE actions, like advanced ACE throwing.
It's working. Thank you !
Yeah realized I must've accidentally deleted that part in my message, since I couldn't seem to get it working at first; however, it seems to be working now though, not entirely sure what I changed
How do you get that info to appear on the map? is it a mod?
It is from Zulu Headless Client (ZHC) mod.
Thanks!
Isn't ZHC supposed to do that on its own
Yes, it can transfer automatically, but in some cases I need one side to be on a certain HC. Like BLUFOR on HC1, OPFOR on HC2.
And when the squad is transferred, such commands like allowCrewInImmobile and allowFleeing need to be reapplied to it.
I noticed that the AI soemthimes just leave their turrets and engage players with their primary firearm even though the turret is in perfect health and condition (with ammo). Is there a reason why this happens and how to force lock them in the turrets.
From what I've found not really...not without trying to edit the vehicles config.
Best ive been able to do on my end is a Mario kart style speed boost using setVelocity function. If you find out lmk
In some piece of code within a function, is there a way to get the name of the function?
I think using _this magic variable returns the scope? After that idk.
I'm curious if that's possible
https://community.bistudio.com/wiki/scopeName if the scope was named in the code somewhere
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Meta_Variables _fnc_scriptName if CfgFunctions was used 
Is setPiPEffect LE or GE? - can't find the info in biki
PiP only exists L
