Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

[MOD] Weapon Engineering (Turret Editor)


darkconsole
 Share

Recommended Posts

So I have a problem with the grey bars that show up for overheating/energy turrets in the in game UI. I used this mod to lower the heat on a railgun and it did eventually remove the "overheats" modifier from the tooltip at least. However, the grey bar still shows in game. Is it possible for the mod to remove this grey bar? (I suspect not as it is in UI code somewhere in the game client that displays those bars based on the turret type).

 

This then got me questioning if it was possible to add other modifiers with a mod such as burst fire, ionized projectiles and what have you.

Link to comment
Share on other sites

Some of the UI is hard-baked into the C++ side of the code, and us modders can't touch it if that's the case. For many "basic" elements such as the Turret Icons, their placement, the healthbars, etc., this is true. So I expect that, no, we cannot remove the grey bar.

 

What *might* be possible is that one could remove the "overheats" modifier from the railgun completely, stripping it from the game. But only if "overheats" is a property added to the railgun in lua script and isn't baked into the behaviour of what defines a weapon as a railgun. But that's also beyond the purview of this mod, I feel.

Link to comment
Share on other sites

Some of the UI is hard-baked into the C++ side of the code, and us modders can't touch it if that's the case. For many "basic" elements such as the Turret Icons, their placement, the healthbars, etc., this is true. So I expect that, no, we cannot remove the grey bar.

 

This is what I suspect to be the case. I was unable to see anything that looked to me as a change I could make anywhere.

 

What *might* be possible is that one could remove the "overheats" modifier from the railgun completely, stripping it from the game. But only if "overheats" is a property added to the railgun in lua script and isn't baked into the behaviour of what defines a weapon as a railgun. But that's also beyond the purview of this mod, I feel.

 

This is what I hope is the case. I have been unable to figure this out myself, though admittedly I am not very familiar with the modifiable lua scripts.

Link to comment
Share on other sites

If it's simply making the mod compliant with the 0.20.2 security update, all that needs to happen is adding callable() function calls to the appropriate functions.

 

Search the scripts included in this mod for the word "invoke". You should get hits that include either invokeClientFunction(), invokeServerFunction(), or both.

 

Then you look inside the brackets for that invoke function. For example, say you find the function call invokeServerFunction("updateTooltip"). The word enclosed in the parentheses is updateTooltip, so we're going to have to find the function called updateTooltip() in that same script.

 

Once you find updateTooltip(), scroll down to where its end statement is. Put the following code after that end:

 

callable(NAMESPACE, "updateTooltip")

 

where NAMESPACE is the script's namespace. In our example, the code shows:

 

function AncientGate.updateTooltip(ready)

 

in which case, the namespace is AncientGate. If the script has no namespace, your job will be a little bit harder, and I suggest you either ask for help again or try and namespace the script yourself.

 

Finally, add the following code at the top of the script, near the other require statements (or just place it near the top of the code if the code has no requires):

 

require ("callable")

 

-----

 

In summary, your changes will alter the code in the following manner:

 

require ("callable")

...

function NAMESPACE.x()
  invokeServerFunction("y")
end

function NAMESPACE.y()
  ...
end
callable(NAMESPACE, "y")

 

Good luck! There's honestly not a lot you could break performing these updates. If you get it working, do post the fruit of your labours here -- it helps the community a lot!

Link to comment
Share on other sites

Thanks for the advise. Ive had a bit of a play around trying to add in the stuff you said, but no luck so far. Ill tinker a little more over the next day or two and keep you all posted.

 

Before any changes, the mod menu itself can be accessed in 20.2, but you are unable to see any turrets in your inventory, and all the stat boxes show up as NIL.

In my experiments, i managed to stop the mod from showing up at all, and in my second attempt it appeared to be no change to the default state that it loads in.

 

This is literally the first time ive ever touched LUA, or any kind of code, so ill keep playing and see how it goes.

Link to comment
Share on other sites

Ah, sorry. That sounds like you might be running into other issues than a simple patch-to-security-update-compliance-fix (PtSUC?) will solve.

 

You can access the in-game console by pressing the quote key (the one with ' and " on it). This may be displaying errors, which will help you pinpoint where things are going wrong.

 

If that doesn't work, reply here again and I'll see if I can take a look.

 

Good luck, and welcome to the modding team! ;>

Link to comment
Share on other sites

Wonderful haha. No worries, ill keep tinkering and see what i come up with. Will keep you posted

 

Edit: Have been playing around with it for a couple of days now, and no luck. Maybe someone else could take a look when they have a chance. Good Luck!

Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

×
×
  • Create New...