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
Expected "("
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#1
Expected "("

I'm making a event that uses mostly timers to run and when I try and start the game I get this message
Quote: main (50,1) : INFO : Compiling void Father_Flashback_Script(string&in,string&in, int) main(55,34) :ERR : Expected '('


Here is my script

Spoiler below!
void OnStart()
{
        TeleportPlayer("Intro_0");
        FadeOut(0);
        SetPlayerActive(false);
        SetSanityDrainDisabled(true);
        ShowPlayerCrossHairIcons(false);

        AddTimer("fadein", 3, "TimerIntroOutro");
        AddTimer("Father_Insane", 3, "Father_Insane_Flashback");
        PlayMusic("OFortuna2.ogg", false, 1.0, 0, 1, true);
        SetEntityConnectionStateChangeCallback("Secret_Door_Lever01", "func_shelf");
        AddUseItemCallback("", "hall_key", "spawn_to_hall", "Open_hall", true);
        AddEntityCollideCallback("Player", "Father_Flashback", "Father_Flashback_Script", true, 1);
}

void TimerIntroOutro(string &in asTimer)
{
        if(GetLocalVarInt("Intro") < 3) {

                if(asTimer == "fadein") {
                        TeleportPlayer("Intro_" + GetLocalVarInt("Intro"));
                        FadeIn(1);
                        AddTimer("fadeout", 3, "TimerIntroOutro");
                }

                if(asTimer == "fadeout") {
                        FadeOut(1);
                        AddTimer("fadein", 1, "TimerIntroOutro");
                        AddLocalVarInt("Intro", 1);
                }
        }
        else
        {
                TeleportPlayer("Spawn");
                FadeIn(2);
                SetPlayerActive(true);
                SetSanityDrainDisabled(false);
                ShowPlayerCrossHairIcons(true);
                StopMusic(5, 1);            
                SetPlayerLampOil(0.0);
        }
}

void Open_hall (string &in asItem, string &in asEntity)
    {
    SetSwingDoorLocked("spawn_to_hall", false,true);
    }
    
void Father_Flashback_Script(string &in asParent, string &in asChild, int alState)
{
    SetPlayerActive(false);
    ShowPlayerCrossHairIcons(false);
    FadeOut(3);
        Father_Insane_Flashback(string &in asTimer) // Line 55 //
        {
        SetEntityActive(candlestick_wall_8, false);
        SetEntityActive(candlestick_wall_7, false);
        SetEntityActive(normal_portrait, false);
        SetEntityActive(insane_portrait, true);
        SetEntityActive(insane_candle01, true);
        SetEntityActive(insane_candle02), true)
        AddTimer("Father_Flashback_Scare", 3, "Father_Insane");
            if(asTimer== "Father_Flashback_Scare")
            {
            FadeIn(0)
            PlaySoundAtEntity("", "24_iron_maiden.snt", "insane_portrait", 0, false);
            AddTimer("Father_Flashback_Reactive",0.01, "Father_Insane");
            }
            
            if(asTimer== "Father_Flashback_Reactive")
            {
            SetPlayerActive(true)
            ShowPlayerCrossHairIcons(true)
            }
        }
}


[Image: 15420.png]
07-15-2014, 03:53 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: Expected "("

Found alot of problems here. Firstly the Father_Insane_Flashback doesnt have a void. This is how its supposed to be.

void Father_Insane_Flashback(string &in asTimer)

The SetEntityActive in the same timer had no " and a few didnt have a ; either.

SetEntityActive("candlestick_wall_8", false);
    SetEntityActive("candlestick_wall_7", false);
    SetEntityActive("normal_portrait", false);
    SetEntityActive("insane_portrait", true);
    SetEntityActive("insane_candle01", true);
    SetEntityActive("insane_candle02"), true);

In the timer called Father_Flashback_Reactive has SetPlayerActive and ShowPlayerCrossHairIcons in there, but without ; again.

SetPlayerActive(true);
        ShowPlayerCrossHairIcons(true);

The FadeIn script in the Father_Flashback_Scare got no ; either.

FadeIn(0);

So, the whole script looks like this:

void OnStart()
{
        TeleportPlayer("Intro_0");
        FadeOut(0);
        SetPlayerActive(false);
        SetSanityDrainDisabled(true);
        ShowPlayerCrossHairIcons(false);

        AddTimer("fadein", 3, "TimerIntroOutro");
        AddTimer("Father_Insane", 3, "Father_Insane_Flashback");
        PlayMusic("OFortuna2.ogg", false, 1.0, 0, 1, true);
        SetEntityConnectionStateChangeCallback("Secret_Door_Lever01", "func_shelf");
        AddUseItemCallback("", "hall_key", "spawn_to_hall", "Open_hall", true);
        AddEntityCollideCallback("Player", "Father_Flashback", "Father_Flashback_Script", true, 1);
}

void TimerIntroOutro(string &in asTimer)
{
        if(GetLocalVarInt("Intro") < 3) {

                if(asTimer == "fadein") {
                        TeleportPlayer("Intro_" + GetLocalVarInt("Intro"));
                        FadeIn(1);
                        AddTimer("fadeout", 3, "TimerIntroOutro");
                }

                if(asTimer == "fadeout") {
                        FadeOut(1);
                        AddTimer("fadein", 1, "TimerIntroOutro");
                        AddLocalVarInt("Intro", 1);
                }
        }
        else
        {
                TeleportPlayer("Spawn");
                FadeIn(2);
                SetPlayerActive(true);
                SetSanityDrainDisabled(false);
                ShowPlayerCrossHairIcons(true);
                StopMusic(5, 1);            
                SetPlayerLampOil(0.0);
        }
}

void Open_hall (string &in asItem, string &in asEntity)
    {
    SetSwingDoorLocked("spawn_to_hall", false,true);
    }
    
void Father_Flashback_Script(string &in asParent, string &in asChild, int alState)
{
    SetPlayerActive(false);
    ShowPlayerCrossHairIcons(false);
    FadeOut(3);
        
}

void Father_Insane_Flashback(string &in asTimer) // Line 55 //
{
    SetEntityActive("candlestick_wall_8", false);
    SetEntityActive("candlestick_wall_7", false);
    SetEntityActive("normal_portrait", false);
    SetEntityActive("insane_portrait", true);
    SetEntityActive("insane_candle01", true);
    SetEntityActive("insane_candle02"), true);
    AddTimer("Father_Flashback_Scare", 3, "Father_Insane");
    
    if(asTimer== "Father_Flashback_Scare")
    {
        FadeIn(0);
        PlaySoundAtEntity("", "24_iron_maiden.snt", "insane_portrait", 0, false);
        AddTimer("Father_Flashback_Reactive",0.01, "Father_Insane");
    }
            
    if(asTimer== "Father_Flashback_Reactive")
    {
        SetPlayerActive(true);
        ShowPlayerCrossHairIcons(true);
    }
}

Other than those issues I brought up, I can't see anything else thats wrong.

Derp.
07-15-2014, 04:04 PM
Find
Artsy Offline
Member

Posts: 213
Threads: 10
Joined: Feb 2014
Reputation: 9
#3
RE: Expected "("

I'm not really sure, but I noticed something.

SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
07-15-2014, 04:05 PM
Find
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#4
RE: Expected "("

(07-15-2014, 04:04 PM)Neelke Wrote: Found alot of problems here. Firstly the Father_Insane_Flashback doesnt have a void. This is how its supposed to be.

void Father_Insane_Flashback(string &in asTimer)

The SetEntityActive in the same timer had no " and a few didnt have a ; either.

SetEntityActive("candlestick_wall_8", false);
    SetEntityActive("candlestick_wall_7", false);
    SetEntityActive("normal_portrait", false);
    SetEntityActive("insane_portrait", true);
    SetEntityActive("insane_candle01", true);
    SetEntityActive("insane_candle02"), true);

In the timer called Father_Flashback_Reactive has SetPlayerActive and ShowPlayerCrossHairIcons in there, but without ; again.

SetPlayerActive(true);
        ShowPlayerCrossHairIcons(true);

The FadeIn script in the Father_Flashback_Scare got no ; either.

FadeIn(0);

So, the whole script looks like this:

void OnStart()
{
        TeleportPlayer("Intro_0");
        FadeOut(0);
        SetPlayerActive(false);
        SetSanityDrainDisabled(true);
        ShowPlayerCrossHairIcons(false);

        AddTimer("fadein", 3, "TimerIntroOutro");
        AddTimer("Father_Insane", 3, "Father_Insane_Flashback");
        PlayMusic("OFortuna2.ogg", false, 1.0, 0, 1, true);
        SetEntityConnectionStateChangeCallback("Secret_Door_Lever01", "func_shelf");
        AddUseItemCallback("", "hall_key", "spawn_to_hall", "Open_hall", true);
        AddEntityCollideCallback("Player", "Father_Flashback", "Father_Flashback_Script", true, 1);
}

void TimerIntroOutro(string &in asTimer)
{
        if(GetLocalVarInt("Intro") < 3) {

                if(asTimer == "fadein") {
                        TeleportPlayer("Intro_" + GetLocalVarInt("Intro"));
                        FadeIn(1);
                        AddTimer("fadeout", 3, "TimerIntroOutro");
                }

                if(asTimer == "fadeout") {
                        FadeOut(1);
                        AddTimer("fadein", 1, "TimerIntroOutro");
                        AddLocalVarInt("Intro", 1);
                }
        }
        else
        {
                TeleportPlayer("Spawn");
                FadeIn(2);
                SetPlayerActive(true);
                SetSanityDrainDisabled(false);
                ShowPlayerCrossHairIcons(true);
                StopMusic(5, 1);            
                SetPlayerLampOil(0.0);
        }
}

void Open_hall (string &in asItem, string &in asEntity)
    {
    SetSwingDoorLocked("spawn_to_hall", false,true);
    }
    
void Father_Flashback_Script(string &in asParent, string &in asChild, int alState)
{
    SetPlayerActive(false);
    ShowPlayerCrossHairIcons(false);
    FadeOut(3);
        
}

void Father_Insane_Flashback(string &in asTimer) // Line 55 //
{
    SetEntityActive("candlestick_wall_8", false);
    SetEntityActive("candlestick_wall_7", false);
    SetEntityActive("normal_portrait", false);
    SetEntityActive("insane_portrait", true);
    SetEntityActive("insane_candle01", true);
    SetEntityActive("insane_candle02"), true);
    AddTimer("Father_Flashback_Scare", 3, "Father_Insane");
    
    if(asTimer== "Father_Flashback_Scare")
    {
        FadeIn(0);
        PlaySoundAtEntity("", "24_iron_maiden.snt", "insane_portrait", 0, false);
        AddTimer("Father_Flashback_Reactive",0.01, "Father_Insane");
    }
            
    if(asTimer== "Father_Flashback_Reactive")
    {
        SetPlayerActive(true);
        ShowPlayerCrossHairIcons(true);
    }
}

Other than those issues I brought up, I can't see anything else thats wrong.

Fixed the issues you mentioned now the error is
Quote: (65,39) : ERR: Expected ';'

Ok, I figured out the problem but now all the events have occured when the game starts. The entity "Insane_portrait" which is supposed to be activated along with the "Insane_candles" are already activated. The fadeout occurs when I enter the script area but the fade in never occurs.

[Image: 15420.png]
(This post was last modified: 07-15-2014, 04:16 PM by CQBgamer.)
07-15-2014, 04:11 PM
Find
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#5
RE: Expected "("

Any ideas why they are already active before I enter the script area? Im not too good with timers so it might be that.

I cant start the CS now. I get the same error. There is nothing at the line it mentions (which is now 58,36) I dont understand why it would expect a '(' there isnt anything there that would require it that doesnt have it. Here is the updated script:

Spoiler below!
void OnStart()
{
        AddEntityCollideCallback("Player", "Father_Flashback", "Father_Flashback_Script", true, 1);
        TeleportPlayer("Intro_0");
        FadeOut(0);
        SetPlayerActive(false);
        SetSanityDrainDisabled(true);
        ShowPlayerCrossHairIcons(false);

        AddTimer("fadein", 3, "TimerIntroOutro");
        AddTimer("Father_Insane", 3, "Father_Insane_Flashback");
        PlayMusic("OFortuna2.ogg", false, 1.0, 0, 1, true);
        SetEntityConnectionStateChangeCallback("Secret_Door_Lever01", "func_shelf");
        AddUseItemCallback("", "hall_key", "spawn_to_hall", "Open_hall", true);
      
}



void TimerIntroOutro(string &in asTimer)
{
        if(GetLocalVarInt("Intro") < 3) {

                if(asTimer == "fadein") {
                        TeleportPlayer("Intro_" + GetLocalVarInt("Intro"));
                        FadeIn(1);
                        AddTimer("fadeout", 3, "TimerIntroOutro");
                }

                if(asTimer == "fadeout") {
                        FadeOut(1);
                        AddTimer("fadein", 1, "TimerIntroOutro");
                        AddLocalVarInt("Intro", 1);
                }
        }
        else
        {
                TeleportPlayer("Spawn");
                FadeIn(2);
                SetPlayerActive(true);
                SetSanityDrainDisabled(false);
                ShowPlayerCrossHairIcons(true);
                StopMusic(5, 1);            
                SetPlayerLampOil(0.0);
        }
}

void Open_hall (string &in asItem, string &in asEntity)
    {
    SetSwingDoorLocked("spawn_to_hall", false,true);
    }
    
void Father_Flashback_Script(string &in asParent, string &in asChild, int alState)
{
    SetPlayerActive(false);
    ShowPlayerCrossHairIcons(false);
    FadeOut(3);
    Father_Insane_Flashback(string &in asTimer) // This is line 58, the one causing a fatal error //
{
    SetEntityActive("candlestick_wall_8", false);
    SetEntityActive("candlestick_wall_7", false);
    SetEntityActive("normal_portrait", false);
    SetEntityActive("insane_portrait", true);
    SetEntityActive("insane_candle01", true);
    SetEntityActive("insane_candle02", true);
    AddTimer("Father_Flashback_Scare", 3, "Father_Insane");
    
    if(asTimer== "Father_Flashback_Scare")
    {
        FadeIn(0);
        PlaySoundAtEntity("", "24_iron_maiden.snt", "insane_portrait", 0, false);
        AddTimer("Father_Flashback_Reactive",0.01, "Father_Insane");
    }
            
    if(asTimer== "Father_Flashback_Reactive")
    {
        SetPlayerActive(true);
        ShowPlayerCrossHairIcons(true);
    }
}    

}


I can provide a download of the CS files if you need it to fix this issue or the issue with the entities activating before entering the script area.

[Image: 15420.png]
(This post was last modified: 07-16-2014, 03:27 AM by CQBgamer.)
07-16-2014, 02:56 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Expected "("

PHP Code: (Select All)
Father_Insane_Flashback(string &in asTimer

What is that? A callback? A function?

"Veni, vidi, vici."
"I came, I saw, I conquered."
07-16-2014, 05:32 AM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#7
RE: Expected "("

Why did you delete the void from the Father_Insane_Flashback?

void Father_Insane_Flashback(string &in asTimer)

Thats how I fixed it for you, but appearntly you changed it again.

Derp.
07-16-2014, 10:02 AM
Find
FalconLoverxxxxxx Offline
Junior Member

Posts: 16
Threads: 1
Joined: Jul 2014
Reputation: 3
#8
RE: Expected "("

NEVERMIND
(This post was last modified: 07-16-2014, 03:46 PM by FalconLoverxxxxxx.)
07-16-2014, 03:39 PM
Find




Users browsing this thread: 1 Guest(s)