Frictional Games Forum (read-only)
[SCRIPT] PlayerInteractCallback how to let it trigger once. - 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: [SCRIPT] PlayerInteractCallback how to let it trigger once. (/thread-20859.html)



PlayerInteractCallback how to let it trigger once. - VeNoMzTeamHysterical - 03-22-2013

Well i made a nice event and i want that you only can click once or it or if you click it for the second time only a text appears like 'i better not touch it again' but how does that work?

Current script now
Spoiler below!

void SecretEvent2(string &in asEntity)
{
PlaySoundAtEntity("scare", "react_scare.snt", "Player", 1, true);
GiveSanityDamage(10, true);
AddTimer("", 1.0, "SecretEvent_Scare2");
SetPlayerLookSpeedMul(0.1);
SetPlayerRunSpeedMul(0.1);
}

void SecretEvent_Scare2(string &in asTimer)
{
GivePlayerDamage(20.0f, "BloodSplat", false, false);
AddTimer("", 2.0, "SecretEvent_Fade2");
FadePlayerRollTo(90, 1, 7);
MovePlayerHeadPos(0.25f, -0.3f, 0, 1, 0.5f);
GiveSanityDamage(100, true);
StartPlayerLookAt("GraveyardMonster", 4.0f, 4.0f, "");
SetEntityActive("GraveyardMonster", true);
ShowEnemyPlayerPosition("GraveyardMonster");
}

void SecretEvent_Fade2(string &in asTimer)
{
SetPlayerCrouching(true);
FadeOut(3);
AddTimer("", 4.0, "SecretEvent_ChangeMap2");
SetMessage("Messages", "SecretEvent3", 3.5);
StopPlayerLookAt();
}

void SecretEvent_ChangeMap2(string &in asTimer)
{
FadePlayerRollTo(0, 15, 90);
TeleportPlayer("BackFromGraveyard");
FadeIn(1);
SetPlayerRunSpeedMul(1);
SetPlayerLookSpeedMul(1);
PlayMusic("18_amb.ogg", true, 1, 1, 1, true);
AddTimer("", 4.0, "SecretEvent_TextReturn");
}

void SecretEvent_TextReturn(string &in asTimer)

{
SetMessage("Messages", "SecretEvent4", 5.0);
}


Already Thanks for helping Big Grin


RE: Need help on a nice script! - Wapez - 03-22-2013

Check out the wiki.
http://wiki.frictionalgames.com/hpl2/amnesia/script_functions


RE: Need help on a nice script! - VeNoMzTeamHysterical - 03-22-2013

(03-22-2013, 10:37 PM)Wapez Wrote: Check out the wiki.
http://wiki.frictionalgames.com/hpl2/amnesia/script_functions

Im already doing that haha its getting better Smile