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 GiveSanityDamage
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#2
RE: GiveSanityDamage

First let's start off in the level editor. Take a dead body, put it where you want, and name it "deadbody".

Then let's start from the basics in your script. Your barebone script file will look something like this:

////////////////////////////
// Run first time starting map
void OnStart()
{
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{
}


Then take a look at this taken from the engine scripts:
Quote:
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);

Calls a function when the player looks at a certain entity.
Callback syntax: void MyFunc(string &in asEntity, int alState)

alState: 1 = looking, -1 = not looking
asName - internal name
asCallback - function to call
abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity

EDIT: I removed the previously above text, as it seemed that it wasn't correct, and I couldn't get it to work either.

(This post was last modified: 04-05-2012, 04:56 PM by Kreekakon.)
04-05-2012, 04:25 PM
Find


Messages In This Thread
GiveSanityDamage - by kiruclanz - 04-05-2012, 03:59 PM
RE: GiveSanityDamage - by Kreekakon - 04-05-2012, 04:25 PM



Users browsing this thread: 1 Guest(s)