#arma3_scripting

1 messages Β· Page 9 of 1

sullen sigil
#

_playerPos+[0,0,1], isnt working

hallow mortar
#

_var vectorAdd [0,0,1]

tough abyss
#

Pretty sure there's some billboard objects in base game literally dedicated to testing hiddenselectiontextures that have physx support

#

Can't add vectors with +

sullen sigil
#

how do i do that within an array for a command

#

dont want to try make a new variable

sullen sigil
hallow mortar
tough abyss
#

They're not that big

#

More like signs than billboards

sullen sigil
#
            _ConeBoi = createVehicle ["Land_PortableLongRangeRadio_F", (_playerPos vectorAdd [0,0,1]), [], 0, "CAN_COLLIDE"];```
#

something like that right

hallow mortar
#

Precisely

tough abyss
#

Bingo

sullen sigil
#

gotchu now

#

oh the issue is it just falls back down

#

i need to move the player downwards on the attachTo without it being weird then

#

probably invisible object is best then

tough abyss
#

I still retain my stance that the cleanest solution to this is a fake rope with setVelocityTransformation as the movement

#

Lot less possible issues

#

And you'll actually have fine-tuned control over the movement

hallow mortar
#

just addForce and attach the rope to the ragdoll. it'll be funny

tough abyss
#

Seems to me that when adding force to units they just ragdoll and then nothing

#

No further force does anything

#

Then again that was in an extreme case and might not always be true...

hallow mortar
#

I know for a fact you can physics slap units with addForce

sullen sigil
tough abyss
#

Yeah my case was with a uhm

#

Celestial body of great gravitational pull

hallow mortar
#

Ah, your mom

tough abyss
#

:(

#

MODS HE HURT MY FEELIES

sullen sigil
#

setVelocityTransformation would have momentum and such wouldn't it

tough abyss
#

Where's lou when I need him

#

@sullen sigil I mean it gives you velocity and by extension momentum so yes?

#

Not sure what you mean

sullen sigil
#

like if I shot it at the top of a tall wall from a while away I'd go flying over the top

#

or something like that

#

rather than being pulled to that point

hallow mortar
#

Depends on what you put into the command. It doesn't know about the wall, it only knows the numbers you give it.

#

Maths Timeβ„’

tough abyss
#

Depends how you set it yeah

#

It just takes an initial state and a final state and lets you smoothly interpolate between them

sullen sigil
#

probably less code too ngl

tough abyss
#

And if your final state has momentum

#

You will end with momentum

sullen sigil
#

yeah thats what i was thinking

#

this is more meant for ascension cables rather than actual grappling anyway so physically it makes more sense this way

tough abyss
#

Is this based on that attack on tinnitus or whatever

#

I know they have fancy movement cables that people like to base mods on

sullen sigil
#

no its based off the clone wars when they fight up a vertical cliff

#

obviously i havent managed to make players walk vertically but we digress

tough abyss
#

Doable kinda

sullen sigil
#

doable but probably not worth the time sink

hallow mortar
#

That's a cool idea but you're going to lose half the squad to falling off the cliff in under 5 minutes

tough abyss
#

Actually very doable with setVelocityTransform

tough abyss
#

As you can just force set their orientation

sullen sigil
#

wait what

tough abyss
#

Maybe combine with some animation to make it look like they're actually walking as they ascend

#

Doable

sullen sigil
#

can you not just rotate an animation or something

tough abyss
#

What I'm saying is that setVelocityTransformation lets you set the orientation of the object you're moving

#

Meaning you can angle players horizontally

#

As they move

hallow mortar
#

Does that actually work on units? They don't behave like normal objects

winter rose
sullen sigil
#

yeah surely i'd have to make a walking animation at 90 degrees and then stop them being able to turn their camera past a certain point

tough abyss
#

They really really don't like being tipped on their side but I presume it'd look normal enough with a fast enough loop

#

And you wouldn't need to rotate the animation if you can rotate the entire unit

#

@winter rose meowsweats

sullen sigil
#

youd have to do some fancy stuff to figure out how to stop it looking like their feet are moving off the "ground"

tough abyss
#

Meh

sullen sigil
#

like if i move my mouse left and right it rotates me in the Z direction

#

but youd want Y rotation if youre vertical

tough abyss
#

Don't get me wrong it wouldn't exactly be easy per se but it's all doable

sullen sigil
#

and probably not too good in MP I'd imagine?

tough abyss
#

Though you'll likely want a deeper understanding of vector maths and the associated commands

#

No reason it couldn't work in MP

#

Might be a little desynced but not much you can do about that

sullen sigil
#

hmmmmmm

#

i mean i need to get the player able to move their camera about and such with this method so

tough abyss
#

Tell you what I'll try rigging up a basic demo of my idea of it later today and let you know how it goes

sullen sigil
#

yes please because if its actually possible thatd be fucking sick

winter rose
tough abyss
#

How sweet

#

Newton did have a thing for mass...

sullen sigil
#

found a pole with physx i can set invisible 😎

winter rose
#

he went to church after all

tough abyss
#

Though it seems his relationships were a bit rough as all of his actions were met with equal and opposite reactions

hallow mortar
sullen sigil
#

perfecto

#

the cone is gone 😎

sullen sigil
#

im making this for literally one op because advanced urban rappelling v2 only allows re-mounting the rope at the bottom

tough abyss
#

Lobbing a pole down a warm shaft

#

Interesting

sullen sigil
#

im using a 3gl right now too so whenever i click back into arma i get propelled to some random point on vr

#

now is anyone aware of a way to let the player turn while theyre attached to an object

tough abyss
#

Turn on bone rotation in the attachTo mayhaps

hallow mortar
sullen sigil
#

aaaa the wiki doesnt have default memPoint listed

hallow mortar
tough abyss
#

Hmm yeah just figured it could help

#

Guess not

sullen sigil
#

onEachFrame {player setPosATL _ConeBoi}; :D

tough abyss
#

Perhaps time to change that variable to _PoleBoi

sullen sigil
#

this is true

#

i suppose i shall mess with the offsets while trying to figure out a way of doing the rotation

#

...

#

wait

#

can i not just make the mouse rotate the cone instead

#

no wait that wouldnt give up and down camera movement

#

or would it

#

it could but it'd look super janky

tough abyss
#

Miiight be easier to set up keybinds for rotating while climbing

#

As hooking into mouse movement is a bit of a PITA

sullen sigil
#

in your case probably though the pole will be moving about of its own accord too so i feel like thats probably a motion sickness nightmare

tough abyss
#

I'll be honest

#

With the way you're going about this

#

I'd say just drop the whole rotation thing

sullen sigil
#

thats my thought too

tough abyss
#

Gonna cause a lot of pain code wise for not much real payoff

sullen sigil
#

its a shame that the ascension speed cant be increased tbh

tough abyss
#

I'll see what I can do with a demo later

sullen sigil
#

this is a hardcoded limit for the rope version

tough abyss
#

Yep

sullen sigil
#

your version will almost certainly be better πŸ˜‚

#

though im still unsure how to wrangle a visual rope

tough abyss
#

My idea is

#

Normal rope but set up to retract in sync with the movement but without actually applying physx

#

So as to give the illusion of pulling

sullen sigil
#

that... makes quite a lot of sense tbh

tough abyss
#

I'd like to think that if I can make a portal gun I can make some climbing gear

sullen sigil
#

ooh ive just had an idea

#

i could rotate the pole 90 degrees

#

so the player is facing the direction of travel more or less

#

that could also be useful for your version

#

so you dont have to loop the player constantly rotating

tough abyss
#

I mean

#

setVelocityTransform will require a loop regardless

#

But not a bad idea

sullen sigil
#

my main issue is getting stuck against walls ngl

#

im unsure how to remedy that without doing something like aur does where you can "kick" off of it

#

which would just be setting the poles velocity in the opposite direction to the direction of travel i think

tough abyss
#

I'll experiment with some ideas

sullen sigil
#

actually i think i might just need a higher overhang tbh

tough abyss
#

Will probably do a periodic surface raycast to determine a surface normal of the climbing face from which to determine the ascension angle

sullen sigil
#

understanding that makes me feel smart

tough abyss
#

Which combined with an offset should keep the player from running into or being dragged through a wall

#

And good I'm glad you get it

sullen sigil
#

i think for all intents and purposes im going to call this version finished and not bother with any rotation or anything

#

will just fuck with offsets and then make my own grenade which doesnt explode or anything

#

just to check there's no easy way to find the muzzle of a gun's location is there

tough abyss
#

I mean

#

You can get the offset in the model

sullen sigil
#

thats not offset from the player is it though

tough abyss
#

But then applying that to get the actual position in the game requires some decently heavy vector math

#

Leopard has posted it before

sullen sigil
#

i think i'll just do it from the players belt line tbh

#

least fucking around with matrices and different muzzles

tough abyss
#

Whatever works for you

sullen sigil
#

unless the one leopard posted works for any gun

tough abyss
#

I believe it does from what I recall

sullen sigil
#

oh word

#

i think im going to stalk his 30k messages in this channel in that case then

#

can you remember how recent it was πŸ’€

tough abyss
#

Just look up matrixMultiply in messages sent by him

#

Not often that command comes up

sullen sigil
#

ah

#

5 results

#

i'd presume its the one from july this year

granite sky
#

Pretty sure he's posted that one multiple times :P

sullen sigil
#

every matrixmultiply message is different

#

i think this is what im looking for

#

onEachFrame scares me though

#

i genuinely have no clue what any of that means other than i'd want to use _p1 for the position

#

...but i suppose if i put that within the EH it wouldnt be too bad..?

granite sky
#

You don't need the onEachFrame there for your application, I think.

sullen sigil
#

i just have to do a whole lot of variable passing

granite sky
#

That code's drawing a 3d line persistently from the muzzle, I think.

tough abyss
#

Yes it is

#

You can chop off everything after p1 at the end

#

And get rid of the onEachFrame

#

Actually no you can't

#

Well... hm

#

Depends

#

If you need it to update consistently with the current muzzle pos then you still need it

sullen sigil
#

just needs to update whenever the EH is fired

tough abyss
#

But if you only need it once you're good without it

#

Alright then scrap it

sullen sigil
#

so just chop out the oneachframe bit?

granite sky
#

and the drawLine, yes.

tough abyss
#

And p2

#

P1 is the muzzle pos you want

sullen sigil
#
onEachFrame {
    _w = currentWeapon player;
    //update weapon info upon weapon switch
    if (_w != player getVariable ["last_weapon", "?"]) then {
        _cfg = configFile >> "CfgWeapons" >> _w;
        _m = getText(_cfg >> "model");
        //if (_m select [0,1] == "\") then {_m = _m select [1]};
        _o = createSimpleObject [_m, [0,0,0], true];
        _off = _o selectionPosition [getText(_cfg >> "muzzlePos"), "memory"]; 
        _off = _off apply {[_x]};
        deleteVehicle _o;
        player setVariable ["offset", _off];
        player setVariable ["last_weapon", _w];
        player setVariable ["proxy", 
            [
            "proxy:\a3\characters_f\proxies\pistol.001",
            "proxy:\a3\characters_f\proxies\weapon.001",
            "proxy:\a3\characters_f\proxies\launcher.001",
            "proxy:\a3\characters_f\proxies\binoculars.001"
            
            ] select (([1, 4, 4096] find getNumber(_cfg >> "type")) + 1)
        
        
        ];
    };
    _offset = player getVariable ["offset", []];
    _proxy = player getVariable ["proxy", ""];
    player selectionVectorDirAndUp [_proxy, 1] params ["_vy", "_vz"];
    _pos = selectionPosition [player, _proxy, 0];
    
    _vx = _vy vectorCrossProduct _vz;
    
    _mat = matrixTranspose [_vx, _vy, _vz];
    _pos = _pos vectorAdd flatten(_mat matrixMultiply _offset);
    
    _p1 = player modelToWorldVisualWorld _pos;
}```
#

where on earth is the drawline bit

#

oh wait i already chopped it

#

i have no clue where on earth this is going inside my code

granite sky
#

For god's sake make a function for it :P

sullen sigil
#

i absolutely refuse

#

actually thats probably a good idea for the errrrrrrrrrrrrrrrrrrrrrrr

#

EH things

granite sky
#

If they're long, sure.

sullen sigil
#

how do i create a function

sullen sigil
#

do i have to put it within a .cpp

#

im doing this all from debug console rn

tough abyss
#

Wait still

#

O_O

sullen sigil
#

yeah lol

#

ADT debug console is nice

tough abyss
#

Oh you're using that at least

granite sky
#

It even has tabs :P

sullen sigil
#

can fullscreen

#

ya

#

idk how you dont use it tbf

#

wait i can just call an sqf cant i

granite sky
#

yeah but it's slow if you didn't precompile it.

tough abyss
#

I use other text editors outside of the game

sullen sigil
#

i'll do it as calling an sqf for now and then i'll do it properly once i compile this all

tough abyss
#

Mostly notepad++ which is good enough for me 99% of the time

granite sky
#

I mostly use VSCode now but ADT does have better SQF support than any VSCode plugin I found.

sullen sigil
#

I use atom and it's a nightmare

#

ok so call new_2.sqf should call that function right

tough abyss
#

I like notepad++ because literally all it has is syntax highlighting and nothing else

sullen sigil
#

as does atom

#

but atom has dark mode

tough abyss
#

No linting no autocomplete no bloat

sullen sigil
#

idk if n++ does

tough abyss
#

Just me and my mistakes

#

It does

sullen sigil
#

ah

hallow mortar
sullen sigil
#

yeah i'll do that once its working fine

#

im still working from debug console atm

#

Script new_2.sqf not found fml

granite sky
#

I'm not sure where ADT sqfs are located in the path.

hallow mortar
#

If you want to execVM an sqf file it must be located within the mission folder. If it's in a subfolder you have to include that in the file path.

sullen sigil
#

it doesnt seem to be returning _p1 to the script i dont think

granite sky
#

If you want it to return _p1, just put _p1; on the last line.

sullen sigil
#

i think it may be because im not creating the rope to an object but just coordinates

#

that is in fact what it was

#

i cant actually tell if its coming from the muzzle or not

#

the rope is present for such a short period of time atm

#

im also unsure if that script works for GLs πŸ˜…

granite sky
#

If you can't tell then it's good :P

sullen sigil
#

in third person camera it looks like its coming from the center of the player

#

i just pass _p1 down the event handlers now dont i

#

or should i recall the function for the sake of if the player has turned a bit

#

yeah that's definitely not the muzzle position πŸ˜…

little raptor
sullen sigil
#

thats with regular bullet too so idk why that wouldnt work

little raptor
#

those are just fake files

sullen sigil
#

hi leopard we are using your amazing matrices

#

(i cannot figure out how it works)

little raptor
sullen sigil
#

will it not work with execVM

little raptor
#

it has to be called

sullen sigil
#

that'd be why then πŸ˜…

#

time to actually do something

little raptor
#

plus you're gonna be calling that a lot

#

so it has to be precompiled

sullen sigil
#

only twice in this instance

#

as you can just attachto the player with the current offset when the helper part for pulling the player is created

#

therefore no requirement to check when youre moving it

little raptor
#
params ["_unit"];
_w = currentWeapon _unit;
    //update weapon info upon weapon switch
    if (_w != _unit getVariable ["last_weapon", "?"]) then {
        _cfg = configFile >> "CfgWeapons" >> _w;
        _m = getText(_cfg >> "model");
        //if (_m select [0,1] == "\") then {_m = _m select [1]};
        _o = createSimpleObject [_m, [0,0,0], true];
        _off = _o selectionPosition [getText(_cfg >> "muzzlePos"), "memory"]; 
        _off = _off apply {[_x]};
        deleteVehicle _o;
        _unit setVariable ["offset", _off];
        _unit setVariable ["last_weapon", _w];
        _unit setVariable ["proxy", 
            [
            "proxy:\a3\characters_f\proxies\pistol.001",
            "proxy:\a3\characters_f\proxies\weapon.001",
            "proxy:\a3\characters_f\proxies\launcher.001",
            "proxy:\a3\characters_f\proxies\binoculars.001"
            
            ] select (([1, 4, 4096] find getNumber(_cfg >> "type")) + 1)
        
        
        ];
    };
    _offset = _unit getVariable ["offset", []];
    _proxy = _unit getVariable ["proxy", ""];
    _unit selectionVectorDirAndUp [_proxy, 1] params ["_vy", "_vz"];
    _pos = selectionPosition [_unit , _proxy, 0];
    
    _vx = _vy vectorCrossProduct _vz;
    
    _mat = matrixTranspose [_vx, _vy, _vz];
    _pos = _pos vectorAdd flatten(_mat matrixMultiply _offset);
    
    _p1 = _unit modelToWorldVisualWorld _pos;
  _p1
#

that's the function version meowsweats

#

be sure to private the vars...

sullen sigil
#

private within the function right

little raptor
#

and fix the tabs...

sullen sigil
#

or private within my sqf

#

or both

little raptor
#

function

sullen sigil
#

all variables should be private right

#

except _p1?

boreal parcel
#

a script im attempting to use makes use of a custom made extension, I have the dll but how would I install it?

little raptor
sullen sigil
#

roger

little raptor
#
@MyExtensionMod
 |
 |__myExt.dll
sullen sigil
#

this should work for GL's right

little raptor
#

no

boreal parcel
sullen sigil
#

uh oh

little raptor
#

it doesn't take the muzzles into account

sullen sigil
#

either way still looks better than being dragged from the waist

granite sky
#

You could always just fire from the eyepos :P

boreal parcel
little raptor
#

no don't mess with that folder

#

just create a watched folder in launcher

boreal parcel
#

ohh ok

little raptor
sullen sigil
#

i feel like ive done my config wrong but oh well

#

i have indeed

#

oh i just didnt put the right filename nvm

boreal parcel
# little raptor

i've done that and tried adding a local mod but get this error, There are no PBO's EBOs in the addons folder inside the mod folder, first time it was the addons folder was missing. it should load automatically if I just put the dll in the root arma installation folder right?

sullen sigil
#

christ im an idiot jfc

winter rose
#

wrong dir, hey?

sullen sigil
#

i dont know.

winter rose
#

then why do you say you're an idiot if you do not know the source of the issue?

sullen sigil
#

because i dont know the source of the issue 😎

winter rose
#

not knowing is different from effin' up blobdoggoshruggoogly

sullen sigil
#
class CfgFunctions {
    class KJW {
        class functions {
            class findMuzzleLoc {};
        };
    };
};
``` 🀷
winter rose
#

but
if that's for a mission, your shown directory wasn't a mission directory

sullen sigil
#

with fn_findMuzzleLoc.sqf inside a folders function

#

with config here 🀷

winter rose
#

that's a mod, right? not exactly scripting
also mods don't look up into functions\

sullen sigil
#

it will be scripting again once ive got this function coming up properly

sullen sigil
#

i am

winter rose
sullen sigil
#

is the category bit not referring to a folder

#

or is it an internal thing

winter rose
#

I do not get this question.

sullen sigil
#

what does category refer to there

#

is it referring to a folder named category

sullen sigil
#

or is it just to organise your functions in the config

winter rose
#

I mean, it is colour-coded for a reason πŸ™‚

sullen sigil
#

i dont know what the colours mean

hallow mortar
#

they match the ones in the other example

sullen sigil
#

im so confused

winter rose
#

hi so confused, I'm dad!

hallow mortar
#

the game will look for a subfolder with the same name as the Category layer in the CfgFunctions

sullen sigil
#

what is Category in terms of how it appears within the mod folder

#

so if ive named if functions it should look for a folder named functions, right...?

winter rose
#

if you writecpp class CfgFunctions { class MY_TAG { class TheCategory { class theFunctionName {}; }; }; }; the game will look into<root>\TheCategory\fn_theFunctionName.sqf

sullen sigil
#

yeah thats what ive done

winter rose
#

no

#

you made a functions\ parent dir

#

wait, your category is "functions", so it's OK

sullen sigil
#

yeah lol

winter rose
#

and inside it?

sullen sigil
#

fn_findMuzzleLoc.sqf

winter rose
#

yep, should work

sullen sigil
#

let me double check i updated the pbos one moment

boreal parcel
# little raptor yes

I dont believe you 😭

17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
17:58:01 CallExtension 'ConfigDumpFileIO' could not be found
#

is there any settings I need to enable to allow the loading of the dll?

hallow mortar
sullen sigil
#

its the config bit not mission folder

winter rose
winter rose
sullen sigil
#

leopard says it doesnt work like that

#

he said it needs to be called and im too dim to do that without cfgfunctions

hallow mortar
#

You can have cfgFunctions in a mission, it's not only for mods

#

You define it in description.ext

winter rose
#

CfgFunctions does not require an addon yeah o_o

sullen sigil
#

either way arma is loading up again now so we will see

winter rose
sullen sigil
#

im allergic to descriptions

winter rose
#

describe your symptoms

sullen sigil
#

ok yeah the error message is still coming up after i repacked the pbos too

sullen sigil
winter rose
#

good, the end is near

#

ANYWAY
make it a mission function, no time to make an addon tonight

sullen sigil
#

yes i shall do that now

#

try to do that now

hallow mortar
#

It's largely the same as what you already have, so it shouldn't be too difficult

sullen sigil
#

for when it inevitably doesnt work

#

christ bringing _unit down to where it needs to be exec again is a nightmare

winter rose
#

stop breaking things

sullen sigil
#

it does not work

#

it now teleports me to the impact position

#

which i think is because of the rope rather than the function

#

yeah _p1 just seems to be returning the players location rather than their muzzle for some reason @little raptor

#

creating a pole at _p1 with can_collide and it just seems to be doing it at the players location

winter rose
sullen sigil
#

unless i need to private all of the _vy and _vz too

#

i think i do

#

probably

winter rose
#

yes, of course.

sullen sigil
#

_unit selectionVectorDirAndUp [_proxy, 1] params ["_vy", "_vz"]; does it matter that theyre in a string here too

winter rose
#

they are auto-privated

sullen sigil
#

or can i just do "private _vy" etc

#

leopard said i should stick private in front of every variable where it first appears so 🀷

copper raven
#

no, that's not allowed

sullen sigil
#

is that what would be breaking it

copper raven
#

params are implicitly private anyway

winter rose
#

every declaration yes

sullen sigil
#

ok i think ive done that then so

winter rose
sullen sigil
#

i should be using _unit call KJW_fnc_new_2; -- i.e the _unit part, right?

#

it has params ["_unit"]; at the top of the sqf so

winter rose
#

no problem with that

sullen sigil
#

hmmmm

#

this is quite odd

sullen sigil
#
params ["_unit"];
private _w = currentWeapon _unit;
    //update weapon info upon weapon switch
    if (_w != _unit getVariable ["last_weapon", "?"]) then {
        private _cfg = configFile >> "CfgWeapons" >> _w;
        private _m = getText(_cfg >> "model");
        if (_m select [0,1] == "\") then {_m = _m select [1]};
        private _o = createSimpleObject [_m, [0,0,0], true];
        private _off = _o selectionPosition [getText(_cfg >> "muzzlePos"), "memory"];
        _off = _off apply {[_x]};
        deleteVehicle _o;
        _unit setVariable ["offset", _off];
        _unit setVariable ["last_weapon", _w];
        _unit setVariable ["proxy",
            [
            "proxy:\a3\characters_f\proxies\pistol.001",
            "proxy:\a3\characters_f\proxies\weapon.001",
            "proxy:\a3\characters_f\proxies\launcher.001",
            "proxy:\a3\characters_f\proxies\binoculars.001"

            ] select (([1, 4, 4096] find getNumber(_cfg >> "type")) + 1)


        ];
    };
    private _offset = _unit getVariable ["offset", []];
    private _proxy = _unit getVariable ["proxy", ""];
    _unit selectionVectorDirAndUp [_proxy, 1] params ["_vy", "_vz"];
    private _pos = selectionPosition [_unit , _proxy, 0];

    private _vx = _vy vectorCrossProduct _vz;

    private _mat = matrixTranspose [_vx, _vy, _vz];
    _pos = _pos vectorAdd flatten(_mat matrixMultiply _offset);

    private _p1 = _unit modelToWorldVisualWorld _pos;
  _p1
``` theres the code being used
winter rose
#

rhaaa, sqfbin :<

#

anyway ^^

sullen sigil
#

_p1 seems to just be returning the unit after checking with systemchat

#

theres the sqfbin if you want it

winter rose
little raptor
winter rose
#

(additionally, no need to create a temp var)

sullen sigil
#

i think its doing it before the maths is done tbh

#

idk if thats possible im dumb

#

7 meters ATL 🀨

little raptor
#

what is that?

sullen sigil
#

systemchat str _p1; at the end of the function

little raptor
#

if that's _p1 it's ASL

#

not ATL

sullen sigil
#

ah

little raptor
#

you might want to forget about ATL completely

#

stick with ASL

sullen sigil
#

2m high wall, getposasl player is ~5m high so

#

muzzle calc seems to be right

#

just isnt coming across to the script properly πŸ€”

winter rose
#

@sullen sigil safety & health reminder:
if you are exhausted, are forcing/dragging yourself through scripting,
make a pause, come back with a fresh mind!

sullen sigil
#

i just had a glass of milk

#

the weird thing is it returning the players name when done in the main script

#

rather than the coordinates before

#

is it possible that the maths for the function isnt completed by the time it does the next line of code

little raptor
#

depends how you run it

sullen sigil
#

...alternatively the pole is just falling back down

winter rose
#

you may have another systemChat or hint or anything elsewhere, too

sullen sigil
#

no im calling the function twice

little raptor
#

anyway, just show the whole code

#

I can't tell what's wrong

sullen sigil
#

too long for clyde to let me send

sullen sigil
little raptor
#

params ["_p1"];
that's undefined

#

_unit call KJW_fnc_new_2;
return is not stored

sullen sigil
#

im confused

little raptor
#

_entity getVariable ["_theUnit",0];
...

#

default value for objects should be objNull not 0

sullen sigil
#

i'll pretend i knew that all along

#

how do you store the return in this instance then

#

does having _p1 at the end not return it

little raptor
#

_p1 = _unit call KJW_fnc_new_2;

sullen sigil
#

bruh moment

#

judging by the fact thats all above the ground im going to say that works

#

however its pulling by the crotch/feet still for the actual connection πŸ€”

boreal parcel
sullen sigil
#

thats a bit high

#

uhhh

boreal parcel
# little raptor how do you call it?

sorry meant to include that as well, using the example it provides
[configFile >> "CfgVehicles"] call compile preprocessFileLineNumbers "dumpConfig.sqf"

little raptor
#

did you wait for the script to finish?

boreal parcel
#

I mean I think so? I loaded up the mission and threw it in the debug console and hit local exec, thats what it copied to my clipboard

little raptor
#

I guess it's broken then?

#

it's kinda old

boreal parcel
#

yeah, the bohemia wiki links to it though

#

big sad

#

any chance you know of a script that will allow me to dump configs like that?

little raptor
#

have you tried the ingame utils?

boreal parcel
#

whats that?

little raptor
#

in vanilla debug console type utils and exec

sullen sigil
#

i think physx is probably messing this up a fair bit tbh

boreal parcel
#

uh ive got the extended debug console, how do I use the vanilla one?

sullen sigil
#

player falling galore

winter rose
boreal parcel
little raptor
#

anyway you didn't say what was wrong with the dll

#

just disable battleEye and make sure the exe platform matches the dll

#

and it will load

winter rose
boreal parcel
boreal parcel
sullen sigil
#

i shall be conceding defeat to physx in this instance

boreal parcel
winter rose
winter rose
#

I am going to fix that page, thanks

boreal parcel
#

lol alright ill give that a shot, no problem

little raptor
#

(again with battleEye disabled)

boreal parcel
little raptor
#

well that one will definitely work but you need to DL the dev branch

boreal parcel
#

just a 530mb update, better than the 70 game restarts I have had to do because the script infinite loops the cant find extension error etc

sullen sigil
#

right now does anyone know how to allow at least free look on a player attached to an object

winter rose
#

negative

little raptor
#

not possible

sullen sigil
#

sadness

little raptor
#

use setVelocityTransformation each frame meowsweats

sullen sigil
#

i think root is going to have a punt at making a more true to the series version of what im making

#

(walking up walls supported by ropes)

#

im just making poor mans version

boreal parcel
little raptor
#

how would I go about loading mods?
command line
where is O:/config.cpp
some path on your PC where you want the dump

boreal parcel
little raptor
#

/config.cpp
must be backward slash

#

%2eB
I doubt Arma supports that

boreal parcel
#

pretty sure arma literally did that to my profile

#

since it was a period

little raptor
#

just try:

C:\Users\Thatguy553\Documents\Arma 3 - Other Profiles\config.cpp
boreal parcel
little raptor
#

just make a batch file

#

example:

"C:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3diag_x64.exe" -malloc=tbbmalloc_x64 -nofreezecheck -noSplash -enableHT -hugePages -world=VR "-mod=C:\Program Files (x86)\Steam\steamapps\common\Arma 3\!Workshop\@CBA_A3;"
#

you can run the normal exe using the launcher first

#

then use Process Explorer to get the command line args

#

then put them in a bat

sullen sigil
#

does setVelocityTransformation have to be run on each frame or can you just run it once

little raptor
#

if you want to simulate "attaching" each frame

sullen sigil
#

what if i just want to fucking yeet the player

little raptor
#

depends how you want to "yeet" him

#

for normal "yeeting" a simple setVelocity will work

sullen sigil
#

what about for a special yeeting

little raptor
#

setVelocityTransformation every frame

sullen sigil
#

tbf i think using setVelocityTransformation would be 100x better than what ive done so far

#

i'll see what roots demo looks like before using any more of my brainpower on this

ocean folio
#

Is #include "\AJ_PylonManager\defines.hpp" not possible?

#

I've read a few conflicting things on the forums about it

winter rose
ocean folio
#

config edits.... guess I didnt quite understand the description πŸ˜…

echo swan
#
{
 sounds[] = {};
 class song
 {
  name = "song";
  sound[] = {"\sounds\song.ogg", 15, 1};
  titles[] = {0,""};
 };
};

class pooper
 {
  name = "pooper";
  sound[] = {"\sounds\pooper.ogg", 15, 1};
  titles[] = {0,""};
 }; ```
#

i cant put more then 2 custom sounds into a mission

#

if i put a third one it just doesnt work

stable dune
#

You are closing cfgsounds at class song.
All classes must be in class cfgSounds

cfgSounds {
 sounds []={};
 class song {
 };
class pooper {
 };
class your3rdName {
 };
};
#

@echo swan πŸ‘†

echo swan
#

everytime i add a sound

#

i put class your3rdName {
};

#

every time correct

stable dune
#

Yeah, but in your example you close {} cfgSounds before next sounds

echo swan
#
 sounds []={};
 class song {
 };
class pooper {
 };
class ANIMAL {
 };
class hecucom {
 };
};```
#

@stable dune is this correct at all?

warm hedge
#

Yes

echo swan
#

ty

#

@stable dune doesnt work man

#

im trying to put this into my description.ext

warm hedge
#

If it doesn't work, show us it

stable dune
echo swan
#
 sounds []={};
 class song {
 };
class pooper {
 };
class ANIMAL {
 };
class hecucom {
 };
}; ```
warm hedge
#

Is this what you have in your description.ext?

echo swan
#

yes

stable dune
#

And you need paste your

{
name =
sound[] =
titles[] =
};
warm hedge
#
  1. You need class before CfgSounds
  2. What prisoner says, you need to fill the actual data inside song pooper ANIMAL hecucom
echo swan
#
{
 sounds[] = {};
 class song
 {
  name = "song";
  sound[] = {"\sounds\song.ogg", 300, 1};
  titles[] = {0,""};
 };
};

class chatter
 {
 name = "chatter";
 sound[] = {"sound\chatter.ogg", 300, 1};
 titles[] = {0,""};
 };
} ```
#

i got this to work

#

but it only allowed two

#

custom audio files

warm hedge
#

Again you need to put every sound classes into CfgSounds

echo swan
#

how would i go along doing that im not script savvy

warm hedge
#

Socpp class CfgSounds { sounds[] = {}; class song { name = "song"; sound[] = {"\sounds\song.ogg", 300, 1}; titles[] = {0,""}; }; class chatter { name = "chatter"; sound[] = {"sound\chatter.ogg", 300, 1}; titles[] = {0,""}; }; };

echo swan
#

how would i be able to get a third one in by chance

warm hedge
#
class CfgSounds
{
    sounds[] = {};
    class song
    {
        name = "song";
        sound[] = {"\sounds\song.ogg", 300, 1};
        titles[] = {0,""};
    };
    class chatter
    {
        name = "chatter";
        sound[] = {"sound\chatter.ogg", 300, 1};
        titles[] = {0,""};
    };
    class ThirdOne
    {
        // put what you want
    };
};```
echo swan
# warm hedge ```cpp class CfgSounds { sounds[] = {}; class song { name = ...
{
    sounds[] = {};
    class song
    {
        name = "song";
        sound[] = {"\sounds\song.ogg", 300, 1};
        titles[] = {0,""};
    };
    class chatter
    {
        name = "chatter";
        sound[] = {"sound\chatter.ogg", 300, 1};
        titles[] = {0,""};
    };
    class hecucom
    {
        name = "hecucom";
        sound[] = {"sound\hecucom.ogg", 300, 1};
        titles[] = {0,""};
    };
}; ```
#

?

warm hedge
#

Yes

echo swan
#

alr

#

i copy from here

#

class hecucom
{
name = "hecucom";
sound[] = {"sound\hecucom.ogg", 300, 1};
titles[] = {0,""};
};

#

right

#

if i want a fourth

stable dune
#
.....
    class hecucom
    {
        name = "hecucom";
        sound[] = {"sound\hecucom.ogg", 300, 1};
        titles[] = {0,""};
    };
// New class here before last } , which close cfgSounds
class 4soundName {
        name = "4sound";
        sound[] = {"sound\4sound.ogg", 300, 1};
        titles[] = {0,""};
    };
};
#

@echo swan πŸ‘†

torn elm
#

When I made a script and put it into addon builder(successfully). I tested in game and no rpt file errors but clearly it wasn’t working? Is there a fix?

warm hedge
#

Always tell us details. What did you do, how did you done, what it supposed to do

torn elm
warm hedge
#

Let me rephrase: post the entire code and config

fierce loom
#
    _unit = _this select 1;
        removeAllWeapons unit;
        removeAllItems unit;
        removeAllAssignedItems unit;
        removeUniform unit;
        removeVest unit;
        removeBackpack unit;
        removeHeadgear unit;
        removeGoggles unit;

        _unit addWeapon "sp_fwa_ar15_603_m16a1";

        _unit forceAddUniform "U_simc_bdu_eto_gas_blench";
        _unit addVest "V_Simc_vest_pasgt_alice_lc2";
        _unit addBackpack "B_simc_US_ALICE_asspack_sekop";

        _unit addItemToUniform "ACE_fieldDressing",4;
        _unit addItemToUniform "ACE_elasticBandage",2;
        _unit addItemToUniform "ACE_quikclot",2;
        _unit addItemToUniform "ACE_EarPlugs",1;
        _unit addItemToUniform "ACE_CableTie",2;
        _unit addItemToUniform "ACE_MapTools",1;
        _unit addItemToUniform "ACE_Flashlight_MX991",1;
        _unit addItemToUniform "ACE_tourniquet",2;
        _unit addItemToUniform "US_Facepaint",1;
        _unit addItemToUniform "H_Simc_Boon_m81_2",1;
        _unit addItemToUniform "kat_Painkiller",1,10,1;
        _unit addItemToVest "sp_fwa_30Rnd_556_Armalite_Ball",7,30;
        _unit addItemToVest "rhs_mag_m67",3,1;
        _unit addItemToVest "SmokeShell",1,1;
        _unit addItemToVest "SmokeShellYellow",1,1;
        _unit addItemToVest "SmokeShellRed",1,1;
        _unit addItemToVest "SmokeShellBlue",1,1;
        _unit addItemToVest "ACE_Canteen",1;

        _unit linkItem "ItemMap";
        _unit linkItem "ItemCompass";
        _unit linkItem "ItemWatch";
            }, [], 6, false, true, "", "", 5]] remoteExec ["addAction", 0, true];```
This is for a scroll wheel menu loadout giver. When I use the loadout, it says I have an undefined variable in expression. Where is it and what do I change to fix it
torn elm
fierce loom
#

Also, I can access my loadout giver object's scroll menu from way too far away, how do I limit the range

warm hedge
torn elm
#

Not sure exactly what’s wrong on my config or my function

warm hedge
#

Then post both

torn elm
#

Okay

warm hedge
fierce loom
#

Man I'm just copy pasting this from somewhere, idk. Is that supposed to be different

warm hedge
#

The error should tell

fierce loom
#

it says the undefined variable is loadout

warm hedge
#

Okay I just read your script carefully, there're the flaws:

  1. loadOut is undefined. Is this supposed to be an unit or an ammobox?
  2. _this select 1 is undefined so _unit is. You probably want to rename it _target
  3. unit is undefined. See 2
  4. _unit addItemToUniform "ACE_fieldDressing",4; is wrong syntax. You need to wrap it into an array so _unit addItemToUniform ["ACE_fieldDressing",4];. Same to others
torn elm
#

all my lines of code will fill this so i would not like that lol. i could just take pic of it then send it here

fierce loom
#

I found another method that works much better

#

I get the arsenal output, and paste it on its own into an sqf, replacing all uses of "this" with "player"

#

Then I just put this in the giving object's init this addAction ["Loadout Name", "LoadoutFilename"];

#

ez

torn elm
#

i found my error, i didnt define a variable in the end of my function πŸ˜†

winter rose
torn elm
winter rose
#

np - & glad you found out the issue πŸ™‚

copper nova
#

Hi, how can I add uniforms to a vehicle inventory?
There is no addUniformCargoGlobal. But does this work with addItemCargoGlobal?

winter rose
#

ye

copper nova
#

πŸ‘

drifting portal
#

Is there a way to get rid of the vignette associated with cutRsc?

winter rose
#

there is one only if it is defined?

warm hedge
#

A vignette is an image

winter rose
#

I mean, what do you spawn, what do you see

#

a vignette effect is a control indeed

drifting portal
#

The black border around the screen is what I meant by vignette

winter rose
#

thank you

drifting portal
#

always welcome sir

drifting portal
winter rose
#

RscTitleDisplayEmpty has a vignette effect defined in it (which you can find and remove)

drifting portal
#

How do I check its config?

winter rose
#

the… Config Viewer? 😁

manic sigil
#

If vehicleNameHere emptyPositions "" returns 0, is it safe to assume the vehicle has not been set up properly? Getting weird numbers from the SOGPF vehicles :/ im assuming because the "" variant was added only in 2.10, but Im not sure.

winter rose
manic sigil
#

Nope, pilot only.

#

"" returns 0, gunner returns 1 (right gun on the UH1C), commander returns 0 despite being the left gun... cargo works, returning 7, but not cargoFFV/cargonoFFV, which were also late additions to the command.

#

Kinda screwed with my crew spawning script when it was asked to make -7 units t_t

winter rose
#

lul! πŸ˜„

#

what's wrong with createVehicleCrew, you also want to fill cargo seats?

manic sigil
#

Im doing a workaround with createVehicleCrew, but I want to make it immersive rather than just immediately appearing in the vehicle, which I had sorta down, just need to figure on ordering them to get back IN when I teleport them.

upper tartan
#

Hey guys I have no experience with SQF but was looking to get all CfgX class and display names. This is what I have so far

manic sigil
#

Nothing wrong with it, just kinda abrupt when I also have a complement of troops who appear and climb in as cargo already :p

upper tartan
#
" getNumber (_x >> 'scope') >= 2 " configClasses (configFile >> "CfgWeapons") apply {configName _x};
 

"getNumber (_x >> 'scope') >= 2" configClasses (configFile >> "CfgVehicles") apply {getText (_x >> "displayName")}
upper tartan
#

I want to create a filter to block certain items

upper tartan
#

However I want them to be outputted in pairs i.e. className, displayName

winter rose
#

(well, if you want classnames, don't use displayName ofc)

upper tartan
#

I'm unsure how to get this to work

delicate lotus
#

Do text, icons, shapes, etc. I draw with drawIcon on the main map automatically appear on the GPS map, UAV map and Artillery Computer map too?

#

Currently I am trying to choose whether I implement a BLUFOR tracker using either local markers or drawIcons. Markers probably appear everywhere but not sure about drawIcon and related commands.

winter rose
upper tartan
#

Oh thats the syntax

#

Ty for taking your time to help me man πŸ’“

winter rose
#

❀️ πŸ‘

#

if you need further assistance, the channel is open anytime!

upper tartan
#

I hate to be annoying but how would I add extra configs, would it be like this ?

configFile >> "CfgWeapons" >> "CfgVehicles"
winter rose
#

nonono ^^

#
private _cfgWeaponsClassAndDisplayName = "getNumber (_x >> 'scope') > 1" configClasses (configFile >> "CfgWeapons") apply { [configName _x, getText (_x >> "displayName")] };

private _cfgVehiclesClassAndDisplayName = "getNumber (_x >> 'scope') > 1" configClasses (configFile >> "CfgVehicles") apply { [configName _x, getText (_x >> "displayName")] };
#

so you have two arrays, as to not mix them

tough abyss
#

Think of >> like being slashes in a file path when it comes to configs

#

configFile >> CfgAmmo >> MyAmmo is a bit like accessing configFile/CfgAmmo/MyAmmo

upper tartan
#

I see

tough abyss
#

Thereby it's required that MyAmmo be within CfgAmmo if it's listed after it with a >>

winter rose
tough abyss
#

CfgWeapons >> CfgVehicles is like trying to do CfgWeapons/CfgVehicles which makes no sense as CfgVehicles is not within CfgWeapons

#

Does it? Interesting

winter rose
#

it is recommended to use >> for it is dedicated and a bit faster (as / tries to determine if it is a division or a config access first)
but it's, like, very minor, man

upper tartan
#

Also where are soldier configs stored?

winter rose
#

CfgVehicles

#

(yeah, I know)

upper tartan
#

Right our bodies are vehicles for our souls 🀣

tough abyss
#

People are vehicles don't worry about it

winter rose
#

there is a isMan = 1 config flag iirc

tough abyss
#

Can you crew a unit with other units thonk

winter rose
#

stahp

tough abyss
#

Hey what's wrong with wanting some backup in my backpack

winter rose
#

although I guess with some config… perhaps

manic sigil
#

... well, if a player sitting in a car is already a vehicle in a vehicle, and a player sitting in another player's backpack would be a vehicle in a vehicle... can we get CS:GO deathstacks? :D

tough abyss
sullen sigil
winter rose
#

I can do the helicopter

tough abyss
#

Turn a unit into a helicopter and have their neck bone rotate with an engineRPM controller πŸ˜†

sullen sigil
#

omg yes

tough abyss
#

Ah yes

sullen sigil
#

nearly finished the ascension cable 😎

winter rose
#

next step: make an addon out of it πŸ˜›

sullen sigil
#

will do once 2.10 comes out

#

but im going to experiment with whatever root said yesterday

#

the better way of doing it

frank mango
#

Yes. that needs to happen ❀️
I need proper flying tanks!

sullen sigil
#

im still tempted to setposatl every frame

#

just because funny

#

ok actually ive found a bug

#

its not disconnecting the player from the pole sometimes when you take a while getting up for whatever reason

umbral patio
#

hi , i want ban a client from my admin menu but my script is broken i think

#

in my life server

#

`_uid = _this select 0;
_reason = _this select 1;
if !(isServer) exitWith {};
_passwordWasOK = "monmdp";

_passwordWasOK serverCommand format ["#ban %1 %2",_uid, _reason];`

#

in my script client

#

`#include "....\script_macros.hpp"
if (FETCH_CONST(life_adminlevel) < 4) exitWith {closeDialog 0;};

private _target = lbData[2902,lbCurSel (2902)];
_target = call compile format ["%1", _target];

[getPlayerUID _target, "Cheat TEST"] remoteExecCall ["TON_fnc_serverCommands", RSERV];`

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
winter rose
#

and we need the encountered error

umbral patio
#

My script does nothing...

#

i have chek my logs but ... nothing

winter rose
#

#ban requires quotes around the id

sullen sigil
#

you want it to look like this within the script

umbral patio
#

@sullen sigil like this _passwordWasOK serverCommand format ["#ban ""%1"" %2",_uid, _reason]; ?

winter rose
#

ye

umbral patio
#

not working but i dont no why lol , i check my logs but nothing

winter rose
#

if !(isServer) exitWith {};

sullen sigil
#

put a systemchat in somewhere before the ban command is run

winter rose
#

"if I am not the server, I don't do anything"
"hey, I will remoteExec something on the server"

*meeeeeep* logic error spotted!

umbral patio
#

lolllllllllll

winter rose
#

well not really, these two are separate scripts, mb

#

but yeah, check your values

umbral patio
#

yes im cheking

sullen sigil
#

how can i be so shit at using my own ascension cables πŸ’€

#

right now time to stalk roots messages to remember what the scripting command was

umbral patio
#

I need to add () for the format?

#

serverCommand (format ["#ban ""%1"" %2",_uid, _reason])

#

maybe ?

winter rose
#

no

sullen sigil
#

it is meant to be an array isnt it

#

i suppose it'd pass expected string or something if it wasnt nvm

winter rose
#

try to check if _target is defined, too

umbral patio
#

private _target = lbData[2902,lbCurSel (2902)];

winter rose
#

yeah

#

check its value

#

and check also what you get when you call compile it

#

I also hope you develop with the -showScriptErrors flag to see script errors πŸ‘€

umbral patio
#

what is -showScriptErrors ? lol

sullen sigil
#

bruhhhhhhh

winter rose
#

in the launcher's advanced options, there is a "show script errors" checkbox - it… shows script errors

sullen sigil
#

my script isnt showing errors
doesnt have script errors enabled

umbral patio
#

ahhhhh yes i have

winter rose
#

…good πŸ˜„

sullen sigil
#

i wonder if i could detect the height of an object above the nearest one below it then cut the rope when the player is ~2m above that height πŸ€”

#

can the players velocity be impacted when using setVelocityTransformation by outside sources

#

say, a short rope

umbral patio
#

<[getPlayerUID player, "Cheat TEST"] remoteExecCall ["TON_fnc_serverCommands"> 15:15:07 Error position: <remoteExecCall ["TON_fnc_serverCommands"> 15:15:07 Error Type Any, expected Number, Side, Object, Group, String 15:15:07 βž₯ Context: [] L1 () ?

tough abyss
#

@sullen sigil it can't be affected by outside sources unless the parameters of setVelocityTransformation update

#

Since it's just linear interpolation between two states

sullen sigil
#

ok so if i were to have the rope stretched it wouldnt pull the player any faster right

tough abyss
#

Also if you want the height of an object over the next one below it, that is the purpose of positionAGLS and one of the only cases where using getPos is good

#

As the Z axis value of getPos is the height above the nearest below surface

#

And correct

sullen sigil
#

hmmmmm

#

i think i wont make any further modifications to how the script works right now

#

on the second version i'll make it a bit more advanced prob

desert socket
#

this is supposed to teleport me onto an inivisible helipad which is in a building above ground level, but it teleports me onto ground level under the helipad.

Condition: this && (player in thislist)

OnActivation: player setPos (getPos scpFacility);

open fractal
desert socket
#

I'll try that and let you know

open fractal
#

setPos and getPos are different formats

desert socket
#

Thank you, it's fixed!

sullen sigil
#

what on earth is up vector for setVelocityTransformation

granite sky
#

Whatever you want it to, as long as it's orthogonal to the forward vector.

sullen sigil
#

idk what that means

granite sky
#

What's the object?

sullen sigil
#

a player

granite sky
#

probably fine: _fwdvec vectorCrossProduct [0,0,1] vectorCrossProduct _fwdvec

sullen sigil
#

that looks confusing and complicated

#

what does it do

granite sky
#

Do you know what a cross product is?

sullen sigil
#

negative

granite sky
#

That's generally a couple of math classes so I'm not going into that :P

sullen sigil
#

roger doger

#

i set it to just some random value instead but the setvelocitytransformation doesnt seem to be doing anything

granite sky
#

but a cross product will give you a vector that's perpendicular to the two input vectors.

#

So _fwdvec vectorCrossProduct [0,0,1] will give you a side vector, and then crossing that again with _fwdvec gives you a valid up vector.

sullen sigil
#

ah yes words that i understand

#

i think i get a vague idea of what it is

#

so do i just shove _fwdvec vectorCrossProduct [0,0,1] into fromVectorUp

#

and then the other part into toVectorUp

granite sky
#

Is your forward vector the same at the start and end?

sullen sigil
#

i want the player to move with momentum if thats what youre asking

granite sky
#

no, I mean fromVectorDir and toVectorDir.

sullen sigil
#

no but i dont know if that is correct

#

im trying to launch the player towards the impact of their projectile basically

#

but i think this understanding of maths is beyond my skill level

granite sky
#

Simple version is just _vectorDir = _startPosASL vectorFromTo _endPosASL

sullen sigil
#

i have positions for the player and the impact of the projectile as variables

#

oh wait i want the vectordir to be the same dont i

#

ok theyre the same but im still not getting launched

#

hmmm

#

it seems to do something if i fire the projectile when not stationary

#

yeah it just moves me a bit very fast

#

i dont think ive got the maths right here

#

player setVelocityTransformation [_playerPos, _entityPos, (velocity player), (velocity player), (_playerPos vectorFromTo _entityPos), (_playerPos vectorFromTo _entityPos), [0,0,100], [0,0,0], moveTime player]; is the command im using

#

where _playerPos is getPosATL player and _entityPos is the getPosATL of the projectiles impact

#

im just doing 100 so i can actually notice if it does anything

granite sky
#

It's probably ignoring it anyway :P

#

velocity player is not what you want here anyway

#

and moveTime player almost certainly isn't either

#

And whole usage is probably wrong

sullen sigil
#

i'll sqfbin the entire thing one moment πŸ˜…

#

the indentation is probably a bit funky but oh well

granite sky
#

yeah no

#

setVelocityTransformation only sets the position once per call, so the normal usage is to prepare the array (aside from the interval value) and then call setVelocityTransformation in an eachFrame mission event handler where you gradually adjust the interval from 0 to 1.

sullen sigil
#

this sounds confusing

granite sky
#

It's not exactly the easiest thing in Arma script.

sullen sigil
#

just to check i do need to be using setVelocityTransformation right

#

due to it going to a projectiles impact

#

which could be anywhere within 100m

granite sky
#

shrugs

#

setVelocityTransformation is certainly a tool you can use for this.

#

but it takes some work.

sullen sigil
#

will the oneachframe not kill performance

granite sky
#

nah, Arma does a lot of things each frame.

#

It's why you should pre-prepare the array though.

sullen sigil
#

pre-prepare meaning define all the variables beforehand so its not having to redefine each frame?

granite sky
#

Well, you can actually build the whole array and pass it into the eachFrame handler

#

Other than interval, which you need to change each frame.

sullen sigil
#

i think i understand

#

im unsure what i actually want within the array though

#

or is what ive done correct just incorrect usage of the command

granite sky
#

well, the velocity, upVector and interval there are wrong too.

#

For velocity you want something like fwdVector * desired speed

sullen sigil
#

and thats the same for them both right

#

how do i get the forward vector too

tough abyss
#

vectorDir

#

For the current forward vector, anyways

#

But if you're using it for a desired velocity it's just a unit vector in the direction you want to move

#

E.g. if you want the velocity to go from point a to point b, you can use a vectorFromTo b to get the unit vector pointing from a to b

#

Which you can then vectorMultiply by your desired velocity in m/s to get a velocity vector

sullen sigil
#

so i would want something like _velocity1 = (_playerPos vectorFromTo _entityPos)*10 to get 10ms in the direction of the entitypos, right?

tough abyss
#

Yes

sullen sigil
#

and then the second velocity is the same, right?

tough abyss
#

If you want to be moving the same speed in the same direction at the end yes

sullen sigil
#

ADT is complaining about the *10

tough abyss
#

Oh yeah duh

#

use vectorMultiply

#

Instead of *

sullen sigil
#

ah gotchu

tough abyss
#

In actual math just using * would be sufficient but alas not in sqf

sullen sigil
#

what about the upVector in this case then

drifting portal
granite sky
#

It shouldn't have been an array :P

drifting portal
#

computers need a way to understand humans
its a two direction road lol

tough abyss
#

Yeah I mean if it were any other language vector would be a type with an operator overload for multiplying with *

drifting portal
#

uh I didn't use vectors except in sqf

#

fair enough

tough abyss
#

They are widely used outside of sqf

drifting portal
#

yeah I know but I never tapped on how they are actually used

tough abyss
#

As are quaternions which are not supported by SQF natively for some reason

sullen sigil
#

quaternions sound like aliens from dr who

tough abyss
#

@sullen sigil upVector is the direction you are facing "up" towards

#

E.g. if the top of your head is facing the sky your upVector is [0,0,1]

#

It has to be perpendicular to your vectorDir at all times

sullen sigil
#

i think i understand that

#

i dont think im using the correct vectorDir

tough abyss
#

Here's how I would do it yeah

sullen sigil
#

_vectorDir = _playerPos vectorFromTo _entityPos; is what im using atm

#

i assume theres some fancy maths i can use to get a normal to that

tough abyss
#

Before you start moving get the player's side vector by doing vectorCrossProduct on the vectorDir and vectorUp

#

Then calculate your new vectorDir like you just sent

#

And then vectorCrossProduct the side vector and the new vectorDir to get the vectorUp to use

sullen sigil
#

_vectorDir vectorCrossProduct (vectorUp player);

#

something like that?

tough abyss
#

Yes

sullen sigil
#

for the new _vectorDir, right?

tough abyss
#

Store that in _sideVector or something

#

No you set the vectorDir like before

sullen sigil
#
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct (vectorUp player);```
#

like that right

tough abyss
#

Yes

sullen sigil
#

roger and then i vectorcrossproduct that again with what

tough abyss
#

And then calculate the new vectorUp with the cross product of the side vector and the vectorDir

sullen sigil
#
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct (vectorUp player);
_vectorUp = _sideVector vectorCrossProduct _vectorDir;```
#

like that right

#

or am i misunderstanding

tough abyss
#

Yep

sullen sigil
#

oh word

#

and vectorup is the same for both right?

tough abyss
#

If you want it to be which I assume you do

sullen sigil
#

i dont actually know what it does in this instance

#

i just assume its rotation of the player or something

tough abyss
#

Yes it is

#

For example if you flipped it you would end upside down

sullen sigil
#

ah is that how you were planning on doing the wall climbing thing

tough abyss
#

In a similar fashion yes

sullen sigil
#

gotchu

#

and then wtf do i do with the interval

tough abyss
#

That is what needs to go from 0 to 1

sullen sigil
#

i assume i add a value to the variable for that on each frame or something?

tough abyss
#

Yep

sullen sigil
#

needs to finish on 1 by the time the movement is finished?

tough abyss
#

Yes

#

One simple way you can do it

#

Is just increase it by the amount of seconds you want the full movement to take divided by diag_deltaT

sullen sigil
#

deltaT being change in time right

tough abyss
#

Or sorry

#

Other way around

#

deltaT/seconds

#

Yes change in time since the last frame

sullen sigil
#

ok so i want to define the interval variable within the oneachframe EH and then have it add deltaT/seconds after the setVelocityTransform has happened and then go back around again until 1, right?

#

i think im doing that anyway

#

now i just need to pass those variables through the onEachFrame handler

tough abyss
#

Which you should use instead of just onEachFrame

sullen sigil
#

confusion

#

oh as in

#

_id = addMissionEventHandler ["EachFrame", { systemChat str [_thisArgs, time] }, [time]]; like this wiki example

#
_velocity = (_playerPos vectorFromTo _entityPos) vectorMultiply 10;
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct (vectorUp player);
_vectorUp = _sideVector vectorCrossProduct _vectorDir;
_interval = 0;
   addMissionEventHandler ["EachFrame", {
    params ["_playerPos", "_entityPos", "_velocity", "_vectorDir", "_vectorUp", "_interval"];
       player setVelocityTransformation [_playerPos, _entityPos, _velocity, _velocity, _vectorDir, _vectorDir, _vectorUp, _vectorUp, _interval];
_interval = _interval + diag_deltaTime/10
                                    }];
#

so i end up with this

#

and then i need to stop that when _interval reaches 1

#

which i have no idea how to do πŸ€”

tough abyss
#

Mm I really am sleep deprived

sullen sigil
#

game is complaining of expecting an array between player and setvelocitytransform too thonk

#

confusion

tough abyss
#

And yeah that's because you can't just use params

sullen sigil
#

oh yeah i have to pass them through the EH too dont i

tough abyss
#

Have to use _thisArgs params

#

In the event handler

sullen sigil
#

ah

#

before params or after

tough abyss
#

Just replace params with that

sullen sigil
#

_thisArgs params ["_playerPos", "_en.....

tough abyss
#

Yes

sullen sigil
#

roger

#

its still complaining about it thonk

#
addMissionEventHandler ["EachFrame", {
    _thisArgs params ["_playerPos", "_entityPos", "_velocity", "_vectorDir", "_vectorUp", "_interval"];
        player setVelocityTransformation [_playerPos, _entityPos, _velocity, _velocity, _vectorDir, _vectorDir, _vectorUp, _vectorUp, _interval];
    _interval = _interval + diag_deltaTime/10
}];```
tough abyss
#

Oh you're not actually passing them lol

sullen sigil
#

bruh moment

tough abyss
#

Regardless you will need to store _interval somewhere where its new value can actually be stored otherwise it won't actually increase Disregard forgot how event handler params work

sullen sigil
#

would getting the variable within the loop not cause it to stay as 0

tough abyss
#

You would need to get it, increase it, then save the increased value

#

Honestly it's an acceptable case to just use a global

sullen sigil
#

right so just chop out the underscores in front

#

im also still confused what you mean about not actually passing the variables

#

latest version of the script

tough abyss
#

As in

#

Look at the syntax for addMissionEventHandler

#

You can keep the underscores but you need to actually give it the parameters you want it to use in its parameters list

sullen sigil
#

oh [_thisArgs, <variable>, <variable>] after the end of the code?

boreal parcel
# little raptor example: ```bat "C:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3diag_...

is this correct? if so it says it cant find tbbmalloc_x64, where is this located?

start "D:\SteamLibrary\steamapps\common\Arma 3\arma3diag_x64.exe" -malloc=tbbmalloc_x64 -nofreezecheck -noSplash -enableHT -hugePages -world=VR "-mod=D:\SteamLibrary\steamapps\common\Arma 3\!Workshop\@RHSUSAF;D:\SteamLibrary\steamapps\common\Arma 3\!Workshop\@CBA_A3;D:\SteamLibrary\steamapps\common\Arma 3\!Workshop\@ace;D:\SteamLibrary\steamapps\common\Arma 3\!Workshop\@ACE Compat - RHS USAF;"
tough abyss
#

@sullen sigil yes

sullen sigil
#

ADT complains about undefined variables when i do that though

tough abyss
#

Are you putting it in the actual addMissionEventHandler call or in the code inside it

#

It's part of the actual function call

sullen sigil
#

oh so between the } and the ]?

tough abyss
#

After the code block

granite sky
#

@boreal parcel What are you trying to do? Just run the diag exe with mods?

granite sky
#

strip out -malloc and -hugePages then

tough abyss
#

@sullen sigil ok so

#

I don't know how else to explain this

granite sky
#

Also a somewhat easier method is to simply rename the diag exe to the normal exe name.

tough abyss
#

BIKI says the syntax for the command is addMissionEventHandler [event, expression, arguments]

granite sky
#

And the you can just use the launcher to run it.

tough abyss
#

You need to put all of them in the arguments spot

#

As an array

#

After the code block {}

sullen sigil
#
addMissionEventHandler ["EachFrame", {
  player setVelocityTransformation [_playerPos, _entityPos, _velocity, _velocity, _vectorDir, _vectorDir, _vectorUp, _vectorUp, interval];
    interval = interval + diag_deltaTime/10;  }, 
    [_thisArgs, "_playerPos", "_entityPos", "_velocity", "_vectorDir", "_vectorUp", "_interval"]];```
tough abyss
#

Don't say _thisArgs

#

That's for use inside the code

boreal parcel
sullen sigil
#

ohhhh i think i understand now

granite sky
#

that one can go too

tough abyss
#

Also don't wrap them in quotes

granite sky
#

and -enableHT

sullen sigil
#

so i use [_thisArgs, _playerPos] instead of _playerPos, right?

tough abyss
#

You then use _thisArgs with params inside the actual code block to access those values

#

This would be so much easier to type if I wasnt on mobile

#

Its literally just

sullen sigil
#

no no i think i understand you now

#

layer setVelocityTransformation [[_thisArgs, _playerPos], [_thisArgs, _entityPos], [_thisArgs, _velocity], [_thisArgs, _velocity], [_thisArgs, _vectorDir], [_thisArgs, _vectorDir,] [_thisArgs, _vectorUp], [_thisArgs, _vectorUp], interval];

#

that, right?

#

and then the rest of the code and then

#

}, [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp]];

tough abyss
#
_arg1 = 5;
_arg2 = 10;
addMissionEventHandler["EachFrame", { _thisArgs params ["_arg1", "_arg2"]}, [_arg1, _arg2]];
#

Example

sullen sigil
#
addMissionEventHandler ["EachFrame", { _thisArgs params ["_playerPos", "_entityPos", "_velocity", "_vectorDir", "_vectorUp", "_interval"];
      player setVelocityTransformation [_playerPos, _entityPos, _velocity, _velocity, _vectorDir, _vectorDir, _vectorUp, _vectorUp, interval];
      interval = interval + diag_deltaTime/10;  },
         [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp]];```
#

okay things now move

#

just not as i would quite like them to

#

things are moving but its incredibly funky

#

oh wait

#

im not actually finishing when interval = 1

#

ok time for that bit i think

granite sky
#

your velocity doesn't match the interval calc either.

#

So it'll be pretty wack in MP

sullen sigil
#

i think just getting it working properly initially is a first step

#

ok so i want waituntil interval = 1 then exitWith {} right

tough abyss
#

Defining _interval is pointless if you're using the interval global (which should be something more like KJW_VAR_INTERVAL)

#

And no

#

Just put a check in the loop that runs this once it hits 1

copper raven
sullen sigil
#

yeah forgot to chop out the _interval i just copy pasted from earlier

tough abyss
#

removeMissionEventHandler [_thisEvent, _thisEventHandler]

#

That will allow you to terminate the EH from within

sullen sigil
#

so something like

if (KJW_VAR_interval) >= 1) then {
removeMissionEventHandler ["EachFrame", _id]
};```?
#

oh i have to pass _id through the EH too

sullen sigil
tough abyss
#

No

#

Use what I said it grabs the id via _thisEventHandler

sullen sigil
#

oh is it an automatic variable

tough abyss
#

Yes

sullen sigil
#

ah

tough abyss
#

You should really read the biki page for addMissionEventHandler lol

#

It says all of this

sullen sigil
#

i have but im also stupid

tough abyss
#

I mean fair

#

Though I was stupid too because sharp has a point

#

You actually can use the interval passed in _thisArgs, it'll keep the updated value between frames

#

Somehow I ended up under the impression that it wouldn't preserve the new value

#

So you actually can just edit _interval instead of using a global

sullen sigil
#

im still meant to be using if and such though arent i

tough abyss
#

Yes

sullen sigil
#

i also end up trapped under the floor for some reason

#

to remedy that i'll need to add like half a meter to the initial pos right?

tough abyss
#

Add whatever makes it look right lol