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
Script Help Script Error
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#1
Script Error

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);
}
05-24-2014, 01:11 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Script Error

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: (Select All)
void ActivateBrokenBoards(string &in asItemstring &in asEntity)
{
  
//code


Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 05-24-2014, 01:19 PM by Romulator.)
05-24-2014, 01:17 PM
Find
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#3
RE: Script Error

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.
(This post was last modified: 05-24-2014, 01:21 PM by MaksoPL.)
05-24-2014, 01:20 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#4
RE: Script Error

In that case, try this:

PHP Code: (Select All)
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");


Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-24-2014, 01:27 PM
Find
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#5
RE: Script Error

Thanks again. I am a novice with custom stories.
05-24-2014, 01:29 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: Script Error

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.
(This post was last modified: 05-24-2014, 02:14 PM by DnALANGE.)
05-24-2014, 02:13 PM
Find




Users browsing this thread: 1 Guest(s)