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
Boolean Type
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#1
Thumbs Down  Boolean Type

What is "boolean"? Because I'm trying to make an enemy loop between 18 path nodes, but there is a fatal error...


for (int i = 1; i <11; i++)
{
int x = i;
if (i == 1)
{
x = 2;
}
if (i = 18)
{
x = 4;
}
if (i != 1 || i != 18)
{
x = 0;
}
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1"+17, 18, "");
}

It says that there it needs to be something of boolean type, and I don't know what is it... Please, help?!
(This post was last modified: 12-05-2011, 06:59 PM by Victor.)
12-05-2011, 04:27 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#2
RE: Boolean Type

Boolean is a variable type whose variables can only assume two values, true or false.

A boolean is declared and assigned as follows:

PHP Code: (Select All)
bool bRandomVar true//declaration and initialization of bRandomVar
bRandomVar false//Assigning false to the bRandomVar Boolean variable. 



Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
12-05-2011, 08:04 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Boolean Type

The issue is if (i = 18). Instead of providing a boolean operator, you made a declaration within the if statement.

Tutorials: From Noob to Pro
(This post was last modified: 12-06-2011, 01:58 AM by Your Computer.)
12-06-2011, 01:58 AM
Website Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#4
RE: Boolean Type

Nice perception.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
12-06-2011, 04:18 PM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#5
RE: Boolean Type

(12-06-2011, 01:58 AM)Your Computer Wrote: The issue is if (i = 18). Instead of providing a boolean operator, you made a declaration within the if statement.
How can I repair this issue?
12-07-2011, 12:43 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#6
RE: Boolean Type

if( i == 18)

= is an assignment operator and doesn't give a boolean result.
== is a comparison operator and does give a boolean result.

12-07-2011, 01:00 AM
Website Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#7
RE: Boolean Type

(12-07-2011, 01:00 AM)Tanshaydar Wrote: if( i == 18)

= is an assignment operator and doesn't give a boolean result.
== is a comparison operator and does give a boolean result.
Thanks a lot!
12-07-2011, 01:32 AM
Find




Users browsing this thread: 1 Guest(s)