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
Monsters don't disappear when die
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#1
Monsters don't disappear when die

When you play amnesia and die from a monster all the monsters that have spawned will disappear. I have a water_lurker and what I want is that if it kills me I don't want it to go away.

11-15-2012, 09:25 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Monsters don't disappear when die

Use the search button. This question has been asked several times before.

Trying is the first step to success.
11-15-2012, 09:26 AM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#3
RE: Monsters don't disappear when die

(11-15-2012, 09:26 AM)beecake Wrote: Use the search button. This question has been asked several times before.
I did search but didn't find anything that would help me. Maybe I'm not searching hard enough but all I found was something about making a checkpoint but i didn't quite understand as I'm a noob when it comes to programming. I need to know pretty much exactly what to do. Sad

Ok I figured it out sorry for posting an already existing subject.

(This post was last modified: 11-15-2012, 10:20 AM by Storfigge.)
11-15-2012, 09:42 AM
Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#4
RE: Monsters don't disappear when die

Every time you use some kind of enemies or if it is possible to die in one or another way, checkpoints is a great feature to use to have control over spawning areas and things that should happen after death.

A smart way would be to put a checkpoint function in your function that activates your enemy.
Then you would use;

void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

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

Do not forget that the callback syntax is void asCallback(string &in asName, int alCount), where asCallback is the name of your callback-function (the function that will be called after death).
It is this function you will need to use to respawn your enemy and it could have the same content as your enemy-function with the checkpoint to respawn your enemy.

Here is an example of how it could like like:

void OnStart()
{
AddEntityCollideCallback("Player", "Enemy_Area", "Enemy_Function", true, 1);
}

void Enemy_Function(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy", true);
for(int i=1;i<=10;i++) AddEnemyPatrolNode("Enemy", "PathNodeArea_"+i, 0.001f, "");
CheckPoint("checkpoint_enemy1", "Spawnarea_1", "DeathFunction1", "DeathHint", "Death1");
}

void DeathFunction1(string &in asName, int alCount)
{
SetEntityActive("Enemy", true);
for(int i=1;i<=10;i++) AddEnemyPatrolNode("Enemy", "PathNodeArea_"+i, 0.001f, "");
CheckPoint("checkpoint_enemy1", "Spawnarea_1", "DeathFunction1", "DeathHint", "Death1");
}
.
(11-15-2012, 09:42 AM)Storfigge Wrote: I did search but didn't find anything that would help me. Maybe I'm not searching hard enough but all I found was something about making a checkpoint but i didn't quite understand as I'm a noob when it comes to programming. I need to know pretty much exactly what to do. Sad

Ok I figured it out sorry for posting an already existing subject.
11-15-2012, 03:04 PM
Website Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#5
RE: Monsters don't disappear when die

Ty a lot I'm going to try this out Smile

(This post was last modified: 11-16-2012, 12:54 AM by Storfigge.)
11-16-2012, 12:53 AM
Find




Users browsing this thread: 3 Guest(s)