#arma3_scripting

1 messages · Page 85 of 1

graceful kelp
#

so what would be 10 degrees elevation, if i rolled 90 to the right would become 0 elevation and 10 degrees azimuth

granite sky
#

Probably something like this then:

_targDir = _heli vectorFromTo _target;
_zdist = _targDir vectorDotProduct vectorDir _heli;
_ydist = _targDir vectorDotProduct vectorUp _heli;
_elevAngle = _ydist atan2 _zdist;
#

You can start from vectorDiff rather than vectorFromTo, doesn't matter if you only want the angle.

graceful kelp
#

il give this a go, i only recently started messing with vectors and dont have alot of need to learn from them, thanks for the help so far

#

so im not the best at understanding how they work

granite sky
#

Dot products are very useful. If you take the dot product of a vector with a unit vector (like vectorDir or vectorUp), it gives you the component of the vector in that direction.

graceful kelp
#

i feel like vectors are an incredibly usefull thing to know, but learning them twists my brain

#

to get the azimuth would i just invert the atan2 inputs?

granite sky
#

Nah, you need the third component for that, which is a bit of a pain.

#

(there is no vectorRight)

graceful kelp
#

hmm

granite sky
#

Working from the previous code:

_vectorRight = vectorDir _heli vectorCrossProduct vectorUp _heli;
_xdist = _targDir vectorDotProduct _vectorRight;
_aziAngle = _xdist atan2 _zdist;
#

Might be backwards.

graceful kelp
#

My god man thank you

graceful kelp
granite sky
#

_xdist = sqrt (1 - _ydist^2 - _zdist^2); might also work.

#

(only if _targDir is from vectorFromTo though, not vectorDiff)

analog inlet
#

im still having issues with this, the settings arent being forced on the players

analog inlet
#

just did some more googling and gonna try the userconfig method, the lad before told me to put them in my mission and add a setting to the description.ext

molten yacht
#

Is there a command to get the birds, crickets, etc to shut up

#

relatedly, is there a way to make a place act like it's inside even when it's not (i.e. no rain in here)

molten yacht
#

oh good

molten yacht
#

is there a good way to teleport people to a radius so they don't all stack into each other like they're trying to telefrag

robust brook
#

You can do a random 1 or 2 an add to set for both the x and y of a central pos and should work

tough abyss
#

I am using alive modules to spawn units dynamically.

But for some reason I can't add eventhandlers for the spawned units?

class Extended_Init_EventHandlers {
class Man {
init = "_this call (compile preprocessFileLineNumbers 'my_script.sqf')";
};
};

dreamy kestrel
#

anyone got any pro tips handling png to paa image conversions correctly? so far I have tried:

  • resolution 32x32
  • using paint.net, let it auto-detect bit+transparenty
  • coupled with tex viewer, seems to find it okay and convert to paa
  • but in game getting errors:
 0:23:58 Warning Message: Cannot load texture res\openfolder_32x.paa.

trying to load it in a picture button...

manic kettle
dreamy kestrel
#

still does not work

#

do I need to be sure it is not in 32-bit png? or rather 8-bit? 24-bit seems out since the transparency thing gets dropped.

dreamy kestrel
#

are there any border issues with PAA images, I seem to vaguely recall something like that...

molten yacht
#

Is there a way to get a thing to behave like an old 2d sprite, where it always faces the player

warm hedge
#

Fixed to the screen or 3D? Guess latter

molten yacht
#

3d

#

just floating in midair. standing there. menacingly. :P

warm hedge
#

Particle is a thing. Making custom one requires some struggle though

#

Or... you may can do a script so an object that looks at you

molten yacht
#

localized in MP tho?

warm hedge
#

Local Object is a thing too

molten yacht
#

I need to learn particles anyway to make a shimmery air effect...

still forum
little raptor
sullen sigil
#

np

#

i would probably rewrite to be unscheduled due to a burning hatred for the scheduler but its w/e

boreal parcel
#

how do you create the ELLIPSE area marker? tried this but no success, checked the mission.sqm and the ELLIPSE doesnt seem to have a type like normal markers

_marker = createMarker [format["%1_ellipse", _x], getMarkerPos _x, 1];
_marker setMarkerSize [TRA_milCaptureRadius, TRA_milCaptureRadius];
_marker setMarkerType "ELLIPSE";
_marker setMarkerColor "ColorWEST";
_marker setMarkerText "test";
#

I get marker type not found

#

color and text appear correctly

finite bone
#

Is it possible to make hostile forces not engage a player and their group without changing the player's side or messing with the side relations?

granite sky
#

@boreal parcel "ELLIPSE" is a shape, not a type.

boreal parcel
#

probably disable auto combat

boreal parcel
#

Oh neato, thanks guys

#

that worked fine

granite sky
#

Common method of doing undercover is to use setCaptive on the player, but that is a side switch, kinda.

finite bone
#

Yea sort of like an undercover mode of players in one region while the others fight as usual.

granite sky
#

It makes the player temporarily civilian-side.

molten yacht
#

Is this also the channel for particle scripting?

sullen sigil
#

that is part of scripting

#

(so yes)

boreal parcel
#

is there a way to make the player respawn via respawn_west markers take into account height of the marker? trying not to have players spawn in/under objects I place in editor

hallow mortar
#

I don't think you can change the basic behaviour to adjust for that, but you can make a pretty simple respawn EH that just corrects the unit's height immediately on spawning

boreal parcel
#

That will have to do then

manic kettle
polar belfry
#

hello I have a question
with attachtorelative if I attach something to a ramp of a vehicle will the attached item follow the ramp?

pulsar bluff
#

try it out

gaunt tendon
#

what are the ptsPerSquare... for in RscMapControl?

hallow mortar
gaunt tendon
winter rose
#

that's all we know

stark fjord
#

The sacred texts

wary sandal
#

Do OnEachFrame arguments get serialized?

#

whenever I restart a saved mission, the _counter variable returns at 0

addMissionEventHandler ["EachFrame", {
    _thisArgs params ["_counter"];
    _counter = _counter + 1;
    _thisArgs set [0, _counter];
}, [0]];
still forum
#

Huh. I think they don't actually

#

Interesting. Should be bug but fixing that? Eeehhh

wary sandal
#

any workarounds?

#

I'm thinking of using a hashmap instead as a sole argument

still forum
#

Use a global variable

wary sandal
#

so that it gets saved in memory

wary sandal
still forum
#

That's a lie

#

A bit slower yeah but not way

#

Also returning to zero is unexpected actually

#

If it wouldn't serialize, it would not be there at all...
Doesn't quite make sense. Something weird going on there

stark fjord
#

His argument is 0

still forum
#

Yes, that's what his code says

boreal parcel
#

actually I see now how it handles respawn, I might be able to instead pass an object

warm coral
#
_text = [
      "Could %1 come with us, please?", _unit,
      "%1, step out the vehicle and follow us, please.", _unit,
      "We need %1 to follow us for a moment.", _unit,
      "Hey %1, follow us please. No need to worry, we just need to talk about something.", _unit,
      "%1, get out and follow.", _unit,
      "Hey Mr. %1, please follow us. We need to check something.", _unit
  ];
#

anyone know why this doesnt work?

#

i called it by randomization

#

[[name _attachedObject, selectRandom _text]] remoteExec ["BIS_fnc_EXP_camp_playSubtitles"];

fleet sand
#

you are mixing strings and objects in arrray

warm coral
#

wait i should probably show what _unit is as well

#

oh

#

how would i get the name of a unit to appear instead of %1?

hallow mortar
#

format

granite sky
#

Each line is probably supposed to be wrapped in a format []

warm coral
#

ohhhh that makes sense

#

ill try

#

and it should probably be name _unit right?

hallow mortar
#

Remove all _unit from the array, and instead of selectRandom _text use this:

format [selectRandom _text,name _unit]```
warm coral
#

formatting seems to work now but the name shows as a space

#

what im trying to do is grab a random player name for the officer to say

#
    _unit = playableUnits call BIS_fnc_selectRandom;
#

so im guessing this aint correct?

#

preferably i would like opfor players to be selected

winter rose
fallen juniper
#

Question, Is there a way to restrict arsenal access to certain groups?

For example, I have three groups USMC, Army, BAF but want each group to only be able to open their assigned arsenal

stable dune
warm coral
#

works like a charm

#

thank you all for the help

granite sky
#

@fallen juniper The "AmmoboxInit" mode has a condition parameter that you can use to control accessibility.

little raptor
little raptor
#

yeah they do get serialized too

#

btw where does the game store the saves for temp (unsaved) missions?

#

ah UserSaved folder

wary sandal
#

when I wanted to shorten and removed the unrelevant parts I forgot to write _thisArgs

little raptor
#

well I tested it and the serialization seemed to work fine too

#

tho I simply loaded the save while running the misison (I didn't close it). but I don't think it would make any difference if I closed it

eternal snow
#

I'm attempting to call HALs give funds script to MP sector capture. Do I add the thisList call sqf to the sector init or do I need to add it to a trigger and event handler?

true frigate
#

Anyone know why fadeSound might not be working? I'm using 0.1 fadeSound 0; and no volume changes happen whatsoever.
It's worth noting, I'm using ACE. I only say this because when I've used it before, the tinnitus effect still works when Sound is at 0.

high marsh
#

is there any macro that points to the mission root when using #include ?

#

not that it'll ever change unless it's unpacked and changed. But I like to not type as much I'm lazy 🙃

#

also do editor regions mess with the compiler at all?

little raptor
little raptor
high marsh
#
/* #region MyBlahRegion */

/* #endregion */
#

Compiler as in however SQF gets interpreted?

little raptor
high marsh
#

I know it doesn't get compiled to native code but it's certainly interpreted by the game in some fashion right?

little raptor
high marsh
#

Oh haha 😄

#

wrong verbage my bad lol

high marsh
#

with setAnimSpeedCoef am I correct in assuming that because it's effect is local, I would need to broadcast to other players the change in anim speed?

#

and I can use the target unit in remoteExec to broadcast these local effects to other machines?

little raptor
high marsh
#

correct. remoteExec target is all the machines, but the code executed with remoteExec has the local unit as a argument

#

just curious if that's possible, there seems to be some local effects commands that just don't have the programmed logic for it.

boreal parcel
#

what is the best way to go about a "respawn" script? for vehicles I mean.

The first thing to come to mind for me is basically a while loop, basically while (alive _veh) do { sleep 10; };

and then once the loop breaks sleep for the time it should take for the vehicle to respawn, and create a new vehicle at some position.

Is there a way to go about this maybe without loops and sleep?

#

mainly asking out of curiosity

hallow mortar
#

A Killed EH or entityKilled MEH would be one way.
There is also a vehicle respawn module in the Editor although I'm not sure what its limitations are.

boreal parcel
#

iirc that module is broken, it certainly was when I used it

#

but yeah can a killed event handler be added to a specific object?

#

I figured killed/entityKilled was a mission eh that fires on any killed object/unit

hallow mortar
#

Killed is a normal EH, entityKilled is a mission EH

pulsar bluff
boreal parcel
#

Hmm thats true in certain scenarios yeah. Though the scenario I may use this information in will have a vehicle cleanup every 2 hours

hallow mortar
boreal parcel
#

which is another question of mine, whats a good way to go about repeat tasks like that? like how should I run a function every 2 hours for example

hallow mortar
#

If you plan to use EHs and to rely on vehicle cleanup, you'll need a deleted EH too as killed doesn't detect deletions

boreal parcel
#

oo another scenario I didnt think of

pulsar bluff
#

from my experience a killed EH is not the best tool for vehicle respawn. not sure about now but some death events didnt trigger killed EH.. such as helicopter sinking underwater

#

so vehicles can become “dead” but not trigger killed EH

#

new drowned event handler in 2.14 might solve that tho

hallow mortar
#

Anyone who sinks a helo without being shot down first deserves to wait for the wreck to be cleaned up anyway

boreal parcel
#

neat, I guess I could manage with an entityKilled eh and attaching a variable for respawn time, then just check for that variable whenever something dies

#

probably with some more data in variables regarding where to spawn it etc

pulsar bluff
eternal snow
#

can anyone tell me how to make a sector module capture trigger a simple give money script?

pliant stream
#

object event handlers: add at initialization and check condition, or add and remove as needed?

dreamy kestrel
twin oar
#

With the WL modules, can players earn CP for completing tasks like side missions?

tough abyss
#

Imo removeEventhandler and especially removeAction are overused.

#

Check condition

still forum
tough abyss
#

Even if the action shouldn't be available for the rest of the mission. It's simpler to just deactivate it with the condition

hollow vessel
#

Hey, not sure whether it belongs to mission makers channel or here...
What happens when you for example have lots of mines and you show them once players are nearby with the show/hide module, a player steps on it, it gets hidden again when out of trigger and then goes back into the trigger, does it reset the mine to its default pristine state or does it stay destroyed?
And is it actually good practice to do show/hide depending on vicinity?

#

I usually init them disabling damage, simulation and visibility

versed belfry
warm hedge
#

Not much is different between two. But it is always recommended to use the alt syntax of cutText nowadays, so you will not accidentally overwrite a third party resource

versed belfry
#

👍

little raptor
still forum
#

Any pragma

#

not sure if documented

cosmic lichen
still forum
#

ah its not on wiki

cosmic lichen
#

I requested that quite a while ago and forgot about it notlikemeow

little raptor
still forum
#

just gets ignored

stark fjord
#

So preproc ignores all pragma?

still forum
#

yes

stark fjord
#

So its just an invalid command like #lol

still forum
#

no

cosmic lichen
#

That would error i guess

little raptor
stark fjord
#

Right

#

Are #error and #warning supported?

little raptor
#

You can also just make a macro for it if you don't like it: BOOL(x) (x != 0)

manic sigil
#

Alright, scripting practices question.

I have a while-loop that, aside from some other unimportant-to-this-question function, essentially tells a helicopter to move to a location, slow down on approach, land, then return to its starting location, each done with a waitUntil.

What I have to exit the loop works, but feels clunky - essentially every waitUntil has to include all the fail states, followed by an if (failstate) exitWith{}.

Is there a better way to handle interrupting a loop like this?

winter rose
#

you could have a minifunction that returns true or false eventually

#
private _shouldExit = { not alive driver _heli or not canMove _heli };

waitUntil { sleep 1; call _shouldExit || _heli distance _destination > 5 };
if (call _shouldExit) exitWith {};
little raptor
#

While? meowsweats

winter rose
little raptor
manic sigil
manic sigil
cosmic lichen
winter rose
#

I don't like macros

cosmic lichen
#

whut

#

macro is love

warm hedge
#

Macros don't too

cosmic lichen
#

this

winter rose
#

it's coarse and rough and irritating — and it gets everywhere

#

oh wait, wrong franchise

cosmic lichen
#

Talking about your crab lice again?

winter rose
#

we said we wouldn't talk about them nor where we got them!!

cosmic lichen
#

we I you

#

ah well, that could be misunderstood as well.

stark fjord
#

Sounds like std

manic sigil
sullen sigil
#

ive macrod my entire units config

#

there is not a single entry that is not a macro

manic sigil
#

I just know id pick an absolutely stupid macro name and get myself into piles of trouble.

sullen sigil
#

one macro for uniforms does make life super easy too

stark fjord
#

Macro is just replace x with y as in any text editor eg

#define yes true
if (yes) exitWith {};
//translates to
if (true) exitWith {};
#

Ofc you can make them more complex with accepting arguments, but in a nutshell all it does is tell pre processor to replace any macro keyword with macro definition in file

manic sigil
#

Thats about where my comprehension ends; replacing one word with another, sure - but replacing whole scripts with one phrase just feels wrong. I dunno.

#

Which I get, thats what a function is in essence xD

stark fjord
#

You can do some fun stuff like #define true false

still forum
stark fjord
#

Ussualy used, if you have some repetitive stuff that you dont want to function, but still want to write shorter. Was more used when cpu speed is limited, as every jump to function could cause unwanted delays etc. Dunno how much of a factor that is with sqf.

winter rose
manic sigil
#

Had me legit wondering if 'enddebug' was a command needed 😭

stark fjord
#

No its just };

manic sigil
#

Yeah, had to read twice

stark fjord
#

Is __VA_ARGS__ in?

hallow mortar
stark fjord
#

Also that. But scriptwise

sullen sigil
#

ive never used macros in scripting i dont think

#

i just copy paste

winter rose
#

that's usually bad

sullen sigil
#

its only like one or two instances where i need to make some minor changes too

#

else i just write a function

#

macroing function config and having the function header vscode stuff makes it make more sense to me

stark fjord
#

Well macro is copy paste replace in a sense. Just that you let machine do that. Instead of doing it manually

sullen sigil
#

copy paste with more setup

stark fjord
#

Well #define name is the only setup

#

Anyways, its a tool, you can use it or not. Thats completely down to you. End result is the same

#

It can cause code to become unreadable, or it can remove walls of text. Depends on usage.
Just like NikkoJT mentioned, adding mags in config.

sullen sigil
#

my unit mods entire config is macro

#

not a single entry in config.cpp aside from class cfg[...] that isnt a macro

still forum
stark fjord
#

Well if one is missing, there could be more 😉

tender fossil
#

(Arma 2: OA v1.64) Before I make a larger architectural change, any idea how expensive is sending pV from client to server and back to clients compared to simple setVariable change by the clients? I'd like to refactor some code, but I'm also a bit afraid of that I'd create noticeable extra traffic since the related functions get called quite often (very roughly put, 0-20 times per second) and server has lots of other stuff to sync as well

#

The pV would contain noticeably more data than the simple setVariable change too

winter rose
#

0-20 times per second
do not pV that

wet geode
#

Is there a way to make this marker removeble by players?

_marker = createMarker ["marker", player, 1, player]; 
_marker setMarkerType "hd_dot"; 
_marker setMarkerColor "ColorGreen";
winter rose
#

hmm, not that but it's possible

#

_USER_DEFINED should work

wet geode
#

So _USER_DEFINED_marker = .....?

winter rose
#

no
like```sqf
createMarker ["_USER_DEFINEDMySuperMarker", player, 1, player];

wet geode
#

Ok thanks, will try

wet geode
# winter rose no like```sqf createMarker ["_USER_DEFINEDMySuperMarker", player, 1, player]; ``...

Ok I now have this:

_x = createMarker ["_USER_DEFINEDMySuperM", player, 1, test]; 
_x setMarkerType "hd_dot"; 
_x setMarkerColor "ColorGreen";

But it only works once, I am guessing that is because it dose not create unique variable every time any solutions.
PS I have tired

_pos = getpos player;
_x = createMarker ["_USER_DEFINEDMySuperM" + str _pos, player, 1, test]; 
_x setMarkerType "hd_dot"; 
_x setMarkerColor "ColorGreen";
winter rose
#

1/ don't use getPos for this (getPosWorld is much faster)
2/ don't use _x which is a more or less reserved magic variable
3/ test is provided as the marker's creator here

wet geode
#
_pos = getPosWorld player;
_marker = createMarker ["_USER_DEFINEDMySuperM" + str _pos, player, 1, player]; 
_marker setMarkerType "hd_dot"; 
_marker setMarkerColor "ColorGreen";
```So something like this?
winter rose
#

something like this

#
private _marker = createMarker ["_USER_DEFINED " + str (getPosWorld player apply { round _x }), player, 1, player];
if (_marker == "") exitWith {};
_marker setMarkerType "hd_dot";
_marker setMarkerColor "ColorGreen";
#

that should allow one marker per meter, if you like it (the apply round _x part)

wet geode
#

Tanks

#

It works!!!!!

tepid vigil
#

How do extensions work with Linux? I am considering turning some scripts in my server-side mod to extensions for performance, but they need to be able to run on Linux

still forum
#

What do you mean how?
The same I'd say

tepid vigil
#

As in do I need different compile targets or some other special considerations, or are the dll's fine

dreamy kestrel
#

Q: are there any limits to the call stack? I know I must be a few functions deep, is there a way to easily tell this, diagnostic or something? or just have to install a var or something to do some counting?

stark fjord
stark fjord
tepid vigil
#

So if I want both the windows and linux versions with no 32-bit, I'll just compile the .so library version for Linux and .dll library for Windows

stark fjord
#

Ye

dreamy kestrel
# stark fjord You could call recursive function and log depth...

well sure, I know this much... I've got an EH chain that is resolving, but toward the end of the expected functions, I see no evidence that the last one(s) are being invoked... got them logging and everything, so I wonder maybe I need to spawn the last one or something...

#

but beyond that, is there an A3 call stack limit? 8? 16? 32? etc...

still forum
dreamy kestrel
#

would be helpful thanks

#

diag dump?

#

stacktrace, I see, thank you

#

ah I see what happened, undefined #define expected results... thanks...

#

and success.

little raptor
still forum
#

except in unscheduled

#

if you do something that doesn't just use the stack

#

like isNil/remoteExec

little raptor
#

Interesting. What's the limit then?

still forum
#

stack memory

little raptor
#

Does Arma use 1 MB for stack?

still forum
#

more I think

granite sky
#

We accidentally discoverd that you can crash Arma by recursively adding event handlers. Takes a few seconds.

proven charm
#

or infinite recursion in some EHs

manic sigil
versed belfry
#

Hello again :D

I'm having a small issue with the following script:
https://github.com/SkippieDippie/A3A-Event-Standard-Files/blob/Nomas_dev/A3AEventMissionBase/initScripts/initDisclaimer.sqf

The issue being that when I execute the script in the debug console either as a file or just take the code and execute it, everything works fine.

But when the code is executed in initPlayerLocal.sqf at the start of the mission, the timing gets fucked for some reason, it's almost like it ignores 1 or 2 of the sleep statements when it's the first time loading into the mission.

Am I missing something obvious here? I haven't slept in a good while trying to get this to work, so it's quite the possibility 😐

The exact issue is:
"Second text..." starts appearing before the large text is fully gone when executed in the way mentioned above.

GitHub

A3 - Antistasi Event team mission base setup. Contribute to SkippieDippie/A3A-Event-Standard-Files development by creating an account on GitHub.

sharp grotto
twin oar
#

How do I get the supports to work on a live server, the artillery, air taxi, and CAS?

#

Not finding much.

abstract girder
#

is there a way to force functions declared in cfgFunctions to be put into the localNamespace instead of the missionNamespace? i have server functions the client would never have any need for.

sullen sigil
#

why change the namespace? thonk

abstract girder
#

things in localNamespace can't be broadcast across the network

#

at least that's how i understand it, could be wrong

sullen sigil
#

if you're concerned about the players accessing those functions, just make a server side only pbo -- they'd still have the functions on their local copies otherwise

#

if you need to prevent use from anything that isnt the server, if (!isServer) exitWith {};

abstract girder
#

i do this already but theoretically a malicious actor with code execution could still access these functions because they can be broadcast across the network

sullen sigil
#

if said malicious actor has that level of capability your function being broadcast across the network is the least of your worries

abstract girder
#

well i have most commands that could allow disruption to gameplay disabled - i can't really disable commands that would allow for the snatching of my server functions in the same way without neutering most of my scripts so having them in localNamespace would mitigate my problem well if possible

sullen sigil
#

if you are concerned about your scripts being stolen, have the modification only on the server

abstract girder
#

a malicious actor could still retrieve them using remote execution

sullen sigil
#

then disable remoteexec and use cba events system 🤷
or just dont use cfgfunctions and define the functions on the servers localnamespace manually

abstract girder
#

i've seen people do that method outside of cfgfunctions and suffer performance wise i'll have to look into cba events

sullen sigil
#

eh? it's no different, cfgfunctions is just protecting it

sharp grotto
#
{
    private _code = '';
    private _function = _x select 0;
    private _file = _x select 1;
    private _code = compileScript [_file];
    missionNamespace setVariable [_function, _code];
}
forEach 
[
    ['YourCustom1_fnc','YourServerPbo\code\YourCustom1_fnc.sqf'],
    ['YourCustom2_fnc','YourServerPbo\code\YourCustom2_fnc.sqf']
    
];
little raptor
abstract girder
#

how can you retrieve them?

granite sky
#

Given arbitrary remoteExec capability you can run whatever you like on the server with call or spawn.

#

If you don't have arbitrary remoteExec capability then I'm not sure how you can retrieve data from missionNamespace on the server either.

abstract girder
#

not with a properly configured CfgRemoteExec - which i guess solves my problem

#

the scenario i'm interested in mitigating is someone remoteExecing something along the lines of

everything = allVariables missionNameSpace;
publicVariable "everything";
#

if i had some important functions in localNameSpace it'd prevent the publicVariable from happening (as i understand it)

#

there's plenty of ways around this but if it were something that were possible i just like putting up as many roadblocks to stop malicious people

#

actually it wouldn't even stop the publicVariable because it'd already be in that other var - do'h - oh well

#

thanks everyone anyway 😆

molten yacht
#

With cfgRespawnInventories, is there a way to add a custom role to someone and just have it grab all loadouts associated with that role

versed belfry
simple trout
#

Yes

#

Your issue might be related to init timing

#

Maybe have that script spawning during mission start when everyone has login in and waiting for debrief

versed belfry
#

Or do you mean something else entirly that I am misunderstanding?

simple trout
#

You have access to the debug console during an event no?

#

Just call the function manually once you think it's an appropriate time to bring up the notification

versed belfry
#

Also the aproperiate time is usually as we load in where you start in the black screen and fade into whatever the view is

simple trout
#

Then make sure it's the last thing that's done in initPlayerLocal

#

And spawn it from there

versed belfry
# simple trout Then make sure it's the last thing that's done in initPlayerLocal

Oki, let me try that, as of right now this is what's in initPlayerLocal.sqf:

/*---------------------------------------------------------------------------
Title
    The code in this file is executed locally when player joins mission.
    For more info see https://community.bistudio.com/wiki/Event_Scripts#initPlayerLocal.sqf
    
    Parameters:
    0. OBJECT: the player's object
    1. BOOL: if the player Joins In Progress, the parameter returns true, otherwise false
---------------------------------------------------------------------------*/
params ["_player", "_jip"];

#include "initScripts\initScripts.sqf";
#include "initScripts\initDiary.sqf";
#include "initScripts\initDisclaimer.sqf";
#include "initScripts\initEquipment.sqf";
#

I'll try switching the initDisclaimer.sqf and initEquipment.sqf around to see if that helps.

simple trout
#

Nah that shouldn't be a problem

versed belfry
simple trout
#

No, do try to switch them first

#

I was talking about the includes

versed belfry
#

Ah oki

simple trout
#

Wait this isn't in a gui is it?

#

If it is you will need to use uisleep instead of sleep

versed belfry
#

Uhhhhh...

||[The statment above translates to: I got no clue >_>}||

simple trout
#

I would recommend you at least try it

versed belfry
#

Replacing all sleep statements with uiSleep right now, all beside the one inside the waitUntil

simple trout
#

You can also make that a uisleep

#

uisleep is just a fancier sleep

versed belfry
#

👍

versed belfry
#

Will come back with results in bit, turns out there is a final exam in 20 minutes ago >_>

versed belfry
#

Ok crisis avoided

versed belfry
molten yacht
#

Hmm.... What is the correct way to say "this is an empty array" when using setVariable?

#

missionNamespace setVariable ["wraithUnits", [] ,true];? [[]]?

#

[""] ?

#

The array might stay empty or it might have units added later.

molten yacht
#

So the way I had it?

little raptor
#

Yes

molten yacht
#

okay, thanks

warm hedge
#

[] <- an empty array
[""] <- an array with an empty string
[[]] <- an array with an empty array

molten yacht
#

Oh, I see.

#

And for a unit meant to insert itself into that array with its init field. Would that just be sqf wraithUnits insert[-1,this,true];
or do I need something else to push the change into the missionNamespace?

little raptor
#

Use pushback

#

But the array must be set at preInit if you want to use it at init

molten yacht
#

hmm

#

it's just the one unit, I thought pushback was for arrays...

#

And I need to look up that one chart that shows all the uh

#

which order things are executed in.

little raptor
molten yacht
#

Okay, thanks.

molten yacht
#

These units won't be spawning anywhere near players, so there's no chance of them peeping the horror early.

little raptor
#

you can't suspend init fields

molten yacht
#

Oh, damn.

#

Hmm. Can an init field call a function that does suspend?

winter rose
#

one thread per unit, yayyy

molten yacht
#

Yowch.

#

Even with only planning to have about 8 of these things, that's enough to make me squint.

#

I may be better off hardcoding all the starter ones and then spawning the rest in by script later.

little raptor
#

locally?

molten yacht
#

It's a global array of units that are invisible (and intangible) through night vision / thermals

#

normally this behavior isn't ideal, but in this case it's part of the story

little raptor
#

then I guess locally?

molten yacht
#

There's a script that checks every frame executed locally, yeah

#

but the list of the units needs to be shared across all the clients

little raptor
#

then you don't need to broadcast it. you can simply do this:

if (isNil "wraithUnits") then {wraithUnits = []};
wraithUnits pushBack this;

in init fields

#

but the list of the units needs to be shared across all the clients
why?

#

it's local

#

they all use the same units don't they?

molten yacht
#

hmm

#

I feel like this would cause some sort of desynchronization issue when adding units later because the variable isn't in the missionNamespace but I don't actually know, that's just me going "Uhh put everything up there so it stays in sync"

#

idk man JIP is scary

pulsar bluff
#

now if you have 50+ then yes youd need a restructure, or rather, even id say itd be worthwhile

molten yacht
#

yeah probably, I'm just used to thinking about scaling a lot from other projects

#

also the back of my head has a programming version of gordon ramsay yelling about X script being FUCKING RAW when I know I've done something wrongly/suboptimally /j

pulsar bluff
#

from what ive seen, theres designers who fret over optimal, and theres designers who publish completed content

#

rarely crossover

sullen sigil
#

cba waituntilandexecute instead of waituntil 🙂

jade acorn
#

I have some units defending a place that upon contact will move from their positions to either find cover or pursuit the enemy, which is desired. What would be the best way to make them return to their positions after the area is clear? By default the will just stay where the group leader called out "area clear" and that can be pretty far away. Thought that having a HOLD waypoint on their initial pos would be sufficient but nope

sullen sigil
#

guard waypoint not work?

stark fjord
#

Move waypoint that never completes, or guard

stark fjord
#

Guard may be undesired, due to them responding to combat quite a distance away

vivid bridge
#

Hello! Could you please suggest a script for bot cowardice? I want the bot to surrender in battle if it is too cowardly

jade acorn
sullen sigil
#

try a move waypoint then a guard waypoint

stark fjord
#

With guard they respond to any event in vicinity. With move waypoint, they will go there but in case danger happens, the danger fsm takes over and they ignore it, until danger is over. Then they will move to it.

Guard needs guarded by trigger and guardsmen with guard waypoint will move to any guard trigger, by priority. In order triggers were placed. And respond to any danger within ~1km.

I suggest move, and periodically re assign them the waypoint.

jade acorn
#

alright, thx

hard haven
#

;P

sullen marsh
#

wat?

torn hemlock
#

It depends on what you want. Because "while" with "sleep" and "onEachFrame" are for different purposes. For example you cant get smooth "drawLine3D" with "while" cycle.

sullen marsh
#

There are plenty of applications for both

#

Oh and, the CPU use of a single if statement is practically negliable as long as the condition isn't some monstrosity

zealous sedge
#

Could anybody help me with my custom warlords scenario? Everything is working fine, Warlords init is good, all the custom vehicles and troops work properly as far as i can tell, but I am getting an issue

17:01:28 Error in expression <ts _newGrp < 3} do {
_newUnit = _newGrp createUnit [_unitArr # floor random _uni>
17:01:28 Error position: <createUnit [_unitArr # floor random _uni>
17:01:28 Error Type Any, expected String
17:01:28 File A3\Functions_F_Warlords\Warlords\fn_WLSectorPopulate.sqf [BIS_fnc_WLSectorPopulate]..., line 130

#

The correct troops parachute in, everything looks good but have this weird function issue

#

I've done this two or three time on different maps with different factions, as far as I know this is the first time I am encountering this issue, I am 99% sure that I have everything setup nicely in the configs and description.ext, I saw somebody had a similiar issue.

#

Here is my description, everything seems to work fine, my warlords init faction configs have been checked and are the same factions as the player factions / whats in the shop. If anybody could help me out would be greatly appreciated

#

And I know the description is a mess I will clean up the extra text when its time to play the mission with friends 😛

#

And entire milsim squad depends on you obi wan

#

help

#

I switched the independent faction back to the default arma 3 one and the error went away

granite sky
#

Aren't you supposed to define a resistance/greenfor side too?

zealous sedge
#

Now I gotta figure out how to make my indep faction work

#

@granite sky I did have one, but it turns out that one was throwing the error, I'm not sure if I need to write the independent faction stuff into the description and add class CfgWLFactionAssets

#

im not sure if that class is just for player factions or if it includes the AI independents though

granite sky
#

Amusingly this code is all using the _unitArr # floor random count _unitArr form, which is currently bugged and will occasionally throw an error there anyway.

#

but if it's always throwing the error then you're gonna be missing a definition.

zealous sedge
#

when it throws that error it likes to throw it quite literally thousands of times

#

I was confused for a while, I realize now that script is referring to the AI that populate the capturable sectors

#

which is why i wrote all that crap

zealous sedge
#

I could try adding the CfgWLFactionAssets to the desc, im not using it yet because I haven't needed it but would I need to use this to manually whitelist independent classnames so it doesnt throw an error?

#

I just don't know if CfgWLFactionAssets even covers the AI

#

They should be populating from the faction as long as its in the config.. idk what im doing wrong

#

alright so

#

bang

#

lookin good right

#

indeed

#

but shes gonna throw an error

#

fuckin arma

#

shameless

winter rose
#

try "CSA38_CSA38"?

zealous sedge
#

the others work without that, I tried it and it still has the error, I'm sure there is a way to fix this but I'm just not experienced enough

granite sky
#

Might be an issue in the CfgFactions rather than anything you can deal with, I guess.

#

I'd check how that works but I still have 9GB of this Arma update to go

zealous sedge
#

IFA seems to be working fine with it, CSA38 seems to be an issue. Just wanted an independent Prussian area faction

#

I had a polish one for it but its on opfor

#

i really needed poland on indep

#

so i had to use czhechoslovakia which isnt even accurate

granite sky
#

You could in theory make a Poland indep faction.

zealous sedge
#

which is now throwing those errors

#

Using somebody elses mod and then put it in warlords properly?

#

I'm not sure how

#

Probably wont work since poland is opfor but im gonna try putting their faction class under indepenedent in the init

#

the whole reason I got csa38 is that the poland faction depends on it, just for poland to be on opfor :/

granite sky
#

Not even sure myself, but probably something like this:

  1. Make copies of the opfor poland uniforms but with a different side flag.
  2. Make copies of all the polish units except with the greenfor uniform.
  3. Make a CfgFactions that uses those units.
#

config-makers people would have a clearer idea.

zealous sedge
#

I think i understand i just need to re-read it for the next 10 minutes before my brain clicks

#

did clothing configs for life servers at one point it might be simliar

#

but would I need to dig into the mod for this?

#

from what im thinking im gonna need to edit the mod configs

granite sky
#

You would need to make a mod that depended on IFA.

zealous sedge
#

politically correct way of doing things

#

yes

granite sky
#

IIRC uniforms are odd. There's a CfgWeapons definition that points back to a CfgVehicles unit which has the side parameter.

zealous sedge
#

might just have to ditch csa38 and save time

#

I commented on the workshop creators page asking if he would allow us to just edit the mod and could upload as a indep compatibility patch or something

#

I don't think csa38 wants to work on warlords regardless without extra attention so might have to find something else

dreamy kestrel
#

Q: when I createDialog I end up with a DISPLAY object, correct. curious of the viability using this object as a sort of name space?
i.e. if I have any vars that I need to maintain in the overall dialog state.
i.e. such that when the dialog closes, this deletes the DISPLAY instance? and all the vars go bye-bye, correct?

proven charm
#

yeah all dialog vars go away... become null when closing the dialog with closeDialog

tough trout
#

I want to modify an array in a script included by a mod, what's the best way to do it?

dreamy kestrel
warm hedge
proven charm
dreamy kestrel
#

yes exactly. I understand the root object(s) 'go away', assuming also the vars attached to the object vanish as well.
sort of a built in GC side effect, which is what I am after.
versus piling up some loosely related anyNamespace vars, i.e. localNamespace ...

hallow mortar
#

The setVariable wiki page contains a list of types of things which have their own namespaces. Display is on that list.

dreamy kestrel
#

right but my question is more the GC aspect when the display is closed, i.e. destroyed

twin oar
#
SupportRequester synchronizeObjectsAdd [player];
if (player == RD_1 or player == RD_2) then{
[player, SupportRequester, ArtilleryProvider] call BIS_fnc_addSupportLink;
[player , SupportRequester, TransportProvider] call BIS_fnc_addSupportLink;
[player , SupportRequester, CasProvider] call BIS_fnc_addSupportLink;
[player , SupportRequester, HelicasProvider] call BIS_fnc_addSupportLink;
};

Having an issue where it says these are undefinded variables but they are clearly stated on the units who can use it.

south swan
#

if the playable slot isn't populated and unit isn't spawned - the variable is undefined blobdoggoshruggoogly

twin oar
#

so that error will go away when it's got a player on it?

granite sky
#

Not unless both RD_1 and RD_2 are on.

twin oar
#

How do I make it to be separated then?

#

As I want the Radio operators to be able to do what they want without the other being required.

dreamy kestrel
twin oar
#

so replace isEqualTo with missionNamespace getVariable ["rd_1",objNull]?

south swan
dreamy kestrel
twin oar
#

still can't figure it out

granite sky
#

If you want it to be readable, best to pull the vars out first:

private _rd1 = missionNamespace getVariable ["rd_1", objNull];
#

does same thing as:

private _rd1 = if (isNil "rd_1") then {objNull} else {rd_1};
twin oar
#
SupportRequester synchronizeObjectsAdd [player];
private _rd1 = if (isNil "rd_1") then {objNull} else {rd_1};
[player , SupportRequester, ArtilleryProvider] call BIS_fnc_addSupportLink;
[player , SupportRequester, TransportProvider] call BIS_fnc_addSupportLink;
[player , SupportRequester, CasProvider] call BIS_fnc_addSupportLink;
[player , SupportRequester, HelicasProvider] call BIS_fnc_addSupportLink;
};
#

That?

granite sky
#

No, maybe make some attempt to understand what the code is doing and why?

twin oar
#

Sorry, I just don’t understand it.

#

The modules are easy to use but don’t show up on a server and that’s all I’ve found for it to show up.

errant iron
#

Is it normal for a dedicated server to return different texture information than clients? I've noticed some odd camouflage values with Dynamic Camo System (server-side mod) such as green uniforms being better in desert than a desert uniform, and after analyzing the code ive determined getTextureInfo was getting the wrong average color of the surface

checked using this script: https://sqfbin.com/ucoxehuqifeqekutumuz
(getPosASL in below screenshot says "array" cause i wrote the wrong variable name)

winter rose
#

yeah it makes sense, it seems like the dedicated server does not have data (a 8×8 texture…)

errant iron
#

ive made a bug report on their github page in the meantime

tough abyss
#

Hey, is there any way to check if a faction has any vehicles present in it?

I would like to only retrieve factions that have atleast one air (helicopter) vehicle, tank vehicle, and car vehicle.

So far I only have a portion of code taken from my script that extracts every faction under OPFOR, BLUFOR, and INDEP.

private _factionName = ""; // Classname of faction
private _factionClasses = [];
private _allFactions = [];

{
    _factionName = (getText (configFile >> "CfgGroups" >> _side >> configName _x >> "name")); // Get faction name e.g. "NATO (Woodland)"
    _factionClasses = "getText (_x >> 'displayName') == _factionName" configClasses (configfile >> "CfgFactionClasses"); // Find display name to find icon
    _allFactions pushBack [_factionName, getText (configFile >> "CfgFactionClasses" >> configName (_factionClasses select 0) >> "icon"), configName _x];
} forEach ("true" configClasses (configFile >> "CfgGroups" >> _side)); 
acoustic yew
#

Ello sorry for interjecting, I want to ask if I can have a script that adds + 1 to a variable each time a function runs :)

#

like if function artilleryShot ran add + 1 to variable TimesRan :D

stable dune
acoustic yew
#

:0

frozen seal
#

Is natural lightning synced across players in MP? Will all players hear it at the same time?

cerulean cloak
#

how would I convert the direction I get from vectorDir into a bearing in degrees?

little raptor
#

Anyway to answer the question: use atan2

cerulean cloak
tiny wadi
#

How do I get the current data in an RscEdit?

#

for a listbox its lbCurSel

restive pike
#

hi im trying to learn scripting and modding. Trying to make an item (cd) and have it in the arsenal. Can anyone show me how to or point me in the right direction?

acoustic yew
little raptor
jade acorn
#

I'm looking for some suggestions of implementing a Old-Man-like cache geolocator since the original script is not single-player friendly, I'd like to avoid it. Thought about using mine detector and place dummy mines in cache locations but it seems I cannot change the detection distance. The simpler the better

astral bone
#

Is there an event for nightvision toggle? No right?

tender fossil
#

Also regarding my earlier question about pVs, thanks for the reply @winter rose

jade acorn
#

cachhe was an ammo box or weapon crate most of the time

tender fossil
jade acorn
#

they are static

#

as in pre-placed in editor

tender fossil
#

That's doable (in both cases) with some scripting yeah

#

You could have a loop that monitors the proximity and direction to caches and calculates a normalized value based on your preferences, and plays a sound with a dynamic interval determined by the normalized value. Just as an example

vivid bridge
#

if the command to make the squad react if the enemy is more than for example 10 people?

tough abyss
#

ctrlText ?

vivid bridge
#

Well, for example, the blue bots saw the red bots and there are more than 10 people, I want the blue bots to back off.

jade acorn
#

set the blue group's courage to 0, and fleeing coefficient to max. Although they might still attack the enemy and then flee. AI in Arma is not designed to calculate the risk before any attack.

granite sky
#

I guess you could setCombatMode lower, although IME fleeing is plenty.

simple trout
#

No

#

look at the wiki

#

Syntax1:

// group is the left "Argument" and is a "Group" type
// right "Argument" type is array
group createUnit [type, position, markers, placement, special]

Alternative Syntax (SYNTAX2):

// type is the left "Argument" and is a "String" type
// the right "Argument" type is array
type createUnit [position, group, init, skill, rank]
#

args[] - (Optional) the format is {{leftArgumentType},{rightArgumentType}}. The information about argument types could be retrieved with supportInfo command.
in your case for args[] = {{"STRING", "GROUP"},{"ARRAY"}};
you are telling CfgDisabledCommands that createUnit has two types for that one syntax, which will break it

vivid bridge
#

Does anyone know how to get the bot to move into cover?

simple trout
#
doMove

and some combinatation of

playAction
nocturne canopy
#

Anyone know of an EH that fires on vehicle destruction and return the wreck produced by the destroyed vehicle? Or something to that effect?

granite sky
#

EntityKilled mission event handler, Killed event handler (but only if the vehicle is local), MPKilled (but spammy).

#

The wreck retains the same object handle that the vehicle used, in case that isn't clear.

nocturne canopy
granite sky
#

It's not like buildings.

nocturne canopy
vivid bridge
simple trout
granite sky
#

Good luck figuring out danger.fsm from the wiki :P

#

Honestly don't go there. You need a very good reason to override the vanilla AI behaviour.

#

They do attempt to take cover in combat already. They're just not very good at it.

simple trout
#

Yeah I really jumped the gun to tell you to use an FSM. You could try something else, but It is very hard to get it right.

vivid bridge
simple trout
#

?

#

what do you mean recognize?

vivid bridge
simple trout
#

that doesn't exist

#

what are you trying to do?

vivid bridge
simple trout
vivid bridge
pulsar pewter
#

hey folks! Hope y'all are having a nice weekend!
Quick question: I currently have a script for players to place down an object if there's a HEMTT nearby. I want to generalize this script so that my group's mission makers can vary which vehicle works for that script, so it doesn't have to be a HEMTT.
Currently, here's the general gist of the script:

_cargo = position _caller nearestObject "B_Truck_01_cargo_F";
if ( _cargo distance _caller < 30)
then
    { //create object}

How can I generalize this so that it doesn't check specifically for that class name?

#

My very general idea is that players can add a line to the init of the vehicle they want to use instead, adding that vehicle's object type to an array or something, and then just have my script check for nearestObjects for all elements of that array. Would that work? is there a simpler way?

boreal parcel
#

You could instead do:

params ["_veh"];
_cargo = position _caller nearestObject _veh;
if ( _cargo distance _caller < 30)
then
{ 
   //create object
}

and use it like so for a single vehicle

["B_Truck_01_cargo_F"] execVM "script.sqf"

or after seeing what you said now you could also do

_objs = ["B_Truck_01_cargo_F", "etc", "etc"];
_radius = 200;
_cargoObjs = nearestObjects [position _caller, _objs, _radius];
if (count(_cargoObjs) <= 0) exitWith {};
_cargo = _cargoObjs select 0;

if ( _cargo distance _caller < 30)
then
{ 
   //create object
}

I havent tested this code but it should work I believe

pulsar pewter
#

My group's mission makers don't know much scripting, so I wanna make it as fool-proof as possible. My mission template (that they use) will have the HEMTT, ideally with a line of code in its init that they can then copy into whatever vehicle they want to use instead.
I think your second option there would work, I think.

#

thanks!

boreal parcel
# pulsar pewter My very general idea is that players can add a line to the init of the vehicle t...

or if you wanted to create something like you said where they add a line to the objects init field, off the top of my head you could instead do
init field:

TAG_yourVar append (typeOf this);

create the global variable somewhere else, probably init.sqf

TAG_yourVar = [];

and instead do this in your script and call it however you currently do

_radius = 200;
_cargoObjs = nearestObjects [position _caller, TAG_yourVar, _radius];
if (count(_cargoObjs) <= 0) exitWith {};
_cargo = _cargoObjs select 0;

if ( _cargo distance _caller < 30)
then
{ 
   //create object
}
pulsar pewter
#

yeah! that's exactly what I had in mind. That works. Thank you!

boreal parcel
#

oh I messed up the if exitWith lemme edit my messages

pulsar pewter
#

(though maybe you meant count(_cargoObjs) rather than _cargo, no?

pulsar pewter
#

Thanks, Guy. I had something like this in mind. Just wanted to see if it made sense to y'all.

boreal parcel
#

np, it makes sense to me but I wouldnt doubt people who have been doing this much longer than me could suggest better ways

blazing loom
#

I want to make a script to loop date on a full moon, something like <if not date =12,6,67 then make date 12,6,67>
and it checks every 2 hours or so, how would i go about this for arma 3? or does anyone have a script that already loops date?

opal zephyr
#

you can use the skiptime command, but that would show the black screen with the text everytime I think

boreal parcel
# blazing loom I want to make a script to loop date on a full moon, something like <if not date...

I would say you could probably do something like this, but I wrote this on the spot using the wiki so I could have some issues here.

private _desiredTime = [2023, 5, 5, 14, 0]; // May 5th, 2023. 2:00pm
while (true) do {
  date params ["_curYear", "_curMonth", "_curDay", "_curHours", "_curMinutes"];
  _desiredTime params ["_desYear", "_desMonth", "_desDay", "_desHours", "_desMinutes"];
  if (_curDay isNotEqualTo _desDay) then {
    setDate _desiredTime;
  };
  sleep 7200; // 2 hours
};
tough abyss
#

onEachFrame could be considered a loop too

sullen marsh
#

eh, it's called every time the game loop... loops

#

I suppose so, but it's a bit stretched logic :D

tough abyss
#

Hey I got a quick question about scripting ACE

#

does callbackProgress check code on every frame during the progress bar

#

I think so

#

You mean the progressBar ?

#

I want a line of code to run when I start the progress, is that the best way of doing it?

#

I'm currently in ACE_Medical_Treatments.sqf

#

Put it after the FUNC(progressBar)

hollow stirrup
#

Quick question, im thinking of making a life jacket, as scripters, would it be possible to make it so whilst wearing the life jacket, you cannot dive and it keeps you on the surface of the water?

tough abyss
#

No.

#

Kenny, I would setvelocity if getposASL select 2 < 0.

sullen marsh
#

@tough abyss I suppose it's a good idea to avoid loops wherever you can, a poorly designed loop can drop your performance real quick, but I agree saying to never use them is a bit silly

tough abyss
pulsar pewter
#

hey folks, quick, conceptual question:
How do I make the script within an object's init field execute after what I have in init.sqf? Do I just use [] spawn = {code}?
Reason why I'm asking: an object's init field refers to a global variable that I've defined in my init.sqf

tough abyss
#

Also commy took me a while but I undesrtand now. thanks for help :)

#

I found that you can't rely at all on the sheduler as addon maker.
Addon1 uses 10 loops
Addon2 uses 12 loops
AI Addon3 uses 30 loops
The mission uses 15 loops

In the end, all of them eat up the 3ms and might get delayed or stuck. Especially on low FPS / multiplayer

granite sky
#

You'd also need to use a waitUntil or similar inside the spawn.

#

Otherwise the spawn may still run before all or part of init.sqf.

#

your syntax is off there btw, there's no = between spawn and the code.

pulsar pewter
#

Alright, so here's what I'm trying to do.
-In init.sqf, I define RG_SupplyVics = []
-I do this because in a function, i later use vehicleClass names that I'm adding into RG_SupplyVics.
-In my mission template that my group will use, I want to add a line into a vehicle's initfield that will add that vehicle's classname into RG_SupplyVics. I'm doing it this way so that my non-scripting friends, in their own missions, can just copy-paste what I'm putting in the init field into whatever vic they want to use. Here's what I've got:

[this] spawn {this = _this select 0; waitUntil {sleep 1; !isNull RG_SupplyVics}; _type = typeOf this; RG_SupplyVics pushback _type}
#

(thanks for the typo of the =, John).

#

This won't work as written, though. I don't think it'll like the "!isNull RG...". How can I write the waitUntil so that it waits until my empty array gets defined in init.sqf?

granite sky
#

should be !isNil "RG_SupplyVics"

pulsar pewter
#

oh, duh. Thanks John~

granite sky
#

Also don't use this as the internal var. That's horrible :P

#

just use _veh or something

pulsar pewter
#

hehe shush. Been scripting all day 😛
But yeah, I know.

granite sky
#

Better way to handle this is to replace the init box with something like this setVariable ["isSupplyVic", true]; and then sort out RG_SupplyVics when it's initialised.

#

RG_SupplyVics = vehicles select { _x getVariable ["isSupplyVic", false] } or similar.

pulsar pewter
#

Oh, nice.
Is this second method better just because I'm not suspending code with the waitUntil and thus better perf-wise, or just stylistically better? (trying to learn here)

granite sky
#

There's no doubt about exactly when or where the vehicles end up in the array.

pulsar pewter
#

Got it.

granite sky
#

Note that init boxes run everywhere, so your version is going to be messy at best for multiplayer.

#

while in the second version you can just publicVariable once it's built.

#

(if you actually need the data anywhere other than the server)

hollow stirrup
#

Thanks guys :)

pulsar pewter
#

Yeah, that makes sense.
I'd have to change what you suggested, because I want the classnames in RG_SupplyVics, not the vehicles themselves. Otherwise, if I have to replace that vehicle mid-op by spawning a new one as zeus, would have to setVariable again, right? I'm fine doing that, but I'm trying to fool-proof this for my non-scripting friends who'll be using this mission template.

granite sky
#

As a general rule you want to make code as deterministic as possible.

pulsar pewter
#

Small fix, though.

granite sky
#

oh, classnames, yeah.

pulsar pewter
tough abyss
#

It's good for things that have to be real-time like it's said in the ACE wiki article about it

sleek skiff
#

just got home from work... thanks to all the replies on my question last night!

sullen marsh
#

@tough abyss I suppose that's the point of the scheduler, it's designed for asynchronous work off the main thread. A fundamental concept of asynchronous work is that it's not.. well.. synchronized.. with the main thread and is, as far as any code running in the synchronized space goes, unreliable.

#

tl'dr, It's not meant to be reliable

tough abyss
#

Then it's not good enough for what I'm doing most of the time

#

And you can't relly say it helps performance.
Just look at the loading times of the config viewer.
I'm working on one that uses unsheduled and it loads and displays the configs almost instantly.

sullen marsh
#

Depends on where you view performance from

#

Good for performance of the game engine

#

Not so much for your script

#

Nothing's wrong with unreliable, that's my point

tough abyss
#

well having 3 second long loading bars while the machine bascially idels just to show raw configs is not what I consider benefitial for performance.

#

It doesn't stutter at all what I build.

sullen marsh
#

tbh the way configs are handled in-game are ridulous anyway

#

Loading from file EVERY time they're needed

tough abyss
#

Is that confirmed?

#

Can they not be pre-loaded ?

sullen marsh
#

It's what Impulse tells me and he talks to Nou so i'd assume so

#
  • you can see disk activity if you try and load configs in a loop
#

Even loading the same one

tough abyss
#

The slow part of the config viewer is not reading the config, but filling the listbox from my testing

sullen marsh
#

On an SSD?

tough abyss
#

Nope.

sullen marsh
#

shrug

#

@austere roost

#

See if he comes..

tough abyss
#

There is no point.

jade abyss
#

Wouldn't be much benefit in it

tough abyss
#

configFile is not the issue I think.
getNumber, getArray, isClass etc. are the reading from disk part

#

If thats even true

sullen marsh
#

ACE does config caching

#

It wouldn't make much sense to do that if it was already cached

tough abyss
#

Yes, for the interaction menu.

sullen marsh
#

Plus, it might have made sense to do it that way when OFP was released

#

If memory was a limiting factor

tough abyss
#

Well now we are usually trying to trade memory for processor time.

#

The memory anything in SQF takes is neglible really.

#

It's funny that everyone tries to optimize scripts, but then uses vehicles with 3+ 4k textures

sullen marsh
#

You could probably calculate it

#

at least approximatley

tough abyss
#

Depends on the machine I guess.

sullen marsh
#

I imagine the limit would be very very high if it's true that the config is read from the filesystem every time a value is needed

tough abyss
#

I once tried to save more than 100000 variables in one frame. Game crashed.

#

This is a horrible machine for Arma though

#

The worst thing is that no one cares about the shitton of updating base class errors

#

probably because no one understands the implications

sullen marsh
#

The mod people in my community rage about it all the time

tough abyss
#

config1 sets up a class inheritance
addon2 changes that inheritance
addon3 relies on the inheritance of config1

#

-> addon2 and addon3 are incompatble

#

And it obviously is addon3's fault

#

No, missing config entries

#

Or config entries that are wrong

#

So basically nothing works as expected

#

And those things are very hard to detect

sullen marsh
#

Game is hard

tough abyss
#

Isn't that exactly what's happening with the current LOP and RHS

#

I blame BI for the horrendous inheritance they use
I mean wtf is this?
CommanderOptics: CommanderOptics: CommanderOptics: CommanderOptics: NewTurret

#

^what?

sullen marsh
#

0.0019989 ms from var
0.0056734 ms from getText on an SSD

tough abyss
#

Why store that on the vehicle and not dynamically create a variable?

#

Would save you one call for each duplicate

jade abyss
#

missionNameSpace setVariable

tough abyss
#

yes^

jade abyss
#

You just have to load that vehicle Type only once

#

So bascily it would be C_offroad_F = allTheConfigData

#

Additional: Just create those Vars that in the init.sqf :D

tough abyss
#

Well that would mean you parse the whole config

#

Just do it on object init

#

A mission probably only uses 0.001% types of all available objects

jade abyss
#

Depends on, what kind of Mission.

tough abyss
#

They are different

#

For this probably even uinamespace

#

Because configs can't change during one session

#

(not counting diag.exe)

#

Yeah, but please use format

jade abyss
#

buh

#

Move to the Corner of shame!

tough abyss
#

Also one thing I like to do with dynamically created variables is putting : or # into the string

#

Because that clearly indicates that it is dynamically generated

#

since you can't do:
blah:blub = 1;

#

It's not a huge deal , but I think it's neat

jade abyss
#

you mean: format ["Tag_#_%1",Data]; ?

#

fk that codethingy

tough abyss
#

yup

jade abyss
#

format ["Tag_#_%1",Data];

#

Now

jade acorn
#

how would I check if player is in fog? Iirc AI has shorter line of sight if in fog, but I can't find anything related to this. Thought about comparing player's posATL to fog base but the fogDecay parameter complicates that a bit

warm hedge
#

Good question, I think doing a math is the only way?

tribal sinew
jade acorn
south swan
#

fogDecay - how much the fog density decays with altitude. 0 = constant density, 0.0049333 = density halves every 500m
i love the accuracy 💀

#

samatra
Posted on Aug 01, 2022 - 09:43 (UTC)
Be aware that this command is affected by setWindStr and windStr! Max fogValue = 1 - windStr,
even better 💀

vestal parcel
#

is there a way to make ACE Arsenals Player/Role Unique without placing one for each Player/Role?

summer gale
#

Hey, I have got a problem that I am unable to solve.
I have script that adds eventhandler to every unit on init in description.ext

class Extended_Init_EventHandlers {
  class Man {
    init = "_this call (compile preprocessFileLineNumbers     'ForceLoadouts.sqf')";
  };
};```

ForceLoadouts.sqf:
```sqf
if !isServer exitwith{};

private "_this";
_this = _this select 0;

switch (typeof _this) do {
  case "I_Soldier_f": {[_this] execVM "SMG.sqf";};
  case "B_Soldier_f": {[_this] execVM "Rifle.sqf";};
  //and so on for many more unit classnames
};```
When I first used that script like 2 years ago it all worked perfectly fine on dedicated server. However, now I can't get it to work on dedicated server with 
```sqf
if !isServer exitwith{};```
It works without the code above but I need it to execute only once on server and not for every client.
Did they change something or is something broken, because it used to work perfectly and now it doesn't.
Thanks in advance :>
stable dune
#
if (!isServer) exitWith {};
#

and you can do check in init so you don't need even compile script to clients

class Extended_Init_EventHandlers {
  class CAManBase {
    init = "if (isServer) then { _this call (compile preprocessFileLineNumbers     'ForceLoadouts.sqf')};";
  };
};```
And use CAManBase ,
Man include snakes etc 😁
summer gale
stable dune
#

And in code

private _unit = _this select 0;
private _type = typeOf _unit;
switch (_type) do {
....
};
jade abyss
#

Why uiNamespace?

#

Wouldn't missionNamespace make more sense @tough abyss

tough abyss
#

I think variables in uiNamespace are not lost between mission changes

#

*I think because

jade abyss
#

Edit is possible here :P

tough abyss
#

All these new tricks. It's hard for old dogs to keep up :D

jade abyss
#

wait, Edit is new? XD

tough abyss
#

I've never seen editing in a instant messaging platform

#

Anyway, what's the best way of testing performance of scripts and frameworks? I wanna optimize code, but can't really do it if I got no real data on which is faster in my case?

jade abyss
#

Editor -> Esc -> Tiny little symbol on the left of Local, Global, Server

#

Watch out: Don't use createVehicel or something like that^^

tough abyss
#

hmm okay, but what should I try running to test code performance

tribal sinew
#

Do I need to call enableCamShake false after calling addCamShake or

  1. is it only if I want to prevent addCamShake from being called?
  2. is it only if I set enableCamShake to true before?
tough abyss
#

And see if maybe too many silly scripts are running and slowing down the game?

fair drum
tribal sinew
#

gotcha, just making sure, thanks

tough abyss
#

Basically : Will other scripts I'm running in the background affect the code test?

jade abyss
#

Sure, but why should there be other results, if you run them under the same circumstances.

#

simply try it out, what the results are:

_Nmb = 1000;
if(_Nmb == 1000)then{};

_Nmb = 1000;
if(_Nmb isEqualTo 1000)then{};

tough abyss
#

How would I do this to test the speed of ~20 scripts I've already got running?

#

Is the optimal way of doing it to run some heavy code and see how it does?

#

Or will my other scripts and stuff not affect it at all?

#

As in it feels like it freezes everything

jade abyss
#

Why don't you just test it?

tough abyss
#

I tried that but got wierd results... I was hoping there is a known "correct" way of doing it.

#

My results seem to be inconsistent :S Probobly worth it to sleep on it... cya

unique pewter
#

Anybody here knows any alive mod scripting?

winter rose
#

I assume it would be recommended to check their Discord

ashen ridge
#

After using params script command a lot, i just noticed how it is heavy to execute. Removing it made my loop execution time change from 4 ms to 2 ms!

#

This is right assumption?

#

The loop is a forEach with 1300 elements.

#
{
    _X params ["_param1","_param2","_param3","_param4"];
    //CODE...
} forEach _array;
winter rose
#

if you just removed it without replacing it by anything, you didn't need it in the first place 😄

ashen ridge
#

No no, it was used. I changed _param1 to (_x select 0) and so on.

winter rose
#

if you know your data and performance is the issue, go for select

ashen ridge
#

So critical code will be now critical... and ugly.

little raptor
#

if you did this it would become a lot faster:

_params = ["_param1","_param2","_param3","_param4"];
{
  _X params _params;
} forEach _array;
#

I would say even faster than your select (tho the game still has to parse them so not 100% sure)

#

if you use all of them ofc. if you just want to use one or two just go with select

little raptor
ashen ridge
#

I can delete destroyed Land Vehicle smoke by finding the "#particle" smoke object and deleting it.
But this don't work for Air objects (planes, helis) because they don't have a "#particle" object to be deleted. There is any other way to delete destroyed Air vehicles smoke?

frozen yarrow
#

Hello there,
I'm playing around with spawning in Support Modules and I'm running into some issues.
I'm running this code:

_player = DjPlayer; // Main player that has DjPlayer assigned in editor
_arti = arti_1; // Test artillery. Object spawned in Editor

if (isNil "moduleGroup") then {
   moduleGroup = createGroup WEST;
};
ArtiProvider = moduleGroup createUnit [  // Creating the ArtilleryProvider Module
   "SupportProvider_Artillery",  
   _player,  
   [],  
   0,  
   "NONE"  
];  
ArtiProvider synchronizeObjectsAdd [_arti]; //Syncing my test artillery to the provider

SupportRequester = moduleGroup createUnit [  // Creating the Requester Module
   "SupportRequester",  
   _player,  
   [],  
   0,  
   "NONE"  
];
  
[_player , SupportRequester, ArtiProvider] call BIS_fnc_addSupportLink;
[SupportRequester, "Artillery", -1] call BIS_fnc_limitSupport;

It works.
I get access to the Support and can use it, but every time this script is run (or even when I call this support in the vanilla way) I get a script error.
This is in my rpt:

 4:57:03 Error in expression <mat ["BIS_SUPP_limit_%1_total", _type], _total]
} forEach [
"Artillery",
"CAS_He>
 4:57:03   Error position: <_total]
} forEach [
"Artillery",
"CAS_He>
 4:57:03   Error Undefined variable in expression: _total
 4:57:03 File A3\modules_f\supports\procedures\refreshMainWindow.sqf..., line 23

I was able to find an ancient (<t:1461899100:R>) post on the Forums which seems to be a bug report: https://forums.bohemia.net/forums/topic/190386-bug-report-error-on-screen/
But that's about all I could find regarding this. Is this just something simple I'm overlooking?

twilit scarab
#

If you set up a fire mission waypoint and attach it to a moving unit will the unit engaging in the fire mission shoot at the unit or at its initial position?

And what script can I use to change how much dispersion they use cause on default it is very tight

#

Okay, I figured out the fire mission will not follow the unit its attached to and just remains where it is. How can I get mortars to fire on my player in a wide dispersion in the simplest way possible?

I already have them set on a hold waypoint with a trigger activated by player presence just need them to fire on my position in a wide dispersion

twilit scarab
#

Ive been trying to use the "doartilleryfire" script but no clue how to insert a "getposATL" of my player into the "doartilleryfire" postion

#

Or basically how to insert the getpos array into the doartilleryfire array dynamically

hallow mortar
#
_artillery doArtilleryFire [getPosATL _target, "Magazine_class_here", 5];```
twilit scarab
#

I was doing getposATL (thislist select 0) on a trigger activation

hallow mortar
#

_target in this case is a placeholder for whatever object you want to get the position of

twilit scarab
#

Ya my player which I named "player1"

#

How can I get that to repeat tho cause it only fires 1 burst and id like it to fire again after reload

#

And add a lil bit of dispersion

hallow mortar
#

If this is a single player mission you can just use the command player to get the current player unit and not worry about naming it. In MP it's more complicated though.

#

To repeat it you can use a for loop, e.g.

for "_i" from 0 to 3 do {
    // doArtilleryFire
    waitUntil { unitReady _artillery };
};

(Will need to spawn this if you're doing this in a trigger, to create a thread where the waitUntil suspension is allowed)

twilit scarab
#

Its currently SP but that part of it works for the most part

twilit scarab
hallow mortar
#

Whether that works depends a lot on how the trigger is set up and how you want the repeating fire to work. Bear in mind that a repeatable trigger can potentially activate an infinite number of times depending on its conditions.

twilit scarab
#

The trigger is pretty much only firing the mortars so im fine with infinite repeating

#

Cause once they run out of ammo they wont be doing much firing

hallow mortar
#

Then you should be able to use a repeatable trigger and no need for a for loop

strange hatch
#

is this where i ask question for scripting

hallow mortar
#

The channel name may be a clue

strange hatch
#

ok

twilit scarab
#

Might have to switch it to "detected by X"

hallow mortar
#

I have no idea what your current trigger conditions are so 🤷

twilit scarab
#

Player present

#

Which im sure doesnt deactivate

strange hatch
#

I just wanted to ask how can i have a enemy heli attack a enemy group and then after patrol the area for enemies it sees. I'm new to arma

hallow mortar
#

A Search & Destroy waypoint is the simple option

twilit scarab
#

Seek and destroy then loiter or sentry

strange hatch
#

i know but what to do it without waypoints

#

just scripts

twilit scarab
#

Why

hallow mortar
#

You can create waypoints with scripting

strange hatch
#

oh i didn't know that

twilit scarab
#

Its basically the same thing tho

hallow mortar
#

Bear in mind that AI helicopters' ability to spot ground targets, particularly infantry, is...not always consistent. Start by trying basic waypoints, but know that you may need to go deeper.

strange hatch
#

yeah the heli ai sometime attacks then after it just loiters around even there still ai on the ground

hallow mortar
#

You can help them a bit with repeated use of reveal but to some extent you just have to take what you can get

strange hatch
#

Reveal?

hallow mortar
strange hatch
#

with seek and destory how large is the area it searches and how can i increase it

hallow mortar
hallow mortar
strange hatch
#

does it work for jets and aircraft

hallow mortar
#

Probably technically yes but jets are even worse at spotting ground targets than helicopters are

hallow mortar
# twilit scarab And add a lil bit of dispersion

Dispersion is complex - you can't directly control it, it's part of the weapon config. There are things you can do to fake it; for example, use very short fire missions and slightly randomise the position each time, or use a Fired EH to modify the projectile's velocity

twilit scarab
#

I thought there was a command specifically for dispersion?

strange hatch
#

Does anyone know how the following waypoint works

twilit scarab
#

This tells you how every waypoint works

twilit scarab
hallow mortar
# twilit scarab I thought there was a command specifically for dispersion?

There is not.
setSkill has control over the AI's ability to compensate for weapon recoil and their general aiming accuracy, but this doesn't really apply to vehicle weapons because of how they work, and especially not for scripted artillery computer firing where the AI is given an exact position to aim at.

twilit scarab
#

I guess closest I can get is BIS_fnc_randomPos

hallow mortar
twilit scarab
hallow mortar
hallow mortar
# twilit scarab I tried both

Launch the mission, don't do anything, put the unitReady check in the debug console, execute, and see what it says in the return line just below the console

#

It should be true pretty much by default since the unit hasn't done anything to change that yet. If it's false then something's up

#

(if it's true then something is also up because then the trigger should activate, but something else)

twilit scarab
#

Was using _barragePos = [[(getMarkerPos "bombHere"), random 500],["water","out"]] call BIS_fnc_randomPos;

#

But cant figure out how to put my players changing position where "getMarkerPod" is

#

_barragePos = [[(getposATL player) "bombHere"), random 500],["water","out"]] call BIS_fnc_randomPos;

#

Would this work?

hallow mortar
#

Remove "bombHere")

twilit scarab
#

Im not sure what that was even for tbh

hallow mortar
#

In the previous version, it was the name of the marker whose position you wanted to get. Since you're not using getMarkerPos any more...

twilit scarab
#

Hmm its pulling an array error on activation

hallow mortar
#

"An array error" isn't a kind of error. What exactly does it say?

twilit scarab
#

That its missing an array. Ill tell you exactly in a second

#

"Error type SCALAR, expected Array"

#

"Object, group, locations, string"

hallow mortar
#

You need another set of [] around the first bit, [[[(getPos .... 500]]

twilit scarab
#

Ill try it

hallow mortar
#

[[[
First one opens the array of arguments for the function.
Second one opens the whitelist array within the arguments.
Third one opens the [centre, radius] array you're providing within the whitelist.
You could provide multiple [centre, radius] arrays in the whitelist, or a mix of the supported whitelist item types, etc. (Don't for this purpose, but the function supports it)

twilit scarab
#

Ah always wondered what those were actually doing lol

hallow mortar
#

Well you're generating the position and then not doing anything with it

twilit scarab
#

Pretty much what I got going on, not sure if I wasnt supposed to replace the script I had before on the trigger

hallow mortar
#

You ain't got no doArtilleryFire my dude

twilit scarab
#

Okay ya I thought that was the problem

#

So I just out my old script after the BIS_fnc_randompos?

hallow mortar
#

Make sure to change the target to _barragePos

hallow mortar
#

Yes

twilit scarab
# hallow mortar Yes

Cool its working. Lil more dispersion, gotta up the value a bit to try and get some more

#

Actually my next tests the mortars were super off, guess the first one was just lucky

#

Is the 500 value in meters??

hallow mortar
#

The randomisation system you're using means it can be up to 500 metres off, but there's no minimum. Increasing the number will increase the maximum but there will still be no minimum and statistically, a lot will still be nearby

twilit scarab
#

Oh so I should probably decrease it then lol

#

First test like 3 of them landed right on top of me

#

Might do like 250ish

hallow mortar
#

Keep in mind that the target position is being calculated once per fire mission, not once per shot. The grouping around the calculated position is affected only by the mortar weapon config dispersion, which is pretty tight for vanilla stuff

twilit scarab
#

Oh I gotta change this up all 8 rounds are still landing in close grouping

#

Ya

#

Might have to do like 1-2 shots and then run it again

#

Just when I thought it was working good lol now I gotta loop it pretty fast

hallow mortar
#

Once the trigger is made properly repeatable that should take care of itself

twilit scarab
#

Ya I still have to figure that out

#

And run that one line through debug

hallow mortar
#

The use of unitReady means the trigger will deactivate when the mortar does a fire mission, and reactivate when it finishes, causing it to loop as long as the main condition is also satisfied

#

Or, you know, it should

twilit scarab
#

So I should probably change it back to bluefor preset so its always activating

#

This is what the trigger looks like so far

hallow mortar
#

Detected by INDFOR should also work provided someone is actually being detected by INDFOR

twilit scarab
#

That was I was doing before but idk it doesnt work with this && {unitReady mortar1}

#

And when I put it into the debug console and pressed local execute nothing seemed to happen

#

I did it with just the unit ready part and it copies it under the debug console

hallow mortar
#

The only thing that should happen is the appearance of TRUE or FALSE in the return line immediately below the console

twilit scarab
#

Ya I dont see either it just copies what I put in there

hallow mortar
#

Don't include the this && { }, that's the part that combines it with the trigger condition which doesn't exist in the debug console

twilit scarab
#

Oh

#

Says False

#

Could it be a hold waypoint cause I have them on one?

hallow mortar
#

Yes, probably. The unit is not ready because it has an uncompleted wp

twilit scarab
#

That would make sense cause the trigger is also a skip waypoint

hallow mortar
#

You shouldn't need a hold wp for a static crew, just lock it and they won't go anywhere

twilit scarab
#

And if its preventing the trigger from actovating they will never complete it

twilit scarab
#

Firing about 2 rounds off in about 2 seconds apart in a 250m dispersion

#

Beautiful

#

Thanks for your help man really came through for me

hallow mortar
#

No problem

twilit scarab
#

Kind of weird when I put the shells on 1 they dont fire more than 1 round in total even when it says true for unit ready

#

But when its set to 2 rounds they fire 2 every X seconds

#

Weird if I change the interval to anything but 2 seconds they dont work right either

#

If I have them on anything but 2 rounds every 2 seconds they dont want to work right

#

But thats a problem for tomorrow

jade acorn
#

Q

I have following code to create a herd of Ravage zombies I execute with a trigger:

horde_muratynNum = [];
 for "_i" from 1 to 30 do {  
  _zed = createAgent [selectRandom ["zombie_walker","zombie_bolter"], getpos _this, [], 30, "NONE"];  
  _zed setPosATL [getPosATL _zed # 0, getPosATL _zed # 1, 0.2];  
  _zed setDir random 359;  
  _zed setVariable ["_zPersistent", true]; 
  horde_muratynNum pushback _zed;
  };
```Array is to later check whether player killed every zed from that horde. 

Now I'd like to execute following code on each zed. ```sqf
this spawn {
    _uStayThere = getpos _this;
    while {alive _this} do {
        sleep 1;
        if (_this distance _uStayThere > 15 && isNil {_this getVariable "_zTarget"}) then {
            _this doMove _uStayThere;
            _this forceSpeed 2;
        };
    };
};```
What do? Iterating this through the array should work but I doubt this is performance friendly. I can use CBA eventhandlers if this simplifies things although the `addClassEventHandler` is for classes and I have other zombiers wandering around
south swan
#

what's wrong with iterating through and array, sqf is single-threaded anyways?

#

ah, the while loops tanking

#

save the original position on zed itself when creating it in the first snippet, use one loop that (checks one zed per frame, skips dead ones, sanitizes the list by deleting dead ones after full iteration loop, closes itself when list is empty), done blobdoggoshruggoogly

candid umbra
#

I've found an old script for dragging dead bodies, for the purpose of hiding them during stealth ops.
I've followed the steps on the forum post but the action does not seem to be working.
I've attached my init.sqf

Any thoughts?
(This is the first time I'm doing scripting)

https://forums.bohemia.net/forums/topic/171916-drag-dead-body-script/?tab=comments#comment-2684385

gusty ridge
#

FYI, I think == will blow up if one of the operands is nil, whereas isEqualTo always evaluates to false or something.

#

Maybe it isn't true with nil, I might be thinking of when you compare things of different types. So [] == 0 blows up but [] isEqualTo 0 evaluates to false.

kindred zephyr
#

Hello,

Does anyone has recent experiences with
https://community.bistudio.com/wiki/BIS_fnc_showNotification
?

I've been wondering if certain notifications can only be shown under certain circumstances.

For example:
ScoreAdded notificacion works on SP and when hosting but not as a client.

The function itself is local and I have only tried a handful of the notifications but it seems like some of them won't show in the previously stated manner.

I was assuming that this one in specific wouldn't show because i had the scoretable disabled on my server testing environment but doesn't seem to be the case, and remoteExecing the function to client or server doesn't seem to do anything for that notification.

The question evolves to: this same situations can happen uppon creating a custom notification?

winter rose
kindred zephyr
manic sigil
proven charm
#

a bit unclear whats the problem but i noticed BIS_fnc_showNotification can only show one notification at a time

kindred zephyr
proven charm
winter rose
winter rose
proven charm
#

no?

winter rose
#

it's for hasInterface machines

proven charm
kindred zephyr
#

^ because of the ui

#

weird for it to happen to only a handful

kindred zephyr
winter rose
#

I'm checking the function's code

#

@kindred zephyr so this difficulty setting needs to be set/enabled for the notification to be shown

kindred zephyr
#

what takes precedence in this case since its local?

User profile difficulty, mission difficulty or the server difficulty?

winter rose
#

most likely server
server settings override player settings ofc

kindred zephyr
#

got it, gonna give it a try later

winter rose
#

the server decides whether or not you can tacticalPing, see death messages, etc

kindred zephyr
winter rose
hallow mortar
#

I feel like that would be a relatively simple fix on BI's end, so you could make a ticket

#

* fix by changing the function I mean, not changing difficultyOption

proven charm
#

and change the fact it can only show single notification at a time 😉

winter rose
#

that's by design, not a bug 🙃

kindred zephyr
proven charm
winter rose
proven charm
#

lol ok

kindred zephyr
#

the que is a bit inconsistent as it not immediate, once the first notification shows anything that gets queued get to show after it according to que order in backwards order of the list, so execution order is not always the same or equally timed, plus also the que will start with the lastly queued notification at the moment when the que starts to show the notifications

frozen yarrow
#

Hello there,
I'm playing around with spawning in Support Modules and I'm running into some issues.
I'm running this code:

_player = DjPlayer; // Main player that has DjPlayer assigned in editor
_arti = arti_1; // Test artillery. Object spawned in Editor

if (isNil "moduleGroup") then {
   moduleGroup = createGroup WEST;
};
ArtiProvider = moduleGroup createUnit [  // Creating the ArtilleryProvider Module
   "SupportProvider_Artillery",  
   _player,  
   [],  
   0,  
   "NONE"  
];  
ArtiProvider synchronizeObjectsAdd [_arti]; //Syncing my test artillery to the provider

SupportRequester = moduleGroup createUnit [  // Creating the Requester Module
   "SupportRequester",  
   _player,  
   [],  
   0,  
   "NONE"  
];
  
[_player , SupportRequester, ArtiProvider] call BIS_fnc_addSupportLink;
[SupportRequester, "Artillery", -1] call BIS_fnc_limitSupport;

It works.
I get access to the Support and can use it, but every time this script is run (or even when I call this support in the vanilla way) I get a script error.
This is in my rpt:

 4:57:03 Error in expression <mat ["BIS_SUPP_limit_%1_total", _type], _total]
} forEach [
"Artillery",
"CAS_He>
 4:57:03   Error position: <_total]
} forEach [
"Artillery",
"CAS_He>
 4:57:03   Error Undefined variable in expression: _total
 4:57:03 File A3\modules_f\supports\procedures\refreshMainWindow.sqf..., line 23

I was able to find an ancient (<t:1461899100:R>) post on the Forums which seems to be a bug report: https://forums.bohemia.net/forums/topic/190386-bug-report-error-on-screen/
But that's about all I could find regarding this. Is this just something simple I'm overlooking?

tepid vigil
#

Does surfaceTexture behave differently on dedicated servers than on clients? And if it does, is this intended behaviour?

#

Looks like running getTextureInfo (surfaceTexture _position); on dedicated returns something like [8, 8, [0.89, 0.89, 0.89]]

tender fossil
#

(Arma 2: CO): Is it possible to make score counting in mission server side? Another option could be to at least verify the scores of players on server but it would generate excessive network traffic

hallow mortar
winter rose
#

I had a déjà vu here 😄

cobalt path
#

Is there a way to spawn unit while in zeus and immediatly give it a variable name?

#

I tried

_cameraai = group player createUnit ["B_Soldier_VR_F", position aircraft_for_camera_1, [], 0, "FORM"];
#

but

deleteVehicle _cameraai;

doesnt work, so I assume it didnt actually aquire that name

winter rose
#

you most likely call this where _cameraai is not defined

twin oar
frozen yarrow
#

oh nice. yeah I saw your posts when searching, just didn't see that you also ran into that error message

cobalt path
cobalt path
twin oar
winter rose
#

but beware of losing the reference to a previous object
e.g

MyObj = createNewObject; // obj1
MyObj = createNewObject; // obj2
deleteVehicle MyObj; // obj2 is deleted, obj1 is not referenced anywhere
fallen elbow
#

Hey y'all, this probably gets asked alot but after the death of Atom, what's your code editor for Arma? I've tried notepad but it's missing a lot of QOL features compared to good ol atom

kindred zephyr
#

n++ with sqf language definition

winter rose
#

(which should prooobably be renamed to Code Editing)

dusky pier
#

Good evening!

I got a question ( didn't find it on wiki ). Is it possible somehow check player arma startup parameters with script?

candid umbra
dusky pier
# winter rose _why_

Well the problem is - as i got - player use script with -init after start game and load main menu - it runs script with uiNamespace do {... which wait until mission started and this script run.

As i got - i can't stop or track code, runned with uinamespace, so i need to somehow track if -init parameter is not empty