[ACE] Fixing the enemy letters for hidden/transformed enemies?

Arsist

Veteran
Veteran
Joined
May 16, 2014
Messages
140
Reaction score
10
Primarily Uses
Say you were creating instances where enemies became conditionally hidden or transformed into other enemies at the start of battle. The letters of all other enemies would remain the same.

So if you had Skeletons A-E and Skeleton A became hidden and Skeleton C turned into a Ghost, Skeletons B, D, and E would retain their original letters.

I tried at the end of the transform/hide process

$game_troop.members.each {|mem| mem.letter = ""} $game_troop.make_unique_namesbut that just made the names Skeleton F, Skeleton G, and Skeleton H.

How could I make it so that in that instance, the Skeleton's names would properly match their indexes relevant to the number of active skeletons in the troop, and soforth?
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
You're on the right track. You just need to reset the hash that determines how many times a name has been used. The hash doesn't have a public method, so I just made a quick little function to reset the names.

Place the following in the materials section of the script editor

Code:
class Game_Troop < Game_Unit  #--------------------------------------------------------------------------  # * Reset Names  #--------------------------------------------------------------------------  def reset_names    @names_count = {}    members.each {|mem| mem.letter = ""}     make_unique_names  endend
Then use
Code:
$game_troop.reset_names
in a script call after you've done your transform/hide events.
 
  • Like
Reactions: BCj

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,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top