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
Scripting Problems !
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Scripting Problems !

I'll give you some examples based upon what you want to do. For starters, you can find all the script functions you need here: http://wiki.frictionalgames.com/hpl2/amn..._functions

Now, to tackle your key problem, you simply need to place an AddUseItemCallback into your OnStart() function. The parameters you need will be shown in the wiki.

EXAMPLE (I placed descriptions in [], so you can replace those with what you need.
void OnStart()
{
AddUseItemCallback("[Can leave this blank]", "[Name of the key]", "[Name of the Door], [Function to call when item is used]", [leave as either true or false, depending if you want the key to disappear]);
}
void UnlockDoor[Has to be what you placed in your adduseitemcallback](string &in asItem, string &in asEntity)[this blurb is simply proper syntax to make your function work. It tells you this in the wiki]
{
SetSwingDoorLocked("[Name of Door]", [True locks the door, false unlocks door], [True or false, depending if you want effects used]);

}
To make your insanity effects work, you simply need to add a
SetEntityPlayerInteractCallback for when an item is interacted with
or
AddEntityCollideCallback for when you want the player to walk into an area.

Be sure to have all names match up perfectly in the level editor. Also note that on the Entities, you can set up an interact callback without having to place it in your OnStart function.

Hopefully this helps you!



09-12-2011, 05:52 PM
Find


Messages In This Thread
Scripting Problems ! - by AmnesiaIsScary :S - 09-12-2011, 02:39 PM
RE: Scripting Problems ! - by Obliviator27 - 09-12-2011, 05:52 PM
RE: Scripting Problems ! - by Itskody - 09-12-2011, 06:04 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-13-2011, 07:40 PM
RE: Scripting Problems ! - by Itskody - 09-13-2011, 08:02 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-13-2011, 08:19 PM
RE: Scripting Problems ! - by Itskody - 09-14-2011, 12:35 AM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:52 AM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 04:10 PM
RE: Scripting Problems ! - by Your Computer - 09-14-2011, 04:24 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:16 PM
RE: Scripting Problems ! - by Your Computer - 09-14-2011, 05:22 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:25 PM



Users browsing this thread: 2 Guest(s)