Expressions....Houston, we have a problem.


(bmax) #1

yes we do, and tell me why the hell this expression REFUSES to evaluate the value of the fucking timer!!!

http://tomhebel.www3.dotnetplayground.com/TimerProblem.jpg


(S_W) #2

I’m not sure, but I think you have to write “PowerTimer == 3”. This should be the operator for equals to.


(gorgan_almi) #3

Yeah S_W’s right there. python treats a single equals sign as an assignment, and a double equals sign as a test for equality.

Keith. 8)


(wiseman303) #4

That still won’t work. The timer might be 2.9857 on one frame, and 3.0162 on the next, and never equal 3. You need to put in your expression:

PowerTimer >= 3


(Pooba) #5

Yeah, wiseman’s right there. When i was using a timer property i ahd to use an interval property sensor.

Pooba


(bmax) #6

thanx guys, tried the “==” already (yes, i know about that, i program in java), but thanx for the tip… :smiley:


(bmax) #7

nope

PowerTimer>=3

doesnt work


(Peter) #8

I guess you have a Always sensor attached to the expression, set it to TRUE PULSE mode. http://hem.bredband.net/petryl/images/pulse.jpg


(bmax) #9

indeed i do! thanx for the tip! it works, but now this doesnt work:


(PowerTimer>=5)&&(PowerPreset==5)

I tried all combinations of this expression, it just doesnt work! :x


(bmax) #10

oops, just noticed i didnt have that expression hooked up to anything… :-?


(doogs) #11

Wow you shouldnt say in the topic “expression problems” :wink: maybe… connecting logic brick problems :wink:


(Pooba) #12

BTW, the expression controller doesn’t use python (i don’t think) and just a plain = works just fine.

Pooba