Currently if two mods want to modify the player's running speed modifier dynamically at the same time, there's a problem.
Instead of having a single integer multiplier for speed, what if there was a table? Mods could read and write the table. Keys would be free-form; most mods would put in just one new key. Values would be either +X or *X and would all get applied in some deterministic order (first instinct is + first then *)
Change character modifiers to a table?
Change character modifiers to a table?
Last edited by sparr on Thu May 02, 2019 4:23 pm, edited 1 time in total.
- Ranakastrasz
- Smart Inserter

- Posts: 2195
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Change character speed modifiers to a table?
http://fractalsoftworks.com/starfarer.a ... eStat.html
I would seriously approve of this.
Starsector makes use of this mechanic, and it is very useful.
I would seriously approve of this.
Starsector makes use of this mechanic, and it is very useful.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Change character speed modifiers to a table?
Thanks for that amazing implementation example!
Re: Change character modifiers to a table?
Editing the title of the post, and adding another use case:
If two mods both want to double the player's reach, it would be nice if they could both take effect, with their choice of +X or +X%.
If two mods both want to double the player's reach, it would be nice if they could both take effect, with their choice of +X or +X%.
Re: Change character modifiers to a table?
+1 this idea. We could also have all those modifiers shown in the effects window (maybe only in debug mode?).
Re: Change character modifiers to a table?
further elaboration on ways to make this idea more flexible:
allow a priority level for a change, similar to data/date-updates/data-final-fixes in mod creation.
allow changes to associate themselves with textual tags, which other changes can reference (or other mods can just search for).
allow a change to specify whether it intends to change the base value or is operating as a temporary or permanent bonus to the base.
allow a change to specify whether it should not apply if the result exceeds some cap or floor.
allow a priority level for a change, similar to data/date-updates/data-final-fixes in mod creation.
allow changes to associate themselves with textual tags, which other changes can reference (or other mods can just search for).
allow a change to specify whether it intends to change the base value or is operating as a temporary or permanent bonus to the base.
allow a change to specify whether it should not apply if the result exceeds some cap or floor.
Re: Change character modifiers to a table?
https://lua-api.factorio.com/latest/pro ... otype.html
Stickers can be used to accomplish this for character and vehicle speed, with many mods each being able to stack and manage their own modifiers independently.
Stickers can be used to accomplish this for character and vehicle speed, with many mods each being able to stack and manage their own modifiers independently.
