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 patrol nodes not added
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#1
Enemy patrol nodes not added

They work for enemies previously set in the level editor. However, when creating a monster dynamically (e.g. with CreateEntityAtArea) the monster doesn't do anything. I'm not sure why, but i'm guessing it is because of the monster's "wait" state, since the other, pre-set monsters are in an "idle" state. Anyone know why dynamically created monsters don't want to follow paths given to them?

I need monsters to be dynamically created because the game doesn't seem to allow monsters to be reset, and this is the only workaround i could think of.

HPL.log showing: "ERROR: There is no node container in enemy 'servant_grunt_2'! (probably no nodes in map!);" not sure what this means and there are plenty of nodes in the map.

Tutorials: From Noob to Pro
(This post was last modified: 09-23-2011, 11:04 PM by Your Computer.)
09-20-2011, 07:55 AM
Website Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Enemy patrol nodes not added

Dynamically created monsters cannot be directed with path nodes unfortunately. I tried many thigns to make it work.
I had a monster and setting it inactive was not enough for some reason; so I tried to dynamically create it. However that didn't quite work. So I had to change the monster, to a less attractive one.

Engine tends to link the nodes to existing enemies in the start of the map, not in the middle of the game.

09-20-2011, 02:30 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: Enemy patrol nodes not added

It's a shame you can't use path nodes with the dynamicly created monsters. The only solution to this I have tried is to make the enemy's .nodes file - this still doesn't work though, as it appears the error comes up before the nodes file is check/created.

Edit:
Does translating the player below -500 in y get the game to load an autosave? This may reset the enemies. Really can't remember if this loads the auto-save or the checkpoint.
(This post was last modified: 09-20-2011, 05:10 PM by Apjjm.)
09-20-2011, 03:05 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Enemy patrol nodes not added

Well, there is still one more method i have in mind in attempting to get what i want, but it is a very extreme method (being sure to lag the level editor to no end) and it means the player will not have unlimited retries. It seems like i'll have to put this on the end of my to do list, therefore.

Tutorials: From Noob to Pro
09-20-2011, 06:47 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#5
RE: Enemy patrol nodes not added

Actually, (I blame having just woken up when i last posted for not suggesting this) but there is a really simple solution. Use LoadMap in conjunction with your player start area to re-load the level. The load times should be really short as the level is already loaded (if it isn't use the Create Cache methods?).

Obviously you can duplicate a few enemies here and there so you only have to reload every 10 tries or so if loading the level still breaks the flow significantly.

(This post was last modified: 09-20-2011, 08:37 PM by Apjjm.)
09-20-2011, 08:34 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Enemy patrol nodes not added

Well, this is only required for Amnesia's Creed (which will be part of Teamnesia), and the goal is to avoid long pauses caused by deaths (i.e. death hints) and loading--that is, after the main course has been initiated (since that is the only time the player would be prone to failure). Reloading the map and using, perhaps, local variables to keep track of checkpoints is more than what i am willing to put the player through.

Also, would you happen to know if the other enemy types available in the model editor can follow path nodes? I don't really need a monster that can attack the player (in fact, i would prefer if it didn't, at least for the part i'm working on), i just need one that can follow path nodes and reacts to the player by temporarily disregarding the path nodes. I know the graveyard corpse reacts to the player and doesn't attack the player, but i haven't tested if it can be reset or made to follow path nodes.

Tutorials: From Noob to Pro
(This post was last modified: 09-20-2011, 08:58 PM by Your Computer.)
09-20-2011, 08:57 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#7
RE: Enemy patrol nodes not added

Just tested out ChangeMap() to the same map - It behaves just like a " Quick Map Reload " except with a short fadein/fadeout. It actually doesn't reset the state of the enemy though. Will see if i can find a workaround.

Edit 2: Problem is caused by map state persisting over level load. This can be fixed with the following approach which switched between two maps, however I am unsure if this will still load quickly - DO test it out though!

To elaborate (though i'm not entirely sure it is necessary) i made a map called "test", and a map called "test_throwback". Test was just a simple map involving a plane and a patrolling enemy:
void OnStart() {
    SetSanityDrainDisabled(true);
    GiveItemFromFile("lantern","lantern.ent");
    SetLanternLitCallback("onLit");
        for(int i=1; i<=3; i++) AddEnemyPatrolNode("servant_grunt_1","PathNodeArea_"+i,0.1f,"");
}

void OnEnter() {
AddDebugMessage("Currently on Test map!",false);
}

void onLit(bool abLit) {
ClearSavedMaps();
if(abLit) resetMap("test.map","");
}

void resetMap(string &in asMap, string &in asPos) {
SetGlobalVarString("_DESTINATIONMAP",asMap);
SetGlobalVarString("_DESTINATIONPOS",asPos);
DestroyDataCache(); CreateDataCache();
ChangeMap("test_throwback.map","","","");
}

The throwback map was literally just a copy with a different hps file - for the fastest loading times a completely blank map with just 1 start area may be better.
void OnEnter() {
ClearSavedMaps();
ChangeMap(GetGlobalVarString("_DESTINATIONMAP"),GetGlobalVarString("_DESTINATIONPOS"),"","");
AddDebugMessage("Entered Test Throwback map",false);
}

Of course, finding some way to get the game to "forget" the state of the map without transitioning to another blank map first will be tonnes better, as there will be no loading screen - this would actually be exactly what you are looking for. However, as it is I'm not suggesting you solely use this solution as it clearly doesn't meet your requirements, but it could be an effective solution to the problem of the finite number of resets with the "tonne of deactivated grunts" approach.

Edit again:
Graveyard corpse is just a permutation of "enemy_grunt" type - it will follow path nodes but still have the same problems with not being able to add them dynamically. You may be able to simulate path nodes by using a water lurker style enemy + invisible food if the game doesn't allow path nodes to be added to lurkers?
(This post was last modified: 09-20-2011, 10:14 PM by Apjjm.)
09-20-2011, 09:41 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Enemy patrol nodes not added

Hmm, after a bit of thinking, i suppose i have no choice but to go with a set number of monsters and temporarily changing maps. I'll manage to work this into the "story" where it shouldn't bother the player much.

Tutorials: From Noob to Pro
09-21-2011, 04:09 AM
Website Find
GraphicsKid Offline
Senior Member

Posts: 258
Threads: 34
Joined: Dec 2010
Reputation: 3
#9
RE: Enemy patrol nodes not added

Yea I had this same problem a while back too. I ended up just having to make 256 monsters in the same spot... though if it takes them 256 tries... I don't care anymore, they can move on... they've earned it for sticking with it 256 times without dying.

Then I accidentally overwrote the code for the map and I haven't been the same since... Sad
09-21-2011, 11:16 PM
Find




Users browsing this thread: 1 Guest(s)