mrjoshy12
Junior Member
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
|
Unexpected err {
Once I go to play my map this comes up!
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!!!
|
|
07-16-2013, 10:35 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Unexpected err {
(07-16-2013, 10:35 AM)mrjoshy12 Wrote: Once I go to play my map this comes up!
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!!!
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); }
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 |
|
Artyom
Senior Member
Posts: 370
Threads: 27
Joined: Jul 2012
Reputation:
11
|
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);
}
(This post was last modified: 07-16-2013, 10:52 AM by Artyom.)
|
|
07-16-2013, 10:49 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
Artyom
Senior Member
Posts: 370
Threads: 27
Joined: Jul 2012
Reputation:
11
|
RE: Unexpected err {
Dammit No Author! You code to faaaast!
|
|
07-16-2013, 10:50 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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 |
|
Artyom
Senior Member
Posts: 370
Threads: 27
Joined: Jul 2012
Reputation:
11
|
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!
|
|
07-16-2013, 10:55 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
mrjoshy12
Junior Member
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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 |
|
|