Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for July - posted on 1st Aug 2018 at 9:00 AM
Replies: 0 (Who?), Viewed: 631 times.
Test Subject
Original Poster
#1 Old 18th Jul 2018 at 3:10 AM
Default Interactive Python Console Mod
Hi there. I created a little tool to help explore the Sims 4's Python API, an interactive Python console.

After installing this mod, launch the game, pause, and use the cheat "python_console.start" to start the Python console. A new browser window will be opened which will allow you to interact with the Sims 4's Python API.

When you're done playing God, the command "python_console.stop" will kill the Python console's HTTP server.

The operation of the console is pretty straight forward. Type your code into the text box at the bottom of the screen. Press Ctrl+Enter to execute and Ctrl+Up and Ctrl+Down to navigate the history. After execution, the output will be displayed on the screen. When an exception occurs, it will be displayed in bold, red text.


WARNING: I would not recommend using this tool with save games that you actually care about. Just probing data is probably fine, but modifying anything could seriously screw up your game.

Also, the Python console HTTP server is run in a separate thread and there is no synchronization, so race conditions can occur if the simulation is running while playing with the Python console. That's why I recommend pausing the game before launching the console.


Hope someone finds this useful. Happy modding!
Screenshots
Download - please read all instructions before downloading any files!
File Type: zip TS4 Python Console v0.1.zip (3.7 KB, 8 downloads) - View custom content
3 users say thanks for this. (Who?)
Back to top