Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Naming the variable

13 years ago
Alright for some odd reason i can't figure out how to name the variable. Where it says the word SCORE i think that's where you name it but it's not letting me! Somebody tell me how to work this !@#$%^&^%$#%#^&%%^$#%^#$$^^&^%$@^@%^@#%!@%^ thingamajig. (just tell me how to change the name... pretty please?)

Naming the variable

13 years ago
Ahhhh nevermind. technology aparently decided to let up and i figured it out.

Naming the variable

13 years ago
Good job on figuring it out! :D

Naming the variable

13 years ago
You mean that you realized that you can add different variables and that score is the only variable that can't be renamed and that it had nothing to do with technology letting up?

hahaha just bugging ya, variables are a tough thing to grasp at first.

Naming the variable

13 years ago

I just hate I can't use underscores in my variable names.

And that theres no easy boolean (though you can use 1 and 0 it's just not the same).

Naming the variable

13 years ago
That's what a boolean is though.

Naming the variable

13 years ago

That's the literal value of a boolean yes, but it's states are "true" and "false". Which to mean just sound better.

(Well technically the states are on and off but whatever)

Naming the variable

13 years ago
In C and Basic and Python, 0 = false and 1 = true

Naming the variable

13 years ago

http://en.wikipedia.org/wiki/Boolean_datatype

Yes those are it's literal values. But when dealing with booleans we say "true" and "false", we don't say "1" and "0".

Naming the variable

13 years ago
According to a mathmatic property.

D=B

IF A+B=C
Then A+D=C

If two things are equal, then they can be used interchangably.

Naming the variable

13 years ago

......So?

I'm not saying the two aren't equal, I'm saying we as humans understand them differently.

If I say the follow:

A - HasApples = True

B - HasApples = 1

I have said the same things, however reading that it's much easier to tell that with the first example I am referring to something that can only be true or false. In the second example it's not so black and white. Since I'm using a number you must rely on the name of the variable to deterimne just what type it is, since I could also be referring to some sort of counter or number based variable.

With A you know that I must mean the player has apples, the amount is irrelevant it just means they have apples.

With B it's not quite as easy, and you may make the mistake of thinking that "HasApples = 1" means the player has 1 apple, rather than meaning the player does have apples.

Of course this can be solved with naming the variable differently, but it doesn't change that fact that true/false is easier to understand than 1/0 as a boolean.

Naming the variable

13 years ago
That's not true, in Basic you can define a variable as a boolean, say it's called bn_test and then say

IF BN_Test = 0 THEN bla bla bla

but in VB and it will evaluate.

Naming the variable

13 years ago
Ah, we're saying the same thing haha

Naming the variable

13 years ago

Yep, I never said they weren't equal lol.

Naming the variable

13 years ago

Basically what I wanted was a way to have a sort of health meter that measured a person's morality throughout the story that would determine the ending that a person got. I figured it out though and finishing up the prolouge as we speak.