﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Doc%3A2.6%2FManual%2FGame_Engine%2FLogic%2FControllers%2FExpression</id>
	<title>Doc:2.6/Manual/Game Engine/Logic/Controllers/Expression - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Doc%3A2.6%2FManual%2FGame_Engine%2FLogic%2FControllers%2FExpression"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expression&amp;action=history"/>
	<updated>2026-04-26T13:28:37Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expression&amp;diff=137483&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expression&amp;diff=137483&amp;oldid=prev"/>
		<updated>2018-06-28T20:50:09Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 20:50時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expression&amp;diff=137482&amp;oldid=prev</id>
		<title>2012年10月1日 (月) 12:50にwiki&gt;Sculptorjimによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Logic/Controllers/Expression&amp;diff=137482&amp;oldid=prev"/>
		<updated>2012-10-01T12:50:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Page/Header|2.6|Doc:2.6/Manual/Game Engine/Logic/Controllers}}&lt;br /&gt;
&lt;br /&gt;
= Expression Controller =&lt;br /&gt;
This controller evaluates a user written expression, and gives a positive (TRUE) output when&lt;br /&gt;
;The result of the expression is TRUE, and&lt;br /&gt;
;The object is in the designated State.&lt;br /&gt;
:For all other conditions the controller gives a negative (FALSE) output.&lt;br /&gt;
&lt;br /&gt;
[[File:BGE_Controller_Expression.png|right|thumb|292px|Expression Controller]]&lt;br /&gt;
;'''Expression'''&lt;br /&gt;
;The expression, which is written in the box, can consist of variables, constants and operators.  These must follow the rules laid out below.&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
You can use:&lt;br /&gt;
&lt;br /&gt;
* '''sensors names''',&lt;br /&gt;
* '''properties''': assign a game property to an object and use it in a controller expression.&lt;br /&gt;
&lt;br /&gt;
These cannot contain blank spaces.&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
=== Mathematical operations ===&lt;br /&gt;
&lt;br /&gt;
Operators: *, /, +, -&lt;br /&gt;
&lt;br /&gt;
Returns: a number&lt;br /&gt;
&lt;br /&gt;
Examples: 3 + 2, 35 / 5&lt;br /&gt;
&lt;br /&gt;
=== Logical operations ===&lt;br /&gt;
&lt;br /&gt;
* Comparison operators: &amp;lt;, &amp;gt;, &amp;gt;=, &amp;lt;=, ==, !=&lt;br /&gt;
* Booleans operators: AND, OR, NOT&lt;br /&gt;
&lt;br /&gt;
Returns: True or False.&lt;br /&gt;
&lt;br /&gt;
Examples: 3 &amp;gt; 2 (True), 1 AND 0 (False)&lt;br /&gt;
&lt;br /&gt;
== Conditional statement (if) ==&lt;br /&gt;
&lt;br /&gt;
Use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
if( expression, pulse_if_expression_is_true, pulse_if_expression_is_false )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the controller evaluates '''&amp;lt;code&amp;gt;expression&amp;lt;/code&amp;gt;''' to True:&lt;br /&gt;
* if '''&amp;lt;code&amp;gt;pulse_if_expression_is_true&amp;lt;/code&amp;gt;''' is &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;, the controller sends a positive pulse to the connected actuators.&lt;br /&gt;
* if '''&amp;lt;code&amp;gt;pulse_if_expression_is_true&amp;lt;/code&amp;gt;''' is &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt;, the controller sends a negative pulse to the connected actuators.&lt;br /&gt;
&lt;br /&gt;
If the controller evaluates '''&amp;lt;code&amp;gt;expression&amp;lt;/code&amp;gt;''' to False:&lt;br /&gt;
* if '''&amp;lt;code&amp;gt;pulse_if_expression_is_false&amp;lt;/code&amp;gt;''' is &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;, the controller sends a positive pulse to the connected actuators.&lt;br /&gt;
* if '''&amp;lt;code&amp;gt;pulse_if_expression_is_false&amp;lt;/code&amp;gt;''' is &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt;, the controller sends a negative pulse to the connected actuators.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Given the object has a property '''&amp;lt;code&amp;gt;coins&amp;lt;/code&amp;gt;''' equal to 30: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
coins &amp;gt; 20&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns True (the controller sends a positive pulse to the connected actuators).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Given the object has:&lt;br /&gt;
* a sensor called '''&amp;lt;code&amp;gt;Key_Inserted &amp;lt;/code&amp;gt;''' equal to True,&lt;br /&gt;
* a property named '''&amp;lt;code&amp;gt;Fuel&amp;lt;/code&amp;gt;''' equal to False, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
Key_Inserted AND Fuel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns False (the controller sends a negative pulse to the connected actuators).&lt;br /&gt;
&lt;br /&gt;
This is the same as doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
if (Key_Inserted AND Fuel, True, False)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead, you could do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
if (Key_Inserted AND Fuel, False, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to return a positive pulse when '''&amp;lt;code&amp;gt;Key_Inserted AND Fuel&amp;lt;/code&amp;gt;''' returns False.&lt;br /&gt;
&lt;br /&gt;
You can also do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
if ((Key_Inserted AND Fuel) OR (coins &amp;gt; 20), True, False)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This expression returns True, hence in this case the controller sends a positive pulse to the connected actuators.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game engine]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Sculptorjim</name></author>
		
	</entry>
</feed>