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
How i can reload script area when i die ? And how to create loopable sounds ?
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#3
RE: How i can reload script area when i die ? And how to create loopable sounds ?

For the checkpoint, what you must do is you have to re-apply all the functions that happen when encountering the monster. I will use my script for example
What this does is before you die the function will run normally as it should the first time through. Now when you die and you respawn at the checkpoint, the script will register that the monster encounter has already happened and doesn't need to do it again unless you declare it in the checkpoint function, that way when you die the script knows that it has to run the function again
Hope this helped Smile
void OnStart
{
AddEntityCollideCallback("Player", "monster_spawn", "monsterspawn", true, 1);
CheckPoint("check01", "PlayerStartArea_2", "CheckPoint01", "", "");
}
void CheckPoint01(string &in asName, int alCount)
{
SetPlayerHealth(RandFloat(80, 95));
AddEntityCollideCallback("Player", "monster_spawn", "monsterspawn", true, 1);
ResetProp("monster_door");
}
void monsterspawn(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
SetPropHealth("monster_door", 0.0);
ShowEnemyPlayerPosition("servant_grunt_2");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_6", 0.0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_7", 0.0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 0.0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_9", 0.0, "");
}
(This post was last modified: 07-31-2012, 09:12 PM by drunkmonk.)
07-31-2012, 09:11 PM
Find


Messages In This Thread
RE: How i can reload script area when i die ? And how to create loopable sounds ? - by drunkmonk - 07-31-2012, 09:11 PM



Users browsing this thread: 1 Guest(s)