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 path nodes
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#1
enemy path nodes

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
02-02-2012, 04:10 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: enemy path nodes

Did you add the patrol nodes to the monster?

Tutorials: From Noob to Pro
02-02-2012, 04:14 PM
Website Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#3
RE: enemy path nodes

yea ofc, every single one....but he dont want to move... :/
02-02-2012, 04:14 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: enemy path nodes

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

Tutorials: From Noob to Pro
02-02-2012, 04:17 PM
Website Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#5
RE: enemy path nodes

pre-placed in lvl editor, inactive. activated by script
02-02-2012, 04:18 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: enemy path nodes

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

Tutorials: From Noob to Pro
02-02-2012, 04:22 PM
Website Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#7
RE: enemy path nodes

PHP Code: (Select All)
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/...nntrop.jpg
(This post was last modified: 02-02-2012, 04:26 PM by Quotentote.)
02-02-2012, 04:25 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: enemy path nodes

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

Tutorials: From Noob to Pro
02-02-2012, 04:42 PM
Website Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#9
RE: enemy path nodes

argh x( ok....then i have to find another ways, thanks anyways Smile
02-02-2012, 04:43 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#10
RE: enemy path nodes

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: (Select All)
//////////////////////////////////////
//    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.

(This post was last modified: 02-02-2012, 06:02 PM by palistov.)
02-02-2012, 05:41 PM
Find




Users browsing this thread: 1 Guest(s)