Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script problem / fatal error
Author Message
Thunderrr Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #1
Script problem / fatal error
I'm rather new at scripting but I'm really interested in making my own level(s) for Amnesia. So I have this problem here:

Upon starting my custom story the game crashes with a fatal error. In the hpl.log I have this:

ERROR: Couldn't build script 'C:/Program Files (x86)/Amnesia - The Dark Descent/redist/custom_stories/TestLevel/maps/ch01/proov.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
main (1, 19) : ERR : Expected identifier
main (8, 10) : ERR : Expected identifier
main (10, 19) : ERR : Expected identifier
------- SCRIPT OUTPUT END ----------------------------
FATAL ERROR: Could not load script file 'custom_stories/TestLevel/custom_stories/TestLevel/maps/ch01/proov.hps'!
main (1, 19) : ERR : Expected identifier
main (8, 10) : ERR : Expected identifier
main (10, 19) : ERR : Expected identifier



My (whole) script file is this:

StartPlayerLookAt(Sound, 5, 10, onlook);

void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}

AddTimer("", 2.5f, "TimerDoneLookAt");

PlaySoundAtEntity( "", react_breath4.ogg, player, 0.5f, false);


I made the script using mastersmith98's and anzki's script tutorials.
Can anyone please tell me what I did wrong?
Thank you!

/I included the map file.


Attached File(s)
.rar  proov.rar (Size: 7.68 KB / Downloads: 6)
(This post was last modified: 04-27-2011 08:43 PM by Thunderrr.)
04-27-2011 08:37 PM
Find all posts by this user Quote this message in a reply
palistov Online
Posting Freak

Posts: 1,177
Joined: Mar 2011
Reputation: 56
Post: #2
RE: Script problem / fatal error
Also, you need StartPlayerLookAt(Sound, 5, 10, onlook); to be under a function, either OnStart(), OnEnter(), or a function to be called through interaction, collision, timers, etc. It can't just be out there on its own. It's lonely Sad

all strings require " " around them. This includes sound files, entities, internal names, etc. Boolean values, integers, and float values do not, however.

(This post was last modified: 04-27-2011 09:14 PM by palistov.)
04-27-2011 09:13 PM
Find all posts by this user Quote this message in a reply
Thunderrr Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #3
RE: Script problem / fatal error
void CollideProov (string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Sound", 5, 10, "onlook");

void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}

AddTimer("", 2.5f, "TimerDoneLookAt");

PlaySoundAtEntity( "", "react_breath4.ogg", "player", 0.5f, "false");
}

There's still something I've missed...
04-29-2011 03:19 PM
Find all posts by this user Quote this message in a reply
palistov Online
Posting Freak

Posts: 1,177
Joined: Mar 2011
Reputation: 56
Post: #4
RE: Script problem / fatal error
Need the closing brace in CollideProov

04-29-2011 03:42 PM
Find all posts by this user Quote this message in a reply
Thunderrr Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #5
RE: Script problem / fatal error
void CollideProov (string &in asParent, string &in asChild, int alState);
{

StartPlayerLookAt("Sound", 5, 10, "onlook");

void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}

AddTimer("", 2.5f, "TimerDoneLookAt");

PlaySoundAtEntity( "", "react_breath4.ogg", "player", 0.5f, "false");

}


FATAL ERROR: Could not load script file 'custom_stories/TestLevel/custom_stories/TestLevel/maps/ch01/proov.hps'!
main (2, 19) : ERR : Expected identifier
main (9, 10) : ERR : Expected identifier
main (11, 19) : ERR : Expected identifier
04-29-2011 04:28 PM
Find all posts by this user Quote this message in a reply
Dalroc Offline
Member

Posts: 57
Joined: Mar 2011
Reputation: 0
Post: #6
RE: Script problem / fatal error
There is a closing brace for CollideProov. But really the whole script is just a mess.
First and foremost, you can't have a function inside of a function like that, you need to place the TimerDoneLookAt after the CollideProov function. Like this:
PHP Code: (Select All)
void CollideProov (string &in asParentstring &in asChildint alState)
 {
     
StartPlayerLookAt("Sound"510"onlook");
     
AddTimer(""2.5f"TimerDoneLookAt");
     
PlaySoundAtEntity"""react_breath4.ogg""player"0.5f"false");
 }

 
void TimerDoneLookAt(string &in asTimer)
 {
     
StopPlayerLookAt();
 } 
04-29-2011 04:35 PM
Find all posts by this user Quote this message in a reply
Thunderrr Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #7
RE: Script problem / fatal error
main (5, 6) : ERR : No matching signatures to 'PlaySoundAtEntity(string@&, string@&, string@&, const float, string@&)'

The script is as Dalroc wrote in his reply.

I'll stop trying to scritp after someone helps me correct this problem.
(This post was last modified: 04-29-2011 05:30 PM by Thunderrr.)
04-29-2011 05:28 PM
Find all posts by this user Quote this message in a reply
palistov Online
Posting Freak

Posts: 1,177
Joined: Mar 2011
Reputation: 56
Post: #8
RE: Script problem / fatal error
PlaySoundAtEntity( "", "react_breath4.ogg", "player", 0.5f, "false");

Don't use quotation marks around the boolean value. It should be

PlaySoundAtEntity("", "react_breath4.ogg", "Player", 0.5f, false);

04-29-2011 07:15 PM
Find all posts by this user Quote this message in a reply
Thunderrr Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #9
RE: Script problem / fatal error
Thanks, both of you! It solved the problem but it doesn't activate like it should. I guess I'll stop trying then Smile
04-29-2011 07:34 PM
Find all posts by this user Quote this message in a reply
TheHunter Offline
Junior Member

Posts: 4
Joined: Feb 2013
Reputation: 0
Post: #10
RE: Script problem / fatal error
(04-29-2011 03:42 PM)palistov Wrote:  Need the closing brace in CollideProov

Jajajja i love your cow Heart Big Grin
02-28-2013 03:39 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)