Still need help with sideway stairs

● ARCHIVED · READ-ONLY
Started by 4rc4n3 10 posts View original ↗
  1. I can't believe it's been months of work on this and still I haven't solved my issue. It seems so easy I just don't understand how terrible I have to be not to fix it myself.

    Here it goes. I'm trying to use some parallaxes stairs bought in DLCs. These are sideways and thus can't be ''moved on'' properly. I've seen various solution to move the character diagonally but I want to do two things:

    1) be able to stay in the middle of the stairs (so no trigger event at the start of the stairs that moves you all the way up).
    2) I want to enter the stairs when I want to and move behind them when I want to, too. Think a bridge like (over/under) parallax.

    This thread (https://forums.rpgmakerweb.com/index.php?threads/how-do-i-create-stairs-effect-side-view.75869/) has been the closest I've managed to get, but the script call has you move when you press UP and DOWN instead of just looking up and down. I'm at a loss and would appreciate any kind of help, with a script call or not. My will of finishing my game depends on these god damn stairs.

    Thank you!

    Example of what COULD be modified to look up and down, but again I'm willing to take ANY MEANS (events, script call, anything) to resolve the issue. Thank you!

    Spoiler
    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;
    }


    TL;DR: I'm trying to have sideway stairs, I think this script call could work but I'm willing to have other solutions like events or other script calls. Thank you.
  2. 4rc4n3 said:
    I can't believe it's been months of work on this and still I haven't solved my issue. It seems so easy I just don't understand how terrible I have to be not to fix it myself.

    Here it goes. I'm trying to use some parallaxes stairs bought in DLCs. These are sideways and thus can't be ''moved on'' properly. I've seen various solution to move the character diagonally but I want to do two things:

    1) be able to stay in the middle of the stairs (so no trigger event at the start of the stairs that moves you all the way up).
    2) I want to enter the stairs when I want to and move behind them when I want to, too. Think a bridge like (over/under) parallax.

    This thread (https://forums.rpgmakerweb.com/index.php?threads/how-do-i-create-stairs-effect-side-view.75869/) has been the closest I've managed to get, but the script call has you move when you press UP and DOWN instead of just looking up and down. I'm at a loss and would appreciate any kind of help, with a script call or not. My will of finishing my game depends on these god dayum stairs.

    Thank you!

    Example of what COULD be modified to look up and down, but again I'm willing to take ANY MEANS (events, script call, anything) to resolve the issue. Thank you!

    Spoiler
    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;
    }


    TL;DR: I'm trying to have sideway stairs, I think this script call could work but I'm willing to have other solutions like events or other script calls. Thank you.
    use this instead:
    var cp = $gamePlayer; var ce = $gameMap.event(this._eventId);
    if(cp._realX == ce.x && cp._realY == ce.y) {
    if(Input.isPressed("right")) {cp._through = true; cp._direction = 6; cp.moveDiagonally(6,8);}
    if(Input.isPressed("left")) {cp._through = true; cp._direction = 4; cp.moveDiagonally(4,2);}
    if(Input.isPressed("up")) {cp.setDirection(8);}
    if(Input.isPressed("down")) {cp.setDirection(2);}
    cp._through = false;
    }
  3. Isabella Ava said:
    use this instead:

    Hi! I changed the part, however it seems ''setDirection'' actually moves your character all the way, I can't manage to have the character in place and just change the direction its facing. With your code, it just gets out of the stairs at this point haha. But thanks for trying!

    I think a solution would be to have side events blocking the way when you're entering the stairs. When I put blockers it has the desired effect. I removed a tiny bit of a line from the original post, but what if it activated a switch, so the side events would block, just like these bridge over/under tutorials?

    Here's my bottom entrance

    Spoiler
    PHP:
    if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
    
    var dir = $gamePlayer._direction;
    
    if(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;
    
    }

    and then my top

    Spoiler
    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("left")){
    
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
    
    }
    
    $gamePlayer._through = false;
    
    }

    So depending the direction it's facing, when the input is pressed, it could activate a switch, correct? I'm just thinking out loud I have no idea on how to do this lol.




    EDIT1
    Spoiler
    This could work, correct? If so the stairs movement should be good, and we could move on to the over/under thing. I guess the same switch could be used.

    BOTTOM
    PHP:
    if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
    
    var dir = $gamePlayer._direction;
    
    if(Input.isPressed("right")){
    
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8); $gameSwitches.setValue(11, true);
    
    }
    
    if(Input.isPressed("left")){ // bottom step has this line removed
    
    $gameSwitches.setValue(11, false);
    
    }
    
    $gamePlayer._through = false;
    
    }


    TOP


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

    EDIT2:

    The previous edit worked ok but for a single thing, a the bottom of the stairs, when I look up, it seems the move is registered BEFORE the switch is activated, so I MOVE FIRST and then the switch is activated. That means, the character actually moves and don't just ''look'' in a direction. I made sure the switch activate was going first in the script call but it's still not working. I also tried separating it on two different event line directly in RPG maker, doesn't work either.
  4. @4rc4n3 setDirection won't move the Player. And i think you should use 1 parallel event only to control this "stair system",
    if you put those code into every stair steps, it may cause lagging
  5. Isabella Ava said:
    @4rc4n3 setDirection won't move the Player. And i think you should use 1 parallel event only to control this "stair system",
    if you put those code into every stair steps, it may cause lagging

    This is the event, straight copy/paste from your text. It's the only parallel event on the map. If I press UP while standing on the event, the character moves. If I press DOWN too, it will move down.

    Are you saying it should not do that? It's the only event on the map, I don't know anything that could cause that to malfunction.

    @Aloe Guvner Thank you for the link but I've already tried that and it wasn't working for me, which is why I moved on to something else. I've been working on these stairs so long I don't even remember what was the issue with that specific plugin but I'm glad it worked for you!
  6. @4rc4n3 that because it's a parallel event, it run separately in same time as system.
    So when you press 'down' key character just move down as usual.
    Now if you run this code once anywhere, before enter stairs (replace x with switch's ID)
    var cmv = Game_Player.prototype.moveStraight;
    Game_Player.prototype.moveStraight = function() {
    if(!$gameSwitches.value(x)) {cmv.call(this);}};
    now if you turn switch X on when you ENTER Stairs and turn it off AFTER go out of Stairs,
    i suppose your stair system should work
  7. Isabella Ava said:
    @4rc4n3 that because it's a parallel event, it run separately in same time as system.
    So when you press 'down' key character just move down as usual.
    Now if you run this code once anywhere, before enter stairs (replace x with switch's ID)

    now if you turn switch X on when you ENTER Stairs and turn it off AFTER go out of Stairs,
    i suppose your stair system should work

    I changed the X with 11, which is my switch number. As soon as I talk to this event, my character can't move anymore and the event is not deleted. I tried without the Erase Event command, same result. I wouldn't dare to say the game freezes, it seems more like the script is repeating itself over and over but again I know nothing about this so I don't really know.

    I feel super bad because I can't manage to make your solutions to work yet you take all this time trying to help me. I appreciate it so much. I'm sorry.

    Since that didn't work, I tried something on my own. It's a case right in front the beginning, as you can see on the picture, that activates the switch the tile before, so I can't move top. It's surely not perfect and flaws might be discovered later, but what do you think of such a system? B are blocks activated by the switch, so when I look, it's blocked and the character just face the direction.
  8. @4rc4n3 well, i think that's an idea, as long as it work it will be great.
    Your method however has 2 problem:
    1, Complex to setup
    2, Extremely complex for long stair (Lagging)

    Well actually i think you should just use plugin instead :) there are some plugins out there for stair moving, have you tried them all?
  9. Isabella Ava said:
    @4rc4n3 well, i think that's an idea, as long as it work it will be great.
    Your method however has 2 problem:
    1, Complex to setup
    2, Extremely complex for long stair (Lagging)

    Well actually i think you should just use plugin instead :) there are some plugins out there for stair moving, have you tried them all?

    I believe I tried every plugin stairs related and none were working for my needs. I agree this is over complex, maybe I should just revisit my expectations. I however still want to thank you so much for your work. I swear if I can make it work I'll release a tutorial on it. I think I'll take a break to explore the plugins, I think what I did at the moment SHOULD work. We'll see!