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
[SOLVED]Now I see you... Oh wait a minute, I don't
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#4
RE: [SOLVED]Now I see you... Oh wait a minute, I don't

I've done exactly this with the skull scene in my custom story, here is the script (sorry, it's a bit complicated):

//those are in OnStart()
AddEntityCollideCallback("Player", "CollideSkullRoom", "SkullRoom", true, -1);
AddEntityCollideCallback("Player", "CollideLookAt", "ActivateLookAt", true, 1);

void SkullRoom(string &in asParent, string &in asChild, int alState)
{
    for(int i=2;i<30;i++) SetEntityActive("human_skull_"+i, false);
    for(int i=31;i<50;i++) SetEntityActive("human_skull_"+i, true);
    SetEntityActive("key_tomb_1", true);
    
    AddTimer("skulldrop", 0.2f, "SkullDropSound");
    AddTimer("removeskulldrop", 1.5f, "RemoveSkull");
    
    PlaySoundAtEntity("stomp", "scare_wall_stomp.snt", "prisoner_cage_1", 0.0f, false);
    
    AddDebugMessage("MAGIC!", false);
}

//SkullRoomActive is an area with a LookAtCallback which calls SkullRoomLookAt
void ActivateLookAt(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("SkullRoomActive", true);
}

void SkullRoomLookAt(string &in entity, int alState)
{
    if(alState == -1)
    {
        SetEntityActive("CollideSkullRoom", true);
        AddDebugMessage("keep not looking..", false);
    }
    else
    {
        SetEntityActive("CollideSkullRoom", false);
        AddDebugMessage("don't look!", false);
    }
}


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-26-2011, 12:43 PM
Find


Messages In This Thread
RE: [SOLVED]Now I see you... Oh wait a minute, I don't - by Frontcannon - 01-26-2011, 12:43 PM



Users browsing this thread: 1 Guest(s)