holy fucking shit!
yea it works now thank you very much for this this is AWESOME
BUT HOW
it even acknowledges clothing status
what is this sorcery!?
how did you do this!?!?
like, seriously, is it very complicated for the average guy? cuz well, i have other ideas in mind, or even just for learning and future reference
This is reverse engineering, you have to play with CE, change variables, look at what happens, look at which code access these variables, try to change the code etc. and make sense out of the program. There will be a lot of trial and error and often you'll have to combine several tricks and idea at once. Saying this is "very complicated for the average guy" is probably an understatement. I think it's probably very complicated even for the average
programmer.
The worst part is that it's not something that can be taught as it's mostly intuition. There's no well-defined process to reverse-engineer a game. You can do the CE tutorial to get the basics, but there will be a very steep learning curve once you try to apply that to an actual game. I can also explain you how this specific trainer works: it basically replaces the part of the game's code triggered when the enemies catch the heroine, with a few new assembly instructions. My new instructions access 2 of the game variables: one named "H_scenestart" (controls when to start the H-scene) and one named "H_scene" (that controls which scene to play, it's where I put the ID of the atk sprite variants). If you set these variables in the right function, there's not much more to do, eg. the handling of clothes is already built in the game (eg. "spr_H_basilisk_atk" is the name of the sprite I pass, then the game appends _underwear to it automatically and it will trigger the actual final sprite "spr_H_basilisk_atk_underwear").
Now this is how the trainer works but the hard part wasn't to write this, rather it was to find the variables and functions in the first place, in particular, the game makes heavy use of pointers. The good news is that I've already done most of it for this game so you can reuse a lot of my existing code.
I'd recommend you to start with the cheat engine tutorial until step 7, or at least step 6. If you don't succeed step 7 you won't be able to write any sort of mod, but you can still use CE to change basic things like HP etc. Then once you're done with step 6/7, run Moon Rhapsody with the Cheat Table I shared previously. I already managed to get
all of the pointer offsets to the GameMaker variables and their name, for example, HP is around the begininng:
and the Hscene and Hstart variables I mentioned previously are under 'obj_game':
I've also managed to dump all the script names and their location in the code, attaching the file.
Now for example, say you want to write a mod that regenerates HP over time. You'd look for the function "obj_game_Step_2" in this file ("step_xxx" are the gameMaker "Update()" functions, run once per frame, for each object).
The file says it's at Moon Rhapsody.exe+130dd86 , so for example, we can go to this address, and add auto-assemble to inject code that retrieves the "hp" variable above, and increments it.