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
How to make a player collapse?
Homicide13 Offline
Senior Member

Posts: 323
Threads: 41
Joined: Nov 2010
Reputation: 14
#5
RE: How to make a player collapse?

Oh boy do I have experience with this...

To make collapses etc. you're going to need to work with either a case switch or a timer based setup (I use timers, but that's just personal preference). Here's an example of one of my collapse sequences:

void UsePotion(string &in asEntity, string &in type)
{
GiveSanityDamage(0,true);
SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
SetInventoryDisabled(true);
SetSanityDrainDisabled(true);
SetPlayerMoveSpeedMul(0.6f);
SetPlayerLookSpeedMul(0.4f);
FadeRadialBlurTo(0.1f,8);
AddTimer("PTt2",2,"PotionTimer");
AddTimer("PTt4",4,"PotionTimer");
AddTimer("PTt7p5",7.5f,"PotionTimer");
AddTimer("PTt9",9,"PotionTimer");
}

void PotionTimer(string &in asTimer)
{
if(asTimer == "PTt2")
{
FadePlayerRollTo(25,3,8);
MovePlayerHeadPos(-0.2f,-0.3f,0,0.2f,1);
}
else if(asTimer == "PTt4")
{
FadePlayerRollTo(-45,5,15);
MovePlayerHeadPos(0.5f,-1,0,0.3f,1);
FadeOut(3.5f);
}
else if(asTimer == "PTt7p5")
{
PlayGuiSound("player_bodyfall",1);
}
else if(asTimer == "PTt9")
{
ChangeMap("04Laboratory.map","PlayerStartArea_1","","");
}
}

The code is set to activate as soon as the player clicks on a certain potion, and causes the player to collapse and the map to change when it's over.

Collapsing is mostly just the FadePlayerRollTo and MovePlayerHeadPos functions set to play in a certain sequence.

10-21-2011, 08:04 PM
Find


Messages In This Thread
RE: How to make a player collapse? - by flamez3 - 10-21-2011, 06:16 AM
RE: How to make a player collapse? - by Homicide13 - 10-21-2011, 08:04 PM



Users browsing this thread: 1 Guest(s)