Page 1 of 1

How do I modify Steamsaw talent?

Posted: Thu Jun 22, 2017 10:54 am
by jenx
How do I overload or superload a steamsaw talent, if it's already in an addon?

Re: How do I modify Steamsaw talent?

Posted: Thu Jun 22, 2017 11:34 am
by nsrr
You don't need to use a super load or an overload, actually. You just need to load a data file and make sure the weight of your add on is higher than the add on which originally loads it. You can use my Bone Shield tweak for reference; just ignore the super load that it contains. In data/talents/corruptions/bone you will see how I edited the bone shield talent. Change the folders to have the appropriate names (something like data/talents/tinkers/steamsaw).

I'm not at my computer or I would put an example here, but I think you have enough experience to figure it out from my code. It's pretty straightforward. You can over write existing fields (as I did with 'absorb' and 'info') or add new fields (as with 'getThreshold'). Basically it's just 'Talents.talent_def.T_TALENTNAME.field = foo'.

Hope that's enough to point you in the right direction .

Re: How do I modify Steamsaw talent?

Posted: Thu Jun 22, 2017 2:12 pm
by jenx
I"m not sure you have answered my question. the fodlers where the talent is, is inside the addon folder already. the steamsaw talents are themselves an addon.

so i'm needing an addon to modiy an addon - how do I do that?

Re: How do I modify Steamsaw talent?

Posted: Thu Jun 22, 2017 4:23 pm
by nsrr
Hmm.. I guess I'm not clear on the question, then. When you say the talent is in an add on already, do you mean Embers? Or a user made addon? Or an add on you are making?

If it's either if the first two, then yes, you'll need a new add on to edit it. If it's one you are making or have already made, you could just edit and update it.

Re: How do I modify Steamsaw talent?

Posted: Thu Jun 22, 2017 11:23 pm
by jenx
nsrr wrote:Hmm.. I guess I'm not clear on the question, then. When you say the talent is in an add on already, do you mean Embers? Or a user made addon? Or an add on you are making?

If it's either if the first two, then yes, you'll need a new add on to edit it. If it's one you are making or have already made, you could just edit and update it.
yes, i meant embers. I don't want to edit one line in embers and but have to copy over the whole lot. how can i modiy one file in embers? is it a matter of overriding it with a different weighting?

Re: How do I modify Steamsaw talent?

Posted: Fri Jun 23, 2017 12:28 am
by nsrr
jenx wrote:
nsrr wrote:Hmm.. I guess I'm not clear on the question, then. When you say the talent is in an add on already, do you mean Embers? Or a user made addon? Or an add on you are making?

If it's either if the first two, then yes, you'll need a new add on to edit it. If it's one you are making or have already made, you could just edit and update it.
yes, i meant embers. I don't want to edit one line in embers and but have to copy over the whole lot. how can i modiy one file in embers? is it a matter of overriding it with a different weighting?
Okay, I assumed you were talking about Embers from the beginning, but it's good that's straightened out.

So, yes, basically it is just a matter of overwriting. Just use the method I described in my first post. True, Bone Shield is not from an addon, so maybe that was a bad example to give you, but the method for editing a talent from an addon or from base ToME is the same, the only difference being that if it is from an addon you will have to make sure your addon has a higher weight than the one that originally adds the talent.

Here, I've attached a mock up to show you exactly how it would work for 'To the Arms', as an example. There are more detailed notes in 'sawmaiming' file.

Re: How do I modify Steamsaw talent?

Posted: Fri Jun 23, 2017 8:06 am
by jenx
Thanks!

So, though, a new problem. In Embers, damage_types.lua is in the addon, but not as superload or overload, but as data.

I want to overwrite the code in: setDefaultProjector(function(src, x, y, type, dam, state).

But I'm not sure how this would work. The dt file in embers just has a number of new damage types, that's all.

So, how do I replace the thing that is setDefaultProjector(function(src, x, y, type, dam, state) with my own version?