Difference between revisions of "Has-attribute Condition"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
imported>Andri
Line 4: Line 4:
 
<tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Definition:</b></td>
 
<td align="left" valign="top" width="80"><b>Definition:</b></td>
<td align="left" valign="top" width="100%">The <strong>Has-attribute</strong> condition checks if the agent in the direction specified by the Direction parameter has the Attribute named in the condition's pop-up field. If the specified agent has selected Attribute, the condition is true. Otherwise, it is false.</td>
+
<td align="left" valign="top" width="100%">The <strong>Has-attribute</strong> condition checks if the agent in the direction specified by the [[Direction parameter]] has the attribute selected in the condition's [[Attribute name parameter|attribute name]] pop-up field. If the specified agent has selected Attribute, the condition is true. Otherwise, it is false.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
<td align="left" valign="top" width="100%">[[Attribute name parameter|attribute name pop up]]</td>
+
<td align="left" valign="top" width="100%">[[Attribute name parameter|attribute name]]</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>

Revision as of 20:44, 17 June 2011

150px

Definition: The Has-attribute condition checks if the agent in the direction specified by the Direction parameter has the attribute selected in the condition's attribute name pop-up field. If the specified agent has selected Attribute, the condition is true. Otherwise, it is false.
Parameters: attribute name
Example: In the Ultimate Pacman project, the Red Ghost agent checks if the agent above it has the attribute p. It then compares this attribute p to the current maxp (the maximum p) and, if p is greater, sets maxp to p. The Red Ghost then changes its facial expression to look as if it is going upwards. This is part of the behavior for tracking down the Pacman agent (see the Ultimate Pacman "Readme" file for a complete explanation of the tracking behavior). 500px