Enemy Class
This script allows you to set up enemies the same way actors are set up using classes.
An enemy’s parameters are determined by their level, which is determined by the class parameter curves. You can set up your enemies strengths and weaknesses using its assigned class.
An enemy’s available actions are also determined by their class. In order to be able to use an action, they must have met the learning requirements for the class.
Download
Script: download here
Required: Core – Enemy Levels
Installation
Place this script below Core – Enemy Levels and above Main
Usage
Assigning a class
To assign a class to an enemy, note-tag the enemy with
<enemy class: x>
Where x is the ID of the class to assign.
Setting up Parameters
Set up your enemies the same way you would set up your actors: assign a class, and then adjust the parameter curves accordingly.
Adding Enemy Parameters
By default, the enemy parameters are only used if no class is assigned.
However, if you would like to force the enemy parameters to use in addition
to the class parameters, note-tag an enemy with
<add enemy params>
Action Class Requirements
Enemy actions are set up as usual, but you can add class-related requirements to each action, such as having a certain level.
Changing classes
Enemy classes can be changed during battle using script calls:
change_enemy_class(enemy_index, class_id)
Where the enemy_index is the index of the enemy in the current troop, and the
class_id is the ID of the class you want to change it to.
The script won’t download as a JavaScript. It downloads as a txt file
Hey, is there a chance that I can check what the enemies class is?
So like say it is set as class 48, could I check that then add that number (48 in this case) to a variable then later in my script say to check that variable then whatever that number is add the actor with the same number?
You can use a script call for your “control variables” event command.
$gameTroop.members()[NUMBER – 1].currentClass().id
Where the NUMBER starts from 1, 2, 3, etc, and then you subtract 1 to get the array index.
Hello, nice script 😀 i was wondering if there is any way to equip the monster with weapons, so they fight with weapons like anyone with class would do. Thx for reading.
Unfortunately this script does not support equipping enemies.
I see… and you know any ways to do it? i’m using a sideview battle system and they all attack with the bare hand, i would like to make some archer monsters.
Do you know if your script supports enemies with bow animations? Maybe it’s only for actors.
I really dont have idea, there is an editable part on the second script of the battle system that let you choose what weapon will use every monster on the game, but i want to choose 1 weapon for each monster.
this is the script http://forums.rpgmakerweb.com/index.php?/topic/25667-%E2%97%84journey-battle-system-v03%E2%96%BAtankentai-translation-project/
Hi! I’m currently trying to create an attack similar to FFIX’s Dragon Crest, where the damage is based on the number of Dragon type enemies you have killed. Using your script, I’ve created classes for enemy types. What I basically need to know is how would I check an enemy’s class? I am simply adding a line to the method die in Game_Battler that would add 1 to a variable each time a Dragon type enemy is killed, but I’m not sure how to check the enemy’s class. I have tried self.class, but that didn’t seem to work, nor did @enemy_id.class.
I know this is kind of outside the scope of the script, but thanks for any help!
You should add this to Game_Enemy unless you actually want to include actor kills in the count. self.class.id and @class_id should both give you the ID of the class you want to use. You can then compare the class ID to the ID of the dragon class.
Yay, it works great now. Thank you!
This script works great! Sadly though it has one flaw..
The <add enemy params> Doesn't work. Which is a damn shame since it was what made this script attractive to me. Anyways I hope it can get fixed despite it being this old.
I've updated the script. For some reason it wasn't even in the code.
i have a class set up (26:Slime) but its not applying the class when i use the tag
class: 26, im stumped.
i figured out what was wrong, in the script it says class: x, but its suppose to be enemy class: x
this si the error im getting
script 'Game_battlerBase' line 187: NoMethodError occured.
undefined method 'features' for #Array:0xb1f3564>
Oops, it looks like I added some extra brackets. Should be fixed now.
Hi. I keep getting an error that reads
Script 'Game_BattlerBase' line 187: NoMethodError occurred.
undefined method 'features' for nil:NilClass
when running both test battles from the database and actual battles during live play. Was wondering if there was anything in particular that caused this. I have enemies notetagged with classes and level formulae properly.
Actually never mind, I just realized what I was doing.
could you tell me what you were doing wrong… im getting the same error but i have no programming knowledge.
https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-prn1/t1/1979600_727218337318733_1457958840_n.jpg
can you tell me whats wrong with mine? im really noob for scripting
Never mind, it stuck with the boss hp script
one more question, does the feature class (such as ex-param, etc.) not added as a feature of the enemy on that script? because mine doesnt, i had to add it into enemies features manually
Doesn't seem like it. Which it should.
I've updated the script to add class features as part of the enemy's features.
Quick question. I love this, but I was wondering what the formula would be to alter a single stat.
Let’s say I’d like to keep all the parameters the same as the set class, only double their HP or magic attack or something.
Would that be something like
or something to that effect? I’m not sure what to type for it.
If you want to change specific params to use formuias I’m assuming you are using the enemy parameter formulas script. I’m assuming you want to use the base params, you’d say something like
I updated it just now to support that.
That wasn’t quite what I meant, but I’ll lock this update to use another day.
val takes the set base parameters that I put in for the enemies, right? I’m looking for a formula that will alter stats of an enemy who has had a class changed stats. Multiplied their stats based on their class stats. Like a level 10 Warrior only with double the attack of another lvl 10 Warrior.
[enemy level]
p.members.min {|actor| actor.level}.level+17
[/enemy level]
[max enemy level: 30]
[enemy class: 15]
[param formula: mhp (I’m not sure what to put here to make this work) * 2]
The enemy class makes it so that the base parameter is pulled from the class, so the base value for a lvl 10 warrior would be different from the base value for a lvl 11 warrior.
When I use something like this:
[enemy level]
p.members.max {|actor| actor.level}.level+17
[/enemy level]
[enemy class: 15]
[param formula: mhp val * 2]
While this successfully makes them 17 levels above my party, and makes them the 15th class with their class stats, the “val” reverts to the original enemy stat in the general settings I had written in, instead of the overwritten class stats. It doesn’t seem to be pulling it from the class. Playing around with it only seems to end up with errors. I’m sorry if I seem like I just keep bugging you.
I am unable to reproduce the issue. My slime has 999999 HP, and I use the formula “val * 2”. If it was using the enemy’s HP value, then I should expect at least 999999. However, the actual mhp I see is what I expect.
Okay, okay, I got it to work. instead of writing:
[enemy level]
p.members.max {|actor| actor.level}.level+17
[/enemy level]
[enemy class: 15]
[param formula: mhp val * 2]
I wrote the general setting for the enemy’s HP to be the base class hp manually, then wrote:
[enemy level]
p.members.max {|actor| actor.level}.level+17
[/enemy level]
[enemy class: 15]
[param formula: mhp val + (p.members.max {|actor| actor.level}.level+17) * X]
where X is the number of hp progression per level of the class * 2
Though a round about way to do what I was trying to do, this works fine. Thank you for your time.
Compatible with Yanfly’s enemy levels.
http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/enemy-levels/
Every day I come to your site I see something that makes my RPG making *WAY* easier! Thank you!
That’s good. When I look at how some people implement their systems, I usually think if there’s a way to do it so that it requires much less effort.