#arma3_scripting
1 messages Β· Page 226 of 1
how can I disable interaction with item on ground? e.g. prevent player to pick up item
Disable simulation on weapon holder
i have a question regarding combat modes - i have a script that makes tanks more "active" by making them fire their main gun at targets, works beautifully, no problems here
now i want to implement a way to restrict its ability to fire based on the combat mode, i.E. on combat mode green its only supposed to fire the gun when it would normally be allowed to fire on combat mode green - and maybe if it then fires change the combat mode automatically to red
You'd just check the group's combat mode in your script, what's your question?
/// Engage Target
private _friendliesNearTargetPos = (_targetPos nearEntities 50) select {side _x == side (gunner _veh)};
if ((count _friendliesNearTargetPos) == 0) then
{
gunner _veh doWatch _target;
_timeStartOfEngagement = time;
_timeFallbackEnd = time + 10;
waitUntil { _veh aimedAtTarget [ _target] > 0.7 || {!alive _target} || {time >= _timeFallbackEnd }};
if (time < _timeFallbackEnd && {alive _target}) then {
_isTargetVisibleFromVeh = [_veh, "VIEW"] checkVisibility [(getPos _veh), eyePos _target];
if (_isTargetVisibleFromVeh > 0.4) then {
sleep 2 + random 2;
gunner _veh selectWeapon _mainGun;
gunner _veh fireAtTarget [_target, _mainGun];
};
sleep 1;
gunner _veh selectWeapon _coaxGun;
};
sleep 1 + random 2;
};
currently the firing sequence looks something like this - i prefaced it with if (_combatMode == "RED" || _combatMode == "YELLOW")
then {script}
yeah but i want them to still use the maingun on Green - just not at 1200m away when they arent detected yet
I don't get it, if you want them to fire on green then you could just check it in your condition (which seems odd since it's specifically "Hold Fire, Disengage")
if (combatMode gunner _veh in ["RED", "YELLOW", "GREEN"]) then {
[...] call YourPrefix_fnc_engage;
};
units on green will still open fire, if they are detected, threatned or the enemy is very close
You're right, it is don't fire unless fired upon
I dislike that the names themselves aren't very descriptive
if the tank lies in ambush i dont want it to open fire at the first opportunity but only when the enemies get closer, for example
maybe u can store it in a seperate array, check the value if its the same and then reselect?
im not sure if thats an elegant or good solution tho
Just delete it. When no markers are left, restore the original areas and begin again
_array = _array - [random marker]
That should work too
No index needed
I'm using a script to simulate a V2 ballistic missile strike. The existing model is not suitable for the geometry of the projectile, so I used this scheme for a dedicated server.:
- some type of artillery appears and fires at the specified coordinates;
- the clients perform the procedure for creating a projectile with the same parameters as the server;
- after firing, a missile model is attached to the "client" projectile, which then rotates accordingly.
The problem arose when I got to the process of seriously optimizing the impact effects. The process of caching objects required accurate knowledge of the point of impact, but it is impossible to predict it using standard methods, so I added a script block for correcting the trajectory to the desired point.
Optimization led to the desired result, but there was an unpleasant side effect - since the client projectiles are not corrected by the script, it turns out that there is a fairly large gap between the client and server impact points (the effect from the server projectile is also visible to the client, but the real problem that explosion effects are relative to its coordinates, not client ones). There was a task to synchronize them somehow (since it is very desirable to show the flight of the missile).
So far, a temporary solution is to create a namespace (CBA) on the server, pass it as a parameter when creating a "client" projectile, and when starting trajectory correction on the server, update the coordinates and velocity of the projectiles local to the players as well (with namespace variable). While the server has an adjustment period of 1 s, the clients have 0.1, which allows to achieve acceptable accuracy - the spread does not exceed a couple of meters in the worst case (but there are doubts about how this will work with a heavy network load).
There was also an idea to run exactly the same cycle on local projectiles, and make adjustments independently.
Maybe someone has more effective solutions?
Can't you just create a single global model and attach to the projectile on the launch machine?
@errant jasper Iirc, it is not possible. At least I'm sure I tried to do it from the very start, of course π Projectiles are local, so there was some serious problems which made this implementation impossible.
If you have signature checking on or whatever, it's automatic. I don't remember how to do that while local hosting though.
Hmm, yeah, might be true that fired projectile mostly run as local objects on each machine. So attaching a global object to a local projectile might mess up ?
Yes, something weird happened π
Even if you can't, I think you can do it by launching as a dedicated server on your computer and then also launching and joining as a client also an you computer.
Either way, I think it's a #server_windows thing.
More of server question
Thanks.
Since I do not apply animation, won't createSimpleObject just place a standing character?
In the past I have used setDammage and removeFromRemainsCollector.
But I am going to be placing several dozen bodies. I'd prefer if there was no AI CPU overhead for the server.
Is there a more efficient method?
If the unit is dead then it's not going to be running any of its AI
Can yall think of any workarounds to give a player control of a webknight smasher/goliath? Iβm finding that I canβt attack controlling one.
Alright; placing units and doing setDammage 1 is probably the simplest implementation.
Is it also cost effective in terms of processing?
Normally the ragdoll simulation is very expensive. I don't know if there's a specific cheat it does when the unit is set to damage 1 immediately after creation.
but if you apply setDamage 1 to 50 units at once, the effect on frame rate is brutal.
Tracks with my experience.
Do you know of an implementation where a unit is directly posed as a corpse? I don't need any interaction; purely decorative.
switchMove
Thank you.
I've run this in a placed civilian init:
this switchMove "AmovPpneMstpSrasWrflDnon";
this setDammage 1;
this enableSimulationGlobal false;
And tried replacing the enableSimulationGlobal with unchecking simulation in the box.
This skips ragdoll, and I assume also any AI or Group initialization, which I understand costs CPU.
Next step: find a death pose that looks natural.
Just a wild thought: Organize units into array, force them all to go prone to decrease ragdoll simulation and apply damage one by one with a delay. Might work if your mission starts away from the players so they wont' see it
Hey guys, I failed to find some helping informations about the way "getVariable" works.
Something in the description on the Wiki suggests that it is kinda working like a pointer, but I am not a 100% sure and also Arma Locality always freaks me out, so before I go on wild goose chases for some bugs, I wanted to ask if someone could help me understand it.
So, I want an Array with several Objects that can be changed during the mission and a script on the client checks if the players are close to the object.
These objects can be added to the list or get taken from the list, therefor it is important that the actual Array with the object is broadcasted to everyone.
So, if I want to add an Object what would be the right way?
(missionNameSpace getVariable ["missionObjects",[]]) pushback _myNewObject;
If it really works like a Pointer, that should do the trick, right?
The other way would be:
_tempArr = missionNameSpace getVariable ["missionObjects",[]];
_tempArr pushback _myNewObject;
missionNameSpace setVariable ["missionObjects",_tempArr,true];
But if there would be several interactions that remove and add objects to the array at the same time , I would worry that I would start "racing conditions".
Would be awesome if someone could bring me up to speed how this should work or if there should be even another way to do this.
Someone more skilled will answer soon most likely, but before that: Are you modifying the array on server only or can clients modify it too?
All manipulation on the Array will happen on the server. It still is important that the clients always get the change asap as it is important for the client side scripts.
your first example is correct, you don't need a temporary array - however there's the caveat that is the variable doesn't exist and the default value is used it won't do anything since it's effectively gonna create a new array there and do nothing with it, so you should make sure that the missionObjects array is actually an array before modifying it
Unless you are scheduling, there cannot be race conditions in SQF because it is single-threaded. with scheduled "threads", while it's not technically running it on a separate thread tasks, the "threads" are effectively resource management to make sure the script doesn't lag the game too much by jumping between them
edit: it's "asynchronous" in the sense that it jumps between different scheduled threads, but internally it's not what you would consider multithreaded in traditional programming
obviously if you want the array to be changed globally you still have to do what you did in the last example (public the updated array every time it is changed)
Doesn't spawn count as async (?)
granted, race conditions are a valid concern if this array is modified on multiple clients and declared public from multiple clients, but from what i understand you're only doing it on the server so that's not an issue either
Yeah, the clients can only trigger the scripts that will run on the server to modify the array.
it does not - it just sounds async becuase the scheduler jumps between different spawned threads per frame, but it's not like traditional multithreading where you have to worry about locks and which "thread" affects a variable at any given time
What if the scheduler stops executing spawned script in middle of it and continues with another one that modifies e.g. the same array than the first script?
which also means the scheduler can behave unpredictably - if one scheduled thread is slow while another is fast, and they modify the same thing - you might get inconsistent results where the modification is done in different order each time
yeah that's when you get issues
that's why you shouldn't be modifying the same array in multiple scheduled threads - while it wont brick anything, it will behave unpredictably
i suppose my explanation was coming more from the perspective of what people consider threading in traditional programming compared to the way sqf does it
Yeah, that's what I wanted to know. I guess there's a fine difference between concurrency and parallellism π
ye
in short - you're fine, and if you wanna avoid race conditions just delegate any array modifications to the unscheduled environment and make sure it's done from only one client/server
Depending on how big the array is, it's also better to send the changes to clients and let it update the data locally.
Because if you send a 10k entry mission objects array often, network won't really like that i guess 
oh yeah that too ^; if you get massive you should probably create an event system that sends a value and task, i.e append/pushback value xyz to array of name xyz
I think this will be fine. We are talking about maybe 5 to maybe 20 entries in a mission. Its not a database ^^
Yea then don't even bother, waste of time then ^^
Okay, great. Thanks for the explanation Kharos. That really helped me understand whats happening. It's always easier to plan when you know what is actually happening there. Coming from JAVA and C++, it is sometimes a bit difficult how few documentations you find for sqf. ^^
also to touch on this real quick - there are a few pages that outline how sqf works on the wiki - not sure if you mean commands or "best practices", but there's both: https://community.bistudio.com/wiki/SQF_Syntax
the top of that page has tabs for different aspects
granted the wiki can be quite barren for SOME things, especially certain config related ones - but for sqf i'd say it's relatively well documented
hi, I wonder if there is a script to show a unit's line of sight on the map?
I need to help our little bird pilot who is very new and practically blind. 
what do you need exactly?
@winter rose make a marker on the map showing the unit's line of sight (direction and if possible distance where the unit is looking)
for him? or for targets?
just for him so he know where he is looking on the map
dude cannot connect where he is looking on map and in real world
difficulty setting can allow his own position/direction on the map
however it is scriptable definitely
we already have player markers on the map, now we need a marker (like an arrow or something) where they are looking
I know its ridiculous to be that kind of lost
cheapest way would be to spawn an arrow marker and set its direction based on the unit direction
(and keep updating it per frame alongside the position)
it'll look fugly but it'd work π€·
the best way is to run a script updating every X seconds (to maybe avoid being OP? otherwise each frame) with cameraDirection
ye i guess it depends on whether he wants it to be a tutoring system or sometihng more permanent, you probably dont want something like that used forever
and for safety maybe both camera dir AND unit dir lol - color code them or something
positionCameraToWorld + getCameraViewDirection @split ruin
I have found a code that do this, I need now to show it on map instead of 3d space
onEachFrame {
_beg = ASLToAGL eyePos player;
_endE = _beg vectorAdd (eyeDirection player vectorMultiply 100);
drawLine3D [_beg, _endE, [0,1,0,1]];
_endW = _beg vectorAdd (player weaponDirection currentWeapon player vectorMultiply 100);
drawLine3D [_beg, _endW, [1,0,0,1]];
};
actually this is a lot cleaner
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", toString {
(_this select 0) drawLine [
player,
(screenToWorld [0.5, 0.5]),
[0,0,1,1], // blue
3
];
}];
Its doing its job, the only thing is I want to draw a triangle (not filled with color) representing units fov, not just a line but even line is ok
https://community.bistudio.com/wiki/drawPolygon maybe with this?
it will work only if I can get two positions left and right relative to screenToWolrd position ...
you can do maths, or use screenToWorld ^^
or just make a graphic/find one (think theres a vision cone in A3) and use drawicon
You can use syntax 3 of https://community.bistudio.com/wiki/getPos
No vector math involved. Use the unit as origin, get it's direction and add/substract half the angle of the vision cone and define a distance.
Use these positions in drawPolygon
@still forum quickie for your monday consideration - any chance for a simple getActionQueue command? for animation states - just spits out an array of actions from the one currently playing to last queued
not the action class itself but rather the action state (i.e MedicOther, WalkF, etc...) since the class can easily be retrieved through the current anim's actions property
there is no "action queue"
you can't get the "action state" at all. actions work one way, i.e action -> animation state, not the other way around
I am getting Undefined variable: _lootPool at the bottom. I define it in an outer class at the top. What am I doing wrong?
Do you mean Line 144 is throwing the error?
deleteAt does not return the result. It modifies the given array
It returns the deleted index
Not sure why it says element
Unless I am mistaken and remembering wrong
So _array deleteAt 4 returns 4?
It does return the deleted element
https://i.imgur.com/5Pp6fHm.png
Don't you guys ever use _array deleteAt floor random count _array :P

Bro π
My deleteAt syntax was entirely wrong and I am tired- can't a guy dirty delete in peace
Joke isn't funny with improper syntax π₯
2 - 1000 yards - Front - Stare
I went by wiki's own wording from the playAction command, to be more precise the idea would be to retrieve what user input (or scripted) calls to which actions had been made? For example when healing another unit the current order would presumably be MedicOther>MedicStop, the order remaining true until the state from medicother is finished
let's say for example the user is prone and needs to play some animation through action; that animation state is assigned to Action1; reaching its assigned state requires passing through 3 other states that may take up to idk, 2-3 seconds (with the former including potentially getting up, lowering his weapon, doing something else, and THEN playing it), or it may happen as soon as the next frame if the user is already standing with his weapon lowered doing a "thing" - during that time some other script or user input may do "hey actually go head and play EvasiveLeft instead" - i now have a temporary AnimStateChanged event handler or a waitUntilAndExecute sitting there unsure how long it'll take until the required animation state is reached to do monitor for (and do) a specific move (might take 3 seconds, might take 0.5, or it might never happen if something messes with the input) - this is where having access to an action queue that's saying "we're still trying to get to that Action1 assigned animation state" or "Action1 is somewhere in the queue if the Now variant wasn't used" allows to either continue monitoring or terminate the process instead of making arbitrarily timed timeouts or guesses based on how long it might take
besides that ofc it might also help with determining a vague movement speed (current action has "Run" in it, it's run, Tact it's tactical, Walk it's Walk, Evasive it's sprint, without having to check the names of the animations and wondering if it's just transitionary or the intended action explicitly made by the user)
thanks for coming to my TED talk 
i also appreciate it's a very niche use case (not many modders muck about with animations) - and perhaps there are better ways, but the way im doing things right now is effectively the aforementioned handler or waituntil that grabs whichever state we are expecting from Action1 in the example and waits until we reach it, but we can never be 100% sure we'll ever reach it or how long it'll take to reach it after initiating the action
how can i easily get the exact limb that was hit using the "HandleDamage" eventHandler?
it works good enough just getting the last _selection each time most limbs get hit but for the head it always gives the body
Checking which body part got damaged the most doesn't do trick?
try checking hitPart instead of selection as well, see if it's any different
also this ^ if you're getting the last part - then depending on the _context you're checking for, you might be getting body because i think the very last one is always going to be for total damage (but dont quote me on that) regardless of hitpoint
how would i compare the damage between the different times the eventHandler is fired?
yeah no such thing
collect them all into an array and calculate based on context #2 being the last one
so what does the wiki refer to then? i'm down for any recommendations on solving the conundrum im having
the idea would be to retrieve what user input (or scripted) calls to which actions had been made
_action = getText(configFile >> "CfgMovesMaleSdr" >> "states" >> animationState _unit);
_medicAct = getText(configFile >> "CfgMovesMaleSdr" >> "actions" >> _action >> "MedicOther"); // can be array for gestures
if (_mediAct == animationState _unit) then {
// is playing MedicOther action
}
for that you need getAnimationQueue which does exist. but there's no action queue
that'.. yep - let's roll with that then - cause yeah the code you pasted above is what im doing right now - it just has the one caveat that if another call is made to change the queue it means we may never reach _medicAct for example (i.e unit goes down while trying to get to it, or another call overrides it using switchMove or playActionNow or whatever)
so now you have a floating waituntil/handler that doesnt know if it should keep waiting or terminate since it cant tell if the needed animationstate will still occur
to revise my request - getAnimationQueue would be awesome π
sorry for the confusion
I can probably add it this weekend if Dedmen or KK don't want to do it
heck yeah, thank you very much π will really help clean up magic timeouts and guesswork lol
it's also useful to know the information about how actions are invoked - while i was aware they were just designed to dictate which animation is played, i was always under the impression they acted independently (the wording made me think they had their own precedence and queue independent from manual move calls)
nope, the action gets mapped to an animation state, and the anim state is pushed to the queue
Total damage are first two
Maybe context 0 is last one? I don't remember. I'm pretty sure context 4 is first and that also carries total damage. Total damage is there more than once per hit
yeah... not really sure - would help to know exactly what he's trying to do - so far he just asked about extracting which limb was hit and i guess comparing damage between hits for whatever reason - every time i used the handler personally it had been consistent in transfering damage to the correct point but i used hitIndex/hitPart instead of selection so π€·
In theory one could save damage variable on unit to 0 on context 4. On context 1 and 2(part hit) overwrite that damage variable by current part damage and save hitPart index, if it's current part damage is larger.
what i am making is a sort of simple 'disabled' state for ai, when a unit gets hit they will ragdoll and then go into a appropriate animation depending on what limb was hit.
this is the first script i am making so i am mostly just learning how things work.
I do not need help with this one thing anymore as i believe it works
@bronze trellis , they cannot join back to your server unless they have a password. However, you could do something like this in the init.sqf: if ((name player) == "Kick me pleaz") then {serverCommand format ["#kick %1",(name player)];};
@earnest valve i setup a test server and when i join it then lock the server it locks but i can disconnect and reconnect. If i lock before I try to join the server i cannot get into the lobby.
@earnest valve You are wrong there. "locked" is not the same as "passworded".
Search for " #lock "
@jade abyss this is what i read about the command. "#lock Locks the server, prevents new clients from joining." so existing clients can reconnect by default then?
If they are on the Server and go from ingame back to lobby -> They can join ingame again.
It simply just blocks the Connection of new Clients ON/TO the Server
Doing a Little Round Top op and was hoping someone could help me figure out how to make a carryable flag
yes that is what i thought. Only thing is im running the server on the same pc as the client and i can disconnect and go back into the MP browser and reconnect again. could it be because both are on the same pc?
"" #lock - Locks the server, prevents new clients from joining. ""
If the admin disconnects, who told the Server to "lock" -> It gets unlocked
iirc
im using rcon tool to lock it does does that make a difference?
ya the lock icon stays there but i can still join.
hm
does isKindOf "Building" also work on map buildings or only the ones i placed in editor?
It should
Work on all objects which have class
Regardless if they are spawned by terrain or mission
It's not hard to test:
cursorObject isKindOf "Building"
ill test, thank u π
A lot of smaller map buildings don't have a class. The houses do though.
Is it helpful to check if something is kind of building though?
We did that stuff often, when the Server was full. So.... could be the local thingy you said (Server+Client on same PC)
Last time I checked a lot of object like street lamps, signs, houses, fences are all kind of "House"
Not really helpful
yeah it's a problem.
well building was just an example - if it works for building, it should work for "Church" or "Fortress"
and those might be more useful lol
Didn't know these classes exist π
ya thats all i can think of. I will reinstall just in case my server is miss configured or something
thanks for the help
Are there any workarounds on disabling a specific default action in game? For example, forcing the commander to be turned out and removing an option to be turned in. I know you cannot directly remove actions as they're hardcoded, but was wondering if there is anything else that could be done. Wouldn't want any other restrictions to the player in that slot though, just so he's forced to be turned out
You can work with these event handlers and force the action by command.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#TurnIn
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#TurnOut
https://community.bistudio.com/wiki/inGameUISetEventHandler return true on TurnIn should work
you can override other default actions for this too
Thanks, will check it out!
if i want to stop RHS tanks from turning their engine off (startup takes ages..) do i have to script that?
or rather -. can you scrip that? is there a command that deals with allowing engines to be turned off and on?
Not sure how RHS does it, but ACE does it with a Engine event handler and they just keep turning the engine off for X amount of time. RHS presumably does the same thing
i can only find engineOn and isEngineOn
okay apparently there is "RHS_ENGINE_STARTUP_OFF = true" but i have no idea where to put this
That's sqf, so you can just run it from a script
yeah but like.. does it turn that off for the whole mod? so i can put it in the init and im fine?
Looks like it yeah, you wouldn't set an object variable like that
alrighty, ill try that, thanks
I am considering it on tuesday to say no
Whats the quickest way to convert a 3D position array into a 2D position array?
_array resize 2;
thank you π
Just note that it modifies the original array, so if take an array as a parameter, it will modify the array in the calling code as well
oof - also sorry i should've updated the message after talking with leopard but he did clear up that an "action queue" doesnt exist and would have to just pull an anim queue instead - in my defense i wasn't entirely crazy since the wiki is a little misleading in that regard 
_worldCenter2D = [worldSize / 2, worldSize / 2];
_locationNames = ["Name", "NameCity", "NameCityCapital", "NameLocal", "NameVillage", "fakeTown"];
_locationsArray = nearestLocations[_worldCenter2D, _locationNames, worldSize];
_objectTypes = ["BUILDING", "HOUSE"];
_initialSearchSize = 250;
{
_positionInstance = locationPosition _x;
_buildingsArray = nearestTerrainObjects[_positionInstance, _objectTypes, _initialSearchSize * 2, false];
// hintSilent format["%1\n%2", className (_locationsArray select 0), _buildingsArray];
_markerInstance = createMarker [format["%1", _x], _positionInstance, -1, objNull];
_markerInstance setMarkerShape "ELLIPSE";
switch (count _buildingsArray) do {
case (<= 3): {_markerInstance setMarkerSize [_initialSearchSize * 0.33, _initialSearchSize * 0.33]};
case (> 3 && < 12): {_markerInstance setMarkerSize [_initialSearchSize * 0.50, _initialSearchSize * 0.50]};
case (>= 12): {_markerInstance setMarkerSize [_initialSearchSize, _initialSearchSize]};
};
};
I can't seem to figure out why its throwing that error :/ perhaps its a misunderstanding of how switch & case works?
I want to create some circular "area" markers over all locations on any given map, and then adjust the size of the markers based on the amount of buildings in a nearby area (to get a Very rough estimate of location size via amount of buildings in the area, ill refine the code more later).
Im reading this page but its evident i dont quite understand how they work still π
switch _value do {
case _case ...```
`_value` and `_case` need to return the same thing in order for the case to match
<= 3 is not a valid expression
You could write it like this instead:
switch (true) do {
case ((count _buildingsArray) <= 3) : ...```
so would (_case <= 3) work?
The cases must be values
ah ok... weird, i cant seem to make sense of this in my head
* doing count _buildingsArray once at the start and saving the result to a variable would be better than doing it in each case check, this is just an example
Is this valid? case ((count _buildingsArray) <= 3) ?????
Yes, see example 4
The case expression returns true, which matches the value being checked
Yeah okay you switched on true yeah.
i have this now:
switch (true) do {
case (count _buildingsArray <= 3): {_markerInstance setMarkerSize [_initialSearchSize * 0.33, _initialSearchSize * 0.33]};
case (count _buildingsArray > 3 && < 12): {_markerInstance setMarkerSize [_initialSearchSize * 0.50, _initialSearchSize * 0.50]};
case (count _buildingsArray >= 12): {_markerInstance setMarkerSize [_initialSearchSize, _initialSearchSize]};
};
But now its saying the middle one has the same error :/
Wow... That an "ugly idiom".... Well we don't have something cond clauses, so I guess it the idiom
count _buildingsArray > 3 && < 12```
this is not a valid expression
&& works by comparing 2 booleans. < 12 does not return a boolean
Let's count _buildingsArray once at the start, so we can make this a little tidier.
private _count = count _buildingsArray;
switch (true) do {
case ((_count > 3) && (_count < 12)) : ...```
private _numBuildings = count _buildingsArray;
private _factor = switch (true) do {
case (_numBuildings <= 3): {0.33};
case (_numBuildings < 12): {0.50};
default {1.0}
};
_markerInstance setMarkerSize [_initialSearchSize * _factor, _initialSearchSize * _factor];
This is not throwing an error but now my markers arent showing at all. ill do some testing. Thanks for the help though! Sorry for me being slow π
Well you original code had this:
_worldCenter2D .........
.....
{
// CODE HERE
};
The code is wrapped inside { } so you are just constructing a code value but not running it I guess?
Also not sure if your intended use it multiplayer but if so- you can optimize network by changing your createMarker and setMarkerShape commands to createMarkerLocal and setMarkerShapeLocal π
Oh its all in init.sqf for the time being, ill move it to a function later, i just want the code to work first lol
Yup, was reading about this in the code optimisation page, but as with the last message, i just want it to work first, then ill optimise afterwards
Totally, working is more important- just wanted to chime in
This works for me:
_worldCenter2D = [worldSize / 2, worldSize / 2];
_locationNames = ["Name", "NameCity", "NameCityCapital", "NameLocal", "NameVillage", "fakeTown"];
_locationsArray = nearestLocations[_worldCenter2D, _locationNames, worldSize];
_objectTypes = ["BUILDING", "HOUSE"];
_initialSearchSize = 250;
{
_positionInstance = locationPosition _x;
_buildingsArray = nearestTerrainObjects [_positionInstance, _objectTypes, _initialSearchSize * 2, false];
_markerInstance = createMarker [format["%1", _x], _positionInstance, -1, objNull];
_markerInstance setMarkerShape "ELLIPSE";
private _numBuildings = count _buildingsArray;
private _factor = switch (true) do {
case (_numBuildings <= 3): {0.33};
case (_numBuildings < 12): {0.50};
default {1.0}
};
_markerInstance setMarkerSize [_initialSearchSize * _factor, _initialSearchSize * _factor];
} forEach _locationsArray;
I wanna create a semi-dynamic mission that spawns hostiles in most locations (with the size of the enemy force being determined roughly by the locations size) that i can just literally throw onto any terrain i want and have it work somewhat effectively :P
This is just the first part lol
This works for me too! Much apprecaited π«Ά
Next job is trying to center the markers better over the actual locations (rather than the locationPosition, as a lot of maps place the "name" outside of the center of the location.
Buuuut thats a later me job, snack break time! :p
If by actual location you mean the buildings covered then you can average (or median) the building positions.
If you mean the middle of the label text of the location that is more difficult
That was exactly how i was thinking of doing it π
I was about to say have fun picking each position manually π
Yeah for average, just sum up the position x, y coordinates and divide. For median you can do it by axis, by sorting all the x and y position and taking the middle of each (thinking about it Median is probably a bad result for this).
Actuallly a third option would just be to find the min/max coords, and take the center of those
I cant tell if im just being dumb, but _selectedLocationNum = _selectedLocationNum + 1; Should work fine right?!?!?! If i just want to add 1 to a variable??
Because its just not doing that. the code is being ran (i have a hint setup so i KNOW the code is being ran, but it just refuses to add 1 to _selectedLocationNum
["AmmoboxInit", [arsenalScreen, true, { _this distance _target < 10 }]] call BIS_fnc_arsenal;
private _locationArray = ["airBase", "agiaMarina", "firingRange", "girna", "maxwell", "rogain", "station", "tempest"];
private _locationCount = count _locationArray -1;
_selectedLocationNum = 0;
addMissionEventHandler ["EntityRespawned", {
params ["_newEntity", "_oldEntity"];
_newEntity enableStamina false;
_newEntity setCustomAimCoef 0;
}];
missionNamespace setVariable ["battleLocation", "airBase", true];
battleLocation = missionNamespace getVariable ["battleLocation", "airBase"];
_teleportPlayer = {
params ["_target", "_caller", "_actionId", "_arguments"];
battleLocation = missionNamespace getVariable ["battleLocation", "airBase"];
_locationPos = getMarkerPos battleLocation;
_locationSize = getMarkerSize battleLocation;
_teleportTarget = [
_locationPos,
_locationSize select 0,
(_locationSize select 0) + (_locationSize select 0 / 4),
2,
0,
0.7,
0,
[],
[3800.5,8146.55,42.2586]
] call BIS_fnc_findSafePos;
_caller setPos _teleportTarget;
_angle = _caller getDir _locationPos;
_caller setDir _angle;
};
_switchLocation = {
params ["_target", "_caller", "_actionId", "_arguments"];
_selectedLocationNum = _this select 3 select 0;
_locationArray = _this select 3 select 1;
_selectedLocationNum = _selectedLocationNum + 1;
_selectedLocationName = _locationArray select _selectedLocationNum;
hint format["%1", _selectedLocationNum];
};
playScreen addAction [
"Teleport to Battle",
_teleportPlayer,
nil,
1.5,
true,
true,
"",
"true",
10,
false,
"",
""
];
settingsScreen addAction [
"Switch Location",
_switchLocation,
[_selectedLocationNum, _locationArray],
1.5,
true,
true,
"",
"true",
10,
false,
"",
""
];
I dunno why you're doing _this select 3 select 0 instead of _arguments select 0. I don't think that's the problem though.
thats how it says it should be done on the wiki page for addAction
It looks like you're expecting your code to increment the value in the array? Which it won't.
I'm reading on mobile so I could be missing something, but it looks like this is written so that the final _selectedLocationNum, used in the switchLocation action code, will always be 1. You set it to 0 to begin with, pass it to the action as 0, and in the action add 1. Final result: 1. Every time. There's no permanent incrementing, if that's what you're after.
Well this is in initPlayerLocal.sqf so surely the _selectedLocationNum = 0; is only called once no?
That's one way of accessing it.
The other way is with params, which you're doing on the line right before that. You only need one method, not both.
It stays 0 in the array.
But its not an array, its an integer
_selectedLocationNum is an Integer
atleast it should be an integer
It's a number in an array :/
Yes, and then you pass 0 to the actions. That's the key part. When you create the actions, you tell them that one of their arguments is 0. It's not a global variable, you're not changing it globally when you do +1 in the action code.
_selectedLocationNum = _selectedLocationNum + 1; just sets that variable to a new number with the value +1. It doesn't update the original value.
so do i just remove _selectedLocationNum = 0;?
No, what you need is to make a way of updating the number globally. Using a global variable instead of a local variable would be one way - you're already doing this with battleLocation
You would need to do something like this:
_switchLocation = {
params ["_target", "_caller", "_actionId", "_arguments"];
_selectedLocationNum = _arguments select 0;
_locationArray = _arguments select 1;
_selectedLocationNum = _selectedLocationNum + 1;
_selectedLocationName = _locationArray select _selectedLocationNum;
hint format["%1", _selectedLocationNum];
_arguments set [0, _selectedLocationNum];
};
Like I just said, the problem is not that you set it to 0 originally, it's that you then encode that 0 in the arguments and never update it
π
Oh wait
im dumb
hold on, ignore that
That code seemed to work, thanks a bunch!!
There's no script access for setting vision mode daytv/nvg/ti for turret/pilotcamera, right? I can only find setCamUseTI
Is Biki down? π
No?
encountering access issue?
TIL the live feed module. It doesn't put stuff on screens (objects), it puts stuff on your screen (UI)
Would love some (a lot) of help with something please, would anyone know of a way I can add an interaction with certain Eden placed vehicles, the interaction spawning squads of AI directly into the passenger slots of a helicopter as well as add them to the players squad ideally but if not I can work around that.
Trying to create a carrier strike group base but seeing as AI canβt traverse objects like a carrier deck I figured I could just have the helicopter and maybe there would be a way to interact with said helicopter and add the units directly into the helicopter so they never have to walk over the actual deck.
Thanks in advance
The simplest method is to synchronize a Respawn module to the vehicle. Units will then spawn in open seats of the vehicle.
Wiki mentions that https://community.bistudio.com/wiki/setDir is LE on a mine, is this specific to like "mine" simulation (not sure what its called or if there is a specific one) or for all explosives? And also if I'm triggerAmmo'ing an explosive right after a setDir, do I need to delay that for it to sync on all machines?
I'm not sure how accurate any of that is. I think setDir was mostly fixed a while back.
Oh nice
How do I then define the ai units/ squads so It knows what to spawn when I interact with said helo?
Something very similar to what youβre talking about exists in ROS Carrier Strike Group in case you havenβt tried it. He did a great job with it!
Yeah I actually watched the video last night and itβs what prompted me to start looking into coming up with this, if it wasnβt for wanting it to be part of a larger campaign Iβd just play that exact mission but thereβs other stuff Iβm working on that Iβd want to be in the same mission that isnβt in the ROS System, and likewise parts do ROS I donβt need in my mission.
So maybe my best option would be to contact ROS or Gunter and ask if they mind sharing how they did it.
Just mentioned in case you hadnβt seen it. Good luck with your project! Love the carrier based stuff.
Thanks very much, I have noticed some ai pathing objects on the workshop as well but havenβt played around with those yet, donβt know if I could whack a load of those onto a carrier deck so that recruited ai can follow me out to the helo or not, will have to have a play around
Thatβs funny, I just downloaded one of those to try also. Havenβt yet, but it looks like placing an invisible helipad in the editor. Youβd think with where society is with technology itβd be easier to move a couple squad members 10 yards π
You may know this too, but in case not - using something like deformer or scripts like in ROS to level the seabed ~30m or so below the surface helps with helo landing consistency.
Nah letβs just have them run around in circles instead unable to figure out thereβs actually something under them π
Didnβt know that thanks, on my test my helo ended up phasing through some of the deck but then fixed itself without blowing up so I counted that as a win in Arma terms π
Totally a win! I probably spent weeks of my life messing with every support mod and helipad setup before I stumbled on that. Hope it helps
For these it would be called "vision mode"
Switching to a different, of the configured vision modes.
The command currentVisionMode which also has the turret variant, tells you what is active.
But I don't see a setter.
Also not sure what you could set that is not in config.
Scripted camera doesn't care.
But these modes only ever switch to "next mode" as configured in config. So if config has no Ti, you would be able to get to it.
But not sure, I think you could force Ti anyway.
I'm putting it on my list
Current workaround is to have each fov-vismode combo be its own optics mode, with config access obv.
I can make it very easily accessible for pylons.
But I suppose that's unfair and you also want it on non-pylon cameras π
So just alt syntax for setCamUseTI that also takes vehicle/turret
That'll work if you prefer it to new commands like setTurretOpticsMode, setPilotCameraOpticsMode
The deadSetTime in getEntityInfo, is there any way to get it to synchronize when JIP?
I'm not all that familiar with the command so may be why I'm not understanding the question. Is the deadSetTime not available for clients who join after the player dies?
You could set any value like that to an object/missionNamespace variable and then broadcast it public which would make it available to JIP; but not sure if that's what you're looking for.
Yeah, I don't really want to add to the JIP queue but I guess maybe it would be similar in impact
I think deadSetTime is just join time and never syncs
What problem are you running into and what do you want to happen?
Well the mission is pretty network heavy and past 60-70 players it can start to network choke a bit. Things start lagging, variable syncs take a while...etc.
Anyway maybe a number for a wreck wouldn't do much and I'm just being lazy to rely on defaults but I was just wondering if anyone's found a way to sync that number, fine if it's just eventually and not instant.
Props on the 60-70 players π
I'm not super familiar with that command so maybe there's some existing functionality of it I'm missing.
I could be totally off here but I'm guessing you're wanting to track that for despawning purposes or something?
Either way although it would add to JIP what you could do is set a public variable to the wreck I.E.:
_wreck setVariable ["wrecktime", serverTime, true];
Then whenever you handle clean up (or whatever you're using it for) could get the time by doing:
private _timeSinceWreck = serverTime - (_wreck getVariable ["wrecktime", serverTime]);
Or something similar of the sort maybe if that's helpful
I suppose that adds more network and contributes to your issue though of it already being network heavy. May have to approach optimizing that some first. Maybe there's another solution that doesn't require network in that context using an event handler if you only need to access those values on server.
It better than jip message someone forgets to delete.
Though I wouldn't check like that. Since values is not set a missing variable will always be read as 0 even on later repeated reads
It was an example, that default could easily be changed for error casing.
We use public object variables for things like despawning just fine. Don't need to keep track of them when you intend to delete the object anyway at some point or another.
Is there any site where I can download all of biki?
what does "Reserved Variable in expression" mean?
the error points me to this line :
params = ["_groupsToChooseFrom","_position","_enemyValue"];
params is a command.
yeah but im declaring params for my function
You don't use an equals then.
Brother, thank you so much, do you really work on a life server or are you out here moderating the arma server? Cant believe you dont miss anything, even that! π
is there a reliable way to get the aim rotation of a unit (vertical looking up and down) that is not eyeDirection or weaponDirection?
i tried with doing selectionVectorDirAndUp on memory aimPoint however that one always has some kind of rotation applied to it as it's guided by the underlying spine bones and won't be zeroed when no aim offset is applied
I may have amnesia and have asked this ages ago but last time i made do with weaponDirection, now i cant π
Haha no problem dude happy to help! For what it's worth I feel like I miss a lot of stuff. I have dyslexia, etc so I feel like sometime I misread things and give crap answers sometimes but is what it is lmao π₯²
Well, talking from what I've seen you do on here, you're always really helpful and accurate. Many brilliant people have dyslexia, autism, ADHD, whatever. It almost feels like being brilliant is related to having some kind of neurodivergence. (Oh, I think the definition itself of neurodivergence states something like that)
Yeah I'll probably do something like that. After some testing, it doesn't seem to snowball. Probably because the JIP queue removes the set-variables if the wreck is deleted so they don't build up? Not sure.
I expect no more than 20-30 wrecks at the same time anyway. Was just kind of afraid of what happens over a few hours.
Probably just over-optimized on something that barely matters.
Yeah, generally you don't need to worry about setVariables on vehicles & units because the cost of the objects themselves is much higher.
Only thing you need to avoid is not spamming global changes when you don't need to.
Part of my mission takes place in an underground "cave" that players teleport to.
I would like to change the sound processing so that steps/gunfire/sounds have high reverb and close proximity. Or simply just indoor.
On the BIKI I've found something about EnvSoundControllers.
Is there a setter command that would change the sound parameters locally for a player?
Trying to understand the syntax.
object in this case can be player?
Inside/outside processing is normally determined by the material properties of the surface you're standing on - for example, the floor of a house. Syntax 2 is an override for that, so it's used on the object you're standing on. You could use it on the objects that make up the floor of the cave.
Syntax 1 is not object-specific. I have not tested it, but I would expect it applies to all sounds played on the client that executes it. Easy enough for you to test. You could use it to apply indoor filtering when inside the cave, and turn it off when outside the cave, if your cave shape isn't too complex and you don't need to hear unfiltered sounds coming from outside.
Hi. Im trying to apply a wound from ACE advanced med system to a soldier per script. Random body part.
* 0: The Unit <OBJECT>
* 1: Damage to Add <NUMBER>
* 2: Selection ("head", "body", "hand_l", "hand_r", "leg_l", "leg_r") <STRING>
* 3: Projectile Type <STRING>
*
* Example:
* [player, 0.8, "leg_r", "bullet"] call ace_medical_fnc_addDamageToUnit
* [cursorTarget, 1, "body", "stab"] call ace_medical_fnc_addDamageToUnit```
As I said, I want to randomize the body part, so i came up with something like that:
```_patient1 = patient1;
_bodypart = ["head", "body", "arm_r", "arm_l", "leg_r", "leg_l"];
_random = _bodypart select (floor (random (count _bodypart)));
_patient1 addAction ["Velocity Wound", {[unit1, 0.8, "_random", "bullet"] call ace_medical_fnc_addDamageToUnit}];```
Could someone help me figure it out? My way doesnt work somehow.The unit1 is being spawned like that:
unit1 setDir 240;
[unit1, true] call ACE_captives_fnc_setHandcuffed;```
the patient is the name of the sing, unit1 is the name of the soldier who is supposed to be injured
also you pass _random as a string
"_random" != _random
_patient1 addAction ["Velocity Wound", {[unit1, 0.8, _random, "bullet"] call ace_medical_fnc_addDamageToUnit}];
you were targeting the "_random" selection
oh, i see. Even the rpt log says that ```[ACE] (medical) ERROR: addDamageToUnit - bad selection [B Alpha 1-2:1,0.8,"_random","bullet"]
Ok, thats a progress. Now i get the "undefined viariable in expression: _random". Looks like i have to squeeze the random variables somehow there
yes
_random loses locality with an addaction
just like with event handlers
_patient1 addAction [
"Velocity Wound",
{
private _bodypart = ["head", "body", "arm_r", "arm_l", "leg_r", "leg_l"];
[unit1, 0.8,(_bodypart select (floor (random (count _bodypart)))), "bullet"] call ace_medical_fnc_addDamageToUnit;
}
];
Okay. I understand. Didnt know you can do it like that.
I mean that it can be done like that.
params bruh
Works. Thanks for the help. I learned a lot from that lesson.
Thank you for this explanation!
How to check if entity is Agent?
It's kind of weird that that can only be done by going through teamMember first
What else is an agent?
An object created with createAgent?
Ah any Person with an "Agent" brain
teamMember confused me at first, since I have no idea what that is. That being said following works:
isAgent teamMember TAG_rabbit;
Also is it me or are the agent and teamMember commands "backwards" in terms of name vs function?
teamMember is a bit.. of a cheat
There are 3 types of brain.
Brain, Agent, TeamMember.
Both Agent and TeamMember just return themselves in the GetTeamMember getter, so it happens to work..
Won't fix lol
could you make that isAgent takes Object?
I have asked the same thing a few months ago for a mission I am working on.
As far as I could get, there is no way of making players look up/down. Sad.
Quite some mission makers use BIS_fnc_unitCapture to record vehicles or helicopter flights..
I took one look at the code and am disgusted 
_capturedData = _capturedData + [[(_timeCur + _timeOffset), (getPosASL _unit), vectorDir _unit, vectorUp _unit, velocity _unit]]; //This line is saving captured data to some string variable
Its not storing it to a string, its appending to an array.
But, its using +
Which.. creates a new array, copies data from the old array, then appends the new data, and replaces the old array..
Every iteration, a huge array is copied for no purpose 
Could it be that playback is more optimized that way vs. recording? I.e. if reading the array was faster than parsing the string and then reading it?
Actually I guess that's a moot point because the output could just be made to whatever preference anyway
string would be utterly stupid, ignore the mentions of string
pushBack is 1.26, fnc might be from before xD
func is from A2 yeah!
It belongs in a museum!
Guess I'm writing my own version.
Using EachFrame instead of unreliable sleep. Pausing and resuming on Esc menu instead of aborting
inb4 BIS_fnc_unitCaptureReal
there is no locality issue here. AddAction is only executed on one machine and ace_medical_fnc_addDamageToUnit has global effects iirc.
Just name it _unitCapture2 π
*WorldVisualWorldReal2
Surely BIS_fnc_unitCaptureRealVirtuality
It's BI naming standard so we surely have to do BIS_fnc_captureUnit
Wait, BI have naming standards? π€―
we have standards?
What BI naming standards? Just look at the behaviour commands, their naming makes no sense at all
That was the joke
Couldn't resist linking
Hello i'm new in general to Arma and also to modding. I want to know if it's possible to have a specific weapon from a mod accept other magazines besides the default ones listed in the arsenal.
Not with scripting, you'd need to make a mod
BIS_fnc_unitCaptureRealFinalV2
Yeah I tried doing one with the Addon Maker and this config file but so far it's been fruitless
class G36_60rnd_Compat {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"CUP_Weapons_G36", "CUP_Weapons_Ammunition"};
};
};
class CfgMagazineWells {
class CUP_556x45_G36 {
magazines[] += {
"CUP_50Rnd_556x45_Galil_Mag",
"CUP_50Rnd_556x45_Red_Tracer_Galil_Mag",
"CUP_50Rnd_556x45_Green_Tracer_Galil_Mag",
"CUP_60Rnd_556x45_SureFire",
"CUP_60Rnd_556x45_SureFire_Tracer_Yellow",
"CUP_60Rnd_556x45_SureFire_Tracer_Red",
"CUP_60Rnd_556x45_SureFire_Tracer_Green"
};
};
};
Am I on the right track?
It's more of an #arma3_config, but you'd want to use something more unique than magazines for the magwell.
Magwells can have multiple arrays defined (usually 1 per mod / addon) and all of them will be used, so you could do like: Agux_G36_Compat[] = {"CUP_50Rnd_556x45_Galil_Mag", ...};
Gotcha, also I'm using addon builder, I've read its not the best tool for packing pbos but for something as simple as this there shouldn't be any problem right?
Yeah it will work fine
Ok ill be back in a bit, if you don't mind I will ask again in #arma3_config later if it's not working. Thanks for answering
One can hope, a getter and setter
Aren't commands turning player missing on purpuse, because of hackers? So they can't aimbot themself easily by a command?
I think you're missing some words
im pretty sure cheaters can easily find other ways lol
@pine garnet so i figured you can technicallly, at least as a setter, depending on what you're doing, apply a gesture that does what you want, but you're not gonna have fine control at all with that
and it still wont move the camera (well - you could use the cameraShake mode that allows for raw camera rotation)
anyway im wary of nagging for more scripting commands since i've already expressed wishes for like three-ish (changes included) in the last month lmao
You can see what replies I got here when I asked, but it did not quite help me.
yeah, i know what you mean - ultimately just doesnt exist atm π€· not sure it ever will cause as jouklik said it does kind of borderline a level of user control that you dont normally get with scripting commands
cheating concerns or otherewise
same reason you can't, for example, inject raw user input through scripting commands
a getter would be harmless, but that's me selfishly focusing on my own problem π
you can get the the camera orientation, locally on the players machine
Ye but that includes freelook, and weapondirection isnt always reliable if weapon is lowered
(Im being very pedantic here i know
)
You can script a laser pointer attachment onto your gun that works just about perfectly.
I'd think you can get weapon direction
Oh for sure - tho on my case its a question of "how much is the aim offset memory point being driven by the aim horizontal/vertical mask"
I.e deadzone + up/down
Meaning ai included not just players
How long is the duration, for this forcing the player to look particular direction? Why not just draw a symbol on the screen on the direction?
@pine garnet ^
(we have two separate things here, bruce is trying to set the player aim offset, im trying to get the engine aim offset)
Well sounds like you are trying to get some vector of the torso if lookdir and weapon dir are wrong?
for me - i had this conversation with ampersand on the ace discord, the short of it is: im trying to rotate a position vector in front of the player (for melee hit detection) with the pivot being the aim memory point - so if the AI or player aims up/down the scans are offset up/down respectively; eyedirection isn't reliable due to freelook and AI moving their head around constantly, weapondirection doesnt fit either because the weapon itself (depending on animation) is gonna be pointing all over the place, cameradirection wont work for AI and has the same freelook issue
the way arma does aim offsets is it basically rotates masked bones (which are certain spine bones with weights applied) around a memory point (aiming_axis), - the engine either rotates that memory point to rotate the spine (or only rotates the spine with that memory point as a pivot) and thus allowing for either deadzone (horizontal aim offset, if enabled in settings) or vertical aiming
now, i did try getting the selectionVectorDirAndUp on that memory point, however because the memory point is also driven by certain bones, it's never zeroed and always has some kind of rotational offset depending on which animation is playing, so you can't get a reliable "zero if no vertical offset applied -1 for down, +1 for up) etc
Well I guess azimuth is rather easy. But can you define precisely what the proper height angle should be? Like assume a magical command existed to give you that what would the result be of?
It seems like you want to reverse construct the equivalent of your direction of an arcade fps, which I guess I don't think arma has since it separates view from barrel from body.
well the engine has to have some sort of float that dictates how much (and in which direction) the aim mask should rotate the spine bones - access to that value would be sufficient
-1 for down, 1 for up, 0 for none, as an example
same goes for left/right
So basically like the torso. You want the forward facing tangent of the spine
@errant jasper actually, think of it like this; it's this command, but for spine looking up/down/left/right https://community.bistudio.com/wiki/getLeaning
leaning works on the same exact principle
it's a -1 to 1 value that rotates the bones based on a memory point pivot and mask
except instead of leaning it's "spine is being rotated down/up/left/right" instead of "spine is banked left/right" as is the case with leaning
leave it to me to dig into some niche feature 
i sit here being the voice of the rare species that is the animation-obsessed arma modder
When you think of it - the getters for aim offsets would be the x and z axis, getleaning already covers the y axis
Spine0 to 3 won't work solving perpendicular to align with dir?
if you mean getting their selectionVectorDirAndUp, no, the spine bones are gonna be pointing in different directions depending on the animation, in most cases even slightly down to begin with, so it's not reliable and doesn't represent the engine-driven aim offset
that'd only be applicable if every animation had their spine bones pointing perfectly forward, which is never the case
If you had this aim offset value what would you apply it to, to get the final result?
if it was a float, i'd have to experiment with the best method, but more than likely have to grab a few things alongside it, namely the limitGunMovement value of the anim, then the chosen blendAnims mask (to get the weights of the spine bones), then the max allowed aim offset for the cfgvehicles class of the unit, then the position of the scans in relation to the position of the aiming_axis memory point, from that calculate the final rotation degrees, convert that to a vector, and then apply the output rotation vector to pivot the actual position vector of the scan the correct amount
(off the top of my head at least, but the end result is rotating a position vector from a pivot point either up or down)
No I mean X combine-with aim offset = result-direction
What is X? Here?
Like I tell you aim offset is 8 degrees right and 3 degrees down, what do you apply this adjustment to?
so i have a position vector that's in front of the player that acts as the source of the raycasting; what i'd effectively be doing is offsetting that vector with the aiming_axis as the pivot point, meaning both its position and rotation will change as if the aiming_axis is driving it.... best way i can explain it is in a 3d program you can set the pivot point of an object you're rotating; rotating around that pivot makes that object move in a circle around the pivot; im doing the same thing
also i can't use degrees directly, i'd have to convert it to a vectorDir, (like converting getDir to vectorDir for example, except it'd involve Up in this case since it's pitch too, not just yaw) to properly rotate a vector
@errant jasper visual representation helps π (watch the black lines)
and yes i did think about using an empty object that is attachedTo the spine with followBoneRotation, problem goes back to selectionVectorDirAndUp - the spine itself is angled sideways and downwards in most Man animations, and as soon as movment starts (depending on the animation) you'll get even more offets and weird behaviour, so you're gonna end up with bad results
that's why the raw engine input on the aiming mask is cleaner
(also, to be quite honest, i can live without this, i didnt want this conversation to spiral beyond "this'd be cool to have", it's fun having a chat but i also don't wanna seem like im begging for implementation since i imagine if i tried hard enough i could cook up a heavily scripted workaround)
there are more important things to have lol
Yeah I see, why you would want the dead zone angles to pivot the point, and I guess arma doesn't give that.
Related though, 2/3 of people I played arma with set their dead zone to 0
oh yeh horizontal deadzone is meh π honestly i probably wouldn't even do the math for it - i'd probably just do the math for up/down (since that one still rotates the spine independently regardless of whether you use deadzone or not) to save up on some performance since deadzone would be so insignificant (at least in my usecase)
so you want something like "aimDirection"?
Ya either that or, to keep consistency with getLeaning, a float defining the magnitude of the aim offset (since its just two other axies of an identical spinal rotation masking)
Whatevers easier
hey, is it possible to make an AI in arma 3 drive a waypoint after i hit an specific trigger?
Yes, you can make trigger make groups skip waypoints or and hold waypoints.
mind teaching me how, i have looked everywhere, even got banned from arma reddit for questioning if it AIs where a good option for my own personal campaing
There's three main things to configure for triggers and one should have an option that skips/triggers a waypoint, IIRC.
When you right click a trigger, there should be an option to Set Waypoint Activation or something and you connect that to a waypoint like when you sync things.
hey, i have a question:
_infantryLineUnitsAvailable = _arrayOfGroups select {_x getVariable "groupType" in "InfantryRegular" == true && _x getVariable "groupStatus" == "IDLE"};
_infantryLineUnitsAvailableSorted = [_infantryLineUnitsAvailable, [], {leader _x distance _position}, "ASCEND"] call BIS_fnc_sortBy;
_selectedUnit = _infantryLineUnitsAvailableSorted select 0;
_selectedUnit;
i have this code snippet to select a certain type of group by distance to a position - it might happen that there is no such group.
if (_selectedUnit != grpNull)
then {
i also have this check to check if it returned a valid group - but i occasionally get the Error _selectedUnit #!= grpNull and claiming _selectedUnit is undefined.
if the array is empty, the return wont be grpNull - is this the cause for this error? if so, how else can i validate the return?
You need to do:
```sqf
With no spaces or new lines if you want the coloring.
yeah i noticed lol
in this code, do the original arrays get modified?
_original1 = [1, 2, 3];
_original2 = [4, 5, 6];
{
_pool = [];
{
if (count _x != 0) then {
_pool pushBack _x;
};
} forEach [_original1, _original2];
_item = (selectRandom _pool) deleteAt 0;
} forEach allPlayers;

π€·ββοΈ

NVM this goes on config
I feel like I'm going insane
private _drops = getMissionLayerEntities "droprandom"; // get list of random drop area spawnpoints
private _vics = units inAreaArray dropMajor; // get all units that are in a dummy trigger's area
"Debug_0"remoteExec ["systemChat",0]; // pseudobreakpoint, works fine
{
"Inner Loop" remoteExec ["systemChat",0]; // never fires
[_x,(_drops select _forEachIndex)] remoteExec ["SWS_fnc_blackout",_x]; // never fires, debug message inside never fires
} forEach _vics;
is "units inAreaArray triggerName" not how you grab that
....or is it just inArea, not inAreaArray
Ugh. Nevermind, I figured out an easier way. Just delay the activation by 3 seconds and make the trigger taller, then pass in the list using thisList. I guess I'm still curious what I was doing wrong but fuck it.
Do you need a delay if you just use thisList directly?
Because that's how you'd get all the objects that match the condition, inAreaArray is just returning everything
well it's a bunch of drop pods falling and the trigger is activated and I dont' want the first drop pod to fire before the last one is in the zone
so the delay is just to make sure they're all in the zone before they get scattered to the winds
Fair enough
You probably meant allUnits inAreaArray triggerName
units takes a group or side parameter.
hey, night, i am having some trouble with arma 3 coding, i cant seem to make an ai make a flyby via trigger and i am also having problems with the ai not driving or apparently not turning the vehicle on after i set its waypoint, does someone know which code or how to do it properly
I dunno, that sounds pretty normal :P
IIRC drivers won't turn on the engine until they've successfully calculated a path.
There are various ways that can fail, most of which are engine bugs.
Check that you can make a vehicle move with whatever method you're using in a simple example with minimal terrain first.
How do I get proper child classes (Inherited from another class that has the same child classes) in mission config?
class Squad1_W {
defaultSquad = 1;
type = 2;
name = "Default Squad";
team = SIDE_WEST;
class SL: DefaultRole_W {
availableAt = 0;
name = "Squad Leader";
abilities[] = {"RP"};
icon = "pra3\pra3_ui\kits\kit_img\sqleader_small_88.paa";
}
};
class Squad2_W: Squad1_W {
defaultSquad = 0;
name = "Squad 2";
};
Following only returns 2, because somehow it doesn't see the child classes (Config viewer does though)
count(missionConfigFile >> "PRA3_kits" >> "Squad2_W")
you're missing a ;
dude i spent 5 hours figgling around every code and vehicle XD
different variables names, etc
even not using tiggers at all
Yeah it's just not there in that scrap. It it is in my actual code.
The children still DO work for the record, it's just that I can't tell how many there are and can't do for loop through the children because they don't show up in the count
With that I mean
(missionConfigFile >> "PRA3_kits" >> "Squad2_W" >> "SL")
still has all the entries
are you on 1.54 stable or 1.55 and upwards ?
probably a bug, report it on the feedback tracker if there isn't a report already.
I guess it could potentially be related to stuff moving to missionAttributes instead of misson configs
Nah it's the same in stable
Okay that works, need isClass in this case, but thanks a lot π
ah misread that bit but yea
is it possible to hook into another mod? I want to the hook into the "Improved Melee System" mod and prevent it from force killing units if certain conditions are met.
Maybe maybe not, depends on "hook" mean, the way function works and the way Mod works
You can always rewrite the function to do so, or investigate the function carefully to inject other code there, but nothing can be said 100%, you need to just figure it out on your own
If you want more info on how to do what POLPOX said above, my advice would be to review this page here:
https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon
I don't create a whole lot of addons but I was able to work my way back to fixing a script error with one being incompatible with my missions CfgDisabledCommands by:
- Unpacking the mods PBOs in your addon folder.
- Making any required adjustments, then packing it all back up.
You may also have to use HEMTT to unbinarize files depending on the mod and what you're trying to do. I needed to use that as well when adjusting the specific mod I had conflicts with due to files being binarized as .bin.
so like this? it returns the aim direction and up (the first point is the direction, and second point is up)
oh heck yeah, exactly what i was thinking of π
if it gets approved you can expect it in 2.22 π€
awesome, cheers man π appreciate it!
Ok, make sure you have "show script errors" enabled in the launcher parameters, so you can at least tell the difference between broken code and broken AI. A crewed ground vehicle will usually move if you just give the crew group an easy waypoint.
Love that on-screen keyboard, is that from recording software you use or something public?
it's an OBS plugin
https://github.com/univrsal/input-overlay
using this one
"C:\Program Files\obs-studio\input_overlay\qwerty-pixel-with-keypad\qwerty-pixel-with-keypad.png"
"C:\Program Files\obs-studio\input_overlay\qwerty-pixel-with-keypad\qwerty-pixel-with-keypad.json"
Awesome, thank you
I found this weird code from my project not knowing how it ended up there XD sqf while { true } do { if(true) exitwith { continue; }; }; or something like that anyway. I wonder what actually happens when that code is ran?
Nothing lmao
i mean it doesnt do anything but how the loop behaves
Hey I just arrived here. Been making mission in arma 3 for a while now. Self taught off of YouTube mostly. I was looking for the mission creator channel. I was told that some mission creators to seek for guidance are Zhal and Nine. Anybody know where I could go?
it seems the continue overrides the effect of exitwith
There's #arma3_editor, #arma3_scenario, and here for scripting.
Iβm making a battle royale where 50 players drop onto the island from a Blackfish that flies overhead
A blackfish only holds 30 players.
Can I give each player their own local vehicle? Or will that cause issues?
Why not make it multiple in formation like for example Call of Duty Black Ops 4 Blackout mode?
I have reasons I guess
It would technically give some players an advantage
Would it be bad to create 50 blackfishes, each one local for a player?
I'd just make a local only simple object of the blackfish if its only going to be visual for the insert
Iβm interpolating its location across a straight path
Because I canβt get AI to fly straight and level
What do you mean simple object?
Is it supposed to be like the fortnite drop thing?
I.e. everyone's theoretically on the same blackfish and dropping at a certain point?
https://community.bistudio.com/wiki/createSimpleObject
Basically it's just the model with nothing else special about it
Well I need to the players to be inside it
Yeah I was thinking you were trying to do more of an airdrop thing, where a player spawns already freefalling
Weird bot
Maybe use https://community.bistudio.com/wiki/BIS_fnc_unitCapture and two blackfishes?
Just a random thought.
Yeah but I also wanna be able to increase the player count to 100, and then Iβd need 4 blackfishes
He might want a random flight path for it as well
I want the player count to be scaleable
It is scaleable, a blackfisch for every 30 players xD
With this requirements you will have no other choice, doubt there are even mods where you could put 100 players into one aircraft.
This might be a little jank, but maybe you could just attach all the players to the blackfish and switch them to third person (I'm pretty sure there's a command for that at least) and hide them?
Then you could add an addAction with the GetOut shortcut so people can press V (or scrollwheel) to exit, which would unhide them and setPos them to a freefalling point
I am specifically asking about creating local blackfishes
Would it work to give each player their own local blackfish, and then locally interpolate them all across the same flight path?
Units are all global. I wonder how it looks when player is in local vehicle
Theyβd probably be floating. I would hide players from each other while theyβre in the vehicle
If visuals don't matter (players seeing each other in the plane etc), you can still just take one aircraft and just spawn/port them on pressing "eject", add some velocity and good to go.
Watch the plane till eject via cameras https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control.
I'm not sure how createVehicleLocal handles vehicles, but if it worked I think you could make a local one on each machine
Wiki mentions that bullets get created on all clients, I wouldn't be shocked if other things worked like that.
So maybe you could createVehicleLocal and set the mass to a really low number to prevent collisions if they do hit each other
Ok
Hello guys - "don't shoot me down in flames ;)". Looking for a framework for a Life Mod. Past coder has let me down. Naturally i'd prefer not to pay anything. But what will be will be- Anyone interested in ?
If they are local, then how would they hit each other?
Wiki mentions that bullets get created on all clients, I wouldn't be shocked if other things worked like that.
If this was true for vehicles
Hidden agents only have collision where they are local
It's not an agent, it'd be the whole blackfish
If vehicles would get created locally and player entered his local vehicle. Would he appear in all other local vehicles? π€£
@lone glade @austere granite that count is not counting children is normal behaviour
only the class operators (eg >>) resolve it 100% correctly
If you have a local object that can affect the state of a global object, then you can break the simulation. I wonder how Arma solves this.
so i was revisiting some old code and it has now broken
I feel ive messed something up somewhere but:
_trainObj setVelocityTransformation
[
_currentPos,
_surfacePos,
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
_interval
];
if (_interval >= 1) then {
_interval = 0;
_trainObj setVariable ["FLCSL_interval", _interval, true];
_currentIndex = _nextIndex;
_nextIndex = spline select 12;
_interval = 0;
_args set [1, _interval];
_args set [8, _nextIndex];
};
},
_interval isnt resetting in this CBA perframe handler
only just added the _args set, still doesnt work
pls post more code
params ["_trainObj"];
_currentIndex = spline select 0;
_nextIndex = spline select 1;
_interval = 0;
_surfacePos = [0,0,0];
_currentVectorDir = [0,0,0];
_nextVectorDir = [0,0,0];
_currentVectorUp = [0,0,0];
_nextVectorUp = [0,0,0];
_currentPos = getposASL _trainObj;
_handler = [{
params ["_args", "_handle"];
_args params ["_trainObj", "_interval","_currentPos","_surfacePos","_currentVectorDir","_nextVectorDir","_currentVectorUp","_nextVectorUp","_nextindex"];
if (!isMultiplayer && isGamePaused) exitWith {};
_speed = _trainObj getVariable "FLCSL_trainThrust";
_interval = _interval + _speed;
_trainObj setVariable ["FLCSL_interval", _interval, true];
if (_speed == 0) exitWith {};
_surface = lineIntersectsSurfaces [getPosASL _nextIndex vectorAdd [0,0,5], getPosASL _nextIndex vectorAdd [0,0,-8], _trainObj, objNull, true, -1, "FIRE", "GEOM", true];
_surfacePos = ((_surface select 0) select 0);
createvehicle ["Sign_Arrow_Large_F", _surfacePos,[],0,"CAN_COLLIDE"];
systemchat format ["_nextIndex: %1",_nextIndex];
systemchat format ["_interval: %1",_interval];
_trainObj setVelocityTransformation
[
_currentPos,
_surfacePos,
[0,0,0],
[0,0,0],
[0,0,0], //train carriage
[0,0,0], //train carriage
[0,0,0],
[0,0,0],
_interval
];
if (_interval >= 1) then {
_interval = 0;
_trainObj setVariable ["FLCSL_interval", _interval, true];
_currentIndex = _nextIndex;
_nextIndex = spline select 12;
_interval = 0;
_args set [1, _interval];
_args set [8, _nextIndex];
};
},
0,
[_trainObj, _interval,_currentPos,_surfacePos,_currentVectorDir,_nextVectorDir,_currentVectorUp,_nextVectorUp,_nextindex]]
call CBA_fnc_addPerFrameHandler;
with enough systemchat debug you can figure what part doesnt work. id start from _trainObj π
everything runs, just the interval doesnt update
so it goes to the target but the if statement doesnt fire
its driving me insane and i think im missing something small
usually is
it ticks over 1 happy as day but doesnt reset
ive cannibalised this to pieces trying to figure it out
interval works when a global variable, why on earth doesnt it pass properly?
I wanted to see how it behaves, when you create local vehicle using createVehicleLocal. Result is kinda funny. You can just walk into place where other player has local vehicle and interestingly the other player will see you next the vehicle, rather than standing in middle of it and clipping through it
Just in case something truly bizarre is going on inside commands, have you tried some unlikely name like _blarg instead of _interval?
I've been using PFH a lot, and the last part of the code you're trying to update the _args array, Idk how that works, try to use just that set/getvariable for the _interval, if you want to update it
damn
yeah was just about to say
You only ever update to 0 when it is greater than 1, so you only see 0
nah, it would go to like 1.9, even 20 etc and never reset
because i was multiplying it with keybinds and it wouldnt reset so it would just read off that
right, time to go back to the actual code now that i had that mental breakdown over _arg updates
Well yeah, inside the handling itself, but the state moved around (over iterations) was never updated to anything but 0
You seem to be using commands with global effect, like setVelocityTransformation and createVehicle. May I ask what you are using FLCSL_interval for outside the handler since you broadcast it so much?
any way to make mortar fire a bit more spread out?
one barrage (8 rounds) from Taliban mortar devastates USA fob π
mortar1G doArtilleryFire [[3852.04,17831.7,0], "8Rnd_82mm_Mo_shells", 8];
I don't want to make the range bigger because I want players to go out on foot and hunt down the enemy mortar crew ...
fire one round at a time and make target pos random?
@proven charm I came up with this, its working quite well, usually only one/two rounds hit the fob inside,
the others are just spread around creating more fear then real damage
for "_i" from 0 to 7 do
{
private _impact = [[3846.1,17829.3,0], 0, 100] call BIS_fnc_findSafePos;
mortar1G doArtilleryFire [_impact, "8Rnd_82mm_Mo_shells", 1];
sleep 5;
};
findSafePos 
Conventionally you'd just do something like _centerPos getPos [random _radius, sqrt 360]
If you want the shots spread evenly over the area rather than over the radius then _radius * sqrt random 1 instead.
yes π actually I was thinking to add object distance so it hit mostly open spaces, making them more deadly
and I suck in math π€«
tbh you don't need to make vanilla mortars more deadly
I mean the open spaces π
It's generally true with random placement anyway. The more objects you have around you then the safer you are from Arma explosions.
At least until those objects explode :P
lots of ammo crates in the fob, when a mortar shell hits the boxes, it start to get ugly, I have the ACE crate cooking ON π₯
normally they have them in a concrete shelter I think
Donβt suppose anyone would be able to help, Iβm looking for a script that will teleport my ai squad into a vehicle that Iβm in? Something that I can activate at any point.
Still trying to do a singleplayer sandbox based on a carrier but ai loose their minds when I tell them to get into the helo so figured I could spawn them and then have a scroll wheel action to teleport them in?
If you want the rounds to hit all around the FOB, but not hit it, you would use something like this. This would spread rounds 50-100 meters around the FOB.
0 = [] spawn
{
_ammo = getArtilleryAmmo [mortar1G ] select 0;
_rounds = 8;
while {_rounds>0} do {
_dir = round random 360;
_dis = [50, 100] call BIS_fnc_randomInt;
_tgt = your_FOB_pos getRelPos [_dis, _dir];
mortar1G doArtilleryFire[_tgt,_ammo,1];
_rounds = _rounds - 1;
sleep 10;
};
};
You could try using a repeatable radio trigger, and use this.
{_x assignAsCargo vehicle player; _x moveInCargo vehicle player}forEach units Group player;
Will give it a try thank you
Worked perfectly thank you
its been cut, was originally for something else i removed
got a new problem now π reversing sends it to oblivion after a single correct movement
count and select ignore inherited config entires / classes
So does configClasses
Which is why it's best to use what cptnnick posted
that count is not counting children is normal behaviour
tbh, it isn't exactly what one would expect. It's needed to stay that way for BWC though.
Thank god configProperties does exist now. What a PITA it would be otherwise. Poor ACE2 devs
hey, i got a question:
i wanted to use on a server playSound "sound"; but this only plays the sound client side. is there a way to play a sound so that every player can hear it in the area?
Wasnt able to send it in chat normally, I hope this works too.
Basisicly what im trying is giving a vehicle APS (active protection system)
It works all fine in single player, but when I tested it on a public zeus server, the intercepting duplicates.
So im loosing 2-3, maybe even 4 APS shots per missile.
I tried remoteExecing to 0, wich also caused duplication; and to only the vehicle, like I did here but nothing worked.
Why do you remote executing addEventHandler?
From where are you executing this code? It may be running on multiple machines
This EH takes global argument, so you could just add it on server. There is no need to remote execute anything
i had a similar bug when i was writing my own APS, although the mechanism is a bit different here
When I didnt remoteExec it and another player fired at the tank (vehicle player), the eventhandler didnt fire at all
or maybe the 2D version if there is one
Thats the reason im remoteExecing it
So I kinda end up with this problem where not remotexecing it does nothing, and remoteExecing it causes duplication
Also sry for the late reply
If it causes duplication, then it probably runs on multiple machines
Since I checked the code and it should run once, if it's called just once
triggerAmmo only works on projectiles local to the client (local arg in wiki), but your code doesn't have a condition for that, so you have multiple clients trying to trigger the same ammo even if only one client is capable of doing it
When I tested it on a server earlier where I was alone, I used 0 first, so yeah, server + me. After that I used _tonk for the remoteExec target in hopes of fixing that, but unfortunatly didnt work
Ah I see. So it needs to run everywhere, but do nothing if _missile on not local
Still no need for remote execution
the IncomingMissile EH is also somewhat limiting, it can fire multiple times per projectile and won't fire for dumb-fired rockets from players (i.e. players need to obtain a lock and fire for the EH to be triggered)
Im aware that it doesn't fire for unguided missiles, and guided missiles wich weren't locked. But why does it fire multiple times per missile?
Is that just a game engine thing?
afaik yeah, you can test it with a titan mprl compact, it triggers once for the initial launch, and then triggers a second time just before impact
i think medium/long-range AA does it too, if you break the lock and the missile re-acquires you
I haven't noticed that in singleplayer tho, the duplication only occured when I went into MP and used remoteExec.
"triggerAmmo only works on projectiles local to the client", also about that, should I leave the eventhandler local then and just remoteExec triggerAmmo?
for my APS implementation, i had set up so every client calculates potential impacts for their own, local projectiles, and aren't concerned with projectiles from other clients
I would add EH everywhere, where _missile can be local. Check for locality and do nothing if it's not local
you'll have a very tight timeframe to explode/delete a projectile before it actually impacts the vehicle, and it tends to take a while for the remote client to receive your command to trigger it
Realistically, a guided missile, short of a barrel, might be one fired, event, then two more for a tandem warhead.
But I guess we are talking vanilla Arma?
Vanilla yeah
I figured I'd have to do something like that for unguided rockets, but I honestly would have no idea how to do that
Can we add variables to missiles using setVariable?
if you're tired of dealing with EH locality (at least in cases where an EH would ideally be only on the machine to which the object is local) what you could do (what i did at least) is create a wrapper that essentially adds an EH to whichever machine the object is local, and then transfers the EH to another machine upon locality change - you never have to worry about remote execing it or adding it globally for safety (unless it must be global)
what the
the hell was that bot lmao
fake support selfbot?
uuh... i dont know but im a bit concerned now given it responded directly to me immediately as i send that
What exactly does "local" mean here, I know this is a rather dumb question but if for exmaple I use createVehicle, the vehicle is local for me, but remote for someone else? is that what that is?
yeah pretty much - an object is local to whichever machine created it, or whichever machine controls it - for example the player is always local to its own machine, a created vehicle is local to whichever machine created it UNTIL someone enters that vehicle, then its gonna be local to the driver
Ah I see
you can think locality as "which machine has control over it" in a sense
so the missile is remote to everyone but the one that fired it from my understanding?
i dont deal with projectiles much, but more than likely yes, it'd be odd if it was server-local, it has to be local to the firer
you can always check locality with the owner command
you can have a look at my implementation if it helps give you ideas:
https://github.com/Warriors-Haven-Gaming/WHFramework/blob/main/WHFramework.Altis/Functions/APS/fn_simulateAPSLoop.sqf
it's not designed for public zeus, but the gist is this:
- every client looks for APS-supported vehicles (both local and remote)
- every client finds their local projectiles in proximity of each vehicle, at a rate of ~30ms
- clients delete their projectiles and decrements the APS ammo counter of the vehicle
it doesn't rely on IncomingMissile so it works for unguided player rockets, but at an extra cost to performance since all clients need to loop through every projectile around each vehicle
I havent read trough all of it, but are you calculating if the projectile will hit the vehicle, or just intercept any missile in the radius?
oh nvm, I assume the lineIntersectsObjs is what you are using?
ye there's that too, WHF_fnc_nearAPSTargets returns every local projectile within range of a vehicle, and WHF_fnc_checkAPSTargetPaths filters through that list with lineIntersectsObjs to see which of those projectiles will impact the vehicle
So this is used to create an imaginary line to where the rocket will land?
private _scale = WHF_aps_rate * WHF_aps_distance;
private _vectors = _projectiles apply {
private _begPos = getPosASL _x;
private _endPos = _begPos vectorAdd (velocity _x vectorMultiply _scale);
[_begPos, _endPos, _x, objNull, false, 16]
};
And this tests if the imaginary line has contact with the tank?
private _threats = [];
{
if !(_vehicle in _x) then {continue};
_threats pushBack _projectiles # _forEachIndex;
} forEach lineIntersectsObjs [_vectors];
yeah, for every projectile in range, draw a line in front of it based on it's velocity (and how frequently the APS loops), and only return the ones that intersect with the vehicle
!sqf
```sqf
// your code here
hint "good!";
```
β turns into β
// your code here
hint "good!";
im aware, I was just to lazy
Well, that fine. Just like I'm lazy to read unformatted mess
Nah I totally get it, It was just that it was a question directly to gamecracks and he knows his own code
PCML is the one missile that my APS can't correctly intercept because it does overfly top-attack (i.e. it flies above the vehicle and detonates rather than trying to impact it), but everything else it does alright with, even titan AT in top-down while driving erratically
yeah I see, might just use a system like you have then instead of the incomming missile EH.
Either way, I appricate the help from yall, thanks a lot
Also cool stuff you got there, no idea if you have published it yet, but it deffently looks interesting, good luck with that project
@young current hey could you please check the audit log and see the name of that thing again? the bot's message was removed but idk if it was on this server or if it's something tied to my account (i dont appear to have anything like that but i wanna make sure)
(Happened around the time of the replied message)
I believe it was a new form of scammy invite spam
gotcha, it was just extremely unnerving it decided to reply to only me exactly as i send my message, and nowhere else
usually see these spamming channels all over the place
spammy bot I think
the thing is playSound3D doesn't seem to work whith CFGsounds
it gives me the error
Audio Stream: Cannot load sound 'sound'
yeah but that would all only be local
Does anyone have a script that forces helicopters to have ejection seats?
So execute it remote to all clients
remoteExec
Or BIS_fnc_MP which is now a wrapper for it
thank you both for answering. ill have a look π
A lot of arma commands only have local effects. Knowing how to execute code remotely is important if you want to script for MP missions
is there a way to hide a specific object using the debug console in the editor? I have tried objectName hideObject true; and objectname hideObjectGlobal true; without success
object hideobject true; should work fine
I believe hideobjectglobal is broken in sp though (unless it's been fixed)
hmm it must be the class name of the object then i guess. is there a way to get the class name while looking at it?
easiest path would be to give the object a name in the editor and refer to it later in the debug console. Other than that cursorTarget might be helpful
hint (typeOf cursorTarget); get's the classname of the object you are looking at
Hey guys,
Does anyone know if there is a method for scaling objects that are global on client side only? Since making the objects local isn't really an option and the scaling seems to be not very stable for each machine. Or having JIP issues..
there is https://community.bistudio.com/wiki/setObjectScale but it only works on simple objects, maybe you already tried that
I am using this, yes. But semi simple objects. 50% they are and 50% they are not. In general works for both but yeah not very stable/synchron in multiplayer.
And yeah I want as less network traffic as possible. Since there can be multiple thousands of these objects. But these are also dynamic and can/will change their states and also positions/scales which is managed serversided. And to not overcomplicate it I went for global objects. I mean performance wise it would not be an issue to change that but can be a bit too much effort for that and yeah I can ofc just reupdate the states of all these objects on each new player connection (which I already kinda do - for the simple objects) but yeah the vehicles seem to have that too. Mostly (80%) it is working but yeah not always.. Might be related to some other issue since they do have some weird behaviour where groups mostly behave the same so if it is not working then the whole group prob because of the mother/attached obj position hasn't been accurate loaded by arma or so. Kinda feels like that's the main issue but prob not much I can do about that either? Or would you increase join times for just that? To be sure it is correct loaded? Or any better guesses?
the only way i see this working 100% locally is if you manage it locally too - you can't have serverside management of position/scale and not have to transfer that same position/scale data to other clients
also you could just attach the scaled objects to empties and move the empties so you dont have to change the scale every time it's moved (since moving scaled objects resets the scale iirc)
ok sad. Thought since attached objects are not physically handled as far as I remember I thought there might be an option for that.
when I scale the obj which they are attached to, the attached objs do scale, too?
but I have to scale and set positions of each obj individually
so that wouldn't really help
no the idea is an attached object does not need to have constant scale changes when its parent moves, unlike when it itself moves - so you attach the object to an invisible one, and move that invisible object - then you dont need to keep reapplying scale
nope, that's why it's attached
the parrent is static (mostly) - can just be moved or deleted by players - but the attached objects do scale and change their positions.
okay so where i'm getting at is - to avoid sending scaling data over network on each frame (assuming the objects are meant to move each frame and you're doing that to avoid them being scaled back to their original scale when moved) - you can attach those objects to invisible objects, so you only need to scale them once
you then move the invisible objects, not the actual objects (the actual objects will move with the invisible ones because they are attached)
and you dont need to keep setting the scale
I am a bit confused. The objects are not moving in any way just getting bigger/and changing their position (instant) when doing so. But also can get smaller again so opposite way.
(growing plants within a grow box)
moving/position changes, same thing, it resets their scale when their position changes, right?
yes
so
in order to avoid having to constantly keep changing scale back to what you want, you can attach it
let's say your growing plant is object1
you make a fake "object1_dummy" object, empty helipad or something
you then attach object1 to object1_dummy
and then you scale object1 to the scale you want
you then change the position of object1_dummy wherever you want - because object1 is attached to object1_dummy, it will follow it, but the key part here is that attached objects do not reset scale when their position changes due to their parent moving, therefore you dont need to spam setObjectScale anymore
But I have to reposition it with each scale process
since it would not be very accurate from its position
so it's the same result
(see pictures I have sent you per dm ;))
since just scaling them would lead into floating objects or objs which are stuck in the ground. So I heavy rely on mixing scaling and height changes
And the issue is JIP. Since this is already working. (the positions and scales of objs are not jip compatible or safe to use with that)
params ["_visualPlants","_curScale","_selRequesterId"];
sleep 0.25;
[_visualPlants,_curScale] remoteExec ["maltisCore_fnc_setObjScale",_selRequesterId,false];
};```
For simple objs I already use this workaround. But yeah I guess just scales the obj again (on the client). But should be global anyway? But yeah using this serversided didn't work for the client which has just joined so I had to use this.
hideObject doesnt take classnames as argument
mmm... so i thought you were trying to avoid the scale reset on position change to avoid spamming setObjectScale to save on network performance (i kinda fixated on that rather than the separate JIP issue)
but i see you're probably just trying to scale over time, so this doesn't apply
but how if that is always the case on repositioning?
i explained π - you attach it to something
when you attach an object, its scale doesnt reset when the position of the parent changes, but that's not important to the JIP issue
no, you change the position of the parent object
the attached object moves with the parent object
I do not change the parent pos. The attached objects do change scale AND positions.
except the attached object won't reset scale
I'm confused.
If you re-scale every 0.25s why do you care about JIP? From the time the JIP gets control of their player a new update has already been sent.
Also sending update every 0.25 is likely terrible if you plan to have "multiple thousands of these objects".
Unlike normal object movement I question whether the engine optimizes these scripting mutations similarly.
the obj which they are attached to is static all the time.
yes but what im trying to explain to you is that if you move the parent object (the object to which you attached your object) - the attached object will not reset the scale, but will move with the parent
no 0.25 sec after the player has requested (due join porgress) I sent the data to this player once.
im not sure how else to explain this 
I rescale / position the object dependent on the grow state of the plants.
or if players take the material
How often does a particular plant change state (size, position, anything) ?
like every few hours unless no player is doing stuff with it.
3-6 hours
or even more
(depending on how much space the obj has and how much visual stages are defined for it)
and yeah grow speed I guess
Okay, but it is like minutes between unless player-interacts directly.
So 100 players could do stuff to 100 plants almost all the time, otherwise, many minutes between updates?
the max refresh rate per grow box is ~5sec.
if a player would fill/empty it all the time this would be the max rate it would update.
I see two considerations
1: How to ensure performance. Suppose 100 players interact and max refresh is 5s then 20 per second is worst case (but also the "cost of doing business"). Add to that another 2000 of objects that interact say every 5 minutes, that's ~7 per second, but less if they grow slower. That can properly work, but not ideal.
2: How to ensure JIP. I guess setObjectScale is not JIP propagated? So upon JIP join have the server launch a script that gathers all plants in an array, sorts it by distance to JIP player, and update X amount per second.
well yeah I admit the whole system could def be more net optimized by simply making the visual plant handling client sided/local. Which also is like the easiest option since it just would require the script to be run on client instead of server. But then the client also has to know the code I guess. π
- Yeah that's what I am kinda doing now or did. I thought it is just for simple objects/non editor objects. So I adjusted that and yeah it works. But for "createVehicle" spawned items it seems to work to 80% but yeah not 100%. So I was wonderring if for these 20% would be a more optimized version to do that. Instead of sending/scaling all plants. But prob not.
Also these objects do make +75% of all objects (since they have not 2-3 plants per box more like 12) so I wanted to try if it is required there first. But seems like it :/
createVehicle is a more "complete"-object creation tool simulation-wise. But I think 2000 extra of those will have undesirable engine consequences.
yeah will find out π
I mean I can go for less plants if. 12 -> 9 -> 6 -> 4 ...
Also this is just the plant system. Prob the building system has even more impact π
There is also createVehicleLocal, but that gives a host of other considerations, and management to do on top.
could not test enough yet to tell how good performance is especially with player counts over 40 (at once)
But yeah I do have many functional objects this would prob overcomplicate stuff.
But yeah you're def right for best network performance you should do it that way π
I don't know if this is feasible. If you control 3d model, make "animations" that grow the plants. Then only the animation changes have to be synced. I don't know if this will work, or if Arma accurately syncs long-running animations.
The first question is: @bronze trellis , what are you trying to hide?
if it doesnt, you can technically start an animation halfway through its phase (at least with men, pretty sure it's the same with objects) - so you can just ask the server upon joining how long it's been
Don't ask, just let the server set the start time as a public setvariable on the plant.
Mh I don't have experience with making 3d model animations for arma 3 yet. So idk if that would be very sensible for me.
Prob will consider doing it locally then. But yeah kind of a special problem I guess. Thanks for your help so far might to test some stuff now.
I mean no work needed for changing it to local. But yeah as said the files then are also exposed I guess. The usual arma scripting trade off π
maybe I will send the script as package but idk π
@indigo snow its just a wall
So its a map object without a classname?
its a buildding on altis i dont know the classname
Yes but it is on the map by default?
yes
Hey fellows,
Im question my learning at the moment. Im creating a trigger with
remoteScopeTarget1 = 2;
[[], "EBER\Erweiterungen\SupportCivilians\SupportCharity\sendfood1\Hijack\Ereignisse\createTrigger.sqf"] remoteExec ["execVM", remoteScopeTarget1];
```sqf
The trigger gets created with
```sqf
HijakSupport2Trigger = createTrigger ["EmptyDetector", (getPosATL SendFoodHijakRubikon), false];
HijakSupport2Trigger setTriggerArea [200,200,0,false,10];
HijakSupport2Trigger setTriggerActivation ["ANYPLAYER", "PRESENT", false];
HijakSupport2Trigger setTriggerStatements ["(this) && (time > 5)", ['EBER\Erweiterungen\SupportCivilians\SupportCharity\sendfood1\Hijack\Einheiten\Support1.sqf'] remoteExec ['execVM', remoteScopeTarget1], ""];
HijakSupport2Trigger setTriggerInterval 3;
publicVariable "HijakSupport2Trigger";
The problem; It fires instantly without any players present
You cant hideObject those
Thats where the things getting to much for me...
Maybe Im just to long on this and the issue iss obvious, but I cant detect any issues
Youll have to simply damage it
iirc you have to add the players present condition to the active trigger statements. So something like listPlayers was available or just make a manual check. - but to be fair haven't used triggers for years and not much too. But you could at least try this and if it fixes the issue yeah..
Fix setTriggerStatements parameters.
this = firesTrue
thanks a lot. Maybe I should touch some grass
Plus remoteScopeTarget1 in the trigger statement is undefined.
Thats defined in initServer so I can switch all Targets at once. For example LAN = 2 | Server = 'HC1'
Its for testing etc. In that way., I learned scopes better
(I know isServer)
Do arma triggers do use some kind of automated downscaling of trigger intervals if targets are too far away or so? I guess not? Just curious.
side (group _x)
You can use SQF syntax highlighting. If you do that, the mistake is a bit more obvious because you'll see that whats supposed to be a string isn't.
HijakSupport2Trigger setTriggerStatements ["(this) && (time > 5)", ['EBER\Erweiterungen\SupportCivilians\SupportCharity\sendfood1\Hijack\Einheiten\Support1.sqf'] remoteExec ['execVM', remoteScopeTarget1], ""];
Wait what, Im using SQF Highlight, we installed it together
I gues Im leaving my Notepad++ love soon...
Time for visualStudio
```sqf
// your code here
hint "good!";
```
β turns into β
// your code here
hint "good!";
Ouuuu π€¦ (Ive changed it)
ah ok, that makes sense. and if i placed the object in the editor?
I wouldn't use strings in not simple code snippets, instead I would write so:
HijakSupport2Trigger setTriggerStatements ([
{ this && { time > 5 } },
{
"EBER\Erweiterungen\SupportCivilians\SupportCharity\sendfood1\Hijack\Einheiten\Support1.sqf" remoteExec [
"execVM",
remoteScopeTarget1
];
},
{ }
]) apply { toString _x };
Last Commit: 2 years ago
apply { toString _x} is new for me. Ill read about
I personally use Hemtt vscode extension - does a very good job at identifying problems and has all the sqf command syntaxes up to date
dafuq -> Is it translating numbers in the matching position of Unicode table?
Then you can reference that object, since it will have a classname
Yeah, I mean there's definitely more up to date ones:
That's just the only one I've ran to be able to recommend.
Yes, but I used alt syntax.
Either name it or find some other way to refer to it
HEMTT will (soon) auto optimize away
toString { code }
But it will not optimize this
[{ code }] apply { toString _x } construct
I also think its easier to read without the array apply
For me, syntax highlighting is more important.
Hemtt just parses wiki, so it's nice when new syntaxes get added
Okay so your executing the code and bring it into the right Syntax
You need toString because your executing code in an Array wich result is given to "toString" where it becomes usable.
-> Geniues
No, the code is not being executed here
Ah that way, the apply is executed yes, the code inside the array no.
this is so confusing to me
HijakSupport2Trigger setTriggerStatements [
toString { this && { time > 5 } },
toString {
"EBER\Erweiterungen\SupportCivilians\SupportCharity\sendfood1\Hijack\Einheiten\Support1.sqf" remoteExec [
"execVM",
remoteScopeTarget1
];
},
toString { }
];
This is so much easier to read, HEMTT will optimize it, and it still has the syntax highlighting you want
But this contains duplicates... π
It will also run faster, because it doesn't need the apply loop.
Yes its a bit more to copy paste the toString multiple times.. but that's also easier than the parenthesis and writing a loop
Is there a diffrence between str and toString? (I gues its that I can play itterations throught magic varss)
Ah okay. I had no idea you could use it for Syntax highlighting. I'll have to check it out again
str includes the {} in the string, which you don't want.
toString only puts the contents of the code block into the string, so everything inside the {}
So much of our stuff is automated via CICD I don't ever really have to open Arma 3 tools or browse for new programs, probably a lot we could be doing better even in terms of faster PBO packing or whatever
# Check for errors without building
hemtt check
Ayo???! If that's what I think it is, I'm adding that into our CICD immediately
It checks for errors
Yeah that's super sick
Our repo has a "tested locally" tag that on occasion gets abused π₯² lmao
-# Tbf myself included. Easy to toss up one last commit before push after the locals already been closed
You can basically let that run with a workflow on each PR.
Dont want to abuse your time but Ive another simple question.
Why is my guard not killing the victim?
while {alive SendFoodHijackMurder
} do {
sleep 1;
systemChat "MurderUnitAlive";
};
if (!alive SendFoodHijackMurder
) then {
SendFoodHijakGuard reveal SendFoodHijackVictim;
sleep 0.3;
SendFoodHijakGuard doTarget SendFoodHijackVictim;
sleep 0.3;
SendFoodHijakGuard doFire SendFoodHijackVictim;
systemChat "killTrigger";
};
The murder unit triggers the guard to kill the victim becauses that means the players are really close to secure the hostage.
The trigger also gets activated. "killTrigger" is sent to the chat
AI doesn't want to shoot civilians
Ill switch faction. Thanks alot
Joining him to group of side, which is enemy of the guard, is one way to do it, yeah.
ok cool
Can also use -e --pedantic to check for more things and make all warnings/helps be errors
I am currently trying to set it up with Github actions within our repo and I will say I am struggling. Currently following the documentation here:
https://hemtt.dev/configuration/index.html#minimum-configuration
Checks will pass even if an error exists, and I'm guessing it's due to misconfiguration on my end. Right now I am trying to use it on a folder with a mission and server addon. I.E:
- Main Folder
- Client Mission
- etc files
- Server Addon
- etc files
Anyone able to provide any advice as to what I might be doing wrong? I've only made a few addons, and am more familiar with mission making; so it could be something extremely basic.
Everything you need to build Arma 3 mods with HEMTT
Project needs to be set up as:
.hemtt
- project.toml
addons
- addon 1
- addon 2
- addon 3
Gotcha- I do have the .hemtt\project.toml. For the addons folder you mention, are you saying it would be required to store my mission in there in order for it to work?
I would say you can take the sample from ACE github, which runs hemtt actions.
But I don't see them running hemtt check
Good idea though to search for an existing repo
They are running a full hemtt build on every PR
They just use build
https://github.com/acemod/ACE3/blob/master/.github/workflows/hemtt.yml#L39
Yeah
Yeah, you can package missions with a mod
E.g. ace's ACE Arsenal mission
Hemtt's only going to be checking for things in the addons folder
Sick, running on PRs is exactly what I am wanting to do. I'll give what ACE does a study and try to implement in the meantime and reach out here if I am still struggling. Appreciate your guys help
This is what we use if you're looking for something
name: Build
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check:
# Tool PRs don't need to build the mod
if: |
contains(github.event.pull_request.labels.*.name, 'area/tools') == false &&
contains(github.event.pull_request.labels.*.name, 'kind/documenation') == false &&
contains(github.event.pull_request.labels.*.name, 'disable-workflows') == false
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
with:
submodules: true
- name: Check for BOM
uses: arma-actions/bom-check@master
- name: Validate Config
run: python tools/config_style_checker.py
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run HEMTT check
run: hemtt check -e --pedantic
I think the BOM one is unecessary now, hemtt checks for BOM characters as well and I just hadn't been bothered to remove it
You forgot to include the value of ${{ secrets.GITHUB_TOKEN }}
-# I am joking :D
Cheers though for that too π
Never seen it before, but might need to modify it on our end due to the custom commands potentially saying there are errors lmao
Hahaha I haven't even gotten to that, but you're totally right.
I think I am finally kinda getting the handle of it though. That ACE example earlier was super helpful. If I am understanding correctly I should be able to xcopy to the format it expects in the action.
You can configure custom commands on project level. You just need to provide the syntax docs. I've seen someone do that before
Everything you need to build Arma 3 mods with HEMTT
Okay so I am still kinda far away at getting my action setup the way it needs to be to work, but quick question. I saw this in the ACE repo:
- name: Install Arma 3 Tools
uses: arma-actions/arma3-tools@master
with:
toolsUrl: ${{ secrets.ARMA3_TOOLS_URL }}
I am also getting tossed this in my job:
warning[BBW1]: Arma 3 Tools not found.
TRACE writing ci annotations to .hemttout/ci_annotations.txt
= help: Install Arma 3 Tools from Steam and run them at least once.
Do I need this? I would assume for the sake of just error checking and not building I wouldn't but wanted to confirm.
Also if I do need this, what zip for arma3tools would I need to host?
Ah okay yeah that might've been a dumb question, sorry.
Check shouldn't need indeef
I am just being stupid right now. Not that I don't have familiarity with Github Actions but this is the first time I am creating one of my own, and I have been trying to one shot it through there when really I should be building using HEMTT locally, then work on actually transferring that to an action. I just need to actually have patience and do it right lmao
Okay I think I got it working locally. It's complaining about a lot of stuff, so probably gonna be another hill to climb over but at leasat now I think I know what to do.
Thank you all again for your help 
how to make hmg toyota move and suppress ?
while {true} do
{
toy1G doSuppressiveFire (leader delta);
sleep 20;
};
this make them stop and they suppress IF they have good view to leader delta
but they don't move to any other waypoint π
Brauch mate fΓΌr Fuchs bin igl habe 50 pr bin gut er igl
how can I disable simulation on a storage crate to prevent it from bugging out, without preventing players from interacting with the inventory?
You could attachit to something so it stops being able to simulate physX if thats what you mean by bugging out
In the init of your crate,
[this, someHelipad, false] call bis_fnc_attachToRelative;
I use helipads as invisible attachment point objects
So if I have a script that creates a bunch of crates around the map, I can create an invisible helipad under each one, disable simulation on the helipad, and attach the crate to it?
Yes
Ok thanks
Dont even have to disable simulation on the helipad (if you dont want to. I would tho, just cause)
Why to use helipad over game logic object, if all I want is object to attach something?
Use a game logic instead, invisible helipad is just the old way
do you need help? (English please)
Neat info on the game logic object. Been a long while since I've needed to create a placeholder object but helipad or sphere is always what I used to do
why attach at all? just set its position
Conversation implied that they didn't want it to be capable of moving.
Or unintentionally interacting with other objects, I guess. Like when you spawn crate slightly intersecting a bush and it kills itself.
Yeah but for some positions it bounces away
ah I didn't scroll enough
is there a way to stop drones from capturing sectors in sector control? setting Air to 0 in the module doesnt seem to prevent it
idk but what if you set the drone pilot and gunner as captive?
and by pilot I mean the AI pilot not the remote controller
first time im seeing this message: 6:25:28 Server: Object info 7:57 not found during Changing Owner

Hey peeps does anyone know If theres a way to display a message in the multiplayer lobby screen after the mission has started?
I basically want to have a message that tells people where they should slot but ideally depending on variables that I can set inside the mission
I doubt its possible since I havent really seen much like it but I thought I'd ask
I ended up creating an extension and a Discord bot for that (in Arma 2), but maybe A3 has more options there
Just an idea if the lobby doesn't support that in A3 either
Ahh thats an interesting way to do it, that reminds me that iirc another unit I played with used the potato framework to have player counts per side displayed in the lobby screen
that might be something to look into
wish more lobby scripting was possible, i think it has been discussed before but dont know whats the deal with that https://feedback.bistudio.com/T183039
its on my todo list
I think just got pushed ahead to 2.24, might push it further.
Its annoying and I need a proper usecase to test with
Also specifically communicating with the server, during the lobby
Although the communicating will be possible anyway with other features planned in 224
2.24 is planned to have Websocket/REST-API, that can talk to the server you're connected to.
But that would probably only work if you can host the webserver on your server.
Unless the game itself can host a webserver, but that needs much consideration
wow big plans
Let's make A3 great again! π
2.24 is planned to have Websocket/REST-API, that can talk to the server you're connected to.
But that would probably only work if you can host the webserver on your server.
Unless the game itself can host a webserver, but that needs much consideration
It sounds like the context are still quite vague?
By server connected to, I guess you mean same host, but different port? Then HTTP 1.1 is quite different from 2, quite different from 3 also.
Seems like having arma server, or mission file, describe a whitelist of allowed targets might be one option.
But I think having the game itself host the webserver is not ideal, because if it is outside a single webserver can service multiple Arma-instances.
Yes. No planning has been done yet
but different port
HTTP 1/2 is TCP, so same port would work too. I doubt any support for HTTP/3
describe a whitelist of allowed targets might be one option.
Not viable. A rogue server would whitelist your router's IP address, and then inject into your router settings.
This will need full CORS
itself host the webserver is not ideal
It being able to do so, does not imply that thats the only option.
Hosting a HTTP server on the gameserver is also not safe.
Game server hosting providers don't want you to abuse their platform for webhosting.
That'll also need some consideration
This is good point about rogue server.
Though not being able to whitelist separate, would restrict many deployments on hosted (as by 3rd party provider) servers unless the game itself runs the webserver then, which will of course need to support many ephemeral hosting port.
Not sure how CORS solve whitelisting better, but CORS is domain-based, right, so it will also limits deployment options to require controlling a domain.
CORS is origin based, an origin does not necessarily have to be a domain
Access-Control-Allow-Origin: ArmaClient == Any Arma client can connect to this host
But CORS controls what the client application makes visible to related code (normally JS in browser).
It does not prevent sending the request, so I'm not sure how it secures users' routers.
The client application will not connect to hosts that don't offer the correct CORS headers
No currently existing webserver, should allow a "ArmaClient" origin.
So your routers are safe, they either have no CORS, or wouldn't allow Arma to connect
You'd need to specifically whitelist Arma in your webserver
CORS does prevent sending requests.
JS does a preflight check to fetch options, if that fails, the POST/GET will not be executed
Though CORS is generally not considered a security boundary for remote, I can see why it will work in practice for Arma assuming you add "stuff" to the request.
There are ways to make request without preflight in CORS.
There are ways to make request without preflight in CORS.
Arma wouldn't offer that
Yeah, just made that "duh" realization, but you beat me to it π
Dedmen touching networking, does that also mean networking optimization? 
That was already done
Ah, veri gud, but what about like... improvements? I.e better prediction and such (if thats planned)
No
Damn
Will clients (including server acting as HTTP client) then just make their own CORS request? Are valid targets further constrained by server whitelist?
Could malicious arma client/server now DOS random HTTP servers (with "preflight" checks)?
Yes.
I don't know, probably similar to allowedHTMLLoad stuff. Localhost probably autowhitelisted (but protected via CORS), connecting the game server undecided, either autowhitelisted too (You still need to provide CORS so can't really end up with malicious requests to other webservers on same machine) or some wildcard (because you don't want to put your servers IP in case it changes around)
No, rate limit for new connections, and once a CORS failed, it won't be retried.
Yeah, I see how it is coming together. From sqf perspective, will their be like a new native "promise" type to work of? Or will it be purely event based?
I'd like both.
We use the existing promises for simple things. One shot setup/send, wait for reply
Working with longer running things, likely something like scriptHandle to refer to it
But there has been zero progress on actual planning and design yet, just ideas.
That is all still to be figured out
I could imagine something like this - just quickly spitballing:
private _response = httpRequest ["GET", format ["https://myawesome.community.com/api/v2/arma-stuff/%1", _someUID]];
_response continueWith {
params ["_result", "_error"];
if (_error isNotEqualTo []) then {
//...
} else {
// process resposne
};
};
edited: continueWith
continueWith instead of terminate. The request parameters will be hashmap.
But yeah same vein
I guess some sqf equivalent of encodeURIComponent will come along with it.
_result = waitUntil httpRequest #{
"type": "POST",
"url": `https://myawesome.community.com/api/v2/arma-stuff/${_someUID}`,
"data": toJSON getUnitLoadout player
};
I don't want to spam a dozen new script commands, so I'll probably come up with something ugly to put most of the things into a single command like ctrlWebBrowserAction does
Yeah that makes sense. Method, URL, Headers, and optional Body can easily be put into a hashmap.
Is there a way to read config for the arma server without an server-only addon/extension? Suppose only the server is to have an apikey, bearer token or whatever, we don't want to leak that to clients?
Yes https://community.bistudio.com/wiki/getServerInfo can read a specific class in server.cfg
That is perfect
But the script security stuff applies, any client could remoteExec and read
Could potentially make something web specific, that cannot read the config in script, but insert the result right into a header.
But, then remoteExec can be used to send bad requests from the server still
Could also add web specific things to CfgRemoteExec though. (because if its all in one command, you can't just block that)
Having to properly filter CfgRemoteExec seems complicated especially for large mission/mod, since you have to hit all indirect uses too, like call compile, etc..
The inserted directly into header is not a "beautiful" solution but it seems the most practical way to avoid leaking secrets, though I guess that doesn't prevent remoteExec'ing requests, but that is a bit smaller problem then leaking secrets.
Is there a way to load a defined mission from within a current one?
on a MP dedicated server, with the missions being pbos uploaded into the server's mpmissions folder
https://community.bistudio.com/wiki/serverCommand + #mission filename
Ive been trying to use that
"blaze51" serverCommand "#mission 51_intro.Kamino";
with blaze51 being the server password and 51_intro.Kamino being the mission im trying to load
Does #mission 51_intro.Kamino work when you manually run in it the chat console while being a logged in admin?
I also want to do that in a script, but I haven't tested that part yet..
Oh I see.
When the server state is currently playing, it doesn't do it immediately...
Ah but it will do it next frame..
I think code wise it should be working, don't see any obvious bugs
i recall using it... twice? but i cant recall if i had executed it as an admin or as server (if you're executing as server that might be why since according to the wiki the #mission command isnt available to the server(?))
also - "If serverCommand is executed on a client, it must be executed from UI context, such as "onButtonDown" or similar events (see User Interface Event Handlers)."
does not apply to the password variant
BUT
The password variant, can only be ran from non-UI.
And als only on dedicated server, not client hosted one
But he wrote
on a MP dedicated server
so that's not it
I just tried this this works via chat command it loads another mission but if i run this
serverCommand command in console it dosent work.
Should at least find out if the command itself is broken, or the serverCommand scriptcommand
serverCommand command in console
How do you run it
Local in console
"password" serverCommand "#mission mission.map";
local doesn't work
Refer to that
what dose that mean from Non-UI like you can run in on server terminal ? but cant run it trough console ?
remoteExec is possible.
But "local exec" in console cannot work. Local means you are not a dedicated server, but a client hosted one, where it doesn't work
even if i serverExec it dosent trigger.
the server is a dedicated server?
Yea
Then I'll have to repro and investigate that tomorrow
yep
Are there any other server commands that could be tested via the command?
Maybe #missions ? I'd expect all to not work then
but then AI wont shoot them down anymore, which is also not really wanted behaviour - idk why bohemia even lets drones or planes capture/has no toggle for it, cause how can a quadcoptor surveillance drone actually "capture" terrain lol
there really should be a way to make only ground units count for sector control...
setting Air to 0 doesnt do anything for the drones
None of the commands are triggering when i server exec the command. I am using ADT and at the bottom it says true when i server exec but nothing happends.
If I use the executeCode module in zeus and execute this code globally, it works
serverCommand "#mission 51_intro.Kamino Custom";
but unable to get anything working through interacting with a prop
Dose it run if you do this ?
["blaze51", "#mission 51_intro.Kamino"] remoteExec ["serverCommand", 2];
I tried this on my server it didnt work.
(I had my own password and mission in strings).
Nope
Doesnt work
congrats you found a bug. Dedman is gonna fix it tomorrow π
Its not supposed to work 
Isn't sector control just SQF code that you can copy and rework?
Its just modules so yeah
yeah it shouldn't. you can make a ticket for it. maybe someone will fix it
setting Air to 0 stops helicopters from capping just fine, but the quadcopter still does
My best guess is it uses class inheritance (iskindof) to determine air and the quadcopter doesnt inherit from it or something
Hmm, IIRC those are Helicopter based.
True, tho then again classes in arma have always been questionable π
No single class for enterable vehicles, animals are men, etc
Should be checking if uav I guess, unless ugv is meant to count
yeah
though this theory falls flat if the filter uses the "Air" class - that really SHOULD encompass all planes and helicopters
but if it doesnt, that could be it
cant be bothered to check the module code right now but someone could just to see
ugv should count to ground units like wheeled or tracked for it to make sense
if i set the sector area to a trigger, can i put something in the trigger condition so it wont count UAVs present?
It appears to be based on simulation attribute. Standard rotor UAVs use helicopterrtd so they should be counted as air.
Interesting (but probably not relevant) note: the function only considers PhysX simulation types, apart from soldiers. Any non-PhysX vehicles will use the default value (0) and so be unable to capture sectors.
Units are detected in BIS_fnc_moduleSector around line 770, you can look it up in the functions viewer
Tbh classes make more sense but not my code lol
but then why is it not counted as air? :/
Mr Bohemia please
John Arma works in mysterious ways
