#(JustinS) Cancel jump without determine cancelled?

59 messages · Page 1 of 1 (latest)

sly epoch
#

Context (not necessarily important):
I'm trying to make NPC Vehicles, though instead of being able to jump, I want the player to boost the vehicle. I want the boost speed to be accurate, which currently it isn't. When narrating the velocity, it goes from 0.7 (correct), to 0.22 (not correct), and 0.38 (not correct). This is when cancelling the on player steers npc event when jumping, and adjusting the npcs velocity.
I think I know an alternative way, which is, instead of cancelling the entire event (and stopping all movement)... I just stop the y velocity from rising. My question is, how do I stop an integer from getting above 0? And if it goes above 0, how do I make it 0? I know I can just use an if statement for this, though is there a tag for this?

In short:
What's the tag for limiting a decimal from going above 0

wise nymphBOT
#

(JustinS) Cancel jump without determine cancelled?

wise nymphBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

sly epoch
#

So, is there another way to cancel jumping, WITHOUT cancelling the rest of all the movement?

raw tulip
#

!event steers

civic ivyBOT
# raw tulip !event steers
Group

Player

Event Lines

player steers entity player steers <entity>

Triggers

every tick that a player is controlling a vehicle.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.entity> returns the EntityTag being steered by the player.
<context.sideways> returns an ElementTag(Decimal) where a positive number signifies leftward movement.
<context.forward> returns an ElementTag(Decimal) where a positive number signifies forward movement.
<context.jump> returns an ElementTag(Boolean) that signifies whether the player is attempting to jump with the entity.
<context.dismount> returns an ElementTag(Boolean) that signifies whether the player is attempting to dismount.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

raw tulip
#

if context.jump, cancel? or am i misunderstanding

sly epoch
#

Afaik you can't just cancel the jump

#

you cancel the entire event

#

thats my whole issue here

#

and Ive tried a lot but still cant find a way to cancel jump, and get proper movement

raw tulip
#

uh

#

you should be able to?

#

there's a script that does this, but its ancient old now, lemme see if i can find it

sly epoch
#

Issue with that and most other scripts that dont use npcs: you cant traverse over different heigh terrain

#

Also the shift for boost doesnt work for me

#

oh it's ctrl

#

it's very smooth though

#

much smoother than with npcs

#

I could use this, though I'd need to add logic for going over different height terrain

#

And it complains about this line - define speed <tern[<context.dismount>]:10||1>

#

Tag tracer: Tag base 'tern' does not exist.

sly epoch
#

Thanks for linking that

midnight pebbleBOT
#
Resolved

Thread closed as resolved.

sly epoch
#

Coming back to this. I decided to use the chicken script together with an uncontrollable npc. Weirdly enough, this works perfectly

midnight pebbleBOT
#
Thread Reopened

Thread was manually reopened by @sly epoch.

sly epoch
#

The only thing I don't really like about the script is that whenever you look down, the velocity goes down signifcantly. If you look all the way down, you dont move at all. Same for looking up.
I've tried a few random things to no prevail. https://paste.denizenscript.com/View/124481
Does anyone know how I could prevent that from happening, and keep the same speed, no matter what pitch?

dapper girder
#

mount an armor stand to the mov

#

then teleport the mob on move

#

i think that fixes stutter??

#

or

#

!t with_y

civic ivyBOT
# dapper girder !t with_y
Cannot Specify Searched Tag

Multiple possible tags: <VectorObject.with_y[<number>]>, <LocationTag.with_yaw[<number>]>, <PolygonTag.with_y_min[<#.#>]>, <PolygonTag.with_y_max[<#.#>]>.

dapper girder
#

raytrace down and get the y value of the lowest point

#

the add that to the velocity equation

sly epoch
#

what

hollow spireBOT
dapper girder
civic ivyBOT
sly epoch
#

No need to fix anything that works

#

Just need to fix looking up and down changing the velocity

dapper girder
#

oh

#

then set the pitch to 0 no?

sly epoch
#

the players pitch?

#

oh

#

I could do .location.with_pitch[x]

#

ohhh

#

thats smart

#

Ill test it

#

You're a geniius

#

how did I not think of that

#

Thanks

#

Seems to work