Posted by Magi on February 12, 1998 at 17:44:42:
In Reply to: I'm wondering how I can end an SP level. posted by Tallon on February 12, 1998 at 15:33:07:
Ending Levels
How do I make it so the level ends when I enter a sector/cross a surface?
Use the jkEndLevel(1); cog command. in conjunction with the entered or touched message. Look at some of the endlevel cogs that came with JK for examples.
How do I make it so the level ends when kill a bad guy?
Just use a cog along the lines of (this is not a complete cog, just fragments !!!) :
thing boba mask=0xfff
message killed
...
killed:
// wait a while, see the death animation, etc.
Sleep(3);
// Don't end the level if player is dead.
if (GetThingHealth(GetLocalPlayerThing()) <= 0) return;
// finish the level
jkEndLevel(1);
Return;
(code from Cog King).