This is something I haven't tested a ton so I can only give you the quick and dirty method.

This call will end the game by playing the credits and dumping you to a menu.
EndGame();

^Yes the () are empty.

So making it run is basically just like any other call.

IF
SOMEEVENT
THEN
GameEnd();

So if you make the query a global event, the second that global event is run it will probably kill your dialog and end the game, something you probably don't want as it would look weird.

My suggestion would be something like this:

IF
GlobalEventSet("TheGameWillBeOver")
THEN
DB_GameIsOver(1);


In your dialog file, for the specific node that ends the game, use the:
ACTION SetFlag("TheGameWillBeOver",1)

All that would do is add the DB_GameIsOver(1);


But the reason for that is so we can do this:
IF
DialogEnded("NPCDIALOG",_) //the _ is very important
AND
DB_GameIsOver(1)
THEN
GameEnd();

So that way, you can talk to that NPC without specifically trying to end the game. But when you hit whatever node has the ACTION SetFlag, as soon as the player hits the Goodbye node and dialog closes credits should roll.




If this particular NPC can only be talked to once, immediately before the end of the game you don't need to do all that.

This would do fine:

IF
DialogEnded("NPCDIALOG",_) //the _ is very important
THEN
GameEnd();


But that would kill the game any time you talk to that NPC, so if the NPC is specifically there at the end only it would work. If you talk to this NPC at any other point in the mod you need to use the DB_GameIsOver(1) thing.

Last edited by SniperHF; 09/09/15 05:28 PM.