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.

how do i make it so when the timer is out, you may die or something else????

how do i make it so when the timer is out, you may die or something else???? if any one knows.... can they help :smile:





                                                        ~ GO HORNS  :rock:~
 

khmp

Sponsor

Code:
Kill_Party_Timer = 1

class Game_System
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # reduce timer by 1
    if @timer_working and @timer > 0
      @timer -= 1
    elsif @timer_working && $game_switches[Kill_Party_Timer]
      $scene = Scene_Gameover.new
    end
  end
end

I don't know if there is a simpler way or a less intrusive way but the above is tested and works. As soon as you enable the timer event command and flip the switch at index "Kill_Party_Timer", as soon as the timer reaches zero the scene will flip the scene to game over.

To install it insert an empty section above main in the script listing column of the script editor and paste in the code. Change the id of the game switch(Kill_Party_Switch) to whatever switch id you wish to use to decide whether or not to kill the party when the timer runs out.

Good luck with it ze straw! :thumb:
 
Honestly... What is it with you guys and scripts?
Conditional branch: When timer is 0:00 or below the gameover.

Thats all... No script or anything needed.

I hope this helps

~Dalton~
 
But why script something, that does not need to be scripted?

I just wanted to point this out, in case ze straw dindn't notice.
And honestly, I think even a scripter doesn't need to script everything.
 
That's why I posted also.  I thought maybe he didn't know you could use events.  And I was only suggesting another option.  When I first started RMXP I nearly gave up when I saw the defaults and didn't know I could use common events or events at all, for that matter, to make the game more customizable.

Just trying to help.  Sorry everyone.  I didn't mean to cause problems.  I hope you find your script.
 

khmp

Sponsor

The reason is quite obvious as to why we posted a script answer in response. This question was asked inside the RGSS forum. I do appreciate the eventing answer though. I honestly don't think about eventing to solve a problem in RMXP. One of my many faults. So a separate approach to the problem is awesome. But a little scripting knowledge is never a bad thing. :thumb:
 
@dalton: why do something with events, when it can be scripted?

If someone can make scripts, he can do whatever he wants with scripts... there is no need to use events if you dont want.

Why make a unstable, buggy system with events when u can make it better with rgss? (without mention the lag events generate)

I'm not saying that events are useless or that I never have used them... but sometimes it's better use scripts.
 
My first game I made was entirely done with events.  Granted, it was only about half hour of play time.  But it was still all done using events.  Including choosing a race, class, and gender.  Also naming your character, and other simple, yet intricate things.  I never used a script at all.  And I never had any problems.  And my newest project, We All Fall, is such a pain in the ass because I have scripts for my battle system, menus, weapon add-ons, and a few other minor things, and it seems that every other time I try to test play it, I get a new error, and none of them are ever due to events. 

It honestly seems to me that if you can do it with events, then all it means is that RMXP has already thought of it and made it possible for you.  And if you don't use events to do the possible, then you're just digging your own grave, because to me scripts are extremely complicated and always full of problems.

Then again, I see it from a scripters point of view and if they can script well enough to never have many problems, then hell, you've got it made, except for the fact that writing an entire script seems to take a hell of a lot longer than making two events, one to start a timer and say if timer = 0 you die.  if not, nothing happens.  And another event that stops the timer.

And again.  If he was already a scripter, why would he be asking such a simple question about scripts. So obviously, he wouldn't be doing much customizing for this one, nor  any others, so in this case, maybe a script would only make it more complicated for him.

EDIT:  This guy hasn't posted since the initial post.  Maybe he gave up. lol and now it's become an events vs. scripts thread.  And with that said.  Maybe events and scripts will one day realize that the best way to conclude this war is to realize that if we work together, we can make great things happen!  There.  Miss USA speech is over with.
 

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