Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Last name script (Resolved)

Okay, I'm trying to code in a script to display the last name of a character on the status screen, but I'm not quite sure how to do it. Here's the script for it right now...

EDIT: Updated the script a bit, still don't think it'll cut it at this point

Code:
#--------------------------------
  def initialize
    x = @actor.id
    case x
    when x = 1
      lastname = " 1"
    when x = 2
      lastname = " 2"
    when x > 2
     lastname = ""
    end
  end
So can you help me here?
 
I think i got what you need...

Place this in Window_Base (right under def draw_hero_name is ok)

Code:
def draw_actor_fullname(actor, x, y)
    self.contents.font.color = normal_color
    case @actor.id
     when 1
      lastname = "Dragon"
     when 2
      lastname = "Gryphon"
     when 3
      lastname = "Snake"
     when 4
      lastname = "Tiger"
     when 5
      lastname = "Whale"
     when 6
      lastname = "Dino"
     when 7
      lastname = "Kitty"
     when 8
      lastname = "Doggy"
    end    
    self.contents.draw_text(x, y, 120, 32, actor.name + " " + lastname)
  end

then change:
Code:
draw_actor_name(@actor, 4, 0)
to
Code:
draw_actor_fullname(@actor, 4, 0)

and your done...

Haven't fully tested it but i think it works fine... enjoy!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top