[VXA] moving forward

darkspot

Villager
Member
Joined
Apr 29, 2019
Messages
13
Reaction score
1
First Language
English
Primarily Uses
N/A
I'm making this racing segment, and I want the player to keep moving forward automatically and only change direction with controls, how do I achieve this?
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
I did a skiing segment perhaps like what you're thinking. I don't know how elegant this solution is, but I had an activator event that did this:

1594843112003.png

And then a parallel event that looks like this:

1594843195521.png

That only handles :LEFT; you'd want to make a similar thing for :RIGHT. Note that the above makes the player jump down and left if they can keep moving down (that's self switch 85). Otherwise, it has them move left (self switch 86).

The big script statement is essentially trying to figure out whether the player can move left+down or down+left (so it's a passability check to ensure they don't go into a square that's impassable). The 6 and 8 are directions; they use the numpad values for directions, so (8 = up, 6 = right, 4 = left, 2 = down).
You can tweak all those behaviors if you want something different.

However, when running this the player essentially only goes left or right as I've defined and cannot speed up or slow down. You could, of course, set their speed to whatever to control how fast they go.

Hope this helps a bit :)
 

darkspot

Villager
Member
Joined
Apr 29, 2019
Messages
13
Reaction score
1
First Language
English
Primarily Uses
N/A
I did a skiing segment perhaps like what you're thinking. I don't know how elegant this solution is, but I had an activator event that did this:

View attachment 151480

And then a parallel event that looks like this:

View attachment 151481

That only handles :LEFT; you'd want to make a similar thing for :RIGHT. Note that the above makes the player jump down and left if they can keep moving down (that's self switch 85). Otherwise, it has them move left (self switch 86).

The big script statement is essentially trying to figure out whether the player can move left+down or down+left (so it's a passability check to ensure they don't go into a square that's impassable). The 6 and 8 are directions; they use the numpad values for directions, so (8 = up, 6 = right, 4 = left, 2 = down).
You can tweak all those behaviors if you want something different.

However, when running this the player essentially only goes left or right as I've defined and cannot speed up or slow down. You could, of course, set their speed to whatever to control how fast they go.

Hope this helps a bit :)
Thank you so much, that really helps a lot!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Ami
--- OP Candy ---

Kids: Trick Or Treat!
Hero: Alright,here's the Candies (Give A Bunch Of Candy).
Kids: Thank you,Mister! (Running)
Hero: How cute they are…
F.Archer: Did you give them a OP Candy,accidently?
Hero: Huh?
Halloween, a day where kids are encouraged to take candy from strangers.
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
Took a break from spriting dinosaurs to carve a dinosaur pumpkin.

Little early but to all of you that celebrate it :

Forum statistics

Threads
104,670
Messages
1,007,977
Members
136,157
Latest member
Tian
Top