[RM2K3] IS THERE A WAY TO WALK THROUGH AN EVENT FOLLOWING THE HERO
Posts
Pages:
1
I want it to appear as if this character (event) is following the hero, but when the event is on the same layer as the hero the event can make moving backwards quite a task, and if the event is below/above the hero, the event tries to sit on the same tile as the hero.
Is there a way to do this in RM2K3? I've really only seen following characters you can walk through in RPGmaker ACE games so I'm not too hopeful, but I figured I'd ask anyway!
Is there a way to do this in RM2K3? I've really only seen following characters you can walk through in RPGmaker ACE games so I'm not too hopeful, but I figured I'd ask anyway!
I used to have a caterpillar system I created for 2k3 that allowed the followers to be walked through while still staying behind the hero, but I've long since lost the code for it.
Basically just having "follow hero" won't work if you have passable followers: you'll have to code a fairly complex system involving storing the hero's X and Y in variables and continually whittling down the difference between that and the event's X/Y to determine which direction it needs to move in.
Basically just having "follow hero" won't work if you have passable followers: you'll have to code a fairly complex system involving storing the hero's X and Y in variables and continually whittling down the difference between that and the event's X/Y to determine which direction it needs to move in.
author=Trihan
I used to have a caterpillar system I created for 2k3 that allowed the followers to be walked through while still staying behind the hero, but I've long since lost the code for it.
Basically just having "follow hero" won't work if you have passable followers: you'll have to code a fairly complex system involving storing the hero's X and Y in variables and continually whittling down the difference between that and the event's X/Y to determine which direction it needs to move in.
Oh goodness, that sounds way above my head! X) Thank you for your answer, but if it is truly so complex I think I will just rewrite this scene in the game, haha.
author=aimcute
and if the event is below/above the hero, the event tries to sit on the same tile as the hero.
oh, serves me right for skim reading
well, you could make it that when the event touches the hero it becomes same as hero... not sure it'd work
well, you could make it that when the event touches the hero it becomes same as hero... not sure it'd work
I don't know if it would be helpful to try reverse-engineering the way VX Ace does it:
def chase_preceding_character unless moving? sx = distance_x_from(@preceding_character.x) sy = distance_y_from(@preceding_character.y) if sx != 0 && sy != 0 move_diagonal(sx > 0 ? 4 : 6, sy > 0 ? 8 : 2) elsif sx != 0 move_straight(sx > 0 ? 4 : 6) elsif sy != 0 move_straight(sy > 0 ? 8 : 2) end end end #-------------------------------------------------------------------------- # * Calculate Distance in X Axis Direction #-------------------------------------------------------------------------- def distance_x_from(x) result = @x - x if $game_map.loop_horizontal? && result.abs > $game_map.width / 2 if result < 0 result += $game_map.width else result -= $game_map.width end end result end #-------------------------------------------------------------------------- # * Calculate Distance in Y Axis Direction #-------------------------------------------------------------------------- def distance_y_from(y) result = @y - y if $game_map.loop_vertical? && result.abs > $game_map.height / 2 if result < 0 result += $game_map.height else result -= $game_map.height end end result end
author=kentona
http://rpgmaker.net/tutorials/256/I wrote a tutorial for one some years ago. Maybe it will help?
Thank you! That is very useful.
Pages:
1