Posted in Sims 4 Studio

Add New Text String in Sims4Studio

In programming, a “string” is a data type that contains a line of displayable text. An example in the Sims would be, when you want to listen to a radio channel, a pie menu appears with the text “Listen to the Radio”. That text is a string.

When making a mod, you might want to change the text strings displayed in game. This tutorial shows how.

(Thank you to BakieGaming whose video tutorial showed me how to do this originally)


1. Open your Project & find a Text String

This is the XML code from the Object State Tuning row StereoChannel_Retro. I’ve made a new copy, by changing the name on the Data tab to StereoChannel_Folk, and now I want the game to display “Folk” instead of “Retro”.

You can easily spot the lines of code where the display name, and display description is linked.


2. Create a unique Hash

In the top bar, go to Tools > Hash Generator. A hash is a kind of number, and we need a unique one to refer to our new text string (so it doesn’t accidentally replace another one in game or by another modder)

This window will pop up:

Under text, type in any old text. The Hash Generator will, as you type, convert that text into a number which is extremely cool.

Good practice is, make the text string as unique as possible: I’ve got my creator name, then the file the string is in, then what the string does, and then YYYYMMDD and the time.

Once you’ve done typing, copy the number next to FNV32.

Close the hash generator.


3. Open String Table

Click on the top row of the String Table (“English”), and look at the Data tab.

Click Edit Items…

A window will pop up. Depending on what you’re doing, there may already be strings there.

Click Add to add a new one, and click on it to open it in the right-pane for editing:

Under Key, paste your number. Under Value, type what you want this text string to display to the player.

You’ve created a Key/Value pair, where referring to the Key in the code will allow the program to access the text in your Value.


4. Paste your Key in the correct place in the XML

Go back to whatever XML tab you were working on:

And replace the Key for Value “Retro”, with the Key for your new Value “Folk”:

For reasons I do not fully understand, there’s an extra 0x at the start of the number that you need to leave the same, only replacing the last 8 digits. *amateur shrugging*

See that I’ve also updated the comment, and I’ve put my creatorname there to make it easy to Ctrl+F changes I’ve made to the code.


5. Update All String Tables

Your Key/Value pair currently only exists in the English language. You need to quickly duplicate the pair to all other languages as follows.

Click Tools > Modding > Copy string tables to all languages

Now, no matter what language the user is playing in, the key exists and points to your text string.

At this stage, you can of course go through each String Table row, click Edit Items, and replace the Value you’ve written in English with a Value translated for that language. It depends on how professional you want your mod to be, your language skills, and whether you have any volunteers who will help.


Follow this process whenever you need to add or change a text string in Sims 4 Studio

One thought on “Add New Text String in Sims4Studio

Leave a comment