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



Can't get area script to work! - Amphen - 07-04-2012

Hellow I'm a new scripter and I really could need some help solving this problem. Confused
In my level editor I've made an area called "ScriptArea_1". When the player enters the area I want a barrel and a sound to appear, but whatever I do it wouldn't work!
Here's my script:
void onstart()
{
AddEntityCollideCallback("player", "ScriptArea_1", "appear", true, 1);
}
void appear(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_scare", "player", 0, false);
SetEntityActive("barrel02", true);
}
If anyone could help me I would be very appreciated!


RE: Can't get area script to work! - Cruzore - 07-04-2012

void onstart()
should be named
void OnStart()
and might as well capitalise "player"
So it is "Player"
just in case


RE: Can't get area script to work! - Amphen - 07-04-2012

(07-04-2012, 12:14 PM)FastHunteR Wrote: void onstart()
should be named
void OnStart()
and might as well capitalise "player"
So it is "Player"
just in case
It worked! Thx! Finally I can continue my scripting Big Grin