Push Box away from wall

● ARCHIVED · READ-ONLY
Started by ArsLudica 4 posts View original ↗
  1. Hello!
     

    I designed a puzzle where you need to push a box to a certain position.

    The pushing is easy (action on event makes the box "move avay" from the player).

    Now when the box is against a wall I want to move it away from the wall. Is there any easy way to do this?

    Thanks!
  2. you can have the player leave the map every time ,or "IF" I'm not mistaken, make a switch that will teleport the player to the same map.

    Because I think that when the player leaves the map everything will switch back.

    I'm not really good at making puzzles in RPG maker....But I hope I helped.
  3. Yes, there is a very simple way of doing it which Shaz came up with in response to a query from me.  The thread is here: http://forums.rpgmakerweb.com/index.php?/topic/27297-pull-an-object-as-well-as-push-it/

    You will need to read the whole thread, as it took a few tweaks to get it working perfectly.  But I have had no problems with it at all.

    EDIT

    Here is a screenshot of the event.  As you can see, it is very easy and straightforward.  Because the 2 script calls are long lines, they don't fully show up in the event screen.

    MoveRockEvent_zps5f94e860.png

    The first script call is

    e = $game_map.events[@event_id]; e.passable?(e.x, e.y, $game_player.direction)

    The second one is

    $game_player.followers.reverse_each {|actor| actor.move_backward }

    Note, that second one is part of the Set Move Route.

    What it is doing is allowing the player to move backwards as well, taking into account the fact that there are followers showing, and they have to move backwards as well.

    So the conditional script call is checking that the rock can move.  If it can, it uses the first Set Move Route which has 'Move Away from player'

    If it can't move, i.e. is stuck up against a wall, then it runs the second Set move route, which has 'Move towards player.  

    The player also moves backwards, and everything can then carry on from there.
  4. Thanks guys,

    there are some neat ideas there I'll try out!