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
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#6
RE: Problem with door closing

(10-13-2014, 09:33 PM)Mudbill Wrote: Just as a side note, the original boolean statements were correct. You don't explicitly need to define a true or false to the boolean in question. If undefined, it assumes true. Another way of doing false would be do to
PHP Code: (Select All)
if(!HasItem("Name")) 

This.

Actually, the reason this works is because the "if" statement is checking whether the whole condition (the entire contents of the brackets) works out as "true", eg:

if(true)
if(!false)
if(1 + 1 == 2)
if(2 == 2)
if(x == x)
if(false == false)
if(false != true)
if(false == !true)
if((false == true) == (true == false))
if((false == !true) == (true == !false))
if(StringToBool("true"))

...are all different ways of saying "if(true)", and the condition would pass.

(This post was last modified: 10-13-2014, 10:25 PM by MrBehemoth.)
10-13-2014, 10:17 PM
Find


Messages In This Thread
Problem with door closing - by Spazatron - 10-13-2014, 05:18 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)