Frictional Games Forum (read-only)
enemy path nodes - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: enemy path nodes (/thread-13040.html)



enemy path nodes - Quotentote - 02-02-2012

hi there i trying to do this:

an enemy spawns nearby the player (disabled triggers) and i want him to patrol around a statue.

what happens:

enemy spawns doing some *roooaaaar* and...nothing....just a lazy splashy =(

anyone know why he dont wanna go? Sad



RE: enemy path nodes - Your Computer - 02-02-2012

Did you add the patrol nodes to the monster?


RE: enemy path nodes - Quotentote - 02-02-2012

yea ofc, every single one....but he dont want to move... :/



RE: enemy path nodes - Your Computer - 02-02-2012

Is the monster spawned by script or was it pre-placed in the level editor?


RE: enemy path nodes - Quotentote - 02-02-2012

pre-placed in lvl editor, inactive. activated by script



RE: enemy path nodes - Your Computer - 02-02-2012

Can we see the script and possibly a screenshot of the patrol nodes? Does the hpl.log provide any insight?


RE: enemy path nodes - Quotentote - 02-02-2012

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""armorfall_area""armorfallsdown"true1);
}
void armorfallsdown(string &in asParentstring &in asChildint alState)
    {
        
AddPropImpulse("armor_01", -3.0f0.0f0.0f"world");
        
StartScreenShake(0.30.520.8);
        
PlaySoundAtEntity("""explosion.snt""roll_2"0false);
        
SetEntityActive("armor_001"false);
        
SetEntityActive("armor_002"false);
        
SetEntityActive("armor_003"false);
        
SetEntityActive("r1"true);
        
SetEntityActive("r2"true);
        
SetEntityActive("r3"true);
        
SetEntityActive("r5"true);
        
SetEntityActive("r6"true);
        
SetEntityActive("a1"true);
        
SetEntityActive("a2"true);
        
SetEntityActive("a3"true);
        
SetEntityActive("a4"true);
        
SetEntityActive("a5"true);
        
SetEntityActive("a6"true);
        
SetEntityActive("a7"true);
        
AddTimer(""1.5"TimerRock1");    
        
SetPropHealth("door_valve_open"0.0f);
        
SetEntityActive("DestroyBoxGate"true);
        
SetEntityActive("waterlurker_1"true);
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_1"2"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_2"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_3"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_4"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_5"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_6"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_7"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_8"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_9"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_10"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_11"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_12"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_13"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_14"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_15"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_16"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_17"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_18"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_19"0"");
                  
AddEnemyPatrolNode("waterlurker_1""PathNodeArea_20"0"");
    } 

http://img198.imageshack.us/img198/9037/unbenanntrop.jpg



RE: enemy path nodes - Your Computer - 02-02-2012

I don't think waterlurkers are designed to follow patrol nodes.


RE: enemy path nodes - Quotentote - 02-02-2012

argh x( ok....then i have to find another ways, thanks anyways Smile



RE: enemy path nodes - palistov - 02-02-2012

They can't be assigned a patrol path, but they still need patrol nodes to navigate. If you're feeling creative, try creating a silent sound file in Audacity or a similar program. Export into ogg vorbis format, and set up a .snt file for it. Modify the properties so it has a large range and has a decent volume. Since it is silent the player won't hear anything, but you can trigger this sound where you want the lurker to go. Lurkers respond exclusively to sounds and the player coming within a certain height distance.

If triggering the sound via doesn't work, then the only other option is a full conversion to create a custom material, or somehow convincing players to overwrite their default materials.cfg with an additional custom material with silent physics sounds -- this way you can spawn a small custom box and give it a powerful body impulse to have it collide with a wall, thus alerting and luring the lurker away.



Now if that is not unconventional enough for you, you can also lure the lurker into a certain path with food. Create a body part entity in your map. Name it "bait_1". Make it small and static, so the player won't notice it or move it. Create a script area around it called "bait_area_1". Do this multiple times, making sure to keep the index at the end the same. Then copy this script into your map while you have it open in Amnesia -- I did not bugtest this.

Also, I'm not entirely this will work! But it's fun to experiment right??

PHP Code:
//////////////////////////////////////
//    QUOTENTOTE LURKER BAIT

//change this to however many bait points you have
const int NUM_BAIT=2;
void OnStart()
{
    for(
int i=1;i<=NUM_BAIT;i++) AddEntityCollideCallback("LURKERNAMEHERE""bait_area_"+i"LurkerBaitCollide"1false);
}

void LurkerBaitCollide(string &in pstring &in cint s)
{
    
int temp=parseStringINT(c);
    
SetEntityActive("bait_"+tempfalse);
    if(
temp==NUM_BAITtemp=1;
    else 
temp++;
    
SetEntityActive("bait_"+temptrue);
}


//////////////////////////////////////
//    PARSING FXNs

int parseStringINT(string str) {
    
int output 0;
    for(
int i=0i<str.length(); i++)
     {
      
int digit getDigit(str[i]);
      if(
digit > -1output 10*output+digit
     }
    return 
output;
}

int getDigit(uint8 digit) {
    
int d digit-48//48 is ASCII code for 0
    
return ((>= 0)&&(d<=9)) ? : -1;


If that works out, the lurker should follow the paths sequentially (goes to 1, goes to 2, etc). Also -- change "LURKERNAMEHERE" to whatever your water lurker's internal name is and make sure you make the bait script areas decently large so the lurker doesn't manage to eat the food Smile



I created large cylindrical collision indicators which you can use in place of a script area -- since the areas are square they won't be as consistent in terms of timing. If you want to use these collision indicators instead let me know and I'll upload the entity file here and modify the script.