This is a rewrite of my former diagonal stairs toturial which unfortunately got lost with the latest database error a few months ago...
Part 1 :: Introduction
This tutorial's purpose is basically to teach you guys how to make 'real' diagonal stairs as in being able to walk on them and not 'skip' all of them with an event at the beginning of the stairs (a method I dislike because you take the control from the player in every single situation, which is bad in my opinion...).
This is once again event-based, though there's a little scripting part. You don't need to know much about events or scripts, as I'll try to explain it newbie-proof and have the script ready, but you should of course know where to find the event commands and similar easy stuff
Part 2 :: Event Setup
Okay, so for this example, we're going to have from-upper-left-to-lower-right stairs. This is a sketch on how the stairs will look like, as well as a second picture showing the events we'll need...
http://img64.imageshack.us/img64/8494/s1ar0.png[/img] http://img64.imageshack.us/img64/4884/s2yk6.png[/img]
As you can already see, we'll need a lot events, but as they'll all be triggered on touch, they shouldn't cause much lag, nor much efford, as you only need three events which you can copy&paste then.
For the events, as you can also see in the second picture, we'll need three different ones - one center event handling all directions, and two border events just handling the left and right movement... you can tell what the events do by looking at the event code that can be seen in the following three pictures...
You can copy the setup from these pictures. The only thing you need to pay attention to that's not quite shown in the picture is to select an impassable, invisible tile for all of the events.
Part 3 :: The Scripting Bit
The following script is needed to make the whole event stuff working. While it was possible in RM2k3 without this, it isn't anymore in RMXP because of a simple reason: You're no longer allowed to move from impassable tiles to passable ones for whatever reason. I have no idea why Enterbrain changed this, but I think installing this script will only get you good things... if you discover any inconcenienced with this script, please let me know. By the way, besides deleting the default comments, commenting-out the three lines you can spot in there, and of course the header comments, the script has been left unchanged.
To install it, simply paste it somewhere below the default Game_Character script.
Part 4 :: Outroduction
I hope people will use this tutorial to improve their stairs and their maps with it... because that's basically what this tutorial is about, I'm finished with one sentence! XD
Part 4 :: Credits & Thanks
BlueScope
Raiju for indirectly reminding me about posting this again.
Part 1 :: Introduction
This tutorial's purpose is basically to teach you guys how to make 'real' diagonal stairs as in being able to walk on them and not 'skip' all of them with an event at the beginning of the stairs (a method I dislike because you take the control from the player in every single situation, which is bad in my opinion...).
This is once again event-based, though there's a little scripting part. You don't need to know much about events or scripts, as I'll try to explain it newbie-proof and have the script ready, but you should of course know where to find the event commands and similar easy stuff
Part 2 :: Event Setup
Okay, so for this example, we're going to have from-upper-left-to-lower-right stairs. This is a sketch on how the stairs will look like, as well as a second picture showing the events we'll need...
http://img64.imageshack.us/img64/8494/s1ar0.png[/img] http://img64.imageshack.us/img64/4884/s2yk6.png[/img]
As you can already see, we'll need a lot events, but as they'll all be triggered on touch, they shouldn't cause much lag, nor much efford, as you only need three events which you can copy&paste then.
For the events, as you can also see in the second picture, we'll need three different ones - one center event handling all directions, and two border events just handling the left and right movement... you can tell what the events do by looking at the event code that can be seen in the following three pictures...
http://img453.imageshack.us/img453/3539/e1aq1.jpg[/img]
http://img117.imageshack.us/img117/3086/e2wi9.jpg[/img]
http://img453.imageshack.us/img453/574/e3kj1.jpg[/img]
You can copy the setup from these pictures. The only thing you need to pay attention to that's not quite shown in the picture is to select an impassable, invisible tile for all of the events.
Part 3 :: The Scripting Bit
The following script is needed to make the whole event stuff working. While it was possible in RM2k3 without this, it isn't anymore in RMXP because of a simple reason: You're no longer allowed to move from impassable tiles to passable ones for whatever reason. I have no idea why Enterbrain changed this, but I think installing this script will only get you good things... if you discover any inconcenienced with this script, please let me know. By the way, besides deleting the default comments, commenting-out the three lines you can spot in there, and of course the header comments, the script has been left unchanged.
To install it, simply paste it somewhere below the default Game_Character script.
Code:
#==============================================================================
# Impassable Tiles Movement Fix Script
#------------------------------------------------------------------------------
# Script by BlueScope
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
def passable?(x, y, d)
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
unless $game_map.valid?(new_x, new_y)
return false
end
if @through
return true
end
#unless $game_map.passable?(x, y, d, self)
# return false
#end
unless $game_map.passable?(new_x, new_y, 10 - d)
return false
end
for event in $game_map.events.values
if event.x == new_x and event.y == new_y
unless event.through
if self != $game_player
return false
end
if event.character_name != ""
return false
end
end
end
end
if $game_player.x == new_x and $game_player.y == new_y
unless $game_player.through
if @character_name != ""
return false
end
end
end
return true
end
#--------------------------------------------------------------------------
end
Part 4 :: Outroduction
I hope people will use this tutorial to improve their stairs and their maps with it... because that's basically what this tutorial is about, I'm finished with one sentence! XD
Part 4 :: Credits & Thanks
BlueScope
Raiju for indirectly reminding me about posting this again.