Troop ID based battlebacks

Troop ID based Battlebacks

Tpasmall

Features

Allows you to set battle backgrounds based on troop ID.

How to Use

Pretty self explanatory, just make sure you go to "game_troop" line 29 and insert "attr_accessor :troop_id" or the script won't work. Let me know if there are any bugs (I don't use VX anymore, but I thought this might be useful for those of you that do). Put your battle backgrounds (in .png format) in the 'Pictures' folder (Graphics/Pictures). The rest of the instructions are in the script. (If there is any confusion, just ask here).

Script

Spoiler
Code:
#--------------------------------------------------------------------------------
# Battle backgrounds go in the 'Pictures' folder (Graphics/Pictures)
# in the script "game_troop" go to line 29 and insert "attr_accessor :troop_id"
# Script written by tpasmall
#--------------------------------------------------------------------------------

module TroopBB
#------------------------------------------------------------------------------
# To set the background put the troop ID number followed by the file name
# ex. Slime x 2 is troop 001
# 1 => "grassland" will make grassland.png as the battleback for slime x2 troop
# make sure to put a "," after each battleback name
#------------------------------------------------------------------------------
BattleBackground =
{
1 => "grassland",
2 => "forest",
}
#-----------------------------------------------------------------------------
# Create the battlefloor?
#-----------------------------------------------------------------------------
Create_battlefloor = true
end
#-------------------------------------------------------------------------------
# Spriteset_Battle
#-------------------------------------------------------------------------------
class Spriteset_Battle
alias crbattlefloor create_battlefloor
#-----------------------------------------------------------------------------
# Create Battleback
#-----------------------------------------------------------------------------
def create_battleback
image = TroopBB::BattleBackground[$game_troop.troop_id]
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = Cache.picture(image)
end
def create_battlefloor
@battlefloor_sprite = Sprite.new(@viewport1)
crbattlefloor if TroopBB::Create_battlefloor == true
end
end
Credit and Thanks

- None needed, it you want to though, credit tpasmall
Please update your topic so that it adheres to the script submission guidelines: http://forums.rpgmak...ion-guidelines/

Thanks.
I believe it's correct now, let me know if I'm wrong though.
Interesting. Can't wait to try.

Original thread: https://forums.rpgmakerweb.com/threads/troop-id-based-battlebacks.4012/