#arma3_scripting

1 messages Β· Page 148 of 1

unkempt marsh
#

it works

granite sky
#

Note that 45 degrees doesn't give quite the correct answer for some mortars because their minimum elevation is higher than that.

#

This is impossible to resolve through config, because minElev and maxElev are relative to the default elevation of the weapon in the model, which is apparently impossible to obtain without spawning the vehicle.

#

The minimum range has the same issue.

abstract gust
#

understanding recoil configs

hallow mortar
#

If you're looking for info on how pure config stuff works, you might need #arma3_config instead

unkempt marsh
#

is there any way to remove a respawn marker created with BIS_fnc_addRespawnPosition, or otherwise disable respawn map markers?

unkempt marsh
#

i don't want to lose the respawn position, only the map marker

faint burrow
#

There is no such function for this. You can use a global variable to store all respawn positions to restore deleted ones.

unkempt marsh
#

dang

digital rover
unkempt marsh
hallow mortar
#

You can use BIS_fnc_getRespawnPositions to get all possible positions, do setMarkerAlpha on them (forEach) and if any of them are markers, that should do it.
However, that will take care of markers displayed on the normal map. When in the respawn menu, selectable locations are additionally marked with scripted UI elements. Those are probably technically accessible in some way, but because they're dynamically created, doing so is likely to be very complicated. The way the respawn UI works is pretty spaghetti and I can't figure it out in enough detail to help with that.

digital rover
# unkempt marsh but how

You can use the "name" section of the create Respawn function to set a custom name. This will then allow you to use setMarkerAlpha with the same name

Nikko's way of listing all respawns would also work

unkempt marsh
#

omg thats so helpful, thank you

rancid nebula
#

I'm new to arma scripting, but I have been a programmer for some time. I'd assume this is possible but I'd like to double check before I waste my time.

I'd like to make a ace arsenal for each player based in what gear they have bought with their bank.

Now I'd assume the logic for this would be to have the Arsenal attached to a box. Something like a list or virtual inventory or arsenal white-list attached to each player referencing their playerUID In a database of some sort. Then in the box the player interacts with, that box would grab the whitest, or array of items from the player.

I'd assume there's a lot more intricate details to this, since I'm not fully learned on SQF yet. But is the logic here sound?

south swan
#

yeah, sure. I've seen it done in similar way (per slot/class/whatever you call it)

rancid nebula
#

My idea is to have a database of bought items be manipulated through a shop, if the player dies they lose their gear and have to rebuy it(or 1 of each gets removed from the database if thsy bave multiple) then the arsenal placed in game grabs this white-list from the player database by the playeruid interacting with it.

#

Pretty much making a framework for a PMC unit.

lavish stream
manic flame
#

Do i need spearhead to use the frontline functions?

[[], nil, "high"] call SPE_MISSIONUTILITYFUNCTIONS_fnc_generateFrontline;
#

Im following the guide in the biki but its not working.

kindred zephyr
#

yes, either that or the compatibility pack i would imagine

hallow mortar
#

Spearhead stuff, like any CDLC stuff, will only work if the CDLC or its compat pack is installed and loaded

#

If it's not loaded then the functions just don't exist

velvet anchor
#

Hello! I'd like to get into scripting for arma 3. I just want to verify, arma 3 uses SQF, not enfusion?

faint burrow
#

Correct.

velvet anchor
#

Gotcha, thank you! Yippie for pain

thin fox
tough abyss
#

Anyone know how to get locations to register under the new spectator mode? Didn't see any documentation on it.

#

Tried placing a base location logic within the mission with no luck.

silent latch
warm hedge
#

Where is your question or goal there?

silent latch
warm hedge
#

I still do not want to make an answer using my assumption

granite sky
#

I think the screwdriver tip is supposed to be pointing at the lock, but there's some confusion about GUI coords vs 3d coords.

little raptor
granite sky
#

The wiki on CT_OBJECT includes the line "The y and z values for the vectorDir (direction array) and vectorUp (up) are switched."

#

which is unintentionally funny because Arma's use of Y and Z has no convention and you always figure it out by trial and error.

#

0,0 is top left in the GUI anyway, right? So there's usually a y flip involved too.

little raptor
#

good point

drowsy magnet
drowsy magnet
nocturne bluff
#

I'm pretty sure its a function

queen junco
#

I am trying to change pylons on planes. As I can see with the CfgMagazines it appears to me, that a pylon is split into the hardpoint and the weaponsystem. Even though some weaponsystems use (visually) the same hardpoints, looking at the hardpoint names I would assume they are strictly connected.
Is it possible to equip a hardpoint with a variety of different weapon systems? E.g. use the PylonRack_3Rnd_Missile_AGM_02_F which is 3xMacer and equip it with 1xMacer, 1xScalpel, 1x Falchion-22?

warm hedge
#

Unfortunately that is not possible due to how a Magazine works

queen junco
#

Alright. Just wanted to make sure. ^^

crude stream
#

Would it be possible to use UI On Texture to make cTab's map appear on a folded down ATAK on a vest? So I could freelook down and see the map instead of it appear on the HUD.

brave mountain
#

is anybody good here with animations scripting? Do you guys know how to make AI fire while in animation?

warm hedge
#

Some animations don't support to use their weapon while the animation is on

brave mountain
#

My question was different : What is the script to make it fire IF the animation allows it?

#

I've tried your script also but does not always work even if it says the animation allows it on animation viewer

warm hedge
brave mountain
warm hedge
#

I don't know what is the exact code or theory you use but I guess

opal zephyr
crude stream
opal zephyr
keen stream
#

Is the new spectator mode default or does it need some scripting somewhere to get it started once someone dies?

queen junco
#

I am trying to use magazinesAllTurrets in an .sqf file. However it seems to not work as in an object init. If I use diag_log str magazinesAllTurrets this in the object init it returns all magazines just fine. If I use the same command in the .sqf with an object reference instead of this it returns an empty array. I checked that the reference is passed correctly and the log returns exactly the same object no matter if I use the init or the .sqf.

Is this a bug or did I miss something?

proven charm
queen junco
#

Yes, only it doesn't...
This is my script

diag_log str magazinesAllTurrets _entity;

This is what is returned

16:56:05 "[]"
hallow mortar
#

How is _entity defined and how (when) is this script called?

queen junco
#

If I put this in the init

diag_log str magazinesAllTurrets this;

It returns this

17:02:05 "[[""5000Rnd_762x51_Belt"",[-1],5000,1.00001e+007,0],[""PylonRack_12Rnd_missiles"",[-1],12,1.00001e+007,0],[""PylonRack_12Rnd_missiles"",[-1],12,1.00001e+007,0]]"
hallow mortar
#

Btw you can use systemChat or copyToClipboard for quick debugging without needing to go digging in the RPT

queen junco
proven charm
#

so hint (str _entity); shows what?

queen junco
#

"219cb4f6040# 10: heli_light_01_f.p3d"

queen junco
hallow mortar
#

Which EH are you using?

proven charm
#

have you given the heli a name in editor?

queen junco
#

I use extended_init_EH, called via description.ext

hallow mortar
proven charm
#

one way to verify if right object in question

queen junco
#

Okay, so apparently this returns all values just fine

{
    diag_log str _x;
} forEach magazinesAllTurrets _entity;
17:11:04 "[""5000Rnd_762x51_Belt"",[-1],5000,1.00001e+007,0]"
17:11:04 "[""PylonRack_12Rnd_missiles"",[-1],12,1.00001e+007,0]"
17:11:04 "[""PylonRack_12Rnd_missiles"",[-1],12,1.00001e+007,0]"
proven charm
#

weird

#

now try printing magazinesAllTurrets _entity maybe it was a typo πŸ˜‰

warped hornet
#

Does anyone know if theres a function to check if the player is in first or third person? Literally just found it its cameraView.

modern osprey
#

There is a server with 122 slots. Slots are divided into conditional groups:

  • Shooter
  • Heavy
  • Medic
  • etc.

At some point, something happens and it is impossible to enter some specific slots.

The player simply sees an endless progress bar β€œloading data”. With this problem, only one department is always solved, for example only doctors, and rebooting the server is always solved. What could be the problem and where to dig?

The difference between the slots is only in units.

frigid spade
#

do missionNamespace variables get stored on the server?

hallow mortar
#

Every machine has its own missionNamespace. If the variable is set on the server, broadcast to it using the public flag of setVariable, or broadcast with publicVariable, then it will exist in the server's missionNamespace. If none of those things happens, then the server won't have it.

frigid spade
#

so i have ```sqf
private _localCooldown = missionNamespace getVariable "globalCooldown"
//some code
_localCooldown = serverTime;
missionNamespace setVariable ["globalCooldown", _localCooldown, true];

this works fine, but when running on a dedi if I invoke the cooldown thing and then disconnect and reconnect the local one is reset
modern osprey
atomic canyon
#

wich is the general chat?

frigid spade
granite sky
modern osprey
granite sky
#

I don't expect there to be any solution. Arma servers are just something you need to restart regularly.

#

Unless there's a known replication then it won't be investigated.

modern osprey
#

It sounds terrible.

granite sky
#

It's Arma :P

modern osprey
#

Yeeee...

errant jay
#

How would one script a script that removes x item/gear from units that are spawned during a mission?

Only for one side/AI

errant jay
stable dune
tawdry knot
#

βœ…

daring cave
#

anyone know a way to add damage, like instead of using setDamage to set at a certain number, you take the current damage value and add like 0.5?

#

something like this?
this addEventHandler ["Hit", {t1 setDamage {{getDammage t1} + 0.5}}];

hallow mortar
#

Yep, that's basically how you do it

#

Some of your brackets are the wrong kind of brackets though, it's () for precedence, not {}

daring cave
#

would you be able to type it out?

#

not exactly sure how to do it

hallow mortar
#
["Hit",{t1 setDamage (damage t1 + 0.5)}];```
#

There are also more complex ways of doing it, using handleDamage EH and specific damage selections rather than overall damage. Principle's the same though, get existing damage then add some

daring cave
#

perfect thanks

hallow mortar
#

Keep in mind that in Arma damage, 0 is full health and 1 is dead, so +0.5 is a lot

daring cave
#

I'm using it as a temporary solution to the PLA Armored force indestructible vehicles

#

I don't know what they did but if they're loaded with cup or rhs they become invincible

#

I suspect it's some kind of prc propaganda thing

hallow mortar
#

Oh, make sure to use the EH's available parameters (described on the wiki page https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Hit). The EH provides a reference to the object the EH is attached to, so you can use that rather than hardcoding a global variable name like t1. Makes it much easier to apply the same EH to multiple objects.

daring cave
#

oh sweet

#

I tried this and it worked
this addEventHandler ["Hit",{(_this select 0) setDamage (damage (_this select 0) + 0.5)}];

#

Now I wonder if I can somehow code this into a mod to auto apply to all PLA armored force vehicles

#

I may fine tune the damage amount per vehicle but that saves me from hitting a transport truck with an abrams 100 times and not even scratching it

haughty timber
#

How do I cycle an array to check for all spawned units excluding players/playable units so that the array of units is always up-to-date on all the spawned units?

#

I'm using it to run a code on every single unit that the module I'm using (DMP) spawns

#

Also on a similar note, how do I make it so that a certain piece of custom GUI text (I'm making a status bar like in Antistasi) keeps updating with variable information without having to use while {true} do {}; loops?

#

I'm only familiar with while {true} do {}; to loop scripts, but it can get problematic because it doesn't know when to stop

versed belfry
haughty timber
#

The array is simply private _unitList = allUnits - playableUnits; so far

#

Which doesn't update to all newly-spawned units, only units that have already been placed

versed belfry
#

Well if you just want to loop through it then use a forEach.

#

One second I will grab an example

haughty timber
#

The code I'm trying to implement is GRAD MoneyMenu

#

The args for that is... hold on lemme grab it up

#

[unit, amount, setBankAccount] call grad_moneymenu_fnc_setFunds

versed belfry
#
_myArray = [player, HELI_1];
{
    _x allowDamage false;
} forEach _myArray;
#

Well to loop through an array you would do use a forEach

#

the _x is a magic variable that will refer to each item of the array when it is running through them.

haughty timber
#

I did ```private _randomMoney = floor random [50, 120, 1000];
private _randomUnit = allUnits - playableUnits;

{[_x, _randomMoney] call grad_moneymenu_fnc_setFunds} forEach _randomUnit;```
and it only did the code once

#

Instead of checking for all units on the map all the time

#

Also it only randomizes the amount of money once IIRC

#

Basically what I want it to do is give every non-playable unit a randomized amount of money

versed belfry
haughty timber
#

How efficient is it?

versed belfry
#

Well it will get executed every time a new entity is created so πŸ€·β€β™‚οΈ

#

I am not the best guy to answer that sadly

haughty timber
#

Alright. I'll see if this method works better

warm hedge
#

An EventHandler is always the best and efficient way. It does only when it happens, and no loop involved, no waitUntil, anything. It doesn't add any hardware consuming anything just to have an EH that waits to fire

versed belfry
#

Good to know πŸ‘

warm hedge
#

Of course, firing an EH can consume CPU. But not that hrash if you make a wise code anyways

haughty timber
#

Thanks!

#

Works like a charm for my purposes

south parrot
#

Does anyone have problems with "Killed" and "MPKilled" event handlers? Since 1.54 update it give me a killer unit only in 10% of all cases. In most cases you can't receive a name of your killer.

lone glade
#

Works here, do you run mods ?

tough abyss
#

Spectator mode is like a player slot, under the game logic side @south parrot

lone glade
#

is there's any info on the API yet ?

tough abyss
lone glade
#

so, you know, we can use it anywhere else.

#

that's the old one

opal zephyr
#

The wiki for disableCollisionWith states that an object can have its collision disabled with multiple objects, however in practice this is simply not true. Am I doing something very wrong or is this just bad info?

meager granite
#

I think each object has a link to another object and that's it

#

So you can only disable it for multiple objects on one object and that's it

#

If other objects will point to one you want no collision with

opal zephyr
#

So example 3 in the wiki is wrong then? _obj1 cannot have collision disabled with both _obj2 and _obj3 at the same time?

meager granite
#

My comment about single link is correct though, but the way to setup it wasn't.

#

What objects are you trying to disable collision with anyway?

opal zephyr
#

The player and some simple objects

meager granite
#

Hmm, maybe simple objects are too simple to have this functionality or something

opal zephyr
#

ill try it with a regular object, one moment (I havnt had it work before)

meager granite
#

Try non-simple objects and see if it works?

opal zephyr
#

Nope doesnt work

#

I did this

_array = [b1,b2];
{
    player disableCollisionWith _x;
}forEach _array;
#

It only disables it with the last object

meager granite
#

[player, b2], then b1 disableCollisionWith _x

opal zephyr
#

I'll try again when im at my computer next, but I think it will be the same results. I believe ive tried this before

meager granite
#

lol I tried it with 3 building pieces and it disabled it for everything but last object meowsweats

#

it only disabled geometry collision, you can still walk on roadways

#

So maybe it depends on an object and how it has roadways setup?

tough abyss
#

That is the only spectator mode documentation I have seen.

opal zephyr
#

My test was with 2 icebox's so roadway collision shouldnt be an issue

opal zephyr
meager granite
#

used yours

opal zephyr
#

Yikes

meager granite
#

Fixed this typo and all 3 objects now have no collision with player

#

You can still walk on roadways

tough abyss
#

The Virtual Spectator can be found under Units > Game Logic > Virtual Entities > Virtual Spectator.

opal zephyr
#

So strange, I wonder why it doesnt work with the icebox or the other objects I tried

#

Im trying again on my end

#

@meager granite Are you executing this in the console/non-scheduled? I just tried it again on two houses this time and still only the second one disables collision

#

When I touch the first object initially I can partially enter it before being pushed out, and then its solid after that

#

Running it like this makes it work:

while {true} do{
_array = [b1,b2,h1,h2];
{
    _x disableCollisionWith player;
}forEach _array;
};

However that is incredibly unideal

meager granite
#

unscheduled

#

are you sure your player is initialized by the time you run your code?

opal zephyr
#

Yup, im just using the dev tools debug console

#

Im on the latest profiling build. I cant imagine this was updated recently, but just in case

#

How are you executing it?

formal grail
south swan
#

i seem to remember something about idc-only syntaxes of GUI commands only working in dialogs or some other meme limitation like that, but can't find it right now

meager granite
#

main syntax is not implmeneted

#

there are few commands like that

south swan
#

fun stuff

formal grail
#

The other commands on tree view seem to work as expected, it's just that one.

cosmic lichen
#

Just ignore the idc variants.

south parrot
#

@lone glade Yes. We have mods. But how mods could break the engine commands?
They have being working before 1.54.

player addEventHandler ["Killed", ...];
_unit addMPEventHandler ["MPKilled", ...];

@tough abyss So, do you advice to add Spectator Logic into mission to make these event handlers work?

lone glade
#

CBA or other mods fucking the EHs.

#

RHS chdkz units are impacted.

tough abyss
#

Sorry, I tagged the wrong person @south parrot. I meant to tag @keen stream

south parrot
#

@lone glade Even addMPEventHandler? It sounds strange. But I can believe in everything in Arma. :) Thank you. Will check that way.

lone glade
#

ACE3 medical also impact the killed EHs, and it can't be fixed without big changes atm

south parrot
#

So it's CBA fault, as I understand. We use CBA and ACE3. @lone glade, thank you for explanation.

lone glade
#

ACE3 then, the medical system most likely since most of the time the bloodloss kills you and not the initial shot

south parrot
#

May be. But it worked well before 1.54.

#

May be recent update of ACE3 broke that.

lone glade
#

Did you updated your version of CBA and ACE3?

south parrot
#

Yes. But I will investigate that more.

errant jay
#

I'm really non-skilled at scripting, but and i'm trying to create a thing for a mission;

Every OPFOR ai that has spawned and will be spawned gets added a Gasmask, anyone would happen to have an existing script for this? Tried to google for one but couldn't find

hallow mortar
#
// server exec, e.g. initserver.sqf
// add mask to existing units (use other slot add commands if it's not a facewear)
{_x addGoggles "your_gasmask_class"} forEach units east;
// add EH to handle new spawns
addMissionEventHandler ["EntityCreated",{
  params ["_entity"];
  if !(_entity isKindOf "CAManBase") exitWith{};
  if (side _entity == east) then {
    _entity addGoggles "your_gasmask_class";
  };
}];```
errant jay
errant jay
hallow mortar
#

πŸ€”

#

Did it correctly take care of existing ones?

errant jay
#

i have zeus enhanceds placement preview on that show they have the gasmask on, but when actually placed they have no mask

hallow mortar
#

Do they have any facewear on at all? It's possible they have a randomisation script as part of their initialisation that immediately replaces their facewear, I've seen that happen before

errant jay
hallow mortar
#

That's weird. The preview having it (assuming the units wouldn't normally have one) seems to imply it should work.

errant jay
#

yeah they normall wouldnt

but its weird that the preview has it and then spawned, nothing

#

i tried the same script but with uniforms and it works, even with mod units that have randomized unis

hallow mortar
#

I just tested it locally with pure vanilla and it's working

#

if there are complex mods involved then 🀷

kindred zephyr
hallow mortar
kindred zephyr
#

i know it should, the clearing is just to gain a couple frames there without having to sleep.
The other alternative is just sleeping half a sec but idk if that prefferend in this case

hallow mortar
#

Spawning a new scheduled thread every time a new unit is created isn't the worst thing I've ever done, though not having to would be preferable.
I'm dubious of the idea that removeGoggles would gain any number of frames given that this is unscheduled; it will always be in 1 frame

#

It's a bit odd that it doesn't seem to work for them with vanilla units either. I suppose it's possible they're running a mod that adds such a randomisation script to vanilla units, but that would be a weird thing to do

kindred zephyr
#

might not be the case, indep units for example have a lot of inheritance issues

#

learnt that the hard way

#

haha

errant jay
#

yeah i tried with vanilla CSAT units

#

might be just a random mod that adds something, ill give it a try with removegoggles before later

flint topaz
#

You could use the CBA runCodeLater or whatever it’s called to prevent using new scheduled

kindred zephyr
#

when in doubt anyways, remove all mods and try achieving the same effect with purely vanilla stuff

errant jay
#

tru, if it doesnt work ill just use compositions or something

sleek galleon
#

Howdy lads !
In the mission i'm building up, I'm using a trigger to start the insert helicopter's route to drop the players in their LZ.

Now, since it's gonna be a on a dedicated server, the play music effect built in the trigger doesn't work, I understood I needed to remoteExec the track so everyone gets the music.

But I want the music to start 10s after the trigger starts, because it's the time it takes for the helicopter to actually take off (and also it helps matching the music to the actual fly-time).

What happens though is I get an error "Suspending not allowed in this context". So it skips the sleep command and just straight up plays the music as soon as the trigger is triggered.

Any ideas of how I can work around this ?

TIA !

if isServer then {"LeadTrack01_F" remoteExec ["playMusic"];};```
stable dune
#

Well with a trigger you can use timeout,
So you don't even need to use sleep.

sleek galleon
#

I'm already using time-out to trigger it

stable dune
#

Aa, sry missed that.

sleek galleon
#

Basically this trigger isn't just the music. It's also the one that skips the "hold" WP of the helicopter so it starts going toward the LZ. The script above is in the "on activation"

#

And to be more precise, the timeout is so that when a player is in the chopper (area of the trigger) for 60s, the routine starts, this is to allow time for the whole team to board the helicopter

stable dune
#

You could use

0 spawn {
sleep 10;
// Your event here 
};

And if you want only server, just [βœ“] only server from attributes.
And remoteexec your play music.

sleek galleon
#

"Your event here" is the "if isServer then {"LeadTrack01_F" remoteExec ["playMusic"];};" bit, yes ?

Also, do I put it in the trigger "On Activation" ?

stable dune
sleek galleon
hallow mortar
#

Combine both of the code bits that prisoner posted

sleek galleon
#

Oh I see !

#

I'm a blind idiot

#

Out of curiosity, what does the 0 before "spawn" do ?

hallow mortar
#

Nothing.
spawn requires an argument on each side - arguments to pass to the code on the left, and the code itself on the right. If you don't want to pass anything to the code, you still have to put something on the left. 0 is the cheapest "none" data available.

#

You'll sometimes see it with [] (empty array), but 0 is actually slightly faster than creating a new array

sleek galleon
#

Alright I see

#

Also, while i'm there
"remoteExecCall" is the dedicated server variant of "Call", right ?

kindred zephyr
#

yes

hallow mortar
#

No.
call is what you use to run the called code as if it were in-line with the current code - in the same thread, so code after that won't happen until it's done.
remoteExecCall is what you use to tell another machine (in any multiplayer, not just DS) to run a function in the unscheduled environment, as opposed to remoteExec where functions will be run in the scheduled environment (https://community.bistudio.com/wiki/Scheduler)

#

It's a common misconception that call is exclusively unscheduled - it's not. If you use call in a scheduled script, the code inside will still be run scheduled, it just doesn't create a new thread like spawn does.
remoteExecCall actually is exclusively unscheduled.

#

Both call and remoteExecCall can be used both on and off of dedicated servers. They have different purposes.

kindred zephyr
#

I always interpreted the RemoteExecCall as being just call for remote machines since you cant RE a call itself. Always good to learn new thing and more important, learn about execution priority

sleek galleon
#

Ok, TYSM !

terse tinsel
#

please help, how to write a script so that the trigger is activated when the units inside it are killed?

terse tinsel
winter rose
terse tinsel
sleek galleon
#

Hello again !

About what has been said earlier, I tried it and I don't know if I did it right.

Basically, I got this script from a video from the modmaker of Advanced Rappelling, the point is to put it in a WP, and the helicopter will slowly move to the fastrope position, kick AI and players out of the chopper to rappel them, and then execute the next WP's. It worked in singleplayer perfectly

[Helo1,30,GetPosASL LZA_RappelPos] Call AR_Rappel_All_Cargo

Now, I noticed it didn't work on our DS, so I tried this script :

[Helo1,30,GetPosASL LZA_RappelPos] RemoteExecCall AR_Rappel_All_Cargo

And it still doesn't work.

I'm unsure about what to do next, I know it's a mod script, but I was guessing there may be something obvious I missed.

TIA ! πŸ™‚

sleek galleon
#

I'm also having another issue I can't for the life of me find an actual fix, again with dedicated server.

To sum the whole thing up.

There is an intel document with an hold action set up. When the HoldAction is completed, the following code executes : TriggerTask2 = 1;

Now you may have guessed, the activation condition for the trigger that's supposed to fire the second task is : TriggerTask2 == 1;

The trigger itself is synced to four modules : A Show/Hide module set to show synced groups of troups, a Set Task State module synced to the previous task to mark it as "Succeeded", a Create Task set up to create the next task, and a Create Diary Report to add intel for the lads on the ground.

The trigger itself also has a "Hint" on activation for a little in-game dialogue.

The trigger actually fires, because we do get the hint, but for some reason it doesn't trigger the modules and their effects.

This whole thing has worked in singleplayer (editor testing).

Also I feel like I should note that the "TriggerTask2" is set to 0 in the init.sqf via this line : TriggerTask2 = 0;

What could I be doing wrong ?

TIA !

delicate hedge
#

Can someone simply explain, why should i place:
if (!local this) exitWith {};
Into script (for giving equipment) which called in unit init field, so it will properly work in multiplayer? I cant get it🫀

granite sky
#

You mean in editor init fields? Those execute everywhere, and you don't want to add equipment to a unit more than once.

#

Otherwise they'll get a bunch of extra equipment for each client.

brave mountain
#

do you guys know how to prevent AI to deploy speedbrakes when recording a plane with UnitCapture?...IF it's even possible lol..

warm hedge
#

No

meager granite
#

Hmm, maybe order AI to move like 2 km ahead of them so they want to speed up?

brave mountain
#

damn

errant jay
#

Continuing from yesterday;
I got a script for adding gasmasks to every AI that gets spawned in mission but it isn't working. The script is as follows;

addMissionEventHandler ["EntityCreated",{
  params ["_entity"];
  if !(_entity isKindOf "CAManBase") exitWith{};
  if (side _entity == east) then {
    _entity addGoggles "G_AirPurifyingRespirator_02_black_F";
  };
}];```

Now i'd wager its being caused by a mod that does something with facewear, although it doesn't work with units that don't even have changing facewear. 

But as i barely have any knowledge on scripting, i'm still seeking some help on if it can be fixed somehow?
warm hedge
#

What if like you spawn it?

errant jay
warm hedge
#
if (side _entity == east) then {
  _entity spawn {
    _this addGoggles "G_AirPurifyingRespirator_02_black_F";
  };
};```
errant jay
meager granite
#

I know you can do:

(values _hashmap) params (keys _hashmap);

if you had all keys with _ prefix, but I really don't like such keys, plus often you only need few variables out of hashmap

#

I wish there was a way to params out only some of hashmap keys

#

HASHMAP params ARRAY:

_hashmap params ["collider", "at_fault"]; // _collider, _at_fault local vars
#

Yay/Nay to this idea?

#

Alternatively, have HASHMAP params ARRAY accept both prefixed and unprefixed keys:
collider -> _collider
_collider -> _collider
__collider -> __collider

still forum
#

hiddenly adding a underscore is weird. Because all other params syntax' work differently

meager granite
still forum
#

Also that only works for retrieving string key'ed entries.
You may want to do the same with numbers or other types

meager granite
still forum
#

_hashmap params [[key, "_varname"], ...]
that maybe but it seems a bit annoying

meager granite
#

Optional key->varname subarrays?

#

_hashmap params ["collider", "at_fault", [123, "_numvar"]];

#

My practical usage: I store damage events in big-ish hashmaps and events are used in many places that often only need some of the keys and not every.

still forum
#

I don't like it being optional, the hidden underscore adding is too obscure for me.
Rather make it require arrays.
SQFC will optimize them out if the keys are constants

meager granite
#

I agree it is somewhat obscure, but you can't have non-underscored local variables normally, so the only outcome is having the engine to add _ for you.

#

If you've been building your hashmaps with underscored keys for older values params keys method, it'd still work as you can also list keys with underscore.

#

Anyway, all of this is more syntactic sugar, but this is the need I felt when working with hashmaps.

still forum
#

For existing code analysis tools it should also preferably be target variable name first, and then key. But then what about the type filters and default values. Moving them around in that special case is also annoying

meager granite
#

Good point about making it confusing for default values vs non-string keys clause πŸ€”

still forum
#

How about a thing that gets multiple values from a hashmap, as array

#

_hashMap get [a,b,c,d] params ["_a", "_b"]

#

but also annoying because array keys are a thing, so doing multiple is hard

meager granite
#

HASHMAP keys ARRAY

#

_hashMap keys ["a","b","c","d"] params ["_a", "_b"]

still forum
#

Ah nevermind its not hard. Array key would be
_hashMap get [[a,b],c,d] params ["_ab", "_c"]
which is fine

still forum
#

Easy, no new script command needed

meager granite
#

Sure, values is even better fit!

still forum
#

I can put that in 2.18

meager granite
#

I'll be one to use this for sure!

#

HASHMAP select KEYS also fits

#

But poor select is already overloaded to hell with functionality

still forum
#

Do we have a thing to pick elements out of an array?

like pick first and fourth and 7th ?

#

values could do that too, array values [index, ...]

meager granite
#

Nope, that's a thing I wanted too, super useful for large event handler arrays

#

HitPart, Fired, etc.

still forum
#

Wondering if you can combine it with find but not really.

Like if findIf returned array of indices for all matches.
Then you could quickly grab out all elements of array that match a thing.. but we have select. meh πŸ˜„

obtuse depot
#

anyone have any idea if you can swap pip displays on the fly, like have it go from taking one pip_pos and pip_dir to taking another pip_pos and pip_dir
i have one main screen and want to make a swappable display without adding 3 trillion draw calls by hiding and unhiding pip screens

little raptor
sleek galleon
#

Is "&&" repeatable ? As in "a && b && c && d etc..."

sleek galleon
#

Thanks ! Was'nt sure bc it wasn't specified in the wiki πŸ˜„ Cheers !

winter rose
warm hedge
#

Think about that
true && true && true
equals to
true && true
equals to
true

sleek galleon
#

I see !

hallow mortar
#

Just be aware that stacking large numbers of && (or similar checks) into one line can get unreadable pretty fast. Sometimes it can be more convenient to do a series of separate simpler checks.
Also make sure to use lazy evaluation condition1 && {condition2} where appropriate to save performance. Lazy evaluation means the second condition will only be checked if the first returns true, so if you have complex checks it's sensible to "gate" them behind a faster check that reduces how often the complex code runs.

meager granite
#
    if(
           (condition1)
        && {condition2
        && {condition3
        && {condition4}}}
    ) then {
    };
```-gang
delicate hedge
#

Is that true, that giving equipment via external scripts, called in unit init is more efficient and optimised for server rather then it will give via mission.sqm? As i understand when equip is set in mission.sqm the engine gives it locally, yes?

hallow mortar
#

It's certainly more efficient in terms of file size, and makes things easier for you as a missionmaker if you have a lot of units to modify.
When you change a unit's loadout with the Editor loadout thing, the unit's whole loadout is stored in mission.sqm, per unit. So if you have 20 units with custom loadouts, that's 20 loadouts' worth of data in the mission.sqm, even if they're all identical. Meanwhile, if you have a gear management script, you can store the loadout data once, and apply it to multiple units with a simple function call. For large numbers of units, that can mean a big difference in the mission.sqm's size.

delicate hedge
hallow mortar
#

Equipment changes are always sent to all clients, because the other clients have to know about them in order to display the correct equipment on the unit

#

Whether the commands are executed on all machines depends on how the script is designed - you can use checks like isServer or local to ensure they only run on one machine, for example - but the effects are always broadcast.

south swan
#

i mean, what gets sent can be fun. Somebody told that custom server-modded tank with extra sensors (extra datalink and such) got consistently transmitted over the network to players.

delicate hedge
#

Ok, i think i get it, its maybe in terms of size of mission, like when you add it through scripts, server has to send less mission file size

formal grail
#

What are potential downsides for enabling dynamic simulation but making it only for view distance, other than AI for your group not listening to commands if they're out of range?

hallow mortar
#

Well, enemies that are out of view distance (and aren't excluded from dynsim) will also not be simulated, so if for example you have an aircraft or a reinforcement group that starts some distance away and is supposed to move in, they won't, because they're not being simulated

#

Artillery could also be a problem

twin anvil
#

Ohboy, seeing your asking the same question months ago while im looking for an answer bestows me with confidence.

!(isNull findDisplay 60492) seems to work for vanilla spectator for anyone wondering.
Trying to find out how to spot the ACE one tho as this doesn't work for it sadly.

stable dune
#

So ace uses ID 60000

twin anvil
#

wait it does!
why, and how, does ace use a IDD lower then vanilla. what even.
Thanks for the rapid reply tho. was dreading havign to dig through ace github fucntions to find that.

thin fox
#

Hello. Can someone explain to me something about "isServer" on a script called from remoteExec?
init.sqf

remote_call_hostages = compileFinal preprocessFileLineNumbers "tasks\remote_call_hostages.sqf";

{
    [
        _x, // Target
        "Free Hostage", // Text
        "a3\ui_f\data\igui\cfg\holdactions\holdaction_unbind_ca.paa", // Icon idle
        "a3\ui_f\data\igui\cfg\holdactions\holdaction_unbind_ca.paa", // Icon progress
        "(alive _target) && {_this distance _target < 3}", // Condition to show
        "(alive _target) && {_caller distance _target < 3}", // Condition Progress 
        {
            params ["_target", "_caller", "_actionId", "_arguments"]; // code executed when action starts.
        }, 
        {
            params ["_target", "_caller", "_actionId", "_arguments", "_frame", "_maxFrame"]; // code executed on every progress tick.
        }, 
        {
            params ["_target", "_caller", "_actionId", "_arguments"]; // code executed on completion.
            [_target] remoteExec ["remote_call_hostages",0]; // PROBLEM CODE
            
        },
        {
            params ["_target", "_caller", "_actionId", "_arguments"]; // code executed on interrupted.
        }, 
        [], // arguments passed to codeStart, codeProgress, codeCompleted and codeInterrupted (max 10) 
        5, //  action duration, i.e. how much time it takes to complete the action
        1000, // priority value; actions are arranged in descending order according to this value
        true, // remove on completion
        false, // show in unconscious state
        true // show on screen; if false action needs to be selected from action menu to appear on screen
    ] call BIS_fnc_holdActionAdd;
}forEach units hostages_guer;
#

remote_call_hostages.sqf

params ["_unit"];

[_unit, ""] remoteExecCall ["switchMove"];

sleep 1;

if (isServer) then {
    PIG_free_hostages = PIG_free_hostages + 1;
    publicVariable "PIG_free_hostages";

    if (PIG_free_hostages == ({alive _x} count units hostages_guer)) then {
        ["task_01", "SUCCEEDED", true] call BIS_fnc_taskSetState;
        task_01_completed = true;
        sleep 300;
        {
            deleteVehicle _x
        }forEach hostages_guer;
    }
};

sleep 2;

[_unit, "move"] remoteExec ["enableAI", _unit];
sleep 1;
doStop _unit;
_unit doMove (getPos safeZ);
#

Why does the "PIG_free_hostages" not getting updated (from the server perspective)?

elfin turtle
#

Does the variable ID in a composition count for a grpID?
IDK about this. If so, then I can skip doing the xxxGrp = group this. If not, then I'll have to do that.

broken forge
#

I'm trying to figure out the best way to create a scheduler in SQF for my C# .NET Framework Library that runs asynchronous tasks. The extension is basically a simple tcp client that connects to dragonflydb (a redis type db) and sets/gets keys. At the moment I already have the functions that communicate with the extension, but I'm having a problem with loading and setting keys at the appropriate times. For example loading a saved player while also loading mission values. Any ideas or places to look?

#

Here's one of my functions:

/*
    Get Hash Table from DB:

        _key = String to your saved hash table (Case sensitivity)
        _object = Target to return data can be Object, Array of Objects, Owner ID (0 = All and 2 = Server only), Side or Group (Multiplayer only)
        _function = String name of function to return your data (Case sensitivity)
        _call = Boolean for call true or false. Default false. (Multiplayer only)

       [_key, _function] spawn dragonfly_db_fnc_hashGetAllId; (Server or Singleplayer only)
        or
        [_key, _object, _function, _call] remoteExec ["dragonfly_db_fnc_hashGetAllId", 2, false]; (Multiplayer only)
*/
params [["_key", "", [""]], ["_object", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_function", "", [""]], ["_call", false, [false]]];

if (count _this == 2) then { _object = nil; _function = _this select 1; };
if (_key == "" || _function == "") exitWith { diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashGetAllId' Invalid Input for Key '%1' or Function '%2'", _key, _function]; };

// if (!isNil "_object") then {
//     if (_call) then {
//         "ArmaDragonflyClient" callExtension ["hgetallid", [_key, _object, _function, _call]];
//     } else {
//         "ArmaDragonflyClient" callExtension ["hgetallid", [_key, _object, _function]];
//     };
// } else {
//     "ArmaDragonflyClient" callExtension ["hgetallid", [_key, _function]];
// };

"ArmaDragonflyClient" callExtension ["hgetallid", [_key, _function]];
broken forge
#
_vest = typeOf test
wispy venture
#

So this?

#

Whatever the hint may be.

#

I'm also getting this spammed into my latest .rpt file and on my screen when i open ace and the code is in the init field.

#
_icon params [["_iconFile", "", [""]], ["_icon>
 2:35:08   Error position: <params [["_iconFile", "", [""]], ["_icon>
 2:35:08   Error Params: Type code, expected String
 2:35:08 File /z/ace/addons/interact_menu/functions/fnc_renderIcon.sqf, line 322
broken forge
#

That error is from you using {} instead of "" within the arguments for calling ace_interact_menu_fnc_createAction

#

typeOf will return the classname as a string, so you can just use _vest for the classname when using the addVest command

tender fossil
wispy venture
#

It's giving this error.

#
if (isNil "_resul>
 2:44:12   Error call: Type String, expected Array,code
 2:44:12 File /z/ace/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf..., line 333
 2:44:13 Error in expression < = [_target, ACE_player, _customParams] call _conditionCode;
broken forge
#

The params for ace_interact_menu_fnc_createAction:

/*
 * Argument:
 * 0: Action name <STRING>
 * 1: Name of the action shown in the menu <STRING>
 * 2: Icon <STRING>
 * 3: Statement <CODE>
 * 4: Condition <CODE>
 * 5: Insert children code <CODE> (Optional)
 * 6: Action parameters <ANY> (Optional)
 * 7: Position (Position array, Position code or Selection Name) <ARRAY>, <CODE> or <STRING> (Optional)
 * 8: Distance <NUMBER> (Optional)
 * 9: Other parameters [showDisabled,enableInside,canCollapse,runOnHover,doNotCheckLOS] <ARRAY> (Optional)
 * 10: Modifier function <CODE> (Optional)
 */
wispy venture
#
_icon params [["_iconFile", "", [""]], ["_icon>
 2:49:27   Error position: <params [["_iconFile", "", [""]], ["_icon>
 2:49:27   Error Params: Type code, expected String
 2:49:27 File /z/ace/addons/interact_menu/functions/fnc_renderIcon.sqf, line 322
 2:49:27 Error in expression <ect ace_interact_menu_iconCount;`
#

Whenever i adjust my params to what that forum says i get errors.

#

That's what this code for ur information.

#

Same error, and "expected array, hashmap line 366 something". The interaction menu doesn't show up at all right now.

#
{
    pri>
 2:58:43   Error foreach: Type Bool, expected Array,HashMap
 2:58:43 File /z/ace/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf..., line 366
 2:58:44 Error in expression <dren pushBack _action;
        };
    } forEach _dynamicChildren;
};
broken forge
#

I'll have to open up arma 3

wispy venture
#

I've been messing around with it for days but i can't seem to get further then getting the submenu to work.

#

Just now getting the actual functions of it to work has been stressing me out.

broken forge
tender fossil
broken forge
#

Yes the extension itself is async

tender fossil
#

Alright. I had a similar issue in A2 and ended up with a hacky (?) but working solution where the extension calls / DB requests were assigned a request ID that the extension returned immediately (to avoid blocking the game for any longer than necessary), and started processing the request. Then in the game SQF code just kept polling the extension with the request ID asking if the result is ready yet, until the extension returned the final result

dark flower
#

So

#

I'm working at this as well since he's my friend and I came up with the similar but diferent code idk if this may be helpfull?

#

_action_1 = ["Interactions", "Interactions", {}, {true}, {true}] call ace_interact_menu_fnc_createAction;
_action_pickup = ["Pickup", "Pickup",
{
Emi addVest "vest_v_tacvest_blk_police";
deleteVehicle _test;
}, {true}, {true}] call ace_interact_menu_fnc_createAction;

[test, 0, [], _action_1] call ace_interact_menu_fnc_addActionToObject;
[test, 0, ["Interactions"], _action_pickup] call ace_interact_menu_fnc_addActionToObject;

#

"Emi" being the Unit/Player

broken forge
#

Just fixed a typo, lol, it's good now

broken forge
tender fossil
dark flower
#

So ill be if it doesn't work go directly to the config and set it to the name "_vest" so it can actually work?

#

Bc I got lost when you said Hardcore and btw, Sem is afk so that's why I'm responding for him

broken forge
#

The test that I did was of a vanilla vest, and the eden editor object that was placed added Vest_ to the front of the classname. There are ways to work around this, but if the vest you put down in the eden editor isn't the same classname as the actual vest classname you can hardcode it for now. I.E. Vest_V_PlateCarrier1_rgr was the eden editor object classname and the actual vest classname is V_PlateCarrier1_rgr

broken forge
#

Oops switch deleteVehicle _vest to deleteVehicle test

dark flower
#

oh k

#

Welp

#

The object is gone when you do that

#

but

#

It doesn't get added to your inv

#

but

#

that's a good part atm

#

So the only issue now it's that the vest is going off (Thing that we want) but it's not comming to our inventory or on the vest position.

dark flower
broken forge
#

Go into the virtual arsenal and find the vest, hover over it and write down the classname that gets displayed, then use that classname for the addVest command.

dark flower
#

I did

#

I'm stupid wait one

#

Still nothing

#

It just evaporats

#

Wierd, Even with your command doesn't

broken forge
#

try using the export button in the arsenal and the ctrl v in an empty notepad file, then find where the line addVest is and use that classname

#

That would be correct

dark flower
#

Thanks for your time and effort

#

We appriciate it!

broken forge
#

You're welcome, keep in mind when using functions with arguments to make sure you're matching the type of argument as well as the amount of required arguments for the function to work. I.E. Number, Code, String, Boolean, Array and etc, also keep in mind the different class names that are used, things placed on the ground in the eden editor will differ from the same item/object you place on your character or into your inventory

dark flower
#

I think we're going to use the "addPrimaryWeaponItem"

#

The thing with this is bc we wanted to create like a custom locker (Yes, 1troop fans L) with interactive features

south zenith
#

Hello, I'm trying to make a custom hud appear/disappear depending on the angle the pilot is looking, up or down.
I tried understanding getCameraViewDirection and eyeDirection commands, but I really don't get 3D Vectors and even analysing the results of said commands I just don't know what to do with that data.
Can somebody help me?

#

What I thought about doing, is maybe creating a reference point just 1 meter in front the pilots eyes, and one where eyeDirection is pointing 1 meter a part, and comparing Z values, but what if the helicopter is at a 90Β° bank? Z difference would be 0 even if in reality player was looking down... I don't even know if this would work πŸ₯²

broken forge
meager granite
south zenith
#

Should be relative to the vehicle I think

#

Helicopter could be upside down, if player is looking down, let's say on his legs, even if in world that would be up, in this case is down

south zenith
south zenith
south swan
#

isn't there envelope or something in the HUD config that disables it depending on look direction already?

#

it seems i'm misremembering things notlikemeowcry

wispy venture
#
 9:30:08   Error parseSimpleArray format error
 9:30:08 File \/x/kat/addons/misc/XEH_preInit.sqf..., line 842
 9:30:08 Error in expression <otation", ""];
        private _array = parseSimpleArray _string;

I keep getting this error when i walk around for the first 5 seconds. Any ideas?

hallow mortar
#

Just KAT Medical things

wispy venture
#

Cause there's no way im the only one who's having this.

wispy venture
#

Figured it out.

still forum
still forum
# broken forge The extension doesn't return a value right away, and the mission framework is tr...

Is your problem that for some things you need to get the data right now, or wait for it? Basically make the reqeuest non-async?
Maybe you just need to make the C# side of your call extension loop and wait for the async task to be done.
Freezing the game while waiting for the answer.

if your script is unscheduled, and you have to wait for the result, there is no other choice.
If it is scheduled, you could do a waitUntil to suspend the script until its done.

Depends how you're using it

tiny rampart
#

I'm trying to mess around with setWeaponZeroing function but whenever weapon with ballisticComputer = 2 has the range measured the said function is being ignored. Is there any way around it?

tender fossil
proper sigil
#

Hey! I'm having a bunch of functions used during MP operations on dedicated server that are responsible for adding action for each players on destroyed vehicles - it allows players to scrap those wrecks for some resources. They works as intended BUT are poorly optimized and by that I mean each time a vehicle is destroyed a lag occurs. I'm looking for some pointers on how to solve the issue. The main function responsible for the lag is that one, I was thinking that perhaps the main issue is using MPKilled EH which afaik runs in scheduled environment so every process is put on hold until it's executed, I couldn't get this to work with local Killed EH though.

#

here is the function


    params ["_target", "_isSalvagable"];
    
    if(_isSalvagable == true && (_target in dnt_mpKilledRegistry) == false) then {
    
            dnt_mpKilledRegistry pushBack _target;
            publicVariable "dnt_mpKilledRegistry";

        _target addMPEventHandler ["MPKilled", {
            params ["_unit", "_killer", "_instigator", "_useEffects"];
                
            removeAllActions _unit;
            
            if(_unit in dnt_deployedVehicles) then {

                private _removeIndex = dnt_deployedVehicles find _unit;
                if(_removeIndex != -1) then {
                    dnt_deployedVehicles deleteAt _removeIndex;
                    publicVariable "dnt_deployedVehicles";
                };
            };
            
            call DNT_removeSupplies;
            [_unit] call DNT_removeRegObject;
            [_unit] spawn DNT_createScrap;
        }];
    
    } else {
    
        _target addMPEventHandler ["MPKilled", {
            params ["_unit", "_killer", "_instigator", "_useEffects"];
        
            removeAllActions _unit;
            
            call DNT_removeSupplies;
            [_unit] call DNT_removeRegObject;
        }];
    };
};```
#

Above function is being applied locally to vehicles on player init (initPlayerLocal) and it's being only run once so it's rather not the issue

granite sky
#

When is the function actually called?

proper sigil
#

Process is as follows:

  1. initPlayerLocal.sqf executes call DNT_initSupplies;
  2. On init below code is executed (once on player init)

    diag_log "DNT_fncCommon.sqf executed DNT_initSupplies";
    
    if(hasInterface) then {
        call DNT_onResDepletionChange;
    };

    {    
        [_x] spawn DNT_createSupply;
        
        if(_x isKindOf "LandVehicle" || _x isKindOf "Air" || _x isKindOf "Ship") then {
        
            [_x] call DNT_setVicCargoSize;
            
            if(!alive _x) then {
            
                [_x] spawn DNT_createScrap;
            };
        };
        
    } forEach entities [[],[],true,false]; 
    
};```
3. Lengthy function *DNT_createSupply* that adds actions is executed, I'll only post piece regarding vehicles
#

params ["_supplyObject"];

...

[_supplyObject, _isSalvageble] remoteExec ["DNT_onSupplyLost",2];

...

#
  1. DNT_createSupply executes DNT_onSupplyLost which adds eventhandler

  2. Eventhandler uses 2 functions

DNT_removeSupplies = {
                                    
    {
    
        private _objectVariable = missionNamespace getVariable _x;
        private _supplyObject = _objectVariable select 0;
        private _objectMission = _objectVariable select 3;
        private _missionState = [_objectMission] call ENGTASKS_GetTaskState;
        if((!alive _supplyObject && _missionState != "SUCCEDED") || (isNil "_supplyObject" && _missionState != "SUCCEDED")) then {
            
             
            [_objectMission] call ENGTASKS_DeleteTask;
            [_supplyObject] call DNT_removeRegObject;
        
        };
    
    } forEach ((allVariables missionNamespace) select {_x regexMatch ".*dntsp_.*"});

};

DNT_removeRegObject = {

    params ["_target"];
    
    private _removeIndex = dnt_regSupplies find _target;
    if(_removeIndex != -1) then {
        dnt_regSupplies deleteAt _removeIndex;
        publicVariable "dnt_regSupplies";
        
    };
};

#

But I'd focus mainly on DNT_onSupplyLost , DNT_removeSupplies, DNT_removeRegObject that are executed on vehicle destruction (it's the only moment lag occurs). There is also DNT_createScrap but it's called using spawn so in my understanding even if performance heavy the function is run in unscheduled enviroment so it's execution shouldn't cause server to hang

granite sky
#

onSupplyLost is only executed on the server then?

#

(allVariables missionNamespace) select {x regexMatch ".*dntsp.*"})
Have you checked how long this takes to execute?

proper sigil
granite sky
#

Advanced developer tools has a stopwatch icon at the top. I think there's one in the stock debug console that I never spotted though.

#

Otherwise just use diag_codePerformance the hard way.

#

I can't test for you because it depends heavily on the number of global variables in your mission.

proper sigil
#

I see I will try that

proper sigil
#

Okay, I run the test in dev console


hint str(_result)```

and it returned [19.4403,1] which I understant is 19.4403 miliseconds in 1 cycle. How do I interpret the result, is that a lot?
#

For comparison I run test "DNT_createScrap" and it only took 0,0043 ms so I guess it is a lot indeed

granite sky
#

19 milliseconds is a lot, yes.

proper sigil
#

Hell okay, I think then that's the culprit. I wonder if calling it only on the server would help at all or should I totally rethink this method

granite sky
#

well, if it's the allVariables + regex that's at fault then there are plenty of better ways of storing related data.

proper sigil
#

Yeah I'm just anxious on redoing this one as there is more elements of my code that relies on this method so if I break it everything stops working xDD

#

Unless I could just store relevant variables in public array instead of searching missionnamespace each time

proper sigil
eternal spruce
#

Given how unitCapture/Play works, I'm not entirely sure how this could work but would It be possible to spawn a unit and have the playback what was recorded?

south swan
#

why wouldn't it?

#

πŸ€” except if by "unit" you mean human or such

eternal spruce
#

no, like a vehicle for example but if its possible how would you even execute that

hallow mortar
#

The same way you'd execute anything on a unit you've just created

#
private _unit = createUnit [ ... ];
[_unit, _data] spawn BIS_fnc_unitPlay;```
eternal spruce
#

So I'd spawn like this:

"FIR_F16C_000224 (F16C_224)" createUnit [
getMarkerPos "marker_1",
];

then add in [_unit, _data] spawn BIS_fnc_unitPlay;

hallow mortar
#

If you're making a vehicle then you need to use createVehicle (and then createVehicleCrew ) - createUnit is for individual units

#

I'm pretty sure FIR_F16C_000224 (F16C_224) is not a valid classname. Classnames can't have spaces and I don't think they can have brackets.

south swan
#

and [getMarkerPos "marker_1"] would give you [[x,y,0]] which is one level too deep to be used blobdoggoshruggoogly

#

and i don't remember if trailing comma angers the SQF gods

hallow mortar
eternal spruce
#

So |FIR_F16C_000224 (F16C_224)| is a vehicle that was already in the editor that i copied the class name and vairable name

hallow mortar
#

OK, but when you do createUnit (or createVehicle), when it asks for the type of thing to spawn, you need to give it just a classname, not a classname and then (what it sees as) some random extra text.

eternal spruce
#

Ok ill try it and see what happens

eternal spruce
#

Ok so I got it to work with this,

_veh = createVehicle ["JS_JC_FA18E", getMarkerPos "NAVY", [], 0, "NONE"];
createVehicleCrew _veh;
[_veh, HLF_moveData_FA18_SH_2_RTB] spawn BIS_fnc_UnitPlay;

the spawned vehicle executed the recorded flight path, so i need further explanation on a few things;

@south swan says the marker gives [[x,y,0]] coordinates so how do i use a desired altitude level if i copy the markers position?
what if i want to delete the spawned vehicle how do i do that without it having a vairable name
and how do i change the spawned vehicle pylons/loadout or the crews loadout

stable dune
#

you can add to position z value with

getMarkerPos "yourMarker" vectorAdd [0,0,200] //200 is Z 
south swan
#

why even bother if the position would be overridden by the UnitPlay?

eternal spruce
#

@south swan yea good point

lethal cave
#

is there a findEmptyPosition command but the one that takes players into account?

fallen crow
#

Hello, I would like to know if you can help me. It turns out that I am using a mod to generate the equipment of each role as seen in the interaction. But I need the players to only be able to see that interaction if they are in front of the object. But I do not know how to do it

formal grail
#

I think this has been asked before, but here's a longshot question: is there any way now to customize group channel behavior so that you can define what is a group, without people actually being in a built-in group with you. I don't want to use built-in groups (it's a warlords scenario so players have to be able to command their own AI), and I thought about using custom channels but it looks like there's a limit on that to 10.

hallow mortar
#

No, Group channel membership is handled engine-side

formal grail
#

Like an empty vehicle that does nothing

tawdry knot
#

So I want to be able to display a variable to a hud, ***class RscTitles{
class moneyHUD{
idd = 1000;
duration = 1e+11;
class Controls{

            class moneyHUD: RscText
            {
                idc = 1001;
                text = "";
                colorText[] = {1, 1, 1, 1};
                x = 0.0153125 * safezoneW + safezoneX;
                y = 0.016 * safezoneH + safezoneY;
                w = 0.12375 * safezoneW;
                h = 0.077 * safezoneH;
            };
            

    }

}

}*** this is my hud.hpp, i want to have my money variable in initPlayerLocal.sqf display for that text value, how can I go about doing that?

stable dune
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

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

Thanks, sorry about that

#

Also figured it out , ```sqf
ctrlSetText [1001,(format["%1", money])]

coarse parcel
#

Can anyone point me in the right direction. I'm trying to make a script that simply checks if an AI (in my case cursorTarget) has a secondary in their vest or backpack and if they do, they they equip it and select it. Any help is greatly appreciated.

warm hedge
#

Clarifying your words:

  • Is secondary, a handgun?
  • Is the thing, stored in vest or backpack? Or something else?
coarse parcel
#

yes and only vest or backpack

warm hedge
#

So stored in an inventory where not selectable directly using 2 key or Action Menu

coarse parcel
#

It's for a scripted event so no player involvement in terms of action menu, they AI just does it themselves. I;ve been scouring the Arma 3 Wiki to no avail.

warm hedge
#

Okay, that would be seriously complicated if you try to do in a straightforward way

#

It definitely is more easier to remove pistol from inventory, spawn the same pistol into the slot

coarse parcel
#

yeah, that would still work.

warm hedge
#
  1. getUnitLoadout to get an unit's inventory state
  2. Find if there is a suitable pistol
  3. Store that pistol into a temp variable
  4. Add that pistol into corresponded part of Unit Loadout Array
  5. Remove the pistol from the inventory
  6. Apply the result via setUnitLoadout
coarse parcel
#

The only problem I've had with this approach is finding the pisto from the getUnitLoadout result. If I can do that, then all is well.

warm hedge
#

So, firstly iterate the inventory items to check if there is a weapon. Check if the weapon is a pistol. Maybe check if there is multiple same weapon (an inventory can store multiple same weapon).

#

Remove that pistol from array. Add the pistol array into handgun part of the array. Apply, call it a day

coarse parcel
#

I understand that but how from this [["arifle_MX_ACO_pointer_F", "", "acc_pointer_IR", "optic_Aco", [], [], ""], 1] can you determine - dynamically - if it is a weapon without having a class name to compare to; for example having an array with arifle_MX_ACO_pointer_F in it so if its within then sure its considered a weapon, but is there a way to check without having to write an extensive list of validGuns.

warm hedge
#

You mean you are not sure how to tell it is a handgun?

#

getNumber (configFile >> "CfgWeapons" >> "arifle_MX_ACO_pointer_F" >> "type") it can return 1, 2 or 4. I forgot which is the pistol, 2 or 4

#

But basically that's it

coarse parcel
#

ok, thanks for the help. I'll give it a try

ornate whale
#

Can anyone tell me how I am supposed to use CBA patrol function. https://cbateam.github.io/CBA_A3/docs/files/modules/fnc_modulePatrol-sqf.html

I follow the documentation, but all the groups walk the same path. Even if I call it for all group leaders separately.

private _leader = leader (_groups#0);

_leader setVariable ["patrolLocType", "OBJECT"];
_leader setVariable ["patrolPosition", "tree"];
_leader setVariable ["patrolRadius", 40];
_leader setVariable ["waypointCount", 4];
_leader setVariable ["waypointType", "MOVE"];
_leader setVariable ["behaviour", "SAFE"];
_leader setVariable ["combatMode", "YELLOW"];
_leader setVariable ["speedMode", "LIMITED"];
_leader setVariable ["formation", "STAG COLUMN"];
_leader setVariable ["timeout", "[0,0,0]"];


[_leader, _groups apply {leader _x} ] call CBA_fnc_modulePatrol;
open hollow
#

hello, im adding some rsctitles to my mission, but for some reason when i change something i need to reboot the game to take the changes ( im using 3den enhanced) there is some way to recompile description.ext?

warm hedge
#

Ctrl+S in Eden

open hollow
#

for some reason it didnt work, maybe some mod like 3den enhanced is interfering it?

warm hedge
#

It shouldn't

#

Make sure the file you update is the correct one, correct mission

cosmic lichen
#

I have got a mission in which I have to hide several ten thousand terrain objects.

The objects are always the same but I have to do a few checks on them like are they in the area, correct type and so on.

Now I was wondering if there is a way to store these objects in any way to speed up the process. Any ideas?

#

I guess I always have to use getTerrainObjects anyway

topaz moth
#

Hello, I'm using vs code for my IDE, is there an extension that shows informative errors for sqf, I have been relying on the arma 3 in-game errors, and its a pain. looking for more immediate error feedback, I'm coming from C++ so I'm still adjusting to the syntax and would like to know when and where I'm messing something up

cosmic lichen
topaz moth
mystic scarab
#

Is there a way to get the animations for a vehicle (like accessories on it, front bumpers and so on) in a format that's compatible with BIS_fnc_initVehicle ? I'm currently getting them with BIS_fnc_saveVehicle and reformatting before passing them to BIS_fnc_initVehicle. I'm doing this as part of a vehicle persistence module.

cosmic lichen
#

Nope. You have to write a custom script.

#

Not too hard though. Get the available animationSources from config of given vehicle class and use animationPhase to check their state.

mystic scarab
hallow mortar
formal grail
#

Made a POC. Seems to work. Basically whenever you talk on side chat, everyone else is notified to mute you

cosmic lichen
formal grail
#

(Except your squad, who still can hear you)

royal quartz
#

Hi guys im working on a small mod for a group I play with and am trying to apply some custom saved loadouts when players respawn, I have a custom loadout for each being saved (currently as a test) when the ace arsenal is closed with the following code and this works.

private _id = ["ace_arsenal_displayClosed", {_loadoutSaved = [ player, [localNamespace, getPlayerUID player]] call BIS_fnc_saveInventory;}] call CBA_fnc_addEventHandler;

The problem is after hours of searching and also trying to understand the Ace Save gear on death function I cannot find out how it is applying the loadout it saves after a player respawns. The below code would do it when run from debug console but I need to have this work from code in my mod which I can find how to add an event handler for this.

private _id = player addMPEventHandler ["MPRespawn", { _loadout = [player,[localNamespace, getPlayerUID player]] call BIS_fnc_loadInventory; }];

Any help is greatly appreciated πŸ™‚

proven charm
#

oh nvm getPlayerUID returns a string

#

is the addMPEventHandler "MPRespawn" triggering?

royal quartz
#

If I run that same code in debug console though it adds the event handler ok and it works. But ofcourse just for the session and I need it to work in my mod for some functions

proven charm
#

i guess its a problem where addMPEventHandler "MPRespawn" is set

#

should be on client...

royal quartz
#

I'm not sure how to set it on client from a mod, I think for that I would need some extra config in my config.cpp to add a respawn event handler to all clients but after hours of googling I'm not sure how to do that

proven charm
#

typically it would be set in mission because mod itself isnt a running mission

#

you cant like set the event handler when game is still in main menu or something

#

what I do is that I call the mod's code in missions init.sqf. actually I use #include there

#

not sure if thats the best way but it works πŸ˜„

lyric plover
#

What does adding underscores to variables do?

proven charm
lyric plover
proven charm
#

it makes it a local variable

lyric plover
proven charm
#

opposite of global variable

faint burrow
lyric plover
faint burrow
#

Use arguments parameter.

lyric plover
#

Or should I make it global and then turn it private in the addaction script?

lyric plover
#

i forgot it exists there

#

thank you for pointing it out

proven charm
lyric plover
proven charm
#

true

lyric plover
#

and i want my script to be modular for zeus

#

so i can place multiple objects without them colliding themselves

#

by overwriting the same global value and then affecting only one thing instead of 3 things separately

lyric plover
#

How would I create an addaction event for all players on the server?

#

Because right now it only works for me but not for others.

proven charm
lyric plover
#

I mean can I do it in object ini?

#

init*

proven charm
#

that's a file name. I prefer files but your call

lyric plover
#

I have to use object inits.

proven charm
#

why cant you use files? πŸ€”

lyric plover
#

Because I intend on using those scripts in public zeus.

proven charm
#

still dont get it XD

lyric plover
#

I'm not an administrator on public bohemia servers.

#

I don't have access to server files.

proven charm
#

but you created the mission?

lyric plover
#

I didn't.

proven charm
#

oh

lyric plover
#

It's public bohemia server.

proven charm
#

well cant help you there sorry

lyric plover
#

Rip

lyric plover
proven charm
#

you are editing the official mission?

lyric plover
#

You know, a server where you play as zeus with 16 other players and make dynamic missions for them.

#

Some servers allow for scripts and some not, I play on the former.

proven charm
#

ic

lyric plover
# proven charm ic

All of my workshop items so far are for public Zeus and I think I'm gonna keep going this way

proven charm
#

ok

lyric plover
# proven charm ok

Say do you know how to make a script to drag captives and put them inside of vehicles?

#

Without CBA?

proven charm
#

nope , sorry

lyric plover
#

RIP

proven charm
#

armaholic used to have lots of scripts but its down, searching steam workshop maybe your best bet but you might have trouble to use it with that zeus composition thing you have

lyric plover
#

I'm out of ideas. This code works but only on a single gate. When I try to open two gates, the second gate's holdaction is broken. It shows up but I can't hold it or anything.

private _Door = Gate_1;   
   
    

[this, _Door] spawn {  
_thisObject = _this select 0;
_Door = _this select 1;
[   
_thisObject,    
"Open the Gate",    
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    
"_this distance _target < 3",    
"_caller distance _target < 3",    
{},    
{},    
{   
_Door = (_this select 3 select 0);         
(_this select 0) animateSource ["switchposition",-1];   
(_this select 0) animateSource ["switchlight",1];   
(_this select 0) setObjectTextureGlobal [1, "#(argb,8,8,3)color(0.2,0.8,0.2,1,ca)"];   
   
[_this select 0] spawn    
{    
for "_i" from 1 To 40 do{   
 playSound3D ["A3\Sounds_F\sfx\alarm.wss", (_this select 0)];   
 sleep 1;    
}};   
   
for "_i" from 1 To 160 do{   
sleep 0.2;    
_Door setPos (getPos _Door vectorAdd [0,0,-0.02])};   
      
    
},    
{},    
[_Door],    
5,    
10,    
true,    
false   
   
] remoteExecCall ["BIS_fnc_holdActionAdd",(_this select 0)];

}; 
proven charm
lyric plover
proven charm
#

ok

#

i think the script is working fine, didnt test with two gates

#

with two gates also

lyric plover
#

can you record it

proven charm
#

ugh actually had the problem you described

frozen seal
#

I feel like I'm missing something obvious here. So I do this:

_zeus = missionNamespace getVariable "zeus_blufor";
systemChat format["zeus is nil %1", isNil _zeus];

Why is the output I'm getting "zeus is nil bool" rather than "zeus is nil True" or "zeus is nil False"?

proven charm
frozen seal
frozen seal
# stable dune isNil "_zeus"

Any ideas why this would result in "authored by zeus bool" instead of "authored by zeus True"? Is this the correct way of checking that a variable exists before using it to check condition?

addMissionEventHandler ["MarkerCreated",
{
    params ["_marker", "_channelNumber", "_owner", "_local"];
    _zeus = missionNamespace getVariable "zeus_blufor";
    _authoredByZeus = not isNil "_zeus" and _owner == _zeus;
    systemChat format["authored by zeus %1",_authoredByZeus];
}];
frozen seal
#

that's why I check for nil first

not isNil "_zeus" and _owner == _zeus;
#

the part to the right of "and" will not execute if the first part returns false, right? Or SQF does not optimize like that?

proven charm
#

it will all run

#

but you can do lazy eval ```sqf
not isNil "_zeus" and { _owner == _zeus }

#

arma style ^^

frozen seal
proven charm
#

its lazy eval

#

the right part gets executed only if left part is true

frozen seal
#

also, why is arma like that ._. that's the first language I worked with that does not terminate AND condition as soon as a False is hit

proven charm
#

good question

lyric plover
frozen seal
#

Is **initServer **the right place to execute this code? It works fine in **local **multiplayer but it does not get invoked on **dedicated **server

addMissionEventHandler ["EntityCreated", {
    params ["_entity"];    
    if(_entity isKindOf "Helicopter" and {unitIsUAV _entity} and {side _entity == west}) then
    {
        _entity setCaptive true;
    };
}];
faint burrow
#

Most likely because the entity creation does not occur on the server.

frozen seal
hallow mortar
#

Is it that it doesn't get invoked at all, or is it that setCaptive doesn't take effect? setCaptive is Local Argument, which means it must be executed where the target object is local - if the helicopter was spawned by Zeus or by a script running on a client, it will be local to the Zeus or that client, not the server

frozen seal
#

ohhh I see

faint burrow
frozen seal
#

Yeah it does not work when zeus spawns the UAV, that explains why

#

so I guess I should add this event handler in initPlayerLocal instead

#

or maybe both? πŸ€” in case server decides to spawn something

hallow mortar
#

Well, add it to init.sqf which runs on both

#

If you do that, it would be wise to add a if !(local _entity) exitWith {}; at the start of the EH, to avoid duplication

modern osprey
#

Do you mind if I ask a bunch of optimization questions here?

faint burrow
lyric plover
#

it stops interfering with the 'open the gate' action

hallow mortar
lyric plover
#

Does anyone here have any clue how to make it work?

proven charm
#
remoteExecCall ["BIS_fnc_holdActionAdd",0];
``` πŸ€”
hallow mortar
#

You can skip the broadcast target parameter entirely really, it's optional and the default is 0

#

Actually, you'll probably want to set it to JIP true, so you will need the target as well in order to get there

#

(i.e. ["BIS_fnc_holdActionAdd",0,true]; )

#

Also, you can make the internals of your holdAction code a lot more readable - BIS_fnc_holdActionAdd provides named variables containing references to various things, like the object the action is added to. You can use those names instead of doing _this select x all the time, e.g. _this select 0 can be replaced with _target
(https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd)

lyric plover
#

Let me try that.

#

Yup, it works fine. Thank you. Tell me, how would I make it so that once someone would trigger the event it would not be available for anyone else?

proven charm
faint burrow
#

JIP ID should be stored and then removed as soon as someone activates the action.

proven charm
#

oh yeah that too

brave mountain
#

hi guys, whats the name of a good cfg magazine for artillery fake fire? The one you can use with module... is Sh_155mm_AMOS the "better" effect?

hallow mortar
# proven charm https://community.bistudio.com/wiki/BIS_fnc_holdActionRemove one option

It's difficult to use this with remoteExec because remoteExec doesn't return the action ID.
The best way, and it is slightly complex, is to make your own function that you remoteExec, which does the BIS_fnc_holdActionAdd locally and saves the action ID. Then you can have another function which retrieves the action ID locally and uses it with BIS_fnc_holdActionRemove.

proven charm
lyric plover
#

well it works in MP but when other people start it it's SUPER slow

#

it moves like at best 1cm every 15 seconds

#

but when the person who places it down uses it, it goes down the speed it was supposed to go down with

proven charm
#

yeah its not lag its just slow update rate when using setpos

lyric plover
#

but when i do it it moves smoothly

proven charm
#

because the object is local to you (probably)

lyric plover
proven charm
#

u cant

lyric plover
#

fuck me is there any way to make it i don't know local to the person triggering it?

tight cloak
#

or is it just a broken func

proven charm
#

dont know but you could try using another command instead of setpos, i forgot the name :/

lyric plover
#

setposASL?

#

setvehicleposition?

proven charm
#

no

tight cloak
#

setPosWorld?

#

idk im just throwing in a random guess i dont have context

proven charm
#

nope

tight cloak
#

it wont

lyric plover
#

it's not a physics object

proven charm
#

i know..

tight cloak
#

why not use a frame handler

proven charm
tight cloak
#

why would it if you make the server run it

proven charm
#

slow network updating you know...

tight cloak
#

i guess

proven charm
#

things like walls dont update too often, saves bandwidth

tight cloak
#

only way around it is to attach it to something that will update often

lyric plover
tight cloak
#

so uh, what is this gate exactly? how big is the gate that it requires a hold action

hallow mortar
#

Do I see a "simulation disabled" icon on the gate object?

hallow mortar
#

Well, that's probably not helping

#

The frequency at which an object updates its position, including sending updates to non-local machines, is part of its simulation. Some types of objects, like buildings, have naturally low simulation update rates, which is one part of the problem - and disabling its simulation entirely will also affect how frequently it updates on top of that.

#

One way around a low simulation rate is to attach the slow object to an object with a higher simulation rate. When an object is attached, it inherits the simulation rate of the object it's attached to. That being said, it's a bit complex especially if you want to smoothly animate an attached object, so I'd recommend just trying with simulation enabled first and seeing if that fixes it.

opal zephyr
#

Does anyone know any way to get the vertext cound of a p3d through script? Or have a suggestion on how to estimate it?

tawdry knot
#
trigger = createTrigger ["EmptyDetector", getMarkerPos "mineMarker", true];
_trigger setTriggerArea [30, 10, 0, false]; 
_trigger setTriggerActivation ["ANY", "PRESENT", true];




mineinit = {
        if (triggerActivated _trigger) then {
            private _markerpos = getMarkerPos "mineMarker";
            private _offset = [100, 0 , 0];
            private _newpos = _markerpos vectorAdd _offset;

            "mineMarker" setMarkerPos _newpos;
        }; 

    "Land_cmp_Tower_F" createVehicle getMarkerPos "mineMarker";

};
``` I'm trying to make a function that will create  props and offset it's position when it recognizes something near the previous prop, however it's not working as intended as when I run this it just places the object right next to it instead of the offset. Can anyone see where the issue is?
hallow mortar
tawdry knot
#

Thank you! I overlooked this, i'll change it to a global variable and see if that helps.

#

Worked like a charm when I changed it to a global variable good call! Now if I wanted to define them all as private variables to avoid conflict instead of defining them in a seperate namespace like so ```sqf
private _trigger = createTrigger ["EmptyDetector", getMarkerPos "mineMarker", true];
_trigger setTriggerArea [30, 10, 0, false];
_trigger setTriggerActivation ["ANY", "PRESENT", true];

mineinit = {
if (triggerActivated _trigger) then {
private _markerPos = getMarkerPos "mineMarker";
private _offset = [10, 0 , 0];
private _newpos = _markerPos vectorAdd _offset;

        "mineMarker" setMarkerPos _newpos;
    }; 

"Land_cmp_Tower_F" createVehicle getMarkerPos "mineMarker";

};

call mineinit;
then I wanted to call them in a header file located in a folder through execvmsqf
execVM '../mineInit.sqf';" ``` the namespace shouldn't matter since i'm calling the entire file to execute correct? instead of passing it through the function to which it doesn't know the variable. However when I try this method it doesn't seem to be working.

hallow mortar
#

I'm not 100% sure I follow what you're going for.
To be honest, I'd just skip the trigger entirely.

my_fnc_spawnObject = compileFinal {
    params ["_position","_type"];

    private _suitablePosition = [_position, 0, 100, 10, 0, 0, 0, [], _position] call BIS_fnc_findSafePos;

    _type createVehicle _suitablePosition;
};

[getMarkerPos "minemarker", "Land_cmp_Tower_F"] call my_fnc_spawnObject;```
faint trout
#

How do I find the IDD for ctrl from Arma like the GPS in Helicopters/Planes?

hallow mortar
faint trout
#

Maybe I am stupid, but I cant find it there :/

hallow mortar
#

Right at the bottom

rancid nebula
#

any way to have a ace arsnenal have limited items and be unique to a player?

warm hedge
#

I don't know if ACE Arsenal works differently than vanilla ones

mortal saffron
#

Looking for help with modifying an old friends Script he made for all -

#

*/

_inAir = 8000; // view distance whilst in air vehicle
_inUAV = 6000; // view distance whilst in uav drive/gunner position.
_shadow = 50; // shadow distance

/* -----------------------------------------------------------------------------------------------
DON'T EDIT ANYTHING BELOW HERE!
----------------------------------------------------------------------------------------------- */
if (hasInterface) then
{
// ------------------------------------------------------------------------
_allowAirView = player getVariable ["allowAirView",false];
if !(_allowAirView) exitWith {};
// ------------------------------------------------------------------------
[_inAir,_inUAV,_shadow] spawn
{
params ["_inAir","_inUAV","_shadow"];
while {true} do
{
_connectedUAVControl = ((uavControl (getConnectedUAV player)) select ((uavControl (getConnectedUAV player)) find player) + 1);
if !(_connectedUAVControl isEqualTo objNull) then
{
if !(_connectedUAVControl isEqualTo "") then
{
setViewDistance _inUAV;
setObjectViewDistance [_inUAV,_shadow];
}
else
{
_vehiclePlayer = vehicle player;
if (_vehiclePlayer isKindOf "Air") then
{
setViewDistance _inAir;
setObjectViewDistance [_inAir,_shadow];
};
};
uiSleep 0.1;
};
};

#

this - [] execVM "scripts\fn_airView.sqf";

in...
initPlayerLocal.sqf
#

and this - placed in player init
call{this setVariable ["allowAirView",true,true];};

#

I am currently getting a } missing from line 55 error when in MP

#

(im not a scripter, excuse my ignorance)

#

Line 55 being after "if (hasInterface) then" in the complete script

#

Attemping to script a change in viewDistance for Pilots only with this setVariable ["allowAirView",true,true]; place in unit INIT

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
hallow mortar
#

In fact, you're 2 short - there's one missing from the end of the else case as well.

mortal saffron
#

Thanks, wll amend

sullen sigil
#

no i will not excuse your n++ colour scheme what the hell is that

dark flower
#

Backpack Eliminates but doesn't add to the player Backpack spot

_action_8 = ["Interactions", "Interactions", "", {true}, {true}] call ace_interact_menu_fnc_createAction; 
_action_pickup = ["Backpack", "Backpack", "", { 
    _backpack = typeOf A8; 
    if (_backpack == "ST_Pack") then { 
        player addBackpack "flb_511aplpine_A_blk"; 
        deleteVehicle A8; 
    }
}, {true}] call ace_interact_menu_fnc_createAction; 
 
[A8, 0, [], _action_8] call ace_interact_menu_fnc_addActionToObject; 
[A8, 0, ["Interactions"], _action_pickup] call ace_interact_menu_fnc_addActionToObject;
#

Any help?

exotic lynx
hallow mortar
last cave
little raptor
#

execVM runs locally
But whether that variable will be seen by others depends on whether you're using the global version of setVariable or not

cobalt path
#

question, how to I do remove action? How do I find these actionids

_this addAction ["<t color='#CDCDCD'>Door Settings (Open)",
{
params ["_target", "_caller", "_actionId", "_arguments"];

    _target addAction ["<t color='#DAEDC8'>Open Door (Left Front)",
    {
    params ["_target", "_caller", "_actionId", "_arguments"];

    _target animateDoor ['Door_LF', 1];

    },
    [], 0.1, true, true, "", "_this == driver _target"];

    _target addAction ["<t color='#EDC8C8'>Close Door (Left Front)",
    {
    params ["_target", "_caller", "_actionId", "_arguments"];

    _target animateDoor ['Door_LF', 0];
    },
    [], 0.1, true, true, "", "_this == driver _target"];
},
[], 0.1, true, true, "", "_this == driver _target"];

Essentially I want to add another Add action, which would be "Door Settings (Close)" and it would remove all add actions that I spawned in

hallow mortar
#

Well, you can use removeAllActions if you're sure there aren't any scripted actions you want to keep

#

Otherwise, the action IDs are the return from the addAction command, e.g. _actionID = _target addAction [ ...

#

You can save the action ID when you add the action, store it in a variable somewhere with setVariable, then later retrieve it for use with removeAction

cobalt path
hallow mortar
#

Basic example:

private _action1 = _vic addAction [ ... ];
private _action2 = _vic addAction [ ... ];

_vic setVariable ["marki_var_doorActionIDs",[_action1, _action2]]; // don't use public broadcast flag as IDs are client specific

// Later
{ _vic removeAction _x } forEach (_vic getVariable ["marki_var_doorActionIDs",[]]);```
modern osprey
#

We have a windows server running.

Recently we had to reinstall Windows and after that the problems started.

We are launching the same mission with the same settings, and it seems to take longer to load onto the server at startup.

The mission is now read not in a second, but in two minutes, and 3 minutes can pass between Mission read and Game starter.

What could be the problem and where to dig?

hallow mortar
#

Yes. The action activation code is only executed on the machine where the action was activated; your setVariables do not have the global broadcast flag, so they are local-only by default.

hallow mortar
#

Depends on the trigger

#

Every machine has their own copy of a trigger (unless it's set to server only). If the trigger's condition is satisfied on a given machine, then the trigger activates on that machine. Some conditions are more or less machine-specific. "Any OPFOR in the trigger area" is not machine-specific; every machine's copy of the trigger will activate when that happens. "player in the trigger area" is machine-specific, because player only refers to the local machine's player unit, not any player, so the trigger will only activate on the machine of a player who enters the trigger area.

ornate whale
#

Any player should be triggered everywhere, unless you have only server checked.

#

Once the trigger reaches the check time (e.g. every 5 secs), and the condition is met - present (at least one player), it will then trigger. But it will trigger only once for all players inside the trigger on each machine. Does it make sense?

#

If any player is detected (one or more), it will be executed on all machines (clients and server) once per the check iteration (if set to repeatable). And all the present players will be in the list of units that triggered it.

#

Like, 5 for outside, 60 for inside?

hallow mortar
#

Set the dropdowns to Any player present.
In the condition code field, replace this with player in thisList.
Change the trigger interval from 0.5 to 60.

ornate whale
#

There is an interval option that specifies the time between checks.
If you want to do something just with one player locally, then reference him simply as player inside the on activation code, and it will affect just him.

#

Did you set it to repeatable?

#

Try to leave the trigger area and enter again. And use shorter interval for debugging. πŸ™‚

hallow mortar
#

Do you have any timeout stuff set at the bottom?

ornate whale
#

This should be working, check the size of the trigger area.

#

In my experience, there is no way to make it trigger again, while you just standing inside. You need to re-enter again.

#

Yep, init.sqf runs on every machine.

#

Yes.

granite sky
ornate whale
#

I have written a simple code that will let you trigger again even if a player does not re-enter the area. Place it inside the on activation field in the trigger. The trigger should have a shorter time interval than the code here (e.g. 5 secs), and remove the comments from it or you get errors. The trigger does not need to be repeatable, to save some CPU time.

if (isNil "spawned") then
{
  triggerList = thisList;
  spawned = true;

  [triggerList] spawn {
    params ["triggerList"];
    while {true} do
    {
      if (player in triggerList) then
      {
        hint ("PRESENT! " + str time); //Your message here.
        //Your additional code here.
      };
      sleep 30; //Your time interval here.
    };
  };
};
proven charm
#

is the string returned by copyFromClipboard a reference or copy?

sullen sigil
winter rose
proven charm
granite sky
#

Some commands could theoretically pass the reference around. I don't know if any do.

proven charm
#

last time Dev said everything is passed by reference

granite sky
#

Everything is a reference. Things are not necessarily passed by reference.

#

Apparently in some cases that's a bug.

#

(and will behave differently on perf/profiling)

#

Looks like it's specifically the assignment operator that (incorrectly) makes a copy.

#
_var = "trash";
_var2 = _var;
_var isEqualRef _var2;
```returns `false` (on stable, apparently not on profiling)
```sqf
_var = "trash";
_var call {
  _var isEqualRef _this;
};
```returns `true`
```sqf
_var = "trash";
_arr = [_var, _var];
(_arr select 1) isEqualRef _var;
```returns `true`
proven charm
#

great cant trust isEqualRef then...

granite sky
#

Apparently it's correct :P

#

It's = that you can't trust.

#

Going back to the original question, I'd be very surprised if copyFromClipboard didn't make a new string every time you ran it.

#

Otherwise it'd imply that Arma is regularly making SQF copies of the clipboard in the background, which seems implausible.

proven charm
#

yeah its slow command and probably the whole reading clipboard is slow too

granite sky
#

nods

proven charm
#

just wondering how many times it builds a string

#

once when reading clipboard and then another to pass it to script (hope not)

mystic scarab
#

How can you get what faction a unit will wake up as when using ACE medical? I'm trying to write a friendly fire script and due to ace unconsciousness, all the _killed units come back as CIV

hallow mortar
#

Do you mean faction or side?

mystic scarab
hallow mortar
#

Try checking the side of the group rather than the unit

mystic scarab
still forum
open hollow
#

im using button to execute a script in 3den, but i want to use some global variables there, and i get this error every time i press it.

it doesnt happen when i use in the console :/

still forum
still forum
#

you can get rid of that serialization warning by using disableSerialization
Actually that only works with local variables

open hollow
open hollow
still forum
#

store it in uiNamespace

open hollow
#

there is a with uinamespace as namespace { // something } isnt it?

#

with uiNamespace do
{
call myfunct
};

can i do that?

still forum
#

probably yeah

open hollow
#

yep i worked πŸ˜„

lone galleon
#

Hello guys, iΒ΄m trying to get the VVS to spawn the vehicles on the diferent decks of the ATLAS LHD

I have tried following the steps on this post that had the exactly same issue, but on the Nimitz. - https://forums.bohemia.net/forums/topic/190654-solvedvirtual-vehicle-spawner-script-on-the-uss-nimitz/

Can anyone help me do it? Like on a STEP by STEP. Thank you in advance.

My idea:

Flight deck: Air Vehicles
Middle Deck: Light Vehicles
Bottom Deck: Heavy Vehicles and Boats

I have seen this video itΒ΄s on a LHD but itΒ΄s from 8 years ago. - https://www.youtube.com/watch?v=AEe8G7DPxu4

rich bramble
#

@gleaming rivet If you didn't get an answer to your arsenal question yet: If you just want to "blacklist" a few items then you're pretty much S.O.L. with the vanilla arsenal. https://github.com/ImperialAlex/XLA_FixedArsenal adds actual blacklisting ;)

elfin inlet
#

Before I even go down the rabbit hole, is it possible to make a weapon that when you fire it, the mag is refilled 1 bullet per second? Making an energy weapon that I want to recharge over time

#

I haven't seen anything discussed like that here so I figure it's not, or above my skill level

elfin inlet
#

Interesting, and very cool. I shall look into this further

flat sluice
#

Really wild question here that is probably a no, but is there are tools out there for diagnosing network issues on arma servers, such as wireshark packet analysis or something? We've reached a point on our public servers where we found the limit to netcode and it would be nice to have something to deduce what our biggest bandwidth hogs are in terms of remoteExecs, publicVariables, etc.

exotic lynx
proven charm
granite sky
#

You can see ACRE's 16MB publicVariableClient calls though :P

jaunty ravine
#

Is there some way to detect the player clicking on a marker on a map?

#

Specifically a marker made with "drawIcon".

still forum
flat sluice
#

Definitely not bandwidth. It's a 1Gb symmetric line that is only seeing around 30 Mbps. Server isn't really freezing up either, mainly just many clients reporting desync. Running on linux x64 for reference

granite sky
#

I'm not sure how you tell, tbh. I don't know what the "message pending" spam actually means.

hallow mortar
#

Previously I've encountered an issue where one specific client had a bad connection (lots of packet loss), which resulted in a lot of "message pending" errors, and it was causing problems for everyone else because the server was spending too much effort on waiting for/trying to contact that specific client

still forum
#

One simple optimization is to make sure that as many objects as feasible are local-only, thus not network synced.
That reduces load alot. Because every object is multiplied by number of players and checked I think every frame

flat sluice
#

I think the issue is more that we are running QS I&A but its something we can look into

still forum
#

There is also something on the server, to display the current size of the network queue

#

Would be interesting whether the queue is empty or not.
I forgot how to do that, maybe its in #monitor

flat sluice
#

Monitords is giving us this in the RPT:
Server load: FPS 86, memory used: 4202 MB, out: 14721 Kbps, in: 235 Kbps, NG:0, G:5902, BE-NG:0, BE-G:0, Players: 26 (L:0, R:0, B:1, G:25, D:0)

still forum
#

NG:0, G:5902, BE-NG:0, BE-G:0
That's the queues

#

I don't know how bad 6k is

flat sluice
#

Makes two of us

flint topaz
#

Does anybody know a way to enable auto assign roles from a server side/script side on a mission. As I want a way to dynamically enable auto assign roles to a mission on init.sqf or similar. Basically I want an option to assign a player to a role when they join via scripts. Rather than relying on the mission parameters being set. I know this might not be possible but would be great if it is.

#

Best option would be a way to assign their role based on a value (put them in slot 15 for example) but auto assign to any slot works

faint burrow
sharp grotto
# flat sluice Makes two of us

Fine in my experience, mostly they are just that "high" for one log cycle and next one its already at 0 or very low.
If you see constant high numbers there is a problem.

viral spire
#

Does anyone knowwhy scripting the VLS to fire in multiplayer just randomly loses track of the targets using this script?
[] spawn { west reportRemoteTarget [t7, 3000]; t7 confirmSensorTarget [west, true]; g4 fireAtTarget [t7, "weapon_vls_01"]; west reportRemoteTarget [t8, 3000]; t8 confirmSensorTarget [west, true]; g5 fireAtTarget [t8, "weapon_vls_01"]; west reportRemoteTarget [t9, 3000]; t9 confirmSensorTarget [west, true]; g6 fireAtTarget [t9, "weapon_vls_01"]; sleep 16; west reportRemoteTarget [t10, 3000]; t10 confirmSensorTarget [west, true]; g4 fireAtTarget [t10, "weapon_vls_01"]; west reportRemoteTarget [t11, 3000]; t11 confirmSensorTarget [west, true]; g5 fireAtTarget [t11, "weapon_vls_01"]; west reportRemoteTarget [t12, 3000]; t12 confirmSensorTarget [west, true]; g6 fireAtTarget [t12, "weapon_vls_01"]; };

#

it will fire, but it will not be consistent in seeing and tracking the targets. The targets are stationary and set to not move. At random, the mission will select some to either not fire, or just fire into space

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

#

works perfectly fine in LAN or SP

stable dune
#

Well, you should check is not null your target / not dead.
and check that they are avaible distance etc.

#

without loggin i bet you wont get any result

willow hound
viral spire
#

three placed AI units.
Originally tried wrenches as targets

#

wrenches worked in sp and LAN.
This problem only occurs in a dedicated server environment.

viral spire
#

update, we also tried this but the issue still happens

[] spawn {
west reportRemoteTarget [t3, 3600];
west reportRemoteTarget [t4, 3600];
g2 doWatch t3;
waitUntil {t3 confirmSensorTarget [west, true]; g2 aimedAtTarget [t3] > 0}; g2 fireAtTarget [t3, "weapon_vls_01"];
sleep 16;
g2 doWatch t4;
waitUntil {t4 confirmSensorTarget [west, true]; g2 aimedAtTarget [t4] > 0}; g2 fireAtTarget [t4, "weapon_vls_01"];
};
willow hound
#

As far as I'm aware the VLS can only target instances of the LaserTarget* classes. Have you tried those?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

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

What would be a happy median for how long a sleep timer is for saving server data to a database?

viral spire
#

well the first part of the code is registering the target for it, and that works just fine in single player. I fail to understand why the target type would be a big issue depending on the environment it's running in

coarse dragon
#

how can one trigger a Pop up message when passing a Trigger?

#

a big pop up message across the middle of the screen

winter rose
#

such as hintC/BIS_fnc_GUIhint, blocking input, time or nothing?

#

there is BIS_fnc_guiMessage too, etc

flint topaz
#

Does anybody know what dialog/display this error message is I want to programmatically close these automatically as they are very irritating, as they interrupt my other scripts functions.

https://imgur.com/a/XNcoPDt

winter rose
#

why not fixing the issue instead?

flint topaz
#

cause this is arma

#

I am making a mod that will be public

#

I know 90% of mods have these kinds of errors, so finding a universal fix is easier

warm hedge
#

This is a fixable error

flint topaz
#

it's an example

warm hedge
#

What

flint topaz
#

I was just giving an example of the error message dialog

#

cause that error isn't even my mod

#

I was going to put a CBA option to allow developers to reenable the messages if they chose

#

but most players don't care about these errors or even know what they mean and just click close

flint topaz
#

thanks

tight nova
#

Does anyone know if it's possible to make ai respawn in vehicles?

Let's a tank gets destroyed, the tank might respawn, but what if I want the ai to respawn in it. That way they can continue to fight inside the vehicle.

#

Might anyone have a script exemple for this?

warm hedge
#

moveInDriver and other related commands teleports someone to a vehicle seat

tight nova
ornate whale
#

Is it faster to use setUnitLoadout or individual commands like addBackpack when randomizing whole inventory and gear? Thanks

kindred zephyr
#

it depends on your level of randomization I guess. For a fully randomized loadout I would suggest using setUnitLoadout

warm hedge
ornate whale
# kindred zephyr it depends on your level of randomization I guess. For a fully randomized loadou...

For example, I do this now with setUnitLoadout:

private _backpack = selectRandom (_loadoutPool#5);
if (isNil "_backpack" || {_backpack == ""}) then { _backpack = []; } else { _backpack = [_backpack,[]] };

It selects one backpack from the pool, then pre-processes it for the final command.
Currently, I donΒ΄t add items (first aid, frags) directly to specific containers, just freely with addItem.

warm hedge
#

I guess having multiple commands maybe slower if you want to randomize items as well

#

setUnitLoadout can take nil if you don't want to re-set other elements but backpack BTW

ornate whale
#

True, but when I have a nil variable in scheduled environment it throws an error when expanding the var.

kindred zephyr
#

speaking logic wise as polpox say, in this case multiple commands for giving the unit x or y is slower thna setting the loadout, but since you are only setting backpack for the sake of sanity it might be better to do the correspondent command since the difference is kinda negligible unless you are settings 100s of units in a row in short intervals

warm hedge
#

Huh?

#

How a nil usage on your end throws an error

ornate whale
#

myVar = nil;
doSomething myVar; //Undef var.

warm hedge
#

This is not what I suggested

ornate whale
#

Oh, OK

#

You mean just directly putting nil inside set...

warm hedge
#

I think I left a note in setUnitLoadout in BIKI's note

ornate whale
#

Yeah, now I get you, I know about this, read your note. )

#

Thanks for help.

naive needle
granite sky
#

I tested this once and I can't remember the result but I do remember being disgusted :P

naive needle
#

now I don't wanna test it , I'm afraid of getting disappointed

granite sky
#

Depends what you're hoping for

#

Hope is not a good idea with Arma.

viral spire
#

So can anyone help me out with explaining why the VLS targetting works fine in single player but is spotty at best in a server env?

#

The forums on similar issues is relatively useless

naive needle
# granite sky Depends what you're hoping for

I'm making a stream variable system, that only the player who needs the var gets it and if something getting updated the people who are in the streaming array gets it as well, so unique ids would be helpful but not totally needed

granite sky
#

Now wondering if the Antistasi arsenal and garage handle disconnections correctly.

#

Looks like garage yes, arsenal no

naive needle
#

What is wrong ?

granite sky
#

It doesn't handle disconnections :P

naive needle
#

yea I figured , but what in particular

granite sky
#

There's a system that maintains a list of machine IDs that are currently using the arsenal, but it doesn't handle the disconnection case, so the IDs stay there forever if a client disconnected while in the arsenal.

naive needle
#

so if the player connects again he is running into issues ?

#

or is the id not giving again to the same client

#

because then it dosent matter

granite sky
#

You're into the crazy spaghetti at that point :P

naive needle
granite sky
#

I'm not sure what arma does if you remoteExec to a machine ID that doesn't exist.

#

Probably some completely opaque RPT bitching.

naive needle
#

so you are telling me I should remove the ids from the array ?

granite sky
#

On disconnection? Yes.

naive needle
#

Im using it for setVariable but I guess same sh*t

#

@still forum do you know what happen when using an machine id (which is not on the server anymore) with remoteExec or Setvariable ["",true,[offline machine ids]]

still forum
#

no

#

please don't ping

meager granite
#

More precisely:
Each new join to the server = new id

#

If you simply go back to lobby and start again, id remains

#
11:33:08 492259 :: PlayerConnected: id=1178788558 uid=76561198018221755 name=Sa-Matra (2) owner=4
11:33:12 492489 :: PlayerDisconnected: id=1178788558 uid=76561198018221755 name=Sa-Matra (2) owner=4
--- going back to lobby and joining again ---
11:33:31 494263 :: PlayerConnected: id=1178788558 uid=76561198018221755 name=Sa-Matra (2) owner=4
11:33:36 494596 :: PlayerDisconnected: id=1178788558 uid=76561198018221755 name=Sa-Matra (2) owner=4
--- leaving the server and joining again ---
11:34:00 496590 :: PlayerConnected: id=1872275161 uid=76561198018221755 name=Sa-Matra (2) owner=5
11:35:25 504552 :: PlayerDisconnected: id=1872275161 uid=76561198018221755 name=Sa-Matra (2) owner=5
tight nova
warm hedge
tight nova
warm hedge
#

I see

#

Using moveInDriver etc commands is not that hard. But you still need to know a bit of basics to utilize them. Maybe I'll back in an hour so I can focus there

faint trout
#

Heya all, is there any good Video/Tutorial Series which you can recommend for learning how to make your own Weapons? πŸ™‚

willow shore
#
    params["_object"];
    while {true} do {
        drop [
            ["\A3\data_f\ParticleEffects\Universal\Refract.p3d",1,0,1],
            "",
            "Billboard",
            1,
            3,
            [0,0,0],
            [0,0,0.4],
            0, 0.005, 0.003925, 0.1,
            [2, 3],
            [[1,0,0,0.5], [0,1,0,1], [0,0,01,0.25]],
            [1],
            0,
            0,
            "",
            "",
            _object,
            0,
            false,
            -1,
            [],
            [0,1,0]
        ];

        _closestObj = nearestObjects[_object, [], 10];
        _effectHandle = ppEffectCreate ["chromAberration", 200];
        _effectHandle2 = ppEffectCreate ["radialBlur", 100];
        
        if (player in _closestObj) then {
            _effectHandle ppEffectAdjust [0.05,0.05, true]; 
            _effectHandle ppEffectCommit 3;
        
            _effectHandle2 ppEffectAdjust [1,1,1,1]; 
            _effectHandle2 ppEffectCommit 3;
            
            _effectHandle ppEffectEnable true;
            _effectHandle2 ppEffectEnable true;
            
        } else {
            _effectHandle ppEffectAdjust [0.0,0.0, true];
            _effectHandle ppEffectCommit 10;
            
            _effectHandle2 ppEffectAdjust [0,0,0,0];
            _effectHandle2 ppEffectCommit 4;
        };
        sleep 0.5;
    };
};```
I'm curious, why does the ppEffect work for one object, but not if I have the code on multiple?
#

I'm clearly doing something wrong but not sure what, and the wiki documentation is not clear to me.

winter rose
#

I would wager the effect ID is already used

willow shore
#

the effect ID? Sorry I'm not familiar with the terminology

#

"chromAberration"?

winter rose
#

the "200" and "100" part

willow shore
#

Ohhh I understand

#

priority: Number - unique priority, defines order of applying effect to the scene. If there is another effect using the same priority, creation will fail

so if both objects are using "200" then the second one will fail to create its PPE.

winter rose
meager granite
#

What if we had NUMBER = NUMBER * BOOL

winter rose
#

please no

south swan
#

Reforger: "Hold my beer"

winter rose
#

yyyyyyeah, let's say we try to avoid such horror as much as possible πŸ˜‚

warm hedge
#

false = true

winter rose
meager granite
#

#define false true

bleak nebula
#

@fair drum Sorry to bother you mate but I'm using your enhanced modules mod, specifically the Effect - Lightpoint module. If placed a hangar that has no vanilla lighting in there so have used the module to add lights. The issue I'm having is the lights flicker and sometimes don't show up at all on our server. It's happening for everyone regardless of graphics settings. What am I doing wrong or is this just an arma thing because I've used a few?

hallow mortar
#

Arma isn't great at dynamic lights in general (you can see streetlights flickering sometimes, for example) and IIRC there's also a limit on the number that can be displayed at once

flint topaz
#

can't remember the exact number, but it's not a huge number I think it's around 50 or so

still forum
#

64 since we increased it in an update. I have 128 but we didn't release that

fast igloo
#

Can someone tell me if this is correct?

car1 animate ["BeaconsStart",1];car1 animate ['DLA', 0];car1 animate ['clamp', 1];car1 animate ['clamp1', 0];car1 animate ['clamp2', 0];car1 animate ['clamp3', 0];car1 animate ['clamp4', 0];car1 animate ['clamp5', 0];car1 animate ['clamp6', 0];car1 animate ['clamp7', 0], car1 setVariable ['ani_siren',0.2,true];

#

_
_
_
_
Everytime i execute it in my trigger it says missing ;

proven charm
fast igloo
indigo wolf
#

how i make sure all damage to one specific vehicle is reduced by 80% but not invisible?

indigo wolf
#

so i modify only _damage variable yes?

proven charm
fair drum
indigo wolf
#

like _unit setDamage (_damage / 8) or _damage = _damage / 8

proven charm
stable dune
bleak nebula
# fair drum Which hangar are you using? Like Nikko said, lights are a pain. How close is the...

I'm not sure on the hangar class name but it's the modern looking one with the sliding doors. I've placed the module above the ceiling light as that way the light flare sits where the bulb is and the light cone illuminates the light fitting. If that is my issue then I can fix that as I don't have anywhere near the 62 dedmen mentioned unless this includes lights already on the map.

fair drum
bleak nebula
#

Bala Murghab but i placed the hangar.

#

It's got loads of objects in there all custom placed so maybe something like that?

ornate whale
#

Is there any reasonable way of making a random patrol path in a base with manually placed objects? When using bis_fnc_taskPatrol.sqf, they usually get stuck, or just go between only two points, or walk too far away, or just stand doing nothing. And CBA patrol module keeps to generate simialr paths for different groups.

naive needle
#

sending hashmaps over network is still not really useful or is it ?

sullen sigil
#

its a bad idea if its a big one

meager granite
#

I use and send a ton of hashmaps over network

#

They're mostly small (<10 keys) though

naive needle
#

ok so no big hash maps , interesting

winter rose
turbid nymph
#

if anyone could help me with this i would really appreciate it! Im tryna make a sorta attendance list that i export through a ui that i already got to work, but i got a problem. this is my code in the init.sqf file of my mission right now :

Maple_AttendanceList = [];
publicVariable "Maple_AttendanceList";

addMissionEventHandler ["PlayerConnected", {
    private _currentPlayers = allPlayers - entities "HeadlessClient_F";
    {
        Maple_AttendanceList pushBackUnique (name _x);
    } forEach _currentPlayers;
    publicVariable "Maple_AttendanceList";
}];

im trying to make a global list that updates whenever a player connects and it adds the player's name to the list if its not already there. It does not seem to want to add names reliable however. Any help or insights would be really nice. Thanks!

#

not sure if its a problem of the value not being sent to all clients

proven charm
granite sky
#

Issues would be whether allPlayers is updated at that point, or name exists on the player object yet.

#

params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
Should give you the name of the connecting player as _name

#

(within the PlayerConnected event handler)

coarse parcel
#

can anyone lend a quick hand ```findPistolInInventory = {
private _inventory = _this select 0;
private _inventoryItems = _inventory select 1;
private _foundPistol = [];

//diag_log text format["SURRENDER: Searching Items: %1", _inventoryItems];

{
    private _itemData = _x select 0;
    private _itemClass = _itemData select 0;
    //diag_log text format["SURRENDER: Checking item class: %1", _itemClass];
    if (getNumber(configFile >> "CfgWeapons" >> _itemClass >> "type") == 2) then {
        _foundPistol = _itemData;
        diag_log text format["SURRENDER: Weapon retrieved: %1", _foundPistol];
        exitWith {};
    };
} forEach _inventoryItems;

_foundPistol;

};```

searching though different inventories (vest, backpack etc). and searching for a pistol. It all works, but I keep getting an error over the exitWith{}

perhaps I've misused the function but when a valid pistol is found, I'm looking to break the loop and return the item

little raptor
#

Just write break instead

coarse parcel
#

is that a thing.,..

little raptor
#

exitWith only works with if

coarse parcel
#

wonderful, I didn't know if that was an expression in sqf

little raptor
#

Or you can also write if (getNumber...) exitWith instead of then

little raptor
winter rose
#

although "recent", it still came with v2.02 πŸ˜„

#

(Feb 2021)

hallow mortar
#

2021 was last year so that's pretty recent

kindred zephyr
#

4 days ago

fair drum
#

COVID feels like yesterday

sleek pike
#

im new to arma scripts, how can i put a script in? eg: full screen night vision

https://forums.bohemia.net/forums/topic/216483-full-screen-night-vision-no-mod-required/

young current
#

it describes how it is used

sleek pike
#

i dont see whare it says it?