02-09-2013, 03:41 PM
Hey Guys!
Im working on a custom story in Amnesia.
So I've watched tutorials and guides, on the wiki too.
So... For my map I need some scripts and functions. And I dont find it so easy to write them, so I've copied the "Door-Smash"-Code from the Wiki. Thanks for it!
So heres my question: I have a code. How can I write 2 codes one after another? I tried just to seperate them with a } one after another,
but I got every time an error like "ERROR" "Unexpected end of file" or something. I will post the code here for you:
So heres the error, if i dont put the } between[/quote]:
http://prntscr.com/s3vwb
Can someone tell me what is wrong or how can i save to scripts without an error?
Thank you!
-Blue
Im working on a custom story in Amnesia.
So I've watched tutorials and guides, on the wiki too.
So... For my map I need some scripts and functions. And I dont find it so easy to write them, so I've copied the "Door-Smash"-Code from the Wiki. Thanks for it!
So heres my question: I have a code. How can I write 2 codes one after another? I tried just to seperate them with a } one after another,
but I got every time an error like "ERROR" "Unexpected end of file" or something. I will post the code here for you:
Quote:////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
(HERES THE 2ND CODE v v v v v v v)
{
SetEntityPlayerInteractCallback("door1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
So heres the error, if i dont put the } between[/quote]:
http://prntscr.com/s3vwb
Can someone tell me what is wrong or how can i save to scripts without an error?
Thank you!
-Blue