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
#1
Simulate the player being dragged ?

Well as you can all probably tell by the title of the thread. I'm in need of a script that would make it look and sound as if the player was being dragged by an enemy, but I've not the slightest clue of how to go about this or if its even really possible. Any input would be greatly appreciated ^^
03-08-2014, 08:06 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: Simulate the player being dragged ?

This might be something to start off with.

void OnStart()
{
     MovePlayerHeadPos(0, -0.9f, 0, 10.0f, 0.1f);
     SetPlayerActive(false);
     AddTimer("drag", 3.0f, "PlayerDrag");
}

void PlayerDrag(string &in asTimer)
{
    AddPlayerBodyForce(8000, 0, -8000, false);
    AddTimer(asTimer, 1.5f, "PlayerDrag");
}

But sometimes, try checking through all the scripts yourselves. You learn quicker Smile
03-08-2014, 08:54 PM
Find
Deadon Offline
Member

Posts: 64
Threads: 5
Joined: Feb 2014
Reputation: 1
#3
RE: Simulate the player being dragged ?

Also, for a better sense of being dragged (that most don't seem to get/notice) is that it's better to pulse (listen to the drag noise) than to keep the same speed.

2 Mappers are definitely better than one.
03-08-2014, 08:57 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: Simulate the player being dragged ?

Well Deadon, I used a sound which fitted this perfectly, but I'm certain he doesn't have it. Unless he got the conversion mod The Fugitive 2.

PlayGuiSound("31_drag.snt", 1.0f);
(This post was last modified: 03-08-2014, 09:47 PM by Neelke.)
03-08-2014, 09:47 PM
Find
lothabread Offline
Member

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

whats the best configuration to have the players head on the floor ?

this is what i have

FadePlayerRollTo(-45, 0.8, 8);
03-23-2014, 06:28 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#6
RE: Simulate the player being dragged ?

Didn't test this (rather stole it from the wiki's wake up tutorial), but it might also help:
FadePlayerRollTo(50, 220, 220); // Simulate being on the floor

Since you have FadePlayerRollTo, you are heading in the right direction (no pun intended)

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 03-23-2014, 12:08 PM by Romulator.)
03-23-2014, 12:08 PM
Find
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
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#8
RE: Simulate the player being dragged ?

void Drag(string &in asTimer)
{
  AddPlayerBodyForce(8000, 0, -8000, false);
  AddTimer(asTimer, 1.5f, "(Player)Drag");
}

Marked with () what was wrong. The timer aint named like that. This below is correct.

void Drag(string &in asTimer)
{
  AddPlayerBodyForce(8000, 0, -8000, false);
  AddTimer(asTimer, 1.5f, "Drag");
}

Derp.
03-24-2014, 09:54 PM
Find
lothabread Offline
Member

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

okay this is gonna sound kinda dumb, but how do i get the player to look straight up at the cieling ?

is it FadePlayerRollTo

or MovePlayerHeadPos

?
03-25-2014, 06:26 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#10
RE: Simulate the player being dragged ?

I think you're better to just place a ScriptArea above you, and;

PHP Code: (Select All)
void StartPlayerLookAt(stringasEntityNamefloat afSpeedMulfloat afMaxSpeedstringasAtTargetCallback); 
Where:
asEntityName - the entity to look at
afSpeedMul - how fast should the player look at the entity
afMaxSpeed - maximum speed allowed
asAtTargetCallback - function to call when player looks at target

You will have to declare a StopPlayerLookAt() at some point if you use this Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
03-25-2014, 07:33 AM
Find




Users browsing this thread: 1 Guest(s)