Frictional Games Forum (read-only)

Full Version: The Capture Scene - Amnesia
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want a brute to slash the player, then a death text will show, then you wake up in another map.

I searched over the internet for a long time. Could be that I wasn't searching for the right stuff, but I want to know how I do this.

I've been looking into the original game script and map, but they weren't eye opening for me.

thanks in advance, SmokeMelvin
(08-29-2012, 05:20 PM)SmokeMelvin Wrote: [ -> ]I want a brute to slash the player, then a death text will show, then you wake up in another map.

I searched over the internet for a long time. Could be that I wasn't searching for the right stuff, but I want to know how I do this.

I've been looking into the original game script and map, but they weren't eye opening for me.

thanks in advance, SmokeMelvin
You need to use a checkpoint here.
Code:
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Call this with the same event that triggers the monster.

Additional info:
Code:
asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file


At the Callback section, add a "ChangeMap" script. Code is below.
Code:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);


If that helped, help me back with a +1. It's a fair trade.
Basic entity collide callback that adds the checkpoint based off what senor Nemet said:


void OnStart()
{
AddEntityCollideCallback("Player", "Name_of_Area", "checkpoint", true, 1);
}


void checkpoint(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "Name_of_Start_Pos", "PlayerDeath", "", "");
}


void PlayerDeath(string &in asName, int alCount)
{
ChangeMap("Name_of_Map.map", "Name_of_Start_Pos", "", "");
}


You can change the type of callback, but be sure to change the callback syntax for "checkpoint" as well.

Hope that helped.
(08-30-2012, 07:07 AM)andyrockin123 Wrote: [ -> ]Basic entity collide callback that adds the checkpoint based off what senor Nemet said:


void OnStart()
{
AddEntityCollideCallback("Player", "Name_of_Area", "checkpoint", true, 1);
}


void checkpoint(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "Name_of_Start_Pos", "PlayerDeath", "", "");
}


void PlayerDeath(string &in asName, int alCount)
{
ChangeMap("Name_of_Map.map", "Name_of_Start_Pos", "", "");
}


You can change the type of callback, but be sure to change the callback syntax for "checkpoint" as well.

Hope that helped.
This should work. But I thought I'd let the lad figure it out. Since that's the way you learn how to script.