_logic = _this param [0,objnull,[objnull]];
_params = getArray (configFile >> "CfgVehicles" >> (typeOf _logic) >> "effectFunction");
_fnc = "";
_nr = 1;
if ((count _params) > 1) then {
_fnc = _params param [0,"",[""]];
_nr = _params param [1,1,[1]];
} else {
_fnc = _params param [0,"",[""]];
};
if (_nr < 1) then {_nr = 1};
if ((_fnc != "") && !(isNull _logic)) then {
_emitterArray = [];
while {_nr > 0} do {
_source = "#particlesource" createVehicle (getPos _logic);
_emitterArray = _emitterArray + [_source];
_nr = _nr - 1;
};
_logic setVariable ["effectEmitter",_emitterArray,true];
if (isMultiplayer) then {
[_logic,_fnc,nil,true] call BIS_fnc_MP;
} else {
_logic call (missionnamespace getvariable _fnc);
};
//--- check if all triggers are still activated
[_logic] spawn {
scriptName "fn_moduleEffectsEmitterCreator_triggerLoop";
_logic = _this select 0;
_triggerList = synchronizedObjects _logic;
_emitterList = _logic getVariable "effectEmitter";
if ((count _triggerList) > 0) then {
while {(!isNull _logic) && (({!(triggerActivated _x)} count _triggerList) == 0)} do {
sleep (0.8 + random 0.2);
};
{deleteVehicle _x} forEach _emitterList;
};
};
} else {
["No particle emitter created! Missing module logic or function name."] call BIS_fnc_log;
};
#arma3_scripting
1 messages · Page 572 of 1
I’m guessing the answer is no but does anyone know if there is an event handler available for admin login? CBA or vanilla? I haven’t found one but thought I would ask. Alternative is to check for command available, I know.
Your guess is correct
Rip
question would be: "why do you need it?"
God has logged in with is ban hammer <
Just didn’t want to have a onEachFrame check. And because my system needs to know who is admin logged. Mostly because we have an adminlogged curator but for other uses as well.
Not actually but wait until and such is executed every frame is it not?
simulation frame, not each drawn frame
^^
Fair enough probably shouldn’t have mentioned the draw handler. Yeah I was gonna use wait until or a while loop with a delay to reduce processing.
Is there any performance difference between the CBA variant and the vanilla one?
For waituntil that is
Performance not afaik, utility yes.
Yeah basically unscheduled vs scheduled respectively right?
No, they behave the same way. CBA has extended event handlers for example, to add EH to classes, objects, etc. Chat handlers too, code is unscheduled.
Yes however the CBA variant of waituntil: waitUntilAndExecute can be used in a unscheduled call function. waitUntil can only be used in a scheduled spawn.
Right, but in regards to any EH like Hit, Killed, etc. Same function
Well, tbh I consider EH a bit different from waituntil though functionally similar.
They are used differently
¯_(ツ)_/¯
Would this capture all mass values even if they are located in subfolders like configFile >> "CfgWeapons" >> "Medikit" >> "ItemInfo" >> "mass" is
"getNumber (_x >> 'mass') == 1" configClasses (configFile >> "CfgWeapons")
Because i'm not finding any items with a mass of 1 (but i do find them with masses 0 or > 1).
No, the condition for configClasses is true or false to return config
if mass is a direct child class to the config
then yes
ah i see thanks
another question; when using remoteExec to let's say add an addAction like this
(_addActionParams) remoteExec ["addAction", -2, true];
How would i capture the return value of the addAction function?
remoteExec only returns the JIP ID ..
(i need to call removeAction after a condition is met on all clients)
use addAction condition then
addAction has passed parameters for action ID
so whomever you're executing the addAction for can/will receive the ID
So the goal is to provide an addaction to everyone, then remove it from everyone right?
The server is running the remoteExec.
This is how it looks right now
_addActionID = _unit addAction _addActionParams;
(_addActionParams) remoteExec ["addAction", -2, true];
// Some stuff happens
_unit removeAction _addActionID; // <-- _addActionID is undefined
[_unit, _addActionID] remoteExec ["removeAction", -2, true];
i tried to make it so the server does the addaction first to get the ID, this doesn't work though
Is there something different between each user’s action or are the all identical?
Why not use the condition parameter for addaction and a public variable?
Yeah that could work, i forgot about the addAction's condition
Create it locally on every client. And just use a public bool? Once server get to where it needs to remove it you change the bool to false and broadcast it public. Public variable also gets resent for jip so you don’t have to worry about that.
But would that 'delete' the action forever after the condition returns false, or just hides the action until the condition becomes true ?
hides
So calling the remoteExec "addAction" for the 2nd time would add a second addAction?
or i have to check first if the action exists already
Is it the same action?
yeah
Just flip the variable and broadcast it public again
It essentially is just a global variable on everyone’s ends
Yeah but that would mean something like this
pseudo code
_addActionParams = [..., condition, ...];
if (!addAction_set || isNil "addAction_set") then {
(_addActionParams) remoteExec ["addAction", -2, true];
};
// Broadcast public variable here to make the `condition` return true
addAction_set = true;
To prevent the remoteExec running multiple times? (again this is the server)
If the action and it’s function is the same every time, you do not need to use remoteExec to add it to each client
Instead have each client give it to themselves and use the condition to control its visibility
check for nil first ,and use lazy evaluation
If the action and it’s function is the same every time, you do not need to use remoteExec to add it to each client
The addAction is added to a unit spawned by the server, so it's not "the same every time" as in i could hardcode it.
Instead have each client give it to themselves and use the condition to control its visibility
How would you achieve this if all the "setup code" is done on the server
check for nil first ,and use lazy evaluation
Yeah this was just some pseudo code 😉
So the action is added to a unit spawned by the server? So let me get the criteria:
Action is added for every client to unit(s) spawned by server.
Action must be able to be disabled and enabled by server for all clients.
Anything else?
No that seems right
Alright, here is a potential solution.
When the server creates the unit, it remoteExecs a function for all clients that adds the action to the unit.(pass the unit itself through the remoteExec for use by client to apply action)
Action is still controlled by either a public variable, if it is a single unit, or a setVariable on the unit itself if there are multiple.
Server can freely control the public variable or the setVariable on the units to control action availability.
Anything else?
Note the function is not an addaction but instead a separate function availiable to all clients
ah yes ofcourse
In that function, there is the addaction
that looks like it could work
it remoteExecs a function for all clients that adds the action to the unit.
Didn't think about this
That theory should work for multiple units and actions if needed as well.
Just add variables as needed
So that would be a function defined in functions.hpp and then a file for it fnc_NAME.sqf ?
However you define it is up to you, it just needs to be available for clients and server
Okay i think i understand now, thanks for your time
Np
You want to spawn smoke via script? Yeah possible
I'm trying to create an addAction condition which looks at a variable of the unit the action is attached to
condition on the addAction
(_originalTarget getVariable ['showBuyOption',false] isEqualTo true)
This addAction is created on all clients using remoteExec.
After some setup code, the showBuyOption variable is set to true using the following code
_unit setVariable ["showBuyOption", true, true];
But somehow the clients cannot see the action on the unit.
Here is some debug code ran on the client
cursorObject getVariable ['showBuyOption',false]; // Returns `true`
cursorObject is the unit which should have the action
(everything is ran in a local hosted MP game if that helps)
this is the actual code (sorry but i'm to tired to strip the non essentials)
_addActionParams = [localize "STR_antistasi_action_buy_dealer", {nul=CreateDialog "dealer_menu";},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (_originalTarget getVariable ['showBuyOption',false] isEqualTo true)"];
([_dealer] append _addActionParams) remoteExec ["addAction", -2, true];
// more stuff
_dealer setVariable ["showBuyOption", true, true];
@thick lintel are u still here?
Have you made sure the action itself works? Change the condition to true and make sure the action is added
if i strip the showBuyOption part from the condition it works
You set your condition to true after you try to add the action
Do it the other way around, see if it helps
If that doesnt fix, make sure the _dealer and _originalTarget are the same entity.
last thing i'm gonna try before calling it a day
Do it the other way around, see if it helps
@spark turret did not work 😦
If that doesnt fix, make sure the _dealer and _originalTarget are the same entity.
@spark turret will try tomorrow, you think theremoteExecchanges something about the entity?
Yes that works fine
as i said, stripping (_originalTarget getVariable ['showBuyOption',false] isEqualTo true) from the condition works
but i'm gonna log off, thanks for helping me out and have a good one
You can delete the isequalto true
Just (_originalTarget gezVariable bla nla) is already checking for true
@spark turret will try tomorrow, you think the
remoteExecchanges something about the entity?
@ember citrus
I gotta be honest i dont know why its not working. Your variable is public and should be accessable on all clients
hello is there a way to exclude from nearEntities (or using a different syntax function) the objects hidden by hideobjectglobal, I need that for construction interface.
with this line I use to hide some map objects to prepare an area to build base, but then
if (count _isFlat == 0 || count (((position _preview) nearEntities 4) - [_preview]) > 0)
is not working also if tree are not visible on screen they are still counted and I can't build doesn't matter if I don't see tree and terrain is flat, but I can't build cos the near entities return the deleted items, and I can't remove the nearentities check or there will be no limit and build can be stacked one above the other or inside map buildings.
I tried also to add setdamage1 and enableSimulationGlobal false but still, they result as near entities I don't know how to fix that problem, please help
you could get the list from nearEntities, and remove the items from that list which are hidden and/or destroyed
how can I remove hidden items from the nearEntities array?
I mean my question is exactly that, it's possible to know the state of map objects returned in near entities array?
something like this (not tested)
((position _preview) nearEntities 4) select { !(isObjectHidden _x) };
if (count _isFlat == 0 || count ((position _preview) nearEntities 4) select { !(isObjectHidden _x) } > 0) then {_color = _colorRed};
doesn't work
4:02:11 Error in expression <nt ((position _preview) nearEntities 4) select { !(isObjectHidden _x) } > 0) the>
4:02:11 Error position: <select { !(isObjectHidden _x) } > 0) the>
4:02:11 Error select: Type Number, expected Array,String,Config entry
because it now tries to check for hidden objects on a count...
if (count _isFlat == 0 || count (((position _preview) nearEntities 4) select { !(isObjectHidden _x) }) > 0) then {_color = _colorRed};
tested, no errors but doesn't work
Without the full script and exact conditions it's also a bit hard to give a perfect solution...
Although it should give you some ideas on how to solve it yourself
with construction interface I have an object that remove terrainobjects with this code:
{
_x setDamage 1; _x enableSimulationGlobal false; _x hideObjectGlobal true;
}forEach nearestTerrainObjects [_position, ["TREE", "SMALL TREE", "BUSH", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "FOREST", "ROCK", "ROCKS","FENCE", "WALL", "POWER LINES", "HIDE"], 25];
deleteVehicle _defense;
};
ok this works fine, and delete the tree rocks etc.
but then if I try to build
I don't know how if the like we wrote remove the hidden objects from the count, so if there are 2 tree 1 rock all hidden the result of that will be 0 ?
your if...then statement is now taking all entities within 4 meter from _preview, removing all entities which are hidden and if the amount is more than 0 it will return true
no idea that the count _flat == 0 is doing
that's not interfeering with our code
but to be sure I can remove it and use only our code
no you are right
it's interferering
perhaps it needs to be && instead of ||?
it's my fault I should have post also the previous code
_isFlat = (position _preview) isFlatEmpty [
(sizeof typeof _preview) / _minDist, //--- Minimal distance from another object
0, //--- If 0, just check position. If >0, select new one
_maxGrad, //--- Max gradient
(sizeof typeof _preview), //--- Gradient area
0, //--- 0 for restricted water, 2 for required water,
false, //--- True if some water can be in 25m radius
_preview //--- Ignored object
];
well, if you read the wiki page of isFlatEmpty you would know that the second parameter must be -1
but I should also add to ignore objects the hidden objects ?
could help, since I don't know how this function works internally
Ican't put -1 will allow to build over other objects
The second element must be -1 (<= 0 really) at all times, otherwise command becomes unusable
from the wiki
yes but the proximity works fine, example if heavy factory it need more space to build if the command center is smaller you can put closer to map objects so that's working fine
although ignoreObject only accepts one object, and not an array
well then I don't know how to fix that
thinking about a logical solution
so the problem is this isflatempty keep considering map object also if they are hidden
hidden/damaged/without simulation
well, set minDistance to -1 to ignore proximity check
this will only check if it's flat enough, and then the second part of the if...then statement will check if there are objects nearby
and instead use the gradientArea to check if the area is flat
if I use -1
let me build over map objects tree / building
but near entities check stop me to build near vehicles
so I have to say what we wrote on near entities was useless cos is already not counting the map objects at least that's the result I hve now
I have no clue how to fix that
maybe
I need another or
using
so its flat empty will check the flatness, nearentities vehicles / soldiers, terrain objects the terrain objects
so I should use the !(isObjectHidden) on the near terrain
let me try
@exotic flax THANKS THANKS THANKS A LOT! it works now
thank the wiki 😉
well before happiness I hould try on dedicated server I am now hosting from editor and sometimes it has different results
now, I have this situation
vehicles and soldiers are working
terrain objects are working
but building that I constructed are not working
I'll need a third check...
I guess it's nearestObjects for the warfare buildings
nearObjects
if (count _isFlat == 0 || count ((((position _preview) nearEntities 5) select { !(isObjectHidden _x) }) - [_preview]) > 0 || count (( nearestTerrainObjects[position _preview,[],12]) select { !(isObjectHidden _x) }) > 0 || count (((position _preview) nearObjects 12)- [_preview]) > 0) then {_color = _colorRed};
I didn't give up 🙂
now is working but I need to find the size of the item instead use 12 meters, what's best method to get the size of the object (radius) ?
sizeof boundingbox or boundingboxreal 🙂
Hi.
I have a mod for map markers that is compatible with TFAR.
Here's an example: if a player doesn't have a long-distance radio, they can't put a marker on the map in the side Channel.
It also changes the marker interface.
The problem is that if I run the mod together with the ACE mod, but the interface doesn't change and the mod doesn't work correctly. Who can help me with this? I would write to the author of the mod, but on the site where I found the mod, the author has not been online since 2017.
The mod was created in 2015.
https://forums.bohemia.net/forums/topic/228004-d_map_adv_markers-for-ace/
Help please 🙂
Not actually but wait until and such is executed every frame is it not?
No, at most once per frame, but usually less.
Is there any performance difference between the CBA variant and the vanilla one?
For waituntil that is
The CBA one executes every frame, in unscheduled, ignoring the 3ms time limit. So yes, there is a performance difference.
No, they behave the same way.
No they don't @high marsh
How would i capture the return value of the addAction function?
Don't remoteExec addAction, instead use call or a custom function, that grabs and stores the ID. @ember citrus
return value of remoteExec doesn't make sense, because you are running the code on multiple players, so a single returned ID could never work.
condition on the addAction
_originalTargetvariable is undefined
isEqualTo trueis nonsense, unless you expect the variable type to be something other than boolean, which is nonsense too as you never set it to anything else.
But somehow the clients cannot see the action on the unit.
Yes as the condition is never true, as _originalTarget is undefined in the condition.
@lapis ivy Afaik ACE also modifies the marker creation interface, you can't run two mods that replace the same thing.
unless you write the mod on top of ace
@still forum How do I make it on top of ACE?
You rewrite the mod to modify the ACE version of the UI, instead of the vanilla version, and add ace to required addons
is there a way to reorder my squads in the MP lobby, or do I just have to go through and replace/regroup everyone? (also this probably belongs in editor, my bad)
replace everyone
there is a WIP UI to reorder them in CBA, but it hasn't landed in release yet
F. Alright thanks. Hopefully that lands before I get to release lol
Ctrl+X Ctrl+S / Ctrl+Y (or Ctrl+V?) Ctrl+S could do
Thats what I'll probably go with. Was just wondering if there was a way I could be lazy 😁
nah 😛
Can anyone confirm that sqf [true,10,10] call BIS_fnc_EXP_camp_setCinematicMode; ignores the fade values (10,10) ?
It works fine when disabling the effect.
Oh I see the issue sqf 0 cutText ["", "BLACK FADED", _fadeScreenTime]; should be sqf 0 cutText ["", "BLACK OUT", _fadeScreenTime];
How do I make it so you can pick an item up (e.g; Pick up a laptop and carry it in your backpack/vest/etc)? Is this a cfg thing?
For it to be in your backpack it needs to be an inventory item.
That can only be done via mod.
other than that you can use addAction or BIS_fnc_holdActionAdd to pick something up
how do you mean via mod? What I've read has used CfgWeapon and subclassing ItemCore & InventoryItem (dont remember the exact thing). Do I just do that in description.ext?
When I tried it I got No entry in config.bin/CfgWeapons.itemclassname
You cannot do that through the missionConfigFile. You need to create a config.cpp which can only be added by a mod.
You might wanna switch to #arma3_config channel
Thats what I was afraid of 😆 will do; thanks
_originalTargetvariable is undefined
wiki says it isn't though?I actually haven't seen this one myself, but after i checked the wiki it's appereantly a thing since 1.81, i thought it's not the issue in the code JohnDoe posted.
what code?
well _originalTarget doesn't exist there
wiki says it does? or am i not understanding something lol
oh, wait
unless it's dev branch, but it says 1.81 if i understand correctly
first, better syntax:
_addActionParams = [
localize "STR_antistasi_action_buy_dealer",
{ createDialog "dealer_menu"; },
nil,
0,
false,
true,
"",
"(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (_originalTarget getVariable ['showBuyOption',false] isEqualTo true)"
];
([_dealer, _addActionParams]) remoteExec ["addAction", -2, true];
// more stuff
_dealer setVariable ["showBuyOption", true, true];
what doesn't work is "append"
(original: ([_dealer] append _addActionParams) remoteExec ["addAction", -2, true];)
@ember citrus
append doesn't return anything
actually didn't look at that xD "if i strip the showBuyOption part from the condition it works" got me looking at the condition
Wait but why does it work when i change the condition?
does it even work at all? xD
From what I'm seeing in that code example, _originalTarget isn't defined in that context
(_originalTarget getVariable ['showBuyOption',false] isEqualTo true)```does that even make sense?
isEqualTo true is obsolete
Yeah, if showBuyOption is set to be a boolean then you can just evaluate (_originalTarget getVariable ['showBuyOption',false])
also use (condition1) && {condition2}
does it even work at all? xD
@copper raven yes, without the showBuyOption condition
What is original target?
🙂
also use (condition1) && {condition2}
@cosmic lichen why{and will this work with 3 conditions?
Does it even return the unit you want?
who in this context has the showBuyOption variable set?
@worn forge the target
@ember citrus It's faster and this condition is checked on each frame iirc.
What is original target?
@cosmic lichen from the addAction wiki, its one of the 3 condtion params
Try
"(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (_target getVariable ['showBuyOption',false])"```
Make sure _originalTarget is not objNull
Try
"(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (_target getVariable ['showBuyOption',false])"```
@worn forge tried that, same result
@ember citrus To whom is that action attached? A player?
are the getVariables made public on their respective ends? thing setVariable ['value', value, TRUE] ?
@ember citrus To whom is that action attached? A player?
@cosmic lichen a unit
are the getVariables made public on their respective ends?
thing setVariable ['value', value, TRUE]?
@worn forge yes
I'm a bit confused as to why the owner variable needs to be there
might also try (_this isEqualTo (_this getVariable ['owner, objNull])), not sure you can == an objNull
not sure you can == an object
you can,sqf leader player == playeralso, won't work withobjNullwhich is good in that case (evenobjNull == objNullwill return false)
Wiki claims you can
I guess what I was meaning was you can't == an objNull, as I == an object all the time in my code 😛
I'm a bit confused as to why the owner variable needs to be there
@worn forge that is original code from what i'm trying to port. But as i said, it works without the last condition
I'll take a look at it tonight
Ded beat me to it 😛
might also try
syntax error, missing'
Still have to check if _target and _originalTarget have something sensible as value on the clients
Wait let me edit that line and all confusion will be erased
(Stokes you're not wrong, it was my typo)
Editing might cause more confusion 😂
😝
screenshot for further blackmail
Hi everyone! Can i use pushBack for adding nil to array?
Doesn't work
(I code that without Arma, and want to know about that without downloading)
Ok, i will try. Ty, @winter rose 🙃
^
then set or resize may work
Use set or plus
@cosmic lichen ooo, thanks. I'm blind a little.
maybe you could also use _arr append [nil]
_arr + [nil] is an array copy so will be slower.
maybe
Don't see any reason for that not to work
is there a command that gives the path to an object's inventory icon via debug?
Found the path to it's model, but not it's icon
"picture"
so something like
getText (CfgVehicles >> V_DeckCrew_blue_F >> "picture");?
inventory items are CfgWeapons
and you are missing the quotes about the classname, but yes. something like that
That did it, thank you both 👍
Okay guys, i think i know what might be going on with my issue..
I may have lied a bit when i said it worked before with the 'old' addAction condition..
It did work, but that was when my code looked like this:
_addActionParams = [localize "STR_antistasi_action_buy_dealer", {nul=CreateDialog "dealer_menu";},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull])"];
_addActionID = _dealer addAction _addActionParams; // <-- OLD
([_dealer] append _addActionParams) remoteExec ["addAction", -2, true];
// Some stuf
_dealer setVariable ["showBuyOption", true, true];
And ofcourse this works on my client, because i'm running a local MP session (so my client is also my server) ..
So i started thinking that maybe i'm doing something wrong with my remoteExec targets, i thought something like this would work but sadly it doesn't:
_addActionParams = [localize "STR_antistasi_action_buy_dealer", {nul=CreateDialog "dealer_menu";},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (_target getVariable ['showBuyOption',false])"];
([_dealer] append _addActionParams) remoteExec ["addAction", [0, -2] select isDedicated, true];
// Using `isDedicated` to determine wether i need to call everyone or just everyone BUT the server
(i also tried my new code without the addAction condition, no luck there ..)
[_dealer, _addActionParams] remoteExec ["addAction", [0, -2] select isDedicated, true];
I think you've done it @copper raven
It works (without condition, but i'll try that next)
works like a charm, with the condition added!
Help, mod ACE
How can I remove the interaction with the box using the win button?
I need the box to not be able to carry and move.
good to hear you finally got it figure out JohnDoe.
Thanks
needed to clone the repo anyway so might as well find it for him
this stuff is also on the wiki:
https://ace3mod.com/wiki/framework/dragging-framework.html#21-enabling--disabling-dragging
thanks
How do you check if a variable is an array? Thought isArray would do it, but that only works on configs..
what if i dont know the values inside the array?
i thought something like
if(count _array > 0) then {};
but _array could be a string here and return true
_blahArray = ["Blah"] select {typeName _x isEqualTo "string"};
if(count _blahArray > 0) then {
};
might be missing parenth butr you get the idea
¯_(ツ)_/¯
shakes head and leaves
if(typeName _array == "ARRAY") then {};
?
ah that seems like the safest way, thanks
also neither that, nor count nor whatever posted here will help you if what you want to do is really
How do you check if a variable is an array?
but I think you don't actually mean that and need to explain in more detail what you actually want
i just want to know if my getArray found something, but i just noticed that the return value for it is always Array (according to the wiki)
if getArray didn't find anything, it returns empty array afaik
so
if (_array isEqualTo []) then { didn't find any }
count would be sufficient enough here right?
isEqualTo is more efficient
or.. you could do the right thing, and check if you actually have an array at all.
if your config entry is not an array, the getArray won't give you anything sensible
Thought isArray would do it, but that only works on configs..
Yes it does, but.. whats the problem with the fact that it only works on configs, while you are trying to read a config. You already have a config, so you can use it.
Yea that makes sense
How can I prevent an unit from dying if the dmg it received exceeds a threshold (0.9)? If I use handleDamage EH the damage will often immediately go from 0.5 to 1 and the unit dies.
If code provided returns a numeric value, this value will overwrite the default damage of given selection after processing. Return value of 0 will make the unit invulnerable if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling). If no value is returned, the default damage processing will be done. This allows for safe stacking of this event handler. Only the return value of the last added "HandleDamage" EH is considered.
I might have found the solution
What is the best way of setting up your private ["_xxx"] variables?
I'm looking for some sort of automated solution
can you explain more? This does not make much sense.
after i finished writing my script, i have to make all my local variables _XXX private (that's the recommended way right?) using the private ["_XXX", ...] function.
This is pretty tedious if my script is long, so i was hoping there is some sort of script out there that does it for you
Althought it's recommended to do private _variable instead of private ["_variable"]
Althought it's recommended to do private _variable instead of private ["_variable"]
@cosmic lichen Thats a thing? That makes it much more bearable
yes
god i love Regexes
Regexes are pretty neat once you're familiar with them 🙂
How can you love that ? 😄
Because I've written regexes that were worse than that xD
If i play a sound with say3D through addMPEventHandler, it should play locally for each clienty right? I don't need to remote execute for everyone to hear it?
yes
How can you love that ? 😄
@cosmic lichen It is a special kind of love 😏
How can you not* love that
/\([^\(\)]*(((?<Open>\()[^\(\)]*)+((?<Close-Open>\))[^\(\)]*)+)*(?(Open)(?!))\)/
Regex are pretty easy to read, I don't see any issues 😕
sgamosdfjsdduckyouoashdfoawenfioawnef 😛
Regexes are powerfull aswell, i think 1 regex recursion crashed multiple CloudFlare servers a while back
Yup, it crashed their whole network for 30 minutes or so iirc (altough this was an addition of different issues that let to this result)
let's just keep it at that one rogue regex caused it 😉
Late to the party, but why not use typeName ?
im getting an error from this expression "Error missing )". Why is that?
if (player_1 not in escape_jeep) then {player_1 moveInCargo escape_jeep};
@worn forge it's (way) slower than isEqualType
@ornate prairie because```sqf
if (not (player_1 in escape_jeep))
Wiki on isequaltype is fairly thin, how would you use that to determine a boolean? Or object, or group?
_myVar isEqualType true
But I don't want to know if it's true, I want to know if it's a boolean
and that's precisely what it does
A tad confusing in the sense of readability. If _myVar is false, that statement would return true?
So _myVar isequaltype objNull world return true if _myVar is an object?
// The following
A isEqualType B
// Is the same as
typeName A == typeName B```
I will just test it next time in the editor...
at least for things like this, SQF-VM probably would be the faster solution (unless you got the game open obviously)
I'll have a look at that. Thanks.
Hey, anyone happen to know if deleting elements of an array through a forEach causes problems? i.e. clearing all of a certain value such as null
yes, as usual there are issues in editing an array you are going through.
you should instead parse it and create a new array with only the elements you want, or use select
_myArray = _myArray select { not isNull _x };
``` @potent depot
that works, but doesn't that still resize it?
so wont that cause a problem in foreach?
had no idea it could do that
ta-daaa! 😁
well thats handy
it saves (Arma) lives
im assuming isNull will return tru on a grpNull right?
kk, thanks
Checked, works for group check
1 more thing, passing an array as a param, duplicates the array as a new variable right? So i can clear the old array?
where?
Say I pass a global array that is continually changing into a scheduled script.
if passing in a script, it's the array's reference iirc. So duplicate it with +
ok, so it would need to be duplicated in the function again?
just in the function
because I want the values of the array at the time of the spawn call and then to clear the global array so those values dont get reprocessed
so taking a copy and setting the global to [] will work right?
yes
ok, well that gets rid of my need to use null then.
Thanks for the help
One more thing since it would make my life easier. Is there a way to have a scheduled function wait until a spawned function returns(completes)?
does waitUntil work in that way?
though I suppose I could use a global variable but having it bound directly to the function would be nice if anyone happens to know if its possible
@potent depot waitUntil scriptDone
Really new to scripting, sorry if I hardly understand a thing
I found an interesting script (http://killzonekid.com/arma-scripting-tutorials-attach-to-relative/) and wanted to test it, but can't seem to figure out how to actually make the script work
I enter in all the code into a init.sqf I created in my mission folder, but it still doesn't work with entities I try to use
I tried using another .sqf file with a trigger, but it still doesn't work
I know it's not on the trigger as I misspelled it the first time like a dumbass and got a popup
private ["_o1","_o2","_v"];
_o1 = _this select 0;
_o2 = _this select 1;
_v = _o2 worldToModelVisual [0,0,0];
[
_o2 worldToModelVisual vectorDirVisual _o1 vectorDiff _v,
_o2 worldToModelVisual vectorUpVisual _o1 vectorDiff _v
]
};
KK_fnc_attachToRelative = {
private ["_o","_v"];
_o = _this select 0;
_v = _this call KK_fnc_vectorDirAndUpRelative;
_o attachTo [_this select 1];
_o setVectorDirAndUp _v;
};```
Where do I put this?
Anyone knows how to disable looting from corpses?
Han it's not quite as simple as that, you have 2 functions there: you would need to supply them with variables that they'd process in order to produce an effect.
Sanchez, either add an inventoryOpened event handler that immediately closes the inventory dialog, or just remove all inventory items when the target dies :)
the intended effect is attatchto with rotation
Han you'll need to describe how you are setting it up, we have no idea how to help you
I have the code above in a init.sqf file in "D:\Documents\Arma 3 - Other Profiles\HanSolo1519\missions\gayapc.VR"
and I have "[Object1,Object2] call KK_fnc_attachToRelative "
on the init of object 2
don't wanna step over Han
I was trying to remove the inventory option at all, and can't remove everything because its a corpse, I'd have to remove uniforms and etcetera
That's fine, this place is for both of us to get answers
[apc,log3] call KK_fnc_attachToRelative;
apc being a vehicle, and log3 being an object
this is in the init of log3
I think you might need to spawn in init field? Instead of call. Plus you need to give it a result, ie, 0 = [Object1, Object2] spawn kk_fnc... Etc
Sanchez you can't remove the inventory function as it's a core part of the engine, but you can manage what happens when the inventory action is initiated or ended
Try this addEventHandler ["inventoryOpened", { closeDialog 0; true}];
in init box
Hard to do this on mobile :)
lol its fine
tried with an eventHandler but it also made doors impossible to open
I'll check
That might not be the right eh actually, but that's the idea
Yeah it's the containerOpened eh
yeah still opens
On player = inventoryOpened, on everything else it's containerOpened
by player you mean corpse or the players units?
doesn't seem to work nope
Might need a delay before closeDialog
like a sleep 0.01?
Probably more than that as I think it needs time to generate before you try to use closeDialog
I'll try better tomorrow
just waitUntil display 602 is active
and then closeDialog/closeDisplay
or actually you can just return true to the EH(allthough never tried this, referring to the wiki) <player> addEventHandler ["InventoryOpened", {true}];
@potent depot
so taking a copy and setting the global to [] will work right?
If you mean GlobalVar = []
then you don't need to copy, because you create a NEW array withGlobalVar = [], you are not modifying the old one, thus not modifying anything that still has a reference to it
Is there a way to have a scheduled function wait until a spawned function returns(completes)?
Uh.. Just usecallinstead ofspawnwhen executing it?
Is there a way to convert hitpoint damage into overall damage returned by damage command?
I think damage takes it from the "" hitpoint, I am although not sure about this
You could have arms damage, legs damage, torso damage to 1, I think you would not die until you set "" to 1
Not sure about head damage
What I basically wanna do is sqf if (damage _unit + _recievedDamage > _threshold) exitWith {....}
Doing it like this inside the handleDamage EH seems to be unreliable.
since _recieved damage is the dmg of a hitPart and can sometimes be > 1, although that doesn't mean the unit would die
well "received* damage" is received on this body part
the "core" damage is "", and you could reduce it by comparing the previous and the current "" hitpoint damage
(again, from what I understood, which can be partially to completely away from the truth)
Can we get position at which camera is looking at?
so the delta of _oldHitpointDmg and _newhitPointDmg is added to the core damage?
Can we get position at which camera is looking at?
yes, screenToWorld
screenToWorld [0.5,0.5];
Should precise, not user camera but camera created with script
should be the same
it's always screen center
Or are you talking about a UAV camera or something along those lines?
But even if it is used for PIP?
No, not for PIP 😄
Yeah thats what I thought
Alternative, is there a function that calculates position on the ground from vector intersecting with it from point in space
Yeah exactly like for UAV for example
https://community.bistudio.com/wiki/getCameraViewDirection
you have camera position, and viewDirection, have fun
lineIntersects might help
Yeah but that hardcoded distance doesnt help ;d
What hardcoded distance?
There are other commands, not sure if they are all limited to 1k m
Yeah will check those, thanks
hardcoded distance doesn't matter if you think a bit
Do multiple runs and move the start position forward each run
Yeah did that
that moment when you find the ACE has a rickrolling joke in its framework guide
// Example: Add radio self-action to all civilian cars
["ace_interact_menu_newControllableObject", {
params ["_type"]; // string of the object's classname
if (!(_type isKindOf "Car")) exitWith {};
if ((getNumber (configFile >> "CfgVehicles" >> _type >> "side")) != 3) exitWith {};
private _action = ["playRadio","Play Radio","",{playMusic "NeverGonnaGiveYouUp"},{true}] call ace_interact_menu_fnc_createAction;
[_type, 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
}] call CBA_fnc_addEventHandler;
_entity setUnitTrait ["engineer",true];
Error position: <engineer",true];
Error Missing ;
is engineer actually not the correct term? ref: https://community.bistudio.com/wiki/setUnitTrait
the other setUnitTrait uses it doesnt complain about
Error position: <engineer",true];
Error Missing ;
What? how would there be a semicolon missing.
if the skillname was wrong (which it cannot be, as custom skill names are also allowed) it would through enum error, not semicolon
same error with all 3 fields?
I believe in a non-closed string here @velvet merlin
IDE shows nothing but trying with 2nd one
example is def "
I'd look at the line before the error
if you use IDE linting, maybe thats just its bug
\o/
the ' ' was a real possibility as well
When I create BIS task with enabled notifications, sometimes CREATED state notification is showed after SUCCEEDED. Is the way to eliminate this behavior?
Is there any way to create custom viewport/camera for a player that offsets the center of the screen?
if you mean "changing the external camera position for a vehicle/soldier", not without mod
Im guessing its not feasible, otherwise someone would have created a mod for it already.
was thinking dual head display then maybe just maybe offsetting the center on each screen....
is there a way to use "ace_interact_menu_fnc_addActionToClass" with isKindOf classes instead of looping over a ton of classnames?
parent paths i mean
so rather have all "heli" childs get the action instead of habving to get every heli classname
use configs instead?
i dont know anything about configs so ild rather not
fnc_addActionToClass only works on the given class itself, and not parents or children.
and something like this is waaay easier:
class CfgVehicles {
class Air;
class Helicopter: Air {
class ACE_Actions {
class some_action {
// some settings
};
};
};
};
thanks guys thats helpful (y)
how do i check for objNull?
without crashing when something else is returned.
_transportingVehicle = isVehicleCargo _target; //returns objNull
nevenmind
isNull
is it possible to let a unit speak in direct communication like we can do with sideChat?
(i need to let a unit speak in chat, unit is of side CIV and player of side GUER. Player starts "dialogue" with an addAction on the unit)
Not as easy as sideChat command, you need to implement a function. I think a system that creates a new radioChannel, adds everyone nearby to that and directs that message to others in location then removing it may help. You may wanna check radioChannel... commands.
yeah that was what i was going for..
Another question; nearEntities is that efficient for finding nearby players?
It may be more efficient if you get all players and check distance from each than doing that. Depends on the environment and parameters of course but most likely this way is more efficient.
how is that better?
nearEntities ["man",10] would be way faster than going through all players and using the distance function right?
depends on how many entities there are in that radius.
yea okay lets say ~5
depends on environment, think of 1000 can of beans between that 5 meters. You will go through them all.
Player count in most scenarios is lower than entity count in radius.
oh i never thought about beans being equal to "man" 😏
I don't know how this command works on engine side of course, but I would assume it still looks for the can of beans but not returning them since it is not suiting to your filter. Does not mean it is not wasting time of beans.
We'll see how this code holds up, but thanks for the feedback
I would assume not much can be done since after all, it is making a position based search. While checking for players is a known list. It has a pre-stored value.
@ember citrus have you considered say?
seems like a lot of work to declare every line of text for it
but the customChat solution seems to work fine
customChat does fine, I assumed you wanted player to have same impression as if there is a conversation in direct chat.
otherwise, definitely the easy way out.
oddly enough the Wiki syntax had nothing to say about what this does. >>
here is the whole line of code in case you want it
_value=[(configFile >> _whereToLook >> _classNameToLook),_configAttribute,_defaultVal] call BIS_fnc_returnConfigEntry;
@bold kiln What do you mean the biki has nothing to say about what this does? https://community.bistudio.com/wiki/config_/_name / https://community.bistudio.com/wiki/config_greater_greater_name
I was looking at this. https://community.bistudio.com/wiki/SQF_syntax
But I was being Vague. I'm just looking for what >> is used for
Hi everyone,
Question about (multiplayer) script performance.
I have an "entitykilled" eventhandler that checks if the _victim 's classname is in an array of 60 strings. How efficient is the Arma engine at this? Would this produce noticeable lag in a 12 player coop mission?
I don't know an effective way of testing this, which is why I ask.
btw what is the precedence level on >> dont see it listed?
@bright flume How do you mean? What do you not see listed?
nvm found it ninja'n down at the bottom of 3. ah the pains of small fonts.
@acoustic abyss you could record the time it takes for the script to run and you can also log FPS
But 60 Strings isnt that much, i have logged and compared a ton more information without lag before
do note that even a "simple" script can cause a lot of issues, especially when called at the wrong time
If i recall correctly i was told that the number of lines have a lot more impact than the actual commands used.
But unless you have excessive loops, performance is usually fine.
I am looking at eventhandlers, is there any eventhandler (or scripting) that can work when a unit gets hit by a projectile, but that unit is also set to not allow damage?
Thats gonna make this difficult 🤔
Invulnerability is not really a purposeful thing in Arma by default
U can get hit but set no damage to unit 😋
armor protection...
So unit get hit, you make smth with that and return no damage to unit
I'm trying to get a message to display in system chat that a player (as like: "playername has been hit" has been hit, however that player not to take damage. The other way I thought of in my head was if I could set unit on hit to full-heal? But this is a bit above me
EH hit doesnt pop, as documented, always for low damage
You can add variable to unit and check it in EH. If unit should be immortal - return damage is zero, otherwise return standart damage
Ah, alright! I shall have a fiddle and see how I get on!
this might be a server question, but i use ace's check pbo thing to manage addons on my server (not all my mods have keys :/) and currently to generate the list of pbo's i need to run a script manually.
How could i automate this process? currently all i can think of is a mod which, on startup, prints the list to the RPT file, with some unique searchable string, and then some kind of python script which started arma in the first place waiting for that unique string which then closes arma
trying to make an auto updater that works with ace's "check pbo"
is setSoundEffect a global command? if its in a server only trigger, will it play for all connected clients in range?
setUnconscious true how do you get an unit out of that state not using scripting?
having a Medikit and unitTrait "medic" doesnt seem to do it
How can I skip to next item in forEach loop? Something like continue function in loop.
I guess scopeName, breakTo ?
Just wrap the code in a sqf if (condition) do {};
@ornate prairie , am testing it now, wait 10
the sound is local to the trigger
so if a player activates the trigger, only they will hear it
not sure about the waypoint syntax, untested
in your case the trigger is server sided, so no one will hear it
@velvet merlin from what I understand there isn't anyway other then using the command.
The BI revive system uses the following,
//reset death reason
bis_revive_deathReason = DEATH_REASON_UNKNOWN;
//not bleeding
bis_revive_bleeding = false;
//remove unconscious state
_unit setUnconscious false;
//allow AI shooting the unit
AI_PROTECTION_DEACTIVATE(_unit);
\a3\functions_f_mp_mark\Revive\fn_reviveOnState.sqf
@verbal saddle ty. so you need manual addAction or is there some framework for it?
//disable built-in death messages
if (bis_revive_killfeedShow && !bis_revive_hudLocked) then
{
private _hud = shownHUD; _hud set [9, false]; showHUD _hud;
};```
is there missing index? @still forum
count shownHUD = 10
There is the default BI revive system
Other then that you will have to make it yourself
what is the "default system"?
well thats the one from above, no?
the coding in \a3\functions_f_mp_mark\Revive looks like that. maybe a more progress version
or what should be different about it?
The default BI revive system is the one in the functions_f_mp_mark\Revive folder.
its MP only tho
Hi, ive got some problems
ive placed down a trigger with the condition s == 1; my triggers variable name is "s" and i have a "addAction" leading to an sqf with s = 1; in it.
It works but i get a "generic error" message every time
1/ name your variables so you can reread them 6 months later 😉
2/ did you define s= 0 somewhere like in initServer.sqf? else s in an undefined variable
@fervent kettle
new problem, i am using playSound but it only plays one sound, the second one (different trigger) doesnt play, no matter wich ones been triggered first
depends on the conditions you have set @fervent kettle
"this" I want a sound to be played when blufor enters the area (I also set blufor as activation)
Does the command limitSpeed not work even if looped? I'm having an issue with this scripting here in that it isn't limitting the speed of the vehicle:
_forklift spawn {
sleep 1;
waitUntil {
_this limitSpeed 5;
_item = _this getVariable ["APM_forklift_object", objNull];
isNull _item
};
_this limitSpeed 500;
};```
For reference, `_forklift` is an ATV and `"APM_forklift_object"` is an object that has been `attachTo` the ATV
I'm assuming that limitSpeed is used to set a Max speed correct? as in the ATV in my script shouldn't go above 5km/H?
I put the sleep in too to make sure the variable was defined on the vehicle before it had a chance to return true for the condition
See the wiki, it works for non-threatened AI
damn... I missed that note lol. Any idea how to limit for a player then?
NVM... I think I'm gonna borrow from this:
https://github.com/acemod/ACE3/blob/e2ac18a05d5f646bc7cbc043bcc148fde4c0f5dd/addons/vehicles/functions/fnc_speedLimiter.sqf
where can I find the default inventory scripts
@dark ocean ?
u sure you aren't looking for the car script?
is there any way to detect the strength of an explosion regardless where it happens? like in a trigger area vs a vic or player ie EH damage likely wont be called cuz it'll likely be terrain objects?
basically wanna detect a explosion near a building to ensure the detonation destroys a building long as the explosive is at least above grenade blast strength.
add an event handler on the building to check the bullet type?
which would be "" in case of an explosion iirc
building part of the map so just trying to go the simple route and maybe just detect any explosion based on the explosive source's class but got no clue of they grouped like that parentage wise
I mean this could be from a cruise missle explosion and instead of doing nothing to the map. actually wipe out everything in a 20m circle...
could a EH on actual explosive/munition setoff trigger damage EH for itself?
@winter rose if it was a eden placed building yeah likely would be nothing more then a EH on the building but this one of the static ones dunno how to pop a script on those. other then deleting it and replacing it with a placed one?
https://community.bistudio.com/wiki/nearestBuilding 😉 @bright flume
dun matter now... just did some test explosions... and well... not useable atleast on these buildings. https://steamcommunity.com/sharedfiles/filedetails/?id=2010415717
Hello boys i need some help since I'm not the best at scripting
i hope im using the correct channel
i want to make the following
a lowered turret to be operated with standing up animation
i hope you guys can understand what i mean
Why not use the raised turret?
i want to place it on top of a wall and look authentic
im all about the details :D
Player operated or AI operated? Either way, likely that arma physics will kill it
@bright flume how about hide the target building and create vehicle your own, put the eh on that?
I've been trying to get the AI artillery to behave, but I stumbled onto a bunch of pretty serious issues.
The vanilla artillery commands kinda break if you want to have a custom spread, meaning firing one projectile at one point then another and slightly different point. Using vanilla arty command to do that results in very slow firing artillery as the AI will have delay, aim, fire, then it tries to reset the turret and then aim again. All because the AI just HAS to move the damn turret after firing.
I tried to kludge together a solution with uses the doArtilleryFire, on a unit with forced hold fire, to get the launcher to aim at the target. That actually worked, but after triggering fire via script, the AI gunner tries to move the turret back into rest position. I tried making a loop with disableAI "WEAPONAIM", but you have to keep the turret locked for at least 5s or the AI will try to move it into the rest position. With means you can have spread during that time.
I also tried doWatch with an object placed along the firing solution's vector, didn't work either.
To make things even more hilarious, if you order the Sandstorm MLRS to doArilleryFire and fire all 12 rounds, it will fire only 10 of them.
To make things even even funnier this does not work for some reason on the Sandstorm (named arty in editor): gunner arty forceWeaponFire ["rockets_230mm_GAT", "Mode_6"] However this works arty fire ["rockets_230mm_GAT","Mode_6"];
More: after using fire and then sleeping for aiRateOfFire taken straight from the weapon's config does not let you correctly fire the ordinance, the firing is too fast and rockets end up unfired as the loop ends up prematurely.
And a cherry on the top: animateSource does not seem to work at all. I even tried the sample that is supposed to let you spawn a UGV and move the turret around, the actions did nothing. I tried animating the sandstorm to manually set the turret's elevation and heading, no luck.
problem is the building itself is just buggered nothing can do about it. have to look for another area. but at some point I wanted to detect any kind of explosion and know what/where it was if that was feasible
Normally buildings just take damage and break when enough damage is applied
you need to make more powerful bombs perhaps?
trying to make an 'effect' buildings always wont be involved. eg. cruise missle misses but still wipes out everything within x meters... plants all that... maybe spawn a crater...
have you tried just setdamage 1 for objects within x range?
yeah its when to set it off.. and detect a explosion 'anywhere' is the underlying issue
add it to the fired event of unit or vehicle that uses weapons that can trigger it
Id say theres no other way to get a position of a hit
was thnking trying to detect the actual destruction of whatever itself that is exploding but I stopped, dang back killing me.
yah thats not really a good option
was thinking it likely isnt gonna be.
Id track the life and death of the bullet/missile/bomb of given types through the fired event.
You would want to limit such to the most powerful weapons only though or it will get too heavy
yeah that I figured.
disable the ability to remoteExec the function
is there any benefit to, instead of
sleep 10;
use
while (_c < 20) do {
sleep 0.5;
_c = _c+1;
};```
?
The first is easier to read and understand 😄
naturally
If I had to guess, the first one would be sligthly faster as the second one, once at 10s, it will need to check again and then continue
i mean more from a scheduler "optimization" standpoint ("real time to completion" doesnt matter in this case)
the first one is way better from a scheduler standpoint, and also without scheduler in mind
the second one is simply stupid
😄
@austere hawk unless you execute something else in the while… no-effin-thing
Sorry for the late reply, Discord had a hard time updating ^^
Does animateSource command even work at all? I'm completely unable to get it work despite multiple attempts.
yes it works
but it doesnt work on everything. what do you want to animate?
it wont work with turrets that are not on drones/UGV for example
at least that was the case a while back
I want to animate a turret on an artillery vehicle. I tried arty animateSource ["maingun", rad 15] It does nothing, with or without AI. I also tried the UGV example posted in the animateSource article. None of the actions worked at all.
https://community.bistudio.com/wiki/animateSource
yeah regular turrets are not animatable by this - i never checked the ugv myself, maybe it only works in certain conditions ...
for my arty script (https://www.youtube.com/watch?v=uKGzWkKDwdY) i calculate a point that the AI has to aim at in order to get the correct elevation
Its not the Aiming. I can get the AI to aim at exact point without problems (you just force hold fire and use doArilleryFire). The problem is that once fired the AI gunner will try to move the gun into the rest position, that is something I want to prevent, while maintaining the control over the turret movement, so I can have custom spread on impact.
you could use doWatch/doTarget on a point right after it
nope, tried that and the AI still tries to move the turret
in some cases it probably simulates the reloading
tried disabling certain AI functions?
i doubt that (reloading)
the arty computer system is just baaad... so i wouldnt be surprised if there are some things that make life even more difficult than it already is
disabling WeaponAIM does top the AI from moving the turret, but you have to keep it off for at least 5s or the AI will try to move the turret to rest positon
what are you trying to do?
also it's not the arty computer, its the AI moving the turret back into rest position
@smoky verge see my rant post above
isnt it the same with if you tell AI to kill a target (and the target dies)
do they do the same if fire command is used?
i use doTarget and fireAtTarget, but at a calculated point in front of the muzzle - not somewhere down range
well I can get the AI to fire accurately at the point, the problem is after firing each round the gunner tries to move the turret back into rest postion with sends rockets all over the palce as the script makes him keep firing
never tried it on arty but how does unitcapture work on artillery vics?
well I want to have something that works all the time for arty call script I'm making
oh nevermind then
well it seems connected to doArtyFire, so dont use that then
no
well then I will use that great function that lets you accurately calculate firing solution, and then use even better one that lets you tell the AI to turn the turret exactly to match coordinates, and then fire the weapon without doing anything stupid.
I literally got to the point where I just want to manually animate the turret just to get the artillery to behave, but nope, we can't have that
🤷♂️
I just want it to fire, slightly adjust to fire within a splash zone, then fire again and so on, while firing as fast as possible. Is it that much to ask?
I tried doTarget, with the point being calculated by taking the "usti hlavne" memory point (AKA the end of the gun) and the weaponDirection taken when the artillery is accurately aimed at the target (by doArilleryFire). The target point seems to be calculated correctly, but the AI borks when I tell it to doTarget the aim object. The Rockets ended up landing 2km off target.
doTarget does not seem to work on my target object. doWatch does get the AI to look at it, but after firing it just starts to randomly swing the turret around
@thorn saffron was it the MLRS that also returned down after it fired?
I just tried it with a named VR cube placed above the tank and used dotarget to point at it and fireAtTarget to shoot
and it did nothing in between
Yeah the sandstorm
are you commanding the gunner or the vehicle?
no, I'm just looking at it, there is only the gunner in the vehicle
no with the script
I tried doTarget with the gunner
the gunner is the damn commnader, how the hell can I change that?
well try pointing the command on the vehicle
and not the gunner
perhaps there is a difference
k I'll just try this with a continous spawned script
at least I managed to solve the fire rate issue
just a sec
setWeaponReloadingTime after the delay is enough to get the AI to fire at the full fire rate, without leaving anything in the tube
tried doTarget on a VR Cube object, using the Sandstorm MLRS, didn't work, not when telling the gunner to do it, nor the vehicle
artyG enableSimulation false;
arty setEffectiveCommander artyG;
artyG doTarget artyAim;```
Nothing
arty doTarget artyAim; version also does not work
now got it to do the same as you
what did you use as targets before?
and now it did shoot at each target in sequence
a marker pos, an invisible blufor target from CBA (the AI freaked out when it was OPFOR), a VR selector object, and the VR cube
_poopfire = [] spawn
{
plop2 reveal target1;
plop2 reveal target2;
plop2 reveal target3;
plop2 dotarget target1;
waituntil {plop2 aimedAtTarget [target1] > 0.8};
plop2 fireAtTarget [target1];
plop2 setWeaponReloadingTime [gunner plop2, currentMuzzle (gunner plop2), 0.0];
sleep 2;
plop2 dotarget target2;
waituntil {plop2 aimedAtTarget [target2] > 0.8};
plop2 fireAtTarget [target2];
plop2 setWeaponReloadingTime [gunner plop2, currentMuzzle (gunner plop2), 0.0];
sleep 2;
plop2 dotarget target3;
waituntil {plop2 aimedAtTarget [target3] > 0.8};
plop2 fireAtTarget [target3];
plop2 setWeaponReloadingTime [gunner plop2, currentMuzzle (gunner plop2), 0.0];
};```
so this is crude but it did run
aand now it doesnt run again xD
It worked. The target has to be within the range of the current fire mode
yeah thats what I just figured too
the aimedAtTarget value should maybe be tweaked too.
dunno if arty can get it to full 1.0
how could in an edit hide the characters with this "·" saving what you write
the what now?
@dark ocean unfortunately your question does not make sense, can you try again to explain the problem
@young current Sadly your script does not seem to work on anything other than targets that are withing first fire mode. I tried with switched fire mode, even manually team switching to the gunner, changing the fire mode, and then switching out. No luck, the mode is correct, and the AI keeps it
Nope, tried multiple ways, using the doartillery fire to get the correct fire mode and all. however the fireAtTarget does not work on targets that are further away
putting the target in front of the gun (to get the correct angle) and getting the AI to aim at it does not work either, the AI tries to use the high angle of attack to hit a target that is like 10m in front of it
aimedAtTarget and dotarget are not reliable
@thorn saffron did you remove the commander? switch effectiveCommander to drive? disabled simulation on vehicle and all crew one by one or in combos?
I did everything I could
I would like to make an eventhandler that hides what I write in an edit and saves it in a variable
this example
@dark ocean you could do a fake field that when you click gives the focus to an out of screen text field, and get this value
putting the target in front of the gun (to get the correct angle) and getting the AI to aim at it does not work either, the AI tries to use the high angle of attack to hit a target that is like 10m in front of it
@thorn saffron yes this is exactly what artillery computer does. It wont ever calculate solutions for < 45° elevation
if you use vanilla weapons, then you can use very simple formula to determine angle of elevation, because vanilla arty shells dont have airfriction
is there any significant performance difference between using FSM or while loops?
how can i combine:
player disableAI "TEAMSWITCH";
with
onTeamSwitch { doStop _from };
that's not the player you want to disableAI, it's either _from or _to
well right now i play a large HC thing. but when i play local roles, i don't wan't the squad leader to issue commands.
a positioned soldier should stay where he was, when i switch away.
so, _from or _to?
i am not sure, maybe both? its confusing, cause i cant script. but i can read css and google some php strings around
i just want the squad leader to shutup, and each switched unit should stay where they are.
it's not a scripting problem, it's a logical problem
which do you want to mute, the one from which you switch, or the one to which you switch?
i want to mute the squad leader, from him i switch to the next unit
also, they should get a stop command, so they won't wander away.
let me be so impudent to ask the next question. how do i make:
onTeamSwitch selectLeader -> the unit i switched to.
i tried:
onTeamSwitch { selectLeader _to };
something here tells me that you didn't read the wiki page about this command
@austere hawk Again, getting accurate angle of elevation is NOT the problem, just telling AI with forced hold fire to doArtilleryFire will have the AI correctly aim and set the firing mode to hit the target, you can even get the animation source to get the elevation angle the AI is using, not that it matters as you can't animate the turret. Again, problem is that AI tries to move the gun to rest position if you try tell it to fire shots one by one instead of burst.
Ok, we could go the stupid way then: is it possible to increase the dispersion of the launcher weapon via scripts? I'm aware that you could use the fired EH to "capture" the rocket and tweak it's heading, but that would require some wizardry to get the correct cone.
Anyway, I thought that I could start by simply making the weapon/gunner inaccurate.
setSkill maybe?
everytime someone uses the setskill command, Maruk laughs and strokes a white cat
That probably depends on if the ai firemode for rocket have any dispersion to it
for locked weapons, it doesnt
Artillery isn't locked though I think.
But changing the direction vector would be pretty simple
Laser guided is supposed to go where pointed though
'supposed to'
The talk now is to cover area with artillery rockets
ive lost count of the times ive artilleried my arse with LG arty
did with plain HE just last night, in fact. i respawned quickly enough to get killed again by the second salvo
yeah, soz, didn't mean to drag convo off topic
_artyG setSkill ["aimingAccuracy", 0.0001];
_artyG setSkill ["aimingShake", 0.0001];
_artyG setSkill ["aimingSpeed", 0.0001];
Made no difference on the spread.
so, adjusting each rocket it is then
Yeah the weapon does not probably have that set up
or add some random variance to the rockets supplied target
AI uses AIdispesssionCoef config setting to add more dispersion to simulate recoil and such. Sadly we cannot control this via configs
@finite sail Great idea, I will just use that awesome, totally existing, command to tell the AI gunner to nicely spread the fire without doing anything stupid
thats how I do it
Yeah, I will have to tweak each missile after it's fired
cant rely on vanilla mortar gunner AI, so I have to give them targets manually, but that makes them bot accurate, so I add random shift to their target pos
ok, you have no idea what my problem is
clearly 🙂
oh yes, I did skim read that yesterday
I was talking about mortar not arty..does the virtual arty have the same problem you described yesterday?
mortar has the same issue, with gunner resetting the aim if you try to tell him to fire shells individually, but since it's slower rate of fire you don't notice it.
And I don't want virtual artillery
with virtual artillery you can spawn whatever you want at whatever position
which is why I mentioned it, but I don't use it either.. my arty provider is on the frigate just offshore so players can often see it firing, thats why i wont use virtual
So, how what that achieved with the sandstorm/scorcher, (I forget which it is)
This a vide showing my problem with AI gunner moving the gun back to the resting position
This behavior is triggered just by the fire command.
so it 'ripplefires' 10 rounds slightly dispersed, isn't that what you want?
slightly dispersed wat? It keeps firing wildly when it tries to move the turret back to resting position
nothing is safe
That is NOT controlled dispersion over target area
deleted unit
right and that makes all handles immediately null?
seems there could be problems in a lot of code if value of a handle can change in the middle of a function, is there some mechanism to deal with this?
you can check for isNull
i.e. if i say ```sqf
private _nearestObj = nearObjects [player, ...] select 0;
...
...
// Can _nearestObj become null?!
yes it can
okay so how can check for null help? it can become null after i check but before i actually use it
yep it could
so am i missing something, because this seems like it actually makes it impossible to write error free code?
most commands don't error on null
without workaround like critical sections that aren't actually in the language that is
but they then return nil right?
which i then also have to check for
depends on what you doing
getPos returns 0,0,0
and other commands other respective default values
so i have to check for null last before i use the values i read i guess
getVariable returns nil btw even with a default
Bug then, please create ticket on feedback tracker and ping @dedmen
How would I go about detecting a terrain object like a tree or bush?
its a fancy command, it's too expensive on the CPU even with relatively large ranges if you keep the types array tight and turn off sorting
correction not too expensive
thank you thats exactly what I needed. I also don't need it to find too big an area. I'm making a FOB building system and players have requested a way to "remove trees/bushes/rocks" so it only needs to search like a 5m area of filtered results
ah yes
Does anybody know how to adjust vector in a cone? It is pretty much getting a random point in a cricle. I know the origin point of the cone, its direction and the size at the foot. Now I have troubles even imagining how to find a point on a plane, and then have that point transformed into local position of the vector along with the angle.
@thorn saffron you can use modelToWorld to pick a point in front of the missile
no
I use the ustu hlavne of the launcher
this way I get the exact point from with the missiles are launched
What I have trouble with is wrapping my head around transforming the "end" point of the vector from the cone's local into world coordinates, as well as finding the random point and rotating it around the origin point
Is this what you want? https://community.bistudio.com/wiki/vectorModelToWorldVisual
probably the non visual one is what you want
its more of a math issue than arma
ah, doubt I can help you too much there
In short: I need the world pos of points like the ones highlighted
https://cdn.discordapp.com/attachments/376871657761013761/683750186937483278/unknown.png
the trick is they are randomly selected withing the circle that is the cone's "foot"
Does anyone have experience with ACE medical? Been looking around to write a script on an addaction that fully heals the player, anything I find does not actually want to work.
player setDamage 0;```
That should work with ace med?
Ace has its own command for a full heal, not near a pc right now but I'm fairly sure it's documented
I found something for it, but it did absolutely nothing
Does anyone have an idea on how to make an addon overwrite another?
Basically, addonx has a feature I don't want. I've gone through the files of addonx and changed the config and some other files to my liking, but I haven't gotten the slightest clue on how to create an addon which'll overwrite the config etc. found in the original addon file (Only solution I've found has been to simply reupload the modified addon, which isn't great for obvious reasons). I'm guessing there's a fairly obvious answer to this, but so far I've failed to find one.
@copper raven thanks mate, joined the slack and asked there. Its sorted now <3
hey there.i am trying to bind a particle source to an eden placeable object and let it have the vector/dir and stuff of the eden object.i cant figure out how to do this
basically i want a stream of water to be pointable into a direction
@fast frost your addon has ot have the other addon as cfgPatches required addon to be loaded after it
Can I make it so people dont swim and instead just walk on the ocean floor
not really I think
where am i supposed to put this?
[ configFile >> "class CfgORBAT" >> "navyesp" >> "teamgreen" ] call BIS_fnc_ORBATGetGroupParams;
tried doing the orbat viewer thing but this is giving me errors
well, either in a script which is called somewhere at mission init, or read https://community.bistudio.com/wiki/Arma_3_ORBAT_Viewer#ORBAT_Group_Module
why will group sometimes just refuse to follow move order, and instead move wp disappears?
in fact i say sometimes but it appears to happen all the tim
example: https://youtu.be/l6JpWPsbunc
whelp problem goes away if i put a waypoint a lot further away, then back again, even though they are way outside the waypoint completion radius
actually nm i don't even set completion radius which (according to docs) should result in leader going exactly to the position of the waypoint
The way it works now it is complete once unit is inside and does not think it would be reasonable to move any closer.
lol what.
Are this and _this equal in SQF scripts?
@ebon ridge not sure how this is a #arma3_scripting issue, unless you use scripts to modify AI, Zeus or waypoints. In which case it would be useful to post those as well.
yeah all script generated, although i think the problem is i didn't explicitly set completion radius
but the video shows you using Zeus to set a WP, not a script
Why does this throw errors?
[] call {
_a = nil;
_a call {};
}; //no erros
[] spawn {
_a = nil;
_a call {};
};//error variable not defined
[] spawn {
nil call {};
}; // works again
I like to use nil as argument for a function i'm calling. ofcourse i dont want to use only nil as argument. In the program im writing i would like to do some something like this [_a,_b,_c] call _fnc_test; I like to be able to set for example _b too nil
sqfvm is showing errors on all 3 examples (since you can't send a undefined variable to call).
However the following does work (and is technically correct):
[] spawn {
_a = nil;
[_a] call {};
};
Well ingame it doesnt
tested in-game and you are right; although it does make sense it doesn't work / returns an error
[] spawn {
_a = "";
_c = "";
if(isNil "_b")then{
[_a,nil,_c] call {};
}else{
[_a,_b,_c] call {};
};
};
since you can't use an unset variable
it's like breathing non-existing air
so it would be better to use
[] spawn {
_a = "";
_c = "";
if(isNil "_b")then{
_b = objNull;
// or
_b = false;
};
[_a,_b,_c] call {};
};
[] spawn {
private _a; //<--- error
if(true)then{_a = 0};
}
Isnt it strange that you can do things in call but not in spawn?
I agree that it's strange that it doesn't return an error in all cases, or that using nil inside an array isn't working
in scheduled you can't use a variable that has nil value
in unscheduled however its fine, and works with things like param
Is there a simple script for limiting total ammo on ammo trucks like Zamak truck? Basically i want to have vehicles re-arm but only really just a bit, not have an infinite supply. As a side note ive played around with the "vehicle ammo" which i thought might effect that but it does not.
Also as a secondary and unrelated thing, i need a waypoint to be activated by either one of two triggers, as it stands i think its waiting for activation on both, is there a simple "or" statement that i can plug into the waypoint to accept an activation from either trigger area?
@plain vale https://community.bistudio.com/wiki/setAmmoCargo
@young current Alright, and how would I go about specifying what files I want replaced and with what?
Possibly by using same class names. I recommend you read up the wiki explanation of class inheritance for starters.
Will do. Thanks.
how would i add local variables to an Event Handler?
Like what for example? You just add them to the code you run I suppose.
but isn't the scope in the event handler code different?
_a = 123;
_unit addEventHandler ["Killed", {
systemChat str _a; // Doesn't work
}];
_unit setVariable ["a", 123];
_unit addEventHandler ["Killed", {
_a = (_this select 0) getVariable ["a", objNull];
systemChat str _a; // Works
}];
i fixed it already with setVariable, is this the most efficient way?
Yes
Imagine a server using a headless client. There are AIs spawned on HC with their waypoints. What will happen with those AIs when/if HC disconnects? Will those AIs be transferred to server or something else will happen?
they'll be transferred to server
With waypoints?
unless you've got a script running on the HC that's creating their waypoints: yes it should
ok, thanks
When I compile a file script, I only need to use preprocessFile if there are preprocessor macros in it, correct?
preprocessFileLineNumbers is still recommended for error finding
@austere sentinel also, no comments with loadFile
so basically preprocessFileLineNumbers until all my testing is done then swap to loadFile for the optimization pass?
just keep preprocessFileLineNumbers, it's a one time process
Hm, fair enough. Thanks!
Anyone know where i can find more JWOLF scripts?
internet?
joke aside, try Armaholic or the forums
ight cheers
cuz i couldnt find anything but some random tik tokers
nvm there is nothing on armaholic
I cant find J-Wolf Scripts (They arnt on the web), anyone got a link.
who is he and what does he do?
he made some really useful scripts for zeusing and made some admin menus to spawn a full arsenal and all that shebang
why not use ZEN? which is actually maintained 😉
(I found https://forums.bohemia.net/forums/topic/226466-script-release-createassign-zeus-interface-modules-curator-creator/ , which is co-signed by M9-SD)
ZEN: Zeus ENhanced
https://github.com/zen-mod/ZEN
Ohhhh ok
@exotic flax Do you know who J-Wolf is?
nope, although a quick google search didn't return anything useful other than a Zeus Admin Menu from years ago
@valid star better luck on the RHS server, see #channel_invites_list
@vagrant elm language #rules
@valid star hmm, sorry. it seems there is no RHS server.
try in #arma3_config though
@unreal leaf
private _a; //<--- error
yes, thats not the correct syntax. Read the wiki.
[] spawn {
_a = nil;
_a call {};
};//error variable not defined
Correct, the variable is undefined which will error
[] call {
_a = nil;
_a call {};
}; //no erros
The variable is still undefined, and thecallcommand is never executed, but you are in unscheduled and unscheduled doesn't throw undefined variable errors
@winter rose you yet again, baited someone into crossposting. 👏
Thank you for trying to keep the moderators on their toes
you're welcome!
@cosmic lichen ok will try that for the ammo thing, what about the two triggers linked to one waypoint problem?
Im guessint the waypoint just needs a simple "activate if either trigger A or trigger B synced trigger is activated" but im not sure how to phrase that or if that is the 100% right solution
Sorry, I didn't read the thing about the waypoint
triggerActivated TRIGGER_1 || triggerActivated TRIGGER_2```might work
ok will try that out
I'm finding that buildings don't produce a result with a Dammaged or HandleDamage event handler, but they do effect a Killed event handler. Some buildings do (ie., the Barracks) and some do not (ie., Military Offices). These are obviously editor-placed buildings. Any ideas? I'm trying to complete a task when a player destroys an objective building with charges.
just to be sure, it is impossible to overwrite a BIS_fnc function through Description.ext/CfgFunctions?
(according to https://forums.bohemia.net/forums/topic/186742-how-to-make-an-addon-that-replaced-a-bis-function/, it's not possible (anymore))
@cosmic lichen Hmm gave that a shot but still no dice, i feel like this should be pretty simple to do
//
{
addSwitchableUnit _x;
} forEach (allUnits select {playerSide isEqualTo side _x});
//
player disableAI "TEAMSWITCH";
//
onTeamSwitch { doStop _from
selectLeader player
};
//
hello. i can't script. can some one help me just to combine those 3 snippets into one hotkey?
i don't need a external file, debug console is just fine for me
yourAction = (findDisplay 46) displayAddEventHandler ["KeyDown", {
params ["_display", "_key", "_shift", "_ctrl", "_alt"];
if ( _key in (actionKeys "GetOver") ) then
{ { addSwitchableUnit _x; } forEach (allUnits select {playerSide isEqualTo side _x});
player disableAI "TEAMSWITCH";
}
}];```
I didn't include the onTeamSwitch command because it won't work, as far as I can tell. _from won't be defined inside the event handler
https://sqfbin.com/sawisogafotuvimeyore excuse me. This is the actual script, but I don't quite understand why _goldbar select 0; instead of calling _goldbar directly?
Hey guys, I'm having some trouble with a script. I'm trying to get an addAction to play a sound on multiple items. Here is what Igot so far but it dosn't work and idk what do to anymore. I'm not familiar with SQF enough.
this addAction [ "QRF Alarm" , { //just dosn't work
alarmPosts = nearestObjects [[11498.6,17725,5.73599], ["jenk_cobra_siren_object"], 2000, false];
alarmPosts[i] say3D ["QRF", 1000, 1, true] forEach alarmPosts
} ];
this addAction [ "QRF Alarm" , {
nearestObjects [[11498.6,17725,5.73599], ["jenk_cobra_siren_object"], 2000, false] say3D ["QRF", 1000, 1, true]; //Overflow of Object into say3d
} ];
// Pseudocode
MakeAction
Set alarmPosts length
for i in alarmPosts
say3D
end
end```
this addAction [ "QRF Alarm" , { //just dosn't work
PYTH_alarmPosts = nearestObjects [[11498.6,17725,5.73599], ["jenk_cobra_siren_object"], 2000, false];
{_x say3D ["QRF", 1000, 1, true]} forEach PYTH_alarmPosts
} ];```
_x is the current element in forEach.
Also always add a TAG to global variables
Works awsome!! thanks a lot
Anyone able to shed any light on my previous ask?
I'm finding that buildings don't produce a result with a Dammaged or HandleDamage event handler, but they do effect a Killed event handler. Some buildings do (ie., the Barracks) and some do not (ie., Military Offices). These are obviously editor-placed buildings. Any ideas? I'm trying to complete a task when a player destroys an objective building with charges.
not as good as event handlers but you could just check if it's alive
Not my issue, the Killed event handler works just fine
It's like buildings don't take damage (if I put a dammaged or handle damage or hit event handler on them, and shoot them, nothing happens), but they can either be alive or dead.
maybe for performance issue, their hit EH are not broadcast
(btw, English speakers: broadcast or broadcast_ed_?)
no english speaker is gonna give you a hard time for using either, except the pendants
If the objective is just to destroy it, why check for damage & not just destruction?
Also what ryko said. Either works, broadcasted just sounds more natural as past tense to me.
I said English speakers, not whatever the United Statians use 😜
(but seriously, I haven't yet found the answer; I will google it)
EDIT: (for the record, broadcasted "exists" but is clearly non-recommended)
The objective is to destroy it, but some buildings are super tough. So the idea I had was to use a hit/dammaged/handledamage EH to assess the amount of damage that's been inflicted, and if it reached a certain amount, setDamage it to 1.
For example the Mine warehouse from the new Livonia assets, you can lay a dozen satchel charges next to it and set them off, but the building just sits there and takes it.
I may be reduced to having "helper" objects created locally on the server, if they take damage, setDamage the associated building to 1...
(English is seriously messed up when it comes to "proper" rules of usage, btw)
Do satchels trigger fired when placed or set off?
If its the latter you could maybe count the number of handlers if they were close enough.
Pretty hackish honestly, but it would give you control over how many satchels == a dead building
There are a good half-dozen hackish ways around it to solve the problem, but now I'm really curious what allows a hit / dammaged / handleDamage EH to fire. I'm beginning to think it's associated with a particular class.
question, can you write stuff to a file on the server? I want to save/restore inventory to a spreadsheet. I'm seeing things about full on databases, but that seems both overkill and like yet another dependency
not easily.
how not easily are we talking
it depends on what you want to write and for what reason. Arma isn't designed for the level of interaction you're suggesting.
like headscratching not easily or more throw pc out the window not easily
diag_log is the easiest way, will let you write out anything you want to a rpt file
But then you have to wade through lots of dross to find what you want
hmm..
Otherwise you'll have to fool with setting up a dll / extDB or some such, beyond my experience
no that works great! probably. thanks!
It's the recommended way to debug, actually 🙂
https://community.bistudio.com/wiki/callExtension
If you're just looking to spit a string into a file it's pretty easy honestly.
Anything more involved is gonna require you parsing the string that gets handed to your DLL via callExtension in C++/C#
Ok did a bit of experimentation.
- The
dammagedeventhandler is pretty much unreliable as it never triggered once on any building (it might be tied to units or physX objects). - The
hitandhandleDamageevent handlers fire on objects which have the House_F, House, HouseBase, Building classes. This includes a sample house and the Mine Warehouse. - No eventhandler fired on objects in the ThingX / Thing category, such as cargo containers. In fact, no amount of explosives would even destroy them, and they don't have a destroyed state (setDamage 1).
- Parts of buildings seem to have a natural level of "damage resistance." Shooting a wall with a rifle has no effect, but shooting it with a tank's cannon will provoke a reaction from Hit/HandleDamage.
- Firing a weapon or throwing a grenade at a house object will provoke a Hit and/or HandleDamage EH reaction if you inflict visible damage, ie., if you shoot a glass window.
- Curiously, an ammobox (NATO Supply crate -
B_supplyCrate_F) has the classes ReammoBox_F, ThingX, Thing and it will report a handleDamage EH; a cargo net barrels objectCargoNet_01_barrels_Fhas the same classes, with additionalCargoNet_01_base_FandSlingload_base_Fclasses - and it will not report a handleDamage EH. So if it's slingloadable, it might not work with EH's... more weirdness
- Unsurprisingly, objects in the
StaticorRocks_base_F(rocks) are unaffected by damage
- Items with
Item_base_Fprovoke responses fromhandleDamageandhiteventhandlers. Items withCargo_base_Fdo not. Both items haveThing,ThingXandAllclasses in common.
I'll stop now, as it's pretty spammy, but indeed it seems that the EHs seem to be aligned with certain classes.
@exotic flax would it work if put on an init.sqf file?
that doesn't seem to write to a file that you can read manually, unless I'm looking at it the wrong way
Kinda true, you can derapify it and read it then
However, that is the only way you can read and write without anything else to and from a file using arma
I believe the only other alternative is using a .dll
There is nothing in arma itself to write to files afaik. So you will need to make your own extension or use a premade one from somewhere.
is there a custom "tag" system around (CBA, ACE etc) , with which i can tag my vehicles/weapons/etc, so that other scripts can properly know what the custom stuff can be used for?
e.g. Heavy Armor, Light Armor, artillery - stuff like that
you could get the editor category from config @austere hawk ?
I've got a problem with the spectrum device documentation found here https://community.bistudio.com/wiki/Arma_3_Spectrum_Device
I'm new to scripting and all that but following this I can get the device to show up signals on the screen but they are always present so I figure I have to put a frequency on an object through scripting so that it will only show up when facing said object but I dont know how. Anyone have ideas?
@winter rose its very unprecise precise though... No differentiation between light and heavy tank possible
getMass 😜
what if i have a very large light tank 😛
you could create a list for each classification of their classnames but that doesnt seem to be what you want.
@austere hawk you use the bounding box volume divided by the mass and calculate density!
hm not too bad actually... Still - i guess most other people just dont have requirements for any of this / dont care about stuff like that?
Wanted to know if some already existed, so i wouldnt waste time on making a home cooked version that someone already has made in a better way
if it is in a very closed system, you can list the classnames
if it has to be mod-friendly, better find a smart generic way
first option is verboten in my mind...
lazy me would use the Eden category, and maybe handmake some smaller categories within them
managed to get the orbat viewer module working but im getting the getgroupparams hasnt been found error
and im not sure if its because of the group sizes but i cant zoom a lot into it
can zoom out tho
is there a command to check on an AI units ammo status (yllow - low on ammo/ red -out of ammo) without explicitly checking magazines?
Count magazines in AI inventory? Since I don't think they do tactical reloads, so mags in inventory should always be full
I actually haven't seen this one myself, but after i checked the wiki it's appereantly a thing since 1.81, i thought it's not the issue in the code JohnDoe posted.