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
Enemy respawn?
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#11
RE: Enemy respawn?

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

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-23-2013, 03:57 PM
Find
Kirbypwnage Offline
Junior Member

Posts: 46
Threads: 4
Joined: Feb 2013
Reputation: 1
#12
RE: Enemy respawn?

(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);
}

Currently working on:
Archedale Castle: Cold Hunger
http://www.moddb.com/mods/archedale-castle
(This post was last modified: 02-23-2013, 06:20 PM by Kirbypwnage.)
02-23-2013, 06:18 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#13
RE: Enemy respawn?

(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.
02-23-2013, 06:38 PM
Find
Kirbypwnage Offline
Junior Member

Posts: 46
Threads: 4
Joined: Feb 2013
Reputation: 1
#14
RE: Enemy respawn?

(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()
{
}

Currently working on:
Archedale Castle: Cold Hunger
http://www.moddb.com/mods/archedale-castle
02-23-2013, 06:59 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#15
RE: Enemy respawn?

(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 Tongue its # this in the editor Wink

When you are looking for someone, to do the scripting for your Custom Story, ask me!
(This post was last modified: 02-23-2013, 07:37 PM by tonitoni1998.)
02-23-2013, 07:36 PM
Find
Kirbypwnage Offline
Junior Member

Posts: 46
Threads: 4
Joined: Feb 2013
Reputation: 1
#16
RE: Enemy respawn?

(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 Tongue its # this in the editor Wink

Okay, sure. But do you have a solution for the problem?

Currently working on:
Archedale Castle: Cold Hunger
http://www.moddb.com/mods/archedale-castle
02-23-2013, 07:39 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#17
RE: Enemy respawn?

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

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-23-2013, 08:02 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#18
RE: Enemy respawn?

What a mess Tongue 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.

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.
(This post was last modified: 02-23-2013, 08:27 PM by OriginalUsername.)
02-23-2013, 08:19 PM
Find
Kirbypwnage Offline
Junior Member

Posts: 46
Threads: 4
Joined: Feb 2013
Reputation: 1
#19
RE: Enemy respawn?

(02-23-2013, 08:19 PM)Smoke Wrote: What a mess Tongue 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.

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?

Currently working on:
Archedale Castle: Cold Hunger
http://www.moddb.com/mods/archedale-castle
(This post was last modified: 02-24-2013, 12:06 PM by Kirbypwnage.)
02-24-2013, 11:48 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#20
RE: Enemy respawn?

(02-24-2013, 11:48 AM)Kirbypwnage Wrote:
(02-23-2013, 08:19 PM)Smoke Wrote: What a mess Tongue 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.

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?
I got an idea. It may not work, but it's something. Or maybe it will.
When the player respawns, add a collide area where the player respawns, so that the monsters will be active.

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-24-2013, 12:22 PM
Find




Users browsing this thread: 1 Guest(s)