Frictional Games Forum (read-only)
Script problem / fatal error - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script problem / fatal error (/thread-7667.html)

Pages: 1 2


Script problem / fatal error - Thunderrr - 04-27-2011

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.


RE: Script problem / fatal error - palistov - 04-27-2011

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.


RE: Script problem / fatal error - Thunderrr - 04-29-2011

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...


RE: Script problem / fatal error - palistov - 04-29-2011

Need the closing brace in CollideProov


RE: Script problem / fatal error - Thunderrr - 04-29-2011

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


RE: Script problem / fatal error - Dalroc - 04-29-2011

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:
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();
 } 



RE: Script problem / fatal error - Thunderrr - 04-29-2011

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.


RE: Script problem / fatal error - palistov - 04-29-2011

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);


RE: Script problem / fatal error - Thunderrr - 04-29-2011

Thanks, both of you! It solved the problem but it doesn't activate like it should. I guess I'll stop trying then Smile


RE: Script problem / fatal error - TheHunter - 02-28-2013

(04-29-2011, 03:42 PM)palistov Wrote: Need the closing brace in CollideProov

Jajajja i love your cow Heart Big Grin