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
How to place several scripts in the .hps file
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: How to place several scripts in the .hps file

This is how your script works.

void OnStart
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFTHEDOOR", "NAMEOFFUNCTION", true);
}

void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
PlaySoundAtEntity("", "NAMEOFSOUND", "NAMEOFDOOR", 0, false);
RemoveItem(asItem);
}

AddUseItemCallback is used to be able to use an item on the world for example a key on a door or a knife on a corpse or what ever.

SetSwingDoorLocked is used to unlock the door but to unlock it you need to check the Locked on the Door in the level editor.

PlaySoundAtEntity plays a sound at the entity of your choice, can be the player, a script area or just an entity.

RemoveItem removes the item or in this case, the key.

I would suggest you look at Elven and YourComputer's video tutorials Smile

Elven:
http://wiki.frictionalgames.com/hpl2/tut...ng/article

YourComputer:
http://www.youtube.com/user/ThisIsYourComputer

(This post was last modified: 03-27-2012, 03:22 PM by SilentStriker.)
03-27-2012, 03:18 PM
Find


Messages In This Thread
RE: How to place several scripts in the .hps file - by SilentStriker - 03-27-2012, 03:18 PM



Users browsing this thread: 1 Guest(s)