Difference between revisions of "0x0010"
MogHughson (Talk | contribs) |
Sophie-David (Talk | contribs) m (→Use: Clarifying that *Local* variable is used in Field 1) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 19: | Line 19: | ||
|0||Qualify location||00:normal<br>01:out of world<br>02:normal in same room<br>03:along object vector<br>04:lateral to object vector<br>05:in routing slot in Param 0x00 (see operand 10)<br>06:in routing slot in Local 0x00 (see operand 10)<br>07:in literal routing slot 0x00 (see operand 10)<br>08:in global routing slot 0x00 (see operand 10) | |0||Qualify location||00:normal<br>01:out of world<br>02:normal in same room<br>03:along object vector<br>04:lateral to object vector<br>05:in routing slot in Param 0x00 (see operand 10)<br>06:in routing slot in Local 0x00 (see operand 10)<br>07:in literal routing slot 0x00 (see operand 10)<br>08:in global routing slot 0x00 (see operand 10) | ||
|- | |- | ||
− | |1||colspan="2"|qualifier on the variable for Start at | + | |1||colspan="2"|qualifier on the Local variable for '''Start at''' |
|- | |- | ||
− | |2 - bit 1||Controls variable containing object<br>to Find Location For||on: Stack Object, start at [[Sims 2 Local|Local variable]] (see operand 1)<br>off: Variable in operand 4, relative to Variable in operand 7. | + | |2 - bit 1||Controls variable containing object<br>to '''Find Location For'''||on: Stack Object, '''start at''' [[Sims 2 Local|Local variable]] (see operand 1)<br>off: Variable in operand 4, '''relative to''' Variable in operand 7. |
|- | |- | ||
|2 - bit 2||Controls "prefer empty"||off: True<br>on: False (N.B. reversed from usual bit settings) | |2 - bit 2||Controls "prefer empty"||off: True<br>on: False (N.B. reversed from usual bit settings) | ||
Line 53: | Line 53: | ||
|3 - bit 8||NW | |3 - bit 8||NW | ||
|- | |- | ||
− | |4||colspan="2"|Variable containing object to Find Location For. | + | |4||colspan="2"|Variable containing object to '''Find Location For'''. 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 5 and 6 give the [[Byte Order|low and high order byte]] respectively. |
|- | |- | ||
|5 & 6||colspan="2"|qualifiers on the variable from operand 4, eg. Local(0xnnnn) | |5 & 6||colspan="2"|qualifiers on the variable from operand 4, eg. Local(0xnnnn) | ||
|- | |- | ||
− | |7||colspan="2"|"relative to" variable. | + | |7||colspan="2"|'''"relative to"''' variable. 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 8 and 9 give the [[Byte Order|low and high order byte]] respectively. |
|- | |- | ||
|8 & 9||colspan="2"|qualifiers on the variable from operand 7, eg. Local(0xnnnn) | |8 & 9||colspan="2"|qualifiers on the variable from operand 7, eg. Local(0xnnnn) | ||
Line 63: | Line 63: | ||
|10||colspan="2"|Variable for routing slot | |10||colspan="2"|Variable for routing slot | ||
|- | |- | ||
− | | | + | |11 thru 15||colspan="2"|Unused? |
|} | |} | ||
==Problems?== | ==Problems?== | ||
For the most part, with a generic call to Find Location For, I wouldn't expect it to fail. Clearly, no empty tiles or all tiles meeting specified requirement for placement being full would cause a failure. If you have a generic request though and it appears to be failing, the problem may well be with the object that you are attempting to place. I have had errors because my object's Main failed. I suggest testing your object is placeable generally by buying it from the Buy Mode Catalog (temporarily making it buyable if needed) and placing it where you think this instruction should place it, to check all is well with the object. | For the most part, with a generic call to Find Location For, I wouldn't expect it to fail. Clearly, no empty tiles or all tiles meeting specified requirement for placement being full would cause a failure. If you have a generic request though and it appears to be failing, the problem may well be with the object that you are attempting to place. I have had errors because my object's Main failed. I suggest testing your object is placeable generally by buying it from the Buy Mode Catalog (temporarily making it buyable if needed) and placing it where you think this instruction should place it, to check all is well with the object. | ||
+ | |||
+ | You may find that if the '''Find Location For''' variable is not set to the Stack Object, the results are unpredictable. In this case the most common error is that the object you are attempting to place does not appear where it should, but instead the reference object is displaced. | ||
==See also== | ==See also== | ||
*[[Primitives]] | *[[Primitives]] | ||
*[[SimAntics]] | *[[SimAntics]] |
Latest revision as of 20:13, 24 October 2011
Find Location For | ||
---|---|---|
OpCode: | 0x0010 | |
Game Version: | The Sims 2 |
Contents |
[edit] Overview
This primitive provides a way to place an object inside the simulation from SimAntics. For example, if you just want to find an empty floor tile for an object, rather than putting the object on a table where you would likely use the Snap Into primitive.
[edit] Use
There is no instruction wizard for this instruction, so the following table details the meaning of each of the operands.
Operand | Description | Operand Values |
---|---|---|
0 | Qualify location | 00:normal 01:out of world 02:normal in same room 03:along object vector 04:lateral to object vector 05:in routing slot in Param 0x00 (see operand 10) 06:in routing slot in Local 0x00 (see operand 10) 07:in literal routing slot 0x00 (see operand 10) 08:in global routing slot 0x00 (see operand 10) |
1 | qualifier on the Local variable for Start at | |
2 - bit 1 | Controls variable containing object to Find Location For |
on: Stack Object, start at Local variable (see operand 1) off: Variable in operand 4, relative to Variable in operand 7. |
2 - bit 2 | Controls "prefer empty" | off: True on: False (N.B. reversed from usual bit settings) |
2 - bit 3 | Controls "user editable" | off: False on: True |
2 - bit 4 | Controls "facing" | Compass direction set using operand 3 |
2 - bit 5 | Controls "on level ground" | off: False on: True |
2 - bit 6 | Controls "with empty border" | off: False on: True |
2 - bit 7 | Controls "begin in front of refobj" | off: False on: True |
2 - bit 8 | Controls "with line of sight to center" | off: False on: True |
3 - bit 1 | Compass direction for "facing". It appears you can set on multiple bits, but I haven`t tried it out to see what it means if you do |
N |
3 - bit 2 | NE | |
3 - bit 3 | E | |
3 - bit 4 | SE | |
3 - bit 5 | S | |
3 - bit 6 | SW | |
3 - bit 7 | W | |
3 - bit 8 | NW | |
4 | Variable containing object to Find Location For. 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 5 and 6 give the low and high order byte respectively. | |
5 & 6 | qualifiers on the variable from operand 4, eg. Local(0xnnnn) | |
7 | "relative to" variable. 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 8 and 9 give the low and high order byte respectively. | |
8 & 9 | qualifiers on the variable from operand 7, eg. Local(0xnnnn) | |
10 | Variable for routing slot | |
11 thru 15 | Unused? |
[edit] Problems?
For the most part, with a generic call to Find Location For, I wouldn't expect it to fail. Clearly, no empty tiles or all tiles meeting specified requirement for placement being full would cause a failure. If you have a generic request though and it appears to be failing, the problem may well be with the object that you are attempting to place. I have had errors because my object's Main failed. I suggest testing your object is placeable generally by buying it from the Buy Mode Catalog (temporarily making it buyable if needed) and placing it where you think this instruction should place it, to check all is well with the object.
You may find that if the Find Location For variable is not set to the Stack Object, the results are unpredictable. In this case the most common error is that the object you are attempting to place does not appear where it should, but instead the reference object is displaced.