Frictional Games Forum (read-only)
How do i make the Sanity script? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: How do i make the Sanity script? (/thread-15617.html)

Pages: 1 2


RE: How do i make the Sanity script? - Putmalk - 05-25-2012

(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


RE: How do i make the Sanity script? - Clear - 05-25-2012

(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:
Code:
{

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

}

Just shift that into the original void OnStart(), so it looks like
Code:
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.


RE: How do i make the Sanity script? - Putmalk - 05-25-2012

Yw glad it worked. Smile

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