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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help fatal error! help plz
pewds..fan Offline
Junior Member

Posts: 11
Threads: 4
Joined: May 2013
Reputation: 0
#1
fatal error! help plz

hi everyone here is the error that arrives when im trying to enter from my map 2 to map 3:

FATAL ERROR:Could not load script file
'custom_stories/paskaa/custom_stories/paskaa/maps/C:/Program Files(x86)/kauhupelit/Amnesia-The Dark Descent(2)/redist/custom_stories/paskaa/maps/03_testi.hps'
main(11,4): ERR : Expected ',' or ','
main(12,19) : ERR : Expected identifier
main(13,19) : ERR : Expected identifier
main(14,19) : ERR : Expected identifier

SCRIPT
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "START_GRUNT_1", "GRUNT", true, 1);
AddEntityCollideCallback("Player", "START_KNIGHTS", "KNIGHT", true, 1);
}

void KNIGHT(string &in asParent, string &in asChild, int alState)

SetEntityActive("KNIGHT_0", true);
SetEntityActive("KNIGHT_1", true);
SetEntityActive("KNIGHT_2", true);
SetEntityActive("KNIGHT_3", true);

void GRUNT(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GRUNT_1", true);
AddEnemyPatrolNode("GRUNT_1", "NODE_1", 0, "");
}

////////////////////////////
// Run when entering map
void OnEnter()
{
AutoSave();
AddEntityCollideCallback("Player", "door_close", "closedoor", true, 1);
}

void closedoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", 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);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{
AutoSave();
}


if you can find these mistakes that i could not find plz tell me Smile !
05-28-2013, 02:05 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#2
RE: fatal error! help plz

void KNIGHT(string &in asParent, string &in asChild, int alState)

   SetEntityActive("KNIGHT_0", true);
   SetEntityActive("KNIGHT_1", true);
   SetEntityActive("KNIGHT_2", true);
   SetEntityActive("KNIGHT_3", true);

The problem is here, you need the { and } surrounding the code in the middle - look at all you're other functions in that script, they all have..

void NAME( stuff)
{
   //code
}

This error, main(11,4): ERR : Expected ',' or ','
The first number in brackets (number 11) refers to the line number that the problem occured on - you can count line by line down to 11, and see the problem.

void KNIGHT(string &in asParent, string &in asChild, int alState)
{
   SetEntityActive("KNIGHT_0", true);
   SetEntityActive("KNIGHT_1", true);
   SetEntityActive("KNIGHT_2", true);
   SetEntityActive("KNIGHT_3", true);
}

Also, you made another thread reporting problems you were having with this map - a bunch of us responded trying to help, but you didn't actually respond. It would be nice if you could respond to people trying to help, giving them the stuff they ask for and letting them know whether it helped or not.

(This post was last modified: 05-28-2013, 02:20 PM by Adrianis.)
05-28-2013, 02:18 PM
Find
pewds..fan Offline
Junior Member

Posts: 11
Threads: 4
Joined: May 2013
Reputation: 0
#3
RE: fatal error! help plz

i could not find any mistakes in error main(11,4): ERR : Expected ',' or ','
i searched the whole line but i just could not find anything
(i noticed the brackets a min after sending this post Big Grin )
05-28-2013, 02:26 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#4
RE: fatal error! help plz

Fair enough - the line number is always going to be 'approximately' where the problem is, it may be a few lines above or below depending on the actual error being reported.

In this case it looks like line 11 is 'SetEntityActive("KNIGHT_0", true);'
This is the first line that the game realizes there is a problem, all the lines that came before it were perfectly fine. Because it did not find a { it was expecting to find , or ; at line 11, but it didn't find any, so it crashes the game and says there's a problem at line 11, where it was supposed to find a valid character. It can't know what you were trying to do, so it has to report on the only place it knows there is a problem, the correction to that problem happens to come a line before it.

Hope that helps explain it

05-28-2013, 02:32 PM
Find
pewds..fan Offline
Junior Member

Posts: 11
Threads: 4
Joined: May 2013
Reputation: 0
#5
RE: fatal error! help plz

Smile thanks man its working now Big Grin
05-28-2013, 02:38 PM
Find




Users browsing this thread: 1 Guest(s)