TP Death Script Returns a Strange Error

Vollerei

Villager
Member
Joined
Mar 31, 2016
Messages
12
Reaction score
0
First Language
English
Primarily Uses
In the game that I'm making, I've decided to try to change the basic combat slightly. The main feature of this so far, is something I thought would be relatively simple, namely changing the nature of TP so that any actor or enemy which TP reached max, would die. This is the script I have for it so far:


class Game_BattlerBase
# OVERWRITE
def refresh
state_resist_set.each {|state_id| erase_state(state_id) }
@hp = [[@hp, mhp].min, 0].max
@mp = [[@mp, mmp].min, 0].max
@hp == 0 || @tp == max_tp ? add_state(death_state_id) : remove_state(death_state_id)
end
end

class Game_Battler < Game_BattlerBase
alias tp_knockout_die die
def die
tp = max_tp
tp_knockout_die
end

alias tp_knockout_revive revive
def revive
tp_knockout_revive
tp -= 1 if tp == max_tp
end
end


This seems based on the testing I've done, to work perfectly fine for the player, but once an enemy is killed, I'm given this error:


"Script 'Scene_battle' line 584: NoMethodError occured.


undefined method 'make_targets' for nil:NilClass"


I've tried removing every other custom script I have installed from the game, with only one exception. Which is this "TP Damage Type, by Hime" which can be found here: http://himeworks.com/2013/11/tp-damage-type/


The reason I didn't remove this particular script when testing, was just because I needed that script in order to fill up an enemy's TP. However, performing a TP-based attack seemed to work fine, and I've made no modifications to that script. As one would expect, the game only crashes once the enemy seems to reach full TP (after two TP-based attacks that fill half of an enemy's TP being done).
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top