Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: G_G on April 08, 2009, 08:30:47 pm

Title: [XP] Terrain Battle Background
Post by: G_G on April 08, 2009, 08:30:47 pm
Terrain Battle Background
Authors: game_guy
Version: 1.0
Type: Battle Background Changer
Key Term: Battle Add-on



Introduction

Remember back when RPG Maker 2003 and 2000 were used before XP was even out? Well there was a feature in there where the battle background changed depending on the terrain you were on. I have scripted this :)


Features




Screenshots

Spoiler: ShowHide
(http://i307.photobucket.com/albums/nn318/bahumat27/terrain3.png)
(http://i307.photobucket.com/albums/nn318/bahumat27/terrain4.png)
(http://i307.photobucket.com/albums/nn318/bahumat27/terrain.png)
(http://i307.photobucket.com/albums/nn318/bahumat27/terrain2.png)



Demo

http://www.filedropper.com/stuff_1


Script


Spoiler: ShowHide

module GameGuy
  Terrain1 = "001-Grassland01"
  Terrain2 = "002-Woods01"
  Terrain3 = "003-Forest01"
  Terrain4 = "004-Mountain01"
  Terrain5 = "004-Mountain01"
  Terrain6 = "004-Mountain01"
  Terrain7 = "004-Mountain01"
end

class Scene_Map
  alias re_update update
  def update
    re_update
    if $game_map.terrain_tag($game_player.x, $game_player.y) == 1
      $game_map.battleback_name = GameGuy::Terrain1
    elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 2
      $game_map.battleback_name = GameGuy::Terrain2
    elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 3
      $game_map.battleback_name = GameGuy::Terrain3
    elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 4
      $game_map.battleback_name = GameGuy::Terrain4
    elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 5
      $game_map.battleback_name = GameGuy::Terrain5
    elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 6
      $game_map.battleback_name = GameGuy::Terrain6
    elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 7
      $game_map.battleback_name = GameGuy::Terrain7
    end
  end
end




Instructions

Change the name of the battle backs in the script between the quotes.

module GameGuy
  Terrain1 = "001-Grassland01"
  Terrain2 = "002-Woods01"
  Terrain3 = "003-Forest01"
  Terrain4 = "004-Mountain01"
  Terrain5 = "004-Mountain01"
  Terrain6 = "004-Mountain01"
  Terrain7 = "004-Mountain01"
end

This is very limited. With only 7 battle backs. Now I could have used terrain 0 as one but I left that in case you wanted to use a battle background from the tileset.



Compatibility

There shouldn't be any. Post any if you find some.


Credits and Thanks




Author's Notes

Give proper credits :)
Title: Re: [XP] Terrain Battle Background
Post by: Starrodkirby86 on April 08, 2009, 08:32:42 pm
It's a cool script...but yes, it is limited with the number of battle backgrounds possible. Perhaps you can make it a list exclusive to each tileset only? Of course this may be some tougher work, or it may not be possible at all (Which I doubt...somewhat), but who knows...who knows...
Title: Re: [XP] Terrain Battle Background
Post by: G_G on April 08, 2009, 08:33:21 pm
of course why I left terrain 0 out of the script. So you can use the tilesets background still.
Title: Re: [XP] Terrain Battle Background
Post by: Starrodkirby86 on April 08, 2009, 08:38:15 pm
Perhaps you didn't get my point. What I was stating was that you can have multiple lists for each tilesets that configure to each battle background.

For example, Port-Town's inside list of battle backgrounds would be something like (I'm not checking the tileset, this is purely random):
  Terrain1 = "001-Grassland01"
  Terrain2 = "002-Woods01"
  Terrain3 = "003-Forest01"
  Terrain4 = "004-Mountain01"
  Terrain5 = "004-Mountain01"
  Terrain6 = "004-Mountain01"
  Terrain7 = "004-Mountain01"


Then I have a list that does another module that goes for...Erm, good ol' Grassland:
  Terrain1 = "a"
  Terrain2 = "n"
  Terrain3 = "c"
  Terrain4 = "filename"
  Terrain5 = "003"
  Terrain6 = "n"
  Terrain7 = "d"


Get my point?
Title: Re: [XP] Terrain Battle Background
Post by: G_G on April 08, 2009, 08:53:39 pm
Quote from: Starholekirby86 on April 08, 2009, 08:38:15 pm
Perhaps you didn't get my point. What I was stating was that you can have multiple lists for each tilesets that configure to each battle background.

For example, Port-Town's inside list of battle backgrounds would be something like (I'm not checking the tileset, this is purely random):
  Terrain1 = "001-Grassland01"
  Terrain2 = "002-Woods01"
  Terrain3 = "003-Forest01"
  Terrain4 = "004-Mountain01"
  Terrain5 = "004-Mountain01"
  Terrain6 = "004-Mountain01"
  Terrain7 = "004-Mountain01"


Then I have a list that does another module that goes for...Erm, good ol' Grassland:
  Terrain1 = "a"
  Terrain2 = "n"
  Terrain3 = "c"
  Terrain4 = "filename"
  Terrain5 = "003"
  Terrain6 = "n"
  Terrain7 = "d"


Get my point?


Its easy to apply that in script. But boy would that be alot of modules  :O.o:
There'd be 50 modules just for the default ones. And than it'd be a hassle for people to set there own up.
Title: Re: [XP] Terrain Battle Background
Post by: Starrodkirby86 on April 08, 2009, 08:57:38 pm
That's true. But for one, you're not going to use all the terrains for the tileset (Unless you are, the more you do, the more work you have anyway). Second, you're not even going to program all 50 of them. I mean seriously, how many different backgrounds are you going to have for InnerBody...? It's just a suggestion anyway, using only one module is indeed more convenient depending on how you change battle backgrounds overall in the game. The way with the multiple modules would just make it easier if you're going for a lot of specific tiles with backgrounds...
Title: Re: [XP] Terrain Battle Background
Post by: G_G on April 08, 2009, 08:58:56 pm
I just sprouted an idea though! I think I can setup where you can confure which tilesets it doesnt affect. I'm going to try and see if I can get that.
Title: Re: [XP] Terrain Battle Background
Post by: Starrodkirby86 on April 08, 2009, 09:02:12 pm
I'll wait for that version to come up, and let's see what happens. Sounds great.

I cannot wait for this feature to be more optimal. Revival of such features from the old editor are a delight to hear. I'm surprised with the sheer convenience of the link though...Stuff_1. Stuff is pretty a common filename, and the fact it such a simple URL like that is interesting. It probably does work, yes...I got a download prompt...
Title: Re: [XP] Terrain Battle Background
Post by: nathmatt on April 10, 2009, 10:03:02 am
dont 4 get u can always change it by calling your module Gameguy::terain1 = newname
Title: Re: [XP] Terrain Battle Background
Post by: fugibo on April 10, 2009, 10:48:42 am
No, you can't. Those are constants.

Instead, use $game_system:


class Game_System
  attr_accessor :terrains
 
  alias gg_terrains_init initialize
  def initialize
    gg_terrains_init
    @terrains = {
      1 => "<name1>",
      2 => "<name2>",
      3 => "<name3>",
      4 => "<name4>",
      5 => "<name5>",
      6 => "<name6>",
      7 => "<name7>"
    }
  end
end


Then you can call with $game_system.terrains[<number>] = "<name>"
Title: Re: [XP] Terrain Battle Background
Post by: nathmatt on April 10, 2009, 12:06:28 pm
hmm thought 4 sure u could guess i was wrong
Title: Re: [XP] Terrain Battle Background
Post by: fugibo on April 10, 2009, 12:35:58 pm
It's a constant. You can't change a constant. They never change.

You could edit the value, though:

GameGuy::Terrain1.gsub!(GameGuy::Terrain1, "<newValue>")

Title: Re: [XP] Terrain Battle Background
Post by: G_G on April 10, 2009, 01:45:59 pm
Thank you guys. As soon as I get back to rapid city *currently in gillette spending easter break with grandma *sighs** I'll update this script
Title: Re: [XP] Terrain Battle Background
Post by: Blizzard on June 07, 2009, 09:34:39 am
This script is now part of Tons of Add-ons.
http://forum.chaos-project.com/index.php?topic=105.0