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
Unexpected err {
mrjoshy12 Offline
Junior Member

Posts: 8
Threads: 1
Joined: Jul 2013
Reputation: 0
#1
Unexpected err {

Once I go to play my map this comes up!Huh
FATAL ERROR:Could not load script file
'custom_stories/Tutorial/maps/maps1.hps'!
main (14, 1) :ERR :Unexpected token '{'

Heres the map1.hps

////////////////////////////
// This runs when the player enters the map
void OnEnter()
{
AddUseItemCallback("", "escape_door_key1", "escape_room_door1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("escape_room_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "escape_room_door1", 0, false);
RemoveItem("escape_door_key1");
}
{
AddUseItemCallback("", "lol_key1", "lol_door1", "UsedKeyOnDoor2", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lol_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "lol_door1", 0, false);
RemoveItem("lol_key1");
PlayMusic("Without_You_.ogg", false, 1, 0, true);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

HELP ME!!! Sad
07-16-2013, 10:35 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#2
RE: Unexpected err {

(07-16-2013, 10:35 AM)mrjoshy12 Wrote: Once I go to play my map this comes up!Huh
FATAL ERROR:Could not load script file
'custom_stories/Tutorial/maps/maps1.hps'!
main (14, 1) :ERR :Unexpected token '{'

Heres the map1.hps

////////////////////////////
// This runs when the player enters the map
void OnEnter()
{
AddUseItemCallback("", "escape_door_key1", "escape_room_door1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("escape_room_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "escape_room_door1", 0, false);
RemoveItem("escape_door_key1");
}
{
AddUseItemCallback("", "lol_key1", "lol_door1", "UsedKeyOnDoor2", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lol_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "lol_door1", 0, false);
RemoveItem("lol_key1");
PlayMusic("Without_You_.ogg", false, 1, 0, true);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

HELP ME!!! Sad

PHP Code: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
     
SetSwingDoorLocked("escape_room_door1"falsetrue);
 
PlaySoundAtEntity("""unlock_door""escape_room_door1"0false);
 
RemoveItem("escape_door_key1");
}
{
      
AddUseItemCallback("""lol_key1""lol_door1""UsedKeyOnDoor2"true);


There's another "{" after the first "}" . There's suppose to be a void thingy before the "{" .
(This post was last modified: 07-16-2013, 10:48 AM by No Author.)
07-16-2013, 10:46 AM
Find
Artyom Offline
Senior Member

Posts: 370
Threads: 27
Joined: Jul 2012
Reputation: 11
#3
RE: Unexpected err {

Try this. (Tell me if i missed something, did this from my phone)
Oh and just so you know, one of the Callbacks didn't match the function.
Void OnStart()
{
    AddUseItemCallback("", "escape_door_key1", "escape_room_door1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "lol_key1", "lol_door1", "UsedKeyOnDoor2", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("escape_room_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "escape_room_door1", 0, false);
RemoveItem("escape_door_key1");
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lol_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "lol_door1", 0, false);
RemoveItem("lol_key1");
PlayMusic("Without_You_.ogg", false, 1, 0, true);
}

- Inactive account -
(This post was last modified: 07-16-2013, 10:52 AM by Artyom.)
07-16-2013, 10:49 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Unexpected err {

////////////////////////////
// This runs when the player enters the map
void OnEnter()
{
     AddUseItemCallback("", "escape_door_key1", "escape_room_door1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "lol_key1", "lol_door1", "UsedKeyOnDoor2", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked("escape_room_door1", false, true);
     PlaySoundAtEntity("", "unlock_door", "escape_room_door1", 0, false);
     RemoveItem("escape_door_key1");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked("lol_door1", false, true);
     PlaySoundAtEntity("", "unlock_door", "lol_door1", 0, false);
     RemoveItem("lol_key1");
     PlayMusic("Without_You_.ogg", false, 1, 0, true);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

Fixed. The reason why you got an error is because this code
{
      AddUseItemCallback("", "lol_key1", "lol_door1", "UsedKeyOnDoor2", true);
}

is not defined in a function.

"Veni, vidi, vici."
"I came, I saw, I conquered."
07-16-2013, 10:50 AM
Find
Artyom Offline
Senior Member

Posts: 370
Threads: 27
Joined: Jul 2012
Reputation: 11
#5
RE: Unexpected err {

Dammit No Author! You code to faaaast! Wink

- Inactive account -
07-16-2013, 10:50 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#6
RE: Unexpected err {

Wow. I left for a minute and there's already 3 replies.
Lol ofc I am

And if that doesn't fix the problem, maybe the adduseitemcallback isn't suppose to be there.
(This post was last modified: 07-16-2013, 10:56 AM by No Author.)
07-16-2013, 10:53 AM
Find
Artyom Offline
Senior Member

Posts: 370
Threads: 27
Joined: Jul 2012
Reputation: 11
#7
RE: Unexpected err {

(07-16-2013, 10:53 AM)No Author Wrote: Wow. I left for a minute and there's already 3 replies.

And if that doesn't fix the problem, maybe the adduseitemcallback isn't suppose to be there.

Yeah It's all about the reps man all about em!

- Inactive account -
07-16-2013, 10:55 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#8
RE: Unexpected err {

Wow. No Author just ninja'd two people. Nice job dude.

"Veni, vidi, vici."
"I came, I saw, I conquered."
07-16-2013, 10:56 AM
Find
mrjoshy12 Offline
Junior Member

Posts: 8
Threads: 1
Joined: Jul 2013
Reputation: 0
#9
RE: Unexpected err {

wow all these comments, i actually forgot to say i started doing this scripting yesterday,
so yeah i dont actually get what most of you are sayin
07-16-2013, 11:05 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#10
RE: Unexpected err {

The adduseitemcallback script on Lolkey_1 to loldoor_1 doesn't have a void before the "{"
Edit : I meant lol_key1 and lol_door1
(This post was last modified: 07-16-2013, 11:11 AM by No Author.)
07-16-2013, 11:09 AM
Find




Users browsing this thread: 4 Guest(s)