I would like some help creating a mod which allows unlimited training sessions.
-
- Posts: 5
- Joined: Sat Jan 30, 2021 11:43 pm
I would like some help creating a mod which allows unlimited training sessions.
I am sorry if this is not the right place to ask, but could anyone tell where I would need to start to create a mod to allow trainers to give training sessions past the 51% mark?
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: I would like some help creating a mod which allows unlimited training sessions.
IGuild interface has an int GetTrainingMax(skill) method, with only one implementation (in abstract class Guild) which returns defaultTrainingMax, a constant equal to 50.
A mod would have to subclass guilds to return higher values, but I don't know if GuildManager allows to override existing guilds or only add new custom ones...
A mod would have to subclass guilds to return higher values, but I don't know if GuildManager allows to override existing guilds or only add new custom ones...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: I would like some help creating a mod which allows unlimited training sessions.
Haven't looked at the code, but you could probably override the guild service window the same way I do with the tavern menu.
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: I would like some help creating a mod which allows unlimited training sessions.
I usually am completely against using reflection, but in this case I think I'd want the default training max to be modified. Currently it's a const but it could be changed to something that reflection could change.
Use overrides for this, either for UI window or guilds, just to affect an underlying constant value would be a bad thing IMO.
Just FYI new guilds can alter this default, and the Archaeologists guild (mod) allows all it's skills to be trained up to the players INT level. Seemed appropriate for academics.
Use overrides for this, either for UI window or guilds, just to affect an underlying constant value would be a bad thing IMO.
Just FYI new guilds can alter this default, and the Archaeologists guild (mod) allows all it's skills to be trained up to the players INT level. Seemed appropriate for academics.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods