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.

Fear System Request

Fear System Request


For last few days, I had tried to script a fear system. And failed miserably.

About: Fear System
The game is a "Psychological Horror" styled.
The hero (You) is hunting the truth about his past.

But the gameplay has no battlesystem. Only option is to run.

How does it work?
I created a HUD (Head Over Display) with a bar which increases when a variables is added. $game_variables[10]

The fear system. When it reach a certain amount (The variables).
It triggers BGS. (Background Game Sound).

Example:
$game_variables += 100
(Which increased the amount to 100)

When the fear system reach 100, it triggers a quiet BGS. (Volume = 10)

This can be made by Events
I don't want to uses events. It's too much works. Scripting > Events.

If you don't understand what I meant, I will try my best to describe it better.

I can't post a mockup, as there's no windows or scene included, it's a system. =(

In-Game Variables... Ewww
=( I don't know any other options. If you could suggest a method I could use, (Which is easily accessable by a quick line of code)


I would be extremely thankful, if you could do this. < 3
(And thanks for reading, have a cookie on the house.)
 

Abbey

Member

He means a system where you can only run. When you run, the variable goes down. When it gets to a certain point, the volume (I'm assuming) increases. When the variable (I'll call it "energy" for now :P) gets back to 100, the music is quieter.

Am I right? The greater your "energy", the quieter the music? Or do you only want 2 volumes?
 
Abbey got it, that's what exact I need.

(The BGS is the sound of heartbeats. When the variables (Bars is empty).
There's no BGS. When it reach like. 25%, the heartbeats start to play, slowly and at quiet volume.

When the bar starts to fill, the heartbeats get faster and louder.

Get what I mean? =)
 
Use this:
Code:
class Scene_Map
  alias scene_map_update update
  def update
    max_fear = 1000 # Put here the max fear that the player can have
    if $game_variables[10] >= max_fear * 10 / 100
      bgs = RPG::AudioFile.new
      bgs.name = "001-Wind01" # Put here the name of your bgs
      bgs.volume = $game_variables[10] * 100 / max_fear
      bgs.pitch = 50 + $game_variables[10] * 100 / max_fear
      $game_system.bgs_play(bgs)
    else
      $game_system.bgs_play(nil)
    end
    scene_map_update
  end
end
If you want any change, ask for it.
 

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