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?
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#11
RE: How do i make the Sanity script?

(05-25-2012, 03:03 PM)Clear Wrote:
(05-25-2012, 02:57 PM)wolfmaster1231 Wrote: AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1) this should be under
AddUseItemCallback

Can you write that for me please?
Check my post, I did it for you. Smile

05-25-2012, 03:04 PM
Find
Clear Offline
Junior Member

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

(05-25-2012, 03:01 PM)Putmalk Wrote: (14, 1) refers to line 14, character 1.

In this case, you are misusing the "{" "}". They cannot be floating around there. May I suggest reviewing a basic scripting tutorial, as syntax errors like these will stop you from doing anything.

When utilizing those brackets, they have to be after a function.

Like:
void OnStart()
{

}

Alternatively, after an if-else statement:

if(whatever)
{

}
else
{

}

or a loop

for(int i=0;i<5;i++)
{

}

So, specifically, your error is right here:
{

AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1);

}

Just shift that into the original void OnStart(), so it looks like
void OnStart()
{
AddUseItemCallback("", "key1", "DoorName01", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1);
}

And remove that line plus the brackets where you had it.


IT WORKED! I WANNA GIVE YOU A HUG AND I WANNA HUMP YOU AND I.... I mean, *cough* thank you kind sir.
05-25-2012, 03:14 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#13
RE: How do i make the Sanity script?

Yw glad it worked. Smile

Check out http://www.frictionalgames.com/forum/thread-15571.html for some more scripting debugging advice.

(This post was last modified: 05-25-2012, 03:19 PM by Putmalk.)
05-25-2012, 03:18 PM
Find




Users browsing this thread: 1 Guest(s)