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
Noob in trouble!
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#4
RE: Noob in trouble!

I triple-checked your code, and I just cross-checked this with my own code, and I don't see any errors. Here, I'll post what I have:

void OnStart()
{

    //Callbacks
    AddEntityCollideCallback("Player", "Area_Wind", "HallwayWindEvent", true, 1);
    AddEntityCollideCallback("Player", "Area_FallTree", "FallTreeEvent", true, 1);
    
    AddUseItemCallback("keyondoor", "key_study_1", "level_wood_3", "UnlockLevelDoor", true);
    
    SetEntityPlayerInteractCallback("Area_InteractBed", "BedEvent", true);
    
    //Enemy pathnodes, this guy is harmless though
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_4", 0, "");

}

void InteractLevelDoor(string &in asEntity)
{

    AddLocalVarInt("DoorTouched", 1);

    if(HasItem("key_study_1") == true)
    {
        SetMessage("Interact", "Ch01_01_KeyOnDoor", 0);
    }

    if(GetLocalVarInt("DoorTouched") == 1)
    {
        AddQuest("01UnlockEntranceHall", "01UnlockEntranceHall");
    }

}

void UnlockLevelDoor(string &in asItem, string &in asEntity)
{

    PlaySoundAtEntity("unlock", "unlock_door.snt", "level_wood_3", 0.4f, false);
    SetLevelDoorLocked("level_wood_3", false);
    
    RemoveItem("key_study_1");
    CompleteQuest("01UnlockEntranceHall", "01UnlockEntranceHall");

}

I guess you can use that as a reference since that works??? The only problem I can see is that your names or your cache would be wrong/still there. You're getting a "Cannot use item this way!" message?

04-13-2012, 10:59 PM
Find


Messages In This Thread
Noob in trouble! - by Macetrow - 04-13-2012, 07:06 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 07:35 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 07:43 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 10:59 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 11:01 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 11:03 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 11:09 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 11:14 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 11:20 PM
RE: Noob in trouble! - by zombiehacker595 - 04-14-2012, 01:37 AM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 09:41 AM
RE: Noob in trouble! - by zombiehacker595 - 04-14-2012, 10:18 AM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 11:54 AM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 03:55 PM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 04:09 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 04:12 PM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 05:15 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 05:51 PM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 06:01 PM
RE: Noob in trouble! - by DRedshot - 04-14-2012, 06:46 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 07:31 PM
RE: Noob in trouble! - by DRedshot - 04-14-2012, 08:27 PM
RE: Noob in trouble! - by JenniferOrange - 04-14-2012, 09:47 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 09:49 PM
RE: Noob in trouble! - by DRedshot - 04-14-2012, 10:06 PM
RE: Noob in trouble! - by SilentStriker - 04-14-2012, 10:21 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 11:08 PM
RE: Noob in trouble! - by SilentStriker - 04-14-2012, 11:13 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 11:16 PM
RE: Noob in trouble! - by SilentStriker - 04-14-2012, 11:17 PM
RE: Noob in trouble! - by Macetrow - 04-15-2012, 12:43 AM
RE: Noob in trouble! - by SilentStriker - 04-15-2012, 01:08 AM



Users browsing this thread: 1 Guest(s)