#arma3_scripting

1 messages · Page 94 of 1

kindred tide
#

then you know whether the "available types" for OFP is a mistake or "setVariable" not being for OFP is a mistake

#

how could anything even be scripted in OFP without "get/setVariable"

#

that's like the most basic most needed thing

winter rose
#

setVariable is not in OFP

#

the 1.34 thing comes from publicVariable network info

hallow mortar
#

You can script plenty of things with only missionNamespace and private/local variables. Yes, it's more limited, but y'know, it was 2001

still forum
winter rose
#

oooh yes.

#

you had to be there! it was fire!

winter rose
kindred tide
#
    setvar(obj, varname, varval) obj##varname = varval;
#else
    setvar(obj, varname, varval) obj setVariable [#varname, varval];
#endif```
#

something like that i guess

winter rose
#

#ifdef __OFP__ what?

kindred tide
#

(or whatever)

#

just an example

kindred tide
#

my mod is singleplayer

winter rose
#

safer ^^

still forum
#

Afaik there is no way to use #if/#ifdef to detect the difference between OFP/Arma1/Arma2

#

The __ARMA3__ definition was only introduced in A3, and that also only in 2020

still forum
#

I guess you can use supportInfo, with if in script, to compile different script files at mission start

requiredVersion won't work to detect games really.
A1 restarted at 1.0, Arma 2 restarted at 1.0, Arma 3 restarted at 1.0

You could try compiling a script, and if it fails, it contains something unsupported.
So if (isNil {compile "supportInfo ''"}) ? to detect OFP?

Ah nvm compile didn't exist in OFP, neither did isNil

Did SQF even exist in OFP? Was it all SQS back then??

call command was only added in OFP 1.85

granite fog
#

what is the best way to add additional arguments inside BI EH's ? Using global variables not a solution

still forum
#

@winter rose I found another wiki mystery.
https://community.bistudio.com/wiki/call
Introduced in OFP 1.85
But syntax one takes string since OFP 1.00 ?

Also if OFP only accepts string, shouldn't the version marker then be on the "Code" argument type instead?
Mh also call string was removed wasn't it?

winter rose
#

this one is most likely "in OFP it took string"

kindred tide
#

looks like i have to macro everything

winter rose
#

yes, String was removed

still forum
winter rose
granite fog
still forum
#

I think not all eventhandler commands have it (for example unit addEventHandler, because there you can pass it via the object)

kindred tide
#

"You could try compiling a script, and if it fails, it contains something unsupported."
or do that yeah, if it can't run getVariable then it's OFP

granite fog
still forum
winter rose
still forum
#

And that would mean you have to wrap basically every command into a script function? That would be absolutely nuts and horrendous for performance.

Unless you take bigger blocks, and write a OFP version and a Arma2/3 (where macro detection works) version

still forum
winter rose
#

uuuuuugh code history

#

(thanks for checking ^^)

still forum
#

That change for string was done on 27.05.2005
That's when string support was removed, before that it was briefly StringOrCode

winter rose
#

wait, we have pre Arma 2 history?

#

2005 = Arma 1

formal stirrup
#

Anyway to make drones not tilt upwards when applying velocity to them?

#

I've tried using setVectorDirAndUp but they seem to just ignore the loop and tilt anyway

winter rose
#

they can't "ignore" it, the loop may be wrong

formal stirrup
#
for "_i" from 1 to 999 do {
sleep 0.05;
  drone1 setVelocityModelSpace [0,-10,0];
  drone1 setVectorDirAndUp [[0,0,0], [0,0,0]];
};};

I mean the velocity is executing so idk why the vector wouldnt

kindred tide
#

i dont understand

hallow mortar
winter rose
#

[0, 0, 1] is "up" (towards the sky)

#

vectorDir requires a facing dir, try vectorDir drone1

kindred tide
#

SQF was first introduced in Operation Flashpoint: Resistance together with the call operator in update 1.85. so i can use SQF in OFP

formal stirrup
winter rose
formal stirrup
#

worth a try ig

#

Not much a change but something was learned

kindred tide
#

yes

winter rose
#

you can use SQF, just not sqf files

kindred tide
#

but mission init is in sqs

#

and i cant

#include "init.sqf";``` because they cant span multiple lines in sqs
winter rose
#

here what "SQF" means is "if () then {} else {}" syntax
you cannot use multiline in OFP, unlike perhaps with some string trickery

kindred tide
#

ig the only way to do OFP compatibility is to write an external utility tool that converts from SQF to SQS and replaces everything incompatible

winter rose
#

still no idea what you are doing btw

winter rose
proven charm
#

isnt EachFrame EH blocking in sense that no other script is run until the eachFrame code completes?

winter rose
#

it is unscheduled

proven charm
#

so that's a yes? ;D

winter rose
#

"blocking" is unclear

proven charm
#

i mean like all others scripts wait and are not processed

winter rose
#

they don't wait

#

unscheduled scripts are run one after another, with no consideration for the scheduler's content

granite sky
#

But then SQF isn't multithreaded, so it's also kinda true.

proven charm
#

right but they dont get paused

granite sky
#

Once an unscheduled script has been started, it runs until completion.

#

And you can guarantee that no other SQF is running concurrently.

proven charm
#

because they might change same scripts variables its important the order is right

still forum
#

Pretty sure that the guy that made that change, is still at BI

still forum
kindred tide
#

yes

still forum
#

then use that instead of #include

little raptor
#

idk what "str"ing an include is supposed to mean. If it's something known to be strable, it's fine, but if you're trying to str the contents of the file, that's wrong

winter rose
#

also, str is Arma 1 🤣

kindred tide
winter rose
#

that's loadFile to you

little raptor
winter rose
#
call str
#include 'file.sqf'
```assumed that `file.sqf`'s content is```sqf
hint "Hello there!";
systemChat "OK";
```would result in```sqf
call str
hint "Hello there!";
systemChat "OK";
```and it would obviously fail (besides it being multiline… also I don't know if `#include` work in SQS)
kindred tide
winter rose
#

you would then stringify code

kindred tide
#

yes

winter rose
#

toString should be used 🙃

#
str { "OK" }; // "{ ""OK"" }"
toString { "OK" }; // "OK"
little raptor
#

Was that available in OFP?

winter rose
#

str? no.

#

toString? A3 v2.02

hallow mortar
#

if only someone could have predicted that trying to accommodate OFP and A3 in the same code would cause huge problems

sullen sigil
#

are we still on this

hallow mortar
#

technically it is a legitimate project and fair game for discussion here. even if it is stupid

winter rose
#

I like the challenge, but I have to wonder: "why?"

kindred tide
#

i put this in init.sqs and it worked

#

call (preprocessFile "init.sqf");

#

and OFP's str is format

#
hint format["%1", A];```
winter rose
#

with length limitation

still forum
#

You know basically nothing about how SQF nor its Preprocessor works (you were surprised that #define and #include worked)
and are trying to take your first steps, starting a huge inter-game compatible mod that even the biggest experts would be struggling with.

Yeah.. what the heck

winter rose
#

tbh, if you want something that will work across all games, write everything in SQS

sullen sigil
#

i dont even understand the point of it regardless

#

like, a3 is less than a mcdonalds meal here when it does on sale

kindred tide
#

i have all arma games on steam

granite sky
#

It's hard enough trying to make anything work consistently on A3 :P

kindred tide
#

it's about choosing between re-writing everything for the older game or making it compatible from the start. i can't foresee every difficulty ahead and it looked like a plenty of commands worked in OFP, so i chose to try making it compatible

sullen sigil
#

why do you need to write anything for ofp nootlikethis

sullen sigil
#

also, john, have you managed to get orientation interpolation to work in mp scenarios before? if ive already asked you sorry, memory loss isn't doing too well 🙃

#

setvelocitytransformation seems to have the same lack of interpolation as addtorque notlikemeowcry

winter rose
sullen sigil
#

has exact same appearance as using addtorque for me, velocity gets interpolated by engine because of velocity property, orientation is just a property with no interpolation

#

i think biki probably referring to command interpolating the values based off interval too

winter rose
#

and… what do you hear by that?

sullen sigil
#

i dont understand the question

winter rose
#

orientation is just a property with no interpolation
do you mean by that "setVelocityTransformation does not interpolates vectorDir/Up?

sullen sigil
#

if not local, no

kindred tide
#

#define setvar(obj, varname, val) obj##varname = val; hint format["%1 is set to %2", #obj###varname, val];
#define getvar(obj, varname) obj##varname;

setvar(Car,_spd, 12);
_test = getvar(Car,_spd);
hint format ["Test is %1", _test];
sullen sigil
#

doesnt interpolate between network updates

kindred tide
sullen sigil
little raptor
sullen sigil
#

yes, will sqfbin it again

#

the exact same shuddering motion happens regardless of if its setvelocitytransformation or just setvelocitymodelspace + addtorque

little raptor
#

I don't know what the second one is for

#

are you using both at the same time?

sullen sigil
#

yes, all run at once -- some code is noted out and idk if sqfbin is highlighting it properly

little raptor
#

it doesn't no but if I had to put my finger on why it doesn't work, then I'd say that's the problem

#

you're only supposed to use svt

#

not setVectorDirAndUp

#

here's a question for you: does unitCapture work fine on your server?

#

if so, the problem is not svt

#

and it shouldn't be
that command is designed to have interpolation (both in SP and MP)

sullen sigil
#

im using addtorque instead of setvectordirandup, had also used just svt and used the orientation equation to update variable that svt oriented by

#

let me look at how to use unitcapture one sec

#

Previously had been setting ([_dir, _up] apply {_ship vectorModelToWorld _x}); as variable in the ship then reading in the svt in _moveShip

little raptor
sullen sigil
#

as in with BIS_fnc_unitCapture? meowsweats

little raptor
#

yes

sullen sigil
little raptor
#

well the local machine doesn't have any latency

sullen sigil
#

ya

little raptor
#

so it's moot

sullen sigil
#

just pointing out its a netcode/network issue 😅

#

arma loading atm

little raptor
#

like I said when you use setVectorDirAndUp you remove the interpolation

sullen sigil
#

i wasnt using it at the same time as svt tho meowsweats

little raptor
#

you said "all run at once "

sullen sigil
#

meant all the functions, not all the code
but fn_orientShip was writing to kjw_capitalships_neworientation variable or something similar, svt was taking from that

#

not a clue what this means

#

had to respawn after if that means anything

little raptor
signal kite
#

My "main" display is black. I can see chat, menu and hints. I can hear sounds (eg when I shoot my weapon) but I have no 3D graphics.
I suspect that the "main" display is faded to black. Is there any code I can run to fade the 3D-Graphics back in?

little raptor
#

and you just paste it into a file and pass it to unitPlay

#

e.g [bla, loadFile "data.sqf",...] call BIS_fnc_unitPlay

#

I don't remember the args so check the wiki

sullen sigil
#

i'll try again but had tried 3 times

little raptor
#

you should record in SP

#

clipboard doesn't work in MP

sullen sigil
#

oh, record in sp and play in mp? 😅

little raptor
#

yes

sullen sigil
tame coral
#

thanks

sullen sigil
#

spawned unit in with zeus, used setOwner to transfer locality to server then ran it

little raptor
#

so issue is in your code like I said blobdoggoshruggoogly

sullen sigil
#

but its the same issue with addtorque and svt when i dont setdirandup anywhere else notlikemeowcry

little raptor
#

in that submarine even a physx obj?

sullen sigil
#

its attached to a physx object

#

Land_Cargo10_white_F

little raptor
#

... then maybe the problem is attaching it to another object with slower simulation or something

sullen sigil
#

nope, it happens when i detach/delete it

#

isnt smooth, is juddering in places

#

oh, just found out something else now

little raptor
#

I mean the submarine itself meowsweats

sullen sigil
#

further away from camera the more its juddering

little raptor
#

what about the plane?

sullen sigil
#

plane i'll test

#

plane is smooth, have also tried dropping it from different distances from zeus after setting ownership to server, is still smooth

little raptor
#

what simulation does the submarine use?

sullen sigil
#

shipX

#

only reason its on there for that clip is its easier to see the juddering getting worse

#

same thing happens for the box

little raptor
#

what if you created a new vehicle using planex (or airplanex, whichever it was) simulation?

sullen sigil
#

that is my absolute last resort as itd be harder to modify the handling of it afaik?

little raptor
#

wat?

sullen sigil
#

i.e user would have to use plane controls

#

rather than mine

little raptor
#

you can use whatever controls you want

sullen sigil
#

mine are reading out of simple af config values

little raptor
#

actually here's another question

#

try recording the movement of the submarine, see if it jitters again

sullen sigil
#

as opposed to the obj its attached to?

little raptor
#

while using it in SP normally

little raptor
#

like the plane

sullen sigil
#

ah

#

smart

little raptor
#

basically one of these is the problem:

  1. your svt parameters are not consistent
  2. the vehicle simulation is not fast enough
  3. you're doing something that messes with the interpolation
sullen sigil
#

would those cause issues in dedi as opposed to everything else?

little raptor
#

well they could cause problems in MP compared to SP

#

dunno any specifics about dedi

#

my current guess is 1

sullen sigil
#

this doesnt happen in lan but theres no latency there

sullen sigil
little raptor
#

well by MP I mean a second client observing what's happening on another computer

little raptor
#

for now the submarine recording test is the best way to go

#

actually play the plane data on the submarine

#

because if you record the submarine while moving it with your code it doesn't tell us anything

sullen sigil
#

ive already deleted the plane data meowsweats
give me a sec though as forgot to record on the same terrain so its just made the sub disappear

little raptor
#

if you use clipboard history you might still have it (Win+V)

sullen sigil
#

give me a few then

#

ok ill test the sub play on dedi then ill re-record plane and do that

little raptor
#

wut? is that the plane data?

sullen sigil
#

thats sp recorded data for it spinning on the spot

little raptor
#

then I'd say something's wrong in your code?

#

anyway rn I'm mostly interested in the plane data

sullen sigil
#

ya i'll go record that now

#

juddering in places there

#

however is somewhat smooth?

little raptor
#

well yeah it looks better than what you had

#

anyway it's not smooth

#

so the problem is also the sim

sullen sigil
#

i wonder if svt doesnt interpolate if interval is 1? thonk

little raptor
#

so you'll have to make your own vehicle config

sullen sigil
#

presume i cant just use this system on that vehicle too

little raptor
#

iirc besides sim you also have to change their typicalSpeed and some other thing related to size

sullen sigil
#

so theres no one size fits all solution for that either for each ship? notlikemeowcry

sullen sigil
little raptor
#

or even the rotation code

sullen sigil
#

good idea

little raptor
#

not sure if it affects it

sullen sigil
#

probably

sullen sigil
#

i.e direction reverses at some point when you get further away

#

and then just stops eventually

#

although... it appears smoother? nope

little raptor
#

then the problem is your code for the most part

little raptor
sullen sigil
#

im not using svt here

#

its addtorque

little raptor
#

well you must use svt

granite sky
#

addTorque is madness

sullen sigil
#

must as in i should do or thats what i am running rn

sullen sigil
little raptor
sullen sigil
#

when i had done it i was using interval of 1 every time, should i change to 0.5 or something? need "live" movement so cant really go 0-1 interval all the time

granite sky
#

Someone put some cute code into Antistasi with addForce that gives vehicles a bit of recoil when you fire attached statics from them. Trouble is that if you get a long frame it just nukes the vehicle.

little raptor
#

interval shouldn't matter

#

but you can try

sullen sigil
#

i did 1 before and same issue was happening

#

however i wouldnt be surprised if 1 caused engine to ignore interpolation

little raptor
#

use 0.999 😛

sullen sigil
#

i hate this so much

little raptor
#

I hate it too

sullen sigil
#

thanks for the help though 😅

little raptor
#

oh you don't mean the font 🤣

sullen sigil
#

but the brain damage would explain all this code

#

time to battle with tcadmin once again

south swan
#

I re-read SVT docs and now i don't see its pros blobdoggoshruggoogly

sullen sigil
#

for this, its engine level pros with how the command is handled i think

#

otherwise if it was just a wrapper for setvelocity etc i wouldnt be using it

#

though it is nice for easy use in mission making for using stuff as doors that shouldnt be used tbh

south swan
#

I re-read again and it still looks like "linearly interpolate between those 3 pairs of vectors with X ratio"

sullen sigil
#

it is 🙂

#

however stack it and stuff (move the destination with it as well) and you have different interpolation

little raptor
#

I re-read again and it still looks like "linearly interpolate between those 3 pairs of vectors with X ratio"
it doesn't use lerp for orientation

#

it uses slerp

#

but also the command doesn't just magically move your vehicle like setPosXXX

#

it issues an engine-level movement, like the vehicle's natural movement

sullen sigil
#

thats news to me

#

though probably why my crashing function broke too

little raptor
#

what I mean is that it's not instant

sullen sigil
#

ah

south swan
#

wut

little raptor
#

i.e. even if you use an interval of 1, the command doesn't just setPos you

#

it "predicts" your move. dunno how to say this exactly

south swan
#

Huh, i actually need yo test it then

little raptor
#

it might setPos you on the first point tho

#

not sure about that one

#

but anyway, the game keeps several movement states, and interpolates between them to generate smooth motion

#

(so that it doesn't have to simulate stuff every frame and save performance)
this command uses those (maybe pushes to them or something, don't know the exact details)

sullen sigil
#

no worky 😦

#

deleting submarine reveals box is doing same thing, just kept the submarine so you can see it better

sullen sigil
little raptor
#

well yeah like I said it makes no diff

sullen sigil
#

wdym

#

oh with interval

little raptor
sullen sigil
#

its still somewhat stuttery up close too

#

but not overly

little raptor
#

imo just take a look at unitPlay

#

the function might be using something that is better here

#

e.g. vectorDirVisual vs vectorDir

#

or getPosASL vs getPosWorld

sullen sigil
#

ah so not the actual svt command itself

#

i'll look

little raptor
#

I mean it might use different getters

#

tho I think for that you should look at unitCapture

#

unitPlay just uses the values

sullen sigil
#

yeah, unitcapture uses vectordir, vectorup and getposasl

#

getposasl vs getposworld has made no diff to me before

little raptor
#

then the problem is the calculations

#

I think the problem is that your interpolation duration is too short

#

i.e. instead of using an interval of 1 every frame, try to predict the movement using exact equations, and adjust the interval accordingly

sullen sigil
#

and svt across frames having predicted movement? meowsweats

little raptor
#

kinda

#

I don't know what equations you currently use for movement

#

as in what's "controlling" the movement

#

and what the equations of motion are
but you need well defined pos, vel and acceleration for this to work properly

sullen sigil
#

for xyz movement, its just get ships position in a second according to velocity, take difference between that and current position and multiply by diag_deltaTime

#

...orientation has no diag_deltatime in it

#

i didnt write the orientation function because its beyond my knowledge, ampersand did iirc

#

all of this is just spaghetti to me

#

only problem is with orientation, not xyz movement too -- that was fixed a few days ago

south swan
#

🧠 make authority only network-transmit control points (including target time), get actual movement with svt in pfh on client

sullen sigil
#

that means nothing to me, if youre talking about a node-based movement system (player clicks and ship goes towards there) i had done that originally but:
a) maintaining speed was a pain in the balls
b) it was really shit

#

could the issue be with lack of diag_deltatime in orientship? meowsweats

little raptor
#

well you need accurate motion equations like I said before

south swan
#

inb4 steering behaviors

sullen sigil
#

orientation motion is far beyond my calculus ability meowsweats

sullen sigil
south swan
#

nah, i'm talking something like this series: https://www.youtube.com/watch?v=OxHJ-o_bbzs

It’s finally time for me to tackle a JavaScript (p5.js) implementation of the “arrival” steering behavior from Craig Reynolds’ 1999 paper Steering Behaviors For Autonomous Characters! Code: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/5-autonomous-agents/4-arrive-steering

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingt...

▶ Play video
sullen sigil
#

he is saying words i do not understand them

tribal sinew
#

is it possible to disable ambient sound for a particular fence object (i mean the rattling sound)?

#

Land_BackAlley_01_l_1m_F to be precise

ornate whale
#

Is it possible to find out which enemy units has already detected a player? Like getting an array of unit names? I think that it would be possible with loop in which you would call "targets" function on all the enemy units in the level and looking for the name of the player in those arrays, but it seems too complicated. Is there any easier way?

#

And second question is? Is there any way how to know if the player was seen when he was detected? I think that when the knowsAbout value is <= 1.35, then he probably only heard the player but not seen.

granite sky
#

You can use knowsAbout instead of targets if you want a simpler check.

#

but otherwise you're on the right lines.

ornate whale
#

So theres probably no function like Player isDetectedBy ... returns ai1, ai2, ai4

granite sky
#

Nope.

#

A very basic example:
allUnits select { _x knowsAbout player > 1.5 };

#

(does not consider enemy vs friend)

ornate whale
#

Nice

#

Is there a selector like allEnemies or allOpfor?

granite sky
#

there's units opfor

ornate whale
#

ok

#

thanks

granite sky
#

knowsAbout is more persistent than you might expect. In any sort of fight it'll escalate to 4 and then stay there for ~5min, even if the unit loses track of the target.

ornate whale
#

Yeah XD I measured it already

granite sky
#

hence people will sometimes use the fancier commands like targetKnowledge to filter that down.

ornate whale
#

I will also need the target age value, and that is shown, to my knowledge, only in the "targetKnowledge" command, how long ago he saw me the last time in seconds.

ornate whale
granite sky
#

You can test it. Chuck some units down in the editor. Enter the code. Hit that clock button on the mid-left that I never spotted.

ornate whale
#

With one player and 30 enemies it say 0.06 ms 10 000/10 000 count

#

is it good bad ? XD

#

But if I put it there three times (3 players) it says this,

ornate whale
#

I also wonder whether setting the player's audiblecoef trait to a low value would affect even the range of the gun fire sound, or only the steps. Does anybody know?

sage bridge
#

Hey, this is my own SQF script, is there a reason as to why the sheep aren't moving? I have the line 19 "_unit = [_BK_random_pos, 250] call BIS_fnc_taskPatrol;" that should in "my theory" work on all of the groups of animals. https://sqfbin.com/mewojulicoxobahavipo this script is chatgpt free. I learned that lesson.

simple trout
south swan
ivory meteor
#

Hey another question on textures how do I send it to a friends

warm hedge
#

If you make it a mission will be packed into the pbo

still forum
fallen locust
#

saved a bottle or 2 of xanax pills

sullen sigil
#

few questions about vectordirandup i hope someone can answer:

  • final number of dir does nothing, right?
  • both must always have a magnitude of 1?
south swan
#

Z coordinate of dir is used for sure. How else would you make thing's nose point up?

sullen sigil
#

uh
vectorup? thonk

south swan
#

uh, no?

sullen sigil
#

guh, will mess a bit more in 3den to try figure this shit out properly

#

this confuses me

south swan
#

vectorDir is literally "which direction object's "nose" is pointing at" I'm confused about what's there to be confused about blobdoggoshruggoogly

sullen sigil
#

why not just roll pitch yaw notlikemeowcry

#

ok, so
vectorDir:
[eastness, northness, upness]
vectorUp:
[90deg rollness, ??, ??]

south swan
#

vectorUp: [eastness of up, northness of up, upness of up] blobdoggoshruggoogly

sullen sigil
#

who on earth at bohemia decided on this

#

how can an up be east

#

oh, rolled to the east
the other two i do not understand

south swan
#

that's pretty standard (and arguably the most understandable) way of dealing with orientations

sullen sigil
#

i hate it

#

i had been avoiding learning it

#

(clearly)

south swan
#

you'd hate roll/pitch/yaw as soon as you try to rotate your object around arbitrary axis 🙃

sullen sigil
#

why must you hurt me in this way

#

i thought the magnitude was supposed to be the objects scale notlikemeowcry

south swan
#

at this point you may ask for direct transformation matrix access already blobdoggoshruggoogly

sullen sigil
#

you are speaking gibberish to me

#

(i am going to continue to try avoid vectordirandup) (it does not work)

south swan
sullen sigil
#

need to pull most of the code out of that though just to change the final line which isnt too helpful notlikemeowcry

#

and my variables arent straight in roll/pitch/yaw either, theyre like 0-1 variables or some shit because of how amp did it 🙃

#

needs to be relative to the object's rotation which is the majority of the headache here

#

so pitch up needs to do yaw if its roll is 90 degrees for example

sullen sigil
little raptor
#

1.7?

#

where?

sullen sigil
little raptor
#

are you summing them? meowsweats

#

magnitude is sqrt(x2 + y2 + z2)

sullen sigil
#

oh ofc

#

ignore me

#

pea brain kjw

#

(again)

#

its evident i failed calculus

winter rose
#

"no, calculus has failed you!"

sullen sigil
#

i think i am understanding now
i need to _orientation vectormodeltoworld _x then subtract current position to get roll/pitch/yaw relative to object then just use BIS_fnc_setObjectRotation? meowsweats

little raptor
#

wut?

#

and I don't know why you insist on using that command

sullen sigil
#

if object is banked 90 degrees then pitching 100 degrees up should be same as putting 100 degrees yaw on the object

sullen sigil
#

so just use the result of it in the svt

little raptor
#

do you know how a cartesian coordinate looks like?

south swan
#

yaaay, #arma3_3dmaths

sullen sigil
#

sounds familiar but i couldnt tell you what it is

#

oh, yes

cerulean egret
#

Hey all. I'm looking for a way to get ai spawned groups to stop and throw smoke when a helo is within X meters. Any ideas

little raptor
# sullen sigil oh, yes

yeah that. and then there's z that points upwards (following the right hand rule)
if you attach those coordinates to an object, y is dir and z is up

#

x can be measured using right hand rule : y * z, so it's not needed

sullen sigil
#

the right hand rule confused me but i think i understand it somewhat now

#

what about vectorUp though? meowsweats

little raptor
#

z is up

#

the coordinates are attached to the object, so object's z is not world z

sullen sigil
#

uhhhhhh
youve lost me now, why is there 3 coordinates for the axis? meowsweats

little raptor
#

some random image from google

little raptor
little raptor
sullen sigil
#

im sat behind my screen making some very confused faces right now

little raptor
#

which part is confusing?

sullen sigil
#

how on earth dir and up become 3d world vectors

little raptor
#

dir and up are the Y and Z vectors on that object above

south swan
#

vectorDir is, basically, a coordinates of point 1 meter directly before your nose when you're at [0,0,0] coordinates blobdoggoshruggoogly

sullen sigil
#

hang on im going to put an arrow and another object down at 0,0,0 and see if that helps

#

i think i understand vectordir now

#

vectorup is still confusing

south swan
#

vectorUp is coordinates of point 1 meter above your head when you're at [0,0,0] position blobdoggoshruggoogly

bitter palm
#

Hello guys
I have a question about arma 2
How to disable magazine icon in arma 2 ace mod when reloading? I can change it to icon or text when reloading
I has searched the configs but no success

little raptor
# cerulean egret Hey all. I'm looking for a way to get ai spawned groups to stop and throw smoke ...

well you can just make a loop like so:

[] spawn {
  while {true} do {
    _leaders = groups west apply {leader _x} select {vehicle _x == _x};
    {
      if (time < _x getVariable ["smoke_cooldown", 0]) then {continue};
      _helis = _x nearEntities ["Helicopter", 300];
      if (west countSide _helis > 0) then {
        _x setVariable ["smoke_cooldown", time + 60];
        _smoke = createVehicle ["SmokeShellBlue", ASLtoAGL getPosASL _x];
      };
    } forEach _leaders-allPlayers;
    sleep 5;
  }
}
little raptor
#

or replace it with a super simple object

tribal sinew
#

Disabling the simulation didnt work for some reason

#

Ill try the simple object tho, thanks

sullen sigil
#

my wonderfully complex self teaching methods

winter rose
sullen sigil
#

ok i understand how the variables work, just dont know how i'd go about modifying them for what im doing without converting them to pitch/yaw/bank

little raptor
#

rotation matrices for example

sullen sigil
#

never learnt matrices meowsweats

little raptor
#

or quaternion but I doubt you know that one meowsweats

sullen sigil
#

hamilton is a play isnt it

little raptor
sullen sigil
#

uh
i thought it was the big
0 0 0
0 0 0
0 0 0
thingy

little raptor
#

it is

sullen sigil
#

youve lost me there then

little raptor
#

e.g. rotation about Z axis is:

_mat = [
 [cos _a, -sin _a, 0],
 [sin _a, cos _a, 0],
 [0,0,1]
] 

and if you do (which looks stupid in SQF):

flatten (_mat matrixMultiply (_vec apply {[_x]}))

you get the rotated vector

sullen sigil
#

i assume _a would be how far you're rotating about that axis? meowsweats

little raptor
#

yeah it's the angle

#

from that same wikipedia page

sullen sigil
#

so then i just modeltoworld that, right? meowsweats

little raptor
#

but you don't really need this stuff for what you do as far as I can tell

sullen sigil
#

im just trying to rotate a mf and not have it stutter in mp 😟

#

what is _vec there? current position? meowsweats

little raptor
#

any vector (e.g. dir or up)

#

but not position

sullen sigil
#

ah

winter rose
#

position is not important in rotation unless you do not rotate around your [0,0,0]

sullen sigil
#

so I just need to take pitch, roll and yaw and then shove them into the matrices and somehow make those into vectordirandup and then modeltoworld it? meowsweats

little raptor
#

let me take a look at your code again before I say anything

#

but anyway:

somehow make those into vectordirandup
you already have those tho
first you get the full rotation matrix
then you multiply it by vectorDir and up and you get the new ones

sullen sigil
little raptor
#

yeah I know it's still up on sqfbin

sullen sigil
#

yeah, just wanted to make sure 😅

sullen sigil
little raptor
#

well you're rotating 1 object

#

so those 3 angles become one rotation matrix

#

and get multiplied by dir and up (and side, but again that's redundant, because right hand rule gives you that) the same way

sullen sigil
#

so i assume i wouldnt just be straight up using roll pitch yaw as _vec? 😅

little raptor
#

no those are angles

sullen sigil
little raptor
sullen sigil
#

oh, they all become one matrix? meowsweats

little raptor
#

alpha beta and gamma

sullen sigil
#

oh wait

#

yeah

#

but then im still with 3 matrices to 2 arrays, right? meowsweats

little raptor
#

it's one matrix

sullen sigil
#

oh so yaw matrix is multiplied by pitch matrix is multiplied by roll matrix? meowsweats

little raptor
#

yes

#

they result in one matrix

#

which is shown in that image

sullen sigil
little raptor
#

yep

sullen sigil
#

okay then modeltoworld those? 😅

little raptor
#

but not sure if that's the problem in your code

south swan
#

roll is 2d in modelspace. New modelspace vectorUp would be [sin _rollAngle, 0, cos _rollAngle]. So _veh setVectorDirAndUp [vectorDir _veh, vectorModelToWorldVisual [sin _rollAngle, 0, cos _rollAngle]]; should apply the roll relative to model?

little raptor
little raptor
sullen sigil
#

but needs to be pitch up makes object pitch up in modelspace rather than worldspace else you'd be rolled 90 degrees and have some fucky shit, no?

little raptor
#

you can just use that matrix in model space

#

and it gives you the new dir and up in model space

#

which you can vectorModelToWorld

sullen sigil
#

i think i understand what leopard is saying now

little raptor
sullen sigil
#

oh so i just modeltoworld the resultant vectors as pitch roll and yaw are provided in modelspace?

little raptor
#

each column of that matrix is the new side (x), dir (y) and up (z) after applying those rotations

sullen sigil
#

im somewhat confused by what is actually a column and what is not in that instance but i think i can figure it out

little raptor
#

so no need for matrices

little raptor
#
[
x
y
z
]
sullen sigil
#

oh roger

sullen sigil
#

i think i understand it now

little raptor
sullen sigil
#

ya i understand it was just reading it wrong

#

i dont need to have side in the matrix though do i?

little raptor
#

no

#

you need the dir and up

#

and you don't need the matrix anymore

#

just a reminder

sullen sigil
#

is it not more convenient to keep the calculation in a matrix?

little raptor
#

well in SQF it just looks weird meowsweats
using those vectors directly might also be faster

sullen sigil
#

fair enough lol

south swan
#
 //BIS_fnc_transformVectorDirAndUp
#define R_YAW [[cos _yaw, sin _yaw, 0], [-sin _yaw, cos _yaw, 0], [0, 0, 1]]
#define R_PITCH [[1, 0, 0], [0, cos _pitch, sin _pitch], [0, -sin _pitch, cos _pitch]]
#define R_ROLL [[cos _roll, 0, -sin _roll], [0, 1, 0], [sin _roll, 0, cos _roll]]

params [["_vectorDirAndUp", [[0, 1, 0], [0, 0, 1]]], ["_yaw", 0], ["_pitch", 0], ["_roll", 0]]; 
_vectorDirAndUp matrixMultiply R_YAW matrixMultiply R_PITCH matrixMultiply R_ROLL```
sullen sigil
#
private _dir = [
            cos _yaw sin _pitch sin _roll - sin _yaw cos _roll,
             sin _yaw sin _pitch sin _roll + cos _yaw cos _roll,
            cos _pitch sin _roll
        ];```
![meowsweats](https://cdn.discordapp.com/emojis/707626030613135390.webp?size=128 "meowsweats")
south swan
#

so run the function that's pre-written by KK in modelspace, convert the result to worldspace, done 🙃

sullen sigil
#

this does look very silly in sqf

little raptor
sullen sigil
#

oh ofc

#
private _dir = [
            cos _yaw * sin _pitch * sin _roll - sin _yaw * cos _roll,
             sin _yaw * sin _pitch * sin _roll + cos _yaw * cos _roll,
            cos _pitch * sin _roll
        ];
        private _up = [
            cos _yaw * sin _pitch * cos _roll + sin _yaw * sin _roll,
            sin _yaw * sin _pitch * cos _roll - cos _yaw * sin _roll,
            cos _pitch * cos _roll
        ];```
![meowsweats](https://cdn.discordapp.com/emojis/707626030613135390.webp?size=128 "meowsweats")
#

this looks horrible

#

so then I'm just multiplying the two vectors together?

little raptor
#

no

sullen sigil
#

i.e vectorDir * _dir for new dir

south swan
#

you vectorModelToWorldVisual both of them and setVectorDirAndUp the result blobdoggoshruggoogly

little raptor
#

they are the new _dir and _up in model space, after being rotated that much

#

so those _roll _yaw _pitch you wrote are actually deltas (_droll, _dpitch, _dyaw)

sullen sigil
#

yeah they are in the code, i dont understand how they're deltas though as you dont feed the original in?

#

oh ofc

#

modeltoworld guh

south swan
#

as in "rotate this much degrees/radians from the current orientation"

#

original orientation is taken care of by modelToWorld

sullen sigil
#

this does look suspiciously like what it was before though kekw

little raptor
#

it is wrong tho think_turtle

#

your _dir and _up are already in world coords

#

as far as I see in your code

sullen sigil
#

uh

#

how

#

wait in the noted bit or what ive just written

little raptor
#

aren't your roll pitch stuff in world?

south swan
little raptor
#

e.g. when you provide a yaw of 90 degrees, you face west right?

sullen sigil
little raptor
sullen sigil
#

in previous code providing [0,0,1] would make it turn until eased back down by regular breaking

#

which is just the variable being taken back down by a different script (fn_turnShip on the sqfbin)

south swan
#

pure trig = modelspace from current rotation, ja?

little raptor
#

ok then I guess it's in model then

little raptor
#

I don't know what the problem is exactly

#

but if it looked ok before, then that part was not the problem

south swan
#

except old code seemingly tried to do rotations in worldspace (which doesn't end good) blobdoggoshruggoogly

sullen sigil
#

its working though the controls are a bit fucked right now, going to test on dedi in a few

#

i.e clearly something is different to before

little raptor
sullen sigil
#

yes

#

so if i do
_ship setVariable ["KJW_CapitalShips_TargetVelocity",[0,500,0],true]; it will make the ship accelerate up to 500ms forwards or its max speed, whichever is lower

#

similar principle is done for ship turning

#

the odd part is this also reversed the direction ships are flying in for some reason

#

i.e theyre all going backwards now

south swan
#

eventually ™️

sullen sigil
#

this game engine will not beat me

little raptor
#

I guess your directions were reversed

sullen sigil
#

still juddering 🙃

little raptor
#

well yeah that part's not the issue

#

the actual motion is

#

most likely velocity vector

sullen sigil
#

xyz movement remains smooth though so thats being interpolated properly

little raptor
#

what about the plane?

sullen sigil
#

exact same thing

south swan
#

inb4 it's setVectorDirAndUp fighting with setVelocityTransformation for orientation authority 🤣

sullen sigil
#

im not using setvectordirandup

#

only initship there runs on the server and that runs once to init the ship

#

and the rest of them also only run once

#

have also str the function on the server to check and it was updated properly

#

would vectordirvisual have any difference? 🤔

little raptor
#

it does but I don't think you should use it with svt

south swan
#

but still worth trying

sullen sigil
#

yeah probably worth giving it a shot on the off chance

#

but fairly sure this is just no interpolation being done by the engine

#

oh ofc i can only use dirvisual on the old positions kekw

#

possible that could still have an impact tho, ill test

kindred tide
#

what happens if you walk on the aircraft carrier deck when it's flying

sullen sigil
#

you get teleported to its "interior"

#

so you can land on them

kindred tide
#

is the interior a static object located at [0,0,0]

sullen sigil
#

trying to come up with a clever pip solution so you can see outside it on the static ship but that can come after it works in mp first

sullen sigil
#

but otherwise yes

#

smoothly landing/taking off with vtol is quite easy

#

just have a handful of bugs that need sorting

#

but its all useless if this doesnt work first so

kindred tide
#

i'm yet to perform one experiment... i attached houses to NPC heads with a high offset and made them (houses) fly, and wanted to see what happens if i'm inside such house as it moves

sullen sigil
#

youll fall through probably

#

arma doesnt like moving and standing on stuff

kindred tide
#

in A2 there's a cargo parachute, and when my character transforms back to human from crow form, if there's such a parachute in its path to ground, it blocks the character's movement

#

even tho the parachute's moving

sullen sigil
#

arma moment

kindred tide
#

i'm yet to nail a landing on it to try to walk on the parachute

little raptor
#

that ones too slow I think

#

let me make some adjustments

sullen sigil
#

rgr

#

testing visual now

#

yeah visual still judders :/

kindred tide
#

are you sure your movement is happening in the same tick with rendering

south swan
#

no for sure

sullen sigil
#

its not

south swan
#

setVelocityTransformation pushes stuff to queue for engine to crunch at some later frame 🤣

sullen sigil
#

wasnt expecting it to work, just getting desperate lol

kindred tide
south swan
#

or just disable battleye and run 2 clients in separate windows blobdoggoshruggoogly

sullen sigil
#

me who never enables battleye

little raptor
#

try this with your submarine:

spd = 25;
duration = 5000 / spd;
heli allowDamage false;
timer = 0;
onEachFrame {
    if (isGamePaused) exitWith {};
    if (timer > duration) exitWith {onEachFrame ""};
    _dt = diag_deltaTime * accTime;
    timer = timer + _dt;
    _d1 = vectorDir heli;
    _u1 = vectorUp heli;
    _d2 = vectorNormalized [sin (200 * timer), 1, cos (200  * timer)];
    _u2 = [sin (200 * timer), 0, cos (200  * timer)];
    _up = (_d2 vectorCrossProduct _u2) vectorCrossProduct _d2;
    _p1 = getPosWorld heli;
    _v1 = velocity heli;
    _v2 = _d2 vectorMultiply spd;
    _p2 = _p1 vectorAdd (_v2 vectorMultiply _dt);
    heli setVelocityTransformation [_p1, _p2, _v1, _v2, _d1, _d2, _u1, _u2, 1, [0,0,0]];
}
sullen sigil
#

with the physx box or the plane one?

#

or both?

little raptor
#

well name your submarine "heli" 😅

#

whichever you want blobdoggoshruggoogly

sullen sigil
#

the submarine itself or the logic object? 😅

little raptor
#

I'd say the sub itself

sullen sigil
#

I can try both tbf

little raptor
#

first try it in SP to see what to expect

sullen sigil
#

no restart needed

little raptor
#

let me remove some useless stuff from it

#

ok now it's better

sullen sigil
#

i was going to turn the music off but for some reason its so funny like this

little raptor
#

why does it jump when it's near the top? think_turtle

kindred tide
#

gimbal lock maybe

#

is it using quats

sullen sigil
#

unsure, doesn't happen when using just the sub object

little raptor
little raptor
little raptor
sullen sigil
#

dedi

sullen sigil
#

think jumping is being caused by capital ships scripts tho

#

setting ownership to me (stops capital ships running) and running eachframe on server is smooth

#

yeah, spawned a box and named it heli while eachframe is on server and thats fine

little raptor
#

so in conclusion if you provide correct values, and still use 1 for interval, the result is correct

sullen sigil
#

so must be my values are still wrong meowsweats

little raptor
#

well yeah

#

take a look at that script I modified (ignore how the _u2 and _d2 were calculated, that's a mess)

#

update the position and velocity vectors like that

#

see if it makes a diff

sullen sigil
#

forgot to disable ping mb

little raptor
#

I mean how you calculate the next pos and velocity in svt

#

do you do it like that?

sullen sigil
little raptor
#

also your dir and up must start from current vectordir and up

sullen sigil
#

they do

#
private _rotation = _x getVariable ["KJW_CapitalShips_SVT_Rotation", [vectorDir _x, vectorUp _x]];
private _vectorDir = _rotation#0;
private _vectorUp = _rotation#1;
private _oldDir = vectorDir _x;
private _oldUp = vectorUp _x;
_x setVelocityTransformation [_newPos, _newPos, _velocityWorldspace, _velocityWorldspace, _oldDir, _vectorDir, _oldUp, _vectorUp, 0.999, [0,0,0]];```
tough abyss
#

is there any command to log a string in a server's rpt?

sullen sigil
#

...could be due to the position stuff?

little raptor
tough abyss
#

thx

sullen sigil
#

i swear to god if its because i dont have the old position asl there

little raptor
#

world you mean

sullen sigil
#

ye

#

done it for velocity too

little raptor
#

calculate velocity and pos like so:

_p1 = getPosWorld heli;
    _v1 = velocity heli;
    //_v2 = _d2 vectorMultiply spd;
    _p2 = _p1 vectorAdd (_v2 vectorMultiply _dt);
#

well _v2 can be whatev you want

sullen sigil
#

p2 is new position yes

#

i think i already do it like that just in reverse for p2

#
private _velocity = _x getVariable ["KJW_CapitalShips_MovingVelocity", [0,0,0]]; //returns in modelspace
private _pos = getPosWorld _x;
private _nextSecPos = _x modelToWorldWorld _velocity;//visualworld still untested
private _velocityWorldspace = _pos vectorDiff _nextSecPos;
private _newPos = _pos vectorAdd (_velocityWorldspace vectorMultiply diag_deltaTime);
//svt stuff begin
private _rotation = _x getVariable ["KJW_CapitalShips_SVT_Rotation", [vectorDir _x, vectorUp _x]];
private _vectorDir = _rotation#0;
private _vectorUp = _rotation#1;
private _oldDir = vectorDir _x;
private _oldUp = vectorUp _x;
private _oldVel = velocity _x;
_x setVelocityTransformation [_pos, _newPos, _oldVel, _velocityWorldspace, _oldDir, _vectorDir, _oldUp, _vectorUp, 0.999, [0,0,0]];```
#

if vsc helps (probably not because of my font)

little raptor
#

try it blobdoggoshruggoogly

sullen sigil
#

ya doing so now

#

tcadmin just takes fucking forever to show updates

kindred tide
#

oh man i just found this in the cfg transportVehiclesCount , does this mean i can vehicle1 moveInCargo vehicle2; ?

sullen sigil
#

ok thank god its not because of that

#

its still juddering

kindred tide
#

i see

#

i have my own thing for this already tho lol

sullen sigil
#

oh, just to make speeding up smooth

#

my only guess is my values are still wrong then

#

but i have no clue why

little raptor
#

diag_deltaTime is based on FPS, not in-game time

sullen sigil
#

ya i gotchu

#

yeah its a lack of engine interpolation not just render being slow either, just double checked the vectorup on client and its only changing in the jerks

#

big brain moment

#

calcs are wrong and game is correcting them (i think?)

#

pause at any point

little raptor
#

what is wrong?

sullen sigil
#

the systemchats are the values i use for the svt then the actual vectordirandup

#

they dont match meowsweats

little raptor
#

like I said they're delayed

#

svt is not instant

sullen sigil
#

oh, nvm then

#

would explain why theres stuff being repeated

sullen sigil
#

really cannot figure this out at all

ornate whale
#

How to combine two conditions (>0 and <=1.35) in one simple select expression here? targetedBy = units opfor select {_x knowsAbout Hardy <= 1.35 && >0};

sullen sigil
#

have to do _x knowsabout Hardy > 0

winter rose
#

you can do per group as knowsAbout is shared across group units

astral bone
#

I have a weird question, I am curious about a way to have scripts I use alot be put into a single spot, without making them into an addon? Such as, for example (although I doubt this is possible) a folder in profile with a config file and fn_function.sqf files

sullen sigil
#

use advanced developer tools and you can save them

kindred tide
#

none of my scripts are in the addon

#

that would require restarting the game and repacking the pbo every time i change something

astral bone
#

I am more thinking about stuff to call from the mission. But then useable across missions.

sullen sigil
#

easy

kindred tide
#

in your init EH you can just pass the object type as parameter and call some global INIT function that from there loads an appropriate SQF etc, none of this will have to be in the pbo except for the init EH in the config

#
class EventHandlers
{            
  init = "(_this select 0) execVM 'module_framework\register.sqf';";
};    ```
astral bone
#

Right now I have it set up to be fn_exmaple.sqf via description.ext

#

oh yea- so what I want, probably no

little raptor
#

you just make a folder in your arma 3 installation folder (or symlink to there), and put your stuff there

#

then you can use execVM, etc. normally

astral bone
#

filepatching?

little raptor
#

it's a command line option (also available in launcher)

#

-filepatching

sullen sigil
little raptor
#

the problem could be how you read those values in the next frame

#

to calculate the new values

#

for example, how do you calculate the new velocity?

astral bone
#

although that is interesting x3

little raptor
#

without making a mod, no

astral bone
#

aww

sullen sigil
#

new velocity is calculated by a different pfh which takes config values and adds to _MovingVelocity variable

astral bone
#

still tho, interesting.

sullen sigil
#

that's the variable that gets used in the ship movement function

astral bone
#

oh how would it interact with MP? xD

little raptor
#

not recommended for MP at all

sullen sigil
#

orientation has KJW_CapitalShips_TargetOrientation which doesn't actually do anything

little raptor
sullen sigil
#

wdym? in the svt? meowsweats

little raptor
#

you need a value to start with

sullen sigil
#

[0,0,0] is default value for it

#

same for orientation

little raptor
#

I mean the value that you start with and update

#

e.g. you take the current velocity, use acceleration to add to it, and that becomes the new velocity

#

kind of thing

sullen sigil
#

yes thats what i do

#

with acceleration just being how much velocity can increase in 1 second

astral bone
#

just get kicked from every server I join xD
although- What about a syslink in the mission folder?

little raptor
astral bone
#

Does that need file patching or-

sullen sigil
#

getvariable yeah

#

i dont ever read the current velocity for modifying it

little raptor
#

that could be a problem

#

not sure but could

#

verify if velocity and your fake one are different

sullen sigil
#

I mean, I can just change _x getVariable ["KJW_CapitalShips_MovingVelocity", [0,0,0]]; //returns in modelspace for velocityModelspace _x;

little raptor
astral bone
#

could I do a symlink* without filepatching

little raptor
#

yes

#

afaik

proven charm
#

I'm using hardlinks to have same files across multiple mission folders

#

not sure if that's the ideal but it seem to work

sullen sigil
#

ffs forgot to disable ping again

#

sorry

#

can try use velocitymodelspace instead of my fake velocity and see how that goes?

#

though the fake velocity is just used to tell my script what to set as the new velocity meowsweats

little raptor
#

_x modelToWorldWorld _velocity;//visualworld still untested
wut? you do know that vectorModelToWorld exists right?

sullen sigil
#

...that'll be why it was still sinking downwards 😅

#

thanks lol

little raptor
#

your equation is backwards. that's why

sullen sigil
#

which one?

little raptor
#
private _nextSecPos = _x modelToWorldWorld _velocity;//visualworld still untested
private _velocityWorldspace = _pos vectorDiff _nextSecPos;
#

it should be _nextSecPos vectorDiff _pos

sullen sigil
#

yeah already reversed that

little raptor
#

but again just use vectorModelToWorld:

_velocityWorldspace = _x vectorModelToWorld  _velocity;
sullen sigil
little raptor
#

no

sullen sigil
#

I'm confused

little raptor
#

see what I wrote

sullen sigil
#

yeah

#

surely though you'd have like 10000ms velocity if 10000m away from [0,0,0] that way

little raptor
#

with your equation (the one you just posted) yeah

#

it's completely wrong

#

at least the old one just had the dir wrong

sullen sigil
#

I'll use what you said though I don't understand it meowsweats

little raptor
#

vectorModelToWorld transforms a vector

sullen sigil
#

surely player vectorModelToWorld [0,500,0]; returns 500m in front of the player in world space?

astral bone
#

interesting

little raptor
#

modelToWorldWorld transform a position vector

#

they're different things

sullen sigil
#

i think i may be misunderstanding how the two commands work

little raptor
#

when you transform a vector its magnitude reminas the same. it just rotates it

sullen sigil
#

ah

#

i get you now

little raptor
#

when you transform a pos, you first rotate the vector (so it becomes a world vector), then add it to the object's pos

sullen sigil
#

doubt that's causing the issue though

little raptor
#

well you get a thousand m/s speed vs the correct one

#

so it does mess up the interpolation

sullen sigil
#

yeah, i mean just fixing it from what was being used before

little raptor
#

well yeah shouldn't

sullen sigil
#

i.e changing a 9e-8 to a 0

little raptor
#

it fixes the current one

sullen sigil
#

ya

#

have also checked vectordirvisual again and theres no difference at all

#

which is to be expected

#

but ive no clue whats going wrong here meowsweats

cerulean egret
little raptor
sullen sigil
little raptor
#

then your equations are wrong

sullen sigil
#

both with them all in the same pfh and changing them into functions and calling them within an eachframe

little raptor
#

it shouldn't

sullen sigil
#

even just putting the orientation stuff above the move stuff caused it to just fall to the floor
even though it was svting fine

little raptor
#

basically your loop should calculate the stuff then use them in svt:

{
  _x call Update;
  _x call SVT;
} forEach blabla;
sullen sigil
#

submarine is still slowly sinking downwards too

little raptor
#

then fix it

#

if it doesn't work then that's definitely the problem

#

you must calculate everything in very careful sequences

#

throwing them randomly into multiple per frame events is not a good idea

cyan onyx
#

Hello, does anyone have the class name for the stealth black wasp and shikra that have a dynamic loadout?

#

I have looked into cfgVehicles West and East but no luck there

little raptor
#

spawn them in 3den, then right click and select find in ... uhm ... something. don't remember what it was called

sullen sigil
#

or function call out to them etc etc

little raptor
#

not just one pfh but preferably also the same loop

sullen sigil
#

so ideally don't have function calls out of it?

little raptor
#

I don't know what you mean by "function calls out of it"

sullen sigil
little raptor
#

you can try that too blobdoggoshruggoogly

#

make sure they're done in correct order tho

sullen sigil
#

I had done that before but it still broke it meowsweats

#

Think it might be worth just rewriting most of this into one pfh

little raptor
#

it is yes

vagrant trellis
#

any way to make a button that will allow players to change sides
example you walk up to a locker "you spawn in as a civ" then you scroll wheel and it will say swich sides "bluefor" is that a thing?

vagrant trellis
#

was just about to do that thanks

cyan onyx
#

Nice, got the wasp and shikra to work, thanks

sullen sigil
#

rewrote it all in one go, works first time... hmmmmmmm

#

sus

astral bone
#

symlink seems to work?

winter rose
sullen sigil
#

and ofc the second i update it finally on tcadmin i notice an issue

#

meh, i can test turning while im at it

proven charm
#

I used hardlinks for other cases... (files)

sullen sigil
#

good news it doesnt all work first time at all

#

so, good news is it's no longer changing how juddery it is with distance & its all in one function now
bad news is i have not got a clue how to resolve it, advice would be appreciated 😅
https://sqfbin.com/oqekekeninejogilanek

#

(youre welcome for the proper indentation lou)

winter rose
#

that made me click

sqfbin gave up on you on syntax highlighting though 😄

sullen sigil
#

i think its having issues on notes at the start of dumps or something

#

nope, it just straight up doesnt do it if i remove the note at the start either kekw

little raptor
#

iirc it's related to #

winter rose
winter rose
#

still missing a lot

#

ah yep, use select

#

# is an abomination

sullen sigil
#

im just find and replacing # out in future then 🤷

sullen sigil
little raptor
sullen sigil
#

think the issue could be to do with velocity looking like this when stationary

little raptor
#

is it smooth now?

sullen sigil
#

no, but the juddering doesn't get worse with distance now

#

i'll record a video give me a second to sort the server

sullen sigil
# sullen sigil

whereas here you can see it gets jerkier the further the camera is from it

little raptor
#

also instead of this whole thing:

if (_x < _currentTargetVel) then {
    _newVelocityModelspace pushBack ((_currentModelVel + ) min _currentMaxVel);
} else
{
    if (_x isEqualTo _currentTargetVel) then {
        _newVelocityModelspace pushBack _x;
    } else { //Less than. There is likely a better way to do this, however I am tired and just want this to work ffs
        _newVelocityModelspace pushBack ((_currentModelVel - ((_config_Deceleration select _forEachIndex)*diag_deltaTime)) max (_currentMaxVel * -1));
    }
};

you can just write:

_diff = _currentTargetVel - _x;
_sign = [1, -1] select (_diff < 0);
_dv = (_config_Acceleration select _forEachIndex) * diag_deltaTime;
_new = _x + _sign * (abs(_diff) min _dv);
_newVelocityModelspace pushBack _new;

it doesn't take into account the _currentMaxVel thing but you should not let _currentTargetVel become greater than that value in the first place

sullen sigil
#

yeah moreso concerned if people set it higher than that
but I'll do that, thanks

little raptor
#

this part doesn't make any sense to me:

{
    private _turnSpeed = _config_TurnSpeed select _forEachIndex;
    _newOrientation pushBack ((_x min _turnSpeed) max _turnSpeed * -1);
} forEach _targetOrientation;
#

you're using _x the same as speed? wut?

#

is targetOrientation a diff?

sullen sigil
#

targetOrientation is the yaw roll pitch thing

little raptor
#

well I know

#

but is it a diff?

#

how is it provided?

sullen sigil
#

diff being differential? I'm confused meowsweats

little raptor
#

difference

sullen sigil
#

yes

#

delta in modelspace

little raptor
#

how do you calculate KJW_CapitalShips_TargetOrientation tho?

sullen sigil
#

that's just in a pfh for the pilot controls for

private _roll = diag_deltaTime *5* (inputAction "AirBankLeft" - inputAction "AirBankRight");
private _yaw = diag_deltaTime *5* (inputAction "MoveForward" - inputAction "MoveBack");
private _pitch = diag_deltaTime *5* (inputAction "HeliRudderRight" - inputAction "HeliRudderLeft");
_ship setVariable ["KJW_CapitalShips_TargetOrientation", [_yaw, _roll, _pitch]];```
#

but im just using setvariable in zeus

little raptor
#

as in they're constant?

#

when you test?

sullen sigil
#

yes

little raptor
#

well from what I see your code looks almost correct

#

the way you calculate velocity doesn't seem to be

sullen sigil
#

doesn't seem to be? 😅

little raptor
#

yes. using the model coordinates for calculating new velocity is not right

#

let me ask you another question

#

does the ship always move "forward"?

#

as in can it have velocity to the side or up (like lift)?

south swan
#

very sane assumption/simplification if we're not intending to implement AFM for it 🙃

sullen sigil
#

i.e controlsnly have forwards

little raptor
#

do you simulate lift?

tulip ridge
#

There's not a way to check if a player is aiming down sights right?
Been looking around on the wiki but wanted to double check

little raptor
#

aiming down as in zooming or you actually just mean aiming?

sullen sigil
#

all 3 numbers need to work

#

in an ideal world

#

but at the least forwards and upwards

little raptor
#

well for now I'd say just use speed

south swan
#

still sounds like a perfectly fine arcade "physics" blobdoggoshruggoogly

little raptor
#

i.e. just a single component

tulip ridge
sullen sigil
#

as in just take #0 and #2 of the current velocity leopard?

little raptor
#

but if you meant zooming you could use the FOV

tulip ridge
#

That's what I figured, just wanted to see if I was missing something

#

Thanks 👍

sullen sigil
#

though would be nice if i would be able to just have all directions of motion from the off so i never have to touch this damn function again

south swan
#

cameraView returns "GUNNER" if player is ADS-ing blobdoggoshruggoogly

sullen sigil
#

gunner player

little raptor
#

just for a quick test

sullen sigil
#

roger, thanks 🙂

little raptor
#

wait let me correct one thing 😅

#

I forgot to move _newPosition lower meowsweats

#

anyway, it should work unless I forgot to edit something

sullen sigil
#

i shall test now, thanks

little raptor
#

I'm curious if it looks ok now. if it does then your velocity computation was the main culprit

sullen sigil
#

and if it doesnt then we must make a sacrifice to miller

#

its now always going backwards and is still juddering in its turning 😅

little raptor
#

what is _targetOrientation?

#

its now always going backwards
if it is it means your ship is reversed blobdoggoshruggoogly

sullen sigil
#

i set it to [0,0,40]

sullen sigil
little raptor
#

what is _newOrientation?

sullen sigil
#

just orientation clamped to config values

little raptor
#

I know I mean its value

sullen sigil
#

ah, sub's is turnspeed[] = {0.05, 0.05, 0.05}; //Maximum turning speed. Yaw, roll, pitch.

south swan
#

wot. Why does shooting 3 wheels of a quadbike change its origin? (at least it moves like 1-1.5 meters down when being setPosASL'd every frame) notlikemeow

little raptor
#

it changes its land contact

#

I used the matrices to rotate the dir and up

#

instead of vectorModelToWorld

sullen sigil
#

I think that makes sense

sullen sigil
#

nope, still juddering and is going forwards when unwanted notlikemeowcry

tough abyss
wary needle
#

anyone have an aas comp, like in squad where the "frontline is the active objective". i know its possible without much scripting, but i really dont want to do it

finite bone
#

Is Global Exec JIP?

granite sky
#

Depends how you do it.

wary needle
#

for some reason i cant get this sqf file to run on pub zeus

finite bone
granite sky
#

When you run remoteExec you can choose whether it's JIP or not.

finite bone
#

Yea remote Exec is fine

#

but when you execute via Global exec?

granite sky
#

debug console "global" button is not JIP, if that's what you mean.

finite bone
#

ah ok then

granite sky
#

It's just a plain remoteExec with target 0.

granite sky
#

well, probably remoteExecCall.

tough abyss
wary needle
#

kinda. say we have 3 objs a, b, c

#

blue captures a and b

#

and red gets c