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
Please remove
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#11
RE: AddEntityCollideCallback

(01-02-2012, 07:08 AM)Statyk Wrote: It makes the screen black instantly. That's actually a good teting idea. see, if a function isn't working, a visual like THAT would easily tell you if something is wrong with a specific function, or if it is working fine but has a typo somewhere, etc. Understand?

Indeed, I do. I tested the map again, but the screen didn't go black when I opened the chest.

Full code:
bool TriggeredEnemy;

void OnStart() {
    if (ScriptDebugOn()) {
        GiveItemFromFile("lantern", "lantern.ent");
        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
        /*SetEntityActive("invisWall", false);
        SetEntityActive("blockArea", false);*/
    }
    AddEntityCollideCallback("Player", "EnemyTriggerArea", "EnteredEnemyTriggerArea", true, 1);
    AddEntityCollideCallback("Player", "BlockArea", "EnteredBlockArea", true, 1);
    SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true);
    PlaySoundAtEntity("", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
    SetDeathHint("Death", "StairScare");
    SetEntityCallbackFunc("key_1", "OnPickup");
}

void OnEnter() {
}

void OnLeave() {
}

void EnteredEnemyTriggerArea(string &in asParent, string &in asChild, int alState) {
    TriggeredEnemy = true;
    SetEntityActive("servant_grunt_1", true);
    ShowEnemyPlayerPosition("servant_grunt_1");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
}

void EnteredBlockArea(string &in asParent, string &in asChild, int alState) {
    if (HasItem("key_1") == false) {
        SetMessage("CustomStory", "Barrier", 6);
    }
}

void OnPickup(string &in asEntity, string &in type) {
    SetEntityActive("invisWall", false);
    SetEntityActive("blockArea", false);
}

void TriggerSpider(string &in asParent, string &in asChild, int alState) {
    SetEntityActive("spider_1", true);
    FadeOut(0);
}

/*int EnemyLooksForPlayer() {
    if (TriggeredEnemy == true) {
        if (SonRoomArea.contains("Player") == true) {
            AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 5, "");
        } else if (DadRoomArea.contains("Player") == true) {
            AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 5, "");
        }
    }
    return 500;
}*/

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-02-2012, 07:44 AM by eagledude4.)
01-02-2012, 07:27 AM
Find


Messages In This Thread
Please remove - by eagledude4 - 01-02-2012, 04:31 AM
RE: AddEntityCollideCallback - by Khyrpa - 01-02-2012, 04:36 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-02-2012, 04:39 AM
RE: AddEntityCollideCallback - by Khyrpa - 01-02-2012, 04:50 AM
RE: AddEntityCollideCallback - by Statyk - 01-02-2012, 05:20 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-02-2012, 05:41 AM
RE: AddEntityCollideCallback - by Statyk - 01-02-2012, 04:46 AM
RE: AddEntityCollideCallback - by Khyrpa - 01-02-2012, 06:42 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-02-2012, 06:45 AM
RE: AddEntityCollideCallback - by Statyk - 01-02-2012, 07:08 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-02-2012, 07:27 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-03-2012, 12:34 AM
RE: AddEntityCollideCallback - by flamez3 - 01-03-2012, 12:44 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-03-2012, 02:58 AM
RE: AddEntityCollideCallback - by flamez3 - 01-03-2012, 03:14 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-03-2012, 03:22 AM
RE: AddEntityCollideCallback - by Statyk - 01-03-2012, 03:42 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-03-2012, 03:48 AM
RE: AddEntityCollideCallback - by flamez3 - 01-03-2012, 06:09 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-03-2012, 06:10 AM
RE: AddEntityCollideCallback - by flamez3 - 01-03-2012, 08:03 AM
RE: AddEntityCollideCallback - by eagledude4 - 01-03-2012, 05:13 PM
RE: AddEntityCollideCallback - by eagledude4 - 01-11-2012, 10:02 PM
RE: AddEntityCollideCallback - by Statyk - 01-11-2012, 10:17 PM
RE: AddEntityCollideCallback - by eagledude4 - 01-11-2012, 10:20 PM
RE: AddEntityCollideCallback - by Statyk - 01-11-2012, 10:21 PM
RE: AddEntityCollideCallback - by eagledude4 - 01-11-2012, 10:38 PM



Users browsing this thread: 1 Guest(s)