Troop ID based battlebacks

● ARCHIVED · READ-ONLY
Started by tpasmall 4 posts View original ↗
  1. 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
  2. Please update your topic so that it adheres to the script submission guidelines: http://forums.rpgmak...ion-guidelines/

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