Difference between revisions of "Sims 2 String Substitutions"

From SimsWiki
Jump to: navigation, search
m (→‎Special Substitution inserts: correcting $GUIDCatalogNameLocal:X:Y entry. Catalog name not description is pulled. also Added X=guidLo nad Y=guidHi)
m (updated description for $PrivateString:X:Y)
 
Line 42: Line 42:
 
|$JobTitle:X||''Insert text name of a job title of given object. Using index passed in via local var X, this indexes into string table 800 (?)''
 
|$JobTitle:X||''Insert text name of a job title of given object. Using index passed in via local var X, this indexes into string table 800 (?)''
 
|-
 
|-
−
|$PrivateString:X:Y||Gets the Private string from the [[STR#STR.23|String Resource]] number in Local:X (have made it work for 0x0101), and the string within that table which is in Local:Y
+
|$PrivateString:X:Y|| Inserts text string from [[STR#STR.23|String Resource]] STR#instance number in Local:X (works with e.g. 0x0101), and the string index in Local:Y.
 
|-
 
|-
 
|$SemiGlobalString:X:Y||''Gets the Semi global string from the [[STR#STR.23|String Resource]] number in Local:X, and the string within that table which is in Local:Y''
 
|$SemiGlobalString:X:Y||''Gets the Semi global string from the [[STR#STR.23|String Resource]] number in Local:X, and the string within that table which is in Local:Y''

Latest revision as of 17:01, 12 October 2026

[edit] Overview

When creating a String Resource for one of the many uses in Sims 2 (including dialogs) you can use special substitution strings to have your string filled in at runtime with something that isn't static, for example a Sims name, or a value calculated at runtime.


[edit] Special Substitution inserts

Italics in the table below indicates an unconfirmed description.

Substitution Description
$Neighbor Insert name of neighbor pointed at by neighbor ID in stackObject ID
$FamilyAssets:X Insert family monetary Net worth into string from family index in local var (note: includes budget, lot and objects value)
$Family Insert house-hold name of person in stack object into string
$Me Insert catalog name of current object/Sim contained in the special My variable
$Object Insert catalog name of current stack object into string
$Local:X Insert value of Local variable X
$TimeLocal:X Insert hour of day in text contained in Local variable X
$NameLocal:X Insert catalog name of object/Sim with ID contained in Local variable X
$NameAttrib:X Insert catalog name of object with ID pointed at index X of stack objects attribute (?)
$NeighborLocal:X Insert name of Sim pointed at by Neighbor ID contained in Local variable X
$Attrib:X Insert attribute value X of stack objects attribute (?)
$CatalogLocal:X Insert catalog description of object with ID contained in Local variable X
$GUIDCatalogNameLocal:X:Y Insert catalog name of object with GUID contained in Local variables X and Y. (X = guidLo, Y = guidHi). Availabled with Pets or higher
$TokenNameLocal:X Insert catalog name of object type pointed at by token type, which is indexed by local var X
$DayLocal:X Insert text name of day given in local var X. Day values are 0-6, 0 being Sunday. This is unlike the Global variable "Day of Week" which starts with Monday as 0 instead
$JobTitle:X Insert text name of a job title of given object. Using index passed in via local var X, this indexes into string table 800 (?)
$PrivateString:X:Y Inserts text string from String Resource STR#instance number in Local:X (works with e.g. 0x0101), and the string index in Local:Y.
$SemiGlobalString:X:Y Gets the Semi global string from the String Resource number in Local:X, and the string within that table which is in Local:Y
$LastName Gets the current family's last name
$FullNameLocal:X Insert full name of Sim pointed at by Neighbor ID contained in Local variable X
$ Displays simoleon sign - §
$LotNameLocalByLotId:X Displays the name of the lot with Lot ID given in Local X
$Cash:X:Y Displays amount; useful for money. Local Y=Div (10,000s), Local X=Mod (remainder). Note: variables must be sequential: :5:6, or :0:1, or :3:4.
$Cash:X Same as $Cash:X:Y, where Y is assumed to be the next local var index ($Cash:0 = $Cash:0:1).
$Money:X:Y Not sure. Example of usage I saw: local X=base value (1000), local Y=multiplier (~1-19)
$PropertyGlobalString:X:Y Displays result of lua script by the name found in Local X=string set, Local Y=string index. There is Global Properties STR 0x00000133 for this.
$PrimaryNeighborhood Displays main neighborhood's name, e.g. Strangetown.
$WantDescriptionLocal:X:Y Displays want name of SimID in Local X. Want slot index in Local Y.
$FearDescriptionLocal:X:Y Displays fear name of SimID in Local X. Fear slot index in Local Y.
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox