Could any Master here enlighten me how do make a game so that player move as per dice number and able to turn left/right/up/down as per the path. Thanks in advanced.
Player move as per dice number and able to turn left/right/up/down as per the path
RPG Maker MV SupportI've moved this thread to MV support. Thank you.
Tutorials is for tutorials you've made yourself that you wish to share.
This can be done by eventing, but it requires you to be good with event logic.
And it needs a rather complex structure for disabling regular player input and replacing it with event-controlled checks on buttons and moveroutes.
How good are you with events? If you're rather new, I suggest you follow the link to the starting point in my signature and work through the eventing tutorials there, especially the variables guide.
Because you will be using variables in complex ways to achieve such a game mechanic.
And it needs a rather complex structure for disabling regular player input and replacing it with event-controlled checks on buttons and moveroutes.
How good are you with events? If you're rather new, I suggest you follow the link to the starting point in my signature and work through the eventing tutorials there, especially the variables guide.
Because you will be using variables in complex ways to achieve such a game mechanic.
Hi Andar. Thanks for the advise.
Hi Andar,
i have create a common event to show the dice animation and the player able to move as per dice number. however, the player will stop to move when encountered turning point (turn left/right/up/down). any advise in more detail how to make the player automatic turn left/right/up/down as per the path according to dice number?
i have create a common event to show the dice animation and the player able to move as per dice number. however, the player will stop to move when encountered turning point (turn left/right/up/down). any advise in more detail how to make the player automatic turn left/right/up/down as per the path according to dice number?
that depends on how you move and how the map is structured - please provide screenshots of your events, then we can help
can't do it that way - there is a reason why I said that this needs a complex event.
you need to move single step (a different counting loop for each diceroll), and before each step check the possible directions and give different move commands based on the possible directions set in the map.
Most people set the possible directions by region ID (for example 1=north only, 2=north and east and so on), using check location info to get the region ID of the current player position. There are alternatives (for example blocking movement off track and testing if move possible, repeating in different direction if not), but most of them should only be needed for other things like a simple track.
That basically means that each of your single set move routes after a diceroll needs to be replaced by several dozens of commands - usually the check for possible moves is done in another common event that is called from this one, because otherwise you'll have to repeat those commands dozens of times.
you need to move single step (a different counting loop for each diceroll), and before each step check the possible directions and give different move commands based on the possible directions set in the map.
Most people set the possible directions by region ID (for example 1=north only, 2=north and east and so on), using check location info to get the region ID of the current player position. There are alternatives (for example blocking movement off track and testing if move possible, repeating in different direction if not), but most of them should only be needed for other things like a simple track.
That basically means that each of your single set move routes after a diceroll needs to be replaced by several dozens of commands - usually the check for possible moves is done in another common event that is called from this one, because otherwise you'll have to repeat those commands dozens of times.
Hi Andar,
Have create common event TurningPoint Step 7 to 2 as below. But problem now is the player turn back unexpectedly even event call for step forward/force to turn right. turning step 7 means there is another 6 step to reach the turning point, turning point step 2 means there is only 1 step to reach the turning point.
kindly pls advise where i did wrongly. thanks!
Have create common event TurningPoint Step 7 to 2 as below. But problem now is the player turn back unexpectedly even event call for step forward/force to turn right. turning step 7 means there is another 6 step to reach the turning point, turning point step 2 means there is only 1 step to reach the turning point.
kindly pls advise where i did wrongly. thanks!
No - that has nothing to do with what i tried to describe, and i can't give you screenshots at the Moment.
@Louis529 You should think more about the logic, and plan the flow before creating the events.
There's a website which teaches this logic and flow using 'block' codes, which you can learn without knowing any coding. It's similar to the Event Commands in that way.
https://hourofcode.com/code
The lesson is meant for a younger audience, but it can still be helpful, and it should be available in your natural language. Around lesson 15 it becomes relevant to this path-finding scenario, I recommend you try it.
After understanding the basics, try to write the logic and flow.
There's a website which teaches this logic and flow using 'block' codes, which you can learn without knowing any coding. It's similar to the Event Commands in that way.
https://hourofcode.com/code
The lesson is meant for a younger audience, but it can still be helpful, and it should be available in your natural language. Around lesson 15 it becomes relevant to this path-finding scenario, I recommend you try it.
After understanding the basics, try to write the logic and flow.
- Roll a die (random number generator) to determine how many steps.
- While the number of steps remaining is more than zero:
- Check if the player can move forward?
- If yes:
- Move forward one step.
- Reduce number of steps remaining by one.
- Go back to bold step #2.
- If yes:
- If no, check if the player can move left?
- If yes:
- Turn left.
- Move forward one step.
- Reduce number of steps remaining by one.
- Go back to bold step #2.
- If yes:
- If no, check if the player can move right?
- If yes:
- Turn right.
- Move forward one step.
- Reduce number of steps remaining by one.
- Go up to bold step #2.
- If yes:
- Check if the player can move forward?
Thanks for the advise. By the way, did you means, the player will not turn back unexpectedly if follow your method as per spoiler shown above?
apart of this, could you please give me a example so that i could follow or use it as a reference for modification ?thanks in advanced.
apart of this, could you please give me a example so that i could follow or use it as a reference for modification ?thanks in advanced.
Event Commands are just a list of instructions which is given to the event. When the event is active, it executes exactly those instructions. It does not create any new instructions, and it does not destroy any instructions. So in fact, the event always does exactly what you tell it to do.
This means that the event doesn't do anything unexpected, it actually means the instructions were not correct. The difficulty, skill, and experience of a developer is how to write the correct instructions, and it takes time and many tests.
To answer your question directly, in the spoiler shown above there is no instruction to the event to turn around 180 degrees. So indeed, the event will never turn around 180 degrees because it cannot make it's own instructions.
Think about your first attempt to write the instructions. In fact you have tried to create a common event for every tile of the board. Let's say the board is 10x10 and the player moves along the outside, that is 36 total tiles to move on. With a dice roll of 1-6, with your first method it is 36 common events each with 6 conditional statements - 216 total statements! That's too many to write and the chance of making a mistake in the instructions is very high.
Now think about Andar's suggestion because it is a good strategy for a simple loop.
If you take this advice, you only need 3 conditional statements (not 216!)
You need to know basic Variables, Event Commands, and Regions. If you haven't learned it yet, I suggest to follow the links in Andar's signature for starting out.
This means that the event doesn't do anything unexpected, it actually means the instructions were not correct. The difficulty, skill, and experience of a developer is how to write the correct instructions, and it takes time and many tests.
To answer your question directly, in the spoiler shown above there is no instruction to the event to turn around 180 degrees. So indeed, the event will never turn around 180 degrees because it cannot make it's own instructions.
Think about your first attempt to write the instructions. In fact you have tried to create a common event for every tile of the board. Let's say the board is 10x10 and the player moves along the outside, that is 36 total tiles to move on. With a dice roll of 1-6, with your first method it is 36 common events each with 6 conditional statements - 216 total statements! That's too many to write and the chance of making a mistake in the instructions is very high.
Now think about Andar's suggestion because it is a good strategy for a simple loop.
If you take this advice, you only need 3 conditional statements (not 216!)
- If the player can move forward, move forward
- If the player must turn, turn
- If the player has no more steps left, stop moving
You need to know basic Variables, Event Commands, and Regions. If you haven't learned it yet, I suggest to follow the links in Andar's signature for starting out.
- Steps Remaining = Random Number 1-6
- Loop
- If Steps Remaining = 0
- Break Loop
- Player X = Player's x
- Player Y = Player's y
- Player Region = Get Location Info (Player's Region (x,y))
- If Player Region = 1
- Move forward
- Steps Remaining - 1
- If Player Region = 2
- Turn 90 degrees left/right (Left for anti-clockwise, Right for clockwise)
- Move forward
- Steps Remaining - 1
- If Steps Remaining = 0
- End Loop
Wow...thankyou very much! Will try as per Andar and your suggestion.
You need the check player position bits within the loop - otherwise it’s just checking the starting position. 🙂
ooh....noted and thanks!
Hi All,
Player move as per dice number -solved.
The issue now :
1) when the Roll And Go! button is pressed, only the dice animation is run. The player move only when click one more time. Any possible to click one to run the dice animation and the player move right after the dice animation
2) The Roll and Go! is actually a png picture which drive by Yep Fly picture common events plug in so that dice animation and player could run when the picture is click. But the picture will disappear when the picture is click (running dice animation) and appear again when second click(player is move). Why?
Player move as per dice number -solved.
The issue now :
1) when the Roll And Go! button is pressed, only the dice animation is run. The player move only when click one more time. Any possible to click one to run the dice animation and the player move right after the dice animation
2) The Roll and Go! is actually a png picture which drive by Yep Fly picture common events plug in so that dice animation and player could run when the picture is click. But the picture will disappear when the picture is click (running dice animation) and appear again when second click(player is move). Why?
For the 1st question, I guess it's because the Show Text command is there ("Step to move is \v[1]"). Because of that, they have to click once first to clear the message.
For the 2nd question, I'm not familiar with that plugin unfortunately. It could be good to create a new post in the Plugin Support section with details about just that issue, with good screenshots of the issue.
For the 2nd question, I'm not familiar with that plugin unfortunately. It could be good to create a new post in the Plugin Support section with details about just that issue, with good screenshots of the issue.
Hi Aloe,Thanks for the advised.
Any other Master here could help?
Any other Master here could help?
Original thread: https://forums.rpgmakerweb.com/threads/player-move-as-per-dice-number-and-able-to-turn-left-right-up-down-as-per-the-path.91427/



