Frictional Games Forum (read-only)
[SCRIPT] can't get this script to work.. - 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] can't get this script to work.. (/thread-13644.html)



can't get this script to work.. - jessehmusic - 02-28-2012

Hello all amnesia fans! i got a problem with my script.
i want to make the entity to spawn fast then dissipear fast (Sorry for bad english)
Here is my hps :


void OnStart()
{
AddUseItemCallback("", "Study Key", "sutdy door", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "text_1", "Text", true, 1);
AddEntityCollideCallback("Player", "Ghost_area", "Horror1", true, 1);
}
void Horror1(string &in asParent, string &in asChild, int alState)
{
AddTimer("T2", 1.0f, "Timer_2");
AddTimer("T3", 3.5f, "Timer_3");
}

void Timer_2(string &in Timer)
{
SetEntityActive("alexander_2", true);
PlayGuiSound("react_pant.snt", 22.4f);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_3(string &in Timer)
{
SetEntityActive("alexander_2", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
AddTimer("timerReleasePlayer", 1, "timerReleasePlayer");
}
void timerReleasePlayer(string &in asTimer)
{
SetMessage("Messages", "what", 5);
}
void StopMusic(string &in asParent, string &in asChild, int alState)
{
StopMusic(1 , 0);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("sutdy door", false);
PlaySoundAtEntity("", "unlock_door", "sutdy door", 0, false);
RemoveItem("Study Key");
}

void OnEnter()
{
}
void OnLeave()
{
AddEntityCollideCallback("Player", "MusicStop", "StopMusic", true, 1);
}


RE: can't get this script to work.. - PythonBlue - 02-28-2012

At first glance the syntax looks okay. What error message do you get, if any?
I did just notice one possible mistake: did you name your study door "sutdy door" in the actual map?


RE: can't get this script to work.. - Strembitsky - 02-29-2012

That isn't the problem he was asking about, but that also may be a problem.

Anyways, it would definitely help if you told us what problem you're having. What doesn't work? Is the function being called?


RE: can't get this script to work.. - flamez3 - 02-29-2012

No idea what your problem is, be more descriptive.


RE: can't get this script to work.. - jessehmusic - 02-29-2012

(02-29-2012, 03:54 AM)Strembitsky Wrote: That isn't the problem he was asking about, but that also may be a problem.

Anyways, it would definitely help if you told us what problem you're having. What doesn't work? Is the function being called?
The problem is that when you enter the area The Ghost pop up fast , but he is there for like 3 sec i want it to be 1 sec but if i change the 3.5f he dont work Sad ("Alexander_2")
Any tip ?





RE: can't get this script to work.. - Obliviator27 - 02-29-2012

Set the timer T3 to something like 1.5 or 2.



RE: can't get this script to work.. - jessehmusic - 02-29-2012

(02-29-2012, 05:48 PM)Obliviator27 Wrote: Set the timer T3 to something like 1.5 or 2.
Thanx you dude!!!!!