RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Random Enemy Battlers v1.0

0 Members and 1 Guest are viewing this topic.

********
Hungry
Rep:
Level 96
Mawbeast
2013 Best ArtistParticipant - GIAW 11Secret Santa 2013 ParticipantFor the great victory in the Breakfast War.2012 Best Game Creator (Non-RM Programs)~Bronze - GIAW 9Project of the Month winner for December 2009Project of the Month winner for August 20082011 Best Game Creator (Non RM)Gold - GIAW Halloween
Random Enemy Battlers
Version: 1.0
Author: NAMKCOR
Date: 4, JAN, 2013

Version History


  • <Version 1.0> 4.JAN.2013 - Original Release

Description


When configured, this script allows for randomly selected battlers, to give more variation to your enemies.

Features

  • Configure random battlers by Enemy ID
  • Configure random hues by Enemy ID
  • Allows for Static Enemies as well

Screenshots


Those are all slimes! ( Ignore YEA )

Instructions

Instructions for configuration are contained within the script comments.  Templates are also provided.

Script


Code: [Select]
#==============================================================================
# ¥ Randomized Enemy Battlers ¥
# -- Last Updated: 4.JAN.2013
# -- Author: NAMKCOR
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ¥ Details ¥
# -- Set random battlers per enemy ID
# -- Set random hues per enemy ID
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ¥ Fun Fact ¥
# -- Without comments, this script is only 14 lines ( without config section )
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ¥ Version History ¥
# -- v1.0 (4.JAN.2013)
# :: Original Release
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ¥ Compatability and Support ¥
# -- This script was created for use with RPG Maker VX Ace.  It is unlikely
#    that it will work out of the box with RPG Maker VX.
# -- You can get support for this script by contacting NAMKCOR at RMRK.net
# -- No known compatibility issues.
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ¥ Licensed under Creative Commons BY-NC-SA 3.0 ¥
# -- Not for use in Commercial projects without explicit permission from
#    NAMKCOR.
# -- You are free to modify this work as long as you distribute it with the
#    same license terms.
# -- Please credit NAMKCOR if used, distributed, or modified.
#
#==============================================================================

module NAMKCOR
 
  #============================================================================
  # ¥ NAMKCOR.get_enemy_battler ¥
  # -- returns the array of battler options
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # To add a new set of random battlers, use the enemy ID from the database as
  # your when condition, then return an array of strings, where each string is
  # a battler filename.  No filetype is necessary.
  #
  # Try to keep when statements in ascending order, for ease of use.
  #============================================================================
  def self.get_enemy_battler(enemy_id)
    case enemy_id
    # -------------------------------------------------------------------------
    # Example
    # when N
    #   return ["Battler_1", "Battler_2", "Battler_3"]
    # -------------------------------------------------------------------------
    # insert new configurations below this point.
    # -------------------------------------------------------------------------
    when 1
      return ["Slime", "Snake", "Soldier"]
    else
      return "ORIGINAL"
    end
  end
 
  #============================================================================
  # ¥ NAMKCOR.get_enemy_hue ¥
  # -- returns the array of hue options
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # To add a new set of random hues, use the enemy ID from the database as
  # your when condition, then return an array of integers, where each is a
  # number from 0 to 255, being the hue variation.
  #
  # Try to keep when statements in ascending order, for ease of use.
  #============================================================================
  def self.get_enemy_hue(enemy_id)
    case enemy_id
    # -------------------------------------------------------------------------
    # Example
    # when N
    #   return [100, 150, 75]
    # -------------------------------------------------------------------------
    # insert new configurations below this point.
    # -------------------------------------------------------------------------
    when 1
      return [255, 23, 15, 100, 75]
    else
      return "ORIGINAL"
    end
  end
 
end

#==============================================================================
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
#==============================================================================

class Game_Enemy < Game_Battler
 
  alias :_old_init :initialize
 
  def initialize(index, enemy_id)
    # call original initialize
    _old_init(index, enemy_id)
   
    # override battler image with random selections
    @battler_options = NAMKCOR.get_enemy_battler(@enemy_id)
    # only if the battler isn't set to use the original method
    if @battler_options != "ORIGINAL"
      @battler_name = @battler_options[rand(@battler_options.length)]
    end
     
    # override battler hue with random selections
    @battler_hues = NAMKCOR.get_enemy_hue(@enemy_id)
    # only if the battler isn't set to use the original method
    if @battler_hues != "ORIGINAL"
      @battler_hue = @battler_hues[rand(@battler_hues.length)]
    end
  end
 
end


Support


For support, post here in this thread or PM me here on RMRK.net

Known Compatibility Issues

None known.

Demo


This script is fully configured to use the RTP.  If you'd like an example of its usage, just drop it into a new, or RTP-using project, and fight enemy 001.

Terms of Use


:ccbyncsa:
end of story.

FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

*
*crack*
Rep:
Level 64
2012 Most Unsung Member2012 Best NewbieFor frequently finding and reporting spam and spam bots
Oh wow, a pretty creative script I reckon, good job :)
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3