Easier Turret Factory
This mod makes some simple QoL changes to how the turret factory functions to allow the user to build turrets in an easier way. This mod does two primary things, first it allows the user to hold ctrl, shift, or alt, while hitting the plus and minus buttons on the turret factory to give +5, +10, +50 respectively. This mod also only refreshes the UI when you build a new turret instead of resetting all the values for everything. So once you have the turret you want, you can just keep clicking build until there are no more resources left.
The changes are pretty simple, but unfortunately will not work unless loaded on the server and the client.
Installation instructions
- Download the mod from the bottom of this post.
- Extract the contents to your root Avorion folder. Aka: "\Steam\steamapps\common\Avorion"
- Assuming the file structure stayed in tact it should ask to overwrite turretfactory.lua, just click yes to replace the file.
How to use
Once installed all turret factories will now have the ability to change different amounts by holding down ctrl, shift, or alt and clicking the plus or minus. Also when you build the turret it will not reset any values.
Files changed
Overwritten
Avorion\data\scripts\entity\merchants\turretfactory.lua
Known Issues
If you hold more then one down at a time you can get weirdness. Don't really care tbh lol
Inside the technical changes
The biggest change was changing the line in the buildTurret function that looks like
this: invokeClientFunction(player, "onShowWindow")
to this: invokeClientFunction(player, "refreshUI").
I also added in some code to handle the key presses.
Credits
_OMAR_ For turret fix code
Rinaldo (Rinart73) For code help
Dirtyredz For code help
Edit: Removed turret values fix.
Easier_Turret_Factory.zip