Status
Not open for further replies.

Jamtec01

Villager
Member
Joined
Jul 24, 2016
Messages
13
Reaction score
5
First Language
English
Primarily Uses
Hello everyone,

This is my first post. I want to create stairs and ramps which are viewed from the side and can raise the character if they walk across them. Here are some examples from FF6. If you guys could give any advice or tips I will be very grateful. Thanks!

ff6 stairs1.jpg
final fantasy 6 stairs 2.jpg
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,942
Reaction score
14,779
First Language
English
Primarily Uses
RMVXA

I've moved this thread to MV Support. Thank you.



MV Tutorials is for ones you've written yourself.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
598
First Language
English
Primarily Uses
RMMV
I've never done stairs before, but I suppose it's not entirely impossible with event script.
I don't have a stairs graphic, so bare with me on this animated GIF example.
stairstry-o.gif


Event on every step a parallel process. It's just a lightweight boolean so don't worry about a ton of processes.
PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}

The top and bottom step are different because you don't want to keep going up/down.
PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
//  if(Input.isPressed("down")||Input.isPressed("left")){ // bottom step has this line removed
//    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
//  }
  $gamePlayer._through = false;
}

PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
//  if(Input.isPressed("up")||Input.isPressed("right")){ // top step has this line removed
//    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
//  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,855
Reaction score
8,578
First Language
German
Primarily Uses
RMMV
do you want the movement to be automatic (if the player steps on one end of the stairs, he moves to the other end automatically) or manual (the player goes diagonally by pressing left/right)?

The first case can be evented, but the second case will require a plugin.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
598
First Language
English
Primarily Uses
RMMV
I can probably make my event script into a plugin, if you want one?

It takes direction keys and goes up and down on direction key press just like a plugin as is.
 

Jamtec01

Villager
Member
Joined
Jul 24, 2016
Messages
13
Reaction score
5
First Language
English
Primarily Uses
I've never done stairs before, but I suppose it's not entirely impossible with event script.
I don't have a stairs graphic, so bare with me on this animated GIF example.
stairstry-o.gif


Event on every step a parallel process. It's just a lightweight boolean so don't worry about a ton of processes.
PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}

The top and bottom step are different because you don't want to keep going up/down.
PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
//  if(Input.isPressed("down")||Input.isPressed("left")){ // bottom step has this line removed
//    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
//  }
  $gamePlayer._through = false;
}

PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
//  if(Input.isPressed("up")||Input.isPressed("right")){ // top step has this line removed
//    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
//  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}

Holy cow this worked perfectly, you are a genius! I appreciate you spending time to help me with this, it's exactly what I was trying to do. Thanks a bunch!
 

4rc4n3

Veteran
Veteran
Joined
Mar 26, 2012
Messages
54
Reaction score
4
First Language
French
Primarily Uses
I've never done stairs before, but I suppose it's not entirely impossible with event script.
I don't have a stairs graphic, so bare with me on this animated GIF example.
stairstry-o.gif


Event on every step a parallel process. It's just a lightweight boolean so don't worry about a ton of processes.
PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}

The top and bottom step are different because you don't want to keep going up/down.
PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
//  if(Input.isPressed("down")||Input.isPressed("left")){ // bottom step has this line removed
//    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
//  }
  $gamePlayer._through = false;
}

PHP:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
//  if(Input.isPressed("up")||Input.isPressed("right")){ // top step has this line removed
//    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
//  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}

Hi,

I'm really sorry for the necropost, but this script seems to be the only one working for sideway stairs in MV. I would make a new thread about the issue but the last ones created on the topic had no replies, thus I'm thinking this might be the solution.

I'm trying to edit the scripts given in this message to be able to look up and down instead of moving up and down when, you guessed right, up and down are pressed. It seems to be a simple edit but I wouldn't know how to code it, could someone please help me?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,649
Reaction score
15,280
First Language
English
Primarily Uses
RMMV
you should still make a new thread of your own. Just provide a link to this one if necessary.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

What the writer wrote: "The curtain is blue."
The readers: "There must be a hidden meaning behind this, perhaps to convey the character emotions ...".
What the writer has in mind: "The curtain is frickin' blue".
Time to share something!
hmZFwQe.png

I made these a while ago for my game. I took reference from various huts in Africa.
Have a great night! :D
I really need to buy a new mouse. Mine's keeps double-clicking and makes me waste A LOT of time eventing
How come there's no spooktober game jam? I thought horror maker games were some of the most popular genre out there...
"I didn't know X song was about that!" Uh... why? Do you not listen to the lyrics? I mean, I guess that makes sense. We live in a world where nobody listens, but everyone wants to be heard.

Forum statistics

Threads
115,843
Messages
1,093,358
Members
151,031
Latest member
Florian973
Top