Difference between revisions of "0x0001"

From SimsWiki
Jump to: navigation, search
(Reformatted and rewrote intro)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Generic Sims Call==
+
This primitive is used to do things that can't be done with [[SimAntics]], sorta like an operating system call.
This primitive allows the manipulation of many elements of game play which do not have their own primitives, and cannot be achieved in globals. An identifier for the particular task to be run is passed in operand 0, with any remaining data generally stored in Temp variables as described below.
+
  
==Tasks (Operand 0)==
+
==Overview==
 +
The desired call is chosen using the first operand byte. The second maybe used in the future to allow more.
 +
 
 +
==Values==
 +
The avaliable calls vary with the [[expansion pack]].
 +
 
 +
===Original Game Calls===
 
;0x0(0) Exit Lot
 
;0x0(0) Exit Lot
:Exits the lot (for use in Tutorial) - Temp0=neighborhoodID; Temp1=0/leave family in lot, Non-Zero/evict family; Temp2=0/no save lot, Non-Zero/save lot; Temp3=0/no reset tutorial episode, Non-Zero/reset tutorial episode
+
:Exits the lot (for use in Tutorial)
 +
::Temp0
 +
:::neighborhood ID
 +
::Temp1  
 +
:::0 - leave family in lot
 +
:::Nonzero - evict family
 +
::Temp2
 +
:::0 - no save lot
 +
:::Nonzero - save lot
 +
::Temp3
 +
:::0 - no reset tutorial episode
 +
:::Nonzero - reset tutorial episode
 
;0x1(1) center view on stack object
 
;0x1(1) center view on stack object
 
:Centers the main game window on the stack object.
 
:Centers the main game window on the stack object.
Line 17: Line 33:
 
;0x6(6) remove from family
 
;0x6(6) remove from family
 
:Remove the neighbor specified in the stack object from the current family.
 
:Remove the neighbor specified in the stack object from the current family.
;0x7(7) deprecated - make new neighbor
+
;0x7(7) make new neighbor (depreciated)
:No longer implemented. tree error. Make a copy of the neighbor id in the stack object. New neighbor id is also returned in the stack object.
+
:Make a copy of the neighbor id in the stack object. New neighbor id is also returned in the stack object. No longer implemented.
 
;0x8(8) family tutorial complete
 
;0x8(8) family tutorial complete
 
:Marks the family tutorial as being finishes.
 
:Marks the family tutorial as being finishes.
Line 31: Line 47:
 
;0xD(13) abort interactions
 
;0xD(13) abort interactions
 
:Aborts all interactions associated with the stack object.
 
:Aborts all interactions associated with the stack object.
;0xE(14) house radio station := temp 0
+
;0xE(14) house radio station = temp 0
 
:Sets the global house radio station to number provided in temp 0.
 
:Sets the global house radio station to number provided in temp 0.
;0xF(15) My routing footprint := temp 0
+
;0xF(15) My routing footprint = temp 0
 
:Set the footprint extension of me to the value in temp 0
 
:Set the footprint extension of me to the value in temp 0
 
;0x10(16) change normal outfit
 
;0x10(16) change normal outfit
Line 40: Line 56:
 
:Pass in lot ID you want to change to inside of Temp 0
 
:Pass in lot ID you want to change to inside of Temp 0
 
;0x12(18) Set Simulator Speed
 
;0x12(18) Set Simulator Speed
:Pass in temp 0 speed you want. 0 = pause, 1 = unpause, 2 = normal, 3 = fast, 4 = Ultra
+
:Pass in temp 0 speed you want:
 +
::0 - pause
 +
::1 - unpause
 +
::2 - normal
 +
::3 - fast
 +
::4 - ultra
 
;0x13(19) Swap Lot to Lot of Family in NeighborID in temp0
 
;0x13(19) Swap Lot to Lot of Family in NeighborID in temp0
 
:Pass in neighbor ID in temp 0 and lot will get swapped to that family's lot.
 
:Pass in neighbor ID in temp 0 and lot will get swapped to that family's lot.
Line 48: Line 69:
 
:Put a new child in the family tree array, passing in neighbor ID of new child in temp 0 and Parent NID in Temp 1
 
:Put a new child in the family tree array, passing in neighbor ID of new child in temp 0 and Parent NID in Temp 1
 
;0x16(22) Add Spouse to Family Relationship Array
 
;0x16(22) Add Spouse to Family Relationship Array
:Put a new Spouse in the family tree array, passing in neighbor ID of new spouse in temp 0 - temp 1 is neighbor ID of initial Spouse
+
:Put a new Spouse in the family tree array
 +
::temp 0 - neighbor ID of new spouse
 +
::temp 1 - neighbor ID of initial spouse
 
;0x17(23) Remove From Family Relationship Array
 
;0x17(23) Remove From Family Relationship Array
:Remove relationships between two Sims in the family tree array, passing in neighbor ID of Sim to remove in temp 0 - temp 1 is neighbor ID of the relative
+
:Remove relationships between two Sims in the family tree array
 +
::temp 0 - neighbor ID of Sim to remove
 +
::temp 1 - neighbor ID of the relative
 
;0x18(24) Preload New Sim Age
 
;0x18(24) Preload New Sim Age
 
:Given age in temp 0 (Same age range as SetAge Primitive uses), preload resources for this sim.
 
:Given age in temp 0 (Same age range as SetAge Primitive uses), preload resources for this sim.
Line 56: Line 81:
 
:Set the selected sim to the sim person object ID in temp 0
 
:Set the selected sim to the sim person object ID in temp 0
 
;0x1A(26) Start Lot Transition
 
;0x1A(26) Start Lot Transition
:This call will exit the lot (not sure if it saves) and bring up the neighborhood in a mode where you can select a community lot to go to and then load that lot.
+
:This call will exit the lot and bring up the neighborhood in a mode where you can select a community lot to go to and then load that lot. It is uknown whether this saves the current lot.
 
;0x1B(27) Get Number of community lots in temp0
 
;0x1B(27) Get Number of community lots in temp0
:Gets the number of community lots in temp 0
+
:Gets the number of community lots in temp0
 
;0x1C(28) Perform Money Effect
 
;0x1C(28) Perform Money Effect
:If a minus sign is required, make sure the value passed in temp 0 is negative. Temp 2 will contain the multiplier for this value - if it's set to 0 then the code will assume you meant 1.
+
:
 +
::Temp0 - amount (for negative change, this needs to be negative)
 +
::Temp2 - multiplier (0 is taken as 1)
 
;0x1D(29) Preload Visitor
 
;0x1D(29) Preload Visitor
:Temp 0 contains the neighborID of the visitor you wish to preload - preloading takes approx 2 seconds (minimum)
+
:Temp 0 contains the neighborID of the visitor you wish to preload
 +
:preloading takes approx 2 seconds (minimum)
 
;0x1E(30) Preload Clothing
 
;0x1E(30) Preload Clothing
:The outfit to preload is in Temp0 (comes from the drop down in Change Outfit) - takes 1/2 second to preload.
+
:The outfit to preload is in Temp0 (comes from the drop down in Change Outfit)
 +
:takes 1/2 second to preload.
 
;0x1F(31) Preload Object
 
;0x1F(31) Preload Object
 
:Place GUID of object to be loaded in temp0/1 for object to be preloaded on separate thread.
 
:Place GUID of object to be loaded in temp0/1 for object to be preloaded on separate thread.
Line 70: Line 99:
 
:Place outfit Type in Temp0 and this will return how many outfits there are available for that type on the current ME in temp 1
 
:Place outfit Type in Temp0 and this will return how many outfits there are available for that type on the current ME in temp 1
 
;0x21(33) Update Footprint
 
;0x21(33) Update Footprint
:Used when you change intersection flags, to update the path planner with the change
+
:Used when you change intersection flags, to update the path planner with the change. This is called automatically after the init BHAV.
 
;0x22(34) Get Distance Between Lots
 
;0x22(34) Get Distance Between Lots
:Source Lot ID in Temp 0, Destination Lot ID in Temp 1. Returns distance in Temp 2. Lot ID is same as House Number.
+
:Returns distance in Temp 2.
 +
::Temp0 - source lot ID
 +
::Temp1 - destination lot ID
 +
:Lot ID is same as House Number.
 
;0x23(35) Get Zoning Type
 
;0x23(35) Get Zoning Type
:Lot ID in Temp 0. Returns Zoning Type in Temp 1. 0= Residential. 1= Community.
+
:Lot ID in Temp 0. Returns Zoning Type in Temp 1. See [[LOT]] for values.
 
;0x24(36) GetIDOfFamilyInLot
 
;0x24(36) GetIDOfFamilyInLot
 
:Lot ID in Temp 0. Returns ID of the family residing in the lot in Temp 1. If there is no family in lot, Temp 1 will have -1 upon return.
 
:Lot ID in Temp 0. Returns ID of the family residing in the lot in Temp 1. If there is no family in lot, Temp 1 will have -1 upon return.
Line 84: Line 116:
 
:Forces a recalc of whatever the current Sim is. Ensure this is only called when Me is a sim.
 
:Forces a recalc of whatever the current Sim is. Ensure this is only called when Me is a sim.
 
;0x28(40) Game State Transition Control
 
;0x28(40) Game State Transition Control
:If Temp 0 == 0, the below items will be Disabled. If Temp 0 != 0, the below will be Enabled. (This disables/enables: saving, quitting, exiting to the neighborhood, lot transitions, and lot entry.)
+
:This disables/enables: saving, quitting, exiting to the neighborhood, lot transitions, and lot entry.
 +
::Temp 0
 +
:::0 - disabled
 +
:::Nonzero - enabled
 
;0x29(41) Facial Overlay Zits Toggle
 
;0x29(41) Facial Overlay Zits Toggle
:Temp0 == Off (0) / On (1)
+
:Temp0
 +
::0 - off
 +
::Nonzero - on
 
;0x2A(42) Sim Fitness Update
 
;0x2A(42) Sim Fitness Update
 
:Syncs the 3D view of the sim to the simulator body settings (fit, fat, normal)
 
:Syncs the 3D view of the sim to the simulator body settings (fit, fat, normal)
;0x2B(43) Is It Ok to Idle Here
+
;0x2B(43) Is It Ok to Idle Here
 
;0x2C(44) Hide / Unhide Puck
 
;0x2C(44) Hide / Unhide Puck
:Hide or unhide puck based on value in temp 0 - if non zero puck is hidden. Don't try and hide the puck twice without restoring it, that will cause an error
+
:Don't try and hide the puck twice without restoring it, that will cause an error
 +
::Temp0
 +
:::0 - unhide
 +
:::Nonzero - hide
 
;0x2D(45) Copy Last Name  
 
;0x2D(45) Copy Last Name  
:Copy Last name from object id in Temp 0 to Object in Stack object.
+
:Copy last name from object id in Temp 0 to stack object.
 
;0x2E(46) Set Sim Hair Override
 
;0x2E(46) Set Sim Hair Override
:Called on a sim, this will override the current hair the sim is wearing. Temp0 is the table Id, Temp1 is the index Id. This string is the FamilyId to search for in the Skin Catalogue for the override hair (for the given age/gender/haircolor of the sim). If Temp3 is set to 1, fallback to globals can happen if the string isn't found.
+
:Called on a sim, this will override the current hair the sim is wearing.
 +
:This string is the FamilyId to search for in the Skin Catalogue for the override hair (for the given age/gender/haircolor of the sim).
 +
::Temp0 - the table Id
 +
::Temp1 - the index Id
 +
::Temp3 - if set to 1, fallback to globals can happen if the string isn't found
 
;0x2F(47) Clear Sim Hair Override
 
;0x2F(47) Clear Sim Hair Override
 
:Clears any hair overrides present on the sim.
 
:Clears any hair overrides present on the sim.
 
;0x30(48) Get Remapped Neighbor Id
 
;0x30(48) Get Remapped Neighbor Id
:For imported lots (message broadcast would be "import lot"), pass in Temp 0 the old neighbor id, and the remapped/new neighbor id will be set in Temp 1. Will return true if a remapped id is found, false otherwise.
+
:For imported lots (message broadcast would be "import lot"), pass in Temp0 the old neighbor id, and the remapped/new neighbor id will be set in Temp1. Will return true if a remapped id is found, false otherwise.
 
;0x31(49) Can Change Footprint?
 
;0x31(49) Can Change Footprint?
:Tests whether a footprint change would cause intersection with another object's footprint. Pass the footprint index in temp 0.
+
:Tests whether a footprint change would cause intersection with another object's footprint. Pass the footprint index in temp0.
 
;0x32(50) Extract Money From other Lot
 
;0x32(50) Extract Money From other Lot
:Temp 0 if non zero means take money from other lot. Temp 1 contains neighborID of sim from other lot to take money from. Temp 2 contains percentage of money we want to add to this lot. temp3/4 contain the amount of money added to this lot post call. If temp 5 is zero, then we get the money from the funds of the lot the neighborID came from. If it's non zero, then we get the funds from the lot assets of the lot the neighborID came from.
+
:Temp0 - if non zero, take money from other lot
 +
:Temp1 - neighborID of sim from other lot to take money from
 +
:Temp2 - percentage of money we want to add to this lot
 +
:Temp3/4 - contain the amount of money added to this lot post call
 +
:Temp5
 +
::0 - we get the money from the funds of the lot the neighborID came from
 +
::Nonzero - we get the funds from the lot assets of the lot the neighborID came from
 
;0x33(51) Show Info On Lot Loading Screen
 
;0x33(51) Show Info On Lot Loading Screen
:Pass in Temp 0: 1 == to show dialog for NPCs and Townies generation
+
:Pass 1 in Temp0 to show dialog for NPCs and Townies generation
 
;0x34(52) Wall in Front?
 
;0x34(52) Wall in Front?
:Direction in temp 0. Returns true if there is a wall within 1.5 tiles in that direction. Returns first object on that tile in temp 1, if there is a wall.
+
:Direction in temp0. Returns true if there is a wall within 1.5 tiles in that direction. Returns first object on that tile in temp1, if there is a wall.
 
;0x35(53) Set Facial Overlay State
 
;0x35(53) Set Facial Overlay State
:Temp0 is the table Id, Temp1 is the index Id, Temp2 is the state (1 == on, 0 == off), Temp3 can be set to 1 to allow fallback to globals.
+
:Temp0 - the table ID
 +
:Temp1 - the index ID
 +
:Temp2 - state
 +
::0 - off
 +
::Nonzero - on
 +
:Temp3 - 1 means to allow fallback to globals
 +
 
 +
====References====
 +
This data is taken from [[STR#]] [[resource]] 7fe59fd0-000000dc-00000000 in [[objects.package]].
 +
 
 +
===University Added Calls===
 +
;0x36(54) add want slot
 +
;0x37(55) add fear slot
 +
;0x38(56) add want lock
 +
;0x39(57) reset uni wants
 +
;0x3A(58) get a want/fear
 +
;0x3B(59) plastic surgery
 +
;0x3C(60) set skin
 +
;0x3D(61) save special outfit
 +
;0x3E(62) scholarship funds
 +
;0x3F(63) Uni transition
 +
;0x40(64) set time
 +
;0x41(65) generic init
 +
;0x42(66) ''unknown''
 +
 
 +
===Nightlife Added Calls===
 +
;0x43(67) set attraction
 +
;0x44(68) ''unknown''
 +
;0x45(69) vampire on/off
 +
 
 +
===Open for Business Added Calls===
 +
;0x46(70) add clothes to inventory
  
==References==
+
==See also==
This data is taken from STR# resource 7fe59fd0-000000dc-00000000 in TSData/Res/Objects/objects.package.
+
*[[Primitives]]
 +
*[[SimAntics]]
  
[[Category:Modding]]
+
[[Category:Sims 2 Modding]]
 +
[[Category:Primitives|{{PAGENAME}}]]

Latest revision as of 11:24, 17 September 2012

This primitive is used to do things that can't be done with SimAntics, sorta like an operating system call.

Contents

[edit] Overview

The desired call is chosen using the first operand byte. The second maybe used in the future to allow more.

[edit] Values

The avaliable calls vary with the expansion pack.

[edit] Original Game Calls

0x0(0) Exit Lot
Exits the lot (for use in Tutorial)
Temp0
neighborhood ID
Temp1
0 - leave family in lot
Nonzero - evict family
Temp2
0 - no save lot
Nonzero - save lot
Temp3
0 - no reset tutorial episode
Nonzero - reset tutorial episode
0x1(1) center view on stack object
Centers the main game window on the stack object.
0x2(2) set action icon to stack object
Sets the icon of my current action to the stack object's thumbnail.
0x3(3) uncenter view
If the center function was used recently, centers the main game view to where it was before that call.
0x4(4) add to family
Adds the neighbor with id in stack object to the family ID passed in via Temp 0. If this id is 0, then the current family is used. If this id is a non valid family ID (like -1), then a new family will be constructed.
0x5(5) combine assets of family in temp 0
Adds the net worth from the family in Temp 0 to the current family.
0x6(6) remove from family
Remove the neighbor specified in the stack object from the current family.
0x7(7) make new neighbor (depreciated)
Make a copy of the neighbor id in the stack object. New neighbor id is also returned in the stack object. No longer implemented.
0x8(8) family tutorial complete
Marks the family tutorial as being finishes.
0x9(9) architecture tutorial complete
Marks the architecture tutorial as completed.
0xA(10) disable build and buy
Temporarily disables the build and buy buttons in the user interface. Only to be used for special situations.
0xB(11) enable build and buy
After the disable call has been made, re-enables the build and buy buttons in the user interface. Only to be used for special situations.
0xC(12) get distance to camera in temp 0
For the stack object, computes an integer in temp 0 that varies increasingly the further an object is from the camera.
0xD(13) abort interactions
Aborts all interactions associated with the stack object.
0xE(14) house radio station = temp 0
Sets the global house radio station to number provided in temp 0.
0xF(15) My routing footprint = temp 0
Set the footprint extension of me to the value in temp 0
0x10(16) change normal outfit
Changes the normal suit of the person to the next available suit.
0x11(17) Swap Lot
Pass in lot ID you want to change to inside of Temp 0
0x12(18) Set Simulator Speed
Pass in temp 0 speed you want:
0 - pause
1 - unpause
2 - normal
3 - fast
4 - ultra
0x13(19) Swap Lot to Lot of Family in NeighborID in temp0
Pass in neighbor ID in temp 0 and lot will get swapped to that family's lot.
0x14(20) Swap Lot via Family in Temp 0
Put Family number in Temp 0 and lot will get swapped to their family lot.
0x15(21) Add Child to Family Relationship Array
Put a new child in the family tree array, passing in neighbor ID of new child in temp 0 and Parent NID in Temp 1
0x16(22) Add Spouse to Family Relationship Array
Put a new Spouse in the family tree array
temp 0 - neighbor ID of new spouse
temp 1 - neighbor ID of initial spouse
0x17(23) Remove From Family Relationship Array
Remove relationships between two Sims in the family tree array
temp 0 - neighbor ID of Sim to remove
temp 1 - neighbor ID of the relative
0x18(24) Preload New Sim Age
Given age in temp 0 (Same age range as SetAge Primitive uses), preload resources for this sim.
0x19(25) Set Selected Sim
Set the selected sim to the sim person object ID in temp 0
0x1A(26) Start Lot Transition
This call will exit the lot and bring up the neighborhood in a mode where you can select a community lot to go to and then load that lot. It is uknown whether this saves the current lot.
0x1B(27) Get Number of community lots in temp0
Gets the number of community lots in temp0
0x1C(28) Perform Money Effect
Temp0 - amount (for negative change, this needs to be negative)
Temp2 - multiplier (0 is taken as 1)
0x1D(29) Preload Visitor
Temp 0 contains the neighborID of the visitor you wish to preload
preloading takes approx 2 seconds (minimum)
0x1E(30) Preload Clothing
The outfit to preload is in Temp0 (comes from the drop down in Change Outfit)
takes 1/2 second to preload.
0x1F(31) Preload Object
Place GUID of object to be loaded in temp0/1 for object to be preloaded on separate thread.
0x20(32) Get Outfits Information
Place outfit Type in Temp0 and this will return how many outfits there are available for that type on the current ME in temp 1
0x21(33) Update Footprint
Used when you change intersection flags, to update the path planner with the change. This is called automatically after the init BHAV.
0x22(34) Get Distance Between Lots
Returns distance in Temp 2.
Temp0 - source lot ID
Temp1 - destination lot ID
Lot ID is same as House Number.
0x23(35) Get Zoning Type
Lot ID in Temp 0. Returns Zoning Type in Temp 1. See LOT for values.
0x24(36) GetIDOfFamilyInLot
Lot ID in Temp 0. Returns ID of the family residing in the lot in Temp 1. If there is no family in lot, Temp 1 will have -1 upon return.
0x25(37) LotTransitionDone
Needs to be sent after every lot load.
0x26(38) UnlinkCharacter
Neighbor ID in Temp 0. Removes all 3D and Edith resources associated with the character, leaving only UI representation.
0x27(39) Force Recalc of Wants
Forces a recalc of whatever the current Sim is. Ensure this is only called when Me is a sim.
0x28(40) Game State Transition Control
This disables/enables: saving, quitting, exiting to the neighborhood, lot transitions, and lot entry.
Temp 0
0 - disabled
Nonzero - enabled
0x29(41) Facial Overlay Zits Toggle
Temp0
0 - off
Nonzero - on
0x2A(42) Sim Fitness Update
Syncs the 3D view of the sim to the simulator body settings (fit, fat, normal)
0x2B(43) Is It Ok to Idle Here
0x2C(44) Hide / Unhide Puck
Don't try and hide the puck twice without restoring it, that will cause an error
Temp0
0 - unhide
Nonzero - hide
0x2D(45) Copy Last Name
Copy last name from object id in Temp 0 to stack object.
0x2E(46) Set Sim Hair Override
Called on a sim, this will override the current hair the sim is wearing.
This string is the FamilyId to search for in the Skin Catalogue for the override hair (for the given age/gender/haircolor of the sim).
Temp0 - the table Id
Temp1 - the index Id
Temp3 - if set to 1, fallback to globals can happen if the string isn't found
0x2F(47) Clear Sim Hair Override
Clears any hair overrides present on the sim.
0x30(48) Get Remapped Neighbor Id
For imported lots (message broadcast would be "import lot"), pass in Temp0 the old neighbor id, and the remapped/new neighbor id will be set in Temp1. Will return true if a remapped id is found, false otherwise.
0x31(49) Can Change Footprint?
Tests whether a footprint change would cause intersection with another object's footprint. Pass the footprint index in temp0.
0x32(50) Extract Money From other Lot
Temp0 - if non zero, take money from other lot
Temp1 - neighborID of sim from other lot to take money from
Temp2 - percentage of money we want to add to this lot
Temp3/4 - contain the amount of money added to this lot post call
Temp5
0 - we get the money from the funds of the lot the neighborID came from
Nonzero - we get the funds from the lot assets of the lot the neighborID came from
0x33(51) Show Info On Lot Loading Screen
Pass 1 in Temp0 to show dialog for NPCs and Townies generation
0x34(52) Wall in Front?
Direction in temp0. Returns true if there is a wall within 1.5 tiles in that direction. Returns first object on that tile in temp1, if there is a wall.
0x35(53) Set Facial Overlay State
Temp0 - the table ID
Temp1 - the index ID
Temp2 - state
0 - off
Nonzero - on
Temp3 - 1 means to allow fallback to globals

[edit] References

This data is taken from STR# resource 7fe59fd0-000000dc-00000000 in objects.package.

[edit] University Added Calls

0x36(54) add want slot
0x37(55) add fear slot
0x38(56) add want lock
0x39(57) reset uni wants
0x3A(58) get a want/fear
0x3B(59) plastic surgery
0x3C(60) set skin
0x3D(61) save special outfit
0x3E(62) scholarship funds
0x3F(63) Uni transition
0x40(64) set time
0x41(65) generic init
0x42(66) unknown

[edit] Nightlife Added Calls

0x43(67) set attraction
0x44(68) unknown
0x45(69) vampire on/off

[edit] Open for Business Added Calls

0x46(70) add clothes to inventory

[edit] See also

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox