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
Problem with door closing
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Problem with door closing

You've got the idea, but you forgot to check if it's true or false that you have it...

if you go here:
http://wiki.frictionalgames.com/hpl2/amn..._functions
You'll notice that "HasItem" requires a bool. (It says 'bool' to the left of it).

A bool is either "true" or "false".

So, to make your script correct, it should look like this.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""enabledoorscript""DoorScript"false1); //area to check if the door should close or not depending on if the player has items
}

void DoorScript(string &in asParentstring &in asChildint alState)
{
    if(
HasItem("ITEM1") == true && HasItem("ITEM2") == true && HasItem("ITEM3") == true//checking for items
    
{
        
SetSwingDoorLocked("door1"truetrue); //lock the door when true
    
}


This should work.

I also added some adjustments

Trying is the first step to success.
(This post was last modified: 10-13-2014, 05:40 PM by FlawlessHappiness.)
10-13-2014, 05:39 PM
Find


Messages In This Thread
Problem with door closing - by Spazatron - 10-13-2014, 05:18 PM
RE: Problem with door closing - by FlawlessHappiness - 10-13-2014, 05:39 PM
RE: Problem with door closing - by Spazatron - 10-13-2014, 06:03 PM
RE: Problem with door closing - by MrBehemoth - 10-13-2014, 11:48 PM
RE: Problem with door closing - by Mudbill - 10-13-2014, 09:33 PM
RE: Problem with door closing - by MrBehemoth - 10-13-2014, 10:17 PM
RE: Problem with door closing - by Mudbill - 10-13-2014, 11:15 PM



Users browsing this thread: 1 Guest(s)