#arma3_scripting

1 messages Β· Page 226 of 1

sharp grotto
#

That covers everything.

real tartan
#

how can I disable interaction with item on ground? e.g. prevent player to pick up item

hushed turtle
#

Disable simulation on weapon holder

cursive tundra
#

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

tulip ridge
#

You'd just check the group's combat mode in your script, what's your question?

cursive tundra
#
/// 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}

cursive tundra
tulip ridge
#

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;
};
cursive tundra
#

units on green will still open fire, if they are detected, threatned or the enemy is very close

tulip ridge
#

You're right, it is don't fire unless fired upon
I dislike that the names themselves aren't very descriptive

cursive tundra
#

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

cursive tundra
#

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

cosmic lichen
#

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

unreal scroll
#

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?

errant jasper
#

Can't you just create a single global model and attach to the projectile on the launch machine?

unreal scroll
#

@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.

sly cape
#

If you have signature checking on or whatever, it's automatic. I don't remember how to do that while local hosting though.

errant jasper
#

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 ?

unreal scroll
#

Yes, something weird happened πŸ™‚

sly cape
#

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.

hushed turtle
#

More of server question

acoustic abyss
#

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?

hallow mortar
tender nest
#

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.

acoustic abyss
#

Alright; placing units and doing setDammage 1 is probably the simplest implementation.
Is it also cost effective in terms of processing?

granite sky
#

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.

acoustic abyss
#

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.

warm hedge
#

switchMove

acoustic abyss
#

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.

cyan dust
remote cobalt
#

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.

tender fossil
remote cobalt
mortal folio
# remote cobalt Hey guys, I failed to find some helping informations about the way "getVariable"...

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)

tender fossil
#

Doesn't spawn count as async (?)

mortal folio
#

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

remote cobalt
mortal folio
# tender fossil Doesn't `spawn` count as async (?)

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

tender fossil
mortal folio
#

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

mortal folio
#

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

tender fossil
#

Yeah, that's what I wanted to know. I guess there's a fine difference between concurrency and parallellism πŸ˜„

mortal folio
#

ye

mortal folio
sharp grotto
#

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 meowsweats

mortal folio
#

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

remote cobalt
sharp grotto
#

Yea then don't even bother, waste of time then ^^

remote cobalt
#

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. ^^

mortal folio
#

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

split ruin
#

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. meowfacepalm

winter rose
#

what do you need exactly?

split ruin
#

@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)

winter rose
#

for him? or for targets?

split ruin
#

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

winter rose
#

difficulty setting can allow his own position/direction on the map

#

however it is scriptable definitely

split ruin
#

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

mortal folio
#

(and keep updating it per frame alongside the position)

#

it'll look fugly but it'd work 🀷

winter rose
#

the best way is to run a script updating every X seconds (to maybe avoid being OP? otherwise each frame) with cameraDirection

mortal folio
#

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

winter rose
#

positionCameraToWorld + getCameraViewDirection @split ruin

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]];
};
split ruin
#

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

split ruin
#

it will work only if I can get two positions left and right relative to screenToWolrd position ...

winter rose
ivory lake
#

or just make a graphic/find one (think theres a vision cone in A3) and use drawicon

cosmic lichen
#

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

mortal folio
#

@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

little raptor
#

you can't get the "action state" at all. actions work one way, i.e action -> animation state, not the other way around

past wagon
#

I am getting Undefined variable: _lootPool at the bottom. I define it in an outer class at the top. What am I doing wrong?

warm hedge
#

Do you mean Line 144 is throwing the error?

past wagon
#

no actually line 148

warm hedge
#

deleteAt does not return the result. It modifies the given array

past wagon
#

oh

#

the wiki says it returns the deleted element

old owl
#

It returns the deleted index

#

Not sure why it says element

#

Unless I am mistaken and remembering wrong

sly cape
old owl
#

Erh

#

That sounds less right now you say it like that

#

Maybe I am trolling rn

dusk gust
old owl
#

Looks like pushBack does index so I'm probably wrong and misremembering

#

Ah

#

Ye mb

granite sky
#

Don't you guys ever use _array deleteAt floor random count _array :P

glossy pine
old owl
#

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 πŸ₯€

warm hedge
#

2 - 1000 yards - Front - Stare

mortal folio
mortal folio
#

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 legallydistinctkekw

mortal folio
#

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

small perch
#

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

hushed turtle
#

Checking which body part got damaged the most doesn't do trick?

mortal folio
#

try checking hitPart instead of selection as well, see if it's any different

mortal folio
small perch
#

how would i compare the damage between the different times the eventHandler is fired?

mortal folio
mortal folio
little raptor
#

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
}
little raptor
mortal folio
#

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

little raptor
#

I can probably add it this weekend if Dedmen or KK don't want to do it

mortal folio
#

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)

little raptor
#

nope, the action gets mapped to an animation state, and the anim state is pushed to the queue

hushed turtle
#

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

mortal folio
#

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 🀷

hushed turtle
#

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.

small perch
#

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

earnest valve
#

@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)];};

bronze trellis
#

@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.

jade abyss
#

@earnest valve You are wrong there. "locked" is not the same as "passworded".

#

Search for " #lock "

bronze trellis
#

@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?

jade abyss
#

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

gusty rivet
#

Doing a Little Round Top op and was hoping someone could help me figure out how to make a carryable flag

bronze trellis
#

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?

jade abyss
#

"" #lock - Locks the server, prevents new clients from joining. ""

#

If the admin disconnects, who told the Server to "lock" -> It gets unlocked

#

iirc

bronze trellis
#

im using rcon tool to lock it does does that make a difference?

jade abyss
#

Should stay locked then

#

Until you unlock it

bronze trellis
#

ya the lock icon stays there but i can still join.

jade abyss
#

hm

cursive tundra
#

does isKindOf "Building" also work on map buildings or only the ones i placed in editor?

hushed turtle
#

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"
cursive tundra
#

ill test, thank u πŸ˜„

granite sky
#

A lot of smaller map buildings don't have a class. The houses do though.

hushed turtle
#

Is it helpful to check if something is kind of building though?

jade abyss
#

We did that stuff often, when the Server was full. So.... could be the local thingy you said (Server+Client on same PC)

hushed turtle
#

Last time I checked a lot of object like street lamps, signs, houses, fences are all kind of "House"

#

Not really helpful

granite sky
#

yeah it's a problem.

cursive tundra
#

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

hushed turtle
#

Didn't know these classes exist πŸ˜€

bronze trellis
#

ya thats all i can think of. I will reinstall just in case my server is miss configured or something

#

thanks for the help

sullen robin
#

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

mortal folio
#

you can override other default actions for this too

sullen robin
#

Thanks, will check it out!

cursive tundra
#

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?

tulip ridge
#

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

cursive tundra
#

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

tulip ridge
#

That's sqf, so you can just run it from a script

cursive tundra
#

yeah but like.. does it turn that off for the whole mod? so i can put it in the init and im fine?

tulip ridge
#

Looks like it yeah, you wouldn't set an object variable like that

cursive tundra
#

alrighty, ill try that, thanks

still forum
junior moat
#

Whats the quickest way to convert a 3D position array into a 2D position array?

hushed turtle
#
_array resize 2;
junior moat
#

thank you πŸ™

tulip ridge
#

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

mortal folio
# still forum I am considering it on tuesday to say no

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 legallydistinctkekw

junior moat
#
_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).

errant jasper
#

Yeah that is completely wrong switch/case syntax

junior moat
hallow mortar
#
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) : ...```
junior moat
#

so would (_case <= 3) work?

errant jasper
#

The cases must be values

junior moat
hallow mortar
errant jasper
hallow mortar
#

The case expression returns true, which matches the value being checked

errant jasper
#

Yeah okay you switched on true yeah.

junior moat
#

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 :/

errant jasper
#

Wow... That an "ugly idiom".... Well we don't have something cond clauses, so I guess it the idiom

hallow mortar
#

&& 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)) : ...```
errant jasper
#
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];
junior moat
errant jasper
old owl
junior moat
junior moat
old owl
#

Totally, working is more important- just wanted to chime in

errant jasper
#

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;
junior moat
# old owl Totally, working is more important- just wanted to chime in

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

junior moat
#

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

errant jasper
#

If you mean the middle of the label text of the location that is more difficult

junior moat
hushed turtle
#

I was about to say have fun picking each position manually πŸ˜€

errant jasper
#

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

junior moat
#

Is there an Euler's Number constant i can use in SQF?

#

found it, its exp

junior moat
#

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,
    "",
    ""
];
hallow mortar
#

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.

junior moat
granite sky
#

It looks like you're expecting your code to increment the value in the array? Which it won't.

hallow mortar
#

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.

junior moat
hallow mortar
granite sky
#

It stays 0 in the array.

junior moat
#

_selectedLocationNum is an Integer

#

atleast it should be an integer

granite sky
#

It's a number in an array :/

hallow mortar
granite sky
#

_selectedLocationNum = _selectedLocationNum + 1; just sets that variable to a new number with the value +1. It doesn't update the original value.

junior moat
hallow mortar
granite sky
#

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];
};
hallow mortar
#

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

junior moat
#

Oh wait

#

im dumb

#

hold on, ignore that

#

That code seemed to work, thanks a bunch!!

digital hollow
#

There's no script access for setting vision mode daytv/nvg/ti for turret/pilotcamera, right? I can only find setCamUseTI

fallow pawn
#

Is Biki down? πŸ™

sly cape
winter rose
digital hollow
#

TIL the live feed module. It doesn't put stuff on screens (objects), it puts stuff on your screen (UI)

topaz lion
#

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

acoustic abyss
tulip ridge
#

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?

granite sky
#

I'm not sure how accurate any of that is. I think setDir was mostly fixed a while back.

tulip ridge
#

Oh nice

topaz lion
versed ledge
topaz lion
# versed ledge Something very similar to what you’re talking about exists in ROS Carrier Strike...

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.

versed ledge
topaz lion
versed ledge
#

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.

topaz lion
topaz lion
versed ledge
still forum
# digital hollow There's no script access for setting vision mode daytv/nvg/ti for turret/pilotca...

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

digital hollow
still forum
#

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

digital hollow
#

That'll work if you prefer it to new commands like setTurretOpticsMode, setPilotCameraOpticsMode

formal grail
#

The deadSetTime in getEntityInfo, is there any way to get it to synchronize when JIP?

old owl
#

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.

formal grail
#

I think deadSetTime is just join time and never syncs

old owl
formal grail
#

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.

old owl
# formal grail Well the mission is pretty network heavy and past 60-70 players it can start to ...

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.

errant jasper
#

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

old owl
radiant lark
#

Is there any site where I can download all of biki?

cursive tundra
#

what does "Reserved Variable in expression" mean?
the error points me to this line :

params = ["_groupsToChooseFrom","_position","_enemyValue"];

cursive tundra
#

yeah but im declaring params for my function

old owl
#

@radiant lark πŸ™‚

sly cape
cursive tundra
#

oh

#

i missed that lol

radiant lark
# old owl <@1155483432068059176> πŸ™‚

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! πŸ˜…

mortal folio
#

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 πŸ˜‚

old owl
radiant lark
formal grail
#

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.

granite sky
#

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.

acoustic abyss
#

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?

hallow mortar
acoustic abyss
#

Trying to understand the syntax.
object in this case can be player?

hallow mortar
#

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.

slim trout
#

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;```
indigo snow
#

your addAction refers to unit1

#

not patient1

slim trout
#

the patient is the name of the sing, unit1 is the name of the soldier who is supposed to be injured

indigo snow
#

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

slim trout
#

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

indigo snow
#

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;
    }
];
slim trout
#

Okay. I understand. Didnt know you can do it like that.

#

I mean that it can be done like that.

lone glade
#

params bruh

slim trout
#

Works. Thanks for the help. I learned a lot from that lesson.

acoustic abyss
#

Thank you for this explanation!

hushed turtle
#

How to check if entity is Agent?

hallow mortar
still forum
#

What else is an agent?

hallow mortar
#

An object created with createAgent?

still forum
#

Ah any Person with an "Agent" brain

hushed turtle
#

teamMember confused me at first, since I have no idea what that is. That being said following works:

isAgent teamMember TAG_rabbit;
hallow mortar
#

Also is it me or are the agent and teamMember commands "backwards" in terms of name vs function?

still forum
#

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

winter rose
#

could you make that isAgent takes Object?

pine garnet
still forum
#

Quite some mission makers use BIS_fnc_unitCapture to record vehicles or helicopter flights..
I took one look at the code and am disgusted notlikemeowcry

_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 notlikemeow

crimson lion
#

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

still forum
#

string would be utterly stupid, ignore the mentions of string

digital hollow
#

pushBack is 1.26, fnc might be from before xD

winter rose
#

func is from A2 yeah!

digital hollow
#

It belongs in a museum!

still forum
#

Guess I'm writing my own version.
Using EachFrame instead of unreliable sleep. Pausing and resuming on Esc menu instead of aborting

winter rose
#

inb4 BIS_fnc_unitCaptureReal

little eagle
#

there is no locality issue here. AddAction is only executed on one machine and ace_medical_fnc_addDamageToUnit has global effects iirc.

cosmic lichen
#

Just name it _unitCapture2 πŸ˜›

winter rose
#

*WorldVisualWorldReal2

digital hollow
#

Surely BIS_fnc_unitCaptureRealVirtuality

cosmic lichen
#

It's BI naming standard so we surely have to do BIS_fnc_captureUnit

restive leaf
#

Wait, BI have naming standards? 🀯

winter rose
#

we have standards?

hushed turtle
#

What BI naming standards? Just look at the behaviour commands, their naming makes no sense at all

cosmic lichen
#

That was the joke

tender fossil
#

Couldn't resist linking

spare idol
#

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.

tulip ridge
cyan thunder
spare idol
# tulip ridge Not with scripting, you'd need to make a mod

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?

tulip ridge
spare idol
#

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?

tulip ridge
#

Yeah it will work fine

spare idol
#

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

mortal folio
hushed turtle
#

Aren't commands turning player missing on purpuse, because of hackers? So they can't aimbot themself easily by a command?

still forum
#

I think you're missing some words

mortal folio
#

@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

pine garnet
#

You can see what replies I got here when I asked, but it did not quite help me.

mortal folio
#

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 πŸ˜‚

still forum
#

you can get the the camera orientation, locally on the players machine

mortal folio
#

Ye but that includes freelook, and weapondirection isnt always reliable if weapon is lowered

#

(Im being very pedantic here i know MillerTarget )

still forum
#

You can script a laser pointer attachment onto your gun that works just about perfectly.
I'd think you can get weapon direction

mortal folio
#

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

errant jasper
#

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?

mortal folio
#

@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)

errant jasper
#

Well sounds like you are trying to get some vector of the torso if lookdir and weapon dir are wrong?

mortal folio
# errant jasper Well sounds like you are trying to get some vector of the torso if lookdir and w...

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

errant jasper
#

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.

mortal folio
#

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

errant jasper
#

So basically like the torso. You want the forward facing tangent of the spine

mortal folio
#

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 legallydistinctkekw
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

errant jasper
#

Spine0 to 3 won't work solving perpendicular to align with dir?

mortal folio
#

that'd only be applicable if every animation had their spine bones pointing perfectly forward, which is never the case

errant jasper
#

If you had this aim offset value what would you apply it to, to get the final result?

mortal folio
# errant jasper If you had this aim offset value what would you apply it to, to get the final re...

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)

errant jasper
#

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?

mortal folio
#

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

errant jasper
#

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

mortal folio
#

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)

little raptor
mortal folio
#

Whatevers easier

glad berry
#

hey, is it possible to make an AI in arma 3 drive a waypoint after i hit an specific trigger?

sly cape
glad berry
sly cape
glad berry
#

ok

#

anything more

cursive tundra
#

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?

sly cape
past wagon
#

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;
still forum
#

yes

#

you never make a copy

past wagon
#

ok thanks

#

they are like objects in oop?

#

ig

still forum
past wagon
#

πŸ€·β€β™€οΈ

hushed turtle
spare idol
#

NVM this goes on config

molten yacht
#

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.

tulip ridge
#

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

molten yacht
#

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

tulip ridge
#

Fair enough

granite sky
#

units takes a group or side parameter.

molten yacht
#

....yeah

#

yeah I did mean that

#

thanks

glad berry
#

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

granite sky
#

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.

austere granite
#

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")
lone glade
#

you're missing a ;

glad berry
#

different variables names, etc

#

even not using tiggers at all

austere granite
#

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

lone glade
#

are you on 1.54 stable or 1.55 and upwards ?

austere granite
#

1.57

#

Latest dev

#

Let me test the same thing in stable.

lone glade
#

probably a bug, report it on the feedback tracker if there isn't a report already.

austere granite
#

I guess it could potentially be related to stuff moving to missionAttributes instead of misson configs

#

Nah it's the same in stable

indigo snow
#

configProperties [my >> path,"!isClass _x"]

#

try that?

austere granite
#

Okay that works, need isClass in this case, but thanks a lot πŸ˜ƒ

indigo snow
#

ah misread that bit but yea

small perch
#

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.

warm hedge
#

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

old owl
# small perch is it possible to hook into another mod? I want to the hook into the "Improved M...

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.

little raptor
mortal folio
little raptor
#

if it gets approved you can expect it in 2.22 🀞

mortal folio
#

awesome, cheers man πŸ˜„ appreciate it!

granite sky
crimson lion
little raptor
#

it's an OBS plugin

little raptor
crimson lion
#

Awesome, thank you

proven charm
#

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?

proven charm
#

i mean it doesnt do anything but how the loop behaves

slate merlin
#

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?

proven charm
past wagon
#

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?

sly cape
past wagon
#

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?

tulip ridge
past wagon
#

I’m interpolating its location across a straight path

#

Because I can’t get AI to fly straight and level

past wagon
tulip ridge
#

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?

past wagon
#

Yeah

#

Battle bus type shit

tulip ridge
past wagon
#

Well I need to the players to be inside it

tulip ridge
#

Yeah I was thinking you were trying to do more of an airdrop thing, where a player spawns already freefalling

#

Weird bot

sharp grotto
past wagon
#

Yeah but I also wanna be able to increase the player count to 100, and then I’d need 4 blackfishes

tulip ridge
#

He might want a random flight path for it as well

past wagon
#

I want the player count to be scaleable

sharp grotto
#

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.

tulip ridge
#

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

past wagon
#

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?

hushed turtle
#

Units are all global. I wonder how it looks when player is in local vehicle

past wagon
sharp grotto
tulip ridge
#

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

past wagon
#

Ok

tough abyss
#

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 ?

hushed turtle
#

If they are local, then how would they hit each other?

tulip ridge
#

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

hushed turtle
#

Hidden agents only have collision where they are local

tulip ridge
#

It's not an agent, it'd be the whole blackfish

hushed turtle
#

If vehicles would get created locally and player entered his local vehicle. Would he appear in all other local vehicles? 🀣

queen cargo
#

@lone glade @austere granite that count is not counting children is normal behaviour

#

only the class operators (eg >>) resolve it 100% correctly

ornate whale
tight cloak
#

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

proven charm
#

pls post more code

tight cloak
#
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;

proven charm
#

with enough systemchat debug you can figure what part doesnt work. id start from _trainObj πŸ™‚

tight cloak
#

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

proven charm
#

usually is

tight cloak
#

it ticks over 1 happy as day but doesnt reset

#

ive cannibalised this to pieces trying to figure it out

tight cloak
hushed turtle
#

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

errant jasper
thin fox
tight cloak
#

i fixed it

#

_args set [1, _interval];

#

thats it

thin fox
#

damn

errant jasper
#

You only ever update to 0 when it is greater than 1, so you only see 0

tight cloak
#

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

errant jasper
#

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?

split ruin
#

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 ...

proven charm
#

fire one round at a time and make target pos random?

split ruin
#

@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;
};
granite sky
#

findSafePos meowsweats

#

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.

split ruin
#

yes πŸ™‚ actually I was thinking to add object distance so it hit mostly open spaces, making them more deadly

#

and I suck in math 🀫

granite sky
#

tbh you don't need to make vanilla mortars more deadly

split ruin
#

I mean the open spaces πŸ™‚

granite sky
#

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

split ruin
#

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

topaz lion
#

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?

iron flax
#

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;
};
};

iron flax
topaz lion
tight cloak
#

got a new problem now πŸ™‚ reversing sends it to oblivion after a single correct movement

little eagle
#

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

misty dew
#

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?

bold rivet
#

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.

hushed turtle
#

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

still forum
errant iron
#

i had a similar bug when i was writing my own APS, although the mechanism is a bit different here

bold rivet
still forum
#

or maybe the 2D version if there is one

bold rivet
#

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

hushed turtle
#

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

errant iron
#

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

bold rivet
#

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

hushed turtle
#

Still no need for remote execution

errant iron
#

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)

bold rivet
#

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?

errant iron
#

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

bold rivet
#

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?

errant iron
#

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

hushed turtle
#

I would add EH everywhere, where _missile can be local. Check for locality and do nothing if it's not local

errant iron
errant jasper
#

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?

bold rivet
#

Vanilla yeah

bold rivet
hushed turtle
#

Can we add variables to missiles using setVariable?

bold rivet
#

Honestly, I dunno if you can give projectiles variables

#

have tested that yet

mortal folio
#

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

errant iron
#

fake support selfbot?

mortal folio
#

uuh... i dont know but im a bit concerned now given it responded directly to me immediately as i send that

bold rivet
#

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?

mortal folio
#

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

bold rivet
#

Ah I see

mortal folio
#

you can think locality as "which machine has control over it" in a sense

bold rivet
#

so the missile is remote to everyone but the one that fired it from my understanding?

mortal folio
#

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

errant iron
# bold rivet I figured I'd have to do something like that for unguided rockets, but I honestl...

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:

  1. every client looks for APS-supported vehicles (both local and remote)
  2. every client finds their local projectiles in proximity of each vehicle, at a rate of ~30ms
  3. 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

bold rivet
#

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?

errant iron
#

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

bold rivet
#

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];

errant iron
#

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

hushed turtle
#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
bold rivet
hushed turtle
#

Well, that fine. Just like I'm lazy to read unformatted mess

bold rivet
#

Nah I totally get it, It was just that it was a question directly to gamecracks and he knows his own code

errant iron
#

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

bold rivet
#

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

mortal folio
# mortal folio the hell was that bot lmao

@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)

young current
mortal folio
#

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

young current
#

spammy bot I think

mortal folio
#

πŸ‘

#

cheers

misty dew
#

the thing is playSound3D doesn't seem to work whith CFGsounds
it gives me the error
Audio Stream: Cannot load sound 'sound'

still forum
#

look at the examples

#

playSound3D ["A3\Sounds_F\sfx\blip1.wav", player]

#

or

misty dew
#

yeah but that would all only be local

verbal shoal
#

Does anyone have a script that forces helicopters to have ejection seats?

indigo snow
#

So execute it remote to all clients

#

remoteExec

#

Or BIS_fnc_MP which is now a wrapper for it

misty dew
#

thank you both for answering. ill have a look πŸ˜ƒ

indigo snow
#

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

bronze trellis
#

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

snow pecan
#

object hideobject true; should work fine

#

I believe hideobjectglobal is broken in sp though (unless it's been fixed)

bronze trellis
#

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?

round scroll
#

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

snow pecan
#

hint (typeOf cursorTarget); get's the classname of the object you are looking at

rugged coral
#

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..

proven charm
rugged coral
rugged coral
#

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?

mortal folio
#

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)

rugged coral
rugged coral
#

but I have to scale and set positions of each obj individually

#

so that wouldn't really help

mortal folio
mortal folio
rugged coral
#

the parrent is static (mostly) - can just be moved or deleted by players - but the attached objects do scale and change their positions.

mortal folio
#

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

rugged coral
#

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)

mortal folio
#

moving/position changes, same thing, it resets their scale when their position changes, right?

rugged coral
#

yes

mortal folio
#

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

rugged coral
#

But I have to reposition it with each scale process

mortal folio
#

yes, you just reposition object1_dummy

#

object1 will move with it

rugged coral
#

since it would not be very accurate from its position

mortal folio
#

so it's the same result

rugged coral
#

(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

rugged coral
#
            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.
indigo snow
#

hideObject doesnt take classnames as argument

mortal folio
#

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

rugged coral
#

but how if that is always the case on repositioning?

mortal folio
rugged coral
#

yeah I do

#

But I change the postion of attached objs by attaching them again or?

mortal folio
#

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

mortal folio
#

the attached object moves with the parent object

rugged coral
#

I do not change the parent pos. The attached objects do change scale AND positions.

mortal folio
#

except the attached object won't reset scale

errant jasper
#

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.

rugged coral
mortal folio
rugged coral
mortal folio
#

im not sure how else to explain this meowsweats

rugged coral
#

I rescale / position the object dependent on the grow state of the plants.

#

or if players take the material

errant jasper
#

How often does a particular plant change state (size, position, anything) ?

rugged coral
#

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

errant jasper
#

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?

rugged coral
#

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.

errant jasper
#

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.

rugged coral
#

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. πŸ˜„

  1. 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 :/
errant jasper
#

createVehicle is a more "complete"-object creation tool simulation-wise. But I think 2000 extra of those will have undesirable engine consequences.

rugged coral
#

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 πŸ˜„

errant jasper
#

There is also createVehicleLocal, but that gives a host of other considerations, and management to do on top.

rugged coral
#

could not test enough yet to tell how good performance is especially with player counts over 40 (at once)

rugged coral
#

But yeah you're def right for best network performance you should do it that way πŸ˜‰

errant jasper
#

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.

indigo snow
#

The first question is: @bronze trellis , what are you trying to hide?

mortal folio
errant jasper
#

Don't ask, just let the server set the start time as a public setvariable on the plant.

mortal folio
#

Or. Yeah thats better actually

#

22 hours of wakeness getting to me

rugged coral
#

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 πŸ˜„

bronze trellis
#

@indigo snow its just a wall

indigo snow
#

So its a map object without a classname?

bronze trellis
#

its a buildding on altis i dont know the classname

indigo snow
#

Yes but it is on the map by default?

bronze trellis
#

yes

broken pivot
#

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

indigo snow
#

You cant hideObject those

broken pivot
#

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

indigo snow
#

Youll have to simply damage it

rugged coral
faint burrow
broken pivot
#

this = firesTrue
thanks a lot. Maybe I should touch some grass

faint burrow
#

Plus remoteScopeTarget1 in the trigger statement is undefined.

broken pivot
#

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)

rugged coral
#

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.

still forum
broken pivot
mortal folio
#

He meant on discord

#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
broken pivot
#

Ouuuu 🀦 (Ive changed it)

bronze trellis
#

ah ok, that makes sense. and if i placed the object in the editor?

faint burrow
#

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 };
broken pivot
mortal folio
#

I personally use Hemtt vscode extension - does a very good job at identifying problems and has all the sqf command syntaxes up to date

broken pivot
#

dafuq -> Is it translating numbers in the matching position of Unicode table?

indigo snow
#

Then you can reference that object, since it will have a classname

faint burrow
indigo snow
#

Either name it or find some other way to refer to it

still forum
#

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

faint burrow
#

For me, syntax highlighting is more important.

tulip ridge
broken pivot
still forum
#

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

faint burrow
#

But this contains duplicates... 😁

still forum
#

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

broken pivot
#

Is there a diffrence between str and toString? (I gues its that I can play itterations throught magic varss)

old owl
still forum
old owl
#

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

cosmic lichen
#

It checks for errors

old owl
#

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

cosmic lichen
#

You can basically let that run with a workflow on each PR.

old owl
#

Yeah that's crack

#

That's absolutely sweet

broken pivot
#

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

hushed turtle
#

AI doesn't want to shoot civilians

broken pivot
#

Ill switch faction. Thanks alot

hushed turtle
#

Joining him to group of side, which is enemy of the guard, is one way to do it, yeah.

bronze trellis
#

ok cool

tulip ridge
old owl
#

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.

tulip ridge
#

Project needs to be set up as:

.hemtt
  - project.toml
addons
  - addon 1
  - addon 2
  - addon 3
old owl
still forum
#

I would say you can take the sample from ACE github, which runs hemtt actions.
But I don't see them running hemtt check

old owl
#

Good idea though to search for an existing repo

still forum
#

They are running a full hemtt build on every PR

tulip ridge
#

Yeah

tulip ridge
#

Hemtt's only going to be checking for things in the addons folder

old owl
#

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

tulip ridge
#

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

old owl
#

Cheers though for that too πŸ™‚

dusk gust
old owl
#

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.

still forum
atomic niche
old owl
#

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.

still forum
old owl
#

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

old owl
#

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 meowheart

split ruin
#

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 πŸ˜”

tepid notch
#

Brauch mate fΓΌr Fuchs bin igl habe 50 pr bin gut er igl

past wagon
#

how can I disable simulation on a storage crate to prevent it from bugging out, without preventing players from interacting with the inventory?

crimson lion
#

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

past wagon
past wagon
#

Ok thanks

crimson lion
#

Dont even have to disable simulation on the helipad (if you dont want to. I would tho, just cause)

hushed turtle
#

Why to use helipad over game logic object, if all I want is object to attach something?

tulip ridge
winter rose
old owl
#

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

little raptor
granite sky
#

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.

past wagon
little raptor
#

ah I didn't scroll enough

cursive tundra
#

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

little raptor
#

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

mortal folio
#

first time im seeing this message: 6:25:28 Server: Object info 7:57 not found during Changing Owner

thonk

oblique arrow
#

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

tender fossil
#

Just an idea if the lobby doesn't support that in A3 either

oblique arrow
#

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

proven charm
still forum
#

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

proven charm
#

wow big plans

hushed turtle
#

Yeah, for game this old πŸ’―

#

Looking for years of support for A4 MillerTarget soldier_sunglasses

faint burrow
#

Let's make A3 great again! 😎

errant jasper
#

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.

still forum
still forum
#

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

errant jasper
# still forum > describe a whitelist of allowed targets might be one option. Not viable. A rog...

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.

still forum
#

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

errant jasper
#

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.

still forum
#

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

errant jasper
#

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.

still forum
#

There are ways to make request without preflight in CORS.
Arma wouldn't offer that

errant jasper
#

Yeah, just made that "duh" realization, but you beat me to it πŸ˜…

mortal folio
#

Dedmen touching networking, does that also mean networking optimization? coolfrog

mortal folio
#

Ah, veri gud, but what about like... improvements? I.e better prediction and such (if thats planned)

still forum
#

No

mortal folio
#

Damn

errant jasper
#

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)?

still forum
#

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.

errant jasper
#

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?

still forum
#

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

errant jasper
#

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

still forum
#

continueWith instead of terminate. The request parameters will be hashmap.
But yeah same vein

errant jasper
#

I guess some sqf equivalent of encodeURIComponent will come along with it.

still forum
#
_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

errant jasper
#

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?

still forum
errant jasper
#

That is perfect

still forum
#

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)

errant jasper
#

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.

steep rapids
#

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

steep rapids
still forum
#

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

mortal folio
#

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)."

still forum
#

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

fleet sand
still forum
#

Should at least find out if the command itself is broken, or the serverCommand scriptcommand

still forum
fleet sand
#

Local in console
"password" serverCommand "#mission mission.map";

still forum
#

local doesn't work

fleet sand
still forum
#

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

fleet sand
still forum
#

the server is a dedicated server?

fleet sand
#

Yea

still forum
#

Then I'll have to repro and investigate that tomorrow

still forum
#

Are there any other server commands that could be tested via the command?
Maybe #missions ? I'd expect all to not work then

cursive tundra
#

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

fleet sand
steep rapids
#

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

fleet sand
#

I tried this on my server it didnt work.

#

(I had my own password and mission in strings).

fleet sand
granite sky
mortal folio
#

Its just modules so yeah

little raptor
cursive tundra
#

setting Air to 0 stops helicopters from capping just fine, but the quadcopter still does

mortal folio
#

My best guess is it uses class inheritance (iskindof) to determine air and the quadcopter doesnt inherit from it or something

granite sky
#

Hmm, IIRC those are Helicopter based.

mortal folio
#

True, tho then again classes in arma have always been questionable πŸ˜„

#

No single class for enterable vehicles, animals are men, etc

digital hollow
#

Should be checking if uav I guess, unless ugv is meant to count

mortal folio
#

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

cursive tundra
#

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?

hallow mortar
#

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.

cursive tundra
#

only unit in that sector is the UAV

hallow mortar
#

Units are detected in BIS_fnc_moduleSector around line 770, you can look it up in the functions viewer

mortal folio
cursive tundra
#

Mr Bohemia please

mortal folio
#

John Arma works in mysterious ways