Frictional Games Forum (read-only)
[LVL ED] I Have A problem in Script!!! Please Help me!! - 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: [LVL ED] I Have A problem in Script!!! Please Help me!! (/thread-14193.html)



I Have A problem in Script!!! Please Help me!! - skirnks017 - 03-24-2012

Hi formun i need your's help but i have a problem!!!
this script no running in amnesia. is a custom history
i have a error in amnesia (loading page") and hps no running in map!!!!!
////////////////////////////
// Run when entering map
void OnEnter()
{
{ AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);

}

void MyFunc(string &in asItem, string &in asEntity)

{ SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");

}



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

}








RE: I Have A problem in Script!!! Please Help me!! - FinBanana - 03-24-2012

The void OnEnter() is having two '{'s
so, it should look like this:void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);
}


Also, your Function is named wrong, it should be "KeyOnDoor" but yours is "MyFunc", so change it



RE: I Have A problem in Script!!! Please Help me!! - SilentStriker - 03-24-2012

I would suggest putting the Callback inside void OnStart and you need to change void myfunc to void KeyOnDoor



RE: I Have A problem in Script!!! Please Help me!! - Unearthlybrutal - 03-24-2012

Smile Use this:
Spoiler below!
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}



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

}




RE: I Have A problem in Script!!! Please Help me!! - skirnks017 - 03-24-2012

Tanks!!!! is great!!! my problem is gone!!!! xD
Tanks to:
[b]FinBanana[/b],[b]Unearthlybrutal,[/b][b]SilentStriker Great People!!!
[/b]


RE: I Have A problem in Script!!! Please Help me!! - Unearthlybrutal - 03-24-2012

No problem Smile