Terrain tag set's battleback

Im want to make a game like DQ.

and RPG maker xp only lets me set a battleback for the general area.

I want to make the game get's what's the tile the player is standing and then define the battleback is being used.

Exemple:

Player is standing on a bunch of trees: so the battleback should be a forest for exemple. etc.
player is standing above mountains: mountains battleback.

1629140657671.png


1629140672093.png
Make a parallel process that looks at the terrain tag of the player to determine the battleback.

1. Under Control Variables... you can set a variable to Character 'Player's 'Terrain Tag'
2. Use conditional branches to check the value of that variable
3. In each conditional variable use Change Map Settings... to set change the Battleback Graphic

*hugs*
Make a parallel process that looks at the terrain tag of the player to determine the battleback.

1. Under Control Variables... you can set a variable to Character 'Player's 'Terrain Tag'
2. Use conditional branches to check the value of that variable
3. In each conditional variable use Change Map Settings... to set change the Battleback Graphic

*hugs*
how exactly? like an in-game event or in the common events?

My rpg maker is in portuguese so I dunno what those are at
If you want all maps to use the same battleback for the same terrain tag, then you could use a common event. But if you want different maps to show different battlebacks, even though you're using the same terrain tag, it will need to be an event on each map.

Include a Wait 10 Frames at the start of the parallel process.

Unless someone else has a Portuguese version and can tell you the commands, you're just going to have to look through them yourself to figure out which ones mean Control Variables, Terrain Tag, and Change Map Settings.
Look this:

Good luck
Scripts for this should still be around, doesn't necessarily have to be evented.
For example: https://forum.chaos-project.com/index.php/topic,3257.0.html
It's in Tons of Add-ons: https://forum.chaos-project.com/index.php?topic=105.0
Poke around and I'm sure you'll eventually find it ^^
Exploring the various event commands and how they work is a good idea not only for figuring this out.

If you want all maps to use the same battleback for the same terrain tag, then you could use a common event. But if you want different maps to show different battlebacks, even though you're using the same terrain tag, it will need to be an event on each map.

Include a Wait 10 Frames at the start of the parallel process.

Unless someone else has a Portuguese version and can tell you the commands, you're just going to have to look through them yourself to figure out which ones mean Control Variables, Terrain Tag, and Change Map Settings.
Adding that wait means that the battleback could potentially be wrong.
Even a wait of 1 or 2 frames is better than none.
I think it's more adequate to check the terrain id specifically at the start of the battle via script, and set the battleback based on that. Also, in games like DQ it's not only the battleback that changes, but the encounters themselves.

Another thing to consider is default terrain tags are quite limited, so you may want to expand that and use areas instead, like in more modern RPG maker versions. The XP terrains are based on tile ID, but the areas are based on map regions. I made an Areas Support script some time ago.

More info here: Advanced Map Encounters
I think it's more adequate to check the terrain id specifically at the start of the battle via script, and set the battleback based on that. Also, in games like DQ it's not only the battleback that changes, but the encounters themselves.

Another thing to consider is default terrain tags are quite limited, so you may want to expand that and use areas instead, like in more modern RPG maker versions. The XP terrains are based on tile ID, but the areas are based on map regions. I made an Areas Support script some time ago.

More info here: Advanced Map Encounters
I think 7 is enough. and the encounter was another questions, like making rare encounters and multiple encounters instead of troops for the whole map
Scripts for this should still be around, doesn't necessarily have to be evented.
For example: https://forum.chaos-project.com/index.php/topic,3257.0.html
It's in Tons of Add-ons: https://forum.chaos-project.com/index.php?topic=105.0


https://forum.chaos-project.com/index.php/topic,3257.0.html

This is what I wanted! Thank you!
I think 7 is enough. and the encounter was another questions, like making rare encounters and multiple encounters instead of troops for the whole map
Check the link anyway, some things apart from the area are related to what you were asking.

If you want a very rare or even a "unique" encounter on the map like that cheeky cactus of Final Fantasy, you can do a little trick instead: You can call those battles via an invisible event.

Here's a little lesson in trickery:

Spoiler: Fake Encounters
This is a little tutorial on how to make map encounters by event, which can be used both in substitution or in parallel to the default system.

With this you can control how many enemies are per map, make more frequent enemies than others, concentrate them on regions, make them depend on switches or variables, make them unique (activate a switch after that disables it, or use a variable as a counter) or even make methods for the player to avoid them like a minimap or a radar, make encounters where you can't escape or something happens when you lose (or win), conditional encounters by equip, or by possessed item or whatever, etc.

With this you can also make encounters that follow the player so staying quiet is no longer a good option, and more complex things like that.

1. Define the events in the map

We create as many enemy events on the map as we want and wherever we want, and name them all "ENCOUNTER". The event has "Touch player" as trigger and only has the battle as command, with the option to escape enabled. I think 10 at most for big maps should be enough.

You can optionally create a condition in the start of the event with this:
Code:
> Condition: $DEBUG && Input.press?(Input::CTRL)
>> Stop Event Process
> END

This way in Debug mode battles are disabled when you press CTRL, as default.

2. Place the events on the map

I posted two ways to do that here, one using a very simple Pathfinding, and one using Areas instead.

We will do that on a common event. After the battle command on each ENCOUNTER event you can call it to place them after each battle, but the easier way is doing it only when you enter the map.

I recommend doing that with a Parallel Process that calls the common event and immediately after is erased temporarily. You could also use a script to call it directly on the entrance of any map instead.

Spoiler: Common Event Direct Call
Ruby:
class Game_Map
  alias encounter_map_setup setup unless $@
  def setup(map_id)
    encounter_map_setup(map_id)
    $game_temp.common_event_id = 1 # Common Event ID
  end
end

Inside the Common Event we use these two Script calls which place every ENCOUNTER event. Note I used "rand_event_position" on the example, it would be "rand_event_area" if you use the Area option.

Code:
for event in $game_map.events.values
 name = event.instance_eval("@event").name
 if name == "ENCOUNTER"
  ch = "@character_name = '051-Undead01'"
  event.instance_eval(ch) if $DEBUG
  event.instance_eval("@through = false")
  rand_event_position(event.id)
 end
end

Code:
for event in $game_map.events.values
 name = event.instance_eval("@event").name
 if name == "ENCOUNTER"
  event.instance_eval("@through = false")
 end
end

I also made it so in Debug mode you can see those invisible events as RTP ghosts instead. You can remove the "051-Undead01" line and the next one to disable that option.

That's it with the system, but I will also mention how to make a very simple radar as well.

3. Making a radar that detects near-by encounters

When used, the item will call another common event that will apply an animation on encounters that are near the player.

Code:
for event in $game_map.events.values
 name = event.instance_eval("@event").name
 if name == "ENCOUNTER"
  dx = ($game_player.x - event.x).abs
  dy = ($game_player.y - event.y).abs
  d = Math.sqrt(dx ** 2 + dy ** 2)
  if d < 5 # Range
   event.animation_id = 1 # Animation ID
  end
 end
end

Well, this was longer than I expected, sorry for that. I'm mister Wall of Text after all.

Original thread: https://forums.rpgmakerweb.com/threads/terrain-tag-sets-battleback.139649/