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
Help a newbie with an HPS file?
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: Help a newbie with an HPS file?

Alright, I see where you went wrong. You can't stuff more information into 1 callback than what is allowed; you put 2 items (keys) and 2 entities (doors in this case) into 1 callback (AddUseItemCallback). Also, the syntax (stuff inside the parentheses) for UsedKeyOnDoor is wrong. This needs to be 2 callbacks and 2 functions, not one. Also, is it irondoor_key or irondoorkey? You have 2 different names.

Anyways, here's the revised script:


void OnStart()
{
AddUseItemCallback("", "irondoor_key", "irondoor" "use_iron_key", true);
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "use_monster_key", true);
}

void use_iron_key(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("irondoor" false, true);
PlaySoundAtEntity("", "unlock_door", "irondoor" 0, false);
RemoveItem("irondoor_key");
}

void use_monster_key(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem("monsterdoorkey_1");
}

I rate it 3 memes.
06-29-2012, 05:45 PM
Find


Messages In This Thread
Help a newbie with an HPS file? - by lbrosious96 - 06-29-2012, 05:28 PM
RE: Help a newbie with an HPS file? - by Cruzore - 06-29-2012, 05:42 PM
RE: Help a newbie with an HPS file? - by Adny - 06-29-2012, 05:45 PM
RE: Help a newbie with an HPS file? - by ApeCake - 06-29-2012, 10:20 PM



Users browsing this thread: 1 Guest(s)