Frictional Games Forum (read-only)
SOLVED [SCRIPT HELP] 2 scripts together Token Error! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: SOLVED [SCRIPT HELP] 2 scripts together Token Error! (/thread-12534.html)



SOLVED [SCRIPT HELP] 2 scripts together Token Error! - heyitsrobert97 - 01-11-2012

Hey I Need Help I joined 2 scripts into Level_01.hps file but if says that (10,1) Unexpected Token and at (15,1) the same WTF? and if someone can fix it can you tell me how to continue with more than 2 scripts thankuShy


void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 1);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState);
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState);
{
SetPropHealth("basementdoor", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
/////////////////////////////

First Script is a sound area box script. It worked alone
The Second Script is a door explode script when you enter the area box this worked alone too.



RE: [SCRIPT HELP] 2 scripts together Token Error! - flamez3 - 01-11-2012

You have ; on the end of both syntax's. Delete those and it should work.

From this:
Quote:void func_slam(string &in asParent, string &in asChild, int alState);

To this:
Quote:void func_slam(string &in asParent, string &in asChild, int alState)



RE: [SCRIPT HELP] 2 scripts together Token Error! - heyitsrobert97 - 01-11-2012

Thank you so muchBig Grin

lol i probably sound like some stupid noob but i have never done proper scripting before. only some when creating a soundboard a couple of years back.



RE: SOLVED [SCRIPT HELP] 2 scripts together Token Error! - flamez3 - 01-11-2012

No problem, you can go to sites like these:

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#player


http://wiki.frictionalgames.com/hpl2/tutorials/script/entihscript_beginner


To help you when you are starting. : D