Modding Question: How does one change the stats of a serum effect? Which files do I need to edit?
Three groups of serum trait parameters can be distinguished:
1) parameters related to researching the serum trait: These are 'research_needed' and 'clarity_cost' - how many points of research are needed to researched this trait, and how much clarity must be spent to make this research available. And also 'start_researched' and 'start_unlocked' - this is the state in which the serum trait is in according to the scenario at the start of the game.
2) parameters related to serum design properties and serum production: These are 'research_added' and 'clarity_added' - the same as 'research_needed' and 'clarity_cost' for the serum trait, but related to the serum design. They are summed for all serum traits included in the design and determine the number of points of research needed to research the serum and the amount of clarity needed to unlock it. 'production_added' determines the final cost of the serum design. 'slots_added' and 'duration_added' determine the number of additional slots for serum traits in the serum design and its duration.
'base_side_effect_chance' is the chance of adding side effects to the serum design when mastery_level == 1.0.
'mental_aspect', 'physical_aspect', 'sexual_aspect', 'medical_aspect', 'flaws_aspect' are parameters related to contract requirements and market demand for the serum design. I will not review them in detail. 'attention' is a parameter that affects the suspicion of local authorities when selling large quantities of serum with its high value. When the suspicion becomes high enough, some script event is triggered.
3) This is actually the eeffect of the serum on women. There are four functions in all: 'on_apply', 'on_remove', 'on_turn', 'on_day'. Each of them takes three parameters - Person (the girl who took the serum), Design (a copy of the serum's design) and add_to_log (a service parameter that determines whether the comments of events caused by the serum will be displayed in the window in the lower right corner of the screen).
These functions are described separately, and their name is passed as this parameter to the serum trait initializer.
Since the reference to the serum trait is not passed to these functions, and it is quite difficult to get it from the serum design, the game does not implement the influence of mastery_level on the effect of the serum trait.
Yes, I forgot about the display properties of the serum trait: 'name', 'desc', 'positive_slug', 'negative_slug' - this is the text that is displayed when viewing the serum trait.
However, two parameters should be considered separately: 'requires' and 'exclude_tags'. 'requires' is a list of serum traits that must be researched before research for that trait can begin. These are the names of the variables under which these traits were created, without the quotes. 'exclude_tags' is a list of character strings - tags. If a trait in a serum design has such a tag, then adding another trait with the same tag to the serum design becomes impossible.
The last one is 'tier' - the level of "advancement" of your laboratory at which this research is possible.
In the original Vren game, serum traits are described in the file "\game\major_game_classes\serum_related\_serum_traits.rpy". At the beginning of the file there is a block describing the "on_..." functions for each trait. You can add your own functions there. In the second part of the file, in the block defined by "label instantiate_serum_traits()", the serum trait is actually added to the game:
name_of_trait = SerumTrait(name = "Any trait", desc ...)
Since this block is executed only once - when starting a new game, if you create a new trait, when loading an old saved game you will not see this new trait in the game. It will only be available when you start a new game. By the way, simply describing functions and creating a new feature is not enough. You should add it to 'list_of_traits'. If this is meant to be a common trait, as most are in this game, then it should be added to the list at the end of the file 'list_of_trait.append(name_of_trait)'. Or do the same thing, but in the code of the corresponding event, if this trait becomes available in the script.
However, you can add a trait to an already started game, but only by using the console. In principle, the “on_...” functions, if you have already defined them in the file and reloaded the game, do not need to be added. You just need to copy the expression 'name_of_trait = SerumTrait(name = "Any trait", desc ...)' that you have already written and run it in the console by pasting it there and pressing Enter. After this, also issue the command 'list_of_trait.append(name_of_trait)' in the console. Naturally, the approximate name of the serum trait is given here. You must write everything yourself, similar to what you see in the file.