Frictional Games Forum (read-only)
Death to main menu - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Death to main menu (/thread-17430.html)



Death to main menu - HeadyBoy - 08-02-2012

Like in Justine.. is there anyway for when you die, to return to the main menu? I tried making saves etc but for the length my story is I think it would be better to have that feature instead of respawning


RE: Death to main menu - Apjjm - 08-02-2012

As far as i am aware, it isn't possible to force the game to exit when dead (except inside the justine full conversion), and if it is possible - you will probably need a full conversion. However, you can achieve the same effect without a full conversion rather trivially by using StartCredits (This also has the benefit of not outright exiting the game too). All you need to do is set a checkpoint callback which then starts a set of pseudo-credits saying "game over" or something.

Example:
Spoiler below!

Code:
void OnEnter() {
CheckPoint("GameOver","PlayerStartArea_1","cbGameOver", "", "");
}

void cbGameOver(string &in asName, int alCount) {
StartCredits("GameOverMusic.ogg", false, "Game", "GameOver", 0);
}

with a .lang category:
Code:
<Category name="Game">
<Entry name="GameOver">Some text or prologue or something...</Entry>
</Category>




RE: Death to main menu - HeadyBoy - 08-03-2012

(08-02-2012, 10:32 PM)Apjjm Wrote: As far as i am aware, it isn't possible to force the game to exit when dead (except inside the justine full conversion), and if it is possible - you will probably need a full conversion. However, you can achieve the same effect without a full conversion rather trivially by using StartCredits (This also has the benefit of not outright exiting the game too). All you need to do is set a checkpoint callback which then starts a set of pseudo-credits saying "game over" or something.

Example:
Spoiler below!

Code:
void OnEnter() {
CheckPoint("GameOver","PlayerStartArea_1","cbGameOver", "", "");
}

void cbGameOver(string &in asName, int alCount) {
StartCredits("GameOverMusic.ogg", false, "Game", "GameOver", 0);
}

with a .lang category:
Code:
Some text or prologue or something...




Why thank you very much Big Grin I will try this as soon as I can and give you my feedback then


RE: Death to main menu - HeadyBoy - 08-03-2012

Done this. It works. But.. there is just a LONG blackness before "the end" comes on the screen. None of my custom text, music etc


RE: Death to main menu - Your Computer - 08-03-2012

You could try to force the game to crash and say that's intended, though it won't necessarily take you to the main menu.

For example, call this in the checkpoint callback:

PHP Code:
AddEntityCollideCallback("NAME_OF_DOOR""NAME_OF_GRAB_ENTITY""COLLIDE_CALLBACK"false1); 

This should cause the game to crash when called.