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.

need help changeing the steps menu thingy to a purity

so ive been trying to change the steps thing in the menu to do basicly the following:

1.find the contents of variable 1
2.Check if the variable is greater or less then 0
2a.(if it is greater)show that the charicter is pure
2b.(if it is less)then show that the charicter is evil

ive been waiting for fable 2 to come out for a while ive now beaten it and freaking loved it, but seeing that as the first and second game were FAR too short, i want to play around making my own, im pretty ok with scripts, but i keep having issues with this small detail, any help would be amazing!
 
Not tested:
Code:
class Window_Steps
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Purity")
    self.contents.font.color = normal_color
    text = $game_variables[1] >= 0 ? 'Pure' : 'Evil'
    self.contents.draw_text(4, 32, 120, 32, text, 2)
  end
end
Next time, make your requests here: http://www.rmxp.org/forums/http://dev.r ... .php?f=2.0
 
tibuda":3lxdfhcc said:

Unless, of course, you are asking for help making a script.

The Script Requests forum is for asking for someone else to write a script for you.

This forum is for asking for help learning how to write scripts.

...in which case you probably should have posted what you had so far.

For an explanation on tibuda's script:

self.contents is the bitmap part of the window.
clear & draw_text are methods in the corresponding class (see Bitmap in the docs)
font.color is a property of the Bitmap class

   text = $game_variables[1] >= 0 ? 'Pure' : 'Evil'

is the same as

   if $game_variables[1] >= 0
      text = 'Pure'
   else
       text = 'Evil'
   end


Happy Scripting
 
thank you very much!!!! it did work quite well, i was so close to write. only i tried: self.contents.draw_text(4, 32, 120, 32, $game_variables[1], 2) and then used an event to solve what goes in the variable, begginer mistake i guess. thanks a million!
 

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