#arma3_scripting

1 messages Β· Page 7 of 1

frank mango
#

Anyway i can make it so that only players of a set role (pilot) or set variable can use the map click waypoint system?

winter rose
lofty pendant
#

I need some help please, Ive been trying to remmeber how to allow ai to say quotes from movies ect

#

I remmeber being able to set a trigger and once I walk over it they say a quote from the movie

#

ive been trying to find a video on youtube, but they all pre-record them selves saying it, but I dont want myself to say the quote except I want quotes from movies like blackhawk down etc

winter rose
#

ask them nicely

vocal valley
#

Anyone know of a script to add to missions to make the AI dynamically surrender or retreat?

winter rose
#

retreat - the AI does that already (on certain conditions)
dynamically surrender - is there a surrender module in A3?
you can also play with waypoints, that's more of a mission design thing

open fractal
#

ace3 at least has a surrender function

#

otherwise if there isn't a BIS function I believe there's an animation you can use

honest carbon
#

hi im new to mission file and scripting im really confused on what i actually doing with eden and was hoping someone could catch me up on what im missing and whats done wrong

open fractal
#

do you have something specific to ask?

honest carbon
#

sadly not artisan as i only understand how to place syn group up and how to disable ai movement

still forum
#

no, I made it years ago as a proof of concept. But.. eh
Not happy enough with it, and I think its not worth my time to make it properly

finite imp
#

hello guys,

I'd like to let players spawn unconscious at mission start with the ACE Unconsciousness feature. Anyone know how to do that? I found this on google, but it didnt work.
In the init of the player unit I put:

[player, true] call ace_medical_fnc_setUnconscious;

Any ideas?

opal zephyr
#

You could try putting "_this" or "this" to replace "player" and see if it works

tough abyss
#
_clothing = selectRandom _array; 
 
this forceAddUniform _clothing; 

_HatArray = ["H_Bandanna_gry", "H_Watchcap_blk", "H_Bandanna_blu", "H_StrawHat_dark", "H_Hat_blue", "H_Hat_tan", "H_Cap_Orange_IDAP_F", "H_Booniehat_khk", "H_Cap_red", "H_Cap_blu", "H_Cap_oli", "H_Cap_blk_ION", "H_Cap_khaki_specops_UK", "H_Cap_blk", "H_Cap_tan", "H_Hat_Safari_sand_F"];  
_Hat = selectRandom _HatArray;  
  
if (random 1 < 0.5) then {
   this addHeadgear selectRandom _HatArray

_BackpackArray = ["B_CivilianBackpack_01_Sport_Blue_F", "B_CivilianBackpack_01_Everyday_Black_F", "B_CivilianBackpack_01_Everyday_IDAP_F", "B_CivilianBackpack_01_Everyday_Astra_F", "B_CivilianBackpack_01_Sport_Red_F"];
_Backpack = selectRandom _BackpackArray;

if (random 1 < 0.75) then {
   this addBackpack selectRandom _BackpackArray
};```
#

when i try to put this in an init of a unit a warning box appears with just "init:" as the error message

#

an identical script minus the last two paragraphs relating to backpacks works perfectly fine so im not sure why it wont accept it now

#

nevermind, just realised im missing a closed bracket, bit of a scripting noob, ill delete this wall of text

warm hedge
#

Not that. You should be able to see the black error message and it should suggest why it doesn't work

#

No need to delete

tough abyss
#

but when i tried to enter it it just says "init:" and nothing else in the error box

#

but yeah ive figured out whats missing, still getting used to the syntax n stuff

frank mango
tough abyss
#

btw

#

is if (random 1 < 0.75)

#

a 25% chance of occuring? or 75%

warm hedge
#

75%

#

Let's simplify the thing: the random 1 is, let's say 0.0,0.1, 0.2, 0.3... 1.0
And the sentence will be true if the random is 0.0 through 0.7

opal zephyr
tough abyss
#

yeah that makes sense now i was confused because i mixed up the < > things but my thing was occuring more often than not

#

ill just switch it to 0.25

warm hedge
#

The opened side is bigger

tough abyss
#

yeah, the alligator opens his mouth to get the bigger food

warm hedge
#

smaller < bigger, bigger > smaller

tough abyss
#

or something along those lines

finite imp
opal zephyr
#

ya you can set a minimum time for them to be unconscious

#

add a 3rd parameter into the call, like this [player, true, 10]

#

the 10 is the time in seconds

finite imp
#

yeah i know that. Is there a way to keep them unconscious until someone "revives" them via zeus? I'd like them to stay uncon compared to let them wake up after a certain amount of time

opal zephyr
#

You could put a very large number in that field

finite imp
#

well, true.

#

do you know if this is JIP compatible?

winter rose
frank mango
#

Literally want it to be active for pilots only.

opal zephyr
winter rose
opal zephyr
#

I think they want only pilots to be able to place the waypoint

winter rose
#

which waypoint

finite imp
opal zephyr
#

The one that appears when you shift click the map Lou

finite imp
#

i thought calling fncs is global already

winter rose
opal zephyr
#

oh lol ok

opal zephyr
warm hedge
#

Not even related to the current topic but can anyone confirm that you can run or not Debug Console's execution even if you're not a host?
Context: I'm using a Mod that unlocks the console for everyone, but can't execute anything. So I looked into BIS_fnc_debugConsoleExec but the code says the executor needs to be isServer. So looks I can't run Debug Console in this context unless I'm missing something. Is this intentional?

#

["Arma 3","Arma3",211,149760,"Diag",true,"Windows","x64"]

#

(Oh don't mind me I'm just launching Diag at this time, but I've tested the MP environment in Dev, I know)

vocal valley
winter rose
jagged elm
#

Does anyone know if there is an event for when the local player kills another player?

opal zephyr
#

I dont think there is one specifically for that, but there are ones for when units die, and a number of filters could be applied to check for that

jagged elm
#

ok

tough abyss
#

is there a way to disable a unit being treated as hostile by everyone after killing like 2-3 civilians?

opal zephyr
#

Maybe in the difficulty settings or something in the mission editor

tough abyss
#

definitely not in difficulty settings

#

it seems like some kinda hard baked feature

warm hedge
#

It is handled by engine, but you can overwrite it using addRating. You can probably use the command with some kill EH(s) to attempt it

tough abyss
#

so im assuming i can use a trigger to reset their rating once they get near that area

finite imp
tough abyss
finite imp
#

so the timer is the way to go then?

jagged elm
tough abyss
#

i know next to nothing about scripting but he shouldnt wake up in ace if his blood pressure is low

#

or try re-running the unconscious script after like 9 seconds? i dont know if that resets the timer that checks if their vitals are stable

finite imp
# tough abyss not sure - if theres a script that lets you change the blood levels of the playe...

this is the documentation on the uncon fnc.

 * Arguments:
 * 0: The unit that will be put in an unconscious state <OBJECT>
 * 1: Set unconsciouns <BOOL> (default: true)
 * 2: Minimum unconscious time (set to 0 to ignore) <NUMBER><OPTIONAL> (default: 0)
 * 3: Force wakeup at given time if vitals are stable <BOOL><OPTIONAL> (default: false)

so i guess the minimum uncon time should fix the problem

jagged elm
#
player addEventHandler ["Killed", { 
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    removeAllWeapons _killer;
}];
``` In initPlayerLocal
tough abyss
#

where is that documentation btw?

finite imp
tough abyss
#

cheers

frank mango
vocal valley
finite imp
jagged elm
#

When I select an item from an array, how can I remove the quotes?

warm hedge
#

Context?

jagged elm
#

I am doing this ```sqf
_randomWeapon = selectRandom ["arifle_SDAR_F", "arifle_SDAR_F"];

warm hedge
#

Why you need to get rid of?

jagged elm
#

nevermind.

tough abyss
#

does anyone know how much "rating" a unit starts with and how much they lose for killing someone they shouldnt?

#

nevermind

#

id assume its the same as this? anyone know if its different in A3?

granite sky
#

IIRC it's at least roughly the same.

#

Honestly it's really busted and you should just override the EH.

#

Especially if you're using any vehicles off-faction.

#

but crashing your own vehicles (even forced) can get you into sideEnemy.

jagged elm
#

How can I add ammo to a player's inventory?

tough abyss
#

is it possible to change a units side upon firing their gun?

#

i want a civilian to switch to opfor when he first fires a gun in the scenario

hallow mortar
#

You can use join to move the unit into a group belonging to the other side. Units inherit their group's side.

jagged elm
hallow mortar
granite sky
#

Caveat: The side switch only works after creation. If you create a civvie in a redfor group, he's still side civvie. If you join him to a redfor group afterwards, he's side redfor.

tough abyss
granite sky
#

Yeah it's fine here.

#

Just a gotcha for future use.

tough abyss
#

ah right

#

so how do i make it so upon firing a weapon he joins the redfor group?

hallow mortar
#

A fired event handler would do it

winter rose
winter rose
hallow mortar
winter rose
hallow mortar
#

Yes, but it doesn't allow overriding

hallow mortar
#

That's a shame. Unfortunately, I can't really troubleshoot without knowing what you actually did.

jagged elm
#

I did this

_magazineClass = currentMagazine _killer;
_killer addMagazine [_magazineClass, 30];
hallow mortar
#

That appears to be valid in principle, but it could be broken if _killer didn't have a weapon, or switched to a weapon with no magazine, or something like that.

#

Note that if you just want to add a full mag of whichever type, you can just do _unit addMagazine _magazineClass and not have to specify the bullet count. Specifying the bullet count could result in getting a 200rd belt with only 30 bullets in it if they were using an LMG!

#

Oh, if this is for multiplayer, you should remoteExec the addMagazine command because it has to be run where the target unit is local. This isn't the cause of the error you had, but it will be an issue later.

jagged elm
#

This is my current code:

_magazineClass = currentMagazine _killer;
_killer addWeapon _randomWeapon;
_killer addMagazine [_magazineClass, 30];

The new weapon doesn't have a magazine.

hallow mortar
#

currentMagazine returns the current magazine at the time the command is run. If you run it before giving the unit a weapon, while they don't have a weapon, then it won't return anything useful, because......they don't have a current magazine.

#

If they do already have a weapon and you're intending to replace it with a new one, then running currentMagazine on the previous weapon is also not very useful, because the magazine it returns is unlikely to be compatible with the new weapon.

#

Perhaps it would be helpful to know what you're trying to achieve overall.

jagged elm
#

I am trying to make it so when you kill a unit it switches your primary weapon to a new random weapon.

#

Everything works other than the ammo.

hallow mortar
#

Well, when you use currentMagazine you're getting the magazine of the previous weapon (or of no weapon, if you removed the old one first), so this isn't right.

#

There are a couple of ways you can do this. You can store a selected magazine type in an array with the random weapon, and select it when you come to add it. Or you can use bis_fnc_compatibleMagazines to pick a random magazine that's compatible with the selected weapon. Give me a moment and I'll demonstrate.

granite sky
#

addMagazine adds magazines to the unit's inventory, not the weapon anyway

#

addPrimaryWeaponItem can be used.

hallow mortar
#

addMagazine does load the magazine instantly if you do it before adding the weapon

granite sky
#

Yeah, you'd need to flip the order there.

#

I prefer the explicit method personally.

hallow mortar
#

The caveat there is that I can't really assume it's going to be a primary weapon. This feels like a Gun Game thing so it could be a pistol or something

#

Method 1:

// Remove old shit
_unit removeMagazines (currentMagazine _unit);
_unit removeWeapon (currentWeapon _unit);

// Store a list of guns and magazines
_randomWeapons = [["gun_rifle_1","ammo_rifle_1"],["gun_rifle_2","ammo_rifle_2"]];
// Select a random pair
_randomWeapon = selectRandom _randomWeapons;

// Select the magazine from the pair and add it. Mag first so it gets instantly loaded.
_unit addMagazine (_randomWeapon select 1);
// Select the weapon from the pair and add it
_unit addWeapon (_randomWeapon select 0);```
open fractal
#

Bis_fnc_addweapon will automatically give ammo

granite sky
#

Just don't give them a Javelin because then it won't, unless they have a huge backpack :P

hallow mortar
#

That would be convenient. That being said, I think it would be better to specify the magazine type to use per weapon, in case the weapon has some wild things that work with it that could be accidentally auto-picked (e.g. rifle grenade magazines for the GM G3)

granite sky
#

(it just uses the addMagazine -> addWeapon method)

#

hmm

hallow mortar
granite sky
#

3CB Factions has a lot of broken default magazines, like it lists all the BAF grenades before the ones that actually exist.

#

So yeah, getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") # 0 is not reliable.

#

Works fine for vanilla, RHS and CUP though IIRC.

hallow mortar
#

A weapon with magazineWells set up properly shouldn't have any problems* because magazines that aren't installed won't be picked up. Unfortunately, you can't rely on weapons having magazineWells - older mod stuff could have defined lists of mags that include things from other mods for cross-compatibility.

  • problems with broken stuff specifically. Problems with functional but unwanted magazines like rifle grenades might still pop up.
jagged elm
#

Thank you. Everything seems to work now.

tough abyss
#

Hi! Is there a chance that I could randomize my ALIVE unit? I want the roles to have random variations of the vest, helmets and hats they already have.

tough abyss
#

has anyone tried sorting for something like```sqf
_rifle = "getText (_X >> 'author') isEqualTo 'Bohemia Interactive'" configClasses (configFile >> "CFGweapons");

then using ```sqf
_Holder addWeaponCargo [_rifle, 1]; ```
because for me regardless of what i try it doesnt give error nor working and it seems to just not work
#

dont see anything about it

#

(ive tried addweaponcargoglobal and additemcargoglobal etc

open hollow
#

i have a question of performance:

i had lets say 100 sector of 100x100 meters that i check a few things to be captured and display it changing the color of a global marker.
what its the best way to handle it?

having 100 whiles runing on each sector, or having only 1 while that checks for each of them ?
At the end its like giving 100 triggers ...

granite sky
#

That's something that you should have smarter optimisations on.

open hollow
#

it has, but in the end is an foreach or 100 whiles running

granite sky
#

What's the check?

#

In general 1 while with a loop is much safer, because it's self-limiting.

open hollow
#

its a function i made, that check the amount of players on each side, and if the ammount is bigger that a desired value like 1.5, you can capture the sector

#

atm i have 1 while that has an 1 minute sleep, and check all at once

#

ill prefer more "resolution" on this, checking each second and having a capture phase

granite sky
#

Are these sectors in a rectangular block?

open hollow
#

yea but use the marker as input an inarea to define what players are in the sector

copper raven
tough abyss
#

Another way you could further optimize it with square/rectangular grid is by doing inAreaArray with columns and rows rather than individual grid squares

#

Then just use row/column intersection for specific cells

winter rose
tough abyss
#

for testing

#

im trying to sort cup i was thinking an issue with cup config

#

so i went to something that should be replying

#

is this when you tell me that there is limits ingame?

open hollow
winter rose
open hollow
#

to be able to capture a square, you need to be more than 1.5 times enemies and having a non diagonal neighbor of same side, after a sector is captured, that new check is made

willow hound
granite sky
#

@open hollow That has even better optimisation opportunities, because a sector can only flip (in the first pass) if it's non-diagonally adjacent to a sector of a different side.

#

So after each loop, you can adjust a candidate list cheaply.

#

And the candidate list is ~10-20% of the total sectors.

open hollow
#

yea ill leave it in that way, ill try in the future to make it work better and be hable to have a middle point, but event if i lower that check to every second. it will be less harmfull that having 100 threads running

granite sky
#

yeah, it just won't necessarily complete in a second, which is preferable to murdering the perf of every other script :P

tough abyss
open hollow
granite sky
#

@tough abyss configClasses returns an array of config classes, addWeaponCargo takes a string. So it's very wrong.

tough abyss
#

how would i add them in an array of config classes? would i need to convert them?

open hollow
#

also, doing that its dead slow

granite sky
#

Probably this for the second part:

{ _Holder addWeaponCargo [configName _x, 1] } forEach _rifle;
open hollow
#
_rifle = "getText (_X >> 'author') isEqualTo 'Bohemia Interactive'" configClasses (configFile >> "CFGweapons");//this give you an array of configs

//so you can whant jhon say:
{ _Holder addWeaponCargo [configName _x, 1] } forEach _rifle;
//you ended up with a holder with all bis weapons
granite sky
#

I haven't checked whether the first part is valid.

open hollow
granite sky
#

well yeah...

tough abyss
#

ok might need to filter that a bit lol

#

God I hate writing code on mobile

#

Why do I even bother

open hollow
#

a friend once added 10k binoculars in a box and it somehow mess up the server lol

#

so having 3286 different items, i think it will be much worse

copper raven
#

otherwise you will end up with all the baseclasses

tough abyss
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
winter rose
tough abyss
#

yeah just didnt get till later sorry

fluid wolf
#

I have a... math error I do not understand.
vehicle distance (plane1 getRelPos [247.909, 0]) returns 789.629
but
vehicle distance plane1 returns 1742.79

#

how does adding 247.909 meters to 1742.79 (or in the most relateable scenario, subtracting it from it) result in a difference of over 1000?

open hollow
#

try with (plane1 getRelPos [247.909, 0]) distance plane1

#

if its more than 250, something weird happend lol

fluid wolf
#

1500.22

open hollow
fluid wolf
#

I'm so lost.

#

...wait it... it's... altitude. GetRelPos does not account for altitude its getting the position on the GROUND

#

thats... so dumb but... it makes sense now.

open hollow
#

yea it return the Z = 0 isn't it?

fluid wolf
#

Yes

#

I needed Vector.

#

thank you so much.

sullen sigil
#

is there any way to detect when a script has failed

#

i have a meme idea to punish myself for making errors in scripting

#

any script in general nothing hardcoded or anything

sullen sigil
# open fractal diag_log

Not entirelt what I'm looking for though its 0232 so I should probably wait till morning so im not tired

granite sky
#

If you spawned it then you can check the handle for completion, but it won't tell you failure vs normal completion.

broken forge
#

Would this work as a function to play a custom sfx sound: ```sqf
SOGAmbientSoundLoop = {
params ["_source", "_sfx"];

private _dummy = "#particleSource" createVehicle ASLToAGL getPosWorld _source;
_dummy say3D _sfx;

waitUntil {(!alive _dummy)};
deleteVehicle _dummy;

};

```sqf
[object, "NameOfSFXSound"] call SOGAmbientSoundLoop;
winter rose
#

createVehicleLocal*
and idk, try it

#

I would say that "no" because why would the _dummy "die"

broken forge
#

It's for an object that would be creating an ambient sound

winter rose
#

and it would die?
also, it would not be a loop.

I recommend you using CfgSFX if you try to do what I think you try to do

broken forge
#

I was using createSoundSource and I just now saw that the command becomes greatly attenuated when in a vehicle or first person view. So I'm trying to figure out an alternative to play an ambient engine sound for a custom composition I created.

winter rose
#

I believe this bug has been solved recently, can you please try and let me know?

broken forge
#

Will do, I'll test it out and let you know, thanks

winter rose
#

then a wiki edit is in order if it has been fixed πŸ˜‰

cobalt path
#

I have a simple add action script

_this addAction ["<t color='#01AC01'>Open Door", 
{ 
params ["_target", "_caller", "_actionId", "_arguments"]; 
_target animateDoor ['Door_1_source', 1]; 
},  
[], 7, true, true, "", "_this == driver _target"];
_this addAction ["<t color='#AC0101'>Close Door", 
{ 
params ["_target", "_caller", "_actionId", "_arguments"]; 
_target animateDoor ['Door_1_source', 0]; 
},  
[], 7, true, true, "", "_this == driver _target"];

but instead of executing it in vehicle init, I want to execute it from sqf, how does one go around executing it that way?
I was thinking

[_this select 0,’yes’] execVM "\MF_Plane_Configs\MF_Y_32X\scripts\door.sqf";

doesnt seem to work

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

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

because of _this

#

also ’ is an invalid character

warm hedge
#

_this can only happen in scripts, not in Init field of a vehicle, you want this instead. Yes, I think this is an Arma moment

unreal marlin
#

Anyone that played the campaign anyone remember the first checkpoint that you get stopped at, I have a good SQF file for it but i would like to add the dialogue with text and voice, anyone know how to do that?

#

Also anyone know if its possible to edit a arma 3 singleplayer mission in Eden Editor?

warm hedge
#

Existed e.g. official missions you mean?

unreal marlin
warm hedge
#

Do you know how to unpack pbos?

frank mango
# hallow mortar Yes, but it doesn't allow overriding

In that case, I found a variation of that

  params ["_units", "_pos", "_alt", "_shift"];
    if !(["pilot", typeOf player, false] call BIS_fnc_inString) then {
      onMapSingleClick {_shift};
    };
}];```

But doesnt actually seem to do anything. I presume the fact that it doesnt allow overriding is why.
hallow mortar
#

That's....not really a good way of doing it

#

the event handler you're adding is completely unnecessary.

#

Just put this part in initPlayerLocal.sqf:

if !(["pilot", typeOf player, false] call BIS_fnc_inString) then {
  onMapSingleClick {_shift};
};```
#

onMapSingleClick is, itself, like adding an event handler. The effect persists once the command has been run. The benefit of the actual EH version is that it can be stacked with other EHs of the same type, removed with removeMissionEventHandler etc. Trying to apply onMapSingleClick through an event handler doesn't confer any of those benefits on it - it just means that it only takes effect once the EH has fired at least once, and the command is repeated every time the EH fires, which is not necessary.

#

The structure of your event handler means you're only applying onMapSingleClick once the EH has fired, which means it's probably too late to intercept that initial map click. I bet if you continued testing after the first one, you'd find it worked for those, since the onMapSingleClick pseudo-EH has now been created.

frank mango
#

"pilot", typeOf player
How do I ensure this? Is it just as simple as placing the Helicopter Pilot AI/setting to playable?

open fractal
#

It checks if the player's classname contains "pilot"

#

seems kind of unnecessary ngl

hallow mortar
#

it's a reasonable way of checking whether the player is a pilot. Since the point of this was to restrict the waypoint except for pilots, that's necessary

open fractal
#

That's contingent on the pilots's classname falling under that naming convention

#

strings are slow but it shouldn't matter too much at this scale

#

if Eagle strictly uses "pilot" classes for playable pilots it should be fine, but if it's part of a template/framework it's probably best to avoid relying on classnames

winter rose
#

I don't believe there is anything like isPilot in the config
maybe grabbing all planes in the config and their pilot's classname would be a framework-acceptable solution

unreal marlin
open fractal
#

Or checking if the unit is the driver of an aircraft

#

depending on the need

winged hemlock
#

Quick question, am I able to make a weapon respawn after 20 minutes? If so how, I'm trying to find how. Thanks

winter rose
winged hemlock
#

So I'm looking to place a M107 on the ground and make it respawn after picked up.

winter rose
winged hemlock
tough abyss
#

this addEventHandler ["FiredMan", {this setCaptive false; 
}];```
#

I'm trying to have this unit turn captive false upon firing a shot so that my police units will start engaging him

#

but it doesn't seem to work - I'm not sure what the issue is. they don't fire at me, and I have no idea if captive is even turning false at all

open fractal
#

you can't use this in an event handler expression

tough abyss
#

so i should name the unit and replace this with the name?

open fractal
#

not necessary one second

#

see the code block?

#

just copy that into your script

#
this addEventHandler ["FiredMan", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
}];
#

then use _unit to get the unit the event handler is attached to

winter rose
#

and do not forget to remove the EH from there too πŸ™‚

#

(for the sake and beauty of cleanliness!)

open fractal
#

what if he wants his setcaptive to be set to false for every bullet in the magazine ever thought of that, Lou?

winter rose
#

no? I only think of MYSELF

open fractal
tough abyss
#

where do i put this setCaptive false;

open fractal
#

you don't

#
_unit setCaptive false;
#

and then remove the event handler as it shows in the link

#

this is a magic variable mostly used for init boxes and such in mission making

#

which while the event handler is being added in the init box the code you're providing in the event handler expression is being executed elsewhere

#
//use `this` here :)
this addEventHandler ["FiredMan", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
  //don't use `this` here >:(
}];
//use `this` here :)
winter rose
#

@tough abyss

smoky rune
#

setTowParent disables stationary brakes, right? will wheels actually rotate upwards/backwards (not steering) while towing in that case?
I'm experimenting with Advanced Towing script from 2016 adding this new command, it seems to work for me with at least steering, but wheels are not rotating/turning over (fully rotating upwards/backwards just like normal wheeled vehicle movement).

smoky rune
#

I meant I tried this and this is what i've observed
I will upload on a video of what's happening, brb

winter rose
#

what do you mean, "upwards/backwards" - like, "rotating", or something else?

winter rose
smoky rune
#

I mean rotating not left-right (when you use steering wheel on real car, for example) but upwards-backwards, making full turn (just)
||jesus, my english is in dire need of improvement||

It seems to working, but it looks like that stationary brake is still working - wheel's protector/tread is not moving at all

winter rose
#

still no idea what you mean but okay πŸ˜›

smoky rune
#

i just wanted to say that the wheels on towable vehicle are static

#

they're only moving left-right angles, not, idk, tilting

open fractal
smoky rune
#

yeah (I believe that setTowParent applies it too though)

#

Advanced Towing uses proxy object to attach rope instead of attaching directly to vehicle, maybe it's causing this

#

yeah, it's the case

smoky rune
#

last question - do towing parent needs to be set to nothing after removing rope? something like _towableVehicle setTowParent objNull?

hallow mortar
#

That would be sensible.

#

The towed vehicle's steering will continue to follow its parent even if it's not connected by a rope.

smoky rune
#

Yeah.
Also, function description has information that only Car-kind vehicles should be towed that way (I guess it's cars, trucks and wheeled APCs as isKindOf returns true for all these types). So, I should avoid towing tracked vehicles with setTowParent or it will be mostly fine?

meager granite
#

Check vehicle's simulation to know if its towable?

#

tankx, carx?

finite imp
#

Hello guys,
I saw a video somewhere where an artwork creator used a couple of animations so set a scene on video. I went and read a few things about how animations work ingame in Arma 3 and found a few animations I'd like to use.
Now the question: I know how I can put an animation onto a soldier and keep that playing, but I'd like to play (read: queue) a few anmiations one after another to make a coherent scene and record that. Does anyone know how I would go about that? For reference, I use some of the mods POLPOX released (the animations viewer for example), but only know how to put on a single animation for example. This doesnt need to be MP friendly aswell, just for recording purposes in SP.

smoky rune
# meager granite Check vehicle's simulation to know if its towable?

I'm already doing that.

if (_towable isKindOf "Car" && {(_towing isKindOf "Car" || {_towing isKindOf "Tank"})}) then {
_towable setTowParent _towing;
_towable disableBrakes true;
{
    if (isPlayer _x) then {
        ["Towing", "This vehicle is about to be towed."] remoteExecCall ["A3A_fnc_customHint", _x];
    };
    moveOut _x;
} forEach crew _towable;

the question is that new way of towing applies only on wheeled vehicles, so only wheeled vehicles will receive new good way of towing, while others will use the old janky one, so I want to know if setTowParent really can't apply on tracked vehs (I guess I just need to test it).
also, do I need to use exactly CarX and TankX? Are they legit classes?

meager granite
#

Simulation, not classes

#
getText(configFile >> "CfgVehicles" >> typeOf _towable >> "simulation") == "carx"
smoky rune
#

oh, didn't know that
thanks for code snippet!

meager granite
#
toLower getText(configFile >> "CfgVehicles" >> typeOf _towable >> "simulation") in ["carx", "tankx"]
#

Didn't use the command myself by apparently you need both vehicles to be local. If that's the case and command itself doesn't do anything with locality, you might have to first kick driver out, lock the driver seat, then have server setOwner to towing vehicle locality and then use the command

winter rose
smoky rune
#

function already has a way to jump around locality issue (though not efficient one) - it simply checks locality of vehicle and remoteExecs it to vehicle's owner machine in case if the vehicle does not belong to origin executor

meager granite
#

Up to you to implement all that

#

lockDriver can be useful to keep players out of driver seat (and locality change)

#

They will still be able to remain in the vehicle on other seats during towing if needed

#

Wish there was something like lockOwner so we can keep driver in with controls disabled and no locality change

smoky rune
#

hmmm
So, only driver should be locked?

meager granite
#

driver is the only seat that changes vehicle locality

finite imp
meager granite
#

Co-Pilot that can "Take controls" does too, but thats not for carx/tankx, I don't think you should care about it

#

lockDriver has to be executed where vehicle is local, it will broadcast to other clients after a bit

#

Not sure how well it does when locality changes, I guess it should be fine

#

Best bet would be add plenty of logging and test edge cases

copper raven
torn elm
#

is there anything on modifying the speed of arma 3 characters?

storm arch
#

There used to be a way to send txt in the center of the screen anyone know the command for that?

storm arch
#

yes thank you bro

potent swan
#

hey guys

#

i got problem

#

editted a mission in pbo manager

#

but when i replace the existing pbo it just reverts

manic sigil
#

I need to get an array of every unit in a vehicle, without selecting any players.

#

I've been tinkering with this whole thing all day, and I'm finally hitting brain frying limit t_t

open fractal
manic sigil
#

... May have come to a workaround.

open fractal
#

you want an array of every ai unit in the vehicle?

manic sigil
#

Yeah

open fractal
#
crew _vehicle - allPlayers
``` if i'm thinking straight
copper raven
manic sigil
#

Aw cripes

#

I was wrapping my head around FindIf, or going to just build an array as they climb in T_T

#

Of fn course, there's a command for every player on the server.

tough abyss
#

Might want to use

private _allPlayers = BIS_fnc_listPlayers;

instead of
allPlayers
to exclude headless clients

manic sigil
#

Good call. This is a project I intend to actually release, inshallah

#

Worked like a charm, thank you!

tough abyss
#

and condition can use _x to represent the current element being checked

manic sigil
#

Yeah, I've got the gist of it, but I was hung up on 'okay so I have to find the element in the array that is a player, then remove THAT element, then search for the next player...'

#

It's been a day.

tough abyss
#

Ah yeah. If you want to filter arrays like that you can just use array select {condition}

#

which will return an array of things in the array that meet the condition

#

so e.g. you can do allUnits select {isPlayer _x} to get only players/headless-clients from allUnits

manic sigil
#

Aw hell that's even easier T_T

manic sigil
#

Alright, one last braintickler, why can't my trigger Call.

#
AirborneTrg setTriggerStatements ["this"," 
list AirborneTrg call SRD_FNC_TROOPTRANSPORT;
",""]; 
#

Trigger is activated, and if I take the snippet of code and execute it manually, it works fine.

#

But it doesn't run when the trigger activates.

tough abyss
#

try this

#
AirborneTrg setTriggerStatements ["this"," 
thisList call SRD_FNC_TROOPTRANSPORT;
",""]; 
manic sigil
#

No dice on trigger activation :/

tough abyss
#

hm

#

where is this code running?

manic sigil
#

Right now, injected via the debug box, on the server level.

tough abyss
#

You're doing server execute?

manic sigil
#

Yeah

tough abyss
#

mm, that'd be why

#

setTriggerStatements has local effect, you'll need to execute it globally

#

try global execute

manic sigil
#

Global exec, deactivated and reactivated trigger, no effect.

tough abyss
manic sigil
#

Executing the code by itself still works at least... yay?

tough abyss
#

out of curiosity

#

what's the code for SRD_FNC_TROOPTRANSPORT?

manic sigil
#

Aight, but fair warning, this is all still in testing and needs a lot of cleaning up.

#
SRD_FNC_TROOPTRANSPORT = {
params ["_Helicopter"];
if !((list AirborneTrg select 0) isKindOf "helicopter") exitWith {};
Helicopter = NearestObjects [AirbornePad, ["Helicopter"], 7] select 0;
Helicopter setVariable ["SRD_canDeploy",true,true];

Helicopter addAction
    ["Rifleman", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
        ["vn_b_men_army_16",_Caller,"AB"] call SRD_FNC_SPAWNINFANTRY
    },nil,4.1,true,false,"","Helicopter distance AirbornePad < 7 && isTouchingGround Helicopter",5];
    
Helicopter addAction 
 ["Deploy Troops", 
  { 
  _Patrol = createGroup West;  
  crew helicopter select {!isPlayer _x} joinSilent _Patrol; 
  _Patrol leaveVehicle Helicopter; 
  [_Patrol,getpos leader _Patrol, 200] call bis_fnc_taskPatrol; 
  RemoveAllActions Helicopter; 
  Helicopter setVariable ["SRD_canDeploy",false,true]; 
  },nil,6,true,false,"","Helicopter distance AirbornePad > 10 && isTouchingGround Helicopter",5]
  }
tough abyss
#

so when you say you're executing the code by itself, what are you running?

manic sigil
#

The trigger just detects when a player vehicle is near the helipad, then the function sorts out helicopters from other vehicles.

#

[list AirborneTrg] call SRD_FNC_TROOPTRANSPORT;

tough abyss
#

I see

#
AirborneTrg setTriggerStatements ["this"," 
[thisList] call SRD_FNC_TROOPTRANSPORT;
",""]; 
#

^ try that

manic sigil
#

Executed on server, global, and local levels, de-reactivated trigger... no effect.

tough abyss
#

perplexing

manic sigil
#

Tested with dummy effect (hint ""good"") and that worked, so the trigger is firing and running the onAct section.

#

Just... refusing to call.

copper raven
#

the hint and the call in the same thing?

#

or did you only try the hint

manic sigil
#

Not at the same time, no, I'll try that now.

#

Just as diagnostic - hell, Ive got the RPT open and it's telling me nothing T_T

copper raven
#

print the list aswell, and the function

#

hint format ["fn=%1, list=%2", srd_fnc_trooptransport, thisList]

#

on phone meowsweats

manic sigil
#

Ooh, good call. I did systemChat with before and after messages, both fired but no effect on the call.

tough abyss
#

Still not sure what's causing the issue but I've cleaned up the function code for you, could help

#
SRD_FNC_TROOPTRANSPORT = {
    params ["_detectList"];
    
    if !((_detectList#0) isKindOf "helicopter") exitWith {};
    
    private _helicopter = nearestObjects [AirbornePad, ["Helicopter"], 7] select 0;
    _helicopter setVariable ["SRD_canDeploy", true, true];

    _helicopter addAction [
        "Rifleman", 
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            ["vn_b_men_army_16", _caller, "AB"] call SRD_FNC_SPAWNINFANTRY;
        }, nil, 4.1, true, false, "", "Helicopter distance AirbornePad < 7 && isTouchingGround Helicopter", 5
    ];
        
    _helicopter addAction [
        "Deploy Troops", 
        { 
            private _helicopter = _this#3;
            private _patrol = createGroup West;  
            (crew _helicopter select {!isPlayer _x}) joinSilent _patrol; 
            _patrol leaveVehicle _helicopter; 
            [_patrol, getpos leader _patrol, 200] call bis_fnc_taskPatrol; 
            removeAllActions _helicopter; 
            _helicopter setVariable ["SRD_canDeploy", false, true]; 
        }, _helicopter, 6, true, false, "", "Helicopter distance AirbornePad > 10 && isTouchingGround Helicopter", 5
    ];
};
copper raven
#

maybe the function itself is undefined on the machine, do the hint i wrote, see what is the output

manic sigil
copper raven
#

well then, the first object in the list is not a helicopter

tough abyss
#

Had a small error, fixed now

#

^ I suspect that may be the issue as well

#

seeing as you're just killing the entire function if the first detected object is not a helicopter

manic sigil
#

But only when run by the trigger, not manually?

#

I'll remove the gatekeeper to test it, but I was having the same issue before.

copper raven
#

just don't use triggers, afaik they have some funky stuff with the thisList or list _trg not returning correct stuff sometimes

manic sigil
#

... And that worked.

#

Welp.

copper raven
#

use findIf then

#

instead of looking at the first object

tough abyss
#

The gatekeeper is a bit pointless anyways, yeah? Your nearestObjects in the function is already filtering out non-helicopters anyways.

manic sigil
#

... Oh yeah. >_>

#

In my defense, it really has been a long day T_T

copper raven
#

but why are you calling nearestObjects, or is the trigger in different position?

tough abyss
#

I would replace the gatekeeper with

if (_detectList findIf {_x isKindOf "Helicopter"} == -1) exitWith {};
#

then it'll only fail if no helicopters are detected

manic sigil
copper raven
#

run findIf on _detectList, if it's -1, exit, else pick an element from the list at that index, and don't use the nearestObjects

tough abyss
#

^

#
private _heliIndex = _detectList findIf {_x isKindOf "Helicopter"};
if (_heliIndex == -1) exitWith {};
private _helicopter = _detectList#_heliIndex;
#

that'll replace the gatekeeper and the nearestObjects

manic sigil
#

Hrm... That didn't seem to work out, but its not telling why in the rpt.

tough abyss
#

What's the current function code

manic sigil
#

Ah, wait.

#

I'm still working in full, front of god and everyone public variables T_T

#

Of course throwing a few privates in there would cause an issue

tough abyss
#

lol yeah this is all assuming you're using the cleaned-up code

manic sigil
#

That did it, yeah, just had to nationalize the helicopter.

#

... I'm sticking with that one.

#

At least, until I get it working, THEN I'll break it by making everything private.

tough abyss
#

private helicopter service > global helicopter service

#

ah I see why it breaks with the helicopter private

#

one moment...

manic sigil
#

My headache with privatizing variables and objects is that I don't fully grasp how far it goes; if I private here, will I still be able to act on it there.

tough abyss
#
SRD_FNC_TROOPTRANSPORT = {
    params ["_detectList"];

    private _heliIndex = _detectList findIf {_x isKindOf "Helicopter"};
    if (_heliIndex == -1) exitWith {};
    private _helicopter = _detectList#_heliIndex;
    _helicopter setVariable ["SRD_canDeploy", true, true];

    _helicopter addAction [
        "Rifleman", 
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            ["vn_b_men_army_16", _caller, "AB"] call SRD_FNC_SPAWNINFANTRY;
        }, nil, 4.1, true, false, "", "_target distance AirbornePad < 7 && isTouchingGround _target", 5
    ];
        
    _helicopter addAction [
        "Deploy Troops", 
        { 
            private _helicopter = _this#3;
            private _patrol = createGroup West;  
            (crew _helicopter select {!isPlayer _x}) joinSilent _patrol; 
            _patrol leaveVehicle _helicopter; 
            [_patrol, getpos leader _patrol, 200] call bis_fnc_taskPatrol; 
            removeAllActions _helicopter; 
            _helicopter setVariable ["SRD_canDeploy", false, true]; 
        }, _helicopter, 6, true, false, "", "_target distance AirbornePad > 10 && isTouchingGround _target", 5
    ];
};
#

this should allow you to not have everything break

#

and the idea of private is that you're limiting the variable's existence to the scope it's declared in

#

the thing with addAction is that the code within runs in a separate scope at a different time, so you need to pass any private variables to it via the arguments param

#

which is what I'm doing in the above code

manic sigil
#

No effect, by the by :/

#

Ah, that'd be the _this#3 line?

tough abyss
#

yes and you can see I have _helicopter after the code block

#

as that's addAction's parameters argument

#

which I access via _this#3 from within the action code

#

also I changed the above code to properly use the new gatekeeping code

manic sigil
#

Tested, no effect - and it's well past time I went to bed, but I am really grateful for your input ^_^

#

I'm sure I'll be tinkering with this for the foreseeable future, but I just need a working model to start.

tough abyss
#

Strange, perhaps I've missed something. Have a good night.

copper raven
#

_detectList is undefined

tough abyss
#

oh duh where'd it go

#

must've copy-pasted my notepad++ wrong

#

there, fixed

manic sigil
#

Works, but neither spawning rifleman nor deploying troop actions functioned.

tough abyss
#

ughhh that'd be because I undid one of my changes

manic sigil
#

Ah, yeah, I see it

tough abyss
#

fixed

manic sigil
#

And the troop function partially worked, but since I called on plain 'Helicopter' in the spawning script... that ones on me :p

tough abyss
#

Ah yeah, that'll need to take the helicopter as a parameter

#

I know working with privates seems like an unnecessary hassle at first but believe me when I say it's worth the added code cleanliness

manic sigil
#

Oh, I'm sure. Just need to bash my head into it until I get it X_X

tough abyss
#
{
  // _a doesn't exist here, it hasn't been defined yet
  private _a = 5;
  // _a exists here, this is the scope it was defined in
  while {true} do {
    // _a exists here, the scope it was defined in encloses the "while" scope
  }
  // _a still exists here, still in the scope it was defined in
}
// _a doesn't exist here, we've left the scope that it was defined in
#

^ might help with the whole understanding scopes thing

manic sigil
#

Got it ^_^ I was already passing _caller, so just vehicle _caller instead of, yknow, a concrete object.

tough abyss
#

I would send _target rather than vehicle _caller

manic sigil
#

True, the action is on the helicopter...

tough abyss
#

in fact the bottom addaction could even be replaced with

    _helicopter addAction [
        "Deploy Troops", 
        { 
            private _helicopter = _this#0;
            private _patrol = createGroup West;  
            (crew _helicopter select {!isPlayer _x}) joinSilent _patrol; 
            _patrol leaveVehicle _helicopter; 
            [_patrol, getpos leader _patrol, 200] call bis_fnc_taskPatrol; 
            removeAllActions _helicopter; 
            _helicopter setVariable ["SRD_canDeploy", false, true]; 
        }, nil, 6, true, false, "", "_target distance AirbornePad > 10 && isTouchingGround _target", 5
    ];
#

but the functionality would be the same

#

just using _target (_this#0) instead of passing _helicopter in _arguments

manic sigil
#

Alright, got a working build with _target being passed.

granite sky
#

Any suggestions to how I'd get the minimum range of an artillery class?

little raptor
#

or not thonk

tough abyss
#

Friend says it's usually defined in the artillery firemodes and/or ammo class but can also be dependent on the time-to-live and etc.

granite sky
#

I would guess there's a list of modes used in the artillery computer somewhere but I haven't found it yet.

tough abyss
#

Could be inherited, probably going to need to do some digging

tough abyss
#

I'm not certain how artillery computers get their modes, just going off of what I've been told

#

but if it's config-level it could be inherited from something else

little raptor
#

there are min and max ranges in the config:

granite sky
#

Yeah but those are nonsense for artillery.

little raptor
#

but there's also:

little raptor
granite sky
#

Like the RHS BM-21 actually has a minimum range of 5000m but the config minRange values are stuff like 800m.

tough abyss
#

pretty sure according to cfgWeapons docs the minRange/maxRange/etc. settings are for AI not the actual weapon ranges

little raptor
#

then calculate it yourself blobdoggoshruggoogly

granite sky
#

I'm not even sure it'd come out at the same numbers.

#

Like that 5000m is too clean to be calculated.

#

Might just cut my losses and use the worst case as a global minimum.

little raptor
#

I guess min range is:

_minArtilleryCharge * _initV^2 / 10
#

e.g. projectile velocity of Mk6 mortar is 200

#

so max range is 4000

#

min range is 1400 meowsweats

#

yeah that's wrong...

granite sky
#

Minimum range would be mostly dependent on elevation.

little raptor
#

yeah

#

let's say max elevation is 80

#
_minArtilleryCharge * _initV^2 * sin 160 / 10
#

478 m

granite sky
#

What's this _minArtilleryCharge?

little raptor
#

0.35 for Mk6

granite sky
#

Units? :P

little raptor
#

oh wait

granite sky
#

And where is it from?

little raptor
#

it's a velocity multiplier meowsweats

#

not range

little raptor
#

in config

little raptor
little raptor
#

looks like it's correct-ish now thonk

granite sky
#

I can't see that in CfgVehicles, CfgWeapons, CfgAmmo or CfgMagazines reference

little raptor
#

e.g. Burst1, Burst2

tough abyss
#

Digging through config viewer now

#

can probably find it

granite sky
#

oh right, mode_N fire modes seem to be the artillery computer ones.

#

Oddly enough there are other modes with a smaller charge than lowest artillery computer mode...

ivory lake
#

they might be inherited from a baseclass and unused, check if they're in the modes[] array

granite sky
#

ah right, only six of them exist in modes[]

#

ok, maybe this is straightforward.

#

minRange seems to be valid for the modes that are actually in modes[].

little raptor
granite sky
#

yeah, the mortars can fire close :P

little raptor
#

if you substitute that you get a correct value

#

also you should put g=9.807 (or 9.81)

#

I put 10 because I was lazy meowsweats
with those you get the exact values as artillery computer

tough abyss
#

Interestingly the min/max range in config for the mortar I'm inspecting don't match the ranges allowed by the ballistics computer, but it seems the ballistics computer does its own range calcs based on the ammo config properties and actual ballistic calcs

ivory lake
#

from what i've seen the AI can sometimes struggle with firing solutions that can be done easily with the artillery computer

#

like when setting up my own assets I can say, fire a mortar at a minimum range of idk, 432 m
but if I set minrange to that, and tell the AI to fire, they won't. so I end up having to set the minrange to something higher like 450

#

this isnt always the case its just something about the AIs own firing solution system vs. the artillery computer

granite sky
#

If you account for air resistance the min should be a bit lower. Not sure if that's a factor there.

ivory lake
#

airfriction is disabled for artillery

ivory lake
#

its why using 'real' values for artillery you end up with mortars that can fly 8km wehn they struggle to 2km in reality

tough abyss
#

Wonder if ballistics computers just generate the min/max range using the min/max angle and artillery speed then thonk

#

suppose they must if not defined in config

granite sky
#

In that case it's kinda curious that the AI firing solution & ballistic computer are different at all. Maybe one's just using the wrong source point or something.

#

but whatever, I can just add 100m here :P

#

thx everyone

little raptor
tough abyss
#

I saw min/max angle under the turret properties so could be that meowsweats

little raptor
#

no

#

didn't add up

granite sky
#

hmm. BM-21 clearly isn't using 88 for the max though.

tough abyss
#

Well wouldn't be surprised if it's just hardcoded, seems ArmA-y

little raptor
#

idk what BM-21 is, so... meowsweats

granite sky
#

It's one of those russian rocket launcher trucks.

#

Elevation limit is quite low.

#

(for artillery)

tough abyss
#

Surely the elevation range of the turret comes into play, no?

#

maybe not always but I'd think with something like that it would

little raptor
#

it does

#

but not sure if artillery computer actually uses it

#

it seems scripted thonk

#

and I didn't find anything to get the elev by script

tough abyss
#

watch them be doing some nasty trig with vectorUp

#

πŸ˜“

little raptor
#

I didn't find any event handler or anything for the display

ivory lake
#

the artillery computer displays are all in engine

#

like the calculations I mean

#

the turret values are correct but for like a mortar its already pointing up so a maxElev of 13 or something is nowhere near correct

#

and its more like 85-89

granite sky
#

oh, these things have thrust + thrustTime rather than muzzle velocity

ivory lake
#

they might but it's unlikely they're used, all 'rocket' artillery is generally using shotshell as its the only one the artillery computer cna handle

granite sky
#

hmm. In that case the numbers are 65 degree max elevation (on the turret, can't find anyone on the weapon), initSpeed 690 (on the sodding magazine) and 0.365 for the minimum artillery charge.

#

Comes out at 4954m.

#

oh hey, actually works with (0.365 * 690)^2 * sin (2*65) / 9.807 :P

winter rose
warm hedge
#

Also pboManager is not to edit a mission

prime aspen
#

Good morning! Do you know how I could know when a vehicle passes a speed? I couldn't find a matching event handler

warm hedge
#

No, an EH doesn't do that. You can check the speed each frame

prime aspen
#

@warm hedge to get the variation of the gearbox ?

warm hedge
#

What?

manic sigil
#

... are you trying to create a racing sim framework?

prime aspen
#

The translator distorts what I mean, sorry πŸ˜‚. In fact, I would like to know when does the gearbox retrograde or raise a speed, as neutral, first...

#

To make flames appear via an animation on the vehicle's exhaust...

manic sigil
#

Tight πŸ”₯

prime aspen
#

πŸ˜‚

#

I think it's not even possible to recover the revolutions per minute of the engine :/

hallow mortar
#

Not directly, but there are a couple of ways you might be able to estimate it indirectly

#

Many vehicles have RPM animation sources, for use with dashboard meters etc., which you might be able to check the phase of.

#

You could also try looking at the RPM soundController. This is used to determine the engine sound for gear shifts, so in theory it should know the RPM. I'm not completely sure how it works, though.

prime aspen
#

Yes it’s possible

#

I try

hallow mortar
drifting portal
manic sigil
#
[
 {
AirbornePad =createVehicle ["Land_HelipadCircle_F", [16166,7059,0]]
 }
] remoteExec ["call",0];

Am I right in this syntax? Just had a terrifying moment of realizing I was letting a global effect run wild on whats supposed to be a multiplayer code t_t

proven charm
granite sky
#

(which you really don't want or need to do here)

#

I'm not sure exactly what you're trying to do, but this should be fine when executed on any single machine:

AirbornePad = createVehicle ["Land_HelipadCircle_F", [16166,7059,0]];
publicVariable "AirbornePad";
#

Note that code in init fields and waypoint statements runs everywhere anyway, so watch out for those.

manic sigil
manic sigil
#

Bluh. This has become a passion project, which is a problem when its my weekend on work and all I have is some friends who can run my code and report the results at their own pace

manic sigil
#

Well, not a problem in the exploding chaos sense.

rough summit
#

Whats wrong with my code?

private _flagsObj = [];
{
    private _flag = missionNamespace getVariable [_x, objNull];
    _flagsObj pushBack _flag;
} forEach _flags;

while {uiSleep 5; true} do {
    for "_i" from 0 to count _flagsObj do {
        private _flagPosition = position (_flagsObj select _i);
        private _allNearEntities = _flagPosition nearEntities ["CAManBase", _distance];

        if (count (allPlayers select {(_x distance _flagPosition) <= _distance}) == 0) then {
            (_flagsObj select _i) setVariable ["flag_captureTimer", _captureTimer, true];
        };
#

line 21
17:13:07 Error in expression < select _i);
private _allNearEntities = _flagPosition nearEntities ["CAManBase",>
17:13:07 Error position: <_flagPosition nearEntities ["CAManBase",>
17:13:07 Error Undefined variable in expression: _flagposition

#

This is part of code ofc

#

Distance is int = 200
flags = array, which getting from cfg

#

capture timer int too

granite sky
#

for does one iteration given from 0 to 0

rough summit
#

step 1?

granite sky
#

no, it's just inclusive. correct version here is either from 1 to count _flagsObj or from 0 to (count _flagsObj - 1)

granite sky
#

Why you have nothing in _flagsObj is maybe another problem.

granite sky
#

^^

rough summit
#

i have little trouble in syntax understanding when using forEach in forEach πŸ˜„

little raptor
#

just store the external _x/_forEachIndex and you're good to go:

{
  private _var = _x;
  {
    if (_var blabla _x) then {
    }
  } forEach _B;
} forEach _A
rough summit
#

Hmm

#

So, ye, error dissapear

#

thanks

little raptor
rough summit
#

Whats wrong?

#

High performance cost?

little raptor
#

many things

#

that's one

rough summit
#

getPosATL then?

little raptor
#

in your code you don't need any position as far as I see

rough summit
#

Im add position cs thinks, what script can't calc distance between flag and player

#

But actually im delete it

little raptor
#

idk what you mean blobdoggoshruggoogly

rough summit
#

nvm, thats my own script tests

little raptor
#
        private _flagObj = _x;
        private _allNearEntities = _flagObj nearEntities ["CAManBase", _distance];

        if (allPlayers findIf {(_x distance _flagObj ) <= _distance} < 0) then {
             _flagObj  setVariable ["flag_captureTimer", _captureTimer, true];
        };
#

also I replaced your count-select with findIf

rough summit
#
    {
        private _flag = _x;
        private _allNearEntities = _flag nearEntities ["CAManBase", _distance];

        if (count (allPlayers select {(_x distance _flag) <= _distance}) == 0) then {
            _flag setVariable ["flag_captureTimer", _captureTimer, true];
        };
....
} forEach _flagsObj;
keen cedar
#

Does anyone know, why doesn't "[this, 0, 0.3] call PLP_fnc_fireWeapon
" work on static turrets

rough summit
keen cedar
#

y

warm hedge
#

Is it yes or why?

keen cedar
#

Why*

warm hedge
#

Because it doesn't. Because it is only for humans

keen cedar
#

Ok, ty

little raptor
rough summit
#

as i understand, findIf always return -1 or 0

warm hedge
#

Always?

rough summit
#

findIf terminates as soon as it finds an element that fulfills the condition

warm hedge
#

Which means not always -1 or 0

#
[0,1,2,3] findIf {_x == 2}```is 2
rough summit
#

ohh, ok

little raptor
little raptor
rough summit
#

If I have 15 elements and the 14th matches the condition, then I get 4?

warm hedge
#

*14

little raptor
#

13

warm hedge
#

...Or, 13 if 0 is not 1st you mean

rough summit
#

ok, ty

manic sigil
#

Aight, Im going to post the sqfbin of my current project.

https://sqfbin.com/azifuhegimiteharezim

Im attempting to create a very basic unit-spawning system for people who want to play SOGPFs Mike Force singleplayer or with a small group, and not bother Zeus to give them supporting elements or man defenses for them.

This is my first prototype meant to be injected by the debug console, and its just not coming together right; each element, ran separately, registers and will work afaik. But trying to run the entire block as a whole produces no results, but also no errors in the report or any of the diagnostic systemChat messages.

granite sky
#

@manic sigil What editor are you writing this in?

#

The indentation is... inconsistent at best.

#

You're missing a couple of brackets at least anyway.

#

SRD_FNC_AirborneTrigger is missing a close which kills everything after.

#

And that spawn at the end is also missing one.

manic sigil
#

Nominally, Notepad++, but sqfbin and android note app makes a mockery of organization.

granite sky
#

The bit that sysroot rewrote for you is fine though :P

manic sigil
#

Naturally, need to add a shoutout for their excellent work.

granite sky
#

It looks kinda like you wrote it in the debug console and pasted it back into an editor?

manic sigil
#

A lot of back and forth, yeah, though usually rewrites and edits were done on Notepad++

granite sky
#

Clean it up anyway. It's a lot easier to spot missing brackets when your indentation is sound.

manic sigil
#

Fair, its just odd that I stopped getting error reports, normally a missing bracket would pop one up right?

winter panther
winter rose
granite sky
#

@manic sigil There's a bug (fixed on dev, IIRC) that causes it not to throw errors on missing trailing brackets. The code just silently fails to execute.

winter panther
winter rose
#

that's code error then? can you show?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
winter panther
#
lbSetData [FACTIONLIST, _index, _tmpSide + '|' + (configName _x)];
lbSetColor [FACTIONLIST, _index, _tmpSideColor];
lbSetPictureRight [FACTIONLIST, _index, (_icon select 0)];
lbSetPictureRightColor [FACTIONLIST, _index, [0, 1, 0, 0.5]];

It fails with the following error

lbSetPictureRightColor |#|[FACTIONLIST, 0, [0, 1, 0, 0.5]];
Error Missing ;
granite sky
#

What's FACTIONLIST?

winter panther
#

the idc of the control

winter rose
#

given the error's location, it looks like this syntax doesn't exist here

#

Dedmeeen? πŸ˜„

winter panther
#

the second syntax works, but I need a reference to the Control πŸ€”

winter rose
#

then it's not an idc reference πŸ™ƒ

manic sigil
winter panther
#

I guess the first syntax is broken

winter rose
frail dune
#

Does anyone know of script that will spawn and garrison AI evenly within a given area?

umbral patio
#

hey I would have liked to modify the altis base position save script to change it, I would like to know if it was possible that the position of the player is only saved for 20 minutes basically I would like that if he disconnects and that if he reconnects within 10 minutes he stays at his old saved break, but if he reconnects after 30 minutes he can spawn where he wants? I tried to setVariable with time when the player is disconnected but I think I'm doing it wrong

winter rose
winter rose
frail dune
#

I mean both, I'd like to find a script that spawns AI on the fly (without Zeus) and have them garrison

#

within specific areas

winter rose
umbral patio
#

thanks

copper raven
#

you shouldn't use the idc syntax at any point anyway πŸ˜„

manic sigil
#

Oh, neat, Sqfbin highlights syntax when you dont have screwy code.

winter rose
#

ta-daaa!

manic sigil
#

Except it still wont run ._.

#

Bluh

granite sky
#

sighs

#

Anyone know a way to determine from config which turret on a vehicle is the one usable by AI for artillery fire?

#

Ideally not a hack :P

storm arch
#

Hey I know that execVM will execute a script, but is there a way to execute a script with call? I've heard that its better on performance.

#

maybe something with compile, I cant seem to figure it out

hallow mortar
storm arch
#

Is call global or local?

#

Compile*

winter rose
#

if "locality" makes sense

dreamy kestrel
#

Q: re: units, sides, waypoints...
It has been a little while since I last pursued this issue. Scenario: couple of downed pilots (side: BLUFOR) in a zone patrolled by some enemy squad (OPFOR).
The enemy squads start off with some nominal waypoints patrolling the zone, and start off well enough.
However, after awhile pilot discovery occurs, and the squads tend to locate, approach, and train weapons on the pilots.
At the time not sure there was a workaround for this, all things being equal.
However, it would not be that offensive, potentially, if we created the same pilot unit objects, same object class, but aligned to side OPFOR. Would that make any difference, i.e. the squads continue patrolling.
Clarifying...

dreamy kestrel
# dreamy kestrel Q: re: units, sides, waypoints... It has been a little while since I last pursue...

No thread here I suppose.
Pilots are set to a SURRENDERED state, animation; when ACE is available, literally using its CAPTIVES module for behavior.
The only concern I would have then, are the enemy squads smart enough to see a surrendered unit, and to 'free' them.
Player objective would be to identify the downed aircraft, pilots, neutralize the enemy squads, and CAPTURE and RTB for questioning.
So obviously freed pilot units would be a problem.

winter rose
#

…what is the question

dreamy kestrel
#

So the core question there is, would aligning the pilot unit side to OPFOR make any difference in waypoint behavior.

#

The last time I checked BLUFOR pilots interacting with OPFOR patrols, the OPFOR patrols break their waypoints cycle.

winter rose
#

if we are talking about vanilla, and ACE not being a concern at all:
enemies don't "break" waypoints - they would fight around, move etc etc, then once everything is back to normal "AWARE" behaviour, they follow again "MOVE" waypoints.

#

if you want OPFOR not to "notice" some BLUFOR as enemy, use setCaptive

dreamy kestrel
#

So, in response to the last statement, yes, they are setCaptive, AFAIK. Which I understand migrates units to CIVILIAN, IIRC (?).
A bit fuzzy there, at which point was finding OPFOR waypoint cycle stopping and training weapons on the units.

winter rose
#

then some other mod is interfering, otherwise they should just walk past them

#

I can only tell you about vanilla.

dreamy kestrel
#

AFAIK there is no other mod influencing the OPFOR units, waypoints, etc.
At the time the postulate was a bug mixing AI sides and so forth.
From the docs,

_soldier1 setCaptive true; side _soldier1; // returns civilian
side group _soldier1; // returns e.g blufor

Which makes sense.
Leaving ACE aside, setCaptive is setCaptive regardless.
The OPFOR units notice them after awhile and train weapons on them.
Literally our internal captives module is doing just this to surrender a unit:

if (!captive _unit) then {
    _unit setCaptive true;
};
winter rose
#

don't forget about locality

drifting portal
winter rose
drifting portal
#

how would I do that?

dreamy kestrel
winter rose
dreamy kestrel
winter rose
#

if you use setCaptive on the wrong machine, the unit won't be set captive

#

this is what aG/aL eG/eL are all about on command pages

dreamy kestrel
winter rose
#

anyway
try vanilla

dreamy kestrel
#

"vanilla" sans ACE; there is nothing else in the loop AFAIK that is influencing the behavior.

winter rose
#

like, NOTHING

#

make a simple repro setup
if it works, you have a mod interference

drifting portal
dreamy kestrel
winter rose
dreamy kestrel
#

yes, and I am saying that is the simplest I can tell you.
requires that I run these for my environment.

winter rose
#

you don't require mods to run vanilla πŸ™ƒ

#

1/ place weaponless unit
2/ this setCaptive true in its init
3/ opfor walking towards them
4/ ????
5/ profit, the captive is not even considered and opfor is not pointing guns anywhere.

winter rose
granite sky
#

Are the squads actually blocked from shooting in any other way?

fair lava
#

hi, when i put a function in an event handler, i.e _aircraft addEventHandler ["HandleDamage", {call hob_fnc_handleDamage}];
what is the locality of the function when run? for example i'm trying to set the vehicles fuel to 0 when its hit.
setFuel says it must be executed local to the owner of the vehicle, how can i ensure that?

#

locality is still a topic that confuses me

granite sky
#

Event handlers always run where they're installed. The question is whether they run at all.

#

HandleDamage only runs if the target object is local at the time that it's damaged.

#

For example, if you create a vehicle & AI crew and then add a HandleDamage on the same machine, that'll work fine. However, if a (non-local) player then kills the crew and boards the vehicle, it'll switch locality and the HandleDamage won't fire anymore.

fair lava
#

what if i added the event handler via a cba Extended_InitPost_EventHandlers?

#

i guess the event is placed on the machine of the person who spawned the asset?

granite sky
#

I don't know if you scrambled that function name but I don't know it.

tough abyss
#

Should probably correct that to event handlers usually run where they're installed. There's exceptions with things like the MP event handlers which run on all clients regardless of where they're installed and some other ones I can't remember off the top of my head.

#

Generally though, unless the BIKI specifies otherwise, they run where they're installed.

granite sky
#

oh right, not a function.

#

I would guess those run everywhere, like the editor init field.

manic sigil
#

GOT IT. God bless T_T

#

Only took like ten minutes after slapping it in an .sqf and executing it normally, so I actually get error messages.

copper raven
fair lava
#

ah hah

#

thanks

low remnant
#

is there any way to directly reference the vehicle spawned by calling BIS_fnc_moduleCAS from scripts? trying to attach something to it.

copper raven
#

look at it's source it might give you some hints

magic locust
#

This is probably the wrong space to ask this, im currently working with EXTDB3 w/ prepared statements, although I have quite a bit of experience with mysql/extdb, I took quite a long break and im just at a total loss for how to do this. Im currently trying to pull multiple lines out of a user database that have the same steamid.

What I'm trying to do is create a multiple-character sort of system.
I would like to have all of the lines dump from the database as their own array, within an array.
Like so:

[['steamid','characterid','name','bankacc'], ['steamid', 'secondcharid', 'secondname', 'secondbankacc']]```

I have this prepared statement, and I know I seem dumb, but if someone could help me out here to adjust this to what I need, id appreciate it.

```sql
[getPlayerChars]
SQL1_1 = SELECT citizenid FROM users WHERE steamid=?;
SQL1_INPUTS = 1
 
OUTPUT = 1
#

I basically need to push that data to the client so that I can draw out the character selection screen... If this isn't the correct space, if someone could push me in the right direction that would be amazing.

#
_fetchstr = format ["getPlayerChars:%1", _uid];
_fetch = [_fetchstr, 2] call ExternalS_fnc_ExtDBasync;
_returned = str _fetch;
_playersArray = _fetch;

This is how I'm retrieving the array if thats needed. Not pretty but should do the trick and I can clean it up after.

copper raven
#

well select the columns you want, not only the citizenid?

magic locust
#
[getPlayerChars]
SQL1_1 = SELECT steamid, citizenid, cash, bank, name FROM users WHERE steamid=?;
SQL1_INPUTS = 1
 
OUTPUT = 5
#

Already changed that

#

Im just not 100% sure if it will pull all of the lines

copper raven
#

OUTPUT = 1,2-STRING,3,4,5-STRING some example output found on internet, i think you're supposed to do the same thing, so for 1, 3 and 4 it returns the unmodified value, while 2 and 5 are stringified i guess

magic locust
#

Okay

#

Thank you

#

My main question though, will this return all the lines that it can find in the table, or just the first line?

copper raven
#

it will return all lines where steamid is whatever you pass (just like in your query)

magic locust
#

Okay, perfect. Thank you, this might seem stupid, but my GPU is in the mail so I'm currently coding without the game sadly.

#

So I really appreciate your help

open fractal
#
private _groups = units _side inAreaArray thisTrigger;
_groups = _groups apply {group _x};
_groups arrayIntersect _groups;
``` is there a quicker way to get all the groups in a trigger area?
granite sky
#

Depends on a lot of factors. That method is probably going to be near-optimal if the number of units within the trigger is relatively low.

#

keys (_groups createHashMapFromArray []) is quicker than arrayIntersect once the count gets larger.

#

And if the groups are mostly large and mostly on the target side then you may be better off starting from allGroups.

open fractal
#

i see

granite sky
#

oh, groups can't be used directly as hashmap keys, so that's not an option here anyway.

little raptor
#

and seeing if it has artilleryLock = 1 meowsweats

manic sigil
#

Continuing on my project; while at present its a workable script that can be activated by the debug console, my future plan is to implement it as a subscribable mod in it's own right.

In the interim to getting there, and seeing how the debug console can sometimes be restrictive for feedback, I need an easier way to call it; is there a method to execute a file on a player-hosted server, running a downloaded scenario? To clarify, for a small group playing Mike Force.

manic sigil
# winter rose make a local mod

Ah. Fair enough, didnt even see that option - or rather, overlooked it all this time.

Wouldnt happen to have a guide handy for the process of setting up the folder, would you? All Im digging up is some second hand steam forum information; naming the folder @ modname/Addons/ and the files needed as a PBO.

#

Ah, got a more thorough explanation dug up, just need to learn how to publish a mod anyways xD

I suppose the next question would be, since im on the topic; how would I go about automating the execution of the script? I cant exactly add it to the scenario's init files, and relying on the server host to execute it every time would be tedious at best. Or am I thinking too hard, and the process of loading it as a mod automatically runs it whenever a mission starts? Maybe ill zip it and read the articles first :)

proven charm
#

You don't need to publish your addon just to work with it...

#

merely pack it to pbo

#

then you can use filepatching

manic sigil
#

Yeah, took me a bit to find that article, didnt think to search for 'Addon' xD

worthy spade
#

Any way to properly force open the escape menu? When I create RscDisplayInterrupt in multiplayer, it shows the load option instead of respawn like it should.

winter rose
#

yeah no, don't create the display from scratch as it does not attach everything properly
no idea if there is a way to do what you want though

worthy spade
#

Seen that, but was hoping it had changed since. Maybe I just have to create my controls on top of the mission display instead of creating my own display.

winter rose
#

sure, why not
depending on your goals ofc

worthy spade
#

Everything does seem to work with RscDisplayInterrupt though... So maybe I'm bold enough to just replace the save button. Hold my beer.

winter rose
#

zomgzomgzomg - what a daring person! πŸ™€ πŸ˜ƒ

worthy spade
#

I found RscDisplayMPInterrupt in config. Tried and see no indication of missing functionality.

winter rose
#

you may have found the Graal πŸ˜‰

worthy spade
#

I'm gonna assume so until the bug reports start dropping in.

polar belfry
#

Is there a way through init to get the ammo like the gbu is "Bo_GBU12_LGB "

#

I want to do it so I can use a nuke from a mod. I want to make it so if the players destroy a vehicle marked with nuclear materials that nuke spawns . The only thing I'm missing is the ammo for my script

winter rose
polar belfry
#

ok

#

thanks

winter rose
#

basically CfgMagazines >> magazineType >> "ammo" array
then CfgAmmo >> ammoType

polar belfry
#

in config viewer

#

right?

winter rose
#

yes

#

that would be in order to find that ^ vehicle's mags/ammo

polar belfry
#

ok thanks cause I was doing it the caveman way of goin to mod->pbo and searching in a cpp file

winter rose
#

works too, but it's tougher πŸ˜„

polar belfry
#

yea

winter rose
#
private _mags = magazines this;
private _allAmmo = [];
{
  { _allAmmo pushbackUnique _x } forEach getArray (configFile >> "CfgMagazines" >> _x >> "ammo");
} forEach _mags;

copyToClipboard str _allAmmo;
```@polar belfry
#

you should get ONE VEHICLE's data copied into the clipboard πŸ™‚

polar belfry
#

where do I write this

#

in vehicle's init?

winter rose
#

yes

winter rose
polar belfry
#

it returns this []

#

let me try with a vanilla vehicle

#

still "[]"

little raptor
#

vehicles might not have mags themselves

#

the mags might belong to the turrets

winter rose
#

(from Dr_Eyeball's note)

This command does not include non-turret weapon magazines, such as smoke, flare or chaff magazines which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy.

winter rose
#

well, otherwise it's allTurrets + magazinesTurret 😬

polar belfry
#

The nuke is on a pylon

#

as a bomb

#

I'll test the thing on a ground vehicle

#

no luck

little raptor
winter rose
#

iz nawt?

little raptor
#

@polar belfry try:

private _mags = magazines this;
private _allAmmo = [];
{
 _allAmmo pushbackUnique getText (configFile >> "CfgMagazines" >> _x >> "ammo");
} forEach _mags;

copyToClipboard str _allAmmo;
winter rose
#

@polar belfry, @little raptor is your new personal interlocutor
*runs away*

polar belfry
#

isn't there cfgAmmo

#

shouldn't they be there

little raptor
#

there is

#

but you have mags

#

not ammo

#

just try the code...

winter rose
#

here, the code reads CfgAmmo names from vehicle's magazines

polar belfry
#

I'll save the thing

#

let me test my code for calling the missile

#

wait something messed up

#

[]

little raptor
#

where are you trying it now?

polar belfry
#

in the vehicle init

#

I can show in creativity lounge if you want

little raptor
#

the exact same code?

polar belfry
#

yea

little raptor
#

actually before I continue, why do you even want the ammo?

polar belfry
#

let me run it again

#

I have a small ied code that spawns the dropped ammo (eg gbu, napalm) when a diesel silo gets destroyed to make a chain reaction

#

I thought about simulating a nuke when a "device assembled" gets destroyed

little raptor
#

so doesn't it mean you just wanted the ammo class name?

winter rose
#

Fired event handler? πŸ˜„

polar belfry
#

yea

#

eg the gbu is "Bo_GBU12_LGB"

winter rose
#
this addEventHandler ["Fired", { copyToClipboard str _this; hint str _this; }];
little raptor
#

you typed your "nuke" ammo here a little while back

winter rose
#

fly, fire, you should have it

little raptor
#

why delete it? blobdoggoshruggoogly

winter rose
#

was ["gm_rocket_luna_nuc_3r10"]

polar belfry
#

it posts it in hint not clipboard but it's ok

#

I'll take screenshot and write

winter rose
#

well, use this ammo and that should be enough πŸ˜„
and copyToClipboard is singleplayer / server only

polar belfry
#

it works

#

I just forced unicode

winter rose
#

weird, but noice!

polar belfry
#

bomb="vn_bomb_750_blu1b_fb_ammo" createVehicle(position s1);

#

that is the script for anyone interested

#

for napalm

polar belfry
#

I don't know if bomb is universal tho

winter rose
#

vn_ = SOGPF

polar belfry
#

I mean the one at start

#

bomb=

winter rose
#

not needed at all

#

(well, needed if you need a ref to the bomb itself ofc!)

polar belfry
#

so how would you write this. I found this line of script in the community page. It is an arma 2 script someone made

#

"vn_bomb_750_blu1b_fb_ammo createVehicle(position s1); " ?

#

s1 is a silo I put on the map

winter rose
#
"vn_bomb_750_blu1b_fb_ammo" createVehicle getPosATL s1;
#

or even```sqf
createVehicle ["vn_bomb_750_blu1b_fb_ammo", s1];

little raptor
#

might want to use can_collide

polar belfry
#

why is that?

#

and where shall I put that in code I mean

tough abyss
#

is there an event handler for a unit getting any kind of kill in any form? i want the unit to lose captive status if they run someone over

polar belfry
#

found it

#

createVehicle ["vn_bomb_750_blu1b_fb_ammo",s1,[],0, "can_collide"];

turbid zenith
#

Hello everyone I have a question regarding ACE Cookoff,
We are using RHS Strykers and even after ACE Cookoff they seem invincible and don't want to explode. I am currently looking for a script that makes it so that after the 2nd or 3rd Cookoff the vehicle automatically explodes no questions asked, anyone have any ideas on how/where to start?

tough abyss
turbid zenith
#

Catastrophic destruction, just a big boom, non usable

tough abyss
#

i have a feeling this is to do with rhs damage model

#

usually things become disabled instead of destroyed

manic sigil
#

Afaik ACE will lock a vehicle at .8 dammage while its cooking off, so you could set up a trigger to detect vehicles at .8 and put them on borrowed time.

storm arch
#

I currently have 4 loops checking for things but they are all in one script and require the 1st one to be completed before the next works, but I am looking for all 4 to run at once all checking for the condition. I think putting all loops into their own file and calling all 4 would work, but its messy and excessive, is there a way to call them all at once? maybe with spawn/call?

open fractal
#

you can't call a loop that's more than a fixed number of iterations

#

use spawn

#

if it's the same loop run multiple times then you can run the same function with different inputs

storm arch
#

no its 4 different loops

#

all checking different things

#

if thats what your asking

open fractal
#

execVM will load a file and run the code scheduled like spawn

#

so if you're only initiating each loop once that should be sufficient

#

just put an execVM line where the previous loop ends

granite sky
#

Isn't this ACE advanced vehicle damage rather than ACE cookoff?

#

The thing where they flare and all components go red instead of destroying the vehicle.

#

If you're using RHS I'd just turn it off.

#

It mostly exists to make vanilla/CUP vehicle damage more "realistic".

still forum
#

The big fire flame is cookoff

sullen sigil
#

is there any way to reduce just how blue everything looks when setting a small aperture

#

i.e bring back the colour to it

open fractal
#

There's a color correction post processing effect

manic sigil
#

How would I make an addAction only available to an AI under their own Action menu [6 key]?

#

Bah, nevermind

#

Thought I had to declare Params in the condition line, didn't realize it pushed its own X_X

little raptor
#

And you can't modify it

#

You can create a new one

granite sky
#

Oddly enough it does seem to add addActions to the 6 menu. IIRC only one of them though.

leaden ibex
little raptor
#

You can add addAction to the 6 menu via addAction?

#

Also wdym by one of them? thonk

granite sky
#

I mean if you use addAction, sometimes they show up in the 6 menu. I don't know what the rule is exactly.

#

Feels like some vestigial functionality they forgot about :P

little raptor
#

Never seen that meowsweats

leaden ibex
#

In function viewer? If only I could get to PC with Arma. I am providing "long range consultantation" for a friend dogeKek wiki was the source I relied on. Will do, good idea, thanks!

ashen hawk
#

Is it possible to store variables on Server's profile namespace?

#

I'd need to store variables that stay persistent over a few missions

open fractal
#

@leaden ibex you should be able to use nearestBuilding with the building's position to get a pointer that you can use with hideObjectGlobal later

#

or at the same time

leaden ibex
#

Just figuring that out from looking in how the module works

open fractal
#

regardless you can grab the object

leaden ibex
#

So I am gonna do it "manually"

#

Which will work perfectly

#

But thanks for the idea! Appreciated

granite sky
#

@ashen hawk You mean from the client?

#

In general, yes, that's what profileNamespace is for.

ashen hawk
# granite sky <@220832952311873547> You mean from the client?

I'll give some context:
I was able to write a script that stores weapons/magazines in a box in player's namespace and it works perfectly, it transfers over missions, maps etc.

Unfortunately, I am affraid I am unable to save it on the server's profile namespace

#

I wanted to make sure everybody has the same weapons in the box no matter if they joined sooner/later/ attended previous missions, that's why I want to save it on the server

granite sky
#

It's the same thing. You just run the code on the server.

ashen hawk
#

and if I run the function that lists all magazines/weapons using getWeaponCargo it returns [[],[]] on the server

granite sky
#

That probably means you added the mags/weapons with local functions.

#

hence addItemCargoGlobal etc.

ashen hawk
#

if (isServer) then {_guns = getWeaponCargo crate1; 
profileNamespace setVariable ["TAG_SaguWeapons", _guns];
 _mags = getMagazineCargo crate1;
profileNamespace setVariable ["TAG_SaguMags", _mags];
_items = getItemCargo crate1;
profileNamespace setVariable ["TAG_SaguItems", _items];
saveProfileNamespace;
};```

this is the script I use for saving
#
sagu_select_weapon = {
    _weapon = _this select 0;
    _index = _this select 1;
    
    if (count _weapon > 0) then {
        crate2 addWeaponCargoGlobal [_weapon select 0, _index select 0];
        _weapon deleteAt 0;
        _index deleteAt 0;
    };
};

sagu_select_magazine = {
_magazine = _this select 0;
_indexM = _this select 1;

if (count _magazine > 0) then {

crate2 addMagazineCargoGlobal [_magazine select 0, _indexM select 0];
_magazine deleteAt 0;
_indexM deleteat 0;
};
};

sagu_select_item = {
_item = _this select 0;
_indexI = _this select 1;

if (count _item > 0) then {

crate2 addItemCargoGlobal [_item select 0, _indexI select 0];
_item deleteAt 0;
_indexI deleteat 0;
};
};
   
if (isServer) then {

    _contentG = profileNamespace getVariable "TAG_SaguWeapons";
    while {count (_contentG select 0) > 0} do {
        _contentG call sagu_select_weapon;
    };

    _contentM = profileNamespace getVariable "TAG_SaguMags";
    while {count (_contentM select 0) > 0} do {
        _contentM call sagu_select_magazine;
    };

    _contentI = profileNamespace getVariable "TAG_SaguItems";
    while {count (_contentI select 0) > 0} do {
        _contentI call sagu_select_item;
    };
};```

this is the one I use to load it
granite sky
#

The loading code is pretty nasty (while + deleteAt? forEach plz)

ashen hawk
granite sky
#

but the save code looks ok.

ashen hawk
granite sky
#

Where is the EH installed, and do you know if it's triggering?

ashen hawk
#

EH is on the crate where I store the items, it uses execVM to run the save script

granite sky
#

I would guess that ContainerClosed only runs if the triggering player is local, although it doesn't say so.

#

So you'd need to install the EH on the clients, and then remoteExec the save function on the server.

ashen hawk
#

Triggers when player finished accessing cargo container. This event handler is similar to InventoryClosed EH, but needs to be assigned to the container rather than the player. Note: will trigger only for the unit opening container.

oh let me guess, it's only saving the stuff for the client using the box?

granite sky
#

never mind the saving, that's an extra step.

#

I would recommend adding diag_logs at the start of each EH or function until you're sure about what's executing where.

ashen hawk
#

alright

winter rose
granite sky
#

Only one though? I mean, there were dozens within range when I spotted it, and only one in the 6 menu.

#

And in that case, how does it pick which one?

ashen hawk
granite sky
#

Whatever you like, it's just printf debugging.

winter rose
manic sigil
#

Alright, got a chance to test my working script... and of course, MP scripting bites me in the ass.

Spawn_Airborne =
{
 If (!isServer) exitWith {};

 AirbornePad = createVehicle ["Land_HelipadCircle_F", [16166,7059,0]];

 AirbornePad setdir 0;
}; systemChat "Helipad Creation Defined!";

...

Call Spawn_Airborne;

Executed on the server level, spawned several copies of the helipad, as expected by a global effect. But I thought the !isServer would have corrected for that :/

#

Thankfully that was just the helipad... but the script also creates a truck (which, predictably, blew the hell up) and a trigger, which was unnecessary server useage.

winter rose
#

Executed on the server level, spawned several copies of the helipad, as expected by a global effect. But I thought the !isServer would have corrected for that :/
wat where is that code? πŸ˜‘

manic sigil
#

This current build is being injected by the debug menu, future versions are as I was talking about this morning, putting into a local mod