unleveled training cost?

Discuss modding questions and implementation details.
Post Reply
User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

unleveled training cost?

Post by John Doom »

I'd like to make a mod to make training cost not scale with player level, however...

Code: Select all

        public virtual int GetTrainingPrice()
        {
            int costPerLev = IsMember() ? memberTrainingCost : nonMemberTrainingCost;
            return costPerLev * GameManager.Instance.PlayerEntity.Level;
        }
...I don't see how I can mod this function without changing the sourcecode itself. I know there are unscaled mods for loots, dungeons and spells, I'd like to know how they work and see if their solution can be applied here as well. Help? :?:

UPDATE: I've found "Unleveled Spells"' source code, I understand the modder replaced all the effects using a specific Daggerfall's function. I don't think the same is possible with training. Do you know how other mods did it?

UPDATE2: I've found "public static void RegisterCustomUIWindow(UIWindowType windowType, Type windowClassType)", this would let me replace/override the whole training window, though it seems a bit too much to me :?

User avatar
Shapur
Posts: 154
Joined: Wed Apr 21, 2021 5:11 pm
Location: Czech Republic
Contact:

Re: unleveled training cost?

Post by Shapur »

You could make a pull request on github.
If it's just something simple you need (like making some functions virtual), it will probably be added to the game relatively soon.
Link to my github here.
And here is my nexus profile.

User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Re: unleveled training cost?

Post by John Doom »

:) Hopefully. In the meantime I went with the window replacement: viewtopic.php?f=14&t=5254

Post Reply