Replies: 0 (Who?), Viewed: 612 times.
#1 18th Jul 2018 at 3:10 AM
Thanks: 3 in 1 Posts
Interactive Python Console ModHi 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!
3 users say thanks for this. (Who?)