Jump to content

Override items repair value


Recommended Posts

Hi, I'm trying to override the percentage repaired by gears when used on the propeller in SW.

I used another mod as a proxy to test the command:

TUNING.REPAIR_GEARS_WORK = 15

Once in game, nothing changes when I try to repair the engine. The amount is the same as before.

So I tried another route:

inst.components.repairer.workrepairvalue = 15

But then I get an error, because the object "inst" hasn't been instanced yet.

Maybe the repair value is set only when the item drops...

Any idea?

Link to comment
Share on other sites

The "repairer" component is typically used for repairing things like walls, in the case of Gears I believe it's used to repair Broken Clockworks, so that's not what you're looking for.

The Iron Wind uses the "fueled" component for its durability, so an item that can be used to restore that kind of durability uses the "fuel" component, which Gears have.

4 hours ago, DMFan79 said:

But then I get an error, because the object "inst" hasn't been instanced yet.

You had the right idea, but you have to access "inst" somehow. Thankfully, AddPrefabPostInit exists for this kind of thing. Here's what you could do:

AddPrefabPostInit("gears", function(inst)
	inst.components.fuel.fuelvalue = -- Put your value here
end)

By default the fuel value of Gears is TUNING.TOTAL_DAY_TIME, which should be 480 seconds, if I remember correctly. You can use a TUNING value if you want, or simply put a number, it's up to you!

  • Thanks 1
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...