- 12
- Posts
- 9
- Years
- Seen Feb 1, 2025
So, the gen 8 project for essentials came with a feature in SWSH that starts one of the four terrains as soon as the battle begins if a specific weather is up in the overworld (I think it is storm and fog for electric and mystic terrain respectively)
I was wondering if it is possible to do de same but for entire maps without having to rely on weather, for example a gym having grassy terrain up all the time, or a forest or something but without using the weather so that is still free for something else.
Or if it is possible to assign them to terrain tags, so on land while the player is on a terrain tag 0 I have grassy terrain and while surfing since I'm on another terrain tag (7 I believe) having idk psychic terrain
Pretty sure is just having a call for the tags to check in which is the player standing but I have no idea how to do it, so any help would be appreciated
Edit: After tinkering with the scripts I found a way to check the environment and the terrain tag and call a terrain for that. So, if anyone is interesed
In
look for
Wich should be arround line 110
Then, before the "else" add this:
This code checks in what environment is the battle taking place and starts your terrain accordingly. I just put Electric and Psychic to test if the terrain changed
Now, if you want to have a terrain based of what terrain tag the player is standing, before this before else add this:
This code checks the terrain tag and actives the terrain accordingly, same as before but since this are TerrainTagsID you can use them for having multiple terrains in one map depending on where the player is standing... although you can create a new environment and have it as the default environment for the tag and using only that, but it never hurts to have more options
If you decided to use both options (like i did for testing purposes) it should look like this:
I was wondering if it is possible to do de same but for entire maps without having to rely on weather, for example a gym having grassy terrain up all the time, or a forest or something but without using the weather so that is still free for something else.
Or if it is possible to assign them to terrain tags, so on land while the player is on a terrain tag 0 I have grassy terrain and while surfing since I'm on another terrain tag (7 I believe) having idk psychic terrain
Pretty sure is just having a call for the tags to check in which is the player standing but I have no idea how to do it, so any help would be appreciated
Edit: After tinkering with the scripts I found a way to check the environment and the terrain tag and call a terrain for that. So, if anyone is interesed
In
Code:
Overworld_BattleStarting
Code:
if battleRules["defaultTerrain"].nil?
if Settings::SWSH_FOG_IN_BATTLES
case $game_screen.weather_type
when :Storm
battle.defaultTerrain = :Electric
when :Fog
battle.defaultTerrain = :Misty
end
else
battle.defaultTerrain = battleRules["defaultTerrain"]
end
end
Then, before the "else" add this:
Code:
case battle.environment = pbGetEnvironment
when :Grass
battle.defaultTerrain = :Electric
when :TallGrass
battle.defaultTerrain = :Psychic
when :"Environment"
battle.defaultTerrain = :"Your terrain ID"
end
Now, if you want to have a terrain based of what terrain tag the player is standing, before this before else add this:
Code:
case $game_player.terrain_tag.id
when :Sand
battle.defaultTerrain = :Grassy
when :"Terrain tag name"
battle.defaultTerrain = :"Your terrain ID"
end
If you decided to use both options (like i did for testing purposes) it should look like this:
Code:
if battleRules["defaultTerrain"].nil?
if Settings::SWSH_FOG_IN_BATTLES
case $game_screen.weather_type
when :Storm
battle.defaultTerrain = :Electric
when :Fog
battle.defaultTerrain = :Misty
end
case battle.environment = pbGetEnvironment
when :Grass
battle.defaultTerrain = :Electric
when :TallGrass
battle.defaultTerrain = :Psychic
end
case $game_player.terrain_tag.id
when :Sand
battle.defaultTerrain = :Grassy
end
else
battle.defaultTerrain = battleRules["defaultTerrain"]
end
end
Last edited: