4.60 star(s) 45 Votes

trentrentren

Newbie
May 24, 2020
47
64
Anyone figure out how to format a json for modded events? I unpacked the RPA and I can see how to add new events as a .rpy file but I'm not seeing how to do it json style in the mod folder
 

Radnor

Member
Game Developer
Nov 9, 2021
365
942
In 3.0 I couldn't get .mp4 videos to work when modding, only .webms work. Is this expected behavior?
Movies are handled by RenPy, if RenPy can't show it, i can't do anything to fix it.
Maybe unsupported codec, no idea.

Anyone figure out how to format a json for modded events? I unpacked the RPA and I can see how to add new events as a .rpy file but I'm not seeing how to do it json style in the mod folder
Random events can't be done as json, only as rpy file. You make rpy files with event content and put it inside <game folder>/game/mods folder. Game will see and load it.
 

trentrentren

Newbie
May 24, 2020
47
64
This very short mod adds an event where a bot with a psychocore stability of 0 has a chance to start cum collection protocols on you while you are sleeping. The bot will continue to ride you until you pass out. How many times you cum is determined mostly by how good the bot is at sex. If you bot is at least C grade in sex or better, you will gain mood from this experience based how many times you were milked. If they are D or below you will instead lose mood. In either case, you will gain a small amount of sex experience and the bot will gain a large amount of sex experience based on how many times you came.

I do not know the exact odds of this event happening; I set the return value for the random event to 100 so it should happen most nights. The bot chosen will be the first in your capsules that has 0 stability. If I knew how to pass variables to the random event handler and the choice handler so that it could then pass that variable to the event it calls I would be able to randomize which bot with 0 stability was chosen. I could have directly called the next labels and bypassed the random event handler but that might break something, so I stuck with matching how the other sleep_events do it. Feel free to use this as a base example to add your own sleep_events. Enjoy!

Tags for this mod: Femdom, Post-Orgasm Torture, Penis Milking, and a passing mention to Energy Drain.
 
  • Like
Reactions: Rabenze and Radnor

dmmt

Well-Known Member
May 8, 2020
1,007
979
oh boy...lol Bots I am training up to sell, I KEEP at 0 Stability, to try and get XXXX Smart/+/++ to enhance the training rates. Sounds like that means a lot of milking. lol
 
  • Haha
Reactions: Radnor

Radnor

Member
Game Developer
Nov 9, 2021
365
942
This very short mod adds an event where a bot with a psychocore stability of 0 has a chance to start cum collection protocols on you while you are sleeping. The bot will continue to ride you until you pass out. How many times you cum is determined mostly by how good the bot is at sex. If you bot is at least C grade in sex or better, you will gain mood from this experience based how many times you were milked. If they are D or below you will instead lose mood. In either case, you will gain a small amount of sex experience and the bot will gain a large amount of sex experience based on how many times you came.

I do not know the exact odds of this event happening; I set the return value for the random event to 100 so it should happen most nights. The bot chosen will be the first in your capsules that has 0 stability. If I knew how to pass variables to the random event handler and the choice handler so that it could then pass that variable to the event it calls I would be able to randomize which bot with 0 stability was chosen. I could have directly called the next labels and bypassed the random event handler but that might break something, so I stuck with matching how the other sleep_events do it. Feel free to use this as a base example to add your own sleep_events. Enjoy!

Tags for this mod: Femdom, Post-Orgasm Torture, Penis Milking, and a passing mention to Energy Drain.
You can do something like this, i guess:
Code:
init python hide:
  @random_event("home_rest")
  def home_rest_test():
    ## check if event is valid at all
    valid_bots=[bot for bot in home.sexbots if bot and not bot.chassis.is_disabled]
    if valid_bots:
      return "home_rest_test_init",100

label home_rest_test_init:
  ## event is valid, now select bot we will use
  $valid_bots=[bot for bot in home.sexbots if bot and not bot.chassis.is_disabled]
  $bot=renpy.random.choice(valid_bots).id
  ## supply bot id as parameter to event label
  choice("home_rest_test:"+bot) "Continue"
  $valid_bots=None
  return

label home_rest_test(bot):
  ## convert bot id to actual bot object
  $bot=find_character(bot)
  header "[home]"
  "Event with bot: [bot]"
  choice("advance_time") "Continue"
  $bot=None
  return
We add $something=None to avoid objects leaks/forgotten references, nothing horribly will happens if you don't, but it can add up over time sometimes. Only bots and items should be None'ed at end of event label.

Also when you want to put "blablabla Jane's thing" you can write "blablabla [bot.posname] thing".

P.S.: I have changed a bit how random events are handled, with 0.4.1 it will be possible to roll events with parameters, avoiding re-gathering things in init label as above.
 
Last edited:
  • Like
Reactions: trentrentren

Radnor

Member
Game Developer
Nov 9, 2021
365
942
Just in case, list of current random event hooks:
Code:
train_combat
train_electronics
train_mechanics
train_sex
train_social
dump_site_scavenge
home_sleep
home_rest
home_work
robosechs_private_room
robosechs_relax
Events will be triggered after normal situation occurs, hijacking player choices.
 
  • Yay, new update!
Reactions: Canto Forte

trentrentren

Newbie
May 24, 2020
47
64
ummmm wouldnt a guy be dead? LMAO
If this game had a health stat for the main character I'd add in HP damage for sure lol. The highest possible random roll for loads collected is 10*sex_skill which is 7 at S-rank, so 70 loads at most. Super easy to edit this in the .rpy file if it is too unrealistic for you. The lower bound is 5+sex_skill, so a minimum of 11 at S-rank.
The mC gets 10xp per orgasm, and the bot gets 100xp per orgasm. If the xp seems unbalanced I can reduce it in the next version once I figure out how to pass variables with the Choice+ thing. I tried to get it to work but it was concatenating the variable I was trying to pass with the label name.
 
Last edited:

Daedalron

Member
Oct 19, 2018
157
139
Radnor Wondering about a little something. For the values of the bots "list_target_chances" and "list_target_tag_chances", are only natural numbers allowed, or can we also use decimals, like a 0.5 chance? And is a value of 0 also allowed? For example using a "dump_site_scavenge" chance of 5 (or whatever number), and then using the "all", "cheap", ... tags at 0, so that the bot can only ever be found in the dump. Would that work?
I'm asking because I'm trying to introduce variants of a single model, and since for A and S-ranks the chance is already quite low, if I need to divide it further into the multiple variants, I would need to use decimals.

By the way, found a small bug about the bot id names and the way the game looks for the asset packs directories. I was trying to use the same assets for multiple bot ids (variants of the same model), and it went that way:
JSON:
  "asset_packs": [
    ("bots BOTNAME","mod_bots BOTNAME"),
    ("bots BOTNAME_a","mod_bots BOTNAME"),
...]
But when you find a BOTNAME_a bot ingame, it will look for assets in a "BOTNAME_a" directory, and not the "BOTNAME" directory mentioned in the asset_packs list. In the end, it was not a big issue, since it can be solved easily by changing the first id from "BOTNAME" to "BOTNAME_0".
Note that this bug was in the 0.3 version, I haven't tested it again in 0.4 since I have already altered all the bot id names in my JSON.
 
Last edited:

Radnor

Member
Game Developer
Nov 9, 2021
365
942
Radnor Wondering about a little something. For the values of the bots "list_target_chances" and "list_target_tag_chances", are only natural numbers allowed, or can we also use decimals, like a 0.5 chance? And is a value of 0 also allowed? For example using a "dump_site_scavenge" chance of 5 (or whatever number), and then using the "all", "cheap", ... tags at 0, so that the bot can only ever be found in the dump. Would that work?
I'm asking because I'm trying to introduce variants of a single model, and since for A and S-ranks the chance is already quite low, if I need to divide it further into the multiple variants, I would need to use decimals.

By the way, found a small bug about the bot id names and the way the game looks for the asset packs directories. I was trying to use the same assets for multiple bot ids (variants of the same model), and it went that way:
JSON:
  "asset_packs": [
    ("bots BOTNAME","mod_bots BOTNAME"),
    ("bots BOTNAME_a","mod_bots BOTNAME"),
...]
But when you find a BOTNAME_a bot ingame, it will look for assets in a "BOTNAME_a" directory, and not the "BOTNAME" directory mentioned in the asset_packs list. In the end, it was not a big issue, since it can be solved easily by changing the first id from "BOTNAME" to "BOTNAME_0".
Note that this bug was in the 0.3 version, I haven't tested it again in 0.4 since I have already altered all the bot id names in my JSON.
These values used in randint call, during which values are converted to int. As result 0.5 is rounded to 0. And when doing weighted choice elements with zero weight are skipped. So minimal weight is 1.

Maybe i will rework wchoice function to check if floats are present and normalize weights internally, so it would still work with randint, but without losing of precision. But no promises.

I thought asset packs issue was fixed sometime ago, but just checked code, well, i guess i will try to add fix to 0.4.1. Generally you want to put longer id earlier, so it would be higher priority. Will add internal sorting by id when checking asset packs.

0.4.1 will be released in a couple of days i think, will add few internal fixes and some minor qol stuff overlooked by 0.4.0. Will update first post then i guess.
 

Daedalron

Member
Oct 19, 2018
157
139
So as I feared, only natural numbers can be used... Guess my plan can't be used as extensively as I had had hoped...

To explain what I was trying to do, I was creating variants of models that can only be found in the dump, where some of the parts are actually missing (to simulate some other techies salvaging, or junkies harvesting parts). But considering that the rarer models only have a chance value of 2 to be found in the dump, if I create multiple variants (for example a variant with 2 parts missing, a variant with 4 parts missing, and a variant where only the raw chassis is left, on top of course of the variant with all parts to be used in robosechs or flea market), I will be forced to use decimal values.

I could increase the value for all bots in order to get the smallest value as 1, but then the probability of finding bots from my mod would become significantly higher than finding bots from other mods (for people who use more than 1 mod, which I assume are quite a few people)
 

Radnor

Member
Game Developer
Nov 9, 2021
365
942
Yep, i can see your reasoning. I think another option would be moving scavenge bots/parts generation to random events too, this way it will be possible to add extra logic on top of usual bot/part generation. Will try to add it to 0.4.1 too.

Talking about 0.4.1, i kinda planned 0.4.0 as some sort of beta version, but friendly moderator already updated first post, so yeah, i guess i have bit more time for 0.4.1 now :D Shouldn't take too long still, it will be rather minor update.
 

Daedalron

Member
Oct 19, 2018
157
139
Yep, i can see your reasoning. I think another option would be moving scavenge bots/parts generation to random events too, this way it will be possible to add extra logic on top of usual bot/part generation. Will try to add it to 0.4.1 too.
Adding an extra logic to the bot generation would indeed be the best way, hopefully that way we could create a system to replace some parts of the generated bot with a "missing part" (with a probability depending on the bot or part rank), and that would apply to every bot.
That's a much better solution than my "brute force attempt" of creating variants with missing parts, which only works for the bots from my own mod. It will also avoid a lenghty JSON with more than 90 bot model ids for only 28 real models...
 
  • Like
Reactions: Radnor

dmmt

Well-Known Member
May 8, 2020
1,007
979
Adding an extra logic to the bot generation would indeed be the best way, hopefully that way we could create a system to replace some parts of the generated bot with a "missing part" (with a probability depending on the bot or part rank), and that would apply to every bot.
That's a much better solution than my "brute force attempt" of creating variants with missing parts, which only works for the bots from my own mod. It will also avoid a lenghty JSON with more than 90 bot model ids for only 28 real models...

from a game play standpoint; is there a functional difference between MISSING Powercore, and having a Powercore that is irrepairable?
 

Daedalron

Member
Oct 19, 2018
157
139
from a game play standpoint; is there a functional difference between MISSING Powercore, and having a Powercore that is irrepairable?
From a gameplay perspective, not really.
Creating a system of missing parts is mostly not for the powercore or CPU, which can often be destroyed when you find a bot in the dump, but for all the other parts. For example finding a bot where the arms or legs (or both) have already been harvested by other techies.
 
  • Like
Reactions: dmmt
4.60 star(s) 45 Votes