Death Scene

Started by Babar, Tue 05/08/2003 10:04:51

Previous topic - Next topic

Babar

Ok, I wanted to know how to make a death scene thing like in the kings quest 5, where they give you some message about how you died along with the restore restart quit options. I want one where I can have different messages if the guy dies in different ways. If it is possible (without TOO much scripting) could I also have it with a WHOLE new room for death, like it was done in King's Quest 6. Could you tell me how to make it? Thanks
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Necro

I'd make a GUI with a buttons and a text box and do a function like this...

function Death (int ButtonGraphic, string DeathText) {
Change gui button image to ButtonGraphic
Change Gui Textboxtext to DeathText
}

then call function death in your script simply by calling...
Death(67,"A rock fell on your head!");

You could add buttons on your gui like restore and Quit too...

renn_inoue

#2
I'm also curious about death scenes.  Where would you put that function definition of death()?  In the global script header?

Has anyone ever written a tutorial on death scenes?  I won't be writing my death scene  for a few days but don't want to start up a new thread for a similar question.  It would be great to just reference a small tutorial on making a death scene from the ground up.  No big deal if there isn't one.   Just curious.  

TerranRich

You really don't need a tutorial about death scenes. It's really rather simple.

Whenever an event that should trigger a death happens, simply call up the Death() function Necro defined above.

Where does it go? Firstly, put the entire function into the global script. Then, put the line "import function Death(int,string);" at the top of the script header.

Then, create the Death GUI by putting some kind of image (maybe an image of the cause of death) and some text (a description of how you died, or whatever), then put three buttons, "Restart", "Restore", "Quit" and for the script, put whatever is supposed to happen.

It's as simple as that. Simply look up in the manual for the restartgame/loadgame/quitgame functions, as well as the change GUI button image/text functions.

:)
Status: Trying to come up with some ideas...

renn_inoue

Quote from: Necro on Tue 05/08/2003 10:22:17

{
Change gui button image to ButtonGraphic
Change Gui Textboxtext to DeathText
}


This sounds like a dumb question, but is the above part of the function definition pseudo-code?  That's not the exact code for the function definition, is it?  Thanks for the help, terranRICH! :)

TerranRich

Yes, it's psuedocode. I guess he expected you to search through the manual for the code to (1) change a GUI button's image and (2) change a GUI label's text. You can do it! ;)
Status: Trying to come up with some ideas...

renn_inoue

No sweat! 8)  Just wanted to make sure before I went digging in the GUI manual.  *slaps hand*  Sorry, should have done that BEFORE posting the question.  Sorry. :-[  

It's just that the AGS function system is so user-friendly I wouldn't have been surprised if the AGS coding geniuses HAD programmed the definition that way.  ;)  But looking again, that clearly is psuedocode.  Sorry for posting such a dumb question.

Thanks again, terranRICH! ;)

SMF spam blocked by CleanTalk