Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a player collapse?
Author Message
FreshKorruption Offline
Member

Posts: 94
Joined: Oct 2011
Reputation: 1
Post: #1
How to make a player collapse?
What is the scripting, that when i touch an area, the character collapses and the screen turns black for 5 seconds. I'm not asking for the exact script (or else i will never learn on my own) but just the names of them, and maybe what goes inside the parenthesis to.

Custom Stories

-BrastaSauce

10-21-2011 01:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
RE: How to make a player collapse?
You can check the scripts written in 03_Archives level. When you pick up the third diary note, player falls on the ground. I used it.

10-21-2011 01:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
FreshKorruption Offline
Member

Posts: 94
Joined: Oct 2011
Reputation: 1
Post: #3
RE: How to make a player collapse?
(10-21-2011 01:51 AM)Tanshaydar Wrote:  You can check the scripts written in 03_Archives level. When you pick up the third diary note, player falls on the ground. I used it.
I can't tell if this is the right script or not. It's under /*Picking the third diary activates the vision



void MapFlashbackOver()
{
//If the diary flashback is running, then need to set back some stuff when flashback is over.
if(GetLocalVarInt("DiaryFlashbackActive")==1)
{
SetLocalVarInt("DiaryFlashbackActive",0);

FadeImageTrailTo(1.2f, 2);
FadeSepiaColorTo(0.65f, 0.5f);
FadePlayerFOVMulTo(2, 0.04f);
}
}

Custom Stories

-BrastaSauce

10-21-2011 02:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #4
RE: How to make a player collapse?
My thinking is that you would need him to enable force crouching, and then make the players camera (head) rotate and go to the side. You could check maps like "Scroobs castle" because at the start is has something exactly like that.

10-21-2011 06:16 AM
Find all posts by this user Quote this message in a reply
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)