Frictional Games Forum (read-only)

Full Version: Map 2 FATAL ERROR
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Every time I open the second door of my level, it gives me an error: FATAL ERROR. Could not load script file 'custom_stories/Escape/main/C:/Program Files (x86)/Amnesia - The Dark Descent/redist/custom stories/Escape/main/escape2.hps'! ExecuteString(1, 1):ERR:No matching signatures to 'OnLeave() main(4, 1):ERR:Expected';'


Here's my code:

void OnStart()
{
AddEntityCollideCallback("Player" , "EnemySpawner" , "Monsterfunc1" , true , 1)
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt" , true);
}




I'm at an odds on what to do.
You need a ;

(01-22-2011, 08:57 PM)Ianlis Wrote: [ -> ]Every time I open the second door of my level, it gives me an error: FATAL ERROR. Could not load script file 'custom_stories/Escape/main/C:/Program Files (x86)/Amnesia - The Dark Descent/redist/custom stories/Escape/main/escape2.hps'! ExecuteString(1, 1):ERR:No matching signatures to 'OnLeave() main(4, 1):ERR:Expected';'


Here's my code:

void OnStart()
{
AddEntityCollideCallback("Player" , "EnemySpawner" , "Monsterfunc1" , true , 1) <- right here
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt" , true);
}




I'm at an odds on what to do.
Thanks, it worked. Now the second problem is that I can't seem to get the enemy to spawn when i walk across 'EnemySpawner'.
Check if the enemy has the exact same name as in the script. If it is "servant_grunt_1", then, you must type in the script "servant_grunt_1". Or check if the ScriptArea has the name of "EnemySpawner", and not something else.
(01-22-2011, 09:41 PM)Nemet Robert Wrote: [ -> ]Check if the enemy has the exact same name as in the script. If it is "servant_grunt_1", then, you must type in the script "servant_grunt_1". Or check if the ScriptArea has the name of "EnemySpawner", and not something else.

Still nothing.
Instead of spawn, change it so the monsters already there except its inactive, and then the script activates it.
(01-22-2011, 11:50 PM)Shev Wrote: [ -> ]Instead of spawn, change it so the monsters already there except its inactive, and then the script activates it.

How do you do that?
(01-23-2011, 02:55 AM)Ianlis Wrote: [ -> ]
(01-22-2011, 11:50 PM)Shev Wrote: [ -> ]Instead of spawn, change it so the monsters already there except its inactive, and then the script activates it.

How do you do that?

Put the monster in the level editor, and uncheck the Active box.

Then put this in.

SetEntityActive(monsternamehere, 1 or 0);
You might also want to change 'Monsterfunc1' to 'MonsterFunc1' in your AddEntityCollideCallback, but I am not sure whether it is case sensitive.