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 token
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#1
Unexpected token

Hey.
Anyone know why i get this?

main(1, 1) : ERR : Unexpected token '<Unrecognized token>'

Here's the code.

void OnStart()
{
AddEntityCollideCallback("Player", "voice_1", "voice1", true, 1);
AddEntityCollideCallback("Player", "voice_2", "voice2", true, 1);
AddUseItemCallback("", "stone_hammer_1", "padlock_1", "unlock", true);
AddUseItemCallback("", "key_4", "mansion_4", "unlock_door", true);
AddUseItemCallback("", "key_5", "level_wood_2", "unlock_level", true);
AddUseItemCallback("", "stone_hammer_1", "chest_small_1", "unlock_chest", true);
}

void voice1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "voice_acting_2.snt", "Player", 0, false);
SetEntityActive("voice_2", true);
StartPlayerLookAt("voice_2", 1, 2,"");
SetPlayerActive(false);
AddTimer("T1", 3.0f, "Timer_1");
}

void Timer_1(string &in asTimer)
{
SetPlayerActive(true);
}

void voice2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "voice_acting_3.snt", "Player", 0, false);
StopPlayerLookAt();
SetPlayerActive(false);
AddTimer("T1", 40.0f, "Timer_2");
}

void Timer_2(string &in asTimer)
{
SetPlayerActive(true);
}

void unlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, true);
SetEntityActive("padlock_1", false);
SetEntityActive("padlock_broken_1", true);
PlaySoundAtEntity("", "25_attach_bar_metal.snt", "Player", 0, false);
}

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

void unlock_level(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_wood_2", false);
PlaySoundAtEntity("", "unlock_door", "level_wood_2", 0, false);
RemoveItem("Key_5");
}

void unlock_chest(string &in asItem, string &in asEntity)
{
SetLeverStuckState("chest_small_1", 0, true);
PlaySoundAtEntity("", "06_break_wood.snt", "chest_small_1", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
}



void OnEnter()
{
PlayMusic("25_amb.ogg", true, 2, 2, 0, true);
}


void OnLeave()
{

}

02-17-2013, 06:09 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: Unexpected token

Are you using regular Notepad?

If so, get Notepad++. Open your file, and if your problem is an encoding problem, as I expect it is, Notepad++ should show your file beginning with something like  .

Remove that and save.

[Image: 16455.png]
(This post was last modified: 02-17-2013, 06:13 PM by MulleDK19.)
02-17-2013, 06:10 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#3
RE: Unexpected token

(02-17-2013, 06:10 PM)MulleDK19 Wrote: Are you using regular Notepad?

If so, get Notepad++. Open your file, and if your problem is an encoding problem, as I expect it is, Notepad++ should show your file beginning with something like  .

Remove that and save.

nope didn't find any problem with notepad++ either

02-17-2013, 06:26 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#4
RE: Unexpected token

(02-17-2013, 06:26 PM)Storfigge Wrote:
(02-17-2013, 06:10 PM)MulleDK19 Wrote: Are you using regular Notepad?

If so, get Notepad++. Open your file, and if your problem is an encoding problem, as I expect it is, Notepad++ should show your file beginning with something like  .

Remove that and save.

nope didn't find any problem with notepad++ either

Well, then you're going to have to upload your script file somewhere, because it's indicating it's a problem with the very first character in the file.

[Image: 16455.png]
02-17-2013, 06:27 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#5
RE: Unexpected token

(02-17-2013, 06:27 PM)MulleDK19 Wrote:
(02-17-2013, 06:26 PM)Storfigge Wrote:
(02-17-2013, 06:10 PM)MulleDK19 Wrote: Are you using regular Notepad?

If so, get Notepad++. Open your file, and if your problem is an encoding problem, as I expect it is, Notepad++ should show your file beginning with something like  .

Remove that and save.

nope didn't find any problem with notepad++ either

Well, then you're going to have to upload your script file somewhere, because it's indicating it's a problem with the very first character in the file.

lol nvm -.- managed to fix it. ty

(02-17-2013, 06:30 PM)Storfigge Wrote:
(02-17-2013, 06:27 PM)MulleDK19 Wrote:
(02-17-2013, 06:26 PM)Storfigge Wrote:
(02-17-2013, 06:10 PM)MulleDK19 Wrote: Are you using regular Notepad?

If so, get Notepad++. Open your file, and if your problem is an encoding problem, as I expect it is, Notepad++ should show your file beginning with something like  .

Remove that and save.

nope didn't find any problem with notepad++ either

Well, then you're going to have to upload your script file somewhere, because it's indicating it's a problem with the very first character in the file.

lol nvm -.- managed to fix it. ty

dammit it works when I exit and then starts the CS but I can't reload the map...

I think I've fixed it. There was a problem with an Inventory.hps file I had -.-

(This post was last modified: 02-17-2013, 06:42 PM by Storfigge.)
02-17-2013, 06:30 PM
Find




Users browsing this thread: 1 Guest(s)