The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spoiler Some Script-Problems
BlueRsX Offline
Junior Member

Posts: 5
Threads: 1
Joined: Feb 2013
Reputation: 0
#1
Sad  Some Script-Problems

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:
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 Smile
02-09-2013, 03:41 PM
Find


Messages In This Thread
Some Script-Problems - by BlueRsX - 02-09-2013, 03:41 PM
RE: Some Script-Problems - by NaxEla - 02-09-2013, 06:02 PM
RE: Some Script-Problems - by The chaser - 02-09-2013, 06:59 PM
RE: Some Script-Problems - by BlueRsX - 02-09-2013, 09:43 PM
RE: Some Script-Problems - by palistov - 02-09-2013, 10:20 PM
RE: Some Script-Problems - by BlueRsX - 02-09-2013, 10:27 PM
RE: Some Script-Problems - by palistov - 02-09-2013, 10:41 PM
RE: Some Script-Problems - by BlueRsX - 02-09-2013, 11:30 PM
RE: Some Script-Problems - by BlueRsX - 02-10-2013, 09:29 AM



Users browsing this thread: 1 Guest(s)