The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: phillip1756 on October 25, 2009, 10:13:12 AM

Title: 8 directions movement
Post by: phillip1756 on October 25, 2009, 10:13:12 AM
go into game_player and find this line

def update
it is around line #204

you should see this code below that line.

case Input.dir4
                 when 2
                    move_down
                 when 4
                     move_left
                 when 6
                    move_right
                 when 8
                     move_up
  end


replace that block with the following

case Input.dir4
                 when 2
                    move_down
                 when 4
                     move_left
                 when 6
                    move_right
                 when 8
                     move_up
                 when 7
                     move_upper_left
                 when 9
                     move_upper_right
                 when 3
                     move_lower_right
                 when 1
                     move_lower_left
                 end


and finally,you have 8 direction movement
Title: Re: 8 directions movement
Post by: tSwitch on October 25, 2009, 05:44:25 PM
move_upper_left does work and such, but the script itself does not.
Title: Re: 8 directions movement
Post by: modern algebra on October 25, 2009, 05:58:12 PM
Well, it would work if Input.dir4 was replaced with Input.dir8


8D movement is very simple (other scripts are long because they try to allow for 8D sprites and they also put in pixel movement so that the time taken to move upper right is longer than to move up or right, because otherwise it doesn't make sense); I doubt he'd have to copy it from a script to get that, and even if he had it wouldn't matter because it's too minor and it wouldn't make any sense to do it any other way.

You people are such negative nancies :P
Title: Re: 8 directions movement
Post by: Lazer Ki on October 25, 2009, 06:03:21 PM
Yeah, if it says that there is only 4 directions, but you input 8, you will get an error.
Title: Re: 8 directions movement
Post by: tSwitch on October 25, 2009, 07:26:32 PM
yep, that fixes it up, MA.