Cheat Mod Ren'Py The Null Hypothesis Cheat Injector [v2.8] [Sleepingkirby]

5.00 star(s) 1 Vote

drifter139

Engaged Member
Dec 11, 2019
2,231
2,288
448
bro pulled a Flash and got down to it fast. dude literally went back in time, saw the game's code, updated his mod, and was like "here you go" and was out lol. thanks bro
 

appendix2852

New Member
May 6, 2024
7
7
21
Thank you. I appreciate it. Don't worry though, I am taking time out for myself. The only time this takes away from is my other side projects, but I've those in spades. Like, I have an list. Everything from a new browser extension that interfaces with a custom backend, modding a PS1 game, making my own mmrpg*, to seeing if there's a way to make my own smart phone. Of all of them, this is the quickest and simplest side project.
What a rollercoaster of a list :LOL:


Anytime I see a PS1 project it warms my heart, it feels like it was 100 years ago I was playing Tenchu as a kid and barely understanding anything but ninjas are cool so it doesn't matter
 

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
bro pulled a Flash and got down to it fast. dude literally went back in time, saw the game's code, updated his mod, and was like "here you go" and was out lol. thanks bro
I know I harp a lot on what good programming is and a lot of people don't really care or don't really understand (or probably think I'm bragging or something). But this is the difference. Sustainable code (and design) means that it can withstand a lot and, often, quickly. When I started taking over maintaining SLDR's rogue-like injector mod, it was me and someone else that looked into doing it. He wanted convoluted solutions, which were often redundant or over engineered. The result is that I'm running 4~5 of these injectors and he had to take his down because its completely broken and needs to be rewritten. It's not guaranteed, but sustainable code (and design) lasts. And it lasts way more often than flashy features and GUI's.
 
  • Like
Reactions: Chrisdarock19

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
Anytime I see a PS1 project it warms my heart, it feels like it was 100 years ago I was playing Tenchu as a kid and barely understanding anything but ninjas are cool so it doesn't matter
Honestly, I really want a Megaman(Rockman) X4 mod where Zero's moves are more in line with X's moves. For those that don't know, Megaman X4 is the first Megaman X series game where Zero is a full, playable, character (as in, special weapons). But the boss weaknesses for said weapons are kind of all over the place. Some bosses supposedly has weaknesses to another of Zero's technique, but not really. I want to change all that. Shippuga should be allowed to execute in the air and cut Web Spider's thread. Kuuenzan should cause Cyber Peacock to fizzle, etc.
All that requires a lot. Preferably a decompile and recompile of the game's code. But there isn't a lot of documentation for Megaman X4's game engine for some reason. So yeah, that's why that pet project list hasn't been very high. The bar of entry is pretty high. It either means I have mode the assembly language or something similar. I did find some resource about modding that particular game and it looks like what I want to do is possible but I don't know for sure. Needless to say, this is all a bit out of my wheelhouse, but I really want it so... yeah.
 
  • Like
Reactions: appendix2852

RufferSOG

Newbie
Nov 19, 2018
21
7
126
Love the mod, really helps out with grinds and the points. quick question though, is there a way to increase the love and trust above 1000 and make it permanent. because as of now, it keep on resetting to 1000
 

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
Love the mod, really helps out with grinds and the points. quick question though, is there a way to increase the love and trust above 1000 and make it permanent. because as of now, it keep on resetting to 1000
Those caps should have been broken. That's what is all about. I'll take a look when I get back.

Found it:
Code:
        max_stat = max_stats[season - 1] if persistent.stat_caps else 1000

        stat = clamp(stat + update, 0, max_stat)
There's a hard coded max if stat_caps isn't set. I'll wipe up a fix when I come back.
Meanwhile, it's a game setting:
1760083807332.png
Turn *ON* cap stats by season and it'll use the new cap.
 
Last edited:

RufferSOG

Newbie
Nov 19, 2018
21
7
126
Those caps should have been broken. That's what is all about. I'll take a look when I get back.

Found it:
Code:
        max_stat = max_stats[season - 1] if persistent.stat_caps else 1000

        stat = clamp(stat + update, 0, max_stat)
There's a hard coded max if stat_caps isn't set. I'll wipe up a fix when I come back.
Meanwhile, it's a game setting:
View attachment 5328514
Turn *ON* cap stats by season and it'll use the new cap.
that work. thanks
 
  • Like
Reactions: sleepingkirby

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
Cheat injector has been updated to v2.5. As always, please apply to a fresh copy of the game.
The version update was made to address 3 issues
  1. The stat limit (stat cap) breaking method was changed. Now, the new stat cap is only applied when the game's stat cap setting in the game setting is turned OFF.
    1. RufferSOG So when you apply this cheat version, make sure to turn OFF the stat cap game setting within the game before you start playing again.
  2. I found an issue where the game can, somehow, interpret one of the values in the code Player.cash + 50000 as a string, causing the money value to end up as a float (a number with decimals). This has been fixed by type casting both values as integers. Anyone seeing their money value with a decimal point, just add more money via this cheat injector and it will correct the value.
  3. Changed the way how I implemented the character status buttons (mad, horny, sad, etc.) so to resolve the errors being brought up by using it with the TNHUXMod. THIS DOES NOT GUARANTEED THAT IT'S COMPATIBLE WITH THE TNHUXMod! OTHER THINGS MIGHT BREAK WHEN USING THE MODS TOGETHER! But it should resolve that one specific error reported here.
 

appendix2852

New Member
May 6, 2024
7
7
21
Honestly, I really want a Megaman(Rockman) X4 mod where Zero's moves are more in line with X's moves. For those that don't know, Megaman X4 is the first Megaman X series game where Zero is a full, playable, character (as in, special weapons). But the boss weaknesses for said weapons are kind of all over the place. Some bosses supposedly has weaknesses to another of Zero's technique, but not really. I want to change all that. Shippuga should be allowed to execute in the air and cut Web Spider's thread. Kuuenzan should cause Cyber Peacock to fizzle, etc.
All that requires a lot. Preferably a decompile and recompile of the game's code. But there isn't a lot of documentation for Megaman X4's game engine for some reason. So yeah, that's why that pet project list hasn't been very high. The bar of entry is pretty high. It either means I have mode the assembly language or something similar. I did find some resource about modding that particular game and it looks like what I want to do is possible but I don't know for sure. Needless to say, this is all a bit out of my wheelhouse, but I really want it so... yeah.
Oh the days where basically each game had its own engine or it was one used for just a couple of games instead of just Unreal or Unity (and not fixing their bugs).
Nice to see the love for X4, those are some great insights on Zero's mechanics. Even though a lot of people hate on it, I gravitate more to X5, one of the reasons being that Zero becoming a Beyblade of death if you can press the button fast enough will never not be funny.
 
  • Like
Reactions: sleepingkirby

freddygonzo

Member
Apr 26, 2024
400
500
179
  1. Changed the way how I implemented the character status buttons (mad, horny, sad, etc.) so to resolve the errors being brought up by using it with the TNHUXMod. THIS DOES NOT GUARANTEED THAT IT'S COMPATIBLE WITH THE TNHUXMod! OTHER THINGS MIGHT BREAK WHEN USING THE MODS TOGETHER! But it should resolve that one specific error reported here.
If you know how to change my overridden screen codes to make them work with your changes, then tell me and I gladly incorporate them as long as everything will also work without your mod. Maybe some IF conditions can be added here and there detecting your injector changes and do whatever.
Adding something to a renpy screen can normally only be done by copying & modifying the whole screen code. At least I wouldn't know any other method by renpy/python code.
No idea how your injection stuff works, but maybe you can let it inject with a higher/later priority to override my init 10 overrides.
 

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
If you know how to change my overridden screen codes to make them work with your changes, then tell me and I gladly incorporate them as long as everything will also work without your mod. Maybe some IF conditions can be added here and there detecting your injector changes and do whatever.
Adding something to a renpy screen can normally only be done by copying & modifying the whole screen code. At least I wouldn't know any other method by renpy/python code.
No idea how your injection stuff works, but maybe you can let it inject with a higher/later priority to override my init 10 overrides.
Let me explain how the cheat injector works first. The whole thing runs on a regex search and replace on specific files. It just turns GUI elements, normally non-interact-able, into interactable elements. i.e. text to text button. Bars into slider bars, etc. So rather than throwing in a file that will supercede existing functions, like adding an additional .rpy file, the injector literally rewrites the game code, injects additions/changes into it. Hence why it's called a cheat injector and not a cheat mod. Why did I choose this method instead of a mod? Well, if the rest of the function changes, if the function name changes, if the styles change, as long as the pattern matches, the cheat injector will still work. And, keep in mind, I didn't come up with this idea, SLDR did.
To the topic at hand, at one point, I was modifying this screen definition: (in this file: game/interfaces/Player_menu.rpy)
screen relationships_status(status, **properties):
to this:
screen relationships_status(status, c, **properties):
To pass in the character. Inside that screen is a text element that I turned into a text button with the action of set "0" to the character's status. Since your mod is also calling that screen as is, but it doesn't know I've changed the parameters, the game gave an error.

With v2.5 of the cheat injector, I've since changed that back to the original definition and, instead, made calls to that function include the character as part of the dict in **properties. So that should be safe again.

But I put that warning out there because I haven't looked at what your mod does nor what code/function/etc. it uses/supercedes so I can't guarantee that it'll work with my cheat injector. After all, if you're superceding a GUI that I've modified, that would render that cheat useless. I don't believe I've changed any other function definitions so that problem/crash shouldn't come up again. But, again, I put up the warning because I don't know what you've done and, honestly, you shouldn't worry about my code either. I didn't get into this because I can tell people already don't care when I go about programming practices and discipline, but for your mod to work 100% inline with my cheat injector will take an non-insignificant amount of coordination. Either both of us together or one taking cues for another. Like, this is why git repositories exist. And, with the way renpy mods are written, I wouldn't doubt that, at some point, you will run into an issue where the best, long term solution, is to make 2 versions of the mod. One for the base game and one for the cheat injected version. And I don't want you to have to do that. It's unfair and unreasonable. And that's ignoring the fact I don't know what other cheats I'll write in the future. I've already had to re-implement skill points (removed in this most recent version) and that only worked because I injected my own function to use. So your mod would have to know a new function exists, know what the name is, where it's being used and either replace or avoid where it's being used. Not a reasonable ask. Currently, I inject a function that removes cheating on a love interest. How would your mod know when it can and can't depend on that function existing if you want to use it? It's a lot of work for very little pay out and I wouldn't want you to have to deal with it. With great power comes great responsibility. If the players want the power of a cheat, let them take some responsibility in knowing they can't, unless they roll the cheats themselves, have everything. (I'm speaking from experience on that one. I did a cheat injector for Rogue-like prime's mod. It was not easy.)

If you really want to take a crack at it, I've open sourced all my stuff. You'll find the file in my github at the OP. But, again, I wouldn't want you to do that.
 

freddygonzo

Member
Apr 26, 2024
400
500
179
Let me explain how the cheat injector works first. The whole thing runs on a regex search and replace on specific files. It just turns GUI elements, normally non-interact-able, into interactable elements. i.e. text to text button. Bars into slider bars, etc. So rather than throwing in a file that will supercede existing functions, like adding an additional .rpy file, the injector literally rewrites the game code, injects additions/changes into it. Hence why it's called a cheat injector and not a cheat mod. Why did I choose this method instead of a mod? Well, if the rest of the function changes, if the function name changes, if the styles change, as long as the pattern matches, the cheat injector will still work. And, keep in mind, I didn't come up with this idea, SLDR did.
To the topic at hand, at one point, I was modifying this screen definition: (in this file: game/interfaces/Player_menu.rpy)
screen relationships_status(status, **properties):
to this:
screen relationships_status(status, c, **properties):
To pass in the character. Inside that screen is a text element that I turned into a text button with the action of set "0" to the character's status. Since your mod is also calling that screen as is, but it doesn't know I've changed the parameters, the game gave an error.

With v2.5 of the cheat injector, I've since changed that back to the original definition and, instead, made calls to that function include the character as part of the dict in **properties. So that should be safe again.

But I put that warning out there because I haven't looked at what your mod does nor what code/function/etc. it uses/supercedes so I can't guarantee that it'll work with my cheat injector. After all, if you're superceding a GUI that I've modified, that would render that cheat useless. I don't believe I've changed any other function definitions so that problem/crash shouldn't come up again. But, again, I put up the warning because I don't know what you've done and, honestly, you shouldn't worry about my code either. I didn't get into this because I can tell people already don't care when I go about programming practices and discipline, but for your mod to work 100% inline with my cheat injector will take an non-insignificant amount of coordination. Either both of us together or one taking cues for another. Like, this is why git repositories exist. And, with the way renpy mods are written, I wouldn't doubt that, at some point, you will run into an issue where the best, long term solution, is to make 2 versions of the mod. One for the base game and one for the cheat injected version. And I don't want you to have to do that. It's unfair and unreasonable. And that's ignoring the fact I don't know what other cheats I'll write in the future. I've already had to re-implement skill points (removed in this most recent version) and that only worked because I injected my own function to use. So your mod would have to know a new function exists, know what the name is, where it's being used and either replace or avoid where it's being used. Not a reasonable ask. Currently, I inject a function that removes cheating on a love interest. How would your mod know when it can and can't depend on that function existing if you want to use it? It's a lot of work for very little pay out and I wouldn't want you to have to deal with it. With great power comes great responsibility. If the players want the power of a cheat, let them take some responsibility in knowing they can't, unless they roll the cheats themselves, have everything. (I'm speaking from experience on that one. I did a cheat injector for Rogue-like prime's mod. It was not easy.)

If you really want to take a crack at it, I've open sourced all my stuff. You'll find the file in my github at the OP. But, again, I wouldn't want you to do that.
I don't have much clue about coding, hence I can't really comprehend complex procedures what is all done in your github codes.
I guess the main culprit is my display of friendship points on the portraits in player_menu.rpy.
If you compare the original and my screen relationships_screen() code (e.g. by if nothing else available), you can see I mainly only added a new text line, besides some minor font size and position changes.
relationships_screen.jpg
Everything else is kept as vanilla as possible, like with my other screen code changes. I usually have commented the parts of my changes.
Yeah, i guess a true mod would have been easier to make both compatible. I wouldn't know where to start how to make the injector changes somehow compatible.
As long as game devs won't do more pointless changes like renaming folders, there won't be more changes on my side either, but let's see in the future. My focus on the game will come back after the release of v0.9 where I'm going to check and test everything again and see what else could be screwed where, particularly among the new sandbox features.
As you have much more clue about coding, I'll change whatever is necessary and possible within my changes, but as mentioned, I wouldn't know where to start alone.
 
Apr 9, 2020
38
31
142
Is there a command for increasing the achievement points in the achievement app? Because I know it uses the add point perk there to add in the perk tree, but I wanna buy some of the other things in the shop

Edit: Figured out a workaround, just go in the achievement.rpy file and change the point amount of any achievement you've completed, and you get a lot of points

Edit 2: You can also go in the game/characters/Player folder and open the Player.rpy file and change the speed of love and trust gain for a faster "grind". Can be helpful for people who don't want to go all out cheating but just speed it up a bit
 
Last edited:

Radchaai

Newbie
Jun 6, 2020
24
6
47
I get that this is a save file, but my PC does not let me download it because it says it has a virus. I even closed and uninstalled my antivirus. Does anyone have a method of hacking that lets me download the file?
 

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
I don't have much clue about coding, hence I can't really comprehend complex procedures what is all done in your github codes.
I guess the main culprit is my display of friendship points on the portraits in player_menu.rpy.
If you compare the original and my screen relationships_screen() code (e.g. by if nothing else available), you can see I mainly only added a new text line, besides some minor font size and position changes.
View attachment 5330502
Everything else is kept as vanilla as possible, like with my other screen code changes. I usually have commented the parts of my changes.
Yeah, i guess a true mod would have been easier to make both compatible. I wouldn't know where to start how to make the injector changes somehow compatible.
As long as game devs won't do more pointless changes like renaming folders, there won't be more changes on my side either, but let's see in the future. My focus on the game will come back after the release of v0.9 where I'm going to check and test everything again and see what else could be screwed where, particularly among the new sandbox features.
As you have much more clue about coding, I'll change whatever is necessary and possible within my changes, but as mentioned, I wouldn't know where to start alone.
Basically, as of v2.5 of this cheat injector, it shouldn't be a problem. I've already changed it on my side as that was a more sustainable approach anyways. Don't worry about it until someone else comes along and goes "This other thing is broken. I'm using TNHUXMod."
 

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
Is there a command for increasing the achievement points in the achievement app? Because I know it uses the add point perk there to add in the perk tree, but I wanna buy some of the other things in the shop

Edit: Figured out a workaround, just go in the achievement.rpy file and change the point amount of any achievement you've completed, and you get a lot of points

Edit 2: You can also go in the game/characters/Player folder and open the Player.rpy file and change the speed of love and trust gain for a faster "grind". Can be helpful for people who don't want to go all out cheating but just speed it up a bit
Yeah, you're the second one to ask about achievement points. I'm considering either re-implementing the old skill points like I did in earlier versions of the injector or implement a way to increase achievement points. Which, ironically, would be using the same methodology. Though, since achievement does do something functional in this game, I might implement the latter.

I guess this is what happens when you never care about achievements in any game.
 

sleepingkirby

Well-Known Member
Aug 8, 2017
1,291
1,921
262
Injector has been updated to v2.6. As always, please apply to a fresh copy of the game.

This adds a button to increase achievement points because buying skill points unbounded can decrease the achievement points into the negative. Please keep in mind that I had to roll my own variable for keeping track of these points. As such, if you give yourself points then spend them and then revert back to the base game, your points will be lowered or in the negative.
 
5.00 star(s) 1 Vote