Frictional Games Forum (read-only)
Causing sanity damage to yourself - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Causing sanity damage to yourself (/thread-4459.html)

Pages: 1 2


RE: Causing sanity damage to yourself - jens - 09-20-2010

Post you script so we can see what you are trying to do.


RE: Causing sanity damage to yourself - RaptorRed - 09-21-2010

(09-20-2010, 07:41 AM)jens Wrote: Post you script so we can see what you are trying to do.
Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
    //Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
    if(ScriptDebugOn())
    {
        GiveItemFromFile("lantern", "lantern.ent");

        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
    }

}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

////////////////////////////
//Function as you specified in ConnectionStateChangeCallback
void PullLever(string &in asEntity, alState)
{
    //If the lever is pulled max up or down then give sanity damage
    if(alState == 1 or alState == -1)
    {
        GiveSanityDamage(40, true);  
    }
}



RE: Causing sanity damage to yourself - jens - 09-21-2010

Argh, sorry.
void PullLever(string &in asEntity, alState) should be
void PullLever(string &in asEntity, int alState)


RE: Causing sanity damage to yourself - RaptorRed - 09-21-2010

(09-21-2010, 06:19 AM)jens Wrote: Argh, sorry.
void PullLever(string &in asEntity, alState) should be
void PullLever(string &in asEntity, int alState)

thanks, it finally works.