#arma3_scripting

1 messages ยท Page 433 of 1

ornate pawn
#

i was typing

drowsy axle
#

Sorry. ๐Ÿ˜ƒ

ornate pawn
#

I will try this

#

thank you

#

its for a MilSim air base im making

drowsy axle
#
[
  Marshall_Dude_1,
  "Preparation",
  "images\take_ca.paa",
  "images\take_ca.paa",
  "_target distance player < 2",
  "_target distance player < 2",
  {},
  {},
  {
    p2 switchMove "Acts_JetsCrewaidL_idle_m";
    sleep 3;
   
    p2 switchMove "Acts_JetsCrewaidFCrouch_in";
    sleep 2.9;

    p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
    sleep 2;

    p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
    sleep 2;

    p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
    sleep 1;

    p2 switchMove "Acts_JetsCrewaidFCrouch_out";
  },
  {},
  [],
  0.5,
  1000,
  false,
  false
] call BIS_fnc_holdActionAdd;};```
knotty mantle
#

wow. No.

#

kill the if

ornate pawn
#

why?

meager heart
#

Only display the addAction in the scroll menu
afaik that is not possible for hold actions (without some tricks), there are no showWindow param like with addAction... but you can try to set action priority at negative value, @ornate pawn

drowsy axle
#

EDITED @knotty mantle @ornate pawn

knotty mantle
#

condShow: String - Condition for the action to be shown. Special variables passed to the script code are _target (unit to which action is attached to) and _this (caller/executing unit)

#

you dont need that while

#

Just edit that line.

ornate pawn
#

I will try that Capwell and if doesn't work then i will have to use the old AddAction

knotty mantle
#

nope. Edit that into the string in 5th and 6th line.

#

these are conditions designed to make sure the action shows up.

drowsy axle
#

tbh it would be nice to have a holdaction for the doors.

ornate pawn
#

yeah

#

HoldActions are better

drowsy axle
#

Yeah

ornate pawn
#

and you can add an image to it

#

๐Ÿ˜„

drowsy axle
#

Yup

ornate pawn
#

I have a towing system that is working and everything is in addAction

#

when you get close the landing platform and park the towing vehicle close to it you can attach that platform to it and get the platform out of the hangar

#

and detach the little bird that is attach to that platform

#

pretty cool

#

i wish i could make the attachto more realistic

knotty mantle
#
[
  Marshall_Dude_1,
  "Preparation",
  "images\take_ca.paa",
  "images\take_ca.paa",
  "_target distance 'markername' <= 10",
  "_target distance 'markername' <= 10",
  {},
  {},
  {
    p2 switchMove "Acts_JetsCrewaidL_idle_m";
    sleep 3;
   
    p2 switchMove "Acts_JetsCrewaidFCrouch_in";
    sleep 2.9;

    p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
    sleep 2;

    p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
    sleep 2;

    p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
    sleep 1;

    p2 switchMove "Acts_JetsCrewaidFCrouch_out";
  },
  {},
  [],
  0.5,
  1000,
  false,
  false
] call BIS_fnc_holdActionAdd;
#

This should btw help you out. Not sure if you need the single quotations around your markername tho.

#

Youยดll have to fiddle around a bit with that.

ornate pawn
#

testing

#

wont work

meager heart
#

what you guys trying to do ?

ornate pawn
#

The addAction wont work with empty marker

#

haha i added a helipad invisible and it works but the addAction stills appears on my scroll menu at all times

#

how is it going @meager heart

meager heart
ornate pawn
#

meeh its cool i will use the helipad with animation disable

#

but @meager heart do you know how to hide BIS_fnc_holdActionAdd ?

#

this is my script:

#
[   
  player,   
  "Preparation",   
  "scripts\BEW\Logistics\images\attach_ca.paa",   
  "scripts\BEW\Logistics\images\attach_ca.paa",   
  "_target distance p2 < 5",  
  "_target distance Marshalling_Area < 5", 
  {},   
  {},   
  {   
  p2 switchMove "Acts_JetsCrewaidL_idle_m";
   sleep 3;
   
   p2 switchMove "Acts_JetsCrewaidFCrouch_in";
   sleep 2.9;

   p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
   sleep 2;

   p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
   sleep 2;

   p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
   sleep 1;

   p2 switchMove "Acts_JetsCrewaidFCrouch_out";
  },   
  {},   
  [],   
  10,   
  1000,   
  false,   
  false   
] call BIS_fnc_holdActionAdd;
#

the addAction works but its on my scroll menu at all times

#

how can i hide it or disable if im not close to the marshalling_area

meager heart
#

on screen ?

ornate pawn
#

yeah on my scroll menu

meager heart
#

so it will be only in scroll menu and not on screen ?

ornate pawn
#

no

#

okay

#

I'm trying to do marshalling animations

#

for a milsim base

#

but i want airforce guys to have marshalling actions only if they are inside the marshalling area

#

but

#

the addAction is there all the time on my scroll menu i want it to disappear if im not inside the marshalling area

#

understand?

#

i'm not good at explaining things haha

wary vine
drowsy axle
#

Okay

meager heart
#

what is Marshalling_Area ? @ornate pawn

ornate pawn
#

are you guys trying to open a door with animation or just unlocking and locking the door?

#

Marshalling_Area is a helipad

meager heart
#

ok

ornate pawn
#

I'm using it to mark the marshalling are so the signal man knows where to stand

#

in order to be able to marshall incoming helicopters

#

but those actions are in the players scroll menu even if i'm a mile away

meager heart
#

action should be removed after use ?

ornate pawn
#

not after use

#

okay

#

lets say im the signal man and theres a helicopter inbound

#

i need to run to the marshalling area in order to be able to get the actions in my scroll menu

#

and if i'm not inside that area then i want addActions to disappear

#

get it?

#

if im inside the marshalling area then i get the marshalling actions in my scroll menu

#

if im not then don't

#

thats what i want

meager heart
#

ok

#

var_helipad < helipad name, replace it with your

0 spawn {
    [   
        player,   
        "Preparation",   
        "scripts\BEW\Logistics\images\attach_ca.paa",   
        "scripts\BEW\Logistics\images\attach_ca.paa", 
        "_this distance2d var_helipad <= 5",  
        "_target distance2d var_helipad <= 5", 
        {},   
        {},   
        {   
            p2 switchMove "Acts_JetsCrewaidL_idle_m";
            sleep 3;
            p2 switchMove "Acts_JetsCrewaidFCrouch_in";
            sleep 2.9;
            p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
            sleep 2;
            p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
            sleep 2;
            p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
            sleep 1;
            p2 switchMove "Acts_JetsCrewaidFCrouch_out";
        },   
        {},   
        [],   
        10,   
        10,   
        false,   
        false   
    ] call BIS_fnc_holdActionAdd;
};
#

@ornate pawn

ornate pawn
#

no addAction

#

maybe cause of this line?

#

"_this distance2d Marshalling_Area <= 5",

#

distance2d?

#

i change it to distance

#

and i was missing };

#

now it works

meager heart
#

nice

ornate pawn
#

thank you so much dude

#

hey

#

one more thing

#

how would you add the remoteExc to thos animations so everytbody can see the animations

meager heart
#
[p2,"Acts_JetsCrewaidL_idle_m"] remoteExec ["switchMove",[0,-2] select (isMultiplayer && isDedicated)]; //--- fix for all kind of hosts
#

@ornate pawn

ornate pawn
#

thanks dude

little eagle
#

This is flawed. isDedicated already implies multiplayer mode.

meager heart
#

yeah but local host, mp host

#

ultimate fix lol

little eagle
#

Not really. switchMove has local effects and therefore has to run on every machine.

#

It should just be:

[p2,"Acts_JetsCrewaidL_idle_m"] remoteExec ["switchMove"];

Everything else is wrong.

ornate pawn
#

so you're telling me that switchMove isn't good for MP?

#

??? you guys confused me

little eagle
#

A command having local effects doesn't mean it "isn't good for MP". No idea where you got that idea from.

ornate pawn
#

so what should i use?

#

playMove?

little eagle
#

remoteExec switchMove.

ornate pawn
#

so remoteExec makes it MP

#

haha

little eagle
#

remoteExec makes the command be executed on remote machines.

ornate pawn
#

okay

little eagle
#

If you use my simple syntax it makes the command be executed on every machine.

#

Which is essentially the same as if switchMove had global effects.

#

Like, e.g. playMove.

ornate pawn
#

so cause last time i was doing the marshall animations and the pilot didn't see any animations

#

i was just standing there hahaha

#

but on my end i was doing all the animations

meager heart
#

also possible that playMove will not work with those animations, not sure

little eagle
#

.... except that playMove only works when executed on the machine that owns the unit. remoteExec switchMove works when executed on any machine.

ornate pawn
#

yeah i'm not using playMove i'm using switchMove with sleep command

#

to let it do the animation properly

little eagle
#

You'll soon see how wonky it looks thanks to the scheduler. Have fun.

meager heart
#

๐Ÿ˜€

ornate pawn
#

hahaha

#

waitin on arma 4

#

lol

little eagle
#

We'll see if it'll be any better.

ornate pawn
#

hopefully

meager heart
#

arma 4 just will be... soon โ„ข ๐Ÿ˜„

ornate pawn
#

its been a long time

#

if i want to add another addAction to the sqf do i need to place it inside the 0 spawn { or do i need to place that before every single addAction?

meager heart
#

don't understand why you adding hold actions to a player tbh

ornate pawn
#

then should i use regular addAction?

#

regular actions would work better?

#

is because i wanted to add a custom image to the addAction

meager heart
#

no i mean... you are adding hold action to a player and wait until he will be close to helipad... maybe add it for helipad ?

ornate pawn
#

no cause he needs to be looking at the helicopter in order to marshall

#

you know what marshalling is right?

meager heart
#

yeah... saw that in movies with john rambo couple times /s

ornate pawn
#

lol

#

do you have any clue why the addActions wont work in MP?

#

do i need to add something to the script or the init.sqf

meager heart
#

do you have any clue why the addActions wont work in MP?
sure... something went wrong

ornate pawn
#

yeah but do i need to add something to the script or init.sqf?

#

cause it works for me but im hosting

#

and my friend doesn't see the action

meager heart
#

how you add it ?

ornate pawn
#

sqf file

#

1 sec

#

this is the only like in init.sqf

#

//Jail Door Lock
[] execVM "JailDoor.sqf";

#

and this is the sqf file

#
//- Open Jail Door

[ 
  player, 
  "Abrir Puerta", 
  "images\take_ca.paa", 
  "images\take_ca.paa", 
  "_target distance JailLaptop < 2", 
  "_target distance JailLaptop < 2", 
  {}, 
  {}, 
  { 
    _target playaction "Putdown"; 
 sleep 3; 
 JailDoor setVariable["bis_disabled_Door_1",0,false]; 
  }, 
  {}, 
  [], 
  0.5, 
  1000, 
  false, 
  false 
] call BIS_fnc_holdActionAdd;


//- Close Jail Door

[ 
  player, 
  "Cerrar Puerta", 
  "images\take_ca.paa", 
  "images\take_ca.paa", 
  "_target distance JailLaptop < 2", 
  "_target distance JailLaptop < 2", 
  {}, 
  {}, 
  { 
    _target playaction "Putdown"; 
 sleep 3; 
 JailDoor setVariable["bis_disabled_Door_1",1,true]; 
  }, 
  {}, 
  [], 
  0.5, 
  1000, 
  false, 
  false 
] call BIS_fnc_holdActionAdd;
cosmic kettle
#

@ornate pawn addactions need to be executed on each client, did you do that?

ornate pawn
#

by how?

#

exactly

#

?

cosmic kettle
#
[ 
  player, 
  "Abrir Puerta", 
  "images\take_ca.paa", 
  "images\take_ca.paa", 
  "_target distance JailLaptop < 2", 
  "_target distance JailLaptop < 2", 
  {}, 
  {}, 
  { 
    _target playaction "Putdown"; 
 sleep 3; 
 JailDoor setVariable["bis_disabled_Door_1",0,false]; 
  }, 
  {}, 
  [], 
  0.5, 
  1000, 
  false, 
  false 
] remoteExec ["BIS_fnc_holdActionAdd", -2];
ornate pawn
#

so remote exec mmm..

#

okay

cosmic kettle
#

^but the best way would be to just make sure he also executes the script that adds the actions

#

initPlayerLocal or something

ornate pawn
#

now not even me can't see the addActions

#

lol

meager heart
#

also with

"_target distance JailLaptop < 2", //--- caller _this
  "_target distance JailLaptop < 2",  

you will have the same troubles as it was b4

cosmic kettle
#

yeah just saw it

#

what is _target

#

replace it with ```sqf
cursorTarget / cursorObject

err actually, you just need
```sqf
player
ornate pawn
#

initplayer?

#

initPlayer.sqf

#

?

cosmic kettle
#

no I mean try

ornate pawn
#

okay

cosmic kettle
#
[ 
  player, 
  "Abrir Puerta", 
  "images\take_ca.paa", 
  "images\take_ca.paa", 
  "player distance JailLaptop < 2", 
  "player distance JailLaptop < 2", 
  {}, 
  {}, 
  { 
    player playaction "Putdown"; 
 sleep 3; 
 JailDoor setVariable["bis_disabled_Door_1",0,false]; 
  }, 
  {}, 
  [], 
  0.5, 
  1000, 
  false, 
  false 
] remoteExec ["BIS_fnc_holdActionAdd", -2];
#

I don't know where you are using _target if you actually mean the player

#

but let's assume you do

#

@ornate pawn ^

ornate pawn
#

the action works perfectly in another mission

#

even in MP

#

i don't know why isn't working in this sample mission

cosmic kettle
#

perhaps you failed to rercreate the exact conditions then?

ornate pawn
#

nope

#

i did exactly the same thing

cosmic kettle
#

what do you do to execute it

ornate pawn
#

init.sqf

cosmic kettle
ornate pawn
#

How can i add remoteExc to this line of code? : JailDoor setVariable["bis_disabled_Door_1",0,false];

cosmic kettle
#

You don't, you can just use

JailDoor setVariable["bis_disabled_Door_1",0,true];
ornate pawn
#

i had to add this in order to make the actions to work in mp

#

] remoteExec ["BIS_fnc_holdActionAdd", [0,2] select isDedicated, JailLaptop];

#

for some reason only the person that executes the action is able to locked and unlock the door

spring dune
#

is that legit way?

private _y = _x;

Yeah, _y would equal _x...

spring dune
#

Example:
requiredAddons[] = {"X", "Y", "Z"};
Uhm... I'm not sure....
"X", "Y", "Z" would be equal to .pbo names?
Just need your clarification guys

torn juniper
#

Does anyone know of a way to add items/weapon to a players dead body?

spring dune
#
        (unitbackpack _unit) addItem "FirstAidKit";
        etc.
        etc.
    };```
Something like that...
#

Where "_x" โ€“ player or id or anything you need.

#

where "_unit" can be "player" as well (but i'm not sure).

torn juniper
#

I tried add item but not on a bag, ill give it a shot thx

spring dune
#

That's example, so just added for easy reading. What and where... ๐Ÿ˜‰

fossil yew
#

@little eagle - CBA_fnc_createNamespace - this can create as many namespaces as we wish?

river meteor
#

What is the best way to create a table UI element where each row in the table is a picture + text?

cedar kindle
#

@fossil yew everytime you call it it creates a new one yes

#

sure there's a limit but you won't be creating 10k of them right?

fossil yew
#

Ok thanks

#

No, just one per "module"

#

I want to avoid globals

cedar kindle
#

that's fine

fossil yew
#

Shame there is no structure support in sqf

#

Language could be as powerful as javascript

little eagle
#

You can create more than you'd ever need.

fossil yew
#

:)

still forum
#

@drowsy axle To your code from yesterday. Just don't optimize it. You won't make it any better.

little oxide
#

I have a lot of object like 750, i want to optimize it, the problem, i need a simulation on each them when player is near, dynamic simulation is cool, but i think, not compatible, because too much object, if I made a loop that create a simple object when no have any player near 50 meter of the object, and if player is near, i create a vehicle, this will be really more optimized than dynamic simulation ?

meager heart
#

probably you will lose more when that script/function/loop runs

lusty canyon
#
  1. is there a bis/cba fnc that makes the player entity throw a grenade (or any physx obj)?

  2. how do you know if an obj is physx enabled or not? like cursortarget isPhysx?

still forum
#

I think CBA Fired XEH

lusty canyon
#

i want a fnc that actually does the "firing of a grenade" or action throw something?

#

is there a grenade object dummy that doesnt blow up? i wanna throw rocks at people

little eagle
#
_unit forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"];
still forum
#

Oh missread.

lusty canyon
#

what kind of grenade is HandGrenadeMuzzle? is that the vanilla rgn? (i need a bloody rock, or a way to disable that grenades explosion)

still forum
#

That's your hand

little eagle
#

HandGrenadeMuzzle is a muzzle of the Throw weapon which only has one compatible magazine: HandGrenade.

still forum
#

It's the weapon. Your hand that does the throwing basically

lusty canyon
#

what happens if the player doesnt have the grenade in the inventory will it still do it?

little eagle
#

You can't fire a weapon with no ammo. Nothing will happen.

lusty canyon
#

so i have to add the item to inventory first then run the forcefire? how can i then get that whatever thrown object into a var?

little eagle
#

You want them to throw HandGrenade_Stone?

lusty canyon
#

yes throw stone/rock/turd any non explosive and the object has to stay alive for awhile

little eagle
#

Which object?

lusty canyon
#

the HandGrenade_Stone

little eagle
#

Grenades cannot die anyway. I mean they could, but they still explode as normal.

lusty canyon
#

ok so first a have to additemtovest "HandGrenade_Stone""

then make a player addEH "fired" if ( firedBullet == "HandGrenade_Stone") //do stuff to it in flight

then throw action player forceWeaponFire ["HandGrenadeMuzzle","HandGrenade_Stone"];

am i on the right track?

drowsy axle
#

@still forum Thanks. That's what I did. Ended up scrapping it anyway. ๐Ÿ˜ฆ

little eagle
#

The muzzle HandGrenadeMuzzle doesn't support the magazine HandGrenade_Stone. And it has no fire mode called HandGrenade_Stone either.

#

The muzzle HandGrenade_Stone supports the magazine HandGrenade_Stone. And it's only fire mode is also named HandGrenade_Stone.

#

So HandGrenade_Stone everywhere.

meager heart
#
private _grenades = currentThrowable _unit;
_unit forceWeaponFire [_grenades select 1,_grenades select 1];
#

no ?

#

like just anything selected

little eagle
#

Kinda. I think that would work, but only because the fire mode happens to be the same string as the muzzle for handgrenades.

lusty canyon
#

ok so after i do player forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"];
will that stone stay in game ? for how long?

@meager heart what does that code do?

little eagle
#

The "stone" will be thrown and then it has a lifetime...

lusty canyon
#

can i modify its lifetime in the EH?

little eagle
#

ammo = "GrenadeHand_stone";

#

can i modify its lifetime in the EH?
No.

#

timeToLive = 6;

#

6 seconds.

#

Inherited indirectly from class CfgAmmo/Grenade

lusty canyon
#

6s is not enough time, plus i dont want to mod cfg....
can i throw something thats not a grenade? like a physx baseball? (im guessing forcefire wont like that?)

still forum
#

You can throw a stone. Then on firedEH spawn a physx ball. Set it to the same velocity as the stone. And delete the stone

#

There is a physx baseball?

little eagle
#

๐Ÿค” You could delete the grenade once thrown and replace it with a custom created object. Then you setVelocity on the object whatever velocity the grenade had.

still forum
#

๐Ÿ˜„

little eagle
#

Requires a physx object though.

lusty canyon
#

right thats a good idea! but yeah where can i get a physx object that small?

little eagle
#

Well, is there a physx basketball?

meager heart
#

cough i saw someone was throwing some animals... cough

still forum
#

I think there was one in LoW?

#

throws ๐Ÿ‘ at @meager heart

little eagle
#

Yeah, I remember a basketball in A3. But is it PhysX?

#

Land_Basketball_01_F

lusty canyon
#

there is a Land_Baseball_01_F but how to know its physx

little eagle
#

Land_Football_01_F

#

Land_Rugbyball_01_F

#

Land_Volleyball_01_F

#

^^

#

They are all ThingX, so they are PhysX objects.

lusty canyon
#

ok great, thanks guys !

broken forge
#

can i make a script where units don't wander outside of a certain area?

still forum
#

Yes. Certainly

little eagle
#

Could kill them. Or attach them to a lamp post.

still forum
#

Either you spawn invisible walls via script.
Or you check periodically if they are outside of the area and move them back.

#

Or just break their legs

broken forge
#

lol

lusty canyon
#

setvelocity 0 on the dudes?

little eagle
#

0 is a not a velocity vector.

#

Also, they'd just start walking afterwards.

still forum
#

Do human units have a velocity?

little eagle
#

Do human units have a velocity?
Yes.

#

What they don't have is an up vector different from 0,0,1

still forum
#

Dumb question.. velocity player :D
does setting their velocity work? or do they speed up for a single frame and go back to normal?

little eagle
#

I remember throwing playable units around in A2 using setVelocity.

#

Was fun on a server to make people float.

still forum
#

I remember making rocketjumps in A2

little eagle
#

I would make Voold float in the air and then throw him down to his death.

#

Fun times.

meager heart
#

we did little crysis mod... hold action with text "Maximum speed" and setVelocityModelSpace or setAnimSpeedCoef lol

lusty canyon
#

in the rare occurence that the player is completely naked how do i add the ammo = "GrenadeHand_stone"; ?
(or force it to add even when all gear slots are full?)

little eagle
#

add a dummy backpack, then add the grenade, then remove the dummy backpack.

#

Bag_Base is a nice one, because it has no model to load/show.

lusty canyon
#

there is no forceAddIgnoreFull ?

little eagle
#

lol, you funny

still forum
#

Even if there was that..

#

Where to add it too?

little eagle
#

There is addWeaponItem, which works with magazines, but the last time I tried, it failed on the Throw weapon.

still forum
#

If there is literally no place to add something to

little eagle
#

Dedmen, a mag to a weapon.

lusty canyon
#

forceAddRockToUnderwear!

little eagle
#

Not being able to hold anything, because you don't wear a uniform is a dumb flaw of the A3 inventory system.

lusty canyon
#

biggest flaw is they are not even truly naked!! atleast take off that shirt!

little eagle
#

That's even more unlikely to happen than exploding heads.

lusty canyon
#

how about setting the ammo = "GrenadeHand_stone"; inventory weight to 0? (in script not cfg)

little eagle
#

inventory weight to 0?
You need a container to hold it, even if the weight is 0. One container could hold infinitely* many of them though.

#

in script not cfg
Not possible.

lusty canyon
#

i mean the weight property of the ammo itself not the container bkpk vest etc

little eagle
#

Yes, me too.

lusty canyon
#

so you can add them to full containers

little eagle
#

Yep. Not possible. Not part of the scripting API.

#

Why not go the dummy backpack route?

lusty canyon
#

yeah the bag base does solve most of the problems, wont the player see his bkpk flicker in out tho?

little eagle
#

Oh, you mean for players with already full backpacks?

lusty canyon
#

yeah

little eagle
#

I thought you mean ai without any container.

#

Well you cannot add a grenade to a unit with full inventory period.

#

Another dumb limitation.

lusty canyon
#

for something as simple as throwing a rock i have to violate the sanctitiy of a players inventory.
yeah so many dumb limitations
can c++ intercept get past stuff like this? or is it just a wrapper for native?

still forum
#

no

#

A Intercept based hack can very easily do that.
Intercept alone can't

little eagle
#

What about not actually throwing a grenade, but just doing the animation?

lusty canyon
#

yeah that can work, but then i would have to manually do the physics on the obj? (velocitytransform , torque, etc)

little eagle
#

Sure.

lusty canyon
#

atleast then i wont need to add EH

little eagle
#

Yep.

still forum
#

But the object needs to support velocity and stuff

#

I don't think houses can have a velocity

little eagle
#

Basketballs do.

still forum
#

Ah yeah. They are ThingX

lusty canyon
#

yeah its gonna be the Land_Baseball_01_F i think its the smallest of the bunch.

if i hideobjectglobal it, physx stops too?

little eagle
#

Good question. I'm not sure.

lusty canyon
little eagle
#

For that you need to guess the weapon index, which is a pretty hidden property and it changes depending on the history of what weapons the unit picked up and in which order.

#

Don't see any benefits compared to forceWeaponFire either.

lusty canyon
#

yeah fucked up either way, ill probably just give up on adding the animation for now

broken forge
#

how do i make an crate have a certain amount of items (e.g. 20 guns) and then for the guns to be translated into an infinite amount within the crate

little eagle
#

Crates can only hold a finite amount of items afaik.

broken forge
#

as in the crate system from the antistasi scenario

little eagle
#

Should ask the developers on how to do that. Doubt anyone here knows.

broken forge
#

kk, ty

warm hedge
#

Is there anyway to hide 3DEN's interface via script command?

little eagle
#
findDisplay 313 createDisplay "RscDisplayEmpty";

???

warm hedge
#

not worked

little eagle
#

What do you mean by hide?

warm hedge
#

Like backspace

little eagle
warm hedge
#

Hmm

#

Probably not

little eagle
#

Have you tried them all?

warm hedge
#

Try them all idolatrously?

little eagle
#

I mean, some look promising like ToggleUnitSel.

warm hedge
#

Definitely that's not it

#

Or maybe I am looking at wrong place

little oxide
#

ctrlshow false on each control

#

YOu can't hide the display directly i think

warm hedge
#

Okay maybe that's the answer

#
{_x ctrlShow false} forEach (allControls findDisplay 313) ; //hide
{_x ctrlShow (ary select _forEachIndex)} forEach (allControls findDisplay 313) ; //show```
#

Thanks @little oxide

warm gorge
#

Does anyone know any good usages of multiline drawIcon3Ds that I could look at? Im trying to draw nametags above players with multiple lines, but cant seem to get it looking right because at different distances the lines seem to intersect

tough abyss
#

If, for example, Iโ€™m transmitting publicVariableClient to publicVaribleServer stuff every second between letโ€™s say 65 clients will there be significant network lag (server has good connection related stuff)?

#

The only content transfered is a bool

#

Or should I use get/set var with global param checked

still forum
#

publicVariableClient/Server is obviously better

tough abyss
#

Danke

errant jasper
#

Side question. If I setVariable with the public arg to true, and the value is the same locally, will it still broadcast the value? For example:

missionNameSpace setVariable ["MyGlobal", 456, true];
missionNameSpace setVariable ["MyGlobal", 123, false];
// Will this broadcast?
missionNameSpace setVariable ["MyGlobal", 123, true];```
still forum
#

yes it will

#

Because others may not have the same variable

#

and you are telling everyone to set that variable to what you want

errant jasper
#

Thx. Was also my guess, but you never know with Arma.
Edit: Well I guess we do know, but you know what I mean -- I guess.

#

From the BIKI I gather that, if you use public setVariable any addPublicVariableEventHandlers on the receiving sides do not run?

still forum
#

What?

#

PVEH's are made for exactly that

#

to trigger on the receiving sides

errant jasper
#

That's my thinking too. So the BIKI is wrong/omitting things in this case?

still forum
#

Where did you read that?

errant jasper
#

Well no where does it say that it does. Basically on addPublicVariableEventHandler: "This event handler will detect if a missionNamespace variable (it is attached to) has been broadcast over network with publicVariable, publicVariableClient or publicVariableServer commands and will execute EH code upon detection. "

For setVariable, on the 'public' parameter: "Boolean - when true, the variable broadcast is global and persistent"

My interpretation of broadcast here is that the new assignment is sent to others and JIPs, but not that broadcast automatically implies PVEHs run, especially since the docs for addPublicVariableEventHandler explicitly mentions only the public* commands. Maybe I am just weird, but even Example 2 for addPVEH does both the setVariable without broadcast and then does a public, although that example does look like it has been griefed - that variable name is not even valid is it?

#

I mean it all makes sense that it works like you say. Just not the impression I get from BIKI.

still forum
#

It will fire when a variable has been broadcast.
But you are not sure if broadcasting a variable will fire it?

#

Like... Just read what you just wrote?

errant jasper
#

Well sorta. If you say that: EH will happen if you BROADCAST with commands X, Y and Z... Then yes, it is not immediately apparent to me it will also happen if you broadcast using command W.

little eagle
#

setVariable will trigger PVEH too. JIP however will not.

#

Oh, setVariable will not trigger the PVEH on the local machine. Only on remote machines. It's exactly the same as publicVariable.

#

Not sure what the setVariable owner version does when the target is the local machine.

errant jasper
#

My best guess is that it will set the variable, but not run any PVEHs.

little eagle
#

Not so sure. The message will go through the server, because clients don't know owner ids.

#

So maybe it will trigger it anyway.

#

But what happens if you do it on the server?

#

publicVariableServer for example will trigger PVEH when executed on the server, while publicVariable will not.

#

Needs some testing I guess.

errant jasper
#

Sounds like. We can go even stranger. Like will publicVariableClient then trigger if the target client is itself?

little eagle
#

publicVariableClient fails outside the server.

shadow sapphire
#

How do I get the position of a trigger from a script that's run in that trigger generically (without naming the trigger)?

little eagle
#
getPosWorld thisTrigger

?

shadow sapphire
#

Wow. I was pretty far off. I was thinking like getpos this trigger.

little eagle
still forum
#

You were pretty far off? Not at all. You just had one space too many

shadow sapphire
#

Oh, shoot. @little eagle, I don't think this will work for my case, because the script isn't in the trigger field, it's an sqf being called by the script. I was trying to figure out how to say that, but I failed originally.

#

Also I tested it and it didn't work.

#

Wanted to be sure before I troubled you.

little eagle
#

Pass thisTrigger to your script then.

shadow sapphire
#

I tried searching the Discord, because I know I've been taught this relatively recently, but I couldn't find the post. So... How do I do that?

little eagle
#
private _fnc_myScript = {
    params ["_trigger"];
    hint str getPosWorld _trigger;
};

[thisTrigger] call _fnc_myScript;
#

This, inside the condition field, should print the triggers position twice every second.

#

And it's how you pass arguments to a function or script.

tough abyss
#

If i were to do publicVariableServer and the client happened to be losing connection (no connection left to server) would the request still go through once the connection is restablished?

little eagle
shadow sapphire
#

@little eagle

call {
thisTrigger spawn {
_G1 = [(getPos _this), WEST, ["B_Soldier_TL_F","B_Soldier_GL_F","B_Soldier_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos _this), WEST, ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
{
    {
    _x setBehaviour "SAFE";
    _x setFormation (selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"]);
    } forEach units _x;
} forEach [_G1,_G2];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 1;
deleteVehicle _this
};
};

Isn't working. I know I'm misunderstanding the syntax, but I don't know what it is I'm missing.

still forum
#

UDP

#

But arma takes care of them not getting lost

#

What's not working on that?

tough abyss
#

so it will send again as connection is restablished?

still forum
#

It should

#

dunno

#

It's still Arma

tough abyss
#

true will test and report back

shadow sapphire
#

Me, @still forum or Cloud? "What's not working on that?"

still forum
#

yes you

#

That call looks weird but it won't break that

shadow sapphire
#

It still isn't recognizing thisTrigger.

#

Note that this script is in an SQF file that is being executed from a radio trigger.

still forum
#

Is the script in the trigger? Or how do you get from trigger to that script

shadow sapphire
#

_this = execVM "script.sqf";

#

In the trigger field.

little eagle
#

Well, of course no local variables carry over if you don't pass them to that script.

#
0 = [thisTrigger] execVM "script.sqf";
#

Then:

params ["_trigger"];

inside that script file.

shadow sapphire
#
0 = [thisTrigger] execVM "USPlatoonSecurity.sqf";

Then:

if (isServer) then {
    params ["_trigger"];
    call {
        thisTrigger spawn {
        _G1 = [(getPos _this), WEST, ["B_Soldier_TL_F","B_Soldier_GL_F","B_Soldier_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
        Sleep 1;
        _G2 = [(getPos _this), WEST, ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
        Sleep 1;
            {
                {
//                _x execVM "Gear\FN_CentralGreen.sqf";
                _x setBehaviour "SAFE";
                _x setFormation (selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"]);
                } forEach units _x;
            } forEach [_G1,_G2];
        [_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
        Sleep 45;
        _G2 copyWaypoints _G1;
        Sleep 1;
        deleteVehicle _this
        };
    };
};```

Is still saying the same thing.
little eagle
#

No, thisTrigger is undefined in USPlatoonSecurity.sqf.

shadow sapphire
#

Right. I get that. I don't understand how to define it there.

little eagle
#

The whole call and spawn is weird. They just make it more complicated than it has to be, serve no purpose.

shadow sapphire
#

Okay.

still forum
#

call and spawn don't make any sense. Your script is already spawned

little eagle
#

You don't define it there. You already passed it and stored it in _trigger with the params.

shadow sapphire
#

@little eagle, OH! Okay, shit. Got it now. Thank you.

#

Thanks to you as well, @still forum.

inner swallow
#

i'm curious why you didn't just make the script use the trigger's variable name

little eagle
#

Well, there's no need to give it a name if you pass it as variable.

#

That way you can recycle the script for multiple triggers.

#

You know, avoid hard coding.

inner swallow
#

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

#

using it for multiple triggers wasn't mentioned as a requirement

little eagle
#

True, but then there would've been no need to put it into a file in the first place.

hushed minnow
little eagle
#

Only these three.

neon snow
#

stupid question, what is the list of types in isKindOf ?

little eagle
#

RiverX, the parents listed in the config viewer.

neon snow
#

@commy2 Thank you

little eagle
#

Some useful classes are CAManBase, Tank, Car, Helicopter, Plane, Ship_F ... from memory.

#

StaticWeapon

shadow turtle
#

Not sure whether this is the right place to post it in, however - I am an author of a marker addon for A3, and I would like to ask - how does one declare a new category for the markers? At the moment they're flooding Flags category, and I would like to declare a new one, in order to put them here.

neon snow
#

So there isnt probably the parent like aircraft(to sum up helicopters, planes and uavs)?

little eagle
#

Adami
markerClass = "System";

#

markerClass = "Military";

#

etc.

#

RiverX, best to consult the config viewer.

neon snow
#

Ok will do

shadow turtle
#

@little eagle In this case I want to declare a new, custom category. If I put in something else than default ones in markerClass, would it outright create another category?

little eagle
#

I think Air is the common parent class for Helicopter and Plane.

shadow turtle
#

Let's say, WW2Markers category.

little eagle
#

And UAVs are themselves either Plane or Helicopter already. Depending on how they fly.

neon snow
#

@commy2 Thank you, that will do, I will just put in script iskindof with plane and heli

little eagle
#
    class CfgMarkerClasses {
        class MyTag_CustomMarkerCategory {
            displayName = "My Custom Markers";
        };
    };
#

MyTag_CustomMarkerCategory can then be used as markerClass.

shadow turtle
#

Excellent, I'll try it out once I'll be able to, thank you very much for assistance

neon snow
#

Does array "vehicles" has only alive vehicles?

little eagle
#

Doesn't mention dead vehicles on the wiki, so I believe it includes dead and living.

#

Returns an array of all vehicles available to current client. This command returns both empty and crewed vehicles but not soldiers. It will also return "WeaponHolderSimulated" of dead bodies (weapon on the ground). Vehicles created with createVehicleLocal will only be returned on the client that created them.

neon snow
#

@little eagle Thank you very much ๐Ÿ˜ƒ

warm bronze
#

Hey hey,
Trying to get a group of playable units to teleport into the Cargo of a chopper post mission start. Was initially using this in the vehicles init field. {_x moveInCargo this} forEach units GrpName; before I realised locality was an issue. Then moved onto {_x action [โ€œGetInโ€, this]} forEach units GrpName; the last example works for the most part. However it seems that when the unit does the get in action, it randomly begins falling to its death (probably due to the helicopter moving away from the unit trying to get in). Is there a better way to do this that I am overlooking?

meager heart
#

if you need to do it from unit/vehicle init field, probably better way will be just

this moveInCargo vehicle_name; 
```unit init ^

next option 
```sqf
{_x moveInCargo vehicle_name} foreach units group this;
```group leader init ^ 
but possible that there will be no player in leader slot
#

@warm bronze

warm bronze
#

@meager heart spawning in the helicopter once all the players are connected and in game. So that wouldnโ€™t work unfortunetly.

meager heart
#

you need some delay ?

warm bronze
#

Yeah but simply putting a sleep in wouldnโ€™t work, if players have issues connecting. Was thing that I could put a check in to see if the unit is alive or not, but the way it spawns it is briefly alive in mission load before deleted and cached

meager heart
#

๐Ÿค”

#
0 = this spawn {
    waitUntil {time > 0}; 
    waitUntil {!isNull _this}; 
    _this moveInCargo vehicle_name; 
};
```unit init ^
#

@warm bronze

knotty mantle
#
{[_x, this] remoteExec ["moveInCargo", _x]} forEach units GrpName;

This in your helo init should solve any locality issues ๐Ÿ˜ƒ

warm bronze
#

Fuck yeah. Was just looking at doing that.

meager heart
#

glhf ๐Ÿ˜€

warm bronze
#

Thanks for the help team ๐Ÿ˜„

meager heart
#

yeah... in case some funny things will happens, you can try that spawn ^ thingy ๐Ÿ˜„

warm bronze
#

Will do thanks!

sinful sky
#

I'm trying to find the nearest vehicle, so if Landvehicle is all cars how do I find helicopters? or just all vehicles in one go, tried "all" "allvehicles" "air" "aircehicles"

meager heart
#

in trigger ?

sinful sky
#

yea

#

well sqf

meager heart
#
{_x isKindOf "Helicopter"} count thisList > 0
sinful sky
#

_items = items player;

if ("ToolKit" in _items) then {

// private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landvehicle"], 6] select 0;
_veh setDamage 0;

};

#

ok il try changing it to that but I'm sure I tried it

#

nope, not working not when I add it to that script^

#

hmmm, well something else is going on

#

I think that will work when i change somthign else but is there not a class for all objects

#

well vehicles

#

well it seems to work perfectly with cars, but with helicoptes its worked a couple of times

#

not sure why its not working reliably

meager heart
#
_veh = nearestObjects [_caller, ["Helicopter"], 6] select 0;
#

try this ^

sinful sky
#

ok so get rid of the private line?

#

wait

#

no that's what I have

#

_items = items player;

if ("ToolKit" in _items) then {

// private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["helicopter"], 6] select 0;
_veh setDamage 0;

};

#

its not coming up with the erro _veh undefined ether its just doing nothing

meager heart
#

private <string> and private <array> are deprecated

#
private _variable = <value>;
sinful sky
#

odd because it works perfectly with "Landvehicle"

#

ok

#

tbh I don't know what the private part is doing

meager heart
sinful sky
#

yea that doesn't help.

#

the wiki is not for people like me

meager heart
#

well... check there Dscha examples

#

you will get it

sinful sky
#

now I'm even more confused because if that is the problem why does it work with my first script

#

ive never even come across " private" before

meager heart
#

also to format code in discord you can try this ๐Ÿ˜€
```sqf
your code
```

sinful sky
#

I keep forgetting how to do that

#

I guess because I'm thinking bout something else lol

meager heart
#

๐Ÿ˜€

sinful sky
#

sqf
private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landVehicle"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];

#

nope

#

that ^ works fine

#

_items = items player;

if ("ToolKit" in _items) then {

// private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landvehicle"], 20] select 0;
_veh setDamage 0;

};

#

and that

#

well, thanks but I'm now more confused, Il ask somebody tomorrow cheers.

meager heart
#

also try it with 'air' but first jump in heli, start engine, kill engine and then try your code ๐Ÿ˜€

#

@sinful sky

sinful sky
#

well Air seems to work atm

#

I think something else is going on

warm bronze
#

Could just remoteExec an addaction to repair it?

sinful sky
#

well I'm doing it so a repairtruck with the Action has to be close to another to flip or repair it

#

its possible when I first checked "air" I messed something else up

warm bronze
#

Ahh rgr.

sinful sky
#

still helicopter was Half working and I guess I should do something about the
private ["_caller","_veh"];
?

#

dos it even need to be private?

meager heart
#
hint str (nearestObjects [player, ["Air"], 50] select 0); // works
hint str (nearestObjects [player, ["Helicopter"], 50] select 0); //works
sinful sky
#

why hint str?

meager heart
#

well... private command allows you to declare a variable in current scope...

sinful sky
#

and whats the object being called?

meager heart
#

and whats the object being called?
try it in debug console

sinful sky
#

ermm, must be me, nothing happening

#

oh lol, the debug covers up the hit

#

hint

meager heart
#

why hint str?
str converts any value into a string

sinful sky
#

ok

#

I can see what that's doing now.

meager heart
#

yes hint works with strings or structured texts lol

sinful sky
#

didn't know you could use hint like that

#

useful for bugfinding

meager heart
#

yep

sinful sky
#

only problem I have now is that I'm searching for both a landvehicle and "air" one after the other and it will repair both the nearest car and heli at the same time

#

not exactly what I was looking for but it mean the repairtruck gets repaired everytime I fix the heli lol

#

o well

#

cheers for the help

meager heart
#

yeah... well, just take your time and check wiki every 5 mikes lol

#

np

sinful sky
#

indeed

sinful sky
#

oh great now the other script I didn't even touce isn't working...

#

how could this
private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landVehicle"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];
work perfectly until I fixed the other one

#

and iven even remove the other one now

meager heart
#
private _caller = _this select 1;
private _veh = nearestObjects [_caller, ["landVehicle"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];
sinful sky
#

ok thanks but this makes no sence

#

sense"

meager heart
#

private ["_caller","_veh"];

sinful sky
#

but it worked.

#

I'm just trying to understand

meager heart
#

better show all code

sinful sky
#

ive pasted it all up there^

meager heart
#

is it file and you execVm it ? or that is function ?

sinful sky
#

I duno

#

i half understand this stuff

meager heart
#

show how you call it

sinful sky
#

or the stuff i use

#

addaction

#

_flip1 = repair_truck addAction ["Flip", "flip.sqf"] call BIS_fnc_MP;

#

nope

#

great so ive acheaved basically nothing i thought i understood, now the first thing i did is broken and I'm more confused

#

yay

#

lol

#

well actualy I'm pissed off

#

time for ben even tho i hate giving up while its broken

#

bed*

#

thanks for the help

meager heart
#

BIS_fnc_MP

[repair_truck,["Flip",{[_target,_caller] execVM "flip.sqf"},[],1,false,true,"","_this distance _target <= 5"]] remoteExec ["addAction",[repair_truck,-2] select isDedicated,true];
#

lol

sinful sky
#

tbh I'm not going to try that because its just going to confuse me more I'm sure, but thanks

#

the MP bits been there all along

#

it works... then it doesn't

#

well i did try it before i leave and its not working still,

#

its clearly calling the sqf with ither that or mine but the sqf its just miraculously broken..

meager heart
#

what you need to do with that truck ? just repair it ?

#

flip..

#

unflip..

sinful sky
#

unflip it

#

it worked perfectly before i started asking u guys about the repair bit

meager heart
#

lol

sinful sky
#

well tbh ive now wasted about 3 hours fucking about with this and I'm basicly no further in

#

i was

#

now I'm not

meager heart
#

don't know what to tell you tbh... maybe "the best of luck" and give you this

#

๐Ÿช

meager heart
wispy lynx
#

Anyone know why spawned AI would run around and shoot randomly? I have AI spawned at locations, they're load outs are scripted random, they're behavior is scripted random, and they're waypoints are scripted random. All that seems to work okay, but a random few seem to orient in a random direction and begin firing their weapon into the ground. They continue to do it until they run out of ammo. They also move position and reorient to shoot, almost seems like they are looking through the map... I have checked to see what they are firing at, and there doesn't seem to be anything in the general direction. Any ideas?

meager heart
#

lol

#

do they fire at random positions/directions or that is the same point for all ?

wispy lynx
#

each one seems to choose a random direction to focus at.

#

they also "twitch" left and right, very rapidly, while they fire, so it's like they are looking in multiple areas within a 45 degree arc of the direction they target.

meager heart
#

is it with vanilla ai or some addons ?

wispy lynx
#

total vanilla (units and equip). Also doesn't seem to matter what map, same behaviors.

#

What's throwing me off is that it only happens with random units, if it was all of them (each scripted unit), then I could focus in on what was the cause.

knotty mantle
#

i so want to see a video of this ๐Ÿ˜„ Sounds hilarious ๐Ÿ˜› Apart from the fact that it is a problem for you obviously ๐Ÿ˜„

little eagle
#

There obviously is a bug in your script somewhere causing this.

quartz coyote
#

Hello Could you tell me if it is possible to make an AI walk while i'm spawning [UNIT1, _unitCaptureData] spawn BIS_fnc_UnitPlay; ??

Cuz all the AI does is glide around like a ghost xD

still forum
#

I swear I just read that on twitter somewhere

#

You can spawn a "parallel" script that forces them into the walking animation I guess

quartz coyote
#

Yeah, that was me lol

#

I tried several ways but looks like the animation takes over anything you make the AI do

still forum
#

The walking animation probably won't match the unit though. Meaning his feet will most likely still slide around unrealistically

quartz coyote
#

yep

#

thats it

still forum
#

Yes

#

I think I have two accounts tho. Nah.. That has stuff from 2012 so probably my only account

quartz coyote
#

^^

#

so, how would I manages to deal with this gliding AI... it would be awesomely cool to have AI walking around exactly how you'd want the to ...

still forum
#

Instead of UnitPlay make a custom script that set's AI waypoints and have them follow the path that way...
But that requires that AI does what you tell them to do. So I guess that's not an option...

quartz coyote
#

it is not indeed

#

cuz in my case, i am making the ai walk inside a badly designed Mod building

#

he would go through walls and shit

#

Anyone got a clue ?

young current
#

make path points and make him walk along those

#

into the model I mean

quartz coyote
#

I'm a scenario maker... not a modder...

young current
#

walking inside/over obejcts is limited at best and requires the models to be set up properly

#

that could work

meager heart
#

there was some "unitcapture/play" tutorial from a guy who won the #armachinima

peak plover
#

Anyone figure out how to give actions to head with ACE3 interaction?

still forum
#

Config or script?

peak plover
#

skript

#

["CAManBase", 0, ["ACE_MainActions"],

#

ACE_HeadActions ?

#

I can't even find where the possiblities are defined

cedar kindle
#

one arg should be selection iirc

still forum
#

That defines the parent. Not where the action is on the model

peak plover
#

Wait so the parent is not where it's modeled

still forum
#

Add them to ACE_Head class. With config.. With script.. eh..

peak plover
#

["CAManBase", 0, ["ACE_Head"],?

peak plover
#

ohh thanks a bunch

austere granite
#

Does anyone have a script that export config hierarchy properly? Like tracing inheritance of subclasses?

#

Basically i wanna change some value somewhere in cfgVehicles, for example in inherited turret subclasses, but the InheritsFrom doesn't seem to give me a proper order

#

For example (InheritsFrom (configFile >> "cfgVehicles" >> "AllVehicles" >> "NewTurret" >> "ViewGunner"))
returns config.bin/CfgVehicles/AllVehicles/ViewOptics

But with all the commands that return config classes, viewOptics is defined AFTER the NewTurret, so that doesn't give a working config

#

Instead i suspect it's actually inherited from class all { class ViewPilot; } but I can't seem to figure out how that inheritance is done through script

#

Extra example, using a BIS config that shows what i need ```cpp
class Tank;
class Tank_F: Tank
{
class AnimationSources;
};
class APC_Tracked_01_base_F: Tank_F
{
class AnimationSources: AnimationSources
{
class HideTurret;
};
};

So animationSources comes from Tank_F here as it should be
#

but script shows (InheritsFrom (configFile >> "cfgVehicles" >> "APC_Tracked_01_base_F" >> "AnimationSources"))
config.bin/CfgVehicles/All/AnimationSources

little eagle
#

Are you asking for the correct inheritance of APC_Tracked_01_base_F/AnimationSources/HideTurret ?

austere granite
#

So in my case i'm looking at zoom configs, but i'll use vanilla config example instead, so lets say for APC_Tracked_01_unarmed_base_F i want to change the initPhase to 0

#

I wanna have a script that allows me to export a config with proper inheritances that would modify that value

#

So right now what my script does is export something like this: https://pastebin.com/yTS5EadJ
But that class ViewGunner is trying to inherit a non-existant class, the inheritsFrom command says it's allVehicles >> ViewOptics but that is defined AFTER newTurret, instead it is all >> ViewOptics but i'm having a hard time wrapping my brain around making sure i can mark that properly for exporting

#

I'm a brainlet

strange urchin
#

I know that newTurret is defined in the main body of one of the classes instead of under Turrets. Might be something like that

austere granite
#

Yes i know what the result should be, just not how to get it from a script right now

little eagle
#

Why would you want to change the initPhase of the animation? Can't you not use animate and leave the initPhase as is?

austere granite
#

So in my case i'm looking at zoom configs, but i'll use vanilla config example instead

#

i dont want to

#

Just because i had a example of how the config should look to be functional on hand

little eagle
#

In your example it says HideTurret and initPhase 0. That has nothing to do with the zoom.

austere granite
#

....

little eagle
#

It's missing ViewOptics.

austere granite
#

I know

#

k different example

#

lets say I wanna change maxFov in this

little eagle
#

Let me create and post an example and maybe we can clear this up. Gimme a minute.

austere granite
#

This should be good

#

Thing is that in that inheritsFrom (configFile >> "cfgVehicles" >> "Tank_F" >> "Turrets" >> "MainTurret") shows allVehicles

#

As in that configfile, class Tank { class NewTurrets } }

little eagle
#

Stop talking

#

I said gimme a minute.

#

jeez

#
// config 1
class M1 {
    class A {
    };

    class B: A {
    };
};

// config 2
class M2: M1 {
    class A {
    };
};

// master config (config 1 loaded before config 2)
class M2 {
    class A {}; // M2/A
    class B {}; // inherits from M1/A
    };
};
#

Read this. This is essentially your problem.

#

The issue is that you cannot not modify the inheritance of class M2 with a third config patch that is loaded after config 2.

#

There is now way in Arma configs to avoid this problem.

austere granite
#

I do know how to patch it for the record

#

That does it

#

I'm looking into a script to create a config that shows that inheritance correectly

strange urchin
#

Itโ€™s usually a better habit to just make your own class anyway

little eagle
#

With the goal to create a patch config that doesn't modify inheritance? Because there will be no such script, because this particular example cannot be patched.

austere granite
little eagle
#

Without editing the inheritance that is.

#

Why do you keep posting links?

austere granite
#

To give extra info? ๐Ÿ˜Š

#

lel

little eagle
#

The classnames collide. There are two different classes with the same name. And there is no way to reference them.

#

Arma configs suck. We've been over this four years ago.

#

Same reason why B_Heli_01_F or whatever the name is has an UBC error when starting ACE. The error will never go away, because it can't go away.

austere granite
#

Hmm okay, was aware they're not exactly great, but figured some smart young lad as yourself probably had an magical workaround

little eagle
#

Sadly no. I can only tell you that it's not possible. You'll have to manually change all modified config entires and live with your addon modifying base classes. Hoping it doesn't break any mods.

manic sigil
#

Is something wrong with disableai "WEAPONAIM"? I keep getting a foreign value error.

#

"SUPPRESSION" and "AUTOCOMBAT" seem to trigger fine, but that one in particular doesn't seem to want to run.

little eagle
#

There are quite a few "foreign enum value" false alarms in the current version.

#

It should still work though. Whatever it does.

quartz coyote
#

@meager heart thanks !

manic sigil
#

@little eagle I'll try; it's my safezone script, tested it last night on the public server and it kinda-sorta worked. Kept flipping player-sided units back to non-captive long enough to get shot... and even the captive enemy units in town would engage forces outside the town.

Ideally, a unit enters the zone and goes back to safe mode, walking, no engaging, until they leave.

#

Kinda worked for one unit, didn't work for the next :/

quasi thicket
#

Can anyone spot something wrong with this trigger?

#

if i run the "0 = [] spawn whz_fnc_moveInPlane" part in debug console (GLOBAL execute) than, the function is executed

torn juniper
#

anyone have any pointers or know any methods to add/remove stuff from a dead body? The only way I can seem to get it to work is by adding an item to a bag/vest but I am trying to remove a weapon

#

using mpkilled EH - trying to use clearWeaponCargo (_this select 0); or removeAllWeapons (_this select 0); is not giving me any results

little eagle
#

Persons don't have a weapon cargo. So clearWeaponCargo will not work.

#

It seems weird to me that you would use MPKilled for this. removeAllWeapons only works on the machine where the object is local. So why not use the killed eventhandler? That one only triggers on the machine where the object is local. So it would work perfectly for this.

inner swallow
#

@quasi thicket are you sure the startMission trigger is being activated? Put a hint in the On Activation box to see if the trigger fires at all

quasi thicket
#

yes.. did put a hint on it

#

and on hosted it worked, but on dedi it didnt

inner swallow
#

might be locality issue

quasi thicket
#

eventually changed the condition to just "this" and blufor not present and it worked

#

and made sure that the trigger overlapped startMission trigger exactly ๐Ÿ˜›

#

not the best solution... but it SEEEMS to work

inner swallow
#

hmm. that just means startMission isn't triggering

quasi thicket
#

well, startMission starts a script with a title screen and that worked fine

inner swallow
#

๐Ÿค”

#

is startMission server only?

quasi thicket
#

it seems more that it didn't activate for the players in the trigger

inner swallow
#

^^probably won't be because title screen, i guess

#

you could also make all of the triggers server only, and remoteExec stuff

#

but i mean that's more of an effort

quasi thicket
#

well, trigger seems more complicated than i thought

#

Triggers seem to create a list of AI and players who meet the conditions as well

winter rose
#

well, it does list everything that meet the trigger rules AFAIK

subtle ore
#

^ Yes

winter rose
#

you could filter with thislist select { isPlayer _x }

little eagle
#

well, trigger seems more complicated than i thought
Yes, they are more complicated than what you want to achieve has to be.

austere granite
#

Just don't use triggers tbh

torn juniper
#

@commy2 ๐Ÿ’ฉ#9913 was thinking of MP setting but I will take a look at that

#

probably was my issue was trying all different commands

#

but ill try regular killed EH

#

and I was trying weaponcargo thinking it was a dead body container

vagrant mango
#

Hey guys. Maybe I am nuking this... but I have a trigger checking to see if 2 AA sites are alive... so the syntax I am using is (!alive aa1_1) && (!alive b1_1) where aa1_1 is the aa turret and b1_1 is the person manning it.... problem is I have 3 turrets/personnel per site......... is there a much better/more efficient way I can check this instead of (!alive aa1_1) && (!alive b1_1) && (!alive aa1_2) && (!alive b1_2)..... (!aliveb2_3)

strange urchin
#

Well, are they all in a group?

vagrant mango
#

Yes.

#

But checcking the group doesn't work

#

Alive expects an object not a group. At least that was the error it threw me.

strange urchin
#

What variable stores your group?

meager heart
#
(count ([unit_1,unit_2,vehicle_name] select {!alive _x}) isEqualTo count [unit_1,unit_2,vehicle_name]) 
#

@vagrant mango

vagrant mango
#

Thanks! And none currently? I am not sure of the question exactly @strange urchin Are you asking what I set the variable as for the group?

strange urchin
#

Yes

vagrant mango
#

Just gave it a variable name of a1... but when I tried to use that with the !alive it threw an error telling me it expected a singular object not an entire group.

strange urchin
#

Then give it the name a1

vagrant mango
#

I had. This is the error it throws if I set the group variable name to a1

#

and then have the trigger looking for !alive a1

#

What I just sent you is what it throws.

strange urchin
#

if (count ((units a1) select {alive _x}) == 0)

vagrant mango
#

Which the way I am reading it then it doesn't like it being passed a group variable.

#

Oh okay.

#

I see how you have that written out.

#

My fault.

#

I was writing it specifically like I had been

#

which was just !alive a1

#

!alive a1

strange urchin
#

Donโ€™t know what sldt1ck was doing up there

#

Overcomplicated

#

Yeah, you still have to check each group member

#

But doing a forEach or something is the best way

vagrant mango
#

Cool. So I can kind of gleam the basics of what its saying... which is if the count of units for variable (group) a1 == 0 then this expression is true correct?

#

er units alive == 0

#

so if I have 2 sites then I could just logical and them together right?? with two statements?? so

#

(if (count ((units aa1) select {alive _x}) == 0)) && (if (count ((units aa2) select {alive _x}) == 0))

strange urchin
#

I would do this:

vagrant mango
#

Meaning I want to show that all units are dead for both sites?

#

There is also the big part which is I want to see that all of the AA pieces (turrets) themselves have been destroyed, which I don't believe turrets themselves can be grouped/added to groups?

#

Okay, im listening.

strange urchin
#

Replace (units aa1) with (units aa1 + units aa2) instead

vagrant mango
#

Oh, I didnt realize you could do that.

strange urchin
#

Yep

#

Array addition

vagrant mango
#

(if (count ((units aa1 + units aa2) select {alive _x}) == 0))

strange urchin
#

Hm. Why do you have parenthesis around the if?

vagrant mango
#

Whoops. Holdover from when I ANDd the two if statements.

#

if (count ((units aa1 + units aa2) select {alive _x}) == 0)

#

There.

#

So... ideally they are taking out the AA turrets too... could I do something lazy to keep from evaluating ALL of the pieces (6 in total) and just look for the one final one? That way the objective doesn't show as completed when they just kill the units on the turrets?

#

B ecause correct me if I am wrong, but emplacements/vehicles themselves are not part of groups? Just the units that occupy them?

strange urchin
#

Kill a unit and tell me what assignedVehicle <unitname> returns

#

Or just kill them all and check one if you donโ€™t feel like figuring out which name belongs to which static

vagrant mango
#

Uhm... sorry but how do I check that?

strange urchin
#

Debug console

vagrant mango
#

Alright one sec.

strange urchin
#

Should appear when you press escape

#

There are 4 pairs of lines at the bottom

#

Type it into one of the pairs

#

The result is printed below

vagrant mango
#

The if statement?

strange urchin
#

Sure

#

But also the thing I told you to do

#

So type assignedVehicle aa1_1

#

Into one of the boxes

vagrant mango
#

Okay typed in before I do anything it returns false obviously since the condition hasnt been met, gonna kill one and see what the return is.

strange urchin
#

Those four lines are mighty useful if you want to check something repeatedly

#

You can do the same thing in the main text box if you want

vagrant mango
#

So

strange urchin
#

Kill aa1_1 and tell me what their assigned vehicle is upon death

vagrant mango
#

For assignedVehicle aa1_1 I get aa1_1

strange urchin
#

Pardon?

vagrant mango
#

Oh

#

Upon death

strange urchin
#

What about before?

vagrant mango
#

<NULL-Object> is what it returns

#

before it is aa1_1

#

Right

#

My bad

#

I forgot

#

aa1_1 is the vehicle

strange urchin
#

You named the statics

vagrant mango
#

b1_1 is the person.

strange urchin
#

Lol

vagrant mango
#

One sec.

#

Shit lol.

strange urchin
#

Then do the same thing but with b1_1

vagrant mango
#

Okay

#

There

#

right now its.

#

b_1 assigned to aa1_1 and subsequently the same

strange urchin
#

Excellent

#

So we can do this:

vagrant mango
#

on death its <NULL-Object>

strange urchin
#

Rip

#

Check vehicle b1_1

vagrant mango
#

for vehicle b1_1 it returns aa1_1

#

when they are alive. I went back into the 'play' session.

#

When he dies though.

#

aa1_1

strange urchin
#

Ah, we have a winner

vagrant mango
#

aa1_1 still

strange urchin
#

So, what kind of AA gun is it?

vagrant mango
#

Its from RHS I believe. The djit.

#

9k38

#

djigit

strange urchin
#

So, thereโ€™s no reason they would bail out or the crewman would get deleted, right?

vagrant mango
#

No. I set them to no pathing so they specifically wouldnt

strange urchin
#

I donโ€™t think they would regardless

vagrant mango
#

Just to be on the safe side I did.

strange urchin
#

But are the statics locked?

vagrant mango
#

How do you mean?

strange urchin
#

Just as youโ€™d lock your car

vagrant mango
#

Oh.

#

No

strange urchin
#

Lock them

kindred lichen
#

Ok, I got a tough one here. Is there a way to do remove the parking break or put a car into neutral?

strange urchin
#

Nope

vagrant mango
#

Okay, theyre locked. Thats to prevent people from jumping in/out correct?

strange urchin
#

Yes

#

If they do, then the gunner will be forced out

#

And that will make our condition produce incorrect results

#

So

#

if (count ((units aa1 + units aa2) select {alive vehicle _x}) == 0)

#

That should work

vagrant mango
#

So in the debug with all the units alive that returned true.

strange urchin
#

What

vagrant mango
#

Whoops

#

nevermind

#

It was a typo.

#

the _x was now part of vehicle

#

so it read vehicle_x

strange urchin
#

Lol

vagrant mango
#

that made it true.

#

So count is the part that iterates through correct?? SO for the array of groups aa1 and aa2, select to see if their vehicles are alive... if THAT is equal to 0 then return true fulfilling the trigger and triggering the .sqf I wrote.

#

Am I reading the statement correct?

strange urchin
#

Count just counts the array

#

Select evaluates each item

vagrant mango
#

Okay thats what I was getting at. Right on.

#

Thanks man I appreciate the help.

#

I suck ass with code/scripting and learning a whole new language while doing makes it worse.

strange urchin
#

Now that I think about it

#

if ({alive _x} count (units aa1 + units aa2) == 0)

#

That does the same thing, and looks fancier

vagrant mango
#

how so?? does it not evaluate the static emplacements??

strange urchin
#

Wait

#

I copied that

#

if ({alive vehicle _x} count (units aa1 + units aa2) == 0)

#

That does it in one statement

#

Not sure if itโ€™s much faster, but it probably is

#

Thereโ€™s a speedometer in the bottom left of the textbox

#

It checks the average runtime of whatever you put in the textbox

vagrant mango
#

.0057 ms for the original

#

.005 for the new one.

#

For the trigger, should it be a server only trigger evaluation?? Since I wouldn't want it running on every machine and it doesn't really need to?

#

as long as the result is proper execution across all clients?

strange urchin
#

That is correct

vagrant mango
#

okay. The call I have set up right now is execVM "AA_Destroyed.sqf"; should work correct?

strange urchin
#

Provided that AA_destroyed.sqf exists in the main directory of your mission

vagrant mango
#

The reason I want it running on all clients is because AA_Destroyed.sqf does a map update, moving some markers around and changing alpha transparancy.

#

It does.

strange urchin
#

As long as they are global markers, you can run it on the server

vagrant mango
#

How do I ensure if they are global or not?

strange urchin
#

They can only be explicitly created as local

#

So they probably are global

vagrant mango
#

Awesome. Thanks.

#

Appreciate all of your help!

strange urchin
#

Iโ€™m just glad to help an aspiring scripter

vagrant mango
#

๐Ÿ‘

warm gorge
#

Is it possible to make it so pressing escape closes a createDisplay display with priority over closing a background createDialog? Or do I need to add a key handler to the background dialog to detect the escape press

outer fjord
lusty canyon
#

how do you get the center pos of any map?

meager heart
#
getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition") //--- not reliable - map maker/designer will set this manually in cfg
getArray (configfile >> "CfgWorlds" >> worldName >> "safePositionAnchor") //--- more reliable but also not 100 (was fails)
#

@lusty canyon

lusty canyon
#

i dont know the world names nor do i want to know them, i just want a relative pos that can work on any map (doesnt have to be absolute center just near enough)

meager heart
#
//--- option 2
_path = configfile >> "cfgworlds" >> worldname;
_size = getnumber (_path >> "mapSize");
_size = _size / 2;
_center = [_size,_size,0];

//--- option 3
_centerposition = [worldSize / 2, worldsize / 2, 0];
lusty canyon
#

actually nvm just realized i can just get the pos from openmapclick

#

i do have another question, say im admin in dedicated, and i already have zeus access, can i make another player that joined my server also have zeus? like curator assign?

meager heart
#

btw you not need "know the world names" for first 2 ^ ๐Ÿ˜€

#

afaik yes with zeus

lusty canyon
#

i mean i want to have more than one player open zeus at the same time

#

so everyone can work on the mission

winter rose
#

@lusty canyon use worldSize ?

#

divide by 2 and voilร , you have your X/Y of the map centre

meager heart
#

yeah... like option 3 from above ^ probably the easiest

lusty canyon
#

right thanks for that one guys, say if i run globalexec openCuratorInterface;
does that make everyone in the server have zeus window open?
can they exit from it themselves?
or i need to run close?

winter rose
#

ooooooh indeed @meager heart , "ninja'd (I was behind in the conversation, my bad)

meager heart
#

๐Ÿ˜„

peak plover
#

How do I get a vector

#

From player to cursorTarget

#

And use with velocity to push the target away from player

peak plover
#

It's a punching script. So I want to ragdoll the target and then push him away from the player that is punching

young current
#

Id say its a combination of those commands

#

OnePunchMod?

peak plover
#

Kind of yeah

meager heart
#

maybe cursorObject setVelocityModelSpace [0, 10, 0]; ?

#

@peak plover

peak plover
#

That's always gonna move it in 1 dirc

#

I want target to be pushed away from player

meager heart
#
0 spawn {
    private _start = ASLToAGL eyePos player;
    private _end = (_start vectorAdd (eyeDirection player vectorMultiply 20)); //--- range 
    cursorObject setPos _end; 
};
#

@peak plover

lusty canyon
#

i want to remoteExec create AI on the HC, what is the id num for the target field?
or will (entities "HeadlessClient_F" select 0) give me the first HC player object?

#

    private _target = (entities "HeadlessClient_F" select 0);
    private _script = {
        if !(hasInterface) then {
            //do stuff on HC
        };
    };
    _script remoteExec ["BIS_fnc_call", _target];

will this work?

winter rose
#

I think it should

#

but it is usually recommended to disable usage of BIS_fnc_call (in Description.ext), for two reasons:

  • network security
  • performance (you send the whole code block over network)
lusty canyon
#

im not touching desc.ext (mod not mission)

#

if not fnc_call that what?

winter rose
#

run it locally?

#

what is this code for

lusty canyon
#

like i already said create AI on the hc

winter rose
#

sorry for making you repeat yourself, I tend to not scroll up enough today - my bad

#

don't forget to check whether there is a HC or not

lusty canyon
#

how do you then get the HC player object? or ID

meager heart
#

also if !(hasInterface || isDedicated)...

lusty canyon
#

is HC considered dedicated tho?

winter rose
#

count entities "HeadlessClient_F" == 0 ?

#

please mind that a mission "properly" configured, disabling BIS_fnc_call, will break your code here (it will do nothing)

you can define a function like JayTAC_fnc_myFunction loaded on every machine
then use it remoteExec ["JayTAC_fnc_myFunction", _hcClientId]

little eagle
#

if !(hasInterface || isDedicated)
This makes no sense.

winter rose
#

dedi doesn't have interface indeed

little eagle
#

Is there any reason to use remoteExec here anyway? Can't you just use:

if (!hasInterface && !isServer) then {
    // do stuff on HC
};

in init.sqf?

lusty canyon
#

so now i have to worry about BIS_fnc_call being disabled by mission makers??

winter rose
#

yyyup

little eagle
#

Well, is this for a mod or a mission?

lusty canyon
#

like i said i want to create AI on the HC

#

if i cant use BIS_fnc_call then what can i use that doesnt involve adding cfg

winter rose
#

for what occasion do you spawn things? why not server?

lusty canyon
#

if server then whats the point of HC

little eagle
#

: if i cant use BIS_fnc_call then what can i use that doesnt involve adding cfg
Depends. Is this for a mod or a mission?

winter rose
#

(a random thing though, aren't HC a mission maker consideration?)

lusty canyon
#

mod

little eagle
#

Then you cannot use remoteExec period, as any mission maker could disable it completely.

#

remoteExec is not suited for addons.

lusty canyon
#

actually private mod for my unit servers

meager heart
#

if !(hasInterface || isDedicated) ... it will make sence if server and client is on the same PC, if HC is on the same PC with server also, commy

winter rose
little eagle
#

Well, if you have absolute control over the missions, then you can use remoteExec freely.

#

Even with BIS_fnc_call

#

Just have to make sure not to block it.

#

But again, I don't see any reason to use it at all.

#
if (!hasInterface && !isServer) then {
    // do stuff on HC
};

This in some init script and it will only run on a HC.

#

No, >: if !(hasInterface || isDedicated) will never make sense.

lusty canyon
#

ok ill just use that conditional then

little eagle
#

It's also highly confusing boolean logic with the not or.

lusty canyon
#

how dare mission makers disable bis_fncs

#

^outrage^

little eagle
#

Well, mission makers demanded it, because they thought it'd make their missions safe.

#

Which of course it doesn't, but w/e

lusty canyon
#

if its an anti cheating thing, doesnt battleEye already do this shit?