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!
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: HELP!

2 main issues:

Lock Door isn't a valid string; you should never use spaces in the middle of a string name, just use underscores "_". I changed it to locked_door in the hps file; you should use that name in the level editor.

All callbacks (AddUseItemCallback, EntityCollideCallback, etc) go under void OnStart().


Here's a revision:


void OnStart()
{
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
AddUseItemCallback("", "key", "locked_door", "KeyOnDoor", true); ///not Lock Door
}


void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("boom", 0);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door", false, true);
PlaySoundEntity("", "unlock_door", "locked_door", 0, false);
RemoveItem("key");
}


void OnEnter()
{


}


void OnLeave()
{


}


Hope that helped!

I rate it 3 memes.
(This post was last modified: 08-25-2012, 04:54 AM by Adny.)
08-25-2012, 04:53 AM
Find


Messages In This Thread
HELP! - by ryan223456 - 08-25-2012, 04:45 AM
RE: HELP! - by Adny - 08-25-2012, 04:53 AM
RE: HELP! - by ryan223456 - 08-25-2012, 05:50 PM
RE: HELP! - by FlawlessHappiness - 08-25-2012, 06:26 PM



Users browsing this thread: 1 Guest(s)