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 Scenario
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#2
RE: Scenario

Do you know how to script?

void OnStart()
{
    AddEntityCollideCallback("Player", "EnableMonster", "EnableMonster", true, 0);//Activate the Monster when colliding with an area
    AddEntityCollideCallback("Player", "CollideRun", "CollideRun", true, 0);//The bridge breaks when colliding
}

void EnableMonster(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("servant_grunt_1", true);
    SetLocalVarInt("MonsterActive", 1);
}


void CollideRun(string &in asParent, string &in asChild, int alState)
{
    if(GetLocalVarInt("MonsterActive")==1)
    {
SetPropHealth("Bridge", 0);
AddTimer("Fade", 1, "Falling");
AddTimer("ChangeMap", 2, "Falling");

    }
    else
    {
//Do nothing
    }
}

void Falling(string &in asTimer)
{
    if(asTimer==("Fade"))
    {
FadeOut(1);
    }
    else if(asTimer==("ChangeMap"))

    {
ChangeMap("MapName", "StartPosition", "", "");
    }
}
Let me know if there's any errors.

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
(This post was last modified: 02-03-2013, 07:51 PM by GoranGaming.)
02-03-2013, 06:42 PM
Website Find


Messages In This Thread
Scenario - by assassinhawk45 - 02-03-2013, 05:36 PM
RE: Scenario - by GoranGaming - 02-03-2013, 06:42 PM
RE: Scenario - by nivramm - 02-03-2013, 06:44 PM
RE: Scenario - by Tiger - 02-03-2013, 07:29 PM
RE: Scenario - by assassinhawk45 - 02-04-2013, 12:35 AM
RE: Scenario - by GoranGaming - 02-04-2013, 07:17 AM
RE: Scenario - by FlawlessHappiness - 02-04-2013, 08:05 AM



Users browsing this thread: 1 Guest(s)