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 what is wrong in my script
EpicLisbe Offline
Junior Member

Posts: 13
Threads: 4
Joined: Dec 2011
Reputation: 0
#5
RE: Help what is wrong in my script

(12-28-2011, 01:02 AM)Your Computer Wrote:
(12-28-2011, 12:35 AM)EpicLisbe Wrote: can you show me the right script because i am amateur scripter and i think its not unlocking when i pickup because the rust_1 is supposed to unlock prisondoor not key_1.

Well, this is what you did that makes picking up the key unlock the prisondoor:

You set a callback to "key_1" with SetEntityCallbackFunc in OnStart; the callback being OnPickup. SetEntityCallbackFunc calls the callback when interacting with the item specified. Therefore upon interacting with the key, in this case picking up the key, the callback, OnPickup, gets called.

If we look inside the OnPickup function, we see SetSwingDoorLocked("prisondoor_1", false, true). You passed in false for the second argument. This tells the game to unlock the door called "prisondoor_1". So, all the player has to do is interact with "key_1" in order to unlock the door "prisondoor_1".

The only way to correct your code is for you to understand what you are telling the game to do. This requires understanding of every function you are making use of, starting with OnStart. You can read the descriptions of most of the other functions used here: http://wiki.frictionalgames.com/hpl2/amn..._functions That should at least provide you with basic understanding of their use.
TY SO MUCH. never tought it would be so easy! Shy


12-28-2011, 01:48 AM
Find


Messages In This Thread
Help what is wrong in my script - by EpicLisbe - 12-27-2011, 08:22 PM
RE: Help what is wrong in my script - by EpicLisbe - 12-28-2011, 01:48 AM
RE: Help what is wrong in my script - by Apjjm - 12-30-2011, 03:27 PM



Users browsing this thread: 1 Guest(s)