Jump to content

[MOD][Clientside] Turret Factory Amount Fix - update: bugfix


Rinart73

Recommended Posts

Starting from version 1.0.1, mod is client-side. But it is safe to install it on server-side.

(Actually, if you'll install it on server-side, you will not need to install it on client-side, unless you want additional QoL changes)

I saw many people (including me) reporting that in 0.15.x after they press "Build Turret" button, their ingredients amount reset, so they can't build several identical turrets in a row.

 

I found a source of the problem and here is my small mod that fixes this behaviour.

 

But I thought that I want to add more useful features to this (that I personally would like to see in vanilla), so.. from now on your ingredients amount will save for each weapon type, each rarity. This way you can easilly compare different turrets or rarities without need of re-adjusting values every time you switch. Basically these values will save as long as you're in the sector so reopening the window will not reset anything too.

 

I might add the feature of saving values even after revisiting sector in the future. Post if you want to.

 

Installing

[*]Make a copy of 'data/scripts/entity/merchants/turretfactory.lua'

[*]Unpack mod archive into Avorion folder

 

Uninstalling

[*]Restore file 'data/scripts/entity/merchants/turretfactory.lua'

 

Changelog

 

 

1.0.1

  • Fix: Now mod is truly client-side

 

1.0.0

  • Initial release

TurretFactoryAmountFix-1.0.1-0.15.x.zip

TurretFactoryAmountFix-old-versions.zip

Link to comment
Share on other sites

  • 3 weeks later...

Nice change I figured out the same thing right after I bought this game.

 

Please keep in mind this is not a client side fix! The function invokeClientFunction is called by the server and the function BuildTurret is run on the server. So the build button not resetting values will only work if installed on server. In fact the invokeClientFunction change does not even need to be on client.

 

P.S I also made a mod that did a simular thing as this but I also allow 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. If you wanna combine my changes as well into yours and we can just have it all in one place I would be cool with that.

 

Edit: So since you are saving the values and setting them after the refresh it may still work on client-side. Just keep in mind that invokeClientFunction does not work on just client.

Link to comment
Share on other sites

Please keep in mind this is not a client side fix! The function invokeClientFunction is called by the server and the function BuildTurret is run on the server.

Oh, you're right, thanks :) I will look if I can make this client-side only.

 

I added a textfield to choose how many weapons to build. It also works on client side only.

 

As for adding compatibility for our mods, bobisback and Hammelpilaw, I can look at your mods source code and provide compatibility patches/files.

 

Link to comment
Share on other sites

1.0.1 update

  • Fix: Now mod is truly client-side

 

If mod will be installed only on client-side, it will use a way to detect, when it should use 'refreshUI' instead of full 'onShowWindow'.

If mod will be installed on server-side, it will directly call 'refreshUI' instead of 'onShowWindow'. In this case, you will need to install mod on client-side only if you want to have additional QoL content.

 

As for other mods, I will release merged versions soon.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...