---------------------------------- ----Hero Step Detection System---- ---------------------------------- -----created by Fale Kunai---- ------------------------------ --Copyright Info This document was originally created by Fale Kunai (FaleKunai@aol.com). As of the time of this writing, no other sites are permitted to host this document. If you recieved this document from any site other than "Arc Horizon", please notify me at FaleKunai@aol.com. This document may not be altered in any way or used for any purpose other than your own personal use. ------------------------------ --Hero Step Detection System Overview This system can be used for any number of things, but in this example it's used in conjunction with the MP Regeneration System to restore MP outside of battle as the player walks about. On a message board, I was presented with the idea that since characters can regenerate MP during battle, why couldn't they regenerate outside as well? It was a solid question which demanded a solution. So I pieced together this rather simple Step Detection System. It works by initially checking the player's X and Y position, waiting, then checking again. If either value has changed, 1 is added to the "Regen Variable". When this variable reaches 2, it adds 1 MP to everyone in the party except spirits and is reset to 0. The threshold of this variable can be raised or lowered to change the speed at which MP is regained. Also, the walk/regen only occurs in areas where combat is possible. This is accomplished by a simple trigger switch. Anyway, on to the important part of this FAQ... ------------------------------ --Hero Step Detection System Implementation 1. The entire process is accomplished with a single common event. Enter the proper tab of the database and start with a new event. I called mine "MP Regen (X-Battle)". Set it to Parallel Process. Also set it to occur when a switch is ON. I called this switch "Combat Zone". 2. In the actual coding space, begin by placing a label (Label No. 1). I know PP's loop themselves, but I find that certain processes stop this from happening with me. 3. Next, we need a Variable Operation. Use it to create a new variable (I called mine "Player X") and set it to the Hero's X position. 4. Make another variable as above, but this time make it set itself to the Hero's Y position ("Player Y"). 5. Place a wait command. I've set mine for .5 seconds. Any more than that is too much--this is to allow the player to move enough to enter a new tile. 6. Now you need 2 more Variable Operations like those above. Only this time make 2 new variables ("Player X2", "PlayerY2") and set them to the X and Y values of the Hero. 7. Now that you've checked the positions, you can make the program act on the information. Make a Fork using the variable "Player X" and compare it to "Player X2". Set the comparison condition to "others". Make sure there's an Else case. 8. Inside the fork, make yet another new variable ("MP Regen Count") and add 1 to it. 9. Make another fork set to check if the "MP Regen Count" variable is 2 or more. No Else case. 10. Inside the new fork, use a Variable Operation to set the "MP Regen Count variable to 0. 11. Next, add 1 MP to all party members. In my case, I had to make a fork that checked for each human character (since spirits don't get MP regen) and added 1 MP to them if they were present. 12. Now in the Exepting case of the first fork (where you compared "Player X" to "Player X2"), make a fork comparing the "Player Y" and "Player Y2" variables as before. Set the comparison condition to "others". No Else case this time. 13. Inside this fork, add 1 to the "MP Regen Count" variable. 14. Make another fork inside this one and set it to check if the "MP Regen Count" variable is 2 or more (as before). No Else case. 15. Repeat steps 10 and 11 for the space inside this new fork. 16. And finally, at the very end of this mess, put a Goto Label command... set it for Label No. 1. 17. Now to activate/de-activate the walk/regen, make sure to include the command to turn on the switch "Combat Zone" in every teleport into an area with monsters. Conversely, be sure to turn off that switch during all the teleports out of a monster area. But when going from combat zone to another combat zone (or vice-versa), there's no need to mess with the switch. ------------------------------ --Conclusion And so, such is my little... thingy... here. It works fine, but you may need to tweak the wait command time if your character walks faster. This can be just as easily used for HP regeneration if you so choose. Or it could be used as a step-based timer (think Pokemon's Safari Zone). I was initially told to use the step detection from Phylomortis 2, but I couldn't find it in all those common events. So if this system is the same (it's likely), I'd like to apologize in advance. Just tell me if I've screwed up and barged in on someone else's territory here, eh? Anyhow... enjoy! ------------------------------ --Email at: FaleKunai@aol.com --This document found ONLY at: "Arc Horizon"