Setting enemy TP at start of battle

Status
Not open for further replies.

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I know that there's a small change to a default script which allows you to set how much TP the enemy has at the start of battle.  Unfortunately I have lost my file of useful information like that.

Can anyone please tell me what the alteration is?

Thanks.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
Initial TP is determined by the init_tp method in Game_Battler. If you want it to be different for enemies, you could do something like this:

class Game_Battler < Game_BattlerBase

  def init_tp

    if self.is_a?(Game_Actor)

      self.tp = rand * 25

    else

      self.tp = whatever you want enemy tp to start at

    end

  end

end
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Whatever it was I did in the past it wasn't that, so just to be clear - this is a new snippet? Or an insertion into a default script?
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Whatever it was I did in the past it wasn't that, so just to be clear - this is a new snippet? Or an insertion into a default script?
I think it's a separate snippet, although you can also edit the corresponding part directly, if you know how.

Another way is to use a script call in a battle event being run at the start of a battle:

$game_troop.members.each { |member| member.tp = x }Where x is the starting tp amount.

Setting different tp for different enemy can be done via this:

Code:
tp = [x1, x2, x3, ..., xn]$game_troop.members.each { |member| member.tp = tp[member.index] }
 
Last edited by a moderator:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Thanks for the clarification - and thanks twice over for mentioning how to set different tp for different enemies.  That opens up a lot of additional possibilities.
 

Lunarea

Artist
Global Mod
Joined
Mar 1, 2012
Messages
8,840
Reaction score
7,797
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top