#arma3_scripting

1 messages ยท Page 386 of 1

lone glade
#

no, "'bla'"

#

gotta mix it up

still forum
#

@tough abyss That's syntax error

#

you are missing quotes

worldly locust
#

ok, so i didn't solve it.

#

frustrating

still forum
#

Can you please post the full error from your RPT?

little eagle
#

You can't use str _side, Reddog.

worldly locust
#
}
_tree tvAdd [ [], format ["%1", _x]];
_t>
10:04:41   Error position: <_tree tvAdd [ [], format ["%1", _x]];
_t>
10:04:41   Error Missing ;
10:04:41 File C:\Users\Gavin\Documents\Arma 3 - Other Profiles\LCpl%2e%20Reddog\missions\Snippets & How To's\ALiVE_Testing_1.Malden\rdg_ALiVEConsole\rdg_fnc_Console.sqf, line 42
10:04:41 Error in expression <_Profiles call ALiVE_fnc_InspectHash;
}
_tree tvAdd [ [], format ["%1", _x]];
_t>
10:04:41   Error position: <_tree tvAdd [ [], format ["%1", _x]];
_t>
10:04:41   Error Missing ;
10:04:41 File C:\Users\Gavin\Documents\Arma 3 - Other Profiles\LCpl%2e%20Reddog\missions\Snippets & How To's\ALiVE_Testing_1.Malden\rdg_ALiVEConsole\rdg_fnc_Console.sqf, line 42```
still forum
#

Well... You are missing a ;

#
if (_debug) then {
    _Profiles call ALiVE_fnc_InspectHash;
}   <---- Right there
_tree tvAdd [ [], format ["%1", _x]];
#

And formatting a string like that still doesn't make sense.

little eagle
#

This is what happens when you put the opening { in newlines. See the else line. Bad habit.

worldly locust
#

ffs.

#

i couldn't give a shit about formatting right now.

#

and i couldn't give a shit about whether it makes sense or not.

#

i do give a shit about it working.

little eagle
#

With proper formatting, this could've been avoided. Not giving a shit was your initial problem.

worldly locust
#

once it's working i'll refactor etc.

little eagle
#

Sounds like twice the work.

worldly locust
#

thanks ever so much for your help and advice

still forum
#

In the end you could have solved this by just reading the error message Arma gave you. It told you about a missing ; and even showed you exactly where.

worldly locust
#

nope. it didn't

#

different line

still forum
#

Huh? no

#
10:04:41 Error in expression <_Profiles call ALiVE_fnc_InspectHash;
}
_tree tvAdd [ [], format ["%1", _x]];
_t>
10:04:41   Error position: <_tree tvAdd [ [], format ["%1", _x]];
worldly locust
#

k thx bye

little eagle
#

Error position: <_tree tvAdd [ [], format ["%1", _x]];

#

The hostility is in your head, Quiksilver.

still forum
#

The error is directly before the _tree and the next thing before the _tree is the closing bracket where you are missing the ;

#

You could also have written

if (_debug) then {
    _Profiles call ALiVE_fnc_InspectHash;
}
;_tree tvAdd [ [], format ["%1", _x]];

So what now? That's exactly the line and exactly the position the error message told you.

little eagle
#

Looks like a commented line in a .INI file.

#

Still favoring to replace them all with commas.

sly mortar
#

Might be worth mentioning that using a code editor with linter capabilities helps catch some of these sorts of error. I know there is an SQF linter for VS Code, and there was squint. Not seen one for Atom.

compact maple
#

Atom is life lol

lone glade
#

nope, it's terrible

#

like 99% of electron apps, only VS code runs fine

little eagle
#

Atom is slow. Why would you ever use a slow text editor?

lone glade
#

it also crashes on files longer than 3 000 lines

compact maple
#

YOU think this is terrible it doesnt make atom terrible

lone glade
#

no, it's objectively terrible

compact maple
#

It doesnt you should get a new pc lol

#

no offense but i can edit sqm mission with a tons of lines without getting slowed or crash

#

What is VS ?

still forum
#

I like atom.. But sometimes I accidentally click on a texture or model and have to wait a couple seconds till it stops freezing

#

I have the new way to get the position of an object! It will revolutionize everything

_position = parseSimpleArray format ["%1", getPos _unit];
little eagle
#

Will it fail for scientific notation?

still forum
#

I can only give you the same answer as for everything in SQF: maybe.

compact maple
#

This function can be used for what exactly ?

still forum
#

You can use it to get the position of the object inside the _unit variable

#

It is a little less precise as other ways. But less precision makes everything faster as we know.

compact maple
#

Oh okay, but there shouldnt be space in it right ? Just read the wiki

still forum
#

Which space? There are 6

compact maple
#

no spaces are permitted between array elements: [1,2,3] - correct, [1, 2, 3] - incorrect!
only double quotes " supported for Strings: ["hello"] - correct, ['hello'] - incorrect!
use " to escape ", for example ["hello"] converted to string should look like this: "[""hello""]"
no spaces should exist before or after array brackets: "[1,2,3]" - correct, "[1,2,3] " - incorrect!

#

My bad lol

tough abyss
#

Is there a way to unnest an array?

#

As in - turn [["first","hello1"],["second","hello2"],["third","hello3"]] into ["first","hello1","second","hello2","third","hello3"].

lone glade
#

yes, by using set

#

actually correction, you'd need to make a new array for that

south pasture
#

Hi scripters,
is it possible to acquire the script handle (for later terminate) from the data received by diag_activeSQFScripts?

lone glade
#

nope

tough abyss
#

@lone glade - could you elaborate?

lone glade
#

the command simply doesn't provide the handle

#

only the name assigned via scriptname, file path, if it's running and the line it's at

tough abyss
#

I was addressing my question, the one before IrLED.

lone glade
#

aaah

#

you pretty much append / use + to merge all three arrays into one

#

pretty much:

_myNewArray =  [];
{_myNewArray append _x} foreach _myOldArray;
tough abyss
#

Thanks @lone glade.

still forum
#

There are other ways to kill scheduled scripts though. I could look into it. PM me @south pasture I'll be afk for an hour now but I might have time later.
I guess you only need that for testing on your server and not for a real usage like a script that you want to redistribute with missions.

queen cargo
#

@south pasture spawn etc return the script handle
Either use a passed object plus set variable to get it inside the scheduled script or a global variable

south pasture
#

@queen cargo thing is that the "legacy" code has loads of anonymous spawns... need to start managing them

lone glade
#

rewrite it entirely

queen cargo
#

@tough abyss only one level or multiple? And why you need to unnest?

still forum
#

Come join me in my candy Van @south pasture I have what you need

lone glade
#

say no to the man with the furry avatar

#

trust the snail

queen cargo
#

@south pasture rewriting it then is the only option unless selling your soul to @still forum is an option

south pasture
#

)))

little eagle
#

bad*

winter dune
#

does anyone know how to make invisible backpacks? Or atleast give me some hints. I tried to make an invisible texture, but when I drop the bag on the ground, it still invisible, cant add any textures on it. What I want to have is that on the player, the backpack is invisible, when dropped, the bp becomes visible again, feel free to give any kind of tips

little eagle
#

Should it always hide that specific backpack or should it hide all backpacks on this specific unit?

still forum
#

You can add textures to backpacks on ground. But you can't just use cursorTarget to get the backpack object

little eagle
#

I forgot what the invisible texture is. My code makes it black. : /

#
// initPlayerLocal.sqf
private _fnc_initHideBackpack = {
    params ["_unit"];

    private _fnc_hideBackpack = {
        params ["_unit"];

        private _backpack = backpackContainer _unit;
        private _textures = getObjectTextures _backpack;

        if (_textures param [0, "#(rgb,8,8,3)color(0,0,0,0)"] != "#(rgb,8,8,3)color(0,0,0,0)") then {
            _backpack setVariable ["commy_textures", _textures, true];

            {
                _backpack setObjectTextureGlobal [_forEachIndex, "#(rgb,8,8,3)color(0,0,0,0)"];
            } forEach _textures;
        };
    };

    _unit call _fnc_hideBackpack;
    _unit addEventHandler ["Take", _fnc_hideBackpack];

    _unit addEventHandler ["Put", {
        params ["", "_container"];

        {
            private _backpack = _x;
            private _textures = _backpack getVariable "commy_textures";

            if (!isNil "_textures") then {
                _backpack setVariable ["commy_textures", nil, true];

                {
                    _backpack setObjectTextureGlobal [_forEachIndex, _x];
                } forEach _textures;
            };
        } forEach everyBackpack _container;
    }];
};

player call _fnc_initHideBackpack;

Here's the code for black. Replace with the transparent texture in the 3 places.

winter dune
#

thanks man

little eagle
#

@tough abyss
memoryPointsGetInDriver
memoryPointsGetInDriverDir
memoryPointsGetInGunner
memoryPointsGetInGunnerDir

#

memoryPointsGetInCargo
memoryPointsGetInCargoDir
memoryPointsGetInCoDriver
memoryPointsGetInCoDriverDir

agile pumice
#

when creating a lightsource, what value do you change to adjust the ambient light brightness? (effect on the environment)

tough abyss
#

@X39#2180 - already did what I had to with the arrays, thanks anyway ๐Ÿ˜›

little eagle
agile pumice
#

the wiki says that setLightBrightness and setLightIntensity do the same thing, so I shouldn't use both?

plucky willow
#

I am trying to use playSound3D, does anyone know where i can find a list of sound files?

still forum
#

Ingame config viewer. CfgSounds

plucky willow
#

thanks

#

the path listed in the cfg isnt similar to the wiki examples, is that alright?

little eagle
#

What if they're both right?

#

Isn't this what you want?

plucky willow
#

wow yes

#

tyvm

little eagle
#

Delete the leading \ before A3 and add .wss if the filepath has no extension. That is what playSound3D needs, because reasons.

plucky willow
#

thanks, it works great

compact maple
agile pumice
#
    {
        case (_lightNum in [1,2,3,4]): {
            [0, 0, 1]    
        };
        case (_lightNum in [5,6,7,8]): {
            [1, 0, 0]    
        };
    };```

```_LP setLightAmbient _color;
        _LP setLightColor _color;```

```16:31:29 Error in expression <_pos ];
_x setLightBrightness 0.005;
_x setLightAmbient _color;
_x setLightColor>
16:31:29   Error position: <setLightAmbient _color;
_x setLightColor>
16:31:29   Error setlightambient: Type Bool, expected Array```
#

type bool?

indigo snow
#

If the condition is not matched by any case and there is no default, it returns true.

little eagle
#

switch repo...

#

What cptnnick wrote.

agile pumice
#

but it can only possible be 1,2,3,4,5,6,7 or 8

little eagle
#

It obviously isn't.

austere granite
#

also if therรฉs only 2 possible cases, why not just use if then else?

#

or even

agile pumice
austere granite
#
case 1;
case 2;
case 3;
case 4: { [0, 0, 1] };
little eagle
#

[_vehicle,7] call call _createLight;

#

So _lightNum is nil

#

call _createLight; reports nil

indigo snow
#

im intrigued that doesnt throw more errors

little eagle
#

[_vehicle,7] call nil
fails silently

#

welcome to SQF

austere granite
#

๐Ÿ‘Œ๐Ÿป

little eagle
#

Another mystery solved. That makes #350.

agile pumice
#

atleast now I know switch returns a bool in that circumstance

little eagle
#

eagle eyes 1 , tools 0

agile pumice
#

I initially had 3 cases in the switch block

#

thats why I wasn't using a simple if else

#

but I changed it now

#

can I use call compile format to find a local variable?

#
    _beaconRpos = _vehicle selectionPosition ["mirrorlb_beacon_r", "Memory"];
    _pos = call compile format ["_%1pos",_light]```
for example, if _light is "beaconL"
little eagle
#

Sounds unnecessarily complicated.

austere granite
#

@agile pumice what are you trying to do with that? Can't think of a reason why you would want that

#

you could probably just use an array with the variables and look it up by an index or whatever

#

or use getVariable with a formatted variable name

agile pumice
#

I just went with a switch block lol

#

just trying to reduce the amount of lines of code

agile pumice
#

why is lightattachto so jittery on moving vehicles ๐Ÿ˜ฆ

jade abyss
#

Never was

#

I guess it's attached to the PhysX Geo, wich is also not moving smoothly with the model itself (at least, it reacts/looks the same way)

austere granite
#

this is correct

agile pumice
#

i dont wanna have to write another oneachframe handler XD

jade abyss
#

Nope, they are all the same

#

If you move it, it starts lagging

#

The only "workaround" would be creating (3D-Model) with a Lightsource and attach it via attachTo.

still forum
#

Yup. Make a onEachFrame handler in Intercept.
Not really worth getting Intercept for that if not already using it. But everyone should be using Intercept anyway Kappa

queen cargo
#

Get an empty model with a light source and create that

blazing quiver
#

Hey, question

still forum
#

Answer!

blazing quiver
#

Is it possible to "hide" a backpack on a character via script?

still forum
#

I think you can make it invisible

#

somebody talked about that just yesterday

blazing quiver
#

Like, keep the attributes of it but just have the model invisible on the character

#

Ah

still forum
#

I guess you can basically set a transparent texture on it

blazing quiver
#

ok

#

did some more research on the texture stuff, found this

#

if (side player == opfor) then { unitBackpack player setObjectTextureGlobal [0,""]} ;

#

it works, but I'm having issues with getting it to apply to a non-opfor character

#

even changing it to if (side player == independent) then { unitBackpack player setObjectTextureGlobal [0,""]} ; does not work

#

any ideas why it works for opfor but not others?

#

I think I just don't know the proper name for independent or something

#

I tried it for blufor and it was fine

violet gull
#

Does this work?

if (side player in [WEST,independent,east]) then{
unitBackpack player setObjectTextureGlobal [0,""];};

#

Works for me in editor

#

As an independent soldier

#

Does it give you an error?

lone glade
#

that's the right syntax for independent, so you must've made a typo in game

#

also yes, you can do <SIDE> in <ARRAY of SIDES>

blazing quiver
#

actually, I'm pretty sure it's just an issue with modded unit I'm trying to apply it to

lone glade
#

just keep in mind sides are their own types and not strings

blazing quiver
#

I tried it with a vanilla indy unit and it worked there

violet gull
#

It's possible the modded backpacks don't have a hiddenSelection ๐Ÿ˜ฎ

blazing quiver
#

I suspect that's the issue

violet gull
#

Test it with vanilla units of that side and see if it works for their backpacks. If it does, but not with the modded ones, there ya go.

blazing quiver
#

yep, that's the case

violet gull
#

D:

blazing quiver
#

so, another question then. The script also does not work on packs added via arsenal

#

like, if I copy a loadout from editor and add it in into the init it won't work, it needs to be spawned on the unit

violet gull
#

So what you're saying is you get a backpack and it's visible, so you want to auto-hide it?

#

From the arsenal

lone glade
#

well, first of all don't do that because that's stupid (copying the BIS old as fuck loadout format in init)

#

inits are called on the player local machine when he joins the server

blazing quiver
#

so phronk, basically what I want to do is hide a certain backpack. It doesn't spawn by default on any units though so I need to add it via init

lone glade
#

I wonder if hideObjectGlobal works here

#

if it doesn't work directly on the backpack you can try to reference the weapon holder directly

violet gull
#

if(backpack player=="myBackbackClassname")then{ code };

#

If you want to make it so that if the player drops/picks up the backpack, you'll need to add a Take eventHandler which calls that code to hide it

#

if you want it to take more than one backpack classname into consideration, you can try it like this: if(backpack player in ["backpackClassname1","backpackClassname2","backpackClassname3"])then{ code };

#

Although it might be better to define that array of backpacks prior to the if()then{} check for better efficiency

#

_backpacksToHide=["backpackClassname1","backpackClassname2","backpackClassname3"];

blazing quiver
#

mmm, I think I found the issue

#

It's again exclusive to the modded backpacks I was trying to use

violet gull
#

๐Ÿ˜ฑ

blazing quiver
#

I should have checked that first lol

violet gull
#

What mod is it?

blazing quiver
#

The Star Wars opposition mod

#

Basically, the mod has "jetpack" backpacks which allow charcaters to launch up in the air around 10 meters or so

young current
#

. . .

blazing quiver
#

I'm trying to make the jetpack invisible so the effect could be used as a "force jump" for characters like Vader or a jedi

violet gull
#

Oh okay, yeah I honestly never checked out the Star Wars mods. I'm surprised they didn't add hiddenSelections, seemed like a solid team, if I'm thinking of the right project.

blazing quiver
#

oh well, was worth a shot

violet gull
#

Better luck next time. ๐Ÿ˜ƒ

blazing quiver
#

I take it with no hiddenselctions I can't do anything on my end to fix that?

violet gull
#

Not that I know of, personally.

lone glade
#

see my previous comment above, also they have to use a func or onKeyDown event for what you describe

violet gull
#

If you can find out what the function is that the backpack calls, maybe try to give the unit an addAction or something to call it

#

The one to make the player jump up

#

Or write your own lol

lone glade
#

yeah, it's not that hard

blazing quiver
#

Unfortunately I'm pretty ignorant when it comes to scripting, but I'll send the suggestions to a buddy of mine who might be able to use that advice better than myself

#

Thanks for the help guys, I appreciate it

violet gull
#

For starters to get you in the (possibly) right direction, look into the setVelocity command on the biwiki

#

That and maybe setVectorDirAndUp

#

IDK

blazing quiver
#

thanks

violet gull
#

No problem. Good luck.

candid jay
#

hat would be the easiest way to create a cable between TWO POINTS in arma

#

that though is affected by physx

#

I just want to state got from [x1,y1,z1] to [x2,y2,z2]

compact maple
#

Is it actually a real rope like the helicopter rope ?

lone glade
#

there's no other "cable" or "rope" stuff, all ropes are the same thing

#

not only that but those can be shot at and cut

candid jay
#

ok but I don't seem to be able to create it

#

does it need to be a vehicle?

#

or can it be between two houses for instance

#

@compact maple I'd like to draw a line between two points. It does not need to behave like a physx rope.

#

I need the closes thing to an understroyable cable between objects

compact maple
#

Lol so CAN you create it between 2 players head ?

candid jay
#

no

#

I have a cableway

#

and I need to connect all pylons

#

I can do it with p3d but it's practically impossible to have those lines connected and rotated correctly

#

so I am trying to dynamically generate a cable

compact maple
#

I was simply asking

candid jay
#

?

#

sure ๐Ÿ˜ƒ

#

and that's why i explained ๐Ÿ˜ƒ

compact maple
#

Oh okay i tought it was a rope,literally, like if the rope lenght 5 meters and you attache theses points to the head of 2 p'aysrs they cant run away more than 5m

candid jay
#

lol

#

no

#

it's practically impossible to have cable lines of > 100m length and line up perfectly

#

first, you need 3 objects of 50m because at 100m you are reaching the size limitations

#

plus, putting them down the rotation angles are obviously very hard to get, if not impossible

#

so I was hoping to make them dynamically

#

but I seem to be unable to create a rope

sour saffron
#

Bis did it with pylons and cables

candid jay
#

?

#

did what

#

and what do you mean with "cables"

#

objects?

sour saffron
#

cables and pylons

candid jay
#

OBJECTS?

sour saffron
#

yeah

#

chernarus and the models are in the samples

candid jay
#

yeah I did my own models

#

the hard part is how to draw it though.

#

it's not the model, is how you position the cables

#

and have the correct length

sour saffron
#

yeah its hard , probably 6- 12 months i would imagine for proper job and good alingment

candid jay
#

nah

#

i think the safest bet is to compute the positions

sour saffron
#

modesl > position > scripts > mp locality etc 6 -12 months for a proper job or 1 month for a life server accepted quality

#

and in green

coarse olive
#

I need a bit of advice here, weโ€™re working a mod using advanced sling loading, once the vehicle deletes, how could we move the passenger into the helicopter?

sour saffron
#

land and ask him to climb aboard

coarse olive
#

Its for MEDEVACs so the goal is to lift the person, once it gets close to the helicopter, he is moved inside, the board is deleted and a new one is spawned in the helicopter

#

How would we go about spawning the backpack into the helicopter upon deletion?

sour saffron
#

i guess you give it a varname and move it before deletion

#

have a look that site i linked scripting commands v good

coarse olive
#

Ok.

#

Once we get this complete the mod is ready for release.

sour saffron
#

sounds good > there is a release channel further down the left

compact maple
#

6 months for placing a cable ??

coarse olive
#

Well, just waiting on the models and working script!

#

Thanks for the help

sour saffron
#

@compact maple you reffering to my calculation ?

lone glade
#

make it look like the task markers

#

because people expect those to be clickies

candid jay
#

is there a way to getPos for a memory point?

#

not the object, the exact coordinates of a memory point

#

then I guess you just need to vectorAdd?

#

oh yeah that too

#

thank you

candid jay
#

thanks! ๐Ÿ˜ƒ

cursive owl
#

good day guys, im loking for a sector script so if the independent control the sector the flag get a addaction in base for halo jump. ? can some one help me.

#

so a marker get green of the ind control the zone, and than it will give a addaction for halo jump, but if tay lose it it will deseper the action for halo jump

#

๐Ÿ˜ƒ

simple solstice
#

so you are basically asking someone to write a script for your

cursive owl
#

well tyes, if some one have the time for it

cursive owl
#

if (_this select 1 isEqualTo west) then {flag addAction ["Exec the file", "somescript.sqf"]}

#

can ido somthing like this

simple solstice
#

what is _this select 1

#

and why west

#

i thought you wanted independent?

cursive owl
#

yesm but its a exempel for somthing if i can go an do this

#

i take out the west and add independent

simple solstice
#

depends where you put it

cursive owl
#

a griger

#

trigger

simple solstice
#

and the trigger will fire when?

#

normally it fires when someone enters it

cursive owl
#

yes

simple solstice
#

and that isn't really taking over an area

cursive owl
#

hmm

blazing quiver
#

Hey, another question

#

Is there any way to keybind an action?

#

Like instead of using a script bound on the action menu could I keybind it?

candid jay
#

I have two points in space

#

what is the best way to get vectorUp of the line that crosses them?

candid jay
#

isn't this the vector from A to B?

#

what I'm referring to (to be more clear) is

#

I have two points A and B, I'd like to put a cable that starts in A and ends in B, so I have to set vectorUp on the cable

#

(forget about distances and stuff, I need just the angle)

#

I probably need a 90 deg cartesian on this angle

little eagle
#

There are infinitely many orthogonal vectors to any vector. You need at least 2 vectors to have a unique up vector.

#

Cross product is what you need.

#

Or if it's a cable, maybe just setVectorDir

candid jay
#

set to which value

little eagle
#

Depends on the model I guess.

candid jay
#

all i have is two points

#

ok consider a simple model of 1m

little eagle
#

Is the cable your model?

candid jay
#

yes

little eagle
#

Make it so [0,0,0] model space is one end of the cable.

candid jay
#

itโ€™s the stupidest model ever

#

ok

little eagle
#

And it goes straight into one direction that is either x or (oxygen) z.

#

So not upwards.

#

flat.

candid jay
#

yes

little eagle
#

Then you setPos it into one end.

candid jay
#

setdir, i can get relative easily

little eagle
#

vectorFromTo is setVectorDir

#

Not setDir, setPosASL and setVectorDir ideally.

candid jay
#

i donโ€™t get it

little eagle
#

Why?

candid jay
#

then you need a vertical cable

little eagle
#

No?

candid jay
#

to use vectorfromto

jade abyss
#

VectorFromTo needs 2 Points - Point of Object and Endpoint

#

vectorFromTo -> setVectorDir

candid jay
#

ok so i have a horizontal cable, use setvectordir to vectorfromto?

little eagle
#

Yes.

candid jay
#

ok

#

great, thank you.

little eagle
#

But that requires your cable to start at [0,0,0] model space and go to e.g. [1,0,0]

candid jay
#

yes

#

thatโ€™s fine

little eagle
#

That would be the easiest. You don't really need the upvector since the cable is a 2d object.

jade abyss
#

(VectorStuff is bรคh)

little eagle
#

No one cares which side is up as long as it points in the right direction.

candid jay
#

yep

jade abyss
#

setVectorDirAndUp if you still wish to adjust VectorUp*

candid jay
#

I actually need a little more than that, if you have pointers

#

so my cable is 1m

little eagle
#

Dir and Up are orthogonal vectors, otherwise setVectorDirAndUp fails.

candid jay
#

letโ€™s say that I have 2 points in space

little eagle
#

A and B

candid jay
#

i need to have cables โ€œline upโ€

jade abyss
#

vectorFromTo

candid jay
#

to cover all of the distance between A and B

jade abyss
#

+Distance

candid jay
#

so ok, first element pos is point A

little eagle
#

You need 20 cables if the distance is 20 meters and the cable is 1 meter.

candid jay
#

yes

little eagle
#

All would have the same direction vector.

candid jay
#

but how do i compute the intermediate pos

#

simply xyz coordinates separately in %?

#

so z = (z2 - z1) * percentage

#

same for x and y

little eagle
#

A vectorAdd _dir, as long as _dir has magnitude 1

candid jay
#

lost you

little eagle
#

There are vector commands for all this. You don't need to do the math yourself.

candid jay
#

_dir being?

little eagle
#

vectorFromTo

candid jay
#

ok

little eagle
#

It's always a unit vector (= mag 1)

jade abyss
#

A = [0,0,0];
B = [1,0,0];
vectorDir = [1,0,0] (right?)

little eagle
#

Yes, but again, depends on the model. You might have to mess around with the model's direction in oxygen.

#

I'm not 100 on that. Oxygen is weird with y being upwards and all that.

#

To completely discourage you, I might add that you could use the katenoide curve for a hanging cable (hyperbolic cosine).

candid jay
#

nonono

jade abyss
#

๐Ÿ˜‚

candid jay
#

ahahah

#

I already have chairs going around and working in MP

#

al I need is ti have the damn cables line up appropriately

jade abyss
#

Or just use a Rope and check for the position of the next segment, then move it to that position.
iirc that was possible (to check for the segment).

candid jay
#

rope has too many issue for this use case

candid jay
#

it can be shot, it is a physx object, it needs to be attached to a physx object with a simulation, etc

#

lol

#

NO

#

NONONONONO

#

๐Ÿ˜„

little eagle
#

But this is where the real fun begins ๐Ÿ˜ฆ

#
y = a cosh (x/a) = a/2 * (e^(x/a) + e^(-x/a))
jade abyss
#

Your definition of "fun" is strange

#

Ah wait, nvm

#

*Macrommy2

candid jay
#

lol

little eagle
#

Now I'm hungry for macaronis.

jade abyss
#

*Macronis

little eagle
#

Macronies.

jade abyss
#

KlugscheiรŸer

little eagle
#

Pretty sure I got it right the first time and everything else was off.

#

I only have fusilli, and napoli sauce.

austere granite
#

Anyone that doesn't have a poorly functioning brain wants to give me a pointer on how to convert hex color code to arma rgba values?

little eagle
#

In SQF? Is the hex thing a string?

austere granite
#

yeah, just normal "#A7A7A7"

little eagle
#

RGBA from 0 to 1 or 0 to 255?

austere granite
#

0 to 1, i can manage to make that translation myself though

#

๐Ÿ˜„

#

@little eagle google-fu came up with

getColorFromHex = {
    private ["_hex","_r","_g","_b","_nums","_return"];

    _nums = toArray "0123456789ABCDEF"; //for converting hex nibbles to base 10 equivalents
    _hex = toArray (_this select 0);
    _hex = _hex - [(_hex select 0)]; //remove the '#' at the beginning

    _r = (_nums find (_hex select 0)) * 16 + (_nums find (_hex select 1));
    _g = (_nums find (_hex select 2)) * 16 + (_nums find (_hex select 3));
    _b = (_nums find (_hex select 4)) * 16 + (_nums find (_hex select 5));

    //divide by 255 (0xFF) because game wants a num between 0 and 1
    _return = format ["%1,%2,%3",(_r/255),(_g/255),(_b/255)];
    _return
};
#

So all good

little eagle
#

I have something better. Gimme a minute.

austere granite
#

kk

#

i swear i've seen it before too somewhere, but couldn't find it, looked through BIS functions but didn't see it

little eagle
#
"#A7A7A7" call { 
    params ["_color"]; 
 
    _color = [ 
        _color select [1,2], 
        _color select [3,2], 
        _color select [5,2] 
    ]; 
 
    _color apply {call compile format ["0x%1", _x] / 255} 
};
austere granite
#

Ah that's pretty clever actually

#

N1

little eagle
#

I found a use for compile format. Kill me ๐Ÿ˜‚ ๐Ÿ”จ

austere granite
#

Yeah i don't think about using that

#

๐Ÿ˜„

agile pumice
#

I have a bit of code that runs in an onEachFrame handler, but when I try and retrieve the variable, its nil. When i test the code in debug, it works

ed4_hud_button_direct_left = worldtoscreen ed4_hud_button_direct_left;
if(count ed4_hud_button_direct_left < 2) then {ed4_hud_button_direct_left = [0,0];};```
little eagle
#

Place something that can be blown up nearby?

#

Yeah. Hide a drone somewhere.

#

Or something that fits the scene.

#

I'm not sure, they might be still able to take splash damage from e.g. explosions, but maybe not.

#

Could always not hide it, but give it a transparent texture.

#

Of course they would show up on the radar/map in scrub mode.

#

^ If not, everything would be nil.

young current
#

Didnt hidden map objects get destroyed at some point?

little eagle
#

Uhm, if you close the mission?

#

Can ground weapon holders be blown up?!

jade abyss
#

nope

little eagle
#

Otherwise an ammo box.

#

Those shouldn't show on the radar and you can make them transparent without hiding them.

#

lasertarget is probably indestructible.

#

ammo box

#

attach it

#

setObjectTextureGlobal something full alpha

#

Explosion eh

#

Oh, those balloons from Marksman

#

Create them by script if you want to avoid dependency

agile pumice
#

@quicksilver right at the top _vehicle = vehicle player;

little eagle
#

eagle, inside the OEF code block or outside of it?

agile pumice
#

inside

#

right above where ed4_hud_button_direct_left is initially defined

#

well its on a constant loop

#

its only defined once

little eagle
#

Can you post it^^?

agile pumice
#

at the top

#

adding the onEachFrame via BIS_fnc_addStackedEventHandler

#
if (_EH != "") then {
    "Added OEF_FordCVPI to onEachFrame stack" call BIS_fnc_log;
};``` gives me the statement in the log
#

so I know its adding the handler correctly

little eagle
#

Hmm, I see you working with the ui namespace. Maybe you try to access the variable from the wrong namespac.e

agile pumice
#

the only thing using the ui namespace is ed4_hud_helpertext

#

and I get the proper namespace when getting that variable

little eagle
#

_EH = ["OEF_FordCVPI", "onEachFrame", {ED4_Vehicles_Ford_CVPI_fnc_worldToScreen}] call BIS_fnc_addStackedEventHandler;
This looks wrong. Should be:
_EH = ["OEF_FordCVPI", "onEachFrame", ED4_Vehicles_Ford_CVPI_fnc_worldToScreen] call BIS_fnc_addStackedEventHandler;

#

Otherwise you have a function that returns a piece of code.

#

Without ever executing it.

#

Alternatively:

_EH = ["OEF_FordCVPI", "onEachFrame", {call ED4_Vehicles_Ford_CVPI_fnc_worldToScreen}] call BIS_fnc_addStackedEventHandler;

agile pumice
#

I think you just solved it

little eagle
#

: )

agile pumice
#

without me even tesitng it

#

XD

#

sigh why am I such trash

#

I want to stack em

little eagle
#

Mission EH does stack.

agile pumice
#

haha

little eagle
#

lmao

agile pumice
#

commy, I wrote my own hex to base 10 color code a while back, and it was probably 6x the length as yurs

#

XD

austere granite
#

the longer the better tbh

little eagle
#

Be glad there is potential for optimization.

austere granite
#

๐Ÿ†

agile pumice
#

I had this huge 10k line list of color arrays by hex and decimal and I could insert a hex or decimal color code, and retrive a stirng that identified the color

#

was it? I use the missioneventhandler for my draw3D script

#

but assumed the bis function was for stacking multiple handlers, so I didn't use it for that purpose

little eagle
#

Stacked has a few benefits though. It can pass args, you have strings as identifiers that can easily overwrite, and some events can make use of the return values still (or could, they broke it at some point - no idea if fixed)

agile pumice
#

my draw3D script for anyone who's curious

little eagle
#

eagle, stacked was the upgrade from the plain onEachFrame etc. sqf commands, that overwrote each other. Mission EH is the upgrade from that making it native C++ events instead of a SQF function framework.

agile pumice
#

its night time ๐Ÿ˜ƒ

austere granite
#

you still want to cache eagle

agile pumice
#

too complex for me ๐Ÿ˜ƒ

#

i got my 70 frames, I'm satisfied

rotund cypress
#

Is there any easy way or command to get all controls of a controlsgroup?

#

The command allControls requires a display as argument

tame portal
#

@rotund cypress I can't remember any easy way to be honest

rotund cypress
#

uggh

#

makes my life harder

tame portal
#

Do you have to get them dynamically?

rotund cypress
#

Yes kinda

#

I can get them dynamically by doing something but it would be not needed code if there was some other way

tame portal
rotund cypress
#

Are the controls under a controlsgroup return by allControls though however? @tame portal

tame portal
#

I think yes, give it a try though

#

Given that you cannot get all controls of a group, allControls should also contain the ones in the groups

#

Oh nevermind

#

"
Returns a list of all controls for desired existing display. Returned controls also include controls from control groups"

#

That should work fine then ๐Ÿ‘

rotund cypress
#

Cheers mate, will use this method.

kindred lichen
#

Hey, what happens if I put an on hit event handler onto a prop object like a house in multi player

austere granite
#

Is there any easy way or command to get all controls of a controlsgroup?

#

that should be easy enough actually

#

with what optix says

#
params ["_control"];
private _allControls = allControls (ctrlParent _control);
_allControls select { (ctrlParentControlsGroup _x) isEqualTo _control };
#

@rotund cypress that should do it then

#

although, i guess that doesnt'support nested

rotund cypress
#

I did something like that

cerulean whale
#

Anyone aware how to remove the borders on rscEdits and rscCombos?

#

I've tried all the colour settings (e.g. colorBorder, etc) and no luck

meager granite
#

There is some style you need to use

#

#define ST_NO_RECT 0x200

#

This one I think

cerulean whale
#

That's it

#

I used to have it but I entirely forgot about it

#

Cheers @meager granite

still forum
#

@-CML-CaptainMittens#8413 When you add it you will have added a hit event handler. What did you expect to happen?
In general.. "When I do that then that will have been done by me" is true.

compact maple
#

@meager granite whats does 0x200 mean ?

tame portal
#

@compact maple It's a binary flag

#

Basically the game will do a logical operation "does the style for the control that's being rendered have flag 0x200 set? Yes? Then render no border"

still forum
#

0x200 == 512 in decimal

little eagle
#

It's just a fancy way of writing a number.

barren magnet
#

Not exactly ... @little eagle it's way more easy to read which bits are set from a hex number than from a base10 number

little eagle
#

And? It's still just a fancy number.

candid jay
#

@little eagle regarding what we talked about yesterday, i.e. settings a cable to go from A to B knowing only coodinates. I do:

private _direction = _start vectorFromTo _end;
_cable setVectorDir _direction;

This sets the appropriate direction but not the inclination. How do I set the vectorUp of the cable?

little eagle
#

You mean the thing is still flat after you used setVectorDir?

candid jay
#

yep

#

the direction is good

#

but it is flat

#

I need set vectorUp otherwise it is flat

little eagle
#
private _vdir = _start vectorFromTo _end;
private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
private _vup = _vlat vectorCrossProduct _vdir;
_projectile setVectorDirAndUp [_vdir, _vup];
#

_projectile would be your cable.

#

oops

#

fixed

candid jay
#

still flat...

compact maple
#

Oh okay thanks ๐Ÿ˜ƒ

little eagle
#

Show the code, SCAR

candid jay
#
private _cable = "Bosnia_Cablecar_Cable" createVehicle _start;
_cable setPos _start;
private _vdir = _start vectorFromTo _end;
private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
private _vup = _vlat vectorCrossProduct _vdir;
_cable setVectorDirAndUp [_vdir, _vup];
little eagle
#

What is _start?

#

and _end?

candid jay
#

two positions ATL

little eagle
#

You need to do your vector math in the ASL system.

candid jay
#

why would that matter?

little eagle
#

You need a flat topology. Otherwise your z is dependent on the x,y.

#

Yes it matters.

candid jay
#

ah

#

ok, trying that, I'll be back

#

that seems definitely better

#

will resume and add all the multiple pieces

#

so to compute the points I just need to A vectorAdd _dir

#

I mean, the middlepoints

#

with _dir being vectorFromTo

little eagle
#

I'm 87% sure you don't need the vectorUp stuff. setVectorDir should be enough. The 13% rest is reserved for Arma.

candid jay
#

ok

#

lol

#

trying

little eagle
#

A1 = A0 vectorAdd _dir
A2 = A1 vectorAdd _dir
A3 = A2 vectorAdd _dir
etc.
B should then be between A(n-1) and An
Dunno how else to explain it.

candid jay
#

FYI

#
private _cable = "Bosnia_Cablecar_Cable" createVehicle _start;
_cable setPosASL _start;
_cable setVectorDir (_start vectorFromTo _end);
#

this does not do it

little eagle
#

Still flat?

candid jay
#

this does:

#
    private _vdir = _start vectorFromTo _end;
    private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
    private _vup = _vlat vectorCrossProduct _vdir;

    private _cable = "Bosnia_Cablecar_Cable" createVehicle _start;
    _cable setPosASL _start;
    _cable setVectorDirAndUp [_vdir, _vup];
little eagle
#

Is it still flat with just setVectorDir?

candid jay
#

yes

little eagle
#

Figures. That's a bug then.

candid jay
#

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

little eagle
#

Eh, that vectorCross thingy stuff you can always use instead of setVectorDir.

candid jay
#

fuck

#

it works and am building my cables dynamically, but approximations are killing it

#

I guess I'd better compute the dir on every 1m iteration

#

after 150m the destination is slightly off

little eagle
#

Uhm.

candid jay
#

this is a life safer, if I can get it to work

#

pretty sure it's a flota number approx

#

after 150m, the cable arrives like 5cm to the right of _end

#

so I'm gonna try to recompute on every 1m slice

little eagle
#

Oh, that's much better than what I thought.

candid jay
#

๐Ÿ˜ƒ

little eagle
#

Do the cables stick together neatly at least?

candid jay
#

yep

little eagle
#

Nice.

candid jay
#

wonderflly

#

yes

#

because then i don't need to do this cable alignment crap in EDEN or TB

#

which is crazy and would never work anyways

little eagle
#

I'm getting the formulas for arc length and catenary.

candid jay
#

lol

#

it would still be kinda crappy

#

it's 1m segments

little eagle
#

I don't think so. 150 segments is a lot and we just make it a big A.

candid jay
#

well it's a 1.5km cable line with 60 seats

#

ok recomputing at every 1m interval looks AWESOME

little eagle
#

Pics please : )

candid jay
#

coming up

#

so, chairs are not in yet in these images

#

but they are fully working and functional

#

even in MP

#

thanks @little eagle ๐Ÿ˜ƒ

compact maple
#

Lol nice work !!

candid jay
#

these and other nice things will be in an upcoming 25x25 terrain

little oxide
#

Nice work

candid jay
#

NO NO NO NO NO NO

#

ahahaha

compact maple
#

Can it be done ?

candid jay
#

yeah

little eagle
#

Sure, it's relatively easy math. Solved 300 years ago.

compact maple
#

Show us xD

candid jay
#

hem NO

#

not me lol

little eagle
#

I'm wondering if you could superpose two catenaries to emulate wind blowing from the side..

tame portal
#

Wait what did I miss

candid jay
#

so

#

the issue is that chairs are also using these vertices to move

tame portal
#

It sounds like someone is trying to do PhysX in SQF

candid jay
#

nah

#

I mean, maybe commy2 is thinking about it lol

tame portal
#

Well I got the bit that you're making a chair lift :P

little eagle
#

OPTiX, just some boring vector math to create cables - that don't even hang.

candid jay
#

ahahaha

#

indeed

tame portal
#

How about placing them according to a function created according to start and end position

#

I mean the rope segments

#

Make it a bit curved aswell :P

little eagle
#

That's what we did. To get a realistic curve, one would have to play around with hyperbolic cosine, but the ropes are stiff (for now).

tame portal
#

Oh I mean stiff looks fine

candid jay
#

yeah I'm fine with that

tame portal
#

They aren't that much curved irl as far as I can remember

#

@candid jay Commy is not

candid jay
#

they are for cable cars

#

but here we'd have chairs

#

so they are not

tame portal
#

more realistic cables \[T]/

candid jay
#

volumetric fog!

tame portal
#

Can't you use the ropes in ArmA?

candid jay
#

ponds!

#

nope

#

can't

#
  1. they can get shot and broken
tame portal
#

How come

#

Oh

candid jay
#
  1. they need a vehicle with physx
little eagle
#

They have to be hanging slightly, so they don't tear in the cold.

candid jay
#

so I'd need to turn my pylons etc to CARS

tame portal
#

Is there a way to get the positions of the rope segments?

little eagle
#

Dummy rope to read the positions of the segments?

tame portal
#

I mean could be one option

#

Just throwing things around

little eagle
#

That's boring though.

tame portal
#

You're boring.

#

I'll make my cable car with ropes. And PhysX, and explosions.

#

(explosions are not a bug)

little eagle
#

Blackjack and hookers.

tame portal
#

In the cable cars? I'd call it a genius idea if it wasn't proposed by the enemy.

little eagle
#

Well, TIL that I can add setVectorDir to the looong list of broken commands.

tame portal
#

Is there a list of commands with unknown use?

candid jay
#

serverTime should be in there

still forum
#

But that's only partially not working as intended

little eagle
#

If you lower the bar too much, you'd just get the "list of all scripting commands" again.

dim terrace
#

@tough abyss tested it now and returns true on wipeout

#

ah, it's working only on primary turret

#

so either pilot camera or primary gunner

#

basically it was converted condition from MFD so I primarily tested it with planes & helicopters

#

maybe for next patch (1.80)

#

someone is on it

meager granite
#

Would be great to have laserTarget work with other turrets as well, can't return laser target of Strider too.

candid jay
#

I am using:

 private _relDir = _chair getRelDir _destPos;
 _chair setDir (getDir _chair) + _relDir;

to set the direction of a chair towards its destination

#

for some reason, this doesn't always work

#

any ideas?

copper raven
#
_chair setDir (_chair getDir _destPos);

is there any reason you arent using this? ^

compact maple
#

Hello guys, I am trying to create a dialog on the inventory display (IDD602), but nothing show up.
I have try the same code with the map display (IDD12) and this is working. Any idea what's going wrong ?

astral tendon
#

Is there a way to remove the explosive damage of a vehicle?

wispy lynx
#

Was hoping for some help (tried internet, but ambiguous question returns nothing/not related results) with this: if(_weaponType = "weaponClassName") then {... I am trying to spawn units with different loadouts, and if the weapon is a machinegun, I need to clear room for ammo instead of grenades/smokes/pistol ammo.

inner swallow
#

export a virtual arsenal loadout, paste it in notepad. will have the code you need

simple solstice
#

@astral tendon allowdamage false for nearby objects

inner swallow
#

(and some you don't, but it should be obvious after some time with the biki)

simple solstice
#

or just an eventhandler handledamage

astral tendon
#

i want the vehicle to explode but i dont wanna the explosion to do damage

simple solstice
#

then you can use the handledamage EVH

astral tendon
#

can you handle me some exemple?

simple solstice
#

I'm on mobile

#

the way it works is that you can use if

#

and check if the damage comes from an explosion

wispy lynx
#

@inner swallow I have the weapon class, but it returns error. My code is: if (_primaryWeapon = "LMG_03_F") then {... The _primaryWeapon is randomly selected from a list, but when the script hits this part, it says it doesnt recognize "LMG_03_F"?

astral tendon
#

but then this will negates any explosive damage? like a grenade?

simple solstice
#

that's why you need to use if statements

#

Well just one but multiple conditions

wispy lynx
simple solstice
#

@wispy lynx and how will that prevent the damage

#

if it's deadly?

wispy lynx
#

@astral tendon add event handler, make it setDamage 0 when Explosion event happens.

simple solstice
#

and then it blocks every explosion

wispy lynx
#

@astral tendon setDamage vehicle+crew 0

little eagle
#

๐Ÿฟ

simple solstice
#

and that won't prevent a deadly explosion.

astral tendon
#

hang on

simple solstice
#

what I would do

#

is to check whether a vehicle is nearby in the handledamage

#

and if it's alive

#

or it's damage

#

if so

#

exitwith {false}

astral tendon
#
_car = _this select 0;
if ({alive _x} count (crew _car) == 0) then {_car setDamage 1}}];

this is the event handle in the vehicle that will explode when the crew is dead
is there a way to check first if there is players or blufor close to that vehicle before se the damage to 1?

little eagle
#

setDamage [1, false]
to prevent the explosion?

simple solstice
#

that makes things easy

#

wish you would pasted it before lol

astral tendon
#

i say players because this is a coop scenario

inner swallow
#

@wispy lynx use == not =

simple solstice
#

or even better

kindred lichen
#

Anyone know if there's a way to create a custom view point while still allowing the player to have normal control of their character?

simple solstice
#

isEqualTo

inner swallow
#

Or that

wispy lynx
#

@inner swallow Thanks, I'll give it a try.

inner swallow
#

@wispy lynx reason is, = is assignment, and == or isEqualTo are used for comparison. The if statement works on a Boolean value.

kindred lichen
#

Basically, i need someone to be able to drive a vehicle, but not be looking in the driver seat.

simple solstice
#

@kindred lichen the only command I know for creating a different view is camCreate

astral tendon
#

@little eagle That works but i wish the explosion still happens

kindred lichen
#

@simple solstice camcreate stops you from controlling your player though.

astral tendon
#

the vehicle just spawn burned

little eagle
#

So you want the explosion to be just visual?

simple solstice
#

@astral tendon then to that script add a foreach with _x allowDamage false for nearby players

astral tendon
#

yes

simple solstice
#

and then true it after some time

kindred lichen
#

@astral tendon you need to delay the check a bit, the units probably aren't alive at the very start of the mission before they're spawned.

simple solstice
#

guess commy has a better solution so you can wait for him :D

wispy lynx
#

@inner swallow Works! Thanks for the help & the explanation. I'm learning this script stuff so the reasoning helps with understanding the how/why. Now on to figuring out how to assign grenades if GL equiped weapon.... ๐Ÿ‘

inner swallow
#

You're welcome ๐Ÿ˜„
Good luck with that! Should be simple enough (rifles with GLs are a different class), but ask here if you need help, of course.

little eagle
#

I'd create a particle with the same effect (VehicleExplosionEffectsBig), but I have no idea if that's possible with just missions.

simple solstice
#

that's what I thought

#

to create the effect

#

but don't know the way

kindred lichen
#

@simple solstice holy, shit, i figured it out, player remoteControl Target;. Let's you control the body of another unit without leaving your current view.

little eagle
#

I know with config, no idea how a mission would do it.

#

You'd think you scrubs would've found a way, but you're disappointing as usual.

simple solstice
#

but that doesn't seem like you wanted it

#

wow commy

little eagle
#

I think you have to create a particle for every class inside VehicleExplosionEffectsBig and then apply

            private _fire = "#particlesource" createVehicleLocal [0,0,0];
            _fire setParticleClass _ParticleClass;
            _fire attachTo [_vehicle, _position];

for all of them.

#

_fire is just one of many particles.

#

Could be _X

simple solstice
#

allowDamage false would be easier imo

astral tendon
#

what is the global equivalent for "player"?

little eagle
#

You have to handle locality with allowDamage and then the latency probably kills you anyway.

#

allPlayers ?

astral tendon
#

example

_car = _this select 0;
if ({alive _x} count (crew _car) == 0 AND Player distance _car >= 10) then {_car setDamage 1}}];
simple solstice
#

CBA_fnc_players

#

ohh

#

nearEntities

#

and you would want >=

little eagle
#
count (allPlayers inAreaArray [getPosASL _car, 5, 5]) == 0
astral tendon
#

@little eagle that works but how i change the distance? is those 5s?

little eagle
#

Yes. 5 means radius 5.

#

It's two fives, because you can make ellipses with this.

astral tendon
#

make sense

little eagle
#

For a circle, both numbers have to be the same.

compact maple
#

@tough abyss yea but this is not even appear once

astral tendon
#

All good, thanks @little eagle

little eagle
#

yay

simple solstice
#

I'm ashamed to answer question when commy is around

#

he will always find a better solution

errant sequoia
#

Sorry if this isn't the right place but I wonder if anyone has a soultion to adding a vehicle spawner to a mission? The script im using right now is kind of flawed https://hastebin.com/aqanuvakin.bash the major issues are that more then 1 person can use it at the same time and sometimes when a player uses this not all other players can see the vehicle.

edgy dune
#

question

#

how can u change the thermal texure of a unit while zeusing?

little eagle
#

You can't?

candid jay
#

does anyone know if the locality of a vehicle changes when a cargo unit enters the vehicle, or only the driver?

little eagle
#

Driver.

candid jay
#

thereโ€™s sonething i am not understanding, which is locality of triggered events.

#

says that effect is local.

jade abyss
#

local to the Machine where it's added

#

e.g. you add it to player1 -> won't get executed on Player2

candid jay
#

yes. but if in the callback you have a global command such as setPos on the vehicle?

#

i would expect the local client to have a global effect

jade abyss
#

So if you create a Vehicle and the owner of it is the Server -> If somebody gets in -> "getIn" is triggered on the Server

candid jay
#

triggered local, ok, but then it depends on what you do in there.

jade abyss
#

setPos is global

candid jay
#

exactly

#

my point is: getin is triggered on the server OK but if in the callback you use functions with global effects iโ€™d expect they have global effect

#

the docs say โ€œlocal effectโ€ but what is meant i guess is โ€œlocally triggeredโ€

jade abyss
#

Again:

#

Vehicle is create on player1.
On Player1 the command gets executed (e.g. systemchat "bla")
If Player2 gets in the Veh -> ONLY player1 gets the systemchat msg
(example for locality)

candid jay
#

i got that

#

again: ๐Ÿ˜ƒ

little eagle
#

The wiki claims Fuel, Engine and Gear have global effects, but that's just wrong.

jade abyss
#

Yeah, Fuel is a local command

#

Engine?

candid jay
#

they mean LOCALLY TRIGGERED not LOCAL EFFECT

little eagle
#

Eventhandlers.

jade abyss
#

EngineOn? Or wich one do you mean, Commy

little eagle
#

Engine eh fires if you turn on or off the motor.

plucky willow
#

anyone know the pboname for the default arma3 textures?

jade abyss
#

Ah, yeah, Commy

little eagle
#

Fuel eh fires if you run out of fuel or refuel from 0.

#

Note that I capitalize eventhandlers to distinguish them from potential commands, which use camel case.

#

...

#

A3_ui_f or A3_data_f

#

Pbo also A3_ui_data_f or whatever it's name was. It uses the same path as a3_ui_f ingame for the magic folder.

edgy dune
#

shit theres no way to remove a units thermals is there now?

little eagle
#
_vehicle disableTIEquipment true;
#

Dunno about Zeus. Maybe there's a module, maybe not. Never use it.

errant sequoia
#

can someone point be in the right direction this line isn't working in the init of an object this addAction ["Vehicle Garage", execvm "scripts\open.sqf"];

edgy dune
#

nah I mean the thermal signiture of a unit

#

like infantry

little eagle
#

That you can't change afaik.

#

SA, remove execVM

edgy dune
#

dang I crie a little bit

inner swallow
#

@candid jay local effect means that the the effect of a command is local, i.e. must be executed per client

#

So you need to make sure it's run for everyone, or run it just on server and use remoteExec

#

local argument means that the variable must be local to that machine

#

a trigger that is local will run the on activation code locally, however if you run a global effect command from a local trigger it will execute for everyone

#

(but if it gets triggered on n machines, then the effect will be n times for everyone)

#

(where n is a whole number)

candid jay
#

yep

#

that was my understanding.

#

it was the words โ€œlocal effectโ€ that didnโ€™t ring right to me.

#

no, itโ€™s a local trigger, the effect depends on what is in the callback

#

anyway all good

little eagle
#

It's addEventHandler that has the local effects really.

astral tendon
#

is there a better description about the Waypoint Types? like Sentry, what that does and how IA acts

candid jay
#

also, between that method and BIS_fnc_addStackedEventHandler?

tulip cloud
#

Does a request from 1 player to another have to be sent to the server? Or can the player directly request a script execution on the client?

plucky willow
#

is there a way to set an object to face a specific, relative point? towards a different object, for example

jade abyss
plucky willow
#

wow that page is amazing

jade abyss
#

๐Ÿ‘

#

and another ๐Ÿคฆ moment from Quiksilver

astral tendon
#

this does the same as the Show/hide module ?

#

because it does not seens to diable simulation

plucky beacon
#

Don't forget to bookmark the A3 functions page too.

abstract plank
#

hey guys, I am working on my own server side mod and I am having some issues getting it loaded my launch command is as follows

#

arma3server_x64.exe -port=2302 "-config=C:\Users\ryan\Documents\ArmA Server\serverfiles\server.cfg" "-profiles=C:\Users\ryan\Documents\ArmA Server\serverfiles\server" -name=server -mod=@extDB3;@serverfiles; -autoinit

#

I see both extDB3 and serverfiles being loaded, but I have a diag_log in my @serverfiles init.sqf that doesn't get logged

#

I see @timber cypressDB3's logging it does when it loads

#

any ideas?

#

sorry @timber cypress , didnt mean to tag you

plucky beacon
#

When you're worried about doing that use code blocks

`like this`
abstract plank
#

yeah forgot @ will tag people

plucky beacon
#

Especially with every mod folder starting with @

abstract plank
#

exactly

#

do you have any ideas about my issue? lol

#

been working on it for hours and i am so lost

plucky beacon
#

Really no clue, sorry.

#

Im sure someone here knows though, hang in there.

abstract plank
#

hopefully. i found someone with same issue on BI forums, but there were no answers lol

south pasture
#

If AI group/unit changes it's locality, what information will be lost? wp, fsm state, setVariable values, behaviour? Will it retain basic danger reactions, or will be complete dummy?

edgy dune
#

So I got this code

#
_this setObjectMaterialGlobal [0,"a3\characters_f\BLUFOR\Data\clothing1_ti_ca.paa"];
_this setObjectMaterialGlobal [0,"a3\characters_f\BLUFOR\Data\vests_ti_ca.paa"];
#

which

#

basicly takes the bluefor thermal map and put it on said unit

#

it does it for the vest and clothing

#

but how would I do the same for helmet and uniform?

#

I tried

#
_this setObjectMaterialGlobal [0,"a3\characters_f_exp\OPFOR\Data\headgear_vipersp_ti_ca.paa"];
``` but this just crashes the game
meager granite
#

You can't do that to headgear, vests or facewear, only as separate config entries through mod

edgy dune
#

i c,any mods that do that?

rancid ruin
#

@eXandric#6898 maybe it's the trailing ; in your mod list? -mod=@extDB3;@serverfiles;

still forum
#

@candid jay eachFrame runs before Simulation. Draw3D after.
stackedEH is just a scripted "scheduler" vs a in-engine "scheduler" that calls your handlers. You should always prefer the engine one. Unless you need to pass variables which the stackedEH can but engine can't.

tulip cloud
#
diag_log (findDisplay 100000);
dialogDestroy = (findDisplay 100000) displayAddEventHandler ["onDestroy", "systemChat 'Hi'];
dialogUnload = (findDisplay 100000) displayAddEventHandler ["onUnload", "systemChat 'Hi'];
//returns
No Display
diag_log allDisplays;

//returns
[Display #0,Display #313,Display #46,Display #100000,Display #12,Display #63]

Why can I do allDisplays and find it but when I request the specifc display it can't.

jade abyss
#

"systemChat 'Hi'];
missing "

candid jay
#

I guess because onEachFrame is the same for every script running?

tulip cloud
#

@jade abyss I checked my code and I got it there. same problem.

jade abyss
#

wasn't it onLoad in the .cpp?

#

In my config it's:
onLoad
onUnload

#

cpp example:

onLoad = "systemchat format ['Display loaded:%1', _this select 0]";
onUnload = "systemchat format ['Display UNloaded:%1', _this select 0]";```
compact maple
#

Anyone ever created a UI with createCtrl on the inventory display ?

#

I do _display = findDisplay 602;

little eagle
#

findDisplay works only one frame after the display is created, presumably because createDialog is scheduled to the ui scripting window, which happens after the simulation stuff.
You have to remove the on for onEvent outside of config.
Missing closing quote marks in both lines.
Destroy only works for controls, not displays.
Not all displays trigger Unload. It only happens when the display is closed by button with exit code (ButtonOK idc=1, ButtonCancel idc=2) or closeDisplay.

#

To circumvent findDisplay being retarded I cooked up this one once:

private _display = allDisplays;
createDialog "RscDisplayEmpty";
_display = (allDisplays - _display) select 0;

Maybe that helps. createDisplay also returns the created display, but not createDialog.

jade abyss
#

@compact maple
Example:

player addEventHandler
[
    "InventoryOpened",
    {
        _InterfaceInteract = [] spawn
        {
            disableSerialization;
            waitUntil { !(isNull (findDisplay  602)) };
            _NewCtrl = (findDisplay  602) ctrlCreate ["RscText",1928];
            _NewCtrl ctrlSetPosition  [-0.07, 0.96, 0.36, 0.05];
            _NewCtrl ctrlSetBackgroundColor [0, 0, 0, 0.65];
            _NewCtrl ctrlCommit 0;
        };
    };
];```
little eagle
#

Well, if you have the spawn there, waitUntil findDisplay will pass first try anyway.

jade abyss
#

nope

#

It can fuck up :/

little eagle
#

The spawn'd code block is also executed one frame later. Though maybe they create the display a few frames after InventoryOpened triggers.

jade abyss
#

I had issues without it (scripts not beeing loaded)

#

Thats the only reason why that waitUntil is in there. Something is fishy there

little eagle
#

This is way I hook into the onLoad events themselves instead...

jade abyss
#

Yep, directly in config would be the better choice, but he asked for scripted one

#

(otherwise he could create it in the config itself ยฏ_(ใƒ„)_/ยฏ )

little eagle
#

I think TFAR had it like this once for some display, and if you were fast enough to close it, the scheduled thread wasn't finished and then pop up a script error.

jade abyss
#

Hm, never had that ยฏ_(ใƒ„)_/ยฏ

little eagle
#

Yeah, sadly most devs don't test under heavy load = slower fps and saturated scheduler from all the bunnies and fish.

jade abyss
#

Yep

#

I had a CombatArea with 200 AI's running from left to right and a 2nd one where 50vs50 shooting eachother (for extra load on the CPU) *allowDamage false on all AI

tender fossil
#

Where can I find the placeable vegetation models in configs? Can't find them myself

compact maple
#

Thanks you guys for the help And the explanations will give it a try !

south pasture
#

If AI group/unit changes it's locality, what information will be lost? wp, fsm state, setVariable values, behaviour? Will it retain basic danger reactions, or will be complete dummy?

little eagle
#

Object namespace variables persist, dunno about the rest.

jade abyss
#

FSM State should be lost and started on the new Owner

candid jay
#

all, what is the difference in just setting in initServer.sqf

missionNamespace setVariable ["Bosnia_CC_chairs", _chairs, true];

and

addMissionEventHandler ["PlayerConnected",
{
    missionNamespace setVariable ["Bosnia_CC_chairs", _chairs, _owner];
}];
#

My understanding is that if _chairs is an array of objects that have local values set on their namespaces, the second will ensure that JIP receive those too

#

while the first one will send over only the original values

#

is this correct?

#

Also, second one is only for MP

little eagle
#

2.) seems like a waste of time when you could just do 1.) instead.

candid jay
#

well

#

the difference is that Bosnia_CC_chairs has local variable set on the namespace

#

so when JIP join in you want those to be updated to the JIP client

#

with 1 they would receive the original variables, not the updated ones

#
_chairs = [_chair]
missionNamespace setVariable ["Bosnia_CC_chairs", _chairs, true];
_chair setVariable ["myvar", 1];
#

in this case, in 1 the JIP would not have the variable set

#

in 2, the JIP would

little eagle
#

I don't think this works as you think it does.

still forum
candid jay
#

right, hence the โ€œcompatibilityโ€ concerns

jade abyss
#

@still forum Are you sure? hmm...

still forum
#

always. But sometimes I'm still wrong

jade abyss
#

I am pretty sure, that you can add multiple

still forum
#

onEachFrame? no.

#

addMissionEventhandler with onEachFrame as parameter yes.

jade abyss
#

e.g. i had one for an Overlay for the position and another one who was added for Medic/Repair stuff

#

addMissionEventhandler with onEachFrame as parameter yes.
Ah yeah

#

Oh, onEachFrame is also a standalone command. Never used it (knew of it)...

little eagle
#

Better that way.

still forum
#

That's a good thing. Keep it that way

jade abyss
peak plover
#

Ewww

#

That's disgusting ๐Ÿ˜‰

jade abyss
#

looked in the mirror? ๐Ÿ˜›

candid jay
#

yep

#

hence use the stacked one

little eagle
#

Or the mission one (which is also stackable)

candid jay
#

yes

#

Ok I suck at vectors and I'm drunk. So, can some kind intelligent soul tell me wtf vector function I can use to achieve the same thing in a one liner?

#
_pos params ["_x1", "_y1", "_z1"];
_destPos params ["_x2", "_y2", "_z2"];

private _x = _x1 + (_timePortion * (_x2 - _x1));
private _y = _y1 + (_timePortion * (_y2 - _y1));
private _z = _z1 + (_timePortion * (_z2 - _z1));
private _newPos = [_x, _y, _z];
#

i'm sure this must be a one liner thing

#

does this even remotely looks right?

#

private _newPos = _pos vectorAdd ((_destPos vectorDiff _pos) vectorMultiply _timePortion)

little eagle
#

lgtm

candid jay
#

or alternatively

#
private _vdir = _pos vectorFromTo _destPos;
private _newPos = _pos vectorAdd _vdir;
#

wtf too much wine damn it

#

ah shit no

#

this one doesn't have the portion

little eagle
#

I don't think so, because now you always add a vector length 1, not length timePortion.

candid jay
#

yeah

#

so maybe

private _vdir = _pos vectorFromTo _destPos;
private _newPos = _pos vectorAdd (_vdir vectorMultiply _timePortion);
little eagle
candid jay
#

OH GOSH

#

you really want this hu AHAHAHAH

little eagle
#

I always wanted to do this since I was like 9 and built a lift with a string and legos.

candid jay
#

lol

#

well

#

go for it

little eagle
#

Modeling is too difficult for me. No artistic talents and I never practiced either.

candid jay
#

models, we have

#

you want my pylons? lol

#

let me finish this work then it's all a matter of vertices

#

anyway everything is now created dynamically

#

// compute pos
private _vdir = _pos vectorFromTo _end;
private _vlat = vectorNormalized (_vdir vectorCrossProduct [0, 0, 1]);
private _vup  = _vlat vectorCrossProduct _vdir;

// create cable
private _cable = "Bosnia_Cablecar_Cable" createVehicleLocal _pos;
_cable setPosASL _pos;
_cable setVectorDirAndUp [_vdir, _vup];

// get to next position
_pos = _pos vectorAdd _vdir;
little eagle
#

_pos and _end are two poles, right?

candid jay
#

yep, this is a portion in a loop

#

at the very beginning private _pos = _start;

#

so _start and _end are the two points to connect

#

this basically builds all the portions in between, but in this case linearly

little eagle
#

Ah, _start and _end are two poles then.

candid jay
#

it's a 1m cable

#

yes

little eagle
#

rgr

candid jay
#

though I will change that

#

because the cableway is 1.3km so that's 2,600 cable objects

#

kinda of unnecessary

#

will do 10m cables or so

#

I guess I'll only have to _pos = _pos vectorAdd (_vdir vectorMultiply 10);

#

or maybe not

#

again, too much damn wine

little eagle
#

The problem is that the formals for the catenary that I found assume both end points to be at the same height, but that is obviously not even close to true for a lift. So this changes the second integration constant , and I'm not sure exactly how yet.

candid jay
#

oh yes

#

and btw

#

that would mean sticking to 1m objects

#

and not really sure it would look better

#

because they'd still be 1m chunks

little eagle
#

Also I don't undertsand the step at 6:25, I think he missed a crucial step there.

candid jay
#

you know.. \ _ /

little eagle
#

I think it would look great. It would only hang a bit, and if you've ever looked at other games, hanging lines are always approximated at close distance.

sour saffron
#

cant you d the play record and grab the positions etc that it spits out as a viable array for what you want ?

little eagle
#

Even worse than 1 meter steps.

#

Play record of what?