#how to check if rider rotation is same as ride?

1 messages · Page 1 of 1 (latest)

prisma siren
#

Help pls, I'm trying to fix this since min 4 months

prisma siren
#

@silent rock sorry for pinging, but why did my last post got deleted?

silent rock
#

I can't say; I'm not sure, sorry.

prisma siren
#

Oh

#

Damn, I'm on this problem for so long now

#

I'm remembering just to check if there is an rotation and than run the gametest the whole time until the gametest detects that the rotation is same

#

Would be event check and than speed function

vital fractal
#

You have a rotation query right?

#

Just do
v.rot1 == v.rot2

#

Then pass

prisma siren
#

But not sure about up and down rotation

vital fractal
#

query.eye_target_x_rotation
query.eye_target_y_rotation

#

Use these

#

Why do you need this btw?

#

I can't seem to think of any way this is useful for

prisma siren
#

Sure these will return 0 ?

prisma siren
#

(Signal when he moves his head)

vital fractal
vital fractal
prisma siren
#

Oh

prisma siren
#

But not sure if that is even possible

vital fractal
prisma siren
vital fractal
#

could you send your code.

prisma siren
#

K

#
},
    "controller.animation.turn": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "turn": "\n      (\n  (\n    (\n      q.has_player_rider ? (\n        v.rider_entity -> (q.head_y_rotation(0))\n      )\n    ) != q.head_y_rotation(0)\n  ) || (\n    (\n      q.has_player_rider ? (\n        v.rider_entity -> (q.head_x_rotation(0))\n      )\n    ) != q.head_x_rotation(0)\n  )\n) && q.health >= 10 && q.mark_variant == 3"
            },
            {
              "hover": "q.has_rider && q.mark_variant == 2"
            }
          ]
        },
        "turn": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "@s flying",
            "/say fly"
          ]
        },
        "hover": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "/function glide"
          ]
        }
      }```
#

@vital fractal

#

And yea, the \n doesn't cause the issue that it's always true

#

But u probably know

vital fractal
#

You are using head rotation

#

Use target rotation

prisma siren
#

Ye

#

Did

#

Didn't changed anything I think

#

Yep

#

Don't change anything

#

@vital fractal

vital fractal
#

I think your molang is wrong too

prisma siren
#

How

vital fractal
#

You didn't define v.rider_entity

prisma siren
#

I did before

#

Idk why it's away

#

But it didn't worked

#

It was just getting the first entity

vital fractal
#

You first need to get the rider or riding array

#

With

#

q.get_ride

#

Or

#

q.get_riders

prisma siren
prisma siren
#

But idk why, but it's lost

#

Like wtf

#

Why is it not there anymore

vital fractal
#

Don't ask me

#

Just define it again

prisma siren
#

@vital fractal this was it

vital fractal
#

Hm

#
"v.player_rot = 0; for_each(v.player, query.get_riders, { v.player_rot = v.player->q.head_y_rotation(0); }); return v.player_rot;"
"q.head_y_rotation == v.player_rot"
prisma siren
#

Oh

#

Try this?

vital fractal
#

I think if you do this inside the entity that the player is riding it should work.

prisma siren
#

Oh, alr, leme try

vital fractal
#

But I wrote this quickly so it may need some fixing.

vital fractal
prisma siren
vital fractal
#

Okay

prisma siren
#

Ok

#

So it do work but than it suddenly stops

#

@vital fractal

#

And is false always

vital fractal
#

To check the value of v.player_rot

prisma siren
prisma siren
vital fractal
#

Uhmm

prisma siren
#

I never did

vital fractal
#

idk now its debugging.

#

But you say it does work

prisma siren
#

I'm kinda confused, cuz it stops after it's right once I think

vital fractal
#

Btw its really hard to match the exact rotation

vital fractal
prisma siren
#

(Ik the x rotation isn't inside, bit we gotta make the y one work first anyway)

prisma siren
#

Leme send the code

vital fractal
#

Just do text.

#

I am on phone rn I can't open files.

prisma siren
#
   },
    "controller.animation.turn": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "turn": "(q.head_y_rotation(0) != v.player_rot) && q.health >= 10 && q.mark_variant == 3"
            },
            {
              "hover": "q.has_rider && q.mark_variant == 2"
            }
          ],
          "on_entry": [
            "v.player_rot = 0; for_each(v.player, query.get_riders, { v.player_rot = v.player->q.head_y_rotation(0); }); return v.player_rot;"
          ]
        },
        "turn": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "@s flying",
            "/say fly"
          ]
        },
        "hover": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "/function glide"
          ]
        }
      }```
#

@vital fractal

vital fractal
#

Wait,
what does turn state do?

prisma siren
#

And than return

vital fractal
#

And why are you comparing up and down to left and right?

vital fractal
#

I mean
(q.head_y_rotation(0) != v.player_rot) && etc....

#

for what is it?

prisma siren
#

Because it should get executed as long as it's not the same

#

As soon as the player rotation matches it should stop

vital fractal
#

Yes and what reactivates it?

prisma siren
#

The query

vital fractal
#

Ah I see.

#

Let me rewrite it.

prisma siren
#

K

vital fractal
#
{
    "format_version": "1.10.0",
    "animation_controllers": {
      "controller.animation.tie_fighter": {
            "states": {
                "default": {
                    "transitions": [
                        {
                            "something": "q.head_y_rotation(0) != v.player_rot" 
                        }
                    ],
                    "on_entry": [
"v.player_rot = 0; for_each(v.player, query.get_riders, { v.player_rot = v.player->q.head_y_rotation(0); }); return v.player_rot;"
                    ],
                   "on_exit": [
                        "/say true"
                    ]
                },
           "something": { 
                    "transitions": [
                        {
                        "default": "true" 
                        }
                    ]
                }
            }
        }
    }
}
prisma siren
#

Oh, but it needs an second state too

vital fractal
#

Oh yeah I forgot wait.

prisma siren
#

Ah

vital fractal
#

try this to debug it.

prisma siren
#

K,

vital fractal
#

It's a simplified version

prisma siren
#

Ah

prisma siren
vital fractal
#

hmmm

vital fractal
#

And try again

prisma siren
#

Oh, k

prisma siren
vital fractal
#

Remove the on_exit at the first state and put it by the second state

prisma siren
#

Ohh

#

K

prisma siren
prisma siren
#

I removed the == and changed it to an! = back again

#

Also the fly event isn't triggering

#

@vital fractal

vital fractal
#

Uhm

#

Hmm...

prisma siren
#

Uh

prisma siren
#

@vital fractal we should try fix the other one who did worked partwise

#

(This:)

#
   },
    "controller.animation.turn": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "turn": "(q.head_y_rotation(0) != v.player_rot) && q.health >= 10 && q.mark_variant == 3"
            },
            {
              "hover": "q.has_rider && q.mark_variant == 2"
            }
          ],
          "on_entry": [
            "v.player_rot = 0; for_each(v.player, query.get_riders, { v.player_rot = v.player->q.head_y_rotation(0); }); return v.player_rot;"
          ]
        },
        "turn": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "@s flying",
            "/say fly"
          ]
        },
        "hover": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "/function glide"
          ]
        }
      }```
#

It's very confusing

vital fractal
#

@prisma siren

prisma siren
#

Oh, this looks complicated asf

prisma siren
vital fractal
#

That's actually better.

prisma siren
#

How would I do it again

#

Oh sheet, I can't get querys

#

@vital fractal

vital fractal
#

I am litterly no js expert ¯\_(ツ)_/¯

prisma siren
#

Uh

prisma siren
#

@vital fractal found the issue

#

It's the variable

#

It somehow don't set right when it stopped once

#

Because when I'm triggering speed so the hover state activates and than go back to the normal state it works again

#

But not sure how I could fix that

prisma siren
#

Welp

vital fractal
#

@prisma siren
Because the variable only works inside the default state.

#

Make sure it works in all states.

prisma siren
#

Also it's in the default state when it's not working..

vital fractal
#

When inside hover state it stops since the variable isn't updated in that state, only in default.

vital fractal
prisma siren
#

Only when switch to hover and back again

vital fractal
#

Could you send your AC

prisma siren
prisma siren
#

I can barely see when there's the sun shining on my phone

prisma siren
#
},
    "controller.animation.turn": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "turn": "(q.head_y_rotation(0) != v.player_rot) && q.health >= 10 && q.mark_variant == 3"
            },
            {
              "hover": "q.has_rider && q.mark_variant == 2"
            }
          ],
          "on_entry": [
            "v.player_rot = 0; for_each(v.player, query.get_riders, { v.player_rot = v.player->q.head_y_rotation(0); }); return v.player_rot;"
          ]
        },
        "turn": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "@s flying",
            "/say fly"
          ]
        },
        "hover": {
          "transitions": [
            {
              "default": "1"
            }
          ],
          "on_entry": [
            "/function glide"
          ]
        }
      }```
#

@vital fractal

vital fractal
#

Hmm did you already put it in the molang to scoreboard thing?

#

That usually works alright with debugging

prisma siren
prisma siren
vital fractal
#

I sen you the wiki article

#

just follow it

prisma siren
#

Yea

#

What happened to the location module? @vital fractal

vital fractal
#

What?

prisma siren
#

Because I haven't updated my script

vital fractal
#

script?

prisma siren
#

Gametest

vital fractal
#

bruh

#

#1067535382285135923