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
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#27
RE: Random Scares

(05-20-2013, 06:49 PM)Adrianis Wrote: Apologies for the late reply, that code isn't fixed JAP...

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;
....

This bit of code is wrong - You don't need any curly braces { } inside of each Case statement, the code block for the Case statement is defined within the space between the keyword 'case [int]:' and 'break;'

case 3: CODE HERE
CODE HERE
break;

(the break; keyword is not strictly necessary, but it is needed in order to stop the flow of the case statements before it starts executing code from the other cases)

^ That is all explained in JAP's original post, underneath the code sample

You also cannot define a function within the code block of a case statement, as you do here
void Push(string &in asParent, string &in asChild, int alState)
{
code
}

Now, I'm not sure exactly what event you are trying to set up, but the code that JAP kindly provided is not as simple to use as it might appear - I highly recommend you learn about how switch...case statements work before attempting to use this method. I say that for your benefit, this will cause more headaches then it will solve
There an explanation of how they work here...
http://www.angelcode.com/angelscript/sdk...ments.html

What Adrianis said. Even though it looks kind of easy, it's actually very hard.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-21-2013, 02:19 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)