MV How I made a geomancy skill

Hey there game makers! I am a huge fan of final fantasy and one of my favorite jobs in is the geomancer, a type of mage that can harness the power of nature. Gameplay wise the geomancer performs random skills based on the environment you r in.

As I was thinking about this I wondered... How can I make something like this in RPG Maker MV

At first I thought it would involve a plugin but then I realized... I CAN DO THIS WITH SCRIPTS!!!

All you need if yanfly's action sequence pack and in the whole action just put in the following code.

eval: $gameVariables.setValue(2,$gamePlayer.regionId());

If ($gameVariables.value(2) === 1)

eval: $gameVariables.setValue(3, Math.randomInt(3));

eval: $gameActors.actor(1).forceAction($gameVariables.value(3) + 4, -1);

eval: Battle manager.forceAction($gameActors.actor(1))
end

$gameVariables.setValue(2,$gamePlayer.regionId()); sets variablele 2 as the value of the region ID

$gameVariables.setValue(3, Math.randomInt(3)); sets variablele 3 as a random value between 0 and 3

$gameActors.actor(1).forceAction($gameVariables.value(3) + 4, -1); makes actor 1 use random a skill between 4 and 7 on a random target

And just like that it works! Keep in that since it is javascript all of it is case sensitive...

Even though I am using region IDs for this you can use for any condition such as if a switch is on or if a variable is a certain value and so much more!

Hope this helps give some of you some ideas!
You have an extra space in "Battle manager" btw. While this won't work for me since I don't use side-view battles, it does give me ideas for making Geomancer spells vary depending on regionId, so thanks!
You have an extra space in "Battle manager" btw. While this won't work for me since I don't use side-view battles, it does give me ideas for making Geomancer spells vary depending on regionId, so thanks!
The space is to help readers know when the eval: starts it's not actually part of the code... Probably should have specified that early...

Anyway I'm glad I got to give you ideas. When I posted this I wanted to help people learn how they could use scripts to make a skill perform another based on conditions and show just how much is possible with scripting. I truly am glad I gave you an idea an I hope it will help you further in what ever game you make.

Original thread: https://forums.rpgmakerweb.com/threads/how-i-made-a-geomancy-skill.149302/