[Modding API] Character modifier handling enhansment

Things that we aren't going to implement
psihius
Fast Inserter
Fast Inserter
Posts: 192
Joined: Mon Dec 15, 2014 12:47 am
Contact:

[Modding API] Character modifier handling enhansment

Post by psihius »

TL;DR
When character modifier changes are coming from multiple sources, keeping track of modifications becomes impossible if it's not a monolithic code base

What ?
I suggest an addition to modding API and/or change how character modifiers are handled by adding an API that can be used to add/modify/remove modifiers on player stats instead of just globally overriding the value.
On the developer side I think this might be something like

Code: Select all

player.addModifier({"type":"speed","value":0.5,"tag":"rpg"});
player.removeModifier({"type":"speed","value":0.5,"tag":"rpg"});
player.changeModifier({"type":"speed","value":0.1,"tag":"rpg"});
Where "tag" is optional and may default to "factorio" or something.

In the long run it might be a nice idea to discourage direct writing into modifiers and make them read only for public side.
Why ?
With 3RA and FactorioMMO tools we run into an issue when using our admin powers in various scenarios we get our player stats reset. In particular that's relevant for our current RPG server where unless you level up or change a class - you can't restore your RPG stats unless you run a command (not advisable by the author). If more scenarios/mods are getting involved, that might escalate the issue even more.
I haven't checked if it will also affect equipment bonuses, or are equipment bonuses applied on top internally.
Tekky
Smart Inserter
Smart Inserter
Posts: 1040
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: [Modding API] Character modifier handling enhansment

Post by Tekky »

You may want to ask a moderator to move this thread to the Modding interface requests sub-forum.
Post Reply

Return to “Won't implement”