#arma3_scripting
1 messages · Page 593 of 1
@onyx sun you should also use the -showScriptErrors exe flag (or Launcher option) to see the errors the game reports in real time
But if I understand your example correctly you want to teleport all people in a trigger to a random position (defined by R1 to R5, which I assume are marker names):
// set list with marker Names
_location = selectRandom ["R1", "R2", "R3", "R4", "R5"];
{
// move _x (player object in thisList) to marker position
_x setPos getMarkerPos _location;
} forEach thisList;
@winter rose thanks i didnt even know that was a thing
@exotic flax Thanks for that im still learning heaps coding in general apologise if i was abrupt before. i was getting rather frustrated with it but thanks heaps.
is there any way to change drivingWheel value in a script?
drivingWheel value
???
I want to change the steering direction of a car once the player gets out of it
not sure if this is the right place to ask sorry
well, you ask for a scripted solution, so it's the correct place
although I don't think there's a script/command/function for it
Ok thanks
mmh i am trying to fiddle with binarizing a PBO, i open the folder with addon builder and do the stuffs, it says success but the final PBO miss some files, i am puzzled
ok it seems there's a not complete list of files included by default in the options
Could anybody elaborate on this for me? Ive been searching the BIKI for hours and cant find what im after
this addEventHandler ["HandleDamage", {_this select 0}] call ACE_captives_fnc_setHandcuffed;}]; this allowdamage false;
This didnt work,
The idea, is to have it so when an AI is shot (on a dedicated server) they A.) Take no damage and B.) Surrender
Your braces and brackets are all messed up.
Does anyone know if it would be possible to replace the ingame map using this https://community.bistudio.com/wiki/drawRectangle
And fill it with a new map
Got an inspiration... But can't test it yet
@gloomy aspen
this addEventHandler ["HandleDamage", {[_this select 0, true] call ACE_captives_fnc_setHandcuffed; false;}];```
If im not entirely wrong
Also, you might want to use
ace_captives_setSurrendered instead of handcuffed
afaik handleDamage expects a number, not a boolean
(200 - (200 / 1.6 ) = 75) How do i get the other side of this equation without having to repeat the calculation? IE the 125
private _value1 = (200/1.6);
private _value2 = 200 - _value1;
```like this? @glass zinc
ah that would work thanks
Is there a way to supress certain log entries/log messages from being put into the logs or give them a certain cooldown after which another entry/message of the same kind can be put in there? I am asking because I have a bunch of Server: Object 2:15801 not found (message Type_169) and Server: Object 2:10717 not found (message Type_274) entries in my server logs but no clue what they are, what causes them nor how to prevent these "errors" from happening and they don't seem to cause any problems in the mission itself but my log files get ridiculously large (>250MB) which one, makes is hard to look through them to find anything but those messages and two, may cause problems itself e.g. with the performance.
no - but you can stop logs entirely through a launcher option @vague geode
or, iirc, the -noLogs option
@winter rose Yeah, I know that but that way I couldn't see if anything else has/causes an error. Do you have any idea what those entries mean or what is causing them?
not really no. Maybe I could make a tool to filter log messages, if this tool doesn't exist already
Dedmen, you were very helpful in the past so if you read this maybe you have any wild guesses on what these log entries mean or what their cause is?
I explained them on BIF a few days ago
Do you have a link so that I can take a look?
no, some of my recent posts somewhere
@still forum false is usually understood by most logic as 0
I remember having used it in evenhandlers before as replacement for 0
And if 0 cant be replaced by false in sqf in logic, then there is room for improvement
parseNumber(false)
That's just extra
Booleans are smaller than any useful integer
That's why passing a boolean is always better than 0 or 1
0 = false
1 = true
Because that's literally the binary value of them
0000 0000 = 0 = false
0000 0001 = 1 = true
N8t exactly an equal
As booleans are one bit
Not a byte
false is a completely different datatype
i know how usual programming works, but I also know how SQF works
But converting a boolean to an integer happens seamlessly
not in SQF
and SQF numbers are float, not int
So that's an oversight by the developers
quite sure thats intentional
Then it's a stupid way of doing it
Cannot think of a single reason not to have them be interchangeable
so
strict mode ¯_(ツ)_/¯
handleDamage expects a number of damage to return
You can pass 1 for true and 0 for false, right?
like 0.1
no
While 1?
or 0.2
Returning "false" from a piece of code that should return the amount of damage from 0-1 doesn't make much sense does it?
Really?
How much damage? False!
no. How much == number
Yes unless it's been changed and Im retarded?
False = 0
I think I found it. It's the following one, isn't it? https://forums.bohemia.net/forums/topic/229614-zues-spawned-objects-error/?tab=comments#comment-3410185
Do you have any tips how to fix it? Is there anything I can write into their init field to stop that from happening?
My mission is a Warlords mission and I guess those log entries are caused by the vehicles and NPCs I have placed and synced to the warlords sector or warlords resonse team modules now since they only spawn once the sector they are linked to (or a neighbouring sector in case of the response teams) gets targeted.
It literally means no
But im 99% sure handleDamage is a float of damage to return
yes that looks like it
How much damage? No
False = 0
@ebon citrus no, for the last time! 😅
Which is a terrible way to do it
Because you're not just asking "yes or no" with that return
It literally means no
"How much damage do you want to receive?"
"no"
what?
It doesnt matter
Yes it does
*boom*
It does though
False is always 0
It's not always 0
not in SQF, so nope
no
false is false, 0 is 0
What is the binary representation of 0?
What is the binary representation of false?
I rest my case
its 0.0
O.O
What is the binary representation of false?
in SQF?
8 byte vtable ptr
4 byte refcount
4 byte padding
1 byte bool
Neither in Java nor in Go
in lua 0 == false is false
don't ask PHP
Maybe there's a node.js package to determine if 0 is false with javascript (I dont know JS, i just know the hilarious "is_even" packages with a metric somethingload of downloads
Anyway the <bleep> do i know, but I think in general it's just bad to just false/true as return when it's a function that actually handles a float value
I need to write massive amount of coordinates to a text file, atm I'm using diag_log but it's not as fast as I would like. Does any other way come to anyone's mind
Basically I'm making a height map of the entire map
wow I just answered that a few hours ago
just need to remember where
Ah
https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/
https://github.com/pennyworth12345/ConfigDumpFileIO
https://github.com/pennyworth12345/ConfigDumpFileIO/releases"ConfigDumpFileIO" callExtension format ["open:AiO.1.%1.%2.cpp", (productVersion select 2) % 100, productVersion select 3];
"ConfigDumpFileIO" callExtension ("write:" + _myString);
"ConfigDumpFileIO" callExtension "close:yes";
anyone know how to set the camera bank (roll) in a script? I can't seem to find this option
according to this page, this command is non-funcitonal:
https://community.bistudio.com/wiki/camSetBank
BIS_fnc_UnitPlay stops if the unit dies correct?
I believe so
I think it does too was just making sure its been a while since i've made a mission
😄
thanks Lou, i'll give it a try
@ebon citrus Thank you! Your script works in SP, but theres a really weird side effect ...
In any mission where that script is in the unit ini, on a dedicated server the playable character slots are removed entirely? I have no idea how to troubleshoot that as its such an odd issue
That may well be down to a mod problem actually, so will run with a vanilla mission and see if thats the issue
Ah will do, thanks 🙂
Also, if you want it to work on player units, you need to look into remoteExec and what locality means in arma 3
Since the handledamage event handler is fired where the object is local
Or rather needs to be defined where the object is local for it to work
Okay, will delve into the BIKI and see what I can learn, thank you for your help! 🙂
@gloomy aspen
Here' some readin material
Im sure the veterans here can point to even more reading
https://community.bistudio.com/wiki/Multiplayer_Scripting can be an interesting read, too 😉
Hmm?
Thanks Lou!
success, with this: https://community.bistudio.com/wiki/BIS_fnc_camera
@ebon citrus turns out it was a mod issue not a script issue ... Whilst I will definitely look into the stuff you linked there, I can say that the script you provided works on both AI and players on a dedicated server! Thanks again, I really appreciate it!
FYI it works without changing from 'false' to '0'
Also thanks @winter rose too 🙂
And @still forum 🙂
and anybody else who helped!

Could someone explain how to count civilian players in a trigger boundry? Ive got this https://pastebin.com/WK78fhQ3
and just cant get it to work at all
How do you execute this? And doubt \\ works to comment...
yeah I figured \ that was just bad pastebinning on my part, its called in the trigger with
[thisTrigger] execVM "functions\fn_countCivs.sqf"; when a Bluefor player enters the trigger
unless it always returns 0 for any side except bluefor
Because your trigger only detects BLUFOR?
Does anyone know why the first one doesn't work, but the 2nd one does? If so, is there a fix/workaround?
//When in an RHS Bradley
private _turret = player call CBA_fnc_turretPath;
vehicle player loadMagazine [_turret, "RHS_weap_M242BC", "rhs_mag_70Rnd_25mm_M242_APFSDS"];
//When in an RHS Abrams
private _turret = player call CBA_fnc_turretPath;
vehicle player loadMagazine [_turret, "rhs_weap_m256", "rhs_mag_M829A3"];
What are you trying to do?
My ultimate goal is to remove the scroll wheel interactions to reload and put them into ACE
Currently I'm trying to find how I can switch ammo types
To remove the scroll wheel interactions I have set the "show " attribute of "LoadOtherMagazine" and "LoadEmptyMagazine" in "CfgActions" to be togglable with a CBA setting (requires a game restart ofc)
class CfgActions {
class None;
class LoadMagazine: None {};
class LoadEmptyMagazine: LoadMagazine {
show = "call compile getText (configFile >> 'CfgActions' >> 'LoadEmptyMagazine' >> 'settingLoadEmptyMagazine')";
settingLoadEmptyMagazine = "profileNamespace getVariable ['showLoadEmptyMagazine', 0]";
};
class LoadOtherMagazine: LoadMagazine {
show = "call compile getText (configFile >> 'CfgActions' >> 'LoadOtherMagazine' >> 'settingLoadOtherMagazine')";
settingLoadOtherMagazine = "profileNamespace getVariable ['showLoadOtherMagazine', 0]";
};
};
I use macros to define stuff, so it's not exactly the same, but it works.
The problem is if I set "show" to "0", I can't reload most RHS vehicles with an ACE addon called "ACE Interaction Menu Expansion" (AIME).
It works for vanilla vehicles and from certain mods, including the Abrams from RHS USAF, but AIME does not work for most if not all RHS AFRF vehicles and the RHS USAF Bradley for example.
https://imgur.com/a/eWBbMXD how to use this
Flag texture path I suppose
C:\Users\acer\Documents\Arma 3 - Other Profiles\Babura\missions\sesnaestabitkubije.woodland_acr\texture.paa
Like this or?
sesnaestabitkubije.woodland_acr\texture.paainstead
photo size matters?
Alright,thanks im going to try now
It works for mp or i need some special code or something?
IDK about 3den Enhanced
Is there a reverse command for https://community.bistudio.com/wiki/owner ?
get all objects owned by owner?
@narrow pollen what do you want from the "reverse command"? put the number and get the player?
Player object from owner id
Is there any reverse of laserTarget in ARMA? There is always the option of me iterating through every unit and checking, but I feel like there should be a much easier and more efficient way of doing so.
Essentially, I am trying to get a consistent object reference to the laser target that a unit fires, even if they turn their laser off and back on again.
do you mean something like isLaserOn?
forget that... that will just check if the laser is on... not if a target is lased on
After a quick search on the wiki I can't find any function which returns a list of units which are currently lasing a specific target...
Although you could run a script which sets a variable in missionNamespace the moment a target has been lased by a single unit, and use setMissileTarget to keep it a target for missiles (depending on what you want to do with it)
Hmm, that is a possibility. Essentially I need to know which unit is using the laser designator. Not the easy solution I wanted, but I could try putting an event handler for Fired on every unit, and keep a track of who is in charge of which target
Alternatively, I am only going to need to do this once upon selection of a laser, and it can be done on the client side so maybe this is premature optimisation
so i have a script that seems to keep bugging out, i basically have an heli that should go from A to B, unload people with fastrope and go back, i have a trigger on the fastrope position set as skip waypoint to let the heli come back, whenever I (as the last player) switch the position using the ACE interaction, the condition count (crew heliTransport) <= 4 gets triggered even if the trigger itself says that the condition must be satisfied for 20 seconds, any clue of why?
well correction it does not throw the "on activation" but the waypoint gets skipped
discard what i said it seems a script issue
Is there a script to disable mines? like how you would normally do with the action menu.
Find it its
player action ["deactivate", player, cursorObject]
Anyone know where I can find the script IDs for all arma 3 facewear like G_Balaclava_TI_G_tna_F
Is it the Fandom wiki?
the wiki wiki
Okay thank you very much
@winter rose I am looking for facewear for all faction in paticular where can I find that?
Thanks
once again i ask for your support, i have that script what i want to execute ingame (previosly it was in the init (attributes) of the object):
test.sqf is a script what i made for test...that is all whats in it:
_this animate ["panel_2_hide", 1, true];
_this animate ["panel_3_hide", 1, true];
_this animate ["panel_4_hide", 1, true];```
for sure i miss something here
@austere silo use animateSource instead
what would be the issue?
place in init:```sqf
if (isServer) then { this execVM "test.sqf"; };
thank you Mr. Montana, you are the MVP here!
hey, how do i disable a specific item in the RscTree? I looked up the tvSetPictureRightColorDisabled command and read that it changes the color when the item is disabled. Or does item mean the whole tree?
I have a question about sendSimpleCommand .
I want an AI driver to reverse. No players are present on the vehicle.
So I'm setting effectiveCommander to a non-driver AI on the same vehicle, and use sendSimpleCommand in a PFH.
This works... sometimes . On some occasions however the car does not budge or - adding insult to the injury! - starts creeping forward.
Sometimes it helps if I nudge the vehicle backwards using setVelocity once, and then it keeps driving backwards.
Is there any knowledge out there about what other issues might affect sendSimpleCommand beside the effectiveCommander?
inb4
- are there waypoints -- no, none.
- is the driver in the same group as a player? -- no
vehicleMoveInforeturns["STOP", "NONE"]
any know if there is a way to disable the endgame spectator map so that the normal map can open
@jaunty zephyr try vehicleMoveInfo to see if your commands are getting through
probably a stupid question, but I'm pretty new to Arma 3 scripting. I have a script that needs to use global variables (assigned from the editor), but that could be assigned or not. What's the shortest way to do something like "_myVariable = globalVariable ?? null". I mean, assign that variable if it's defined, or null if it's not.
trying to use a global variable that hasn't been defined results in error, unless you do a isNil check
if (isNil "globalVariable") then {};```?
hmm I was looking for a shorter way to do it, without so many "if" and "else". But I guess SQF doesn't have operators like "?" and "??"
I don't know what language you're talking about, but most likely no
pretty much any language, C#, javascript, etc
I've no experience with other than SQF ¯_(ツ)_/¯
@winter panther switch-do? SQF version of switch-case. Or you can just if-else
@winter panther no ternary in Arma, no '??' JS operator either
yeah I ended up using if/else, adding the variables to an array if they exist
there is```sqf
[falseStuff, trueStuff] select boolean;
no '??' JS operator either
not yet 😉
yes
private _code = [{ hint "dead"; }, { hint "alive"; }] select (alive player);
call _code;
(you can put anything inside the array obv.)
ah nice, thanks
@winter rose can you use boolean for select?
not yet 😉
@still forum I'm pretty sure you already have that in one of your custom build/version, don't you? 😄
The biki says it takes a number
(1 == 1) && ({ hint "dead" } else { hint "alive" } select alive player)
https://community.bistudio.com/wiki/select 1st alt syntax
@ebon citrus yup
Oh wait, there is alternative syntax
plenty of 'em
So boolean is fine for a shorthand for number here, but not elsewhere 😂
So boolean is fine for a shorthand for number here
no its not
No wonder they scrapped sqf for Enfusion
its a boolean, not a number
Its not a number, its a special syntax that takes boolean
boolean: Boolean - true => 1, false => 0
Its not a shorthand for a number
Says right there
its a special seperate implementation that takes a boolean
its not a number shorthand
Yes, so it's a shorthand for an index number here
Hold on
there is a special alternative syntax here, it's not "using a boolean instead of a number"
there is a specific syntax for a boolean, that's it
its implementation is
if (condition) then {array[1]} else {array[0]}
So in the context of select, this is wrong?
true => 1, false => 0
private _a = true + true; // throws error
So in the context of select, this is wrong?
Yes.
true selects the second element, false selects the first element
its not a "shorthand for a number"
What?
its a special case
So is it wrong or not in the context of select
what you said is wrong
true is not 1, and false is not 0. They are booleans, a different datatype
Ok, can you fix the biki?
https://community.bistudio.com/wiki/select
I think we went over that yesterday
Alternative Syntax
Syntax:array select boolean
Parameters:
array: Arrayboolean: Boolean - true => 1, false => 0
Return Value:Anything - a reference to array element given by its index (false - 0, true - 1)```
Doesn't mean that false/true is a number, just that false will take the element 0 in the array, and true the element 1
So in this context, it's a shorthand for 0 and 1?
no... As already said half a dozen times
also in what world is "true" short for "1" its like.. 3 characters more
So False != 0 in this case?
yes
In literally any respectable programming language and also in any respectable cpu based on binary-memory
like SQF is respectable 😁
Go, Java, C#, Lua... we already talked about that yesterday
I don't think we need to rehash that whole convo
Well it's done this way, it has always been like that and it probably cannot change due to backward compat, there is no point arguing how it works, it just works (sometimes) and it's good enough ¯_(ツ)_/¯
I mean, there is a Bohemia Dev telling you that boolean != number, so that's it :p
But i CAN use false to represent the first index, a.k.a. 0, in this case?
only in this select syntax yes
in that case yes
@unique sundial nah, "BACK" command is not getting through it seems - vehicleMoveInfo gives me "STOP" in the first array index
Alright
That's what i was saying
@winter rose a "Bohemia Dev" was also telling me this:
also in what world is "true" short for "1" its like.. 3 characters more
in C, I believe 😬
@winter rose a "Bohemia Dev" was also telling me this:
also in what world is "true" short for "1" its like.. 3 characters more
…where? @ebon citrus 😅
quite sure in C its also longer
actually do I see that right that C doesn't even have a boolean type?
correct
https://sites.uclouvain.be/SystInfo/usr/include/stdbool.h.html yeah it doesn't
actually do I see that right that C doesn't even have a boolean type?
You C #
indeed - couldn't find it in search o__o
well yeah, in C, if (1) {}
@jovial nebula hey, it's MY job to do the jokes!!
indeed - couldn't find it in search o__o
Me neither, guess Discord doesn't want us to use the search function anymore 😕
forgive me, i understand that was too much😂
And sorry for being so bickering
It's more work to differentiate Bools from integers/floats than to not
from integers, in assembly maybe.
Besides that I disagree 🤔
I've had so much help from this server and i kind of feel ashamed for how much i bicker over small things
There are many reasons I don't want to work in C anymore, the lack of bools is a small part of the massive list of landmines the language has.
You cant get over it?
even in assembly. Usually you want 2==true/if(2) too, but in assembly when you consider a bool to be one bit, that'd be false
It might be just me, but i always connect bools to 0 or 1+
Could be because C was my first language
Well it was mine too but we live in the world of algebraic data types and functional programming, raising the level of abstraction has been a continuous process since the 70s.
and JS keeps adding confusion
All datatypes eventually boil down to binary
yeah but i mean you are working on a language (sqf) that is not even a programming language
JS. is. a. pain.
[] == false; // true
if ([]) { 'a' } else { 'b' }; // result: 'a'
Making them more complicated than necessary is just extra work
Mmmh
Sqf feels like prigramming only in the logic
JS. is. a. pain.
[] == false; // true if ([]) { 'a' } else { 'b' }; // result: 'a'
What about the true===1? Lol
But fortunately i have Python under the belt which is a script aswell
Python is not a scripting language i mean
Well...
There is a lot more than those 2 in JS: https://github.com/denysdovhan/wtfjs 😖
I use python mostly as a scripting language
Writing in C and scripting in Python
Anyways, enough bickering, i have a movie to watch
Gg
@unique sundial oh, and in the case of the vehicle creeping forward, it actually got the BACK in vehicleMoveInfo . weird..
any idea of a way to make a script that would unload all vehicles at an unload waypoint for landing craft
wouldnt setWaypointStatements on the unload waypoint be sufficient
oh?
I'm meaning for unloading like 3 trucks/apcs from a LCU-mk10 lander
I'm wanting to do a beach landing, players arrive in ribs and small landers or helos and their vehicles arrive via the larger AI driven lander
the only way I've found to land vehicles is using Achilles' supply drop module, but that can only handle 1 vehicle at a time
Hey, just putting a message on here as to if anyone knows of any good and informative explanations of how to create an introduction cutscene for a mission. I've looked everywhere and have yet to be successful in finding the desired outcome. Any help is greatly appreciated.
(Also, I'm looking to make a proper intro cutscene as I'm aware that their is the UAV style that is built into 3Den editor but I'm looking a camera style cinematic to script into my mission).
@plush breach there is the https://community.bistudio.com/wiki/Camera_Tutorial on the wiki
@plush breach and no crossposting #rules
yw - enjoy the wonderful but somewhat painful tool!
yeah from the vague tutorials on youtube it does come across quite a nuisance to use. I'll just brute force the camera script, work at it until it works.
What's best practice for evaluating a single condition for a large amount of units?
I'm writing an FSM and I'm not sure what the best way to write out "if any of these units have detected an enemy, return true"
I know there's a trigger for that, and that's what I'm using, but this is mostly a question for personal reference
I'm guessing it'd be forEach
something like
_enemyDetectedArray = [];
{
_enemyDetected = _x call BIS_fnc_enemyDetected;
_enemyDetectedArray pushBack _enemyDetected;
} forEach arrayofunits;
and then for when I want to eval
if (true in _enemyDetectedArray) then { [code] };```
Dunno if there's a better way or if I've got it, though
||This is all psuedocode obviously pls don't yell at me for syntax errors||
Oh, I was not aware of findIf! Thank you very much @winter rose
That makes things way simpler 
heyho people of the arma scripting world
i have a question
I m fairly new to arma 3 scripting. I do have programming experience and so on, but i m quite new to arma scripting.
I m currently working on a small admintool with gui and stuff. Its meant for being used on our altis life server.
On to my question
Is it possible to get the value of a variable that is set on another player, like, the life_hunger variable for example?
and maybe even edit that variable remotely?
yes, see get/setVariable
aight
i m currently looking into getVariable, but i dont find a way to grab a variable from another player, am i maybe looking at the wrong place?
??? object getVariable "variable"
object in this case being the player you want to grab the variable from
can this be the clientOwner id or must it be the unit?
and, i see that i still have a lot to learn then

i tried that solution, but it didnt want to work.
I created the variable
testVar = "TestValue";
and then queried it, via the unit that i m currently controlling
_tempVar = player1 getVariable "testVar";
hint format ["%1", _tempVar]
It returned
<null>
Cause you should use for object namespace
player1 setVariable ["testVar", "testValue"];
When sending CBA serverEvent, would it be beneficial network usage to pass it object netId instead of the object?
is there a way to determine the object detail (video objects setting) via sqf?
the problem is on very low the targets on a training range are no longer rendered. so need a way to determine if thats the case and skip it
Hell everybody 🙂 I was wondering if someone could help me figure out how to find the class names of custom compositions. I can find the vanilla arma compositions under the Config Viewer > CfgGroups > Empty > (tons of pre-made compositions).
@velvet merlin There's a config setting you can pull
how can you read that?
kju's not asking for that. It won't get current video setting
And I think there's no way to get current video settings
@velvet merlin you can force an object drawing, but I am not sure if it overrides object quality - can set FeatureType help, or does the object disappear anyway?
iirc it will disappear into the fog of the terrain view distance
will try FeatureType. good idea
Hey everyone, I'm making a admin menu and I have hit a bit of a brick wall, I'm trying to a search box to search for player names and when I type in pasta for instance it doesn't show any results dispute me being the list box heres the code for the search return https://sqfbin.com/qajahowisutasalenuzu
Just figured it out nvm
Should i make all my variables in sqf private? I noticed the scope is limited to the main execution block, you can't use functions declared at the top of your file inside other blocks, unless they are global or you pass them as parameters
Is making global stuff bad?
a private variable is gone after the script finished executing, no?
Can other mods access those global variables?
a private variable is gone after the script finished executing, no?
@slender schooner its gone after the code inside your scope ends
Other MODs, and other everything could access to every global variables
Thanks
e.g I can (should) use PLP_variable and Lou can (should) use LOU_variable so we won't do unexpected use/update/such other actions to variables
ACE/CBA has some macros to automate this
does it make sense to nil a private variable?
for what?
only if it won't get deleted before long and holds a lot of data in memory
i mean, does it completely dissapear, or does it stay in the cyber realm still set but inaccessible
i mean, does it completely dissapear, or does it stay in the cyber realm still set but inaccessible
it disappears of course, just like it does when it goes out of scope
i once wrote some dumb stuff in python in a private variable, in a function that held a lot of data, like, 300MB. After execution, that ram wasnt being opened again, so the code used up those 300MB extra ram
i had to manually unset it to get the ram back
https://community.bistudio.com/wiki/Variables#Deletion says it all 😉

i once wrote some dumb stuff in python in a private variable, in a function that held a lot of data, like, 300MB. After execution, that ram wasnt being opened again, so the code used up those 300MB extra ram
IIRC, some variables in Python are actually references to data and are treated as such, perhaps it was one of them?
what i did was load files into the program, and then encrypt them, and write them back down
but the last file that was loaded was about 300MB, and it didnt get unloaded
mayhaps i just wrote some sucky code that wasnt working as expected

but now i know
Suggestion for anyone skilled enough to script this, the supply drop option from Achilles but able to fit multiple vehicles into a single cargo vehicle
Like the British LCU mk10 can carry 3 APCs in game but the Achilles script will only load 1
is there a way to have A3 print the functions that are being called? I want to call a missle strike from a mod but i don't know what function does that
nope
what is the best approach then?
find out how it is called, or look up CfgFunctions
@dapper mist have you thought if making one yourself?
Pretty simple, infact it would be
Im not sure about achilles, but all you would need is some simple logic and attachTo-script with the right offsets
You could even do some fancy animations, if you like
But the core-idea is very basic
If you haven't done it by next week, i'll make an example for you
Im going to head out to Lapland on wed, so cant do it right now
if you haven't done it by next week…
Beware 👀
Already occupied by another OP till tue morning
Tue evening*
Might have time on wed morning to make it

We'll see
@winter rose what's up?
The sky?
Up and down only matter in a reference indeed
If you haven't done it by next week, i'll make an example of you
Muhahaha
True, but there are still objective things with up and down, if we consider it in the context of humans
The question is, do we assume your head as up and your feet as down, or the direction of the downward force of gravity as down and opposite of it up?
You would also have to account for the rotation of the earth warping the direction which you consider down compared to that which is the direction of gravity
is up the Z or the Y axis?
heh i think it's a sequence, when you do it by hand you get an interface, select the position, open the silo and fire it
I prefer z-up
Lou, Any chance you could look at some code for like 30 seconds just wondering if I've placed it right ?
only one line
30s, one line? You overestimate me
Shoot ^^ if anyone has the answer he will answer @craggy wraith
I cant post in file in here can I pm?
post on sqfbin.com and paste the link here :-)
@craggy wraith ```sqf (see channel's pinned message)
Thanks buddy 🙂
Hey, could you guys direct me to a series or links that could put me on the right path to start SQF? I've tried looking through videos and it's a majority of "do this and that and this" without much information on what it actually does. I do have experience with Python, Lua, and JavaScript so the basis of programming isn't something I need to start with. I just need to understand the server model and syntax and a few others to get started.
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting can help @tough abyss 🙂 (if the link is correct)
Thanks.
Lou is that your way of saying its ok 😂 😂 I like it!!
@craggy wraith I didn't do anything?
The pinned post saying "your code" good. Meaning you checked the code and it's good?
no, I mean use the sqf highlight so we can read it properly 😄
what is the difference between rocket core and rocket base?
@ebon citrus I'm totally hopeless with scripting, animating and modelling I can do
I see
I'll take a look on wednesday
I should have a little bit of time to whip up an example
lou how does this thing work 😂
it's explained in the pinned message!1! @craggy wraith
I tried it but wouldn't highlight it 🤣🤣🤣 I'll try again shortly
Is there a way to detect if projectile killed somebody via direct hit, explosion and submunitions? I'm spawning ordinance and I would like to log if it killed any enemies.
indirectly, by killed EH on units @thorn saffron
🤔 I guess I could add temporary EH to units in the area, but problem is they might get killed by something else and return a false positive.
You can also get the shooter
Then just verofy that the shooter was the one you needed
I'm spawning the ordinance
Interesting scenario
Yeah, totally. The incredibly new idea of scripted artillery strike...
@winter rose what does the EH say when someone is killed by game-logic or fire-support?
No, im not talking about that
🤔 I think I could spawn a game logic/dummy unit, parent the shots to that and then check for kills
I am a master of cabbage trebouche
Im not sure if that's how it works
I cant say for sure right off the bat
It's an edge-case
@ebon citrus game logics can't kill you 🤔
But if you use setDamage, objNull is your killer
if you use a spawned ordinance, objNull is your killer too but the ammo is provided
game logic with a gun 🙀
setDammage 
that's also the first in-game suggestion 😄
Also, since when were MP EH a thing?
OFP:R iirc
I think that tracking the kills on dummy unit will be more reliable than adding killed EH. Might be better on performance too
no no, they were added broken hue hue hue
Yep
As in, are they reliable in determining if a remote unit was damaged?
Hey, give me some slack
Or killed
Mphit and mpkilled
Instead of making EH's where the unit is local and remoteExecing to server a script to tell it the unit was hit
They work, they can be added from everywhere, I think that's "all" there is about them
tbh, I haven't played with them in a long time
Im having a go once i come back from lapland
the wiki knows more than me about them yep
Hmm... it seems that there is no command for getting all the kills of a unit. At least I couldn't find one for SP
@thorn saffron nope, none (maybe use "score")
The wiki usually knows more than I do, because I write there if I know something there isn't 😬
yeah, but it's a number, I would prefer the actual units.
I think I might need to use the killed EH
or combine it with my dummy unit instagator
possible to disable the ambient anims of soldiers via sqf?
like when they are standing around doing those weird hand/leg/head movements
there is a config mod to disable that, but not sure if it can be done also via scripting
Fun fact: if you change the projectile parent when it's fired from a vehicle, then there is a good chance it will hit and explodify the original parent
I remember having managed to bork the idle by accident
The what?
Uhh, yeah, like if you change it immediately after being fired?
yup
I assume it wont collide with the parent initially
nope
But if the parent is changed, the bullet is now inside the barrel
just a funny little thing
Which it WILL collide with, since it's no longer a child of said barrel
Makes sense, though
yup, it was funny to see the plane assplode itself
@velvet merlin painfully, with animation EH
😬
…yep!
iirc, I believe agents don't have these, but I might very well be mistaken
hey gents. If i want to pick up a unit and cause it to appear somewhere else, is there a command for that? Essentially teleport a unit? I want the player to have a randomized start at the beginning of the game (using case).
oh nevermind!
setpos...............
wow i am dumb
thanks, me!
so dumb 😜
ok so i am trying to make a ship fire and the ship have a script to do that, it stuck on this line +(_Vehicle getVariable "Cruise Waypoints" select {_x select 1}) and i am not sure how it is supposed to work, afaik the +() will just return a number, the select {_x select 1} would return the second element of every array (_x should be the iterator), right?
anyone know how to register a dead man's switch on an AI to trigger?
[ACE]
cause I know players have to manually activate it but don't know if AI have to
@fair drum give https://unitedoperations.net/forums/index.php?/topic/25071-ace-ais-with-dead-man-switches/ a read (link is someone on UO showing step by step how to do it)
Note site is not HTTPS so you will have to click apparently I dont know how chrome works :padvanced then let me on site if using chrome. Hope im not breaking any rules this time
Note site is not HTTPS
It is, thats why you need to do that
wait im dumb. It is HTTPS. Why do I need to click the things? Ah, probably cause certificate invalid
ty sir
cause i was just using a createVehicle with a bomb to do it but I want my players to find the switch and deal with it
is there a way to have an optional missing parameter between two others? like i want to get a [attacker, positionAttacker, number] and the positionAttacker if it's not supplied will be deduced automatically, yet i still want to be able to set the number, if i call it like [attacker, , 3] i get an invalid number in expression error
Just like every other program language it's not possible to do that...
Either set null/false to use default, or switch the 2md and 3rs param
Depending on the function of course
Not inbetween, no. In Python you could use keyword arguments and just Null the values you dont need to use and use logic to check whether they have a value or not
Just to clarify, i am not aware of keywords in SQF
that's incorrect, in other languages you can use assignments in a function call, like function(x=1, y=2)
and IIRC you can also skip parameters if there's no confusion in some, like if the 1st is a number 2nd is a string and 3rd is a struct, you can only specify a number and a struct as it's clear what you are assigning
if (getText (configfile >> "CfgVehicles" >> typeOf _ship >> "vehicleClass") == "HAFM_Submarines") then {_startingDepth = _ship animationPhase "senkou"; //Save starting depth
};
[other stuff]
if (getText (configfile >> "CfgVehicles" >> typeOf _ship >> "vehicleClass") == "HAFM_Submarines") then {_ship animate ["senkou", _startingDepth]; // Return to previous depth
};```
I get:
2:02:52 Error in expression <arines") then {_ship animate ["senkou", _startingDepth];
};>
2:02:52 Error position: <_startingDepth];
};>
2:02:52 Error Undefined variable in expression: _startingdepth
I don't get why tho
oh dumb me the scope 🤦♂️
if someone use hellenic armed forces mod (HAFM), i have made a wrapper script to control the AI ship launch of cruise missles so you can use it to create scene effects or call it for ship to surface missle bombing support, https://pastebin.com/S4AMLi2E feel free to let me know if you have any suggestion, the script is copyless so please feel free to copy, modify, include in anything, etc.
does https://community.bistudio.com/wiki/BIS_fnc_respawnTickets need to be executed locally, on the server, for every player or it's syncronized?
Is it possible to get the parent rope object of a ropeSegment?
question tyme. can we use setObjectTexture somehow on proxy models?
I have a model that has a proxy for another model, and I would love to change the texture of that one.
the model that is proxy'd in has hidden selections
Seem to have an issue with lbClear not clearing on a EH (LBSelChanged), however the rest of the code after it works.
((findDisplay 348567) displayCtrl 2100) ctrlSetEventHandler ["LBSelChanged","VKN_Template_Tool_selectionChange = true; lbClear 2101; lbClear 2102; [] spawn VKN_fnc_sideChanged;"]; //Side LB
((findDisplay 348567) displayCtrl 2101) ctrlSetEventHandler ["LBSelChanged","VKN_Template_Tool_selectionChange = true; lbClear 2102; [] spawn VKN_fnc_sideChanged;"]; //Faction LB
It'll set the variable and spawn the function, but not clear the listboxes, any ideas? They do exist and its the top most dialog.
wrong ids? (I know, "stupid" question)
See i thought that too, but I can add elements to it perfectly fine
My next option was to loop lbDelete
To see if that would work
But I have enough loops in this system already haha
Is there a way to change the kill log messages because whenever a player gets killed by AI on official servers it only says "<Player name> got killed" in the chat while in my mission it always says "<Player name> got killed by <NPC name> (AI)"...
nope… well, you can disable it and replace it with systemChat
@vague geode ↑
see showHUD
@winter rose Ok, thanks.
How would I remove a respawn position using a trigger? i read the wiki and tried using myRespawn call BIS_fnc_removeRespawnPosition; but the respawn position doesnt get removed.
what is "myRespawn" in your code?
its the variable name of respawn position
code?
Thats whats called in the trigger exactly
where do you define "myRespawn"? is it the module's name?
its defined in the variable name of the respawn module
that's why it can't work
https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition
→ ```sqf
myRespawn = [missionNamespace,"arena"] call BIS_fnc_addRespawnPosition;
that's quite different
https://community.bistudio.com/wiki/BIS_fnc_addRespawnPosition
returns an array to format [target, id]
So im trying to optimise how I spawn Quick Reaction Forces, and limit the amount of lag it puts on the server. Any tips on improving this code?
_QRF001= [[1722.74,15187.6,0], EAST, ["LOP_SYR_Infantry_SL", "LOP_SYR_Infantry_MG", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_Rifleman", "LOP_SYR_Infantry_AT_Asst", "LOP_SYR_Infantry_Corpsman", "LOP_SYR_Infantry_MG"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
_wp1 = _QRF001 addWaypoint [[1717.08,15165.8,0],0];
_wp1 setWaypointType "GETIN NEAREST";
_wp1 = _QRF001 addWaypoint [[1639.13,14465.6,0],0];
_wp1 setWaypointType "GETOUT";
_wp1 = _QRF001 addWaypoint [[1627.14,14266.3,0],0];
_wp1 setWaypointType "SAD";
_QRF002= [[1702.79,15201.10], EAST, ["LOP_SYR_Infantry_SL", "LOP_SYR_Infantry_MG", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_Rifleman", "LOP_SYR_Infantry_AT_Asst", "LOP_SYR_Infantry_Corpsman", "LOP_SYR_Infantry_MG"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
_wp2 = _QRF002 addWaypoint [[1705.93,15193.9,0],0];
_wp2 setWaypointType "GETIN NEAREST";
_wp2 = _QRF002 addWaypoint [[1782.48,14520.1,0],0];
_wp2 setWaypointType "GETOUT";
_wp2 = _QRF002 addWaypoint [[1627.14,14266.3,0],0];
_wp2 setWaypointType "SAD";
_QRF003= [[1703.11,15173.9,0], EAST, ["LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
_wp3 = _QRF003 addWaypoint [[1700.81,15169.5,0],0];
_wp3 setWaypointType "GETIN NEAREST";
_wp3 = _QRF003 addWaypoint [[1627.14,14266.3,0],0];
_wp3 setWaypointType "SAD";
This spawns two Squads that load into 2 trucks and head to target.
And 1 squad that loads into a tank and heads to target.
is there a way to get via script the network quality of a client (bandwidth, latency etc.)?
@high silo i would (but i just came back to A3 after years so pardon me if I don't get things right on first try) try to use the spawn instead of call so the function will run in a scheduled environment
so the spawning of the units will be non-blocking for the thread
Will have a look
_QRF003= [[1703.11,15173.9,0], EAST, ["LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman"], [], [], [], [], [], 273.660] spawn BIS_fnc_spawnGroup;
_wp3 = _QRF003 addWaypoint [[1700.81,15169.5,0],0];
_wp3 setWaypointType "GETIN NEAREST";
_wp3 = _QRF003 addWaypoint [[1627.14,14266.3,0],0];
_wp3 setWaypointType "SAD";
Like that?
no, spawn returns the script handle, not the function's result
still call, but the whole thing surrounded with spawn e.g
[] spawn {
private _QRF003 = [[1703.11,15173.9,0], EAST, ["LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
private _wp3 = _QRF003 addWaypoint [[1700.81,15169.5,0],0];
_wp3 setWaypointType "GETIN NEAREST";
_wp3 = _QRF003 addWaypoint [[1627.14,14266.3,0], 0];
_wp3 setWaypointType "SAD";
};
@high silo ↑
where is this code located?
.sqf in the mission file
Ya
no need to use spawn or anything then
Using spawn/execVM will make more lag, more like they're used to make a lag
So theres no way to cut down on lag, with the way im using atm?
https://community.bistudio.com/wiki/Scheduler
Probably little “complicated” thing but yeah... long story short, you can use call compile preprocessFile "yourScript.sqf" instead to make less (no) lag. However in this case if the script is super complicated, the game will freeze a while to process the code
So rather then:
execVM "Scripts\Meeting1\QRF\SendQRF.sqf";
It would be
call compile preprocessFile "Scripts\Meeting1\QRF\SendQRF.sqf";
?
Will do
wait what do you mean by "spawn will make more lag"?
the scheduled environment is made for the purpose of not impacting the normal running of other things, so the function may take longer to be completed but the rest of the server functions will not be/will be less affected by that, no?
I believe "lag" as in "you call this function, but the effects are showing 10s later"
uhm i understood it as "calling this slows the server down", as he said he wants to limit the amount of lag it puts on the server.
ah well, spawning units is spawning units, there is no magical +10FPS command then (unfortunately)
but you can spawn them in chunks and reduce the hit on the server
not the final one but if you spawn them at chunks you let the server complete the initialization of the old ones so it does not have to process 200 initializations at once
Plus the game must synchronize the data about created object for all clients which I believe also takes processing resources.
how do I prevent the dumb AI from leaving the helicopter? for no reason at all the pilot leave the helicopter and when i order the skip of the hold waypoint the helicopter of course do not take off
as the pilot is away doing his business for whatever reason
(and no i can't lock it since players have to enter)
well… I guess the pilot doesn't leave by himself, out of the blue?
yes, the mission start, my planes takes off, the helicopter closes the back door and the pilot leaves the helicopter
like "F this i'm going to take a milkshake" and walk away
driver _myHelicopter linkItem "B_Milkshake_F";
heh
Attached this EH to a unit and upon opening the inventory where there is no container, the _container parameter is Null (since inventory is overriden). The problem is that isNull _container returns false, despite _container being null
what gives?
_this addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
_Nca_container = _container;
if (isNull _container) then{ //<---returns false even though _container is null
_Nca_container = "GroundWeaponHolder_Scripted" createVehicle position player;
};
[_unit, _Nca_container] spawn Nca_fnc_showInventoryDialog;
true; // <-- inventory override
}];```
Arma bug?
here is the exact return:
[R Alpha 1-1:1 (S.S),<NULL-object>]
is <NULL-object> not recognized as Null by isNull?
yes, it is objNull
but it's not according to isNull
it's also alive, since !alive doesnt work on it
what magic is this 😅
systemChat typeOf _container```?
GroundWeaponHolder
WHAT?
but it's passed as follows
[R Alpha 1-1:1 (S.S),<NULL-object>]
what do you mean, "passed as follows"?
did you systemChat str _this?
Nca_fnc_showInventoryDialog gets the following [R Alpha 1-1:1 (S.S),<NULL-object>]
Is this some naming thing?
that the groundWeaponHolder is null until you place something in it?
[R Alpha 1-1:1 (S.S),23763434b80# 18700: dummycap.p3d]
seems to be so
maybe for cleanup purposes
why would you designate something still in use as "null"
it's an object that gets deleted - and yes it's better
(not a null-pointer in RAM, though)
but marked for cleanup?
https://community.bistudio.com/wiki/createVehicle#Examples
see example 9 to have "GroundWeaponHolder_Scripted"
what exactly is the purpose of a null-object in arma?
objNull is the "null" value for Object type, that's it
it does
it does
just that between the check and the dialog, it may have been deleted
GroundWeaponHolder is an object that is to be created and filled immediately - else it gets deleted if empty.
this here part returns false: (isNull _container)
but if i plonk a "systemChat str(_container)" above it, it's still null
so it's null before the isNull check, but then it's not null
but immediately after it's null again
or is this object named null by mistake, despite not being null for isNull
this addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
systemChat str isNull _container;
systemChat str typeOf _container;
systemChat str isNull _container;
}];
```is this what you mean?
@ebon citrus, repro plz
repro?
about your isNull/not null
that's what I get with a```sqf
isNull _container
typeOf _container
str _container
isNull _container
repro = reproduction of the issue
your example is incorrect
this addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
systemChat str isNull _container;
systemChat str typeOf _container;
systemChat str isNull _container;
true; // <-- inventory override
}];```
same with true - it works
doesnt work for me
¯_(ツ)_/¯
so i can't lock the driver in position? damn AI
@flat elbow mods? scripts? milkshake?
question for you too @ebon citrus btw - no mods?
[R Alpha 1-1:1 (S.S),<NULL-object>]
still the same
yep, mods
CBA is only scripted mod, though
still the same
@ebon citrus with my example?
with my example
it's a chinhook from RHS that is placed on USS freedom aircraft carrier
@ebon citrus then try mine
sure, in a moment
the mission start, you count 20 to 30 seconds, the driver get out never to be seen again
i even tried to moveInDriver him without luck
try with the helicopter on land? maybe he's "scared" of the carrier
yea things on the land works
there is otherwise no reason for an AI to leave a helicopter, unless it is heavily damaged
if I disable his path, would he still leave the heli?
IDK… perhaps
ok, after the function spawn the object is null
before it it's not null
so something cleans it up when the function is called
that's what I meant, yes
it is unscheduled in the EH, then spawn happens, the object gets cleaned up
I don't think you can prevent that
you could, however, replace it with the _Scripted version within the EH
(and don't forget to delete it afterward)
that brings a problem
i need to check if a groundweaponholder has anything in it before i spawn a new one
to determine if i need a new one or not
frontal lobotomy of the driver seems to have done the trick but as soon as i skip the waypoint and reenable it he starts the engine then leaves the helicopter
to say that i'm frustraded by the AI would be an understatement
try with a vanilla chopper?
if I delete the chopper and place everything again it will start to work for a while, after a while the problem (or any of the other 5 problems that i have solved) will pop up again
i would not believe it either if i had not seen it myself
Can I use EpeContactStart to set the force of the collision to zero
or to ignore the collision alltogether?
I would use disableCollisionWith but I dont know what the object may be colliding with is the problem
is there a script to spawn a c130 and add a paradrop waypoint when a trigger is hit
https://www.youtube.com/watch?v=pcqDtXS4BAM and you can play with hide/show modules or spawn
im having some issues with actions
i have the following script:
where Nca_openInventoryObject is the target inventory and _className is the classname of the item to be picked up
player action ["TakeMagazine", Nca_openInventoryObject, _className];
the animation plays just fine, but the item is not picked up
the following code works to drop said item, but the picking up doesnt work
player action ["dropMagazine", Nca_openInventoryObject, _className];```
What???
23:27:42 Error in expression <r_option", 0];
private _tableHeight = 0.816;
private _boxOffset = 2;
p>
23:27:42 Error position: <0.816;
private _boxOffset = 2;
p>
23:27:42 Error Incorrect number in expression
What wrong with this?
private _tableHeight = 0.816;
nothing at all, the error is most likely on another (previous) line
unless… you copy/pasted that and there is some invisible character shenanigan going on here @rustic plover 😄
if (!isNil "mission_commander_confirmed") exitWith {};
mission_commander_confirmed = false;
// Вместо 0 можно поставить значение по умолчанию
private _option = missionNamespace getVariable ["mission_trigger_option", 0];
// Высота стола
private _tableHeight = 0.816;
...
It's really something strange...
Ok, takemagazine doesnt work
is there a command to remove a single magazine from cargo?
i can only find "clear" commands
which remove ALL items of a type
unless… you copy/pasted that and there is some invisible character shenanigan going on here @rustic plover 😄
@winter rose yes, it was an invisible character. WTF, i just copied from win calculator :D
Ok, takemagazine doesnt work
correct
is there a command to remove a single magazine from cargo?
no (unfortunately)
No, dot was mine. Calc had me comma
ah yes, it depends on the locale (Windows setting)
so... count all magazines of a type in cargo, then remove all of them and add back one less?
¯_(ツ)_/¯
this is gonna take a bit
and when you don't set a mag class, the game says "I don't know CfgMagazines.<empty>" !
and since there is no takeItem…!
ehhh...
im just pulling all items of a type, storing them in an array, and then adding them all back with one less of the class that was taken
dropMagazine works fine
fortunately
im making my own takeMagazine
with blackjack and professionals
i'm not sure if that word counts as profanity
it can to some, so we try to avoid it (to my regret, as I like using the expression)
Done
there, i made a Nca_fnc_takeCargo
it's not perfect
because BI doesnt let me find out how many rounds magazines in inventories have
but meh
@ebon citrus AllCaps
can you try TakeDropMagazine/TakeDropWeapon?
these are two undocumented action - that's the action's name, really
"TakeDropMagazine" does nothing
TakeDropMagazine (maybe it is take/replace)
it probably takes extra parameters that i dont know of
i tried player action ["TakeDropMagazine", Nca_openInventoryObject, _className];
ok, so dropWeapon works unless the target is a player
if the target is a player, you need to removeWeapon and addweapon
because, you know
you cant DROP into a unit's inventory
even if that unit is dead
but you can DROP into their backpack
BI is being too humane
i am somewhat displeased by the recent developments (trying to avoid profanity)
well, i am equally displeased
ha!
i'll make my own drop-function!
with blackjack and professionals!
wait, is blackjack profanity? Its gambling 🤷♂️
often involves gambling
yeah no, it's not profanity
hey all. Trying to addaction to an AI character so that it will give the player(s) intel
informant addAction
[
"Talk to Informant", //title
{
cutText ["There is an enemy convoy that will be moving soon. I've marked the location on your map.","PLAIN",1]; //script
},
nil, //arguments
1.5, //priority
true, //showWindow
true, //hideOnUse
"", //shortcut
"true", //condition
10, //radius
"false", //unconcious
"", //selection
"" //memoryPoint
];
```sqf
on start I get "error, type string expected bool" with the hash mark in front of addAction
but it seems correct
thoughts?
don't put "" on the false
many thanks friend!
How does one apply enableEngineArtillery false; to remove artillery computers from all mortars/vics?
just like that
Ive tried it just like that and does nothing in my sqf
Effect: Local
If its being executed locally, shouldnt it mean it reads my sqf properly? or am I misunderstanding the local term
on the machine = my client?
client, server, wherever the code is run
🤔 Im still not catching on, If im running the .sqf in my mission folder and test running the mission, shouldnt it be executed locally then?
how/where do you run it?
I swear, if you tell me these are modded vehicles that are not impacted by the command…
shakes scarily one second
no were good its the vanilla mk6 🤣
and I just put the sqf in with
enableEngineArtillery false;
then proceeded to run the mission in eden editor
and have it do nothing
I think im missing a fundamental understanding part of the scripting
I just put the sqf in
how, where? tell me
talk to me! we can get through it together!
so you place a script named "myScript.sqf"
i called it arty.sqf 🤣
aaand how do you call it?
🤔
so copying and pasting enableEngineArtillery false; into a sqf by itself dosnt work is what your telling me 😿
Copy and paste into a sqf (except some special ones) does nothing!!
yep
place it in init.sqf, it will run by itself 😉
https://community.bistudio.com/wiki/Event_Scripts
these ^ files are automatically called by the game, none other
so would a execVM work?
yep
🤔 ok thanks for the help ill try not to break things
i put it in the init.sqf first and it worked immediately I feel so stupid now
don't worry you're realising just now that's how people learn 😉
better ask and feel stupid for 5 minutes than not ask and be stupid for the rest of your life 🙃
Hm, yea I guess thats true, Would you also by chance know the name of a scripting command that sets the time for ammo vehicles/crates to rearm?
the "reammo refilling rate" ?
I believe there is nothing like that,
but you can play with setVehicleAmmoDef to set vehicle's weapons amount in a 0..1 range
hm I read that, but I believe
setAmmoCargo Aligns better, as this is for warlords and people will sit next to an ammobox/vic regardless, of the magazine capacity in vehicles. Also Im not sure how to implement this correctly, Because vehicles in warlords arnt preplaced in eden, I cant just use vehicleName
setAmmoCargo only refills the ammo truck with "ammo load"
🤔 might as well try SetAmmoCargo then, but the original problem still remains, vehicle name isnt applicable here and I Dont think substituting for a classname would work
Hemmet ammo and csat ammo, and as soon as their spawned in by warlords system.(i.e players calling one in)
wait, they aren't filled when spawned? 😄
No they are, but they are TOO FULL (dont want to see missles flying from one side of the map to the other without the need to change ammo trucks)
as it is now you can have a singular ammo truck refill all vehicles indefinetly without issue
they should not be able to do so "indefinitely" - so maybe this is part of the WL system
and if so, any command would conflict with the WL system refilling them
🤔 never knew that too many hours in official WL servers. i guess bm-21's cant be used for now
In practice though, is their a way around needing a classname to alter vehicles in that manner? could be useful for removing/adding weapons and other vile things
maaaybe something like that```sqf
private _trucks = vehicles select { getAmmoCargo _x > -1 };
Is there any way to run code parallel? I'm apparently losing my mind since I thought spawn did that but it doesn't ^^
Been too long
spawn does
I'm thinking more in terms of threads. 1 spawn runs parallel to unscheduled but multiple spawns run in a single "thread" apparently
No
Are you sure? I didn't see any time improvement when splitting the code in 2, 4, 8, 16 spawns
Like from start to until all spawns are scriptDoneed
Time improvement what?
1 spawn runs parallel to unscheduled
i dont believe thats correct. as i understand it, unscheduled code freezes everything else until it completes.
True
technically, the more spawns you have the longer it takes for them all to complete, because there are more threads trying to get their piece of the 3ms per frame allocated to the scheduler.
Scanning the map terrain in cells of 100x100
I mean what is the code?
Ah I always confuse unscheduled and scheduled
maybe a mnemotechnic way:
Scheduled = Schedule = timed/planned 🗓️
@warm hedge
Please excuse the commented code, on my phone, via ssh ^^
should it be uncommented?
private _mapBounds = [] call ALiVE_fnc_getMapBounds;
private _sectorSize = 1000;
private _subSectorSize = 100;
private _width = round(_mapBounds / _sectorSize) * 1000;
private _jobs = 4;
private _t = _jobs / 2;
for "_x" from 0 to _t - 1 do {
for "_y" from 0 to _t - 1 do {
private _handle = [_width / _t, _subSectorSize, [_x * (_width / _t), _y * (_width / _t)]] spawn TEST_fnc_analyzeTerrain;
_scripts pushBack _handle;
};
};
waitUntil {
for "_i" from (count _scripts) to 0 step -1 do {
if (scriptDone (_scripts select _i)) then {
_scripts deleteAt _i;
};
};
(count _scripts) == 0;
};```Uncommented things out
👌
And once again, what did you expected for this code, how it should behave and how isn't?
it's behaving fine but if spawns ran parallel it should've ran faster basically halving the runtime with 2 jobs, etc
It should slower
depending on what happens in TEST_fnc_analyzeTerrain I'd say you could just call it and forget waiting for script handles entirely.
As it is yes but I'll need to do stuff with the results eventually
analyzeTerrain basically tests 5 points in a cell for it's terrain type
So yeah I'm trying to optimize it so that mission loading times stay somewhat reasonable and I'd basically need parallelism for that 😋
The code itself can be optimized further but I was trying out the spawns last
assuming you dont need scheduled commands, executing the whole thing unscheduled would complete the fastest, though the game might freeze for a moment. otherwise i believe a single spawn would be just as fast, if not faster than multiple.
alternatively you could save the results of an analyzed terrain so it doesnt need to happen every time the mission starts, but that may not be quite what you're after.
Caching is one of the things to look at but I'm still at the early stages
Wait, it's probably the sufaceIsWater call that's holding it back 🤦♂️
I'll test some more tonight I guess ^^
I know that you can draw e.g. triangles and polygons on the map with findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { /*code*/ }]; but is there a way to draw the same markers (or copies of them) on the mini map, too?
@vague geode
https://community.bistudio.com/wiki/Arma_3_IDD_List help yourself 😁
(I suppose IDD_CUSTOMINFO_MINIMAP, 311)
@winter rose Ok. I tried both findDisplay 133 displayCtrl 51 and findDisplay 160 displayCtrl 51 (for UAV Terminals) but neither worked...
@winter rose I don't think so, but I will try it later.
that's the customInfo minimap, so I suppose so
maybe 133 was the id before the custom info panels
this is what i have
((uinamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw",{}];
Ok, followup question: Where can I find what the different displayCtrl IDs stand for? I searched for them all over the wiki but couldn't find anything...
look at the control you want to use in the config viewer
Ok, will look at that as well.
you may want to check
https://community.bistudio.com/wiki/allDisplays
uiNamespace getVariable ["IGUI_displays", []];```and https://community.bistudio.com/wiki/allControls as well
Anyone every compared setting texture vs animateSource for something like a blinking light ? My guess would be texture setting should perform way better and result in less network traffic
is there a way to check if animation exist ? I want to check if I can use animation from mod, and not select it when mod is not loaded
isClass maybe ?
Probably, though I don't think that's a case...
could check if the state is in a moves class
eg: isClass(configfile >> "CfgMovesMaleSdr" >> "States" >> "AadjPcrhMstpSrasWpstDdown")
Ah, thought you're talking about animations of vehicles
in the case of a vehicle it might be eg:
isClass(configfile >> "CfgVehicles" >> "I_MRAP_03_F" >> "AnimationSources" >> "Door_LF")
idk. odds are it is defined in a config somewhere
Can't you just use the config viewer if the Animation has a proper source defined ?
?
not for the purpose of checking in a script, no
Ahh, I thought he just wanted to know
@robust hollow "CfgMovesMaleSdr" is base one used also for mods ? what about these: "CfgMovesMaleSdr_TC3", "CfgMovesMaleSdr_TC4"
TC somethings are really not things
i dont know, i guess so. the states in the TC classes seem to be vehicle crew states mostly. you'd need to check the mod you're using as to what class it is defined in (most likely CfgMovesMaleSdr).
@robust hollow
_animations = ["c7a_bravotleskani_idle5", "Acts_CivilIdle_1"] select { isClass(configfile >> "CfgMovesMaleSdr" >>
"States" >> _x) };
I think this should work
Acts = Animation Cutscene
turns out most of them are 🤦♂️
Every of them are
some are "actions". whatever the difference is.
which ones? 
or, they're in the actions class atleast
idk what im on about.
configfile >> "CfgMovesMaleSdr" >> "Actions" >> "Acts_CarFixingWheel_actions" for example. its not an animation i dont think so ill just pretend i didnt see them in there 👍
¯_(ツ)_/¯
idk 😄
@winter rose allDisplays returns [Display #0,Display #313,Display #70,Display #46,Display #49,Display #12] so findDisplay 311 displayCtrl 51 ctrlAddEventHandler ["Draw", { /*code*/ }]; doesn't work.
get the display using the uinamespace variable
That doesn't work either.
is the mini map open?
((uinamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) does work in debug for me right now.
Ok, I will try again.
i notice you're trying ctrlidc 51 though
what would you guys reckon is the best way to determine if a weapon is a cannon?
my best shot so far (but I wonder if it might miss a lot of modded cannons) ```sqf
_isCannon = "cannon" in toLower (configName (inheritsFrom (configfile >> "CfgWeapons" >> _weapon)));
Check nameSound IMO
@warm hedge ha, thanks. i wonder why i didn't go for that 😇 🤔
I know this might be a stupid way either 😛
i had issues with RHS that i didn't have in vanilla. just realized that the RHS cannon in question inherits from the 120_mm cannon, the 'inheritsFrom' is returned differently but 'namesound' is identical in the weapon config so it seems to be the better way
@robust hollow No, doesn't work.
I used exactly what you sent me: ((uinamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw", { /*code*/ }];
so when u say it doesnt work, is it that the event doesnt fire or the ctrl isnt found?
controls have draw handlers?
ah they do 🤔
Would've just added it onto the display itself
@robust hollow It is that the marker isn't visible on the minimap after running the code.
but the ctrl is found and the event is added?
@still forum
onDraw
Use on: Map
Fired on: Fires when the map is drawn (can occur more than once per second).
Returns: Returns the map control.
doesnt say about working on displays 🤔
@robust hollow No entirely sure but the return is 0 instead of -1 so I guess it is.
ok so its a problem with the event code, not with how the event is added.
oof
@robust hollow No, the event code is definatly working since I use the same event code to draw the marker on the normal map (findDisplay 12).
this marker is made with drawIcon?
No, drawTriangle and drawPolygon.
both commands work for me. in your event code do you reference the ctrl idc directly or do you use the ctrl parameter provided by the event?
I use the ctrl parameter provided by the event.
It is just _this select 0 drawTriangle [/*...*/]; and _this select 0 drawPolygon [/*...*/];...
ever heard of params our Lord and Saviour? ^^
@winter rose That's how I saw it in the wiki... https://community.bistudio.com/wiki/drawPolygon
have you tried that example on the minimap ctrl? does it work for you?
@vague geode Wiki gonna be corrected 👀
@winter rose Ok, how else should I do it then?
So.. Im trying to get it where when a heli lands near a AI group, they run and get in it. Then when get to there LZ they dismount. I need to be able to repeat this with several groups of AI. Any tips?
make an array of AI groups, loop over them and execute the scripts to have the heli do the transport
The heli will be flown by a player thats the issue
trigger -> if heli present, move AI, repeatable



