Create and Fuck your AI Slut -70% OFF
x

makaiforce

Member
Nov 26, 2017
220
125
191
Hi! I'm new to RenPy in general, but so far it's been fairly intuitive for the most part. This is how I'd do it:

  • First you'll need to decompile script.crpy and the corresponding enemyname.crpy files of the enemies you want to mod into *.rpy files (found in "game" and "game/Enemies" respectively).

View attachment 5389743
I use un.rpyc to do this. Just place it in the "game" folder and run the game to automatically decompile all .crpy files.

  • Then you'll need to write code for the enemies. Open the enemyname.rpy file of the enemy you want to mod in a text editor and try to understand how the fight works. Decide where the draining should happen, or come up with new code to give the enemy a new attack or pattern. Whenever you want them to lower the player's stats you'll need to call lostatt(), which looks like this:
    • lostatt(stat=None, amount=1)
    • The stat should be "STR","AGI","VIT","INT" or "CON". If you type "None" or don't provide a name, the stat decreased will be random.
    • The amount represents how many points of that stat will be lost, it's 1 by default but you can make it higher.
  • This means that you'll have to write something like this to use that function (the $ sign at the beginning is important):
    • $ lostatt("VIT") - Lose 1 point of VIT
    • $ lostatt("INT", 2) - Lose 2 points of INT
    • $ lostatt() - Lose 1 point of a random stat
    • $ lostatt("None", 5) - Lose 5 points of a random stat

  • Now, if you want the enemies to remember how much of each stat they have drained, there's 2 ways I can think of
    • In script.rpy add a variable to keep track of this. Around line 181 of the script, there are a bunch of variables dedicated to enemies, so if you wanted Laura to drain INT, for example, you could add something like:
      • default laura_drained_int = 0
    • Now you can use this variable in the enemy code, for example:
      • $ lostatt("INT", 2)
      • $ laura_drained_int += 2
    • This way you can keep track of that variable during the entire run, and use it to alter the enemy's behaviour

  • Way number 2
    • In the enemy file itself you can do the same, add a variable at the top of the code just like we did in script.rpy, but I'm unsure if this variable gets saved during the entire run or if it gets reset every fight.

I hope this helps you design an interesting battle!
tx so much for all the info, i'll try it tonight!
 
  • Heart
Reactions: pekomon

DogMammoth

Newbie
May 24, 2018
23
32
76
tx so much for all the info, i'll try it tonight!
In Pekomon's 2nd way of making the variable, you would have to keep it from re-instantiating itself every time the encounter loop runs, so it is a lot cleaner to just store that in script.rpy around line 180 with the rest of them like Pekomon first suggested. Ines has a similar mechanic that stores her affection between encounters, you'll find her variable there too as reference.
 

DogMammoth

Newbie
May 24, 2018
23
32
76
Me and Pekomon got our mods merged and updated with new content. My three enemies and Pekomon's hardmode, sandbox mode, and his Sarah enemy can now be found in one place.

Additionally, I added a new character, Kenzie, who I am thinking about making a recurring needy step-sister type of character who has unique events. Pekomon made the battle selector UI smoother and I added a toggle for sandbox and hardmode to the options menu so players can toggle them mid-game without need for restarting. All of the customization for the modes still needs to be done in the .rpy files.

This mod needs a new run to work properly. Let us know if I forgot a file or if anyone runs into an error.



View attachment kenzie3.webp
 
3.60 star(s) 30 Votes