Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Scares
RurouniMori Offline
Junior Member

Posts: 11
Threads: 3
Joined: Apr 2013
Reputation: 0
#22
RE: Random Scares

(04-24-2013, 04:56 PM)Adrianis Wrote: The compiler reads this line, but because there is no ; at the end, it does not know where the line ends. As far as the compiler knows, the next line down is part of the same statement.
To the compiler it looks like this
int AhVariable = RandInt(1, 2) switch(AhVariable) {

The error is generated because it was expecting to the have the statement terminated by the ;
switch(int) { is not a valid part of a statement, so it throws the error on this line.


tl;dr - the line number given in the error message is approximate, with this particular error, it tends to be the line above
Okay, well if this is the case, how do we resolve the issue. Like I just can't figure out how to fix it. I keep getting the same error.

It tells me the expected ';' or ',' is for line 117. This is my script:
void PlrCollideSwitch(string &in asParent, string &in asChild, int alState)
{
    int RandomScare = RandInt(1, 5)
    switch(RandomScare) *LINE 117
    {
    case 1:
    //Scare 1
        GiveSanityDamage(40, true);
        PlaySoundAtEntity("scarecase1", "scare_breath.snt", "Player", 3.0f, False);
        break;
    case 2:
    //Scare 2
        {
        AddEntityCollideCallback("Player", "scarecase2", "Push", true, 1);
        }
        void Push(string &in asParent, string &in asChild, int alState)
            {
            GiveSanityDamage(40, true);
            PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
            AddPlayerBodyForce(30000, 0, 0, false);
            }
        break;
    case 3:
    //Scare 3
        {
        AddEntityCollideCallback("Player", "scarecase3", "Throw", true, 1);
        }
        void Throw(string &in asParent, string &in asChild, int alState)
            {
            GiveSanityDamage(40, true);
            AddPropForce("throwhelmet", -28.5, 4, 6, "mylordscurse_1");
            }
        break;
    case 4:
    //Scare 4
        GiveSanityDamage(40, true);
        PlaySoundAtEntity("scarecase4", "scare_walk_hallway.snt", "Player", 3.0f, False);
        break;
    case 5:
    //Scare 5
        GiveSanityDamage(40, true);
        SetPlayerCrouching(True);
        FadeSepiaColorTo(10, 3.0f);
        PlaySoundAtEntity("scarecase5", "react_scare.snt", "Player", 3.0f, False);
        break;
    }
}
(This post was last modified: 05-07-2013, 04:23 AM by RurouniMori.)
05-07-2013, 04:22 AM
Find


Messages In This Thread
Random Scares - by PutraenusAlivius - 04-16-2013, 03:10 PM
RE: Random Scares - by Yare - 04-16-2013, 03:39 PM
RE: Random Scares - by PutraenusAlivius - 04-17-2013, 06:10 AM
RE: Random Scares - by Yare - 04-17-2013, 12:44 PM
RE: Random Scares - by PutraenusAlivius - 04-17-2013, 12:51 PM
RE: Random Scares - by Yare - 04-17-2013, 01:55 PM
RE: Random Scares - by VeNoMzTeamHysterical - 04-17-2013, 02:04 PM
RE: Random Scares - by FlawlessHappiness - 04-18-2013, 11:11 AM
RE: Random Scares - by PutraenusAlivius - 04-18-2013, 11:58 AM
RE: Random Scares - by Your Computer - 04-18-2013, 12:10 PM
RE: Random Scares - by Adrianis - 04-18-2013, 12:40 PM
RE: Random Scares - by Your Computer - 04-18-2013, 01:00 PM
RE: Random Scares - by CarnivorousJelly - 04-19-2013, 05:57 AM
RE: Random Scares - by Adrianis - 04-19-2013, 09:45 AM
RE: Random Scares - by Adrianis - 04-18-2013, 01:11 PM
RE: Random Scares - by FlawlessHappiness - 04-20-2013, 09:42 AM
RE: Random Scares - by Adrianis - 04-20-2013, 08:23 PM
RE: Random Scares - by FlawlessHappiness - 04-23-2013, 06:48 PM
RE: Random Scares - by PutraenusAlivius - 04-24-2013, 08:24 AM
RE: Random Scares - by Adrianis - 04-24-2013, 04:56 PM
RE: Random Scares - by RurouniMori - 05-07-2013, 04:22 AM
RE: Random Scares - by PutraenusAlivius - 05-17-2013, 12:19 PM
RE: Random Scares - by FlawlessHappiness - 04-24-2013, 04:50 PM
RE: Random Scares - by PutraenusAlivius - 05-07-2013, 04:30 AM
RE: Random Scares - by RurouniMori - 05-07-2013, 04:47 AM
RE: Random Scares - by Adrianis - 05-20-2013, 06:49 PM
RE: Random Scares - by PutraenusAlivius - 05-21-2013, 02:19 AM
RE: Random Scares - by GoreGrinder99 - 07-21-2013, 11:22 AM
RE: Random Scares - by PutraenusAlivius - 07-21-2013, 11:30 AM
RE: Random Scares - by GoreGrinder99 - 07-21-2013, 11:50 AM
RE: Random Scares - by PutraenusAlivius - 07-21-2013, 12:27 PM



Users browsing this thread: 1 Guest(s)