Button that when hold only lets you move diagonally (Edit to any diagonal movement script)

Status
Not open for further replies.

Seacliff

RPG Maker Mastermind
Veteran
Joined
Nov 8, 2012
Messages
2,982
Reaction score
1,129
First Language
Yes
Primarily Uses
RM2k
Like in most mystery dungeon games, whenever the player holds down a specific button, the player can only move diagonally.


I'm not asking anyone to create a diagonal movement script from scratch, this could just be an add-on or edit to any diagonal movement script of your choice. At the movement, I'm using Victor Diagonal Movement.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
As there are 4 diagonal movements, presumably you are asking for something which uses 4 different buttons.  Is that correct?


I am unfamiliar with Victor's Diagonal Movement script.  How many buttons do you hold down in that one?  The reason that I ask is that the script I use requires 2 - If you want to move northwest, you press the up and left arrow key; if you want to move south west you press the down and left key, and so on.  I suspect it might be difficult to have less than 2.  It might be easier on the player to use 2 keys they are familiar with, rather than introducing 4 others.
 

Seacliff

RPG Maker Mastermind
Veteran
Joined
Nov 8, 2012
Messages
2,982
Reaction score
1,129
First Language
Yes
Primarily Uses
RM2k
As there are 4 diagonal movements, presumably you are asking for something which uses 4 different buttons.  Is that correct?


I am unfamiliar with Victor's Diagonal Movement script.  How many buttons do you hold down in that one?  The reason that I ask is that the script I use requires 2 - If you want to move northwest, you press the up and left arrow key; if you want to move south west you press the down and left key, and so on.  I suspect it might be difficult to have less than 2.  It might be easier on the player to use 2 keys they are familiar with, rather than introducing 4 others.
Not what I'm asking for at all.


I don't want to change the buttons that allows the player to move diagonally, that will still be executed by pressing two arrow keys adjacent to each other.


A better way to ask what I'm looking for is a single button, say the 'S' key, that when held down DISALLOWS the player to move in the traditional 4 direction and the player can only move in the diagonal directions. Naturally, when the button is not pressed, the player can move in all 8 directions normally.


I'm asking for this because I'm making a game where precision is key, and to move diagonal on the fly is a bit tricky with buttons.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Oh, I see.  Yes, that makes more sense now.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You can try to use this:

class Game_Player < Game_Character

alias fix_smove7726 move_by_input
def move_by_input
return if Input.press?:)CTRL)
fix_smove7726
end

end



You should probably change the button for it though.


I used CTRL because I was too lazy to check for other button names. :p


Ohh, and this must be placed above Victor's Diagonal movement!
 

Seacliff

RPG Maker Mastermind
Veteran
Joined
Nov 8, 2012
Messages
2,982
Reaction score
1,129
First Language
Yes
Primarily Uses
RM2k
@Sixth Tried it and it works great! Thank you!


I'll see about closing this thread now.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top