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 do i make the Sanity script?
Clear Offline
Junior Member

Posts: 19
Threads: 4
Joined: May 2012
Reputation: 0
#7
RE: How do i make the Sanity script?

(05-25-2012, 02:44 PM)Putmalk Wrote:
(05-25-2012, 02:34 PM)Clear Wrote:
(05-25-2012, 02:25 PM)Obliviator27 Wrote: You would have to set up a CollideCallback, which calls the function GiveSanityDamage. Like so

void OnStart()
{
AddEntityCollideCallback("Player", "RoomArea", "SanityDamage", true, 1);
}
void SanityDamage(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
}
Thanks!
But i have a problem while putting the script down the HPS file, when i put it and load the game it gives me an error wich says function with the same parameters allready exicts... i have 2 void OnStart() in 1 HPS file, is that suppose to be like it?
One of it is for a key & door script, what do i need to do?
No. NEVER have two functions with the same name in it.

A basic script always looks like:

void OnStart()
{

}

void OnEnter()
{

}

void OnLeave()
{

}
This is my .HPS so far,



////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key1", "DoorName01", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DoorName01", false, true);
PlaySoundAtEntity("", "unlock_door", "DoorName01", 0, false);
RemoveItem("key1");
}

{
AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1);
}
void SanityDamage(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
}

I removed the second "void OnStart()" and it looks like this, it gives me an error of Unexpected token in 14,1, what the Hell do i do Q_Q
05-25-2012, 02:51 PM
Find


Messages In This Thread
How do i make the Sanity script? - by Clear - 05-25-2012, 01:50 PM
RE: How do i make the Sanity script? - by Putmalk - 05-25-2012, 01:54 PM
RE: How do i make the Sanity script? - by Clear - 05-25-2012, 02:00 PM
RE: How do i make the Sanity script? - by Clear - 05-25-2012, 02:34 PM
RE: How do i make the Sanity script? - by Putmalk - 05-25-2012, 02:44 PM
RE: How do i make the Sanity script? - by Clear - 05-25-2012, 02:51 PM
RE: How do i make the Sanity script? - by Clear - 05-25-2012, 03:03 PM
RE: How do i make the Sanity script? - by Putmalk - 05-25-2012, 03:04 PM
RE: How do i make the Sanity script? - by Putmalk - 05-25-2012, 03:01 PM
RE: How do i make the Sanity script? - by Clear - 05-25-2012, 03:14 PM
RE: How do i make the Sanity script? - by Putmalk - 05-25-2012, 03:18 PM



Users browsing this thread: 1 Guest(s)