#arma3_scripting

1 messages · Page 130 of 1

grizzled cliff
#

yah

#

speaking of... im about to set my project to public on github because im just too excited about it

#

:D

#

then ima take a nap

#

because my head hurts

queen cargo
#

the SQF wrapper thingy?

grizzled cliff
#

yah

#

its pretty much done except for writing you know, hundreds of wrapper functions

#

haha

#

but a lot of those can be auto generated

queen cargo
#

maybe i will check it out

grizzled cliff
#

and macroized

deft zealot
#

i started that stuff with C#

queen cargo
#

...

#

definitly check it out when im done with this dota game

fair drum
#

Then in the group attributes panel by clicking the flag, post the code, but change units group player to units this

#

Sorry in and out of sleep lol, rough night

plush summit
#

Fellas, I have returned with a quick question - to remove addaction, I have put this in the item init

this addAction ["<t color='#880808'>Read the Liber Maleficarum</t>",{ [[],"chaos.sqf"] remoteExec ["BIS_fnc_execVM",[0,-2] select isDedicated,false]; }, [],1,false,true,"","_this distance _target < 2"];

I am wanting to remove the addaction for all clients once activated, would I need to do this in the chaos.sqf or can I do this on the item itself? Basically I am trying to activate this script for everyone on the server but have it done locally since its particals (if that makes sense sorry)

fair drum
#

You want it removed on all clients after one person executed it?

plush summit
#

Yes

#

So one person activates it - script plays for everyone but locally - then no one can use the addaction after someone already activated it

fair drum
#

Ok, let me hop on pc to type an explanation.

plush summit
#

Thanks mate

hallow mortar
#

BIS_fnc_execVM is outdated. You can just remoteExec execVM (or make the file into a function and remoteExec that)

fair drum
# plush summit Fellas, I have returned with a quick question - to remove addaction, I have put ...

Option one, (preferred) changing a variable so that the action won't show to anyone after one person executes it:

this addAction [
    "myAction",
    {
        [] remoteExec ["myLocalFunctionInsteadOfFile", [0, -2] select isDedicated];
        missionNamespace setVariable ["myFunctionActivated", true, true];
    },
    [], 1, false, true, "",
    toString {
        !(missionNamespace getVariable ["myFunctionActivated", false]) &&
        {_this distance _target < 2};
    }
];

Option two, save the actions handle on the object itself locally when you add the action, then grab it and remove it. This is because if you add actions in different ways for different clients, the action stack number will be different:

private _handle = this addAction [
    "myAction",
    {
        params ["_target", "_caller"];
        [] remoteExec ["myLocalFunctionInsteadOfFile", [0, -2] select isDedicated];
        [[_target], {
            params ["_target"];
            private _handle = _target getVariable ["myActionHandle", -1];
            _target removeAction _handle
        }] remoteExec ["call"]; // Or you make this section a file as well and remoteExec that instead
    },
    [], 1, false, true, "",
    toString {
        _this distance _target < 2;
    }
];
this setVariable ["myActionHandle", _handle];
grizzled cliff
plush summit
#

Thank you heaps mate, I am reading through and looking things up to make sure I understand it

fair drum
#

just start using the CfgFunction library when you need to start executing code for remoteExec instead of writing in line stuff

grizzled cliff
#

there is your chance! :)

fair drum
#

or if you are using CBA, their event system is preferred to using remoteExec all together

queen cargo
#

game is not over yet

#

30 mins

deft zealot
#

thanks

#

downloaded :P

oblique arrow
#

fyi it was that and the waituntil worked, thanku blobheart

queen cargo
#

forked

grizzled cliff
#

haha

plush summit
#

Im attempting to make Option one work for me

hallow mortar
grizzled cliff
#

lets see how fast this gets on unknowncheats lmao

hallow mortar
queen cargo
#

depends

fair drum
#

the two preferred methods are CfgFunctions for vanilla, and PREP in pre & post init for CBA

queen cargo
#

some here might post it

plush summit
#

I see, thank you for the explanation, I am using CBA so I yeah ill have to do it in a config.cpp located in the mission file, right? (I will use method 2 provided)

oblique arrow
queen cargo
#

but well ...

#

there was some sort of simmilar project up already

#

which i checked out last time i thought about writing an arma mod just in c/c++

#

so ...

#

nothing rly new ther

fair drum
grizzled cliff
#

yah, though this is intended to be stable and easily usable (and legitimate)

#

so i imagine it'll be fairly popular

queen cargo
#

all things can be used for both sides

deft zealot
#

if i have time i ll port it to C#

#

easier to read

queen cargo
#

no

#

only benefit is no mem

deft zealot
#

i dont want to start C' vs C/C++ discussion. But if it works in C' i ll do it.

#

C#

queen cargo
#

in theory you already did with saying easier to read in c#

#

but thats too ot

deft zealot
#

lets keep it in theory

merry python
#

Okay, i am having a minor problem
I am basically as Newb when it comes to arma scripting as you can get but I am attempting to make a custom ORBAT group (the ones from the east wind campaign) For a AAF remnants campaign im running

From what ive read i needed to make a custom missionconfigfile
which i attempted to do by making a Description.ext file in the mission root folder (which i believe is just the mission folder where you place img's for ops n such and where the sqm is). I then copied the example CfgOrbat slightly changed it to match a bit more to what my group is playing as.

Whenever i launch the mission file in singleplayer with These settings for the Orbat group module (first linked image) I get this error (second linked image)

#

I genuinly dont know whats causing this. Mainly because i dont know how to setup any of this in the first place

#

And to edit/make the "description.ext" file I renamed a Txt file to description.ext because on the Wiki it says you can bypass notpads automatic addition of the .txt extention by wrapping the name in quotes but i couldnt seem to get that to work

#

So i just made the file a .ext and then opened it in notepad

deft zealot
#

back to scripting:
fastest way to find minimun number in an array of numbers?

cosmic lichen
#

ceiling path is wrong

#

also, these classes don't exist in your description.ext

merry python
#

Ceiling path i just realised what was wrong there
but the classes are those the ones after the CFG orbat?

#

so would i change the "BIS" and "B_1_A_1_2"?

queen cargo
#

depends

#

is it pre-sorted at least a little?

#

or is it completly random?

#

because in second case you have to check every spot

cosmic lichen
#

missionConfigFile >> "CfgORBAT" >> "7thInfantry"

merry python
#

Okay, that got it working on the map
But the icon is invisible and there are no squads under it

Correct me if im wrong, but i believe the way to fix the squads would be a new Orbat group module, and creating a sub-class in the Description.ext file?

and it would be similar in look the the 1st BCT that is in there currently?

#

And removing all the helicopters from there would be removing all the assets from the asset page

deft zealot
#

not pre-sorted

queen cargo
#

check all

#

no other way

cosmic lichen
#

Pretty much yeah.

#

Does the wiki not have a decent example?

merry python
#

The wiki has basically what i have in my file but it doesnt really explain what any of it does or is and so ive been kinda winging it up until asking here

#

im starting to figure it out now though hopefully

merry python
#

or I may just be a muppet who fails at reading comprehension

merry python
cosmic lichen
#

I'll update that page with a working example.

queen cargo
#

however, if you know the minimum you can stop at the absolut minimum

grizzled cliff
#

C++11 is honestly like the best language out there in terms of hitting all the marks

#

14 is even better

#

and 17 is looking really good

#

seriously if you know the "right" way of doing things

#

you get all the benefits of a "managed" language with no speed drawbacks

queen cargo
#

well ... c++ not suits for every purpose

#

small applications for example benefit more from c#

#

as most stuff is already available in one of the default libraries

merry python
#

Okay, ive gotten everything working now
and gotten subbordinates working correctly

but whenever I'm in the orbat menu and click on a unit such as my Platoon HQ I get an error. I believe its an error trying to zoom onto the map marker but im not too sure.

on the same note as the map marker though is there a way to move the marker to a specific spot, or is it just stuck where the unit you attach the module to is?

deft zealot
grizzled cliff
#

as far as i can tell, no realistic one

queen cargo
#

at some point

#

you hit the "mem is full retard ..." point

cosmic lichen
#

Weird.

#

The marker will be were the module is. If changing the modules position also ch anges the marker position I don' t know.

grizzled cliff
willow hound
queen cargo
#

feel free to find it using this here eg.

_s = " ";
while {true} do {
     _s = _s + " ";
};```
#

as said @grizzled cliff
will check it out right now (dota done, won the game :3)

grizzled cliff
#

Intercept factory generated RStrings are currently limited to 2kb

merry python
#

Dang, hopefully since i local host all my ops i'll be the only one who gets the error and i can just tell my players "dont click on stuff in the orbat menu"

grizzled cliff
#

eventually will make it so they can dynamically allocate more

molten yacht
#

Anyone know which server property resets the mission to the default mission without giving people a chance to read the end screen / description?

#

It just needs like, 3 extra seconds.

willow hound
queen cargo
#

ouch
looks like a hell lot of work to put all 2k commands into that cpp file ...

merry python
#

Yeah, then i should be good

grizzled cliff
#

of course it will be broken up a bit

deft zealot
#

thought the same

grizzled cliff
#

and not all commands have to go in

#

and a lot can just be a macro

queen cargo
#

well XD
Nou now has the same problem like i have but at a different topic

grizzled cliff
#

cause they are all standardized

deft zealot
#

all math functions wont be needed either

queen cargo
#

yup

grizzled cliff
#

yah

grizzled vapor
queen cargo
#

in fact

#

only functions needed are those which interact with the world

grizzled cliff
#

and dialogs

#

and configs

queen cargo
#

not even + - * / etc. are needed

#

mimimi

#

you always have to drag the simplicity out right ...

grizzled cliff
#

yah no math operators, no arrays

deft zealot
#

what about callExtension ;)

grizzled cliff
#

technically i might keep it

hallow mortar
#

You could use fadeRadio to mute all incoming voice. There isn't really a way to do it per-channel though, other than removing the player from the channel (for custom channels only) or removing other players' ability to transmit.

grizzled cliff
#

i mean nothing stopping it from working lol

queen cargo
#

compile and call are more interesting
for test automatization

grizzled cliff
#

yah, those are going to stay in

coral pelican
#

Is there a way to make a player incognito to AI so that they could sneak past a checkpoint but if they draw their weapons then they will be shot at?

grizzled cliff
#

cause in ACRE2 i want to port some loops over to this, but they call dynamic functions in other pbos, and i want to keep those in SQF for now

#

so you can mix SQF and C++

#

pretty easily

granite sky
#

The usual approach is to use setCaptive so that enemies consider them civilian-side.

#

Making a unit invisible to AIs, or even making an AI blind is not really an option.

#

You need various event handlers or monitor functions to detect when the players should be detected and remove the setCaptive.

coral pelican
#

Okay. Thanks. Are trigger’s acceptable to detect that? Would I have to work out how to detect if the player has their weapon drawn?

merry python
#

atleast thats what ive just tested

candid sun
#

oh shit, ctrlCreate is news to me :D

#

thanks

#

a lot

queen cargo
#

was for many of us @candid sun

deft zealot
#

mcc save sqm is broken - nothin i didnt expect

grizzled cliff
#

now that we have C++ access, who is going to port Qt to Arma's UI system? :D

queen cargo
#

Qt?

jagged mica
#

Hi, Ive got a condition trying to make sure that player is currently wearing and using nightvision goggles. I'm checking for hmd player and also currentVisionMode != 0 but that condition is also true when player is operating a vehicle turret in full-screen (I assume using a night vision scope/binoculars is going to be the same). Is there a way to eliminate these two cases?

grizzled vapor
grizzled cliff
#

the GUI library

grizzled vapor
#

even with the player stuck in global they can hear the incoming vc ongoing in sidechannel(1)

hallow mortar
#

then perhaps setPlayerVoNVolume foreach allplayers

grizzled cliff
#

jk, its actually easier to just render it into the Arma pipeline

fair drum
grizzled cliff
#

jaynus had a demo of that

hallow mortar
grizzled vapor
grizzled cliff
#

was pretty cool

hallow mortar
grizzled vapor
#

thx for clarification should work then. Awesome! Thank you!

jagged mica
candid sun
#

roughly how would one "render it into the Arma pipeline"?

grizzled cliff
#

hook the directx functions

queen cargo
#

just one question is left

deft zealot
#

yep

queen cargo
#

interactions

#

mouse clicks etc.

#

its cool you can render it in

#

but if you cannot interact with it then it is rather useless

deft zealot
#

you can intercept interaction tpp

grizzled cliff
#

apparently you can

#

Qt recognizes the window space

#

and will take clicks and events

jagged mica
#

found it: for reference / anyone who's curious, cameraView == "GUNNER" is what I was looking for

grizzled cliff
#

and intercept them if they interact with its known coordinates

deft zealot
#

or hook wm messages

grizzled cliff
#

yah

#

i mean its basically how Steam Overlay works

#

or anything else

queen cargo
#

well ... never used Qt

grizzled cliff
#

yah, dont, its huge and horrible

#

BUT

#

its still the best cross platform GUI toolkit

#

hell KDE is written in it

#

or was

queen cargo
#

ye ... also not using KDE

#

^^

grizzled cliff
#

haha

#

ok, i need to take a nap, or ima have no time tonight that is productive

#

bbl

queen cargo
#

gn8

deft zealot
#

same here gn8

cobalt path
#

Is there a way to disable ai collision detection?
I have an aircraft (heli). I want to attach a large 3d object to it to make it seem like that large 3d object is flying.
Issue, heli just keeps flying up and up and up. Apparently AI thinks it needs to avoid that object or smth. Any way to make AI completely ignore that object?

granite sky
#

Possibly not without overriding the AI entirely.

cobalt path
granite sky
#

Nah, otherwise I could fix the stupid bridge bug.

#

Some vehicles can't cross bridges because the AI detects incoming collisions with the bridge supports. Similar issue.

#

Detecting collisions with attached objects makes even less sense and is likely wasting a ton of CPU, but there we go.

#

BI are terrified of their AI code and won't touch it :P

cobalt path
#

Damn thats a shame

#

I tried attaching heli to an object that is far away than attaching the large model to the object thats far away, doesnt seem to work either

distant egret
#

Depending on what you want to do, you could use flyInHeight

distant egret
#

Ah ok. Does it think the object is the ground then?

cobalt path
#

could be

#

Here, the moment object gets close, it starts increasing altitude, and continues to do so indefinitely

cobalt path
distant egret
cobalt path
distant egret
#

Yes but without rotors and stuff. Just basic XYZ movement like a box 😅. Similar to those Santa sleigh mods.

hallow mortar
#

The helicopter is there to provide aircraft-like motion to the object

cobalt path
hallow mortar
cobalt path
hallow mortar
#

then it is a mystery. AI doing AI things

granite sky
#

Geometry is a collision LOD, right

cobalt path
cobalt path
granite sky
#

Geometry PhysX? That means collisions would be done with PhysX instead, but Arma has multiple physics/collision systems.

#

Could you try using an empty geometry LOD, or is that disallowed?

#

Not sure if that's an acceptable solution but it'd be an interesting test at least.

cobalt path
#

So what do you mean, just delete the geometry and leave the "1"?

granite sky
#

You should ask a modeller really.

cobalt path
#

copy that

candid sun
#

@deft zealot did you write that function you pastebin'd?

coarse dragon
#

is there a script to turn on beacon lights only for cop cars ect?

fair drum
plush summit
#

Quick question re BIS_fnc_replaceWithSimpleObject, I read on the wiki that it shouldn't be used in multiplayer, I just wanted to know why it shouldn't be?

Additionally, I saw I can use createSimpleObject, would I put this code in the init of the mission file or would I do this on the object init? Thanks!

plush summit
warm hedge
#

units group this -> units this

light fox
#

What's the rationale/advantage of an extension DLL from that of a text sqf script? Can all the script statements in an sqf be also possible in a C++ dll in a faster way?

rain dirge
#

dlls best for interactions with external software. I would hazard a guess that no it's not possible for ALL the script statements to be faster as there are bound to be engine functions that will always be faster in the sqf than in something external. In fact my guess would be that there are very few things that sqf can do that a dll would be faster at. That said I don't know specifics. I know that things like pythia have been used to implement scripts like those in the Frontline mod. I am going to again take a shot in the dark and say that is likely because the computation was easier or more efficient to implement in python and it's libraries than in sfq.

cosmic lichen
#

I use Pythia for example to get access to the file system which sqf can't (for good reason).

rain dirge
cosmic lichen
#

Creating missing.sqm backups on eden editor auto saves and manual ones.

rain dirge
#

Oh interesting. Never would have thought about that.

fair drum
#

@meager granite speaking of using externals, what do you use to save player stats to external server without mod dependency (That's at least what I think you do)? How could I go about getting started for use in my own projects?

meager granite
#

the other way around when player joins, server requests stats from hive, sends them to player

fair drum
#

So client -> arma server -> external server (hive)

I'll try to mess around with something. I'll try in c# unless there is a superior choice.

meager granite
#

Yes

#

If you don't care about global stats, just save locally somewhere through extension

#

use local sql server or something like that

fair drum
meager granite
#

And missionProfileNamespace

#

you can use that as easy storage

fair drum
#

I guess I could do that. And if it becomes popular enough to have global stats, then I'll mess with an extension

meager granite
#

you have to send entire namespace each time though, which can get troublesome if you have lots of data

#

serialization takes a long time

fair drum
#

Referring to the global extension, or the profilenamespaces?

meager granite
#

profile namespace

#

with extensions you can only save needed piece of data, namespaces are saved whole

small gyro
#

If player is in vehicle how to get his turret current optic and optic mode ?
getTurretOpticsMode could help to understand which optic he using right now, but how to find out is it NV or TI or normal?

kindred zephyr
#

I believe there is a command for vision mode

#
vehicle currentVisionMode turretPath;
#

this one

small gyro
#

Much appreciate !

kindred zephyr
half inlet
#

I need an expert - my mission has these random hiccups that I'm trying to investigate using diag_captureSlowFrame. However upon closer inspection, I'm noticing there are gaps in the profiling tree (~50ms and ~60ms respectively, which is a lot). What could be causing this?

#

(fwiw, I'm on dev build 2.17.151510)

sharp grotto
half inlet
#

hmm, I don't think that's what I'm experiencing - I do have 4 AI units (each sat in a vehicle driver seat, not driving), but no corpses

sharp grotto
still forum
#

Epe is physics yeah

meager granite
#

Physx scene init something-something?

half inlet
still forum
#

probably not

sullen sigil
#

try and make it crash then get the mdmp 😄

still forum
#

no

molten yacht
#

Is there some way to run createSimpleObject on, say, a rock that just recreates the same rock in the same position and rotation but at a different scale

#

and if I do that, will AI walk through the rock?

#

I was reading createSimpleObject's wiki page and it says Supported features include collision, texturing, animation, penetration, AI spotting occlusion, and surface specific sounds (like footsteps). Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls),

plush summit
#
[book, ["book", 1000, 1] ] remoteExec ["say3D"];

Trying to play this audio in a script - when executing globally the audio plays multiple times for each player that is on the server, for some reason? Not sure what im doing wrong here.

cosmic lichen
#

Exec globally?

#

remoteExec already makes it global.

plush summit
#

Thats what I mean

#

Im using execVM "chaos.sqf" - to execute the script, would this be the issue?

fair drum
#

post everything, and I mean everything related to this and where you are calling each thing

#

use pastebin

plush summit
fair drum
#

Yeah so you are already executing chaos globally which means you don't need to remote exec that say3d command

#

Everything inside of chaos is local because chaos was called globally before.

#

Basically what you have right now is every client telling every client to play that sound. And it stacks.

plush summit
#

I see, that might be the issue, so I should instead do

book say3D ["book", 500, 1, 0, 0, true];
fair drum
#

Yes

plush summit
#

Ill give that a try, I appreciate your help Hypoxic

fair drum
#

For all of the say3ds inside of chaos

#

Not just that one

plush summit
#

That worked like a charm, fuck me I was overthinking something so simple

#

Thought I had to do so much just for that simple command

vast zodiac
#

Quick question, I'm using a trigger to summon the hide terrain module, the code I have currently is

sqf [11355.474, 5513.634, 1.896] call BIS_fnc_moduleHideTerrainObjects;

in a trigger set to activate on radio alpha. when I use it, it throws up this error message:

File A3\Modules_F\Environment\HideTerainObjects\init.sqf..., line 15

Private _mode = |#|param [0,"",[""]];
private _input = para...'
Error Type Number, expected String.

I assume this means that the code expects the location data in the last set of square brackets, making the correct code

sqf [0, " ", [11355.474, 5513.634, 1.896]] call BIS_fnc_moduleHideTerrainObjects;

Is this correct? Or will this cause issues

hallow mortar
#

That's showing you a piece of the internal code of the function, which is where the error occurred.
The function is trying to interpret the parameters passed to it by using the param command. It's trying to define its internal variable _mode as the contents of the first (0-index) parameter in the array of parameters passed to it, and it expects that parameter to be a string.
https://community.bistudio.com/wiki/param
If you look at the function's code in the Function Viewer (Tools > Function Viewer), you can see that it wants a "string" as parameter 0, and an [array, of, things] as parameter 1. Parameter 1's element 0 is expected to be the module object, then there's some other information in the other elements of parameter 1.

#

It looks like the function can be called with several modes, depending on what's happening to the module (e.g. Editor attributes changed, mission init, etc) and the expected parameters can change based on that. Also, some of the important information is stored as variables on the module object itself.

#

It's a complex function, and it seems to be pretty specifically designed to work with the module. Trying to use it independently might be a pain.

vast zodiac
hallow mortar
#

I don't think the affected area is updated if the module is moved after mission start. It looks like a one-and-done.

vast zodiac
#

Shoot. I'm trying to hide a baked asset on a trigger activation, looks like I might just have to use the zeus module

#

Thanks for the help

hallow mortar
#

The module isn't the only way to do this. Fundamentally, it's just an Editor-convenient interface. Everything it does uses script commands which are also available to you.

#

The important ones are nearestTerrainObjects, hideObject/Global, allowDamage, and inAreaArray.

#

(and forEach)

#

For example, you could do this:

private _nearTerrainObjects = nearestTerrainObjects [thisTrigger, ["HOUSE"], 100]
{
  [_x,true] remoteExec ["hideObjectGlobal",2];
  [_x,false] remoteExec ["allowDamage",0,true];
} forEach _nearTerrainObjects;```
vast zodiac
hallow mortar
#

Is there a convenient way to make an AI unit face in a certain direction, with its whole body, using normal turning animations? lookAt and doWatch only control the head (unless the target is outside of head arc), and setDir gives an obvious snap.

winter rose
limber panther
#

Hello everyone!
I would like to create something new but i got stuck on one thing. When i use sqf object1 attachTo [object2, [0, 0, 0]]; i can define the coordinates where the object should be fixed relative to the object it is being fixed to. I also know i can use ```sqf
object1 setVectorDirAndUp [[0,1,0],[0,0,1]];

While in game, i get two objects close to each other (for example i bring an ammo crate near a vehicle) and now i want to use `attachTo` to attach the ammo box to the vehicle. But i need it to be attached in that specific place it is currently positioned. Therefore i don't know the coordinates in advance but i need to somehow obtain them from the current position of those objects. Any suggestions how can i do this?
hallow mortar
hallow mortar
# limber panther Hello everyone! I would like to create something new but i got stuck on one thin...

You can use worldToModel and vectorWorldToModel to convert the object's initial position and orientation into coordinates relative to the parent object.
Or, you can use BIS_fnc_attachToRelative, which does the calculations for you. However, BIS_fnc_attachToRelative doesn't give access to some of attachTo's advanced features, like attaching to bones, so if you need that then you'll have to get and convert the data yourself.

limber panther
# hallow mortar You can use `worldToModel` and `vectorWorldToModel` to convert the object's init...

I want to try to create something like a boot for a vehicle. My idea was to spawn a noticeboard, give that a texture so the noticeboard will be displaying like this vehicle has been immobilized or something like that and then use attachTo to attach the nearest vehicle to the noticeboard. This way the vehicle can still be accessed, players can get in, open inventory, even start the engine or turn on light, but won't be able to drive it away. I find this approach better than my original idea where i was thinking about giving the vehicle a certain damage.

limber panther
#

But can i use detach after applying BIS_fnc_attachToRelative ?

hallow mortar
#

Yes. Like all functions, BIS_fnc_attachToRelative is composed of commands. Internally, it uses the same commands you would have, to determine the relative position and then attach the object. So internally, it uses attachTo, so you can detach the things it attached.

meager granite
#

So, when you crash a helicopter you can get 3 different outcomes in terms of damage source (HandleDamage and Killed).

  1. EPE damage: No damage source
  2. Crash damage: Source = Pilot
  3. Crash damage: Source = Heli itself
#

Apparently there is some kind of race condition between classic helicopter crash logic (pre A3) which instakills you VS physx collision damage

#

I guess this is why you can randomly survive crashes into buildings/ground/trees/water with little to no damage?

meager granite
# meager granite So, when you crash a helicopter you can get 3 different outcomes in terms of dam...
EPE/PhysX crash death (source=null)
 9:23:40 =========================================================
 9:23:40 "Frame 404619: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=true)"
 9:23:40 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","",23.781,"<NULL-object> ()","",-1,"<NULL-object> ()","",true]
 9:23:40 ---------------------------------------------------------
 9:23:40 "Frame 404619: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=false)"
 9:23:40 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","fuel_hit",103.463,"<NULL-object> ()","",1,"<NULL-object> ()","hitfuel",true]
 9:23:40 ---------------------------------------------------------
 9:23:40 "Frame 404619: Killed Both: B_Heli_Transport_03_F"
 9:23:40 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","<NULL-object> ()","<NULL-object> ()",true]

Engine crash with pilot (source=pilot)
 9:30:12 =========================================================
 9:30:12 "Frame 460568: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=true)"
 9:30:12 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","",234.677,"B Alpha 1-2:1 (Sa-Matra) (B_Soldier_F)","",-1,"<NULL-object> ()","",false]
 9:30:12 ---------------------------------------------------------
 9:30:12 "Frame 460568: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=false)"
 9:30:12 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","fuel_hit",1132.07,"B Alpha 1-2:1 (Sa-Matra) (B_Soldier_F)","",1,"<NULL-object> ()","hitfuel",false]
 9:30:12 ---------------------------------------------------------
 9:30:12 "Frame 460568: Killed Both: B_Heli_Transport_03_F"
 9:30:12 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","B Alpha 1-2:1 (Sa-Matra) (B_Soldier_F)","<NULL-object> ()",true]

Engine crash with no pilot (source=itself)
 9:32:15 =========================================================
 9:32:15 "Frame 476963: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=true)"
 9:32:15 ["B Alpha 1-2:2 (B_Heli_Transport_03_F)","",275.244,"B Alpha 1-2:2 (B_Heli_Transport_03_F)","",-1,"<NULL-object> ()","",false]
 9:32:15 ---------------------------------------------------------
 9:32:15 "Frame 476963: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=false)"
 9:32:15 ["B Alpha 1-2:2 (B_Heli_Transport_03_F)","fuel_hit",1324.12,"B Alpha 1-2:2 (B_Heli_Transport_03_F)","",1,"<NULL-object> ()","hitfuel",false]
 9:32:15 ---------------------------------------------------------
 9:32:15 "Frame 476963: Killed Both: B_Heli_Transport_03_F"
 9:32:15 ["B Alpha 1-2:2 (B_Heli_Transport_03_F)","B Alpha 1-2:2 (B_Heli_Transport_03_F)","<NULL-object> ()",true]
#

All this is done by vehicle player setVelocity [0,0,-100] from "FLY" spawned helicopter into dried lake flat ground

#

This is also why players crashing helis\planes score is so random, you can end up with pilot being credited for teamkills of the crew but then sometimes everyone just dies (was killed)

#

tl;dr; a complete mess

#

What's curious is that non-EPE damage does on average x10 more damage than EPE damage

#

23.781 vs 234.677 vs 275.244

fair drum
#

@meager granite im curious why you've been so focused on handle damage for the past few months. what are you working on?

meager granite
#

I just want to properly attribute players for the damage they make and be able to tell a story of what happened

#

Already have some cool stuff like chain damage attribution, including full info to show in the kill feed

#

Damaging a helicopter and having a pilot jump out still attributes the kill to AA shot

#

And most importantly having all this MP-compatible

wind hedge
hallow mortar
#

Am I going insane, or is this [orange sphere] not anywhere near where you'd expect either of the display_* selections on this terminal to be? Trying to figure out if this is a model problem or a me problem (RuggedTerminal_01_communications_hub_F)

{
  private _proxy = "Land_InvisibleBarrier_F" createVehicleLocal (_terminal modelToWorld (_terminal selectionPosition _x));
  private _proxyProxy = "Sign_Sphere200cm_F" createVehicleLocal getPosATL _proxy;
} forEach ["display_1","display_2"];```
#

I'm pretty sure those selections are used for stuff in the model animations, so I kinda expected them to be....near the displays

meager granite
#

Do a setPos after creation

hallow mortar
#

I'll test, but I've been using createVehicleLocal to do particle sources and stuff and they always get created precisely regardless of collision 🤔

meager granite
#

My guess would be particle sources have no models and engine does no space checks but does for spheres

#

Some ancient spawn logic magic nobody asked for

hallow mortar
#
private _proxy = "Land_InvisibleBarrier_F" createVehicleLocal (_terminal modelToWorld (_terminal selectionPosition _x));
_proxy setPosASL (_terminal modelToWorldWorld (_terminal selectionPosition _x));
private _proxyProxy = "Sign_Sphere200cm_F" createVehicleLocal getPosATL _proxy;
_proxyProxy attachTo [_proxy];```
the position is now slightly different (more centred relative to the overall model) but still definitely wrong
meager granite
#

attachTo without offset does relative attach

hallow mortar
#

oh it does, I thought it was [0,0,0] by default for some reason

meager granite
#

Do _proxyProxy attachTo [_proxy, [0,0,0]]

hallow mortar
meager granite
#

Another thing here, you do setPosASL which uses land contact Z, while attachTo uses origin\world

#

Try setPosWorld instead?

hallow mortar
#

Okay, but I'm pretty sure the difference isn't that severe

meager granite
#

It is on lots of objects, maybe not in invisible barrier though, why would it have land contact points

#

Just checked, Land_InvisibleBarrier_F has no land contact points and getPosASL equals to getPosWorld

hallow mortar
#

I mean if I place both of them the appropriate places in the Editor, there's like a metre of vertical separation between their outer bounding boxes...not to mention the horizontal difference between expected/actual position

#

I tried a different selection name "display_mid" and got the same result

meager granite
#
testobj = _terminal;
onEachFrame {
    {
        private _sel = testobj selectionPosition _x;
        drawIcon3D ["\A3\ui_f\data\map\groupicons\selector_selected_ca.paa", [0,0,1,1], ASLtoAGL (testobj modelToWorldWorld _sel), 0.4, 0.4, 0, format ["%1 %2", _x, _sel], 2];
    } forEach ["display_1","display_2"];
};
#

Try this debug bit

#

My bet is that selectionPosition is [0,0,0] and that position is center of the object

hallow mortar
#

"display_1","display_2","display_mid" and their off counterparts all seem to be in that same position up on the antenna (verified with your code)

meager granite
#

Is it [0,0,0]?

hallow mortar
#

Yes it is

meager granite
#

So you either have wrong selection names or they're in another LOD

hallow mortar
#

These names came from selectionNames so I'm pretty confident in them

#

The first syntax of selectionPosition, which I'm using, is supposed to automatically go through all the LODs until it gets a hit

meager granite
#

Hmm, selectionPosition is supposed to check lots of LODs

#

yeah, just checked the wiki

hallow mortar
#

There are some other selections on this model that are where they're supposed to be, and are...close enough, I guess...to what I need. But like, wtf BI, over

meager granite
#

Maybe selections are named but just empty?

#

so its a model issue

#

Try selectionNames from different LODs

hallow mortar
#

The display_ selections aren't in any of the named LODs 🤔

meager granite
#

Wiki says it checks in first LOD in the model, maybe its some odd LOD like resolution or shadow

#

@ selectionNames

#

Check allLODs to see which is first

#

and use selectionPosition with Syntax 3

#

Not sure if allLODs indicates which is really first or its ordered somehow

hallow mortar
#

Well, that tells me they're in LOD 0, which is one of the visual (distance, I assume) LODs with a sequential resolution and no name

meager granite
#

You specify LOD index in Syntax 3

hallow mortar
#

The debug marker appears in the same place (on the antenna) with all LOD indexes

#

So they're just useless selections 👍

ivory lake
half inlet
half inlet
#

I was always under the impression that ACE modified the armor values on units via config

meager granite
#

As for my implementation, I send HitPart to the server and then compare it against final damage that resulted in kill to determine exact kill means

#

There are some optimizations in place that condense HitPart blocks into useful data and avoid sending repeated same-y info

half inlet
#

right, that's a thing, but I now remember why I ditched that option

meager granite
#

I combine ammo type, source and instigator into array and then do hashValue look up in hash map for quick check

half inlet
#

my problem with hitPart was that it didn't trigger for the unit that got hit (though maybe I just did it wrong?) - meaning I would've had to have the shooter and the victim send data to the server for validation, which is a recipe for disaster with networking in mind

meager granite
#

As you have all these in both HitPart and HandleDamage

meager granite
#

There are also quirks like hits resulting in damage but only Explosion is triggered and not HitPart

#

I'm losing my sanity being deep into this for months already

half inlet
meager granite
#

But it seems to work in the end, I know everything about the kill when it happens

half inlet
#

obviously that isn't an option though as it turns out, since HitPart only triggers on the shooter...

half inlet
meager granite
#

You'll need to figure which ammo caused the kill though, it is also complex issue in itself

half inlet
#

oh, hold up -- you've got two machines sending data to the server, and deferring the kill feed entry until the server has received both?

meager granite
#

Yes, so it is MP compatible

#

In general if you send HitPart right when it happens it should be sent to the server alongside engine damage that ends up triggering HandleDamage on victim client

#

So HitPart always arrives on server before HandleDamage in all cases

#

Shooter: HitPart and Damage -> Server
Server: Saves HitPart, Damage -> Victim
Victim: HandleDamage -> Server
Server: Has HitPart already, now got HandleDamage summary from victim

#

If you wish to same more info about the shot you'll also need to track it all through Fired and SubmunitionCreated

half inlet
#

I'm already doing the latter to some extent (to handle mines and artillery submunitions), but having the server collect data from two clients for one kill was the one solution I immediately crossed out for being too complex ("surely there's got to be a better way, right?")

#

your solution is very clever, but I'm bummed (albeit not surprised) that it's what it takes

meager granite
#

I was trying to collect HitPart and Fired summary for EACH instance of HandleDamage cycle but its ultra nightmare difficulty, I abandoned it half through

#

Right now I only send HitPart for [ammo, source, instigator] hash if it different enough to be worth sending, like new HitPart was a headshot or distance changed significantly

#

Same for HandleDamage, I only send it to server once, when significant amount of damage was done

#

Dying mid HandleDamage or on the same frame after HandleDamage also triggers this send

half inlet
#

I can only imagine the amount of variables you've got to track for all of this

#

truth be told, I'm now having second thoughts about fixing my implementation

meager granite
#

Its mostly hashmaps where keys are these ammo-source-instigator triplets

#

This approach of saving hit and damage summaries on server also lets attibute them to scripted identities rather than entities

#

So if player respawns or leaves the server you can still attribute say a mine kill to them

half inlet
#

hmm, I see the potential for stats tracking, but that would be far beyond the scope of my project

#

in any case, thank you for all the insight into your damage tracking system - I thought I had a good grasp on how to do it in ArmA but clearly I've got a long way to go still, heh

meager granite
#

👌

plush summit
#

Fellas, I want to know how I would get the following code to work for only certain players, and they keep this when they respawn. I inted to use the following code :

player setAnimSpeedCoef 0.75;

With this, would I have to make an array for all players within the squad, and have that code execute? Would I put this in onPlayerRespawn.sqf ?

proven charm
plush summit
#

Gottcha

plush summit
proven charm
#

array

plush summit
#

Appreciate it, ill get er done

plush summit
# proven charm array

Having issues with this -

private _khorne = [k_1, k_2, k_3, k_4, k_5, k_6, k_7, k_8, k_9, k_10, k_11, k_12, k_13, k_14];

{
_x setAnimSpeedCoef 1.5;
} 
foreach _khorne;

When launching - it is giving me the following error

#

k_ is each units variable name

proven charm
#

looks like k_2 is not defined

plush summit
#

But he has a variable name, or am I doing this wrong

#

Is there perhaps an issue with it initializing too fast ? Should I add a sleep at the start?

proven charm
#

i think the scripts should run after objects init is processed, so i dont see a problem

plush summit
#

yeah im not sure whats going on here, it looks like k_1 which is the sl is fine, but k_2 is not

#

and when I delete k_2 then k_3 becomes an issue

proven charm
#

what are those k_ objects anyway?

plush summit
#

omg im stupid sorry

#

They are players

proven charm
#

ok

plush summit
#

BUT because its multiplayer, and not all objects are present because theyre not slotted

#

its giving an error

proven charm
#

ah makes sense

#

but if you want to run that for each player you should just set that for each player in the init scripts

plush summit
#

I only want it for a squad of players is the thing

proven charm
#

putting foreach in player init scripts processes all players every time someone joins

#

in initPlayerLocal.sqf & onPlayerRespawn.sqf you could just do ```sqf
if(group player == theSpecialGroup) then
{
player setAnimSpeedCoef 1.5;
};

plush summit
#

I was looking at group player just now - ill give it a try and see thank you for your advise

meager granite
#

Amazing stuff with the Intercept, @grizzled cliff!

grizzled cliff
#

danka :)

light fox
#

I just want to clarify something: Arma3 does not expose C++ API, in the same way that they expose stuff using via SQF API. So, these few DLL APIs that must be present, be made exported, and non-mangled in their names is all there is, and nothing more. Which means, the DLL must be driven from an SQF script and the SQF script is the main control logic

little raptor
still forum
#

Since 2.17 (last dev branch) it does expose a tiny bit of C++ API. But its just for use with extensions and doesn't really do anything more

#

With extension callbacks you can have the main control logic be inside your extension and trigger SQF code at will

#

I used that model with TacControl where the SQF code does basically nothing by itself. But the extension will trigger a callback that will run SQF code, whenever the extension feels like it wants an update

fair drum
# plush summit I was looking at group player just now - ill give it a try and see thank you for...

for future reference, you can build arrays of objects that might be nil cleaner using: missionNamespace and getVariable + insert or pushBack/pushBackUnique:

private _khorne = [];
for "_i" from 1 to 14 do {
    _khorne insert [-1, [missionNamespace getVariable [format["k_%1", i], objNull]]];
};

Then either filter out the null objects, or in many cases, commands for objects that are run on null objects simply are skipped and don't throw errors

light fox
# little raptor Not unless you use Intercept

What I meant is, a C++ API direct from Bohemia Arma3 itself and not some user made C++ made API. Does intercept have direct access to Arma3 events directly in C++ without going through SQF layer?

proper sigil
#

Hey, can someone confirm if "MPEnded" EH fires also when mission is changed using #missions command?

Reading BIki entry about it my understanding is that the answer is "yes" but wanted to make sure

visual epoch
#

I've ran into a pretty annoying problem. I've got an AI group that's meant to take position on static HMGs, but since they arrived via a vehicle and passed a "GET OUT" waypoint earlier, the group members keep trying to dismount the HMGs.

At least I assume this is what's happening, since I tested them in isolation, and it worked out fine. Anyone struggled with this in the past?

granite sky
#

How are you putting them into the HMGs?

visual epoch
#

I'm using BIS_fnc_unpackStaticWeapon to get them assembled at a specific location

#

The HMGs aren't there at the start of the scenario, I want the AI to assemble them themselves

granite sky
#

Yes, but how are you putting the units into the HMGs?

visual epoch
#

The function does it with
_group addVehicle _weapon; _gunner assignAsGunner _weapon; _gunner moveInGunner _weapon;

granite sky
#

And the rest of the group doesn't get any subsequent orders?

visual epoch
#

They do.
_leader doWatch _targetPos; _leader doMove _leaderPos;

granite sky
#

Can you check the contents of assignedVehicles for the group?

visual epoch
#

Maybe it's that the truck they came in is still assigned to them?

#

yeah sure

granite sky
#

probably need apply { typeof _x } to make it useful.

#

I forget the default behaviour for groups with partial static occupancy though. We don't use it much.

visual epoch
#

"Partial static occupancy"?

#

Tried to fast forward it but ended up breaking it, hang on...

#

...seems like the only vehicle they've got is the static MG itself.

#

I'll probably end up cheesing it by giving them a "get in" waypoint once the thing's built

hallow mortar
granite sky
#

Are the group and static both local to the code?

visual epoch
#

If that question's directed at me, I have no idea where I'd find that out.

granite sky
#

What's your test environment? Localhost or DS+client?

visual epoch
#

localhost

#

just SP eden

granite sky
#

Everything's local then. No mods?

visual epoch
#

Oh wait, I am running a few mods, think LAMBS_Suppression would have an effect?

granite sky
#

Would be surprised. Main LAMBS might though.

hallow mortar
#

LAMBS usually makes the AI more likely to get into statics tbh

#

But you could check the LAMBS settings in addon options and see if there's a "don't get in statics" toggle or something

visual epoch
#

I'll try it without any mods just to be sure

visual epoch
granite sky
#

I might have a poke at it later tonight. Will let you know if I can replicate anything.

visual epoch
#

Thanks a lot! I could probably dump the whole scenario here, it isn't too complex

granite sky
#

yeah could be useful.

visual epoch
#

I... don't know what mod caused it, but the vanilla AI is now consistently running each other over.

fair drum
#

Sounds about right for Arma ai lol

sharp grotto
visual epoch
#

Here, I can't keep troubleshooting this

#

Every change I try to make fucks things up even more, now the vehicle won't even depart...

fair drum
#

Math question:

I have a hashmap with the following data:

GVAR(compositions) = createHashMapFromArray [
/* STUFF */
    ["carrier", createHashMapFromArray [
        ["missiletarget", [24.9297,66.3911,-0.0245016]],
        ["turretclass", "B_AAA_System_01_F"],
        ["turret_0", [[47.6841,-0.00439453,19.0834],216.866]],
        ["turret_1", [[25.5493,-114.821,16.6596],215.628]],
        ["turret_2", [[-30.1289,-105.404,17.5575],36.7085]],
        ["turret_3", [[-39.8408,179.097,19.9095],84.0869]],
        ["turret_4", [[30.917,175.103,19.6474],186.955]],
        ["turret_5", [[-16.8071,188.767,11.2129],125.788]]
    ]],
/* STUFF */
]

each turret has the relative position on the carrier model and their direction from north. my goal is to have these turrets face their relative positions no matter which way the carrier is rotated.

I have tried two following functions but I can't seem to get the math right:

params ["_child", "_parent"];

private _childDir = getDir _child;
private _parentDir = getDir _parent;
private _difference = _parentDir - _childDir;
_child setDir (_parentDir + _difference);
params ["_child", "_parent"];

private _childDir = getDir _child;
private _parentDir = getDir _parent;
private _relDir = _child getRelDir _parent;
private _worldDir = _parentDir - _relDir;
_child setDir _worldDir;
still forum
#

_child setDir (_parentDir + _childDir) ?

Assuming the carrier was pointed north when the first directions were taken

fair drum
#

it looks like i have made a mistake with that now that you point it out. the carriers initial direction when i was exporting the data was 126.119 so I guess I need to subtract 126.119 from all of my values in the hash?

manic flame
#

What is the main difference between Server Execution and Global Execution?

hallow mortar
#

Server Execution is when something is executed on the server. Global Execution is when something is executed on all machines.
Note that the SE and GE tags on the wiki don't stand for Server Execution and Global Execution, they stand for Server Execution and Global Effect. The SE tag means that the command must be executed on the server in order to take effect. The GE tag means that the command's effects are applied on all machines, even if it was only executed on one machine.

manic flame
#

Would GE be intended if I wanted something that was intended to be clientside to reflect across all clients?

hallow mortar
#

It...depends on what commands you're using?
Different commands have different effects and requirements. We'd need a better explanation of what you're trying to do, to give a full answer.

manic flame
#

Fair enough, I'll check the documentation thoroughly

fair drum
# manic flame Would GE be intended if I wanted something that was intended to be clientside to...

if you run a SE command from a client, nothing will happen

if you run a GE command from the dedi, everyone will see it.

if you run a GE command from each of the clients, everyone will see it multiplied by the number of clients

if you run a local command on the dedi, no one will see it

if you run a local argument command on a remote unit (meaning AL commands should be remoteExec to where the unit is local), the command will probably not have intended effects

granite sky
meager granite
#

remoteExec executes twice if you provide two entities of same client as target? Is this intended?

#

I was kinda expecting it to only RE on unique clients

#
testf = {diag_log _this}; 123 remoteExecCall ["testf", [player, player]];
```=>

10:27:38 123
10:27:38 123

#

Sad, could've been useful to have engine handle this, no way to determine if two entities belong to same client from client side

#

Wish there was comment ANY so you can add

#define diag_log comment
```to quickly mute all logs inside a script
#

Encasing diag stuff in #ifdef #endif is so clunky

meager granite
#
[typeOf car, driver car, alive car, local car, lockedDriver car]
```=>
`["I_C_Offroad_02_unarmed_F",<NULL-object>,true,true,false]`

yet `player moveInDriver car` doesn't work ![thronking](https://cdn.discordapp.com/emojis/388221973303394315.webp?size=128 "thronking")
#

lock => 1 so its not locked either

#

Manually getting into driver seat fixed it, then moveInDriver started working again

autumn arch
#

Is there a script or zeus module that lets you create a Task(found in the map area for players, along with an assignable map objective) mid-game?

raw quiver
#

does anyone have experience doing 3D world text scripting, i've been scratching my head for like three hours trying to get it to work where you can add names (or whatever) above players and i can't seem to get it right, any help would be appreciated

meager granite
raw quiver
#

would that be going in an init.sqf? im still pretty new to scripting

visual epoch
meager granite
raw quiver
#

or something to that nature

meager granite
#

Functions are for your convenience and reusability

meager granite
#

both vehicle and driver were local, they end up deleting on server but not on your client

#

car deleteVehicleCrew body does not fix it
moveOut body does not fix it either

#

both cases you end up with seemingly empty seat and you can't get into it

#

And lots of

14:00:49 Server: Object 3:66 not found (message Type_125)
14:00:49 Server: Object 3:67 not found (message Type_125)
14:01:07 Server: Object 3:67 not found (message Type_97)
14:01:07 Server: Object 3:66 not found (message Type_97)
```spam
raw quiver
#

like would that be a zeus thing in the Initialization tab?

meager granite
#

Check wiki for these commands to see how they work

raw quiver
#

thanks brother, sorry if i caused a bit of a headache

meager granite
meager granite
#

player moveInAny car works fine and finally fixes driver seat

#

There is some kind of condition check that fails for scripted get in driver actions

#

Yet getting in through mousewheel menu and with moveInAny works

timber shore
#

why would this not work? _items = primaryWeaponItems player; if (count _items == 0) then { hint "no items" };

meager granite
#

Why is alt syntax right operand an array? thonk

winter rose
#

thoughts of future expansion iirc

minor viper
#

Anyone know if it's possible to get the back door of a prowler open?

jade acorn
#

no

minor viper
#

Cool 😎

#

Thanks

nocturne bluff
#

because there is three empty strings in it

chrome hinge
#

Any ideas if it is possible to change locations of barrels created with addWeaponTurret? Like having dual miniguns under wings firing at same time

meager granite
#

oitherwise no, barrel depends on weapon simulation and memory points in the model

chrome hinge
#

okay, so no mounting 2x miniguns under civilian plane wings?

meager granite
#

Maybe with ton of scripting

#

As in creating fake miniguns, then moving bullets to their positions on Fired on all clients (bullets are local to each client)

chrome hinge
#

Alright, i was thinking first if the weapon could be created as a seperate entity and attached to the plane, and then fired all at once with fired but apparently thats not possible either?

meager granite
#

Nope

proven charm
#

weird that when I call saveMissionProfileNamespace in my mission I can no longer open the game menu (ESC). anyone got similar problems? (SOLVED bad return in "KeyDown" EH)

wind flax
#

Anyone know of a function to use "hasItem" on a player, and also check "isKindOf"

fair drum
wind flax
#

I can write one, just wanted to be sure there wasn't anything pre-existing before I started

#

Thanks though

proven charm
winter rose
hasty gate
#

Hi, does anyone know how to execute 'Engage' for an AI unit command using SQF? (the one from commanding menu)

proven charm
hasty gate
#

it's not

scarlet phoenix
#

Best way to get started/learn how to code arma?

fair drum
#

if you guys could go ahead and get 2.18 out for ignoreTarget that would be greeeeaaaaat

scarlet phoenix
#

does arma use C++ or SQF? Kind of confused on it

hallow mortar
#

User-side scripting is done in SQF. The game's internal code, which we don't touch, is C++. Extensions use C++ or a couple of other languages, I think.

scarlet phoenix
#

So eden would be sqf?

winter rose
#

yes

scarlet phoenix
#

My father knows how to code. He says that SQF is related to C++ but are different. Like siblings, they are the same family but are different people with personality and such

fair drum
scarlet phoenix
#

K

hallow mortar
#

SQF is only used in Arma. I'd be surprised if he's heard of it unless he plays Arma himself. Maybe he was thinking of SQL

winter rose
#

still would not match the "same family" description though

scarlet phoenix
#

Idk I'm an idiot

winter rose
#

nay, just "newbie" as in "not knowing", no trouble!

#

anyway, if you need help about SQF, this is the channel to be

steep verge
#

Hello gents, someone had maybe the luck to get AI to fast rope from the chopper via EDEN Ace Fast Rope waypoint? For me the AI heli pilot is just stuck and does nothing when waypoint is reached.

#

However, the Fast Rappeling waypoint added via Zeus does work perfectly fine, with the pilot going down to 15m to drop the guys off via fast rope.

#

Or maybe is there some option to view the inside of the fast rappeling waypoint which Zeus is using? I dont have a clue anymore. 5h wasted so far to get this done.

steep verge
#

also flyInHeight and flyInHeight ASL don't seem to work on lower altitudes.

keen stream
#

*four

#

@timber shore Maybe you've found a bug or don't have any primaryWeapon...

meager granite
#

Thank god there is isPlayer ARRAY which doesn't return true on vehicles with players in them

#

So you can both check if entity is a unit AND a player

winter rose
meager granite
#

isPlayer ARRAY still always returns false on vehicles thankfully

#

Warning could be updated to say that alt syntax is reliable to also check that entity is a unit

winter rose
#

or fixed to behave like the main syntax 😛

manic kettle
#

Sqf has so many quirks like this you could fill as many books as the Warhammer universe

winter rose
#

"say, what's the lore behind this discrepancy?"

meager granite
warm hedge
#

I just recalled Warfare was a thing 😅

meager granite
#

I remember playing it for quite a bit in A2 Free

#

It was so buggy though, if you pressed "Unpack MHQ" or whatever action was called twice, it teleported to [0,0,0]

#

Action didn't disappear right away due to scheduled scripts lag

exotic flame
#

How can i retrieve the key used for a specific action using scripting commands ?

#

For example, how can i know what key the player is using to talk in the radio ?

warm hedge
#

Action as in keybind?

#

actionKeys and other related commands

exotic flame
hallow mortar
#

If you want to detect when the player is doing a particular action, you can use a UserActionEventHandler. This sort of EH will pick up the action regardless of what keys are bound to it, so you don't have to worry about detecting multiple keybinds. It's much simpler if that's what you're trying to do. (If not, then do continue)

exotic flame
#

the problem is i can't intercept the action with UserActionEventHandler

warm hedge
#

Intercept as in stop the input?

exotic flame
hallow mortar
#

You can also use inputAction to check when an action is being done, by its action name rather than by its keybinds. This works OK with a keyDown EH (the type used to intercept actions), at least as long as it's not something they're likely to press at the same time as doing another action

warm hedge
#

🤔 So the intention is to stop one to use ingame PTT?

hallow mortar
#

If it's turning off the ability to speak that you're after, specifically, you can use enableChannel to lock the VON system itself

exotic flame
#

As i'm working on connecting multiple servers together, i'll need a new audio engine for communication in order to transfer communications in between servers

#

But i need this audio engine to use user's predefined keys so you don't need to reconfigure it

nocturne bluff
#

Sorry four.

#

Its not a bug

#

It means he has 4 empty slots

warm hedge
#

Maybe setPlayerVoNvolume then?

exotic flame
nocturne bluff
#

@timber shore {_x != ""} count _items == 0

meager granite
#

inputAction "PushToTalk"
inputAction "VoiceOverNet"
?

#

Though these will probably change after KeyDown

exotic flame
#

I will also disable all channels so there won'tbe any problem for VoiceOverNet

minor viper
#

Anyone know how to implement a live procedural texture for the map? I can get a still image of the map using "ui(RscMap", but for the life of me I can't figure out how to get it to stay live

#

Trying to get it onto a rugged tablet

warm hedge
#

What do you mean stay live

minor viper
#

like how do I get it to update

#

it's just one image for the whole mission

minor viper
#
{
  diplayUpdate "display";
  uiSleep 5;
};```
#

?

warm hedge
#

Probably. Cannot tell without your actual code

minor viper
#

I tried that but I had two issues;
A: I can't find the display name
B: Ideally I'm trying to run this in the unscheduled environment and uiSleep doesn't work I think.

#
private _tabletr = createSimpleObject ["Land_tablet_02_F", position this];
_tabletr attachTo [this, [0.635986,-0.0993652,-0.474988]];
[_tabletr, this] call BIS_fnc_attachToRelative;
_tabletr setVectorDirAndUp [[-8.74228e-008,0.0871557,-0.996195], [0,-0.996195,-0.0871557]];
_tabletr setObjectTexture [0,"#(rgb,1024,1024,1)ui(RscMap ,abc)"];```
warm hedge
#

A: abc
B: displayAddEventHandler or ctrlAddEventHandler

#

Also

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
minor viper
warm hedge
minor viper
#

what does "draw" do?

minor viper
#

so is it an event that triggers on every frame the map is being drawn?

warm hedge
#

Yes

minor viper
#

what is the { hintSilent str time} bit for?

warm hedge
#

It does nothing. Just to tell the idea

minor viper
#
(findDisplay "abc") displayAddEventHandler ["draw", {}];
#

so this would work too or I am a moron?

warm hedge
#

I don't think it does work. Your code does nothing

warm hedge
minor viper
#

ah okay

#

so

#
(findDisplay "abc") displayAddEventHandler ["draw", {displayUpdate findDisplay "abc"}];
#

?

warm hedge
#

Basically

still forum
still forum
still forum
still forum
warm hedge
#

Part of 3den are SQF, but core is not, yeah

winter rose
#

I considered the question being "scripting in Eden", thx for clarifying

meager granite
minor viper
# warm hedge Basically
private _tabletr = createSimpleObject ["Land_tablet_02_F", position this];
_tabletr attachTo [this, [0.635986,-0.0993652,-0.474988]];
[_tabletr, this] call BIS_fnc_attachToRelative;
_tabletr setVectorDirAndUp [[-8.74228e-008,0.0871557,-0.996195], [0,-0.996195,-0.0871557]];
_tabletr setObjectTexture [0,"#(rgb,1024,1024,1)ui(RscMap ,abc)"];
_tabletrdisplay = findDisplay "abc";
(_tabletrdisplay) displayAddEventHandler ["draw", {displayUpdate _tabletrdisplay}];
#

I'm a bit stuck now, it's not working but there is no error messages so I'm just fiddling around but I don't know what is wrong

#

fixed that order issue but still not working

still forum
#

_tabletrdisplay variable is undefined inside the eventhandler

#

displayUpdate (_this select 0) should give you the display

minor viper
#

Thank you I will try that now 🙏

#

yeah I noticed that

#

is that not an issue?

still forum
#

Nah actually the script version strips the "on" prefix

winter rose
minor viper
#
_tabletr setObjectTexture [0,"#(rgb,1024,1024,1)ui(RscMap ,abc)"];
_tabletrdisplay = findDisplay "abc";
(_tabletrdisplay) displayAddEventHandler ["draw", {displayUpdate (_this select 0)}];
#

still not working unfortunately

meager granite
minor viper
#

so where does that leave me?

still forum
#

You can make your own display in config. Either in mod or missions description.ext
And add the eventhandler via there, its onLoad handler will be called when created. Maybe you can even put onDraw directly into there too

minor viper
#

if that's the only way to do it then that's fine and I'll start working on it, but is there any way to implement it without using scripts, just using the 'init' box in 3den/zeus alone?

warm hedge
#

Without scripts? What you do is some scripts already. Or rather, init you call already is

minor viper
#

I mean without any .sqf files

#

so that it can just be run on any mission at any time

#

Atm everything runs out of 3den

clear leaf
#

Hello, i hope some of you can help me with this script i made. I works fine until the end of it where i wont my player and the other ai to leave the animation i et them to leave the animatiob, but when they leave it they are like stuck. They are stuck to the Z,X,Y when i try mov he does the move animation but cant move and his ehad cant turn at all, why?

cosmic lichen
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
winter rose
#

also: do not use ChatGPT to write code: enablePlayerControl is not a command

cosmic lichen
#

Stupid Ai can't read wiki. We are all doomedmeowsweats

proven charm
#

why this simple line doesnt work (with dedi run from client) [spot] join player; doesn't join

proven charm
#

the player is supposed to have one AI in his group from start but from some reason it isnt

#

nevermind, persistent bf and auto init was on which broke the whole thing. still wonder why join didnt work but atleast got my group member

hallow mortar
#

@meager granite @edgy nimbus 👋
Init fields in Zeus (either when placing a saved composition or when selecting an object with ZEN/Achilles) are only executed on the Zeus client, so on DS an isServer check will automatically fail

meager granite
edgy nimbus
edgy nimbus
hallow mortar
#

It's always useful

meager granite
#

Just paste the code into vehicle init field

#

This code bit assumes you use it on a UAV that has both driver and gunner (driver locked\unvailable\etc)

#

otherwise it will do setOwner 0

edgy nimbus
#

Like that or do i have to change everything to this without _```sqf
if (isServer) then
{
this spawn {while {true} do
{
waitUntil {sleep 1; owner gunner _this != owner driver _this;};
(group (driver _this)) setGroupOwner (owner (gunner _this));
_this setEffectiveCommander (gunner _this);
_this setOwner (owner (gunner _this)); sleep 1;
};
};
};

meager granite
#

yeah

#

not sure if you really need effective commander here

#

but wont hurt

edgy nimbus
meager granite
#

it doesn't

edgy nimbus
meager granite
#

You need to log ownership states and stuff like this

#

Don't bother if you don't get what code does

edgy nimbus
meager granite
#

By [] I meant an array with anything related to whatever script is doing

edgy nimbus
meager granite
#

Yes

edgy nimbus
meager granite
#

Just try the code and see if it solves the issue of not being able to drive from gunner seat as non-server

edgy nimbus
edgy nimbus
# meager granite I didn't test it

Yes not this one, but you said a few days ago, you fixed this UGV problem once before. So did that work in multiplayer with other people?

meager granite
#

It worked in local test server setup, I didn't get complaints when it was used live.

meager granite
#

Vanilla armed UGV with driver seat locked

mystic scarab
#

Hello, is it possible to make a unit change factions when in proximity of a player?

meager granite
#

so you can only control gunner

edgy nimbus
meager granite
meager granite
edgy nimbus
meager granite
#

No, it was script spawned

#

you'll need to RE server to run that code from Zeus side for each vehicle you spawn

#

or add it CfgVehicles init field

#

having that addon only on server will also suffice

edgy nimbus
meager granite
#

no idea if it is _this or this or even array in Zeus

#

maybe @hallow mortar can tell

hallow mortar
#

I believe it's this (object), but I only use Achilles so ZEN could be different

edgy nimbus
#

For logging, roughly like this?

if (isServer) then 
{ 
  this spawn {while {true} do 
  { 
    _driver = driver _this;  //or this?
    _gunner = gunner _this;
    _driverID = owner _driver;
    _gunnerID = owner _gunner;
    _driverGroup = group _driver;
    _gunnerGroup = group _gunner;
    diag_log [_this, _driver, _gunner, _driverID, _gunnerID, _driverGroup, _gunnerGroup];
  
    waitUntil {sleep 1; owner gunner _this != owner driver _this;}; 
    (group (driver _this)) setGroupOwner (owner (gunner _this)); 
    _this setOwner (owner (gunner _this)); sleep 1; 
   }; 
  }; 
};

Can i use systemchat for it? Propably?

hallow mortar
#

diag_log doesn't create a new file.
One RPT file is created per session (game launch to game exit) and updated as things happen. If you have the file open when things happen, you'll need to reload it.

#

You can often use systemChat for debug logging, but be aware that it is a Local Effect command, so if used on a DS it won't be displayed to the players. You would need to remoteExec it to see it.

edgy nimbus
edgy nimbus
hallow mortar
#

Also you can't copy/paste from systemChat so it's not always convenient

edgy nimbus
#

Really stupid question, but how to i use variables in systemchat? I thought so far its custom text only.

hallow mortar
#

Wrong reply but oh well

#

that was about using systemchat

edgy nimbus
hallow mortar
# edgy nimbus I opened the newest one with notepad++, and it had some general information in i...

The diag_log itself looks OK. The big possibilities are that the code didn't run (error or was run on not-server and instantly bailed) or the waitUntil never finished. You can add more simple checkpoint diag_log at various points to see what's running and what's not.
The other possibility is you looked in the wrong file. You need the one dated for the start of the session where the code was run. If the game's been restarted since, the newest file won't be the right one.
Try including a keyword in your diag_log so you can ctrl+f for it

#

Also make sure you're looking at the server's RPT, not your client's

still forum
edgy nimbus
#

Do you think, this will have the desired results of when the ugv/uav driver is not reacting to the player from the gunner seat, this fixes it?

  (group (driver _this)) setGroupOwner (owner (gunner _this)); 
  _this setOwner (owner (gunner _this));

As its quite the major issue i have with a mod in multiplayer.
UGV's when spawned by zeus and player controls gunner, are not made local / grouped to the player correctly.

viral ferry
#

What type of code does arma use?

#

I mean the name

opal zephyr
#

for scripting, sqf

viral ferry
#

Thank you

edgy nimbus
# still forum All the variables in the diag_log are undefined

Propably used the wrong this? Which is what i asked earlier as i wasnt sure. Thx for pointing it out, gonna fix it. 😊

Please just make hasDriver=-1; also work for wheeled vehicles,
and fix multiplayer locality/grouping when connecting to unmanned vehicles, im begging you. 😭😂

still forum
chrome hinge
#

Is it possible to spawn 3d model of pylons (lets say a 4x scalpel rack) with scripts and attach it?
Or do they exist as objects?

hallow mortar
#

You can createSimpleObject its model and attach it

chrome hinge
#

thanks!

knotty gyro
#

hey. I'm looking for the animation/ move to have an AI sit on tjheir knees and hands tied behind back. Help?

proven charm
knotty gyro
#

close, but I was more looking for the animation where they sit on their knees

#

But thanks anyways

proven charm
#

I thought it might be close 😉

knotty gyro
#

there was this part in the contact capaign where there was a couple of soldiers held hostage... Trying to find that particular move

hallow mortar
#

Try "Acts_ExecutionVictim_Loop"

proven charm
#

there's anim viewer in the editor

knotty gyro
#

yeah, but not very user friendly

knotty gyro
split nebula
#

wouldn't it be != instead of ==, now it returns true if no slots are empty. unless my brain is acting up on me

molten yacht
#

So, broadly, I were to run, like
(pseudocode)

private _v = createSimpleObject[typeOf this, getPosASL this]
_v setDir (getDir this);
deleteVehicle this;

in the init field of every bunker in my mission.

Would these objects be properly available to JIP, since the simpleobject code is in a now-deleted object?

wet shadow
molten yacht
#

Hmm, tricky

#

I have to make sure it executes after deformer...

junior moat
#

hey im using this script:


_MapSize = WorldSize;
_HalfMapSize = WorldSize / 2;
_CivilianWeapons = ["Weapon_hgun_Pistol_heavy_02_F", "Weapon_hgun_PDW2000_F", "Weapon_sgun_HunterShotgun_01_sawedoff_F", "Weapon_srifle_DMR_06_hunter_F", "Weapon_arifle_AKS_F", "Weapon_launch_RPG7_F"];
_CivWeaponsMax = count _CivilianWeapons;
_BungalowHouses = [_HalfMapSize ,_HalfMapSize ,_HalfMapSize] nearobjects ["Land_i_House_Small_03_V1_F",worldsize];

{
    _BuildingPositions = _x call BIS_fnc_buildingPositions;
    {
        _RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
        _CreatedWeapon = createVehicle [_RandomWeapon, _x];
    } forEach _BuildingPositions;
} forEach _BungalowHouses;

to spawn weapons in houses around the map. the only problem is the weapons are spawning about a meter off of the ground (see attached image). is there any way i can just snap the weapons to the ground?

nocturne bluff
#

You are tottally right

#

Early brain ;)

fleet sand
# junior moat hey im using this script: ```sqf _MapSize = WorldSize; _HalfMapSize = WorldSiz...

Try this i havent tested it:

private _MapSize = WorldSize;
private _HalfMapSize = WorldSize / 2;
private _CivilianWeapons = ["Weapon_hgun_Pistol_heavy_02_F", "Weapon_hgun_PDW2000_F", "Weapon_sgun_HunterShotgun_01_sawedoff_F", "Weapon_srifle_DMR_06_hunter_F", "Weapon_arifle_AKS_F", "Weapon_launch_RPG7_F"];
private _CivWeaponsMax = count _CivilianWeapons;
private _BungalowHouses = [_HalfMapSize ,_HalfMapSize ,_HalfMapSize] nearobjects ["Land_i_House_Small_03_V1_F",worldsize];

{
    private _BuildingPositions = _x buildingPos -1;
    {
        private _RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
        private _CreatedWeapon = createVehicle [_RandomWeapon, _x];
    } forEach _BuildingPositions;
} forEach _BungalowHouses;
junior moat
fleet sand
scarlet phoenix
#

Where do you guys usually script? Is this the debug menu or is it something else?

junior moat
molten yacht
#

Can someone skilled with vectors let me know - is there a way to convert compass-direction to VectorDirAndUp?

scarlet phoenix
junior moat
#

should look like this, but only mission.sqm

junior moat
#

@scarlet phoenix incase youre unaware. there is an advanced form of mission editing where you script your missions using code in .sqf files instead of doing it in the eden editor. alot of the more advanced missions (Antistasi, Wasteland, etc) are made in this way as theyre too complicated to replicate using only modules and eden editor stuff

molten yacht
scarlet phoenix
junior moat
fleet sand
junior moat
# scarlet phoenix Missions let's say

go for it. its not too complicated to learn. esspecially if you already know other coding languages such as python. i myself, managed to learn most of the essentials to get started coding stuff in like, 2-3 days

scarlet phoenix
junior moat
molten yacht
#

Oh

molten yacht
junior moat
junior moat
#

no worries, best of luck o7

scarlet phoenix
junior moat
# scarlet phoenix Quick ol' question, know any information on cinematics?

if youre making a video youre going to upload to youtube or some other service just use the gcam mod. if you want like a cutscene in your mission. im not 100% sure when it comes to scripting but in the eden editor there is the keyframe system which can be used for a lot of cool stuff including having a camera follow a path

#

you could probably combine the keyframe animation stuff with scripting for the best result

scarlet phoenix
junior moat
#

just save it with nothing in it or just a player character

scarlet phoenix
#

okie

junior moat
#

just a quick tip btw

#

coding for singleplayer and coding for multiplayer are very much different. so make sure you do research into which mode you want to make your mission for

scarlet phoenix
#

okay saved it so now I presume i code in the notepad and as I do that, the game should change?

molten yacht
#

I feel like this should be working. But it isn't.

[submarine,wp_0] spawn { 
params ["_src","_target"];
_v = "ammo_Missile_Cruise_01" createVehicle [0,0,1000]; 
_v attachto [_src,[0,16,5]]; 
_v setVectorDirandUp [[0,0,1],[-1, 0, -1]];
sleep 0.2; detach _v; sleep 6;
_v setVectorDirandUp ([_v, _target] call BIS_fnc_vectorDirAndUpRelative); 
}; ```

Spawn the missile (works fine)
Fire it straight  up (works fine)
Change the direction to the location of a gamelogic (doesn't)
hallow mortar
# scarlet phoenix okay saved it so now I presume i code in the notepad and as I do that, the game ...

The game automatically recognises certain files, like description.ext, init.sqf, initServer.sqf (look those up, and there are others) and executes the code (or interprets the config, in the case of description.ext) at the start of the mission.
You won't see observable changes in the Editor, but things will happen when you run the mission.
Although the Editor itself can't interact with external scripts, the code all operates in the same environment, so variable names etc. are all shared.
Note that not everything in the game can be changed through mission config and scripting. Some config types can't be overridden by missions, and anything outside the mission, like main menus, is out of reach. And some things don't have commands for changing them.

hallow mortar
hallow mortar
#

Yes, sort of, and not literally immediately as you type.

molten yacht
#

Hmm, doesn't work

#

I feel like it should unless I'm using vectorDirAndUpRelative

junior moat
#

still having issues with this script lol it just does not want to work at all.


_MapSize = WorldSize;
_HalfMapSize = WorldSize / 2;

_CivilianWeapons = [
    "Weapon_hgun_Pistol_heavy_02_F",
    "Weapon_sgun_HunterShotgun_01_sawedoff_F",
    "Weapon_srifle_DMR_06_hunter_F"
];

_CivilianBuildings = [
    "Land_i_House_Small_03_V1_F",
    "Land_i_House_Big_02_V1_F",
    "Land_i_Shop_02_V1_F",
    "Land_u_Addon_02_V1_F",
    "Land_i_House_Big_01_V1_F",
    "Land_i_Shop_01_V1_F",
    "Land_i_House_Small_01_V2_F",
    "Land_u_House_Small_02_V1_F",
    "Land_i_Addon_03_V1_F",
    "Land_i_Addon_03mid_V1_F",
    "Land_i_Stone_HouseSmall_V1_F",
    "Land_Metal_Shed_F",
    "Land_i_Stone_Shed_V1_F",
    "Land_i_Stone_HouseBig_V1_F"
];

_CivWeaponsMax = count _CivilianWeapons;

{
    _Houses = [_HalfMapSize ,_HalfMapSize ,_HalfMapSize] nearobjects ["_x", worldsize];
    hint _x;
    sleep 1;
    {
        _BuildingPositions = _x buildingPos -1;
        hint "BuildingPositions";
        sleep 1;
        {
            _RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
            _CreatedWeapon = createVehicle [_RandomWeapon, _x];
            hint "CreatedWeapon";
            sleep 1;
        } forEach _BuildingPositions;
    } forEach _Houses;
} forEach _CivilianBuildings;

hint "Finished Script";
#

it never seems to get to the:

_BuildingPositions = _x buildingPos -1;
        hint "BuildingPositions";
        sleep 1;
        {
            _RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
            _CreatedWeapon = createVehicle [_RandomWeapon, _x];
            hint "CreatedWeapon";
            sleep 1;
        } forEach _BuildingPositions;

part

hallow mortar
#

You can't create weapons using createVehicle. They're not real objects, just proxies.

#

Unless you want to just create the model using createSimpleObject, you need to create a weapon holder (a sort of invisible fake crate that's used to hold anything "on the ground") and add the weapon to its inventory

junior moat
hallow mortar
#

oh, hold on, I see you're using the preloaded holders for those weapons, not the actual weapon classes. That makes sense now

junior moat
#

yup!

#

my old code worked, but only on one specfic type of house. i tried to adapt it for most of the common houses found on altis and stratis and its no longer working and i get no error message

junior moat
#

im such an idiot

#

i figured it out

#

this has "" around it

steep verge
#

Someone does maybe know the issue with flyInHeight don't working properly at low altitudes?

#

Any help would be appreciated

warm hedge
#

What's your code

hallow mortar
#

The "dead zone" below ~10 metres for flyInHeight is a long-standing issue with the command itself. Using the alt syntax with the true to force it is supposed to be the solution. If that's not working, then ???

quaint oyster
#

Anyone know what kind of "iskindof" fish and other sea creatures fall under?

manic kettle
#

Look at the config

lavish ocean
quaint oyster
#

"Fish_Base_F" it seems, ty

candid narwhal
#

Greetings, I am trying to learn how to use param atm and am wondering how to assign expected DataTypes.

_VCrew        = param[2, "C_Marshal_F", [objNull, ],[]];

What´s to be put in there for Strings? Code? Numbers? etc.
I know it looks like this:

_arr  = param [0,[0,0,0],[objNull, []], [2,3]];

For Arrays.

warm hedge
#

What string you mean? The third argument?

split nebula
#

definately interested to see where it leads.

candid narwhal
#

Yes. But the question extents to classes, code etc etc. I Want to have an expected Datatype for my parameters of my future functions.

/* 
Pseudo stuff
*/
_ShouldBeString  = param [0, "hi", /*what to put here*/, []];
_ShouldBeArray   = param [1, [0,0], /*what to put here*/, []];
_ShouldBeCode    = param [2, {_fnc_}, /*what to put here*/, []];
_ShouldBeGroup   = param [3, _myGroup, /*what to put here*/, []];

^^ Like this stuff.
If that makes my question clearer

jagged terrace
#

Weird one here. I'm trying to get SCBACylinder_01_F to start leaking upon completing a hold action. It does this when shot at, so I tried using setDamage, which did not work. I then looked through the config to see if I could find anything relating to this behavior, which I did not, and animationNames returned an empty array. I'm not sure what else to try going forward.

warm hedge
candid narwhal
warm hedge
jagged terrace
warm hedge
warm hedge
candid narwhal
#

Lmao so I am asking a question way above my paygrade xD
Ty anyways and I will keep asking around and see if I can find something

hallow mortar
#

You could look at its config and see if it has any event handlers or special surface hit effects
* this is about the SCBA cylinder

warm hedge
#

It is not a hard question to answer though. An empty array is [] empty code is {} empty group is grpNull

jagged terrace
#

It launches itself away when not frozen in place. There is nothing changed about this object, it is freshly spawned from the menu.

jagged terrace
hallow mortar
jagged terrace
hallow mortar
#

Definitely recommend picking up Advanced Developer Tools from the Workshop. It makes the config viewer much easier to use, amongst other things

candid narwhal
# warm hedge It is not a hard question to answer though. An empty array is [] empty code is {...

whats an empty class and empty number?
and this would have an expected datatype of "code" right?

_shouldBeCode = param [0,{_fnc_}, {}, []];

param [index, defaultValue, expectedDataTypes, expectedArrayCount]
^^This is how it is described on the wiki.
expectedDataTypes: Array of direct Data Types - (Optional) checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
So this should function just like that?
I am having difficulty wrapping my head around this for some reason.

hallow mortar
#

The thing about the param expected data type is that it doesn't actually matter what the content of the data type is. It doesn't actually have to be empty/null etc, that's just used for convenience. It can be anything as long as it's the right type.

#

There is no "empty number" because all that defines a Number type is...being a number. Just use any number.

deft zealot
#

@candid sun yes i wrote the function that i pastebind'd. WHy do you ask?

candid narwhal
hallow mortar
#

The expected data types argument is an array of expected data types

#

So param [index, defaultvalue, [datatype1, datatype2], arraycount]

candid narwhal
#

It kinda would be nice if it was like
if (int_thing)
if (Array_thing)
...
and not something like ObjNull.

candid narwhal
hallow mortar
#

It literally works by "show me an example of a thing of the data type you want"

candid narwhal
warm hedge
#

And "yeah it looks similar, Imma accept your input"

candid narwhal
unkempt marsh
#

does anybody know how to make a trigger condition "squad A detects an enemy"

hallow mortar
#

Btw, if you're splitting up a whole array of params, you don't need to do it one manually-indexed param at a time. There is params to do several in one command

candid narwhal
#

and from what I imagined and saw param seems to be more readable to beginners

#

Or people that are even newer to this than me

hallow mortar
#

params is very similar to param. The structure is essentially "several param in a trench coat".
To help with keeping it readable, here's a tip - line breaks and indentation are free and you can put them almost anywhere.

nocturne bluff
#

@lavish ocean been discussed here, its nice

hallow mortar
#
params [
    ["_zero", objNull],
    "_one",
    ["_two", ["string array element", "another!"], [[]], 2]
];```
candid narwhal
#

thx!
I shall upgrade after a nap

meager granite
#
params [
     ["_zero", objNull]
    ,"_one"
    ,["_two", ["string array element", "another!"], [[]], 2]
];
pulsar bluff
#

efficient

keen stream
#

Is there a away to keep flashlights on AI on when they die?

#

Now when a unit dies, the flashlight dies with them (asif it is neurally powered or something).

tough abyss
#

what is the best way to make an overlay like the cbrn facemask overlay and what is the recommended filetype?

warm hedge
tough abyss
#

yes

#

i understand cutrsc and igui / gui elements just dont know how to import a 2d ui element into arma and what is the filetype i should use

warm hedge
#

Urm, why you need to make an image when there already is?

tough abyss
#

i want to make a custom overlay sorry if i didnt give that detail

warm hedge
#
  1. Only acceptable image format is PAA (well that is the only alpha-able image)
  2. You need to make a GUI element for it
tough abyss
#

thanks

solar geode
#

so, what you think about Nou's effort ?
My first thought: I need to start learning C

still forum
#

@grizzled cliff will you include the API to create own scriptFunctions? I implemented my first own function yesterday because your project pushed my interest.

queen cargo
#

already told @grizzled cliff that i most likely will add a new printOut to OOS so that you can deploy addons in c++ AND SQF with the same source code

#

only thing the folks here then would need to do is following some howTo about the compiling of the c++ code if they have no idea about that and the rest is just writing it in OOS then

the good about it: one lang two targets
the bad: why would you want to write OOS if you can use directly c++?

still forum
#

Because OOS provides a better overview and standartization? ^^

queen cargo
#

then SQF? yes

still forum
#

Or OOS generates some type like an intermediary language which gets parsed by a premade extension.. Like Java kinda does it. That way people dont need a c compiler

queen cargo
#

more: OOS code gets translated to c++ code (instead of SQF, you would just choose your target lang)

pliant stream
#

no offense but if you can write c++ why write oos :D

queen cargo
#

as said

#

the benefit is that you also can deploy your stuff in SQF then

#

((its also added to the "the bad" 'list' of mine @pliant stream :P))

still forum
#

Ouhhhh that will be awesome... When Nous Lib doesnt support Battleye the OOS code can still be executed in slow sqf instead of fast c++ ^^

queen cargo
#

exactly (+ you also could deploy whatever you have been writing in a mission only instead of an addon)

#

thats the rough idea behind it

#

however, till that happens a lot of shit still has to be done in OOS

#

but im working constantly on it

#

and fixed a gigantic bunch of issues OOS had by starting an actual project in it

knotty gyro
#

Where can I find a good tutorial about eventhandlers? I need to learn how to register a player killing a civilian in MP as well as SP.

fair drum
knotty gyro
junior moat
#

i have this code:


_HalfWorldSize = WorldSize / 2;
createCenter east;

"group" setDynamicSimulationDistance 500;

_MilitaryBuildings = [
    "Land_i_Barracks_V2_F",
    "Land_Cargo_HQ_V1_F",
    "Land_Cargo_House_V1_F",
    "Land_Cargo_Patrol_V1_F",
    "Land_Cargo_Tower_V1_F",
    "Land_MilOffices_V1_F"
];

_InfantryUnits = [
    "I_Soldier_lite_F"
];

{
    _Houses = [_HalfWorldSize ,_HalfWorldSize ,_HalfWorldSize] nearobjects [_x, worldsize];
    {
        _BuildingPositions = _x buildingPos -1;
        _BuildingGroup = createGroup [east, true];
        _BuildingGroup enableDynamicSimulation true;
        {
            _RandomInfantryUnit = selectRandom _InfantryUnits;
            _CreatedInfantryUnit = _BuildingGroup createUnit [_RandomInfantryUnit, _x, [], 0, ""];
        } forEach _BuildingPositions;
    } forEach _Houses;
} forEach _MilitaryBuildings;

which should create a unit in every military building of the types specified (ik about the performance, im going to do that later) which works but im also trying to enable dynamic simulation for units that are far away but it doesnt seem to do anything and i get no errors. how would i fix this?

edgy nimbus
# meager granite ```sqf [_this, {while {true} do { waitUntil {sleep 1; owner gunner _this !...

This bit seems the key! 🥳 This fixes the mentioned UGV bug.
(group (driver _this)) setGroupOwner (owner (gunner _this));
Absolute legend. 🏅🔥

Didnt find a difference with setowner so far, is it needed?

Also im working on some semi unmanned vehicles,
and sadly the "it works on whoever got in first" issue (for a lack of better words) still exists,
so when someone else got in the vehicle, like passenger, it doesnt work if the gunner gets in second,
which i thought was effectiveCommander related, as the wiki says:

Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to. So if in a tank there is a gunner and a commander and AI driver, if the effectiveCommander is gunner, then gunner pressing WASD will give AI orders to move. If gunner jumps out and then enters tank again, the effectiveCommander role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis.

Despite setGroupOwner / setOwner / setEffectiveCommander, the UGV AI is not reacting to gunner driving in this case (other playing gotten in as passenger first).

Any idea on that? 🤔

small gyro
#

Is it possible to set addEventHandler for "Take" & "Put" on server ? I would like to let server handle inventory actions made by clients. Trying to add from the server side this EHs for containers with no success. Clients take & put items and server not catching that

fair drum
fair drum
small gyro
# fair drum what do you have written so far

this code runs from server addon at postInit stage

{
  _x addEventHandler ["Put", {
      params ["_unit", "_container", "_item"];
  
      _containerName = getText(configFile >> "CfgVehicles" >> typeof _container >> "displayName");
      _itemConfig = _item call CBA_fnc_getItemConfig;
      if (isNull _itemConfig) exitWith {};
  
      _itemName =[_itemConfig >> "displayName", "STRING", str _itemConfig] call CBA_fnc_getConfigEntry;
  
      [QGVAR(SyncLogData), [format["%1 put %2 in %3\n", name _unit, _itemName, _containerName]]] call CBA_fnc_serverEvent;
  }];
} forEach vehicles;
fair drum
#

invert it, put the handler on a unit, then do a container check instead. I believe put has to be on a unit, not a vehicle/container.

small gyro
#

but unit is kind of vehicle too, on arma language )
Also my idea was based on this:
This event handler can be added to a container. 2.14
UPD:
tried to put this events on server from container to units - doesn't help

frigid spade
#
{_x setPosASL _infWp} foreach (units _infGrp);

For some reason this is giving me the error about expecting 3 elements and that i only provided 2

#

I'm not sure which elements I'm missing for any of these functions

#

setPosASL just needs an object itself and a pos

#

units just needs itself and a group

stable dune
frigid spade
#

hmm thats probably it

#

guess waypoints dont have a z value

hallow mortar
# frigid spade guess waypoints dont have a z value

They do. The AI sometimes doesn't care about it, but waypoints are 3D.
The issue you're having is that you're not giving setPosASL the waypoint's position, you're giving it the waypoint. And waypoints aren't objects - they're represented as an array of [group, waypointIndex].
So what you're giving is _x setPosASL [someGroupID, 0], which is not a valid position array.
You could use waypointPosition _infWp and that would work, although waypointPosition returns AGL, not ASL, so you'd want to use setPosATL or convert the position first.

granite sky
edgy nimbus
granite sky
#

If it wasn't an AI driver then you couldn't do setGroupOwner.

#

Players can't have their locality switched.

#

I'm not following your second point. The players aren't in the vehicle at all in this case, are they? It's remote control.

edgy nimbus
# granite sky I'm not following your second point. The players aren't in the vehicle at all in...

I had two problems.
The first was about fully remote controlled vehicles, setGroupOwner to gunner fully fixed that.

The second problem is more tricky:
Its an IFV, with a seperate driver compartment (so players cant switch to it), it has a B_UAV_AI driver.

setGroupOwner works if the gunner is the first person entering the IFV.

If another player, goes into passenger seat first.
And after that the gunner enters and is set as groupOwner of the driver AI.
It doesnt react to driving inputs...

I am wondering why thats the case, and if its in any way fixable. (Maybe not, but hopefully.) thonk

granite sky
#

Well, the commander is probably the effective commander for a start.

#

If you're saying you switched that too, and it still doesn't work, then I'm not sure what's happening.

edgy nimbus
bleak mural
#

anybody using CBA task patrol?

#

im finding calling it via unit init and syncing unit to a CBA module produces very different results

haughty sand
#

can someone help me reduce vehichle weight to make them faster

#

or reduce health loss when crashing a car

#

or increase player run speed

warm hedge
#
  1. setMass
  2. handleDamage event handler
  3. setAnimSpeedCoef
warm hedge
#

@haughty sand If you have a question about my answer just ask here. I offer no such "private" QnAs that has to be public. As I stated in my bio

haughty sand
#

how do i 1)set mass

hallow mortar
haughty sand
#

im still new to editor but i managed to make spawn points and my map

warm hedge
#

Wiki is ALWAYS your friend

sullen sigil
#

i thought i had no friends until i discovered the wiki..... since then my life has changed

warm hedge
haughty sand
#

so like this?

#

handleDamage event handler setMass setAnimSpeedCoef 9999; };};

warm hedge
#

You've only wrote something that is not going to run

#

Do it one by one. Read BIKI carefully

fair drum
#

do you have any coding experience at all or are you completely green

haughty sand
#

i was coppying this layout i found on youtube
[]spawn { while{true}do{ player setAnimSpeedCoef 9999; }; };

#

i never coded before

#

i just been copy pasting things i seen on youtubw