MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...

[Script Mod] enable advanced debug/cheat interactions

by clown Posted 13th Sep 2014 at 8:19 PM - Updated 13th Sep 2014 at 11:53 PM by leefish
858 Comments / replies (Who?) - 24 Feedback Posts, 1 Thanks Posts
Picked Upload! This is a picked upload! It showcases some of the best talent and creativity available on MTS and in the community.
This mod is a small script that patches a function in the maxis game code to enable additional debug cheats. It also always enable cheats without needing to use the testingcheats command.
The python source is included as it provides an example of how to replace methods and functions in the maxis code.
I do not guarantee that the mod won't break with future updates of the game or that I'll be able to be arsed to fix it. But hey, you have the source :p

Unlike the original less than subtle method of modifying python33.dll to force the __debug__ variable to true, this one doesn't seem to be suffering from any game breaking side effect (at least it didn't during my extremely thorough 20 seconds test of getting a sim to fish and then successfully cancelling it).

Installation: put the zip file in your Mods directory. The zip also contains the .py source.
Make sure that script mods are enabled in game options.

Update: Now doesn't require to use the testingcheats console command.

Below is the original post describing the original less than satisfactory python dll editing method, in case someone is interested for some reason:



So I was looking into the decompiled python code and I noticed that a lot of interesting things are enabled when the global __debug__ variable is set to true.

It turns out that it is a builtin python variable normally set by python when run in non-optimized mode. Sims 4 helpfully ships python as a separate DLL from the main binary, so we can easily do some good ole hex editing of the code in that dll to force this variable to be set.

Steps:
1. Get HxD (http://mh-nexus.de/en/hxd/).
1. Locate your sims 4 directory, which should be something something Origin Games/The Sims 4
2. Go into the Game/Bin directory.
3. Make a backup copy of Python33.dll
4. Launch HxD
5. Drag and drop Python33.dll into HxD
6. Press ctrl+f to bring up the search dialog
7. In "datatypes", select "hex-values"
8. In "search for", enter "0f45fd57"
9. The four bytes "0F 45 FD 57" will be highlighted. Click on the "45".
10. type "44", so that those bytes now read "0F 44 FD 57"
11. Save

Restart the game.

In the game a bunch of new debug interactions should now be available by shift clicking on sims, objects or directly on the lot, allowing to manipulate traits, emotions, spawn sims, break things, start fires etc.
They are always available without having to enter testingcheats true in the console, until you restore the original Python33.dll file.

Doing this is also probably a useful step towards enabling the commands to reload scripts on the fly. There are lots of console commands that are flagged as debug only, but even after doing the above they don't seem to work. This will need more investigation.
Type: Other

You must have the expansion or stuff packs listed below installed to use this custom content. Please see the post text for any exceptions.

Sims 4
Key: - File was updated after upload was posted
Filename - Tip: You can click the magnifying glass to see the archive contents Size Downloads Date
EnableDebugCheats.zip

Size: 2.6 KB · Downloads: 204,965 · 13th Sep 2014
2.6 KB 204,965 13th Sep 2014
Don't forget to Thank the creator after downloading! Use the Thanks button located above the screenshots above.
Basic Download and Install Instructions:
1. Download: Click the File tab to see the download link. Click the link to save the .rar or .zip file(s) to your computer.
Read the upload description for installation instructions. If nothing else is specified, do the following:
2. Extract: Use WinRAR (Windows) to extract the .package file(s) (if included, ts4script as well) from the .rar or .zip file(s).
3. Cut and paste the .package file(s) (if included, ts4script as well) into your Mods folder
  • Windows XP: Documents and Settings\(Current User Account)\My Documents\Electronic Arts\The Sims 4\Mods\
  • Windows Vista/7/8/8.1: Users\(Current User Account)\Documents\Electronic Arts\The Sims 4\Mods\

Need more information?
  • Anyone can use both .rar and .zip files easily! On Windows, use WinRAR.
  • If you don't have a Mods folder, just make one.
  • Mod still not working? Make sure you have script mods enabled
 
858 Comments / Replies (Who?) - 556 Feedback Posts, 268 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Page 1 of 35
Test Subject
#2 Old 3rd Sep 2014 at 11:49 PM
(Game/Bin , Hehe. Nitpicky but might help someone)

This worked nice, quick and easy for me! THANK YOU so much for this! Excellent, excellent, improvement. Beautiful.

I was hoping this would somehow allow moveobjects but no

Good stuff!!
Test Subject
Original Poster
#3 Old 4th Sep 2014 at 12:03 AM
Quote:
Originally Posted by InvaderQ
(Game/Bin , Hehe. Nitpicky but might help someone)


Indeed. Edited it. Thanks!
Lab Assistant
#4 Old 6th Sep 2014 at 1:00 AM
It works but after some tests i found out that it disables the option to cancel active commands that sims are doing, so for instance a sim is fishing and you want him to stop doing it then you can't you can keep on click on the cross to stop him but the activity keeps removing the cross and keeps on going.now if only this could be fixed.
Eminence Grise
#5 Old 6th Sep 2014 at 1:16 AM
Quote:
Originally Posted by cyberops
It works but after some tests i found out that it disables the option to cancel active commands that sims are doing, so for instance a sim is fishing and you want him to stop doing it then you can't you can keep on click on the cross to stop him but the activity keeps removing the cross and keeps on going.now if only this could be fixed.


Yeah... I am having this problem too Too bad because there is some super useful functionality inside those menus. I was getting around it by using the "reset" cheat on the object the sim was interacting with to cancel interactions :/ But that's not exactly ideal.

Must be a way to unlock the functionality through the cheat console, like testingcheats... so you could turn it on and off... just need a mod for that..
Lab Assistant
#6 Old 6th Sep 2014 at 1:28 AM
Quote:
Originally Posted by Srikandi
Yeah... I am having this problem too Too bad because there is some super useful functionality inside those menus. I was getting around it by using the "reset" cheat on the object the sim was interacting with to cancel interactions :/ But that's not exactly ideal.

Must be a way to unlock the functionality through the cheat console, like testingcheats... so you could turn it on and off... just need a mod for that..


Yeah I was doing the exact same thing, I hope a mod for this can be made because there are indeed very usefull options in there that i love, like promoting careers or demoting, adding traits and skills etc. Saves time if you want to move up a little quicker just for fun times.
Eminence Grise
#7 Old 6th Sep 2014 at 1:36 AM
Quote:
Originally Posted by cyberops
Yeah I was doing the exact same thing, I hope a mod for this can be made because there are indeed very usefull options in there that i love, like promoting careers or demoting, adding traits and skills etc. Saves time if you want to move up a little quicker just for fun times.


Yup... personally, when I create an adult or elder sim in CAS especially, I like to give em a few skill points and a couple of career levels, so there's a slightly more level playing field between them and born in-game sims
Test Subject
Original Poster
#8 Old 6th Sep 2014 at 1:40 AM
Yes, I have also had this issue. I think this is because that __debug__ variable activate way more debugging stuff than just those additional interactions, and some just mess things up.

Maybe it is possible to do this kind of things in a more controlled fashion with fewer unwanted side effects with script mods and monkey patching
Eminence Grise
#9 Old 6th Sep 2014 at 4:59 AM
Re-swapping the modded dll and the backup doesn't seem to have any negative effect on the save though

Which means that for now, you can swap in the modded dll, cheat up your sims, swap it back out and play normally. Not exactly convenient, but for a player like me you only need to do it once per household
Lab Assistant
#10 Old 6th Sep 2014 at 10:39 AM
Quote:
Originally Posted by Srikandi
Re-swapping the modded dll and the backup doesn't seem to have any negative effect on the save though

Which means that for now, you can swap in the modded dll, cheat up your sims, swap it back out and play normally. Not exactly convenient, but for a player like me you only need to do it once per household


I'm doing the same thing, only put it in when I need to cheat a sim up or make a change. So for the time being it will have to do until there is a debug cheat mod out. And hoping for a rewards unlock mod so you can actually build a home with the unlocked furniture and decorative stuff
Lab Assistant
#11 Old 11th Sep 2014 at 8:18 AM
I can confirm that this debug option still works as the file has not been updated in any of the patches, however the problem still remains that you cancel actions the sim is doing, hopefully someone can still make use of this in a good mod.
Test Subject
Original Poster
#12 Old 11th Sep 2014 at 11:27 PM
I have managed to achieve the same thing without the side effects with a scripting mod. See the edited original post for details.
Lab Assistant
#13 Old 12th Sep 2014 at 5:25 AM
Just tested it, works great man. Thanks for making it available. Hope you keep updating it if needed when patches come out. Can also confirm that it works 100% and i can now cancel sims actions. Again thanks man now we got debug cheats without problems
Test Subject
#14 Old 12th Sep 2014 at 7:46 AM Last edited by Elerneron : 12th Sep 2014 at 8:00 AM. Reason: Further Information
I can't get it to show up. I put the zip in the Mods folder, but the mod dialog only shows the no mosaic mod (which is the only other mod that I have), and the testingcheats true functionality is unchanged. The zip is in C:\Users\(My User Name)\Documents\Electronic Arts\The Sims 4\Mods but the game doesn't seem to be recognizing it. I tried extracting it. I re-downloaded it. I can't seem to get it working. I haven't tried any other scripting mods . . . so I'll go do that now . . . I should have thought of that before typing all of this . . .

Edit: Okay, It's my game apparently, and not this mod. Maybe the update that fixed the game loading script mods didn't install properly . . . IDK. Anyway sorry for bothering you. Now to find out what the problem really is.

Edit 2: Okay, I missed the fact that script mods must be enabled in the game settings somehow. Everything's good now.
Test Subject
#15 Old 12th Sep 2014 at 11:15 AM
I'm either missing something or doing something wrong, heh. So just to confirm, now that this is a Scripting Mod, it's functionality is to enable the Advanced Debug Options that we normally wouldn't see with TestingCheats but it no longer automatically enables TestingCheats. (?) I liked not having to enter in TestingCheats every time, but obviously it's not a big deal, I just want to make sure I'm understanding and have everything working properly
Test Subject
Original Poster
#16 Old 12th Sep 2014 at 2:09 PM
This is correct. The mod just makes additional cheats available when you use testingcheats. The original method of modifying the DLL also made the cheats available without typing the console command first but it wasn't intended, it was just an harmless see effect.

I can probably make it so that the mod also automatically enables testing cheats, I just didn't bother with it yesterday because it doesn't seem a huge issue.

I wasn't even sure it could work the way I did it, it was originally mostly an experiment to see if it was possible to replace individual methods in the maxis code with a mod.
Lab Assistant
#17 Old 12th Sep 2014 at 4:21 PM
That would be even better make that more awesome if testing cheats was automaticly enabled
Test Subject
Original Poster
#18 Old 12th Sep 2014 at 10:53 PM
Ok, I've done that.
Lab Assistant
#19 Old 13th Sep 2014 at 1:14 AM
Quote:
Originally Posted by clown
Ok, I've done that.


Thanks man, great work on this
Eminence Grise
#20 Old 13th Sep 2014 at 2:16 AM
Sorry, had to take down the attachment, since MTS doesn't permit sharing mods in the forums. Hopefully this will appear in downloads soon
Lab Assistant
#21 Old 13th Sep 2014 at 2:58 AM
Quote:
Originally Posted by Srikandi
Sorry, had to take down the attachment, since MTS doesn't permit sharing mods in the forums. Hopefully this will appear in downloads soon


I hope he uploads it then, so everyone can make use of this awesome mod.
Test Subject
#22 Old 13th Sep 2014 at 6:54 AM
I hope he does soon. I want the update. I don't see it in the downloads yet except the BuildBuyMode Unlocker and SuperSpeed Mod. I have the older update before it was removed.
Test Subject
Original Poster
#23 Old 13th Sep 2014 at 6:28 PM Last edited by plasticbox : 13th Sep 2014 at 6:54 PM.
Sorry, I work crazy overtime 6 days a week these days and can't really be bothered with internet bureaucracy on what little free time I have.

[ edit by pbox: Link removed, see next / first post ]

Get it before the link is removed, feel free to upload it yourself if you want.
Pettifogging Legalist!
retired moderator
#24 Old 13th Sep 2014 at 6:52 PM Last edited by plasticbox : 13th Sep 2014 at 8:36 PM.
I'm removing the link from your last post and then we're going to turn the entire thread into a proper upload thread.

Note to others, this is *not* standard procedure.

Edit: Okay, done. And playtested as well -- works as advertised; thank you! Attached in post #1 is the version from post #23.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
#25 Old 13th Sep 2014 at 9:03 PM
will this enable the testingcheats when we load a new screen or will we have to type it then? I love the idea of not having to type testingcheats everytime I load a screen
Page 1 of 35