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
HPS Files
coldron1 Offline
Junior Member

Posts: 1
Threads: 1
Joined: Jun 2012
Reputation: 0
#1
HPS Files

Hey Guys just want a bit of help with the HPS file Sad Ive programmed a key to unlock a door so far and now i want to trigger that door to close again behind me once i get through the door. I know the scripts but do i add those scripts to the same HPS or another one? also if its same one could you show me how to set one up? Smile
Sorry im new heres what ive got so far...
////////////////////
// Run First time Starting map
void OnStart()
{
AddUseItemCallback("", "Awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("Awesomekey_1");
}

{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
void SetSwingDoorClosed("mansion_1", true, true);
}
(This post was last modified: 06-22-2012, 09:04 PM by coldron1.)
06-22-2012, 09:01 PM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#2
RE: HPS Files

you can setup a script area on the other side of the door use an AddEntityCollideCallback for when the player enters that area the door will close behind them.
something like this
void OnStart()
{
AddEntityCollideCallback("Player", "name of the area here", "CloseDoorFunction", true, 1);
}
void CloseDoorFunction(string &in asParent, string &in asChild, int alState)
{
//you can maybe use 3 different scripts here//
SetSwingDoorClosed("name of your door", true, true);
//or//
AddPropImpulse("name of your door", 0, 0, 10, "World"); //may need to play around with this
AddPropForce("name of your door", 0, 0, 10, "World"); //may need to play around with this
}
06-22-2012, 09:10 PM
Find




Users browsing this thread: 1 Guest(s)