The Panther Dynamics Blog

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!

Expressions

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

Yes, expressions, but not as in:
:-)
[^^,]
('c ',)
or even
q^_^p

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!!!!!!!!

Sources:
 - JESUS
 - http://wiki.blender.org/index.php/Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expression
 - http://wiki.blender.org/index.php/Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expressions
 - http://www.tutorialsforblender3d.com/LogicBricks/Controllers/Expression/Expression_Controller.html
 - http://www.tutorialsforblender3d.com/LogicBricks/Controllers/Expression/Expression_Controller_Examples.html

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

About Me


Marius Oberholster Hey! I've been doing this full-time since July of 2011. It has been an incredible learning experience, not only learning how Blender works (still learning), but also about Open-Source and the incredible software available. ----------- This Blog will be a way to stay up to date on all things Panther Dynamics as well as some personal stuff as well.

LivingWaters movies:

The Living Waters ministry kindly allow people to post these, so you too may benefit from them! :D
GOD Bless you! Please share these!

Wanna see more, check out the portfolio:

Make a free website with Yola