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.

Drunk script

Hi everybody,

I'm looking for a script, but if it is really easy, then tell me and I will try to make it myself, cuz I'm learning RGSS

The script I'm looking for is a script that keeps track of a variable named drunkness. If the value for this variable is a certain number, it should substract 1 after a certain time that depends on the current value
e.g. If drunkness=3 then after 15 minutes 1 should be substracted, but if drunkness=15 then 1 shuold be substracted after 1 min

The script should also check if the constant is above a certain value and if it is, then it should inlfuence your screen
e.g. drukness=1 => nothing happens
drunkness>6 => screen becoms a bit blurry (fog maybe?)
drunkness>10 => screen becomes very blurry
drunkness>15 => everytime you take a step forward, you also take a step to the right or the left
drunkness>20 => no more items can be used that increase the value of drunkness

Is this possible and/or very hard??
Thanks
 
I'm sure it isn't to hard to do. That's an interresting idea and i might give it a shot!

You can make your variable in Game_Actor and add a value to it with a common event linked to an item. I'm not sure how to decrease with time though. You can also edit movement methods in Game_Player to make your character walk in every ways depending on the value of the drunkness variable.

Shouldn't be too hard ;)
 
de meester;142564 said:
Mmm, I have absolutely no idea where to begin :)
Can anybody help me?

hmmm for time either do Time.new and than keep track of the time passed with time.new.min or hour (well do something like)
t = Time.new
t.min
or you can do something like
Code:
@wait = 0 #(though make sure it doesnt loop to setting it to 0)
if @wait>=0
@wait+=1
  if @wait >=__#how much time you want until the effect goes away
  @drunkness-=1#?
end
and than just add to that
 

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