Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help The Capture Scene - Amnesia
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#1
The Capture Scene - Amnesia

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

[Image: 25F7U37.png]
(This post was last modified: 08-29-2012, 05:27 PM by Melvin.)
08-29-2012, 05:20 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: The capture scene

(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.
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Call this with the same event that triggers the monster.

Additional info:
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.
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);


If that helped, help me back with a +1. It's a fair trade.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
08-29-2012, 05:28 PM
Website Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: The Capture Scene - Amnesia

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.

I rate it 3 memes.
08-30-2012, 07:07 AM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#4
RE: The Capture Scene - Amnesia

(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.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
08-30-2012, 07:59 AM
Website Find




Users browsing this thread: 1 Guest(s)