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.

Sim Needs

Sim Needs
RMVX
Description:
I asked for this script for RMXP last year, but it seems to have dissappeared off the forums, anyhow now I would like it for RMVX.
Basically I would like a script which calls a window by pressing a certain key. On this window there should be attributes. EG.
Sleep
Toilet
Hunger ect.
The attributes should decrease in value over a certain period of time. Lets say Sleep is 100% when you first check it, and a few minutes later you check again and sleep has decreased to 76%. I would also like to be able to increase the value of these attributes when nessasary. EG.
Your hunger is rather low, so you need to eat, so when you do choose eat a snack, it replenishes the hunger bar, showing it as full...
This system I am requesting is similar to the Sims 2 Needs system.

The attributes I would like are:
Hunger
Energy
Bladder
Hygiene
Social

ScreenShot
sims2ep52007022820054568_2.jpg

The Needs system is in the right hand corner. That is the type of system I'd like.
Other Scripts I am using (in order):
AS: AntiLag
Kylocks Time System
Simple Mouse System
DerVVulf's Mouse


Thank-you in advance
Sprugles555 :smoke:
 
Do you have a working system for each of things you want to display? Otherwise its going to mean not just coding a window to display the variable bars and such it'll be coding the entire system which would probably be a lot of work. If you've got the systems that are working post them and I'll take a look and making the window shouldn't be too much trouble.
 
The last script i had did not show bars but just numbers like 100% , 75% ect. All you need to script is the window that pops up when you press [KEY], the attributes to show up on the window like:
Hygeine: 75%
And there were calls for each attribute, a call that decreased the value of the attribute, and a call that increased it.
The last script I had was pretty simple, I don't have it as I lost it.
 
jbrist":1s758svm said:
JBrist Sliding HUD


Hi everyone,

So I haven't made any scripts for a while, well, not any good ones, although I will admit I thought my Info. Cards script was pretty darn useful (Trainer Cards FTW !),

Not sure if you can remember, a while ago I made a HUD which looked pretty good visually, but because I never got the refresh rate done or anything, it lagged like a bitch, lol.

So now I'm releasing a NEW HUD;

Basically, when you press a button (Which can be assigned via the script) a box displaying your characters name, HP, SP and EXP will slide in from the left, and stay in the top left corner, until you release the button, simple yet effective;

Script ---
Code:
#==============================================================================

# ** JBrist Slide HUD - By JBrist of rmxp.org

#------------------------------------------------------------------------------

# Instructions of use :

#   This is a simple plug and play script, just insert it into a new

#   script above Main, and away you go. To show the HUD while ingame

#   press the button which corrosponds to Z (Usually D), if you don't 

#   want it to be this, edit this line further down:

#

#       @hudwindow.visible = Input.press?(Input::Z)

#

#                           JBrist

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

 

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

# ** Window_Base

#------------------------------------------------------------------------------

#  This class is for all in-game windows.

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

 

class Window_Base < Window

  #--------------------------------------------------------------------------

  # * Get the clear color.

  #--------------------------------------------------------------------------

  def clear_color

    return Color.new(0, 0, 0, 0)

  end

  #--------------------------------------------------------------------------

  # * Clear a certain number of pixel rows on the bitmap.

  #--------------------------------------------------------------------------

  def clear_rows(y, height)

    rect = Rect.new(0, y, width - 32, height)

    self.contents.fill_rect(rect, clear_color)

  end

  #--------------------------------------------------------------------------

  # * Specialized hud drawing stats.

  #--------------------------------------------------------------------------

  def specialized_draw_hud(x, y, left, right, height = 24)

    self.contents.font.color = system_color

    self.contents.draw_text(x, y, 60, height, left)

    self.contents.font.color = normal_color

    self.contents.draw_text(x, y, width - 32, height, right, 2)

  end

end

 

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

# ** Jbrist_HUD

#------------------------------------------------------------------------------

#  This class performs hud processing when on Scene_Map.

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

 

class Jbrist_HUD <  Window_Base

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(0, 0, 260, 130)#210, 130

    self.contents = Bitmap.new(width - 32, height - 32)

    self.back_opacity = 255

    # Not visible by default.

    self.visible = false

    

    self.contents.fill_rect(0, 24, width - 32, 2, system_color)

    # Save the actor that will be doing the drawing for.

    @actor = $game_party.actors[0]

    refresh

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    # Drawing values.

    x, y, height_inc = 0, 0, 24

    

    # Draw the Name of the Party Leader.

    if @actor_name != @actor.name

      # Save the new value

      @actor_name = @actor.name

      # Create a rectangle to clear the portion we will draw to.

      clear_rows(y, height_inc)

      # Draw the actors name.

      specialized_draw_hud(x, y, "Name", @actor.name)

    end

    

    y += height_inc + 2

    

    # Draw the Hitpoints of the Party Leader.

    if @actor_hp != @actor.hp

      # Save the new value

      @actor_hp = @actor.hp

      # Create a rectangle to clear the portion we will draw to.

      clear_rows(y, height_inc)

      # Draw the health points.

      hp_str = @actor.hp.to_s + ' / ' + @actor.maxhp.to_s

      specialized_draw_hud(x, y, 'HP', hp_str)

    end

    

    y += height_inc

    

    # Draw the Skill Points of the Party Leader.

    if @actor_sp != @actor.sp

      # Save the new value

      @actor_sp = @actor.sp

      # Create a rectangle to clear the portion we will draw to.

      clear_rows(y, height_inc)

      # Draw the skill points.

      sp_str = @actor.sp.to_s + ' / ' + @actor.maxsp.to_s

      specialized_draw_hud(x, y, 'MP', sp_str)

    end

    

    y += height_inc

    

    # Draw the Experience of the Party Leader.

    if @actor_exp != @actor.exp

      # Save the new value

      @actor_exp = @actor.exp

      # Create a rectangle to clear the portion we will draw to.

      clear_rows(y, height_inc)

      # Draw the experience.

      exp_str =  @actor.exp.to_s + ' / ' + @actor.next_exp_s

      specialized_draw_hud(x, y, 'Exp.', exp_str)

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    @actor = $game_party.actors[0]

    refresh

  end

end

 

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

# ** Scene_Map

#------------------------------------------------------------------------------

#  This class performs map screen processing.

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

 

class Scene_Map

  alias_method :jbri_hudwindow_main, :main

  alias_method :jbri_hudwindow_update, :update

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    @hudwindow = Jbrist_HUD.new

    jbri_hudwindow_main

    @hudwindow.dispose

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    @hudwindow.update

    @hudwindow.visible = Input.press?(Input::Z)

    if @hudwindow.visible

      if @hudwindow.x < 0

        @hudwindow.x += @hudwindow.width / 10

        @hudwindow.opacity += @hudwindow.width / 10

      end

    else

      @hudwindow.x = @hudwindow.width * -1

      @hudwindow.opacity = 255 - @hudwindow.width

    end

    jbri_hudwindow_update

  end

end

 

 


Instructions ---

It's basically a Plug n' Play script, so you shouldn't find it too difficult, if you'd like to change which button opens the HUD, it's all in the script for you, but I'll paste the line anyways;

@hudwindow.visible = Input.press?(Input::Z)

And thats it.

Compatability ---

I have NO idea about the compatability, I'm guessing it'll work with everything cause it doesn't edit any classes or anything like that.

Credit ---

Yeah, if you use, just credit me as JBrist, cheers.

And thats the script, feedback ?

this script is similar, nealy exactly the same to my old XP Needs script. The only difference was it showed the needs, and these needs could be increased or decreased by calling a script.
I hope someone is able to help.
Thank-you in advance
Sprugles555 :smoke:
 

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