#arma3_scripting

1 messages ยท Page 552 of 1

queen cargo
astral dawn
#

TBH I am more inclined with automated layout in favor of any of these existing available tools which export configs.
Even with ADC, unfortunately, as it doesn't support many things, I can't just export whole config and replace an existing one, so I have to copy coordinates manually
plus the need to manage multiple include files and other tiny things which add up and make maintaining any of the UIs a horrible experience, when lots of time is spent on nothing

queen cargo
#

well ... if arma-ui-editor would work flawless, you could do it with it

#

as it just renders a config

#

onto some screen

smoky verge
#

Condition:
Trigger_Con;

Init:
this addaction ["Triger",{Trigger_Con = true; publicVariable "Trigger_Con";}];

Any reason this doesnt work?
I'm trying to open the strategic map through AddAction but got no results

exotic flax
#

To what is the addAction set? The player, or the module?

#

please note that a lot of people have tried to use addAction to open the StrategicMap without much luck... unless you build the map up with BIS_fnc_StrategicMapOpen "within" the addAction I'm afraid there won't be an easy solution

#

depending on what you want to do with it it might be easier to take a look at the Respawn templates, which will allow you to spawn/respawn at different locations on the map

#

@queen cargo I just tested BIS_fnc_dbImportXML with your example XML, and after removing the leading tabs this is the result:

["#DIALOG",["#PANEL",["#GRID",["#COLUMN",["&LABEL","Enter ID:"],"#COLUMN%2",["#TEXTBOX",[]]]]]]
queen cargo
#

Very very very neat

exotic flax
#

currently trying to modify the script to accept leading tabs, and also include classses (like width="*")

queen cargo
#

Yeah..

#

There is plenty of room for improvement scottMmm

exotic flax
#

blame BIS ๐Ÿคฃ

young current
#

BI. BIS is the other one

exotic flax
#

it's BIS_fnc_, so I blame BIS ๐Ÿ˜›

queen cargo
#

๐Ÿ˜‚ ๐Ÿ˜‚

astral dawn
#

It stands for BI Scripted function compiled ...

#

So to be safe blame both

tough abyss
#

And BIN?

astral dawn
#

I haven't thought of it ๐Ÿค”

exotic flax
#

"The .bin file extension is most commonly associated with compressed binary files."

smoky verge
#

@exotic flax
I almost managed to make it work with fnc_strategicMapOpen but I couldnt place "missions"

muted cove
#

I'm trying to create a SP mission where the player spawns in downed and needs to be revived by and AI, how could I do this?

exotic flax
#
this setDammage 0.7;
this setUnconscious true;

No idea if/how AI reacts to it though

#

and I think it's a bad idea to have the success of a mission depend on Arma AI, because their behaviour isn't predictable at all

muted cove
#

How do I add chat interactions with AI?

exotic flax
#

well, you could use addAction on the AI unit which triggers a scripted dialog

muted cove
#

What do you mean addAction?

exotic flax
muted cove
#

thank you

silent latch
#

so I want to add a action to every building on the island how would i go about to do this

exotic flax
#

although I'm sure you would prefer it on doors, and not the building itself ๐Ÿ˜‰

tough abyss
#

is it normal for teamswitch to complete your current waypoint?

#

because it's completing it for me

grave stratus
#

Hey guys, i am trying to write a script that would kill all enemy unit and vehicle. So i tried a code it ended up killing every enemy but the vehicle is left empty. So i decide to use trigger instead to delete the vehicle but it seems that the vehicle doesnt get deleted. Not sure where i went wrong, it doesn't show any error either when i execute the script

stoptrig = createTrigger ["EmptyDetector", [14267,12509], true];
stoptrig setTriggerArea [1500, 1500, 0, false];
stoptrig setTriggerActivation ["EAST", "PRESENT", true];
stoptrig setTriggerStatements ["thisList", "{deleteVehicle _x} forEach thisList;",""];
[East, -5000] call BIS_fnc_respawnTickets;
{if ((side _x == east) && (_x != player)) then 
    {
        _x setDamage 1;
    };
} forEach allUnits;
deleteVehicle stoptrig;
tough abyss
#

the trigger is only checking for units as i see it

grave stratus
#

it doesnt check vehicles too? oh my

tough abyss
#

let me check but if i'm correct is either that or the vehicle doesn't have a side defined (and that's if you can assign a side to the vehicle to begin with i never tried that)

#

yep that doesn't count the empty vehicles

grave stratus
#

because i found this solution by googling and the person who asked the question actually thanked him

tough abyss
#

the car is actually CIV when in run a test on it

grave stratus
#

thats why i wanted it to delete the vehicle before killing all the units

tough abyss
#

weird

grave stratus
#

maybe i can try CIV instead of EAST

tough abyss
#

if the car was occupied by a csat it turns into east

#

maybe you should try deleting the vehicle first?

grave stratus
#

isnt that what i wrote already? the code is to delete the vehicle fist then units

#

maybe the trigger doesnt check for vehicles as you suspected

tough abyss
#

yep the car turns into CIV when i kill the opfor occupant

#

so pretty much if the vehicle was empty to begin with it should be CIV

grave stratus
#

i tried it using CIV instead of East, even when empty, it doesnt delete the vehicle

tough abyss
#

but if it was or is occupied by opfor it is EAST

grave stratus
#

so i think its the trigger not checking for vehicle

tough abyss
#

or the vehicle is not inside the trigger

#

use hint str(thislist)

#

to know if the vehicle is in the list or not

grave stratus
#

ill try it, tho as 1500x1500 i doubt that the vehicle is not inside the trigger, the vehicle spawn around 300/400m from the trigger location

tough abyss
#

lol

#

i'm a dumbass

grave stratus
#

nope its not showing any hint..

tough abyss
#

stoptrig setTriggerStatements ["this", "{deleteVehicle _x} forEach thisList;",""];

#

you put thislist in the statements instead of this

grave stratus
#

i actually used this before thisList and nothing happened. that why i try using thisList

tough abyss
#

thisList is a list, not a bool

grave stratus
#

haha that is what happens when i got stuck. i play aroud

tough abyss
#

when you use "this" in a trigger it takes the statement to determine that bool result

grave stratus
#

changed it back to this but still the vehicle doesnt get deleted

tough abyss
#

it does for me

#

stoptrig = createTrigger ["EmptyDetector", (position player), true];
stoptrig setTriggerArea [1500, 1500, 0, false];
stoptrig setTriggerActivation ["CIV", "PRESENT", true];
stoptrig setTriggerStatements ["this", "hint 'henlo';{deleteVehicle _x} forEach thisList;",""]

grave stratus
#

so i need to use civ and not east?

#

so i need to kill the unit first then

tough abyss
#

only if the vehicle is empty

#

let my try with east

#

and the unit inside

#

still working for me when i change it to east and the is a unit inside the vehicle

#

stoptrig = createTrigger ["EmptyDetector", (position player), true];
stoptrig setTriggerArea [1500, 1500, 0, false];
stoptrig setTriggerActivation ["EAST", "PRESENT", true];
stoptrig setTriggerStatements ["this", "hint 'henlo';{deleteVehicle _x} forEach thisList;",""]

grave stratus
#

so when i check, the vehicle turn to purple for a bit then turns yellow

#

yellow in empty means civ too?

tough abyss
#

yep

grave stratus
#

hmm its not working for me gahhh

tough abyss
#

if you run side _x

#

on an empty vehicle it returns civ

#

weird

#

do you get the hint?

#

stoptrig setTriggerStatements ["this", "hint this tigger has been activated'';{deleteVehicle _x} forEach thisList;",""]

grave stratus
#

im gonna try turning it around to let it kill uynits first then delete the vehicle.

tough abyss
#

stoptrig setTriggerStatements ["this", "hint 'trigger activated';{deleteVehicle _x} forEach thisList;",""]

grave stratus
#

i didnt put hint in side

#

letme try with hint

tough abyss
#

yep

#

that way you know if the trigger is even being activated

grave stratus
#
stoptrig = createTrigger ["EmptyDetector", [14267,12509], true];
stoptrig setTriggerArea [1500, 1500, 0, false];
stoptrig setTriggerActivation ["CIV", "PRESENT", true];
stoptrig setTriggerStatements ["this", "hint 'trigger activated';{deleteVehicle _x} forEach thisList;",""]
deleteVehicle stoptrig;

i got an error missing ; at the last line.. what the fish

tough abyss
#

at the last line

#

weird

#

missing a ;

#

my take on it without using triggers
{if (str(side _x) == "EAST") then {deleteVehicle _x;};} forEach ([996,4527] nearEntities["Land",1500])

#

that way you don't need the trigger to be activated first

#

just goes straight to the point

grave stratus
#
{if (str(side _x) == "EAST") then {deleteVehicle _x;};} forEach ([996,4527] nearEntities["Land",1500])

i have no idea how to do this myself that why i go for the trigger approach, easier to understand

ruby breach
#

str(side _x == โ€œEASTโ€) ๐Ÿค”

grave stratus
#

i am just about to ask about that too, why there is str in front of the bracker

grave stratus
#

hmm.. it still didnt delete the vehicle

grave stratus
#

ah i didnt change the nearEntities position ๐Ÿคฆ

#

it works now

#

thanks @tough abyss

tough abyss
#

i got an error missing ; at the last line.. what the fish
It is because you have missing ; at the end of setTriggerStatements line, duh

grave stratus
#

@tough abyss yeah i noticed that already, but the error said it was mission on the line under that triggerstatements

tough abyss
#

Because you havenโ€™t ended previous statement it looked like you are passing left argument to deleteVehicle

grave stratus
#

oh i see.

still forum
#

It stands for BI Scripted function compiled ...
It doesn't @astral dawn
Bohemia Interactive Studios (BIS)
Bohemia Interactive Netherlands (BIN)

errant patio
#

is there a way to find the nearest free space inside of a building? findEmptyPosition doesn't work, it seems to just consider buildings as solid boxes or something

dry inlet
errant patio
#

thanks, i'm actually trying to place the units on any walkable surface rather than just buildings that have positions in them.

setVehiclePosition works to some degree but it's prone to spawning them on the roof :/ and I'd like to be able to use the 2nd floor of buildings etc. too.

dry inlet
#

If you're using CBA you could just call the function ๐Ÿคท

still forum
#

If you're not using CBA you could just copy the function

errant patio
#

all that function does is provide a fancy wrapper and the capability to use a special editor object to define your own.

I could write a script of some kind to place the objects used to define the custom positions but then if I achieved that... why not just use it to place the units in the first place and avoid the overhead?

exotic flax
#

all properly defined buildings have positions for AI in them, and CBA simply adds a method to use custom positions

errant patio
#

the problem is that building positions are typically near windows, and often buildings don't have many - there's one in my map that only has one defined, in the dead centre - not exactly useful.
I'm trying to avoid using the predefined positions so that there can be more variety in CQB

#

i may, so far my own efforts towards solving this problem are going pretty well though

young current
#

That may cause issues like ai being unable to move.

#

AI needs path lod paths to navigate inside buildings/objects and the "pos" position points are part of that system.

short vine
#

I am currently trying to find the position of a specific p3d, and a specific memory point on the p3d.
The model is spawned through an assembly script, so the object doesnt have a unique classname. Assembly script just uses a placeholder object, and moves the p3d's into position.

#

Anyone know if a way to do this?

tough abyss
#

So it is weapon assembly?

short vine
#

Apologies, this is a static structure

tough abyss
#

Can you show the assembly script?

short vine
#

Ill have to ask permission from owner on that one

#

but the summary is that the scripts grabs an array of class names, and looks at the p3d position and assembles it in eden

short vine
#

So after digging, it does have a classname that is grabbed by the array, but the positioned with the holder object.
So I may be able to just have a init in the cfg to just force a variable

young current
#

or one of the other model to world commands

tough abyss
#

You want position of an object inside a holder in relation to the world? Like backpack inside weaponholder? If you have reference to the object you can get parent with objectParent command

digital jacinth
#

someone could help me understand this? It is not really an error for me to fix, but i am interested what the hell it means.

_vectorCase_X = random [_vectorCase_X, (((_vectorCaseDir>
17:54:25   Error position: <random [_vectorCase_X, (((_vectorCaseDir>
17:54:25   Error Type Number,Not a Number, expected Number
17:54:25 File \WW2\Core_f\WW2_System_Infantry_f\caseEjection\fn_caseEjection.s..., line 13
finite dirge
#

Something ended up with a NaN instead of a number due to an error most likely, which then threw this one.

tough abyss
#

Doesnt have to be error

 random [2 ^ 213213213123213, 2, 2]
astral dawn
#

Output of backpackMagazines looks like

[
    "9 mm 16Rnd Mag(16/16)[id/cr:10005771/0](4x)",
    "Smoke Round (Green)(1/1)[id/cr:10009582/0](1x)",
    "40 mm HE Grenade Round(1/1)[id/cr:10009574/0](1x)"
]

What do these things in the square brackets mean?

tough abyss
#

id and cr says right there

astral dawn
#

What is a CR?

#

Interesting, so every item in the inventory has a unique ID?

exotic flax
#

They should, because the moment you use rounds from a magazine (eg. half), you don't magically get a full magazine again ;)
So the moment it changes, it gets a new ID

#

would be great actually to have access to this system in mods (as an unique identifier), especially for mods like ACRE and TFAR ๐Ÿ˜‰ hint hint

astral dawn
#

TFAR currently solves this in a different way

#

(a thousand of unique class names)

#

So yeah would be useful...

exotic flax
#

I know, that's why this would make more sense.... no limits and build in core

#

but I'm sure there are things which should remain hidden for peasants like us ๐Ÿ˜‰

young current
#

is it unique ID per item or ID per item with X amount of ammo

#

since you have 4x full mags there

exotic flax
#

it seems to be an ID per unique item

young current
#

if you have 2x 4 rounds mags are both listed or is it 2x of mag(4/16)

exotic flax
#

I believe it would look like this:

[
    "9 mm 16Rnd Mag(16/16)[id/cr:10005771/0](2x)",
    "9 mm 16Rnd Mag(4/16)[id/cr:10001337/0](2x)",
    "Smoke Round (Green)(1/1)[id/cr:10009582/0](1x)",
    "40 mm HE Grenade Round(1/1)[id/cr:10009574/0](1x)"
]
young current
#

then its not unique per object item

#

its unique per item state

exotic flax
#

ID per unique item ๐Ÿ˜‰

#

before:

[
    ".45 ACP 11Rnd Mag(11/11)[id/cr:10000024/0](4x)",
    "6.5 mm 30Rnd Sand Mag(30/30)[id/cr:10000028/0](4x)"
]
// +1 in each weapon

after:

[
    ".45 ACP 11Rnd Mag(11/11)[id/cr:10000026/0](2x)",
    ".45 ACP 11Rnd Mag(5/11)[id/cr:10000009/0](1x)",
    ".45 ACP 11Rnd Mag(6/11)[id/cr:10000024/0](1x)",
    "6.5 mm 30Rnd Sand Mag(30/30)[id/cr:10000029/0](3x)",
    "6.5 mm 30Rnd Sand Mag(20/30)[id/cr:10000007/0](1x)"
]
// +1 in each weapon
tough abyss
#

cr - creator, owner id of creator

exotic flax
#

although it also seems to change the original ID, or reuse it for another item

tough abyss
#

After what?

exotic flax
#

after shooting a few rounds

#

and then reloading (and therefor putting it back in the inventory)

tough abyss
#

how do you get more mags in inventory after shooting???

exotic flax
#

magic

#

6.5 mm 30Rnd Sand Mag(30/30)[id/cr:10000029/0](3x)

name_or_mag(cur_rounds/max_round)unique_id

tough abyss
pseudo shadow
#

Hey random question, Does anyone know the function through either CBA/ACE/ZEN or default that adds objects to zeus?
I used to use [[_basetank]] call Ares_fnc_addUnitsToCurator;
But I don't use Ares anymore

exotic flax
pseudo shadow
#

That doesn't feel right, but that's probably the easiest way

#

so I'll take it

#

Thanks!

exotic flax
#

or use the Achilles mod ๐Ÿ˜‰

pseudo shadow
#

My Unit's decision was to switch to Zen. I'm just trying to keep up with all the scripts that used to work

pseudo shadow
#

Honestly adding the function back in saved me like 2 hours of work from remaking a bunch of stuff

smoky verge
#

can anyone here help me with this script, it should open the strategic map with addAction but its all in german and for some reason it tells me only the squad leader can select missions, even when I'm the squad leader

fleet sand
#

@pseudo shadow ``` {
_x addCuratorEditableObjects [allUnits,true];
_x addCuratorEditableObjects [vehicles,true];
_x addCuratorEditableObjects [allMissionObjects "All",true];
} forEach allCurators;

pseudo shadow
#

Oh gosh, I just needed specific objects in certain scripts. Re-adding the function worked perfectly

jolly jewel
#

Does anyone have any experience with making units move after using cba_fnc_taskDefend?

#

Using _unit enableAI "PATH" and _unit doFollow leader _unit doesn't seem to be enough

#

Or maybe it does, and I was doing it in the wrong order

jolly jewel
#

Yeah seems like order matters, if anyone ever needs to do that

#

Also it's a good idea to clear their waypoints as well

ruby galleon
#

Howdy- hoping someone could help me figure out the nature of the conversation system in ARMA3. Currently, I'm trying to figure out when and when isn't the radio is used when delivering dialogue.

#

https://i.imgur.com/Fh1tCLN.jpg
I have a simple thing currently set up- player approaches desk, and a bit of script is called up-
["ambientBriefing", "MissionName"] call BIS_fnc_kbTell;

#

here's the curious thing though-

#

in the ambientBriefing.bikb, I have class briefing 1 to 6, for each line of dialogue.

#

there are three characters involved, the player, the captain, and one named willis

#

if I structure the .bikb like this, the radio-when-distant thing will work from the get go.

#

but when structured like this: https://pastebin.com/a4fVQjj4

It does not- if the player wanders away from the conversation, the radio will not turn on.

#

link 1- Player speaks in line 1 and 5, and can hear the conversation on the radio from the very beginning
link 2- Player Speak in line 1, but cannot hear the rest of conversation on radio
link 3- Player speak in line 5, and can hear on the radio after that

#

as it is, my knowledge on scripting is tiny, but I would very much like to one day make some narrative driven scenarios, hence why I'm trying to understand this system

#

Any help towards figuring it out would be immensely appreciated ^^

dreamy kestrel
#

what's the difference between a button action defined in an .hpp file and wiring up ctrlSetEventHandler? When I try to do the latter, I cannot seem to effect the same sort of change that an action does. Control does not resume, for instance, in the manager loop that is watching the currently open dialog.

#

That being the case, I would like to get away from embedding actions in the .hpp quite as much because I find that is brittle to change, would rather it be in the SQF, personally.

sullen pulsar
#

now i remember why i despised arma and scripting... ripping my hair out for idk a good 30 minutes and the rpt log wasn't being helpful.. then finally i noticed i had an extra / which was causing the error.. ๐Ÿ˜’

high marsh
#

I thought you quit.

sullen pulsar
#

I came back to give the community more wonderful life stuff hehexd

high marsh
#

Curses.

winter rose
sullen pulsar
#

sikeuthot

#

working with this shit makes me want to quit again tho all cause the rpt wasn't helpful in pinpointing the issue.

ruby galleon
#

That's what I've been referencing, mainly, @winter rose

#

that and decompiling ARMA's showcase missions to see if I can pick apart how they do things

#

as it is, they're a bit hard to parse for someone that's still a novice at scripting

#

the official missions, that is

winter rose
#

Also, I am on mobile (and it's early to me) but what is the difference between "it works" and "it doesn't"?

ruby galleon
#

mainly, whether or not the units speaking will broadcast on the radio

#

in one instance, the player will not receive any radio broadcast. In another, they will only receive radio broadcast after they appear again in the conversation. In the last, the conversation will happen all throughout radio

#

on that note though, I just noticed the "forceRadio" parameter.

winter rose
#

File* difference

The channel will be chosen on sentence beginning, so if the sentence is too big and the player runs away, it won't change mid-sentence (afaik)

ruby galleon
#

mmhmm- that's no problem. The main problem is whether or not the radio will be used in the first place, which it seems BIS_fnc_kbTell does something to automatically determine, but it's not perfect. But I just found a radioMode parameter under BIS_fnc_kbTell, which may solve my problem

winter rose
#

And what is the file difference that makes the difference
I couldn't find any discrepancies in your links (but again, I am on mobile and brain isn't fully functional @ruby galleon)

#

But yeah forceRadio is a thing ^_^

ruby galleon
#

the main differences was the order in which the player unit gets involved with the conversation. If the player isn't involved at all, then the radio doesn't broadcast the conversation. If the player is involved in the beginning but not later, the radio also doesn't broadcast. If the player is involved part way, but not the beginning, then the radio will only broadcast after the player unit speaks

#

it's all very strange.

winter rose
#

Oh.

#

Indeed

#

I would have thought the function would parse and get through all the conversation units to broadcast to them all

ruby galleon
#

As it is, I'll test with RadioMode set to true and see how it plays out

#

...tomorrow.

#

is late for me.

winter rose
#

(I assume playerInf is the player unit variable set in the editor)

Well, good night to you, good morning to me! Taking the shift ๐Ÿ˜‰

ruby galleon
#

it's also pretty weird and silly hearing myself "voice act" to myself

#

I appreciate the help!

hearty plover
#

IS there really no way to hide markers created by addRespawnPos?

high marsh
#

sure there is, you just have to know what they're named

#

or in what convention they're namede

#

might be like BIS_respawn_blah

hearty plover
#

I am trying to get respawn markers via

#

[west, false] call BIS_fnc_getRespawnMarkers apply { systemChat _x };```
#

But when I put that in the debug console

#

im getting no output

high marsh
#

or.

_westMarkers = [west,false] call BIS_fnc_getRespawnMarkers;
systemChat str _westMarkers;
#

I guess apply would work, but it doesn't really make any sense to use it.

#

Make sure your markers were created before you call that function

hearty plover
#

I am getting nothing back from this

#

Really weird

#

So, using trhe RespawnModule

#

to get a player the ability to respawn on a veh

#

I want to hide the respawn modules marker

#

on the map

high marsh
#

Hmm..

#

try allMapMarkers ?

#

it has to be there

still forum
#

@astral dawn

What is a CR?
Creator. OwnerID where mag was created
Interesting, so every item in the inventory has a unique ID?
no
@exotic flax
So the moment it changes, it gets a new ID
no.

Magazines have uid's because they need to be tracked, as each magazine has properties assigned to it (amount of ammo left). Normal "items" don't have that.
@smoky verge

for some reason it tells me only the squad leader can select missions, even when I'm the squad leader
Well that has nothing to do with the strings in there being german

//check if a mission is already selected
if !(player isKindOf "rhs_msv_sergeant") exitWith {hint "Nur der Gruppenfรผhrer kann Missionen anfordern!"};
If you are not that specific rhs unit, you can't request missions.
Funnily enough that comment is wrong.
@sullen pulsar what issue did you ran into exactly? Just some logic error?

crisp turtle
#

So, i've got a trigger than when activated calls

[2] call BIS_fnc_earthquake;

now, the trigger and the effect work, but i get this error

Sleep ( _duration - _compensation );
|#|Sleep 3;
BIS_fnc_earthquake_inprogress =...'
File \A3\Functions_F_EPC\Misc\fn_earthquake.sqf [BIS_fnc_earthquake]..., line 83
Error Generic error in expression
Error Generic error in expression```

Does anyone know what causes this? The earthquake happens and whatnot, but i'd like to not have a giant black box show up every time...
winter rose
#

use spawn instead of call

tough abyss
#

[2] spawn BIS_fnc_earthquake;?

#

though if it works without sleep maybe you should remove sleep?

crisp turtle
#

Thanks laddies, worked like a charm

tough abyss
#

I came back to tell you how shit this shit was hehexd
๐Ÿค”

sullen pulsar
#

@still forum ah just the generic generic error in expression pointing to the wrong thing causing the error. Good ol' helpful rpt log

#

Just glad that arma error reporting is as useful as it was 5 years ago when i dipped

still forum
#

Thought maybe debugger would produce more helpful errors. But in that case probably not

#

the RPT usually points exactly where it should, but you need to know how to intrepret it

sullen pulsar
#

well I had it compiled as final via an addon so that made it even harder to track down with CBA on so it was saying error at line 99999999999 even when 9999999 didn't exist and other fun things totally not related to it or near the line

winter rose
#

Don't create bugs - it's that simple!

sullen pulsar
#

would be nice but my keyboard double taps keys

#

kinda why i didn't see the mistake in the first place, plus i'm using visual code editor on dark mode so even harder LOL

winter rose
#

j/k of course, but regarding VS Code I am pretty sure there are some good dark themes out there

still forum
#

Having #include after block comments /**/ breaks line numbers. put your includes above

sullen pulsar
#

i only have 1 include at the tippy top

#

I learned to compensate for arma, i just go back to notepad++ and write the code out in debug console before I slap it in addon worry

#

gotta say tho I am using your intercept-database, actually freaking brilliant. Love it. Really could of used it 5 years ago.

#

Intercept entirely is just all around nicer but the database plugin makes SQL management very nice

still forum
#

Maybe vsCode with sqf extension. But there are no good SQF linters for VSCode... :/
Atleast the one i use doesn't detect "_x = 5 / / 7"

sullen pulsar
#

Uh i'm using the vscode sqf extension, it just doesn't catch certain things and the excessive / was one of them. Made it blend with the background.

queen cargo
#

@still forum there is technically the task @ebon ridge created with sqf-vm

#

And... Sqf-vm should catch theese things

#

Yup, it does as expected

#

@sullen pulsar depending on what you need to use in regards to sqf, sqf-vm May be your friend

tough abyss
#

but can you dump any code in it to check for compile errors?

still forum
#

yes

tough abyss
#

even the code with script commands that are not in sqf-vm?

still forum
#

yes

#

As long as there is a dummy implementation for the command in the vm

#

The VM has to know what commands exist, but doesn't need to have them implemented

queen cargo
#

And if not, you can provide on with cli args ๐Ÿ˜œ

tough abyss
#

123//123 - pass
I guess you need to specify if you want it preprocessed @still forum

still forum
#

- pass yes ofc

#

That's valid sqf

tough abyss
#

is not

still forum
#

yes it is

#

123 followed by a comment

#

that's valid

#

123 / / 123
would not be

#

Pretty print SQF doesn't do preprocessing

#

which..is a bug.. but.. maybe its a feature

tough abyss
#

I guess you need to specify if you want it preprocessed

still forum
#

Pretty print SQF doesn't do preprocessing

errant jasper
#

But / / is wrong regardless of preprocessing

tough abyss
#

you can do with a tick option on that page

queen cargo
#

@still forum technically, not a Bug
The cli Option was added before the preprocessor

still forum
#

We already talked about that

queen cargo
#

One could also just use the sqfvm commands for that ๐Ÿค”

#

Possible ๐Ÿ˜‚

tough abyss
#

well I found a bug

private "lol";

runtime error in A3, local var in global space

#

same for private ARRAY

#

@queen cargo fix it fix it fix it

still forum
#

Same error in vm

#

Wait no?

#

We already talked about that bug and I thought we fixed it?

queen cargo
#

I am quite sure it was fixed ๐Ÿค”

#

Though... It is a quite simple fix

#

More interesting, there aint no test case for this

tough abyss
#

Found another bug

missionNamespace setVariable ["player", 123]

you cant do this in A3

#

reserved names

tough abyss
#

oh dear

set = 2; apply = 3;

all good?

still forum
#

ye

tough abyss
#

should error

still forum
#

yeeeep.

tough abyss
#

I guess @queen cargo is writing A2 SQF ๐Ÿ˜‚

still forum
#

Doesn't break anything. command names take precedence over variable names like they should

#

Just a missing warning/error

winter rose
#

error (from some A2 patch)

#

I remember doing a true = false in A2, it broke everything ๐Ÿ˜„

exotic flax
#

isn't

missionNamespace setVariable ["some_var", "some_val"];

equal to

with missionNamespace do {
    some_var = "some_val";
};

???

and therefor can't contain reserved names?

#

which would make sense ๐Ÿ˜‰

tough abyss
#

WHOA!

toLower toString [75,76,74,72,75,76,74]

result [WORK] <STRING> KLJHKLJ ๐Ÿค”

exotic flax
#

@tough abyss that makes sense, because it's transforming unicode to strings

tough abyss
#

Seriously what are you on about?

#

Open Arma, put it in debug console and execute

dusk sage
#

Bit hostile

exotic flax
#

same as

toArray "KLJHKLJ"

gives [75,76,74,72,75,76,74]

tough abyss
#

obviously

exotic flax
#

except the toLower part... that doesn't make sense...

tough abyss
#

@queen cargo toLower/toUpper dont work when the argument is the result from operation

toLower call {"YO"}

[WORK] <STRING> YO

dusk sage
exotic flax
#

@tough abyss

dusk sage
#

They are not talking about SQF in ARMA 3

tough abyss
#

obviously

winter rose
#

Well, can't argue with Boguu ๐Ÿค“

exotic flax
#
Schnellfeuer: Seriously what are you on about?
Schnellfeuer: Open Arma, put it in debug console and execute
tough abyss
#

Yeah, execute what though?

exotic flax
#

well... since you didn't specify, I referred it to the last comment I wrote before your comment...

tough abyss
#

so to you it makes sense that the result is all CAPITAL letters even after it was toLower-ed?

winter rose
queen cargo
#

what @winter rose said (the discord is the best place for that https://discord.gg/vpdwJtG) plus there ain't nothing to fix, but the version you entered that code into @tough abyss

tame lion
#

does anybody know of a good way to resize an RscStructredText box to the size of the text within it? I have a textbox in a vehicle select dialog that gives a description of the currently selected vehicle and would like to avoid a long trailing box since they all have different sized descriptions

winter rose
#

@tame lion maybe more luck in #arma3_gui (unless you want to do it by script, which I am not sure how to)

tame lion
#

Yeah I'm looking for a scripted way since the text will be changing with vehicle selection anyway, meaning it'll have to change while the games running

exotic flax
#

I'm far from an UI expert, but I guess the only way to make it dynamic is to have a scrollbar (instead of making the box bigger/smaller)

tough abyss
#

you can resize based on text height but not text width

astral dawn
#

I think there is a way to get the whole text width, I recall someone asking the same

#

But I don't remember which program does that

tame lion
#

@exotic flax i like that scroll bar idea. Guess i gotta find out if a structured text boxcan be scrolled now

#

And i know you canmake something auto scroll too.

exotic flax
upper rose
#

Is there a command to make a building door open or close?

jade abyss
#

1/0

waxen tendon
#

i have a sound to play on every player

#

should i do it locally or globally

still forum
#

local

waxen tendon
#

thanks

mortal wigeon
#

Is there a simple way to count available (whether filled or not) cargo index spots in a vehicle? e.g. count cargoIndex _someVeh

winter rose
#

(alternative syntax)

mortal wigeon
#

perfect, thanks

#

Another question: is there a way to return a value out of a scheduled function to the calling script before the function is finished running?

winter rose
#

Nope

#

Beside global variable or setVariable on an object or something, I don't see any

mortal wigeon
#

figured :\

thorn mural
#

Idk if thats a wanted feature but if you switch a weapon from the ground for one in your inventory it doesnt fire the Put EventHandler, just the take one. Any ideas ?

velvet merlin
exotic flax
#

depends on what you want to know... I have tested this function to see if I could build a mod around it and it works exactly as it says it does.

velvet merlin
#

well performance is one consideration, calculation time for various situations, scaling with more units, "issues" like described in there

exotic flax
#

I only used it as a GPS system for vehicles with real-time updating of routes (in case you drive on a different route), and it seems to work decently.
Yes, I also noticed the delay, although it seems that it's way less for vehicles than for "man", not to mention the used behaviour (CARELESS is the fastest).

#

However, just like described in that topic, when terrain is difficult (non-roads, water, etc.) the execution time seems to explode.

#

It seems that the function prefers roads over terrain

#

and if no road can be used, it will simply draw a straight line (although AFTER it tried all road possibilities)

west grove
#

hmm wasn't there a function that returns the degree of where the player is looking at ?

#

direction is easy, but i need the up/down

still forum
#

cameraViewDirection

west grove
#

that is just for cameras, no?

exotic flax
#

eyeDirection (?)

west grove
#

ok, getCameraViewDirection works. fancy.

upper rose
#

@jade abyss thanks!

jade abyss
#

what?

#

Ah

astral dawn
#

How do I make my mission ACE-compatible? I know they add some event handlers, and I also add some event handlers. Is there some page where all these things are listed?

hollow thistle
#

Depends what do you mean by "ACE-compatible"

#

Think about what systems are in ace and what are in your mission and which one have overlapping functionalities.

#

Most likely:

  • Medical
  • Arsenal
  • Logistics (Rearm refuel)
#

If you have any medical system in your mission you should disable it when ACE medical is detected.

astral dawn
#

๐Ÿค”

#

I use handleDamage a lot to prevent AIs from being killed by their friendly driving AIs

sullen pulsar
#

there's also just getDir no?

astral dawn
#

What?

#

BTW guys, is it possible to invert color of a marker?

#

Or do I need to supply a different .paa?

tough abyss
#

Is there a way to disable "Autospotting"? In my mission file, when any player spots an enemy, they are marked on the map. Is there a way to disable that? Thanks in advance

tame lion
#

Does anyone know of a way through script to remove an action that was added in userActions class?

#

actionIDs doesn't reveal any ids on the vehicle im testing this on

hollow thistle
#

You can't remove config added actions without editing the config.

tame lion
#

dang... aite then

finite dirge
tough abyss
#

@finite dirge where do I change it? description.ext?

finite dirge
tough abyss
#

I appreciate it a lot, thank you

astral tendon
#
(allPlayers select {alive _x})

How much time does it take for the Alive to return that a player is dead?

winter rose
#

Not a lot, why

astral tendon
#

Because I was using EntityKilled event handler in a Dedicated server and checking how many players are alive, if they all died the mission should fail but there was a situation were the missions did not failed with all players dead.

#

It did worked some times but its unreliable.

jolly wolf
#

Hello, I am running the Ama3 group in Korea and now I am trying to learn a script.

young current
#

hello

#

the BI wiki contains quite a bit of info on that. especially the scripting commands page is very useful reference

jolly wolf
#

I have to start with the basics...

young current
#

There are also few pages for that. It might take some time to learn more advanced stuff.

young current
#

@lavish ocean should ๐Ÿ‘† be pinned on this channel?

exotic flax
#

people should not be able to ask questions here without spending time on the wiki for at least 30 minutes ๐Ÿคฃ

lavish ocean
hallow mortar
#

What's the correct procedure for checking the current value of a bis_fnc_countdown? I'm trying missionNamespace getVariable "bis_fnc_countdown_time" but it's just returning the initial value.

austere granite
#

i dont have any code available on this laptop, but 99% likely you can't get it, judging from overal usefulness of BIS functions

hallow mortar
#

Then what's the function for? What's the purpose of having a countdown if you can't tell when it ends?

young current
#

have you read the description of the function?

hallow mortar
#

Triggers a countdown. Countdown can be accessed via missionNamespace variable bis_fnc_countdown_time

young current
#

did you first run the countdown function?

#

so that it is running

hallow mortar
#

Yes, otherwise it would not be returning the initial value

young current
#

is it safe to assume you are running a mission?

#

MP or SP?

hallow mortar
#

Currently testing in SP but will be MP (and I have set the countdown function to be global)

#

Test code deployed in init.sqf:

if isServer then {[45,true] call BIS_fnc_countdown;};

while {true} do {
systemChat format ["%1",(missionNamespace getVariable "bis_fnc_countdown_time")];
sleep 2;};```
the resulting systemChat message is always 45.

(I know while true loops are bad, this is just for test purposes)
#

I'm confident it isn't just a problem with the systemChat report loop; I have another check (in the actual mission functionality I'm doing this for) that's supposed to respond when the timer is 0, and isn't doing anything

young current
#

you sure isServer runs on SP?

hallow mortar
#

a) if it wasn't running, I wouldn't get 45 because that wouldn't be being set at all
b) I tried it without isServer and got the same result

exotic flax
#

could you try the following:

if isServer then {
   [45,true] call BIS_fnc_countdown;
};

while {true} do {
   _value = [] call BIS_fnc_countdown;
   systemChat format ["%1", _value];
   sleep 2;
};
hallow mortar
#

That works

#

So...bis_fnc_countdown_time is just there to mislead people, then?

exotic flax
#

actually, BIS_fnc_countdown uses bis_fnc_countdown_time to keep track of the current timing, so it should be available

hallow mortar
#

in that case I don't really understand why my original script wasn't working

grave stratus
#

is it possible to change vehicle appearance via script?

hallow mortar
#

Make the appearance changes you want in the Virtual Garage, then click Export at the bottom. Open your text editor of choice and press CTRL+V. You can use that output in a script. (specifically the part involving BIS_fnc_initVehicle)

grave stratus
#

@hallow mortar okay. thanks a lot

#

BIS_fnc_initVehicle is the same as putting code in init box in eden right?

#

or is it like this?

_veh allowDamage false;
tough abyss
#

@hallow mortar someone made a mess when he first filled the page. bis_fnc_countdown_time doesnt change because it just keeps initial value.

So...bis_fnc_countdown_time is just there to mislead people, then?
It is internal param and should not be exposed. You check it like this:

_timeLeft = [] call bis_fnc_countdown;
_isCountdownInProgress = [true] call bis_fnc_countdown;
hallow mortar
#

@grave stratus

BIS_fnc_initVehicle is the same as putting code in init box in eden right?
No. It's a separate command. You could put that command in a vehicle's init box, though. I recommend looking it up if you're unsure.

#

@tough abyss I've been told it's bad practice to use them because there's no end state.

winter rose
#

it's a bad practice if you don't know what you do yes
Also, put the sleep in the while code (if possible) so you are sure you don't while {true} without delay

while { sleep 2; true } do {
   private _value = [] call BIS_fnc_countdown;
   systemChat format ["%1", _value];
};```โ†‘ of course with this you have a 2s start delay
grave stratus
#

@hallow mortar noted. as i want to spawn it via script, i cant put it in init box can i? ๐Ÿ˜„

hallow mortar
#

One of the parameters for BIS_fnc_initVehicle is the target vehicle. In an exported example, it's probably _this or something like that. Simply replace that with whatever variable name you gave the vehicle when you spawned it - for example, if you used _veh = createVehicle ..., plug _veh into BIS_fnc_initVehicle.

grave stratus
#

@hallow mortar got it. thanks

#

does
endLoadingScreen makes loading mission faster? someone told me that, i've read the biki, nothing much has been said.

hallow mortar
#

It appears that's designed for use with custom loading screens. I wouldn't recommend trying to use it on the native A3 loading screens, because even if it does work, you might end the loading screen before the mission's finished loading. Loading screens are typically the length they are for a reason.

exotic flax
#

endLoadingScreen is only removing the loading screen, it doesn't magically load scripts fasters...

still forum
#

actually scripts load faster while the loading screen is open

exotic flax
#

just wanted to say that ๐Ÿ˜‰

grave stratus
#

Ahh okay

dim kernel
#

Hello,
i got a combo list, i add some items, but when i added pictures, and they suddenly turned black

grave stratus
#

I have a few players that have tried it when entering my server. they said that they load faster using it

hallow mortar
#

The visual/UI loading screen may be gone, but that doesn't mean the mission has actually finished loading

dim kernel
#

anyone able to help?

grave stratus
#

i see

dim kernel
#

i got a combo list, i add some items, but when i added pictures, and they suddenly turned black please any idea why?

grave stratus
#

what is this combo list? ๐Ÿค”

astral dawn
hallow mortar
#

New problem. I'm spawning a bomb and setting it to point straight down. I'm then attempting to give it a few hundred m/s of velocity, straight down. I've got it pointing down okay, but I can't figure out what the correct settings for setVelocity are to create straight-down velocity.

#

I assumed it was the z value (last in the array) but increasing that makes the bomb go further off target

exotic flax
#

try decreasing it (so it goes down)

hallow mortar
#

Sorry, I meant to say that changing it at all makes it further off target. I've tried negative values too.

exotic flax
#

do you also use setVectorDirAndUp to rotate the object?

hallow mortar
#

in case the setVectorDirAndUp is changing where the z axis points, I've been playing with modifying the other values in the setVelocity array, but I just can't find the one that makes it go straight down

exotic flax
#

I'm not 100% sure, but if you rotate an object, the xyz for setVelocity also changes.
So if the object is rotated to point down, setVelocity should use the x value to go forward (or in this case down).

#

But I could be wrong about that

hallow mortar
#

Apparently the problem is actually a crippling lack of consistency

#

sometimes the bombs are set to point the right way, and come down mostly on target

#

other times they come in backwards and a mile away

#

you know what, I'm just gonna spawn them and let gravity do the rest. I can't deal with this.

astral dawn
#

Maybe try with setVelocityModelSpace ๐Ÿคท

exotic flax
#

@hallow mortar try this:

// create explosive
_bomb = "M_Mo_82mm_AT_LG" createVehicle [0,0,0];
// place explosive 100m above player
_bomb setPos [getPos player select 0, getPos player select 1, 100];

// set the pitch to -90 degrees (downwards)
_y = 0; _p = -90; _r = 0; 
_bomb setVectorDirAndUp [ 
   [ sin _y * cos _p,cos _y * cos _p,sin _p], 
   [ [ sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D 
];
// set the velocity to 100 m/s
_bomb setVelocity [0, 0, 100];
hallow mortar
#

The rotateVector2D thing works fine, but as soon as I throw in setVelocity things start going off course

exotic flax
#

the above script does work (spawns explosive, rotate it and blast downwards on top of the player) while testing it locally

#

I also noticed some issues with manually setting setVectorDirAndUp where it didn't moved the correct direction, since the rocket (in my example) would just go its own way

hallow mortar
#

Well, I don't know what to tell you. I did it without the setVelocity part at first (by accident) and the bombs were being created correctly and falling straight down on target. I added the setVelocity part, did the thing, and the bomb landed 400 metres away.

marble thistle
#

Can you somehow detect if the player is on a main road (Orange on the map)

astral dawn
#

yes

marble thistle
#

Yes

merry arrow
#

hey does anyone know how i can make it so aircraaft can have a set colored smoke trail behiond em?

winter rose
#

you can either use the drop command (not really nice), or particle emitters @merry arrow

merry arrow
#

k im not super good with that, i found the emitter 3ditor mod so that should help, thx

sullen pulsar
#

Am I right to assume that ARMA 3's revive system is entirely scripted?

hollow thistle
#

yes

sullen pulsar
#

Alright, was looking into it and seeing if I can customize it but there's a lot to dig into and wanted to make sure I wasn't wasting my time.

hollow thistle
sullen pulsar
#

Yeah I was digging through the a3 pbo's and found it in functions_f_mp_mark

#

just.. a lot to dig through cause of their macro and stuff x d

hollow thistle
#

Fastest way would be to copy paste reviveInit and replace handlers with your handler functions where you need customizations I think.

merry arrow
#

@winter rose so how would i go about this, im doing it but its not achieving the result im going for. im trying to make it kinda like an airshow

winter rose
#

what are you doing?

merry arrow
#

oh wait nvm man, got it

#

thanks tho

grave stratus
#

does position support float up to 3 decimal points?

random crescent
#

@grave stratus it's a C++ float, so 7 digits.

#

(decimal digits)

tough abyss
#

@grave stratus it is about overall precision, so depends on the whole part as well, you can have even more digits after decimal point if the whole part is small.

west grove
#

for some reason i'm unable to overwrite defaultAction via KeyDown event handler.. am i doing something wrong?

#

i don't want the player to be able to raise and fire his weapon

ivory lake
#

cant override mouse buttons

west grove
#

can i disable it?

ivory lake
#

best you can do for that sort of thing is an addaction

#

using the shortcut defaultaction

#

and the addaction will always take priority

#

its hacky tho

real tartan
#

is there a way to get element position within array ?

astral dawn
#

find ?

#

Or findIf

real tartan
#

there can be more same elements in array ["a", "b", "a", "a", "c"] ...

astral dawn
#

Then foreach and pushback the _foreachindex for elements which match your criteria

tough abyss
#

would be good if findIf had _forEachIndex so that you could say && _forEachIndex > n

real tartan
#

or apply, count, ... anything doing something with array

#

got around that anyway, as usual in case of Arma

#

Any "smart" way to check if character is lower or upper case? check if "u" or "U". I am checking it by comparing to alphabet array at the moment.

tough abyss
#

could do it by comparing the char code

_charCodeA = toArray "a" select 0;
if (toArray _letterToCheck < _charCodeA) then {hint "IsUpper"} else {hint "IsLower"};
grave stratus
#

@Schnellfeuer thanks

west grove
#

is there a way to set where a player is looking at?

#

up/down i mean

winter rose
#

@west grove set no, get yes.

tough abyss
#

thanks god there isnt

winter rose
#

Well, for SP immersive moments there could be, such as the camera looking at an event then transferring the controls back to the player, but regarding abuse, heck yes

west grove
#

that's what i wanted to do, yes

#

could use a custom animation, but that would rob the player from being able to move

#

also i never made an animation before, so...

tough abyss
#

use gesture

west grove
#

no idea about any of that

tough abyss
#

actually gesture doesnt change camera dir only pos

winter rose
#

Yup

grave stratus
#

how i find classname of objects inside of a box?

#

i noticed that items in equipment storage has some extra items than arsenal

tough abyss
#

AmmoBox?

grave stratus
#

yes, ammo box, equipment, uniform, whichever it is

tough abyss
#

getXXXCargo commands

grave stratus
#

@tough abyss thank ill look it up

grave stratus
#
_box_type = _this select 0;
_amount = _this select 1;
_amount2 = _this select 2;

clearWeaponCargo _this;
clearMagazineCargo _this;
clearItemCargo _this;
clearBackpackCargo _this;

switch (_box_type) do {
    case "equip": {
            _this addItemCargo ["ACE_adenosine", _amount2];
            _this addItemCargo ["ACE_fieldDressing", _amount];
    };
    case "reset": {        
            if (_this == "equip") do case "equip";
    };
};

I am trying to figure out a command that can switch to another case from
another case but i am not sure how, i've read biki, but doesnt seems to
have the example for it. In the script above, i wonder how can make it on the
if (_this == "equip") do case "equip"; so that it goes to another case.

still forum
#

_this select
use params

#

The thing you are trying to do doesn't exist

grave stratus
#

oh

still forum
#

clearWeaponCargo _this; thats a syntax error

#

_this is an array as you show in the first 3 lines. the clear commands don't take arrays

grave stratus
#

yeah i've thought that much that it would return error

still forum
#

You could so smth like this

private _fnc_equip = {
    _this addItemCargo ["ACE_adenosine", _amount2];
    _this addItemCargo ["ACE_fieldDressing", _amount];
};

switch (_box_type) do {
    case "equip": _fnc_equip;
    case "reset": {        
            if (_this == "equip") then _fnc_equip;
    };
};
#

Oh.. just noticed that you check _this == "equip"

#

so you expect _this to simultanously be array,object and string ๐Ÿค”

grave stratus
#

๐Ÿ˜…

#

im a bit confused

#

if i put ["equip",100] execVM "Custom\suppliesInit.sqf";
would _this point to the object or the array?
i understand that to use the array i need to use _this select 0;

still forum
#

array

#

you aren't passing any object. You are passing an array with a string and a number. no object anywhere to be seen

#

i understand that to use the array i need to use _this select 0;
no. As I said use params

grave stratus
#

so i need to give a name to the object first

#

im reading params

still forum
#

so i need to give a name to the object first
not necessarily. You just need to pass it somehow

grave stratus
#

okay ill study params first see how it goes

#

thats for the advice @still forum

tough abyss
#

anyone has any idea of how to determine if a weapon config entry is a weapon with attachment?

flint iris
#

Hello, probably dumb question.Is there any way how to increase backpack inventory?

west grove
#

only via config

tough abyss
#

like those weapons with attacments in crates

west grove
#

is it possible to cancel a kbtell sentence?

#

i tried to overwrite it with something empty, but no chance

#

also deleting the topic mid-sentence doesnt seem to stop it

winter rose
#

You can kill the peep

tough abyss
#

Hey guys I'm having some real trouble coding a cfgvoices class anyone know them?

winter rose
tough abyss
#

ty

tough abyss
#

hmm anyone know a way to overide normal voices in any way? I've got the voice to work but sometimes the original is heard too

vernal venture
#

Does anyone know- if I use player enableStamina false does that still respect weight? Or should I use enableFatigue?

#

I'm looking to slow someone down if they're overburdened, while still removing the stamina bar.

winter rose
#

Nope, it disables the whole system completely

vernal venture
#

I'm sure there's a way to respect weight but disable stamina, apparently I just don't know it. Is it a player attribute maybe?

winter rose
#

what makes you so sure?

vernal venture
#

Used to play on a vanilla Invade and Annex server that did it.

winter rose
#

Try the commands in Eden then.
Else it was a loop that sets endurance to 1 every second

vernal venture
#

A loop seems horribly inefficient. I suppose just dropping the various commands into my init to test is the way to go, yeah.

obsidian violet
#

Hi guys,
Im having some issues regarding some of the ACE functions hoping you can help me out once again =)

So the issue is that I need to delete the specific object the ACE action is attached on.
I found one solution by doing it vanilla with the following:

 ["Land_BottlePlastic_V2_F", 
"initPost", 
{
param[0] addaction ["randomaction", 
{
    deleteVehicle param[0];
},
[],6,true,true,"","_this distance _target < 2"];
}, false, [], true] call CBA_fnc_addClassEventHandler; 

So this works perfectly, the object spawns with the attached action and is being deleted when im doing the action.
Now I wanna do the same thing with ACE.
What Iยดve got so far...

removeobjectAction = ["removeObject","Remove Object","",  
    {[2, [], {
    deleteVehicle param[0]; //<----This is the issue...
    }, {hint "Action aborted";}, "Removing"] call ace_common_fnc_progressBar;},{true}] call ace_interact_menu_fnc_createAction;   

[
    "Land_BottlePlastic_V2_F" 
,"initPost",{
[param[0],0,["ACE_MainActions"],removeobjectAction] call ace_interact_menu_fnc_addActionToObject;}, false, [], true] call CBA_fnc_addClassEventHandler;

I know that the deleteVehicle param[0]; does not work because the param 0 is not the object in this case, but is there any good way to get it?

obsidian violet
#

found a solution, itยดs not beautiful but it works ^^

    deleteVehicle nearestObject [player, "Land_BottlePlastic_V2_F"];
exotic flax
#

actually... in ace_interact_menu_fnc_createAction the statement has access to params ["_target", "_player", "_params"];, so _this select 0 should return the object you put the action on.

tough abyss
#

Does anyone know how to apply custom voices to be able to be picked when making a profile?

#

class CfgIdentities
{
class Combine
{
name = "Combine";
face = "whiteHead_01"; // doesnt have to be this one, you can use any head you want. Just look up the class names
glasses = "None";
speaker = "CivilProtectionENG"; // your voice class defined below
pitch = 1;
nameSound = "Kelly"; // I believe this ties to the sound file for Kerry, I'm guessing you can change this but I havent bothered
};
};

#

Ive got this cfgidentity but i dont know if it works or what face its tied too

astral dawn
#

missionNamespace has lifespan of the current mission, what is the 3DEN editor then? Is it also a mission because it also has a mission namespace?

cosmic lichen
#

Yes

#

MissionNamespace in Eden editor is cleared once the mission is previewed

#

@astral dawn

astral dawn
#

Thanks!

grave stratus
#
this addACtion ["Reset Box","Custom\suppliesInit2.sqf",["reset",200,50,"supply"],2,false,true,"",""];
_caller = (_this select 1);
_box_reset = (_this select 3) select 3;

 If ((_caller == CO1) || (_caller == CO2) || (_caller == CO3)) then {
                if (_box_reset == "supply") then _fnc_supply;
                if (_box_reset == "helmet") then _fnc_helmet;
                if (_box_reset == "equip") then _fnc_equip;
                if (_box_reset == "medic") then _fnc_medic;
                }
            else { 
            hint "You are not authorised to use this function."; 
            };

i am having problem for the script to check wether or not caller of the addAction is named CO1,CO2 (variable name) to proceed on the script, but it seems that CO1 doesnt return anything although i have named then on the unit's variable name. What do i need to use to check if the caller is the named unit?

frozen knoll
#

if (_box_reset == "supply") then _fnc_supply;
that and the others should be ...
if (_box_reset == "supply") then {_fnc_supply;};
but also how do you call the function?
call your_fnc_supply; ?

grave stratus
#

@frozen knoll i deliberately removed the function in the example script since it is working fine. my problem is only the check for player with variable name CO1,CO2...

here is the full script https://pastebin.com/40GJxPDw

#

i wanted to restrict the usage to a certain playable slot only

frozen knoll
#

player addACtion ["Reset Box",{params ["_target", "_caller", "_actionId", "_arguments"]; hint format["%1",_caller]},["reset",200,50,"supply"],2,false,true,"",""];
strange as it should return the caller

#

100% if you place a unit CO1 and add the action to the init and run
this addACtion ["Reset Box",{params ["_target", "_caller", "_actionId", "_arguments"]; if (_caller == CO1) then {hint format["Caller is %1",_caller]};},["reset",200,50,"supply"],2,false,true,"",""];

#

it returns C01

frozen knoll
#

the check is fine btw ๐Ÿ™‚

grave stratus
#

hmm

frozen knoll
#

if (_box_reset == "supply") then _fnc_supply;
if (_box_reset == "helmet") then _fnc_helmet;
if (_box_reset == "equip") then _fnc_equip;
if (_box_reset == "medic") then _fnc_medic;

#

thats what you need to fix ๐Ÿ™‚

#

you could test by removing that and putting hint "test"; in there to see if its firing

grave stratus
#

if i remove the check line it works fine, it also mean that anyone can use the addaction

frozen knoll
#

so your playing as C01 right?

grave stratus
#

in my original script it show Error Undefined variable in expression : co1

#

im playing as co2

frozen knoll
#

and you havnt mixed up number 0 with letter O ?

grave stratus
#

nope, since i copy paste everytime

#

and CO mean commanding officer

frozen knoll
#

hmm yeh its unusual as my test above definately returns the caller your playing as

#

the check is good like i said but u could try a alternative way
_units = [CO1,CO2,CO3];
If (_caller in _units) then {

grave stratus
#

using your code directly into the box init shows the same error too

frozen knoll
#

have you tried to see what _caller is returning in your case?

#

_caller = (_this select 1);
_box_reset = (_this select 3) select 3;
hint format[Caller - %1",_caller];

grave stratus
#

i am trying it now

frozen knoll
#

roger

grave stratus
#
this addACtion ["<t color='#FF0000'>Reset Box</t>","Custom\suppliesReset.sqf",["reset",200,50,"supply"],2,false,true,"",""];

supppliesReset.sqf :

_caller = (_this select 1);
hint format[Caller - %1",_caller];

Error invalid number in expression

#

i think my addaction is wrong somewhere

frozen knoll
#

missing "

#

hint format["Caller - %1",_caller];

#

my bad

grave stratus
#

oh

frozen knoll
#

sorry man ha

grave stratus
#

haha its okay, i didnt notice that either

#

okay now, it returns Caller - CO2

frozen knoll
#

so it is returning the caller as expected

grave stratus
#

using if (_caller in _units) shows error invalid number in expression

frozen knoll
#

i did a test and it works

#

CO1 = "meow";
C02 = "meowmeow";
CO3 = "meow3";
_caller = CO1;
_units = [CO1,CO2,CO3];
if (_caller in _units) then {hintSilent "yes";};

grave stratus
#

i supposed that works, since you have declared all the COs in the script

#

but even for me, when i test _caller returns CO2

#

brain explodes!

#

๐Ÿ˜‚

#

maybe because there is no player playing the other CO slot?

#

because the error returns invalid expression on CO1, while im using CO2

#

yup i guess thats the problem

#

it shows up CO2 as an error while im playing as CO1

frozen knoll
#

yeh man if they arent they wont be verified ๐Ÿ˜‰

#

cracked it haha

grave stratus
#

so how do i go around this issue, i cant expect every CO to go online everytime ๐Ÿ˜ฉ

frozen knoll
#

check if objnull

grave stratus
#

reading objNull

frozen knoll
#

yeh man

grave stratus
#

Read it. i have no idea how to integrate this into the script ๐Ÿ˜…

frozen knoll
#

perhaps isNull

#

i will quickly write something that should work

grave stratus
#

i need to somehow remove the CO in _units array if the CO isNull correct?

frozen knoll
#

_units = [];
{
if !(isNull _x) then
{
_units pushBack _x;
};
} forEach [CO1,C02,C03];

#

should work

grave stratus
#

ah pushBack is used to put an element into an array

#

ill try it

#

does not work. undefines variable : CO1 and _x

winter rose
#

@grave stratus use strings, isNil and missionNamespace getVariable

wanton swallow
#

Is it possible in SQF to remove action which appear from CfgActions of vehicle?

winter rose
#

I don't think so, why? what usage @wanton swallow

grave stratus
#

@winter rose then its like this?

 _units = [];
{
    if !(isNil _x) then
    {
        _units pushBack _x;
    };
} forEach [missionNamespace getVariable CO1,missionNamespace getVariable C02,missionNamespace getVariable C03];
winter rose
#

have you checked the wiki for these commands?

#
private _units = [];
{
    if !(isNil _x) then
    {
        _units pushBack (missionNamespace getVariable _x);
    };
} forEach ["CO1", "C02", "C03"];```
#

also I just noticed, but you are using mixed CO and C0

#

C zero and C o

grave stratus
#
if ((isNil missionNamespace getVariable C01) || (isNil missionNamespace getVariable C02) || (isNil missionNamespace getVariable C02)) then { code; };

like this? i have read it, but couldnt figure out how to use it yet

#

in my script it is CO

winter rose
#

use my code โ†‘

grave stratus
#

oh

#

string

wanton swallow
#

Usage is to remove special action on plane

winter rose
#

@wanton swallow which one?

wanton swallow
#

From external mod

winter rose
#

if you don't give precise info, I can't give precise answer ยฏ_(ใƒ„)_/ยฏ

wanton swallow
#

What do you want to know? Mod name and plane class?

grave stratus
#

i dont think you can remove it tho, removeAllActions is for player added action right?

wanton swallow
#

Yes

winter rose
#

scripted actions
if it's a model action, I don't think you can

wanton swallow
#

This command dont work with actions from cfg

winter rose
#

yep

#

is it an action from config ?

wanton swallow
#

Yes

#

Why BIS didnt it

grave stratus
#

@winter rose thanks a lot. It works!. i've been stuck here for 3 days. Thanks to @frozen knoll too

#

@winter rose how do i point to the object if the object has not been named? for execVM

#

[this,"supply",200,50] execVM "Custom\suppliesInit.sqf";

winter rose
#

in an init field yes, but init fields are executed everytime a player connects

grave stratus
#

i am not sure how i can additem to the crate to the box,

winter rose
#

_myCrate addWeaponCargo/addMagazineCargo/addItemCargo stuff

grave stratus
#

yes supposed to be

winter rose
#

then? name your crate

grave stratus
#

but it does not adding item

#

because there is a lot of crate

#

i didnt name all the crate

winter rose
#

no, because of this:

_boxtarget = _this select 0;
_box_type = _this select 0;
_amount = _this select 1;
_amount2 = _this select 2;```
#

use params

grave stratus
#

ive been reading params

winter rose
#
_boxtarget = _this select 0;
_box_type = _this select 0;```
#

โ€ฆnothing wrong? โ†‘

grave stratus
#

its wrong

#

_box_type = _this select 1;

winter rose
#
params [
    "_boxTarget",
    "_boxType",
    "_amount1",
    "_amount2"
];```
grave stratus
#

i was testing it i forgot to change it back again

#

so i need to use this at the crate init?

#

or in the script?

winter rose
#

โ€ฆin the script

#

instead of all your select

grave stratus
#

so it would return the same thing?

winter rose
#

I renamed boxType and amount1

grave stratus
#

what i dont understand is the difference between using this select and params

winter rose
#

params doesn't make the kind of mistakes you did, it's more legible, and it can also filter argument types

grave stratus
#

ah

#

so in the init of the crate this is fine?

[this,"supply",200,50] execVM "Custom\suppliesInit.sqf";
winter rose
#

check with if isServer

#

you don't want the crate to add more mags everytime a player connects

grave stratus
#

error clearWeaponCargo. type string expected object

#

it should be

params [_boxTarget,"_boxType","_amount1","_amount2"];

is it?

#

after changing it, it return error undefined variable

#

or am i doint it wrong?

winter rose
#

I said I did rename your param variables, if you didn't rename them in the script then it won't work obviously

grave stratus
#

yes i have renamed all of the variables.

#

stil shows up error, type string, expected object

#

the error is on _boxTarget

winter rose
#

yes, because sqf params [_boxTarget,"_boxType","_amount1","_amount2"];is wrong

grave stratus
#
[this,"supply",200,50] call {
    params [_boxTarget,"_boxType","_amount1","_amount2"];
    //everything else here?
};
#

like this?

#

or

[] call {
    params [_boxTarget,"_boxType","_amount1","_amount2"];
    //everything else here?
};
wraith cloud
#

You're missing quotes

grave stratus
#

I have tried it with quotes, same thing. It return as string, not object before the 2 codes above

winter rose
#

And how do you call it?

grave stratus
#

using execVM

winter rose
#
[this,"supply", 200, 50] call {
    params ["_boxTarget", "_boxType", "_amount1", "_amount2"];
    // everything else here?
};``` works, period
grave stratus
#
if (isServer) then { 
    [this,"supply",200,50] execVM "Custom\suppliesInit.sqf";
};
#

in the crate init

winter rose
#

yes?

grave stratus
#
[this,"supply", 200, 50] call {
    params ["_boxTarget", "_boxType", "_amount1", "_amount2"];
    // everything else here?
};

and this in the script?
i havent tested this since i went outside for abit and just got back,

winter rose
#

no.

#
params ["_boxTarget", "_boxType", "_amount1", "_amount2"];```that's it
#

why would you double your arguments.

grave stratus
#

Hmm i've tried putting in just that. _boxTarget returned string, not object

winter rose
#

k

#

the init is good, don't touch itsqf if (isServer) then { [this, "supply", 200, 50] execVM "Custom\suppliesInit.sqf"; };

grave stratus
winter rose
#

your switch-case is wrong

#

no { } around your _fnc

#

it's already code

grave stratus
#
switch (_boxType) do {
    
    case "supply": {
        {_fnc_supply};
    };    

it should be like this? Dedmen was the one who teach me this code

#

it is working fine in my script reset the crate using addAction

winter rose
#
switch (_boxType) do {    
    case "supply": _fnc_supply;
};```
grave stratus
#

ah misread your text

#

missed the word no there

#

my bad

#

fixed the switch-do, still _boxTarget returns string, not object

winter rose
#

how do you know? what is the error message?

grave stratus
tame stream
#

Hi im trying to make it so players can abuse ACE cargo with my liberation server, according to ACE API this code should be used sqf [item, -1] call ace_cargo_fnc_setSize; to make item unloadable but i have no idea how to implement it in my mission, any suggestion?

winter rose
#

@grave stratus well somewhere you are calling it with string

#

maybe not this init especially

#

the script is fine.

grave stratus
#

|#|clearWeaponCargo _boxTarget;
error clearweaponcargo: Type String, expected object

#

the init is also fine right?

#

hmm

#

it should return this right?

#

isnt it supposed to be local to the object?

winter rose
#

is the crate the only place you call this script though

grave stratus
#

yes

#

but there is another code in the crate

#

to reset the items inside using addaction

#
if (isServer) then {
     [this,"supply",200,50] execVM "Custom\suppliesInit.sqf";
};

this addACtion ["<t color='#FF0000'>Reset Box</t>","Custom\suppliesReset.sqf",["reset",200,50,"supply"],2,false,true,"",""];
#

the other script also use similar _variable name

#

shouldnt it works with multiple crates calling it tho?

grave stratus
#

ok i found the problem

#

there is 1 more crate that calls it without proper arguments in [] of execVM

#

now it works fine

#

thanks @winter rose

winter rose
#

what a ride, but hey, we got it working!

late wolf
#

Hey all, just a random one. I am trying to use the fire script for an AI unit "topgunner" it is on a MWMIH 50 cal gunner. But I cant seem to get him to fire.

grave stratus
#

thanks a lot @winter rose . i have learn a lot by writing this script

reef walrus
#
winter rose
#

ooooooh

#

arg
requirements: CBA_A3

๐Ÿ˜ข

errant jasper
#

A quick search on the repos, it looks like it only uses CBA_fnc_addPerFrameHandler and CBA_fnc_waitAndExecute so you could just define those functions without using all of CBA.

#

And looking at the code, you don't need the per-frame quality that CBA offers for those functions, so the substitute implementation can be quite simple

exotic flax
#

on the other end, 99% of the mods use CBA nowadays, so the moment it's not 100% vanilla this should work perfectly fine

west grove
#

hmm question. i have a box with uav backpacks. i want to give each uav a unique name

#

is that possible?

#

i dont even know how to "get" the uav object.. inside the uav backpack... inside the box

#

i know that i can get the backpacks via backpackCargo

carmine maple
#

until you assembled the drone once there is no "uav" object.
You can use an Event handler to get the assembled object (Drone)

west grove
#

hm ok. so i guess i will have to count them this way then

grim coyote
#

Does anyone know if it is known that addWeaponWithAttachmentsCargo and global are not working properly? By that i mean that if you add one weapon with 50% magazine full, and then same kind of weapon with different amount it will stack those 2 with same amount of bullets left.

#

Not sure if it will do the same with attachments

#

Maybe someone can report it if its not done yet. But myself I wasn't able to find it

steady terrace
#

I'm trying to get the zombie double-tap to the head mechanic working. I looked at this guide

https://forums.bohemia.net/forums/topic/108931-handledamage-eh-explained-poor-mans-gethit/

but I can't seem to make it work. in fact the handleDamage eventhandler doesn't seem to work at all..

I'm trying to make sure that A) headshots don't kill(I count hits and do stuff with that)
B) I can detect if a shot was a headshot, reliably

I tried using allowdamage false, but that confuses the MPHit eventhandler.

any tips?

young current
#

theres probably no damage to handle if allowDamage is false

winter rose
steady terrace
#

thank you @winter rose ! I ended up using the hitPart event handler, which does what I want!

queen cargo
#

Just in case somebody is bored:

#
<Grid xmlns="https://schema.x39.io/arma/uxf">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="2*"/>
        <ColumnDefinition Width="123"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="2*"/>
        <RowDefinition Height="123"/>
    </Grid.RowDefinitions>
    <TextBlock Text="Example" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
</Grid>```
need this parsed into
#
[
    [["https://schema.x39.io/arma/uxf", "Grid"], [], [
        ["https://schema.x39.io/arma/uxf", "Grid.ColumnDefinitions", [], [
            [["https://schema.x39.io/arma/uxf", "ColumnDefinition"], [[["https://schema.x39.io/arma/uxf", "Width"], "Auto"]], []],
            [["https://schema.x39.io/arma/uxf", "ColumnDefinition"], [[["https://schema.x39.io/arma/uxf", "Width"], "*"]], []],
            [["https://schema.x39.io/arma/uxf", "ColumnDefinition"], [[["https://schema.x39.io/arma/uxf", "Width"], "2*"]], []],
            [["https://schema.x39.io/arma/uxf", "ColumnDefinition"], [[["https://schema.x39.io/arma/uxf", "Width"], "123"]], []],
        ]],
        [["https://schema.x39.io/arma/uxf", "Grid.RowDefinitions"], [], [
            [["https://schema.x39.io/arma/uxf", "RowDefinition"], [[["https://schema.x39.io/arma/uxf", "Height"], "Auto"]], []],
            [["https://schema.x39.io/arma/uxf", "RowDefinition"], [[["https://schema.x39.io/arma/uxf", "Height"], "*"]], []],
            [["https://schema.x39.io/arma/uxf", "RowDefinition"], [[["https://schema.x39.io/arma/uxf", "Height"], "2*"]], []],
            [["https://schema.x39.io/arma/uxf", "RowDefinition"], [[["https://schema.x39.io/arma/uxf", "Height"], "123"]], []],
        ]],
        [["https://schema.x39.io/arma/uxf", "TextBlock "], [
            [["https://schema.x39.io/arma/uxf", "Text", "Example"],
            [["https://schema.x39.io/arma/uxf", "Grid.Row"], "1"], 
            [["https://schema.x39.io/arma/uxf", "Grid.Column"], "2"], 
            [["https://schema.x39.io/arma/uxf", "Grid.ColumnSpan"], "2"],
            [["https://schema.x39.io/arma/uxf", "Grid.RowSpan"], "2"]
        ], []]
    ]]
]``` into this
exotic flax
#

that array looks more complicated than the XML ๐Ÿ˜ฎ

#

and why the schema definitions? Wouldn't it make more sense to have that separated (and only once)?

queen cargo
#

Theoretically, yes

#

Practically however, the XML parser is supposed to be generic

#

And having the namespaces in there is more practical then providing a full lookup table for each node just to allow proper Support for xmlns

#

(as you can xmlns on every node you want theoretically)

#

Plus the array is fairly simple ๐Ÿ˜‚

#
NAME = ["namespaces", "Name"]
NODES = [NAME, [ATTRIBUTES], [NODES]]
ATTRIBUTES = [NAME, "Value"]```
#

Is the basic idea behind it

exotic flax
#

but if you want to namespace an element it has to be in the XML anyway, so it would show up as an attribute anyway ๐Ÿ˜‰

#

just my 2 cents though

queen cargo
#

not sure what you mean by that

still forum
#

it should be like this? Dedmen was the one who teach me this code
@grave stratus
No not at all. Don't take my idea, then mangle and break it to unusability and then say it came from me dude.
@grim coyote
Does anyone know if it is known that addWeaponWithAttachmentsCargo and global are not working properly?
I made that command. Can you reproduce that? can you send me script to reproduce it?
It's mooooost likely engine bug that "cannot" be fixed anymore, the command implementation itself is fairly error safe.

winter rose
#

No wonder the command is broken if you can't write a simple switch-case ๐Ÿ˜„

grim coyote
#

I cant reproduce it because I dont have arma installed. But maybe someone else can?

still forum
#

Lol wtf. Who edited the aWWACG wiki page.
cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", $DEAD], ["3Rnd_HE_Grenade_shell", $DEAD], ""], 5]

$DEAD?? wat

winter rose
#

KK? ยฏ_(ใƒ„)_/ยฏ

still forum
#

So @grim coyote you mean something like this:

//add mx with half full mag
cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "", "", "", ["30Rnd_65x39_caseless_mag", 15], [], ""]];
//add mx with 2 bullets in mag
cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "", "", "", ["30Rnd_65x39_caseless_mag", 2], [], ""]];

will end up with 2 MXs with half full mag each?

grim coyote
#

Yes

#

Didnt test if thats the case for ugl

#

Nor attachments

winter rose
#

@still forum error 1 element provided, 2 expected

still forum
#

I thought count was optional

winter rose
#

ah yep good call

grim coyote
#

Also Im not sure if the magazine type matters

#

Tracer or not...

still forum
#

ugh its not. It was designed to be. Darn you KK and your changes

#

there is no reason to have to always provide "1" as count

winter rose
#

actually, the command stacks the two guns on top of each other, but you will take the one with the more ammo first I think

still forum
#

Even in the example
{ cursorObject addWeaponWithAttachmentsCargoGlobal [_x, 1] } forEach weaponsItems player;
look at that crap, so bad

grim coyote
#

Haha

#

Same with magazine

#

If nil then full

winter rose
#

ah, no, just in the order they were introduced

#

could not reproduce in Vanilla

grim coyote
#

I saw this when the patch came

still forum
#

If ammocount is not a number, it should skip the setAmmo and leave the magazine at default, meaning full.

grim coyote
#

And ni it was not a dev build

#

That exolains the $DEAD

winter rose
#

I somehow tried to put $DEAD and it didn't work, unfancy

still forum
#

Quite sure $ would cause syntax error

winter rose
#

yeah I think so too ๐Ÿ˜„

still forum
#

ah bummer, I can't test. Mouse control via Teamviewer doesn't work that well

winter rose
#

ah, the famous "look down" stuff!

tough abyss
#

I somehow tried to put $DEAD and it didn't work, unfancy
Why not? It is legit hexadecimal notation

#

If you state ammo exceeding mag capacity it will fill it to full capacity

still forum
#

It is legit hexadecimal notation
wat

winter rose
#

you can use $AA as hexa in sqf?

#

@tough abyss ๐Ÿ‘€

still forum
#

I have never ever seen that anywhere

#

thus I don't think its a good idea to use such a obscure thing in a example

tough abyss
#

$DEAD == 57005 which will exceed any current mag capacity thus filling any mag in full.

#

Which brings me to the question, why it didnโ€™t work for you, did you get error or example didnโ€™t do what it said? @winter rose

winter rose
#

I didn't try it, obviously

tough abyss
#

Says you fixed it

winter rose
#

wat

#

if you didn't get it from

you can use $AA as hexa in sqf?
I wasn't aware of this $ hexa syntax in SQF.

Now as Dedmen stated,

I don't think its a good idea to use such a obscure thing in a example
so let's not use $DEAD that is both obscure and not adapted to an easily legible example.

still forum
#

0x000 notation is the standard in most languages.
So why use $ ever?
Also just a uncommented use DEAD and itll give you a full magazine is a total "wtf"

#

We don't need a "look I can write HEX numbers in a obscure syntax to make this command do a thing that you don't understand" on the wiki.
We need a "if you use a number higher than the maximum capacity of the magazine, you will get a full magazine"

winter rose
#

ditto.

tough abyss
#

You just mad you canโ€™t write Dedmen in hex

still forum
#

Comment says a full 30 round magazine
If you tell users that providing $DEAD as ammo count will give you a 30 round magazine they'll be confused as heck. And maybe copy paste that stuff and wonder "wtf? why is this not giving me 30"

winter rose
#

0xCAFE works for ๐Ÿ‡ซ๐Ÿ‡ท โ˜•

astral dawn
#

Half will be confused, the other half will take it as granted assuming it's some magic number for arma engine, because it can

tough abyss
#

$CAFE == 51966

#

$C0FFEE

astral dawn
#

80085 when all you have is a calculator

winter rose
#

8008135!

queen cargo
#

@still forum you did not knew that? iirc we talked about this once jj_think

#

think it was something related to the regex

#

chances are thus that you just cannot remember

still forum
#

know*

queen cargo
#

still

#

SQF-VM has supported that too for "ages" now

#

IIRC, the C variant also already had support for those hexadigits

still forum
#

well who cares if noone uses it ๐Ÿค”

ivory lake
#

good way to confuse the hell out of someone trying to RE your script

queen cargo
#

unless ... you use SQF-VM anyways ๐Ÿ˜›

#

as you then just can pretty-print everything ๐Ÿ˜‰

tame stream
#

Need so help on how to implement ACE features on dynamically spawned items, im trying to get [ItemName, -1] call ace_cargo_fnc_setSize; to be applied to dynamically spawn resources so players are cant load resources into ACE cargo.

Any suggestions, ACE wiki does not detail how to apply codes only what they are (as far as i can see)

still forum
#

what is your problem with that?

#

just execute that function on the object that you want

tame stream
#

implementation on dynamically items

#

using item init is not a option

still forum
#

Yes you already said that

#

what's the problem with that?

tame stream
#

so how can i apply the code as soon as the item is spawned or do i have it backwards ?

#

ill have a look

still forum
#

you can't do it before the object is spawned

#

you can do it any time after it was spawned

tame stream
#

i assumed as much...item is spawned, detected then code i applied. Im looking at the link you send

queen cargo
hollow thistle
#
["TargetClassName", "InitPost", {
    params ["_object"];
    [_object, -1] call ace_cargo_fnc_setSize;
}, 
    true, // allow inheritance
    [],     // excluded classes
    true  // apply retroactively
] call CBA_fnc_addClassEventHandler;
```\
tame stream
#

oo ill have a look thx

hollow thistle
#

or smth like that, can't verify right now.

#

edit: changed to InitPost should be safer for that usecase.

errant jasper
#

@queen cargo XML? Is there an actual use case? I wrote a JSON parser long time ago. And performance wise, on a blank server you can read 10,000 chars per second, but only half that on an "embattled" server... Even with improved structure and newer commands , given the complexities of XML it seems like one of those things that really need an extension DLL instead?

queen cargo
#

there is no need for CDATA support generally

#

full-validation also is not supposed to be available for the parser

#

generally speaking, i need it for simple formatting reasons

#

aka: no serialization format but rather some application format

#

with XML being just the basic app layer, and after parsing it, magic then happening

errant jasper
#

yeah, if you stick to only the real basic I can see it working out

still forum
#

YAML ๐Ÿšถ

winter rose
#

ini file!

still forum
#

no

#

no multilevel structure

winter rose
#

HTML3!

still forum
#

That's XML tho (basically)

finite dirge
#

tdv! That's what we really need.

errant jasper
#

I mean, if you can choose the input format then the answer is obviously stringified sqf arrays.

winter rose
#

XML to JSON then arma's JSON parsing, I think you would lose less time maybe

#

CSV \o/

errant jasper
#

Arma has JSON parsing?

queen cargo
#

that is the plan, full XML support is overkill for pretty much any usecase ...
However, using XML also allows to utilize schema-validation in eg. editors

the end-application then expects a valid XML file and ... thats it

tame stream
#

@still forum The following code [this, -1] call ace_cargo_fnc_setSize is obviously what i need to make it not be a loadable item, easily applying via eden if item is placed via editor. My problem is i dont know how to apply that code to this item CargoNet_01_barrels_F, for instance, when its not placed in editor say via zeus or game mechanic in existing game mode.

How do i get [CargoNet_01_barrels_F, -1] call ace_cargo_fnc_setSize to be applied as soon as game mode spawns the item or zeus places the item.

still forum
#

The answer is the CBA XEH handler that someone already linked you above

#

you cannot pass a classname to that function, only specific objects

tame stream
#

@hollow thistle linked me that...ok ill give it a go

dry inlet
#

@tame stream as mentioned in the KP discord, you could just use the liberation functions for that instead of some XEH

tame stream
#

yes i can but id like to know how for future missions thats not liberation

hollow thistle
#

How do i get [CargoNet_01_barrels_F, -1] call ace_cargo_fnc_setSize to be applied as soon as game mode spawns the item or zeus places the item.
I've litteraly told you that... ["TargetClassName", "InitPost", {

tame stream
#

thx im checking your method now

tough abyss
#

Arma has JSON parsing
Yes, but not available to the end user

fleet sand
#

i have a question how to add ace interaction on all wrecks this is my try but it adds ace interaction on all exept wrecks _action = ["LoadInTo", "Load Wreck", "", {hint "test"}, {true}] call ace_interact_menu_fnc_createAction; ["All", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;

peak hound
#

I want to mass create markers, I have a list of positions, what is the easiest way to do it?

queen cargo
#

Createmarker?

peak hound
#

Never mind sorted it

#

Was in mong mode haha

dreamy kestrel
#

Is there a way to log the line number when reporting to diag_log?

verbal saddle
dreamy kestrel
#

perfect thank you

#

as macro expansions go, if I have a macro wrapping a function call and one parameter is the line number, I can do this, FNC_MYFUNC(_x, _a, _b), where that expands into [_x, __LINE__, _a, _b] call _fnc_myFunc ? how does the macro expansion respond to complex macro inputs?

#

in our case, such as callback functions, etc

grave stratus
#

it wont read execute _fnc_coreCargo;. it just goes through it without an error

grave stratus
#

i have solved it by directly execute it below the params line instead of using _fnc_coreCargo. But i still wanted to know why it fails tho

still forum
#

It doesn't execute it. Because you never ever tell it to execute

#

if you don't call it, it won't be called.

grave stratus
#

ahh ๐Ÿคฆ

#
switch (_boxType) do {
    
    case "supply": _fnc_supply;
        
    case "helmet":     _fnc_helmet;
    
    case "equip": _fnc_equip;
    
    case "medic": _fnc_medic;
    
};

how come the code you gave to me does not need call?

winter rose
#

I gave you

It is because of the switch structure that does it by itself @grave stratus

#

read the wiki, it's here for you ๐Ÿ˜˜ ๐Ÿ˜

grave stratus
#

@winter rose you and both @still forum gave me, the one with {} is the one that he gave me.

#

and what i am trying to is in switch too

#

okay i've read the wiki, understood

#

would it read the next code?

#
case "supply": _fnc_supply; _fnc_helmet;
 case "equip": _fnc_equip;
#

like this?

#

or a block

winter rose
#

case "something" :

โ˜๏ธ This takes a code block. Not two, not one in another, just one.

So if you have two code blocks, use ```sqf
case "blah" : {
call _code1;
call _code2;
} ;

grave stratus
#

ah thanks, i've thought of that after Dedmen tell me to call it

#

@thanks again @still forum and @winter rose

still forum
#

the one with {} is the one that he gave me.
we already were at this yesterday, not that was not what I gave you.

grave stratus
#

really? i remembered wrong then

still forum
#

The : operator in your switch/case, takes CODE type as right argument, the code which it will execute

#

it doesn't matter if you specify the code directly there using {}, or whether you just use the code that you previously stored in a variable

grave stratus
#

my bad

still forum
#

it will execute the code it's given.
But if you give it the code {_myvariable} instead, it will execute "_myvariable" as script, not the contents of your variable.
call is a command that takes CODE type as argument, and will execute the code you give it.
Exactly like the : operator in switch/case

grave stratus
#

ahh

#

okay now that clears things up

#

my understanding of variable is wrong

#

i thought, variable would return code even without call

winter rose
#

hopefully not ;-)

still forum
#

i thought, variable would return code even without call
Well.. that's correct

winter rose
#

the game doesn't "compile" it in the way that "wherever this variable is written, I will text-replace it with code"

still forum
#

a variable containing code, returns the code when you reference that variable

winter rose
#

it returns the code, but doesn't run it

grave stratus
#

but it would not run the code if i dont call it

#

yeah

still forum
#
call {
_code1;
} ;

This will end up like

call {
{ code contents }
}

The call will return the code contents as a return value

grave stratus
#

it acts like at statement instead of code right?

#

script

winter rose
#

Code is a variable type in itself

still forum
#

its just a value.

grave stratus
#

yes, thats what i meant

still forum
#

its like you'd write a script like

1;
2;
"string";
winter rose
#

it is like defining _var = 5, then just typing _var: it does nothing

still forum
#

as the variable (except the last value which will be returned from the script) is never used or stored, it just gets thrown away again