Frictional Games Forum (read-only)

Full Version: Unexpected token
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
{

}
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.
(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)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.
(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 -.-