Conditionnal Branch for facing diagonal

dartarvo

Warper
Member
Joined
Dec 22, 2015
Messages
2
Reaction score
0
Primarily Uses
Hi everyone,


i am trying to conditional branch when player facing diagonal movement in an event.


The idea behind this is  if player is facing UPPER_R  then do an action


i have try a lot of thing more than the following but without success :


if: Script $gamePlayer.Input.dir8 == 9


If :Script Game_Character.ROUTE_MOVE_UPPER_R


If: Script this.moveDiagonally(6, 8);


I have a little experience at javascript. I am turning around on that now for a few day and i am running out of idea.. any tips would be appreciated.


Edit : I have found a solution see image attachement.

playerisfacingdiagonal.jpg
 
Last edited by a moderator:

Corrupted Ralph

The World Breaker
Veteran
Joined
May 24, 2015
Messages
197
Reaction score
51
First Language
English
Primarily Uses
If I am right you are trying to check the direction the player is facing? You can do that in the 3rd tab of Conditional Branch under character then you can check which direction any event on that map is facing.
 

dartarvo

Warper
Member
Joined
Dec 22, 2015
Messages
2
Reaction score
0
Primarily Uses
Yes Exactly. The only thing is in the 3rd tab of Conditional Branch under character choice:


Down = 2 // on the numeric keypad


Left =   4 // on the numeric keypad


Right = 6 // on the numeric keypad


Up =     8 // on the numeric keypad


What about 1, 3, 7, 9 that correspond to diagonal movement


LOWER_Left     =  1 // on the numeric keypad
LOWER_Right      =  3 // on the numeric keypad
UPPER_Left       =    7 // on the numeric keypad
UPPER_Right      =  9 // on the numeric keypad


It work now with an event condition =  if button Up and button Right are pressed set varposition to 9, i can then call varposition to instruct an action


But : button keyboard must be triggered ( key on the numeric pad)


What about if the character is facing a diagonal direction like north-east  without an key press triggered ?


How to instruct the engine that a character is facing north-east or south-west ?
 

Corrupted Ralph

The World Breaker
Veteran
Joined
May 24, 2015
Messages
197
Reaction score
51
First Language
English
Primarily Uses
Are you using a plugin to move with the numpad? If so I would ask the developer of the plugin.
 

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

Latest Threads

Latest Posts

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,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top