#arma3_scripting
1 messages · Page 85 of 1
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.
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
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.
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?
Nah, you need the third component for that, which is a bit of a pain.
(there is no vectorRight)
hmm
Working from the previous code:
_vectorRight = vectorDir _heli vectorCrossProduct vectorUp _heli;
_xdist = _targDir vectorDotProduct _vectorRight;
_aziAngle = _xdist atan2 _zdist;
Might be backwards.
My god man thank you
nope its spot on
_xdist = sqrt (1 - _ydist^2 - _zdist^2); might also work.
(only if _targDir is from vectorFromTo though, not vectorDiff)
im still having issues with this, the settings arent being forced on the players
What have you done so far ?
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
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)
you're in luck https://community.bistudio.com/wiki/enableEnvironment
oh good
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
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
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')";
};
};
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...
Arma 3 tools does this
Also https://paa.gruppe-adler.de/
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.
are there any border issues with PAA images, I seem to vaguely recall something like that...
Is there a way to get a thing to behave like an old 2d sprite, where it always faces the player
Fixed to the screen or 3D? Guess latter
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
localized in MP tho?
Local Object is a thing too
I need to learn particles anyway to make a shimmery air effect...
Filepath is wrong. Also missing suffix
If it's a mission, use getMissionPath
np
i would probably rewrite to be unscheduled due to a burning hatred for the scheduler but its w/e
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
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?
@boreal parcel "ELLIPSE" is a shape, not a type.
probably disable auto combat
Assuming that you mean "without preventing the hostile forces from shooting other enemies", then not really, no.
Common method of doing undercover is to use setCaptive on the player, but that is a side switch, kinda.
Yea sort of like an undercover mode of players in one region while the others fight as usual.
It makes the player temporarily civilian-side.
Is this also the channel for particle scripting?
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
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
That will have to do then
If you use BIS_fnc_addRespawnPosition that takes in a posATL argument. It may work
hello I have a question
with attachtorelative if I attach something to a ramp of a vehicle will the attached item follow the ramp?
try it out
what are the ptsPerSquare... for in RscMapControl?
BIS_fnc_attachToRelative doesn't support attaching things to specific selections, so anything attached with it won't follow animated parts. You'll need to use the advanced parameters in attachTo, and handle the relative positioning yourself. Commands like worldToModel, selectionPosition, and vectorWorldToModel may help with that.
They all have n/a description ...
that's all we know
The sacred texts
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]];
Use a global variable
so that it gets saved in memory
I heard that globals are way slower
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
His argument is 0
Yes, that's what his code says
yeah I was thinking about that honestly, im not sure how Invade & Annex handles their respawns but i think today ill look into it and see if I cant just swap out the markers
actually I see now how it handles respawn, I might be able to instead pass an object
_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"];
you are mixing strings and objects in arrray
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?
format
Each line is probably supposed to be wrapped in a format []
Remove all _unit from the array, and instead of selectRandom _text use this:
format [selectRandom _text,name _unit]```
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
_unit = selectRandom playableUnits;
```is faster
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
selectRandom (units opfor select {isPlayer _x})
@fallen juniper The "AmmoboxInit" mode has a condition parameter that you can use to control accessibility.
event args are passed as _thisArgs not _this
I don't think that's the problem. he should do _thisArgs params ["_counter"]
yeah they do get serialized too
btw where does the game store the saves for temp (unsaved) missions?
ah UserSaved folder
yeah I had this in my actual script
when I wanted to shorten and removed the unrelevant parts I forgot to write _thisArgs
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
Thanks
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?
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.
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?
you don't need abs path for include
what editor regions? and what compiler?!
/* #region MyBlahRegion */
/* #endregion */
Compiler as in however SQF gets interpreted?
if they're typed in comments no
I know it doesn't get compiled to native code but it's certainly interpreted by the game in some fashion right?
that's called preprocessor not compiler 
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?
yes
no sure what you mean exactly. if you mean use the unit as remoteExec target no, the target should be all machines
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.
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
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.
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
Killed is a normal EH, entityKilled is a mission EH
its not just respawn tho, with vehicle respawn youll also want to manage abandonment
Hmm thats true in certain scenarios yeah. Though the scenario I may use this information in will have a vehicle cleanup every 2 hours
The reason one might use entityKilled is to have a single server-only EH that handles all respawns, by filtering by type of the object. This allows you to avoid any locality issues or having to add killed EHs everywhere.
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
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
oo another scenario I didnt think of
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
Anyone who sinks a helo without being shot down first deserves to wait for the wreck to be cleaned up anyway
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
it could be the whole server waiting on that tho. which eventually becomes 0/50 as people go to different server
can anyone tell me how to make a sector module capture trigger a simple give money script?
object event handlers: add at initialization and check condition, or add and remove as needed?
Q: for a function such as lnbSetValue, value must be a Number, cannot be a Boolean, for instance? or at least not without numeric interpolation i.e. 0 for false, etc...
https://community.bistudio.com/wiki/lnbSetValue
With the WL modules, can players earn CP for completing tasks like side missions?
got er sorted
If your thing supports pragma region.
You can use them directly
https://learn.microsoft.com/en-us/cpp/preprocessor/region-endregion?view=msvc-170
The preprocessor handles #pragma
Even if the action shouldn't be available for the rest of the mission. It's simpler to just deactivate it with the condition
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
Hello :D
Quick question, are there any big differences between those 2 commands? The only thing I can see is the alternetive syntax from cutText.
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
👍
Really? Is the documented? Also which pragmas?
See #community_wiki
ah its not on wiki
I requested that quite a while ago and forgot about it 
So I can do #pragma once and it'll actually work? Or does it just get ignored?
just gets ignored
So preproc ignores all pragma?
yes
You can use it for custom tools
Like ASC does https://github.com/dedmen/ArmaScriptCompiler/commit/af94a8e1adc978dfe264434c8e5cb448f822c4bf
So its just an invalid command like #lol
no
That would error i guess
That's an error
No. As wiki says it takes Number. You can use a number as a bool anyway: _value != 0
You can also just make a macro for it if you don't like it: BOOL(x) (x != 0)
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?
no
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 {};
While? 
no
You can also use waypoints and waypoint completion statements
Thats pretty much what I was going to look into next, to trim down a bit of the copy-paste I have going on 😅- just wasnt sure if itd work well without passing the _heli/_helipad/_helipadActiveVariable to the function.
That might also be an option... id have to sort out the other functions and how theyd fit in, but it shouldnt be too much of a hassle - literally just 'run this function to add troops, wait until all troops are out'. May consider as an alternative.
Why no macro? No extra call needed
I don't like macros
Macros don't too
this
it's coarse and rough and irritating — and it gets everywhere
oh wait, wrong franchise
Talking about your crab lice again?
we said we wouldn't talk about them nor where we got them!!
Sounds like std
I have, at best, a rudimentary understand of how macros work, and they still terrify me xD
I just know id pick an absolutely stupid macro name and get myself into piles of trouble.
one macro for uniforms does make life super easy too
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
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
You can do some fun stuff like #define true false
no
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.
#define debug if (is3DENPreview) then {
#define enddebug };
debug hint "it works"; enddebug
// translates to
if (is3DENPreview) then { hint "it works"; };
```and I hate that
Had me legit wondering if 'enddebug' was a command needed 😭
No its just };
Yeah, had to read twice
Is __VA_ARGS__ in?
It's used a lot in config since there's a ton of repetitive stuff and there's no such thing as functions (or for) in config
Also that. But scriptwise
that's usually bad
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
Well macro is copy paste replace in a sense. Just that you let machine do that. Instead of doing it manually
copy paste with more setup
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.
my unit mods entire config is macro
not a single entry in config.cpp aside from class cfg[...] that isnt a macro
Read the wiki for preprocessor.
only #pragma is missing
Well if one is missing, there could be more 😉
(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
0-20 times per second
do not pV that
Is there a way to make this marker removeble by players?
_marker = createMarker ["marker", player, 1, player];
_marker setMarkerType "hd_dot";
_marker setMarkerColor "ColorGreen";
yes - prefix its name with __USER_DEFINED iirc
hmm, not that but it's possible
_USER_DEFINED should work
So _USER_DEFINED_marker = .....?
no
like```sqf
createMarker ["_USER_DEFINEDMySuperMarker", player, 1, player];
Ok thanks, will try
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";
each marker needs a unique name, yes.
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
_pos = getPosWorld player;
_marker = createMarker ["_USER_DEFINEDMySuperM" + str _pos, player, 1, player];
_marker setMarkerType "hd_dot";
_marker setMarkerColor "ColorGreen";
```So something like this?
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)
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
What do you mean how?
The same I'd say
As in do I need different compile targets or some other special considerations, or are the dll's fine
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?
You need to compile two for linux 32/64 and two for windows 32/64. If you wanna be all inclusive
You could call recursive function and log depth...
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
Ye
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...
there is that command to dump the current callstack. That'll tell you how deep you are
would be helpful thanks
diag dump?
stacktrace, I see, thank you
ah I see what happened, undefined #define expected results... thanks...
and success.
AFAIK SQF's "stack" is just the entire heap (i.e. it's dynamically allocated) so the only limit is as much RAM as you can get 
except in unscheduled
if you do something that doesn't just use the stack
like isNil/remoteExec
Interesting. What's the limit then?
stack memory
Does Arma use 1 MB for stack?
more I think
We accidentally discoverd that you can crash Arma by recursively adding event handlers. Takes a few seconds.
or infinite recursion in some EHs
@rugged fern https://community.bistudio.com/wiki/attachTo
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.
waitUntil{sleep 1; !(isNil "BIS_fnc_init")};
I found out that clicking on a empty CT_COMBO also crashes the game 
How do I get the supports to work on a live server, the artillery, air taxi, and CAS?
Not finding much.
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.
why change the namespace? 
things in localNamespace can't be broadcast across the network
at least that's how i understand it, could be wrong
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 {};
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
if said malicious actor has that level of capability your function being broadcast across the network is the least of your worries
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
if you are concerned about your scripts being stolen, have the modification only on the server
a malicious actor could still retrieve them using remote execution
then disable remoteexec and use cba events system 🤷
or just dont use cfgfunctions and define the functions on the servers localnamespace manually
i've seen people do that method outside of cfgfunctions and suffer performance wise i'll have to look into cba events
eh? it's no different, cfgfunctions is just protecting it
{
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']
];
put that inside a server mod pbo's fn_preInit.sqf
https://community.bistudio.com/wiki/compileScript
Any help?
You can also retrieve them from the localNamespace using remoteExec
And you can modify the localNamespace using remoteExec
If you thought localNamespace was for protection against malicious intent, well you got it wrong
how can you retrieve them?
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.
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 😆
With cfgRespawnInventories, is there a way to add a custom role to someone and just have it grab all loadouts associated with that role
This does not seem to fix the issue :(
Tho I assume it is still better to keep to avoid the check happening more times than it is needed?
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
So consider moving it from initPlayerLocal.sqf to onPlayerRespawn.sqf?
Or do you mean something else entirly that I am misunderstanding?
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
Uhhh, while that can work, the whole point is automating all of this so I need to find a way to make it work 😅
Also the aproperiate time is usually as we load in where you start in the black screen and fade into whatever the view is
Then make sure it's the last thing that's done in initPlayerLocal
And spawn it from there
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.
So no need to switch them around I guess?
Ah oki
Wait this isn't in a gui is it?
If it is you will need to use uisleep instead of sleep
Uhhhhh...
||[The statment above translates to: I got no clue >_>}||
Replacing all sleep statements with uiSleep right now, all beside the one inside the waitUntil
👍
Will come back with results in bit, turns out there is a final exam in 20 minutes ago >_>
Ok crisis avoided
Seems to have no effect, if anything they overlap even more now
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.
[]
So the way I had it?
Yes
okay, thanks
[] <- an empty array
[""] <- an array with an empty string
[[]] <- an array with an empty array
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?
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.
No. insert and append take arrays. pushBack uses any
Okay, thanks.
So, pursuant to this, it seems like unit inits are called before all of the various initServer, initPlayer, etc - so do I just add a waitUntil {!isNil BIS_fnc_init}?
These units won't be spawning anywhere near players, so there's no chance of them peeping the horror early.
no
you can't suspend init fields
one thread per unit, yayyy
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.
how is the wraithUnits array meant to be used?
locally?
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
then I guess locally?
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
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?
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
8 is not really much at all. not perfect no, but imo if its just 8 scripts and youre at intermediate or beginner SQF, your time is best used by making your thing work and be fun instead of worrying about script count.
now if you have 50+ then yes youd need a restructure, or rather, even id say itd be worthwhile
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
from what ive seen, theres designers who fret over optimal, and theres designers who publish completed content
rarely crossover
cba waituntilandexecute instead of waituntil 🙂
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
guard waypoint not work?
Move waypoint that never completes, or guard
Guard may be undesired, due to them responding to combat quite a distance away
Hello! Could you please suggest a script for bot cowardice? I want the bot to surrender in battle if it is too cowardly
yeah I'd rather have them react only if they are directly attacked
try a move waypoint then a guard waypoint
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.
alright, thx
you meant to say they publish 12FPS power point slide shows
;P
wat?
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.
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
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
Aren't you supposed to define a resistance/greenfor side too?
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
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.
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
By definition do you mean the faction config in the init? or something I should add to the description
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
try "CSA38_CSA38"?
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
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
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
You could in theory make a Poland indep faction.
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 :/
Not even sure myself, but probably something like this:
- Make copies of the opfor poland uniforms but with a different side flag.
- Make copies of all the polish units except with the greenfor uniform.
- Make a CfgFactions that uses those units.
config-makers people would have a clearer idea.
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
You would need to make a mod that depended on IFA.
IIRC uniforms are odd. There's a CfgWeapons definition that points back to a CfgVehicles unit which has the side parameter.
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
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?
yeah all dialog vars go away... become null when closing the dialog with closeDialog
I want to modify an array in a script included by a mod, what's the best way to do it?
perhaps to clarify, i.e. when I do something like this:
_display setVariable ['my_display_state', 123];
i.e. vars actually on the _display DISPLAY object, i.e. 'my_display_state'?
Not even sure if there is a “better” way than “just do it”. I actually don't know what makes this question so that's the only answer
yes you can save values to the display , if that's what you are asking? but when the display closes i assume the values at display wont exist anymore
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 ...
The setVariable wiki page contains a list of types of things which have their own namespaces. Display is on that list.
right but my question is more the GC aspect when the display is closed, i.e. destroyed
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.
if the playable slot isn't populated and unit isn't spawned - the variable is undefined 
so that error will go away when it's got a player on it?
Not unless both RD_1 and RD_2 are on.
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.
isEqualTonot==, there's a difference, especially re: object referencesmissionNamespace getVariable ["rd_1",objNull]when you are uncertain as to whether this slot is logged
what else you do, shrug, depends on your code
so replace isEqualTo with missionNamespace getVariable ["rd_1",objNull]?
or maybe https://community.bistudio.com/wiki/vehicleVarName on player and compare it to string. May work 
you know how to do the logical reduction.
still can't figure it out
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};
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?
No, maybe make some attempt to understand what the code is doing and why?
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.
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)
yeah it makes sense, it seems like the dedicated server does not have data (a 8×8 texture…)
ive made a bug report on their github page in the meantime
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));
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
Many ways.
But you can add +1 in exist value
//Outside of function
TimesRan = 0;
// In function
TimesRan = TimesRan + 1;
:0
Is natural lightning synced across players in MP? Will all players hear it at the same time?
how would I convert the direction I get from vectorDir into a bearing in degrees?
Why not use getDir?
Anyway to answer the question: use atan2
the direction is coming from the weapon direction
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?
tysm, sorry forgot to thank ya :D
That's more related to #arma3_config and #arma3_model
What you want to make doesn't need any scripting
ah cheers
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
Is there an event for nightvision toggle? No right?
Just curious, what do you mean with 'cache geolocator'? Haven't played Old Man myself but got curious 😄
Also regarding my earlier question about pVs, thanks for the reply @winter rose
when you have a feature called "Geo-Finder" enabled in your, uhh, phone, whenever you are close to a cache it will start producing sounds, the more frequent the closer you are to that cache (and when you are looking at its direction)
cachhe was an ammo box or weapon crate most of the time
Are the caches predetermined or should they be able to be found dynamically based on object type?
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
if the command to make the squad react if the enemy is more than for example 10 people?
ctrlText ?
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.
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.
I guess you could setCombatMode lower, although IME fleeing is plenty.
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
Does anyone know how to get the bot to move into cover?
Anyone know of an EH that fires on vehicle destruction and return the wreck produced by the destroyed vehicle? Or something to that effect?
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.
Ah, no I was not aware of that, that's pretty helpful
It's not like buildings.
I assumed it was, sweet!
how will the bot know that he needs to take cover? (I mean random hiding place) For example, the squad was walking along the road, and they started shooting at them. I want them to run to a random fence.
If it's a behavior of the AI. Then I would look at making a FSM
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.
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.
what is the command for recognizing one bot by another? i.e. i want a certain bot to recognize another bot and get something
bot1 recognized bot2 (a particular bot)
that doesn't exist
what are you trying to do?
you do have https://community.bistudio.com/wiki/targetsQuery
The scenario is this: my bot blue is watching a crowd of red bots somewhere far away and when blue sees the right red bot (boss) the trigger reacts
Thank you, I will try it
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?
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
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!
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
}
yeah! that's exactly what I had in mind. That works. Thank you!
oh I messed up the if exitWith lemme edit my messages
(though maybe you meant count(_cargoObjs) rather than _cargo, no?
Thanks, Guy. I had something like this in mind. Just wanted to see if it made sense to y'all.
np, it makes sense to me but I wouldnt doubt people who have been doing this much longer than me could suggest better ways
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?
you can use the skiptime command, but that would show the black screen with the text everytime I think
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
};
if you are setting the date in the editor at mission start you could make use of example 1 in place of _desiredTime
https://community.bistudio.com/wiki/missionStart
example 1:
setDate (missionStart select [0,5]);
onEachFrame could be considered a loop too
eh, it's called every time the game loop... loops
I suppose so, but it's a bit stretched logic :D
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)
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 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
Use a pfh https://dev.withsix.com/docs/cba/files/common/fnc_addPerFrameHandler-sqf.html
Add an ace interaction action or addAction for when wearing the vest to "inflate the vest"
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
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
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.
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?
should be !isNil "RG_SupplyVics"
oh, duh. Thanks John~
Also don't use this as the internal var. That's horrible :P
just use _veh or something
hehe shush. Been scripting all day 😛
But yeah, I know.
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.
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)
There's no doubt about exactly when or where the vehicles end up in the array.
Got it.
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)
Thanks guys :)
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.
As a general rule you want to make code as deterministic as possible.
Small fix, though.
oh, classnames, yeah.
Cool, that makes sense. Will keep it in mind going forward.
I swear, between all the help y'all have given me over past few months, learning scripting is going better than expected. So, thanks a lot! 🙂
It's good for things that have to be real-time like it's said in the ACE wiki article about it
just got home from work... thanks to all the replies on my question last night!
@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
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.
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
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.
tbh the way configs are handled in-game are ridulous anyway
Loading from file EVERY time they're needed
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
The slow part of the config viewer is not reading the config, but filling the listbox from my testing
On an SSD?
Nope.
There is no point.
Wouldn't be much benefit in it
configFile is not the issue I think.
getNumber, getArray, isClass etc. are the reading from disk part
If thats even true
ACE does config caching
It wouldn't make much sense to do that if it was already cached
Yes, for the interaction menu.
Plus, it might have made sense to do it that way when OFP was released
If memory was a limiting factor
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
Depends on the machine I guess.
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
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
The mod people in my community rage about it all the time
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
Game is hard
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?
@tough abyss
It's exactly what happens here: https://github.com/acemod/ACE3/issues/2814
0.0019989 ms from var
0.0056734 ms from getText on an SSD
Why store that on the vehicle and not dynamically create a variable?
Would save you one call for each duplicate
missionNameSpace setVariable
yes^
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
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
Depends on, what kind of Mission.
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
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
yup
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
Good question, I think doing a math is the only way?
Wasn't fog emitting some sort of a sound? Perhaps that would be a thing you could check 🤔 .
the value for "fog" is the same throughout the map unfortunately
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 💀
is there a way to make ACE Arsenals Player/Role Unique without placing one for each Player/Role?
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 :>
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 😁
Man I am so stupid, I was tinkering with this code for a while and I completely forgot about (). I will check it it works now. Alright I will use CAManBase, thank you 🙂
And in code
private _unit = _this select 0;
private _type = typeOf _unit;
switch (_type) do {
....
};
I think variables in uiNamespace are not lost between mission changes
*I think because
Edit is possible here :P
All these new tricks. It's hard for old dogs to keep up :D
wait, Edit is new? XD
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?
Editor -> Esc -> Tiny little symbol on the left of Local, Global, Server
Watch out: Don't use createVehicel or something like that^^
hmm okay, but what should I try running to test code performance
Do I need to call enableCamShake false after calling addCamShake or
- is it only if I want to prevent
addCamShakefrom being called? - is it only if I set
enableCamShaketotruebefore?
And see if maybe too many silly scripts are running and slowing down the game?
you don't need to call it at all. addCamShake eventually ends. I think it also stops shakes from grenades and such (maybe i'll test it).
gotcha, just making sure, thanks
Basically : Will other scripts I'm running in the background affect the code test?
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{};
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
Why don't you just test it?
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
Anybody here knows any alive mod scripting?
I assume it would be recommended to check their Discord
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;
if you just removed it without replacing it by anything, you didn't need it in the first place 😄
No no, it was used. I changed _param1 to (_x select 0) and so on.
if you know your data and performance is the issue, go for select
So critical code will be now critical... and ugly.
the thing that slows it down is creating the array
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
the () won't make any difference
Thanks a lot Leopard.
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?
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?
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
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
_artillery doArtilleryFire [getPosATL _target, "Magazine_class_here", 5];```
_target would be the player variable?
I was doing getposATL (thislist select 0) on a trigger activation
_target in this case is a placeholder for whatever object you want to get the position of
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
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)
Its currently SP but that part of it works for the most part
I tried to just use the repeatable part of the trigger but it wasnt working probably because the trigger isnt deactivated and reactivating fast enough
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.
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
Then you should be able to use a repeatable trigger and no need for a for loop
is this where i ask question for scripting
The channel name may be a clue
ok
Ya the problem is it wont deactivate and reactivate fast enough
Might have to switch it to "detected by X"
I have no idea what your current trigger conditions are so 🤷
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
Can do that with waypoints
A Search & Destroy waypoint is the simple option
Seek and destroy then loiter or sentry
Why
You can create waypoints with scripting
oh i didn't know that
Its basically the same thing tho
https://community.bistudio.com/wiki/addWaypoint (see related commands too, you'll need them)
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.
yeah the heli ai sometime attacks then after it just loiters around even there still ai on the ground
You can help them a bit with repeated use of reveal but to some extent you just have to take what you can get
Reveal?
Not reveal, reveal
https://community.bistudio.com/wiki/reveal
with seek and destory how large is the area it searches and how can i increase it
In the condition field where it says this, try using this && {unitReady name_of_mortargunner} (and maybe set the trigger frequency to a couple of seconds for pacing)
Allegedly the search radius for helicopters is about 300 metres (they will engage outside of this if they happen to spot something). This is internally coded based on the unit's capabilities and can't be changed.
does it work for jets and aircraft
Probably technically yes but jets are even worse at spotting ground targets than helicopters are
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
I thought there was a command specifically for dispersion?
Does anyone know how the following waypoint works
This tells you how every waypoint works
For some reason it wont even activate with this
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.
I guess closest I can get is BIS_fnc_randomPos
Try referencing the vehicle itself instead of the gunner
I tried both
You can use that, or you can randomise a position yourself quite easily
(getPosATL player) params ["_x","_y"];
_newPos = [random [_x - 50, _x, _x + 50], random [_y - 50, _y, _y + 50], 0];```
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)
Okay ill try that, trying to set up the random bit first
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?
Remove "bombHere")
Im not sure what that was even for tbh
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...
Hmm its pulling an array error on activation
"An array error" isn't a kind of error. What exactly does it say?
That its missing an array. Ill tell you exactly in a second
"Error type SCALAR, expected Array"
"Object, group, locations, string"
You need another set of [] around the first bit, [[[(getPos .... 500]]
Ill try it
[[[
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)
Ah always wondered what those were actually doing lol
So no errors but the mortars arent even firing anymore
Well you're generating the position and then not doing anything with it
Pretty much what I got going on, not sure if I wasnt supposed to replace the script I had before on the trigger
You ain't got no doArtilleryFire my dude
Okay ya I thought that was the problem
So I just out my old script after the BIS_fnc_randompos?
Make sure to change the target to _barragePos
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??
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
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
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
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
Once the trigger is made properly repeatable that should take care of itself
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
So I should probably change it back to bluefor preset so its always activating
This is what the trigger looks like so far
Detected by INDFOR should also work provided someone is actually being detected by INDFOR
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
The only thing that should happen is the appearance of TRUE or FALSE in the return line immediately below the console
Ya I dont see either it just copies what I put in there
Don't include the this && { }, that's the part that combines it with the trigger condition which doesn't exist in the debug console
Yes, probably. The unit is not ready because it has an uncompleted wp
That would make sense cause the trigger is also a skip waypoint
You shouldn't need a hold wp for a static crew, just lock it and they won't go anywhere
And if its preventing the trigger from actovating they will never complete it
Oh its working perfectly now GG
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
No problem
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
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
what's wrong with iterating through and array, sqf is single-threaded anyways?
ah, the while loops 
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 
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
Drag Dead Body Script By BangaBob DescriptionDoes what it says on the tin. Hide dead bodies by dragging them out of sight or loading them inside vehicles. Fully Dedicated MP compatibleInstructionsSimple Copy this code into your Init.sqfnull = allUnits execVM H8_dragBody.sqf;Functions [uNIT1,UNIT2...
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.
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?
notificacions
Spanish much? 😋
typity typo
Did you spawn the posted command per each unit? Eg [unitName] spawn H8_addDrag?
a bit unclear whats the problem but i noticed BIS_fnc_showNotification can only show one notification at a time
it wont show certain notification types in dedicated environment
well its client only thing
nope
from what I know the function only deals with UI and does not check "if isServer" or "if isMultiplayer" etc
no?
ah I see your point
i wonder if it would be a config based situation, specifically with difficulty since some notifications have a parameter for that but the wiki doesnt explain much
difficulty[] = {"netStats"};
This referes to the scoretable for example.
I'm checking the function's code
// Required difficulty settings. All listed difficulties has to be enabled
as per https://community.bistudio.com/wiki/Arma_3:_Notification yes
@kindred zephyr so this difficulty setting needs to be set/enabled for the notification to be shown
what takes precedence in this case since its local?
User profile difficulty, mission difficulty or the server difficulty?
most likely server
server settings override player settings ofc
got it, gonna give it a try later
the server decides whether or not you can tacticalPing, see death messages, etc
my guess is that BIS_fnc_showNotification uses difficultyEnabled which is now deprecated
see https://community.bistudio.com/wiki/difficultyEnabled
and https://community.bistudio.com/wiki/difficultyOption
gonna consider this then, if not the worse case scenario is that i just need to adapt the function to show all the notifications disregarding difficulty since it doesn't seem to be working or declare a child class without the difficulty stuff. The server does has the scoreTable enabled after all.
That or netStats its not the score table.
Anyway thanks for the info
the function uses difficultyOption, but difficultyOption does not support netStats according to the doc, so unfortunately… here we are
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
and change the fact it can only show single notification at a time 😉
that's by design, not a bug 🙃
they are queued anyway, so once one its gone the next shows up
but in here: https://community.bistudio.com/wiki/Arma_3:_Notification you can see two notifications 😮
that's good
old font, old screenshot, old info
lol ok
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
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?
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]]
(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
Appears to be the case: #arma3_scripting message
Whether it's intended, 🤷 but seems too specific to be an accident
I had a déjà vu here 😄
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
this works
you most likely call this where _cameraai is not defined
I can help you later tonight, I got mine to work. After asking here several times.
oh nice. yeah I saw your posts when searching, just didn't see that you also ran into that error message
Well it doesnt
yee thats the issue, how do I define a variable name of a unit I just spawned in
I’ll send you over the info when I get home
no underscore = global scope variable
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
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
n++ with sqf language definition
Visual Studio Code + SQF plugin
(which should prooobably be renamed to Code Editing)
Good evening!
I got a question ( didn't find it on wiki ). Is it possible somehow check player arma startup parameters with script?
not afaik
why
No. Do I need to add variable names to each unit that this might apply to?
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