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
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#15
RE: Random Scares

(04-19-2013, 05:57 AM)Kiandra Wrote:
Spoiler below!

(04-18-2013, 11:11 AM)BeeKayK Wrote: can a switch script determine if the case has been used before?

Correct me if I'm wrong, but I think you could add local (or global) variables and an "if" statement to restrict how many times/if the case is used more than once. I'm not entirely certain since I don't fully understand how the original script works.

What I think I'm saying up ^ there:
///*insert opening part of switch script here*////
if(GetLocalVarInt("Scare1Played") == 0)
{
       *insert the scare script*
       SetLocalVarInt("Scare1Played, 1);
}

if (GetLocalVarInt("Scare1Played") == 0)
{
   /////whatever else you want here/////
}
/////rest of script below/////

Is that in any way possibly right, or should I just go home and focus on mapping?


You can definately do it like that, but if you looking at having 5+ different events, all of which you need to keep track of, it's going to get very inneficient (but not really a problem*) to keep them all in seperate variables.

Doing it you're way would look more like...
void PlrCollideSwitch(string &in asParent, string &in asChild, int alState)
{
int x = RandInt(1, 5)
switch(x)
{
case 1:
    if (GetLocalVarInt("Scare1Done") == 0) {
    //Scare 1
    SetLocalVarInt("Scare1Done", 1);
    }
    break;
case 2:
    if (GetLocalVarInt("Scare2Done") == 0) {
    //Scare 2
    SetLocalVarInt("Scare2Done", 1);
    }
    break;
case 3:
etc etc...

* the possibility for hard-to-track bugs is pretty high doing it like that. It's ok if your ready for it

(This post was last modified: 04-19-2013, 09:53 AM by Adrianis.)
04-19-2013, 09:45 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)