#arma3_scripting

1 messages · Page 697 of 1

little raptor
#

it's extremely simple:

fnc1 = {
  params ["_target", "", "_id"];
  _source = _target say3D "blabla";
  _target removeAction _id;
  _target addAction ["off", fnc2, _source];
};

fnc2 = {
  params ["_target", "", "_id", "_source"];
  deleteVehicle _source;
  _target removeAction _id;
  _target addAction ["on", fnc1];
};
_target addAction ["on", fnc1];
past gazelle
#

Thanks for the tips!

radiant yacht
little raptor
#

well you could save yourself some time if you learned some sqf meowsweats
if you don't know what you're doing you'll just waste time

marsh solstice
#

I’m trying to create a MedEvac helicopter that players can call in that has combat medics in the back who will get out and tend to wounded/unconscious players and AI that are brought near the helicopter, OR tend to players or AI that are loaded into the helicopter. I think I need a script that will remove the medics from the helicopter group and have them join the player group to make this happen

little raptor
#

remove the medics from the helicopter group and have them join the player group to make this happen
no
but you need to script everything else you said

radiant yacht
marsh solstice
#

@little raptor so I use simplex support services mod that gives the players the option to call the helicopter to land at a location of their choosing, and I can set that up to have the medics in it and grouped with the pilots. So I’ll need to script them joining the player group, and healing, correct?

little raptor
marsh solstice
#

Or just a script in the medic’s INIT that has them heal any friendly unit in their vicinity

past gazelle
#

which syntax highlighting should I use for sqf in here?

little raptor
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
past gazelle
#

oh, cool.

#
inGameUISetEventHandler ["Action", "
    if (_this select 3 == 'rearm' && cursorTarget side _this == west ) then {
        
        hint 'Rearming on NATO/FIA is disabled.'; 
        true
    };
"];
#

Actually I wanna post the original sample of this from bi's website...

little raptor
past gazelle
#

Are those quotes supposed to be brackets?

#

the last quote and the first one...

little raptor
#

according to wiki it has to be a string

past gazelle
#

Boy that's weird because addEventHandler uses {}'s

little raptor
#

because it takes code

past gazelle
#

ok so then yeah, I'm just trying to check if the cursorTarget is side west...

little raptor
#

also I'm pretty sure addEH supports string too

little raptor
#

and if not that, _this is clearly an array

#

so you have two errors there

past gazelle
#

Yeah I forgot to delete _this.

little raptor
#

even if you did you still have another error

past gazelle
#

I'm halfway poaching this from another script I found for looting but yeah...

radiant yacht
copper raven
#

you got a global variable in params

past gazelle
#

"blabla" should be a reference to the sound file...

little raptor
radiant yacht
#

then i'm very wrong

little raptor
#

but that blabla was all you had to change

past gazelle
#

Ok I actually just coded up the radio/music thing two weeks ago so I can help him in a DM...

radiant yacht
past gazelle
little raptor
radiant yacht
#

good call

radiant yacht
past gazelle
#

Honestly sqf is a little hard for me to understand because of nular's...

#

I'm very used to c's (return value) functionname(arguements)

#

Although it is cool that sqf can return an array...

copper raven
past gazelle
#

ooH!

#

For anyone interested, rather than disabling the inventory screen, it might be better to disable the "gear" action...

wicked fulcrum
#

Anyone know if the "gui" opened with right-click on the spectrum device is its own display/thing you can add eventHandler to? To register mouse left-click etc?

Tried to find it with allDisplays but doesn't seem like it shows up. I could just add an mouseDown on the unit and try to figure out a way to see if spectrum device is currently in the hands. Ideally I would like to check if the gui is open too.
But would be easier if I could bind an eventHandler to that specific gui instead.

willow hound
#

#arma3_gui, but what GUI do you mean? It's been a long time since I've played Contact.

wicked fulcrum
#

Opens up when you right-click while having the spectrum device out.
As this wasn't creation of gui I thought it was more of a scripting issue getting an eventhandler to work on it. But can change to #arma3_gui if that is the correct channel

#

Have not been able to find any functions or way to monitor/check when its open or not. So current idea is probably just to add mouseDown to main display, (IDD: 0?) and then check if currentWeapon is spectrum device.

random loom
#

Is it possible to make ammunition detonate midair via scripts?

still forum
#

setDamage 1 should detonate yeah

random loom
#

That is what I tried, doesn't seem to do anything

#

Tested on 120mm HE

copper raven
little raptor
#

huh, didn't know that one

winter rose
#

same, or forgot it 😄

snow pumice
#

Does an function exist to revers an array
[1,2,3] to [3,2,1]

little raptor
#

¯_(ツ)_/¯

cosmic lichen
#

We need get this added to the discord bot 😄

tidal ferry
#

Question

#

Can you attach markers to keyframe animation?

winter rose
tidal ferry
#

Gotcha, okay

terse hollow
#

Is it possible to create a script that would change how the MIM-145 and S-750 launch there missiles. To make them more realistic by launching vertically instead of horizontally.

copper raven
#

youd need to script the missile id assume

past gazelle
#

Slight question off the above: Does anyone else launch a Titan AT/AP at a distant target by firing ~45 degrees above the target and THEN moving down to laze the target? I've just noticed AI soldiers doing that

winter rose
#

most likely done to have a top-down impact, I would assume 🙂

past gazelle
#

Hadn't thought of that, I was thinking it was to clear ground obstacles on a more regular basis...

winter rose
#

that too I'd say ^^

terse hollow
copper raven
#

make the launcher look straight up, and script the projectiles yourself

#

i mean i havent looked into something like this, but that would be my first approach, maybe someone else knows a better way

#

youd need to just do the launch part, then maybe use setMissileTarget

terse hollow
#

ah ok ty

tawdry oriole
#

Hey guys, BI fourms wont let me post anything (think its my web browser), so I thought I would give this a shot. Have a function thats so close to being finished and I cant for the life of me figure out this bug. Im very active on the fourms and pretty decent at google skills... nothing! anyone whos decent at scripting willing to take a look at it?? thanks!

final storm
#

Sure

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
tawdry oriole
#

got it cool

#

openMap true;
titleText ["Click desired strike target", "PLAIN"];

addMissionEventHandler ["MapSingleClick", {
    params ["_units", "_pos", "_alt", "_shift"];

    _assaultobj = createMarker ["_assaultobj", _pos];  

                                                  
    _assaultobj setMarkerShape "ICON";
    _assaultobj setMarkerColor "Default";
    _assaultobj setMarkerSize [1, 1];
    _assaultobj setMarkerType "hd_objective";
    _assaultobj setMarkerText "Objective";
    
    _sp = [getMarkerpos "_assaultobj", 50, 60, 3, 0, 60, 0] call BIS_fnc_findSafePos;                 // safe area from objective

    _assaultsp = createMarker ["_assaultsp", _sp];                                     // group start position at safe area
    _assaultsp setMarkerShape "ICON";
    _assaultsp setMarkerColor "Default";
    _assaultsp setMarkerSize [1, 1];
    _assaultsp setMarkerType "hd_start";
    _assaultsp setMarkerText "Assault Squad";    

    grpAssault = [getMarkerPos "_assaultsp",independent,["I_G_Soldier_F","I_G_Soldier_GL_F","I_G_Soldier_AR_F","I_G_Soldier_LAT2_F"]] call BIS_fnc_spawnGroup;
    grpAssault deleteGroupWhenEmpty true;

    _wp = grpAssault addWaypoint [_pos, 0];
    _wp setWaypointType "SAD";
    _wp setWaypointStatements ["true", "{deleteVehicle _x;}forEach units grpAssault; deleteGroup grpAssault; teamready = true;"];

    [player,striketeamcmd] call BIS_fnc_removeCommMenuItem;
         // take support away while team is active
    
}];

waitUntil{ missionNamespace getVariable[ "teamready", false ] };                    
// wait until waypoint finished or group is dead

striketeamcmd = [player,"striketeam"] call BIS_fnc_addCommMenuItem 
// give support back to call another team
// clean up markers
deleteMarker "_assaultsp";                                     
deleteMarker "_assaultobj";
#

Opens player map, on map click spawns two markers, an objective at map click and a nearby random start point in a safe area. At the start point a group will spawn with a search and destory wapoint on the objective marker. The group moves to the marker, and after the waypoint finishes the group is deleteed and the support becomes availabe again via the communication menu. Spawned as function because it will be used multiple times and contains waituntil conditions.

#

Problem 1: sometimes the group spawned is doubled, or duplicated. Not sure why

#

Problem 2: I runs this as a function, with spawn, and it works the first time fine. But the second attempt problem 1 usually happens AND the comm menu item is given right back, and the script never ends. I also get an error saying that [player] add comm menu #1 (or 2 or 3) is not there. I just want the support to be in active when the team is "deployed" and as soon as the Wp is complete or they die give it back to player. So close!

past gazelle
#

You might need to add some safety checks in there, if( not alreadyspawned) then {do everything;} so if the function DOES get called twice or gets called multiple times, it does nothing...

novel delta
#

bit of an odd question and sorry if this isnt the right place but im not sure where else to ask it

#

is there a way i can force a vehicles paint to be black in the init?

oak finch
#

Im trying to whitelist ranks with there own ace arsenal armory is this possible, its for a mission im working on?

copper raven
#

just like vanilla arsenal functions, ace also has a "global" option(which you should disable, by passing false into the function)

#

so adding stuff into arsenal locally for each player would be the correct approach id imagine

fading oar
#

Every time I try to spawn an object on top of another object (i.e. spawning a laptop on a counter), the top object flies off the bottom object and ends up on the ground some distance away. Is there a trick to spawning things like laptops on top of tables or counters?

winter rose
#

make their simulations disabled, or make them simple objects

#

(or make them slightly higher than needed)

carmine sand
#

Is there a way to change the weather overcast without any lags? Its needed for a effect we do, the overcast has to change from good to bad and when its over it has to go back to good. But its causing lags while change

Any ideas?

fading oar
#

thanks, I've tried disabling sim, but that often catches them in midair, I think making them higher should work, I'll try it now

winter rose
winter rose
fading oar
carmine sand
winter rose
#

I'm working with the Grabber/Mapper functions
(aren't they deprecated? I might be remembering wrong too)

you can also use isNil {} to have non-scheduled code executed 🙂

fading oar
winter rose
#

as long as they don't throw errors and work, don't mind me then 😄

cosmic lichen
#

Same is true for BIS_fnc_MP 😄

tough abyss
#

Where do I put this command and how do I run it?
["AmmoboxInit", [this, true, { _this distance _target < 10 }]] call BIS_fnc_arsenal;

thorn saffron
#

I'm trying to poke the vanilla revive as I want to add and tweak some stuff. However to do so I need to know how can put a unit in incapacitated state via scripts so I can test interactions and stuff. Any idea how to do that? The revive functions are using defines with make it hard to follow the flow of the code and even after I run the code with I assumed would incapacitate the unit nothing happened.
Also please do not tell me to use some other revive scripts, they all have their own problems.

winter rose
manic sigil
#

Ive got a trigger, I want it to register how many players of one side are in its area.

Am I correct in the conditions being

Condition: true
OnActivation: playersInsideVariable =  {_x side INDEPENDENT} count [allPlayers in thislist]
distant oyster
#

or

{side _x == independent} count (allPlayers inAreaArray thisTrigger)
``` might be faster
manic sigil
#

Thanks, I couldnt for the life of me get it to report accurately. I keep thinking onAct is a constant process, not just once t_t

little raptor
#

allPlayers inAreaArra thisTrigger
if the trigger is set to activate by any player, then it's identical to thisList

tough abyss
#

Hi everyone i am currently working on a Mission and want to create a sort of Time Jump thing. My Code is working on my Local MP but not on the dedicated Server.

call{
0 = [] spawn
{
[0,"BLACK",5,0] call BIS_fnc_fadeEffect;
skipTime 5;
Fahrer moveinAny Auto;
{_x moveinCargo Auto} foreach allplayers;
sleep 1;
[1,"BLACK",5,0] call BIS_fnc_fadeEffect;

};
}; That is the Code i am working to convert it to an remoteExec version but that gives me Headaches maybe some people here have better Ideas.

cosmic lichen
#

Got a weird issue I've never had before. My function ENH_fnc_log is not available in Eden Editor missionNamespace but it's available in uiNamespace.

#

CfgFunctions is the same as it has always been and the other functions seem to get initialized properly

#

Nothing in the rpt and recompiling didn't fix it as well

willow hound
tough abyss
willow hound
#

Is the Server only box ticked?

tough abyss
#

i guess it could work if i uncheck it but then the Code would be executed on every client am i right ?

#

or could i just transform the fadeEffect into remoteExec ?

willow hound
#

Probably something like this:

[0, "BLACK", 5, 0] remoteExec ["BIS_fnc_fadeEffect", 0];
skipTime 5; //Server only!
[Fahrer, Auto] remoteExec ["moveInDriver", Fahrer];
{
  [_x, Auto] remoteExec ["moveInCargo", _x];
} forEach allPlayers;
sleep 1;
[1, "BLACK", 5, 0] remoteExec ["BIS_fnc_fadeEffect", 0];
tough abyss
#

ok thanks i will test it later

willow hound
#

Why didn't you tell me earlier?

cosmic lichen
#

Curly brackets? Python doesn't...oh wait

undone flower
#

hey guys. how can I hide the "Development build" label on the bottom right corner? is there a 1 I can flip to 0 somewhere?

velvet merlin
#

whats the most simple method to determine what vehicles are currently on your screen and their [x,y] position from the screen center

tawdry oriole
#

anyone know how to "exit" a mission event handler?

#

private _mapclick = addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];

**a bunch of code that works fine including a group spawn**    

removeMissionEventHandler ["MapSingleClick", _mapclick];

}];

#

it just keeps running forever on map clicks, just need one map click and it to go away... anyone?

still forum
#

_mapclick variable is undefined

#

if you want the id of the eventhandler, see addMissionEventHandler wiki page, there is a variable inside the EH that has the ID

tawdry oriole
#

ok word, so it needs to be global

#

I have been all over the wiki and google, I cant figure it out

still forum
#

Since Arma 3 v1.64 the event handler handle is also stored in _thisEventHandler variable and is available during event handler code execution

tawdry oriole
#

the wiki says: _id = addMissionEventHandler ["type", whatever, whatever]; so by my understanding my code should work by assigning it _mapclick right???

still forum
#

Since Arma 3 v1.64 the event handler handle is also stored in _thisEventHandler variable and is available during event handler code execution

the event handler handle is also stored in _thisEventHandler variable and is available during event handler code execution

_thisEventHandler variable

is available during event handler code execution

tawdry oriole
#

sorry man I dont know what "the event handler handle is also stored in _thisEventHandler variable". im not new to scripting but new to event handlers and how they work. would it possibly be: _mapclick {true}???
Can you give a short example of how it should work? Thanks!

still forum
#

your code above was already mostly correct

#

just that _mapclick variable was undefined

#

but I told you that there is a different variable that you can use instead, and thats listed on the wiki page

tawdry oriole
#

mmmmm ..... params ["_units", "_pos", "_alt", "_shift", "some variable id" ]; ???

still forum
#

WHAT

tawdry oriole
#

Im close, but the script runs forever I need it to stop after a single map click, I can click forever and the script runs every time

still forum
#

Again.

just that _mapclick variable was undefined
your usage of _mapclick is wrong.
And you only use it in one place

removeMissionEventHandler ["MapSingleClick", _mapclick]; <-- here

There is no reason to change the params when only your _mapclick is wrong.

tawdry oriole
#

global then?

still forum
#

but I told you that there is a different variable that you can use instead

use a different variable instead of your _mapclick, and I listed that multiple times above

willow hound
#
_id = addMissionEventHandler ["Any", {
  systemChat str _id; //_id does not exist here, this is a completely different scope
  removeMissionEventHandler ["Any", _thisEventHandler];
}];

systemChat str _id; //_id is available here
tawdry oriole
#

Ok I used: removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; It now will not work the second time I spawn the function

#

I didnt know about the scope inside of the EH, so thank you for that. Learning!

willow hound
#

Is there more code around that block?

tawdry oriole
#

yeah but everything inside and outside works fine

#

You would think that "MapSingleClick" would only be.... a SINGLE MAP CLICK. But I essentially need to turn on/off the EH via a player action

willow hound
#

An EH removing itself should not impact your ability to create new EHs blobdoggoshruggoogly

tawdry oriole
#

Thats exactly how I feel lol

tawdry oriole
willow hound
#

Well, I would start the debug journey by confirming that the addMissionEventHandler statement is actually reached when your function is executed for the second time.

tawdry oriole
#

Roger that

#

so confirmed it is reached with systemchat, but the code inside wont work the second time around, and there are no erros.... 🤔

still forum
willow hound
tawdry oriole
still forum
#

Pretty sure you didn't try that, as that would've worked and its the same that ansin sent you

#

You sent this

private _mapclick = addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
a bunch of code that works fine including a group spawn
removeMissionEventHandler ["MapSingleClick", _mapclick];
}];
I said to not use _mapclick and use the variable that is listed on the wiki page, which is _thisEventHandler
Result:
private _mapclick = addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
a bunch of code that works fine including a group spawn
removeMissionEventHandler ["MapSingleClick", _thisEventHandler];
}];

And thats also the correct way to do it.

tawdry oriole
#

And I said that it doesnt work the second time... Should I upload a screen shot with arrows on it or....???

#

No Asin posted a helpful example code, which helped, thanks Ansin!

#

This code, Dedmen ---> removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; returns error "type any expected #"

finite sail
#

guys.. arrays of logics...

#

returns missing ]

#

[[logic 1,logic2].[logic4,logic 99]] etc

untold copper
#

GOAL:
Group in safe behaviour moves to position using combat / stealth calculated pathway / waypoints.

EDIT: I got it figured out! 🕺

||I have been using this method to create 'smart' patrols during the mission creation process.
However it is tedious to do; Run mission, generate waypoints, copy to clipboard, exit mission, then add waypoints to a group inside 3DEN... Aaaaand repeat.
I would like to save time and a little bit of sanity and make the process possible during a mission via a function.

WHY?
When not in combat, or aware behaviour, I don't like the way groups move in the safe behaviour ( Using roads, avoiding available cover and concealment positions ).
I also don't like aware behaviour as a patrol behaviour because units walk about with their weapons raised.
I do-do do doooo like combat and stealth behaviour, the path a group chooses I mean!

My function appears to be working, in SP testing, as it should for me.
But I have run into an issue when running the function on 2 groups on mission start.
I reckon the 'CurrentGroup' / 'ARO_pathArray' is the culprit, but it's only a guess.

GET TO IT, MAN!
I am looking for help with solving the above issue and for general advice on how to achieve my goal.

Script:||

#
/*
EDIT:

SOLVED!

I can't hide this and add on to the post, so I'll post the working example.
I've used CBA which is fine as I use it in all my missions anyway.

Now that it is working with multiple groups... optimisation time!

Any help with that will be truly appreciated!

*/


ARO_fnc_moveSmart =
{
    params ["_grp","_end","_bhv"];
    [
        (calculatePath ["man", _bhv, getPosATL leader _grp, _end]), "PathCalculated",
        {
            params ["_agent", "_path"];
            _thisArgs params [ ["_grp", [""]] ]; //    Doesn't work without the [""]. WHATEVER WORKS!!
            {
                private _debug = createMarker ["marker" + str count allMapMarkers, _x];
                _debug setMarkerType "mil_dot";
                _debug setMarkerColor "ColorRed";
                _debug setMarkerText (str count allMapMarkers);
                
                _wp = _grp addWaypoint [_x, -1];
                _wp setWaypointType "MOVE";
                _wp setWaypointBehaviour "SAFE";
                _wp setWaypointCombatMode "GREEN";
                _wp setWaypointFormation "LINE";
                _wp setWaypointSpeed "LIMITED";
                _wp setWaypointTimeout [0,0,0];
            } forEach _path;
        }, 
        [_grp]
    ] call CBA_fnc_addBISEventHandler;
};

[testGroup_A, getPosATL player, "combat"] call ARO_fnc_moveSmart;
[testGroup_B, getPosATL player, "safe"] call ARO_fnc_moveSmart;
willow hound
willow hound
untold copper
distant oyster
#

what is the most performant object one can use to create an object to store variables?

#

it has to be of type objNull and must not be the invisible helipad (don't want to mess with helis landing)

unreal scroll
#

How can I check that vehicle weapon is in reload state? Wait for 2.06? 🙂

little raptor
untold copper
little raptor
#

afaik it only has a visual LOD

copper raven
#

if you have CBA, CBA_NamespaceDummy?

#

@distant oyster

finite sail
copper raven
#

obviously that won't work

finite sail
little raptor
#
_obj setVehicleVarName "blabla1";
missionNamespace setVariable ["blabla1", _obj];
...

now if you stringize the array you get

[blabla1, blabla2, ...];

which can be converted back to actual array of objs

finite sail
#

Oh....setvehiclevarname .. on logics? Very cunning

#

Yes, that's going to work well, thanks

little raptor
#

in empty terrain (VR):

deleteVehicle ("UserTexture1m_F" createVehicle [0,0,0])
``` 0.43 ms
```sqf
deleteVehicle ("CBA_NamespaceDummy" createVehicle [0,0,0])
``` also 0.43 ms
#

on terrains with objects, it depends on the number of previously existing objects (normally ~3 ms; can go higher/lower)

willow hound
# untold copper I'd appreciate that. Cheers, and goodnight!

Alright, so what you can do is this:

params ["_grp", ...];

//If all groups have variable names you can skip this part and use those instead
if (isNil "ARO_NextGroupID") then {
  ARO_NextGroupID = 0;
};

private _grpIdentifier = "ARO_CurrentGroup" + str ARO_NextGroupID;
missionNamespace setVariable [_grpIdentifier, _grp];
ARO_NextGroupID = ARO_NextGroupID + 1;

(calculatePath ...) addEventHandler ["PathCalculated", 
  //String instead of code:
  "params ['', '_path'];
  {
    ...
    private _wp = " + _grpIdentifier + " addWaypoint [_x, -1];
    ...
  } forEach _path;"
];
wicked fulcrum
still forum
#

no way

wicked fulcrum
#

alright. Thanks for quick response.
I assume the direct-connect in the server-browser use some other internal way or possible get the ip from dns lookup first then. (Tried to see if I could find where it was defined in .pbos, but haven't been able to find it yet).

still forum
#

ye

winter rose
#

it would be engine-side I believe, nothing in data

wicked fulcrum
#

fair. Thanks 🙂

distant oyster
winter rose
dusky pier
#

Hi, trying to:

player linkItem "Binocular";

but nothing changed, what can be a problem with that?

warm hedge
#

Binocular is a weapon, so addWeapon

#

(IIRC)

dusky pier
#

Thank you @warm hedge !

real mango
#

Hi guys,
I was working on a script where I need to know very specifically what's my view angle (or FOV) when playing.
I looked up the possible script solutions and I saw both getObjectFOV and getResolution and both return the profile's settings of VFov 0.75 radians (~45deg) and HFov 1.333 rad (~75deg). When I tested in game though by using the screenToWorld command I noticed that from the left to right margin of the safezone I have 90 degrees rather than 75. Here's how I did that:

360 - (player getRelDir (screenToWorld [SafeZoneXAbs, 0])) + (player getRelDir (screenToWorld [SafeZoneXAbs + SafeZoneWAbs, 0]))

https://community.bistudio.com/wikidata/images/6/6b/UI_12-3.jpg

This works when looking straight ahead but when you start looking up towards the sky it will break as screenToWorld uses AGL. Any ideas on how to compute the actual view angle of a player? 🙏 thanks in advance

distant oyster
winter rose
distant oyster
#

well it doesn't seem to have the fsms for danger and formation enabled they are just blank in config

past gazelle
little raptor
#

but afaik it doesn't have any AI anyway

#

if you create it using createVehicle

distant oyster
#
[typeOf testlogic, testlogic checkAIFeature "AUTOTARGET"] //-> ["Logic",true]
[typeOf cursorObject, cursorObject checkAIFeature "AUTOTARGET"] //-> ["Land_CinderBlocks_F",false]
#

the logic is editor placed

little raptor
distant oyster
#

and also with createVehicleLocal

little raptor
#

if not just use those

#

¯_(ツ)_/¯

distant oyster
#
deleteVehicle ("Logic" createVehicleLocal [0,0,0])
Execution Time: 0.4203 ms  |  Cycles: 2379/10000  |  Total Time: 1000 ms

deleteVehicle ("UserTexture1m_F" createVehicleLocal [0,0,0])
Execution Time: 0.4392 ms  |  Cycles: 2277/10000  |  Total Time: 1000 ms
past gazelle
past gazelle
#

I captured a Quinlin yesterday and was loading it up with supplies when I accidentally rolled to 'place mine' (the anti-vehicle one and hit place by accident...

#

said mine...exploded instantly...

little raptor
winter rose
past gazelle
#

I thought those were manually triggered...

winter rose
#

not all of them 😄

past gazelle
#

Well, 7 hours into a an all-out-altis war my character died. 🙂

winter rose
#

satchels are """mines""" (same as claymores) that are manually triggered
others are sensor-based

distant oyster
past gazelle
#

I was just gonna disable the scroll action menu command but I can't find it anywhere...man that thing is poorly coded...

little raptor
#

¯_(ツ)_/¯

distant oyster
winter rose
winter rose
past gazelle
#

Just that, remove or replace the scroll action menu with something...more cool 😉

warm hedge
#

Isn't it possible via showHUD?

past gazelle
#

¯_(ツ)_/¯

past gazelle
warm hedge
#

Yes. I think I've done the similar while I tested the command

past gazelle
#

You know what I would like to make: a popup menu for the left hand that opens with TAB and let's you use alternate key presses WITHOUT having hold down keys...

#

Hmm, nope, not seeing anything for the scroll menu there...

#

Having played Starcraft II for a bit(I think i have an APM of 3-4) I can clearly see why repetative keypresses are better than key-combos

warm hedge
#

But even if there is a way, I'd say you shouldn't do that since we have no way to simulate the entire action menu

past gazelle
#

Right right, no, what I'm thinking of is that it'd just add an additional menu to the left side of the screen (showing the QWE/ASD/ZXC keys)

#

so like, if you are opening inventory a lot, you could just hit tab to get the alternate menu, then say E, because it's convinient rather than looking down for the 'i' key or mouse scrolling

#

let me photoshop an example

winter rose
past gazelle
#

Sorry for the delay I'm still mentally in 1997

#

But yeah, basically TAB would open the dialog menu on the left, then the next keypress would execute instead of armas default commands...

#

I have a feeling that could be hard to implement though...

#

Maybe not though, arma has to have a way of disabling key commands while typing in chat, right?

past gazelle
# winter rose

I dunno if you could just cut that section of the image and post it in here. I don't have image posting priviledges.

past gazelle
#

Appreciated, now I can delete the link.

winter rose
#

basically, "a numpad with orders" 🙂

past gazelle
#

Yeah basically, but then you don't have to keyhunt on the right side of the keyboard...

#

I have DCS and I haven't played it in years now because every time I want to fly a jet I have to spend 2 hours reviewing the correct key sequences or I can't get it off the ground.. 🙂

untold copper
willow hound
#

I don't know about the internals of CBA_fnc_addBISEventHandler, but there is hope that it's better than the wacky string solution (which creates lots of global variables) 🙂

faint sage
#

Hey, does anyone know how to make an AI unit (HVT) detected by my group side in MP scenario? I mean I want his kill task to appear on trigger when he is detected by my group/side but just can't figure out the script

willow hound
faint sage
#

_knowledge = (group player) knowsAbout _target; did not work

#

changed the name to hvt for target

willow hound
#

In what capacity does it not work? Does it generate an error?

faint sage
#

Nope, no error

#

The unit that will be detected on sight is named 'hvt'. The code is -
_knowledge = (side player) knowsAbout hvt;

willow hound
#

Where are you using it?

faint sage
#

On a trigger, connected to task

#

The trigger will create the task when activated

#

I have been looking hard at the hvt, it still does not trigger the task

willow hound
#

I imagine that is because you are doing it slightly wrong: The Activation Condition has to return a true-false answer, but _knowledge = (side player) knowsAbout hvt; returns (basically) nothing.
(What you are doing is you are assigning a number value to the variable _knowledge)

faint sage
#

Ah, okay?

willow hound
#

According to the Wiki knowsAbout returns the level of knowledge as a value between 0 and 4, so to get the required true-false result, you need something like this:

group player knowsAbout hvt > 2
```You might want to play around with the `2` a bit and try different other values between 0 and 4 (stuff like 1.5 is okay too), as I don't know if 2 is a good threshold value for `knowsAbout`.
cosmic lichen
#

knowsAbout is very tricky.

faint sage
#

Okay

#

Lemme try

#

Did not work on 1, 1.5 or 2

#

No luck

#

3, 4 no luck

#

What about targetKnoledge

willow hound
#

You can place group player knowsAbout hvt in one of the Watch Fields of the Debug Console (in the pause menu) to see if the result ever changes compared to 0.

winter rose
#

be wary of locality

willow hound
faint sage
winter rose
# faint sage How's that

knowledge is dealt locally (a.k.a if another player is leader of that group, you checking on another computer won't be the true value)

willow hound
#

I would do it that way, yes.

faint sage
#

0-4; 4 being maximum knowledge

#

Forget it, Imma just do Opfor detected by blufor on an area trigger

winter rose
#

ah, if the trigger is server-only and you have a dedi, well, player is obviously null there

copper raven
#

empty map vr blobdoggoshruggoogly

winter rose
#

can you try the empty helipad (I know, that's not wanted) and grass cutter?

also wouldn't a simple object work for setVariable?

copper raven
#

it would yeah

#
Result:
0.206313 ms

Cycles:
4847/10000

Code:
deleteVehicle ("Land_HelipadEmpty_F" createVehicleLocal [0,0,0])
#
Result:
0.64433 ms

Cycles:
1552/10000

Code:
deleteVehicle ("Land_ClutterCutter_small_F" createVehicleLocal [0,0,0])
winter rose
#

thanks for the tests 👍

copper raven
#
Result:
0.0065 ms

Cycles:
10000/10000

Code:
deleteVehicle createSimpleObject ["Static", [0, 0, 0]]

don't even need the scoped CBA thing for that

winter rose
#

w00t - but no rpt spam?

copper raven
#

nope 🤔

winter rose
#

ah well ¯\_(ツ)_/¯

#

Good to know, thankie!

past gazelle
# winter rose _no_

Sorry maybe I misunderstood your response: Are you saying that Arma does NOT have a way to capture the next keypress separately from normal input?

winter rose
past gazelle
#

Ahh okay, well I guess that means it's not totally an impossible idea...

winter rose
#

it's doable I think

#

painful but doable (anti-"that's what she said" protection)

faint sage
#

Same code that wasn't working before

wind hedge
#

(findDisplay 46) displayAddEventHandler ["KeyDown", is not able to detect right clicks right?

distant oyster
distant oyster
winter rose
#

and simple object is an object 🙂

distant oyster
#

yeah I will implement it and report back

#

so for a bit of background: I am creating an arsenal with different inventories on a single object. for this to work you can use ["Open", [false, cargoObject, player]] call BIS_fnc_arsenal in an addaction where the cargoObject is the object which holds the virtual weapon cargo added by the BIS_fnc_addVirtualItemCargo (and similar). These parameters haven't been documented until I added them.

wind hedge
#

But then inside the FNC, how do I detect if it is a right click?

wind hedge
#

can you point me to the number/value of XX?

still forum
#

Google "DIK key codes"

#

and then the Arma wiki page

wind hedge
wind hedge
final storm
wind hedge
still forum
wind hedge
smoky verge
#

is there a way to set the featureType of simple objects created by CreateSimpleObjects?

#

for example if I did something like

Harold = createSimpleObject ["/Harold", _pos];
Harold = setFeatureType 2;
#

would it work?

winter rose
smoky verge
#

oh true

past gazelle
#

sigh had six tabs for bi studios open looking at code and 50mb of texture files downloaded before I remembered one could just right click a vehicle in eden and set the texture that way...

graceful pewter
#

Looking for some help with the following:

  • create an action called "search object" - for example a box or furniture
  • start a timer for x secods
  • reveal the contents of the inventory or a message at the end of the timer
    Does something like this already exist? Is it possible?
#

Any help appreciated

misty osprey
#

can anyone help with a script I'm trying to check if the player has a radio backpack and then run a script if they do have the one of the backpacks this is the code I have but I don't know what's wrong

_Backpack = unitBackpack player;
_Radio = [ "CUP_B_Predator_Radio_MTP", "CUP_B_Motherlode_Radio_MTP", "CUP_B_Kombat_Radio_Olive", "B_RadioBag_01_wdl_F", "B_RadioBag_01_mtp_F", "B_RadioBag_01_tropic_F", "B_RadioBag_01_black_F","B_RadioBag_01_hex_F","B_RadioBag_01_oucamo_F","B_RadioBag_01_ghex_F","B_RadioBag_01_digi_F","B_RadioBag_01_eaf_F" ];

if ( _Radio findIf { _x = _Backpack } ) then {

hint "radio equipped";

};

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
warm hedge
#

Also, = is to define/declare, not to compare. To compare ==

somber radish
#

Any way to get AI units to holster their weapon? I am currently doing this:

_Unit action ["SWITCHWEAPON", _Unit , _Unit , -1];

But I do not get the result I want (It does work on player tho).

warm hedge
#

Possibly with selectWeapon?

somber radish
#
_Unit selectWeapon "";

Like this?

warm hedge
#

Maybe. I don't even tried that

somber radish
#

Ima try now

#

No luck

fair drum
#

where _unit is your unit object variable

somber radish
#

Sorry, I did not quite understand

fair drum
#

if 299 isn't the index that works for you, put in weaponIndex and search for the correct one

somber radish
#

aah

raw scaffold
#

is a strobelight possible for arma? if so how.

warm hedge
#

What kind of strobe light?

#

And does what?

raw scaffold
#

just a lamp or the yellow worklights

#

just go on and off continuously

#

for a horror/ interesting cqb effect

#

just cant figure how it would be done

raw scaffold
#

thankya

lapis jungle
#

Are the RopeBreak and RopeAttach eventhandlers Global or Local?

cosmic lichen
#

Only one way to find out

timber quartz
#

In Sensors Config Reference the range of the radar is specified using class AirTarget, also the vertical range using minTrackableATL and maxTrackableATL. Is there any way to specify the class and variables for each radar/AA vehicle individually?

Currently I have included this in the Description.ext file

class AirTarget
{
    maxRange = 200;
    viewDistanceLimitCoef   = 1;
    objectDistanceLimitCoef = 1;
};

class GroundTarget
{
    maxRange = 200;
    viewDistanceLimitCoef   = 1;
    objectDistanceLimitCoef = 1;  
}

minTrackableATL = 50;
maxTrackableATL = 2000;
copper raven
#

descriptionext won't work for that

willow hound
timber quartz
#

Cool, thanks I'll ask there.

tough abyss
#

How do you make those big Arsenal and Garage boxes?

willow hound
tough abyss
#

Ah, yes. Thank you.

#

Is there perhaps a way to disable certain types of guns/equipment?

tough abyss
#

Found them.

lapis jungle
#

@tough abyss if you're using ACE, why don't you just use the ACE Arsenal? Whitelisting or blacklisting items with that is very easy. Just double click the item in the Editor and scroll to the bottom

south knoll
#

Hello,
I have a function that basically drops a crate and it works in crate init in the Support Module: Supply Drop when used with execVM, but i moved it to a function and now it wont work.

Code: https://pastebin.com/HkuHRLEe

Thanks

tough abyss
warm hedge
#

“Doesn't work” doesn't help you. You should tell “what exactly is happening and not happening”

tough abyss
#

tried ace. ace no work. tried vanilla. vanilla no work. using virtual arsenal init.

lapis jungle
#

Note, I'm specifically talking about the ACE Arsenal included with the ACE mod. Not the BI Vanilla Arsenal that you guys are talking about.
ACE Arsenal is a simple matter of point and click.

I recommend you check the ACE documentation.
And yeah, what Polpox said... We can't help you unless you specifically tell us what you did, and HOW it didn't work

tough abyss
#

i just did

#

put virtual arsenal init. no work. shows me vanilla crate ui.

warm hedge
#

And, well, I suggest you to stick to ONE topic. If you wanted to post a picture, just put it into some image holder like imgur and post URL

south knoll
#

oh did you put [_this ,true] call ace_arsenal_fnc_initBox;

tough abyss
#

i cant post pics here

south knoll
#

need to use a img host its annoying, but its the only way

tough abyss
#

too lazy to retrieve my account on one of my private image hosts

warm hedge
#

Nope

#

imgur doesn't need an account AFAIK

tough abyss
#

not imgur

#

mine is called uploads.system

south knoll
#

imgpaste is my goto

warm hedge
#

Or just put your image into some private Discord channel and put the URL

tough abyss
#

???????

#

whyat

south knoll
lapis jungle
tough abyss
#

i asked and all support i'm getting is to use an image host

dusky wedge
#

Is it possible to make a commit for setVectorDirAndUp? So that the object changes its orientation for a certain time. Maybe this is possible using LinearConversion?

tough abyss
#

like

#

don't just tell me to use an image host, that is NOT helpful

warm hedge
dusky wedge
#

Oh thx

south knoll
lapis jungle
#

Could you paste the code you have in the init please?

south knoll
#

sure man

#

give me a tick to open my mission

warm hedge
south knoll
tough abyss
#

guess i won't ask for help then if i get warned for dumbass shit like "crossposting"

warm hedge
#

If you feel it is a dumbass shit, you can leave as you wish, sir

#

I'm happy to see the fix of your problem, though.

lapis jungle
#

Alright, so see how your _this is in an array there? ([]), that means you need to select the first item in the array, to get your object.

So, in your function itself put this:

params ["_oldCrate"];

And replace all instances in your function where you reference _this with _oldCrate.

south knoll
#

oh so, its not like a static reference then

willow hound
#

The function name is also not drop_newCrate 🙃

#

What does your CfgFunctions look like?

lapis jungle
#

Also that

south knoll
#

Pretty sure I set it up right?

lapis jungle
#

Cool, so your function name is on the top there

south knoll
#

so i can't use the subclass to call it?

lapis jungle
#
SupplyDrops_fnc_newCrate
#

You need to always reference a function by it's full name

willow hound
#

The category classes are just for filtering.

lapis jungle
#

Think of a function name as a variable that holds a code block. That's essentially all it is

south knoll
#

right, i was under the impression that you could use the subclass names.

#
class CfgFunctions
{
    class SupplyDrops
    {
        class drop
        {
            file = "functions";
            class newCrate {};
            class newVeh {};
        };
    };
}
#

thats my CFG

#

so pretty much add param and then call by the full function name and it should work?

lapis jungle
#

Yep

#

ShouldTM, sponsored by SoonTM. As we all know though, both of those can be quite deceitful

south knoll
#

nope nothing dropped.

crude vigil
south knoll
#

so its [_this] call SupplyDrops_fnc_newCrate;

crude vigil
#

it should be spawn, not call

#

u got waitUntil / sleep in ur function

#

thats the first thing.

south knoll
#

right

crude vigil
#

param[_this] is wrong in ur function

#

check the param page , you misunderstand the usage.

south knoll
#

yeah my code changed based on what @lapis jungle suggested

crude vigil
#

ok I didnt read that part, mb

lapis jungle
#

What does it look like now?

south knoll
crude vigil
south knoll
#

can I do that on the Arma 3 Laucnher is there an option

crude vigil
#

Yes there is an option for that

south knoll
#

nice ill go do that and try this out

#

with spawn key word

lapis jungle
#

What's the point in that switch? It's just returning the same thing regardless of the result

south knoll
#

Well, for now i wanted to test with one object but if it works it would change the box depending on side who called in the support

lapis jungle
#

Sounds good, I like your attempt at safe landing but... Why don't you just make the box invisible until after it's stopped moving?

#

Invincible*

south knoll
#

the box i use tends to just sink into the floor

lapis jungle
#

Invisible would just be confusing xD

#

Eh. Wut?

south knoll
#

its from a mod and is much bigger than the base ammobox so guessing the supply drop thing expects it to be the same size or at least have the same geo

lapis jungle
#

I... Ok, whatever works 🤷‍♂️

south knoll
#

honestly if i take the safe landing out it just goes into the floor everytime

#

could be the box geo is goosed on the custom object

#

Thanks a bunch

lapis jungle
#

HeHey! You see what happens when you ask for help without losing your temper?

Also. I think I know why it's going into the ground. You're attaching the box to the parachute, not the other way round....

#

Which means the box's collision is being ignored

south knoll
#

oh

lapis jungle
#

Now, I don't know if swapping them around will mean the parachute won't work or not.. but it's worth a try?

crude vigil
south knoll
#

okay ill see if that helps, one other question because I don't full get the argument passing of Arma 3 yet, this code will work on air dropping vehicles how would i pass a extra arg into this script to name a vehicle eg. ML700_Taurox_Stubber (I play in a 40K unit)

lapis jungle
#

Or that I guess

crude vigil
south knoll
#

true

#

But how would i pass a object arg into this

crude vigil
#

you are doing it already

south knoll
#

do i just add another param?

#

I dont think you follow

#
_crateType = switch _side do {
case 0:{"ML700_Taurox_Stubber";};
case 1:{"ML700_Taurox_Stubber";};
case 2:{"ML700_Taurox_Stubber";};
default {"ML700_Taurox_Stubber";};
};
crude vigil
#

nevermind, I didnt really read your function properly and just went with what I believed it to be ^^"

south knoll
#

how can I add a arg to replace the ML700 with param _Car

#

I tried reading the article on params but i didnt get it

crude vigil
#

In that case, I believe you would want to replace the "land_tiow_astartes_scale_weapons_rack_01_blood_angels" part with an additional input as you said

#

params is basically getting index by index the values and assign them the name you give

#

_oldCrate is basically _this in your script

south knoll
#

so then if i add more args it becomes _this[0] _this[1] ect

crude vigil
#

cos it is the 1st parameter you pass...
for e.x if you had something like [_this, "ML700_Taurox_Stubber"] spawn blabla
then params ["_arg0", "_arg1"] would simply be _this and "ML700_Taurox_Stubber"

#

yes

south knoll
#

I hate how game engines complicate coding sometimes every time i try to mod a game it's like learning a new language again

crude vigil
#

Think like you call/spawn with bunch of materials right? Im talking about [] part of it

#

that [] part comes to your function as it is

south knoll
#

yeah so its indexed from left to right

crude vigil
#

if you do : [apple,banana,peach] call/spawn myFnc; then you get [apple,banana,peach] in your function as the params

lapis jungle
#

Zero based, yes

crude vigil
#

yes

#

if you dont like params, you can also use
private _oldCrate = _this select 0; and so on

#

there are many ways... another way is param command for e.x which also easily checks for you if parameter type is as you want otherwise returns error, up to you really.

south knoll
#

wait, so if i have param ["_a"] and param ["_b"] how does the engine know what to put in A and B unless i tell it _a = This 0 and _b This 1

lapis jungle
#

Yep. And like Talya says:

private _oldCrate = _this select 0;
private _crateType = _this select 1;

It's exactly the same as

params ["_oldCrate", "_crateType"];
south knoll
#

oh you assign it as an array for params

crude vigil
#

no, you receive an array cos you passed [_this]

lapis jungle
#

Parameters are sent to the function as an array, pure and simple

crude vigil
#

[_this] is an array

#

so function receives an array

#

you can also send it only the object as well... like _this spawn myFnc

#

in here you pass an object, not an array

south knoll
#

okay noob question can you send multiple objects to a function

lapis jungle
#

Yes

south knoll
#

but not in a array

lapis jungle
#

Oh

crude vigil
#

nope

south knoll
#

right

warm hedge
#

You can send ANY variables if you wish

lapis jungle
#

You allergic to arrays or something?

#

xD

south knoll
#

no, just wanted to get my head around it

lapis jungle
#

Ah

crude vigil
#

array serves as a list, to send multiple stuff, you need an array...

south knoll
#

yeah, C# is my main lang so dealing with lists is fine, just wanted to double check object notation

#

Genuinely thanks for going over all this with me, you probably get asked these same questions like 1000s of times.

crude vigil
#

It is normal you get confused with params as a new starter imo. Cos params command if doesnt have a left hand side parameter, automatically assumes "_this" (which is the input received by function) and params get the info from there...

#

Which is hard to figure out as a new starter.

lapis jungle
# copper raven use an array instead

Also, what sharp was saying.
Your whole switch can be simplified. Just let the_side get the type for you from an array. You're essentially manually checking each index anyway.....
So just do this instead:

private _crateTypes = ["create_type1", "crate_type2"];
_crateType = _crateTypes select _side;

It'll use the result of side to get you the appropriate index of the array without any extra effort.

#

Less is more :)

south knoll
#

Yeah, on that note the as Talya mentioned i can get the bounding box of the object if i do that can i just then attach the bounding box to the parachute?

lapis jungle
#

What. The bounding box isn't separate to the object. The dimensions of the object are used to produce the abstract thing that is the bounding box

crude vigil
south knoll
#

its just a point array

#

okay

crude vigil
lapis jungle
#

It's just a method of describing the dimensions of an object in it's simplest terms

#

A square

#

Using two points only

crude vigil
#

There is a picture in the page that describes it well

lapis jungle
#

Yeah, although here's a question.... In Zeus, I know that when you lift something quite high, it'll automatically deploy a parachute. Does this not happen for an object lifted up via script also? I'm thinking that attaching it to a parachute manually may be unnecessary?

south knoll
#

dunno, may just drop it right down as its spawned by engine not the zeus module

#

worth a gander

lapis jungle
#

Found it

#

Stick it in the air, then execute that command. Let us know what happens

crude vigil
#

Isnt he working on in editor

#

Zeus already has its own handler for objects dropped in air for paradropping.

#

Dont know if 3den has something for that.

south knoll
#

could I use the boundingBox and getTerrainHeightASL with lineIntersectsWith?

#

then on true just remove shoot?

lapis jungle
#

He's working in editor, yes. But the command shouldn't care.
Looks like it's intended for Zeus, but if you look at it, it just checks height and if it's above a certain it deploys parachute.
Literally, that's it.

It means we don't need to do any calculations, any safe landing checks and manipulations, etc. Just let the engine do the work

crude vigil
south knoll
#

wouldn't lineintersect be better tho as it will raycast?

#

i could do if X = Y but was thinking of intersect been a bit better as it will keep an eye on it and be more accurate?

crude vigil
#

Write a while loop, while the object is being dropped, get its boundingBoxReal values, boundingBoxReal values return "positions **RELATIVE **to the object" , you need to convert them to world space, then convert this world space using modelToWorld , modelToWorld returns you a value called positionAGL, this positionAGL is enough for you for paradropping reasons. Check if Z value of this new position is around 2 or 3 and if so , drop it , otherwise keep checking.

south knoll
#

wouldnt a while loop cost more processing?

crude vigil
#

getTerrainHeightASL isnt doing what you assume it is doing

#

either you misunderstand that or you do not notice you ll need a while loop either way? :P

#

or you expect lineIntersectsWith to do some magical stuff

#

Also lineIntersectsWith command is quite a costly command

south knoll
#

oh so its a fire once function

crude vigil
#

well all commands are like that.

#

it is not a function ^^

lapis jungle
#
  1. Don't put the bounding box calculations in the white loop, put them before, save the relative position and then use the modelToWorld inside the loop if a while loop is the way you want to go

  2. Try this out:

[objnull, _object] call BIS_fnc_curatorobjectedited;

Use it instead of all your attaching of the parachute, and all the safe landing calculations you've got going on. See if it works, and let us know. I really think that using it will be better than trying to manually do what the command above does anyway.

south knoll
#

yeah will do

lapis jungle
#

So?

crude vigil
#

curator is zeus function

lapis jungle
#

It is

#

So what?

south knoll
#

I am but @lapis jungle thinks it may work once the lobby is loaded

crude vigil
#

curator functions ... dont work in 3den >.>

lapis jungle
#

Aye

crude vigil
#

3den has its own event handlers

south knoll
#

yeah but Im superseeding them by calling a script

#

it may just be crazy enough to woek

lapis jungle
#

At which point, you're in Zeus territory

crude vigil
#

@south knoll What is this script for? Are you writing this function to fulfill your need in a zeus mission?

south knoll
#

nope didnt work

crude vigil
#

And if he is a zeus, he doesnt need a script at all... Zeus base event handlers already got him covered

lapis jungle
south knoll
#

I assume that is what you meant?

lapis jungle
#

Eh. You need to change it's altitude for it to take effect mate

#

Or at least, that's what it states

south knoll
#

it gets dropped from a plane

#

so it may work but the plane may not be high enough for it to trigger

lapis jungle
#

Wait. What? Where's the plane in all this?

south knoll
#

Support Provider: Supply Drop

lapis jungle
#

Alright, I have zero experience with that module(?)

south knoll
#

that way i can connect it to Support Requester and have a player able to call in stuff

lapis jungle
#

Ah

#

In that case carry on with Talya's method. I need to sleep anyway

south knoll
#

but by default it drops the basic ammobox with the BIS arsenal

lapis jungle
#

Wait

#

All you're trying to do is swap the crates out?

south knoll
#

yeah?

crude vigil
#

You can switch crate type afaik

lapis jungle
#

So... Yeah, that

south knoll
#

I did not find anything online for that

#

if you guys got a suggestion to make my life a lot easier im all ears

crude vigil
#

ah nvm, it is after crate is created

lapis jungle
#

As in, the function is executed after?

#

So. If there's no function at all, what happens?

#

How much of this does this provider handle on its own?

crude vigil
south knoll
#

ill check pretty sure it just drops a ammobox

lapis jungle
#

Alright, I'm out. Good luck, good night, and good huntinggoogling

south knoll
#

yeah it drops a ammobox with stuff in it

crude vigil
south knoll
#

well, im think so

#

may just rip out the side code

#

would simplify the code to be generic to drop anything in

crude vigil
#

if you gonna drop only 1 type, then you dont need to calculate all the stuff. You dont need bounding box, you can just make an "estimation" and do it accordingly.

#

The script I described would support any container you wanna drop though that is passed through parameters.

#

Cos boundingBoxReal would check the size of it and that way it would support any container you wanna drop in

south knoll
#

yah any container that way can use it to drop transports in

crude vigil
#

that would be up to your parameters. You are already passing crate type.

#

instead of switch, you ll simply take the _newCrate as parameter and use that

#

so it will now be something like
[_oldCrate, _newCrateName] spawn yourFnc;
or
[_oldCrate, _newCrate] spawn yourFnc; (more comfy, you would put any box around the map you want and pass the variable of it into this script, that script would fetch it for you and attach it to your parachute, easier than passing a class name that u would need to look for around)

fair drum
#

anyone know how to make a boundary marker like in this image from the beyond hope campaign where everything outside of the playzone is shaded?
https://imgur.com/a/eAwlAew

tough abyss
#
class CfgSounds
{
 sounds[] = {};
 class music1
 {
  name = "music1";
  sound[] = {"\sounds\music1r.ogg", 300, 1};
  titles[] = {0,""};
 };
};
#

Does anything there seem wrong scripting wise? My folder name is sounds and the file name music1r (ive tried changing everything to music1 but no change) but keep getting told it cant find the sound file

summer pelican
#
params ["_veh"];
if (!(missionNamespace getVariable ["r0ed_SurvivableCrashesVar_ModEnabled", true])) exitWith {};
_vehKindWhitelist = missionNamespace getVariable ["r0ed_SurvivableCrashesVar_VehicleKindWhitelist", true];
if (_veh getVariable ["r0ed_SurvivableCrashes", false]) exitWith {};

private ["_isAllowed"];
_isAllowed = false;
{
    _vehType = _x;
    if (_veh isKindOf _vehType) then {
        _isAllowed = true;
    };
} forEach _vehKindWhitelist;
if (!(_isAllowed)) exitWith {};

_veh setVariable ["r0ed_SurvivableCrashes", true];
_veh setVariable ["r0ed_SurvivableCrashes_NotShotDown", true];

_veh addEventHandler ["HandleDamage", {
    private ["_veh", "_part", "_dmg", "_index", "_health","_returnVal", "_isCrash"];
    _veh     = _this select 0;
    _part     = _this select 1;
    _dmg     = _this select 2;
    _index     = _this select 5;
    _isCrash = false;
    _returnVal = _dmg;
    _health = 0;


    if(_index == -1) then { 
        _health = damage _veh;
    } else { 
        _health = _veh getHit _part; 
    };
    if(_health == 1) exitWith {};
    if (_health + _dmg > 0.88) then { // this is wrong and needs to be fixed
        if (_index == -1 or _part == "hull_hit") then {
            _returnVal = 0;
            _isCrash = true;
        };
        if(_isCrash) then {
            if (_veh getVariable "r0ed_SurvivableCrashes_NotShotDown") then {
                _veh setVariable ["r0ed_SurvivableCrashes_NotShotDown", false];
                [_veh, _this] call r0ed_SurvivableCrashes_OnVehicleCrash;
            };
        };
    };
    _returnVal
}];```
#

having issues with survivable heli crashes

#

its unhappy with line 13 "_isAllowed = true;"

#

} forEach _vehKindWhitelist;
if (!(_isAllo>
17:24:57 Error position:
if (!(_isAllo>
17:24:57 Error foreach: Type Bool, expected Array,HashMap
17:24:57 File r0ed_SurvivableCrashes\functions\fn_vehicleInit.sqf..., line 13
17:24:57 Error in expression
_isAllowed = true;

fair drum
#

please use

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
summer pelican
#

ahh

#

sorry bout that

fair drum
fair drum
#

its not finding anything, thus making it become true which is default. you can't do a forEach with a bool value

tough abyss
summer pelican
#

wait so what do i change

fair drum
#

hop in a voice channel below and i'll explain it

tough abyss
#
class CfgSounds
{
 sounds[] = {};
 class music1
 {
  name = "music1";
  sound[] = {"sounds\music1r.ogg", 300, 1};
  titles[] = {0,""};
 };
};

Is this what you meant?

copper raven
#

so fix that, preferably defaulting to empty array instead

fair drum
tough abyss
#

Doesnt seem to be

fair drum
#

let me see your whole description.ext file. just post it on sqfbin.com

#

or pastebin for a .ext (use the .hpp extension)

tough abyss
#

that is my whole description.ext file lol

#

should there be more?

fair drum
#

nah. are you reloading the mission preview every time you change that file? cause config files are loaded every time you go back to the editor

#

so if you change it while preview is still running, nothing "actually" changes

tough abyss
#

what dyou mean by mission preview sorry?
each time i change the description.ext i save it, alt tab back into editor, save it and then relaunch the scenario

fair drum
#

yeah as you should. mission preview is where the mission starts and you are running around in the editor

#

I'm not seeing any problems with your code now though. can you verify your file path. maybe you have the file labelled sound instead of sounds? actually, check the extension of the file and make sure its .ext and not something accidental like .ext.txt

tough abyss
#

forgot to rename the description file to .ext

#

thanks for the save there

#

is there anyway i can make it loop so its playing 24/7?

fair drum
#

local execution

#
addMusicEventHandler ["MusicStop", {
    playMusic "music1";
}];

every time the music ends, it will start that specific music class over again.

#

start the initial cycle with just playMusic "music1"

still forum
copper raven
#

there's alot more to do in that code than just that 😄

tough abyss
winter rose
#

NO

#

this part```sqf
addMusicEventHandler ["MusicStop", {
playMusic "two";
}];

#

@tough abyss ↑ 🙂

quick abyss
#

Trying to make a live camera feed with game logic, everything works fine but I need to rotate the camera in the sqf code, so far I just have position coordinates, I’m completely new to this how do I add a rotation cord?

winter rose
quick abyss
#

Game logic Zeus module

#

And I just put it on a camera lens

#

I’m new so sorry if I explained badly

winter rose
#

no it's just that I don't really know how modules work, so let's wait for someone who does 😆

quick abyss
#

Ok ✅ 😆

fair drum
#

BIS_liveFeed is going to be your camera created by the module. After full init of the system, you can edit this camera just like how you would any other camera.

graceful kelp
#

could use some quick help with vehicle player
so vehicle player works with players but i want the equivilant for ai would vehicle player work for ai or is there something else i would need

fair drum
#

vehicle Bob

#

or if using a function:

Bob call ROS_fnc_getVehicle
params ["_unit"];

private _vehicle = vehicle _unit;

_vehicle
dreamy kestrel
#

I am finding HASHMAP to be extremely expensive. I have some sectors being maintained with some variables that need to be published to listening managers. When the key+value pairs are rolled up, I am using HASHMAP over the range of variables and sectors. And finding a severe dip in FPS at the same time, to literally 1 FPS. FPS recovers, but why does it dip like that at all?

Now... rinse and repeat that in the context of a CBA statemachine in which it gets an array of the same sectors, every time this sequence is evaluated for publication to the listening managers. No bueno, no bueno...

still forum
#

Sounds more like bad code, rather than hashmaps being bad

dreamy kestrel
#

hmm ok, I stand corrected, does not seem related to the map at all...

#

after running a snippet in the debugger performance eval

dreamy kestrel
#

so my assessment at the moment is this, unless you have a good reason to, avoid allMissionObjects.

fair drum
astral dawn
#

just use the magical arma script profiler and you will see what takes so long to compute magic

#

magic made by (ง •̀_•́)ง himself magic

dreamy kestrel
#

yeah that does not actually help in this instance. it is all buried behind CBA statemachine clockwork. plus I think it is an A3 primitive, not a function, as I mentioned.

#

as it stands I put CBA setting plumbing in to be able to enable or disable CBA statemachines on the fly to try to isolate which one(s) might be causing the issue.

dreamy kestrel
#

so... Q: how is it that special vars can be injected into a callback function? you arrange for variables by those names in the calling context then invoke the callback? is that the secret in the sauce?

copper raven
#

they carry over like any other local variable

weary fiber
#

does anyone know how to create an infinite ammo script for vehicles? i have a script that makes a magazine infinite for vehicles, for example the ammo will never run out on the MG. Same goes for the cannon, but even though i have infinite cannon ammo, it still makes me reload between shots, i need a script that lets me fire the cannon as fast as i want without reloading each shell

warm hedge
#

@weary fiber Please stick to one channel per a topic

winter rose
copper raven
#

oh yeah true, missread meowsweats

winter rose
fervent kettle
#

Is this valid?

onPlayerRepsawn.sqf

if ((hasInterface) && (leader player == player)) then {
    {
                [player, _x] call BIS_fnc_removeCommMenuItem;
        [player, _x] call BIS_fnc_addCommMenuItem;
    } forEach ["cCMags", "cCMortar", "cCMG"];
};
livid wraith
#

is there a simple/proper way of telling when arty/mortar is done with it's doArtilleryFire mission ?

#

is canFire being blocked by a firemission ?

slate cypress
#

when referring an object which is placed in editor, can I just use the variable name in sqf from an event script or do I need to do something else

copper raven
#

yes

livid wraith
#

if you've set a variable name on it, it's available in the global missionNamespace (IIRC) as <your_var_name> in any script

willow hound
willow hound
unreal scroll
#

Is there any difference for waypoints behaviour for land and air units/groups?
It seems like groups with air units keep all waypoints all the time, unlike the land ones? Is it supoosed to be?

lusty oasis
#

How do you spawn the USS Freedom (the aircraft carrier) while in zeus. Using ZEN and the module isn't working

fervent kettle
crude vigil
willow hound
fervent kettle
#

Okay

#

do the ID's start with 0 or 1?

past gazelle
#

If I add an action to a corpse using _unit addAction ["Request Retrieval", {execVM "functions\fn_corpseHandler.sqf"}];

How can I later remove the same action from inside fn_corpseHandler.sqf?

#

Should I pass _unit as an argument via execVM?

crude vigil
past gazelle
#

Er, so I should...capture it into a variable?

crude vigil
#

Dont you want to remove it upon script is called (Like action activated -> character is buried -> remove action) ?

past gazelle
#

Yeah, that's exactly what I want to do...

#

I'm just not sure how to type it in.

willow hound
past gazelle
#

Would that be using params inside fn_corpseHandler.sqf?

crude vigil
#

inside your function, add the line (_this # 0) removeAction (_this # 2); at the end.

past gazelle
#

Getting "Error zero divisor"

crude vigil
#

can you post the script (if it is long, post it on pastebin etc)

willow hound
#

execVM "functions\fn_corpseHandler.sqf" is not the way to go 🙃

past gazelle
#
systemChat "Corpsed...";
    (_this # 0) removeAction (_this # 2);```
#

That's literally all that's in there right now...

past gazelle
crude vigil
#

you need to pass the parameters of course >.>

willow hound
#

I recommend using CfgFunctions, but aside from that there is no _this if there are no parameters, it was more intended as a hint for Talya_taya.

past gazelle
crude vigil
#

yeah, I really am not used to this execVM thing my brain just skips haha

past gazelle
#

The other function I have was defined in cfgfunctions so...

crude vigil
#

mission makers' stuff, yuck

#

cfgFunctions is not needed, you just need to call _this execVM <yourFunc>;

#

@willow hound what notlikemeowcry

willow hound
#

You are right, simply passing the arguments to execVM works, but the file already follows the A3 Functions Library name scheme and CfgFunctions is already present notlikemeow

crude vigil
copper raven
#

if its called only once in the mission + scheduled, its ok to use execVm

slate cypress
#

To get the class name of that aircraft carrier, you will need to go into Editor and look it up.

willow hound
#

USS Freedom is not a single vehicle, it's a special snowflake.

crude vigil
#

^ For that reason, it is probably not added into Zeus.

slate cypress
#

Oh, didn't know

#

No way to spawn with scripting in real-time?

copper raven
#

you can

crude vigil
#

You need to calculate the positions relatively and put them all together like bricks though

cosmic lichen
#

Try to spawn it in Eden Editor and use the Export to SQF thingy

#

If you are lucky it works

crude vigil
#

I think there are also the scripts for it to make it work properly (give additional functions as in its own missions) which would need to be called separately.

past gazelle
#

Sorry for the delay, now I got "Type string / expect code"

#

I think I'll just have to pick this one up tomorrow...

#

Thanks!

lusty oasis
winter rose
willow hound
quick abyss
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
quick abyss
#

thanks 👍

winter rose
quick abyss
#

ok i will try that

meager epoch
#

Can i somehow force the boat driver to dock the boat closer to the shore cause he always stops like 2-3 meters behind my hold/move waypoint which is near the shore

winter rose
#

most likely not as it is AI
unless you drive yourself or record the path yourself

meager epoch
#

How can i record the path

#

That sounds like super useful

#

Cause the ai is braindead

winter rose
#

see BIS_fnc_unitCapture/BIS_fnc_unitPlay
the AI can still take over after that if needed

meager epoch
#

Ait thanks, will check it out

fresh geyser
#

Is it possible to fire vehicle weapons directly, or at least direct AI to fire instantly? I'm looking to time gunfire on sync with timestamps in a song

tough abyss
#

Hi all, does anyone have a clue of where I can find a simple ai recruit script nowadays? I used Bon's infantry recruitment before but since armaholic is down I can't find a way to get it anymore

tough abyss
#

Got it, using spyder addons works like a charm👍

quick abyss
#

What’s some good tasks to try and master to learn sqf well? I’m kinda jumping in a bit too deep and don’t really know where to start

winter rose
#

🤣 ouch
but yeah that command may… be tough indeed

brazen lagoon
#

lmao

#

yeah it is definitely better to put things in custom cba inits

pulsar bluff
#

@still forum we could avoid it better if we had a “nearestSimpleObjects” command

#

how to find all simple objects with 100 m radius

winter rose
#

ooor nearestObjects + select { isSimpleObject _x }, too
no need for allMissionObjects bruteforce

#

that would already be an improvement

last rain
#

Is there a way to find an array of all the weapons and equipment available during the mission (equipment those in the Arsenal)?

tidal ferry
#

Hey, question, is there any way I can execute code whenever Zeus takes control of an AI?

meager epoch
#

Ok so... I have this boat and everyone on it is being ejected after it reaches a certain spot. Once ejected, one of the AI soldiers is supposed to run to a certain place... however, instead of running, he gets back on the boat, despite it being locked.
Any idea why this happens and/or how to fix it?

#

By the way, the move command works. I destroyed the boat and he started going where he's supposed to go. The only problem is him getting back on the boat for absolutely no reason at all.

crude vigil
meager epoch
#

lmao ait, will give it a shot

crude vigil
meager epoch
#

Every time i have to interact with the ai, i lose a braincell

dreamy kestrel
crude vigil
silent latch
#

Are lightpoints local even if created using createVehicle and not createVehicleLocal?

warm hedge
#

Local AFAIK. More like you can't createVehicle it IIRC

silent latch
warm hedge
still forum
winter rose
#

maybe I should test again, but I thought it did

winter rose
#

although nearObjects seems better (no living entities)
but not it doesn't

#

neither does nearestObjects, hmm.

#

so allSimpleObjects [] select { _x distance2D player < 20 } works

#

@pulsar bluff @still forum ↑ for now

still forum
#

what is that slow command that finds near objects?
nearestObjects? is that the slow one?

#

the one that filters by classnames

winter rose
#

both near(est)Objects filter by classnames

placid trellis
#

I come seeking knowledge

{
player addAction [("Say " + _x), {[_x] execVM "script.sqf"}]
} forEach ["abc","def","ghi"]

I'm attempting to write a script that gives the player actions for certain strings (using "abc" as a placeholder).
The actions show correctly, but when trying to run them, the game returns that the passed parameter is undefined. For example, if "script.sqf" was hint (_this select 0), it should return the string equal to _x, but instead it throws an error.
I'm assuming that is the result of using the magic variable "_x", so is there a workaround? Or would I have to write out addAction commands for each item?

still forum
#

correct, local variables don't carry over to completely different scripts

proven charm
#

which one it is, a feature or bug that local variables exist in the inner scopes?

proven charm
little raptor
#

you can always use private if that's not intended

proven charm
#

yep

pulsar bluff
hollow plaza
#

How would I go about making an attached object follow the movement of a characters eyes?
Currently I've got an object attached to an AI character's head but obviously it won't follow up if the AI turns their head without turning their body.

little raptor
hollow plaza
#

Functions as it should now

winter rose
still forum
#

will save perfs if you have a usecase that needs that

winter rose
still forum
#

definitely

still forum
#

Back at the multithreaded insert unique :wob:

Code:
_array = +BigArray;
_array insert [-1, BigArray, 2];
count _array;

Multithreaded: 129381 ms
Singlethreaded: 345089 ms

with 204418 elements in the array
:wob:

little raptor
#

I thought you said won't do

#

multithreading I mean

still forum
#

Because our multithreading code was too bad, but I made it better

50 element array
Single: 0.0297 ms
Multi: 0.0567 ms

Before my optimizations

single: 0.0452ms
multi: 0.155 ms

#

multithreading overhead was at 100us which was too bad.
I got it down to 20-30us

still forum
#

no

little raptor
#

nice 👍

winter rose
#

easy, make a command that does it all!```sqf
multithread {
{ /* do something costly */ } forEach allMissionObjects "";
};

cosmic lichen
#
 multithread {
   { /* do something costly */ } forEach allMissionObjects "";
 };
};``` @winter rose
winter rose
#

even MOAR performance!!1!

cosmic lichen
#

Just give us an command to set the fps
setFPS 120 😄

little raptor
#

give us command to set RAM
myPC setRAM 128

winter rose
#

-runOn640KB should be enough, I think!

still forum
#

100 elements

ST: 0.0912 ms
MT: 0.0994 ms

120
ST: 0.124039 ms
MT: 0.119503 ms

150
ST:0.186359 ms
MT: 0.158629 ms

so 120 is about break even now

little raptor
#

does it activate after a certain size?

still forum
#

not sure what i should do. Either I let the scripter decide, or I let the scripter decide and have additional size check

little raptor
#

Either I let the scripter decide, or I let the scripter decide
both

still forum
#

Single: 0.0019
Multi: 0.0233

little raptor
#

yeah I'd say go with size chck

proven charm
#

is there a reason why gmControls is sometimes undefined when created like this: ```sqf
with uinamespace do
{
gmControls = [];
gmNextButtton = controlNull;
};

winter rose
#

``` *

proven charm
little raptor
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
warm hedge
#
//Your code
little raptor
#

you can just copy paste the template

proven charm
#

sometimes when I have code: ```sqf
with uinamespace do
{
gmControls pushback gmNextButtton;
};

#

I get error saying gmControls doesnt exist

#

idk why

little raptor
#

because it doesn't?

warm hedge
#

Welllll...... so don't we. Post the entire code

little raptor
#

just use getVariable

#

or put an isNil check

proven charm
#

the gmControls is used only in that file so I dont know why its undefined.. maybe i did some simple mistake but cant see it yet

little raptor
still forum
#

You are using with uiNamespace do, but also uiNamespace setVariable ["phaseText", _txt]; inside the do?

#

Whats the purpose to change the namespace when you use setVariable to specifically target the namespace anyway

#

I remember some problems with with namespace do some years back, where some other scripts can switch the namespace back without you knowing. Don't know if thats still a thing

still forum
#

why are you even using uiNamespace there? I don't see any need, might aswell be mission or localNamespace

#

thats probably both easier and safer

proven charm
proven charm
little raptor
#

because it's not indented meowsweats

copper raven
#

indentation is non existant meowsweats

proven charm
proven charm
still forum
#

Ah right, controls in missionNamespace cause issues

copper raven
proven charm
little raptor
#

use an IDE

proven charm
copper raven
#

as an example

proven charm
#

from the "with" wiki: NOTE for the reasons unknown, namespace switching might unexpectedly occur inside some scopes (for, if, try, call) started in scheduled scripts (canSuspend true) after small suspension if with was not the main scope. For example:

copper raven
#

you wanna tell me

if(!isCustomBattle) then
{
{
  _x call retAllBattleGroupsToPool;
} foreach [east,west];

// Delete depleted forces here (Should have returned to pool)
{
_force = _x;

if(!([_force] call isForceAlive)) then
{
if((_force # FORCE_SIDE) == (call getPlayerSide)) then
{
 hint "Your force was destroyed"; // Todo better msg to player
};
[_force] call deleteForce;
}
else
{
if(_loser == (_force # FORCE_SIDE)) then
{
_loc = [_force] call getForceFleeLocation;
if(_loc != "") then
{
 systemchat format["Fleeing to %1", _loc];
 [_force,_loc] call moveForceToBattleloc;
};
};
};

} foreach [curPlrForce,curEnemyForce];

};

is more readable than

if(!isCustomBattle) then
{
    {
        _x call retAllBattleGroupsToPool;
    } foreach [east,west];

    // Delete depleted forces here (Should have returned to pool)
    {
        _force = _x;

        if(!([_force] call isForceAlive)) then
        {
            if((_force # FORCE_SIDE) == (call getPlayerSide)) then
            {
                hint "Your force was destroyed"; // Todo better msg to player
            };
            [_force] call deleteForce;
        }
        else
        {
            if(_loser == (_force # FORCE_SIDE)) then
            {
                _loc = [_force] call getForceFleeLocation;
                if(_loc != "") then
                {
                    systemchat format["Fleeing to %1", _loc];
                    [_force,_loc] call moveForceToBattleloc;
                };
            };
        };

    } foreach [curPlrForce,curEnemyForce];

};
proven charm
#

I can read both 🙂 my eyes are used to it...

copper raven
proven charm
#

ok so namespace can change inside with. that has to be the problem...

little raptor
#

where some other scripts can switch the namespace back without you knowing.

#

can't happen in unscheduled

still forum
proven charm
winter rose
#

then not unscheduled

#

(unless you use isNil in there)

proven charm
winter rose
little raptor
#
isNil code

executes the code in unscheduled environment

proven charm
little raptor
#

it does

#

if you use it like above

winter rose
willow hound
#

Skipping CfgFunctions to develop some sort of framework in a single 688 line file with no indent... that's really... something else morphine🥲

still forum
little raptor
#

these are for only 1 element right?

still forum
#

ye

#

but I more than halved the overhead for a single element in MT.
So now I gotta rerun the other numbers notlikemeow

#

100 elements

ST: 0.0883 ms
MT: 0.0866 ms

now its already equal at 100 elements instead of 120 :wob:

#

ah no wrong numbers, had one tweak disabled notlikemeow

little raptor
#

keep squeezing it...

still forum
#

MT: 0.0706 ms

winter rose
still forum
#

now I again need more slow commands that i can test this with

little raptor
#

multithreading?

still forum
#

ye

little raptor
#

how about lineIntersectsSurfaces?

winter rose
#
allMissionObjects "" select { allMissionObjects "" }
```😂
still forum
#

well for that I first have to make a lineIntersects command that does multiple intersects at once

little raptor
#

how about arrayIntersect

#

wait no it's the same thing...

still forum
#

arrayIntersect if both arguments point to the same value

#

but the gains there should be about the same as insert unique

#

although a bit better, that would only be one MT job, the insert unique is two jobs.
One unique selfcheck on the to be inserted array, and then unique check between inserted->target

proven charm
#

idk if this is a good idea or not but what about making every AI unit run on its own thread?

winter rose
#

NO

little raptor
#

not even remotely good...meowsweats

winter rose
#

NO
no.

#

.

proven charm
#

or maybe 10 per thread?

still forum
#

wtf

#

its not a good idea. k thx bye

proven charm
#

alrighty 🙂

winter rose
still forum
#

ah yes

#

how slow is that usually?

little raptor
#

if the sampling size is small and the area is large, it's very slow

still forum
#

uh its simple expression, nice.
simple expression are somewhat slow, but can actually be multithreaded without any issues

#

but how many people use that thing, is it worth the effort even?

little raptor
#

¯_(ツ)_/¯

#

I did plan on using it

still forum
#

no usages in ACE nor CBA :u

little raptor
#

I've also seen DRO use it (for placing minefields, creating enemy presence, etc.)

winter rose
#

not really useful but you will do it anyway due to perf OCD :3

still forum
#

I'd rather do my uniqueUnitItems instead

copper raven
#

i mean you usually you run it, copy the result, and use it a constant instead, no?

still forum
#

returns hashmap of classname->number of items in inventory

hollow thistle
#

It's really cool command. But seems a bit underused.

little raptor
#

yeah. I was gonna try it for path planning
I haven't yet because it's slow...

winter rose
#

ooouh, possible improvement(s) for calculatePath?

little raptor
#

no meowsweats

winter rose
#

wai naught

little raptor
#

calculatePath itself doesn't do anything afaik
it just creates an agent
also the path is not created in one frame
also I think it's already multithreaded

dreamy kestrel
#

hello, I am trying to figure out why ,for the life of me, this is reporting 'no change', when I am 99.99% certain uiNamespace has never seen the variable before at this point.

params [
  ["_newFactoryView", [], [[]]]
];

private _oldFactoryView = uiNamespace getVariable ["MY_productionMgr_view", []];
//                                                                          ^^ (?)

if (_debug) then {
    [format ["[fn_productionMgr_onChanged] Entering: [count _oldFactoryView, count _newFactoryView]: %1"
        , str [count _oldFactoryView, count _newFactoryView]], "PRODUCTIONMGR", true] call MY_fnc_common_log; // Reporting 21, 21
};

if (_newFactoryView isEqualTo _oldFactoryView) exitWith {
    if (_debug) then {
        ["[fn_productionMgr_onChanged] No change", "PRODUCTIONMGR", true] call MY_fnc_common_log;
    };
    false;
};

uiNamespace setVariable ["MY_productionMgr_view", _newFactoryView];

So, here, a server task is running and reports the factory view to listening managers. All that is wired up correctly and working.
Is the UI namespace somehow linked with the mission namespace and I don't know it?