Thunderrr
Junior Member
Posts: 5
Threads: 1
Joined: Apr 2011
Reputation:
0
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 Files
proov.rar (Size: 7.68 KB / Downloads: 116)
(This post was last modified: 04-27-2011, 08:43 PM by Thunderrr .)
04-27-2011, 08:37 PM
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
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
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
Thunderrr
Junior Member
Posts: 5
Threads: 1
Joined: Apr 2011
Reputation:
0
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
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
RE: Script problem / fatal error
Need the closing brace in CollideProov
04-29-2011, 03:42 PM
Thunderrr
Junior Member
Posts: 5
Threads: 1
Joined: Apr 2011
Reputation:
0
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
Dalroc
Member
Posts: 57
Threads: 2
Joined: Mar 2011
Reputation:
0
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:
void CollideProov ( string & in asParent , string & in asChild , int alState ) { StartPlayerLookAt ( "Sound" , 5 , 10 , "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
Thunderrr
Junior Member
Posts: 5
Threads: 1
Joined: Apr 2011
Reputation:
0
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
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
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
Thunderrr
Junior Member
Posts: 5
Threads: 1
Joined: Apr 2011
Reputation:
0
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
04-29-2011, 07:34 PM
TheHunter
Junior Member
Posts: 4
Threads: 2
Joined: Feb 2013
Reputation:
0
RE: Script problem / fatal error
(04-29-2011, 03:42 PM) palistov Wrote: Need the closing brace in CollideProov
Jajajja i love your cow
02-28-2013, 03:39 PM