My first WORKING script
This script is free to use and such.
First, the script part:
And now the EVENT part.
Just put the event on any map that you want hunger enabled.
wait: 60 frames
control variables - 1
conditional branch:
variable hunger >= 101
control variable hunger = 100
else
conditional branch:
variable hunger <= 0
control variables hunger = 0
decrease hp = 30
else
branch end
You can also edit this script to be used for sleep and other motives used in survival/Sim games (which i am currently working on).
This script is free to use and such.
First, the script part:
- class Window_hunger < Window_Base
- def initialize
- super(100, 400, 100, 80)
- self.back_opacity = 145
- self.contents = Bitmap.new(200 - 32, 80 - 32)
- refresh
- end
- def refresh
- self.contents.clear
- @hunger = $game_variables[1]
- self.contents.draw_text(0, 0, 190, 70, $game_variables[1].to_s)
- self.contents.draw_text(0, -15, 190, 70, 'Hunger'.to_s)
- end
- def update
- super
- if $game_variables[1] != @hunger
- refresh
- end
- end
- end
- #HUD2 UPDATE
- class Scene_Map
- alias hunger_main main
- alias hunger_update update
- def main
- @hunger = Window_hunger.new
- hunger_main
- @hunger.dispose
- end
- def update
- @hunger.update
- hunger_update
- end
- end
Expand to see the code.
And now the EVENT part.
Just put the event on any map that you want hunger enabled.
wait: 60 frames
control variables - 1
conditional branch:
variable hunger >= 101
control variable hunger = 100
else
conditional branch:
variable hunger <= 0
control variables hunger = 0
decrease hp = 30
else
branch end
You can also edit this script to be used for sleep and other motives used in survival/Sim games (which i am currently working on).