| 
 RE: Enemy respawn? - tonitoni1998 -  02-23-2013
 
 Thats why you need the cache. You save the map as it is and load it. I did not try that yet but thats my idea of it
 
 
 RE: Enemy respawn? - Kirbypwnage -  02-23-2013
 
 
  (02-23-2013, 03:57 PM)tonitoni1998 Wrote:  Thats why you need the cache. You save the map as it is and load it. I did not try that yet but thats my idea of it Sounds like it should work, but I have no idea how to use the cache.
 
 
  (02-23-2013, 03:52 PM)Smoke Wrote:  Could you give us the script? Of course. Sorry I didn't post that to start with. This is the checkpoint script, inside a function.
 
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "Monsterfunction", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 
 
 RE: Enemy respawn? - OriginalUsername -  02-23-2013
 
 
  (02-23-2013, 06:18 PM)Kirbypwnage Wrote:   (02-23-2013, 03:57 PM)tonitoni1998 Wrote:  Thats why you need the cache. You save the map as it is and load it. I did not try that yet but thats my idea of it Sounds like it should work, but I have no idea how to use the cache.
 
 
  (02-23-2013, 03:52 PM)Smoke Wrote:  Could you give us the script? Of course. Sorry I didn't post that to start with. This is the checkpoint script, inside a function.
 
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "Monsterfunction", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 I mean your total script.
 
 
 RE: Enemy respawn? - Kirbypwnage -  02-23-2013
 
 
  (02-23-2013, 06:38 PM)Smoke Wrote:   (02-23-2013, 06:18 PM)Kirbypwnage Wrote:   (02-23-2013, 03:57 PM)tonitoni1998 Wrote:  Thats why you need the cache. You save the map as it is and load it. I did not try that yet but thats my idea of it Sounds like it should work, but I have no idea how to use the cache.
 
 
  (02-23-2013, 03:52 PM)Smoke Wrote:  Could you give us the script? Of course. Sorry I didn't post that to start with. This is the checkpoint script, inside a function.
 
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "Monsterfunction", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 I mean your total script.
 My total script for the whole map? Well... Okay. I dunno why you need the whole thing though.
 
 But here it is:
 
 void OnStart()
 {
 AutoSave();
 SetPlayerMoveSpeedMul(1.0);
 SetPlayerLookSpeedMul(1.0);
 SetPlayerRunSpeedMul(1.0);
 FadeIn(5.0f);
 AddTimer("henrytalktimer", 5.0f, "Henrytalkfunction");
 AddEntityCollideCallback("Player", "williammessage", "Williamfunction", true, 1);
 AddEntityCollideCallback("Player", "henrytalk", "Henrytalk2function", true, 1);
 AddEntityCollideCallback("Player", "henrytalk3", "Henrytalk3function", true, 1);
 AddEntityCollideCallback("Player", "williammessage2", "Williamfunction2", true, 1);
 AddEntityCollideCallback("Player", "monsters", "Monsterfunction", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge1", "Charlesbridgefunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge2", "Charlesbridgefunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesfall1", "Charlesfallfunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesfall2", "Charlesfallfunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesdie", "Charlesdiefunction", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge1", "Floydbridgefunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge2", "Floydbridgefunction2", true, 1);
 AddEntityCollideCallback("floyd", "floydfall1", "Floydfallfunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydfall2", "Floydfallfunction2", true, 1);
 AddEntityCollideCallback("floyd", "floyddie", "Floyddiefunction", true, 1);
 AddEntityCollideCallback("Player", "williammessage3", "Williamfunction3", true, 1);
 }
 void Henrytalkfunction(string &in asTimer)
 {
 SetMessage("Messages", "henrytalk", 0);
 SetPlayerActive(true);
 }
 void Williamfunction(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage", "");
 }
 void Henrytalk2function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk2", 0);
 }
 void Henrytalk3function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk3", 0);
 }
 void Williamfunction2(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage2", "");
 }
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "Monsterfunction", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 void Charlesbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_37", 0.001, "");
 }
 void Charlesbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_38", 0.001, "");
 }
 void Charlesfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Charlesfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Charlesdiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadcharles", 0);
 SetEntityActive("charles", false);
 DestroyParticleSystem("charlesspark1");
 DestroyParticleSystem("charlesspark2");
 DestroyParticleSystem("charlesspark3");
 }
 void Floydbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_37", 0.001, "");
 }
 void Floydbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_38", 0.001, "");
 }
 void Floydfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Floydfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Floyddiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadfloyd", 0);
 SetEntityActive("floyd", false);
 DestroyParticleSystem("floydspark1");
 DestroyParticleSystem("floydspark2");
 DestroyParticleSystem("floydspark3");
 }
 void Williamfunction3(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage3", "");
 }
 //===========================================
 // This runs when the player leaves the map
 void OnLeave()
 {
 }
 
 
 RE: Enemy respawn? - tonitoni1998 -  02-23-2013
 
 
  (02-23-2013, 06:59 PM)Kirbypwnage Wrote:  My total script for the whole map? Well... Okay. I dunno why you need the whole thing though.
 But here it is:
 
 void OnStart()
 {
 .....
 
 .......
 void Williamfunction3(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage3", "");
 }
 //===========================================
 // This runs when the player leaves the map
 void OnLeave()
 {
 }
 use "[ code ]" and "[ /code ]" (without spaces) next time
  its # this in the editor   
 
 RE: Enemy respawn? - Kirbypwnage -  02-23-2013
 
 
  (02-23-2013, 07:36 PM)tonitoni1998 Wrote:   (02-23-2013, 06:59 PM)Kirbypwnage Wrote:  My total script for the whole map? Well... Okay. I dunno why you need the whole thing though.
 But here it is:
 
 void OnStart()
 {
 .....
 
 .......
 void Williamfunction3(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage3", "");
 }
 //===========================================
 // This runs when the player leaves the map
 void OnLeave()
 {
 }
 use "[ code ]" and "[ /code ]" (without spaces) next time
  its # this in the editor  Okay, sure. But do you have a solution for the problem?
 
 
 RE: Enemy respawn? - tonitoni1998 -  02-23-2013
 
 
  (02-23-2013, 07:39 PM)Kirbypwnage Wrote:  Okay, sure. But do you have a solution for the problem? nope sorry im just following this thread because i need the same thing.
 
 
 RE: Enemy respawn? - OriginalUsername -  02-23-2013
 
 What a mess
  Don't you want some order in your script? 
 EDIT: I'm sorry, with full script i meant the stuff in void OnStart. I should've been more clear
 
 Anyway: this might do it.
 
 
 Code: void OnStart() {
 AutoSave();
 SetPlayerMoveSpeedMul(1.0);
 SetPlayerLookSpeedMul(1.0);
 SetPlayerRunSpeedMul(1.0);
 FadeIn(5.0f);
 AddTimer("henrytalktimer", 5.0f, "Henrytalkfunction");
 AddEntityCollideCallback("Player", "williammessage", "Williamfunction", true, 1);
 AddEntityCollideCallback("Player", "henrytalk", "Henrytalk2function", true, 1);
 AddEntityCollideCallback("Player", "henrytalk3", "Henrytalk3function", true, 1);
 AddEntityCollideCallback("Player", "williammessage2", "Williamfunction2", true, 1);
 AddEntityCollideCallback("Player", "monsters", "Monsterfunction", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge1", "Charlesbridgefunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge2", "Charlesbridgefunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesfall1", "Charlesfallfunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesfall2", "Charlesfallfunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesdie", "Charlesdiefunction", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge1", "Floydbridgefunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge2", "Floydbridgefunction2", true, 1);
 AddEntityCollideCallback("floyd", "floydfall1", "Floydfallfunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydfall2", "Floydfallfunction2", true, 1);
 AddEntityCollideCallback("floyd", "floyddie", "Floyddiefunction", true, 1);
 AddEntityCollideCallback("Player", "williammessage3", "Williamfunction3", true, 1);
 SetLocalVarInt("monster", 0);
 }
 void Henrytalkfunction(string &in asTimer)
 {
 SetMessage("Messages", "henrytalk", 0);
 SetPlayerActive(true);
 }
 void Williamfunction(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage", "");
 }
 void Henrytalk2function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk2", 0);
 }
 void Henrytalk3function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk3", 0);
 }
 void Williamfunction2(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage2", "");
 }
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 AddLocalVarInt("monster", -1);
 if(GetLocalVarInt("monster") == 0)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "check", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 else
 {
 }
 }
 
 void check(string &in asName, int alCount)
 {
 AddLocalVarInt("monster", 1);
 }
 
 void Charlesbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_37", 0.001, "");
 }
 void Charlesbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_38", 0.001, "");
 }
 void Charlesfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Charlesfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Charlesdiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadcharles", 0);
 SetEntityActive("charles", false);
 DestroyParticleSystem("charlesspark1");
 DestroyParticleSystem("charlesspark2");
 DestroyParticleSystem("charlesspark3");
 }
 void Floydbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_37", 0.001, "");
 }
 void Floydbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_38", 0.001, "");
 }
 void Floydfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Floydfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Floyddiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadfloyd", 0);
 SetEntityActive("floyd", false);
 DestroyParticleSystem("floydspark1");
 DestroyParticleSystem("floydspark2");
 DestroyParticleSystem("floydspark3");
 }
 void Williamfunction3(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage3", "");
 }
 //===========================================
 // This runs when the player leaves the map
 void OnLeave()
 {
 }
I added a LocalVarInt and set it on 0. Everytime a player dies, it adds 1 to that. When you enter that script area, it takes one, so it's 0 again. And like it says: If the localvarint "monster" == 0, that stuff happens. I just guessed floyd and charles are monsters.
 
 
 RE: Enemy respawn? - Kirbypwnage -  02-24-2013
 
 
  (02-23-2013, 08:19 PM)Smoke Wrote:  What a mess  Don't you want some order in your script? 
 EDIT: I'm sorry, with full script i meant the stuff in void OnStart. I should've been more clear
 
 Anyway: this might do it.
 
 
 Code: void OnStart() {
 AutoSave();
 SetPlayerMoveSpeedMul(1.0);
 SetPlayerLookSpeedMul(1.0);
 SetPlayerRunSpeedMul(1.0);
 FadeIn(5.0f);
 AddTimer("henrytalktimer", 5.0f, "Henrytalkfunction");
 AddEntityCollideCallback("Player", "williammessage", "Williamfunction", true, 1);
 AddEntityCollideCallback("Player", "henrytalk", "Henrytalk2function", true, 1);
 AddEntityCollideCallback("Player", "henrytalk3", "Henrytalk3function", true, 1);
 AddEntityCollideCallback("Player", "williammessage2", "Williamfunction2", true, 1);
 AddEntityCollideCallback("Player", "monsters", "Monsterfunction", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge1", "Charlesbridgefunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge2", "Charlesbridgefunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesfall1", "Charlesfallfunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesfall2", "Charlesfallfunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesdie", "Charlesdiefunction", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge1", "Floydbridgefunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge2", "Floydbridgefunction2", true, 1);
 AddEntityCollideCallback("floyd", "floydfall1", "Floydfallfunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydfall2", "Floydfallfunction2", true, 1);
 AddEntityCollideCallback("floyd", "floyddie", "Floyddiefunction", true, 1);
 AddEntityCollideCallback("Player", "williammessage3", "Williamfunction3", true, 1);
 SetLocalVarInt("monster", 0);
 }
 void Henrytalkfunction(string &in asTimer)
 {
 SetMessage("Messages", "henrytalk", 0);
 SetPlayerActive(true);
 }
 void Williamfunction(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage", "");
 }
 void Henrytalk2function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk2", 0);
 }
 void Henrytalk3function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk3", 0);
 }
 void Williamfunction2(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage2", "");
 }
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 AddLocalVarInt("monster", -1);
 if(GetLocalVarInt("monster") == 0)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "check", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 else
 {
 }
 }
 
 void check(string &in asName, int alCount)
 {
 AddLocalVarInt("monster", 1);
 }
 
 void Charlesbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_37", 0.001, "");
 }
 void Charlesbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_38", 0.001, "");
 }
 void Charlesfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Charlesfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Charlesdiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadcharles", 0);
 SetEntityActive("charles", false);
 DestroyParticleSystem("charlesspark1");
 DestroyParticleSystem("charlesspark2");
 DestroyParticleSystem("charlesspark3");
 }
 void Floydbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_37", 0.001, "");
 }
 void Floydbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_38", 0.001, "");
 }
 void Floydfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Floydfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Floyddiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadfloyd", 0);
 SetEntityActive("floyd", false);
 DestroyParticleSystem("floydspark1");
 DestroyParticleSystem("floydspark2");
 DestroyParticleSystem("floydspark3");
 }
 void Williamfunction3(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage3", "");
 }
 //===========================================
 // This runs when the player leaves the map
 void OnLeave()
 {
 }
I added a LocalVarInt and set it on 0. Everytime a player dies, it adds 1 to that. When you enter that script area, it takes one, so it's 0 again. And like it says: If the localvarint "monster" == 0, that stuff happens. I just guessed floyd and charles are monsters.
 Okay, so with that little adjustment, will it work if I connect it to the monsters?
 
 EDIT: I attempted it, and the monsters still despawned. Is there anything more than a LocalVarInt I need to add?
 
 
 RE: Enemy respawn? - PutraenusAlivius -  02-24-2013
 
 
  (02-24-2013, 11:48 AM)Kirbypwnage Wrote:  I got an idea. It may not work, but it's something. Or maybe it will. (02-23-2013, 08:19 PM)Smoke Wrote:  What a mess  Don't you want some order in your script? 
 EDIT: I'm sorry, with full script i meant the stuff in void OnStart. I should've been more clear
 
 Anyway: this might do it.
 
 
 Code: void OnStart() {
 AutoSave();
 SetPlayerMoveSpeedMul(1.0);
 SetPlayerLookSpeedMul(1.0);
 SetPlayerRunSpeedMul(1.0);
 FadeIn(5.0f);
 AddTimer("henrytalktimer", 5.0f, "Henrytalkfunction");
 AddEntityCollideCallback("Player", "williammessage", "Williamfunction", true, 1);
 AddEntityCollideCallback("Player", "henrytalk", "Henrytalk2function", true, 1);
 AddEntityCollideCallback("Player", "henrytalk3", "Henrytalk3function", true, 1);
 AddEntityCollideCallback("Player", "williammessage2", "Williamfunction2", true, 1);
 AddEntityCollideCallback("Player", "monsters", "Monsterfunction", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge1", "Charlesbridgefunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesbridge2", "Charlesbridgefunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesfall1", "Charlesfallfunction1", true, 1);
 AddEntityCollideCallback("charles", "charlesfall2", "Charlesfallfunction2", true, 1);
 AddEntityCollideCallback("charles", "charlesdie", "Charlesdiefunction", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge1", "Floydbridgefunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydbridge2", "Floydbridgefunction2", true, 1);
 AddEntityCollideCallback("floyd", "floydfall1", "Floydfallfunction1", true, 1);
 AddEntityCollideCallback("floyd", "floydfall2", "Floydfallfunction2", true, 1);
 AddEntityCollideCallback("floyd", "floyddie", "Floyddiefunction", true, 1);
 AddEntityCollideCallback("Player", "williammessage3", "Williamfunction3", true, 1);
 SetLocalVarInt("monster", 0);
 }
 void Henrytalkfunction(string &in asTimer)
 {
 SetMessage("Messages", "henrytalk", 0);
 SetPlayerActive(true);
 }
 void Williamfunction(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage", "");
 }
 void Henrytalk2function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk2", 0);
 }
 void Henrytalk3function(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "henrytalk3", 0);
 }
 void Williamfunction2(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage2", "");
 }
 void Monsterfunction(string &in asParent, string &in asChild, int alState)
 {
 AddLocalVarInt("monster", -1);
 if(GetLocalVarInt("monster") == 0)
 {
 CheckPoint("checkpoint", "PlayerStartArea_2", "check", "Messages", "monsterhint");
 SetMessage("Messages", "henrytalk4", 0);
 SetEntityActive("floyd", true);
 SetEntityActive("charles", true);
 }
 else
 {
 }
 }
 
 void check(string &in asName, int alCount)
 {
 AddLocalVarInt("monster", 1);
 }
 
 void Charlesbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_37", 0.001, "");
 }
 void Charlesbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("charles", "PathNodeArea_38", 0.001, "");
 }
 void Charlesfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Charlesfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("charlesblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Charlesdiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadcharles", 0);
 SetEntityActive("charles", false);
 DestroyParticleSystem("charlesspark1");
 DestroyParticleSystem("charlesspark2");
 DestroyParticleSystem("charlesspark3");
 }
 void Floydbridgefunction1(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_37", 0.001, "");
 }
 void Floydbridgefunction2(string &in asParent, string &in asChild, int alState)
 {
 AddEnemyPatrolNode("floyd", "PathNodeArea_38", 0.001, "");
 }
 void Floydfallfunction1(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam1", false);
 SetEntityActive("beam2", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1_1", "ps_break_wood.ps", "beam2", true);
 CreateParticleSystemAtEntity("break2_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break3_1", "ps_break_wood.ps", "beam1", true);
 CreateParticleSystemAtEntity("break4_1", "ps_break_wood.ps", "beam2", true);
 }
 void Floydfallfunction2(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("floydblock", false);
 SetEntityActive("beam3", false);
 SetEntityActive("beam4", false);
 PlaySoundAtEntity("", "explosion_rock_large", "Player", 0, false);
 StartScreenShake(0.50f,0.50f, 0.50f,0.15f);
 CreateParticleSystemAtEntity("break1", "ps_break_wood.ps", "beam3", true);
 CreateParticleSystemAtEntity("break2", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break3", "ps_break_wood.ps", "beam4", true);
 CreateParticleSystemAtEntity("break4", "ps_break_wood.ps", "beam3", true);
 }
 void Floyddiefunction(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "deadfloyd", 0);
 SetEntityActive("floyd", false);
 DestroyParticleSystem("floydspark1");
 DestroyParticleSystem("floydspark2");
 DestroyParticleSystem("floydspark3");
 }
 void Williamfunction3(string &in asParent, string &in asChild, int alState)
 {
 StartEffectEmotionFlash("Messages", "williammessage3", "");
 }
 //===========================================
 // This runs when the player leaves the map
 void OnLeave()
 {
 }
I added a LocalVarInt and set it on 0. Everytime a player dies, it adds 1 to that. When you enter that script area, it takes one, so it's 0 again. And like it says: If the localvarint "monster" == 0, that stuff happens. I just guessed floyd and charles are monsters.
 Okay, so with that little adjustment, will it work if I connect it to the monsters?
 
 EDIT: I attempted it, and the monsters still despawned. Is there anything more than a LocalVarInt I need to add?
 When the player respawns, add a collide area where the player respawns, so that the monsters will be active.
 
 
 
 |