Push to Move

Started by Blizzard, August 08, 2008, 10:28:00 am

Previous topic - Next topic

Blizzard

August 08, 2008, 10:28:00 am Last Edit: August 08, 2008, 10:30:51 am by Blizzard
Push to Move
Version: 1.0
Type: Event Behavior



Introduction

This is a fairly simple system, but some people might bother with more complicated ways to achieve this while it's actually so easy to make.


Features


  • pressing in an event's direction will move the event
  • additional conditional branch to prevent any movement if there's a wall



Screenshots

N/A


Demo

N/A


Instructions

Put this event code in any event.

Event code: ShowHide
@>Play SE: '045-Push01', 80, 100
@>Set Move Route: Player
                : $>Change Speed: 3
@>Set Move Route: Player
                : $>1 Step forward
@>Set Move Route: This event
                : $>Turn away from Player
                : $>1 Step forward
@>Wait: 8 frames
@>Set Move Route: Player
                : $>Change Speed: 4


A possible improvement is to prevent moving at all if the event can't move. In this case you need a scripted Conditional branch wrapping the event code above. This is the altered event code:

Event code: ShowHide
@>Conditional Branch: Script: $game_map.events[@event_id].passable?($game_map.events[@event_id].x, $game_map.events[@event_id].y, $game_player.direction)
  @>Play SE: '045-Push01', 80, 100
  @>Set Move Route: Player
                  : $>Change Speed: 3
  @>Set Move Route: Player
                  : $>1 Step forward
  @>Set Move Route: This event
                  : $>Turn away from Player
                  : $>1 Step forward
  @>Wait: 8 frames
  @>Set Move Route: Player
                  : $>Change Speed: 4
: Branch End


If you don't use a speed change, be sure to set the "Wait" command appropriately to 1, 2, 4, 8, 16 or 32 for the player speeds 6, 5, 4, 3, 2 and 1 respectively. (i.e. the speed was changed to 3, to a time of 8 frames is required)


Credits and Thanks


  • Blizzard



Author's Notes

You can use this code in a common event and simply call that common event from an actual event.

N-Joy! =D
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

It's simple and does the trick. Now, I've got to check other event systems to see what you mean (really, I've NEVER checked a push-event system before >.<)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews





Punn

There's a script that does this too.
I remember I did this before but it was long and no script piece was involved.

Holyrapid

I AM TRULY SORRY FOR THIS KIND OF A NECRO POST THING! But there´s one thing i don´t get, and that is why do you need to use a script snipplet to check if you can move the event? Wouldn´t it be simpler and simpler to check the ingore if can´t move box in the set move route?
That way it could be used unmodified in 2k/3...

Blizzard

I remember having some problems with that, that's why.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Holyrapid

Ok. Sorry to bring this up...

Calintz

Oh, I hadn't noticed that this was even here, Lol.
Good job instructing though.

Ryex

June 30, 2009, 11:29:48 pm #8 Last Edit: June 30, 2009, 11:31:11 pm by Ryexander
Quote from: Calintz on June 30, 2009, 04:02:32 pm
Oh, I hadn't noticed that this was even here, Lol.
Good job instructing though.

what do you mean! have you never looked at the database guide I posted? I updated it by the way, but then again you know that.
lol to think that this was one of the very first things i learned to do with events, i did it the exact same way to
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />