#arma3_scripting

1 messages · Page 169 of 1

crisp sonnet
#

Fixed itself somehow, not sure how. New issue though, the waitUntil just straightup does nothing. The guy turns to look at me before he's finished moving and then continues to move

stark fjord
#

then the issue might have been you not saving the file.

crisp sonnet
stark fjord
#

about wait until, perhaps the command in there doesnt do what you expect it to do under certain conditions

crisp sonnet
#

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

stark fjord
#

Unless someone arrests "martinez" 😄

crisp sonnet
#

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

stark fjord
#

test away

foggy stratus
#

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.

dusty steppe
#

Glad it helped,
You might be able to do stuff with maps with a larger gridWidth, but the holes are kinda sloped

regal kraken
#

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

primal trench
#

Is there a guide for creating projectiles?
I'm lost in the sauce

fair drum
#

and I shall guide you

primal trench
#

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.

primal trench
warm hedge
#

So do you mean you want to make a Mod to add a new type of round

warm hedge
primal trench
#

Crap

stiff valley
#

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!
tulip ridge
naive wigeon
#

Is there any way to share video feed from Arma 3, a in game camera or any stuff, to a external conection like RTSP?

hallow mortar
stuck palm
#

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.
tulip ridge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
odd kite
#

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

analog mulch
#

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.

crisp sonnet
#

Currently getting an error for expected Array,Object on the getDir player

#

I replaced setDir with lookAt

hallow mortar
#

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.

analog mulch
#

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];
proven charm
#

never tried that command my self

regal kraken
# warm hedge Post your script

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

crisp sonnet
regal kraken
#

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";
            };
        };```
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
regal kraken
#

is it literally just !code

winter rose
#

no, the message's content 😂
```sqf and all

regal kraken
#

OH

#

now my shit code looks like code

#

unfortunate

winter rose
#

noice! now just add "sqf" after the first ``` and you're all set 😎

regal kraken
#

i will get this got it!

jade acorn
#

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

regal kraken
#

uh oh

winter rose
#

units resistance in thislist is a bool yes

jade acorn
#

hmm

winter rose
#

thislist select { side _x == resistance } is an array

winter rose
regal kraken
#

you know, i wish i did - but i didnt

winter rose
#

wait, it is 😄

#

it is even highlighted, my bad meowfacepalm 😄

regal kraken
#

I was genuinely checking google there incase it was a fake site lmao

winter rose
#

maybe _CargoVehicle is nil?
_sortedVehicles select 0 _sortedVehicles may be empty, you don't know

regal kraken
#

i'll need to try again later, i've been at it for too long

winter rose
#

don't code while tired!

regal kraken
#

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

winter rose
#

we'll make it kiss it 😎

#

take a rest and come back, we'll be waiting!

jade acorn
#

right now it says error type number, expected bool.

#

ok I think I got it too.

stark fjord
#

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

jade acorn
#

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

winter rose
#

@jade acorn all good then?

jade acorn
#

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

hallow mortar
#

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.

jade acorn
#

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"?

faint burrow
#

!this

hallow mortar
#

I'm pretty sure it uses knowsAbout. I dunno what the threshold value is though, maybe 1 but not sure

faint burrow
jade acorn
#

is there any performance difference between yours and thisList select?

hallow mortar
#

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

faint burrow
faint burrow
hallow mortar
#

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.

faint burrow
#

Yes, but use of hacks is not obvious.

stark fjord
#

When unit dies, knows about is reset to 0 i believe

hallow mortar
stark fjord
#

I was just getting max value of all enemy units knows about. Then in condition compared max value to 2.5

hallow mortar
#

actually I don't care, forget it

faint burrow
# hallow mortar .......hacks?

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
crisp sonnet
faint burrow
#

It works. Only syntax highlighting doesn't work.

crisp sonnet
#

I mean, I'm literally viewing on a Samsung S21FE and I see nothing other than the standard code block

stark fjord
#

yes but if you view same message on PC it highlights syntax, it just doesnt highlight on phone

winter rose
crisp sonnet
crisp sonnet
faint burrow
#

As I wrote, only syntax highlighting doesn't work.

crisp sonnet
#

Yeah that's what I said

#

Lou was referring specifically to the syntax highlighting

winter rose
#

YOU BOTH AGREE DAMMIT, now fight or this is not internet anymore 😄

stark fjord
#

Round 1... fight!

winter rose
#

(j/k, I love you don't fight you're all very nice people)

stark fjord
#

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

regal kraken
#
_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

hallow mortar
#
[[_vehiclesList]],[_ObjectToLoad],{_ObjectToLoad distance _vehicleslist},"ASCEND"]```
Count your `[` and find their matching `]`.
regal kraken
#

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

faint burrow
#

That means _SortedVehicles is empty.

regal kraken
#

in the editor i have a vehicle right next to it, surely that would be listed onto the
_sortedvehicles

faint burrow
#

Not sure.

hallow mortar
#
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

regal kraken
#

its those supply boxes that look like their airdropped - i'll up the distance to about 50 and see if that works?

hallow mortar
#

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.

regal kraken
#

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

hallow mortar
#

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.

regal kraken
#

["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

hallow mortar
regal kraken
#

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"};```
hallow mortar
#

okay so it's not that the original list is empty, it's that your sort algorithm is wrong

regal kraken
#

sorry i'm still trying to get used to this stuff, not a coder as you can clearly see

hallow mortar
#

well, the sort algorithm was wrong in the previous script, now you've corrected it, but you're passing _vehiclesList to the sort wrong

faint burrow
hallow mortar
#
[_vehiclesList] // array containing _vehiclesList (array within an array)
_vehiclesList // just _vehiclesList (array)```
faint burrow
#

Bingo!

regal kraken
#

god damnit

#
_SortedVehicles = [_vehiclesList,[_ObjectToLoad],{_ObjectToLoad distance _x},"ASCEND"] call BIS_fnc_sortBy;```
hallow mortar
#

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;```
regal kraken
#

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

astral bone
#

Was there a link somewhere, to adding SQF to notepad++?

faint burrow
#

Yes, use a search engine to find.

astral bone
#

.>

#

Do people use sqf arrays for data often? I know what I do, but I'm not everyone.

faint burrow
#

It depends.

astral bone
#

I am wondering b/c I just realized the syntax doesn't like arrays across multiple lines.

faint burrow
#

It likes.

hallow mortar
#

Newlines are treated basically the same as a single space, you can put them pretty much anywhere except in the middle of a word

astral bone
#

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
hallow mortar
#

That should work fine other than that weapons can't be used because it's the name of a command

astral bone
#

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

hallow mortar
#

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

astral bone
#

oh no, I know

#

Although- idk where else I'd talk about this x3

faint burrow
#

That's the issue of either N++, or the plugin, or both. But not SQF.

astral bone
#

Was just curious if someone had a solution is all. More updated syntax or something.

faint burrow
#

Migrate to another editor.

proven charm
#

ive never seen that problem with npp. maybe its setup wrong

regal kraken
#

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;```
winter rose
#

IF the list is not empty 👀

heavy lynx
#

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

regal kraken
#

right so.. its clearly not the sortby that i've gubbed.. its how its finding vehicles for the list

astral bone
#

wha- ok so I found a DIFFERENT sqf syntax when I googled to what I already have-
confusion-

still forum
#

VSCode better

regal kraken
#

Right fuck it, does anybody have a load cargo script

winter rose
#
vehicle player setVehicleCargo _jeep;
```here you go
heavy lynx
faint burrow
#

It works for me.
Provide your code.

heavy lynx
#

So I can't figure out how to use it

faint burrow
#

Read description, examples...

regal kraken
#

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 😅

astral bone
regal kraken
#

yeah exactly man

#

i appreicate everybodies time

pallid palm
#

lol

#

youe guys make me smile lol

heavy lynx
faint burrow
#

Don't remember.

tulip ridge
faint burrow
#

typeOf doesn't have alt syntax. Maybe isKindOf?

tulip ridge
#

Oh I read that as isKindOf

#

In that case, typeOf works on rockets, or any projectile, just fine

tough abyss
#

@granite sky Lets continue here

#

What am i supposed to do with the code in this website

granite sky
#

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.

tough abyss
granite sky
#

That is the idea, yes.

tough abyss
#

Do i need to restart my game to test the code out?

heavy lynx
granite sky
#

No. IIRC you just need to restart the mission.

tough abyss
granite sky
#

No.

tough abyss
#

ok

tough abyss
tough abyss
granite sky
#

sqm :/

tough abyss
granite sky
#

In the mission's folder.

tough abyss
#

Nothing in there

granite sky
#

Depends which profile you're using and whether it's SP or MP.

tough abyss
#

except a read me text

granite sky
#

Then that's not the mission's folder.

tough abyss
#

Its called missions

#

This is in the read me

granite sky
#

You didn't export.

tough abyss
granite sky
#

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.

tough abyss
#

Ok

granite sky
#

If it's the default profile and an SP mission then it'll be in Documents\Arma 3\missions

tough abyss
#

Oh

#

Found it

tough abyss
granite sky
#

The only documentation on initServer.sqf I could find on the BI website.

tough abyss
#

What do i do for triggers?

#

How do i code that in

tough abyss
#

Im getting this error now @granite sky

#

Better picture

tulip ridge
#

T1 isn't defined, i.e. no unit has that variable name

tough abyss
tulip ridge
#

Can you show it?

tough abyss
#

How do i code a trigger in the initserver

tulip ridge
#

You don't, a trigger is an object

tough abyss
#

Okay

tulip ridge
#

What are you trying to do?

tough abyss
#

I got the initserver working

#

I just gotta delete all of the code i did on the unit now

tulip ridge
#

Script wise, what are you trying to do?

Disable AI until units enter a trigger?

tough abyss
tulip ridge
#

That's default behavior, and your error says you're using disableAI

tulip ridge
#

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

tough abyss
#

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

tulip ridge
#

Then those variables aren't defined when that code runs

tough abyss
tulip ridge
#

It means they're undefined, so nothing has those names

tough abyss
#

assault squad

#

is that why?

tulip ridge
#

No, the type of units wouldn't change anything

tough abyss
tough abyss
faint burrow
#

Post the entire screenshot.

tough abyss
faint burrow
#

Good.
Now you can fix the error.

tough abyss
#

I cant though

tulip ridge
#

You assigned S1 to a group

faint burrow
#

Yes, not to a unit.

tulip ridge
#

DisableAI only works on a unit

tough abyss
#

im not adding a variable inviduallyuuu

tulip ridge
#

You could do:

{
    _x disableAI "MOVE";
} forEach (units group S1);
tough abyss
#

Also the _x?

tulip ridge
#

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];
tough abyss
#

Do i just copy and paste it

#

Oh this is too complicated

tulip ridge
#

Yeah, and just replace your current lines with that

#

Scripting can be hard, especially at the beginning

tough abyss
tough abyss
tulip ridge
#

Oh I forgot the units part

#

It should be forEach units _group

tough abyss
#

So how should i learn to script

#

So now it should look like this

tulip ridge
#

Should be the one inside the first loop

I edited my code I sent

tough abyss
#

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

tulip ridge
#

No problem 👍

analog mulch
#

i tried the following but the AI keeps joining as #6 of a 5 unit squad

hvt1 joinAs [(group player), 4]; 
faint burrow
analog mulch
#

yeah AI unit not joining as #4 but the default last of the group

faint burrow
#

That was expected without video.

analog mulch
#

i inputted the number i wanted him to be assigned in after joining, but joined as last

faint burrow
#

Let's think, if the number is occupied, then the others need to be moved, is that logical?

analog mulch
#

yeah

faint burrow
#

Do this.

analog mulch
#

so i have to remove the current #2, have hvt1 join as #2, then make #2 rejoin again?

faint burrow
#

Sounds like a plan.

analog mulch
#

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);
faint burrow
#

Remove suspending. Or change environment.

analog mulch
#

what are those?

faint burrow
analog mulch
#

i got it to work with no errors by putting it in an sqf and calling it

#

which i guess is the sceduler

faint burrow
analog mulch
#

but i've seen trigger activations work on sleep code

#

thinking back it was one instance not multiple

faint burrow
#

Only if you change environment.

#

spawn, for example, your code.

lyric plover
#

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?

buoyant cairn
#

One shot Kill (local player only)

vapid scarab
# lyric plover Hello, is it possible to script an intel document composition for public Zeus se...

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
vapid scarab
#

Ive written a whole mod that does this and more 😁

analog mulch
#

which one?

digital radish
#

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

warm hedge
#

No, engine feature, and they are the part of the model

digital radish
# warm hedge 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?

tulip ridge
#

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

gentle zenith
#

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

digital radish
#

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;
  };
tulip ridge
#

That's just for the faster swimming as far as I know

#

Is that all you were looking for?

digital radish
odd kite
#

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

GitHub

ArmA Scripts - Majority ArmA 3. Contribute to soulkobk/ArmA3_Scripts development by creating an account on GitHub.

naive wigeon
warm hedge
#

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

naive wigeon
#

oh, drawing as characters

#

i didn't think about this

warm hedge
#

Drawing as procedural texture (ui2tex)

naive wigeon
#

but you got me thinking about rendering as ASCII

#

using a extension with some rust library to give me the drawing and parsing it

warm hedge
#

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)

vapid scarab
vapid scarab
vapid scarab
warm hedge
vapid scarab
#

Found it, thanks

thick hatch
#

is their a param/command for setting a satchel charge timer?

celest sedge
#

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

meager granite
#

Where did you get this line? It makes no sense.

celest sedge
meager granite
#

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

celest sedge
celest sedge
#

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;

celest sedge
meager granite
#

This is edtor init field, right?

celest sedge
meager granite
#

of the unit you placed in the editor?

celest sedge
#

Yes

meager granite
celest sedge
#

😭

#

I'm even trying it in zeus too and they just stand there

meager granite
#

iirc its different in Zeus with _this instead of this

celest sedge
#

I shall try that

celest sedge
meager granite
#

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

celest sedge
meager granite
#

Show it in the editor

celest sedge
#

Oki

celest sedge
meager granite
#

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

celest sedge
#

Lemme try pasting it in the group tab since nothing happens in the unit tab

celest sedge
meager granite
#

You need individual unit init field only

#

Also maybe 3DEN enchaned uses _this instead of this?

#

No idea, I don't use it

celest sedge
#

I'll give that a try

celest sedge
#

It doesn't work

#

I wish polpox's Enhanced Artwork Supporter had this animation 😭

meager granite
celest sedge
errant iron
celest sedge
errant iron
# celest sedge

as for this error, did you accidentally select the group and paste it in Group: Init?

warm hedge
warm hedge
#

Also, both Animations Viewer should show EVERY animations ingame

celest sedge
#

Alright I got it working, thank you all for your help and thank you polpox for your mods

junior moat
#

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?

proven charm
#

probably locality issue

junior moat
#

shouldnt be i dont think. considering the line above it works completely fine.

junior moat
#

only a few

proven charm
#

when is the code run, editor, dedi?

junior moat
proven charm
#

well if onPlayerRespawn.sqf runs at server your code wont work because the commands require local argument and player is not local in server

junior moat
#

apparently i can use _this select 0 to get the player, why wouldnt i just be able to run code on that?

proven charm
#

locality

#

but i dont remember if onPlayerRespawn.sqf runs at server or client

winter rose
#

client, iirc

stable dune
pallid palm
#

the player is the Server on a Hosted Server

jade acorn
#

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?

cosmic cipher
#

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?

still forum
#

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

hallow mortar
#

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.

cosmic cipher
#

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.

jade acorn
#

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 };```
jade acorn
#

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?

jade acorn
#

I set it to true (Boolean - true to force radio)

#

tried other options, too

winter rose
#

well yeah, should do

jade acorn
#

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.

winter rose
#

setName perhaps?

#

so the UI name is displayed instead of group member number

jade acorn
#

yeah works only on direct chat

winter rose
#

which syntax used?

jade acorn
#

setName's? _this setName ["Ben Kerry","Ben","Kerry"];

winter rose
#

ah well, I'm out of options then
if the campaign itself is like this then I would say that's about it?

jade acorn
#

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.

hallow mortar
jade acorn
#

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?
hallow mortar
#

Wrong input values

jade acorn
#

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

hallow mortar
#

1 isn't a string

jade acorn
#

what would be a string for custom radio channel?

#

label, which is a string, does not work, channel ID is the number

hallow mortar
#

It's not clear. Maybe try passing the ID as a string.

jade acorn
hallow mortar
#

Well, try opening BIS_fnc_kbTell in the Functions Viewer and seeing what it actually does.

jade acorn
#

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};```
hallow mortar
#

Well I've looked at the code and I believe the answer is that it's just f'ed

jade acorn
#

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
faint burrow
jade acorn
#

tell that to Karel Moricky, not me lol

faint burrow
#

Oh, I thought that's your code. LOL.

hallow mortar
#

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.

jade acorn
#

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.

lyric plover
jade acorn
broken pivot
#

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?

hallow mortar
#

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)

broken pivot
#

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

flint topaz
#

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

hallow mortar
broken pivot
# flint topaz Just save an ace loadout copy it to your clipboard and use the addDefaultLoadout...

@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

dusty steppe
#

What are currently the best sqf plugins for notepad++?

flint topaz
broken pivot
#

So _loadout will be the shown name?

flint topaz
#

No rifleman will be the name

#

_loadout is the kit

vapid scarab
#

😉

broken pivot
#

Omgh

vapid scarab
#

These are the ones i use in VSCode if you ever would like to swap

flint topaz
#

I’m just crazy and don’t use a language aid, don’t be me

fair drum
#

use the hemtt language server and utils plugin

#

brett keeps it much more updated than the others

broken pivot
#

Ive insert in Notepad. Its now way more logical. But still dont work: @flint topaz

[“Schuetze”,_loadout_schuetze] ace_arsenal_fnc_addDefaultLoadout;```
flint topaz
#

You changed the structure of the kit

#

Just copy and paste when you copy the kit don’t mess with it

broken pivot
#

The kit is the thing I get from getUnitLoadout VAR right?

flint topaz
#

You can do it that way, but I prefer doing the ace Arsenal way

broken pivot
#

This is the result of your benchmark:

flint topaz
#

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

broken pivot
#

Ill change language of corse for you. Im sorry

flint topaz
#

I’m on a phone right now so can’t really debug myself

south swan
#

looks like "undefined variable in expression" or something blobdoggoshruggoogly What's "Rifleman" in that expression?

broken pivot
south swan
#

missing "call" between arguments and ACE funcion?

broken pivot
#

Ill try

#

**# YES! **

jade acorn
#

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.

warm hedge
#
missionNamespace getVariable format ["pos_%1",1];``` can be a workaround
#

TBH I want a command that convert string to a identifier

dusty steppe
#

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

tulip ridge
dusty steppe
#

That is probably what I want, and would handle all ways that the muzzle attachement could change

warm hedge
#

There was... SlotItemChanged or something that might work

tulip ridge
#

Oh right 2.18 added the _weapon param too

dusty steppe
hallow mortar
remote cobalt
#

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?

warm hedge
#

It does. I'd say you are missing something

remote cobalt
warm hedge
#

I've tested on AR-2

remote cobalt
manic kettle
#

Is there a limit on how large a hashmap can be?

odd kite
#

is there a way to stop PBO manager creating so many .bak files?

tulip ridge
#

And for mission addons, just export it from Eden

#

This also isn't scripting related

odd kite
#

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

tulip ridge
#

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

odd kite
odd kite
tulip ridge
#

Your question just didn't have anything to do with scripting

odd kite
#

its probably the most relevant channel for it considering its the next step after scripting

late flume
tulip ridge
#

Their question was about a tool that isn't related to scripting

#

PBO Manager just packs files into a *.pbo file

meager granite
meager granite
#

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

winter rose
winter rose
vital quest
#

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 😅

stable dune
vital quest
stable dune
#

Yes

tough abyss
#

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

stable dune
tough abyss
#

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

stable dune
tough abyss
tough abyss
#

It worked with west germany but not east germany

hallow mortar
# vital quest Hey all, I've started an Antistasi server for a few friends, when in Zeus I can'...

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.
vital quest
regal kraken
#

I'm sure the answer is yes, but is there a way to apply an init to vehicle wrecks?

pallid palm
#

you mean so you can delete it or what ?

#

why do you want an init on a vehicle wreck ?

regal kraken
#

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

pallid palm
#

ahh nice hmmmm

hallow mortar
regal kraken
#

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

pallid palm
#

its not silly

regal kraken
#

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}

hallow mortar
#

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

regal kraken
#

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

hallow mortar
regal kraken
#

right okay

hallow mortar
#

(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)

regal kraken
#

Oh so i'm actually looking for a new entity instead

pallid palm
#

thats good to know

regal kraken
#

so instead of wreck i should be checking to see if a vehicle has health less than 1?

pallid palm
#

thx you Nikko

hallow mortar
# regal kraken Oh so i'm actually looking for a new entity instead

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

hallow mortar
pallid palm
#

nice thx you Nikko

regal kraken
#

Thanks Nikko you must be getting fed up with me

#

Appreciate it

pallid palm
#

no no hes not fedup them guys like helping as i see it

hallow mortar
#

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

pallid palm
#

thx m8 your awsome love you @hallow mortar

regal kraken
#

I appreicate it man

pallid palm
#

its so freeking awsome we have guys in here like Nikko and Dart and others, where would we be with out them

hallow mortar
#

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.

pallid palm
#

it seems clear to me

#

you helped me alot Nikko

#

i like that word speculation i use that in court alot lol

#

he he

heavy lynx
#
  1. 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.";

  1. Console command [] execVM "extractAllAmmo.sqf";
  2. The data will be written to the RPT file C:\Users<YourUsername>\AppData\Local\Arma 3
regal kraken
#

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];
    };```
tulip ridge
south swan
regal kraken
#

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

blissful current
#

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?

crimson lion
#

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

tacit prairie
#

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";

fair drum
blissful current
tough abyss
#

I have a question, "name" is a string of text, but what does it mean if it look like this 'name'?

hallow mortar
#

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".

hallow mortar
# tough abyss I have a question, "name" is a string of text, but what does it mean if it look ...

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.

tough abyss
blissful current
#

What's the best way to search to for playMove animations? Is there a list available somewhere?

fair drum
#

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

tough abyss
#

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;
fair drum
#

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

tough abyss
#

oh okay thank you

regal kraken
#

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

south swan
#

What? Can you please show the code?

regal kraken
#
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

south swan
#

"script that gets executed" where and how?

regal kraken
#

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

south swan
#

Single or multiplayer?

regal kraken
languid fable
#

haven't played arma since 2020/2021

languid fable
heavy lynx
south swan
regal kraken
#

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

south swan
#

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

regal kraken
#

the hint thats fine, it was only really for debug anyway - but i'll do that for the multiplayer side

south swan
#

[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

regal kraken
#

oh so that can literally just be [] execVM

south swan
#

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 tanking

#

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?

regal kraken
#

well it was a civilian that was about 100k away but i changed it to a game_logic

south swan
#

places in editor with KILL_POT1 as its name in editor?

regal kraken
#

yes

south swan
#

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?

regal kraken
#

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

south swan
#

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

regal kraken
#

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

tacit prairie
# languid fable idk how you do it anymore but it might be the way it's being executed? the _x fo...

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.
regal kraken
# south swan well, at least half of those fixes is readability/general fluff, tbh

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

fair drum
#

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

regal kraken
#

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

tulip ridge
#

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)

regal kraken
#

thanks man

fair drum
#

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

old owl
#

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";
fair drum
#

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

old owl
#

Haha thank you! Trying to be as performance driven and smart as I can be without also being silly lol hmmyes

vapid scarab
#

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?

fair drum
#

How do I set the inventory of an object (non-units)?

what kind of object

vapid scarab
#

Nevermind. Thanks for the help

languid fable
grim cliff
#

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

tulip ridge
#

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

grim cliff
tulip ridge
#

No

fair drum
grim cliff
#

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?

grim cliff
fair drum
warm hedge
#

Mod function cannot be overwritten and has priority

fair drum
#

oh i was thinking he was gonna cfgFunction the same exact thing in his mod config.cpp, not inline function in the mission

tulip ridge
#

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

vapid scarab
next gust
#

how does adding a default value for a param to a funtion work?

warm hedge
#

What it does mean by adding a default value for a param to a function

next gust
#

if the param has no passed value I want to have it use a default

warm hedge
#

Do you mean param params commands

next gust
#

yes, should have been more precise there

warm hedge
next gust
#

i see, thanks

spark turret
#

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

little raptor
#

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

meager granite
#

Is there uiNamespace on a dedicated server?

grim cliff
#

on a different topic, can i draw a rectangle on the hud with missioneventhandlerdraw2d

if so, how?

grim cliff
jade acorn
#

draw2d is for map drawing iirc. For a healthbar in interface you would have to make custom GUI

astral bone
#

Is there an event handler for exiting the arsenal? Vanilla or CBA

astral bone
#

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.

south swan
#

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) 🙂

junior moat
#

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.

https://community.bistudio.com/wiki/BIS_fnc_spawnGroup

errant iron
junior moat
#

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

astral bone
#

uh- GIAR pre stack size violation
Does that mean I'm trying to add to the even handler too early? x3

proven charm
#

dont think so

astral bone
#

google shows nothing useful it seems

#

private _vanillaID = [missionNamespace, "arsenalClosed", { with the # being just infront of the [

proven charm
#

please post full code

#

where the error happens...

astral bone
#

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

hallow mortar
#

Missing ; after the hint

astral bone
#

hm

#

That'd give the GIAR?

hallow mortar
#

Both hints, actually

astral bone
#

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

proven charm
astral bone
#

huzza
Although, will need to implement checks to make sure ya aren't in zeus or something

tulip ridge
#

Display 312 being the Zeus interface, obviously

errant iron
astral bone
#

Would it be display 312 if your in the arsenal tho?

#

idk how quickly it calls the events

tulip ridge
#

I assume the Zeus display stays open, you'd have to check

astral bone
#

Also, I feel like having it in another location then just init.sqf might be good, but not sure where to put it-

tulip ridge
#

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

astral bone
#

Does setLoadout auto send it to the server?

#

I mean I guessit does

tulip ridge
#

It's all updated on the client and then it's synced to all machines

astral bone
#

b/c respawn sqf is local right? and it's working x3

tulip ridge
#

Yeah onPlayerRespawn runs local to the person respawning

astral bone
#

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.

pallid palm
#

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

pallid palm
#

ok thx m8

#

ahh yes i used this befor hmmm

#

thx

pallid palm
#

Woohoo thats 4 things i got right lol he he

#

and counting 🙂

half owl
#

español??

pallid palm
#

no Lo siento

#

i think English is only Allowed

cold pebble
#

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

faint burrow
junior moat
#

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 👍)

hallow mortar
junior moat
tulip ridge
junior moat
hallow mortar
#

Opening the map is not a unit-specific event. You must use addMissionEventHandler because only a mission event handler exists for it.

tulip ridge
#

That's not what Nikko said

hallow mortar
#

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

faint burrow
#

I doubt because of sleep command.

junior moat
#

ohh i see. i got it, thank you

split iris
#

is there a somewhat straightforward way to make an AI squad respawn all at once, one the whole squad is wiped?

tulip ridge
#

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;
faint burrow
#

createUnit?

tulip ridge
#

Ah yeah meant unit

faint burrow
tulip ridge
#

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

hallow mortar
#

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.

tulip ridge
tulip ridge
#

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

jade acorn
#

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

proven charm
jade acorn
#

wdym mixed?

proven charm
#

it doesnt always work

#

maybe i used it wrong way or something

#

updated code

frank lynx
#

Does anyone know any cool scripts to do that makes my missions more fun

cold pebble
faint burrow
#

Alternatively, you can somehow save already placed FOB objects, for example, at mission start.

frank lynx
flint topaz
# frank lynx 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.

frank lynx
#

And is it possible to create a scripted death

#

Thank you i never thought of making it a story

flint topaz
#

Talking characters is quite advanced

frank lynx
flint topaz
#

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?

frank lynx
flint topaz
flint topaz
#

Okay why?

fair drum
#

i anticipate that this might be a long thread. would you consider making a thread for this walkthrough with strawberry?

flint topaz
#

Sure

#

I can’t seem to create a thread on my phone

frank lynx
#

Let me

#

Mission

frank lynx
flint topaz
#

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

true frigate
#

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?

opal zephyr
#

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

grim cliff
#

is it possible to create eden editor asset >> compostions via a script in a mission?

grim cliff
grim cliff
grim cliff
#

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

fair drum
#

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

broken pivot
#

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
proven charm
#

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

broken pivot
#

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.

proven charm
#

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?

broken pivot
#

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?

proven charm
#

in eden editor there is function viewer

broken pivot
#

Im gonna check it

#

Theres no entry to it...

#

Got it! Becuase its a function (fnc) its in function viewer -> logic

hallow mortar
#

If you use Leopard20's Advanced Developer Tools, it massively improves the Config and Function Viewers, making them much easier to use

jade acorn
#

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?

proven charm
#

sounds good honger but be aware getMissionLayerEntities may contain null objects so check for Alive only

jade acorn
#

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

proven charm
#

wiki comment says deleted objects appear as null in getMissionLayerEntities

jade acorn
#

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

proven charm
#

why cant you just count it?

jade acorn
#

in case I increase or lower the number of units later in development

little raptor
#

0.25 * count _array

proven charm
#

hmm

little raptor
#

You should probably ceil it btw

proven charm
#

but if they are in the layer you could just count the max in mission start script

jade acorn
little raptor
#

Yeah

#

Or round

#

Depends how you want the number to round (round up, down, closest)

jade acorn
#

I'll try ceil for now I guess

little raptor
#

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

jade acorn
#

I want to end the mission successfully when there is 25% or less units alive in that layer

#

including all of them dead

little raptor
#

Yeah I know. I was just explaining an edge case where you have fewer than 4 units in the layer

jade acorn
#

understood

#

{ !alive _x } count (getMissionLayerEntities "GroupLayer" select 0) <= floor (0.25 * (count (getMissionLayerEntities "GroupLayer" select 0))2nd part throws an error with missing ")", why?

little raptor
#

Missing ) at the end

jade acorn
#

thanks

proven charm
#

i think you meant alive without the !

little raptor
#

btw you don't need the floor 😅 (tho it won't make any difference if you keep it)

junior moat
#

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.

sullen sigil
#

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

flint topaz
#

I’ve never understood obfuscating arma files

sullen sigil
#

outdated practice from people who want to feel better about themselves

#

we've stopped doing it in usp

#

doesnt actually solve anything

flint topaz
#

I get obfuscation for paid producers, but like this is just hobby game

#

But that’s fair

sullen sigil
#

obfuscation is pointless nowadays

#

easily bypassed

flint topaz
#

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

sullen sigil
#

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

little raptor
#

Because the fractional part won't matter

flint topaz
#

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

little raptor
#

No it just won't make any difference

#

It works exactly the same with or without it

sullen sigil
flint topaz
#

floor(17 / 4) = 4
17/4 = 4.25

4 <= floor(17 / 4) // [TRUE]
4 <= (17 / 4) // [TRUE]

little raptor
#

Wut? 4 is not lower than or equal to 4.25?!

little raptor
flint topaz
#

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

little raptor
#

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)

flint topaz
#

Okay I flipped the statements

little raptor
#

Still both true 😓

flint topaz
#

I see your point now, I will admit when I’m wrong

sullen sigil
#

from launcher to game

regal kraken
#

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

little raptor
#

It can be because of no bin yes

sullen sigil
#

ya just wanted to check its actually not binarized

little raptor
regal kraken
#

Thanks Leopard, that was rapid

little raptor
regal kraken
#

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

little raptor
#

apparently it doesn't include the trigger position, so I had to add it manually

regal kraken
#

ah okay fantastic mate

hallow mortar
little raptor
#

true. fixed

regal kraken
#

it works fantastic atm but i just seen you updated it again - should i change aswell?

little raptor
#

it won't make any difference but if you want yeah

regal kraken
#

amazing mate, really appreicate the help again guys

jade acorn
#

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

frank lynx
#

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

cosmic lichen
#

BIS_fnc_endMission.

#

The wiki has examples

frank lynx
still forum
sullen sigil
#

yes

still forum
#

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

pallid palm
#

does anyone have a nice plupin for Notepad++ for C++ i lost mine

frank lynx
#

Do i have to name the script in the folder initserver?

tulip ridge
tulip ridge
#

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

frank lynx
#

I just figured something out

#

i am so happy rn

#

i figured out how to add an action

frank lynx
#

So server is on the server in a unit?