Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Babar on Tue 05/08/2003 10:04:51

Title: Death Scene
Post by: Babar on Tue 05/08/2003 10:04:51
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
Title: Re:Death Scene
Post by: Necro on Tue 05/08/2003 10:22:17
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...
Title: Re:Death Scene
Post by: renn_inoue on Wed 06/08/2003 01:42:25
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.  
Title: Re:Death Scene
Post by: TerranRich on Thu 07/08/2003 21:48:12
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.

:)
Title: Re:Death Scene
Post by: renn_inoue on Fri 08/08/2003 02:14:55
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! :)
Title: Re:Death Scene
Post by: TerranRich on Fri 08/08/2003 03:47:14
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! ;)
Title: Re:Death Scene
Post by: renn_inoue on Fri 08/08/2003 04:47:20
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! ;)