Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: bigace on May 01, 2010, 01:20:13 pm

Title: [XP] Special Elements Script
Post by: bigace on May 01, 2010, 01:20:13 pm
Special Elements Script
Authors: Bigace
Version: 1.0
Type: Special Element-Add-on
Key Term: Add-on Collection



Introduction

First ever script done by me(bigace) and probably my last until my first game is done. This script allows it so for only certain enemies to be hurt by certain elements. Mostly for items that are supposed to target a certain type of enemy. Like If you have a Item called 'Dragoon Slayer'. That Item should only hurt dragons, other enemies would be uneffected by this item. You can do the same with skills to.


Screenshots

None needed....


Demo

If you need one, I'll make one for you.


Script

Spoiler: ShowHide
Quote#==============================================================================
#Special Elements
#By Bigace
#==============================================================================
=begin
This script allows it so for only certain enemies to be hurt by certain elements.
Mostly for items that are supposed to target a certain type of enemy. Like If you
have a Item called 'Dragoon Slayer'. That Item should only hurt dragons, other
enemies would be uneffected by this item. You can do the same with skills to.

In the Database Under 'Items' add the type of element, most preferably an animal
type like demon or dragon, and then in this script add the monster ID for the
one that certain element works on.
=end
#-----------------------------------------
$special_elements = {
#Element_ID => [Enemy_ID],

  10 => [3, 7, 12], #element 10 only works against monsters 3, 7 and 12
  11 => [6, 14], #element 11 only works against monsters 6 and 14
}
#-----------------------------------------
# Don't Not Touch Below
#-----------------------------------------
class Game_Enemy
  alias special_element_rate element_rate
  def element_rate(element_id)
    result = special_element_rate(element_id)
    if $special_elements.keys.include?(element_id)
      unless $special_elements[element_id].include?(@enemy_id)
        result = 0
      end
    end
    return result
  end
end




Instructions

Plugin above main and then in the Database Under 'Items' add the type of element to an Item your using against a enemy, most preferably an animal type like demon or dragon, and then in this script add the monster ID for the one that certain element works on.


Compatibility

It works on my game and I have a wall of scripts, only thing I can tell you that it might have trouble with the Game_Enemy,but that's about it.


Credits and Thanks


Title: Re: [XP] Special Elements Script
Post by: G_G on May 01, 2010, 01:57:03 pm
Not to sound harsh on your first script but this could be done entirely through the database.

Make an element called Dragon.
Make an item that uses the element Dragon.
Make all enemies that are dragons effective against the Dragon element.
Make non dragon elements immune to the Dragon element.
Title: Re: [XP] Special Elements Script
Post by: bigace on May 01, 2010, 02:06:23 pm
Ya I know but that takes way to long, this is just shorter for more lazier people like me  :^_^':.
Title: Re: [XP] Special Elements Script
Post by: G_G on May 01, 2010, 02:29:48 pm
True. I'm quite lazy myself. I may use it, or make my own script like this. xP Anyways nice job.
Title: Re: [XP] Special Elements Script
Post by: AresWarrior on May 01, 2010, 11:42:59 pm
nice i might use this for my game. ^_^ in Digimon there is a weapon/attack that destroys "Dramon", so this script will come in handy. nice for your first script.
Title: Re: [XP] Special Elements Script
Post by: Blizzard on May 02, 2010, 04:29:51 am
*scratches head* Actually making the database work is a lot faster. -_-
Title: Re: [XP] Special Elements Script
Post by: bigace on May 02, 2010, 12:30:54 pm
Well in my game I have too many enemies to go through that I'm to lazy to change most of them to immune and the others to effective. Plus I have like 10 types of enemies. with like 500 (making up a number) enemes so far to configurate that I think just adding there number would be easier. I don't know I guess it just depends on the guy making it.
Title: Re: [XP] Special Elements Script
Post by: Starrodkirby86 on May 02, 2010, 05:34:05 pm
Well...in response to everyone saying that it's much better to do it on the Database...

Hm...at least this can be a nice start to a career of RGSS.  :D
Title: Re: [XP] Special Elements Script
Post by: Blizzard on May 03, 2010, 03:01:45 am
Quote from: bigace on May 02, 2010, 12:30:54 pm
with like 500 enemes so far to configurate


You can make a small script that automatically changes the configuration of enemies in the database. It's much cleaner through the database. In fact, if you're intend to use this script, why bother with RMXP's database manager at all? Make everything through script if you're claiming that it's easier.
Title: Re: [XP] Special Elements Script
Post by: G_G on May 03, 2010, 08:23:53 am
Quote from: Blizzard on May 03, 2010, 03:01:45 am
Quote from: bigace on May 02, 2010, 12:30:54 pm
with like 500 enemes so far to configurate


You can make a small script that automatically changes the configuration of enemies in the database. It's much cleaner through the database. In fact, if you're intend to use this script, why bother with RMXP's database manager at all? Make everything through script if you're claiming that it's easier.


Blizz don't tempt me :V
But really I would be the person to use a script for EVERYTHING.
Title: Re: [XP] Special Elements Script
Post by: Blizzard on May 03, 2010, 08:48:35 am
If I would expect that this procedure would have to be repeated in future, I'd make a tool instead.