How Can I Make "Change Enemy HP" Show the Numbers?

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
That because, the status window will be updated once the information is changed. Usually, status window changed when you applied a certain state which it should get refreshed once you add your feral state. The same thing happen when you get hit. Because the HP changed, thus refresh everything. The status window found out that the face also changed, so it changed. However, it stopped to refresh at a certain point, which I'm not sure where, since adding a state should always refresh the status window.

I tried to come up with another silly solution to always refresh when the state get added / removed
Code:
class Game_Actor
 
  alias ori_face_name face_name
  def face_name
    return "Actor41" if state?(6)
    return ori_face_name
  end
 
  alias ori_char_name character_name
  def character_name
    return "$Actor-Unk" if state?(6)
    return ori_char_name
  end
 
  alias ori_add_state add_state
  def add_state(id)
    ori_add_state(id)
    scene = SceneManager.scene
    scene.status_window.refresh if scene.is_a?(Scene_Battle)
  end
 
  alias ori_rem_state remove_state
  def remove_state(id)
    ori_rem_state(id)
    scene = SceneManager.scene
    scene.status_window.refresh if scene.is_a?(Scene_Battle)
  end
 
end

class Game_Player
 
  def character_name
    actor.character_name
  end
 
end

class Game_Follower
  def character_name
    visible? ? actor.character_name : ""
  end
end

class Scene_Battle
  attr_reader :status_window
end
 

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
That worked perfectly! Thank you so much ^_^ I'm gonna do a full test play sometime later tonight and make sure it's consistent but I think I can finally call finish on my little test project, lol.

Totally unrelated thing but do you know if it's easy to make battle animations play over the top of the status window/character portraits because both enemy attacks and ally heals/buffs play behind it and I can't seem to find any setting that would change the layering. It's not a major issue but something I thought I'd check and see if it's easily fixed. I did some googling on it a couple days ago but couldn't find a solution that looked simple.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Totally unrelated thing but do you know if it's easy to make battle animations play over the top of the status window/character portraits because both enemy attacks and ally heals/buffs play behind it and I can't seem to find any setting that would change the layering. It's not a major issue but something I thought I'd check and see if it's easily fixed. I did some googling on it a couple days ago but couldn't find a solution that looked simple.
This better to make a separate post if you're still looking for it.

A little explanation though, a viewport of where the animation is being displayed is different with the window one (which makes them always behind the status window). And it might be tricky to move the animation viewport into the status window (as animation is handled in separate instance in script). It needs some understanding how everything works so it won't break stuff. In short, it can't be a quick snippet like the previous ones.
 

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Ah I won't worry about it then.

So I should've tested my game from the 'New Game' option (I was using Continue so that I had the Shapeshifter in my party).

When choosing New Game, I get a crash and this error "Script 'FaceSwap' line34: NoMethodError occurred. undefined method 'character_name' for nil:NilClass"
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Good point, I didn't double check with the new game. Try to add these
 

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Hmm I got a different error after adding that: "Script 'Cache' line 88: NoMethodError occurred. undefined method 'empty?' for nil:NilClass"

Kinda weird 'cause I haven't edited anything in the cache :S

Just to clarify though, in line 41 should the name in " " be the Shapeshifter or the image file she should change to? I wasn't sure. Neither name made a difference though.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
*facepalm* I forgot to return the String value
Code:
class Game_Player
 
  def character_name
    actor ? actor.character_name : ""
  end
 
end

class Game_Follower
  def character_name
    return "" unless actor
    visible? ? actor.character_name : ""
  end
end
This should do. And no, don't change the "". Keep it blank
 

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I've done numerous test playthroughs today and everything's working flawlessly! Thanks a lot for all your help and patience! ^_^
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top