Difference between revisions of "0x000B"

From SimsWiki
Jump to: navigation, search
(Use)
(Use)
 
(2 intermediate revisions by one user not shown)
Line 21: Line 21:
 
|2 - bit 1||Which variable||off: Me<br>on: Variable defined in operand 3
 
|2 - bit 1||Which variable||off: Me<br>on: Variable defined in operand 3
 
|-
 
|-
|3||colspan="2"|Variable containing the object to find the distance away from the Stack Object. The choices are any of the many [[Sims 2 Variables|variables and attributes]] that are part of [[SimAntics]]. Where the variable type can have many of them, e.g. Local variables, operands 4 and 5 give the low and high order byte respectively.
+
|3||colspan="2"|Variable containing the object to find the distance away from the Stack Object. The choices are any of the many [[Sims 2 Variables|variables and attributes]] that are part of [[SimAntics]]. Where the variable type can have many of them, e.g. Local variables, operands 4 and 5 give the [[Byte Order|low and high order byte]] respectively.
 
|-
 
|-
|4 & 5||colspan="2"|qualifiers on the variable in operand 2.
+
|4 & 5||colspan="2"|qualifiers on the variable in operand 3.
 
|-
 
|-
 
|6 - bit 1||colspan="2"|Unused
 
|6 - bit 1||colspan="2"|Unused
Line 31: Line 31:
 
|7 thru 15||colspan="2"|Unused
 
|7 thru 15||colspan="2"|Unused
 
|}
 
|}
 +
 +
==Examples==
 +
* [[BHAV:Find nearest|Finding the nearest object of a certain category]]
  
 
==See also==
 
==See also==
 
*[[Primitives]]
 
*[[Primitives]]
 
*[[SimAntics]]
 
*[[SimAntics]]

Latest revision as of 15:38, 24 April 2011

Distance
OpCode:0x000B
Game Version:The Sims 2


Contents

[edit] Overview

This primitive provides a way to discover the distance between two objects, handy for finding the nearest desk for example. The discovered distance is always placed in a temporary variable and the distance is between the object held in the Stack Object and a nominated other variable.

[edit] Use

There is no instruction wizard for this instruction, so the following table details the meaning of each of the operands.

Operand editing
Operand Description Operand Values
0 & 1 qualifiers on the temporary variable which will be returned the distance
2 - bit 1 Which variable off: Me
on: Variable defined in operand 3
3 Variable containing the object to find the distance away from the Stack Object. The choices are any of the many variables and attributes that are part of SimAntics. Where the variable type can have many of them, e.g. Local variables, operands 4 and 5 give the low and high order byte respectively.
4 & 5 qualifiers on the variable in operand 3.
6 - bit 1 Unused
6 - bit 2 Controls "in 1/100ths tile" off: False
on: True
7 thru 15 Unused

[edit] Examples

[edit] See also

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox