HiddenAlchemist

Veteran
Veteran
Joined
Jan 6, 2021
Messages
97
Reaction score
113
First Language
English
Primarily Uses
RMMV

HiddenAlchemist's
Geomancy / Terrain Skill with Events tutorial for MZ!

Brief description:​

This is a tutorial on how to remake the "Geomancy" skill from the Final Fantasy series (also called Terrain or Gaia). This technique lets a character "draw magic from their surroundings" and produce a skill determined by the current terrain. A cave could create earth magic, a forest could sprout magic vines, etc etc.

Requirements:​

Only MZ and basic eventing knowledge is required. The exact same process can also be followed for MV too. If, however, you want the battleback to also change with the terrain then you'll have to use a plugin for that (such as VisuStella's Battle Core for MZ or Yanfly's Regional Battlebacks for MV).


Tutorial Body:

This method can be done using either region IDs or terrain tags by choice. Both have their own pros and cons. Terrain tags can be quicker as you simply have to assign each tile a tag in the database, however you are limited between only 0 - 7 for tags. Region IDs require that you "paint" over each tile in the map editor, but the large number of region IDs means you can have a lot more variety and control. I personally prefer the region IDs for the control and will be using them for this tutorial.

To begin, first decide how many terrain types you want in your project. I.e. places like plains, forests, deserts, bodies of water, etc. In addition to creating the 'main' Geomancy skill, you'll also want to make a skill for each terrain type. For this tutorial's example, we'll just create 6 terrain skills and name them after each terrain.

geomancy1.png

For now, set the Geomancy skill to a scope of "None" and the terrain skills to "All Enemies".

Next, create three variables: one for map coordinate X ("Map X"), one for map coordinate Y ("Map Y"), and one for Region ID. On your world map, or whichever other area that has multiple terrains, assign a region ID for each terrain type and begin painting your map with them accordingly. "1" could be for plains, "2" for forests, "3" for deserts, etc.

geomancy2.png

If you're using terrain tags instead, just enter the database and assign each tile a numbered tag. You will still need to make a third variable for the terrain tags.

On that same map, create a Parallel event with two Control Variables set to record the player's map X and Y coordinates. These will be found in Game Data > Character > Player > Map X/Y. Then add a Get Location Info command to retrieve the Region ID Info (or alternately terrain tags if using those) as designated by the Map X and Y variables. Have the info be stored into the Region ID variable.

geomancy3.png

For a location that only ever has one terrain type: you can just make an Auto Event that sets the appropriate region ID or terrain tag variable without having to constantly check the player's current position. (Be sure to add an Erase Event after it's been set too.) The Parallel event is only recommended for world maps with multiple terrains.

Now make a Common Event for the actual Geomancy effect and fill it with conditional branches that checks the region ID or terrain tag for each terrain skill. These do not need an else branch to work. For each conditional branch, add a Force Action and set it so that your Geomancy user will use the appropriate terrain skill. I.e. if the player is standing in plains and the region ID variable is set to "1", have the Force Action call the skill for Plains. Set it to Last Target.

geomancy4.png

Have the Geomancy skill call this Common Event as its Effect. Remember to set Geomancy to a scope of "None" and have each terrain skill's scope be "All Enemies", as I find this best to avoid conflicts with Force Action.

You can then make a battle event on top of a terrain type to test this out. If you followed this exactly, the Geomancy skill should produce a spell based on your current terrain!
geomancy5.png

Checking for Vehicle:

The Parallel event setup will still set the regional ID / terrain tag variable even while you are riding a vehicle, so you don't have to add anything extra for it. However, if you want specific Geomancy skills while riding a vehicle, that can also be done as well. (This can be handy if you want a Geomancy skill for the sky/clouds while riding an airship, although you will need a plugin to make airship encounters possible.)

To achieve this, return to the Geomancy Common Event and make a new conditional branch at the very top that checks for a vehicle WITH an Else branch. Put all the other terrain conditional branches into the Else branch. For the vehicle's If branch, put in whichever skill you feel is appropriate. Maybe for a ship you could channel a large tidal wave.

3h6Ck0tsLq8Po8VzUujgMA0PSa1xjBf8gnGtzGITc5NDocouiXBEiT_sQlN4yu12gm84LCz1GKUR1HQZkX_oj_FDogNZJakyfGWN6hCinw3dfDdO-jlhQwVfIv7FxzJXqlok512N


Even during battle, the game will still work in checking whether the player is currently riding a vehicle or not. So you don't have to make a pre-battle process for that.

Randomized Geomancy Skills:

You can also make your Geomancy technique more varied by adding in multiple, randomized skills for each terrain type, similar to what Final Fantasy 5 did.

Again return to your Geomancy Common Event. This time, for each terrain conditional branch, add a Control Variables command with a new variable: call it "Random Geomancy" or something. Have this variable randomly pick between a set of numbers; this should be the number of skills you want that terrain type to have. For this example, we'll set the variable to 1 ~ 3 to pick from three random skills.

Next make three more conditional branches inside the terrain branch. Then for each of those branches, add a Force Action for each of the three skills the variable will randomly pick from.

E1Pv7ZKjP5ZYemY_N7HCc1F5BRXbZyKZ8IfC9JLkWw0m-ZcDwv0lxnWVJK_vGocF5mw08_CVVIfMqDak1uKKCsOtbrGNrP_7k6B1QPQotjbiDV0wsbHvn60zstuUOZjdODT6482_


With the above setup, now every time Geomancy is used on plains, it will generate either Twister, Earthquake, or Sonic Boom! Add excitement by giving each of the randomized skills unique effects!



That is it for the tutorial. Thoughts, feedback, and suggestions are very welcome. Have fun experimenting with the power of nature!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,192
Reaction score
3,457
First Language
English
Primarily Uses
RMMZ
Really cool tutorial. ^_^ I'm sure it'll be useful to a lot of people.

Do you mind if I share the alternative method I mentioned to you yesterday?
 

HiddenAlchemist

Veteran
Veteran
Joined
Jan 6, 2021
Messages
97
Reaction score
113
First Language
English
Primarily Uses
RMMV
Really cool tutorial. ^_^ I'm sure it'll be useful to a lot of people.

Do you mind if I share the alternative method I mentioned to you yesterday?
Of course! Go right ahead. I'm sure lots of people (even me lol) would appreciate any streamlining.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,192
Reaction score
3,457
First Language
English
Primarily Uses
RMMZ
Okay, so for anyone who wants one fewer parallel process going on and doesn't mind getting their hands dirty with a bit of Javascript, there's a way to do this where you only evaluate the region ID when the skill is used. The setup for the skill itself is the same, but for the event you'd do something like this:

JavaScript:
const plains = 354, forest = 355;
let skill;
const actor = $gameActors.actor(BattleManager._action._subjectActorId)
switch($gamePlayer.regionId()) {
  case 1: skill = plains; break;
  case 2: skill = forest; break;
  default: break;
}
actor.forceAction(skill, -1);
BattleManager.forceAction(actor);

You'd just add whatever region identifiers and skill IDs you want to the const declaration at the top, and a case statement for each region ID that needs a Geomancy skill associated with it.

The main disadvantage this has over the original method is losing the "set and forget" variable option for maps that don't have multiple regions, but if you need that too you can get the same effect by setting aside a region ID variable and changing

JavaScript:
switch($gamePlayer.regionId()) {

to

JavaScript:
const region = $gameVariables.value(1) > 0 ? $gameVariables.value(1) : $gamePlayer.regionId();
switch(region) {

where 1 is the ID of your region variable. However, using this method you'd still have to set the variable back to 0 manually at some point, otherwise it'll be stuck on that skill. You could set it back to 0 in the common event, but then you'd only get to use the Geomancy skill once in the battle.

Basically if you want the convenience of just setting a variable for single-region maps, the original way is better than coding it.
 

Latest Threads

Latest Posts

Latest Profile Posts

Hang on, let me get my glasses...
giphy.gif
Bust Status 1!
Animated lipsynch as well as lineart. Just lineart so far...
Ramona Expression 1-2 L.gifRamona Expression 1-1 L.gifRamona Bust 1C.png
2 FPS 5 FPS Static
SF_People3_7 added!
index.php

Anyone want dynamically soft shadow? :kaohi:
1643106068630.png

Forum statistics

Threads
118,689
Messages
1,117,926
Members
155,816
Latest member
mydaboom
Top