Frictional Games Forum (read-only)
[SCRIPT] Script 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: [SCRIPT] Script Error (/thread-25355.html)



Script Error - MaksoPL - 05-24-2014

Error is:
main (8,1) : ERR :Expected ',' or ';'

That's my script:
void OnStart()
{
AddUseItemCallback("","ham1","board1","ActivateBrokenBoards",false);
AddEntityCollideCallback("Player","grunt_script1","Hallucination",true,1);
}

void ActivateBrokenBoards(string &in asItem, string &in asEntity)
void Hallucination(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("board1",false);
SetEntityActive("boardb1",true);
SetEntityActive("haluc1",true);
ShowEnemyPlayerPosition("haluc1");
RemoveItem("Ham1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("","ps_cog_stone.ps","BoardParticles", false);
CreateParticleSystemAtEntity("","ps_break_mansionbase_wall.ps","BoardParticles",false);
PlaySoundAtEntity("","player_crouch","Player",0.0f,false);
PlaySoundAtEntity("","break_wood.snt","Player",0.0f,true);
}


RE: Script Error - Romulator - 05-24-2014

Quote:void ActivateBrokenBoards(string &in asItem, string &in asEntity)
void Hallucination(string &in asParent, string &in asChild, int alState)

You have this, but you have no braces for one of them. If you need hallucination to happen in sync with the Activate Broken Boards script, then you don't need that line.

If you still need it:
PHP Code:
void ActivateBrokenBoards(string &in asItemstring &in asEntity)
{
  
//code




RE: Script Error - MaksoPL - 05-24-2014

I added lines:
AddEntityCollideCallback("Player","grunt_script1","Hallucination",true,1);
void Hallucination(string &in asParent, string &in asChild, int alState)
SetEntityActive("haluc1",true);
ShowEnemyPlayerPosition("haluc1");

Before this I added, it worked.


RE: Script Error - Romulator - 05-24-2014

In that case, try this:

PHP Code:
void OnStart()
{
AddUseItemCallback("","ham1","board1","ActivateBrokenBoards",false);
AddEntityCollideCallback("Player","grunt_script1","Hallucination",true,1);
}

void ActivateBrokenBoards(string &in asItemstring &in asEntity)
{
SetEntityActive("board1",false);
SetEntityActive("boardb1",true);
RemoveItem("Ham1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("","ps_cog_stone.ps","BoardParticles"false);
CreateParticleSystemAtEntity("","ps_break_mansionbase_wall.ps","BoardParticles",false);
PlaySoundAtEntity("","player_crouch","Player",0.0f,false); 
PlaySoundAtEntity("","break_wood.snt","Player",0.0f,true);
}

void Hallucination(string &in asParentstring &in asChildint alState)
{
SetEntityActive("haluc1",true);
ShowEnemyPlayerPosition("haluc1");




RE: Script Error - MaksoPL - 05-24-2014

Thanks again. I am a novice with custom stories.


RE: Script Error - DnALANGE - 05-24-2014

Just saying...
Make 1 treadh for your problems please!
I asked a mod to take a look at your treads, nothing to worry about!
Just make 1 tread please.
ONLY if you have something other then the tread you have, you can make anotehr one.
We are here and look in all treads, if there is another issue in the same tradh, we will see and help.
ALSO if the one is fixed you can easely change the topic name into your "new" problem\question.