#arma3_scripting

1 messages ยท Page 598 of 1

still forum
hushed tendon
#

what about it?

still forum
#

also you play that sound everytime the player is alive, not dead

#

that code is ugly, stupid and inefficient

#

You can use selectRandom as I wrote above ๐Ÿ˜‰

hushed tendon
#

Look you tasked me with this

still forum
#

I hoped someone else would

#

ugh playSound needs CfgSounds

#
player addEventHandler ["killed", {
playSound selectRandom ["sound1", "sound2", "sound3"];
}]

something like that I think.

hushed tendon
#

the ; is not at the end?

still forum
#

if you don't have any code after that, you don't need it

hushed tendon
#

oh alright

#

I'll try this and let you know if it works

#

and what section goes under "killed"?

still forum
#

what mean?

hushed tendon
#

doesn't something have to go there?

still forum
#

where?
i posted the whole code

#

it adds a eventhandler, that will fire the code once player gets "killed"

hushed tendon
#

huh I thought i had to put something there. My little bit of knowledge is making me question a programmer way to much

still forum
#

I'm not good at explaining stuffz

hushed tendon
#

same

#

And if you want to know this script is so I can play random anime sounds when players die in my mission because I do exotic ops in my unit and this one anime op is a tribute to our lead pilot (In case you were wondering)

smoky verge
#

I'm kinda losing hope on this stupid line
is there really no better way to change an object texture in the editor from the attributes?

half hornet
#

what are you trying to set?

smoky verge
#

I've made an object and the problem is it has like 25 texture variants
and I don't want to spam the editor with 25 objects and instead make one with a texture selection menu

half hornet
#

have you tried setObjectTexture?

#

if im reading you correctly i might not be

smoky verge
#

well setObjectTexture changes it in eden
I need it to be a dropdown menu visible in the attributes
like this https://imgur.com/a/brxxweZ

half hornet
#

oh oh oh yeah i definitely misread your question uh im not sure how to solve that one but iโ€™ll see if i can find anything for you

smoky verge
#

don't worry I've been trying for 3 days
I'm the closest I'll ever be before I give up

half hornet
#

thats the arma development spirit!

ebon citrus
#

magazinesAmmo doesnt work on vehicles?

#

yes, it would seem so

#

ok, so there is no way to get the ammo-count of magazines in a vehicle's inventory?

winter rose
ebon citrus
#

yeah, that works

#

finally

#

i knew there was one

winter rose
#

yw

ebon citrus
#

thank you โค๏ธ

#

im getting the feeling that youre developing this addon more than i am

#

๐Ÿ˜…

winter rose
#

I demand 50% of the revenue

ebon citrus
#

i make no revenue

#

i thought arma modding was about giving to the community

#

i got it all wrong

winter rose
#

harr harr, how naive can you be! we du eeet for the moniez ๐Ÿ’ฐ

restive leaf
#

How much does a box of sand and a few snails cost though? ๐Ÿ˜‰

ebon citrus
#

fine sand here is 9,90 for 16kg

#

snails are 7,90 piece

winter rose
#

PIECE??

ebon citrus
#

supply and demand

winter rose
#

ร—6, no? Oo

ebon citrus
#

demand is low, so supply is non-existent, thus prices for bulk are up

winter rose
#

โ‚ฌ?

I feel way too concerned about snails prices all of a sudden

ebon citrus
#

โ‚ฌ

#

#arma3_scripting : "Discussion about anything related to Script creation and usage within game ... IF (script == true) THEN {chat here};"
Lou and Nica: SNAILS!

#

yeah, idk

#

i'll add you on the credits

#

along with the whole discord

#

but you'll get a personal mention

#

as well as anyone who i can remember ๐Ÿ˜…

winter rose
#

awww not mandatory but very welcome! ๐Ÿ‘

ebon citrus
#

it's the least i can do, tbh

robust hollow
#

script == true doesnt even work ๐Ÿ˜ข

restive leaf
#

if (sand && count snails > 0) then { call vomit; };

#

Damn... I actually like escargo ๐Ÿ˜‰

winter rose
#

HAH! screenshot and saved. You can't get away with this one!

restive leaf
#

๐Ÿ˜ฑ

ebon citrus
#

let it forever be known, that Lou will be credited as Hugh Laurie-lookalike

astral dawn
winter rose
#

if I find a way to ship some, I will @ebon citrus/@restive leaf /offtopic

#

@astral dawn I don't know, but I would tend to believe they act as attached objects (relative dir)

ebon citrus
#

i assume rotation is always 0

#

by default

#

so the angle would be north

astral dawn
#

funny, I assumed it's relative to north always. Because it's the laziest implementation and it's more accurate to assume it. ๐Ÿค”

restive leaf
#

That's what I would assume, but tbh, just an assumption

ebon citrus
#

there is a parameter to set rotation

#

but all objects spawn with a rotation of 0 unless otherwise specified

restive leaf
#

Dedmen probably wouldn't know... we need Dwarden for the answer to this one

ebon citrus
#

since triggers are 2d-ish objects, theyre always on the vertical axis only

#

which is correlative with north

#

will have to check

astral dawn
#

Dedmen seems to learn Czech though

ebon citrus
#

i dont get the question

#

wait, OH!

astral dawn
#

i dont get the question
You don't get my question?

ebon citrus
#

youre talking about attaching

#

sorry, i've lost my glasses

astral dawn
#

yes, trigger attachto car

ebon citrus
#

does that work?

astral dawn
#

no problem ๐Ÿท ๐Ÿท

#

attaching? sure

ebon citrus
#

ok

#

you can always get rel dir

#

welp, i guess ill try

astral dawn
#

Thanks but no need for it, I am trying this already

#

But I was thinking if someone had an immediate answer... there was a non zero chance of it ๐Ÿ˜„

#

I am very hyped for results since it will teach my bots to avoid vehicles moving towards them

ebon citrus
#

YES

#

it follows parent rotation

#

so if parent rotates, trigger rotates too

restive leaf
#

Nice

astral dawn
#

Oh interesting

#

Thanks

restive leaf
#

Maybe @winter rose could add a note that that info should be added to the wiki before this conversation gets lost in the aether

ebon citrus
#

not really

#

i think it acts as predicted

#

if it would act unpredictably, then i guess

restive leaf
#

Not really... otherwise the question would not have been asked and you wouldn't have tested it...

ebon citrus
#

but that's just my opinion

#

mmmh

#

fair point

winter rose
#

@astral dawn , how did you attach the trigger?

ebon citrus
#

although, triggers are objects

#

i used attachTo

#

objects act like objects

astral dawn
#

if it would act unpredictably, then i guess
It gets more weird here, since does it also rotate whole detection area box according to parent model rotation (including pitch and roll) or not?

#

i used attachTo
yes I used same

ebon citrus
#

no pitch and roll, i assume

#

since it doesnt have those properties

#

but fair point

winter rose
#

ok

It gets more weird here, since does it also rotate whole detection area box according to parent model rotation (including pitch and roll) or not?
would need to test

ebon citrus
#

i shall test more

#

let me break out the helicopters

winter rose
#

since it doesnt have those properties
it does have a height though - I would tend to support the fact that it shouldn't, but we can't rule it out before testing

restive leaf
#

No... trigger is a sphere so pitch and roll are irrelevent

#

You just roll around the circle

astral dawn
#

No... trigger is a sphere so pitch and roll are irrelevent
is it? trigger should have area (a, b, angle, ...)

ebon citrus
#

triggers can be non-spherical

winter rose
#

nope

ebon citrus
#

they can also be rectangles

winter rose
#

not a sphere
usually endless vertical cylinders

ebon citrus
#

unless you set a height

restive leaf
#

Oh... really?

winter rose
#

butโ€ฆ they can be square/rectangle, and/or set a height yes

#

@restive leaf yep. you are wrong. please leave this Discord now.

#

no snails for you ๐Ÿ˜ข

restive leaf
ebon citrus
#

nope

#

triggers keep their rotatation

#

the only axes they rotate around is Z

#

i spent a good moment kicking a car around with a tank

#

because i was too tired to write as script

queen cargo
#

Fairly logical
Even with a height property

It is easier to check if something is inside something on a 2D plane then it is in 3D

winter rose
#

I can add that to the attachTo page then

hushed tendon
#

For the mission init I have

player addEventHandler ["killed", {
playSound selectRandom ["tuturu_1.ogg", "tutturuu.ogg", "onee-sama.ogg", "oh-shit_2.ogg", "hitmarker_2.ogg", "niconiconilovesyou-3_cutted.ogg"];
}]

and for the Description.ext I have

class CfgMusic
{
sounds[] = {01,02,03,04,05,06};
class 01
{
name = "01";
sound[] = {"tuturu_1.ogg", db+10, 1.0};
titles[] = {0,""};
};
class 02
{
name = "02";
sound[] = {"tutturuu.ogg", db+10, 1.0};
titles[] = {0,""};
};
class 03
{
name = "03";
sound[] = {"onee-sama.ogg", db+10, 1.0};
titles[] = {0,""};
};
class 04
{
name = "04";
sound[] = {"oh-shit_2.ogg", db+10, 1.0};
titles[] = {0,""};
};
class 05
{
name = "05";
sound[] = {"hitmarker_2.ogg", db+10, 1.0};
titles[] = {0,""};
};
class 06
{
name = "06";
sound[] = {"niconiconilovesyou-3_cutted.ogg", db+10, 1.0};
titles[] = {0,""};
};

};

Is anything wrong with this? (I have the sound files in the mission folder)

#

Making custom death sounds for exotic op

robust hollow
#

playsound takes the sound class not the file name doesnt it?

#

so 01,02,03,etc

hushed tendon
#

for the init?

robust hollow
#

playSound selectRandom ["tuturu_1.ogg", "tutturuu.ogg", "onee-sama.ogg", "oh-shit_2.ogg", "hitmarker_2.ogg", "niconiconilovesyou-3_cutted.ogg"];
๐Ÿ‘‡
playSound selectRandom ["01","02","03","04","05","06"];

ebon citrus
#

@hushed tendon pastebin, please

#

or atleast codeblocks

hushed tendon
#

oh sorry. How do I do that?

ebon citrus
#

which one?

hushed tendon
#

either one that is needed

robust hollow
#

```sqf
code
```

#
code
hushed tendon
#

oh alright thank you

ebon citrus
#

pastebin for long pastes

#

codeblocks for short code blocks

hushed tendon
#

thanks both

ebon citrus
#

for example, if you want to paste your whole config

#

the prefer pastebin

#

keeps the chat nice and tidy

#

โค๏ธ

astral dawn
#

Nice, thanks Lou

hushed tendon
#

@robust hollow Gives the error "Sound 05 not found"

robust hollow
#

you used CfgMusic, try CfgSounds

hushed tendon
#

alright

robust hollow
#

unless it is actually music, in that case you might want the playMusic command. up to you.

hushed tendon
#

it is an .ogg playing a quick sound so I think you are right

#

it is '''CfgSound''' not CfgSounds'''?

#

messed the entire sentence up

robust hollow
#

the wiki disagrees

hushed tendon
#

huh

robust hollow
#
playSound

Description:
    Plays a sound from CfgSounds
hushed tendon
#

and also found the right (`)

hushed tendon
#

Am I missing the "Sound\tuturu_1.ogg", ... (Sound\ )

robust hollow
#

that depends, are your sound files in a folder named sound?

hushed tendon
#

They are in the mission file. Does that count?

robust hollow
#

as in the mission file root folder?

hushed tendon
#

ye

robust hollow
#

then just "tuturu_1.ogg" should be fine

hushed tendon
#

still not working

robust hollow
#

idk then. follow the instructions, do exactly what the wiki says and it is impossible to go wrong ๐Ÿ™‚

hushed tendon
#

๐Ÿ˜ญ Been doing this custom death sound thing for like 4 hrs

#

Way too much work for something totally not worth it

robust hollow
#

is your cfgsounds in the description.ext?

hushed tendon
#

ye

robust hollow
#

maybe try with sounds[] = {01,02,03,04,05,06}; as an empty array instead.

#

i imagine it isnt changing those to strings anyway (which i assume they need to be). the wiki examples leave it empty though so i guess it isnt necessary.

hushed tendon
#

Not working

robust hollow
#

mm yea i have no idea. never had any issues adding sounds myself.

hushed tendon
#

Well it is a custom death sound. That change anything from what you use it for?

ebon citrus
#

do i hear talk about playSound/playMusic?

#

have you been taught about say3D already?

hushed tendon
#

no

ebon citrus
#

our lord and saviour

hushed tendon
#

did not know about that until now

ebon citrus
#

ok, anyways, what's up

#

what do you want to do?

hushed tendon
#

make a custom death sound

#

it is .ogg

ebon citrus
#

death sound to others or the player only?

hushed tendon
#

player only

ebon citrus
#

ok, sound is enough

#

playSound

hushed tendon
#

or for players on one side

ebon citrus
#

?

#

players of a particular side, as in west, east etc.?

hushed tendon
#

like players on bluefor. Let them know someone died kinda

ebon citrus
#

kk

#

is your triggering method setup?

hushed tendon
#

being? like in the init using eventhandler

ebon citrus
#

which eventHandler are you using?

hushed tendon
#
playSound selectRandom["01","02","03","04","05","06"]; 
}]``` The Init
ebon citrus
#

this will only play the sound for the player

#

and no-one else

#

is that fine?

hushed tendon
#

If it cuts down time yes

ebon citrus
#

cuts down?

hushed tendon
#

forgot time

ebon citrus
#

ummm, yeah like 3 seconds worth of writing

#

ok youre triggering the sound

#

how's your CfgSounds?

hushed tendon
ebon citrus
#

lets see

#

change this sounds[] = {01,02,03,04,05,06}; to this sounds[] = {};

hushed tendon
#

trying it out

#

actually is that all?

robust hollow
#

i suggested that before ๐Ÿ˜ข

ebon citrus
#

are all the sound-files in your root

hushed tendon
#

Sry I must have not understood

#

I think

ebon citrus
#

what do you mean, you think?

#

are they or are they not?

hushed tendon
#

They are with the mission.sqf

#

that root?

robust hollow
#

if by sqf you mean sqm, yes

hushed tendon
#

ye sqm

#

So yes they are

ebon citrus
#

yep

#

ok

#

wait, where is your CfgSounds? in Description.ext?

hushed tendon
#

๐Ÿ˜ญ Finally after like 5 hrs I can finally hear "Nico nico ni" when I die๐Ÿ˜ญ

ebon citrus
#

oh wow

#

good job

#

๐Ÿ‘

#

hmmm...

#

what if...

#

to be continued arma 3 death mod?

hushed tendon
#

@ebon citrus @robust hollow @still forum
Thank you guys for helping me make a custom death sound and cutting down the time to only 5 hrs ๐Ÿ˜ญ Thank you ๐Ÿ˜ญ

ebon citrus
#

i didnt do anything

#

if connor suggested the fix already

hushed tendon
#

@ebon citrus Yeah we kinda just made that

#

And you did help even if you just helped me see something I missed or misunderstood

ebon citrus
#

sure

#

i'll take that

hushed tendon
#

There you go

#

Would this just be like a more gruesome death sound mod?

open hollow
#

helloo anyone knows how to do a costum Vignetting for a mission? , i want to use gas masks but JSHK mod doesnt have this "effect"

robust hollow
#

you define a display inside the RscTitles class of a description.ext (or config.cpp?)

#

there isnt too much trickery to it, just add the class to your description.ext file and it should be good to go

class RscTitles {
    class YourDisplay {/* display stuff here */};
};```
open hollow
#

ok, ill try with that

#

i mean i shoud put the .paa route there and thats it?

robust hollow
#

yes, but that isnt all. you would need to define a display and then an image control on that display to set the image path to.

open hollow
#

cutRsc ["whateverImageClassName","PLAIN"];

#

it will work with that?

robust hollow
fair drum
#

if a unit with a variable placed in editor dies and respawns, does it lose that variable? is that variable only for that life?

#

it looks like it does... any way I should go about reassigning it when that unit respawns?

ebon citrus
#

depends

#

where does this variable need to exist?

#

where the unit is local? server? all clients? all clients and server?

#

The way to go about it is always "how lazy can i be"

#

Dont ever do more than is absolutely necessary

#

Lazy code = best code... usually

fair drum
#

the unit is a playable unit lets name it squadlead1. so I guess it would have to be local to the player that is using it, and the server if I have scripts to run on that unit that are ran on the server

#

some things that come to mind are doing some sort of on respawn mechanics but I need to learn eventhandlers first

ebon citrus
#

Mmmh

#

Remember the locality related to eventhandlers

fair drum
#

currently looking at MPRespawn which shows global and local

fair drum
#
squadlead1 addMPEventHandler [
        
        "MPRespawn", {

            params ["_unit", "_corpse"];

            if ((missionNamespace getVariable "squadlead1") == _corpse) then {

                squadlead1 = _unit;
            };
        }
    ];

something like this?

unique sundial
#

MPRespawn fires only where unit is created, i.e. on the respawning player machine

fair drum
#

i guess I'm still lost. just trying to grab the global variable off a players corpse and reassign it to him when he respawns.

unique sundial
#

if you give variable name to the unit in editor it should still have this name after respawn

#

without any additional scripting

fair drum
#

well when I have a unit named "somename" and I enter him as a player, I run out, die, then respawn. when I check somename == player, I get false. same with isPlayer somename

unique sundial
#

hmm will have to check that

fair drum
#

i think i might know the error. you might not have to... give me a sec

#

yes, as per usual its user error. I had a bandaid fix where I had named a random item a variable, then in the unit's init I had thatvariable=this so I could skip an error I was getting if players didn't select that unit

#

so I have created this which works wonderfully. the problem is, when the unit respawns, I have to manually call the script again. its as if the while loop ends on death. if I call it manually, everything works fine and resets on the unit. am I missing something?

https://pastebin.com/RWAyq02D

crude vigil
#

So the problem is _unit right?

#

It works when you recall the function but the function fails after _unit's death, right?

fair drum
#

yup my function throws nill after that unit dies, but if its called again, then it is defined again

crude vigil
#

It is because _unit is getting updated when you recall it , and when he dies, it is no more the respawned unit

#

but still the dead guy

#

you need to get _unit within while loop

fair drum
#

I believe it is updated when I recall it yes

#

so just stick my params in the while loop?

crude vigil
#

The variable remains same as Killzone says, but the problem is , at that point, _unit is recorded in there in value form, not reference anymore.

#

You need to get the variable by using

missionNamespace getVariable ["_unit", objNull]; //Ignore this, this confused you. New one with additional info below.```
#

within your while loop

fair drum
#

this will return the unitname/var?

crude vigil
#

ofc , whatever the _unit in there is

#

u wont write _unit there

#

but whatever input u give to function

#

an option to do that is, pass the variable as string...

#

then do it like this:

_unit = missionNamespace getVariable [_this select 0, objNull];```
#

So you do not pass an object anymore, but a string because your variable is what you want, but the value that variable returns is not always what you want(on death for example)

fair drum
#

I guess I'm confused with params since this is my first time using it. I'm trying to make the code applicable to more scenarios than just putting the unitname in. I thought params ["_unit"] is the same as _this select 0

crude vigil
#

it is. But you have a while loop there, and you want _unit to always be the player who respawned

#

For example, you want "_unit" to always target player, which can not always be the same entity(if he dies, he is a new man, he is no more the value that is returned from _unit)

fair drum
#

oh ok I think I get it. the params in the beginning is defining the first _this select 0 from the [unitname] execVM "filename.sqf". Then the unit dies and the first _unit isn't filled anymore. so the second _this select 0 is pulling from that `[unitname] execVM "filename.sqf" again?

crude vigil
#

you need to retrieve a new value, which is still stored in the variable that you pass to your function .

#

yeah, _unit in there is the dead guy in this scenario, which is why isPlayer someunit returns false after death.

#

Killzone said that variable name in the editor remains same, which is true, but you are losing that variable name after you pass a 'unit object'

#

you need to get the new value that variable returns

#

but in this function you are losing since _unit is an object now

#

therefore, your function should retrieve the variable in string form, so it is not the value, but u re returning the string.. so later on, you can ask this string who the new guy is by using getVariable I provided above.

#

which you have to do after your while loop starts.

fair drum
#

ok I'm trying to follow. So I need to go back to the beginning and use something other than `params ["_unit"] to do this string idea?

crude vigil
#

so what you have to do is , it wont be a unit anymore, it will be just a string. So the _unit is something like _unitVariable now. then you call:

_unit = missionNamespace getVariable [_unitVariable, objNull];
#

beginning of your while loop.

#
/* ----------------------------------------------------------------------------
Name: Undercover
 
Description: Turns the unit defined by the parameter to friendly then hostile if unit gets too close to blufor or opfor units
 
Parameters:
0: Unit Variable <STRING>
 
How to call:
 
[unitname] execVM "undercover.sqf";
---------------------------------------------------------------------------- */
 
params ["_unitVariable"];
 
if (isServer) then {
 
        while {true} do {
            _unit = missionNamespace getVariable [_unitVariable, objNull];
            waitUntil {
.
.
.
#

Mind that Parameters part, it is not OBJECT anymore but a STRING

#

making this change, will fix your problem. You do not need to change anything else, but try to understand what the problem is.

#

Edited code, I used 2 different variable names accidentally, recheck pls..

#

Of course, do not forget to turn your variable into string as well when u call the function.

#

Since we changed data type

fair drum
#

ok so the unit gets brought into the script as a string "unitname". then what getVariable is doing is searching everything looking for the string "unitname" and finds it. It then pulls in the object variable of that said unit and sets it to our private variable?

crude vigil
#

indeed.

fair drum
#

ok that makes sense, but wow I was trying to read the getvariable wiki page at the same time and that page is confusing for that command imo

crude vigil
#

Basically , you are getting the unit the variable is assigned to in this mission

fair drum
#

so my call has to be ["string"] execVM... as well right?

crude vigil
#

indeed

#

the variable 'name' that you use for the unit..

#

if you are using

[myUnit] execVm ...
```you now need to use:
```sqf
["myUnit"] execVM ...
still forum
#

missionNamespace getVariable ["_unitVariable", objNull];
thats wrong. Needs to be
missionNamespace getVariable [_unitVariable, objNull];

fair drum
#

i was just gonna ask that, cause it didn't seem to work

crude vigil
#

Thank you, @still forum , modified accordingly.

#

Coding in discord is not one of my top skills ๐Ÿ˜ฉ

fair drum
#

mk so in the getVariable parameter, if you want a string you put a string, and if you want an object you put an object

#

we wanted an object in the end

crude vigil
#

@fair drum Make sure you remove the " " parts in getvariable (modified the code now).

fair drum
#

yeah i got it

crude vigil
#

getVariable just asks the missionNamespace, what the variable's value is.

#

if you are asking objNull that is provided as 2nd parameter, it is the default value in case it is not defined.

#

so if you wanna make it string, go ahead, but it is better practice to keep it same type as the value you expect _unit to be.

fair drum
#

the wiki is just weird. it says varspace getvariable name where name is a string, and all the examples are strings. how would I know that I could put an object lol

crude vigil
#

You are talking about objNull part or the first part?

#

_unitVariable is a string, dont forget.

fair drum
#

ah ok

crude vigil
#

you pass the variable name in string form, and you get the value from it.

winter rose
#
["myObject"] call HYP_fnc_myFunction;
``````sqf
params ["_variableName"];
private _theObject = missionNamespace getVariable [_variableName, objNull];
fair drum
#

hmmmm i have it like that and its still not looping. is it because I'm using ["suicideBomber"] execVM "undercover.sqf"?

#

my params is a string, and the getVariable is just a local variable just like above

#
["suicideBomber"] execVM "undercover.sqf";
params ["_unitVariable"];
_unit = missionNameSpace getvariable [_unitVariable, objNull];
winter rose
#

it's not "looping"?

#

you have to use _unit at some point

fair drum
#

sorry there was a pastebin above. standby

crude vigil
#

Can you paste your new code?

fair drum
#
["suicideBomber"] execVM "undercover.sqf";
params ["_unitVariable"];

if (isServer) then {

        while {true} do {

            _unit = missionNameSpace getvariable [_unitVariable, objNull];

            waitUntil {

                sleep 1;
                ([west, east] findIf {_x knowsAbout _unit > 1.4} == -1) and
                (primaryWeapon _unit == "") and
                (handgunWeapon _unit == "");
            };

            hint "The Bomber is Hidden";
            _unit setCaptive true;

            waitUntil {

                sleep 1;
                ({((side _x == west) or (side _x == east)) and (_x distance2D _unit < 20)} count allUnits > 0) or
                (primaryWeapon _unit != "") or
                (handgunWeapon _unit != "");

            };

            hint "The Bomber Has Been Discovered!";
            _unit setCaptive false;

            waitUntil {

                sleep 1;
                ([west, east] findIf {_x knowsAbout _unit > 0} == -1) and
                ({((side _x == west) or (side _x == east)) and (_x distance2D _unit < 200)} count allUnits == 0);
            };

            sleep 10;
        };
};
winter rose
#
private _get = { missionNameSpace getvariable [_unitVariable, objNull]; };


if (alive (call _get)) then
{
  // ...
};
#

because _unit might die at any point

fair drum
#

yeah I thought that was what we were trying to fix above with the getVariable to reset the _unit

crude vigil
#

there are sleeps/waitUntils in this code, so after each sleep , you need to make sure the _unit is still the unit you want

winter rose
#

when you place it in _unit, it refers to the object itself, not the reference - hence the need to either refresh _unit or to always go for getVariable

crude vigil
#

To identify the issue, can u remove all the sleeps except sleep 10 at the end?

#

and test it like that?

fair drum
#

sure. before we did the getVariable stuff, I would run him into an enemy which he would die and I had a hint "test" after the sleep 10 which would always fire. I narrowed it down to the first while do returning nill because _unit was no longer defined. let me try it without the sleeps, 1 sec

fluid wolf
#

Shoot uhh, how do you do quoted names inside of a quote again? So a command like typeof that needs a "b_heli_light" inside of something thats already under "quotes"

winter rose
#

""

crude vigil
#

you can use ' '

#

or u can use " each time multiply it with 2.

winter rose
#
private _string = "his name is ""Lou Montana""";
private _string = 'his name is "Lou Montana"';
private _string = "his name is 'Lou Montana'";
fluid wolf
#

Awesome, thank you so much. That was driving me nuts.

winter rose
#
private _string = format ["his name is %1Lou Montana%1", '"'];
``` ๐Ÿ‘€ ๐Ÿ˜„
fair drum
#

doesn't loop even without the sleeps.

winter rose
#

then code problem - using -showScriptErrors?

fair drum
#

let me try lou's dealio

#

no errors on screen from previous attempts

#

with your call lou, would you put it in the while loop at the start?

winter rose
#

no, replacing every _unit

fair drum
#

oh.... oh my

fair drum
#

well I just looked up some reference material for gamemodes I know have an undercover system. looking specifically at antistasi and his functions all use player and not trying to do it with a particular unit. would this just be easier to do it with all players?

#

oooo or maybe an add action for the undercover script? or maybe something I can put into a player respawn template?

crude vigil
#

It really depends on what sort of mission/gamemode you have in your hand.

#

If you want to do this for all players instead of a particular unit, then yes you can use player but considering you will have multiple players, it is required to understand multiplayer scripting which I believe, you are not familiar with, yet.

#

adding action is a matter of design, which is up to you.

fair drum
#

i do want to do it for a particular unit, but I've been at this single script for over 3 days now so I'm getting burned out and wondering if I should start from the ground up again lol

crude vigil
#

if you re getting burned out, give a pause. Pushing may discourage and demotivate you which can lead you to completely give up if you are new to it; and in some scenarios, may also affect your capability of thinking logic wise.

#

Are you saying it because the code is still not working, or is it fixed after Lou's fix?

fair drum
#

it is not but I haven't fully implemented lou's fix yet. thats what I'm burned out about, I have rearranged and rewrittin this thing so many times in the past 3 days that its just burnout. I was looking for a simple idea that would be cool for an op for my unit but in the grand scheme of things, they probably wouldn't notice the work that went into it. its every friday so i'll have to make do for now but there's three more missions in this campaign so I have time to figure it out. just gonna take a break like you said

crude vigil
#

Take a break, also I suggest you to learn debugging techniques and whenever you are stuck, just use them to find out what is wrong.

winter rose
crude vigil
#

It will make your life easier.

winter rose
#

There is a wiki page for everything!

crude vigil
#

Eh, there was not when I had started :(

fair drum
#

ive been using visual studio for the stuff. any cool things I can do with it if you guys use it?

crude vigil
#

not meaning that specific page, just in general ๐Ÿ˜…

winter rose
#

@fair drum Visual Studio Code I hope?

#

See? told ya@crude vigil

fair drum
#

yes VScode. Already have the color'd text plugin. gonna try the armadev

crude vigil
#

@winter rose Today's starters are lucky in resource aspect.

fair drum
#

hopefully its consistent with the next iterations of the game so I don't have to relearn

winter rose
#

@crude vigil we work hard on that! ๐Ÿ‘

#

I 'member when using a wrong weapon classname in OFP crashed the gameโ€ฆ

faint oasis
#

i have a question ? how can i make a convoy in arma 3 ? because i have this command : setConvoySeparation but i don't know how i use that.

winter rose
#

link the vehicles together in a group, and order them to go to some other point - they should use roads in column

faint oasis
#

@winter rose ok but what is the "FOLLOW" waypoint ?

winter rose
faint oasis
#

i have group all vehicles after i have set a "limitspeed" and "convoyseparation" and it work only if i change the formation to "line"

winter rose
#

set behaviour safe should do the trick

#

tanks, or just road vehicles?

faint oasis
#

@winter rose i have remove the "convoyseparation" and the convoy always work so the "convoyseparation" command is only to change the distance between vehicle in a convoy and it doesn't work if i remove the limitspeed. When the vehicle doesn't have a speed limit the convoyseparation doesn't work and the distance between vehicle can be bigger ex : this setconvoyseparation 20 | can be 100 between a faster vehicle. So how the faster vehicle can wait other vehicle ?

winter rose
#

ah yes, it's only a floor limitation, not a ceiling

#

limitSpeed to the min speed I suppose - although, vehicles should wait each others in a way

faint oasis
#

yes but i need to check the distance between all vehicle

#

and if it's greater than 20 limitspeed = 0

#

yes it's a good idea

ebon citrus
#

I use notepad++ and arma ingame debug tools for code dev

astral dawn
#

There is even a real debugger with breakpoints and everything for VS Code, why not use this ๐Ÿคท

exotic flax
#

Because "real" programmers use Notepad (not ++)

unkempt sorrel
#

how tf am i suppose to define a uav with addAction? only way i get it to work is going into in game init and doing "this" addAction...

surreal peak
#

in editor you can give the UAV a variable name

ebon citrus
#

Depends on what youre adding the addaction to and how it's meant to worl

#

There are lots of ways of retrieving objects

#

you just need to find one that suits your purpose

unkempt sorrel
#
player nearestObject addAction ["hi button", 
{
    hint "hi";
}];```
#

now that i look at this... idk man

#

i tried the variable name too and it just doesn't do anything lol, i wonder if im initiating the code right or something stupid

ebon citrus
#

what do you expct this to do? @unkempt sorrel ?

#

the excamples for this one are great aswell

#
this addAction
[
    "title",    // title
    {
        params ["_target", "_caller", "_actionId", "_arguments"]; // script
    },
    nil,        // arguments
    1.5,        // priority
    true,        // showWindow
    true,        // hideOnUse
    "",            // shortcut
    "true",     // condition
    50,            // radius
    false,        // unconscious
    "",            // selection
    ""            // memoryPoint
];```
#
target (_this select 0): Object - the object which the action is assigned to
caller (_this select 1): Object - the unit that activated the action
actionId (_this select 2): Number - activated action's ID (same as addAction's return value)
arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax```
#

what you posted is a syntax error

unkempt sorrel
#
player nearestObject addAction ["hi button", 
{
    hint "hi";
}];
//params ["_target", "_caller", "_actionId", "_arguments"];```
ebon citrus
#

no...

unkempt sorrel
#

do i have to fill out all of those params?

ebon citrus
#
player addAction ["hi button", 
{
    hint "hi";
}];```
#

this adds the action "hi button" to the player

unkempt sorrel
#

Yes, I'm aware of that but idk if its my brain but like i can't replace player with the object i want

ebon citrus
#

what is it you want to do?

#

add the action to the UAV or the player?

unkempt sorrel
#

the UAV, but the tricky thing is, the uav is programmed as if a player is inside of it and you take control of that unit inside of the uav, that's why there's 2 seats, im just wondering how to get the unit inside of the uav

ebon citrus
#

why do you need to get the units inside of the UAV?

unkempt sorrel
#

basically im trying to get an add action for the gunner in the uav

ebon citrus
#

here you go btw

unkempt sorrel
#

oohhh

#

that might work!

ebon citrus
#

that gives you the gunner

unkempt sorrel
#

hell yeah man, thanks for the info ๐Ÿ˜„

ebon citrus
#

aything else?

unkempt sorrel
#

if i stumble across anything ill for sure let u know ๐Ÿ˜„

ebon citrus
#

thanks, i like tricky questions

#

especially those ones that involve flipping a car over with a tank for research purposes

oblique arrow
#

hm wasnt there a way to do a custom one of those radio support actions?

#

As in the ones that show up with a little icon on the top left of the screen that can then be executed via the radio

unkempt sorrel
#

@ebon citrus quick question... do you believe this init script will work?

#
{
    if (addMissionEventHandler ["PlayerViewChanged", {
    params [
        "_oldUnit", "_newUnit", "_vehicle",
        "_oldCamera", "_newCamera", "_uav"
    ];
}]) then
    {
        _d = [_x] execvm "IRLaserScript.sqf";
    };
}     forEach fullCrew player;
#

i think i forgot the variable actually, i think i use _this

exotic flax
#

What are you trying to do? Since that script won't work

unkempt sorrel
#

Well basically when i switch to a uav terminal or gunner screen, that event handler will fire and it will get the crew of the uav im in, then use that to put an addaction on the gunner

exotic flax
#

You most likely want something like this:

addMissionEventHandler ["PlayerViewChanged", {
    params [
        "_oldUnit", "_newUnit", "_vehicle",
        "_oldCamera", "_newCamera", "_uav"
    ];
    if !(isNull _vehicle) then {
       _newBody execVM "IRLaserScript.sqf";
    };
}];

Which will run an EH on "PlayerViewChanged", and run the script when inside a vehicle.

unkempt sorrel
#

ohh okay, can u point out what i did wrong if u dont mind? i just like learning from my errors lol

#

im new to all this so

exotic flax
#

addMissionEventHandler doesn't return anything and will always execute when the EH is triggered (in this case on "PlayerViewChanged").
All scripts you want to run on executing must be placed inside the EH.

unkempt sorrel
#

ohh okay so it doesn' t give a return so i add it in the block? makes sense ๐Ÿ˜„

exotic flax
ebon citrus
#

@unkempt sorrel player is not a valid vehicle

#

fullCrew will return nothing

#

if you want the player's vehicle, you need to use vehicle player

#

Sorry i couldnt reply immediately, i was out helping my friend apply for worker's permit

unkempt sorrel
#

@ebon citrus its okay i seemed to figure it out anyways, im using "gunner" and it does seem to return a value, my problem was initiating the script so i just did a simple way to start it and things are working as intended ๐Ÿ˜„

ebon citrus
#

what exactly is your script?

#

if you care to share

#

i'd like to have a read to make sure you did it right

vague geode
#

Is there a way to change how much the player score rises for certain kills? (E.g. for a jet double that of a helicopter or for a tank double that of an APC)

ebon citrus
#

handlescore and addscore

#

couple that with "iskindof"

#

and you have an easy check to give specific score for specific type of vehicles

vague geode
#

The _object refers to the destroyed vehicle?

ebon citrus
#

try it

#

would seem like so

exotic flax
#

object: Object - object for which score was awarded
So whatever is causing the award (killed unit, destroyed vehicle, etc.) is in this variable

agile anchor
#

Hiya does anyone know if it is possible to hide an object and only allow a specific unit to see it? Can't for the life of me think how it could be done

exotic flax
vague geode
#

@agile anchor What Grezvany13 said. If you want to hide if for everyone you could use hideObjectGlobal but I don't know if you can reveal it for one person with hideObject again afterwards...

unkempt sorrel
#
uav = nearestObject [player, "USAF_MQ9"];
addMissionEventHandler ["PlayerViewChanged", 
{
    params ["_oldUnit", "_newUnit", "_vehicle","_oldCamera", "_newCamera", "_uav"];
    list1 = gunner uav;
    list1 addAction 
    [
        format["<t color='%1'>Enable IR Marker!</t>","#228B22"], // forest green
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            _pos = getMousePosition;
            invis = createVehicle ["B_Soldier_A_F", uav, [], 0, "CAN_COLLIDE"];
            invis hideObject false;
            invis attachTo uav;
        }
    ]
}];
ebon citrus
#

dangerous use of a global variable

winter rose
#

also, uav != _uav

ebon citrus
#

i dont think "_uav" param is passed for that event

unkempt sorrel
#

this works btw, it executes the command when i want, its just the matter of adjusting z coords, and i can make it local, i just dont understand the differences of why they can conflict with other things, and can you elaborate lou ? i dont quite understand, and it actually is, _uav is if you go into the terminal screen

ebon citrus
#

oh, yeah it is

#

that's new

#

yeah, but it's still a dangerous use of a global variable

winter rose
#

works if you have only one UAV named uav yes

ebon citrus
#

make sure to remove the action aswell

#

or you'll keep on stacking them

#

and if you have one USAF_MQ9 in the mission

winter rose
#

long story short: don't ๐Ÿ˜„

ebon citrus
#

this seems like very Ad hoc code

#

it works for one use-case in VERY specific circumstances if you open the UAV terminal once

unkempt sorrel
#

hmm so basically, no global variables, and remove the action and loop it back

#

and name uav something else

ebon citrus
#

the game is adding a new action to the UAV whenever one of these occurs:

Fired on player view change. Player view changes when player is changing body due to teamSwitch, gets in out of a vehicle or operates UAV for example.```
#

it's broken on a fundamental level

unkempt sorrel
#

how should i specify that i only want the uav

#

just do the param _uav?

#

i didn't know if that conflicted with other things

ebon citrus
#

need help with it?

unkempt sorrel
#

a little, but i think im understanding, ill have to see though when i actually write it lol

ebon citrus
#

ok

#

it's best to design the code in pseudo-code first

#

first question, what do you want to do?

unkempt sorrel
#

well, i do want an ir laser to be shot from the tgp of the USAF mq9, so basically you can see what it is pointing at

ebon citrus
#

like a visual laser?

#

like the ones on rifles?

agile anchor
#

@exotic flax @vague geode thanks I look into that

ebon citrus
#

visual to NVG

unkempt sorrel
#

yeah, but only for night vision, exactly

ebon citrus
#

not just visual to where it's pointing

unkempt sorrel
#

yeah a visual laser

#

so im bascially putting an invis unit and attaching it to the drone

ebon citrus
#

that turns off the laser too

#

if you make the unit invisible, the laser goes invisible too

unkempt sorrel
#

is there a way to disable just the model of the unit?

#

i would assume the ir laser is seperate

ebon citrus
#

yes and no

#

make a gun that has no model and a unit which has no proxies appart from weapon-proxy

#

then attach a laser to the gun

#

but that's VERY hacky

#

?

unkempt sorrel
#

i haven't read into that actually

#

one sec

#

o\

ebon citrus
#

a far less hacky way

#

keep this in mind:
Visible through fog and past draw distance.

unkempt sorrel
#

lmao that is probably what i would want, but is it possible to make it only seen by nvg's since it looks more like a mapping tool

#

like i wonder if there's a way to do an eventhandler with nvg's and run that script, but idk how much workload that is

ebon citrus
#

yeah

winter rose
#

yup

ebon citrus
#

damn

#

you got me

winter rose
#

ninja'd

ebon citrus
unkempt sorrel
#

y e s, im fully erect, thanks btw man you helping me a lot lately lol

ebon citrus
#

thank Lou

#

men

#

thank the community

#

that's the one

#

without the community, the community wouldn't exist

#

when one person helps you, it's a long chain of helping and advice

#

going way back decades

#

almost

winter rose
#

decades - OFP was released in 2001, the wiki dates back from 2006, and Arma 3 released in 2013 (already) ๐Ÿ™‚

fair drum
ebon citrus
#

almost decades already

#

this is maybe a romantic idea

#

but i like to think that the arma community was born the day ofp was released

#

the community as in the people and the spirit

winter rose
#

it sure did! mission makers existed day 1 thanks to the in-game editor ๐Ÿ™‚

#

the spirit grew from day 1 too

ebon citrus
#

โค๏ธ

#

continuing a tradition spanning many decades would be a dream come true for me

#

a tradition around a game

#

a tradition about helping

winter rose
#

(I remember my old website in html to download .zip ๐Ÿ‘ด)

Helping is generally the best option for a social species, soโ€ฆ yes, let's do that

unkempt sorrel
#
uav1 = nearestObject [player, "USAF_MQ9"];
addMissionEventHandler ["PlayerViewChanged", 
{
    params ["_uav", "_uav1"];
    _list1 = gunner uav1;
    _list1 addAction 
    [
        format["<t color='%1'>Enable IR Marker!</t>","#228B22"], // forest green
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            _pos = getMousePosition;
            if (currentVisionMode player == 1) then
            {
            drawLine3D [uav1, _pos, [0,0.2,0,1]];
            }
        }
    ]
},1]
removeMissionEventHandler ["PlayerViewChanged", 1];
return```
#

i had to use a global one

winter rose
#

no

unkempt sorrel
#

i think but i changed it to uav1

#

o

winter rose
#

also, return is useless and throws an error ^^

unkempt sorrel
#

yeah that was gonna be my question, how do i loop the script back

ebon citrus
#

loop back?

#

dedmen coming at you

#

dont worry

#

lmao is starting out

#

with scripting

#

lets think this through

#

in pseudo code

#

if we are going to use drawLine3D

#

you need to first get the object to add the action to

unkempt sorrel
#

which is the uav right?

ebon citrus
#

the first line is useless as PlayerViewChanged gives us the UAV

unkempt sorrel
#

or am i big wrong

#

ohh tru

ebon citrus
#

but even better than that

#

you can attach the action to all UAV's at init-stage

#

when you are initializing said vehicle

#

this is a little dirty

unkempt sorrel
#

how shall i go about this ๐Ÿ˜„

ebon citrus
#

add an onEachFrame eventHanddler to draw the line if the player is in NVG-mode and toggle(let's call it that) is enabled

#

hmmm, is this multiplayer compatible meant to be?

vague geode
#

@ebon citrus If I have to add the HandleScore event handler to the player how can I get the server to execute the addScore and addScoreSide commands?

ebon citrus
#

can there be multiple UAV's?

#

@vague geode addScore has global effect

#

ah, i see the note

#

remoteExec?

unkempt sorrel
#

well, it would be nice but, and yeah, multiple would be nice, but idk if its worth the workload cause idk how to really go about it,

vague geode
#

remoteExec?
I don't know. I am asking you... XD

ebon citrus
#

it's possible, but youre taking quite the undertaking here

#

considering your knowledge of scripting

#

so i would recommend you do it for one UAV for singleplayer for now

#

to get the hang of it

#

and how scripting works, sounds good?

unkempt sorrel
#

hell yeah man, its all i need it for anyways, ive just been wanting to do a solo mission ๐Ÿ˜„

ebon citrus
#

@vague geode yes, you would remoteExec it

vague geode
#

Ok, thanks.

ebon citrus
#

@unkempt sorrel the start of a scrtipting project is to consider what's the least effort you can expend to do it

#

dont just "i can do MP, it's nice"

#

it's a do i need to, do i not need to

#

anyways

#

give the UAV a variable name in it's init

#

something like "LMAO_UAV_1"

#

that way we can always refer back to the UAV with that name

#

now let's add an action in the uav's gunner

#

this action will just toggle a variable

flat elbow
#

i'm looking for insights, i wish to make an event where in a certain time a missle is shot by a unit on the terrain toward an helicopter but, the missle should not hit the helicopter, ie i want the unit to shoot to miss

ebon citrus
#
LMAO_UAV_TOGGLE=false;
this addAction 
    [
        format["<t color='%1'>Enable IR Marker!</t>","#228B22"], // forest green
        {
          if (LMAO_UAV_TOGGLE) then {
            LMAO_UAV_TOGGLE=false;
          }else{
            LMAO_UAV_TOGGLE=true;
          };
        }
    ]```
#

something like that

#

you could also trigger this on the event of firing the UAV's laser marker, but we'll get to that later, not now

#

actually this is garbage

#

we probably want to use the UAV fired trigger

#

that way we have the lsertarget

#

@unkempt sorrel let's take this to DMs?

vague geode
#

@ebon citrus I have never used remoteExec for a command with two parameters before so I don't know how I would do it...

[_unit, _score] remoteExec ["addScore"];?

ebon citrus
#

change the projectile speed to make it miss@flat elbow

#

exactly like that

#

now just define it to fire only on server side

flat elbow
#

uhh i think even with lower speed the target lock will still keep it to hit

ebon citrus
#

not speed as in speed

#

but nudge the missile to the side

flat elbow
#

wouldn't the homing system just make it steer?

#

i mean i would expect a guided missle to steer even if I move it

ebon citrus
#

setMissileTarget

vague geode
#

exactly like that
@ebon citrus Was that the answer to my question?

ebon citrus
#

or nudge it enough to make it miss

#

@vague geode yes

vague geode
#

Ok, thanks.

ebon citrus
#

but just make it fire server-side

winter rose
#

@flat elbow setMissileTargetPos to aim at a position instead of an object

ebon citrus
#

pos doesnt work on some missiles

#

as they dont have appropriate config

winter rose
ebon citrus
#

as i said

#

AA missiles dont have manual, for example

flat elbow
winter rose
#

what about exploding the missile short before hitting?

ebon citrus
#

that could work

#

but if you want it to miss, i would recommend just steering it with script

winter rose
ebon citrus
#

10m is enough to damage most vehicles

#

air vehicles atleast

flat elbow
#

mmh i'd prefer the missle to just go over it

ebon citrus
#

then just nudge it

#

missiles dont have infinite g-tolerance

#

they cant account for all changes

winter rose
ebon citrus
#

i amde a missile "jamming" script at one point to make missiles steer away when the jammer was online

#

@ebon citrus I have never used remoteExec for a command with two parameters before so I don't know how I would do it...

[_unit, _score] remoteExec ["addScore"];?
@vague geode [_unit, _score] remoteExec ["addScore",2];

winter rose
#

basically:

1/ if you want the missile to go in a straight line to a missed point, setMissileTarget/setMissileTargetPos (depending on the weapon)
2/ if you don't mind the missile changing its trajectory before touching, setVelocity/setVelocityModelSpace
3/ if you don't want any of these, just triggerAmmo before hit (and beware of network desync)

unkempt sorrel
#

@ebon citrus sorry i was taking a little break, i can add u and we can go into dms if u want ๐Ÿ˜„

flat elbow
#

can i like, get the helicopter position, add like 5 meters, then force the unit to aim there and then forceWeaponFire?

ebon citrus
#

that would work @unkempt sorrel

#

yes

#

getPos

#

but you would want a dummy-vehicle for AA missile, for example

#

we need to know what kind of missile this is

winter rose
#
private _posAboveHeli = getPosATL _helicopter vectorAdd [0,0,5];
flat elbow
#

yea for the getting i know that i'm unsure how to force the launcher orientation tho

winter rose
#

(even though, 5m may not be enough)

ebon citrus
#

5m is within detonation cone for AA missiles

flat elbow
#

the aimAt, fireAtTarget et simila requires an object not a pos

ebon citrus
#

actually almost optimal

#

HOLY MOLY

#

is this an AA missile or ATGM?

#

does it have manual target or lock-on?

winter rose
#

Speak!

flat elbow
#

it is a lock-on

ebon citrus
#

ok, then you need setMissileTarget

#

OR!

#

you can do like the chads do

#

and spawn your own missile projectile

#

and guide it to target with script

#

and then make it miss

flat elbow
#

you overestimate my knowledge of trigonometry

ebon citrus
#

but far easier would be to rely on the AI

#

anyways, im going to go and roast LMAO

#

Lou, have at it if you want to

#

i'll be back in a bit

flat elbow
#

basically i want the players to $ their pants as they hear they are getting locked

#

the pilot AI will then perform evasive manouvre but i need to be sure the missle miss

winter rose
#

hah, if you want them to hear getting locked, the AI has to lock them unless you play a soundfile

ebon citrus
#

and lock them with a radar-weapon at that

flat elbow
#

yes my idea was to make the AI lock them and as soon as the AI is ready to fire make it move the aim and shoot

winter rose
#

you should count on the AI to shoot, then, but add a "Fired" EH to grab the missile and set its target off

#

maybe like creating an invisible object above the helicopter and making the missile to target it

flat elbow
#

mmh yea i can do that, maybe a pencil

#

so it will also explode at the heigh i want

#

i'm just curious now if I can manually control the aiming of a unit

#

like, tell the AI where to point the gun

winter rose
#

maybe
but again, you won't have the locking

flat elbow
#

yea that's just out of curiosity now

ebon citrus
#

i'm still on the side of nudging the missile

winter rose
#

from memory, there were a lot of issues in forcing the AI to shoot at something

fire, doFire, fireAtTarget, forceWeaponFire, I guess all these commands tried to circumvent various issues differently

flat elbow
ebon citrus
#

supressing fire

#

my best luck with getting AI to shoot is supressing fire

#

but im not sure if that works with missiles

winter rose
#

I would argue that a missile suppressing fire is the most effective kind

flat elbow
#

if you are a soviet AA missle suppressing fire is like the standard

winter rose
#

reminds me of this video of a Russian soldier with broken arm calling Stalin organs fire over the radio ๐Ÿ˜„

astral dawn
#

@ebon citrus how did you test the attached trigger rotation yesterday? In my tests it seems that the trigger's area is not rotated with the parent object.

ebon citrus
#

jsut saw that the other day

#

not the area but the trigger's rotation

#

i guess i misunderstood your question

astral dawn
#

So what exactly did you find then?

ebon citrus
#

the trigger's direction changes as the car's direction changes

astral dawn
#

when attached?

ebon citrus
#

yep

astral dawn
#

in my case it seems to always look forward I mean North ๐Ÿค”

ebon citrus
#

forward?

#

it's possible the direction is relative to the parent

astral dawn
#

oh wait a minute it might be facing north because my velocity is zero

#

sorry

ebon citrus
#

๐Ÿคทโ€โ™‚๏ธ

winter rose
#

velocity doesn't matter; direction does

ebon citrus
#

internal scripting stuff maybe

#

resets trigger size if vel is 0

#

so that the trigger wont fire

#

he has an adaptive system based on speed

#

that scales the trigger

astral dawn
#

I just tested with a long narrow trigger area and yes, it seems like this area doesn't rotate with the car the trigger is attached to

#

it moves with it, but does not rotate

vague geode
#

Does anyone happen to have a list of all possible type names of vehicles for the isKindOf command?

warm hedge
#

Every CfgVehicles entries could be

winter rose
#

yeah, I am not listing that on the isKindOf page ๐Ÿ˜

agile anchor
#

Hi I'm trying to hide an object to all units apart from 1 and have tried objectname hideObjectGlobal true; and objectname hideObject false; but this doesn't work any ideas please

winter rose
#

where did you run that?

agile anchor
#

'global was in the mission init and normal in a trigger

vague geode
#

@warm hedge Ok.

winter rose
#

@agile anchor
hideObjectGlobal in init.sqf?
and the trigger, when does it fire? what are its settings

agile anchor
#

global in mission init from within editor and just for testing purposes i have the trigger player activated

winter rose
#

from within editor
? wait, wut?

agile anchor
#

attributes/general/init (I believe it is the same as having an init.sqf) but I could be very wrong and would like to know lol

winter rose
#

I don't know a lot about advanced Eden functionalities, which is why I ask ๐Ÿ˜

agile anchor
#

Oh ok i was beginning to worry lol

winter rose
#

well, it hides the object, right?

agile anchor
#

could there be another way of achieving what I'm after

#

yes it hides it

#

when ever i unhide it all see it

#

atm

winter rose
#

the trigger would need to have player in thislist as condition

#

otherwise, any unit would trigger all local triggers

agile anchor
#

oh ok makes sense i'll give that a try thankyou

#

@winter rose didn't work unfortunately

winter rose
#

wut?

agile anchor
#

so just to make sure i'm getting it right... in mission init objectname hideObjectGlobal true; activation trigger... Activation: 'any player' & 'present' Condition: player in thisList On Act: objectname hideObject false;

winter rose
#

yep

agile anchor
#

doesn't work ๐Ÿ˜•

winter rose
#

Make it work! ๐Ÿ”จ

#

do you try it in MP with someone?

agile anchor
#

I'm trying and failing hence why I'm here

#

no using sp atm

winter rose
#

โ€ฆ

#

ooooooh you want only -you- can see it, not AI?

agile anchor
#

yes or a specific Ai unit and no other ai

winter rose
#

that's different then

you cannot "hide" something from AI, except one-timed with forgetTarget
what you could do however, is setCaptive

ebon citrus
#

Fired and FiredMan EH's dont work with laser designator?

agile anchor
#

I've tried setCaptive and same thing happens (as soon as it transfers over they all shoot)

winter rose
#

@agile anchor yes, setCaptive must be reapplied on locality change

agile anchor
#

would i have to assign forgetTarget to all other ai (other than the 1 i want to use)?

winter rose
#

now, give us context so we can be more precise

brave jungle
#

Context?

#

Whats that

agile anchor
#

lol

winter rose
#

what is it you really desire want to do?

brave jungle
#

you must know my question without anything else!

#

I'll stop being unhelpful ;)

#

@ebon citrus I don't think so

agile anchor
#

I'm trying to get a specific ai unit to engage a specific target but no other ai near by join the party lol

brave jungle
ebon citrus
#

not an eventhandler

#

and i am aware

winter rose
#

@agile anchor ```sqf
{ _x setBehaviour "CARELESS"; } forEach _allOtherUnits;

brave jungle
#

Yes but that is the closest you'll get

#

What you trying to do exactly?

ebon citrus
#

detect the firing of a laser designator on a vehicle without making a loop

brave jungle
#

well if its not an EH then you have to

ebon citrus
#

yes, it would seem so

#

i was just coming here to confirm my assumnptions

#

think so's dont help

#

my hypothesis is that fired and firedMan dont work with lasers

brave jungle
#

Best way is to test, but afaik it doesn't

winter rose
#

is that a hypothesis, or did you test it?

ebon citrus
#

i tested it

#

after my hypothesis

#

and according to my tests

#

i have made the conclusion that it doesnt

brave jungle
#

I'll need a 2000 word report by monday!

#

Nah but seriously, as I thought ๐Ÿ˜‰

#

Loop it'll have to be!

winter rose
#

isLaserOn can help

#

yes, every time you turn on/off, a laser target object is created/deleted

ebon citrus
#

hmmm

winter rose
#

hmmm.

#

(๐Ÿง…)

ebon citrus
#

layers

winter rose
#

mostly a Dark Souls reference ๐Ÿ˜„

ebon citrus
#

is there a way to set an addAction's title to a script?

#

that would be re-evaluated the same way the condition is

#

or will i have to see if i can slip an setUserActionText in the condition field

#

this is gonna go so wrong

#

but im also intrigued

vague geode
#

Just to make sure, with player addScore -1; I lower the score by one, right?

winter rose
#

yup

#

@ebon citrus โ€ฆwhat?

ebon citrus
#

๐Ÿ˜…

#

it didnt work

#

i need to change the action name

#

since the players can change their backpacks

#

so the action name needs to be the backpack name

#

but i guess i cant do it in any "smart" way

#

uhhh...

#

i would hate to make a loop

winter rose
ebon citrus
#

yep, i know about that

#

but i cant add a script to it, can i?

#

a script that would evaluate every time similar to the condition field

#

wait, never mind

#

it works

#

in the condition field

#
"
    private _className = backpack _originalTarget;
    if (_className != '') then {
        private _backpackName = getText(configFile >> (_classname call TOM_fnc_getConfig) >> _className >> 'displayName');
        _originalTarget setUserActionText [1, format ['Open %1',_backpackName]];
    };
    ((backpack _originalTarget) !='') && (!alive _originalTarget);
    "```
#

this has got to be the stupidest condition-field

#

ok, i've got a problem

#

the script is initialized for something IN THE MAIN MENU

#

is there a way to detect if the game is in a mission?

winter rose
#

maybe you can figure something through findDisplay? IDK about UI

ebon citrus
#

i tried 46

#

but 46 is loaded when the game loads into the main menu

#

let's see !isNull player

#

that might work

winter rose
#

yep (and the script is irrelevant for dedi servers)

ebon citrus
#

yep

jade abyss
#

MainMenu = uiNamespace getVariable ['RscDisplayMain', displayNull];

ebon citrus
#

im trying to run a script as soon as the player loads into a mission

winter rose
#

CfgFunctions?

jade abyss
#

nah, mainMenu is something different

ebon citrus
#

cfgVehicles INIT eventhandler

#

yeah, no

#

shame

#

i wanted to add an EH that adds an action to all units

#

the script is running but it's not adding the eh

#

is there a way to get the unit's object with the unit-name?

#

never mind, it IS the object

#

hmmm

#

idk

#

the script executes but the action is not visible

#

it shows up in "actionIDs"

#

but the action itself is not visible

#

maybe it's inited too early

#

nope

#

it's not about when it's executed

#

let's see if it works if i execute it through cfgFunctions

#

instead of preprocessfile

ebon citrus
#

that's weird

winter rose
#

Vector question, does multiplying/diving a vector is the same as multiply/divide all of its values?

e.g
vector vectorMultiply 3
is equal to
[vector#0 * 3, vector#1 * 3, vector#2 * 3]
?

#

it seems so.

#

is there a rounding issue not displaying in the str array, ooor am I blind/crazy missing something?

private _v = [102, 687, 1543];
private _f = 53;
private _r1 = _v vectorMultiply 1/_f;
private _r2 =  [_v, _f] call BIS_fnc_vectorDivide;
[_r1, _r2, _r1 isEqualTo _r2]
```for reference
austere granite
#

i dont know what sorta floats arma uses

#

but 102 divided by 53 is quiteeeeeeee a lot of decimals

winter rose
#

that's my guess, buuut

#

nah it's 1543/53

private _v = [102, 687, 1543];
private _f = 53;
private _r1 = _v vectorMultiply 1/_f;
private _r2 =  [_v, _f] call BIS_fnc_vectorDivide;
[_r1, _r2, _r1 isEqualTo _r2, [_r1#0 isEqualTo _r2#0, _r1#1 isEqualTo _r2#1, _r1#2 isEqualTo _r2#2]] // last is [true, true, false]
restive leaf
#

A very simple formula is used to calculate floats in Real_Virtuality. It is (+/-)1 integer, decimal point, 5 integers as the fractional component, e,(+/-)3 integers representing the exponent component. If the beginning integer is negative, the negative symbol will be added, but if it is positive, it will be dropped. In the exponent component, positive and negative is always shown. If the resulting shortened value would go further than the hundred-thousandth's decimal place, it will be rounded at the hundred-thousandth's decimal place, this is why numbers of larger magnitude lose precision. Numbers start getting shortened once they reach the millions, thus, 999999 is the largest unshortened number than can be shown. 1000000 will be shown as 1e+006.

winter rose
#

sooo there is a difference between x/y and x * 1/y?

#

no :D

private _a = 1543;
private _b = 53;
(_a/_b) isEqualTo (_a * 1/_b) // true
exotic flax
ebon citrus
#

arma doesnt fallow basic mathemathical order

#

so it does 1/_B

#

arma calculated _a*(1/b)

#

not (_a*1)/_b

#

right?

#

i've seen this behaviour in some notorious languages

exotic flax
#

Actually Arma is correct, since it first did math and then calling a command

#

And yes, a lot of languages just read RTL instead of per line and parse it correctly

queen cargo
#

Uhm... How did you came to that conclusion @ebon citrus?

ebon citrus
#

i didnt

still forum
#

"a very simple formula is used" wat....
It's just standard c/c++ float... Nothing special

#

Actually Arma is correct, since it first did math and then calling a command
Math is also a command

winter rose
#

gib answers ๐Ÿ˜„

restive leaf
#

LOL... That is straight from the wiki Dedmen

still forum
#

Someone please burn it down

#

And just link to floating point wikipedia

queen cargo
#

Tried ti

#

But sqf-vm is down right now

still forum
#

Who wrote that abomination of text?

queen cargo
#

So no tree__

winter rose
#

/shrug

Who wrote that abomination of text?

#

๐Ÿ˜ข

#

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

restive leaf
#

DreadedEntity did... It was much shorter originally (in the original version by the same author actually) so I assume someone asked for it to be expanded...

winter rose
#

also, maybe there were some evolutions in the engine? (don't burn me, just asking)

still forum
#

Please just wikipedia IEEE float

winter rose
#

so all in all, where does the "issue" arise?

restive leaf
#

NOTE: Despite rounding the number and displaying it as a shortened literal, the engine seems to keep the actual value stored in RAM. ๐Ÿคฃ Now that is a classic line

still forum
#

Yes it is the same. And precision

winter rose
#

float/double? or nothing alike

still forum
#

float prec

#

Could be that isEqual.... No can't..
Just some weird precision issue with specifically your numbers

barren spire
#

is there anything I can check for when a variable I saved with saveVar for my campaign is nil in the next mission? it does appear in the campaign.sqc with the right value, so it should be there, but it's not :/

still forum
#

What are you storing in the variable?

barren spire
#

a string

still forum
#

What is saveVar?

#

Never used that ๐Ÿค”

barren spire
#

"save a variable to campaign namespace"

still forum
#

Ah. Our like 3rd implementation of methods to save variables

barren spire
#

I just need a variable that will still be there in the next mission. if there's another way, let me know ๐Ÿ˜„

#

for some reason, it is nil, even though it did save correctly.

still forum
#

profileNamespace, but that would also stay there outside of campaign

barren spire
#

huh, actually, the variable is there.
but isNil returns true ๐Ÿค”

winter rose
#

isNil var?

#

it's isNil "var"

#

beware the paddlin'โ€ฆ

barren spire
#

yeah, I just noticed... thanks, I'll adjust it

ebon citrus
#

hmm

#

my addaction is not showing up when i do it through the config.cpp

#

the action is there...

#

in actionIDs

#

but the action doesnt do anything

#

if i add the SAME action through in-game (copy-paste) debug monitor, it works

#

never mind, it is

#

im just ACTUALLY factually artarded myself

winter rose
#

bewaaare of the profanities ๐Ÿ‘€

#

what was the issue?

ebon citrus
#

wrong action ID

#

because the one i added in the debug had the correct action ID since the previous one was already added below it

#

so it worked

#

i used action ID 1

winter rose
#

๐Ÿ”จ

ebon citrus
#

so the first aciton to be added was 0

winter rose
#

consider also mods and other interactions - you should get the action ID by reference, not "guessing" it

ebon citrus
#

yep, now it works

#

i know...

#

i swear there was a method to get all actions of an object

#

but now i can only find the IDs

barren spire
#

yay, it works ๐Ÿ˜„
now I can have the strategic map from Arma 1

winter rose
#

oooh with the little screen top-right and all?

ebon citrus
#

pictures

barren spire
#

I re-made it with the Arma 3 strategic map right now, because I have no clue about Rsc, but yeah, with some effort I could make the original A1 screen work ๐Ÿ˜„
(it almost worked unchanged, but not quite, a bit glitchy)

winter rose
#

i swear there was a method to get all actions of an object
I believe all there was around was actionIDs @ebon citrus

barren spire
ebon citrus
#

i swear to god, lou

#

i have made this before

winter rose
#

SWEAR TO MEEE ๐Ÿฆ‡

#

but what do you mean by "get actions"?
obtain addAction parameters?

ebon citrus
#

yep

#

im going to do my own fnc for this

winter rose
#

with card games, yeah ๐Ÿ˜‹

barren spire
winter rose
#

yeah that's the "video" I was talking about
this was a nice idea at the time!

ebon citrus
#

Done

#

my TOM_fnc_getAction with card games and street performers is done

winter rose
#

you need an addAction & removeAction too ๐Ÿ˜›

ebon citrus
#

XD

#

sure

#

addaction is there

#

and removeaction exists too

#

i wrote a quick function to return action ID of a unit with title or argument