Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
Gary The Duck

Accelerate and Braking Script

Recommended Posts

Hello all!

I has just started with a subway driving RMXP game ( :P ) but the only problem is, I need to make the train accelerate and brake, right? But how?! :angry: So does anyone know were I can find a script like that ...or maybe make one for me? :unsure:

 

Thanks in advance.

Share this post


Link to post
Share on other sites

if you're doing it a simple way you can do a common event parallel, with

 

conditional branch, button "[]" is being pressed,

player route, increase speed, and the same similar thing...

 

basically you can do it similar to a dash system where there is no else so if you let go, the train wont slow down.

 

=3

hope this helped.

Share this post


Link to post
Share on other sites

if you're doing it a simple way you can do a common event parallel, with

 

conditional branch, button "[]" is being pressed,

player route, increase speed, and the same similar thing...

 

basically you can do it similar to a dash system where there is no else so if you let go, the train wont slow down.

 

=3

hope this helped.

 

Let's see.

It depends on how specific you want the speed mods to be.

If you send me the game file or go into more detail about how you want your engine to work I could help you.

I don't do simple things with events, I go all out =p

A good example would be...if I were to make a demo

I'll post one this evening.

Share this post


Link to post
Share on other sites

Here is the demo I promised. =p

I hope it works for you. The technique I used is a little linear and primitive but it does the job.

 

Oh yeah, and if you want the dust to work for the player going down as well in this example you can create the high lighted event code in this screenshot, and paste it into the events named "Dust" right above the part in each one where it says: "Set Event Location: This event"

 

 @>Conditional Branch: Player is facing down
    @>Control Variables: [005: Y]-=8
    @>
  :  Else
   @>
 : Branch End



Paste that ABOVE the Set Event Location Command. And the dust will work for the player facing down as well. Do it in each "Dust" event. They are all in a row you can't miss them.

 

Still confused?

Shot1-2.jpg

Happy eventing!

Subway Demo.zip

Share this post


Link to post
Share on other sites

I'm sorry to say it but it doesn't work. :o I'm pressing the action button but nothing is happening. (It only worked the first time :huh:)

Share this post


Link to post
Share on other sites

I'm sorry to say it but it doesn't work. :o I'm pressing the action button but nothing is happening. (It only worked the first time :huh: )

 

@Gary The Duck - just keep pressing the action button = (C or spacebar)

it's not setup to just hold to accelerate... is that what you wanted?

 

@Tosharu - great job with this, with just a few touches... you just might me able to make a "Spy Hunter" ^,^

FYI - when you hold the brake the dust always shows (even when you are at a stop or haven't started to move)

 

~(G/A//\/\|E|F/A(C|E

Share this post


Link to post
Share on other sites

This is quite a neat little system!

 

 

I wouldn't of been able to think of that if I needed to!

Share this post


Link to post
Share on other sites

This is quite a neat little system!

 

 

I wouldn't of been able to think of that if I needed to!

 

I love eventing in rmxp. With a few changes I could make it so that the dust doesn't show if the player IS stopped.

And @Gary: All you have to do is hold the action button AND the directional key. If you let go of the action button and keep holding the directional key you will slow down over time.

 

A tip to other eventers: If you want to change the parameters for this just change some of the waits in these events.

And if you REALLY don't want the dust to show up if the player is stopped. Go into the dust event, and change the variable conditions on the page to "Subway Speed" and make it "Is greater than 1"

That'll make it so that if the subway speed is reduced already the dust doesn't show at all. =p I'd post a screeny but I'm too lazy right now, it's pretty straightforward.

 

And @Kiriashi:

Do remember that events are just a short cut to the "Interpreter" engine, you can throw values around, and conditions for values just like regular syntax in a programming language. That's how I see it anyways. I do know some simple ruby commands cause I had to learn for a few things.

 

Additional ideas for eventers:

 

If you really want something cool. you could make some paralell process events that refer themselves to a "Coordinates" list. And make a switch for each of these "Coordinates"

Then, once every loop the event checks those specific variables to see if the player's mapx and mapy match the location of the "powerup" or "powerdown" so to say. If it does, you give the player that "Powerup" or "powerdown" by reffering to an index number. Instead of giving the player the powerup directly through that event you can make a switch called "Power_Up", make it true. Then make the conditions for all the other events in a conditional branch for that switch to be off so they don't get "multiple" powerups, but only recieve one of them upon a collision. and.. if you really want to get nifty with it.. you could erm... create a queu system using a script array and use the .push script command, in a loop ie

 

 #add to powerup queu
 powerup=$game_variables[010: Queu count]
 ind=$powerups[powerup]
 for i in 1..ind

or something like that.. too lazy to type out a full example... you wouldn't need script to do it. you'd just have to set aside a group of variables and use a batch variable/switch command.

using an array might actually slow down processing time as it has to loop for each instance of itself...

 

but anyways.. keeping it simple.

You could just.. uh.

 

 

for i in $game_variables[10]..$game_variables[11]
if $game_variables[i]=1
#powerup condition for powerup type 1
end
if $game_variables[i]=2
#powerup condition for powerup type 2
end
if $game_variables[i]=3
#powerup condition for powerup type 3
end
end

 

Basically my way around scripting, is I'll use a variable if I don't know how to do something in a script. Then, I'll use one of those variables to trigger another event with a hybrid of script, and event commands. it works. But yeah.. say you have a common event with that code you could just refer to it through a player touch event. and make one of the variables in the queu equal to a power up index.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...