Jump to content

[Mod Help] Machete


Recommended Posts

SOLVED, see comment below.

 

Hey guys,

 

So a couple days back I published a mod on the workshop called Machete (workshop-486322336) and some one requested I add a configure option for the damage.

 

After reading up about the API I added the feature and tested it out, it worked great. However, after uploading it to the workshop, downloading it from there and enabling it, it fails to do any damage. I've looked through the log, changed the damage in the configuration and everything but the Steam Workshop version just refuses to do damage.

 

After testing a bit I've found that Wigfrid still gets the health and sanity buffs while hitting anything but just no damage.

 

Can someone help me figure out how to fix this please? Let me know what other information I need to give you.

 

I've attached the uncompiled version.

Machete.zip

Edited by MystPhysX
Link to comment
Share on other sites

Okay so I solved it.

 

Instead of calling a new local variable in machete.lua (wdamage). I decided to call the variable in modmain.lua. The changes are as follows:

 

modmain.lua

 

+ GLOBAL.TUNING.MACHETEDMG = GetModConfigData("wpn_dmg")

 

machete.lua

 

- local wdamage = GetModConfigData("wpn_dmg", "Machete")

- inst.components.weapon:SetDamage(wdamage)

+ inst.components.weapon:SetDamage(TUNING.MACHETEDMG)

 

I did the same for weapon durability and now everything works great.

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
 Share

×
  • Create New...