0x0032

From SimsWiki
Revision as of 12:00, 14 August 2006 by Jaxad0127 (Talk | contribs)

Jump to: navigation, search
This article is imported from the old MTS2 wiki. You can help Sims2Wiki by cleaning it up. It's original page with comments can be found at http://old_wiki.modthesims2.com/0x0032

This primitive is used in the guardian to either change the name of the interaction in the pie menu, or add options via plugins. Basically it sets the menu option for whatever the stack object is in the check tree of an interaction.

This works the same as in TS1, except that you no longer have to specify the string 302, or 12E(Hex) for the string used. This primitive automatically references to the text reference 12E, and the id of this string is in operand 04(remember that 01 will mean id 0, 02 would be id 1, et. al.).

Here is an example where it just changes the name of the menu option depending upon age:

(Interaction - Use - Test) 0:My Person Data Age > 18 1,2 1:Add/Change Action String:0(0x32:00 00 00 00 01 00 00 00 - 00 00 00 00 00 00 00 00) true,error 2:Add/Change Action String:1(0x32:00 00 00 00 02 00 00 00 - 00 00 00 00 00 00 00 00) true,error

Because the stack object by default in a check tree is the object that the sim is interacting with, this will just change the pie-menu option for using this object.

However Set-To-Next-Loops can provide a whole new usage to this function. In this example, I will show how multiple stack objects can add menu options to a single object. This is very useful for making patches that allow for plugin upgrades, so that anyone can add to your patches without conflicts. Here is an example of a basic Set-To-Next-Loop with menu options automatically being added:

0:Local Var 0 Assign to: 0 1,error 1:Local Var 1 Assign to: Stack Object ID 2,error 2:Stack Object ID Assign to: 0 3,error 3:Set to Next(object) 4,7 4:Run Tree By Name:(CT - My Object) 5,3 5:Add/Change Action String:0 6,error 6:Local Var 0 Assign to: 1 3,error 7:Stack Object Assign to Local Var 1 8,error 8:Local Var 0 Equals: 1? true,false

in this case, CT - My object would be a string in the text list 12f using the Run Tree By Name primitive, and thus would search for any object that had a behavior function with that name in it, and because it would be a new stack object, it would not change the name of the interaction, but add the menu option with the specified string in 12E of the id defined in operand 04 of the primitive(remember that 01 will mean id 0, 02 would be id 1, et. al.)

Note: The object id of the menu object selected from the pie menu will be stored in Parameter 0 of the action tree.

See also

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox