Frictional Games Forum (read-only)
Need help for Insanity 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Need help for Insanity script (/thread-6637.html)



Need help for Insanity script - lightsheik - 02-18-2011

I'm not really good a scripting and my script dosent work. I looked on the forum and tried a lot of things but it dosent work. I dont know what to write and where to write it and just tried what I thought would make sense. (Sorry, i'm not really good in english, my first language is french)

This is the script:

void SetEntityPlayerLookAtCallback(string& Corpse1, string& Corpse11, 1 abRemoveWhenLookedAt);
{
StartScreenShake(0.5 afAmount, 0.5 afTime, 0.5 afFadeInTime,0.8 afFadeOutTime);
}


RE: Need help for Insanity script - lightsheik - 02-19-2011

I tried this, but it dosent work:

void OnStart()
{
SetEntityPlayerInteractCallback("cabinet_simple_2", "insanity1", true);
}

void insanity1(string &in entity);
{
StartScreenShake(0.5f, 0.01f, 0.1f, 0.02f);
GiveSanityDamage(10.0f, true);
}


RE: Need help for Insanity script - Tanshaydar - 02-19-2011

What doesn't work?
Give it a 90.0f instead of 10.0f and see if it works.

Also, your screenshake values are too small.


RE: Need help for Insanity script - lightsheik - 02-19-2011

Sorry, It just dosent work. When I open my story the whole game crash.


RE: Need help for Insanity script - Vradcly - 02-19-2011

remove the ; last in: void insanity1(string &in entity);


RE: Need help for Insanity script - lightsheik - 02-19-2011

Thank you so much, its working now. I've been trying to do it for 2 hours straight.
Sorry but I have another question. If I wanted to delay the event by 1 sec, how would I do that. I tried this but it dosent work:

void OnStart()
{
AddTimer("time1", 1, "insanity1")
SetEntityPlayerInteractCallback("cabinet_simple_2", "insanity1", true);
}

void insanity1(string &in entity)
{
StartScreenShake(0.5f, 0.01f, 0.1f, 0.02f);
GiveSanityDamage(10.0f, true);
}


RE: Need help for Insanity script - Vradcly - 02-19-2011

void OnStart()
{
SetEntityPlayerInteractCallback("cabinet_simple_2", "insanity1", true);
}

void insanity1(string &in entity)
{
AddTimer("time1", 1, "Timerinsanity1")
}

void Timerinsanity1(string &in asTimer)
{
StartScreenShake(0.5f, 0.01f, 0.1f, 0.02f);
GiveSanityDamage(10.0f, true);
}

Like that Smile Hope you understand what I did...


RE: Need help for Insanity script - lightsheik - 02-19-2011

It works ! Thank you. I know a lot of people are asking question like this and I appreciate that you took the time to help me.