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 script Fainting?
taylor122002 Offline
Junior Member

Posts: 13
Threads: 10
Joined: Aug 2012
Reputation: 0
#1
How to script Fainting?

Hello everyone!

I have a question for scripting. I'm making a custom story, and I set up the map so in one room, right when you open the door, you see a torso with some blood. And I want to make a script area so when you enter the script area, you collapse or faint for a moment.

I don't know how I would script this, could someone help me?
I don't know how to even begin the part of fainting when walking into a scripted area.


But, I tried anyways.
Here's what I did:

AddEntityCollideCallback("Player", "Faint", "Faint", true, 1);
void SetPlayerSanity(float afSanity);
{
SetPlayerSanity(0);
}
See, I don't even know where to begin. Lol

Originally, I had this before I set it to "void SetPlayerSanity...":

void Faint(string &in asParent, string &in asChild, int alState)
{
SetPlayerSanity(0);
}

and that did nothing.

I apologize if this didn't make sense.
(This post was last modified: 11-02-2012, 03:58 AM by taylor122002.)
11-02-2012, 03:56 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: How to script Fainting?

Look what fricitonal games did.
What i would use is:

FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);
Rotates the position of the camera on the player's body.
afX - angle of rotation of head, positive being counter-clockwise
afSpeedMul - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)
afMaxSpeed - maximum speed of rotation



SetPlayerCrouching(bool abCrouch);

SetPlayerActive(bool abActive);

FadeImageTrailTo(float afAmount, float afSpeed);
Applies the image trail effect to the screen.
afAmount - intensity (default: 0)
afSpeed - time in seconds until full effect



FadeRadialBlurTo(float afSize, float afSpeed);
Applies radial blur effects to the screen.
afSize - intensity (default: 0)
afSpeed - time in seconds until full effect

Trying is the first step to success.
(This post was last modified: 11-02-2012, 11:35 AM by FlawlessHappiness.)
11-02-2012, 08:13 AM
Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#3
RE: How to script Fainting?

For a newbie i would i use this simple script :p
When the player collides with the "Faint" Script area he will get a 5 sanity damage ( you can edit it as much as you want til 100 )



void OnStart()
{
AddEntityCollideCallback("Player", "Faint", "Faint", true, 1);
}

void Faint(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(5.0f, true);
}

I help people when i'm bored :U


Typing Speed: 74 Words per minute
(This post was last modified: 11-02-2012, 09:04 AM by naseem142.)
11-02-2012, 08:51 AM
Website Find




Users browsing this thread: 1 Guest(s)