More flexible Prototypes
Posted: Thu Jan 28, 2021 4:11 am
I have now twice attempted to create a mod, only to be stymied in the same way and I was wondering if there's any sane way of dealing with it. The problem is this- I wish for more flexible prototypes.
In one case, I wanted to create a "foot powered equipment generator" aka "reverse-exoskeleton", that slows your gait but charges your pack. I would have expected to achieve this by combining the "movement-bonus-equipment" prototype with the "generator-equipment" prototype. Lua allows multiple inheritance but Factorio does not, so that idea is off the table.
In the 2nd case, I wished to create a powered offshore Pump. Of course, this is not possible given the prototype definition- it has no "EnergySource" field. Again, I have to abandon the idea.
Given the API, the only way I can see to solve these problems is by lobbying the devs to create new prototypes- a "movement-bonus-generator-equipment" prototype and a "offshore-pump-with-energy-source"- but that seems highly unlikely and pretty much a bad idea. I'm not a Lua expect and I don't know anything about the base code, but I thought I would ask before I give up on the idea forever. What can be done when the prototypes don't meet our needs? Can we lobby the devs for adding specific prototypes or is that entirely not kosher? And if multiple inheritance is not currently possible, perhaps someday it could be?
In one case, I wanted to create a "foot powered equipment generator" aka "reverse-exoskeleton", that slows your gait but charges your pack. I would have expected to achieve this by combining the "movement-bonus-equipment" prototype with the "generator-equipment" prototype. Lua allows multiple inheritance but Factorio does not, so that idea is off the table.
In the 2nd case, I wished to create a powered offshore Pump. Of course, this is not possible given the prototype definition- it has no "EnergySource" field. Again, I have to abandon the idea.
Given the API, the only way I can see to solve these problems is by lobbying the devs to create new prototypes- a "movement-bonus-generator-equipment" prototype and a "offshore-pump-with-energy-source"- but that seems highly unlikely and pretty much a bad idea. I'm not a Lua expect and I don't know anything about the base code, but I thought I would ask before I give up on the idea forever. What can be done when the prototypes don't meet our needs? Can we lobby the devs for adding specific prototypes or is that entirely not kosher? And if multiple inheritance is not currently possible, perhaps someday it could be?