# can anyone explain this? (Read 1021 times)

Started by Alchemist, November 25, 2008, 07:49:03 pm

#### Alchemist

##### can anyone explain this?
#1  November 25, 2008, 07:49:03 pm
• Welcome to Die!
So just skimming through other creators code as you do from time to time when I stumbled upon this line of code:

value = ifelse((var(1) != 0), var(1), (50 * (StateType = a)))

what does 50*statetype mean? I don't see how that works unless each statetype is given a value but where in the docs does it tell you that?  how can you multiply a stateype by 50, what would that equate to  ???

Alchemist AKA Alcheymyst AKA H.F.C Alchey

#### Bastard Mami

##### Re: can anyone explain this?
#2  November 25, 2008, 08:00:46 pm
• [E]

• Online
You are missing one part, it is not 50*statetype, it is 50 * (statetype=a).

#### Alchemist

##### Re: can anyone explain this?
#3  November 25, 2008, 08:09:12 pm
• Welcome to Die!
hmmmmmm, I thought the expression multiplies the outside by the inside, like standard algebra, but still what exactly was trying to be expressed here? what was the need for the statetype=a ?

Alchemist AKA Alcheymyst AKA H.F.C Alchey

#### Byakko

##### Re: can anyone explain this?
#4  November 25, 2008, 09:06:33 pm
"statetype = a" returns 1 if the statetype is indeed a. Otherwise, it returns 0.
This means that "50 * (statetype = a)" equals 0 if you're not in the air, or 50 if you are.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

#### Alchemist

##### Re: can anyone explain this?
#5  November 25, 2008, 09:20:37 pm
• Welcome to Die!
Thanks