#arma3_scripting

1 messages Β· Page 574 of 1

fair lava
#

this is a somewhat complicated question to ask:
Do and statements exit when the first false is found, or do all statements get processed, i.e:
bool = (call myFunc) and (call myFunc2);
If myFunc returns false, does myFunc2 get called?

#

im writing a sanity check into my code, and want to avoid nested if statements, but the second function i want to call would cause an error if the first function returns false

still forum
#

Do and statements exit

#

no, unless you use code as right arg

fair lava
#

exit is the wrong word

still forum
#

the answer is still no

#

unless you do what i said

#

wiki page of if/&& should mention that

fair lava
#

code as right arg?

winter rose
#

yes

fair lava
#

what does that mean

winter rose
#

@fair lava

if (alive player && { damage player < 0.5 }) then { ... };
fair lava
#

i might just have been awake for too long

still forum
#

bool = (call myFunc) and {call myFunc2};

fair lava
#

oh

still forum
#

or

fair lava
#

thats not too bad i'll change it to that, and i did not see anything like that on the wiki though i didn't find much

still forum
#

bool = (call myFunc) and myFunc2; if you're crazy

fair lava
#

i didn't dare go this deep into sqf

#

im still at the "look at the wiki page for the if statement" stage of sqf learning

winter rose
#

welcome aboard

fair lava
#

can i do !{}

still forum
#

no

#

but {!}

fair lava
#

ah

#

if _hel && {!([_helmet, (_varHelmetArray select 1), true] call BIS_fnc_inString)} then

#

using parenthesise like bubble wrap and call is fragile ^.^

still forum
#

still missing a pair of parens

fair lava
#

oh really?

still forum
#

not sure if && is higher than if

fair lava
#

ah the whole statement

#

if (_hel && {!([_helmet, (_varHelmetArray select 1), true] call BIS_fnc_inString)}) then {

#

that should about do it

#

Thanks

bright flume
#

since ya awake over here, any luck @still forum ?

still forum
#

with what

bright flume
#

re: livonia I was crashing out when ya asked for dewrp link again.

still forum
#

no, and not today

bright flume
#

okies, and gratz on the hire over.

cosmic lichen
#

on the hire? πŸ˜„

hollow thistle
#

shh

tame lion
#

my instinct is that it has to occur on server, but I could be wrong

worn forge
#

Your guide is found in the icons at the top of the wiki page

#

commands are global, and it must be called on server to work properly in multiplayer

#

excuse me, that's radioChannelCreate

#

radioChannelAdd, as you point out, is not indicated

#

That said I can tell you that it's global, ie., client can use radioChannelAdd and get into the custom channel, provided they provide the right channel number

tame lion
#

yeah that is what was confusing me, because on the clients, the custom channel could be 6-15 whle radioChannelCreate returns a much lower number. This is why I wasn't sure how I should go about adding players to it; if i needed to remoteExec to the server or have the clients handle the command themselves

ebon ridge
#

targetKnowledge returns last seen time, but what is it? in my testing it has values like -2.212e-6 That isn't server time, OR date as a number I think?

bright flume
#

its a number... im guessing in seconds?

ebon ridge
#

but its negative?!

bright flume
#

repeatable/always happens? docs really dont even define what the time is

ebon ridge
#

actually looks like for civ side only it gives this, for other sides its correct

#

time is seconds after server start it looks like

worn forge
#

is it related to the target class? I'm wondering if it doesn't track positive numbers for vehicles but does so for men

ebon ridge
#

oh i didn't check but i hope it tracks for vehicles as this is what i want to use it for!

coral owl
#

Hi everyone, I am trying to get where an infantry unit was hit, and I am using this:

 private _bodyParts = ["head", "body", "arms", "legs", "pelvis", "spine1", "spine2", "spine3", "neck"];
 private _dmgParts = [0, 0, 0, 0, 0, 0, 0, 0, 0];
        
 {
 _dmgParts set [(_bodyParts find _x), _unit getHit _x];            
 } forEach _bodyParts;
                    
private _bodyPart = _bodyParts select (_dmgParts findIf { _x >= 0.9 });

I am not sure this is the best, but it works... however sometimes I do get an
error zero divisor

Which I can't for the life of me understand why..

I was thinking maybe some of those body parts do not exist on a CAManbase type of unit? Meaning infantry stuff?

surreal peak
#

since getHit returns nothing if the selector is wrong, it may be that the assigning is going astray due to trying to asign a null value from an array into _bodypart

#

not sure if I explained that well...

#

@coral owl where did u get the _bodyParts strings from?

coral owl
#

@surreal peak I think I got it, that would make sense.. I just got it .. mh from somewhere in the official forums lol maybe someone trying to do something with damage location

#

I was thinking worst-case I will reduce it to the first four, which work perfectly.

surreal peak
#

is there any other code being executed

#

can u post the entire script? in a pastebin or something

#

can only guess without context

coral owl
#

It's basically that, at the moment it just reports
systemChat format ["you have been hit to the %1", _bodyPart];

surreal peak
#

["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"];

#

maybe try these for the array

coral owl
#
                    private _bodyParts = ["head", "body", "arms", "legs", "pelvis", "spine1", "spine2", "spine3", "neck"];
                    private _dmgParts = [0, 0, 0, 0, 0, 0, 0, 0, 0];
                    private _bodyPart = 'TORSO';            
                    {
                        _dmgParts set [(_bodyParts find _x), _unit getHit _x];            
                    } forEach _bodyParts;
                    
                    _bodyPart = _bodyParts select (_dmgParts findIf { _x >= 0.9 });
                    
                    switch (_bodyPart) do {
                        case "head" : { _bodyPart = "HEAD" };
                        case "body" : { _bodyPart = "TORSO" };
                        case "arms" : { _bodyPart = "ARM" };
                        case "legs" : { _bodyPart = "LEG" };
                        case "pelvis" : { _bodyPart = "PELVIS" };
                        case "spine1" : { _bodyPart = "SPINE" };
                        case "spine2" : { _bodyPart = "SPINE" };
                        case "spine3" : { _bodyPart = "SPINE" };
                        case "neck" : { _bodyPart = "NECK" };
                    };
                    
                    _messageDOWN2PARTA = 'YOU WERE HIT ON THE: ';
                    _messageDOWN2PARTB = _bodyPart;
            ```
#

that was just the old version when I discovered toUpper lol

#

but I am keeping the last switch as it's convenient..

surreal peak
#

also would probably be worth to change private _bodyPart = 'TORSO'; to private _bodyPart = '';

coral owl
#

right right, true

#

As you can see I very basically check which area registers a damage over 0.9 and report that, nothing fancy

#

I put them in a sort of order, from most sensitive parts to others.. and it kinda works in case more than one location has 0.9 it reports the main one first (e.g. head)

winter rose
#

but some damages are set to "", which is general damage

coral owl
#

You are right that //["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"], seems good

#

so that could be why I get a zero divider.. as in "" >= 0.9 = BOOOM!

surreal peak
#

ahhh

#

true

#

gonna need an if statement somewhere there

winter rose
#

a "default" case in the switch

coral owl
#

Thanks @winter rose and @surreal peak this is great just enlightening

winter rose
#

anytime

coral owl
#

it's kinda fun and I did not want to limit myself to head torso legs and arms which work fine

surreal peak
#

np, I like helping people cause it improves my skills as well πŸ˜„

coral owl
#

It was cool to see "NECK" yeaaaaaaaaah I've been shot in the neck, look mom!

surreal peak
#

if you ever want to do something with it, I could recommend doing things like disabling nightvision goggles when headshot

coral owl
#

@winter rose I think the default case is definitely useful but the error happens in the line just before the final switch?

surreal peak
#

or GPS when shot in arm

coral owl
#

ah cool!

worn forge
#

drop weapon when shot in the arm? fall down when shot in the leg?

winter rose
#
_dmgParts set [(_bodyParts find _x), _unit getHit _x];

if find returns -1, in set…

surreal peak
#

many things for torture immsersino

coral owl
#

OR, I could completely revamp this using getAllHitPointsDamage

#

because that's what it returns..


    getAllHitPointsDamage player;
    //[
    //["hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"],
    //["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"],
    //[0,0,0,0,0,0,0,0,0,0,0,0]
    //]```
#

so basically I can scan the third array, find the first 0.9 or the highest number in the array... keep that array position number but move it to the second array and bam, I get the location

surreal peak
#

sounds good!

coral owl
#

I just gotta find out how to return the index of the highest value in an array lol

winter rose
#

there is a function for that

surreal peak
#

loop through array and just do comparisons between them

#

ooooooor

#

find the functino lou is talking about

winter rose
#

sort sorts the data, you could do something with it

surreal peak
winter rose
#

yup; but with selectMax you only get the value, not what it is linked to?

coral owl
#

once I selectMax and get the value, I find it?

winter rose
#

with sort you could do an array like [[0.5, "spine"], [0.2, "head"], ...]

coral owl
#

use the find to return the index

surreal peak
#

ahhh

#

true

#

I wonder which would be more efficient

winter rose
#

I think selectMax + find

coral owl
#

I think might just

  • get the highest number
  • find it again in the same array
  • get its index
  • use that index on the previous array and get the location name
    ...
surreal peak
#

should work

coral owl
#

Just because it does not matter to me if there is another value that is similar to the max found..

#

otherwise Lou's is spot on and more precise

bright flume
#

now question is what form of sorting alg does max use πŸ˜›

coral owl
#

exactly, but if it misses one and gets another, I don't care as long as it feels good that you've been shot somewhere lol

#

With Lou's method you can basically go wherever you want with that data

surreal peak
#

I just realised, this is a legit place where stalin sort can be used

winter rose
#

hahaha

surreal peak
coral owl
#

ahaha that's awesome

#

Anyway could be something like:

                    private _bodyParts = (getAllHitPointsDamage _unit) select 1;
                    private _dmgParts = (getAllHitPointsDamage _unit) select 2;
                    private  _mostDamaged = selectMax _dmgParts;
                    private _mostDamagedPart = _dmgParts find _mostDamaged;
                    private _bodypart = _bodyparts select _mostDamagedPart;

                                   
                    switch (_bodyPart) do {
                        case default : { _messageDOWN2PARTB = "TORSO" };
                        case "face_hub" : { _messageDOWN2PARTB = "HEAD" };
                        case "head" : { _messageDOWN2PARTB = "HEAD" };
                        case "body" : { _messageDOWN2PARTB = "TORSO" };
                        case "arms" : { _messageDOWN2PARTB = "ARM" };
                        case "legs" : { _messageDOWN2PARTB = "LEG" };
                        case "pelvis" : { _messageDOWN2PARTB = "PELVIS" };
                        case "spine1" : { _messageDOWN2PARTB = "SPINE" };
                        case "spine2" : { _messageDOWN2PARTB = "SPINE" };
                        case "spine3" : { _messageDOWN2PARTB = "SPINE" };
                        case "neck" : { _messageDOWN2PARTB = "NECK" };
                    };
                    
                    // reminder: for an infantry unit these are the hit zones that could get returned:
                    //["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"],
                    
                    ...```

rudimentary ofc
#

I could nest it as hell and do it in one line eheheh or TRY TO

#
                    private _bodypart = ((getAllHitPointsDamage _unit) select 1) select ((getAllHitPointsDamage _unit) select 2) find (selectMax ((getAllHitPointsDamage _unit) select 2));
                    
                    switch (_bodyPart) do {
                        case default : { _messageDOWN2PARTB = "TORSO" };
                        case "face_hub" : { _messageDOWN2PARTB = "HEAD" };
                        case "head" : { _messageDOWN2PARTB = "HEAD" };
                        case "body" : { _messageDOWN2PARTB = "TORSO" };
                        case "arms" : { _messageDOWN2PARTB = "ARM" };
                        case "legs" : { _messageDOWN2PARTB = "LEG" };
                        case "pelvis" : { _messageDOWN2PARTB = "PELVIS" };
                        case "spine1" : { _messageDOWN2PARTB = "SPINE" };
                        case "spine2" : { _messageDOWN2PARTB = "SPINE" };
                        case "spine3" : { _messageDOWN2PARTB = "SPINE" };
                        case "neck" : { _messageDOWN2PARTB = "NECK" };
                    };
#

sometimes I think anyone getting this code in the future might hate me and therefore avoid doing this. Especially since I easily forget what this could do or mean

surreal peak
#

try to make it as nice as possible

#

remember to comment!

winter rose
#

replace your switch with this πŸ˜‰

_messageDOWN2PARTB = [toUpperANSI _bodyPart, "TORSO"] select (_bodyPart == "");
#

well, it keeps the number in "spine" though

hallow mortar
#

if I put a sleep in a forEach, does that create a delay between instances of the forEach, or are they all run simultaneously?

bright flume
#

believe its sequential/ordered execution so a sleep will make the script pause (x) amount of time... at that point.

bold kiln
#

I don't want to step on whoever's problem is above if not resolved, but I have a script that should be increasing the speed like an afterburner. It seems to run but it doesn't increase speed.
Something I'm missing?

young current
#

@bold kiln for big chunk of code pastebin.com with c++ or similar fitting syntax enabled would be better place to put it

bright flume
bold kiln
#

gotcha

young current
#

and link here of course

#

the syntax highlight selection is somewhere at the bottom where you hit create too

bold kiln
#

right, right. trying to find the link so I can post

bright flume
#

if you use hastebin the link is in the address bar soon as you click the save button top right

bold kiln
#

hastebin is having connection issues for me

bright flume
#

really? odd...

#

https://hastebin.com/ << if it looks like basically a blank screen other then the few icons top right of screen then its working correctly

bold kiln
#

This site can’t be reachedhastebin.com unexpectedly closed the connection.
Try:

Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_CLOSED

bright flume
#

ewww and odd... o.O

#

trying to think of md5's fork of hastebin... cant think of the link

bold kiln
#

i think this is the pastebin site

bright flume
#

yeah ya good

still forum
#

@hallow mortar SQF cannot execute anything simultaneously. So yes they run after eachother, including the sleeps inbetween

winter rose
#

I know that technically it doesn't, but you can still spawn multiple scripts and have them run """in parallel""" ^^

surreal peak
#

if you have a script (lets call it script A) that calls two other scripts (B,C) , does script A wait for B to be finished before calling C?

still forum
#

if by calling you mean call then yes

silk sparrow
#

Hi, I'm searching for some ingame texture selector script.
Does anyone here has a script like this?

#

Thanks!

cosmic lichen
#

Selector script? What do you mean?

silk sparrow
#

Well, i've thought at something like a NPC or a crate with an addaction on it which allows player to change it's vehicle texture.

cosmic lichen
#

I see.

#

Don't know if there's a script for that.

silk sparrow
#

I've got some very basic knowledges in sqf, do you think it would be easy to develop?

#

Maybe not easy

#

But at least not too complicated ^^

cosmic lichen
#

Should be possible.

#

Vehicle textures are stored inside the vehicle's config IIRC

#

So you need to retrieve all texture for the vehicle and add actions to the vehicle accordingly

silk sparrow
#

I've got personal textures in the pbo mission file, so I think the thing to do is to make a script that recognize the vehicle (to not put a huron skin onto a strider e.g) and to shows one addaction per texture.

#

Well, i'll work on it and stay you tuned

#

Thank you!

cosmic lichen
#

yw, gl πŸ™‚

silk sparrow
#

Yup @alpine ledge ! Thanks!

#

First i'm trying to get the vehicle classname.
I've put a prop in editor called "selector"

#

And i've written this code (which of course, does not work)

#
private _myArray = [];
private _classname = "";
_myArray = nearestObjects [selector, ["Car", "Tank", "Air"], 10];
_classname = _myArray select 0;
hint _classname;
#

I execute it from the debbug menu

#

I haven't yet understand how typeOf work.

worn forge
#

nearestObjects returns class names, it returns objects.

silk sparrow
#

Okay, so I can't use it in that way

worn forge
#

if you do

_object = _myArray select 0;
hint str (typeOf _object);

that'll give you the class name of the nearest object.

silk sparrow
#

So I only keep the first line and add the code you juste give me after it?

cosmic lichen
#
private _myArray = [];
private _classname = "";
_myArray = nearestObjects [selector, ["Car", "Tank", "Air"], 10];
if (_myArray isEqualTo []) exitWith {hint "No vehicle found!"};
_object = _myArray select 0;
hint str (typeOf _object);```
silk sparrow
#

Oh yes ofc

#

I've got to keep the selector

#

Wow

#

It work

#

xD

cosmic lichen
#

πŸ˜„

#

Have faith in us and yourself πŸ˜›

silk sparrow
#

@worn forge @cosmic lichen you guys are genius

silk sparrow
#

Now I've think about a switch/do to show the addactions
My code does not return any error but the game hint "Error1" (the default section of the switch/do)

#
private _myArray = [];
_myArray = nearestObjects [selector, ["Car", "Tank", "Air"], 10];
if (_myArray isEqualTo []) exitWith {hint "No vehicle found!"};
_object = _myArray select 0;
_veh = str (typeOf _object);
//hint str (typeOf _object);

switch (_veh) do
{
    case "C_Kart_01_F":
    {
        hint "it's a kart"
    };

    case "C_Van_01_transport_F":
    {
        hint "It's a truck"
    };

    default
    {
        hint "Error1"
    };
};
#

I'm just a little bit confused about what put in the switch

#

Is it the _object

still forum
#

str (typeOf
you are turning a string into a string

#

why

#

Ah you copied that from R3vo, bad R3vo

#

remove the str

silk sparrow
#

Thats a good question

#

Yup

still forum
#

Your _veh contains ""C_Kart_01_F"" instead of C_Kart_01_F which is why the case never hits

silk sparrow
#

Okay

#

I delete this

#

so in the switch instead of _veh i should put _object

still forum
#

no

silk sparrow
#

And put the "" away in the cases

#

?

still forum
#

Here, let me copy-paste what I just told you

#

str (typeOf
you are turning a string into a string
remove the str

silk sparrow
#

Yup it's removed

#
private _myArray = [];
_myArray = nearestObjects [selector, ["Car", "Tank", "Air"], 10];
if (_myArray isEqualTo []) exitWith {hint "No vehicle found!"};
_object = _myArray select 0;
//hint str (typeOf _object);

switch (_object) do
{
    case "C_Kart_01_F":
    {
        hint "it's a kart"
    };

    case "C_Van_01_transport_F":
    {
        hint "It's a truck"
    };

    default
    {
        hint "Error1"
    };
};
still forum
#

I said remove the str, not the whole line

#

you still need the typeOf

silk sparrow
#

Oh

#

ok

#

sorry

still forum
#

you cannot compare an object to a string

coral owl
#

Thanks @winter rose that's just sexy and streamlined, it does keep the number in spine unfortunately, but yeah ONE LINE πŸ™‚

silk sparrow
#

Okay!

#

It work

#

Thank you @still forum !

cosmic lichen
#

@still forum I copied from @worn forge πŸ˜›

silk sparrow
#

x)

#

So now with a "nearestObject" i should be able to apply the skin to this nearest object?

cosmic lichen
#

Yes, you got the object already in the _object variable.

silk sparrow
#

Yes, you're right

#

So _object select the precise vehicle that is near my selector?

cosmic lichen
#

Yes

silk sparrow
#

That's nice!

#

I try

cosmic lichen
#

Btw use @cosmic lichen otherwise I will miss your messages

#

Not in every message though πŸ˜›

winter rose
#

@cosmic lichen ?

#

@cosmic lichen .

cosmic lichen
#

Not in every message though

winter rose
#

@cosmic lichen 😁

cosmic lichen
#

I added that for special ppl like you πŸ™‚

cunning crown
#

Ohhhh, so if we're not special we can use it in every messages? Nice!

silk sparrow
#

Roger!

cosmic lichen
#

I am the one who decides who's special and who's not, and seems your are special too πŸ™‚

cunning crown
#

πŸ™

silk sparrow
#

Okay, so now there is an issue with the _object variable.
Could it be due to a private / local variable or something like this?

#
case "C_Truck_02_fuel_F":
    {
        texturer addAction ["Peindre skin XAL", {_object setObjectTextureGlobal [0, "Skin\xalvea1"];
                                                 _object setObjectTextureGlobal [1, "Skin\xalve2"];
                                                 hint "Fini!"
                                                 }];
    };
#

@cosmic lichen pingpanda

cosmic lichen
#

Yes, _object is not available inside the code {} of the addAction

silk sparrow
#

Okay

#

So I can "transform" this variable in a global one?

cosmic lichen
#

You can pass it to the code

cunning crown
silk sparrow
#

What do you mean by "passing it" to the code/addaction?

cosmic lichen
#
this addAction 
[
    "<title>", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
      _arguments params ["_object"]; //Get the _object variable like this
    },
    [_object],//Add the variable here
    1.5, 
    true, 
    true, 
    "",
    "true", // _target, _this, _originalTarget
    50,
    false,
    "",
    ""
];```
cunning crown
#

The addAction gives access to 4 params in the script params ["_target", "_caller", "_actionId", "_arguments"];, the first 3 are not modifiable but the 4th one can by giving the arguments a value in the addAction

silk sparrow
#

Hummm

#

So it's like overpass the limitation I have rn

#
1.5, 
    true, 
    true, 
    "",
    "true", // _target, _this, _originalTarget
    50,
    false,
    "",
    ""
#

For what are, all these lines, used for?

cosmic lichen
silk sparrow
#

Ok, so it's a super advanced addaction

#

xD

cosmic lichen
#

You might be interested in radius and condition arguments. But first get the code working.

silk sparrow
#

For what I understand, you can modify really everything about this addaction

cosmic lichen
#

Yep, it's pretty powerful

silk sparrow
#

Does this stand like a general config for all addactions or is it THE addaction (in this case, i'm not sure of where to place the code to execute after clicki,g the addaction on my NPC)

this addAction 
[
    "<title>", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
      _arguments params ["_object"]; //Get the _object variable like this
    },
    [_object],//Add the variable here
    1.5, 
    true, 
    true, 
    "",
    "true", // _target, _this, _originalTarget
    50,
    false,
    "",
    ""
];```

@cosmic lichen

cosmic lichen
#

It's a general config. I just added the _objects parameter

#
 {
        params ["_target", "_caller", "_actionId", "_arguments"];
      _arguments params ["_object"]; //Get the _object variable like this
 // Add your code here
    },
#

Put the code inside the curly brackets

silk sparrow
#

Okay

#
texturer addAction 
[
    "Peindre skin XAL", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
      _arguments params ["_object"]; //Get the _object variable like this
      hint "blahblahblah" //HERE
    },
    [_object],//Add the variable here
    1.5, 
    true, 
    true, 
    "",
    "true", // _target, _this, _originalTarget
    10,
    false,
    "",
    ""
];
#

Oh boy

#

It work

#

And it work well

#

So much thank you @cosmic lichen @cunning crown @still forum @worn forge @alpine ledge for your time, help and patience !!

sacred slate
#

when i export my scenario to sp, all my execvm things aren't working anymore. how do i fix this?

#

ah they are not pbo and i have to move the files manually.

#

*they are not in the pbo

cosmic lichen
#

Where did you put your execVMs?

shut kraken
#

I am trying to set the position of a unoccupied turret, I can use _val = cursorObject animationSourcePhase "mainTurret"; hint str _val; to get the value but using cursorObject animateSource ["mainTurret",deg(_valu)]; is not working. I've searched and searched and don't know if theirs anyway to do this?

worn forge
#

Yeah I don't think animateSource works that way, I think it's defined states

cosmic lichen
#

Also, there is a typo in your code. You get _val but use _valu for setting

worn forge
#

phase: Number - wanted animation phase

#

When you say "set the position" do you mean set the location / direction? Because you would want to use setPos and setDir for this

cosmic lichen
#

I just read that with animationSourcePhase and deg one can set the relative direction of the turret to the vehicle. So that should work.

shut kraken
#

I mean the rotation, basically it's adjusting the rotation like this

                    _valu = _val + 0.01;
                    if (_valu >= 2.61799) then {_valu = 2.61799};
                    vehicle player animateSource ["mainTurret",deg(_valu)];```
#

_valu can range from 2.61799 to -2.44341

worn forge
#

So you want to line up the vehicle direction with the direction of the main turret?

shut kraken
#

I'm trying to write a script to control the main turret from the drivers seat

#

using EV's that are added when your inside a certain type of vehicle

crude needle
#

The rest of that thread suggests that it works only with UGVs.

cosmic lichen
#

IIRC I tried that 2 years ago or so with tanks and couldn't get it to work, but it worked with UGVs

#

So that would support what's written in the thread

winter rose
#

same

cosmic lichen
#

Problem solved, next case πŸ˜„

shut kraken
#

Thanks guys, I think I know a way around it but it would require some model changes

cosmic lichen
#

Too bad it doesn't work.

winter rose
#

I would have made a spinning-turret helitank already πŸ˜„

cosmic lichen
#

πŸ˜„

hallow mortar
#

Do you need a script to control the turret from the driver's seat? You should now be able to directly control a driver AI from the gunner's position (maybe not for UGVs). Might have better luck by dynamically spawning drivers if solo control is your goal

winter rose
#

in OFP (…yeah) there were "hidden" classes of "one-man tanks" (M1A1auto" iirc) where you would drive with the keyboard and aim with the mouse, do it all by yourself

cosmic lichen
#

@hallow mortar Is right

hallow mortar
#

That would be neat to have, or at least to see if the config can be replicated in A3. The new direct driver control lets you do basically the same thing, though

cosmic lichen
#

add an AI as driver and boom, one man tank

winter rose
#

yup (but "RIGHT/LEFT/FORWARD/STOP/LEFT/STOP/LEFT(…)")

hallow mortar
#

Only with overlapping order and driving keybinds

winter rose
#

oh, maybe I should remap some keys then

haughty fable
#

Hello, is there any script that makes an specific vehicle for example the "B_Heli_Transport_01_F" only to be driven by an specific unit for example the "B_Helipilot_F" ? (I dont know too much about scripting)

wispy cave
#

Yup, put a getin EH on that vehicle, or one of the player, and kick the player out if he's not the specific class allowed to fly that heli

#

or just google for seat restriction script

austere sentinel
#

you'd be looking for addEventHandler, roleDescription, and isTypeOf
Edit: ignore roleDescription, didn't register that you were using unit classes instead of lobby roles at first.

haughty fable
#

thanks @wispy cave , i dindt know what to exactly search and finally found this script:

#

init:

#

RestrictVehicles.sqf:

#

If i do it with more vehicles,
Will it make the server perform worse?

austere sentinel
#

Short answer; Yes.
Event handlers for each vehicle are a lot more lightweight than a while loop iirc.

haughty fable
#

And how can i do that? To check only when a player enters into a vehicle

haughty fable
#

the thing is that i dont know about scripting

#

maybe that when someone gets in, the script actives

#

activates

crude vigil
#
this addEventHandler ["GetIn", { 
  if (((_this select 1) == "driver") && typeof (_this select 2) != "B_Helipilot_F" ) then {
    moveOut (_this select 2);
  }
}];

Drop it on the helis you want in editor.

haughty fable
#

and the other code i have?

crude vigil
#

Hello, is there any script that makes an specific vehicle for example the "B_Heli_Transport_01_F" only to be driven by an specific unit for example the "B_Helipilot_F" ? (I dont know too much about scripting)
@haughty fable This does what u specifically asked

haughty fable
#

ok, let me try it

crude vigil
#

Updated , try this one instead. I did not notice it is transport heli u wanted

haughty fable
#

It works, but it wont let anyone use it at all

#

I only want it for the driver position

crude vigil
#

yep it is now gonna do what you want

haughty fable
#

Still the copilot

crude vigil
#

you want copilot to be anything?

haughty fable
#

Yes

crude vigil
#

updated again 😩

haughty fable
#

Can you send me the one you did before, for co pilot and pilot?

crude vigil
#
this addEventHandler ["GetIn", { 
  if ((((_this select 1) == "driver") || (_this select 1 == "gunner")) && typeof (_this select 2) != "B_Helipilot_F" ) then {
    moveOut (_this select 2);
  }
}];
haughty fable
#

thank you very much, you saved my day hahha

#

If i want it to display a message, i just have to put a hint at the end?

#

A private message*

crude vigil
#

depends on where u want. a hint is easy one

haughty fable
#

A private message, only for the player trying to enter

crude vigil
#

but it may not work if ur mission is multiplayer

haughty fable
#

Or maybe a message on the vehicle chat

crude vigil
#
  "You are not a pilot!" remoteExec ["hint", _this select 2];

Put it after moveOut line, test it just in case.

#

is your mission multiplayer or not?

haughty fable
#

Yes

#

Is multiplayer

#

The script works perfect, also for artillery guns lol, thank you 😁

crude vigil
#

no worries, enjoy.

worn forge
#

Hi folks, does anyone have a bright & simple idea for how I can detect a keypress that's assigned to any/all TFAR radio button activation?

hallow mortar
#

CBA may have a better eventHandler to deal with this, I don't know.

You'll need to know the inputAction names of the TFAR radio button controls.
Construct an onKeyDown UI event handler. Use an if statement, the event handler's parameters, and actionKeys to determine if the key that was pressed matches one of the TFAR actions.

#

An example I haven't tested but should get you closer:

// create an event handler in Display 46 (main display)
_nul = findDisplay 46 displayAddEventHandler ["KeyDown", "
  // create local variables for the results of the event handler
  params ["_display","_key","_shift","_ctrl","_alt"];
  // store the key codes for the TFAR actions in local variables
  _TFARkey1 = actionKeys "TFARAction1";
  _TFARkey2 = actionKeys "TFARAction1";

// check whether the key pressed matches the TFAR action key
if (_key in _TFARkey1) then {
  hint "you pressed TFAR key 1";
  };
if (_key in _TFARkey2) then {
  hint "you pressed TFAR key 2";
  };
"];
worn forge
#

Hi Nikko, thanks for this. I'm using that exact strategy right now, and I think what I'm looking for are the inputAction names, if any πŸ™‚ You have just reminded me that I think it's possible to hint out the inputAction as it's pressed, so I could get it that way.

hallow mortar
#

I'm sure you can find a point of contact with the TFAR devs (or another modder who actually uses TFAR) who can tell you what they are

still forum
#

You'll need to know the inputAction names of the TFAR radio button controls.
wuht.
TFAR has eventhandlers for transmission start/end, ui open, and most things that are done with buttons. @worn forge

wispy cave
still forum
#

most of them I think

thorn shale
#

I want to play a custom Arma map. But the teamate AI take a massive hit on fps, so all i want to do is disable teammate AI, you can do it when you host a server but I don't know how to do it for single player scenarios

winter rose
#

Can't

#

Also, no crossposting #rules @thorn shale

thorn shale
#

i got told to post it in here

covert inlet
#

you also got told to remove your other post to avoid crossposting

#

he even pinged you so you cant pretend you didn't see it πŸ˜‰

thorn shale
#

I didn't see that sorry

#

kinda hard to see it when im doing something else

winter rose
#

aaanyway.

In SP you don't have access to any settings (unless you use singleplayer cheat), so you "have to" play the way the mission maker designed it. If it is a mission you can edit in Eden, you can simply delete said AIs.

thorn shale
#

ok thanks

bright flume
#

if you have editor/script access maybe just as simple as an addaction on yourself to disable the AI on any squad you controlling? not sure the implications/side effects of that though. only idea I could come up with other then as a player force them to just go sit somewhere

#

if you got zeus you can just tp them into a 'safe box' way out in nowhere. or maybe addaction that would do that effect?

worn forge
#

Thanks for the direction towards TFAR variables and event handlers - I've been all over that page. My problem is that those variables are useful when the TFAR activity has been engaged, but I'm trying to detect the key event that triggers it. I've created a custom UAV interface through a camera, and using a Keydown displayeventhandler works only if you know what you're detecting for. My solution has been to allow everything and then add use cases for specific key presses (in my switch, I have a default condition now that produces false, and allows the TFAR actions to work)

still forum
#

can you explain what you want to do? Why you want this key blocking

worn forge
#

When you create a camera with camCreate and push the player view into with switchCamera, user input is essentially disabled unless you put a displayEventHandler to capture input events. My workaround has been to put a default { false } case

still forum
#

with switchCamera the input is disabled, but just adding a displayEH re-enables it? Or are you handling the keybinds, inside your display handler specifically, per-keybind?

worn forge
#

I'm not sure I understand your second question, but yes, putting the player view into a new camera disables input. Creating a "KeyDown" display event handler allows them, and in that event handler I use a switch to process the keypresses to provide different effects, and a "mouseMoving" handler (I think, probably not the right name, not looking at it right now) to allow the view direction to move.

still forum
#
#

also actionKeys won't work once modifiers come in. shift+ctrl+alt (as is common with TFAR) make the actionKeys numbers useless as their precision is too limited. Also TFAR keys don't even have a ActionKey
https://community.bistudio.com/wiki/actionKeys see notes.

worn forge
#

you mean inputAction? I'm aware.

still forum
#

No I don't mean inputAction, that works fine

worn forge
#

well tfar doesn't have one of those, either.

still forum
#

I mean actionKeys, in reference to the code snippet above

potent depot
#

Question: If a client that has ai local to it(it is handling processing for ai) disconnects. What client are those ai then local to? Do they get dumped to server? This is an HC and Zeus related question for the most part.

still forum
#

server

potent depot
#

Ok, then if im worried about server killing itself in such an event, would disabling simulation on all of the dumped units locally on the server reduce the processing impact of the dump? Reenabling later ofc after processing or offloading the ai again ofc.

#

or would using disableAi be better?

still forum
#

disabling simulation would reduce load

#

but I don't think the server would die

potent depot
#

Its mostly meant for if like a HC dies and dumps 100+ ai with 50-70 players. That will probably kill it I think.

#

Thanks for the info

still forum
#

no it won't

potent depot
#

Hmm. It is moded so that is also a factor. Disabling simulation is probably something ill hold off on for now then. Im already grabbing all of the ai being dropped and immediately starting offloading.

winter rose
#

you could add them to the Dynamic Simulation system… or delete them

exotic flax
#

The worst that could happen is a minor server fps drop the moment the server gets all those AI.
Unless you have some weird scripts in place which only work/init on the server it should be fine.

winter rose
#

ouch
I crashed Arma with airportSide πŸ˜…

exotic flax
#

:O

hollow cloak
winter rose
#

@exotic flax ```sqf
airportSide 999999999; // or something

austere sentinel
hollow cloak
#

@austere sentinel Thanks πŸ™‚ but how would I insert this would i have to change variable names for the cars ?

tough abyss
#

Hi, a new experienced developer here. I got a couple of questions:

  1. What's the best way to start learning arma 3 server side & client side scripting ?
  2. Is arma still a thing? Will a new multiplayer mode (other than Altis Life/KOTH) be played if made properly ?

Thanks :-).

winter rose
austere sentinel
#

@austere sentinel Thanks πŸ™‚ but how would I insert this would i have to change variable names for the cars ?
@hollow cloak
Are you doing this in the editor or via script? Are you just checking all cars in the trigger area, or against specific ones? If the former; a forEach thisList would check against all units in the given trigger (you'd put that in activation/deactivation field). If you want to check specific cars, you'd have to use varnames, yes.

hollow cloak
#

No just every car inside the trigger at that time and yes its in editor if possible @austere sentinel

haughty fable
#

Hello, is there any way that i can set specific respawns only for specific units? For example, i want that B_Helipilot_F can spawn at a house but no one else can

austere sentinel
#

No just every car inside the trigger at that time and yes its in editor if possible
@hollow cloak
{ if ( _x isKindOf("Car") ) then { _x skipWaypointCommand; }; } forEach thisList; in the trigger activation field. Replace skipWaypointCommand with whatever command you're using to skip. Trigger activation mode is up to you though πŸ˜‰

winter rose
haughty fable
#

@winter rose Thank you, but i dont know about scripting πŸ˜…

finite sail
#

hehe

haughty fable
#

How did you learn it?

hollow cloak
#

@austere sentinel Wait so it has to be a specific type of car stated so I cant have an SUV roll past then like 2 mins later a quad bike

austere sentinel
#

Oops, that should've been isKindOf, edited. That should cover all ground vehicle types

winter rose
#

you won't be able to do what you want only through Eden; you will need scripting

hollow cloak
#

@austere sentinel Wait so do i need to do anything else or just paste that in? Also thank you so much πŸ™‚

haughty fable
#

@winter rose Okay, i'll take a look 😁

austere sentinel
#

You'd have to edit the skipWaypointCommand part to whatever skips your AI's waypoint, but other than that it should work out of the box. (I don't know the command off the cuff, sorry)

hollow cloak
#

@austere sentinel Thanks for your help really appreciate it πŸ™‚ cant test it just yet as im not on my pc any longer but if i need help could I ask you 😁 πŸ˜‰

austere sentinel
#

No problem, and sure. πŸ‘

hollow cloak
#

Thanks alot

tough abyss
#

@Lםו

#

@winter rose Thanks. Unfortunately there is nothing in the guide about some templates or coding conventions regarding code structure (classes, sub folders, includes, correct hierarchy). Any idea?

winter rose
ebon ridge
#

Hi, how can i turn on siren and lights with SQF in B_GEN_Offroad_01_gen_F (and other gendarmerie vics)?

tough abyss
#

Thanks! Just what I was looking for.

#

Love you.

ebon ridge
#

I worked it out from the arma files:

if(_siren) then {
    [_vehicle, 'CustomSoundController1', 1, 0.2] remoteExec ['BIS_fnc_setCustomSoundController'];
    _vehicle animate ['beaconsstart', 1, true];
} else {
    [_vehicle, 'CustomSoundController1', 0, 0.4] remoteExec ['BIS_fnc_setCustomSoundController'];
    _vehicle animate ['beaconsstart', 0, true];
};
bright flume
#

yeah nvm am asking need to cut #s by x decimal places and ideas how?

bright flume
#

that or toFixed since I am going to a string anyway with it

harsh vine
#
while (TRUE) DO {

 if (player distance _Satellite <= 10 && _ishvt) then 
{

myActionID = _Satellite addAction 
[
    "REINFORCEMENT REQUESTER ", //title
    {
        params["_target", "_caller"];
        [_caller] execVM "script.sqf";
    },

    [],
    10,   
    false,
    true, 
    "",   
    "true"
    2,    
    false,
    "",
    ""
]; 
};
};
#

Is there a was to stop the addaction for stacking??? its inside the while loop so, i guess thats why but what im trying to achieve it has to be in (while true)... i just want one action to show up.

winter rose
#

@harsh vine you can add the action once and set a distance condition, without any waiting

still forum
#

@winter rose feedback tracker ticket for crasherinos, important to give correct category

cosmic lichen
#
myActionID = _Satellite addAction 
[
    "REINFORCEMENT REQUESTER ", //title
    {
        params["", "_caller"];//You don't use _target, no need to assign it
        [_caller] execVM "script.sqf";
    },
    [],
    10,   
    false,
    true, 
    "",   
    "true" //Add isHvt here, cannot be a local variable
    10,    //Radius
    false,
    "",
    ""
]; 
``` @harsh vine
winter rose
#

@still forum I shall, on Saturday (if I remember my password there)

jaunty zephyr
still forum
#

I assume that's a joke question and you meant "tell me what it does!"

winter rose
#

I suppose it checks if object models etc are loaded in the designated area

#

camPreload etc

#

Maybe

jaunty zephyr
#

what does "reasonable time" mean though tinfoil

winter rose
#

I would say "don't bother"

#

see preloadObject, might be related

still forum
#

--snip-- answer removed because user crossposted

jaunty zephyr
#

yes unforgivable cross post, when its on a different server, a different language, and the overlap of people reading both is literally Dedmen and no one else... okay I see where I went wrong. :D

slate sapphire
#

Hello, is there a way to force player group leader when he is incapacitated, I am trying to integrate arma3 revive to my mission it's working but the fact that player swap team on incapacitate is creating me some minor troubles that I would like to fix, if any of you had similar problem would be cool to know a possible solution. Cheers!

winter rose
#

swap team?

slate sapphire
#

I just want to stay leader of group also when incapacitated I think it's game engine that automatically give lead to an AI if you are incapacitated, so my question is: Can I force player as leader also when he is incapacitate (lifestate == incapacitated))

young storm
#

Is there a way to change sides in eden with a trigger? So ai wont outright shoot you lol. The dont fire unless fired upon keep in formation doesnt work and the one that says dont fire unless fired upon just makes em shoot you lol

winter rose
#

@slate sapphire I don't think you can, but you can still try selectLeader

#

@young storm if you just want "not being shot at", you can use setCaptive

slate sapphire
#

I need to use an event handler and check state incapacitated? yes I was reading about select leader problem is how to use it properly and if it's not looping back like you get lead but you incapacitated so lead switch again...

winter rose
#

if you can't, you can't - there is no forcing, the engine is always stronger than commands

young storm
#

@winter rose hmm oki ty

winter rose
#

@slate sapphire you can try in the Editor with the debug console

slate sapphire
#

in the editor there is a strange behave if I host, without group works

#

with group, I get in a ghost invisible state I can kill all map nobody is shooting me and I see only 3rd person and black/white screen like I am in Limbo

#

if I do in dedicated server then it works with or without group

#

the problem is when I am incapacitate ai start to give orders and also other script that need to know if player group leader to work... such ass penalty on ai die and addranking remove to player, don't work cos player is not leader, it's something I would like to fix to have a more polished system that still count AI loss to side of player also if he is incapacitated, and remove ranking, plus I would lose all command to supply truck and other ai in group if one AI take lead and start to assign waypoints to all group.

#

come on AI I am not died yet don't take lead wait at least you mf... heheh

winter rose
#

you are incapacitated, it means what it means

#

just don't get shot

slate sapphire
#

well that's an hint I'll follow also in real life but to be realistic in a warfare of hours and against also other players there is good amount of bullet in the air and the chance to get hit by one is very high, so I've ask if somebody already deal with incapacitated state and found a work around to the leadership swap, that was my question, if the answer is don't get shot, well thank you I'll tell to all players to don't get shot so problem solved.....

winter rose
#

Perfect! Problem solved :+1:

young storm
#

@winter rose i hate to be a pain but my trigger isnt activating the way pointsss lol

young storm
#

Nvm it seemed being in proximity to the trigger was the problem

lucid junco
#

does anyone knows if Gcam works with controller?

worn forge
#

@lucid junco I think it depends on the controller, it didn't work with my little Logitech gamepad.

young storm
#

I take it back my trigger is fubar lol

gusty jewel
#

is there a script command to halt a server? e.g. if a preInit script decides that a condition is unrecoverable, stop all execution and shut down the server?

#

or can I just throw an exception outside a try/catch block to terminate the program?

modest temple
#

_obj ctrlAnimateModel ["Threat_Level_Source", 0.5, true];

#

what is the "Threat_Level_Source" here?

exotic flax
#

it's a GUI element with some kind of animation, although it doesn't seem to be vanilla

modest temple
#

it's meant to change the numbers on the chemical detector

#

but it's not working

worn forge
#

Many Contact functions don't work unless you're running that DLC

modest temple
#

im running the DLC

#

maybe im doing it wrong

#

this ctrlAnimateModel ["Threat_Level_Source", 0.5, true];

#

i just put this in to the init of the player for testing but it does not work

worn forge
#

well the player isn't a control, so that's likely your problem right there

still forum
#

@gusty jewel no

gusty jewel
#

thx

viral basin
#

hey guys, does anyone know if HandleDisconnect also detects timed out players?

worn forge
#

Wiki says it gives you the following params: ["_unit", "_id", "_uid", "_name"]; so the cause of disconnection is not made available.

viral basin
#

yeah guess i have to try it myself πŸ€–

young storm
#

Someone helpee i hava question.
How many waypoints to trigger can i sync one trigger too?
How come if i do this the helos follow the waypoints without me triggering it ? What i do wrong lol

drowsy axle
#

Hey guys, Is there a way to find out in game your arma.cfg settings and displayed?

young storm
#

@drowsy axle are you asking me or telling me to go there lol

drowsy axle
exotic flax
#

Or scripting, since it's possible to make waypoints and triggers with scripts

#

And afaik it's not possible to read out cfg files.

young current
#

@drowsy axle what kind of info are you looking for from there?

young storm
#

@exotic flax hm i see ill post there too ig lol

#

@drowsy axle ty

exotic flax
#

Be careful not to Cross-Post πŸ˜‰

ebon ridge
#

e.g. if I have remoteExec some piece of code or function call with JIP true, then when does it get executed on the joining client?

exotic flax
#

In the same order as normal, just skipping the tasks which are not JIP compatible

ebon ridge
#

no i mean if I at some point do remoteExec of a function, when does that function get executed for the JIP player?

exotic flax
#

No, because you can't run code on a client that doesn't exist yet

#

Although depending on the function/script, it could be global and therefore automatically be set on new connections

slate sapphire
#

Hello I did ask this morning without luck but I try again now, is there a way to force player as group leader when he is incapacitated, trying to integrate revive within my warfare and need to know if someone found a solution or know that is possible or not.

drowsy axle
#

@young current to see if your info like GPU frames ahead etc

young current
#

GPU frames what now?

still forum
#

no you cannot read the config.

queen cargo
#

@ebon ridge JIP is what gets executed for every player that joins after the mission started
And remoteExec with JIP true probably gets executed at the same level as BIS_fnc_MP, needs to be double checked though

sacred slate
#

i some how don't know the google syntax: can i designate some random area as town, so generators can find it as location?

upper isle
#

does anyone have a script for a gunship?

acoustic abyss
#

@upper isle Drongo has an excellent mod for it... Must it be a script?

young storm
#

On triggers whats the timer thingy do

winter rose
#

oh all the questions

winter rose
#

@sacred slate you can create locations

#

@slate sapphire I told you to try commands in the editor

#

@upper isle the gunship script?

#

@young storm depends on the set timer mode; it is either a countdown or a "wait for x seconds of validated conditions"

#

Phew done.

slate cypress
#

πŸ‘

upper isle
#

Metin, It does not have to be a script. Where can I find Drongo's mod? Thank you.

#

Lou Montana, I was looking for an AC-130 script

bright flume
#

is there a \a3\ui_f\hpp\ for joystick codes?

winter rose
#

@upper isle you could use a circle waypoint with the Apex west airship

bright flume
#

loiter... does have CCW

still forum
#

you mean DIK code @bright flume ?

upper isle
#

Lou Montana, thank you I will try it.

bright flume
#

not keyboard but input/dik codes for joysticks.

still forum
#

they are mostly analog so...

bright flume
#

trying to figure why two totally different devices getting mapped as the same input from both

still forum
#

xbox example

#define XBOX_A     0
#define XBOX_B     1
#define XBOX_X     2
#define XBOX_Y     3

probably not that helfpul.

bright flume
#

yeah its for a flight stick. I found the xbox ones

still forum
#

can't find anythin

bright flume
#

I dont know what pbo that file paths into unless ya know offhand

#

k maybe hardcoded inputs

still forum
#

might not be any. If its not usable via script, there won't be a include for scripts

bright flume
#

Im just looking for the defines in the hope to maybe manually remap it or see why it thinks and dups the inputs

young storm
#

@winter rose i tried that its weird. I went into trigger waited the apropiate amount of time that was max amount i set, i exit helo it starts up as soon as i leave. It then flies past two way points then instead of landing. It goes into a 2km holding patturn (flies round n round a forest when the LZ was 5 km away. What am i doin wrong? Surprisingly my trigger to get the MI8 and trucks full of infantry to move an rappel and dismount work (ish..the mi8 comes back an picks em up again or in my cycle waypoint it sits on the place n the infantry remount it. The 2nd truck out of the first one dismounts its units 200m from the point the first one does)

#

Sooo yeee tons of weirdness lol

#

XD im close to givin up after like ive been workin on this op for nearly 35hours in the last 3 weeks

winter rose
#

punctuation x_x

young storm
#

Yes i know im sorryyyy

#

Its nearly midnight, being moderately coherent is hard ;_;

#

Can you forgive me sir lol

winter rose
#

don't work with non-working brains, all you'll have is awful thinking πŸ˜„

#

take a break, have a kitkat and come back to it with a fresh mind - forcing won't do

young storm
#

Working 4 hours with triggers that change behaviours everytime does that lol. And ahah uhm sure xD why not

#

Got any advice on what im doing wrong tho ?

winter rose
#

first, working tired!
second, I don't know. I would need to see the whole mess of triggers

young storm
#

Hmm yes you are correct lol. In that case ill go rest xD and try round 2 and 3 and 4 maybe 5 then ill bother you πŸ˜…πŸ˜…πŸ˜…

#

Honestly tho ty xd

winter rose
#

'night! ^^

summer void
#

Hello everyone im kind of new to scripting and im messing with vehicule weapon and use them on vehicule that totaly should'nt have that and i wanted to make or find a script to make all the magazine in big one like if i have 3 120round belt on my canon with the script i only have 360 munition

winter rose
#

Hi new, I'm dad!

#

also, 3Β Γ—Β 120 = 360, it adds up

summer void
#

yeah english is not my main langage so i may not use the right word to express myself ^^'

winter rose
summer void
#

btw dad when u will come back from store its been like 8 years :v

winter rose
#

I still haven't found my cigs, you will have to wait

summer void
#

yes i added a weapon thats not from the vehicule to it and because i use a secondary ammo type when i use it from the begining it start reloading

winter rose
summer void
#

i found that while i was searching awser for what i wanted to do but i dont really know what to put were

#

if i do "this setWeaponReloadingTime [gunner (vehicle player), currentMuzzle (gunner (vehicle player)), 0.5];" idk what the bold part mean

#

i think if i put down the 0.5 to 0 its going to work as i want but dont know what i have to put instead of the bold stuff for my heli

summer void
#

If anyone could help me understand what i need to replace to make it work mp me or just tell me here ty ^^'

past mist
#

I'm trying to set a marker over the position fo a fugitive

#

I'm using this code

#
   [] spawn { 
       While{not isNull fugitive; sleep 1} do{ 
           "lastKnownPos" setMarkerPos getPos fugitive; 
            fugitive globalChat "well "+getPos fugitive;
       }; 
   }; 
};`
#

it's placed on the global init but it does nothing

#

tried also on the init of the unit itself and nothing

#

What's wrong with it?

winter rose
#

fugitive is an undeclared variable, therefore the code errors

#

you can check in the arma rpt, and/or activate the -showScriptErrors startup flag to have a popup

#

@past mist

past mist
#

fugitive is a unit

#

I kinda resolved by adding

    "lastKnownPos" setMarkerPos getPos fugitive;
    sleep 60;
}
``` in the init.sqf
#

dunno why it works now and not before

winter rose
#
fugitive globalChat "well "+getPos fugitive; // will error
past mist
#

ah yes, that was my attempt to debug

winter rose
#

unless it only globalChat "well "

past mist
#

but the code was not working

#

at all

#

didn't pop any error

winter rose
#

yep, you put the sleep after the condition in your while

#

the while code block should end with a boolean.

#
if(isServer) then{ 
   [] spawn { 
       // While{not isNull fugitive; sleep 1}
      while { sleep 1; not isNull fugitive }
do{ 
           "lastKnownPos" setMarkerPos getPos fugitive; 
            systemChat str getPos fugitive;
       }; 
   }; 
};
``` @past mist
summer void
#

@winter rose sorry to ping you but i didnt find the meaning of the code to adapt it to my heli and other vehicules
Halp πŸ˜…

winter rose
#

is this for SP or MP?

#

also, is the vehicle empty or has a gunner?

summer void
#

Its a ah- pawnee

#

So its for pilot

#

I removed the minigun and rocket and put a 20mm minigun and 230 mm rocket

#

Im not on my computer atm so i cant give you the actual code πŸ˜…

winter rose
#

and does it have a pilot?

#

and is it for SP or MP

summer void
#

I tryed it for solo but if i can use it on mp it would be great

#

Yeah the weapon are on the pilot seat

winter rose
#

I get it, but is there a pilot in it

summer void
#

Oh sorry

#

No

winter rose
#

or is it an empty vehicle

summer void
#

Its empty mb πŸ˜…

winter rose
#

np :p

winter rose
#

setWeaponReloadingTime seems to be the time between rounds, not reloading reloading
what you could do is remove/readd weapon, this would load the mag instant I think

summer void
#

Ok ty ill try that ^^

hallow mortar
#

didn't one of the addMagazine commands recently get a parameter for instant mag loading?

still forum
#

don't remember that

#

you can do addPrimaryWeaponItem

#

that will load it afaik

hallow mortar
#

I was thinking of addWeaponItem, which gained a parameter for instant loading in 1.95

hollow cloak
#

Is there a script when an alarm is played while a bargate is open and then when it is shut it turns off?

tough abyss
#

Anyone has NoSQL integration to arma server ?

distant oyster
hollow cloak
#

@distant oyster Thank you appreciated

viscid flame
#

yo

#

I have a question

#

I am trying to kill my friend with the command player setdamage 1; but his name has a space in it, what do?

winter rose
#

@viscid flame you don't use the player's name.

runic quest
#

Hi friends, may I ask, for example, a map with a module (xxx.jackon_county), what is its worldname?
Is it (altis) or something else? Thank you

tender fossil
#

What kind of database solution would you recommend for storing massive amounts of information and retrieving it very often?

#

(talking about Arma 3 gamemode)

still forum
#

uh...

#

the kind of database usually depends on the kind of data, not the size/read frequency

tender fossil
#

Also congrats @still forum πŸ˜„

still forum
#

I'd say, use that what's available, which means extDB or intercept-db, which means mysql.

tender fossil
#

Just small bits of information like numbers and strings

#

But a lot of them. A lot

#

In terms of Arma

exotic tinsel
#

is there a function where i can pass cursor object and get config reference? issue is there are objects on the map that are not in cfgvehicles so i cant look up stuff using inherits from or functions like. i need to get base class name of an object that i cant click on in the eden editor.

still forum
#

typeOf gives you the class of the object

#

if it has a class. it has a cfgvehicles entry. if not it doesn't have a config entry at all (like many map objects)

exotic tinsel
#

so the equivalent to cfgvehicels. example what base class are tress in? is there a function that will give me that so can then write other code to get more info.

still forum
#

example what base class are tress in
none, they don't have a config class, they are terrain objects

exotic tinsel
#

ok.... when i use nearestobjects i cant hide/delete them. some stuff i want to delete/hide some stuff i dont. but i need to know the "iskindof" terms to use to keep what i want and remove what i want. only way i can do that is by looking them up in the config file, and to do that i need to know the base class to start looking in and it would be nice if i could go in game and look at something and return the info i need. so im trying to write that. not everything is terrain object or cfg vehicle. so any ideas on functions that would help. inheretsfrom or returnparents all require you to know the base class.

still forum
#

nearestObjects doesn't return terrain objects

exotic tinsel
#

well this hide/deleted everything on the map. this is just my test code. so....

{
    private _x_delete = true;
    if ((_x isKindOf "trees") || (_x isKindOf "bushes")) then
    {
        _x_delete = false;
    };
    if (typeOf _x == "O_MRAP_02_F") then
    {
        _x_delete = false;
    };

    if (_x_delete) then
    {
        deleteVehicle _x;
        if !(isNull _x) then
        {
            hideObject _x;
        };
    };
} foreach nearestObjects [centerposition, [], 10000];
still forum
#

inheritsFrom gives you the base class of a class you have

#

have you read the nearestObjects wiki page yet?

#

it tells you how to detect trees

exotic tinsel
#

yes... hence my need for a way to detect them in the foreach so i dont delete them.

still forum
#

It tells you a way to detect them

#

so.. what else do you need again?

exotic tinsel
#

its not just about trees. its... nvm... ill ask someone else.

still forum
#

look at str _x for bushes, or modelInfo and see if you find anything that they have in common

#

but as I said, they have no config classes. so your config approach won't work

exotic tinsel
#

is there a way to detect if an object has no class?

still forum
#

what does typeOf return for a bush?

exotic tinsel
#

idk

bright flume
#

tbh think there is a class did he name which bush cuz the ETO module picks up bushes under 'grass'

bright flume
#

yeah but when it groups them Im thinking there some parentage that is being checked

fleet hazel
#

In my RPT file, an error appears when a player exits the server.

#

Warning: Cleanup player - person 2:1859 not found

bright flume
#

common

lapis ivy
#

Is it possible to change the armor vest through the script in the mission?

winter rose
#

yes

#

@lapis ivy ^

lapis ivy
#

I have a vest with a winter skin, but the protection characteristics are huge, I need to change the degree of protection, not change the vest.

winter rose
#

no can do.

supple vine
#

Is there any command that would let me check what map/terrain is the object being placed on wiht Init EH?

winter rose
#

yes, worldName

supple vine
#

ah, awesome, thanks πŸ˜„

ebon ridge
#

I would like to have a unit take a weapon from an inventory, first moving to it if necessary, is there a simple way to do this or do I need to spawn a move and then wait for them to get there and use Take action?

lucid junco
#

someone knows keycodes for controller?

warm storm
#

Where do i put sounds in my mission folder

#

?

#

playSound "Killfeed_notification.wav";

#

where do i put this sound

lucid junco
warm storm
#

@lucid junco thanks for the quick reply

#

i already have that

lucid junco
#

if you have defined in description.ext then u just put the sound into the folder coresponding with the path defined in ext file

warm storm
#

are you able to join a vc? @lucid junco

lucid junco
#

not now

warm storm
#

Ok np

#

this is my mission folder

lucid junco
#

class CfgSounds
{
class boom
{
name = "boom";
sound[] = {"\sound\boom.wav", 1, 1};
titles[] = {1, ""};
};
};

#

in this case u put sound into "sound" folder

#

{"\sound\boom.wav", 1, 1};

warm storm
#

I have

#

check the above gif

lucid junco
#

where is problem?

warm storm
#

It says missing sound

#

this is my script that executes the sound

lucid junco
#

probably some misspel. Dont have time to check sorry

warm storm
#

now i get no error

#

but the sound doesnt playu

lucid junco
#

playsound "music1";

warm storm
#

I have that

#

but the variable is

#

'deadsound'

winter rose
#

you defined "class music1"

you should playSound "music1"

ebon ridge
#

Has someone made a generalized system for dealing with all the different functions for accessing and modifying inventories? It requires a lot of boiler plate to have some remove item action that will work on a unit and a container. There should just be "removeItem" that will work regardless of what the target or item class is (and by "item" I mean everything, weapons, items, backpacks etc.)

winter rose
#

@ebon ridge doesn't and won't exist.
So far, remove everything then re add everything -1

ebon ridge
#

what?

#

i don't understand what that means

winter rose
#

if you are talking about ammocrates, the "remove 1 item" will never exist

ebon ridge
#

i mean something that generalizes the different interfaces between a unit and an inventory for instance. If I want to remove a vest from some object, I need to use a different function if that object is a unit or a crate.

winter rose
#

yep, and it won't change

ebon ridge
#

I didn't ask if anything will change

#

I asked if someone has written a wrapper that makes it sane

winter rose
#

I don't think so, but… Perhaps

ebon ridge
#

I never seen such a thing, but its only the 3rd time I need to write code for simply removing something from a target regardless of if that target is a crate or a unit, and already I am annoyed by it, so I hoped someone who wrote it 10 times got annoyed enough to solve it πŸ˜„

#

in this case its an auto looting script for AI, I jsut want AI to take a vest from any possible place

#

whether its a box or a body

#

and even more generally I want them to take a set of things, a primary, vest and helmet, without needing separate code paths for each item

winter rose
#

removing one item from a crate is tricky : which magazine, for example? The first inserted one, or the one with the least ammo? Same for vest or backpack. Empty vest? Vest with one mag in it?

ebon ridge
#

yeah these would be decisions such an API would either decide for me, or allow me to control with parameters

winter rose
#

Write it
Sell it for 5 toilet paper rolls
???
Profit

still forum
#

different interfaces between a unit and an inventory for instance
uniformContainer, vestContainer, backpackContainer
are all vehicle cargo containers, same as if you target a vehicle directly

#

get the cargo container, and then use the same function on all of them because they are all equal

ebon ridge
#

yeah but unit itself is a container as well which can have a vest and uniform in it right?

#

or at least i want it to behave like one

#

i don't care that a unit can only have one vest, and a box can contain lots, I jsut want to say object removeItem "vestclass"

#

or something like that

still forum
#

yeah but unit itself is a container as well which can have a vest and uniform in it right?
no

#

a unit has containers on it. Its not a container per-se, or atleast the unit container itself you cannot access

spiral sundial
#

guys if I wanna remove the side skirts of a tank from RHS how would I do that? (T-80A/B/BV/BVK have that as customization option, but T-72s and T-90s dont, which I wanna change)

hollow cloak
#

Is there a way I can make multiple Ai stop at a checkpoint then you use a radio command to tell them to go also the ai dont come at the same time

lofty rain
#

Hey guys! A way to ”block” players weapon slots? Primary, secondary and launcher. So that player can not use any weapons.

distant oyster
#

@hollow cloak maybe with a trigger and the commands doStop or disableAI "MOVE"

hollow cloak
#

@distant oyster How would i use this in my mission?

summer void
#

any idea why a script that change weapon work on eden and worked 1 time in mp dont worked after changed the weapon but still same code ?

distant oyster
#

@hollow cloak depends on your mission. seems harder than I thought but as I said that depends on your mission... After all you could try with a waypoint that is synched to a trigger with activation by radios.

#

@lofty rain There is the eventhandler "InventoryClosed". maybe run a check on the unit and if he has a wepon drop it via commands.

lofty rain
#

@distant oyster thanks. I’ll start digging.

potent depot
#

Anyone know if its possible to have an eventhandler on a specific command? i.e. createVehicleLocal

haughty fable
#

Hello, can anyone tell me why when i run this script on my player, all the weapons dissapear?

#

[player, "PRONE_INJURED", "NONE"] call BIS_fnc_ambientAnim;
sleep 2;
[player, "STAND1", "NONE"] call BIS_fnc_ambientAnim__terminate;

still forum
#

@potent depot no

potent depot
#

rip

winter rose
#

@haughty fable "NONE"

haughty fable
#

@winter rose I tried with "FULL" , but the backpack still dissapearing

winter rose
#

did you try "ASIS" @haughty fable?

haughty fable
#

Yes

winter rose
#

Then this function removes everything by default for this anim, no way to do otherwise but use the animation yourself directly

summer void
#

Is their a difference between script used in eden and in zeus ?

young current
#

some commands work only in eden, some live

summer void
#

does the command remove weaponturret and add weaponturret only work in eden ?

#

i made it work one time in zeus

young current
#

since it worked in zeus that should tell you its not confined to Eden

#

most commands are normally run in live game

#

3DEN commands are restricted to the editor

#

and some of the other commands run in editor dont have actual effect when the mission is run and need to be run again when the game is live.

hollow cloak
#

Is there a script anyone can help me with please where you scroll on a car and tell it to skip waypoint?

#

Also works on multiple separate cars

bright flume
#

also I believe someone mentioned this in the past, gotta lead in to the animation with ASIS otherwise wont matter what you stop it with as its already lost (could be the issue in this case?)

winter rose
#

@haughty fable
it's sqf [player, "PRONE_INJURED", "ASIS"] call BIS_fnc_ambientAnim; sleep 2; player call BIS_fnc_ambientAnim__terminate; note that it's only player for the last call

bright flume
#

thanks Lou it was likely you that mentioned it.

winter rose
#

also, if you just want someone injured you can use setUnconscious (even if it is not immediate)
or swichMove "UnconsciousFaceUp"

bright flume
#

I only asked about the wiki cuz Im spoiled by JavaDocs and basically even something like that its documented so the IDE knows it. πŸ₯³

winter rose
#

wrong channel? :p

bright flume
#

nah I didnt want ya jumping. cuz Im about to ask....

winter rose
#

oh shβ€”

bright flume
#

is there a EH for vic spawning vanilla or even CBA? need to run a invulerablity script on any and all spawned vics. in this case a mod is spawning them not a player so I cant add the script on it like in eden. so hoping for a EH mission level to catch all of them

winter rose
#

#define vic

bright flume
#

vehicle...

winter rose
#

(could have been victims)

bright flume
#

yeah specifically ground, trying to stop alive from being naughty with some vehic's

winter rose
#

either a respawn EH, a MPRespawn EH or an EntityRespawned missionEH

bright flume
#

does that count on the first spawn I mean these are 'spawns' not something being respawned.

winter rose
#

my bad, I read "_re_spawning"

bright flume
#

all good lol I fell in that trap this morning

hollow cloak
#

I have this in a trigger 10x5 area car disableAI "move" ; then
this addAction ["Allow through","enableAI Move"]; but whenever I launch the mission it says 'enableAI Move # ' ---- Error invalid number in expression Could anyone help me out please ?

winter rose
#

@bright flume vehicles

#

@hollow cloak "_this select 0 enableAI ""move"""

#

better in code { _this select 0 enableAI "move"}

hollow cloak
#

wait where would that code go @winter rose

winter rose
#
car disableAI "move";
car addAction ["Allow through",{ _this select 0 enableAI "Move" }];
hollow cloak
#

Thank you alot for that πŸ™‚

bright flume
#

dreams of a discord diff markup like quoting.

haughty fable
#

@winter rose Thank you, im trying another code, later i'll show you 😁

hollow cloak
#

@winter rose Also is there a way where you have to be fairly close for it to work or is that very complicated?

bright flume
#

radius # in addaction

winter rose
#

@hollow cloak yes you can set a distance in addAction arguments

bright flume
#

object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

winter rose
bright flume
#

dang lou you type fast as me. well refence is above posted πŸ™‚

winter rose
#

(if I counted well)

#

am I good or am I good?

bright flume
#

starts whispering number nine number nine...

hollow cloak
#

'car # addAction allow through... Error type Any expected string

bright flume
#

is the ; missing on the end of the addaction object's script command? cant remember if its needed in it

haughty fable
#

https://community.bistudio.com/wiki/addAction
9th argument, so```sqf
car disableAI "move";
car addAction ["Allow through",{ _this select 0 enableAI "Move" }, nil, nil, nil, nil, nil, nil, 5]; // 5m

@winter rose Is there any way i can change that argument without having to write all of that?

winter rose
#

no

haughty fable
#

Okay

bright flume
#

wtb a way to define specific args by [] πŸ˜›

winter rose
#

shhh we don't do that here

haughty fable
#

?

hollow cloak
#

Wait @winter rose Can you help the code has an error

winter rose
#

gimme the code you put there?

bright flume
#

shake just pose the question if its related, anyone here if they can help normally does.

winter rose
#

^ also true

hollow cloak
#

is the code you said

winter rose
hollow cloak
#

is the code you said
@hollow cloak car addAction ["Allow through",{ _this select 0 enableAI "Move" }, nil, nil, nil, nil, nil, nil, 5];

haughty fable
#

wtb a way to define specific args by [] πŸ˜›
@bright flume What do you mean?

hollow cloak
#

sorry @bright flume 😦

bright flume
#

no apologies needed just saying pose the ? :), and as for arg[] some let you define args without writing the whole line cuz you define the value to what arg by [] position as in like a list []. different language....

winter rose
#
car disableAI "move";
0 = car addAction ["Allow through",{ _this select 0 enableAI "Move" }, nil, nil, nil, nil, nil, nil, 5]; // 5m

0 = @hollow cloak because trigger…

haughty fable
#

no apologies needed just saying pose the ? :), and as for arg[] some let you define args without writing the whole line cuz you define the value to what arg by [] position as in like a list []. different language....
@bright flume Oh, thank you πŸ™‚

bright flume
#

but like Lou said we dont talk about that here. lol

hollow cloak
#

wait im confused I used the code but it still has an error do i need to change anything in the triggers?

haughty fable
#

but like Lou said we dont talk about that here. lol
@bright flume I dont understand english perfectly, so i didnΒ΄t know what you mean πŸ˜…

winter rose
#

@hollow cloak just add 0 = before car addAction

hollow cloak
#

I did πŸ˜•

winter rose
#

hmm, weird then
lemme try

steady terrace
#

is there some form of ID for players joining a server that one could use to send variables?

like eh.


if (playername == "John") then {
    //send variable ["John wallet"]
}

cause I want to incorporate money in my script, and that has to be server only to avoid tampering

bright flume
#

Battleye UUID? steam ID?

still forum
#

ownerID

#

use remoteExec, you can send to player based on variable, ownerID, or just reply to whoever remoteExec'ed to you

winter rose
#

@hollow cloak sorry, one has to provide most if not all the arguments

addAction ["Allow through", " _this select 0 enableAI ""Move"" ", nil, 1.5, true, true, "", "true", 5];
#

Fixed*

hollow cloak
#

@winter rose It now says init missing ;

#

Nevermind sorry my fault

#

needed car at front

#

Thank you for your help much appreciated

winter rose
#

yeah sorry I did cut to the meat of it :)

haughty fable
#

When doing a setPos, how can i change the x corrdinate adding +10?

#

For example, i have an object in [10,10,0] , how can i do a setpos to the player to those coordinates but adding 10 to the x coordinates?

winter rose
#

vectorAdd

#

@haughty fable

private _origPos = getPosATL player;
private _newPos = _origPos vectorAdd [0,0,10]; // +10m altitude
player setPosATL _newPos;
#

so [10,0,0] in your case

haughty fable
#

ohh ok, thank you!

steady terrace
#

thanks @still forum and @bright flume ! remoteExec with remoteExecutedOwner seems to be what I need.

haughty fable
#

Ok, so i made this code:

#

_sBag = _this select 0;
_sbagPos = getPos _sBag vectorDiff [0.3,0,0];
_playerPos = getPos player;
player setPos _sbagPos;
player setDir(getDir _sBag + 180);
[player, "PRONE_INJURED", "ASIS"] call BIS_fnc_ambientAnim;
sleep 1;
player setPos _playerPos;
[player, "STAND1", "ASIS"] call BIS_fnc_ambientAnim__terminate;

#

But still dissapearing the backpack

#

Is there any way i can save all the equipment of the player on an array, remove them from the player, and then put them back into the player?

coral owl
#

Is it possible that some animations lock the unit performing them and can never be toggled/moved again?

hollow cloak
#

How would I rotate the junk in the back of this offroad

#

cant send images one sec

#

90 degrees

#

boom

haughty fable
#

Is it possible that some animations lock the unit performing them and can never be toggled/moved again?
@coral owl You need to end the animation

cyan dome
#

i am developing a mission in which it uses dynamic mission and i need to know how to add sound in scripts that doesnt use trigger.

#

could anybody help?

coral owl
#

Thanks @haughty fable I am trying to find out if I can avoid a brutal switchMove ""

young current
#

thats the way to end it

#

@cyan dome how are you running the scripts if not with triggers?

#

you just add the commands into whatever script you run

cyan dome
#

as i said it is dynamic

coral owl
#

@young current yes but it disconnects from the previous action and the animation breaks

cyan dome
#

i was using sunday_system

young current
#

that does not say anything to me

#

and @coral owl then you will need to play transition animations

#

before using switchmove "" to clear it

cyan dome
#

if anybody now how to insert sound in the script next to the diagloges

#

know*

coral owl
#

Thanks @young current I am looking into it, I can't seem to find the right transition animations, but I get it now

young current
#

some animations are connected to play in sequence

#

some are not

cyan dome
#

// Create extract task
switch (_extractStyle) do {
case "LEAVE": {
if (((count _heliTransports) > 0) && !extractHeliUsed) then {
_taskCreated = ["taskExtract", true, ["Extract from the AO. A helicopter transport is available to support. Alternatively leave the AO by any means available.", "Extract", ""], objNull, "CREATED", 5, true, true, "exit", true] call BIS_fnc_setTask;
diag_log format ["DRO: Extract task created: %1", _taskCreated];
[(leader (grpNetId call BIS_fnc_groupFromNetId)), "heliExtract"] remoteExec ["BIS_fnc_addCommMenuItem", (leader (grpNetId call BIS_fnc_groupFromNetId)), true];
} else {
_taskCreated = ["taskExtract", true, ["Leave the AO by any means to extract. Helicopter transport is unavailable.", "Extract", ""], objNull, "CREATED", 5, true, true, "exit", true] call BIS_fnc_setTask;
diag_log format ["DRO: Extract task created: %1", _taskCreated];
};

    // Send new enemies to chase players if stealth is not maintained
    if (!stealthActive) then {
        if (enemyCommsActive) then {
            diag_log 'DRO: Reinforcing due to mission completion';
            [(leader (grpNetId call BIS_fnc_groupFromNetId)), [2,4]] execVM 'sunday_system\reinforce.sqf';
        };
        // Make existing enemies close in on players
        diag_log "DRO: Init staggered attack";    
        [30] execVM 'sunday_system\generate_enemies\staggeredAttack.sqf';
    };

this is the sample.

coral owl
#

got it

young current
#

@cyan dome pls use codeblock markdown formatting or pastebin.com

cyan dome
#

how>?

#

kinda new to the script

young current
#

its discord feature

#

three ` then cpp
then your code

#

and three ` more

cyan dome
#

like this ?

young current
#

no

cyan dome
#

im horrible at this

young current
#

thats alright

#

you can do it

#

` usually is produced with the button left to the backspace and shift being pressed together

cyan dome
#

||~~taskCreated = ["taskExtract", true, ["Extract from the AO. A helicopter transport is available to support. Alternatively leave the AO by any means available.", "Extract", ""], ~~||

#

in any way that is the sample code

#

i have a voice acted ogg files ready

#

the only problem now is how am i gonna insert the voice in the script it can be done in triggers in game but just as the campaign mode it doesnt usally use tons of tons of trigger just to hear all the annoucer is saying in the game.

young current
#

welll you just plug whatever sound command you want to use into there and it should play it

cyan dome
#

i have no idea what kind command i am gonna need to use for it.

young current
#

is it safe to assume you did not write the code yourself?

cyan dome
#

yep

#

i am just adding voice in the announcer to give it life for personal use ONLY

young current
#

Id use triggers then

cyan dome
#

until the developer itself approved the release

coral owl
#

is there a way to make an AI discharge its weapon accidentally?

young current
#

no, you would have to force it to do so

coral owl
#

but I have to create a virtual target it will aim to?

young current
#

if you want it to point somewhere

coral owl
#

I was curious if a weapon can be made to just shoot without being aimed

#

currentWeapon _unit something..

young current
#

there are few different "fire" commands in the link above

coral owl
#

yes, they seem to all be deliberate acts of fire to something

#

will investigate πŸ™‚

#

thanks

haughty fable
#
_sBag = _this select 0; 
_sbagPos = getPos _sBag vectorDiff [0.3,0,0];
_playerPos = getPos player;
player setPos _sbagPos;
player setDir(getDir _sBag + 180);
[player, "PRONE_INJURED", "ASIS"] call BIS_fnc_ambientAnim;
sleep 1; 
player setPos _playerPos;
[player, "STAND1", "ASIS"] call BIS_fnc_ambientAnim__terminate;
#

I made this code for sleeping,the only problem is that when i sleep, the action removes the backpack of the player

cyan dome
#

one last question

#

any body has any idea how to add voice in a.i? make them speak

young current
#

there is a command to that too I recall

#

@haughty fable removes it how?

#

theres nothing backpack related in your code

haughty fable
#

I made this code for sleeping,the only problem is that when i sleep, the action removes the backpack of the player
@haughty fable Is there any way that i can save all the things that the player is carrying on an array, remove them for the action and then give them back to the player (after the action)?

#

@haughty fable removes it how?
@young current It just dissapear, with all the things inside

young current
#

sure you can save the stuff but better way would be to figure out what removes the stuff

haughty fable
#

I thin its the action itself, i have tried with [player, "PRONE_INJURED", "FULL"] also but still the same

#

sure you can save the stuff but better way would be to figure out what removes the stuff
@young current How can i do that ? (Im relatively new to scripting)

young current
#

you collect the stuff into an array with different comands and then before the script ends you use other commands to put the things in the array back into the character

haughty fable
#

I know, but which commands

young current
#

there are quite a many of different items and weapons related commands you can choose from

#

in the commands list I linked above

coral owl
#

can I do a pushback on an array I have not defined?

I mean:

globalArray01 pushBack _unit;
#

I would like to avoid globalArray01 = [] at the beginning but I am getting an undefined variable error

winter rose
#

no

#
globalArray01 = [_unit];```eventually @coral owl
haughty fable
#

When i use addAction in the init box of an unit, what can i do so that im the only one (the unit) who can access that action?

coral owl
#

true @winter rose thanks

young current
#

this for multiplayer @haughty fable

haughty fable
#

What?

young current
#

you addAction

winter rose
#

@haughty fable not put it in the init

as a poor workaround, ```sqf
if (local this) then { /* blah */ };

haughty fable
#

But what i mean is, when i put another unit near to me and put the addAction in his init box, i can access to it

winter rose
#

in single player or in multiplayer…?

haughty fable
#

how can i send an image?

bright flume
#

imgur? photobucket? snaggy? etc

#

steam screenshot...

winter rose
#

Just answer the question Mason

haughty fable
#

hahahaha

#

wait

winter rose
#

SP or MP

haughty fable
#

SP or MP
@winter rose I have saved the mission on MPmissions

#

But im doing the tests in single player

winter rose
#

then if (local this && player == this), should cover most cases

#

but using the init is baaad

haughty fable
#

But im not using the unit

#

init

#

Im doing it one the init of the bot

winter rose
#

…you are using the init field

#

using the init field is baaad

haughty fable
#

ANd how do i put the addAction then?

winter rose
#

scripts!

haughty fable
#

What you mean is to call the unit Unit1 (for example) and then do it all
through a script?

winter rose
#

for example yes; on each player connection, all init fields are run so it's "not great"

haughty fable
#

Ok, let me try

sharp lake
#

I figure it makes sense to ask here, how do I include ACE functions in an SQF file so I can use them? trying to find the specific include command I'd need and the wiki isn't helping much

haughty fable
#

for example yes; on each player connection, all init fields are run so it's "not great"
@winter rose I cant make it work 😩

#
if (local this) then {
Unit1 addAction ["Loadout", "Loadout.sqf"]
};
winter rose
#

if local Unit1 ?

#

@haughty fable

haughty fable
#

i tried but still nothing

winter rose
#

where did you put this?

haughty fable
#

On a new script

#

Called addaction.sqf

winter rose
#

and where do you call it?

haughty fable
#

πŸ€” i dont know, you told me to not use the init box of the unit πŸ˜†

#

What should i do?

winter rose
#

in init.sqf, _which is called locally for the server and each clients (even JIP),

if (player == unit1) then {
  unit1 addAction ["Loadout", "Loadout.sqf"];
};
haughty fable
#

That way, the script is only called for the Unit1? and doesnt affect to the server?

winter rose
#

yep

#

as long as you don't allow group teamswitch or in-group respawn, it should be fine

haughty fable
#

unit1 addAction ["Loadout", "Loadout.sqf"]; so if i put only this on the init.sqf, what would happen?

winter rose
#

put what I wrote up there

#

if you only put this, you would have the same effect as before, everyone would have access to the action.

haughty fable
#

i still dont have the addAction

winter rose
#

are you unit1?

haughty fable
#

oh wait

#

I think its because i named the soldier Unit1 instead of unit1 πŸ˜†

winter rose
#

nope

#

case-insensitive

#

what do you want to do? that only if you are unit1, you have the action, right?

haughty fable
#

Well, i still dont have the action :/

#

what do you want to do? that only if you are unit1, you have the action, right?
@winter rose What i want to do, is that if another player comes close to me, he cant do the addAction

winter rose
#

then that's the one

haughty fable
#

but it doesnt work

winter rose
#

are you sure it's init.sqf and not init.sqf.txt?

haughty fable
#

yes

winter rose
#

and are you playing as unit1?

haughty fable
#

and yes

#

Variable name: unit1

winter rose
#

put this in init.sqf:

sleep 1;
systemChat "1";
if (player == unit1) then {
  unit1 addAction ["Loadout", "Loadout.sqf"];
  systemChat "2";
};
systemChat "3";
#

then tell me the systemChat output

haughty fable
#

ok now it worked

#

1 2 3

winter rose
#

there is no armagic here; you probably didn't edit or save the good file
anyway, it's good now

haughty fable
#

I think its because i cant name the unit (unit1) only (Unit1)

winter rose
#

case-insensitive

haughty fable
#

I dont know what happened then

winter rose
#

*magic*
anyway, it's cleared now

haughty fable
#

Yes, thank you very much πŸ˜„