#arma3_scripting

1 messages Β· Page 565 of 1

runic edge
#

evening there, noob question incoming :

#

i'm looking at execVM and call commands and i cant get the difference ! i can apply call to an object but not execVM ?

winter rose
#

hmm example plz?

runic edge
#

i want to call a script that reload a crate

#

execVM "crate.sqf";

#

or

#

mycrate call "crate.sqf";

cunning crown
#

No, it's either
myCrate execVM "crate.sqf" OR myCrate call YOUR_FUNCTION

runic edge
#

ok

#

so i can apply execVM to a certain object then ?

cunning crown
#

Yup

runic edge
#

ok and call is used only for functions ?

cunning crown
runic edge
#

but it's confusing πŸ₯΄ execVM is code isn't it ?

winter rose
#

execVM calls the code that is contained in a file

#

basically, execVM takes a file, call takes code

runic edge
#

ok much clearer πŸ™ƒ

#

thanks a lot guys

cunning crown
#

(And if not clear, blame Lou!)

runic edge
#

I already using that option too much
apologies kind sir

winter rose
#

nevah (apologise), you're learning!
if something is not clear after you did read… we gladly explain

west sand
#

Hi all, I'm trying to recreate the AI respawning behavior in the Virtual Arsenal, I'm currently stuck on what I'd have to do after an AI target is killed since setDammage will not work if the AI isn't alive.

sudden yacht
#

I have a script that attaches a unit to an another in a medic animation. Works fine in single player. In MP the unit some times does not attach it selt to the correct unit position.... Keep in mind I have detach using a sleep command a couple seconds later... Any idea why?

queen cargo
#

Show the Script

#

@sudden yacht

#

@west sand what AI in virtual Arsenal?

west sand
#

Referring to the roaming targets that stand/patrol near the player when you go into the Virtual Arsenal practice range

#

Not necessarily BIS_fnc_arsenal itself

queen cargo
#

Killed EH will help you out

exotic tinsel
#

How do i allow third person when connected to a uav? i use the following code to allow third person when in a vehicle.

while {true} do
{
    if (cameraView == "External") then
    {
        if ((vehicle player) isEqualTo player) then
        {
            player switchCamera "Internal";
        };
        {
            if (isPlayer _x) then
            {
                player switchCamera "Internal";
            };
        } forEach attachedObjects player;
    };
    sleep 0.01;
};
still forum
#

maybe

exotic tinsel
#

testing now

#

@still forum sweet it worked. thx mate

ebon citrus
#

is there a way to disable the LOD on usertexture objects

#

or will i just have to make my own

jade abyss
#

usertexture objects?

ebon citrus
#

UserTexture10m_F

#

i need it to render at full quality no matter the range

#

the shape and textures aren't all that complicated, so i might just make an object for it

#

but im trying to avoid making a mod for now

tough abyss
#

anyone know a code for a bomb in a van with a timer after players have entered a radius??

ebon citrus
#

if you can, you could try to attach a trigger into the van

#

haven't played around with them though, so im not sure how they work exactly

#

another option is to spawn a waituntil

tough abyss
#

Ok, thank you

ebon citrus
#

and once the condition is filled, enter a sleep for timer ammount and then spawn a gbu at the van position

#

i can write a real quick and dirty oen for you if you want to that you can work off of

oblique arrow
#
  • Place trigger around the van in the radius you want
  • use createVehicle (or a similar command) to create an explosve charge
  • wait for x seconds
  • setDamage 1 on the charge
tough abyss
#

Yeah thank you!

ebon citrus
#

alrighty, just s second

#

will the van be moving?

oblique arrow
#

Btw do you peeps know if theres a command to change a units side?

tough abyss
#

yes it will be moving to a building and then driver has time to escape and it explodes

ebon citrus
#

ummm...

#

you could create a headquarters unit

#

and then a group under that headquarters

#

and move the unit you want to change the side of into that group

#

it's a bit dirty, but i remember getting it working maybe once

#

@tough abyss hold on, let me dm you

exotic flax
#

Use addAction on the vehicle, set a timer (eg. 30 seconds), when timer reaches 0 place an explosive under the vehicle and make it explode

jade abyss
#

@oblique arrow Create a group on "enemy" side, let the unit join that group.

#

"Headquarter" is not needed anymore (formaly createCenter)

oblique arrow
#

hm oki

jade abyss
#
//_unit = on side west
_group = createGroup east;
[_unit] joinSilent _group;
//== _unit on side East
ebon citrus
#

thanks Dscha for clearing the headquarters thing. I had not needed to use anything like this in years

jade abyss
#

And i already forgot it (had to search for it's correct name again πŸ˜‚ )

ebon citrus
#

btw, here is the quick script i wrote for what @tough abyss was asking for:

null=this spawn
{
    waituntil{{_x distance _this < 500} count allPlayers > 0};
    _charge = createMine ["SatchelCharge_F", position _this, [], 0];
    _charge attachTo [_this,[0.7,-0.85,-0.87]];
    [_charge, 600] call ace_explosives_fnc_scriptedExplosive;
    _this addEventHandler ["Explosion", {
        params ["_vehicle", "_damage"];
        {
            if (typeOf _x == "SatchelCharge_Remote_Ammo") then {
                 "Bo_GBU12_LGB" createVehicle (position _vehicle);
            };
        }forEach(attachedObjects _vehicle);
        _vehicle removeAllEventHandlers "Explosion";
    }];
};```


Intended use:
To be dropped into the Init field of vanilla arma 3 Van Boxxer. Ace is a requirement. It will spawn an explosive bag ontop of the fueltank that is defusable with a defusing kit

multiplayer compatible (i assume, haven't actually tested it out yet)
#

it has surely got some points to improve still, like if someone detonates a grenade nearby, the truck will go skyhigh

#

but i cant be asked

#

"it's a feature"

#

feel free to use, reuse, publish or abuse. i dont care

slim oyster
#

I am doing intensive allUnits enemySide & distance selects for a variety of functions, and I am thinking of storing that data in the unit with a timer as a way of mitigating redundant calls for those checks again.
Does this make sense? Macros are CBA/ACE

params ["_unit", ["_forced",false,[false]]];

private _enemyArray = GETVAR(_unit,enemyArray,[]);
private _enemyUpdateTime = (CBA_MissionTime - GETVAR(_unit,enemyArrayUpdateTime,(CBA_MissionTime - 5)));
if ((_forced) || (_enemyArray isEqualTo []) || (_enemyUpdateTime >= (GETMVAR(EnemyUpdateFrequency,5)))) then {
    private _unitSide = side _unit;
    _enemyArray = (allUnits select {!(_x isKindOf "TargetSoldierBase") && {[_unitSide, (side _x)] call BIS_fnc_sideIsEnemy}}) - allCurators;
    SETVAR(_unit,enemyArrayUpdateTime,CBA_MissionTime);
    SETVAR(_unit,enemyArray,_enemyArray);
};

_enemyArray```
jade abyss
#

Just4info:
```sqf
code
```

#

πŸ‘

exotic flax
#

How and how often is this called/needed?

slim oyster
#

this is in an addon that I hope to build on, as of now it gets called by 3 modules with various timings

exotic flax
#

Because the function itself makes sense (to me), but I can image it can put a lot of data on an unit and if it's called for each unit a lot of time as well.
Of course I don't know in which context it's used, but I guess in some use cases functions like nearEntities or allGroups could give similar results.

slim oyster
#

Function is typically only called for group leader, but occasionally called for MGs and vehicle gunners. Array is typically filtered more for specific cases like visibility, group size, etc.

pulsar trail
#

Want to set up like a private teleporter from one door way to another door way. I want to replicate this across 4 different doorways what's the best / easiest way around this. (Like a sky scraper having an elevator to certain floors but the floors are spread out across buildings. So each door has its own teleporter.)

#

I figured the addAction would be used in the init section but how would one move the player to the location?

#

anyone know any good tutorials for scripting in arma like I am currently going through college and just barely scratched the surface of coding so like is there a good scripting tutorial for eden that I can look into?

#

Like how to get a certain object give it a name and then once I have that I should be able to figure it out by myself

#

Would I setPos or setPosworld

still forum
#

@slim oyster
why the ugly GETVAR macros that CBA/ACE themselves don't even use because they hurt readability too much, and then all these superfluous parenthesis that hurt readability even more :U
You could probably just use cba cachedCall for that, or was it ACE which has that?
also the last entry of the if condition should probably be lazy eval.
also it might be better to do -allCurators first, before you iterate through the units+curators, and then filter them back out afterwards.

errant patio
#

Is it possible to get whether or not the player is in a state that lets them fire their weapon?

winter rose
#

which state, "animation", or ammo, gun etc?

errant patio
#

animation - so false when they're running or sprinting and true when they're in combat stance, standing with weapon up etc.

winter rose
#

none I know

errant patio
#

dang

#

time to go make a list of animations lol

winter rose
#

afaik!

also, maybe the information is in the animation config, so you may get the animationState and go through the config to see if the unit can fire

errant patio
#

πŸ€” that's an idea

winter rose
#

now is it a good one, yet to be found out πŸ˜„

smoky verge
#

so, setVelocityTransform is asking me velocity
how can I give it a certain velocity?

#

the velocity page on the biki says I have to define the classname of a vehicle or something, which I don't/can't have

winter rose
#

copy/paste your code?

```sqf
/* your code here*/
```
↓

/* your code here */
brave jungle
#

I think i'm right, using the UI EH onLBSelChanged on a combo box would fire it?

smoky verge
#
[ 
 getPosASL car1, 
 getPosASL car2, 
_currentVelocity, 
 _nextVelocity, 
 _currentVectorDir, 
 _nextVectorDir, 
 _currentVectorUp, 
 _nextVectorUp, 
 _interval
];```
#

as you can see I barely started

errant patio
#

lou you may be pleased to know the answer is as simple as using find with the right keywords on the animationstate

winter rose
#

how so?

errant patio
winter rose
#

oh this way! indeed - beware of ptential weird naming? (like weapon raised but it's a cutscene anim or such thing)

#

@smoky verge what are

_nextVelocity,
_currentVectorDir,
_nextVectorDir,
_currentVectorUp,
_nextVectorUp,
_interval```?
smoky verge
winter rose
#

did you read this page πŸ˜„

#

there is a Parameters section

finite sail
#

specifically, those velocities are vectors

still forum
#

@smoky verge it doesn't take a classname. it takes an object that you apply the transform to

winter rose
#

I think he figured that out (see above example)

smoky verge
#

yeah I know @winter rose , I'm there
and from that parameters section I went into the velocity page
https://community.bistudio.com/wiki/velocity
but I don't understand what it exactly wants
@still forum why would it ask the object I'm moving?

winter rose
#

…to move it?

smoky verge
#

didn't it already ask it in the first parameter?

winter rose
#

it's not a class

#

it's a variable that references the object itself

smoky verge
#

yeah my bad, meant variable name

winter rose
#

a class is a config entry, the vehicle is an instance of such class

no problem πŸ˜‰

smoky verge
#

What I asked is what to put in fromVelocity and toVelocity

finite sail
#

a velocity vector

jade abyss
#

[0,0,0] = stop

#

[1,0,0] moving 1 at x axis

#

etc

smoky verge
#

oh, and I guess thats [x,y,z]

finite sail
#

yes

smoky verge
#

that was what I was hoping to understand, thank you a ton

jade abyss
#

Description:
Return velocity (speed vector) of Unit as an array with format [x, y, z].
Just like in the description πŸ˜„

finite sail
#

so you need to work out the vector from the start pos to the end pos

smoky verge
#

yeah I thought that too but the example looked different and got confused
I should be set, probably... possibly.

jade abyss
#

looks okay, tbh

#
if ((velocity _plane1 select 2) > 50) then { hint "Aircraft is climbing up too fast!"; };

index 2 = Z axis

#

So if velo on Z > +50 = "too fast"

finite sail
jade abyss
#

Yes

finite sail
#

Ah yes, I use it to "shove" an uncooperative AI driven vehicle

jade abyss
finite sail
#

yes, that one

#

πŸ™‚

smoky verge
#

whats an interpolation interval?

jade abyss
#

how many steps

#

oh wait

smoky verge
#

its a value between 0 and 1

jade abyss
#

0 start
1 final

smoky verge
#

at what point to start?

jade abyss
smoky verge
#

yeah

jade abyss
#

at what point to start?
the hell i know? πŸ˜‚

smoky verge
#

I mean, does the interpolation thing defines at what point to start the travel?

jade abyss
#

You have to rephrase your questions a bit more (like with setVeloTrans). We don't see what you see or know what you know

finite sail
#

Sometimes, asking the right question is harder than finding the answer

smoky verge
#

Not being a native english surely doesn't help, I'll rephrase

#

I simply have no idea what the interpolation value does, what I understood is that its a value between 0 and 1 and that 0 means start and 1 final
not sure what to make of it

jade abyss
#

Same here, not a native english speaker.

#

Check the Picture

winter rose
#

@jade abyss knows ~0.7 human languages

finite sail
#

hehe

jade abyss
#

and .sqf @winter rose

winter rose
#

you know 5 sqf!

jade abyss
#

So make it 0.5

finite sail
#

i tried to listen to @weary trail and we both have the same first language

#

i struggled a little πŸ™‚

jade abyss
#

scottish?

finite sail
#

yes

jade abyss
#

πŸ˜‚

#

god, that was a good guess

#

(rly didn't knew before)

finite sail
#

im joking, btw, i understood him just fine, even when he was drunk

jade abyss
#

SanchezToday at 2:59 PM
Not being a native english surely doesn't help, I'll rephrase
I simply have no idea what the interpolation value does, what I understood is that its a value between 0 and 1 and that 0 means start and 1 final
not sure what to make of it
Have you checked the pic in setVeloTransf?

#

It can't be described easier, tho :/

ebon citrus
#

what's going down?

smoky verge
#

I might have an idea of it

#

this is the script so far

car setVelocityTransformationyTransformation  
[ 
 getPosASL car1, 
 getPosASL car2, 
[0,5,0], 
[0,5,0], 
 [0,1,0], 
 [0,1,0], 
 [0,0,0], 
 [0,0,0], 
 0.5;
]
finite sail
#

-z is going down

#

hehe

ebon citrus
#

what is setVelocityTransformationyTransformation

jade abyss
#

This moves the car 50% of the path from car1 Pos to car2 Pos, staying at the same vectorUp and Dir

#

So if car1 is at [0,0,0] and car2 at [2,2,2] -> The Pos would be [1,1,1]

smoky verge
#

I'm literally trying to keep this car in a straight line, so yeah

jade abyss
#

in a straight line to?

#

just moving forward?

smoky verge
#

yeah

ebon citrus
#

keyframe animations?

jade abyss
#

nono

ebon citrus
#

oh, ok

smoky verge
#

it should be a way to move objects

ebon citrus
#

does it need to be non-rigid?

jade abyss
#

I think, the best way would be, to understand how vectors work and what they are

ebon citrus
#

can someone link me the original request

jade abyss
#

(not advanced stuff, just basics)

ebon citrus
#

this sounds interesting

jade abyss
#

erm, scroll up πŸ˜„

#

no idea where it started

ebon citrus
#

my mouse scroll wheel is broken

#

πŸ˜…

winter rose
#

page up then :p

smoky verge
#

it started way longer than you think
I challenged @winter rose at making a train tunnel scene

winter rose
#

oh wait, I still have that somewhere πŸ˜…
didn't finish it, still rotting on my hard drive

jade abyss
#

Straight track?
Use that and force it to move along the line

ebon citrus
jade abyss
#

3den, not scripting

ebon citrus
#

so they need to have it working in script?

smoky verge
#

nah, that, would work but it would obliterate any player on it
what I'm trying to do is move the tunnel backwards to give a sense of movement without being beaten down by the engine

jade abyss
#

vectorLinConv

smoky verge
#

so set velocity transformation won't work?

ebon citrus
#

it will

jade abyss
#

Of course it will

ebon citrus
#

but making anything move smoothly in script is not really performance friendly if there are too many of them

jade abyss
#

But since i assume that you have to reset the "tunnel" models* over and over again, you can go this way

smoky verge
#

I indeed do, I'll check it out

jade abyss
#

e.g. 10 Tunnel Parts
Each one starts with a difference of 0.1 in the rangeValue (assuming using 0..1) -> loopedyloopedy and go on

ebon citrus
#

add some blur to the player's screen to make it more convincing even if the object movement is choppy

jade abyss
#

for example Β―_(ツ)_/Β―

smoky verge
#

I'm using camera shake

ebon citrus
#

sounds good

jade abyss
#

I need to check my old files, i did that Tunnelscene out of boredom before.

smoky verge
#

thanks a lot @jade abyss I'll make some tests

ebon citrus
#

you can also attach some usertexture frames with transparent textures moving slower than the "tube" and be closer to the player camera to give a perception of depth

jade abyss
smoky verge
#

so nice, a multi parameter script with a script in it that has even more parameters

ebon citrus
#

welcome to arma

jade abyss
#

You haven't even touched the surface πŸ˜‚

ebon citrus
#

or rather

#

welcome to vector maths

finite sail
#

hehe

smoky verge
#

I just wanted to move forward😭

jade abyss
#

Vector is a female Dog.

#

(i also hate it)

ebon citrus
#

me too

#

vectorDirandUp took me like months to get my head around comfortably

finite sail
#

if all you want to do is move forward, why not setvelocitymodelspace?

#

just don't go mad with it, or you can end up in orbit

ebon citrus
#

well...

#

the problem is... it's not a physics object

jade abyss
#

We had that before

ebon citrus
#

if i understood it right

finite sail
#

ah

smoky verge
#

it could

jade abyss
#

DschaToday at 3:11 PM
But since i assume that you have to reset the "tunnel" models* over and over again, you can go this way
VectorlinConv

#

@finite sail

ebon citrus
#

force the player to look up, make the object physics enabled and keep dropping and teleproting it back and forth around the player XD

finite sail
#

im not sure you can force the head dir

ebon citrus
#

me neither

#

attachoTo?

finite sail
#

*head pitch

jade abyss
#

You can't

ebon citrus
#

and then vectordir and up

#

like a dentist's chair

#

that stuff is scary

#

anyways, ive had some luck using setVelocity

finite sail
#

sounds like as much fun as being in the dentists chair IRL

ebon citrus
#

messing around with vectors and setVelocity felt like being magneto

jade abyss
smoky verge
#

I've lost you guys 10 messages ago

jade abyss
#

all fine πŸ˜„

smoky verge
#

mom I'm scared come pick me up, they are doing weird stuff

jade abyss
finite sail
#

yeah, freaks

jade abyss
#

I mean... they either play constantly with dirt or stay locked inside the rooms. Freeeeeeaky ppl

finite sail
#

everytime someone launches the editor.. the spanel brothers laugh maniacally and stroke white cats

ebon citrus
#

im going to have to say

#

the best experience working out things in arma comes when things have least to do with bohemia-stuff

#

nothing against bohemia, love em'

#

but vectors jsut make sense

#

although a bit... hard to udnerstand at first because you skipped maths in high-school

smoky verge
#

so if I understood correctly linearConversion should go in the _interval parameter of setVelocityTransformation

jade abyss
#

Yes

finite sail
#

oh yeah, in an xyz universe, you really need to get your head arround vectors

jade abyss
#

no stop

smoky verge
#

oh god oh frick

jade abyss
#

gimme a sec, i check my old files

#

Maybe you are lucky and i still have my stuff...

ebon citrus
#

when in doubt, copy what bohemia does

#

that's ok? right?

smoky verge
#

I'll pray to the content ripper gods

jade abyss
#

meh, doesn't look like it....

#

so if I understood correctly linearConversion should go in the _interval parameter of setVelocityTransformation
Oh wait, i missread that. Yeah, it has to

smoky verge
#

ahw, thats fine, I'll just have to make extra tests
I should know most of the stuff

jade abyss
#

I was confused with VectorLinConv

smoky verge
#

where should I put the VectorLinConv?

jade abyss
#

one q before:
MP or SP?

ebon citrus
#

to MP, or not to MP

smoky verge
#

SP

finite sail
#

thank god for that

smoky verge
#

yeah I'm not even gonna bother moving stuff in multiplayer

#

wierd I'm getting an error, missing ;
don't see anything wrong

car setVelocityTransformationyTransformation  
[ 
 getPosASL car1, 
 getPosASL car2, 
[0,5,0], 
[0,5,0], 
 [0,1,0], 
 [0,1,0], 
 [0,0,0], 
 [0,0,0], 
 linearConversion [5, 5, 5, 0, 1, false],
];
still forum
#

comma too many

#

that command doesn't exist

smoky verge
#

oh yeah what the hell
transformationyTransformation

#

now I'm getting a missing [

finite sail
#

its as likely to be a missing comma as it is a square bracket

#

what code editor do you use?

winter rose
#

[ 0, 1, 2 ] = OK
[ 0, 1, 2, ] = NOK

#

also setVelocityTransformationyTransformation β†’ setVelocityTransformation ?

smoky verge
#

yup
as for the comma, I don't see it anywhere before a bracket

finite sail
#

are you not familiar with transformationy, Lou? most proper coders are

smoky verge
#

@finite sail I'm in an eden trigger lmao

finite sail
#

oh right

#

good luck with that πŸ™‚

smoky verge
#

don't see this infamous comma

#

maybe the first 2 parameters need brackets?

winter rose
#

current code plz?

smoky verge
#

same as above but with correct setVelocityTransformation

winter rose
#

then ```sqf
linearConversion [5, 5, 5, 0, 1, false], // last comma
];

#

[ 0, 1, 2 ] = OK
[ 0, 1, 2, ] = NOK

smoky verge
#

that did it, for some afwul reason I though it was necessary

still forum
#

Well I already told you above that you had a comma too many..

smoky verge
#

yeah I realized that, but thoughit was in one of the vectors above

queen cargo
#

worst thing is that there aint no real reason to disallow a final comma

winter rose
#

Β―_(ツ)_/Β―

smoky verge
#

because frick you thats why

winter rose
#

πŸ¦† *

smoky verge
#

with that same code but corrected
not only it doesn't loop
but car doesn't even reach car2, it just moves once

finite sail
#

which command did you end using?

smoky verge
#

the one above

finite sail
#

ok, im not sure

#

double to starting velocity?

#

i understood all you wanted to do was to move an object towards anopther

smoky verge
#

I got confused in the way, but yeah I simply want to move an object in a direction at a stable velocity without the slightest of unwanted movement

spark turret
#

im trying to force a helicopter into a flying height of like 10m, so the ai can rappel themselves.
this flyingheight 10 and vehicle this flyinheight 10 doesnt seem to do anyhting.
any helPΓΌ?

smoky verge
#

@spark turret tried that too once, seems that AI doesn't like to fly lower than 45 or something

finite sail
#

setvelocitytransformation, as i understand it, is good for smoothly moving an object from one position to another while handling the roll, pitch and yaw in one go

#

just like th biki example, an aircraft going nose up at speed

#

the object that is being moved, what is it?

smoky verge
#

I'm using a woodbox to which all tunnel pieces are attachtoed

finite sail
#

a moving tunnel?

smoky verge
#

yup, trying to fake a train moving through a tunnel, so static train and moving tunnel

finite sail
#

ok

#

ok, gotta go on school run

#

bbiab

cosmic lichen
#

Is it possible that in Arma 3 comments in stringtable.xml files don't work?

queen cargo
#

comments?

#

what are you expecting from them?

cosmic lichen
#

Not me

#

For some reason he commented all languages he doesn't need, but arma still reads those and therefore returns an empty string.

winter rose
#

"weird flex but ok"

finite sail
#

its an xml, is commenting allowed?

queen cargo
#

bug of the XML parser then

cosmic lichen
#

@finite sail Yes, <!-- --> is the right syntax

#

Yeah I guess it's just a bug. Was just wondering if someone can confirm that

still forum
#

arma just uses a standard xml parser library πŸ€” so that shouldn't be happening.

hollow thistle
#

Single line comments work, so XML parser bug I guess.

still forum
#

Maybe someone needs to update the library 🀣

hollow thistle
#

u? bloblurkinglenny

exotic flax
#

Just implement Chromium in the backend, so we have proper XML, HTML and CSS support πŸ˜…πŸ€”πŸ˜‰

hollow thistle
#

and replace sqf with js

#

and buy everyone more ram, they'll need that for chromium

tough abyss
#

Anyone know what I did wrong?

//in config.cpp/bin inside a mod addons folder
//didn't work
class CfgVehicles {
    class Man;
    class CAManBase: Man {
        class EventHandlers {
            respawn = "[(_this select 0), 'respawn'] call salmon_heac_fnc_adjust";
            getInMan = "[(_this select 0), 'in'] call salmon_heac_fnc_adjust";
            getOutMan = "[(_this select 0), 'out'] call salmon_heac_fnc_adjust";
        };
    };
};
//placed in config.cpp/bin inside mod addons folder
//works perfectly fine
class Extended_Respawn_EventHandlers {
    class CAManBase {
        class Salmon_heac_respawn_eh {
            respawn = "[(_this select 0), 'dead'] call salmon_heac_fnc_adjust";
        };
    };
};
class Extended_getInMan_EventHandlers {
    class CAManBase {
        class Salmon_heac_getInMan_eh {
            getInMan = "[(_this select 0), 'in'] call salmon_heac_fnc_adjust";
        };
    };
};
class Extended_getOutMan_EventHandlers {
    class CAManBase {
        class Salmon_heac_getOutMan_eh {
            getOutMan = "[(_this select 0), 'out'] call salmon_heac_fnc_adjust";
        };
    };
};
worn forge
#

how didn't it work? Ie., what were the errors reported

tough abyss
#

it didn't

#

the vanilla (non cba) eventhandlers didn't exist

worn forge
#

no idea then, sorry

tough abyss
#

I did diag_log and systemchat and neither of it worked on the vanilla. It made no sense..

worn forge
#

my question today: Draw3D missionEventHandler & drawIcon3D don't appear to work on created camera interfaces (camCreate), any suggestions for a workaround?

worn forge
#

Although oddly they seem to work in BIS_fnc_establishingShot, and I can't figure out how

#

nvm, solved my own problem, cameraEffectEnableHUD true; - has to be called after the camera is activated

still forum
#

Please tell what's not working. I don't want to go looking for missing semicolons when thats not the problem

hollow lantern
#

What's an easy way to check if a unit looks trough a rangefinder?

finite sail
#

returns "GUNNER" if they are using optics

#

and check if their primaryweapon is the rangefinder

winter rose
#

currentWeapon*

hollow lantern
#

neat

slim oyster
#

for running code in a condition, it has to be in {} right? or can we (code; true) ?

#

would (true && {code; true} && {condition}) be necessary to run code before condition?

hollow lantern
#

does the firedEH works on a rangefinder? What I want to simulate is the marking of a target with it and then on that "laser pos" something gets executed. So guy pulls out rangefinder, "shoots" and then code

pulsar trail
#

Best way to disable collision on a physx object like a building? I know that disableCollisionWith is just vic based but I want to disable a skyscraper collision so I can set up a proper building floor!

young current
#

@pulsar trail keep questions on one channel

ebon citrus
#

@hollow lantern why not just waituntil laserTarget for that unit?

#

like waituntil the laser target is a valid position

pulsar trail
#

Its more of a scripting question than before so thats why I moved it

ebon citrus
#

can you make a new model for it with no collision geometry?

#

if you dont want something to have collision with anything to begin with, then that would be the best option

pulsar trail
#

No I was hoping I just could disable the collision

ebon citrus
#

feel free to disagree, though. I only do scripting and that very little

hollow lantern
#

@ebon citrus that is actually a nice idea

ebon citrus
#

also something Dscha gave an idea to do if you dont want the waituntil to run on each frame:

waitUntil
{
  uisleep 0.1;
  someBoolVarToCheck
};
young current
#

@pulsar trail delete the message on the other channel please to keep the discussion on one channel please.

hollow lantern
#

@ebon citrus do you by any chance know if I can return the unit of an object dynamically? In your example now with laserTarget I need to fetch the unit based on the rangefinder. Aka if the rangefinder will be passed on to another unit that should be used instead

ebon citrus
#

i think he is talking about getting the unit lazing the lkazertarget

#

thing is , one of the parameters for lazertarget is the unit that you want to get the target for

#

so you need to figure out the unit you want to get the target of and work from there

jade abyss
#

ah

hollow lantern
#

yup

ebon citrus
#

i'm not entirely sure if you can attach any kind of namespace variable to a specific item

jade abyss
ebon citrus
#

doesnt sound like sopmething you can

#

so attaching a script to a specific item is not possible as far as im aware of

hollow lantern
#

well you can use setVariable and getVariable

jade abyss
#
private _target = laserTarget _unitThatIsWatching;
#

That doesn't help?

ebon citrus
#

different topic, dscha

hollow lantern
#

well I need _unitThatIsWatching but base off a rangefinder

ebon citrus
#

cant

jade abyss
#

?

hollow lantern
#

so if UnitA has it, it will return UnitA

jade abyss
#

forEach unitstuff

ebon citrus
#

they are asking if they can attach an identifier to an inventory object

hollow lantern
#

if the rangefinder will be handed to UnitB it will be UnitB

ebon citrus
#

and check which unit is holding it

jade abyss
#

Then check for Inventory obj

ebon citrus
#

you can't identify any specific laser range finder

#

maybe a laser code with laser designator

#

are laser code vanilla?

jade abyss
#

Or whatever it was using

ebon citrus
#

yeah, but that works off of classnames

#

so anyone with that object in general gets to use the feature

#

not just THAT SPECIFIC item

jade abyss
#

they are asking if they can attach an identifier to an inventory object
That is a no, sadly.

ebon citrus
#

with ace, you could probably use laser codes to identify a specific designator

jade abyss
#

There seem to be IDs internaly, but nothing we as users can get.

hollow lantern
#

not even setVaraible works ?

jade abyss
#

Or just store the unit that has it in missionNameSpace and request it from there (of course, when it picks it up, store it in there)

ebon citrus
#

so basically, you need to track yourself which unit has the designator somehow and work from there

jade abyss
#

not even setVaraible works ?
No, doesn't.

hollow lantern
#

hmmm sad, ok

ebon citrus
#

inventory items are not actually objects

#

the inventory is just an array that holds information of what, in what condition you have

hollow lantern
#

yeah

finite sail
#

@pulsar trail , yes, activating the laser desi is 'firing' it

pulsar trail
#

why was i tagged my appologies

finite sail
#

i answered your earlier question

#

about firing the laser desi

pulsar trail
#

My question was about disabling collision on a building which cant be done sadly 😦

finite sail
#

lol, ok

#

who should i have tagged if not you?

#

it's @hollow lantern

#

wow.. not had a drink yet, either

hollow lantern
#

ah lol

#

Thanks

finite sail
#

np

still forum
#

@slim oyster yes. Semicolon only in code block

slim oyster
#

as long as it eventually returns a boolean, can you make nested if conditions inside the lazy evaluated code block?

still forum
#

Yes

#

It's a normal Codeblock like any ither

#

Could also pass function variable instead of cblock

slim oyster
#

thank you

worn forge
#

So it looks like even if you createGroup with the deleteWhenEmpty boolean set to false, arma will still eventually delete the group when it's empty.

ebon citrus
#

is there a local mission namespace?

#

i would like to integrate the spectrum device in a multiplayer environment, but having more than one would be really hard if the mission namespace is always global and i cant set per-device variables

#

or rather, "per-user" variables

cunning crown
cunning crown
#

The missionNamespace of playerX != missionNamespace of playerY

ebon citrus
#

am i misunderstanding some part of "global" in Returns the global namespace attached to mission.

#

ahh, public

#

heck*

#

i am

#

good one Heyoxe

#

global != public

pulsar trail
#

Best way to outright deny the usage of nvg equipment to a multiplayer server because disableNVGEquipment is for vehicles so it says?

hoary torrent
#

So, i just recently started making a real arma mission in the editor and the scripting of waypoints is a little... daunting. I had a get in waypoint working a few nights ago but it's not working anymore.

I'm literally just copy/pasting code from the wiki documentation for waypoint scripting. I'm trying to get transports loaded and moved, and unloaded with soldiers/ pilots.

ebon citrus
#

doesnt Eden have waypoint functions for that?

hoary torrent
#

I linked a driver's load waypoint with a group's get in waypoint but, that's just broken stuff

ebon citrus
#

yeah, mmm...

pulsar trail
#

It does yeah

ebon citrus
hoary torrent
#

ok, thank you

ebon citrus
#

if you want help in bypassing the whole waypoint system and scripting AI to do stuff instead, im all for that

hoary torrent
#

I do need some with something called a "knowsabout" script. I need to use this in order to trigger reinforcements

pulsar trail
#

Can I use a while true loop in arma?

ebon citrus
#

yes, you can @pulsar trail

#

but if you "should" is another question

#

very case sensitive question

hoary torrent
#

There's an officer in the base and his sole job is to callout for help. But I don't know how to make it so that when the enemy detects the players, the man runs off and triggers all manner of help

pulsar trail
#

Yeah i want to constantly have nvgs off unitl somthing is destroyed

ebon citrus
#

yeah, jsut dont

pulsar trail
#

okay whats a better solution to just have the nvgoggles off?

ebon citrus
#

just make some plot-point to give your units NVG's once the device is destroyed

#

or make a fake-nvg's and replace them with rela ones

#

like NVG's that take up the nvg-slot but are not actually nvg's

#

and call them like...

#

"NVG's (broken)"

#

or something

pulsar trail
#

how would one force gear to a multiplayers units

ebon citrus
#

make the "Officer" into its own group

#

and check until that unit is aware

pulsar trail
#

Either way thanks nica πŸ˜„

hoary torrent
#

awesome, thank you very much

pulsar trail
#

Awesome and one last question wheres a good document for like parent classes of things like for multiplayer is "player" like I guess naming conventions

still forum
#

πŸ™ƒ

young current
#

those terms you have dont really go together

#

killzonekids tutorials helped me quite a bit when I first dabbled with scripting, those might help you too

#

then BI wiki has a looot of pages about that stuff

runic surge
#

Does anyone know if a script exists that can save/export a camera's exact position and rotation? I want to take comparison screenshots between two versions of a terrain and the only way I have been able to ensure the images are aligned and oriented in the exact same way is to simply save a mission in the 3den editor, and load it again with the changes. With two terrains loaded, I can simply do this, remain the mission folder to use the other terrain, and load the mission again.

But, that is inefficient and in my case, won't work, since i would need to unload addons and restart the game entirely, which is far too slow. I also plan to take a significant number of screenshots to compare.

My idea for a solution would be to have an action or key that would "record" the current camera position, rotation, fov, and everything else relevant, and export it. That way, I can simply have a script that loads this data, so when I restart the game, I can take the new screenshots in sequence and have them be properly aligned.

I can't seem to find a good way to do this. There are commands to get the eden camera, but none to get the rotation.

ebon citrus
#

set camera position in eden for the curator object not good enough?

#

or

#

i suggest you use cameras

runic surge
#

set camera position in eden for the curator object not good enough?
I don't know what you mean by this

#

what is the curator object?

ebon citrus
#

"zeus"

#

set camera position is under the zeus stuff in 3den

#

haven't messed around with it too much because i like scripts

#

it's ok for keyframes though

#

and world building

young current
#

you can also create a camera object with scripts and switch view to it

young current
#

so it seems πŸ‘

ebon citrus
#

all good

runic surge
#

I'll look into it, thanks. The main issue I have is being able to export and reload the exact rotation of the camera from within 3den

ebon citrus
#

sounds awfully specific

#

why within 3den?

#

is that like some sort of fetish?

#

no shaming though

#

πŸ˜‚

#

everything else is already mentioned here

runic surge
#

The 3den camera controls are much faster and easier to use, and I want to be able to quickly fly around and log camera info to be used again later

ebon citrus
#

good luck

#

here

#

load into the world

#

make sure you have debug menu enabled for yourself or atleast the camera

#

open up the camera

#

hit "ctrl+c"

#

then paste it somewhere

#

hitting "ctrl+v" when you have that stuff copied immediately sets your camera to the exact point

#

@runic surge ^

#

or hit ctrl+ any number ROW key

#

and hitting that number row key again returns your camera there

#

2 ways!

#

and not at all related with scripting

runic surge
#

That seems to work almost perfectly

#

I didn't realize that actually saves the rotation now

#

Maybe it always did and I'm just a moron lol

#

thanks for help anyway though @ebon citrus

ebon citrus
#

πŸ‘Œ

runic quest
slim oyster
#

are those backwards on purpose?

#

independent to "CIV"?

runic quest
#

@slim oyster Yes, on the one hand, independent to civ, and on the other hand, civ to independent, but I don't quite understand what "GUER" means.

slim oyster
#

It is the string of the side independent/resistance

runic quest
#

tks!

frosty stratus
#

Is it possible from within a script to change a models config setting, for example I would like to be able to change the following within a script, however, I am unsure how to both get the values and then set new values

        extCameraPosition[] = {0.4, -0.2, -1.2};
    };```
still forum
#

within a script to change a config setting
no

frosty stratus
#

Bugger, thanks Dedmen

oblique arrow
#

Hm whats the 'easiest' way to make a custom mission sound work with playSound3D FoxBlepDerp ?

ebon citrus
ebon citrus
#

also, if you want the sound to be attached to an object, use say3d instead

tawdry hatch
#

How do I make an object or a screen in arma play a media, using an ace interact to play it?

smoky verge
#

you can't play videos but you can use the slideshow module for pictures

snow cipher
#

im sure you can play videos somehow

#

i saw it myself on a unit mission

still forum
#

yep you can

#

BIS_fnc_playVideo check killzone kids blog

ebon citrus
oblique arrow
#

Hm how do I show the missions info after loading into the mission? As in in some missions some ambient information like mission name time and location are shown in the bottom right of the screen

cosmic lichen
#

Check see also too. There are several functions with different style for that.

oblique arrow
#

shibaheart2 Thanks

light moat
#

Hey, Im trying to get this particular wake up animation working on all players for my MP mission, Ive tried swapping out player for another variable name but no luck, any help?

playSound "b_in_intro";```
worn forge
#

Where are you calling that?

winter rose
#

@light moat

light moat
#

wym

#

@worn forge

worn forge
#

It's hard to help you when you don't give us any context as to where our when you are calling those commands

light moat
#

Oh im putting them in the Init @worn forge

#

of the player

ebon citrus
#

might want to take a look here

light moat
#

It only works on like the player

#

not any of the other playables

#

@ebon citrus would i find something like that in there

ebon citrus
#

if you want to run it on the local client IMMEDIATELY as a player joins, use this in your initPlayerLocal.sqf:

#
waitUntil {
    sleep 1;
    
    (!isNull player && time > 0)
        
    };
//your stupid sqf code here, please
#

the "player" global variable is also only available on a client

light moat
#

i see

#

I just wanna like

#

do it on the MP on a dedicated server

ebon citrus
#

yeah?

#

do what? run your code as the player logs in?

#

btw, if you want to be ultra secure, use like... (!isNull player && time > 1) or (!isNull player && time > 5)

light moat
#

Not necessarily, I want them to spawn and just kind of do the wake up from the start

ebon citrus
#

some people have slow PCs

light moat
#

Im new to this

#

so pls be gentle

ebon citrus
#

spawn?

#

like load into a playable character?

light moat
#

precisely

ebon citrus
#

yeah, then that should be good

light moat
#

So just drop that in the Init

ebon citrus
#

use this in your initPlayerLocal.sqf

#

also, might want to PlayMoveNow

#

switchMove has a tendency to get people stuck

light moat
#

I assume i have to make a notepad++ thing for that .sqf

ebon citrus
#

precisely

light moat
#

Copy

ebon citrus
#
Executed locally when player joins mission (includes both mission start and JIP). See initialization order for details about when the script is exactly executed.```
light moat
#

so all I do is make that sqf and simply put the code in order

ebon citrus
#

say something smart Dscha, im feeling a bit tipsy

jade abyss
#

In your mission folder, simply create a file named: initPlayerLocal.sqf
Add the code from above in it -> It runs, during the players initialization.

ebon citrus
#

i run my spawning in GUI stuff with that script

#

i'm also not sure if it's valid to execute playmove, playmovenow or switchmove on a remote client

#

if that makes sense

#

so you might need to do it in initPlayerServer.sqf

#

the script i provided above DOES NOT work server-side, though

#

so just... see if it works

#

might get some weird results, like animations playing only on the client it is executed on when run locally, though

light moat
#

wilco

#

Ill let you all know if it works

jade abyss
#

So your initPlayerLocal.sqf should look like this:

params ["_player", "_didJIP"];
_player switchMove "Acts_UnconsciousStandUp_part1";
playSound "b_in_intro";

https://community.bistudio.com/wiki/switchMove
Applies given animation to a unit. When used on a person, the given move is started immediately (there is no transition). Use _unit switchMove ""; to reset animation. For a smooth transition use playMove.

ebon citrus
#

@jade abyss im pretty sure the _player variables is redundant in this case

#

initPlayerLocal is always local

#

so "player" should be just as good

#

let me know if im wrong

jade abyss
#

doesn't matter, it's a param given over from the file itself

#

Β―_(ツ)_/Β―

ebon citrus
#

yeah i guess, as long as you have memory and clock as the sheep eat

light moat
#

so i just put the code you gave just in that sqf

#

Now i assume

#

i can try and start the scenario

#

?

ebon citrus
#

remember ```
waitUntil {
sleep 1;

(!isNull player && time > 0)
    
};

//your stupid sqf code here, please```

jade abyss
#

It get's autoloaded, so you should be good to go

#

Not needed @ebon citrus

light moat
#

Ok lemme try

ebon citrus
#

are you sure

#

GUI stuff wont load if it runs immediately

#

and it's really unpredictable, especially on slow PCs

jade abyss
#

params ["_player", "_didJIP"];

#

+UI Stuff != other stuff. Maybe the display get's loaded to late (or whatever)

light moat
#

Ok so

ebon citrus
#

fair point

light moat
#

I made the SQF

#

all i have in it is this

#

params ["_player", "_didJIP"];
_player switchMove "Acts_UnconsciousStandUp_part1";
playSound "b_in_intro";

jade abyss
#

That's most likely more like, what ya want @ebon citrus
waitUntil{!isNull findDisplay 46};

light moat
#

is that correct

ebon citrus
#

didnt work

#

46 was true but the GUI didnt load

light moat
#

@jade abyss

ebon citrus
#

just try it

light moat
#

i did

ebon citrus
#

you'll lose nothing by trying

#

did it work?

jade abyss
#

Instead of asking, just start it.
If it doesn't work, tell us the problem.

light moat
#

I will try

jade abyss
#

Nobody is going to rip your head off, if you got it wrong πŸ˜‰

ebon citrus
#

IDK man...

jade abyss
#

Just keep on testing
ALSO:
Start your game with the "show Script Errors" option enable in the A3-Launcher
@light moat

ebon citrus
#

arma 3 once crashed

#

also, what's up with UserTexture10m_F

#

if you set it a texture and shoot it... the game crashes

light moat
#

@jade abyss I dont see the animation, however i hear the Sounds script

jade abyss
#

No clue, never used

#

@light moat At least you have the sound, probably the animname is wrong?

ebon citrus
#

that name looks weird

light moat
#

No, i used it in SP with the player thing

jade abyss
#

Have you tried executing it in the editor before? Seeing if it works at all?

light moat
#

it worked

ebon citrus
#

too readable to be BIS

#

2 things

#

it's executing too early

light moat
#

just like it did in the anim in east wind

ebon citrus
#

or...

#

it needs to be executed server-side

light moat
#

when you wake up on the beach

jade abyss
#

No @ebon citrus

#

Can't check atm myself.

light moat
#

Ah im dumb

#

I didnt make it a not TXT file

jade abyss
#

if you set it a texture and shoot it... the game crashes
@ebon citrus chcked the feedback-tracker?

light moat
#

ok i made it an SQF

#

but i didnt see the animation

#

same error

ebon citrus
#

it's throwing errors?

#

nice

#

let me see

jade abyss
#

@light moat To be sure it's beeing loaded:
Add systemchat "i was loaded"; to the beginning of the file

ebon citrus
#

wait...

#

how did it play the music if it was .txt?

light moat
#

Β―_(ツ)_/Β―

#

Ok yeah its loaded

#

but its not working

#

@jade abyss i hear the sound still

ebon citrus
#

i mean, you've tried everything surely already

light moat
#

Its gotta work though

#

I have tried it on SP

#

it work

#

MP no work

#

but ive seen it been used

#

in like Maxor videos

ebon citrus
#

one of 2 things

#

start with trubleshooting

#

can you execute it manually in the debug console on "execute local"?

#

does it work?

light moat
#

the code in the sqf?

#

hmm

#

lemme try

ebon citrus
#

on the server

#

but execute it locally

#

make sure to enable the debug console in description.txt

#

makes debugging a hela lot easier

light moat
#

Ok

#

progress

ebon citrus
#

if it is working, then maybe... jsut maybe , give a shot to trying to delay executing after the player is loaded with the script i provided

light moat
#

it doesnt work on the local exec

#

the anim

ebon citrus
#

alright, great

#

so i was onto something earlier

#

abouts here

#

you might need to run the script in initPlayerServer.sqf instead

#

same script should work, but do the playmusic locally

light moat
#

kk

#

should i try the exec now?

ebon citrus
#

so

#

initPlayerLocal.sqf

params ["_player", "_didJIP"];
playSound "b_in_intro";

and initPlayerServer.sqf:

params ["_player", "_didJIP"];
_player switchMove "Acts_UnconsciousStandUp_part1";```
light moat
#

have 2 of those things

#

in muh mission?

ebon citrus
#

and instead of playSound you could use playMusic

#

then just merge

light moat
#

Ok so i have two notepads on

#

initplayerserver and initplayerlocal

ebon citrus
#

ok?

light moat
#

now i just drop those 2 codes in the corresponding things

#

?

ebon citrus
#

yeah, that would make sense

#

just a question

light moat
#

yes

ebon citrus
#

are you working on some already existing script or is this a clean slate?

light moat
#

clean slate

ebon citrus
#

roger

light moat
#

ok

#

am goiung to try

#

IT WORKED

#

:DDDDDDDDDDDDDDD

#

THANK THANK THANK THANK

#

@ebon citrus

#

oh and thank you @jade abyss

#

:)))))))))))))))))

jade abyss
#

Btw: You started your game with show Script Errors?

light moat
#

nop I did not

jade abyss
#

This will help you ALOT with errorsearching

light moat
#

I will from now on

jade abyss
#

Do it, just a friendly advise

#

πŸ‘

light moat
#

thanks a bunch yall

jade abyss
light moat
#

thank!

#

Im trying to get into scripting with arma

#

and code in general

jade abyss
#

Be sure to be able to endure alot of pain and suffering.

light moat
#

Wanna eventually help develop with the Operation Trebuchet mod

#

Love halo a lot, ive heard a lot of negative things about BIS cod

#

so

#

i am ready

#

well

#

are we ever truly ready

jade abyss
#

nope.

light moat
#

lmao

jade abyss
#

And you never stop learning πŸ˜‰

light moat
#

just smack letters together until they worjk

jade abyss
#

πŸ˜‰

ebon citrus
#

i've found it more useful to learn to speak gseon the side with any programming language

#

than to bookmark a bunch of websites

#

ofcourse, you SHOULD bookmark

#

but dont rely on just that

#

gse: Google Search Engine

light moat
#

@ebon citrus now heres a fun thing to try

#

can i have it target specific player slots

#

lets say

#

i am zeus

#

i dont want that animation

ebon citrus
#

yeah

light moat
#

but i want it for my players

#

ooh

ebon citrus
#

give that slot a varibale name

#

and make sure that the script is not executed on a player if they are that variable name

light moat
#

can i make it like officer1,officer2,etc

ebon citrus
#

whatever you want

#

try not to use taken names though

#

like "player"

light moat
#

where would i put those variable names

#

in the sqf

ebon citrus
#

do you use Eden?

light moat
#

i do

#

I know where to put em

ebon citrus
#

in the "name" field

light moat
#

on the character

#

but like

#

where in the code

#

at the _player part

ebon citrus
#

just make an if condition

light moat
#

so like

#

if (officer1) then;

ebon citrus
#

question, if you may?

light moat
#

yep

ebon citrus
#

does sqf happen to be your first programming language?

#

well, "script" language

light moat
#

yeppo

ebon citrus
#

oh boy, ok

light moat
#

yeah

#

am neanderthal

ebon citrus
#

we can take this to DMs?

#

because im not going to lie, im going to be a bit rude, but i assure you we will get this done

#

one way or the other

light moat
#

well

#

hmm

#

i was just thinking

ebon citrus
#

or i can point you to a bunch of biki links like a platonic butthole

light moat
#

this would happen as each player loaded in

#

i could simply load before hand now?

#

and then as the players load in

#

they too, will enter the same anim

ebon citrus
#

youre already doing that

#

you jsut dont want the player slot to get done in

#

so do you just want the work done for you or do you want me to teach you?

#

no offense, just be clear with me here

light moat
#

it would be more valuable to be taught

#

however

#

time is an asset i dont have

ebon citrus
#

i have ABSOLUTELY no issue with writing a bit of code

#

lairhg,t hold ona second

light moat
#

ok

ebon citrus
#

can you DM me your initPlayerServer.sqf?

exotic flax
#

Or post on pastebin and send link here, so more people can look into it πŸ˜‰

hollow lantern
#
player addEventHandler ["Fired", {[player, "Laserdesignator_03"] execVM "itsAebian\KI_OrbitalStrike.sqf"}];``` seems fine for me, however the script doesn't get fired when I lase a target with a laserdesignator, I thought this counts as fired, tried with ``FiredMan`` also
dreamy kestrel
#

Q: do you need to detach objects before re-attaching them, i.e. to a different location on the hosting object?

ebon citrus
#

@dreamy kestrel A: no

#

but remember, when you do, the vector changes to default

cunning crown
dreamy kestrel
#

@ebon citrus thanks, so to avoid funny or bouncing animations I might disable the simulation on the attaching object?

ebon citrus
#

@dreamy kestrel unless the attached object is ragdolled, there shouldn't be any issue. I have not noticed any, atleast.

jade abyss
#

@austere granite Did you create a new display and suddenly they don't work?

austere granite
#

its in buldozer, seems like it doesn't want to work for that 😦

#

keydown works fine, but mousedown or whatever its called does not

jade abyss
#

Ah, Buly :/

#

related to that thingy you showed me?

forest ore
#

Any pointers why ```sqf
addMissionEventHandler ["EntityKilled",{
params ["_killed","_killer","_instigator"];

_vehicles = [veh1,veh2,veh3,veh4];

if !(_killed in _vehicles) exitWith {};

[_killed] spawn {
params ["_killed"];
_var = vehicleVarName _killed;
_type = typeOf _killed;

sleep 10;
deleteVehicle _killed;

_newVeh = _type createVehicle [0,-40,0];
_newVeh setVehicleVarName _var;
missionNamespace setVariable [_var,_newVeh,true];

waitUntil {isNull _killed};

if (_var == veh1 || _var == veh2) then {_var call TEST_fnc_respawnFnc1};
if (_var == veh3 || _var == veh4) then {_var call TEST_fnc_respawnFnc2};
};

}];

errors with ```if (_var |#|== veh1 || _var == veh2) then >
10:01:08   Error position: <== veh1 || _var == veh2) then >
10:01:08   Error Generic error in expression``` ?
(Trying to achieve vehicle respawn functionality with sleep with this πŸ‘†πŸΌ )
ruby breach
#

Because _var is a string and I presume that veh1 - veh4 are objects. == requires comparisons to be of the same type.

forest ore
#

Thanks Gnashes. Got that problem solved just a tad earlier by referencing to _newVehicle instead of _var so as far as I understand anything of that the issue was exactly what you pointed out it to be

surreal peak
austere granite
#

@final vessel

final vessel
#

But as stated, the library is in alpha state for now. Some things are less optimized than they could be, etc..

#

I never had the time to improve the library besides what i needed, myself, at the time of the writiing 😦

surreal peak
#

thanks, its been a while since ive used python so im coming back to it, seems like im doing some more reading then πŸ˜„

#

thats fine, I should figure it out

#

thanks for help!

final vessel
#

If you have any questions, mention me because I'm not following this channel @surreal peak

surreal peak
#

will do, thanks!

tough abyss
#

is there any version of addWeaponWithAttachmentsCargo that works for players?
I'm trying to add a primaryWeapon in a players primaryWeapon slot with a specific mag (and ammo) as well as attachments.

#

Hey

#

Is this a coincidence

#

πŸ€”

exotic flax
#

@tough abyss addWeaponItem is most likely what you're looking for

tough abyss
#

there's not a version which can add attachments main and secondary muzzle mags with ammo etc etc

#

addWeaponWithAttachmentsCargo is so easy to combine with weaponsItemsCargo

exotic flax
#
player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];

This is actually putting a HE shell in the 3GL launcher on the MX-GL

tough abyss
#

you get an exact copy without having to write anything yourself at all
IE: ```sqf
_unit addWeaponWithAttachmentsCargo [weaponsItemsCargo _weaponHolder select 0, 1];

final vessel
#

@surreal peak basically, from what I remember, you just fetch the file from the PBO using the methods available in the test file, linked above, and then when you have the file_entry, you can access the file contents with file_entry.data

tough abyss
#

the addWeaponItem doesn't support multiple magazines or attachments. You'd have to do some type of loop and link them I guess

surreal peak
#

ahhhhh

#

thanks!!!!

still forum
#

@tough abyss yes you have to use addWeaponItem and loop it somehow.

tough abyss
#

would've been a lot cooler if there was a non cargo version lol
thanks

surreal peak
#

so you know how there are OFPEC name thingys, is there a place in PBO's where people will place this?

winter rose
#

TAGs, you mean? @surreal peak

still forum
#

yes

surreal peak
#

yes @winter rose

forest ore
#

Testing out: a trigger is created by pressing Server Exec in dedicated server with the following input

dmgTrigger = createTrigger ["EmptyDetector", getMarkerPos "Marker_1", TRUE]; 
dmgTrigger setTriggerArea [1000, 1000, 0, TRUE]; 
dmgTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", TRUE];  
dmgTrigger setTriggerStatements [  
 "this",  
 "_x = _this select 0; _x setDamage 1;",   
 ""];

but the OnActivation is not killing the player (me that is). I thought _x would be the magic variable for everything but apparently it isn't.. so what gives?

winter rose
#
(thislist select 0) setDamage 1```
 @forest ore
tough abyss
#

Does anyone know how to call up textures / data from a mod in Eden editor? Like the file path for them? I'm trying to use the object specific Texture #0 on the "Banner" object to retexture it to a texture I put in my custom mod, is this possible or can you only use game / mission textures?
Basically I just want to cut down on the size of the mission file by including textures in mod rather than in mission

winter rose
#

you totally can call mod textures yep

#

as for the path I am not sure so I let other people answer about it

tiny wadi
#

The path for the mod would be the path in the pbo structure @tough abyss

#

So if your pbo is test.pbo

#

/test/mypath/texture.paa

tough abyss
#

Would /test/ be A3 or ?

#

Like where would it start since it's clearly dependent on the user

#

Or

#

Oh

#

Test is the PBO name

tiny wadi
#

yes

tough abyss
#

But it would start at test and not anywhere else?

tiny wadi
#

/[your pbo name minus .pbo/[path to texture]/[texture].paa

tough abyss
#

Gotcha, I'll try that rn

tiny wadi
#

You can do absolute file paths aswell

#

C:\mypath\texture.paa

#

That wouldn't work nicely though if you plan on distributing it to multiple people

young current
#

pls dont even suggest that

#

thats how people learn to do mods the wrong way

#

@tough abyss to build proper addon you will need to setup the mod development tools and development environment correctly.

#

PMC wiki has steps to set up arma 3 tools and P drive

#

follow those to the letter

forest ore
#

@winter rose Yesterday at 10:49 PM
"(thislist select 0) setDamage 1"

Oh so that's how it was supposed to go this time around. Finally got to test it also so here to confirm that it works (of course, how else). Thank you Lou πŸ™‚

forest ore
#

Well, now what is wrong with this then. I used to have editor placed triggers but had to switch to scripted version for reasons. In the editor placed trigger's Condition field I used (thislist findIf {side _x==east || side _x == resistance} == -1) with no hiccups. With the editor placed trigger as activation I used ANY. Now with the scripted version that same condition does not seem to work anymore:

hideyMrkr = createTrigger ["EmptyDetector", position civVeh_1, TRUE];
hideyMrkr attachTo [civVeh_1, [0, 0, 0]];
hideyMrkr setTriggerArea [1000, 1000, 0, TRUE]; 
hideyMrkr setTriggerActivation ["ANY", "PRESENT", TRUE];  
hideyMrkr setTriggerStatements [
"(thislist findIf {side _x==east || side _x == resistance} == -1)",
"['vehMarker_1', 0] remoteExecCall ['setMarkerAlphaLocal',-2];",
"['vehMarker_1', 1] remoteExecCall ['setMarkerAlphaLocal',-2];"];
worn forge
#

Are you running it locally? -2 will exclude you as server

forest ore
#

Testing on dedicated

worn forge
#

sorry, nothing jumps out at me

forest ore
#

FYI if I use EAST or INDEPENDENT as activation and have this in the sripted trigger's Condition field then the scripted trigger works (as in the "vehMarker_1" changes it's Alpha as expected)

forest ore
#

Ahh, for the functionality I was looking to achieve one way that I found working was to turn the Condition "around" with !(thislist findIf {side _x==east || side _x == resistance} == -1)

winter rose
#

you could enhance readability with sqf side _x in [east, resistance] @forest ore πŸ˜‰

forest ore
#

That I will most certainly check out Lou! 🀝

worn forge
#

FWIW I always use independent instead of resistance

winter rose
#

old habits die hard :p

nocturne bluff
#

the arma3 ones are blufor, opfor and independent

sharp grotto
#
                { 
                    _lootHolder addWeaponCargoGlobal [_itemClassName, 1]; 
                    if !(_itemClassName isKindOf ["Exile_Melee_Abstract", configFile >> "CfgWeapons"]) then
                    {
                        _magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines");
                        _blackList = [ "rhsusf_5Rnd_HE","rhsusf_5Rnd_FRAG","rhsusf_8Rnd_HE","rhsusf_8Rnd_FRAG","rhsusf_5Rnd_doomsday_Buck","rhsusf_8Rnd_doomsday_Buck"];
                        {
                            if ( _x in _blackList ) then {
                                _magazineClassNames set [ _forEachIndex, -1 ];
                            };
                        }forEach _magazineClassNames;
                        _magazineClassNames = _magazineClassNames - [ -1 ];
                        if (count(_magazineClassNames) > 0) then
                        {
                            _magazineClassName = selectRandom _magazineClassNames;
                            _numberOfMagazines = 2 + floor(random 2); 
                            _lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines];
                            _spawnedItemClassNames pushBack _magazineClassName;
                        };
                    };
                    _numberOfItemsToSpawn = -1;
                };```

Can someone tell me why the blacklist isnt working ? πŸ˜„
worn forge
#

what's your error

#

Not sure I like this construction _magazineClassNames = _magazineClassNames - [ -1 ];

winter rose
#

@sharp grotto be sure to enable -showScriptErrors in the launcher, to see script errors when (and where!) they happen.

tough abyss
#

When a vehicle gets deleted, the dead units inside cannot be deleted but they still are not null objects and they appear in allDeadMen

#

anyone know a fix?

worn forge
#

Do it before you delete the vehicle, though

tough abyss
#

i don't delete the vehicles, they delete themselves after they explode an such

#

otherwise is there a way to check if the unit is just not visible but not null?

#

cause isObjectHidden returns false

worn forge
#

Are you just using vanilla garbage collection?

tough abyss
#

its not really for any particular mission

#

so I would need vanilla garbage collection to work

#

it has to just be some kind of arma 3 bug

worn forge
#

Yes

tough abyss
#

that is super annoying

tough abyss
#

hopefully they fix it but who knows with bohemia

grave lotus
#

I've been hunting down a strange behavior with a script and think I got it to a point where its reproducible. I have a script firing from init_server which redresses on a case basis, most units. It works properly if I log in and get mission running before the headless clients connect. If HCs connect at startup/before players init, the script doesnt fire properly.

#

Does this behavior sound familiar to anyone?

astral dawn
#

@grave lotus sounds like ownership of units is messed up, or synchronization of initialization with HCs is broken

#

@echo yew I guess you can do it client side, check player's name, then endMission for him with explanation that his name has wrong characters

#

why, did someone wipe your database? πŸ˜„

high marsh
#

serverCommand too.

#

I would just prompt for password

astral dawn
#

serverCOmmand needs password to be passed to it

high marsh
#

Instead of pbo containing scripts with password, just prompt whomever is logged as admin at the tine.

#

Might get annoying after a while, so if some client preference has this disabled, then instead just endMission them yes

#

Method given isnt rcon

astral dawn
#

you asked in scripting so we assumed SQF

high marsh
#

all SQF

grave lotus
#

@astral dawn that sounds about right. i could cause the state by connecting the HCs. works fine before/without. Is there a best practice here for syncing HCs? I have a routine running in init which scoops up aispawned units in zeus. Could I perhaps use that to execute my redress and have that propigate to the HCs?

astral dawn
#

can you show me how units are redressed? I believe that it must be called locally on the computer which owns the unit, right?

grave lotus
#

@astral dawn I have init_server firing [] execVM "GF_Set_Custom_Loadout\Vanilla\GF_SCL_allUnits_REWORK.sqf";

astral dawn
#

well, must see what's inside that script of course

grave lotus
#

The script itself is: GF_SCL_allUnits = {
_this unlinkItem "NVGoggles";
_this unlinkItem "NVGoggles_OPFOR";
_this unlinkItem "NVGoggles_INDEP";

params ["_unit"];

if !(isServer) exitWith {};
if (isPlayer _unit) exitWith {};

private _side = side _unit;
private _unitType = typeOf _unit;

switch _side do {

case INDEPENDENT: { case "I_E_Scientist_F": {
removeAllWeapons _unit;
_unit unlinkItem "NVGoggles_INDEP";
_unit removeWeapon primaryWeapon _unit;
_unit removeWeapon secondaryWeapon _unit;
_unit removeWeapon handgunWeapon _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit forceAddUniform "skeleton_u";
_unit addVest selectRandom ["V_Chestrig_blk",""];
_unit addWeapon "SMG_02_flash_F";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
};

default {
    _unit unlinkItem "NVGoggles_INDEP";
    removeAllWeapons _unit;
    _unit removeWeapon primaryWeapon _unit;
    _unit removeWeapon secondaryWeapon _unit;
    _unit removeWeapon handgunWeapon _unit;
    removeAllItems _unit;
    removeAllAssignedItems _unit;
    removeUniform _unit;
    removeVest _unit;
    removeBackpack _unit;
    removeHeadgear _unit;
#

removeGoggles _unit;
_unit forceAddUniform "U_O_R_Gorka_01_black_F";
_unit addWeapon "SMG_02_flash_F";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addVest selectRandom ["V_Chestrig_blk"];
_unit addHeadgear selectRandom ["H_PilotHelmetHeli_B"];
_unit addGoggles selectRandom ["G_her_GasMaskA"];
};
};};

_this linkItem "ItemMap";
_this linkItem selectRandom ["ItemCompass","","","",""];
_this linkItem selectRandom ["ItemWatch","","","",""];
_this linkItem "ItemRadio";

//________________ reload handgunWeapon ________________

_this selectweapon handgunWeapon _this;
sleep 3;
reload _this;
sleep 8;

//________________ reload primaryWeapon ________________

_this selectweapon primaryWeapon _this;
sleep 3;
reload _this;
sleep 8;

//________________ reload secondaryWeapon ________________

_this selectweapon secondaryWeapon _this;
sleep 3;
reload _this;

};
//________________ *** End *** ________________

[] spawn {
while {true} do {
{
if (
((alive _x))
&& (!(_x getVariable ["Var_GF_SCL_allUnits",false]))

        /*
    //________________    You can filter the side here    ________________    
    && {((side group _x) == west || 
        (side group _x) == east || 
        (side group _x) == independent || 
        (side group _x) == civilian)}
    */
    
    //    && (side group _x == playerSide)
    //    && (!(side group _x == playerSide))
#

) then {

        _x spawn GF_SCL_allUnits;
        
        };                        
        _x setVariable ["Var_GF_SCL_allUnits",true];
        {waitUntil {!alive _x};
        _x setVariable ["Var_GF_SCL_allUnits",false];         
        };
    }forEach allUnits;
    sleep 5;
};

};

#

thats it, pared down. the important part I think is the flag set for units which have been added to the Var_GF_SCL_allUnits variable in relation to the HCs

#

i an replace it with a simple case test if that helps. πŸ™‚ Put santa hats on em or something

oblique arrow
#

Use code blocks for easier and nicer reading plox @grave lotus

grave lotus
#

aok πŸ™‚

#

neub πŸ™‚

#

Ive avoided scripting for like 2 decades of computer hustling πŸ™‚

oblique arrow
#

I mean in discord tho

grave lotus
#

yes πŸ™‚ first time cut/pasting πŸ™‚

winter rose
#

@grave lotus
```sqf
hint "text";
```

hint "text";
#

Please format your above message to make it readable

grave lotus
#

lemme work on that πŸ™‚

winter rose
#

thanks!

astral dawn
#

@grave lotus commands like removeWeapon and such require unit to be local, are you sure that he is local?

grave lotus
#

thats likely IT! They arent

#

what is the global equivalent for weapon?

#

removeWeapon ratjer

#

rather

nocturne bluff
#

There is none, use remoteExec to pass it to the unit owner.

grave lotus
#

so I remoteExec the script rather than exec?

astral dawn
#

yep!

#

whole script

#

better remoteExecCall

#

oh, and GF_SCL_allUnits_REWORK.sqf must be made a function, preferably

tough abyss
#

unless I am doing something wrong removeMissionEventHandler does not seem to be working

#

I have it assigned to a handler variable such as handler = addMissionEventHandler ["EachFrame", {}];
I am removing it with removeMissionEventHandler ["EachFrame", handler]; but every time I add the event handler again it increments the ID as if the previous one was never removed

astral dawn
#

I think it should increase the ID

#

so that it's always unique

tough abyss
#

and when i use removeAllMissionEventHandlers "EachFrame"; it resets the ID back to 0

astral dawn
#

then the guy at bottom of page says:

#

As of Arma 3 version 1.38 you can safely remove mission event handlers without worrying about decrementing higher indices.