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
Getting a Monster to respawn after death
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Getting a Monster to respawn after death

(02-11-2013, 05:01 AM)Cyphermur9t Wrote: Basically what it says. I'm trying to get certain functions to be triggered again after death. I have this chase scene where everything works correctly, but there's no point in having it where if the player dies there's no chase when he respawns. So I pretty much want FUNCTION16 and everything that goes with it to start over again.

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_13", "FUNCTION16", true, 1); //final chase starts
}

//////////FINAL CHASE//////////
void FUNCTION16(string &in asParent, string &in asChild, int alState)
{
    SetPlayerActive(false);
    PlaySoundAtEntity("","suitoridle.snt", "servant_suitor_5", 0, false);
    StartPlayerLookAt("servant_suitor_5", 5, 5, "");
    AddTimer("timer1", 2.5f, "final_chase_2");
    StartScreenShake(0.1, 0.16, 0.10,0.10);
    SetMoveObjectState("castle_portcullis_2", 0);
}

void final_chase_2(string &in asTimer)
{
    PlayMusic("Music_Junkies_Brutal.ogg", true, 6, 0, 9, false);
    StartPlayerLookAt("servant_suitor_5", 6, 6, "");
    AddTimer("timer1", 3.8f, "final_chase_3");
}

void final_chase_3(string &in asTimer)
{
    SetMessage("Messages", "Run" , 2.5f);
    StartPlayerLookAt("Look5", 6, 6, "");
    AddTimer("timer1", 1.5f, "final_chase_4");
    SetPropHealth("castle_12", 0.0f);
}

void final_chase_4(string &in asTimer)
{
    SetEntityActive("servant_suitor_5", true);
    AddEnemyPatrolNode("servant_suitor_5", "PathNodeArea_43", 0.0f, "");
    ShowEnemyPlayerPosition("servant_suitor_5");
    StopPlayerLookAt();
    SetPlayerActive(true);
}

//////////RESTART FINAL CHASE AFTER DEATH//////////
void Restart(string &in asParent, string &in asChild, int alState)
{
    CheckPoint ("checkpoint1", "PlayerStartArea_2", "servant_suitor_5", "DeathCategory", "Deathtext1");
}

void

It should be:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_13", "FUNCTION16", true, 1); //final chase starts
AddEntityCollideCallback("Player", "Script_areacheck", "Restart", true, 1);
}

//////////FINAL CHASE//////////
void FUNCTION16(string &in asParent, string &in asChild, int alState)
{
    SetPlayerActive(false);
    PlaySoundAtEntity("","suitoridle.snt", "servant_suitor_5", 0, false);
    StartPlayerLookAt("servant_suitor_5", 5, 5, "");
    AddTimer("timer1", 2.5f, "final_chase_2");
    StartScreenShake(0.1, 0.16, 0.10,0.10);
    SetMoveObjectState("castle_portcullis_2", 0);
}

void final_chase_2(string &in asTimer)
{
    PlayMusic("Music_Junkies_Brutal.ogg", true, 6, 0, 9, false);
    StartPlayerLookAt("servant_suitor_5", 6, 6, "");
    AddTimer("timer1", 3.8f, "final_chase_3");
}

void final_chase_3(string &in asTimer)
{
    SetMessage("Messages", "Run" , 2.5f);
    StartPlayerLookAt("Look5", 6, 6, "");
    AddTimer("timer1", 1.5f, "final_chase_4");
    SetPropHealth("castle_12", 0.0f);
}

void final_chase_4(string &in asTimer)
{
    SetEntityActive("servant_suitor_5", true);
    AddEnemyPatrolNode("servant_suitor_5", "PathNodeArea_43", 0.0f, "");
    ShowEnemyPlayerPosition("servant_suitor_5");
    StopPlayerLookAt();
    SetPlayerActive(true);
}

//////////RESTART FINAL CHASE AFTER DEATH//////////
void Restart(string &in asParent, string &in asChild, int alState)
{
    CheckPoint ("checkpoint1", "PlayerStartArea_2", "Urstuff", "DeathCategory", "Deathtext1");
}

void Urstuff (string &in asName, int alCount)
{
AddEntityCollideCallback("Player", "ScriptArea_13", "FUNCTION16", true, 1);
}

///That simple.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
02-11-2013, 08:29 AM
Find


Messages In This Thread
RE: Getting a Monster to respawn after death - by The chaser - 02-11-2013, 08:29 AM



Users browsing this thread: 1 Guest(s)