[XP] Special Elements Script

Started by bigace, May 01, 2010, 01:20:13 pm

Previous topic - Next topic

bigace

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


  • It's a very small script so need to credit but some feedback would be nice



Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

G_G

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.

bigace

Ya I know but that takes way to long, this is just shorter for more lazier people like me  :^_^':.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

G_G

True. I'm quite lazy myself. I may use it, or make my own script like this. xP Anyways nice job.

AresWarrior

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.

Blizzard

*scratches head* Actually making the database work is a lot faster. -_-
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

bigace

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.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

Starrodkirby86

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

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

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.

Blizzard

If I would expect that this procedure would have to be repeated in future, I'd make a tool instead.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.