#arma3_scripting
1 messages · Page 169 of 1
then the issue might have been you not saving the file.
If I hadn't saved the file it would have restored with the error through OneDrive... How odd lmfao. Maybe it was just how I was testing it
about wait until, perhaps the command in there doesnt do what you expect it to do under certain conditions
How about I make the script sleep for the amount of time it takes him to walk there instead
It's a little more... Simple
But should get the job done
Unless someone arrests "martinez" 😄
They don't have the means of doing that
Ohhhhkay then
Bye Martinez...
Mf got to his waypoint and... Wandered off
LMFAO HE WANDERED BACK TO THE TRIGGER
Oh Arma
Never change
Gonna refine and test a bit more tomorrow
test away
Thanks again, your math suggestion regarding terraingGridWidth worked perfectly. Unfortunately, my holes are only good for The Bra map, which has a small terrainGridWidth of 2.5. All other maps I checked had larger values which makes the holes way too big. But it will be a sweet addition to The Bra.
Glad it helped,
You might be able to do stuff with maps with a larger gridWidth, but the holes are kinda sloped
last queston i swear!
im wanting to add an addaction to crates for them to be loaded into the nearest vehicle, but im having trouble understanding the nearest ordeal
i can figure out the rest i just cant find really much on nearest object with vehicles
Is there a guide for creating projectiles?
I'm lost in the sauce
what do you want to do?
and I shall guide you
I'm trying to recreate the MT round for the MAAWS: a tandem warhead structural round that's designed to punch through the wall with the first charge and then detonate inside with the second.
There's a mod I found today from Rat Works that appears to achieve the effect, but the files are so messy and rife with Cyrillic characters that all I can figure out is that they use an event handler to recreate the projectile at the point of initial impact with the same velocity, but I can't figure out how that's called.
I've also heard it may be possible to achieve the effect through submunitions, but like I mentioned I don't understand anything about the projectile system so I don't know which would be best. I do know that I want the second explosion to be different than the first.
forgot to reply
So do you mean you want to make a Mod to add a new type of round
Post your script
Correct
Crap
Soz if this ain't the right area, can someone confirm if ACE and CBA are fuckin busted again with the latest update? Our dedi is gettin fucky
Include Stack:
- z\ace\addons\realisticnames\config.cpp:1
- z\ace\addons\realisticnames\script_component.hpp:17
- z\ace\addons\main\script_macros.hpp:2
3:40:49 Application terminated intentionally
3:40:49 ➥ Context: Preprocessing file: z\ace\addons\realisticnames\config.cpp at 1
Include Stack: - z\ace\addons\realisticnames\config.cpp:1
- z\ace\addons\realisticnames\script_component.hpp:17
- z\ace\addons\main\script_macros.hpp:2
3:40:49 ../lib/Network/networkServer.cpp ClearNetServer:NOT IMPLEMENTED - briefing!
Include file x\cba\addons\main\script_macros_common.hpp not found.
3:40:49 Critical:Destroying running thread!
3:40:49 Critical:Destroying running thread!
They're not
They haven't even updated recently. The last time they both updated was the 15th of last month
Is there any way to share video feed from Arma 3, a in game camera or any stuff, to a external conection like RTSP?
#arma3_troubleshooting , but it looks like your CBA has a file missing, which ACE relies on as well. Try repairing/reinstalling it.
Hey guys. I have a repair trigger. Works in local hosted but need to remote exec it only for client in trigger in vehicle.
Crude example:
// Set trigger condition and statements
_repairTrigger setTriggerStatements
[
//"{_x isKindOf 'LandVehicle' || _x isKindOf 'Helicopter' && speed _x < 1} count thisList > 0", // Condition (testing cond. below.)
"{(_x isKindOf 'LandVehicle' || _x isKindOf 'Helicopter') && speed _x < 1 && damage _x > 0} count thisList > 0",// Condition
"call {_handle = [(thisList select 0), thisTrigger] call NUP_fnc_repairVehicle;}", // Activation
"" // Deactivation (empty)
]; //works on local hosted ```
I’m just not sure how to remote exec it only the correct client. Tried
``` " [(thisList select 0), thisTrigger] remoteExec ['NUP_fnc_repairVehicle', owner _x] ;}", // Activation```
Any takers wanna tell me what I’m doing wrong?
Happy thanksgiving. fixed.
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
anyone know how to setup auto-restart messages? i have the server through GTX and they have scheduled tasks but no option of restart warnings. i did message gtx but they were not much help at all. is there a script or something i can get that lets me set up restarts with warnings
Hi
Once an AI joins the player group they get assigned as the last number (group is made up of 6 newest will be 7 etc). Is there a way to make them join but push them up the chain, for example to 6 and have the current #6 be #7?
So basically my tail gunner will always be at the end of the group, regardless of who joins.
Currently getting an error for expected Array,Object on the getDir player
I replaced setDir with lookAt
setDir cannot be directly replaced with lookAt. They require different inputs.
https://community.bistudio.com/wiki/lookAt
lookAt does not accept a direction, partly because it works in 3D and directions are 2D. It requires an object or a 3D position (3-element array) as a target to look at.
have you tried https://community.bistudio.com/wiki/joinAs ?
ty will give it a try
so to have AI hvt_1 join the player's group it will be
hvt_1 joinAs [(group player), 3];
never tried that command my self
I dont have one as of yet because I dont understand the nearest object for a vehicle - but i'll get started and post it here
Ohhhh gotcha so I need to replace the direction with player
so i'm not sure how to do the little code boxes everybody is doing
i got a script but it keeps telling me that canvehiclecargo is a undefined expression
_ObjectToLoad = _this select 0;
_vehiclesList = (getPos _ObjectToLoad) nearEntities [["Car", "Armored", "Air"], 10];
_vehiclesList = _vehiclesList - [_ObjectToLoad];
if (count _vehiclesList < 1) exitWith {hint "Cargo: No vehicles within 10 meters"};
_sortedVehicles = [_vehiclesList, [], {getPos _ObjectToLoad distance _x}, "ASCEND"] call BIS_fnc_sortBy;
_CargoVehicle = _sortedVehicles select 0;
_check = _CargoVehicle canVehicleCargo _ObjectToLoad;
if (_check isEqualTo [true,true]) then {
_CargoVehicle setVehicleCargo _ObjectToLoad;
}
else {
if (_check select 1) then {
hint "Cargo: Vehicle Full";
}
else {
hint "Cargo: Cargo too large";
};
};```
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
is it literally just !code
no, the message's content 😂
```sqf and all
noice! now just add "sqf" after the first ``` and you're all set 😎
i will get this got it!
I want to make a check if a side knows about more than 1 unit of other side within specified area. I though something like { blufor knowsAbout _x } count (units resistance in thisList) > 0 would work but it says that count receives bool rather than array
uh oh
no?
units resistance in thislist is a bool yes
hmm
thislist select { side _x == resistance } is an array
yes, canVehicleCargo is not a command
did you use… ahem… some AI to generate that?
you know, i wish i did - but i didnt
i got it from https://community.bistudio.com/wiki/canVehicleCargo
I was genuinely checking google there incase it was a fake site lmao
maybe _CargoVehicle is nil?
_sortedVehicles select 0 _sortedVehicles may be empty, you don't know
i'll need to try again later, i've been at it for too long
don't code while tired!
yeah exactly, all the stupid mistakes like editing the wrong mission lmao
but i want to use that BIS_fnc_holdActionAdd and apply it to crates for 'humanitarian' cargo - but man its just kicking my ass
ok I get it, so how do I use the knowsabout as a condition for count?
right now it says error type number, expected bool.
ok I think I got it too.
KnowsAbout returns number 0-4. Compare it against something. I found that comparing it against >2.5 says that ai got positive id on enemy. Anything less was that they know something is odd
yeah I got it right too, but I still cannot make the trigger to run.
as long as I check for units resistance rather than Lou's array it's all good, the other gives no return value with no error either
@jade acorn all good then?
no :(
{ blufor knowsAbout _x > 2.5 } count (thislist select { side _x == resistance }) > 0 thrown into the trigger condition does not have any return value nor an error. if I count for units resistance instead it does return true
thisList depends on the conditions set in the trigger's attributes (e.g. ANY PLAYER, etc). If it's set to something that excludes INDFOR units, you won't find anything.
oh, so all I have to do is set independent in the activation field
what is the code counterpart of trigger's "side detected by other side"?
!this
I'm pretty sure it uses knowsAbout. I dunno what the threshold value is though, maybe 1 but not sure
Try "Detected by BLUFOR" +
this and { (thisList findIf { (side (group _x)) == independent }) >= 0 }
is there any performance difference between yours and thisList select?
I think this is probably a case where you actually don't want to use group side, because you don't want to accidentally count dead units
These are different things.
Don't remember if triggers detect corpses. If they do, then
this and { (thisList findIf { (alive _x) and { (side _x) == independent } }) >= 0 }
You shouldn't need both an alive check and a unit side check (for sides other than civ) because the dead units become civilian. That's what I was trying to say, just using unit side rather than group side will definitely exclude dead units.
Yes, but use of hacks is not obvious.
When unit dies, knows about is reset to 0 i believe
.......hacks?
I was just getting max value of all enemy units knows about. Then in condition compared max value to 2.5
actually I don't care, forget it
Yes.
Why does
(thisList findIf { (side _x) == independent }) >= 0
not take corpses into account? Because Arma makes them civilian. We know that. But for others that isn't obvious. So I think it's better to write
(thisList findIf { (alive _x) and { (side _x) == independent } }) >= 0
Just a note - this doesn't work on mobile
It works. Only syntax highlighting doesn't work.
I mean, I'm literally viewing on a Samsung S21FE and I see nothing other than the standard code block
yes but if you view same message on PC it highlights syntax, it just doesnt highlight on phone
yep, known (it's on Discord's end)
Yeah haha, it's dumb
Yeah that's not what I meant
As I wrote, only syntax highlighting doesn't work.
YOU BOTH AGREE DAMMIT, now fight or this is not internet anymore 😄
Round 1... fight!
(j/k, I love you don't fight you're all very nice people)
knows about compared to > 1. But they will also get triggered if bullet lands near them when fired from 1km away
eg they would have no idea where it came from or if it was actually fired by enemy. Or they spotted a plane/drone/helicopter kilometers away
_ObjectToLoad = _this select 0;
_vehicles = (getPos _ObjectToLoad) nearEntities [["Car", "Armored", "Air"], 10];
_vehiclesList = _vehicles - _ObjectToLoad;
if (count _vehiclesList < 1) then {hint "Cargo: No vehicles within 10 meters"};
_SortedVehicles = [[_vehiclesList]],[_ObjectToLoad],{_ObjectToLoad distance _vehicleslist},"ASCEND"] call BIS_fnc_sortBy;
_CargoVehicle = _SortedVehicles select 0;
_Cargo = _SortedVehicles select 1;
_check = _CargoVehicle canVehicleCargo _Cargo;
if (_check isEqualTo [true,true]) then {_CargoVehicle setVehicleCargo _Cargo};
if (_check isEqualTo [false,true]) then {hint "Cargo: Vehicle Full"};
if (_check isEqualTo [true,false]) then {hint "Cargo: Cargo too Large"};
it abosolutely is determined that
_SortedVehicles = [[_vehiclesList]],[_ObjectToLoad],{_ObjectToLoad distance _vehicleslist},"ASCEND"] call BIS_fnc_sortBy;
needs ;
what am i not getting
[[_vehiclesList]],[_ObjectToLoad],{_ObjectToLoad distance _vehicleslist},"ASCEND"]```
Count your `[` and find their matching `]`.
it just fixed those brackets around the _vehiclelist
as soon as its all rainbow i can see 4k apparently
after fixing that, _cargovehicle, _x and _cargo are undefined
That means _SortedVehicles is empty.
in the editor i have a vehicle right next to it, surely that would be listed onto the
_sortedvehicles
Not sure.
if (count _vehiclesList < 1) then {hint "Cargo: No vehicles within 10 meters"};```
This line checks whether there aren't any nearby vehicles, but still allows the function to continue if there aren't any. I suggest replacing `then` with `exitWith` so it bails out if it's about to fail this way.
10 metres is a surprisingly short distance in Arma, especially since it's (in this case) measured from object centres, not from the outside of their models
its those supply boxes that look like their airdropped - i'll up the distance to about 50 and see if that works?
I would say the main suspect for misleading you this way is the truck itself; they're longer than you think, so if it's end-on, the centre will be further away than it looks.
probably stupid question - but Car, Armored and Air is just the universal stuff right? because i'm using RHS and its literally ontop of the box
rightclick > inspect in config viewer.
If it lists "Car" in the list of parent classes at the bottom, it should be detected. If not, you have a problem.
["rhsusf_M1083A1P2_flatbed_fmtv_usarmy","rhsusf_M1083A1P2_fmtv_usarmy","rhsusf_M1078A1P2_fmtv_usarmy","rhsusf_fmtv_base","Truck_01_base_F","Truck_F","Car_F","Car","LandVehicle","Land","AllVehicles","All"]
AllVehicles just revealed itself like a prize
okay so if that changed, its now back to telling me that the _cargovehicle and _x is undefined, meaning _sortedvehicles is empty again as Schatten pointed out
Did you make this change? #arma3_scripting message
yes
i'll repost the script
waitUntil {!isNull player};
_ObjectToLoad = _this select 0;
_vehicles = (getPos _ObjectToLoad) nearEntities [["LandVehicle", "Air"], 50];
_vehiclesList = _vehicles - [_ObjectToLoad];
if (count _vehiclesList < 1) exitWith {hint "Cargo: No vehicles within 50 meters"};
_SortedVehicles = [[_vehiclesList],[_ObjectToLoad],{_ObjectToLoad distance _x},"ASCEND"] call BIS_fnc_sortBy;
_CargoVehicle = _SortedVehicles select 0;
_Cargo = _SortedVehicles select 1;
_check = _CargoVehicle canVehicleCargo _Cargo;
if (_check isEqualTo [true,true]) then {_CargoVehicle setVehicleCargo _Cargo};
if (_check isEqualTo [false,true]) then {hint "Cargo: Vehicle Full"};
if (_check isEqualTo [true,false]) then {hint "Cargo: Cargo too Large"};```
okay so it's not that the original list is empty, it's that your sort algorithm is wrong
Check syntax: https://community.bistudio.com/wiki/BIS_fnc_sortBy
sorry i'm still trying to get used to this stuff, not a coder as you can clearly see
well, the sort algorithm was wrong in the previous script, now you've corrected it, but you're passing _vehiclesList to the sort wrong
To check syntax you don't need to be a coder, you just need to be attentive.
[_vehiclesList] // array containing _vehiclesList (array within an array)
_vehiclesList // just _vehiclesList (array)```
Bingo!
god damnit
_SortedVehicles = [_vehiclesList,[_ObjectToLoad],{_ObjectToLoad distance _x},"ASCEND"] call BIS_fnc_sortBy;```
This isn't strictly a problem as it should still work, but if you're going to reference _objectToLoad directly by name in the algorithm, then you shouldn't need to pass it as a parameter.
Passing parameters to BIS_fnc_sortBy makes them available in the algorithm as variables _input0 to _input9. Having passed _objectToLoad, you could reference it as _input0. This is so you can dynamically use different inputs with the same algorithm without having to write different code. But if you're just specifying _objectToLoad and not using the parameters, you don't need to pass it as one.
e.g.
_SortedVehicles = [_vehiclesList,[],{_ObjectToLoad distance _x},"ASCEND"] call BIS_fnc_sortBy;
// or
_SortedVehicles = [_vehiclesList,[_ObjectToLoad],{_input0 distance _x},"ASCEND"] call BIS_fnc_sortBy;```
right, okay
so the top eg you did, its able to be called _ObjectToLoad because theres only 1 instance, the one below that was already called so it can then be used as _input0
got you
i appreciate your time
However, I think i need to step back and admit defeat on this one.. I think the code is just fucked to begin with
Was there a link somewhere, to adding SQF to notepad++?
Yes, use a search engine to find.
It depends.
I am wondering b/c I just realized the syntax doesn't like arrays across multiple lines.
It likes.
Newlines are treated basically the same as a single space, you can put them pretty much anywhere except in the middle of a word
Well- not the one I had. It's fine with {} but not []
Before, couldn't collapse arrays across multiple lines.
weapons = [
["arifle_AKM_F","30Rnd_762x39_Mag_F"],
["arifle_AKS_F","30Rnd_545x39_Mag_F"],
["hgun_PDW2000_F","30Rnd_9x21_Mag"],
["SMG_01_F","30Rnd_45ACP_Mag_SMG_01"],
["SMG_02_F","30Rnd_9x21_Mag_SMG_02"],
["SMG_05_F","30Rnd_9x21_Mag_SMG_02"]
];```
for example
That should work fine other than that weapons can't be used because it's the name of a command
oh- well just example so x3
But in NPP it wouldn't be collapsible.
I tried to do a fix and thought it worked although i've just noticed-
hm yes
What Notepad++ detects as a collapsible section doesn't really have any relation to what the game thinks, you can set it up however you like
That's the issue of either N++, or the plugin, or both. But not SQF.
Was just curious if someone had a solution is all. More updated syntax or something.
Migrate to another editor.
ive never seen that problem with npp. maybe its setup wrong
am i right in saying that the _sortedvehicles select 0 is the first vehicle printed out on the list when it comes to the function?
_SortedVehicles = [_vehiclesList, [_ObjectToLoad], { _input0 distance _x }, "ASCEND", {}] call BIS_fnc_sortBy;
_CargoVehicle = _SortedVehicles select 0;
_check = _CargoVehicle canVehicleCargo _ObjectToLoad;```
IF the list is not empty 👀
Hi!
How can I find out which missiles belong to which class. I mean which missile belongs to Missiles0 and which missile belongs to Missiles4
right so.. its clearly not the sortby that i've gubbed.. its how its finding vehicles for the list
wha- ok so I found a DIFFERENT sqf syntax when I googled to what I already have-
confusion-
VSCode better
Right fuck it, does anybody have a load cargo script
vehicle player setVehicleCargo _jeep;
```here you go
Sorry, but either it doesn't work or I don't understand how to use it. Is there another way to find out?
It works for me.
Provide your code.
So I can't figure out how to use it
Read description, examples...
Oh my fucking god
it works
you know what the problem was?
the vehicle had no cargo
i'm a fucking idiot
but thank you everybody.. i wont show my face around here anymore 😅
Ah no! I've had that happen before. "Why isn't this wor-...oh..." xD
have you tried this on rockets?
Don't remember.
It works, just use the alt syntax
typeOf doesn't have alt syntax. Maybe isKindOf?
Oh I read that as isKindOf
In that case, typeOf works on rockets, or any projectile, just fine
@granite sky Lets continue here
What am i supposed to do with the code in this website
You just create a text file called initServer.sqf in the same location as your mission's .sqm file. If you put that S1 disableAI "MOVE"; in there then it should work.
Can i put my code in there instead of the game
That is the idea, yes.
Do i need to restart my game to test the code out?
Can you help me with this? I don’t really understand programming, much less arma(
No. IIRC you just need to restart the mission.
ok
Can you provide your code?
Do i need to export the mission first
No.
ok
Where can i find the mission file
The mission.sqf file where is that
sqm :/
I knew that
In the mission's folder.
Nothing in there
Depends which profile you're using and whether it's SP or MP.
except a read me text
Then that's not the mission's folder.
You didn't export.
If you export it'll be a PBO and then you can't put anything in it. You need to find the mission folder in the profile.
Ok
If it's the default profile and an SP mission then it'll be in Documents\Arma 3\missions
What was the website you sent?
The only documentation on initServer.sqf I could find on the BI website.
Ahh okay
What are you trying to do?
T1 isn't defined, i.e. no unit has that variable name
But a unit does have that name
Can you show it?
You don't, a trigger is an object
Okay
What are you trying to do?
Set up a counter offensive
I got the initserver working
I just gotta delete all of the code i did on the unit now
Script wise, what are you trying to do?
Disable AI until units enter a trigger?
Enable the units ai so it can move
That's default behavior, and your error says you're using disableAI
Oh the trigger
So are you trying to have units who won't move until a trigger activates?
That seems to be what you are trying to do
im setting the unit to disable unit and when my team take control they will enable ai and move over and attack
Yes
I get the same error
Just for the actual mission im making
And this time there actually is someone named it
This is my code
I have the exact same code on a testing save and it works fine
Then those variables aren't defined when that code runs
What does that maen
It means they're undefined, so nothing has those names
Its for a squad
assault squad
is that why?
No, the type of units wouldn't change anything
Is there anyway to fix this?
Post the entire screenshot.
Good.
Now you can fix the error.
You assigned S1 to a group
Yes, not to a unit.
DisableAI only works on a unit
How do it to a group
im not adding a variable inviduallyuuu
You could do:
{
_x disableAI "MOVE";
} forEach (units group S1);
Also the _x?
It's a "Magic variable" that is the current item in a forEach loop.
In this case you loop over all the units in the S1 group, so _x will be the unit
And if you need to do it for S1-4:
{
private _group = _x;
{ _x disableAI "MOVE"; } forEach units _group;
} forEach [S1, S2, S3, S4];
Yeah, and just replace your current lines with that
Scripting can be hard, especially at the beginning
I get this error now
Should be the one inside the first loop
I edited my code I sent
Oaky
Finally works
Ill do the testing for the mission tomorrow
ill just add some markers now
Thank you alot i wouldve never figured this out alone
No problem 👍
i tried the following but the AI keeps joining as #6 of a 5 unit squad
hvt1 joinAs [(group player), 4];
From BIKI ( https://community.bistudio.com/wiki/joinAs ):
if position id is available, this one is used
That was expected without video.
i inputted the number i wanted him to be assigned in after joining, but joined as last
Let's think, if the number is occupied, then the others need to be moved, is that logical?
yeah
Do this.
so i have to remove the current #2, have hvt1 join as #2, then make #2 rejoin again?
Sounds like a plan.
the following worked but gave me an error:
"Error suspending not allowed in this context"
sleep 3;
[a2] joinSilent grpNull;
[a3] joinSilent grpNull;
[a4] joinSilent grpNull;
[a5] joinSilent grpNull;
hvt1 joinAs [pg, 2];
sleep 3;
[a2, a3, a4, a5] joinSilent (pg);
Remove suspending. Or change environment.
what are those?
sleep for the first, https://community.bistudio.com/wiki/Scheduler for the second.
i got it to work with no errors by putting it in an sqf and calling it
which i guess is the sceduler
Sure, init.sqf runs in scheduled environment.
but i've seen trigger activations work on sleep code
thinking back it was one instance not multiple
Hello, is it possible to script an intel document composition for public Zeus servers, where players can pick it up and get information from the intel?
One shot Kill (local player only)
yes:
[
this, // object reference in 3den object init
"Pickup Intel",
{
params ["_target", "_caller", "_actionId", "_args"];
// I recommend creating your own diary subject (subject here is "Diary")
[[], { player createDiaryRecord ["Diary", ["Title", "Description"]]; }] remoteExec ["spawn", 0, true];
// delete intel as if you "picked it up"
deleteVehicle _target;
// alternatively, delete action instead of object
[_target, _actionId] remoteExec ["removeAction", 0, true];
}
] remoteExec ["addAction", 0, true]; // true is for JIP players
Ive written a whole mod that does this and more 😁
which one?
If your unit is wearing a rebreather vest, and a wet suit, the diver fins show up on the side of the outfit. When you're deep enough in the water the fins automatically go on the feet and the rebreather mask shows up on the face.
Is this done internally through a script?
Say, if I wanted the fins to show up arbitrarily regardless of the uniform and make the unit swim as if wearing the fins, is there a script command for that?
I can't seem to find it, and it seems like the models for the fins and the mask are not part of the suit model itself. It's as if they get attached using attachTo
No, engine feature, and they are the part of the model
I saw someone try to find a hidden selection on the wetsuit model before.
With that said, on the itemconfig itself, eg: the vest or the outfit, is there a part of the config to signal to show the fins?
Even if it doens't, how does the game know that a certain outfit gives the unit the ability to swim using fins?
There's hiddenSelectionsUnderwaterTextures or something like that on the unit's configiirc
I never looked into it, but could be each set of fins are their own selection and each is hidden/shown when going in the water
Interesting issue here, I've just come back to Arma 3 editing after 6 months and suddenly BE is blocking local functions ran from the debug console, is this a new thing or is something really weird happening for me?
Basic example, let's say I have functionA, inside functionA, data is sent to the server. In the Debug console (on a dedicated server) I can run the guts of functionA, and the data is sent to the server. However, if I actually try to run functionA [] spawn DS_fnc_functionA, the guts of the code is not sent to the server, instead the server's logs will say BE protection activated for player id=1959382702, name='Huntah', msgType=379
I think someone already tried that and the wetsuit model doesn't have hidden selections.
I'm honestly under the impression there's an attachTo somewhere internally.
And it seems that there has to be a config line somehwere in the uniform, something like canDive=true in the wetsuit config
Just make it neopren type
class ItemInfo: UniformItem {
uniformModel = "-";
uniformType = "Neopren"; // <--- This is it
uniformClass = "NSWDG_Operator_CS_OD";
containerClass = "Supply40";
mass = 40;
};
That's just for the faster swimming as far as I know
Is that all you were looking for?
Correct, that's what I meant by striking only the swimming part.
Attaching the fins is the second part.
does anyone have a server restart warning script i can use for wasteland. i found this one but it says i need to put "real_date.dll" into the same directory as my arma3server.exe but i cant do that as im running the server through GTX servers. im not sure if there is a way around this problem
https://github.com/soulkobk/ArmA3_Scripts/blob/master/serverRestartMessages/serverRestartMessages.sqf
is there any way to get a dynamically generated images inside game from a URL? i am trying to use QR Codes on the briefing screen using qrserver api, but got no clue about how i am going to do it
example:
https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=hello_world
(even discord can do it, this imaged below is fetched)
Yes you can. How to generate a QR is open source/knowledge so generate one in SQF.
...However, in 2.20 you will get a web browser GUI which could make it easier
but how i would generate a image out of a sqf script?
oh, drawing as characters
i didn't think about this
Drawing as procedural texture (ui2tex)
it is something
but you got me thinking about rendering as ASCII
using a extension with some rust library to give me the drawing and parsing it
You don't even need an extension if you afford enough time to write SQF
But as I said it is much easier to wait till 2.20 or join Dev-Branch to use web browser
(Never tried, but it should work)
Please review my code. I screwed up the createDiaryRecord command. Its fixed now.
BAX Intel
Posted here:
#production_releases message
Can you post a link to the 2.20 branch notes?
In this thread well try to describe updates happening in the Development branch of Arma 3.This changelog is not complete, nor confirmed to be working as advertised. Again, Development branch does not pass internal QA before publication. Stick with main branch if you do not want to deal with the (...
is their a param/command for setting a satchel charge timer?
Hey I need some help with an animation, so I input this code on the ai, on the object: init
[["class EF_B_Navy_WellDeckCrew","Acts_NavigatingChopper_Loop"]] call BIS_fnc_animViewer;
And the ai just stand there as if nothing happened, I'm probably missing a step, and I'm lost honestly
Where did you get this line? It makes no sense.
Splendid animation viewer
Is your mission SP or MP?
Oh its looping animation, I guess it shouldn't matter much
Do something like this switchMove "Acts_NavigatingChopper_Loop"; in init
MP
Okie I'll try that
Also sorry I forgot to mention that I did mess with the code, here's the orginal
[["B_Soldier_unarmed_F","Acts_NavigatingChopper_Loop"]] call BIS_fnc_animViewer;
They still just stand there :(
This is edtor init field, right?
Yes
of the unit you placed in the editor?
Yes

iirc its different in Zeus with _this instead of this
I shall try that
YES HE DOES IT but stops bc I think the animation is short?
no idea tbh, I'm bad with AI and animations
this spawn {waitUntil {time > 0}; _this switchMove "Acts_NavigatingChopper_Loop"};
This worked in Editor
Basically you need to wait until unit inits first before applying animations, checking for time > 0 is the easiest check here
Hey its all good, at least I'm getting somewhere and I really appricate the help!
I'll give it a try boss
Show it in the editor
Oki
Is there a group init field somewhere or something?
You could've pasted it in the wrong place
since the init script passes group instead of unit
Lemme try pasting it in the group tab since nothing happens in the unit tab
So in the composition state it comes up with the error but if it's in the individuals state there is no error but the ai still stand there
You need individual unit init field only
Also maybe 3DEN enchaned uses _this instead of this?
No idea, I don't use it
I'll give that a try
Sad to say
It doesn't work
I wish polpox's Enhanced Artwork Supporter had this animation 😭
It honestly could be something on my end
I see it has the same animation:
I was about to try the old one rn lmao
as for this error, did you accidentally select the group and paste it in Group: Init?
EAS does not add any (not static) animation. You can even run both ASes too
Ah okay
Also, both Animations Viewer should show EVERY animations ingame
Yeah
Alright I got it working, thank you all for your help and thank you polpox for your mods
very simple question, but i have the following code in onPlayerRespawn.sqf:
_player = _this select 0;
_player enableFatigue false;
_player setCustomAimCoef 0;
the enableFatigue part works fine, but the setCustomAimCoef doesnt seem to do anything. any thoughts?
probably locality issue
shouldnt be i dont think. considering the line above it works completely fine.
Using mods?
when is the code run, editor, dedi?
its ran in onPlayerRespawn.sqf on a local hosted session
well if onPlayerRespawn.sqf runs at server your code wont work because the commands require local argument and player is not local in server
apparently i can use _this select 0 to get the player, why wouldnt i just be able to run code on that?
client, iirc
You have disabled ace sway?
https://github.com/acemod/ACE3/blob/61e6d109f26cf89b4658a6ac3a8fc2c352cc9013/addons/common/initSettings.inc.sqf#L106-L111
Because you have ACE No Medical -> you have ace,
and ace set in loop of sway
->
https://github.com/acemod/ACE3/blob/61e6d109f26cf89b4658a6ac3a8fc2c352cc9013/addons/common/functions/fnc_swayLoop.sqf#L28
ACE_player setCustomAimCoef (_baseline * _multiplier);
the player is the Server on a Hosted Server
Wiki says that once I apply doStop on a unit it will not follow the leader until I use doFollow on it. However in this script
private _waypoint = group player addWaypoint [getPosASL arr_1, -1];
_waypoint setWaypointStatements ["true", "flow1 = 1"];
sleep 2;
doStop [guy2, guy3];
guy2 doMove (position arr_2);
guy3 doMove (position arr_3);
```they go to those position and then follow the leader anyway. It does not stay nor does not wander around like KK's comment says on the doStop page
so what is it then, do I not have to run doFollow and AI will join the formation as soon as I have any move command executed after doStop?
hi, i need some help with define.
My intention is that this code is populated with three arguments and then a return is the output.
#define CHECK_SWITCH_DO(var1,var2,var3) (((random 1) > var1) && {var2 in var3})
var1 & var2 are numbers, var3 is an array with numbers.
So far nothing works with the code snippet or I can't get it to work in all my Variant I have tried.
What am I doing wrong?
Looks alright to me.
Put it into a script function, and then print it in debug console to see the end result after preprocessing. You're probably using it wrong
Just to expand on that, #define is a preprocessor command, so you have to use it in a place that's going to go through the preprocessor. If you're just putting it straight in the debug console like that, it won't work, because the debug console doesn't preprocess.
Works in function.
omg im so dumb, I have two Tags (beo,mbmc) for my functions and i wanted to call every time the false function with my mbmc_fnc_ Tag.
sry and thanks for the time.
how do I make BIS_fnc_kbTell sentence played on radio? In its default state ["ConvGotOut", "MissionConversations"] call BIS_fnc_kbTell; works and is played in direct chat, but as soon as I run ["ConvGotOut", "MissionConversations", "", true] call BIS_fnc_kbTell; it does not work at all, but no error, there is no sentence or sound. The bikb itself is just a single sentence that's supposed to be heard by player
class Sentences
{
class Sentence1
{
text = "Alright, let's see Robinson. This will be a long day.";
textPlain = "Alright, let's see Robinson. This will be a long day.";
speech[] = { "\vo\guy1_v1.ogg" };
class Arguments {};
actor = "guy1";
};
};
class Arguments {};
class Special {};
startWithVocal[] = { hour };
startWithConsonant[] = { europe, university };```
and then how do I change the speaker's ID to his name or anything else? With normal text I can use customChat, but what about conversations?
see radioProtocol parameter
radioMode sorry
well yeah, should do
what about the other thing? Although now I'm watching some official campaign playthrough on youtube and see the same behavior so I guess it is not possible to change at all. Number for all team convos.
yeah works only on direct chat
which syntax used?
setName's? _this setName ["Ben Kerry","Ben","Kerry"];
ah well, I'm out of options then
if the campaign itself is like this then I would say that's about it?
I was thinking that if not through the normal chat, I would somehow force the BIS_fnc_kbTell to display sentences with BIS_fnc_showSubtitle, but can't really put my finger on how to insert the text value into the code parameter
sentences have the textPlain thing but I would have to export the mission, put it into a mod folder and then restart the game every time I change something.
This isn't a part of the Sentences system, it's the Group channel itself. Channels have their own rules for how they display callsigns, and AI have different rules to players, for the built-in channels.
AI names also aren't displayed if they're the source of a sideChat, for example.
oh okay, I think I get it now
so I made a custom radio channel
myRadioChannel = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "My Radio Channel", "%UNIT_NAME", units blufor];```but when I execute this
```sqf
["ConvGotOut", "MissionConversations", nil, 1] call BIS_fnc_kbTell;```it is displayed, but I also get an error as shown on the screenshot. Some engine/perf bug or I gave a wrong value somewhere?
Wrong input values
https://community.bistudio.com/wiki/BIS_fnc_kbTell
0. Topic: string (OK)
- Container: string (OK)
- Section: array or string (NOT OK, you passed
nil) - Mode: bool, string, object, or code (NOT OK, you passed
1)
BIS_fnc_kbTell's syntax says "String - name of radio channel ("DIRECT" or "VEHICLE") or custom", but the custom channel's label does not work
1 isn't a string
what would be a string for custom radio channel?
label, which is a string, does not work, channel ID is the number
It's not clear. Maybe try passing the ID as a string.
Well, try opening BIS_fnc_kbTell in the Functions Viewer and seeing what it actually does.
parameter description in the code says "_this select 3 (Optional): BOOL or STRING or OBJECT or CODE - true to force radio, name of custom radio channel, listener's channel, returned value of code". But from what I see it refers to fn_kbTellLocal and it doesn't really have any info I would understand
and the error message references these lines
private _channel = _params param [3,"",["", true]];
if (typeName _channel == "STRING") then {_channel = toUpper _channel};```
Well I've looked at the code and I believe the answer is that it's just f'ed

I see that kbTell has this:
//--- Custom channel
_noChannel = false;
private _channelCfg = gettext (_cfgSentences >> _sentenceId >> "channel");
if (_channel isequalto false && _channelCfg != "") then {_channel = _channelCfg}; //--- When undefined, use config channel
switch (typename _channel) do {
case (typename {}): {
_channel = [_from,_to] call _channel;
_channel = _channel param [0,false,[false,"",0,{}]];
};
case (typename 00): {
_channel radioChannelAdd _listUnits
};
case (typename true): {
_noChannel = !_channel;
};
case (typename objnull): {
_toActual = _channel;
_noChannel = true;
};
};
_params = if (_noChannel) then {
[_toActual,_topic,_sentenceId]
} else {
[_toActual,_topic,_sentenceId,_channel]
};
``` but unsure if this is of any use to me
Don't use typeName: https://community.bistudio.com/wiki/Code_Optimisation#isEqualType_and_typeName
tell that to Karel Moricky, not me lol
Oh, I thought that's your code. LOL.
kbtell, the command, does support numbers for custom channel IDs, and this is what the kbtell functions end up doing, internally. If you pass a number, it will reach the internal kbtell and should basically work.
However, fn_kbTellLocal also uses the channel parameter for some other stuff like subtitles, and in the process of parsing it for that, it goes through a param that doesn't allow all the types that are supposed to be supported - it only accepts strings and arrays, not any of the other things that it could be. And that's what causes the error.
There are also a fair number of "todos" and commented-out pieces in these functions, and they're old as hell too. So yeah, this part just doesn't work. I would suggest treating it as if custom channels are not supported through these functions. You can try to do it by using kbtell directly if that's important, but you'll have to do a lot more of the work yourself.
I was about to say I would just use it anyway and hope that the final player won't have the "Show script errors" option checked, so they wouldn't see this
so if I wanted to ditch the idea of using the side chat at all and use the showSubtitles function, do you know how would I insert this into the code parameter of BIS_fnc_kbTell? It takes the same parameters as eventHandler parameter in kbAddTopic, which takes the same parameters as the fsmFile parameter, but I don't know how to make it to put the speaker name and text string into the BIS_fnc_showSubtitle function
so far I only managed this with the manual conversation stuff, so kbAddTopic, kbTell through inserting it between the sentences and replacing after every waitUntil to match the spoken text, but it's a lot of copypasting.
Yeah sure thing I'll check it when I'll have time.
made a ticket on FT, see you in 5 years 🫠
Hey guys. I want to setup global Loadouts with ace. So Ive to use:
["Squad Leader", getUnitLoadout sql1, true] call ace_arsenal_fnc_addDefaultLoadout
So I want to use "Syntax4" of getUnitLoadout config
But I dont know how to define that config. Is it just in a config.sqf?
In the mission description.ext.
Config is a separate thing to SQF, it has its own rules.
The bluebox at the top of the getUnitLoadout page has an example loadout config class in it, and Examples 4 and 5 at the bottom shows how to retrieve a loadout class from a game/mod config (CfgVehicles or anywhere else a loadout might be defined) or mission config (description.ext)
So Ive to do it like this:
I need Example 5
And I have to define a class in description.ext like in the second picture
So Ive to learn how to create a class
Far easier way is to use ace loadouts
Just save an ace loadout copy it to your clipboard and use the addDefaultLoadout function in ace to add the kit
Like I said, the blue box at the top of the getUnitLoadout page includes a sample loadout class. You just need to fill it with the things you want to put in the loadout.
Do you mean this: https://community.bistudio.com/wiki/Unit_Loadout_Array
@flint topaz where do Ive to insert this? And is my example right:
[[["JCA_arifle_M4A4_AFG_sand_F","JCA_muzzle_snds_556_advanced_sand","acc_flashlight","JCA_optic_AICO_sand",["JCA_30Rnd_556x45_IR_sand_PMAG",30],[],"JCA_bipod_04_sand"],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",17],[],""],["U_tweed_acu_summer_ocp",[["ACE_Canteen",2],["ACE_WaterBottle",2],["ACE_MRE_CreamChickenSoup",2],["ACE_EntrenchingTool",1],["ACE_EarPlugs",1],["ACE_Chemlight_IR",1,1]]],["V_tweed_iotv_mk4_e_1",[["ACE_elasticBandage",10],["ACE_packingBandage",15],["ACE_quikclot",15],["ACE_bloodIV_250",2],["ACE_epinephrine",1],["ACE_morphine",3],["ACE_splint",1],["ACE_tourniquet",2],["ACE_painkillers",2,10]]],["B_simc_US_Molle_asspack_OCP",[["30Rnd_556x45_Stanag_Sand_Tracer_IR",5,30],["HandGrenade",1,1],["SmokeShellBlue",1,1]]],"H_tweed_ech_OCP","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","TFAR_anprc152","ItemCompass","ItemWatch","ACE_NVG_Gen4"]],[]] call ace_arsenal_fnc_addDefaultLoadout
I dont understand the syntax of call ace_arsenal_fnc_addDefaultLoadout from https://ace3.acemod.org/wiki/framework/arsenal-framework
What are currently the best sqf plugins for notepad++?
Example:
[“Rifleman”,_loadout] call ace_arsenal_fnc_addDefaultLoadout;```
The format needs a name for the default kit and the kit itself
So _loadout will be the shown name?
I know this really good one called VSCode.
😉
Omgh
These are the ones i use in VSCode if you ever would like to swap
I’m just crazy and don’t use a language aid, don’t be me
use the hemtt language server and utils plugin
brett keeps it much more updated than the others
Ive insert in Notepad. Its now way more logical. But still dont work: @flint topaz
[“Schuetze”,_loadout_schuetze] ace_arsenal_fnc_addDefaultLoadout;```
You changed the structure of the kit
Just copy and paste when you copy the kit don’t mess with it
The kit is the thing I get from getUnitLoadout VAR right?
You can do it that way, but I prefer doing the ace Arsenal way
This is the result of your benchmark:
Unfortunately I’m not able to read that error as I’m not really able to read German. But I assume the formatting is what it would be complaining about
Ill change language of corse for you. Im sorry
I’m on a phone right now so can’t really debug myself
looks like "undefined variable in expression" or something
What's "Rifleman" in that expression?
So weve found issue. Your also from another country so your " and my " are diffrent. Weve changed but getting now this error @flint topaz
missing "call" between arguments and ACE funcion?
I have a group of 7 people and I want to set their position on 7 different object positions. How do I do that through a loop? Objects are named pos_1 to pos_7. I thought of a for loop but it can take a single array. Group members have no variable names.
missionNamespace getVariable format ["pos_%1",1];``` can be a workaround
TBH I want a command that convert string to a identifier
Is there an event handler that will fire every time a weapon attachement is changed?
Suppressor/muzzle attachement in particular
Best I've been able to figure out so far is use InventoryClosed and the ace interaction menu equivalent
I looked for something similar not too long ago, I went with a CBA loadout player event handler
That is probably what I want, and would handle all ways that the muzzle attachement could change
There was... SlotItemChanged or something that might work
Oh right 2.18 added the _weapon param too
Use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#SlotItemChanged instead actually
Yeah, that's easier than handling the loadout or an extra step to get the weapon
No, I do not. That's useful information, but it's for a different way of doing it, not for the config class method.
What I mean is this:
Go to this page: https://community.bistudio.com/wiki/getUnitLoadout and look for the BLUE BOX at the top of the page. It has the words "the config should contain these standard entries" in it, followed by an example config class.
Hey folks, I've got a question regarding drones. How can I get a drones Target for a script?
I know, with a Player it would be simply cursorTarget. But strangely, this seems not to work when I have control over a UAV.
Is there another way that I am missing?
It does. I'd say you are missing something
Strange, script works flawless when using Laser Designator but not when using a UAV Drone. Okay, will try further.
I've tested on AR-2
Okay, nevermind. Its to late for me. Sorry 😄
Is there a limit on how large a hashmap can be?
is there a way to stop PBO manager creating so many .bak files?
Yeah, don't use PBO Manager. It's not meant to pack mod addons and shouldn't be used to do so
And for mission addons, just export it from Eden
This also isn't scripting related
nah im unpacking the mission file and editing it then repacking it to a pbo then using filezilla to put it back on the server. seems everytime i repack the folder to a PBO it creates .baks for every file in the folder
It creates a .bak file if there's already a .pbo with that name
But just export it from Eden again, PBO Manager doesn't perform any optimizations. It just packs whatever is in the folder
so if i delete the existing PBO before repacking i wont get that problem. sweet as
also didnt realise there was scripting police on here lol
Your question just didn't have anything to do with scripting
its probably the most relevant channel for it considering its the next step after scripting
i have 35 years scripting experience and I think its rather relevant to the situation
Their question was about a tool that isn't related to scripting
PBO Manager just packs files into a *.pbo file
If you mean laser target, use laserTarget command
Anyone knows a bugfeature where remote unit switches seats they get out and get in for a few frames, it properly triggers get out and get in events, right?
Pretty sure it does but I can't repro it to make sure
Maybe somebody has something taking this into account and knows for good
your computer's RAM 😄
35 years of experience on Arma scripting & PBOs? please send in your application, you will most likely be promoted CEO of Bohemia!
Hey all, I've started an Antistasi server for a few friends, when in Zeus I can't edit any of the existing vehicles. I've tried using Ares to make things editable but it does not work. Do you have any idea why this is and/or how I can fix it?
I'm pretty green in the world of Arma scripting and missions so any references to read up on would also be handy 😅
You have a game master module in mission?
There is an attribute where you can define editable objects for Zeus, including unofficial ones
https://community.bistudio.com/wiki/Arma_3:_Module:_Game_Master#Default_addons
I have absolutely no idea, I can access Zeus when logged in as admin (#login -> Y) though. I suppose I'd need to open it in Eden to check?
Yes
Why does my script barely work in global mobilization
i can put the exact same script in global mobilization that i used for the base game and suddenly it stops working
You should provide your code,
Without content it's hard to say where your issue is
{
private _group = _x;
{ _x disableAI "MOVE"; } forEach units _group;
} forEach []
Alot of code doesnt work
but ill just give the ones i have experienced not working
ScriptedCharge = "Bo_Mk82_MI08" createVehicle (getMarkerpos
"Marker variable name");
Sometimes it works but other times refuses to work
Its the exact code i always use
Where do you call this one?
Make sure your grps is correctly defined in grp array.
{
private _group = _x;
{
_x disableAI "MOVE";
} forEach units _group;
} forEach [grp1,grp2,grp3];
A trigger
I do use the variables when i use it just not when its in my saved codes text
It worked with west germany but not east germany
You'd need to modify the mission to do a permanent change, but on the fly you can do this:
[getAssignedCuratorLogic player,[vehicles, false]] remoteExec ["addCuratorEditableObjects",2];```
Debug console, local exec. Change false to true if you also want to make the crews editable.
Notes:
- be careful, Antistasi's scripted systems may not like you touching their stuff
- editable objects may not appear as editable in 3D if you have their layer collapsed in the left panel. I can't remember if this is a spectator thing or a Zeus thing or both, but watch out for it just in case.
Thank you, I appreciate the help, I'm just shocked google didn't turn up exactly this within 5 mins
I ended up taking the alternative solution and installing Antistasi ultimate which includes Zeus compat, as well as some other mods my friends asked for
I'm sure the answer is yes, but is there a way to apply an init to vehicle wrecks?
you mean so you can delete it or what ?
why do you want an init on a vehicle wreck ?
basically wanting it so if a vehicle becomes a wreck, i can set its mass to 10 and have it slinged back to base for scrap
ahh nice hmmmm
Use a Killed eventhandler or EntityKilled mission eventhandler
its going to be something like if typeof "Wreck_base_F" then this or something
okay great
If i already have an existing Entitykilled, I can use it again? silly question i know
its not silly
I know its not the code, but i'm guessing the eventhandler is going to be along the lines of - if (_unit isEqualTo "Wreck_base_F") then { my code here that i want}
If it's already designed to target the same types of things, or a broader class of things that can also include the vehicles you want, then you could sensibly put it in the same one.
If it's more specific and doesn't have any overlap in what it's aimed at, it'd be better to make a separate one.
Not because it's impossible to use the same one in either case, but because it's logistically better to separate things that have totally different purposes. Like imagine you wanted to turn one of the systems off at some point - can't remove the EH if that would also wipe out something completely unrelated.
* also makes the filter logic easier to get your head around if it's 2 separate filters
okay fantastic, well I ended up putting a if !(_instigator isEqualTo player) exitwith {); for the money script as the entitykilled was picking up ALiVE despawning enemies and random entities around the map detonating - my commander on the mission gets $5 a kill from infantry so he went from 2500$ to about 1,500,000 in 5 minutes
so i'm guessing because I have that one only activating for players, it should not* collide
No, you'd use the vehicle's normal class. In most cases vehicles don't change class when they are destroyed.
right okay
(actually things never change class, that's not something that's possible. If something appears to change class, it's because it was deleted and replaced with a new entity)
Oh so i'm actually looking for a new entity instead
thats good to know
so instead of wreck i should be checking to see if a vehicle has health less than 1?
thx you Nikko
No, unless it's one of those horrifying ancient Arma 2 helicopters that replaces itself with a "wreck" object when it dies. The vast majority of vehicles don't have separate wrecks, they just have a "dead" state for the same object. * which does not change its class
No. You're using an EntityKilled event handler, so you know the object it fired for is dead. Otherwise the EH wouldn't have fired. You just need to check that the entity is one of the classes you want to target (using isKindOf) so you're not operating on dead men or map objects or whatever other random junk is out there.
nice thx you Nikko
no no hes not fedup them guys like helping as i see it
It's fine. I'm not getting paid to do this so you can rest assured that if I'm here, I'm willing to help.
* clarification: that means if I'm actively here, random pings are different :U
thx m8 your awsome love you @hallow mortar
I appreicate it man
its so freeking awsome we have guys in here like Nikko and Dart and others, where would we be with out them
Also, I know sometimes my way of writing isn't always incredibly clear, so if you ever don't understand what I've said, please ask for clarification and I'll try to reword it. That's much better than trying to struggle forward on incomplete information or speculation.
it seems clear to me
you helped me alot Nikko
i like that word speculation i use that in court alot lol
he he
I'm still not sure if your method works, but I found a much better way
- SQF file to the mission folder extractAllAmmo.sqf
private _ammoClasses = "true" configClasses (configFile >> "CfgAmmo");
private _results = [];
{
private _ammoClassName = configName _x;
private _effectsMissile = if (isText (_x >> "effectsMissile")) then {getText (_x >> "effectsMissile")} else {"undefined"};
_results pushBack [_ammoClassName, _effectsMissile];
} forEach _ammoClasses;
// Output to RPT
{
diag_log format ["Ammo: %1 | effectsMissile: %2", _x#0, _x#1];
} forEach _results;
hint "Data has been written to the RPT file.";
- Console command [] execVM "extractAllAmmo.sqf";
- The data will be written to the RPT file C:\Users<YourUsername>\AppData\Local\Arma 3
is there any tips for a money system if you're giving money out for two different classes?
I have the entitykilled eventhandler working wonderful
but when i try to make it pay a different slot a different amount, it just keeps putting their money to 0 - but this is what i have atm
NotHim = [PLAYABLE_SLOT_1];
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator"];
if !(_instigator isEqualTo player) exitwith {};
if (_instigator in NotHim) exitwith
{
private _bonus = round (_unit distance _killer);
private _killersCash = _instigator getVariable ["Cash", 0];
if !(isNull objectParent _killer) then
{
_totalreward = (_totalreward / 3) + 25;
_killersPayout = _killersCash + _totalreward;
_instigator setVariable ["Cash", _killersPayout, true];
hint format["Killer: %1 Cash %2", name _instigator, _killersCash];
};
_totalreward = (_totalreward / 2) + 25;
_killersPayout = _killersCash + _totalreward;
_instigator setVariable ["Cash", _killersPayout, true];
hint format["Killer: %1 Cash %2", name _instigator, _killersCash];
};```
No, because typeOf only works on objects
where does _totalreward initially come from?
i swear when it goes up like a rainbow and somebody points something out like that it makes you feel real stupid
Thank you 😅
that should be _bonus in that (_totalreward part
There is a option in the Eden Editor to make a unit a "Hostage". But you can't change the speed to untie the unit or adjust other properties. So I wanted to try to make a version of this with holdAction. How would I go about making it so that the unit had that sitting pose then allow them to stand once united?
the 9th parameter in bis_fnc_holdactionadd is codeCompleted, aka code run when the action is completed fully. You could do _target playMoveNow ""; maybe?
and in the hostage's init you could just set an animation for the hostage to be seated
I have used this script, but it turns on all flashlights, including infantry groups wich doesn't have the script.
How can i make it work only for those groups with the script?
Bohemia web shows me this script, but it doesn't work at all, i'm confussed
_groupA enableGunLights "Auto";
This is all animation manipulation. Speed animations up using setAnimSpeedCoef. Change animations with play move but they have to have a interpolation config setup between animations for it to work smoothly
If I do something like playanimation from one animation to the other will it just kinda zorp the animation from one to the other and look jank?
I have a question, "name" is a string of text, but what does it mean if it look like this 'name'?
playMove/Now will attempt to interpolate if there is interpolation available for the animations involved, otherwise yes there's a "zorp" and there's no way around that.
switchMove does not attempt to interpolate and always "zorps".
Also a string. In this context, " and ' are interchangeable, although I believe they have to match, i.e. you can't do "string'. Which one you use is up to you. Sometimes a mix is used if you need to nest a string within a string, e.g. "outer string 'inner string' outer string" - using the different types allows the game to distinguish between the inner and outer strings, and not prematurely end the outer string when it reaches the start of the inner string.
alright, thank you for the information.
What's the best way to search to for playMove animations? Is there a list available somewhere?
To find the interps, you go to the animation config and they are listed in a interp array which ones work with that specific animation
To find the list itself, they are listed on the wiki or you can use the in game animation viewer, or polpox's viewer
But you still have to look at config for interps
okay, i am trying to understand how linebreak works because for some reason it wont linebreak my text Script:
_string = "First line", lineBreak, "Second line";
copyToClipboard _string;
you aren't composing the text (this is used for structured text)
if not using structured, you can also do:
_string = "First line\nSecond line";
or
_string = "line1" + endl + "line2";
if using structured text like you are, you'd have to do:
_text = composeText ["First line", lineBreak, "Second line"];
but in some instances, you'd still have to convert that back into a string
oh okay thank you
can i pass variables through an event handler to be used in a different script?
i have it set up atm where you get kills it gives you money and updates the variable, but as soon as I add an AI to the mix, it seems to just not transfer from the event handler to the script - almost like the variable cant be applied to the entity
What? Can you please show the code?
addMissionEventHandler ["EntityKilled",
{
params ["_unit", "_killer", "_instigator"];
if !(_instigator isEqualTo player) exitwith {};
private _bonus = round (_unit distance _killer);
private _totalreward = (_bonus / 2) + 50;
private _killersCash = _instigator getVariable ["Cash", 0];
private _killpotCash = KILL_POT1 getVariable ["Cash", 0];
if !(isNull objectParent _killer) then
{
_totalreward = (_bonus / 3) + 50;
_killersPayout = _killersCash + _totalreward;
_killertax = _killerpayout * 0.12;
_killpotadd = _killpotCash + _killertax;
_instigator setVariable ["Cash", _killersPayout, true];
KILL_POT1 setVariable ["Cash", _killpotadd, true];
};
_killersPayout = _killersCash + _totalreward;
_killertax = _killerpayout * 0.12;
_killpotadd = _killpotCash + _killertax;
_instigator setVariable ["Cash", _killersPayout, true];
KILL_POT1 setVariable ["Cash", _killpotadd, true];
hint format["Killer: %1 Cash %2", name _instigator, _killersCash];
}];```
thats the event handler in the initserver.sqf
KILL_POT1 = _this select 0;
ThisGuy = [PLAYABLE_SLOT_1];
_Cash = KILL_POT1 getVariable ["Cash", 0];
_Cash2 = PLAYABLE_SLOT_1 getVariable ["Cash", 0];
_Contractfund = _Cash + _Cash2;
if !( player in ThisGuy ) exitwith {hint "Tablet: Restricted to Commander"};
hint "Contract Funds: Standby";
sleep 1;
if (_Cash < 1) then {hint "Contract Funds: is Empty"}
else
{
hint format ["Contract Funds: You have recieved $%1 for completed contracts", _Cash];
sleep 3;
PLAYABLE_SLOT_1 setVariable ["Cash", _ContractFund, true];
KILL_POT1 setVariable ["Cash", 0, true];
sleep 1;
if ( player in ThisGuy ) exitwith {hint format ["Payment: $%1", _ContractFund];};
default {hint "Shop System: Out Of Order // Report to RaptorSKA"};
};```
thats the script that gets executed
if i set the variable in the server using the debug - then run it the script - it gives me the money and says the balance and everything - but on the event handler - it doesnt set the variable and always comes back empty
"script that gets executed" where and how?
it gets executed via a holdaction on a tablet i'll put the execute
[KILL_POT1, Player] execVM "Scripts\killpot.sqf";
probably that ithats wrong
Single or multiplayer?
Multiplayer, sorry was afk
sorry bro I truly have no idea that script was from 6 years ago lol
haven't played arma since 2020/2021
idk how you do it anymore but it might be the way it's being executed? the _x for each all units will just apply it to everything spawned most likely
I found what Missile0/1/2/3/4 are responsible for and what types of ammunition belong to them, but there is also Missiles5, and I cannot understand and find where it is used and what it gives. Maybe someone knows?
whoo, boy, where do i start
oh god
the money side of things, it works great - but if theres a better method of adding value to say _killpot then i'm all ears - i'd like to get better
if !(_instigator isEqualTo player) exitwith {}; isn't guaranteed to work on server and is guaranteed to break when there are 2+ players. Probably check with isPlayer _instigator
hint format["Killer: %1 Cash %2", name _instigator, _killersCash]; would only show the thing on server (to the host or to nobody on dedicated server). Consider changing that to remoteExec
the hint thats fine, it was only really for debug anyway - but i'll do that for the multiplayer side
[KILL_POT1, Player] execVM "Scripts\killpot.sqf"; that goes to KILL_POT1 = _this select 0; doesn't really make sense. If KILL_POT1 is already a global variable - the script can access it as-is. No need to pass it as an argument and even less need to reassign its value back to the global variable
oh so that can literally just be [] execVM
default {hint... in a script is probably a relic of already deleted switch case and i'm not sure it'll work at all and not break anything 
duplication of _killersPayout = _killersCash... and so on in the event handler looks fishy. You'd probably need to delete the first set of lines as the second set (after the end of if !(isNull... block always runs. Or wrap the second set in else {...}
next, what is KILL_POT1 anyways? Some kind of object?
well it was a civilian that was about 100k away but i changed it to a game_logic
places in editor with KILL_POT1 as its name in editor?
yes
looks sane then. "as soon as I add an AI to the mix" how? Allow AI to spawn in the second playable slot or something?
oh basically everytime i went ingame, killed an AI - then went to the tablet and did the execVM - it said the pot was empty
but when i did it from the debug - it immediately worked
i had the same event handler doing stuff to another playable unit which worked - but when i switched it to a Ai it stopped
but, it's probably been a fluke that its worked seeing how much i had to fix
well, at least half of those fixes is readability/general fluff, tbh
and the player check in EH wouldn't cause problems as long as you host yourself (or play singleplayer), so that should've worked in theory
yeah alot of the issues basically came to light as soon as my friend hosted
especially with the support_requester, that only works for the host atm
but this being fixed will be great man
I figured out a way to do it but implies to change the name of every group in every group's script.
if (!isPlayer _x) then {
_x enableGunLights "forceOn";
};
} forEach units g1;```
Being "g1" the name of the group, then i copy and paste that group (g1_1, then g1_2, etc.) and change the name of the group in the script for every group. That way i can do it for a single group and not all units. I had to discard the idea since i need a way to copy and paste that group live on a Zeus mission without editing every time. 🤷🏼♂️
Thanks a lot by the way! if not because of your script i would never figure a way out.
so i'm confused tbh
i want to understand what is going wrong here because I did all the changes that was suggested, and it stopped working
but i also noticed that this script that i started with which i'll post after this message, works great - until i put Else or ExitWIth.. i dont know if i'm using these wrong (which i probably am)
but if i do.. for example
if (isplayer _instigator) then { code bullshit here };
It works
but if i do
if (isplayer _instigator) exitwith { code bullshit here };
or
if (isplayer _instigator) then {code bullshit here} else {bla bla bla};
it completely dies out
the money goes from 2500$ to 0 and remains and 0
i've even removed the killpot and everything just to get the killing to work
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator"];
if !(_instigator isEqualTo player) exitwith {};
private _bonus = round (_unit distance _killer);
private _killersCash = _instigator getVariable ["Cash", 0];
if !(isNull objectParent _killer) then
{
_totalreward = (_totalreward / 3) + 50;
_killersPayout = _killersCash + _totalreward;
_instigator setVariable ["Cash", _killersPayout, true];
};
_totalreward = (_totalreward / 2) + 50;
_killersPayout = _killersCash + _totalreward;
_instigator setVariable ["Cash", _killersPayout, true];
hint format["Killer: %1 Cash %2", name _instigator, _killersCash];
}];```
this works 100% of the time
but if i change the if !(_instigator isEqualTo player) exitwith {}; to the if (IsPlayer _Instigator) then - it stops working
even when i change that bottom half to a else it just dies
been at this since 11am
are you doing any debugging/logging yet?
if not, you should start doing that, cause the problem might be right under your nose, you just can't recognize it via your code atm
this is going to sound really sad
but is there a better way to debug instead of the black window that pops up for 2 seconds
Do you mean the one that appears for script errors?
You can just log stuff in whatever way you want, diag_log for your rpt file or a systemChat for just showing in-game (you'd want to remove that for a release)
thanks man
are you using vscode?
download Log Viewer
then in the side bar, open up side bar for Log Viewer: Watches and use a generic location like I have in the photo. then you can click on that file, it will open up the most recent rpt file, and watch/update it as changes are made
Out of curiosity- does anyone know if something like this would work? I've got two locally created vehicles that I want to be able to have other clients across the network be able to set variables on for certain machine IDs. Would those vehicles local cause any kind of issues with this? I imagine no but would just like to verify 🙂
// Client 1 and Client 2:
global_localVehicle = createVehicleLocal ["VR_Area_01_circle_4_grey_F", getPosATL player, [], 0, "CAN_COLLIDE"];
// Client 1:
global_localVehicle setVariable ["global_localVehicle", serverTime, [owner client_1, owner client_2]];
// Client 2:
global_localVehicle getVariable "global_localVehicle";
yeah, you can set independent vehicle namespace variables for the same vehicle like this, but just really keep track of what you are doing lol
Haha thank you! Trying to be as performance driven and smart as I can be without also being silly lol 
was wondering if I could get some help. I am making a persistence mod. I have that mostly done.
I would like to create a 3den editor preview of the players and objects stored by the persistence mod, and I would do this by creating objects in folder that have their presence turned off, but it lets a mission maker see where everything is.
Edit: I am creating objects in 3den. I figured some things, but not others.
Things I got down: spawning objects, setting position, setting SOME attributes
Things I still need help figuring out:
How do I set the Ace Medical and Engineer Traits? This would be an attribute, right?
How do I set the inventory of an object (non-units)? // this would be an attribute, right?
Generally speaking, how would I got about finding the attribute names for custom attributes?
medical traits are a combination of default and ace custom traits:
// Medic Levels: 0 - None, 1 - Medic, 2 - Doctor
_unit getVariable ["ace_medical_medicClass", parseNumber (_unit getUnitTrait "medic")]
same can be applied for engineer
private _class = _unit getVariable ["ACE_IsEngineer", _unit getUnitTrait "engineer"];
if (_class isEqualType false) then {_class = parseNumber _class};
How do I set the inventory of an object (non-units)?
what kind of object
Nevermind. Thanks for the help
I believe with Zeus enhancements or one of the mods that make zeusing easier, you can create a custom module with a script and then make it so you just drop the module onto a group and the script can use _this to apply it to that grp only
are there any items in default arma3 that i could add to units for players to find and collect?
like just a peice of paper or something. anything else is a bonus. i just want to know if there are any useless items for scripting things
Search for "Inventory Items" in Eden
There's a decent bit of misc stuff like keys and files
Just note that those are objects that contain those items, not the item (i.e. CfgWeapons class) itself.
For example, there's Item_SecretDocuments, but the actual item class is DocumentsSecret
can i edit the contitions of an addaction after it has been set on a unit?
No
modules enhanced has a gun light module in it that does everything for you
if i mad a mod that used the same function names as a mission, would i be able to overwrite the funtion from the mission, or would it just cause issues?
for example i have a funtion in the mission called fn_onvehiclespawn that gets called like this: [_vehicle] call a3e_fnc_onVehicleSpawn;
so i want to know that if i have a mod that does some different things than what the original function does, will it replace it, run tandem with it, or just cause errors on the server?
brain says if you load it after the original by using the original as a requiredAddon in your mod, it will overwrite. heart says that miller will come out of the monitor and strangle you for doing such a thing
Mod function cannot be overwritten and has priority
oh i was thinking he was gonna cfgFunction the same exact thing in his mod config.cpp, not inline function in the mission
Mod functions are originally compiled on preStart, way before a mission is loaded
I assume giving a function the same name in a mission would just do nothing
Practically, yes. Technically, no.
If the function use function recompiling, then this wont work. function recompiling must be off.
If you write mod function that happens to have the same name as a mission function, the mission function will attempt to overwrite the modded function but fail. Thus practically, you have overwritten the mission function.
how does adding a default value for a param to a funtion work?
What it does mean by adding a default value for a param to a function
if the param has no passed value I want to have it use a default
Do you mean param params commands
yes, should have been more precise there
https://community.bistudio.com/wiki/param
Pretty much BIKI explains, like Example 4
i see, thanks
How does arma load mods?
Does it search all folder in ! Workshop and load the PBOs that match the prefix for loaded mods?
I had a wierd incident Yesterday where arma loaded ace pbos twice, one from the ace folder and one from an NTF Event folder that probably was made with JustSync.
Just trying to understand how arma decided which pbos to load
You tell it explicitly which mod to load by giving the game a path
Unless you give it the the mod name only, in which case the game assumes its a folder in the game installation directory
Is there uiNamespace on a dedicated server?
how can i be sure function recomiling is off? is that the default state?
on a different topic, can i draw a rectangle on the hud with missioneventhandlerdraw2d
if so, how?
i want to draw health bars of my groups units so i can keep tabs on their health.
draw2d is for map drawing iirc. For a healthbar in interface you would have to make custom GUI
That links to the wiki record for it.
Check for that in description.ext
Is there an event handler for exiting the arsenal? Vanilla or CBA
ah I forgot scripted handlers!
unit I'm in uses a thing that saved your loadout when ya die. I'm wondering if I could instead save it when ya exit the arsenal.
you sure could, i've seen it done already
(as well as filling the arsenal depending on player slot or whatever and validating the loadout when closing the arsenal) 🙂
heyo, having an issue with this following code:
_transportGroup = [_fromPosition, _attackSide, (configfile >> "CfgGroups" >> "Indep" >> "IND_F" >> "Infantry" >> "HAF_InfSquad")] call BIS_fnc_spawnGroup;
its just not spawning a group and im getting no errors or debug messages. _fromPosition and _attackSide are Both defined and work.
i couldn't reproduce this, are you able to print _transportGroup? it should show <NULL-group> if it failed
apologies, i was away from my computer, but yes, ill try that now
i tried hint str(_transportGroup); and i got nothing. no hint, no error message.
i also just tried diag_log to see if that worked. and its not even outputting anything to rpt either
uh- GIAR pre stack size violation
Does that mean I'm trying to add to the even handler too early? x3
dont think so
google shows nothing useful it seems
private _vanillaID = [missionNamespace, "arsenalClosed", { with the # being just infront of the [
Alright.
Copied the save loadout from what my unit is already using, but with ned variable name
if(!isNil "RCHT_Saved_Arsenal_Events")then{
if((RCHT_Saved_Arsenal_Events select 0)!=-10)then{
[missionNamespace,"arsenalClosed",RCHT_Saved_Arsenal_Events select 0] call BIS_fnc_removeScriptedEventHandler;
};
if((!isNil "CBA_fnc_removeEventHandler") && (RCHT_Saved_Arsenal_Events select 1)!=-10)then{
["ace_arsenal_displayClosed",RCHT_Saved_Arsenal_Events select 1] call CBA_fnc_removeEventHandler
};
RCHT_Saved_Arsenal_Events = [-10,-10];
};
RCHT_Saved_Arsenal_Events = [];
private _aceID = -10;
hint (toString {missionNamespace});
private _vanillaID = [missionNamespace, "arsenalClosed", {
hint "Saving BI loadout for respawn..."
player setVariable["RCHT_Loaded_Loadout",getUnitLoadout player];
}] call BIS_fnc_addScriptedEventHandler;
if(!isNil "CBA_fnc_addEventHandler")then{
_aceID = ["ace_arsenal_displayClosed", {
hint "Saving ACE loadout for respawn..."
player setVariable["RCHT_Loaded_Loadout",getUnitLoadout player];
}] call CBA_fnc_addEventHandler;
};
RCHT_Saved_Arsenal_Events = [_vanillaID,_aceID];```
oh, the saved event ids is just for debug x3
while debugging I like to make sure the event IDs are cleared then resaved
Missing ; after the hint
Both hints, actually
huh
Oh maybe it's like- an error in the init.sqf, then b/c of that GIAR is failing
ah right I'm now naked- I guess that's sorta good then? xD
probably
huzza
Although, will need to implement checks to make sure ya aren't in zeus or something
!isNull findDisplay 312 will be true if you're in zeus
Display 312 being the Zeus interface, obviously
hmm, i suspect your mission is never running those lines at all, so the issue might be further up in whatever is supposed to trigger your group
Would it be display 312 if your in the arsenal tho?
idk how quickly it calls the events
I assume the Zeus display stays open, you'd have to check
Also, I feel like having it in another location then just init.sqf might be good, but not sure where to put it-
Init.sqf has weird timing and also runs scheduled (most event scripts do)
If you're just doing stuff for the client, you can use initPlayerLocal
It's all updated on the client and then it's synced to all machines
b/c respawn sqf is local right? and it's working x3
Yeah onPlayerRespawn runs local to the person respawning
err- how do I convert from bool to string
toString {boolVal}?
oh wait, I can jsut do an if statement >.>
I received true
wait what if the Zeus changed their own loadout- Also, even if they do edit a loadout, it's only gonna be resaving whatever they have on them, when they leave the arsenal
If I work on this again, I'll make an option visible to CBA maybe? Rn, just a line of code to change from false to true, and it should only do saving if ya outside zeus.
hello Arma3 friends, if i spawn 7 enemy in from a script, based on a 200 by 200 marker, How do i get Each Of the Enemy to spawn at random locations inside the marker
i'm looking on net but i cant seem to find anything that helps me the way you guys can
You can get a random position with this function
https://community.bistudio.com/wiki/BIS_fnc_randomPos
español??
TLDR: is there a way to detect if an object was spawned by the SQM, rather then a script at some point during the mission
Long version: in my mission players can build their own FOB which is persistent across saves. My save script looks around the FOB and saves various items they can build. My problem is, items placed by the SQM which can also be built are saving, thus duplicating and having multiple copies of the object in almost the same spot. Therefore, I am trying to find a way to filter out objects on the SQM from my save script
Move FOB objects to a layer, then during saving check if objects are placed in editor using https://community.bistudio.com/wiki/getMissionLayerEntities.
hey! i have the following code in initPlayerLocal.sqf but i seem to be getting an error when launching my mission (see attached picture)
params ["_player", "_didJIP"];
_player addMissionEventHandler ["Map", {
params ["_mapIsOpened","_mapIsForced"];
if (_mapIsOpened) then {
hintSilent "You have opened the map.";
sleep 5;
} else {
hintSilent "";
};
}];
(im going to be away for roughly 15 minutes so please ping me or reply to my message with ping on and ill check when im back, thank you 👍)
mission event handlers aren't added to specific objects, they're added to the mission as a whole. There is no left argument (target object) for addMissionEventHandler.
Oh i see, i wasnt aware there were multiple types of event handlers. Which one should i use then?
Considering that Map is a mission event, missionEventHandler
Thats the one ive just been told i shouldnt use though??
Opening the map is not a unit-specific event. You must use addMissionEventHandler because only a mission event handler exists for it.
That's not what Nikko said
The only problem with your code is the _player to the immediate left of addMissionEventHandler. addMissionEventHandler does not accept a left-side argument, so trying to provide one causes an error.
Literally just remove that _player and it'll be fine
I doubt because of sleep command.
ohh i see. i got it, thank you
is there a somewhat straightforward way to make an AI squad respawn all at once, one the whole squad is wiped?
Just get the class names of all the units in the group, delete their corpses, and spawn the same types of units in some other place
private _group = createGroup (side _someGroup);
private _unitClasses = (units _someGroup) apply { typeOf _x };
{
_group createUnit [_x, _somePos, [], 0];
} forEach _unitClasses;
createUnit?
Ah yeah meant unit
There is also https://community.bistudio.com/wiki/BIS_fnc_spawnGroup function.
And like most BI functions, it does a lot more than what is necessary
Most BI functions are either so small you could write it yourself, or overlay complicated for what they do
It's a 225 line long function. You don't need the vast majority of what the function does
Well, most of them were created because someone at BI needed them for something.
Personally I would say almost all that function's parameters are useful, obviously not for every case but useful enough to be worth having. The only one that's a bit dubious is rank management, because ranks almost never matter at all :U
"so small you could write it yourself" is a weird criticism IMO, like yeah, you could......but now you don't have to. That seems like a positive.
I wasn't saying they're never useful, just that most times you don't need everything a BI function does depending on what you're doing
I wasn't saying you should write it yourself, I was just saying that BI functions are usually one of those two cases.
It wasn't a criticism
It was more of a statement that you should look at what a function does before using it. Whether that be a BI function or some other mod
can I disable showing non-controlled friendly groups in High Command mode? I have a mission where player can use it but it kinda spoils the premise showing groups that shouldn't be shown in anyway until player is close to them
you could try using this: ```sqf
player setvariable ["MARTA_hide",_hiddenGroups];
wdym mixed?
Does anyone know any cool scripts to do that makes my missions more fun
What if layers weren't being used in the mission, as people make their own SQM's for different maps. The FOB is built in-game, not in the editor also
Alternatively, you can somehow save already placed FOB objects, for example, at mission start.
Usually they are boring and repetetive
Show not tell, tell your story with things that occur, be that just a big explosion, or just a cool thing to look at. Being creative is on you, scripting can help, but isn’t required. Just try to change the flow, give the players a challenge they don’t typically face, or give their actions more meaning.
How do I make my characters talk
And is it possible to create a scripted death
Thank you i never thought of making it a story
Talking characters is quite advanced
What else can I do to make a story mission
Honestly I’d suggest starting simple, just tell a story with actions, try not to railroad the players let them make decisions and change/alter the story, but the story idea is simple.
Just respond to my questions for now I want to show you something
So what will the players do in your mission?
1st mission they will take their weapons and touch a flag to start which i have already scripted then they go on patrol and Come across an ambush a explosion goes off infront of Them killing many but they manage to repel the attack and escape to a nearby Village before reinforcements Come
I will do this in the som prairie fire cdlc us against vietcong
Okay, so let’s simplify this the what is they are going on patrol correct?
Yes around the jungle
Okay why?
i anticipate that this might be a long thread. would you consider making a thread for this walkthrough with strawberry?
Made one
I can’t type in that thread, so I will DM you if that’s okay as I don’t want to clutter this channel
Thats ok
Sent it in dms
Is there a way to detect when a player "Fires" from a drone using EH? Doesn't seem to do anything from just using drone addEventHandler ["Fired", {params ["_unit"]; systemChat format ["Unit: %1", _unit];}];
Currently I'm also using
Drone removeWeapon "Laserdesignator_mounted";
Drone addWeapon "UK3CB_BAF_Safe";
Drone addWeapon "MissileLauncher";
``` To add a safe option and remove the laser designator, whilst also having something that I should be able to detect. But please let me know if I'm doing it wrong 🙂
Alternatively is it possible to rename something like a horn to work in the same manner?
Fired eh on the drone should work... make sure its assigned to the actual drone and then use a systemchat ot hint within the eh to check if its firing at all
is it possible to create eden editor asset >> compostions via a script in a mission?
like this
but in a script?
i found this:
https://community.bistudio.com/wiki/create3DENComposition
but it doesnt seem to do anything. perhaps it can only be used in the confines of the 3DEN Editor?
yes its only within the editor
is there a SIMPLE way to get the composition from a script running at the beginning of a mission, so i can place the composition dynamicly?
the reason being is i would like to be able to take the file and modify it later or completely replace it as a sort of prefab, so that i can fine tune it without having to edit a script the creates the composition manually
im TRYING to avoid having to touch this BARF
me personally, if i want to make a custom composition via script, i make my composition in the editor, choose a "anchor point" record all the object types, relative positions and direction vectors in a hash map, then build it from that hashmap. similar effect, a lot less lines than what you are doing. but I'm gonna sign off for tonight right now, so I won't be able to elaborate until later
Morning guys, is there a way to force a command to be server side?
I dont know if this is the right question but if I launch this:
["Open", [true, _vehicle]] call BIS_fnc_garage;```
The created vehicle is just visible for the person who spawned it
its probably like that by design
and i dont think there is easy way to change that, you would have to modify the garage code
Im goining to wake up by a cigarete. Can you teach me how to do it if you have the know how? I would suck the knowledge in like a sponge.
i dont really know but my guess its the garage uses createVehicleLocal so you'd have to change that
why you want it to be server side?
you mean like everyone would see the garage vehicle?
Yes thats what I want to do
Can I somehow enter or see the whole script behind it so I can copy it to create my own function with createVehicle?
in eden editor there is function viewer
Im gonna check it
Theres no entry to it...
Got it! Becuase its a function (fnc) its in function viewer -> logic
If you use Leopard20's Advanced Developer Tools, it massively improves the Config and Function Viewers, making them much easier to use
I have an eden layer with some units. Assuming I don't know the exact number of objects in it, how do I check if less than 25% is alive? Do I have to save the count (getMissionLayerEntities "GroupLayer") select 0) in a variable before a fight, and then compare it to the current count?
sounds good honger but be aware getMissionLayerEntities may contain null objects so check for Alive only
yeah that's what came to my mind right now
wait, does "may" mean you are not sure if it saves bodies or that the function may be inconsistent? 😄
because if it saves then I guess I could just not save the initial number and then compare counts of "full" select 0 to alive units in that layer
wiki comment says deleted objects appear as null in getMissionLayerEntities
ok so one last thing, how do I write "less than 25% of number" in sqf?
if I knew the number (i.e. 12 units) then I could just do { alive _x } count (getMissionLayerEntities "GroupLayer") select 0) <= 4 but what if I don't know that number
why cant you just count it?
in case I increase or lower the number of units later in development
0.25 * count _array
hmm
You should probably ceil it btw
but if they are in the layer you could just count the max in mission start script
ceil (0.25 * count _array)?
Yeah
Or round
Depends how you want the number to round (round up, down, closest)
I'll try ceil for now I guess
I guess try floor and use <= instead of <. Because if you have fewer than 4 units, you probably want it to succeed when all of them are dead
I want to end the mission successfully when there is 25% or less units alive in that layer
including all of them dead
Yeah I know. I was just explaining an edge case where you have fewer than 4 units in the layer
understood
{ !alive _x } count (getMissionLayerEntities "GroupLayer" select 0) <= floor (0.25 * (count (getMissionLayerEntities "GroupLayer" select 0))2nd part throws an error with missing ")", why?
Missing ) at the end
i think you meant alive without the !
btw you don't need the floor 😅 (tho it won't make any difference if you keep it)
i remember there being a BIS function that allowed you to grab a composition and save it as an SQF file, then be able to load it at any position using a different function. lemme see if i can find it hold on
ok yea i found it. create or add your composition to the virtual reality world, then use the function: BIS_fnc_objectsGrabber to get all objects in a certain radius around a point and add it to your clipboard. you can then create a new SQF file somewhere and paste it into that file. then, you can use BIS_fnc_objectsMapper to use that file and paste that composition wherever you need it.
r.e obfuscation, if fileExists cannot find the file's existence through obfuscation, the file doesn't exist, right? trying to validate if config.cpp vs config.bin is present in an obfuscated pbo to make sure its binarized
it does with some of our older stuff for USP that wasnt binarized but was obfuscated but im not sure if thats either a red herring or im just user erroring
I’ve never understood obfuscating arma files
outdated practice from people who want to feel better about themselves
we've stopped doing it in usp
doesnt actually solve anything
I get obfuscation for paid producers, but like this is just hobby game
But that’s fair
True it’s only use now is to reduce the people able to decompile; but as you said there is tools now that does it for them
im just trying to find out where the load time is coming from in this mod - whether its unbinarized config (fileexists is only finding config.cpp files so i would guess the engine also isnt finding config.bins) or just sheer qty
why not?
Because the fractional part won't matter
It’s preference
The code will work with or without it, if you want a true “25%” you’d avoid flooring the output
If you want ~25% floor will work fine especially if that makes more sense to you
hey leopard are you able to offer any insight into this or is it more likely a dedmen q?
floor(17 / 4) = 4
17/4 = 4.25
4 <= floor(17 / 4) // [TRUE]
4 <= (17 / 4) // [TRUE]
Wut? 4 is not lower than or equal to 4.25?!
obfuscation shouldn't affect fileExists
If it returns false it doesn't exist
There but my point was with the same input, the output will vary based on having or not having floor present
Not really a massive difference, as I previously stated, but they are not identical
Well that's obvious. we're talking about the int <= floor(positive float) being the same as int <= positive float not the other way around (at least as long as you're dealing with small floats)
Okay I flipped the statements
Still both true 😓
I see your point now, I will admit when I’m wrong
Load time when?
from launcher to game
If i wanted to get a script to count how many ammocrates are inside of a trigger, how would i go about that? can only find information on triggers and not scripting
It can be because of no bin yes
ya just wanted to check its actually not binarized
private _crateRadius = 2;
private _area = triggerArea myTrigger;
private _radius = (_area#0 max _area#1) + _crateRadius;
private _crates = nearestObjects [getPosWorld myTrigger, ["WeaponHolder"], _radius, true] inAreaArray myTrigger;
private _cntCrates = count _crates;
Thanks Leopard, that was rapid
I'm not 100% sure if "weaponHolder" will work for your crates tho
well i had half of the script working already with
nearestObjects [UR_LG1, ["B_Slingload_01_Ammo_F"] - you gave me exactly what i needed
just didnt know how to do the count
btw I made some changes to the triggerArea part
apparently it doesn't include the trigger position, so I had to add it manually
ah okay fantastic mate
inAreaArray accepts triggers as the area argument so you should be able to just give it the trigger directly and skip all that
true. fixed
it works fantastic atm but i just seen you updated it again - should i change aswell?
it won't make any difference but if you want yeah
amazing mate, really appreicate the help again guys
how do i forbid player from ordering his teammates to mount a specific vehicle? I used both lock and setVehicleLock and neither player nor AI on their own cannot get in, but player still can issue an order to get in one.
well to be specific, if vehicle is locked AI will go to it and say Negative, I'd like to get rid of the "get in" command option when player tries to order AI hovering on this specific vehicle
Can someone give me a script on how succeed mission
i need it for my missions and i dont know how to make it
also a fail mission would also be nice
if you know how
Does it end mission with a success or?
config.bin is always named config.bin, also inside obfuscated pbo's
which load time? game start?
yes
throwing a profiler would be easiest.
Sadly ASP loads too late I think
But I can run one from game start tomorrow, DM me the mods to check
does anyone have a nice plupin for Notepad++ for C++ i lost mine
Do i have to name the script in the folder initserver?
Depends on what you pass to the function
https://community.bistudio.com/wiki/BIS_fnc_endMission
That depends on what your script does
Some scripts have to be run on the server, others have to be run on the client
What does that mean
Some commands need to be run on a certain machine. For example, hint will display a message to the machine that it runs on, but won't do anything if run on a server because there is no screen to even display a hint
Ahh okay
So server is on the server in a unit?
😄
