The Blog

About Me

Marius Oberholster Hey! I'm having an incredible learning experience, not only learning how Blender works (yes, still learning), but also about Open-Source and the incredible software available. Stick around!


Posted by Marius Oberholster on Monday, January 20, 2014 Under: Quick Blog Tutorial
Hey all!!

Yes, expressions, but not as in:
('c ',)
or even

No, we're talking, the expressions we use in programming! Oh yes, we're going to get to grips with some of it today!

An expression is something that acts as a filter. It can be explained as follows:

I want something to go through, only when it is in a certain range, for example:

I have a speedometer, but the steering should have no effect on movement below a certain speed. Now, I'm going to write something like this in the expression controller:
speed > 10 AND speed < 250

Now, when the following is aligned:
Property > Expressions > Action

The property will be set to detect any property change and only when speed changes, the expression is checked. If the expressions passes as true, unless tested for false, in which case the expression still needs to be valid, then, and only then will the action take place.

Let me explain it like this, the game has 60 logic tics a second, so this is how often, for example, the game checks the property, to see if it has changed:

When the property changes, it happens only so many times in the course of the game:

But, the expression is only valid for a few of those changes or in this case, speed's changes:

So you can see, an expression acts like a filter, to deter the actuator from functioning more often than it should. The same goes for the other controllers. They are there to act as filters or channels. Some are more open than others, but they all determine the flow or outcome of the sensor's activity and validity.

In the expression controller, you can use the following (All-caps is not required btw):
 - Property names without spaces
 - *, /, +, -, ()
 - And, Or, Not, If
 - <, >, >=, <=, =, !=
 - Numbers
 - True and False
 - Quotes for grammatical or lingual testings, ie, testing if a string contains a certain letter or combination, like for battleship

And that's it for this little QBT! I really hope this helps you overcome some issues you've had with your games and that you will now be able to make those actuators only fire when they need to; no more misfires!

Have a wonderful day everyone!!

Thank YOU!!!!!!!!


In : Quick Blog Tutorial 

Tags: jesus  qbt  new  controller  expression  and  true  false  god  real  know jesus 

"For I testify unto every man that heareth the words of the prophecy of this book, If any man shall add unto these things, God shall add unto him the plagues that are written in this book:
And if any man shall take away from the words of the book of this prophecy, God shall take away his part out of the book of life, and out of the holy city, and from the things which are written in this book.
He which testifieth these things saith, Surely I come quickly. Amen. Even so, come, Lord Jesus.
The grace of our Lord Jesus Christ be with you all. Amen."
Revelation 22:18-21

"Add thou not unto his words, lest he reprove thee, and thou be found a liar."
Proverbs 30:6

King James Version, Public Domain

Ultimate Glory

I give glory to, acknowledge and remember God for this website. He enabled me to do all this and this website belongs to Him. Thank You!


Make a free website with Yola