Okay, so I got a nice script for isometric gameplay/height but the real issue with it was that to get to many places you'd end up tacking which is even more noticable and awkward in isometric gaming than it is in overhead. I found a basic (tile-based) diagonal movement script that allowed for 8-directional sprites and put that in the game.
The isometric script worked by creating a sub-map for events/blockages and a visual map for the isometric tiles so up/down/left/right movements are translated to diagonal movements and diagonal movements in the diagonal-movement script became straight. To call this awkward to control is an understatement. So I set about changing the controls so that this was corrected - up became diagonally up/right and so on. This was largely achieved by swapping around the 1/3/7/9 and 2/4/6/8 values in the diagonal movement and default player scripts.
The only problem this has created thus far is that whilst movement typically moves as it should the first moment you press up/down/left/right the character moves diagonally to the right for one square before continuing on its straight course. This only ever happens when you go from no input/movement to pressing a movement key. If you immediately switch from moving, say, up to down this will not occur. There is no issue with the actual diagonal movements either. What simple element have I missed here?
#==============================================================================
# Test
#==============================================================================
#==============================================================================
# ¡ Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
alias update_para_quarter update
def update
update_para_quarter
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# •ûŒüƒ{ƒ^ƒ",ª‰Ÿ,³,ê,Ä,¢,ê,ÎA,»,Ì•ûŒü,ÖƒvƒŒƒCƒ,,[,ðˆÚ"®
case Input.dir8
when 4 # ¶‰º,ɈÚ"®
move_lower_left
when 2 # ‰E‰º,ɈÚ"®
move_lower_right
when 8 # ¶ã,ɈÚ"®
move_upper_left
when 6 # ‰Eã,ɈÚ"®
move_upper_right
end
end
end
end
#==============================================================================
# ¡ Sprite_Character
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
alias update_para_quarter update
def update
update_para_quarter
if @tile_id == 0
if (@character.direction - 2) % 2 == 1
# ŽÎ,߉æ'œ,Ì--L-³,ðƒ`ƒFƒbƒN
if quarter_graphic_exist?(@character)
# ŽÎ,߉æ'œ,ðƒZƒbƒg
if character.dash_on and dash_quarter_graphic_exist?(@character)
@character_name = @character.character_name + "_dash_quarter"
else
@character_name = @character.character_name + "_quarter"
end
self.bitmap = RPG::Cache.character(@character_name,
@character.character_hue)
# Œü,«,ðŽæ"¾
case @character.direction
when 1
n = 0
when 3
n = 2
when 7
n = 1
when 9
n = 3
end
else
@character.direction = @character.sub_direction
# ŽÎ,߉æ'œ,ª'¶Ý,µ,È,¢,Æ,«,ÌŒü,«
n = (@character.direction - 2) / 2
end
# "]'--Œ³,Ì‹éŒ`,ðÝ'è
sx = @character.pattern * @cw
sy = n * @ch
self.src_rect.set(sx, sy, @cw, @ch)
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
# "]'--Œ³,Ì‹éŒ`,ðÝ'è
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
end
end
#--------------------------------------------------------------------------
# › ŽÎ,߉æ'œ,Ì--L-³,ðƒ`ƒFƒbƒN
#--------------------------------------------------------------------------
def quarter_graphic_exist?(character)
# "Ç,Ýž,݃eƒXƒg
begin
RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue)
rescue
return false
end
return true
end
#--------------------------------------------------------------------------
# › ŽÎ,߃_ƒbƒVƒ...‰æ'œ,Ì--L-³,ðƒ`ƒFƒbƒN
#--------------------------------------------------------------------------
def dash_quarter_graphic_exist?(character)
# "Ç,Ýž,݃eƒXƒg
begin
RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue)
rescue
return false
end
return true
end
end
#==============================================================================
# ¡ Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ"ƒXƒ^ƒ"ƒX•Ï"
#--------------------------------------------------------------------------
attr_accessor :direction # Œü,«
attr_accessor :sub_direction # ŽÎ,߉æ'œ,ª'¶Ý,µ,È,¢,Æ,«,ÌŒü,«
#--------------------------------------------------------------------------
# œ ¶‰º,ɈÚ"®
#--------------------------------------------------------------------------
def move_lower_left
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 4
# ‰EŒü,«,¾,Á,½ê‡,Ͷ,ðAãŒü,«,¾,Á,½ê‡,͉º,ðŒü,
@sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction)
end
# ‰º¨¶A¶¨‰º ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'Ês‰Â"\,Èê‡
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
# À•W,ðXV
@x -= 1
@y += 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# œ ‰E‰º,ɈÚ"®
#--------------------------------------------------------------------------
def move_lower_right
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 2
# ¶Œü,«,¾,Á,½ê‡,͉E,ðAãŒü,«,¾,Á,½ê‡,͉º,ðŒü,
@sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction)
end
# ‰º¨‰EA‰E¨‰º ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'Ês‰Â"\,Èê‡
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
# À•W,ðXV
@x += 1
@y += 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# œ ¶ã,ɈÚ"®
#--------------------------------------------------------------------------
def move_upper_left
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 8
# ‰EŒü,«,¾,Á,½ê‡,Ͷ,ðA‰ºŒü,«,¾,Á,½ê‡,Íã,ðŒü,
@sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction)
end
# 㨶A¶¨ã ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'Ês‰Â"\,Èê‡
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
# À•W,ðXV
@x -= 1
@y -= 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# œ ‰Eã,ɈÚ"®
#--------------------------------------------------------------------------
def move_upper_right
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 6
# ¶Œü,«,¾,Á,½ê‡,͉E,ðA‰ºŒü,«,¾,Á,½ê‡,Íã,ðŒü,
@sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction)
end
# 㨉EA‰E¨ã ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'Ês‰Â"\,Èê‡
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
# À•W,ðXV
@x += 1
@y -= 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# › ƒ_ƒbƒVƒ...ƒXƒNƒŠƒvƒg"±"ü"»'è
#--------------------------------------------------------------------------
def dash_on
if @dash_on != nil
return @dash_on
else
return false
end
end
end