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
Script Help engineers wont move ?
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#1
engineers wont move ?

enemies engineer_2 and 3 wont patrol the halls guys, just as the title says, im pretty sure i've set em up right too. help ? Oh and i was wondering if it were possible to activate two enemies with one collide call back area ?

PHP Code: (Select All)
////////////////////////////
// Run when starting game
void OnStart()
{
/////////////////////////////////////////////////////////////////////////////////////////
//Debug
    
if(ScriptDebugOn())
          {
               
GiveItemFromFile("lantern""lantern.ent");
               
SetPlayerLampOil(100.0f);
 
               for(
int i 0;10;i++)
               {
                    
GiveItemFromFile("tinderbox""tinderbox.ent");
               }
          }
///////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////
//Start Scene
    
ShowPlayerCrossHairIcons(false);
    
SetSanityDrainDisabled(true);
    
SetPlayerCrouching(true);
    
SetPlayerActive(false);
    
FadeOut(0);
    
AddTimer("StartGame"6.0f"IntroSequence");
////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////
//General
    
////////////////////////////////////////////////////////////////////////////////////////
}

///////////////////////////////////////////////////////////////////////////////////////
//Start Scene
void IntroSequence(string &in asTimer)
{
    
AddLocalVarInt("iIntroPart"1);
    
float partSpeed 0.5f;
    switch(
GetLocalVarInt("iIntroPart")) {
        case 
1:
            
MovePlayerHeadPos(0, -0.9f010.0f0.1f);
            
PlayGuiSound(""1.0f);
            
StartPlayerLookAt("AreaIntroLook_1"10.0f10.0f"");
            
FadePlayerRollTo(-50200200);
            
partSpeed 0.5f;
        break;
        
        case 
2:
            
StartPlayerLookAt("AreaIntroLook_1"1.0f1.0f"");
            
FadeIn(2.0f);
            
Manpig01();
            
engineer_2();
            
engineer_3();
            
partSpeed 3.0f;  
        break;
        
        case 
3:
            
StartPlayerLookAt("AreaIntroLook_2"1.0f1.0f"");
            
partSpeed 5.0f;
        break;
        
        case 
4:
            
StartPlayerLookAt("AreaIntroLook_3"1.0f1.0f"");
            
PlayGuiSound(""0.7f);
            
FadeOut(5.7f);
            
partSpeed 6.0f;
        break;
        
        case 
5:
            
StopPlayerLookAt();
            
StartPlayerLookAt("AreaIntroLook_4"20.0f20.0f"");
            
TeleportPlayer("PlayerDrag");
            
FadePlayerRollTo(70200200);
            
partSpeed 0.1f;
        break;
        
        case 
6:
            
StopPlayerLookAt();
            
SetEntityActive("engineer_1"false);
            
PlayGuiSound("joint_cage_slide_open"10.0f);
            
FadeIn(8.0f);
            
partSpeed 8.0f;
        break;
        
        case 
7:
            
AddTimer("drag"1.0f"Drag");
            
FadeOut(9.0f);
            
partSpeed 10.0f;
        break;
        
        case 
8:
            
RemoveTimer("drag");
            
partSpeed 2.0f;
        break;
        
        case 
9:
            
TeleportPlayer("PlayerStartArea_2");
            
FadeIn(5.0f);
            
StartPlayerLookAt("AreaIntroLook_5"20.0f20.0f"");
            
PlayGuiSound(""1.0f);
            
partSpeed 6.0f;
        break;
        
        case 
10:
            
FadeOut(2.0f);
            
PlayGuiSound(""1.0f);
            
partSpeed 4.0f;
        break;
        
        case 
11:
            
FadeIn(4.5f);
            
PlayGuiSound(""1.0f);
            
StopPlayerLookAt();
            
FadePlayerRollTo(02018);
            
MovePlayerHeadPos(0.00.00.00.50.1f);
            
partSpeed 5.0f;
        break;
        
        case 
12:
            
ShowPlayerCrossHairIcons(true);
            
SetPlayerCrouching(false);
            
SetPlayerActive(true);
            
partSpeed 0.01f;
        break;
    }
    
    if(
GetLocalVarInt("iIntroPart") < 13)    AddTimer("tmrIntro"partSpeed"IntroSequence");     
}

void Drag(string &in asTimer)
{
  
AddPlayerBodyForce(0010000false);
  
AddTimer(asTimer1.5f"Drag");
  
PlayGuiSound("Drag03.snt"1);
}

void Manpig01()
{
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_1"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_2"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_3"0.0f"");


/////////////////////////////////////////////////////////////////////////////////////////////////
//General
/////////////////////////////////////////////////////////////////////////////////////////////////

void engineer_2()
{
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_19"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_78"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_97"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_119"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_19"0.0f"");


void engineer_3()
{
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_119"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_19"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_78"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_97"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_119"0.0f"");

(This post was last modified: 04-04-2014, 05:44 AM by lothabread.)
04-04-2014, 04:45 AM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: engineers wont move ?

It might be better to call these pathnodes when the enemy is spawned or when the enemy has reached a certain area.

Derp.
04-04-2014, 09:04 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#3
RE: engineers wont move ?

What neeke said.
Try this for example :
PHP Code: (Select All)
void Manpig01()
{
    
SetEntityActive("engineer_1"true); 
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_1"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_2"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_3"0.0f"");

---
You can do this if this works for your map offcourse.
PHP Code: (Select All)
case 6:
            
StopPlayerLookAt();
            
SetEntityActive("engineer_1"true);
            
SetEntityActive("engineer_2"true);
            
SetEntityActive("engineer_3"true);
            
PlayGuiSound("joint_cage_3lide_open"10.0f);
            
FadeIn(8.0f);
            
partSpeed 8.0f;
        break; 
(This post was last modified: 04-04-2014, 01:37 PM by DnALANGE.)
04-04-2014, 01:31 PM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#4
RE: engineers wont move ?

neither seemed to work sadly, they'll just stay in place until they see me, i'd like to add that these manpigs are in another section of the map altogether so i was wondering if the activation distance for them hand anything to do with it ?
04-04-2014, 02:59 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: engineers wont move ?

Hm, it might. If the nodes are too far away, it might not know how to get there. I think it would at least try though. You should scatter some nodes around you map. You don't need to assign them in the script, the monsters will use them as guidelines to get to where they're supposed to go. Also try making sure the script is run after they have spawned. Perhaps that makes a difference.

04-04-2014, 03:18 PM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#6
RE: engineers wont move ?

hmm well i have them set to active from in the editor and i do believe that i have placed the nodes a fair distance from eachother. but when i actually get to round the corner, there's the first pig just as he is waiting for me.


Attached Files
.jpg   LevelEditor131111 2014-04-04 16-02-15-39.jpg (Size: 120.9 KB / Downloads: 78)
(This post was last modified: 04-05-2014, 12:05 AM by lothabread.)
04-05-2014, 12:04 AM
Find




Users browsing this thread: 1 Guest(s)