Chaos Project

RPG Maker => Event Systems => Event System Troubleshooting => Topic started by: Noob on January 17, 2011, 04:50:17 pm

Title: Gameover Common Event
Post by: Noob on January 17, 2011, 04:50:17 pm
How do you make a gameover commont event that will override the default game over screen, or, it it's already overriden by blizz-abs or something, will make something happen when you die (lose items/gold, respawn, etc.)? Thanks!
Title: Re: Gameover Common Event
Post by: Starrodkirby86 on January 17, 2011, 05:20:23 pm
Can't say my solution here is the best...But...

Hmm...

What you'd probably want to do is to replace all instances where if a Game Over is true, then RPG Maker XP will go to the Game Over Scene. In the script editor, there should multiple instances where the script asks

if $game_temp.gameover


and the like.

We'll probably need to comment or delete them out. (Adding a # can turn it into a comment).

So...

We should probably comment out or remove Line 75 - 80 in Scene_Map:

    # If game over
   if $game_temp.gameover
     # Switch to game over screen
     $scene = Scene_Gameover.new
     return
   end


Then in the Common Events, have a all-running Conditional Branch that has a script condition saying:
$game_temp.gameover = true


And do what else you need to do after that.

If you want to do the same for Scene_Battle, then that's a little bit different. You'd probably want it to return to the map. So maybe instead of the Scene_GameOver it'll go to, replace that to Scene_Map or something. Whatever the script does after a battle is won, you should emulate.

...I think that's how you do it. If anyone can help me lead Noob to the right direction, then sure. @_@

I suggest you try this on some test project, since editing the original system files can turn to be a yucky mess.
Title: Re: Gameover Common Event
Post by: Wizered67 on January 17, 2011, 05:43:52 pm
Look for auto gameover in the Blizz-ABS config and set it to false. Then you can do whatever you want in a common event when you die.
Title: Re: Gameover Common Event
Post by: Noob on January 17, 2011, 06:36:06 pm
kirby ur idea sorta works but its wierd bcuz instead of checking for if $game_temp.gameover=true, it seems to set it to true, so either nothing happens, or, when i dont comment out that stuff i get the gameover screen. but i have another idea, and i need to know, how can i call a common event using a script? thanks :)
Title: Re: Gameover Common Event
Post by: nathmatt on January 17, 2011, 06:42:18 pm
that is because when you use its used as a condition you need == so it would be
if $game_temp.gameover == true
Title: Re: Gameover Common Event
Post by: Starrodkirby86 on January 17, 2011, 06:47:30 pm
Whoops, my bad.

Meant to add the two =='s. I originally had $game_temp.gameover = $game_party.all_dead or something since that was in the script. I forgot about those =='s. Thanks nathmatt.  :^_^':

For the conditional though, having the if would already be redundant, so you only need $game_temp.gameover == true.

Wizered's point about Blizz-ABS's autogameover might be more useful, personally. oxo See what you can do with that as well.
Title: Re: Gameover Common Event
Post by: WhiteRose on January 17, 2011, 07:45:55 pm
Quote from: Wizered67 on January 17, 2011, 05:43:52 pm
Look for auto gameover in the Blizz-ABS config and set it to false. Then you can do whatever you want in a common event when you die.



This.
Title: Re: Gameover Common Event
Post by: Noob on January 18, 2011, 07:31:55 pm
Well, I tried that, turned off auto gameover, put in the new conditional script with ==, and died in the game. It didn't call my common event, instead it got stuck in a loop with some sound (collapse sound?) and just sounded like a car engine starting or something. But I've got another idea, if I leave auto-gameover on but replace the gameover code with code that calls my common event. So my next qustion is.....how do you call a common event using script? thanks! :)
Title: Re: Gameover Common Event
Post by: Wizered67 on January 18, 2011, 07:42:15 pm
There's no need to. If it does weird things when you set auto gameover to false its your common event to blame. I'm using auto gameover on false and have a common event that works fine.
Title: Re: Gameover Common Event
Post by: Noob on January 18, 2011, 08:16:33 pm
Well then could you help me with my common event? I set it to run parallel, and I turned on the switch that runs it parallel. For my initial test, all that I put inside it was:
Conditional Branch: $game_temp.gameover==true
Text: You are dead.
Branch End
It never showed me the text, all that happened was the error I described above.
Title: Re: Gameover Common Event
Post by: Wizered67 on January 18, 2011, 08:24:39 pm
Here's mine: (it's paralel process with the switch being one turned on by default)

Set a variable to player's HP.
conditional branch: if the HP is 0
Recover all entire party.
Dramatic screen flash.
Transfer player to respawn map.

My example would only work if you only have one actor in the party, but that could be fixed by adding additional conditional branches in the beginning.
Title: Re: Gameover Common Event
Post by: Noob on January 19, 2011, 04:58:20 pm
That would be great, except for the fact that in the set of values that you can set a variable to, they included actor HP, (I don't see how that would ever by applicable), but not party member HP. any ideas?
Title: Re: Gameover Common Event
Post by: The Niche on January 19, 2011, 05:10:12 pm
Something along the lines of $game_party.actors[0].hp == 0

0 is the slot in the party.