Issue with Fhizban's Party HUD

Status
Not open for further replies.

Jammythewerewolf

Villager
Member
Joined
Jun 23, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
I'm using Fhizban's party HUD script in my game to display the player's HP in the corner of the screen, and up until now it's been working perfectly. A couple of times in the game I've swapped which party member is active, but it's only now I've reached a section with two party members at once I'm getting problems. When I try to remove one of them, I get the following error:

Script 'FHIZBAN'S PARTY HUD' line 58: NoMethodError
occurred.
undefined method 'hp' for nil:NilClass

I feel pretty sure it has something to do with having more than one party member, but I'm no scripter, so I don't really know how to solve this. If I can't find a way to make it work and allow me to remove party members, the only way I'm going to be able to make this game is to not have party members, which will make the lategame much less interesting.

Here's what seems to be the relevant part of the script, I would really appreciate any help with this!

def fhiz_hud
i = 0
while i < @party_size
@actor = $game_party.members
@actor_hp = @actor.hp
@actor_mp = @actor.mp
i += 1
end
i = 0
while i < @party_size
@actor = $game_party.members
@x = OFFSET_X + (WIN_WIDTH + OFFSET_X)*i + (PADDING*i)
@y = OFFSET_Y
if DRAW_FACE
if @actor_hp > 0
draw_actor_face(@actor, @x, @y, true)
else
draw_actor_face(@actor, @x, @y, true)
end
end
if DRAW_NAME
draw_actor_name(@actor, @x, @y)
end
if DRAW_STATES
draw_actor_icons(@actor, @x, @y+(WIN_HEIGHT-line_height*4), WIN_WIDTH)
end
if DRAW_HP
draw_actor_hp(@actor, @x, @y+(WIN_HEIGHT-line_height*3), WIN_WIDTH)
end
if DRAW_MP
draw_actor_mp(@actor, @x, @y+(WIN_HEIGHT-line_height*2), WIN_WIDTH)
end
i += 1
end
end
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,655
Reaction score
562
First Language
English
Primarily Uses
RMVXA
Change the script to include these few lines.
Ruby:
  def find_party_size
    @party_size = $game_party.all_members.size
  end
  #=============================================================================
  #
  #=============================================================================
  def fhiz_hud
    i = 0
    find_party_size
    while i < @party_size
      @actor = $game_party.members[i]
I included a few lines from the script so you know where to put the lines
 

Jammythewerewolf

Villager
Member
Joined
Jun 23, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
Thanks so much for your help! Unfortunately I think I must still be missing something, as when I try to launch the game I now get this error.

Script 'FHIZBAN'S PARTY HUD' line 141: SyntaxError
occurred.
unexpected $end, expecting keyword_end

It's at this part of the script. 141 is the final line.


#===============================================================================
#Show the window on the map
#===============================================================================
class Scene_Map < Scene_Base
alias original_create_all_windows create_all_windows
def create_all_windows
original_create_all_windows
create_face_window
end
def create_face_window
@face_window = Window_Fhiz_Hud.new
end
end

#===============================================================================
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,655
Reaction score
562
First Language
English
Primarily Uses
RMVXA
I must still be missing something
Probably because you added that text somewhere in the script and not in the correct location. I did not give you an addon or a piece to insert cleanly.
I gave a reference to where you need to change the code. Every line that is not in the script you can add in.
So that would be the 3 lines for def find_party_size, and the one line inside def fhiz_hud
 

Jammythewerewolf

Villager
Member
Joined
Jun 23, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
Yeah, you're right. I replaced the previous 'end' when I wasn't supposed to. Thanks again, the problem is fixed now c:
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,813
Reaction score
5,212
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


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

Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.
I checked out Genshin Impact gameplay out of curiosity. I can't believe it's available as a mobile game too. Smooth animation, great music, and stellar sound effects (the ambient sounds are pretty detailed).

I'm flabbergasted to see games have becoming more and more advanced. Maybe also because I'm oblivious to current trend for a long time, it almost feel like I'm being sent into distant future. xD
xDRAGOONx wrote on WaywardMartian's profile.
Your artwork is amazing!!!
:ewat:
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
I should finish the cat video I'm editing and finish the indesign stuff. So far only 1 is done and 4 to go

Forum statistics

Threads
105,665
Messages
1,015,384
Members
137,341
Latest member
jasapembuatanwebsite
Top