Yeah, I want to have it so that at the start of battle, enemy TP has an additional 100, out of 200.
There are varying effects, like skills now requiring TP to be 80 + TP Cost instead of 0 + TP Cost, low TP, full TP, and 0 TP to add a variety of things...
I already have all the other scripts I need, I just want to know raise TP of an enemy if they exist.
But it's not as easy as
$game_actors[1].tp += 100$game_actors[2].tp += 100$game_actors[3].tp += 100$game_actors[4].tp += 100$game_actors[5].tp += 100$game_actors[6].tp += 100$game_actors[7].tp += 100$game_actors[8].tp += 100, and
$game_troop.members[1].tp += 100$game_troop.members[2].tp += 100for two bats gives me an undefined tp error.
Adding TP to enemies only if they exist? (adding 100 aka 100% tp out of 200% at start of battle)
● ARCHIVED · READ-ONLY
-
-
I think $game_troops starts usage with 0 index so try [0] and [1]
-
In Game_Enemy, after the initialize method, adding this causes the enemy to start with 100TP
#--------------------------------------------------------------------------# * OVERWRITE Inherited Initialize TP#--------------------------------------------------------------------------def init_tp self.tp = 100endYou can adjust the value, of course. Also, you can set a minimum value of 100 + a random value by doing this:
self.tp = 100 + (rand * 25)
That would make enemies start out with at least 100 TP plus a random value between 0 and 25.
Perhaps tinkering with this would give you what you want? -
There are instances where I'd want the game to handle various things and not it be defined in a script.
Plus I want to know how to do it manually.
Couldn't I just do
x=$game_troop.members[0];if !x.nil? then x.tp += 100 endx=$game_troop.members[1];if !x.nil? then x.tp += 100 endx=$game_troop.members[2];if !x.nil? then x.tp += 100 endand
x=$game_party.all_members[0];if !x.nil? then x.tp += 100 endx=$game_party.all_members[1];if !x.nil? then x.tp += 100 endx=$game_party.all_members[2];if !x.nil? then x.tp += 100 endand soforth? -
if you're gonna add to the whole troop
$game_troop.members.each {|enemy| enemy.tp += 100}