#arma3_scripting

1 messages · Page 86 of 1

winter rose
#

why?

manic sigil
#

Looking at it, kinda. You can kick off with allUnits spawn H8_addDrag I think, but after that youll have to Spawn it on any newly added units.

jaunty nest
#

P1 in thisList AND P2 in thisList AND P3 in thisList AND P4 in thisList
i have this trigger that i need to activate only when all players currently playing the mission are inside
right now when i simulate the players with ai and move them into the trigger it works fine however when i play the mission without AI the trigger does not work (because P2 P3 and P4 are not preset)
for refrence AI will be turned off for the mission
i feel like it should be simple but i cant find anything online

winter rose
#

it's ugly, but it works
it says "of all existing players, if there is any outside thislist, don't do poop"

#

@jaunty nestand don't crosspost, thank you
pick one channel and stick to it

I cleaned #arma3_scenario

jaunty nest
#
call BIS_fnc_listPlayers findIf { !(P1 in thisList AND P2 in thisList AND P3 in thisList AND P4 in thisList) } == -1;
#

so if im using P1 P2 P3 P4 it would look like this?

winter rose
#

my code says "activate once all players are in this area"
if you have enemy players, it does not fit

little raptor
#

or count ([p1, p2, p3, p4] - thisList) == 0

winter rose
jaunty nest
#
call BIS_fnc_listPlayers findIf { !(_x in thislist) } == -1;
#

just so i understand

#

i dont need to change any variables

winter rose
#

again, for a "all players in that trigger", whatever their side

opal zephyr
#

Does anyone know why createUnit is creating a unit per client? Its being executed from the server

winter rose
opal zephyr
#

no, its an addon and the script exits if it isnt the server

hallow mortar
#

How sure are you that it exits?

opal zephyr
#

the first line of the sqf is this if (!isServer) exitWith {};

#

I havnt verified it with some kind of print or anything though

#

Another issue, Im creating the unit and then moving it into a vehicle. However when I try and move it into the vehicle with moveInAny it actually creates a new unit and puts that unit in the vehicle, leaving the old one standing there

winter rose
#
if (isServer) then
{
  ["C_Offroad_01_F", getMarkerPos "create"] remoteExec ["createVehicle"];
};
```will create a vehicle on each machine, resulting in big boom boom
#

I smell shenanigans in all the cases you mentioned

opal zephyr
#

what kind of shenanigans lol, I dont smell them

winter rose
#

vanilla: if you create a unit server-side, it is created server-side and replicated on each client.
createUnit does not create a unit per client.

opal zephyr
#

I know it shouldnt, It is the result of my code however

hallow mortar
#

May we see the actual line of code containing createUnit?

opal zephyr
#

Heres the block

_group = createGroup civilian;
    _group deleteGroupWhenEmpty true;
    _unit = _group createUnit ["B_Soldier_F", getPosATL _vehicle, [], 0, "NONE"];
    
    //Attaches variable to be used later
    _vehicle setVariable ["bb_attachedUnit", _unit, true];
    //Removes passengers ace options
    [_unit,_unit] call ace_common_fnc_claim;
    
    //need a delay for the name change to work
    [_unit,_item,_vehicle]spawn{
        params ["_unit","_item","_vehicle"];
        
        _unit setCaptive true;
        _unit allowDamage false;
        _unit hideObjectGlobal true;
        _unit setSpeaker "NoVoice";
        
        //Puts the ai in the stretcher
        _unit moveInAny _vehicle;
#

^the spawn ends a few lines later

#

when the moveInAny happens, a visible unit is in the vehicle, and an invisible(because of hideobject) one is standing next to it

winter rose
hallow mortar
#

Have you restarted the server and/or verified game files recently?

opal zephyr
#

all files validated.. yay

hallow mortar
#

Whether a command is also executed by JIP clients depends on whether they are told to execute it. For example, a command in init.sqf will be executed by JIP clients because they run init.sqf when they join - same for Editor init fields. A command will also be executed by JIP clients if it's in the JIP queue as a result of being remoteExec'd with JIP true.

#
  • Do you have any mods loaded?
  • Have you checked all your Editor init fields?
  • It's impossible for us to say whether your code contains a hidden setPos as we don't have your code
opal zephyr
winter rose
#

what does

Does every client execute the setPos command when they join?
mean?

white hull
candid umbra
manic sigil
tepid vigil
#

I can see how that's possible considering that I am only asking specifically because of the aforementioned GitHub issue 🥲

tough abyss
#

Hi, I'm making a mod for ARMA 3. Is it possible to make a script that increases an AO based on how much food you deposit in the safe zone?

fair drum
tough abyss
#

I don't have anything so far...I just wanted to make sure it was possible before delving into it.

rustic lava
#

I hope someone can help me.

I am running a dedicated server with the following in the initserver.sqf

MOUT_hostileVicArray =[];```

however when I run the following from a dialog button the script fails unless I manually execute the above by logging in as Admin and running it globabaly from the esc menu input box.

```MOUT_hostileAliveCount = {alive _x} count MOUT_hostileArray; 
if (MOUT_hostileAliveCount > 0) then {
    format ["Hostiles Remaining, %1!", MOUT_hostileAliveCount] remoteExec ["hint", 0];
    sleep 5;
    "Is their anyone already running this training scenario?" remoteExec ["hint", 0];
    sleep 5;   
    "If not, Clear MOUT Hostiles first" remoteExec ["hint", 0];
    sleep 5;
    "" remoteExec ["hint", 0];
}
else {  REST OF MY CODE  };```
tough abyss
fair drum
fresh dome
granite sky
#

You're referring to classnames as if they were controls.

#

You need to find the controls with functions like displayCtrl

fresh dome
#

okay somethigng like this // Clear the list
((findDisplay 12345) displayCtrl 198) lbclear;

// Add each weapon to the list
{
    ((findDisplay 12345) displayCtrl 198) lbaddText _x;
} forEach _arsenal;
granite sky
#

Some UI commands have a version where you specify the IDC instead but they're a bit dangerous.

#

yes, but more readable to pull it into a local variable:
private _listCtrl = (findDisplay 12345) displayCtrl 198;

#

You also broke the syntax of both commands there.

#

should be lbClear _listCtrl and _listCtrl lbAdd _x

fresh dome
#

aaahh thats what it suppose to be it was throwing syntax errors and i could not find a way around that thanks man

#

see the only problem now is how do i pull the items from the arsenal to go onto the list to delete them

#

after testing the code im still getting "error undefined variable in expression" thanks for the help

granite sky
#

You had the same issue with RscListBox.

fresh dome
#

what do you mean by that?

granite sky
#

Referring to a classname as if it was a control.

#

In fn_ui_TestPop

fresh dome
#

okay i changed it, but for the script that handles populating the list it still shows error undefined variable in expression i don't know what else to do to address this.

granite sky
#

The error does say exactly which variable is undefined if you read it.

fresh dome
#

I am not understanding what this means.

granite sky
#

It means populatedeletelist is undefined.

#

That's not in any of the code you pasted.

fresh dome
#

ohhh man im so dumb i now see what it was saying

granite sky
#

You should look in the RPT though. You get a better version of the same error there.

fresh dome
#

[] call populateDeleteList;";

#

i never changed the action and where can i pull the RPT from

granite sky
fresh dome
#

thank you!

lean anchor
#

hey guys, looking for a bit of a hand making a script that saves a vaariable to a players namespace on disconnect and retrierves that variable on load.

Current server is a dedi server.
Looking to save "credits" to a players namespace
then retrieve it when they load back in

#

''
private _uid = getPlayerUID player;
_playerfundsvar = [];
_playerfundsvar = ["Playerfunds", missionname, _uid];
_playerfundsvar = _playerfundsvar joinString " ";
_kills = profileNamespace getVariable [_playerfundsvar, 0];
[player,_kills] call grad_lbm_fnc_setFunds;
diag_log _playerfundsvar;
''

this is the code i want

#

just bnot sure when/where to fire this.

manic kettle
#

Well you could use a postInit script so it loads when they log in. If it's in a mission file or a mod it's just setting up the config.cpp file...
If this is for a mission file only you could simply call the function in init.sqf... or ideally probably inside initPlayerLocal.sqf

#

If you don't know what that means just say

candid umbra
#

Or is this something I run on a local/global execute after the mission has started?

smoky roost
#

how do i change the weather/time with triggers inside the game

warm hedge
#

setOvercast, skipTime or setDate

smoky roost
#

thx

manic sigil
smoky roost
#

and how do i turn off Fatigue for everyone using game logic

smoky roost
manic sigil
smoky roost
#

ok thx

proven charm
#

what's the right null command for null triggers? objNull?

stark fjord
#

Watcha mean by null triggers?

proven charm
#

variable that is null

little raptor
proven charm
still forum
#

No. Yes.

#

Servers don't have full texture files to save disk space. The commands work the same though

#

^ above

tepid vigil
# still forum ^ above

I am the author of the mod and looks like now I need to find a way to get the texture RGB data to a dedicated server

still forum
#

You can upload client pbo's to the server.
But you won't be able to get every mod user to do that

tepid vigil
#

I'll probably just make the clients send known texture RGB data to the server

tepid vigil
still forum
#

yes

opal zephyr
#

Does anyone know if hideObject cant be used on a unit inside a vehicle? Same goes for any parameter, like enable damage, etc

dreamy kestrel
proven charm
dreamy kestrel
#

could be useful, thanks. and from there I gather mag bone connected to the ammo bone, for things such as characteristics, mass, etc.

ashen ridge
#

Can i get Arma 3 script help on Chat GPT?

#

Never tried 😮

warm hedge
#

Check the pinned.

exotic flax
granite sky
#

ChatGPT is awful at writing SQF, although maybe not so bad at commenting working code.

#

but generally you should be looking up every command on the wiki.

exotic flax
#

ChatGPT is awfull at anything... Especially when you don't know anything about the subject to begin with...

granite sky
#

That introduction to scripting page is actually quite good these days. I'm surprised :P

ashen ridge
#

GPT needs to read Arma Wiki one more time.

opal zephyr
# opal zephyr Does anyone know why `createUnit` is creating a unit per client? Its being execu...

Hello, im still having trouble with this convo from yesterday. I found a discussion online with a similar issue, but its solution did nothing for me https://forums.bohemia.net/forums/topic/179753-creategroup-in-multiplayer/

What im trying to do is create a unit, make it invisible and take no damage, and then put it in a vehicle. Essentially filling the seat in the vehicle so no one can enter it. This works fine in sp. However in multiplayer what happens is the unit is created, but when the moveinAny command is run, it creates another unit to put into the vehicle, there are now 2. The invicibility is applied to the unit in the vehicle, but not the one outside it, the invisibility is applied to neither. I am VERY confused as to why this is occuring.

Note: All of this code is happening within a if (isServer) then{ block. The server is being ran through TADST, tested with loopback on and off

winter rose
still forum
ashen ridge
#

I feel like that when i see my country in an movies, series, cartoons and games 😐

dreamy kestrel
ashen ridge
#

I can't blame "Reportagen" since i did like this on most of my School presentations.

#

Coleages: Wow! Professor: Hmmm!

granite sky
#

Note that hideObject is local-effect. On a DS you'd want to use hideObjectGlobal or remoteExec the thing everywhere.

opal zephyr
# little raptor yes why not?

It isnt working in mp for me, I get the unit with the crew command, and then do hideobjectglobal and it does nothing.

little raptor
opal zephyr
#

Its being run from the server

thorny osprey
#

I’m looking for scripting commands to make AI units run inside buildings. In particular the Sogpf crater “buildings”. Any pointers?

little raptor
opal zephyr
little raptor
opal zephyr
#

yup one sec

#

reading it now makes me wonder if the server check should be inside the function....

lavish stream
#

L74/75, aren't you just recreating events that already exist?

#

Ah, ignore me.

opal zephyr
#

L52 is an attempt to correct an issue of the unit not just moving and being duplicated btw

little raptor
little raptor
#

yes

#

the EHs are added everywhere

opal zephyr
#

They need to be, but the code shouldnt run everywhere

#

thanks for the help

#

its been driving me crazy and all it was is a silly locality issue

little raptor
opal zephyr
#

ah I see ok thanks, if putting a server check in them doesnt work then ill just set them to remoteexec the function on the server

opal zephyr
little raptor
#

they do

they only execute where the object is local

sudden yacht
fleet sand
jade acorn
#

how can I quickly get an array of multiple markers with the same prefix in their names? I remember a script that was searching for all marker names that had travel in their names but I can't find any info on how was it achieved.

#

I'd rather have this instead of manually writing down all the marker names, even if it would be a heavy piece of code - I'm debugging my setDriveOnPath stuff and the amount of markers changes frequently.

still forum
#

allMapMarkers select {_x select [0, 123] == "blablabla"}

jade acorn
#

thx

rustic lava
#

hopefully a very quick question. Portable Helipad Lights, is there away to force their on/off state like you can with other lights.
this switchLight on;
this switchLight off;
this switchLight auto;

little raptor
rustic lava
little raptor
rustic lava
#

duh, thanks

#

I must be more tired than I thought lol

rustic lava
#

works perfectly thank you

cold cloak
#

What kind of condition / script should I use if I want a trigger to activate when a player(s) walk on a flare mine in a mine field, created with the minefield module. I assume this is correct channel because I think it needs bit of scripting 😅

#

I started thinking, could something like isKindOf -> Mine -> Killed be possible?

iron tundra
#

I need some help getting this mod's menu to actually work the way I want it. So far I've already got it to launch on any mission startup.
It adds a radio support menu for "Vehicle Tuning Module" but when I select it-
it just adds an add action to "Tune Vehicle". Selecting that opens the actual menu I want it to open.
I want it so that when the radio support option is selected, it just goes straight to opening the actual menu.
I have no clue how to read sqf or all this coding but it's a pain in the ass to figure it all out just to fix this issue.
Also when I keep hitting "Vehicle Tuning" radio support, it adds the same action to the action menu and it accumulates on each use. unless I have " removeAfterExpressionCall = 1; // 1 to remove the item after calling" on 1 instead of 0 so I can circumvent this...

GOMALA already does everything the way I want it- and I tried to reference the code in it but I still can't get it to work properly

granite sky
#

The radio menu calls VTA_fnc_vehicleTuning.sqf which runs the addAction. You'd just need to change a couple of lines at the start and end of that.

iron tundra
#

mmmm could you help me find what lines to change at start and end. my attempts just end up breaking the mod

granite sky
#

Replace lines 12-14 with private _activator = _object;

#

Remove line 188

#

you'll lose some conditions but it should do something.

iron tundra
#

Alright will give it a try

iron tundra
granite sky
#

You removed the wrong line.

iron tundra
#

so 12-14 and line 189

#

?

#

awesome it works

#

thanks a lot @granite sky oldman👍

iron tundra
#

nvm deleting that fixes it- was a line of code i added to experiment

#

Thanks for your help again. Mod works awesome now and jumps to menu. MillerTarget

jade acorn
granite sky
#

should normally be something like _x find "path" == 0 to avoid false positives.

thorny osprey
#

I’m looking for scripting commands to

little raptor
little raptor
#

As for converting it, use apply

allMapMarkers select {} apply {getMarkerPos _x}
cold cloak
little raptor
#

You don't need to use triggers when you use event handlers

cold cloak
#

I'd need it to init a spawn module, is that possible without a trigger? Because without a trigger the module inits at mission start

little raptor
#

Dunno
You can create the module using scripts tho

cold cloak
#

True

#

Wait a sec.. I think Rimmys OP tutorial had a script for spawning a search squad.. Lemme check.

little raptor
#

Well you can also use a global var instead

#

Or a var on the trigger

#

The condition would be:

thisTrigger getVariable ["triggered", false]
cold cloak
#

oh yea

#

so like, when the eventhandler is fired the variable will turn true

little raptor
#

Yes

cold cloak
#

Aiight

#

I'm not really sure how to start on it

#
_projectile addEventHandler ["Explode", {
    searchParty setVariable ["triggered", true];
}];
#

Got a error about undefined variable, not sure what variable to run on that

little raptor
#

What is projectile?

cold cloak
#

(I'm a smooth brain with scripting)

little raptor
#

Also you should set the var to true

cold cloak
#

Yeah I noticed that

#

Uh

#

I'm not sure what variable to use because I want it to be triggered by a RHS flare mine
And there is about a 150 of those mines

fallow pawn
#

Hello!
I want to draw on the main map upon a script call, but that call can happen consecutive times in parallel to each other, and I don't want the previous "draws" to dissapear.
So I'm trying to create some kind of random-generated seed with each script call, so I can draw with the information from those seeds and not overwrite the previous ones.
The problem is, I cannot wrap my head around on how to pass the seed information to the "onDraw" EH without using global variables (which would defeat the purpose of the seed).
I'm using #define but to no avail, since I may not fully understand it's complete purpose and mechanic.

In the image below I try to pass the seed information to the #define PING_POS with a local variable (since I have to use this variable again in the script). That doesn't give PING_POS the content of the variable, but the string "_seed".

Can someone help?

sullen sigil
#

Is there any way to assign slots in mp lobby via script? 🤔

stark fjord
#

There is, much like server to server connection by KK. You need to simulate clicks etc

sullen sigil
#

ah, ty - will look at kks tutorial once i have time

jade acorn
#

toggleable radio triggers are possible, no? I mean having two triggers activated by Radio Alpha for example and they just disable each other. I'm trying to add an option for player to enable or disable playing certain music during a mission. What works now are two triggers for Radio Alpha and Radio Bravo that change a variable rng_music to true or false and just hide eachother with setRadioMsg "NULL"

#

what I want to achieve is that once player enables Radio Alpha trigger #1 setting rng_music to false, the other Radio Alpha trigger #2 is available which would set rng_music to true

#

I tried repeatable and non-repeatable triggers and can't figure out how to have them both available because every time one of them does not want to activate.

granite sky
#

Fun with Arma networking. Run this on your client:

"netTestVar" addPublicVariableEventHandler {
    systemChat format ["EH: %1", _this#1];
};

And this on the server, assuming client is owner ID 4:

netTestVar = 1; publicVariable "netTestVar";
{ systemChat format ["RE1: %1", netTestVar] } remoteExecCall ["call", 4];
netTestVar = 2; publicVariable "netTestVar";
{ systemChat format ["RE2: %1", netTestVar] } remoteExecCall ["call", 4];
netTestVar = 3; publicVariable "netTestVar";
{ systemChat format ["RE3: %1", netTestVar] } remoteExecCall ["call", 4];

Results:

EH: 1
EH: 2
EH: 3
RE1: 3
RE2: 3
RE3: 3
#

Now I'm just hoping that there's some order guarantee regardless of packet loss...

exotic flax
#

It does make sense, since remoteExecCall is running unscheduled, meaning netTestVar is already set to 3 (since it's secheduled) before it can print it in the chat.

However addPublicVariableEventHandler is being called the moment netTestVar changes, so it will print the correct numbers

granite sky
#

Everything there is unscheduled. It's not clear whether the publicVariables & remoteExecCalls get reordered on the sending or receiving end.

#

I did wonder if there's a send priority, like publicVariable always gets sent before remoteExecCall, but it might just be receiving-end mechanics.

fallow pawn
valid abyss
#

If I execute a function on a client will the function communicate with the server? If not is there any way I can make the function send data back to the server?

#

I’m planning a saving system and I want it to get data from clients and then save it to the server using the server’s profileNamespace

winter rose
#
// on server
[] remoteExec ["TAG_fnc_SendDataToServer"];
``````sqf
// client's function
// ...
["my data"] remoteExec ["TAG_fnc_SaveClientData", 2]; // 2 = server
#

that could be a structure, maybe not the ideal one

winter rose
exotic flax
#

If you use CBA:

// on client
["Your_Custom_Event", ["data you want to send"]] call CBA_fnc_serverEvent;

// on server
["You_Custom_Event", {
  params ["_data"];
  // your code which handles the data
}] call CBA_fnc_addEventHandler;

Does the same as what Lou posted, just (IMHO) nicer and easier to write

valid abyss
winter rose
granite sky
#

Note that health and position are globally accessible anyway

valid abyss
#

itll also need some custom variables that are set on the clients such as hunger and thirst

granite sky
#

How often are those updated?

valid abyss
#

only before the server restarts or closes

granite sky
#

Sometimes it's easier just to set those globally as well if it's low-traffic.

winter rose
granite sky
#

Consider if a player disconnects.

valid abyss
#

that too

granite sky
#

Once they disconnected, you're not gonna get a remoteExec ping-pong out of them.

valid abyss
#

is there an easier way to do it?

#

maybe it can save when they pause the game?

granite sky
#

You can't pause unless it's SP.

#

I was suggesting that you just do something like player setVariable ["MyTag_thirst", _val, true];

valid abyss
#

i mean when they press esc

granite sky
#

It doesn't seem like it's a variable that needs super-frequent updates.

tough abyss
#

^ Not correct.

nil == ""
nil isEqualTo ""

Both return nil (without error message).

valid abyss
granite sky
#

Yes, it's just a variable set on the player object globally.

valid abyss
#

nice

#

tysm

granite sky
#

just don't update the thing every frame if you do that :P

valid abyss
#

yeah ofc

tough abyss
#

There is no SQF command that returns anything other than NIL, if one of the arguments is NIL.
(Including isNil, because you actually use isNil SRING or isNil CODE)

jade acorn
#

copying these markers from Markers layer to a custom one will give an empty array, when I reverted the change all markers are now in wrong order and I have to redo the path again :/

tough abyss
#

You should use isEqualTo if:

  • you want to compare types that == doesn't accept. (BOOL, ARRAY, some other I think)
  • you want to compare variables with potentially different types (which should be avoided imo)
  • you want to compare STRINGs case sensetive
little raptor
#

right now you're adding an EH for each icon...oof
for best performance use one EH for many things, not one EH for each thing

if (isNil "map_markers") then {map_markers = []};
map_markers pushBack ASLtoAGL getPosWorld _pingObj;
private _map = findDisplay 12 displayCtrl 51;
if (_map getVariable ["my_old_EH", -1] >= 0) exitWith {};
private _EH = _map ctrlAddEventHandler ["Draw", {
  params ["_map"];
  {
    _map drawIcon ["...", [..], _x, ...];
  } forEach map_markers;
}];
_map setVariable ["my_old_EH", _EH];
tough abyss
#

One use is:
_array isEqualTo [] being slightly faster than count _array == 0

warm fern
#

Hello, I have a question. I want to make a DLL for arma 3 to interact with Rcon from the game itself. To check, I used "KillZone Kid's callExtension" in which everything worked, but as soon as I tried to use it in the game, my connection to the BattlEye server stopped working. Can someone tell me what the problem is?

south swan
warm fern
#

it is stored on the server and called remotely, the extension is called, but the connection to the Rcon server does not work

south swan
#

causing any callExtension attempt to fail.

still forum
#

And also doesn't explain why BattlEye would fail

#

Maybe you're sending a bad command that crashes or freezes the BattlEye code that handles the rcon

warm fern
#

The extension does not reach the execution of the command. It cannot connect to the Rcon server.

#

it dont works on this code fragment ```cs
BattlEyeClient client = new BattlEyeClient(credentials);
client.Connect();

if (!client.Connected)
return "Not Connected";

tough abyss
#

Also isEqualTo is a fuck ugly name for a command like this. Why not ===?

little raptor
#

did you create BattlEyeClient or does it come from a library? just wondering

warm fern
#

I took BEClient from ```cs
using BattleNET;

#

I also tried BytexDigital RconClient, but it's also don't working

little raptor
warm fern
#

it freeze for 5-10 seconds (probably trying to connect). and works return on "not connected"

pulsar pewter
#

Hey folks! I've been looking around the BI command wiki and I'm pretty sure this won't be possible to do, but figured I'd ask y'all anyways.
I'm a bit unsatisfied with some of the Electronic Warfare mods available. They're great! But, not necessarily realistic. Generally, how they work is that if you get a UAV within its range, UAV is destroyed and that's it.
I want something a bit more fine-grained.... one of the effects I want, for example, is severely degrading the quality of the feed, as thats what most videos show on both sides in the current Russian-Ukrainian war.
Can y'all think of any way to accomplish that? I know how to disable NV/Thermals from UAV, for example, but not how to degrade the feed itself. Does the engine allow for that sort of thing?

little raptor
pulsar pewter
#

Oh! How would I do that? I've never messed with overlays

#

(general pointers, happy to do my own work)

little raptor
#

depends where you want to show it. if it's over an ingame screen (e.g in game TV) it's a bit more difficult (I think you might need a custom TV?) but if you want to show it while controlling the UAV you can create a RscTitle with only an image in it. then you just cycle the image to another one to simulate the static effect.

pulsar pewter
#

Awesome, thanks Leopard. I'll look into this! Brand-new territory for me.

granite sky
#

Anyone know if addForce is actually a force (for one frame or what?) or a more sensible impulse?

little raptor
#

impulse afaik think_turtle

keen stream
#

Because BIS.

twilit scarab
#

Anyone know how to script the VLS launcher to act as fire support or hit a specific area?

lone glade
#

@tough abyss because that would make sense, i'm sure they have hidden operators

#

tinfoil hat mode on

digital iron
#

I am currently attempting to update the PIR ace medical compat as it was broken with the latest update of PIR

#

I believe it added a new shrapnel system because the error message shows up whenever a player or ai is damaged by an explosion

#

this appears to be what's wrong:

#

||_count = round ((18 + (random 18)) * PiR_frags_on);||

#

but i do not know what is wrong and why it works with PIR but not the compat

#

or may more likely be:

#

||if ((!isServer) or (((agltoasl _this) select 2) < 0) or (PiR_frags_on == 0)) exitWith {};

params ["_position","_frag", "_frag_correct", "_count", "_speed", "_xv", "_yv", "_zv", "_angleXY", "_angleZ"];

_count = round ((18 + (random 18)) * PiR_frags_on);
_position = _this;||

fair drum
digital iron
granite sky
#

The error's saying that PiR_frags_on is undefined. You would need to figure out why that's the case when it wasn't before.

twilit scarab
digital iron
#

so this is the code in question that god added to PIR is

keen stream
#

@lone glade If there were any hidden operators, I would expect the guys that derap everything BIS makes to report it somewhere. :)

shut gate
#

If there's a very simple/obvious way to do this, I apologize in advance.

Is there a way to quickly execute and get the output from getPosASL or getPosATL for an object while still inside the Eden editor? I.e. without loading the mission and using a script mid-mission.

south swan
#

top menu - tools - debug console

shut gate
#

Ty, i appreciate it

south swan
shut gate
#

oh that's huge

#

tyvm

winter rose
shut gate
fallen elbow
#

better late than never: thanks a bunch for that I'll check it out 😄

manic sigil
#

@quiet burrow

findDisplay 46 displayAddEventHandler ["KeyDown", 
  {
  params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
  if (_key == 46) 
  then 
    {driver vehicle player forceWeaponFire ["CMFlareLauncher", "AIBurst"];
    } 
  }];
fleet sand
#

Hi guys question. Does anybody know any fnc or command or something to make a pull force. Basicly make entity get pulled towards a certain position ?

opal zephyr
#

addForce adds a force in a direction for physx objects

fleet sand
# opal zephyr addForce adds a force in a direction for physx objects

Oh i see addForce if the force is positive is a push and if the force is negative its a pull ?
so if i understand this corretly
params of AddForce are:

  1. Object on to witch apply Force.
  2. Force with is vector if its positive its a push and if negative its a pull
  3. Position relative to object Position.
opal zephyr
#

I've never tried a negative force, but it could work. If not then just apply a positive force behind the object so it gets pushed towards the point you want it to

hallow mortar
#

There's no such thing as negative force

fleet sand
hallow mortar
#

The force vector is in world space, it's like velocity. Negative numbers just mean the direction is towards world [0,0,0] (assuming your position is positive and not outside the map)

#

The force vector controls the direction of the impulse in world space, and its magnitude. The position parameter is the position on the object's model to which the force is applied. For example, if you apply [0,-1000,0] force to the centre of an object, it will move south a bit. If you apply [5000,0,0] force to the top of an object, it will move east with the top leading, possibly causing it to tumble or roll depending on mass and force.

granite sky
#

Zeus can delete anything it can select, in my experience.

#

So no.

#

Is this client/server?

fleet sand
#

So to create a Pull force i would need a vector that constantly point towards the position that i want. And to and inverted Vector Magnitude would be strenght of the force. Meaning if the distance is bigger from object to Position that i have the force is lower ?

granite sky
#

I mean the setup in general.

#

sounds like pretty bad network overload.

#

No, it's a black box.

#

Often the start is the worst.

#

Lots of data to distribute to clients.

#

shrugs

#

Default basic.cfg bandwidth settings are very low these days so if you have more than a handful of players then you might need to edit that.

#

But then if you're spamming public vars then that's gonna cost too.

#

Usually clients don't send much data. If they are then you're probably doing it wrong.

#

client->client has to go through the server anyway.

#

correct.

hallow mortar
granite sky
#

Word of warning with addForce: PhysX apparently sucks so much that an addForce in a long frame has a massively different effect to addForce in a short frame. And Arma can have some very long frames.

winter rose
#

adding any network is bad.
now what is the least evil 🙂

granite sky
#

Yeah, like we remoteExec setMass because it otherwise transfers too slowly and people kill each other with crates.

#

The remoteExec is preferable to the accidental death.

#

But ideally you remoteExec minimally.

#

publicVariable is still network.

#

Probably similar to a remoteExec with no parameters.

hallow mortar
#

Depends on what's in it, I would think. If the var has a short name and a simple value it might be better than a long command with big arguments.

granite sky
#

It's still a name and some arguments. Unlikely to be better.

still forum
#

remoteExec was specifically made to efficiently remotely execute stuff

#

why would you try to find a non-remoteExec way to do the exact same

#

remotely executing things is "bad"
but public variable with EH is the same thing, its also remotely executing things, just a different way of doing it

granite sky
#

As an example of improvements, sometimes you can replace stuff like _object setVariable ["wibble", _val, true] with setVariable that specifically targets the server, if no other clients need to see it.

#

but often it's high-level design stuff to keep data local.

errant iron
#

apparently BIS_fnc_convertUnits is omitting the measurement unit for me, not sure why
edit: the localization keys it uses such as STR_HSIM_unitFull_m aren't defined

granite sky
#

It's probably bugged. Copy the code and fix it.

#

what does "storing variables" mean?

winter rose
#

network trafficking = highway usage
storing in RAM = storing in the trunk
if you load the truck but don't use the highway, there are no traffic jam risks

granite sky
#

If the final parameter is false or missing then it causes no network transfer.

#

It's only setting that variable locally.

#

setVariable true -> setVariable false, less traffic

stray jacinth
#

does anyone know how to make jet pilot ai only start moving in its airstrip upon trigger?

if not, i could just set a waypoint trigger to make the pilot go into the jet & begin their air campaign

granite sky
#

disableAI probably works.

stray jacinth
#

honestly i think ill just do the pilot going into jet

granite sky
#

Arma :D

winter rose
#

if you can store it while broadcasting it you can store it without broadcasting it
the truck's suspensions will break the same whether it drives or not

granite sky
#

I guess disableSimulation on the jet would work, but may have other unwanted consequences.

#

So sitting the pilot next to the plane might work out better.

#

set the variable to nil and it's not there anymore. Kinda.

#

At a low level, adding a bunch of vars to an object and then nilling them may not reduce the hashmap size. Dunno.

#

Similarly, adding one var to an object may be proportionally much more expensive than adding additional vars, but CBA adds the first one anyway.

#

In SQF, data storage capacity is generally the least of your concerns.

#

Expensive caching strategies that you'd never do in a fast language often make sense.

queen cargo
lone glade
#

i'm sure there's something, SOMETHING HIDDEN tinfoil intensifies

stable dune
#

Hello,
What is correct/best or is there an extension to Visual Studio Code to show Arma cfg files ?
I have extensions to sqf but i want a working extension to config.cpp etc

queen cargo
#

ye ... also that would be discoverable because you are having arma here

#

you would just have to analyze all those fancy existing pbos

#

even thought, the supportInfo has no hidden commands which is why some debug commands are also known ...

south swan
#

except it's not 🤷‍♂️ Close, but not.

winter rose
#

wrap with isNil { /* code */ };

cunning oyster
coral mason
#

i could

twilit scarab
#

Im trying to make a task complete when I pick up an object but not sure how to do it

#

Got all the tasks and triggers set up just need a script

#

Basically the task is to pick up a remote designator so it gets packed and put on the player as a backpack. idc if it completes from just being packed or put on the player, either one is fine

twilit scarab
#

Classname is "B_Static_Designator_01_weapon_F"

hallow mortar
#

That is how. It is a check to see whether the player's backpack is of the correct type. When that's used as a trigger condition, the trigger will repeatedly check it at whatever frequency you set.

twilit scarab
#

Oh okay cool

#

Nice it works good, thanks

pulsar pewter
#

Quick question: why does eyePos give me a wrong pos for where player is "looking" from?
I was trying to Draw3D a line from where players are to where they're aiming at, by using weaponDirection, but the line shows up several meters above the player unit.

#

(I know I can use PositionCameraToWorld; I'm just trying to figure out what's up with eyePos)

twilit scarab
#

Is there a mission failed version of BIS_fnc_endmission?

#

Or would this work
"fail1" call BIS_fnc_endmission;

pulsar pewter
#

Syntax: [endName, isVictory, fadeType, playMusic, cancelTasks] call BIS_fnc_endMission
So, just put false for isVictory

twilit scarab
#

Why do you need the first part tho

#

I ususally just do this for mission completed "end1" call BIS_fnc_endmission

#

And it does all the vanilla mission end stuff

hallow mortar
twilit scarab
#

I got it to end on failure with this

#

["epicFail", false, 2] call BIS_fnc_Missionend

#

Screen fades to black but it doesnt play the fail music

#

Says default for music is set to true so it should play without any code added right?

hallow mortar
#

The automatic music may only play if the standard closing effect is used, rather than the black fade

twilit scarab
#

What is the number for the vanilla fail close effect?

hallow mortar
twilit scarab
#

Oh I just need to set that to true instead of a number

#

Okay I got the vanilla mission fail working

#

["epicfail", false, true, true, true] call BIS_fnc_endmission

#

That will also cancel all tasks

agile cargo
#

Is there a way to get the suppresion value of an AI unit?

#

I want to quantify the effects of suppresion on AI

pulsar pewter
hallow mortar
pulsar pewter
#

Yes, I just didn't pay attention to the wiki to see if it was a AGL/ASL issue

twilit scarab
#

I cant understand why I cant get air vehicles to listen to hold waypoints they always just take off and ignore them

#

Seems to be fixed wing only

hallow mortar
#

That's just how the fixed wing AI is

#

If you absolutely must stop them taking off, remove the fuel

twilit scarab
hallow mortar
#

you can.......you can give the fuel back later

twilit scarab
#

Guess I can just take the pilot out

#

And then give him a get in waypoint

twilit scarab
#

Can you remove the remote designators batteries?

agile cargo
#

ah

#

when I was searching for it I had a typo in the word lol

stable quail
#

anyone has a way to disable voice chat for side chat?

hallow mortar
twilit scarab
#

{if (side_x == east) then{ _x enablegunlight "forceOn";};} foreach (allUnits);

#

What am I doing wrong here

#

unit enablegunlight "forceOn";

#

I dont see whats wrong with this either...

#

The games telling me its supposed to be like this
unit ;enablegunlight ;"forceon"; wtf??

#

Shits gotta be bugged

exotic flax
#

Your code (with highlighting and a bit of markup):

{
   if (side_x == east) then {
      _x enablegunlight "forceOn";
   };
} foreach (allUnits);

I already see 2 issues:

  1. side_x or side _x?
  2. enableGunLight**s** "ForceOn"
twilit scarab
#

Oh im an idiot

#

Forgot the S smh

twilit scarab
exotic flax
twilit scarab
radiant yacht
#

Hi yall, i'm having issues with some debug type code to export maps as an SVG
diag_exportTerrainSVG ["C:\Users\Gebruiker\Desktop\Song_Binh_tan.svg", true, true, true, true, true, false];
it's giving me an error message for a missing ; however i can't find where that would be missing

(if it helps i am in the Dev branch of arma for this)

#

does anyone have any ideas what's wrong with this?

lavish stream
#

Are you running the diagnostic branch?

#

ah, it was hidden above the image.

radiant yacht
#

i'm running this^

exotic flax
#

Did you also start the game through arma3diag_x64.exe instead of the normal arma3_x64.exe (or launcher=?

#

Because I don't see any typos in that code

radiant yacht
#

i started arma just through the launcher, i'll try that diag exe

#

is that in the regular arma folder?

exotic flax
#

yes

#

but only available on the dev branch (which you have, so that should be fine)

twilit scarab
#

How can I hide a unit on the map? I have a VLS turret that simulates a cruise missile strike but I dont want it to be visible cause its just off in the desert somewhere

fair drum
twilit scarab
twilit scarab
#

Ya that works without a laser right? Think ive seen that

fair drum
#

yes

twilit scarab
#

My mission kind of revolves around a laser marking the target but that could come in handy for future missions

tough abyss
#

supportInfo didn't help with the local / private keyword.

#

And I'm pretty sure == isn't listed in supportInfo either

humble tundra
#

How can I check Arsenal is used by player?

fleet sand
#

Myb something like this:

[missionNamespace, "arsenalOpened", {
    player setVariable ["ArsenalOpend",true,true];
}] remoteExecCall ["BIS_fnc_addScriptedEventHandler",[0,-2] select isDedicated];
``` And now you have Variable on Player ArsenalOpend where you can check stuff...
winter rose
#

"ArsenalOpened" +

(...) remoteExecCall [
  "BIS_fnc_addScriptedEventHandler",
  [0,-2] select isDedicated,
  true // for JIP
];
```+ closed EH ofc

but yes you need to use the "local machine" to get that info (a nice, light solution)
velvet flicker
#

I want to make it so that a player is "captured" instead of killed, so right before death, they are teleported, healed, and forced into a captive state. Q: How can I run these methods just before death? I know about the killed event handler in CBA, but if I'm not mistaken that happens after the death has already happened

little raptor
#

you can just check for the display

winter rose
sudden yacht
#

unit setSkill 1; does not appear to work on already created units midgame? Any idea what im doing wrong?

sullen sigil
#

There's no depth of field postprocess effect, right? thonk

winter rose
#

nope
you can have this effect with cameras only afaik

sullen sigil
#

rip, there goes my idea for depth of field with nv

hasty current
#

Is it possible to make the civilian side a combatant?

Using setFriend to make BLUFOR, OPFOR, and INDFOR hostile towards the civilian faction, and vice versa, just leads to them aiming at civilians, or walking towards them menacingly without ever actually attacking. Meanwhile, the civvies themselves are more than happy to shoot the shit out of the RGB factions.

So clearly something's causing the RGB sides to still consider civilians as at the very least neutral. I'd set the civvies to renegade, but that'd cause in-fighting amongst them, which isn't ideal to say the least.

I'm running this on a random object's init:

civilian setFriend [east, 0];
civilian setFriend [resistance, 0];

west setFriend [civilian, 0];
east setFriend [civilian, 0];
resistance setFriend [civilian, 0];```

Am I, uhh, missing something?
sullen sigil
#

nope, its just not all that possible to do

#

you cannot have a true 4-sided conflict

hasty current
#

Sad!

#

Oh god I just thought of a horrible solution, putting a script on each would-be-civilian group that changes its side based on the two nearest sides, checking every X seconds

It'd work at least I guess lmao

south swan
#

Wouldn't marking them as renegades work if no "civ"-to-"civ" teamplay is intended?

hasty current
#

It would yeah, but said teamplay is intended in my case sadly

sullen sigil
#

Yeah I gave it quite a bit of energy trying to find a method -- even setting units on LOGIC side but no avail

astral bone
#

where's the kill count stored?

#

maybe a missionNamespace variable?

#

probably easier to check in vanilla xD

astral bone
#

no, its like a thing for all the units you've killed. "3x Rifleman, 4x Sniper, 1x Offroad"

tidal aurora
#

why do i get a 'missing ;' error on the line with the forEach? for "_i" from 0 to count _leaderArray do { { _unitArray append _x; } forEach units _leaderArray[_i]; diag_log "foo"; };

proven charm
#

just not so detailed

astral bone
#

yea, but I'm looking for the detailed one

proven charm
astral bone
proven charm
#

the mission debrief shows the kills though 🤔

#

yep

astral bone
proven charm
#

@tidal aurora probably this: ```sqf
_leaderArray[_i];

tidal aurora
#

yup didnt realize that, changed to forEach units (_leaderArray select _i); thanks

velvet flicker
#

Is there a way to keep ai from trying to enter the proper formation of their squad

#

at least until they take contact

sullen sigil
#

doStop _unit; iirc

#

@velvet flicker

granite sky
#

There is a lot of ambiguity in the request :P

sullen sigil
#

im assuming its just something they want to throw in unit init so they stay in building positions

velvet flicker
#

Yeah building positions thing

sullen sigil
#

what a guess
yeah all you need is doStop _unit;

granite sky
#

_unit disableAI "PATH" is the alternative one for that.

sullen sigil
#

stops the AI from moving completely though doesnt it

velvet flicker
#

Will they resume maneuvering if they take contact in that state?

sullen sigil
#

yes

#

with dostop, not disableai path

granite sky
#

Nah, path allows turning.

velvet flicker
#

Gracias guys, thanks

granite sky
#

oh, dostop prevents turning, right

sullen sigil
#

no it doesnt ❓

#

just stops it moving into formation

granite sky
#

shrugs

#

I didn't try using doStop in a firefight.

#

And it's not like anything is documented properly.

sullen sigil
velvet flicker
#

Perfect! It works like a charm!

sullen sigil
#

epic

#

just bear in mind if its in unit init it'll run every time someone joins the server as its global

#

would recommend you use
if (isServer) then {doStop this};
or something similar if its an issue to you

granite sky
#

wait, doStop and stop are completely different...

sullen sigil
#

yes 🙂

velvet flicker
#

Now, another unrelated question. Can the death message setting be disabled via script?

sullen sigil
#

wdym? player death messages? thats difficulty options

velvet flicker
#

Are those unable to be configured after start time?

granite sky
#

Generally yeah.

#

All you can do is check the values.

velvet flicker
#

Ah, got it

sullen sigil
#

ofc if you're making a scenario you can make it end if the difficulty options arent correct

#

but thats not really something i'd recommend

velvet flicker
#

Is there any reason using getUnitLoadout and setUnitLoadout might not work as expected?

sharp grotto
ashen ridge
#

I just found i can make the server save some non-critical info on profileNamespace instead of dealing with mySQL, wich is more dificult to do.

velvet flicker
sharp grotto
velvet flicker
#

Got it, thanks for the info!

boreal parcel
#

is there any obvious reason why this script I wrote doesnt move (setPosATL) the vehicle in a dedicated server, but it works fine locally?
Halo Menu.sqf (called before Halo Jump.sqf)
https://pastebin.com/EVX4W2AH (line 79 actually assigns the object)

My halo jump script doesnt exit on the vehicle being null on line 32 so I assume it finds it?
Halo Jump.sqf
https://pastebin.com/bRAewES1

south swan
#

Lune 29, if (_vehicleBool isEqualTo 1) exitWith {. And i don't see it getting set to anything other than false?

boreal parcel
#

on line 59

south swan
#

true is not 1

boreal parcel
# south swan true is not 1

right, I realised this when using onCheckChanged which returns 0 or 1, (not boolean). I didnt mean the value is switched to true, the value is switched to 1.

#

I know the condition returns true

south swan
#

Just from the fact that player gets teleported? It can be from the line 68 onwards that's outside the vehicle block blobdoggoshruggoogly

#

Does the chute for the vehicle get created? Does its inventory change? Can you add some other noticeable effects specifically to that block to check (like systemChat-ting the vehicle classname or something)?

pastel pier
#

Are there any commands available to predict where the bomb or rocket will fall? Like the assistance computer in planes. Are there public commands available?

pulsar bluff
#

afaik the “ccip” is not available in script

untold turret
#

Hello, I was thinking about mod that disables stamina (unlimited sprinting) but in the same time limits max speed of sprint depending on overweight - the more weight, the slower sprint up to no sprint at all.
I've found some stuff about disabling sprint but that's only part of the case, anyone can hint me with some clues? (Or make such a mod for arma? :P)

untold turret
#

Hmm, so movement speed depends entirely on animation speed? 🤔 Interesting, but thanks for sure R3vo

formal stirrup
#

Is there a way to mimic the remote control module via action? everything i've tried so far ends up not working or requires the player to have zeus which defeats the purpose. heres what i've got so far

this addAction ["Control a Strider", { 
  params ["_target", "_caller"]; 
  private _strider = group player createUnit ["WBK_Strider_HL2", getPosATL strider_pad1, [], 0, "NONE"]; 
  [_strider] call bis_fnc_moduleRemoteControl;
  _strider switchCamera "Internal"; 
  _strider addAction ["Exit the hunter", { 
  params ["_target", "_strider"]; 
    player switchCamera "Internal"; 
    objNull remoteControl _target; 
    deleteVehicle _strider; 
  }]; 
}];
inner fiber
#

How do I open the script to control a character?

exotic flax
warm hedge
#

“open the script” “control a character” what do these mean

inner fiber
#

I am trying to make shit guy run around

warm hedge
#

Wrong game

formal stirrup
inner fiber
#

whoops

#

Ignore me

formal stirrup
#

If its any help, this is in webknight's code

_unit = missionNamespace getVariable["bis_fnc_moduleRemoteControl_unit", player];
#

Currently it just throws an error about _activated = _this select 2; and it being zero divisor

exotic flax
#

But does it work without any mods or custom scripts?

#

Because in that case it's the problem with that specific script 😉

formal stirrup
#

Yeah, it just wont activate the custom control stuff, can move around and all

#

with my script? or the mods?

exotic flax
#

if it works without mods, the problem is in the mods

formal stirrup
#

Interesting cause some of the zeus enhanced functions for remote control, when i have zeus, work perfectly

#

thanks for the help anyway, atleast makes me not keep trying a dead end

exotic flax
#

Yeah, but if it checks for zeus controlled units it obviously works when you remote control as a zeus 😉
Which in this case you don't have (and want?), since you're not a zeus.

formal stirrup
#

Ahhhh i see, so is there a way to check for any remote controlled units?

exotic flax
#
_who = _unit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull];
if (!isNull _who) then
{
   // _unit is controlled by _who
   // therefor remote controller as a Zeus
};
formal stirrup
#

So that will return all remote controlled units, not just ones controlled by zeuses?

exotic flax
#

no, it will check if the current unit (which you're checking) is currently being controller by a zeus

warm hedge
#

I do not think is even a thing

#

It is all or nothing

velvet flicker
#

I'm struggling to figure out how I can take a weapon from a unitloadout _loadout select 0 and add it to a container _this addItemCargo [ <item>, <count>];

#

I'm guessing there is another method (not addItemCargo) that allows adding an item from an array instead of by type

warm hedge
#

getUnitLoadout you mean?

velvet flicker
#

Yeah, I use getUnitLoadout select 0 to get a players weapon, I want to then add it to a container box I have nearby

velvet flicker
#

Thank you @warm hedge 🍻

velvet flicker
#

I'm trying to collect items from the ground and put them into a crate. Q: Are items on the ground found via nearbyEntities? OR is there a ground Cargo I need to access?

willow hound
#

@granite haven The alternative syntax for createUnit (type createUnit [position, group, init, skill, rank], referred to as SYNTAX1 in the example on the CfgDisabledCommands page) has the init parameter which can be used to run arbitrary code when the unit is created.
The other syntax (group createUnit [type, position, markers, placement, special], referred to as SYNTAX2 in the CfgDisabledCommands example) does not have this parameter.

#

I don't know, I've never looked into CfgDisabledCommands. But now that I've seen that page, I have to say that it is a little confusing and could use some polishing.

velvet flicker
fair drum
#

how can I prevent the users mouse movement inputs?

#

without using disableUserInput

warm hedge
#

What's the usecase?

fair drum
#

you know how some animations let you rotate your character around while playing? don't want that

warm hedge
#

Probably you can use attachTo to a Logic object

warm hedge
#

I don't think that would interrupt it

fair drum
warm hedge
#

Keep it mind that you would need to have some workaround to work in MP environment

fair drum
#

yup yup

warm hedge
#

If that's your answer, I don't need to elaborate I guess. gl 👍

velvet flicker
#

I always struggle with understanding where to execute a script. I am using call CBA_fnc_addClassEventHandler to do stuff when a player is killed, if I'm zeus and I want to add this handler for all players, how should I be calling it, and in what exec scope?

granite sky
#

What's the intention? To trigger for all players when any player is killed, or just trigger locally when the local player is killed?

velvet flicker
#

What my script does is when a player dies, it collects their stuff and puts it in a crate nearby

#

So, just for a single player when he dies

granite sky
#

addClassEventHandler doesn't seem to be fully documented.

#

Easy way to do what you want is just add an EntityKilled missionEventHandler on the server and check whether the entity is a player. Loadout-shifting shouldn't have locality requirements.

fair drum
boreal parcel
# south swan Just from the fact that player gets teleported? It can be from the line 68 onwar...

just confirmed, it does run. The system chat "_vehicle bool was 1" runs as expected.

if (_vehicleBool isEqualTo 1) exitWith {
    systemChat "_vehicleBool was 1";
    _veh = _vehicle;

    if (_veh isEqualTo objNull || _veh isEqualTo "") exitWith {
        systemChat "No Vehicle Selected...";
    };

    _veh setPosATL _position;
    _veh addBackpackCargoGlobal ["B_Parachute", count (crew _veh select {isPlayer _x})];

    _chute = createVehicle ["B_Parachute_02_F", [0, 0, 1000], [], 0, "NONE"];
    _chute allowDamage false;
    _chute enableSimulation false;

    // Make chute wait until certain altitude to deploy (not very smooth, insta stops vehicle mid air)
    [_veh, _chute] spawn {
        params["_veh", "_chute"];
        while {((getPosATL _veh) select 2) >= 350} do {
            sleep 1;
        };
        _vehPos = getPosATL _veh;
        _chute setPosATL _vehPos;
        _chute allowDamage true;
        _chute enableSimulation true;
        _veh attachTo [_chute, [0, 0, 2]];
    };

    {
        // Current result is saved in variable _x
        _space = random 15;
        _x setPosATL [(_position select 0) + _space, (_position select 1) + _space, _position select 2];
        _x setVariable ['TRA_lastHalo', diag_tickTime];
        if ((backpack _x) isNotEqualTo "") then {
            [_x] call bocr_main_fnc_actionOnChest;
        };
        _x addBackpack "B_Parachute";
    } forEach _players;
};
boreal parcel
queen cargo
#

u:private ARRAY,STRING

#
u:local GROUP```
#
b:STRING == STRING
b:OBJECT == OBJECT
b:GROUP == GROUP
b:SIDE == SIDE
b:TEXT == TEXT
b:CONFIG == CONFIG
b:DISPLAY == DISPLAY
b:CONTROL == CONTROL
b:TEAM_MEMBER == TEAM_MEMBER
b:NetObject == NetObject
b:TASK == TASK
b:LOCATION == LOCATION```
#

they are ALL listed in there

#

however, the command is kinda broken

#

so to get all informations you have to execute it like so: supportInfo ""

boreal parcel
#

hmm actually I was able to see the vehicle this time

#

it looks like a parachute does open on it, but it stays where it originally was?

#

That makes zero sense to me though, im doing _veh setPosATL _position. _veh certainly exists, that is how the parachute attaches to the correct vehicle. _position is certainly correct, the player gets teleported to it

#

is there something that can lock a vehicle in place?

granite sky
#

Does the parachute stay where it is as well?

#

It looks like you're assuming that a parachute will fall at some speed without a driver unit in it.

boreal parcel
#

I think it may actually be that the mission im running on, Invade & Annex does something to the vehicles (maybe simulation disabled or something? not sure).

I tried getting in and driving the vehicle closer to where the halo jump addAction was, and it worked fine. The vehicle teleported with me and parachute opened as expected

#

I dont see anything in the mission files disabling vehicle simulation, ill need to go search for whatever file spawns the vehicles

granite sky
#

What's _position?

#

You have a general lack of private on your local vars, and given your generic var names that's extremely dangerous.

#

Like if you call one of your functions from another then you have no guarantees about what your local vars are afterwards.

boreal parcel
boreal parcel
#

it really doesnt make sense to me. I have found the script that spawns vehicles, and followed it to all other functions is appears to pass the vehicles to for modification and nothing seems to disable simulation or anything of the sort. At one point the vehicle was locked, _veh lock 2 then unlocked _veh lock 0

#

even if simulation was disabled, I dont see why setPosATL wouldnt move the vehicle

#

oh wait

#

could it be a locality issue? the vehicle is on the server, hence why the setPosATL doesnt work as setPosATL is technically executed on the client?

#

and when the player gets in the vehicle its local to him or something, hence why it works after he drives it? still doesnt make total sense to me

jaunty nest
#

Making a CO-OP PVP mission and I'm using the High Command function, but I think it's too easy-mode to have enemy markers on my map/HUD especially since it displays Player units uniquely. is there a way to turn enemy markers off? I've tried looking for mods that do this, but found none, also tested many stock-game difficulty options to no avail.

Any help/guidance would be appreciated.

#

when i tested it in pvp with my friends it effectivly gives you wall hacks is what i mean

granite sky
#

Yeah, there's no stock option to turn it off. Script might be able to do it.

jaunty nest
#

what i was hoping

granite sky
#

Ok, easiest method is to run this as local:
setGroupIconsVisible [true, false]

#

That turns off all group icons on the HUD. You still get enemy icons on the map.

#

If you want to turn enemy icons off entirely, or still want friendly markers on the HUD, then you'd probably need to use setGroupIconParams on every group.

jaunty nest
#

let me play around with it

#

on setGroupIconParams would i put that into a groups init

#

@granite sky i put setGroupIconsVisible [true, false] into init.sqf is that incorrect?

granite sky
#

Might be too early. You'd have to test.

#

I just ran it from the debug console.

jaunty nest
#

that video above is when i was testing

#

it didnt seem to work

little raptor
#

who's the unit local to? unit or server?

granite sky
#

A unit created with createVehicle?

jaunty nest
#

It works fine on the debug console

#

how would i execute it server wide

jaunty nest
#

i cant get it to work

#

i did

_loopHandle = spawn "loop.sqf";

in init.sqf

#

and

setGroupIconsVisible [true, false];

in liip.sqf

#

loop*

#

it doesnt work but when i execute

setGroupIconsVisible [true, false];
``` using debug it works just fine
granite sky
#

If the loop version doesn't work then you screwed up the loop. Try initPlayerLocal anyway though.

hallow mortar
#

Try _loopHandle = 0 spawn "loop.sqf";
(you can remove _loopHandle = if you don't actually use it - saving the handle is not required)

jaunty nest
#

hm loop method doesnt seem to work

#

doesnt make any sense that it works just fine on debug

#

maybe if it had a repeating script in itself?

granite sky
#

Spawn only works with code anyway. If you want to execute a file then it's execVM, but if you're running something small then you can just declare the code inline:

0 spawn {
  // code goes here
};
#

Try initPlayerLocal though, runs later than init.sqf.

#

After module init, which might be important.

#

oh wait, that's not true for multiplayer :P

#

(init.sqf timing is completely different for SP vs MP)

jaunty nest
#

doesnt seem to work

granite sky
#

I don't have time to investigate it anyway. You're probably fighting against some stock high-command code on timings.

#

Maybe loop setting is fine.

jaunty nest
#

i put

setGroupIconsVisible [true, false];
``` into initPlayerLocal.sqf btw
granite sky
#
0 spawn {
  while {true} do {
    setGroupIconsVisible [true, false];
    sleep 10;
  };
};
jaunty nest
#

i havnt tried the loop method nikko suggested

granite sky
#

Try that in initPlayerLocal.

#

You know you need an actual loop, right. Just executing a file called loop.sqf doesn't do it :P

cosmic lichen
#

There should be no need to loop it.

#

Make sure the locality is correct. If in doubt use remoteExec on the target unit

#

Just keep i mind that teamswitch breaks it

#

or rather, you need to re-execute it after team switch

jaunty nest
#

wont be doing any teamswitching

granite sky
#

aha, it switches back on when you toggle high command mode.

#

so you'll need an EH

jaunty nest
#

yes

#

didnt know how to word it

granite sky
#

initPlayerLocal again:

addMissionEventHandler ["CommandModeChanged", { 
  setGroupIconsVisible [true, false];
}];
hallow mortar
granite sky
#

The loop method would kinda work but you could still cheat by repeatedly toggling HC mode so that the icons pop up for a few seconds.

jaunty nest
#

EH worked absolutely perfect. Exactly how i needed it to

cosmic lichen
#

So the issue was the if you exit HC view it resets the group icon visibility? If so I am going to add a comment to the command page.

granite sky
#

Oh I see, the HC module actually sits on top of this stuff.

#

So you can set group icon visibility even if you're not in HC mode.

#

Once you understand that then it makes complete sense :P

#

The existence of the CommandModeChanged EH then becomes the curious part.

jaunty nest
#

ive been testing it in single player and is working flawlessly

granite sky
#

Should probably change to:

addMissionEventHandler ["CommandModeChanged", {
  params ["_isHighCommand", "_isForced"];
  if (_isHighCommand) then { setGroupIconsVisible [true, false] };
}];
jaunty nest
#

whats the difference

granite sky
#

Otherwise the group icons will be shown on the map even when you switch back from high command.

jaunty nest
#

ah okay

jaunty nest
#

i get an error

hallow mortar
#

And what does it say?

jaunty nest
#

copying it rn

hallow mortar
#

(If you exactly copied the last posted code without reading it, it's because you need to replace the last }; with }]; - the event handler arguments array is not closed)

jaunty nest
#

thats exactly what i did

#

i can deactivate a script by turning it in to a comment right

#

putting // infront of it

#

so i dont have to delete then repaste stuff

hallow mortar
#

That is indeed what comments do

jaunty nest
#
addMissionEventHandler ["CommandModeChanged", {
  params ["_isHighCommand", "_isForced"];
  if (_isHighCommand) then { setGroupIconsVisible [true, false] };
}];
#

doesnt seem to be any different than the previous script

#

i can see friendly and enemy group markers on the map same as before

#

no group markers on HUD is still working how i want it (no markers)

#

im putting this in initPlayerLocal.sqf btw

velvet flicker
#

I want to do a feasibility check on something. Can you remove a players input, give their character an AI, and have it move for them?

hallow mortar
#

A player and an AI can't both be the brain of a unit at the same time

#

You could possibly use selectPlayer to move the player into another body. If AI was enabled on their unit in the slotting screen, it should take over (if it wasn't, the unit might just die 🤷 ).
Alternatively/in combination, you can use switchCamera to let the player see through the eyes of an AI-controlled unit.

velvet flicker
#

Hmm, Okay, thanks!

quaint oyster
#

Can someone help me come up with a script? Been having troubles thinking of a good way to do it. Essentially I'm having a dog that spawns, I want the dog to either hold a waituntil script that deletes the unit when I leave the lobby or have an ondisconnect script do it, but I might be over thinking the entire process.

Solved

tough abyss
#

Does anyone know how I could carry two launchers at once because I really like to use static weapons but cannot because have to bring the tripod and gun separately

#

So either a mod or a simple script to let me carry two launchers

grand idol
#

Is there a way to remove a specific magazine from a player's inventory? I have a CT_LISTNBOX display which shows every magazine in the player's inventory and the number of rounds in each mag. Selecting an entry and clicking a button will send the list box index to a function which will then remove that mag from inventory and add a number of other items equal to the number of rounds in that mag. The only part of this that I can't figure out is how to address the inventory to remove a specific mag or a mag that matches the description including number of rounds.

_index = _this select 0;
_magX = magazinesDetail player select _index;
player removeItem _magX;

yields [""45rnd RPK-74 7N6M(35/45)[id/cr:10000828/0]"",""45rnd RPK-74 7N6M(45/45)[id/cr:10000829/0]""] but those entries don't appear to be recognized by the removeItem command. I could dumb it down and filter to allow only full mags but I'd rather not.

#

Other workaround suggestions are welcome.

grand idol
tulip ridge
hallow mortar
# grand idol Is there a way to remove a specific magazine from a player's inventory? I have ...

Firstly I'm pretty sure you want removeMagazine, not removeItem.
Secondly, there are not currently any relevant commands that can target specific magazines. They only accept classnames, not magazine IDs.

The only way I can think of is to use magazinesAmmo to see what mags there are (since that command provides a usable classname), then use removeMagazines to take away all mags of that type, then use addMagazine to give back all except the one you wanted to remove.

tulip ridge
#

What's the default font for scroll wheel actions?

hallow mortar
tulip ridge
#

That looks right

#

We'll go with that, 'preciate it 👍

tough abyss
#

Thank you

tulip ridge
#

I just realized I was thinking of WebKnight's "Two Primary Weapons" mod

leaden summit
#

Ok it's late Sunday evening here so forgive me if the answer to this is staring me in the face, but if I have the groupID O Alpha 1-1:1 how do I reference the group that unit is in? Or can I just not do that?

hallow mortar
#

You must have got that ID by having a reference to the unit. So you can use group _unit to get a reference to the group the unit is in.

leaden summit
#

Problem is I'm editing the ALiVE mod and the groupID comes from a hash which is well outside my wheelhouse at the moment. I'll go bug the ALiVE discord about it see if I can't get more info

leaden ibex
# leaden summit Ok it's late Sunday evening here so forgive me if the answer to this is staring ...

From what I see, my guess is that O Alpha 1-1 is the groupID and the :1 is the unit it is referencing.
You can get the group by doing something like this.

private _aliveStr = "O Alpha 1-1:1"; // Will get from hashmap I guess?
private _grpStr = _aliveStr  select [0, (count _aliveStr) - 2]; // remove the ":1" from the string
private _group = nil;
{
  if (str(_x) == _grpStr) exitWith {_group = _x};
} foreach allGroups;

did not test, but this is how I would go around doing that

tough abyss
#

It doesn't meantion the keyword functionality of local at all.

#

Thats the conventional usage of the local commad

#

upvoted both issues

velvet flicker
#

is it safe to delete elements from an array while forEaching through it

sullen sigil
#

no, it will skip the next iteration

velvet flicker
#

Is there a proper way to do something like this other than making an empty array to juggle the new list?

_item = [1, 2, 3];
{
    if (_item == 2) then { _item = _item - [_x]};
} forEach _items;
sullen sigil
#

_item apply {if (_x isEqualTo 2) then {};}

velvet flicker
#

Thank you!

queen cargo
#

u ==> Unary

#

that is your "keyword functionality"

south swan
quick peak
#

hey is it possible to sort array of variables? lets say i have a markers with names path_1 to path_11. When i use sort command it looks like this ["path_1", "path_10","path_11","path_2", ...], which don't work i think. But when i use BIS_fnc_sortAlphabetically it looks like this ["path_10","path_11","path_2", ... , "path_9","path_1"]

granite sky
#

surely ["path_1","path_10","path_11","path_2",...]

#

If you want that sort of thing to be sorted "correctly" then you need to pad with zeroes, like "path_001"

quick peak
#

damn, no other options? I mean i already placed about 150 markers

#

hmm maybe changing name of every point in array to number and then sorting?

#

will have to think about it

granite sky
#

You could write your own sorting function

#

well, an apply to break the marker names into string + number and then they'll sort properly.

south swan
#

so, something like

private _meme =  ["path_10","path_11","path_2", "path_9","path_1","path_5","path_7","path_003" ];
[_meme, [], {parseNumber (_x select [5])}] call BIS_fnc_sortBy``` returns expected `["path_1","path_2","path_003","path_5","path_7","path_9","path_10","path_11"]` 🤷‍♂️
#

but it's still better to have a more usable names in the first place

quick peak
unborn bramble
#
_objects = nearestobjects [start_pos,[],500];

{
  _objPos = getPosASL _x;
  _zCord = (_objPos #2) - 0.5;
  _objPos set [2, _zCord];
  _x setPosASL _objPos;
} foreach _objects;

I am using this code to move my objects, but since some of them are rotated, they move in other direction. For example, upside down object will move up instead of down (uses his own z coordinate)
Is it possible to use world's z coordinate to move all objects down?

still forum
#

Or simpler.
_items = _items - [2];

As that's the same thing, remove all 2's

velvet flicker
#

Thank you. My use was to filter out all locations that aren't at least a certain distance away

dreamy kestrel
velvet flicker
#

given a players unit, what's the best way to get their machine ID for use with executing remoteExec on their machine?

granite sky
#

From where?

#

Server can just do owner _playerUnit

velvet flicker
#

Ah perfect, that should work then. Thanks!

granite sky
#

Bear in mind that player units don't transfer locality to the client immediately on creation.

velvet flicker
#

Okay, is there a safe time to wait or should I test it somehow

granite sky
#

Not sure.

#

getUserInfo is also an option in some cases.

velvet flicker
#

I was looking at that, in which case would it not be an option?

granite sky
#

Well, you need the playerID. I guess you could wait until the object has a non-empty-string playerID.

#

(that's not necessarily immediate either)

#

In both cases the potential problem is with "given a player's unit".

shut flower
#

"Also isEqualTo is a fuck ugly name for a command like this. Why not ===?"

Java for example uses equals(), it's almost the same

fair stirrup
#

Does anyone have any idea how ModuleRadioChannelCreate_F works? It doesn't seem to kick in on dedicated servers but nondedicated it functions fine?

fair stirrup
high marsh
#

what are the ui elements called that display information, are not interactable, but display information without inhibiting player movement / actions

still forum
little raptor
still forum
#

nuuu

#

It was 32°C at midnight 😢

winter rose
#

meltededmen

drifting portal
twin comet
#

because === is stupid

grand idol
#

How can you check if a string is in an array that consists of arrays?

_magArray = [            
["30Rnd_65x39_caseless_black_mag","65",30,2],
["30Rnd_65x39_caseless_khaki_mag_Tracer","65",30,2],
["150Rnd_556x45_Drum_Green_Mag_F","556",150,2],
["30Rnd_762x39_AK12_Mag_F","762",30,2],
["30Rnd_762x39_AK12_Mag_Tracer_F","762",30,2],
["10Rnd_127x54_Mag","127",10,3],
// etc...
];
_magazines = magazinesAmmo player;
{
    if (_x select 0 in _AmmoTemp ) then { // Something }
    else { // Something else };
}forEach _magazines;

I've tried various versions of if (_x select 0 in _AmmoTemp select 0 ) with no success.
The primary array will eventually be a global hashmap if that changes anything.

south swan
#

if hashmap is keyed by mag classname, you can check for if (_x#0 in keys _magHashMap) blobdoggoshruggoogly

#

current data organization should use something like sqf private _current = _x; if (_magArray findIf {_x#0 == _current} > -1) then { blobdoggoshruggoogly

grand idol
#

Ah, ok, thanks. What about in it's testing version above?

tranquil nymph
#

whoa there, what?

grand idol
#

Ok, just saw the edit. Thanks again.

tranquil nymph
#

=== is a pretty fundamental operator

#

or, comparison, rather

dreamy kestrel
#

working with uniforms, vest, backpacks, as containers, I know how to get their loading, as a percentage. but I would also like to know their loading of what, in terms of mass. I am halfway certain how to do this for backpacks. not so much for uniforms and vests, or the same information is not available (?).

dreamy kestrel
#

duh right, cool I think I can work with that thanks

velvet flicker
#

What cool projects you all working on anyway

dreamy kestrel
opal zephyr
#

Hi when I attach an object to the player and then attach a character to said object, that character has their animations sped up considerably... Is this a known issue and if so is there a workaround?

little raptor
#

the simulation speed of attached objects changes so yes it's known

opal zephyr
#

Damn, that doesnt sound like something I can change 😅

#

ah the comment from R3vo mentions it on the attachTo page, perhaps I just need to find an object with a similar update frequency

#

got around the issue :)

shut flower
#

=== is the standard in almost every language

unborn bramble
#

Is there a way to let players draw markers above images on map, drawn with drawIcon?

runic heart
#

Dscha have you ever found out what keeps a building from being able to be used in housing?

jade abyss
#

???

runic heart
#

what keeps the building from being buyable

#

like a custom building placed on the map not being buyable

#

if all the classnames are correctly inputted

jade abyss
#

If you refer to Life -> F that shit. I ain't do shit for that anymore.

runic heart
#

Ah i thought you were the owner of Distrikt41 did you shut all that down

jade abyss
#

I am, i gave the Life-Server to other guys, so i can start my own non-life Mod ;)

runic heart
#

im more of a roleplayer than a life mod person.

shut flower
#

What it prevents? A shitty global object varibale

#

and there is the really rare chance that it doesn't get broadcasted

sullen pulsar
#

Yeah, screw life.

#

Down with it.

jade abyss
#

Yeah

shut flower
#

so change this system

jade abyss
#

Kill it @sullen pulsar

shut flower
#

@sullen pulsar here? lol :D

sullen pulsar
#

I lurk around here an there.

runic heart
#

ya im not getting into the whole life mod talk for the 100th millionth time

#

i just wanted to know what was stopping a custom building i had

#

thanks anyways

shut flower
#

Tonic, small q, why did you tried to continue developing altis life another time just to realize that it's just dead?

#

Custom building? Modded al?

sullen pulsar
#

Just because something is dead does not mean I can't work on something to pass the time.

shut flower
#

You're bored, are you? :D

runic heart
#

suddenly i feel like im on altisliferpg again

#

time to go bye

sullen pulsar
#

Life is all about having a hobby, a hobby which you use as a time sink.

runic heart
#

amen to that

rich bramble
#

This is somewhat offtopic but by god do I hope that the next iteration of the engine will deprecate (keep it around as legacy option for all I care) the weird little custom langauge with funky syntax and odd semantics and instead just offer a LUA API or something equally 'mainstream'. </sqf-rant>

shut flower
#

"next iteration of the engine"
You really believe BI is rewriting the whole game and engine for arma 4? this is funny

jade abyss
#

Why not?

rich bramble
#

I did say iteration. I'm not asking for miracles, just a LUA api ;)

shut flower
#

I don't believe in such myths

sullen pulsar
#

I think it's funny that people believe in an ARMA 4. ARMA 3 wasn't even suspose to exist.

molten yacht
#

I'm trying to figure out the proper code... I need to have this trigger auto-teleport this boat full of players that drives into it and then set them facing south.

#

I think I want Condition: vehicle player in thisList and activation vehicle player setPos getPosASL tpMarker;

#

and then vehicle player setDir 180

#

I'm also not sure if you can just use getPos instead of getPosASL because they're in boats?

torpid palm
#

@molten yacht have you checked this?

molten yacht
#

I'm not sure what the advantage of that would be

torpid palm
#

true, lol. thought i would try to help

winter rose
molten yacht
#

oh hm

#

yeah

#

I was gonna have it just remoteExec but that won't work, it'd teleport the boat a ton

#

like 8 times per boat if they're full of players...

winter rose
#

if you know the boat, name it and call it a day?

molten yacht
#

So the idea was like, you fade out for 3 seconds and you fade back in to have the players skip a good 10 minutes of loud boat ride

winter rose
#

if you don't know or there can be multiple boats… do you want to teleport them all to the same spot all at once wherever they are?

molten yacht
#

yeah I need to rethink how I'm doing it

keen wing
#

_wprgsl setUnitLoadout [
    ["CUP_arifle_AKM_Early","","","",["CUP_30Rnd_762x39_AK47_M"],[],""],
    [],
    ["CUP_hgun_TT","","","",["CUP_8Rnd_762x25_TT"],[],""],
    ["CUP_U_B_BDUv2_dirty_OD_NK",["CUP_8Rnd_762x25_TT","CUP_8Rnd_762x25_TT"]],
    ["rhs_6b5_officer",["CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","CUP_30Rnd_762x39_AK47_M","rhs_mag_rdg2_white","rhs_mag_rdg2_white"]],
    ["rhs_sidor",["rhs_mag_f1","rhs_mag_f1","rhs_mag_f1","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit"]],
    "PO_H_SSh68Helmet_NK_2",
    "",
    [],
    ["ItemMap","","ItemRadio","ItemCompass","ItemWatch",""]
];```
I wrote this script to customize the loadout of a unit with a specific classname. But the script didn't work and I found "_wprgsl = LOP_NK_Infantry_SL;" was the cause, but I don't know how to solve it. Log says I need to write a phrase in Object, but I don't know how to write it.
little raptor
unborn bramble
keen wing
unborn bramble
keen wing
# unborn bramble No, check this https://community.bistudio.com/wiki/forEach

Then one more question. Is this below the right way to put units of different classnames into each different loadout?

{
if (typeOf _x == 'LOP_NK_Infantry_SL') then {_units pushBack _x};
} forEach allUnits;

{
_x setUnitLoadout [];
} forEach _units;

{
if (typeOf _x == 'LOP_NK_Infantry_MG') then {_units pushBack _x};
} forEach allUnits;

{
_x setUnitLoadout [];
} forEach _units;```
unborn bramble
#

No, you need to create separate arrays for MG and SL units, otherwise their loadouts will be same.
Right version would look like this

_unitsSL = [];
_unitsMG = [];
{
if (typeOf _x == 'LOP_NK_Infantry_SL') then {_unitsSL pushBack _x};
if (typeOf _x == 'LOP_NK_Infantry_MG') then {_unitsMG pushBack _x};
} forEach allUnits;

{
_x setUnitLoadout []; // insert SL loadout here
} forEach _unitsSL;

{
_x setUnitLoadout []; // insert MG loadout here
} forEach _unitsMG;
winter rose
#

or… do it all in one loop?

velvet flicker
#

Is there a known way to change the height of an entire map without aboslutely bogging it down and freezing the game

vocal mantle
#

@rich bramble But where is <sqf-rant>? when does the rant begin?

rich bramble
#

@vocal mantle See, I'll call that bit of code later, in a scope where <sqf-rant> is defined! Isn't dynamic scoping great? :P

vocal mantle
#

Not as cool as 360 no scope

keen wing
#

There's a problem. I wrote a loadout like below, but there's nothing in unit's inventory but only 5 of FAKs in backpack. Also, weapons are not loaded with a magazine. Did I write it wrong?
P.S: I also want to improve readability by dividing text by color, what should I do?

_x setUnitLoadout [
    ["CUP_arifle_AKM_Early","","","",["CUP_30Rnd_762x39_AK47_M"],[],""],
    [],
    ["CUP_hgun_TT","","","",["CUP_8Rnd_762x25_TT"],[],""],
    ["CUP_U_B_BDUv2_dirty_OD_NK",[["CUP_8Rnd_762x25_TT",2]]],
    ["rhs_6b5_officer",[["CUP_30Rnd_762x39_AK47_M",10],["rhs_mag_rdg2_white",2]]],
    ["rhs_sidor",[["rhs_mag_f1",3],["FirstAidKit",5]]],
    "PO_H_SSh68Helmet_NK_2",
    "",
    "Binocular",
    ["ItemMap","","ItemRadio","ItemCompass","ItemWatch",""]
];
} forEach _unitsSL;```
velvet flicker
#

I'm not an expert, but instead of typing it out by hand you could build the unit in editor/arsenal and copy the loadout array to your clipboard and be certain of it's format

velvet flicker
#

When a unit dies it drops their weapons, so getUnitLoadout isn't getting me the weapons they drop.

I've been using nearObjects to get an array of nearby dropped items, using weaponCargo on it, and getting them name of the weapon from that array. The problem I'm running into is I cannot get whatever attachments it had on it via this method. Is there a better way to get the dropped weapons a unit had after it dies, and if not, is there a way to get the attachments a weapon via the way I'm attempting?

#

Solution: weaponsItems

granite sky
#

If you put a Put EH on the unit it'll give you the weapon holder they drop their weapon into when they die.

#

That weapon holder is internally linked to the corpse and it's deleted when the corpse is, but I don't think there's any direct way to determine it.

hallow mortar
#

You can use nearSupplies to find weapon holders near the corpse and getCorpse to select the right one

velvet flicker
granite sky
#

oh, 2.12 has getCorpse, neat

#

You'd probably need to add the Put EH pre-emptively.

mighty fox
#

I wanted to start learning by messing around with some workshop mods, managed to extract the .pbo and start making my own changes to the sqf files. However when I repack the pbo, install local mod in the launcher, and run, none of the changes I made are reflected in game. It's as if I'm running the unedited mod. Anything completely obvious I'm missing?

velvet flicker
#

There is a lot to bite off there

#

First, you must be certain your change is obvious and detectable

high marsh
#

Class has idd, idc, etc. then it’s components as children?

mighty fox
velvet flicker
#

Gotcha

#

I have to ask because I've been there before lol

shut carbon
granite sky
#

The brackets won't hurt. They're just not required here.

mighty fox
#

I had some with systemChat format (); as well

velvet flicker
#

Did you unload the old mod?

granite sky
#

Now format () is probably wrong ;P

#

format takes an array, like this: format ["my var = %1", _myVar]

mighty fox
#

Ok well that's a separate issue to what I'm trying to fix, because even editing the text of the mod's groupChat messages is not being reflected ingame

granite sky
#

Is this the only mod you're loading?

mighty fox
#

It's a mod that requires ACE and is using ace medical, so I'm just digging through the code and adding systemChat to help me see what's being run

#

But even editing the text of the pre existing _player groupChat "mod initialised" for example is not working, I still see the unedited message in game

#

It's definitely not running from the workshop folder and should be using my edited pbo from the game directory

granite sky
#

I guess check the latter from the RPT at least.

#

It lists every addon PBO loaded.

shut carbon
#

is your mod on the launcher mods list?

mighty fox
shut carbon
#

no need

mighty fox
#

Yeah I figured, that would make launching the game thousands of time for testing even more frustrating

shut carbon
#

you're building the wrong pbo...?

#

I only use Addon Builder so, check your path if you're using that.

mighty fox
#

Using pbo manager right click and then manually placing in the directory. Thanks anyway, I'll go see if I can figure out what I'm doing wrong

shut carbon
#

don't use that, it's bad for building. Good for extracting though.

mighty fox
#

Thanks, will install add-on builder

keen wing
#
_face = selectRandom [face1,face2,...];
_voice = selectRandom [voice1,voice2,...];

_units setFace _face;
_units setSpeaker _voice;```
I wrote a script like this to make the units in _units set randomly among the faces and voices below, but I get the error that I need an Object type and it doesn't work. I don't understand what the Object type is, can anyone tell me what it is?
south swan
#

unit is object. Vehicle is object. Building is object. Game logic is object.

#

array is not object blobdoggoshruggoogly

kindred lichen
#

Arma is like a side project that bi has as a fun thing to do with all that sweet military contact vbs money.

keen wing
hallow mortar
#

The problem is that you're trying to apply setFace and setSpeaker to the entire _units array at once. Those commands only accept a single unit at a time. You have to iterate through the array, applying the command to each unit.

_units = [ ... ];
{
  _face = selectRandom [ ... ];
  _voice = selectRandom [ ... ];
  _x setFace _face;
  _x setSpeaker _voice;
} forEach _units;```
kindred lichen
#

As long as vbs exists, there will be arma built on top of it.

keen wing
warm hedge
#

_x only exists in the scope of forEach, so no problem at all

hallow mortar
#

It would be a problem if you were using a forEach inside another forEach, but if the other use is separate then it's fine.

kindred lichen
#

That being said, we have like 5 more years until hardware overtakes arma 3.

keen wing
#

I only renamed _units, _face, _voice and wrote it as it is, but it still requires an Object type and doesn't work.

hallow mortar
#

Please post the exact code you tried

keen wing
#

Is it okay to upload as the file? It's too many to write in the chat.

hallow mortar
keen wing
warm hedge
#

Do you mean the first forEach doesn't work?

#

It is because _unitsWPRG only contains empty arrays

keen wing
#

Then will it be solved by written the classname of the unit instead of those?

warm hedge
#

A classname is just a string, not an object

#

It is very hard to answer what/how to fix since I don't really understand the intention there

hallow mortar
#

Line 16 should probably be _unitsWPRG = _unitsSL + _unitsTL + _unitsMG + ... ; rather than making an array of arrays

keen wing
drifting portal
winter briar
#

which is the path to loaded addons, want to use addonFiles ["path/pbo", ".hpp"] to get the header files

little raptor
#

You can't use pbos themselves. You should use the pbo prefix

drifting portal
#

BIS_fnc_deleteTask seems to not be working? when I create a task and set it to completed it does not delete it from the tasks list? (it also returns true for some reason while in biki it says that it returns nothing)

[player, "task_1", ["Destroy It", "Destroy Comms Tower", "marker"], [0,0,0], "ASSIGNED", 0, true, "Attack"] call BIS_fnc_taskCreate;

sleep 5;

["task_1", "SUCCEEDED", false] call BIS_fnc_taskSetState;

["task_1",player, true] call BIS_fnc_deleteTask;
drifting portal
#

apparently using the last two optional parameters of the function is what caused it to not work...

["task_1"] call BIS_fnc_deleteTask; //works
fleet sand
#

Hi guys question. How can i make it so unit takes same damage no matter where is hit with HandleDamage ? Basicly how to make it so units damage counts the same no matter where he is hit ?

proven charm
#

something like that, if I got the return value right

warm hedge
#

AFAIK HandleDamage's return is not the damage it produces but the entire health

exotic flax
#

If code provided returns a numeric value, this value will overwrite the default damage of given selection after processing. Return value of 0 will make the unit invulnerable if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling). If no value is returned, the default damage processing will be done. This allows for safe stacking of this event handler. Only the return value of the last added "HandleDamage" EH is considered.

proven charm
#

so current damage + wanted damage

dreamy kestrel
#

would be more precise perhaps, is there a way to add magazines to container inventory with a different ammo amount?

exotic flax
#

Not sure if it's possible to add magazines with reduced ammo counts though 🤔

#

You can manually set the ammo count of the current weapon/muzzle with setAmmo, but not for individual magazines

dreamy kestrel
#

thanks. it's okay, probably a non-issue all things considered. although it is interesting that the weapon loaded mag ammo amounts, AFAIK, would be preserved.

exotic flax
#

It's because each magazine will have an unique ID and therefor unique ammo count (see: magazinesDetail). However there are simply no commands available to get/set the ammo count for a single magazine, even though it should technically be possible.

dreamy kestrel
#

yeah I see that. no worries, thanks.

fleet sand
# exotic flax > If code provided returns a numeric value, this value will overwrite the defaul...
_doctor addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
    private _health = (1- damage _unit)*100;
    systemChat format ["%1",_health];
    private _currentDmg = if (_hitIndex < 0) then {damage _unit} else {_unit getHitIndex _hitIndex};
    private _takenDmg = _damage - _currentDmg;
    hintSilent format ["Current DMG: %1 \n Taken DMG: %2",_currentDmg,_takenDmg];
    _currentDmg + _takenDmg / 5;
}];
``` This is the code i currently have. But if i hit arm or leg then the _health of the unit changes depending on the _selection where was hit. How would i make it so that i can change how mutch dmg unit can take and save that in variable so i can later show it as a health bar ?
exotic flax
#
player setVariable ['TAG_currentHealthPercentage', ((1 - damage player) * 100)];

Or replace player with _unit when using it inside the EH