Terrain Effects

In my game, I want more interaction with the environment but I'm not sure of how make it work properly.


For example. I want that the final damage input of skills are affected by the terrain, like:


In a mountain, Wind skills receive damage boost of 10%-30% and Earth skills damage decreased by 10-20% depending on height.


In a beach, water skills are increased by 40% because of the ocean presence and moist air. So the weather would play a part too. Dry areas would diminish the water damage because of both the lack of water and dry air. So the boost would be not a simple boost of 30% on all situations where a element is more present. The boost could range from 10%-40%. Is this possible?


I think I could do that through variables in normal situations, but in the world map how can I assign the terrain effects to different areas inside the same map?


The variables would go on the skill damage formula like:


1 - water terrain


2 - earth.....


and


1 - moist ar


2 - dry air


3 - rain


and


1 - underground area - earth damage increased


2 - normal ground level - normal damage


3 - mid height - earth damage decreased


4 - high height - earth damage decreased even more


Maybe switches are easier for this system? I don't know! I'm trying to make this work but opinions would be welcome. Thanks in advance!
My first thought would be common events, switches, and states. It may be a bit twisted way around, I mean someone may have a easier way to do this. You may even find something useful in a script.


Okay, so here is a long about way to do it:

  • Make switches between maps ex. going from map Plain to map Beach make a switch like WaterArea = ON.
  • Make a State for each effect you need, ex. "Water Down". I haven't tried it out, but in the right hand section I made Element Rate [Water] *140% and made sure to check the box "Remove at Battle End".
  • In the Troop section leave Condition as "Don't Run" but add in conditional branches check for each of your switches and then activating the appropriate State for Entire Troop and/or Entire Party depending on who you want to be afflicted.
  • Don't forget to adjust the switches between the maps though. If you are going from "Beach" to "Desert" you would want WaterArea=OFF and DryArea=ON.



I think that should do the trick. Problems: you have to add the conditional branches to EVERY troop you make, but once you finish the setup on one, it should be as easy as copying and pasting. Also, I'm not sure how on the same map you can change the switches for the height idea you had. The only thing I could think of is if you only had one path way to the different height area on your map, then you could make an event with trigger Below Character and Player Touch.

  • Enter a Windy Map, make switch WindArea=ON
  • Go higher in the Windy Map and make switch go WindArea=OFF and WindArea2=ON.
  • Go higher, WindArea2=OFF, WindArea3=ON. (etc., etc.)

The problem with this is if you have more than one pathway to the higher terrain on your map, then you would need multiple events. Also, you can condition these events so it depends on which way you are walking. So if you are going Up the Mountain, conditional branch to check what your move route is, then activate switches WindArea=OFF and WindArea2=ON. If coming Down the Mountain, make sure to do the opposite, WindArea2=OFF and WindArea=ON.


As I said, it seems like a long way around for your idea, but that's my first thoughts. I'm still pretty amateur at this myself. Hopefully someone more experienced can lend advice. As per your formula ideas, I'm not sure how to activate a random based number:

The boost could range from 10%-40%.





Good luck, hope this helps a little!
thanks! the idea of states may work. dunno about switches, but I'll consider them. actually you can control the damage in the formula box of the skills in many ways, including with variables.


I gave a try: water element variable could range from 1 to 5. using the v[x] command in the damage formula, maybe would be more easier than states since it doesn't need to inflict states to anyone (my idea is that the elemental "buff" affects everyone on battle)


if v[x] == 5; 1.5*(100 + 15*2); elsif v[x] == 4; 1.4 *(100 + 15*2); else; 100 + 15*2; end;


v[x] is the variable, and the number of the variable change the damage modifier (1.5 being 50% additional damage; 1.4 40% and so on). I tested a lot with formulae to achieve this result. yet, the formula box have a limit of space, so I guess that my initial concept won't work and I'll have to cut the original variance of damage that I wanted. 


but I would really like to assign somekind of commom events to regions IDs so it could change the variables and then automatically set the damage. theres a way to do that?
Not that I am aware of. Region IDs only come into play when placing enemies. I have not experimented with this, but under "Variables -> Game Data -> Character" there is Map X and Map Y. You might be able to do something with that. Also, if the formula line is too small for your formulae, Yanfly has a Lunatic Damage Script that helps with that. I've never used that either, but I hear that it works well.

Original thread: https://forums.rpgmakerweb.com/threads/terrain-effects.59746/