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 Simulate the player being dragged ?
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#7
RE: Simulate the player being dragged ?

Well i want the player to start off in a cage, have an engineer come "open" it and then "drag" the player around a corner, but im at a standstill

Spoiler below!
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
    
SetSanityDrainDisabled(true);
    
SetPlayerCrouching(true);
    
SetPlayerActive(false);
    
FadeOut(0);
    
AddTimer("StartGame"6.0f"IntroSequence");
    
AddTimer("drag"3.0f"Drag");
////////////////////////
}

////////////////////////
//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();
            
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:
            
TeleportPlayer("PlayerDrag");
            
MovePlayerHeadPos(-1.0f, -0.45, -1.110.0f0.1f);
            
partSpeed 0.01f;
        break;
        
        case 
6:
            
PlayGuiSound("joint_cage_slide_open"1.0f);
            
FadeIn(6.0f);
            
partSpeed 8.0f;
        break;
    }
    
    if(
GetLocalVarInt("iIntroPart") < 7)    AddTimer("tmrIntro"partSpeed"IntroSequence");     
}

void Drag(string &in asTimer)
{
  
AddPlayerBodyForce(80000, -8000false);
  
AddTimer(asTimer1.5f"PlayerDrag");
}

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


03-24-2014, 12:56 AM
Find


Messages In This Thread
RE: Simulate the player being dragged ? - by lothabread - 03-24-2014, 12:56 AM



Users browsing this thread: 4 Guest(s)