Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level Editor Help I Have A problem in Script!!! Please Help me!!
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#1
I Have A problem in Script!!! Please Help me!!

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()
{

}





03-24-2012, 04:08 AM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#2
RE: I Have A problem in Script!!! Please Help me!!

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
03-24-2012, 09:27 AM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#3
RE: I Have A problem in Script!!! Please Help me!!

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

03-24-2012, 11:45 AM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#4
RE: I Have A problem in Script!!! Please Help me!!

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()
{

}


When Life No Longer Exists
Full-conversion mod
03-24-2012, 11:58 AM
Website Find
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#5
RE: I Have A problem in Script!!! Please Help me!!

Tanks!!!! is great!!! my problem is gone!!!! xD
Tanks to:
[b]FinBanana[/b],[b]Unearthlybrutal,[/b][b]SilentStriker Great People!!!
[/b]
03-24-2012, 04:28 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#6
RE: I Have A problem in Script!!! Please Help me!!

No problem Smile

When Life No Longer Exists
Full-conversion mod
03-24-2012, 05:17 PM
Website Find




Users browsing this thread: 3 Guest(s)