Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Patrol Nodes don't work on spawned enemy
Author Message
DoubleThinking Offline
Junior Member

Posts: 32
Joined: Mar 2012
Reputation: 1
Post: #1
Patrol Nodes don't work on spawned enemy
Again here with a problem! So I am making a scripted survival map and it doesn't seem me to add patrol nodes to a n enemy that I spawn with a function. Here is the script part:

.......................        CreateEntityAtArea("servant_grunt", "servant_grunt.ent", "ScriptArea_2", false);            CreateParticleSystemAtEntity("", "ps_ghost_release.ps", "ScriptArea_2", false);            switch(GetLocalVarInt("var_room")) {                case 1:                    AddDebugMessage("Going to Room 1", false);                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_1", RandFloat(1,2), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_2", RandFloat(1,2), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_17", RandFloat(1,2), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_16", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_15", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_10", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_75", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_54", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_48", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_49", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_51", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_52", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_53", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_51", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_49", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_50", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_47", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_45", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_46", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_54", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_48", RandFloat(3,8), "");                    AddEnemyPatrolNode("servant_grunt", "PathNodeArea_75", RandFloat(3,8), "");                break;.............


The dots is continuing script that isn't relevant.

So it shows me the debug message it just doesn't go to the patrol nodes.
Someone knows what is up with that?

The picture was taken with a 1337x1337 camera resolution and then resized to 42x42. The results are blending, as seen in my avatar.
04-10-2012 08:13 PM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #2
RE: Patrol Nodes don't work on spawned enemy
Can you please format the code so that it is readable? Right now I'm not going to attempt to read it, it's all over the place.

Check me out at my youtube channel: http://www.youtube.com/user/Putmalk?feature=mhee

I post videos of my Amnesia creations.
04-10-2012 08:19 PM
Find all posts by this user Quote this message in a reply
DoubleThinking Offline
Junior Member

Posts: 32
Joined: Mar 2012
Reputation: 1
Post: #3
RE: Patrol Nodes don't work on spawned enemy
Oh sorry, didn't see that. Damn, code. Dodgy


CreateEntityAtArea("servant_grunt", "servant_grunt.ent", "ScriptArea_2", false);
CreateParticleSystemAtEntity("", "ps_ghost_release.ps", "ScriptArea_2", false);
switch(GetLocalVarInt("var_room")) {
case 1:
AddDebugMessage("Going to Room 1", false);
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_1", RandFloat(1,2), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_2", RandFloat(1,2), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_17", RandFloat(1,2), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_16", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_15", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_10", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_75", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_54", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_48", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_49", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_51", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_52", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_53", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_51", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_49", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_50", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_47", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_45", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_46", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_54", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_48", RandFloat(3,8), "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_75", RandFloat(3,8), "");
break;


I hope that snippet is enough, but if needed, I submit the whole code.

The picture was taken with a 1337x1337 camera resolution and then resized to 42x42. The results are blending, as seen in my avatar.
04-10-2012 08:28 PM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #4
RE: Patrol Nodes don't work on spawned enemy
The whole code would be nice, as there might be an error there, too.

Actually, you said the debug message was showing, so nevermind.

1. Is there a mapcache, if so, delete it.
2. Is the grunt called "servant_grunt"?
3. Are the pathnodes correctly named?

I guess the servant is called grunt, I see you generated it via CreateEntityAtArea.

Maybe that may be an answer, try creating an enemy in the editor, setting Active off, and then using "SetEntityActive("servant_grunt", true);" in the script.

Check me out at my youtube channel: http://www.youtube.com/user/Putmalk?feature=mhee

I post videos of my Amnesia creations.
(This post was last modified: 04-10-2012 08:34 PM by Putmalk.)
04-10-2012 08:30 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,229
Joined: Jul 2011
Reputation: 215
Post: #5
RE: Patrol Nodes don't work on spawned enemy
Path nodes don't work on dynamically created monsters.

Tutorials: From Noob to Pro
04-10-2012 08:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
DoubleThinking Offline
Junior Member

Posts: 32
Joined: Mar 2012
Reputation: 1
Post: #6
RE: Patrol Nodes don't work on spawned enemy
I can't make it like that because I am making a survival map, so I need infinite enemies (it's randomly generating in later rounds). I removed the map cache and checked all names. What I could try is adding a timer to the patrol node adding... Ok it didn't work. Also, if he sees me, he can move, so he isn't stuck in the floor. Any other ideas, I really need this. Huh

EDIT: Ok just after post I see you posted something, ok. Then I will just add a shitload of inactive monsters. Still thanks.

The picture was taken with a 1337x1337 camera resolution and then resized to 42x42. The results are blending, as seen in my avatar.
(This post was last modified: 04-10-2012 09:01 PM by DoubleThinking.)
04-10-2012 09:01 PM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #7
RE: Patrol Nodes don't work on spawned enemy
How does this work? Is it like waves and stuff? Or one continuous wave that gets increasingly harder and harder.

If it's by wave, then you do some tricky stuff. First, you can have a start area that after every round, the player fades to black, teleports to the start area, and then you can reset the positions of monsters (ResetProp MAY work for this, else you can just set them to path to the starting area). During this "intermission" when the monsters reset their places, you can randomly activate items that the player can pick up in his starting area, with different positions each time (might I suggest RandInt for this).

What I mean by that is like, presuming you have 100 "disabled" tinderboxes.

for(int i=0;i<100,i++)
    ResetProp("tinderbox_"+i);

do
{
    int maxitems = 0;
    for(int i=0;i<100;i++)
    {
          activeitem = RandInt(1,100);
          if(activeitem > 75)
          {
                maxitems++;
                SetEntityActive("tinderbox_"+i, true);
          }
     }

    }
}    while(maxitems < 4);

I don't know if that would work, but the point is that every wave, if you call a function with that, it would reset the position of the tinderboxes in the starting area, and roll a random dice out of 100, and generate four random tinderboxes like that (assuming they were named "tinderbox_1", ...etc.). Also I wrote that in C++, angelscript may had do while loops differently.

Check me out at my youtube channel: http://www.youtube.com/user/Putmalk?feature=mhee

I post videos of my Amnesia creations.
04-10-2012 09:31 PM
Find all posts by this user Quote this message in a reply
DoubleThinking Offline
Junior Member

Posts: 32
Joined: Mar 2012
Reputation: 1
Post: #8
RE: Patrol Nodes don't work on spawned enemy
It is like 10 waves programmed at first, and then infinitly does a random amount of monsters (like 1 grunt and 2 brutes). I might try that with reseting their postition, but maybe later. I am a bit tired right now. I will tell whenever it worked or not.

The picture was taken with a 1337x1337 camera resolution and then resized to 42x42. The results are blending, as seen in my avatar.
04-10-2012 10:12 PM
Find all posts by this user Quote this message in a reply
DoubleThinking Offline
Junior Member

Posts: 32
Joined: Mar 2012
Reputation: 1
Post: #9
RE: Patrol Nodes don't work on spawned enemy
OK, I tried. He doesn't seem to reset his position. I will make 20 of any kind of monsters. I don't really care. But anyway, how could someone survive 20 monsters of ALL 3 KINDS? Still thanks for all help Wink

The picture was taken with a 1337x1337 camera resolution and then resized to 42x42. The results are blending, as seen in my avatar.
04-11-2012 02:37 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)