Trollden

Member
Aug 8, 2017
253
326
It turns out to be just about the same as with enabling crisis events in terms of there being an Action with a name, requirement and a label it calls, but I have to manually add it to the list of actions available for the room the way it is set up in the script.

Take for example a look at the Human Resources / Office room
Code:
office = Room("main office","Main Office",[],office_background,[],[],[policy_purhase_action,hr_work_action,supplies_work_action,interview_action,sell_serum_action,pick_supply_goal_action,set_uniform_action,set_serum_action],False,[0.85,0.82], tutorial_label = "office_tutorial_intro")
The actions inside of [] seems to be an unnamed list so cannot append to it, if that had not been the case one could enable room upgrades without touching the main script at all unless there is something I am unaware of.

Having figured out what is required I'll add a "Purchase Upgrades" action to the office and then from there have a menu where you can buy things which will satisfy the requirement for the action to show and then manually add the action to any applicable room.

After having this we can get creative, have the action trigger a label that for example add new objects to the room. Purchase a couch, change modifiers in the room etc. Increase marketability, efficiency and so on.
Going to try making a small example that showcases what can be done with it (essentially everything that can be done with a crisis), so something like:

You don't have permission to view the spoiler content. Log in or register now.
 
  • Like
Reactions: The Grifter

ParadigmShift

Member
Mar 4, 2019
112
145
It turns out to be just about the same as with enabling crisis events in terms of there being an Action with a name, requirement and a label it calls, but I have to manually add it to the list of actions available for the room the way it is set up in the script.

Take for example a look at the Human Resources / Office room
Code:
office = Room("main office","Main Office",[],office_background,[],[],[policy_purhase_action,hr_work_action,supplies_work_action,interview_action,sell_serum_action,pick_supply_goal_action,set_uniform_action,set_serum_action],False,[0.85,0.82], tutorial_label = "office_tutorial_intro")
The actions inside of [] seems to be an unnamed list so cannot append to it, if that had not been the case one could enable room upgrades without touching the main script at all unless there is something I am unaware of.

Having figured out what is required I'll add a "Purchase Upgrades" action to the office and then from there have a menu where you can buy things which will satisfy the requirement for the action to show and then manually add the action to any applicable room.

After having this we can get creative, have the action trigger a label that for example add new objects to the room. Purchase a couch, change modifiers in the room etc. Increase marketability, efficiency and so on.
Going to try making a small example that showcases what can be done with it (essentially everything that can be done with a crisis), so something like:

You don't have permission to view the spoiler content. Log in or register now.
I've done something similar with my current mod project. By using bedroom.action.append(pc_action) (and creating all the requisite action files) I can add an action to the "do something" menu of the MC's room.

I attached an example of what I did so far below. Its probably got errors, I'm not done with it yet. Creating a static menu like this is easy, but I'm trying to redo the menu design to be dynamic, so I can append to it later, making adding new fetish variables easier and more mod friendly, without having to modify this mod to add new menu options.

The overall goal is to create the basis for a mod architecture that future mods can build on top of, including a "Mod Initialization" prompt that will function separately from the crisis listing, so adding new mod content would basically be appending an initialization action to a list in the PC mod, and then having the MC do this action, forcing the initialization code to run. Otherwise I fear in the future, as we keep adding more mods, and using crisis events to initialize each one, we'll end up with 47 (or more!) separate crisis events (one for each mod) that have to randomly trigger to get the mod loaded.

Unfortunately I'm struggling with getting the array to behave. I'm missing something. Something stupid probably.
 
  • Like
Reactions: The Grifter

LZ_Starbuck

Member
Mar 25, 2019
189
337
Awesome, glad to hear this is something achievable. Maybe we can put a bug in Vrens ear about adding some kind of universal action to every room, so that every room at least has a starting point. Make it like, masturbating or something. If there's any girls in the room they take turns making comments, offer to help, etc. If there aren't then... Well... It's a lonely wank haha
 

Kaiww

Member
Jul 8, 2018
148
81
I think the last tier was broken in 14.0 , but it is working in 14.1.
I can confirm that at least for me it seemed to be working in 14.1. But i tend to mod the Game always a bit for my personal use.....
 

ParadigmShift

Member
Mar 4, 2019
112
145
Bah....Im throwing in the towel on this for now.

Attached the debugged "final" copies of my two mods ie they work and dont throw errors. Height serum is pretty much complete as is, unless someone (probably not me) wants to write a lore-friendly intro event for the serum initialization event. Or until I figure out how to get my fetish toggle menu to work the way I want.

The PC mod is....simple. Too simple imo.
Creates new variables, toggles those variables. States are -1/0/1. Disabled/Off/On. Variable handles are in the file. Variables are initialized at -1/Disabled. They will need to be set to 0 or 1 by at least 1 mod file to enable their function.
I'm personally not happy with it right now. I don't know enough about python and arrays to create a nested action array to figure out how to do what I want it to do. Also, the initialization event sucks. I might write some lore friendly dialogue in the future, about your mom giving you an old laptop to help with your new business or something like that. Or someone else can. I'm not really a writer.

Hopefully these can help be examples to other modders for how to initialize mod content using crisis events, create new serum traits, add new location actions, etc.
 

ParadigmShift

Member
Mar 4, 2019
112
145
Awesome, glad to hear this is something achievable. Maybe we can put a bug in Vrens ear about adding some kind of universal action to every room, so that every room at least has a starting point. Make it like, masturbating or something. If there's any girls in the room they take turns making comments, offer to help, etc. If there aren't then... Well... It's a lonely wank haha
No need, its already there...kinda. The "Room" class has an "actions" attribute built in as part of it. Most rooms, the "actions" array is empty, but you can add an action to any room by appending to the actions list.

Script.rpy Lines 8698-8720 list out the various "Room"s, so call (example) "downtown.actions.append(sleep_action)" and now you can sleep downtown just like you can in your bedroom. Ya hobo!
The "Do Something" dialogue basically just lists out the actions available in that "room". So create the "Action" (see lines 8650-8686 for examples, as well as their attached requirement check functions and descripton functions) and then append the action to whatever room you want it in.

I fully expect someone to create actions now for sleeping in mom and sis's rooms at night now (stares at Pilotus13.....) Would be an excellent idea for a mod.

I really do think we need to put our heads together first and figure out a better universal system for simple mod initialization before we have 100 crisis events to initialize 100 different mods.
I'm thinking 1 crisis event to initialize 1 mod that creates an action in some room.
This action should :
1. run a list of actions, basically calling every single action in the list. (ex call it mod_initialize_list)
2. Each action should have a requirement to check if the mod is initialized already. If so, skip. ie "if random_mod_initialized: Return False". L3944-4031 are all action requirement functions. I used versioning as the check variables in my mods.
3. Each action should initialize its attached mod (with limited dialogue preferably), then set a variable to indicate the mod is installed. "random_mod_initialized = True"

This way, each new mod just has to append its new action to mod_initialize_list. And installing new mods would only require running the Initialize function we created at the start rather than waiting for a random crisis initialization.

This is what I was trying to figure out and failing at. I was trying to do it with my PC mod. Seemed logical.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
If it easy to create new actions and associate then with rooms, then yeah we could set it up so new content can load itself without touching script.rpy, and might be able to make them all compatible with each other. Setting it up as a room action would also allow creating settings, so if wanted users to be able to customize things, like with difficulties or disabling certain things, etc. I'm on board with getting something like this organized.
 

ParadigmShift

Member
Mar 4, 2019
112
145
This issue I run into is the room object has an actions attribute that contains the actions array. I can easily add to an existing action to that array. But I cant quite wrap my head around how to create a totally new action array. Cant figure out if I need to create a totally new object with its own action array, or if there's some other way to do this.

When you use the "menu:" function, you can easily create menu options, and then the functions behind them. By appending to an action array, you can just keep dynamically adding new options to the menu infinitely, since it builds the menu dynamically based on all available actions in the array, without having to go back and modify the original menu code.

The challenge I can't figure out is this:
1. Can I put an action array INSIDE an action array; ie can I put an appendable list of menu actions nested behind an appendable list of menu actions.
2. HOW?
3. How to get the menu's to display properly so it behaves like a normal nested menu / a menu with options leading to another menu with options leading to actions OR another menu with options, etc etc ad infinitum.

Frankly trying to wrap my brain around it all gives me a headache. I'm not that great with object oriented coding.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
This issue I run into is the room object has an actions attribute that contains the actions array. I can easily add to an existing action to that array. But I cant quite wrap my head around how to create a totally new action array. Cant figure out if I need to create a totally new object with its own action array, or if there's some other way to do this.

When you use the "menu:" function, you can easily create menu options, and then the functions behind them. By appending to an action array, you can just keep dynamically adding new options to the menu infinitely, since it builds the menu dynamically based on all available actions in the array, without having to go back and modify the original menu code.

The challenge I can't figure out is this:
1. Can I put an action array INSIDE an action array; ie can I put an appendable list of menu actions nested behind an appendable list of menu actions.
2. HOW?
3. How to get the menu's to display properly so it behaves like a normal nested menu / a menu with options leading to another menu with options leading to actions OR another menu with options, etc etc ad infinitum.

Frankly trying to wrap my brain around it all gives me a headache. I'm not that great with object oriented coding.
To be honest i'm not 100% certain I understand what you are attempting.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
Bah....Im throwing in the towel on this for now.

Attached the debugged "final" copies of my two mods ie they work and dont throw errors. Height serum is pretty much complete as is, unless someone (probably not me) wants to write a lore-friendly intro event for the serum initialization event. Or until I figure out how to get my fetish toggle menu to work the way I want.

The PC mod is....simple. Too simple imo.
Creates new variables, toggles those variables. States are -1/0/1. Disabled/Off/On. Variable handles are in the file. Variables are initialized at -1/Disabled. They will need to be set to 0 or 1 by at least 1 mod file to enable their function.
I'm personally not happy with it right now. I don't know enough about python and arrays to create a nested action array to figure out how to do what I want it to do. Also, the initialization event sucks. I might write some lore friendly dialogue in the future, about your mom giving you an old laptop to help with your new business or something like that. Or someone else can. I'm not really a writer.

Hopefully these can help be examples to other modders for how to initialize mod content using crisis events, create new serum traits, add new location actions, etc.
Hey, do these mods work correctly if you acquire the serum, save, shut the game down, restart the game, and then load your save game? My experience so far has been that variables that get declared in INIT blocks don't get saved with save games.
 

ParadigmShift

Member
Mar 4, 2019
112
145
So far....I havent had an issue... /shrug
To be honest, I've been more focused on getting these thing to work, I havent actually 'played' the new version or given them extensive play testing yet.

As for the mod core, I think I almost have it.....
It came to me in a dream....no seriously, I figured it out last night while I was asleep. It's not what I wanted to do before, but it should function for initializing mods. Basically creates a new "crisis" like system that you append an action to, and it runs the entire list of actions when the function is called. The crisis system creates a similar list, then randomly chooses one. This system doesn't choose, it just does them all.

The most testing I've done in that regard is I can create a new game, initialize the mods, research a serum, save, quit, reopen the game, load, and all the actions and serums and such still exist. Console shows all the variables are still set how they were when the game was saved.
I personally have never run into the bug you mentioned. The save games in renpy are supposed to be a snapshot of the game state, including all objects and variables. Everything. Never had something reset like you mentioned.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
Having objects not saved when set during an init block was something I ran into when I initially attempted my custom serums. Basically, i moved the serum list to an init block, and then every time the game was reloaded, the serum list was empty, effectively resetting all progress towards research, as well as blocking you from researching any serum traits previously researched.

Now I'm trying to track down another bug in my mod... for some reason, no matter when I create her, setting Starbuck's hair color to blond automatically sets Stephanie's hair to blond also...
 

ParadigmShift

Member
Mar 4, 2019
112
145
Hey, do these mods work correctly if you acquire the serum, save, shut the game down, restart the game, and then load your save game? My experience so far has been that variables that get declared in INIT blocks don't get saved with save games.
Alright, give these a try.
Three files.
One is the Mod Core, which is basically a repurposing of my PC mod. Got rid of the fetish toggle stuff, Ill revisit that at a later date. Creates the PC in the players room, which has the functions to initialize mods.

Second file is my growth serum mod file, modified to work with the mod core. Basically just append the event to mod_list rather than crisis_list, and no weight is necessary, unlike crisis_list. Initializes via the PC in the MC's room.

Third file was a 3rd dummy file I made just to test that the mod_list and initialization functions would work with multiple mods. Once initialized via the PC, it creates a "masturbate" action in the mall, along with a little scene to go with it. Its meant to be funny. I almost quoted Monty Python in it, but I resisted the urge. Also, I can personally make an appearance in the scene, just for laughs. The file also can be used as an example for how to create new location actions or serum traits to function with the MOD_CORE.

The MOD_CORE and growth_serum mods are NOT compatible with my original pc and serum mods. So make sure to remove those and start a new game if you have to.

The only thing I dislike is it isnt possible to use the mandatory_crises_list instead of crisis_list to run the MOD_CORE intialization, because the mandatory_crises_list doesnt exist until you start a new game (it's an attribute of mc.business and the object is created when you start a new game. crisis_list is initialized at init 1 in crises.rpy, so exists at game launch. This means the player is forced to wait and get lucky with the crisis event to initialize the MOD_CORE and I see no way around that.
 

ParadigmShift

Member
Mar 4, 2019
112
145
Having objects not saved when set during an init block was something I ran into when I initially attempted my custom serums. Basically, i moved the serum list to an init block, and then every time the game was reloaded, the serum list was empty, effectively resetting all progress towards research, as well as blocking you from researching any serum traits previously researched.

Now I'm trying to track down another bug in my mod... for some reason, no matter when I create her, setting Starbuck's hair color to blond automatically sets Stephanie's hair to blond also...
Ill dig into that later and see if I can figure it out if you haven't yet. I'm done staring at code for the day I think.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
Well, I've managed to pull all of my content mod out of script.rpy with one exception. For the vaginal fetish event, it has the girl sleep with you that night, then you wake up the next morning and sex continues. To do this I had to write it into the time advance function for an additional time slot to run mandatory events after it had shown the day summary screen. The way Vren wrote his morning events, he made a new morning crisis list, but it doesn't have the option to run stuff from the mandatory crisis list. So, going forward, I'll be able to still add the morning events from the mod, but only as random events, not "scripted" to occur immediately following the girl the spending the night, which is frustrating.
 

ParadigmShift

Member
Mar 4, 2019
112
145
Well, I've managed to pull all of my content mod out of script.rpy with one exception. For the vaginal fetish event, it has the girl sleep with you that night, then you wake up the next morning and sex continues. To do this I had to write it into the time advance function for an additional time slot to run mandatory events after it had shown the day summary screen. The way Vren wrote his morning events, he made a new morning crisis list, but it doesn't have the option to run stuff from the mandatory crisis list. So, going forward, I'll be able to still add the morning events from the mod, but only as random events, not "scripted" to occur immediately following the girl the spending the night, which is frustrating.
Could fake it out kinda. Remove the time_advance function, pretend like its morning in your event scene, and then just day += 1 and time_of_day = 1. Kind of a poor mans time advance, forcing the time to advance to the next morning. That way its now the next day and morning without calling time_advance.

It's hacky, but it might work.

Downside is it would skip all the other stuff that happens when the time advances ie. serum duration ticks, chance of events, etc

Or have the event in the "morning" crisis list. Who's to say they came to you at 9pm or 2am? 2am could be morning. Its all just a matter of perspective.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
Yeah, I suppose for the sake of keeping the narrative it would work okay. I'll need to design content going forward with the limitations of not modifying base files in mind though, to keep from designing around it the way I have been doing.

That being said, I'm looking forward to getting everything compatible with 15.0 and writing new content soon.
 

ParadigmShift

Member
Mar 4, 2019
112
145
Yeah, I suppose for the sake of keeping the narrative it would work okay. I'll need to design content going forward with the limitations of not modifying base files in mind though, to keep from designing around it the way I have been doing.

That being said, I'm looking forward to getting everything compatible with 15.0 and writing new content soon.
I think most of us are. Player LR2 without the fetish content just isn't the same. I know I'm eagerly awaiting your updated mod. That and Vren's 15.1 version.

Anyways, let me know what you think of the mod core. Any modder, really. I'm hoping its something that is easy utilize for any modder, that requires learning a minimal amount of new code to make mods compatible with it. And any feedback would be appreciated, since I want it to be the basis of a new mod architecture. Its the ideal place to define functions and variables that are common between multiple mods.

I think, with the new serum system, its easier than ever to create new serum traits. And with the mod core, its easier than ever to add those serum traits, as well as new location actions, to the game. All without modifying any core game files.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
I'll take a look this evening. After sleeping last night, I got up this morning and realized that I can basically just bypass Vren's end of day code and basically copy paste it into my event. This would have the benefit of also bypassing the overnight random crisis (girl showing up at your place drunk), as well as advancing time from early morning to morning, simulating you "sleeping in" with your partner. It should work, but I'll have to wait until after work to try and prototype it.
 

LZ_Starbuck

Member
Mar 25, 2019
189
337
I think most of us are. Player LR2 without the fetish content just isn't the same. I know I'm eagerly awaiting your updated mod. That and Vren's 15.1 version.

Anyways, let me know what you think of the mod core. Any modder, really. I'm hoping its something that is easy utilize for any modder, that requires learning a minimal amount of new code to make mods compatible with it. And any feedback would be appreciated, since I want it to be the basis of a new mod architecture. Its the ideal place to define functions and variables that are common between multiple mods.

I think, with the new serum system, its easier than ever to create new serum traits. And with the mod core, its easier than ever to add those serum traits, as well as new location actions, to the game. All without modifying any core game files.
I'll try to get a basic mod version out tonight or tomorrow. Not very much new content in this version, but it should atleast be functional with 15.0
 
3.40 star(s) 127 Votes