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
Scripting error
viccie Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2011
Reputation: 0
#1
Scripting error

well i am trying to make a custom story and found some tutorials on youtube but when i want to start my story i get an error it says:
FATAL ERROR: could not load script (folder name and where the text file is)
main 15.1: ERR : Unexpected token ''{''
And that's it
So in my .HPS file i have these scipts
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', True);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}
void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem(deurkey_1);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
PLS anyone help me it would be great!
12-21-2011, 03:06 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: Scripting error


I fixed some problems. Do it work with this?
Spoiler below!


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', true);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}

void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}




When Life No Longer Exists
Full-conversion mod
12-21-2011, 04:30 PM
Website Find
viccie Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2011
Reputation: 0
#3
RE: Scripting error

(12-21-2011, 04:30 PM)Unearthlybrutal Wrote: I fixed some problems. Do it work with this?
Spoiler below!


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', true);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}

void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}




Nope that didn't work either but the error was just a little bit different it now says (15, 2) instead of (15, 1)...
12-22-2011, 08:44 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Scripting error

(12-22-2011, 08:44 AM)viccie Wrote:
(12-21-2011, 04:30 PM)Unearthlybrutal Wrote: I fixed some problems. Do it work with this?
Spoiler below!


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', true);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}

void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}




Nope that didn't work either but the error was just a little bit different it now says (15, 2) instead of (15, 1)...
You put quotation marks around the 0 in
void UsedKeyOnDoor

12-22-2011, 12:27 PM
Find
viccie Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2011
Reputation: 0
#5
RE: Scripting error

(12-22-2011, 12:27 PM)flamez3 Wrote:
(12-22-2011, 08:44 AM)viccie Wrote:
(12-21-2011, 04:30 PM)Unearthlybrutal Wrote: I fixed some problems. Do it work with this?
Spoiler below!


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', true);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}

void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}




Nope that didn't work either but the error was just a little bit different it now says (15, 2) instead of (15, 1)...
You put quotation marks around the 0 in
void UsedKeyOnDoor


Removed them but still the error :/
although the number changed again from (15, 1) to (16, 1)
12-22-2011, 01:28 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#6
RE: Scripting error

I am unsure if HPS can read double '. Use double " and not double ' and try if that works.
Also, PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);, Change "0" to 0.0f.

Creator of The Dark Treasure.
(This post was last modified: 12-22-2011, 01:52 PM by Linus Ågren.)
12-22-2011, 01:52 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#7
RE: Scripting error

(12-22-2011, 01:28 PM)viccie Wrote:
(12-22-2011, 12:27 PM)flamez3 Wrote:
(12-22-2011, 08:44 AM)viccie Wrote:
(12-21-2011, 04:30 PM)Unearthlybrutal Wrote: I fixed some problems. Do it work with this?
Spoiler below!


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', true);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}

void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}




Nope that didn't work either but the error was just a little bit different it now says (15, 2) instead of (15, 1)...
You put quotation marks around the 0 in
void UsedKeyOnDoor


Removed them but still the error :/
although the number changed again from (15, 1) to (16, 1)
I got it! You put a ; on the end of
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;



12-22-2011, 01:55 PM
Find
viccie Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2011
Reputation: 0
#8
RE: Scripting error

(12-22-2011, 01:52 PM)junkfood2121 Wrote: I am unsure if HPS can read double '. Use double " and not double ' and try if that works.
Also, PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);, Change "0" to 0.0f.


didn't work either.....
ill paste what i have now so u can see what i've changed with all the comments i got
btw thnx every1 for helping me though
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", True);
AddEntityCollideCallback("Player", "doorclose", "Collidedeur", true, 1);
SetLightVisible(string& asLightName, bool abVisible);
}
void doorclose(string &in asParent, string &in asChild, int alState) ;
{
SetSwingDoorLocked("deur", true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked("deur", false, true);
PlaySoundAtEntity("", "unlock_door", "deur", 0, false);
RemoveItem(deurkey_1);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}


(12-22-2011, 01:55 PM)flamez3 Wrote:
(12-22-2011, 01:28 PM)viccie Wrote:
(12-22-2011, 12:27 PM)flamez3 Wrote:
(12-22-2011, 08:44 AM)viccie Wrote:
(12-21-2011, 04:30 PM)Unearthlybrutal Wrote: I fixed some problems. Do it work with this?
Spoiler below!


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback('''', ''deurkey_1'', ''deur'', ''UsedKeyOnDoor'', true);
AddEntityCollideCallback(''Player'', ''doorclose'', ''Collidedeur'', true, 1);
}

void doorclose(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked(''deur'', true, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked(''deur'', false, true);
PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}




Nope that didn't work either but the error was just a little bit different it now says (15, 2) instead of (15, 1)...
You put quotation marks around the 0 in
void UsedKeyOnDoor


Removed them but still the error :/
although the number changed again from (15, 1) to (16, 1)
I got it! You put a ; on the end of
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;

that's already there???
(This post was last modified: 12-22-2011, 02:05 PM by viccie.)
12-22-2011, 02:01 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#9
RE: Scripting error

Remove it.

Creator of The Dark Treasure.
12-22-2011, 02:20 PM
Website Find
viccie Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2011
Reputation: 0
#10
RE: Scripting error

(12-22-2011, 02:01 PM)viccie Wrote:
(12-22-2011, 01:52 PM)junkfood2121 Wrote: I am unsure if HPS can read double '. Use double " and not double ' and try if that works.
Also, PlaySoundAtEntity('''', ''unlock_door'', ''deur'', ''0'', false);, Change "0" to 0.0f.


didn't work either.....
ill paste what i have now so u can see what i've changed with all the comments i got
btw thnx every1 for helping me though
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", True);
AddEntityCollideCallback("Player", "doorclose", "Collidedeur", true, 1);
SetLightVisible(string& asLightName, bool abVisible);
}
void doorclose(string &in asParent, string &in asChild, int alState) ;
{
SetSwingDoorLocked("deur", true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked("deur", false, true);
PlaySoundAtEntity("", "unlock_door", "deur", 0, false);
RemoveItem(deurkey_1);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}


(12-22-2011, 01:55 PM)flamez3 Wrote:
(12-22-2011, 01:28 PM)viccie Wrote:
(12-22-2011, 12:27 PM)flamez3 Wrote:
(12-22-2011, 08:44 AM)viccie Wrote: Nope that didn't work either but the error was just a little bit different it now says (15, 2) instead of (15, 1)...
You put quotation marks around the 0 in
void UsedKeyOnDoor


Removed them but still the error :/
although the number changed again from (15, 1) to (16, 1)
I got it! You put a ; on the end of
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;

that's already there???

oh w8 i found it but now we got another error yaay D:
all right this is the new error:
FATAL ERROR: could not load script file (file map)
main (5, 62) : ERR: 'true' is not declared
main (19, 12) : ERR: 'deurkey_1' is not declared

(This post was last modified: 12-22-2011, 02:52 PM by viccie.)
12-22-2011, 02:48 PM
Find




Users browsing this thread: 2 Guest(s)