Fixies v2 (merged into Core r635+)
#11
I know that I don't document things too well, true. Sorry for that confusion. Any chance you can write up some documentation on those 3 crafting hooks into the wiki, too?
Reply
Thanks given by:
#12
Bug fix is done Smile
I'll try to write all basic documentation (hooks and classes description)
Although I might need some help in things I don't quite understand (for example JSON)
Reply
Thanks given by:
#13
Ignore json, it is used only for PAK files saving and for some reason it has been exported to Lua, I think by accidentTongue
Reply
Thanks given by:
#14
We discussed this with FakeTruth, and we'd like to ask you for your permission to merge this plugin into the Core. It is, after all, a "basic functionality", so it would make sense to have it "out of the box". Also, it would mean SVN versioning for the code Smile Would you be willing to make this contribution?
Reply
Thanks given by:
#15
Sure thing Smile Merge!
But leave possibility to set BONUS factor, please)
Reply
Thanks given by:
#16
As of Rev 635 the Fixies plugin source is integrated into Core. No need to download this separate plugin.
Reply
Thanks given by:
#17
I appologize, but seems like you forgot "if fixing items are damaged" check Smile
Here's "fixed" oncraftingnorecipe.lua, and below there's added bit of code:
Code:
if (
    (Items[1].m_ItemHealth == 0)    or
    (Items[2].m_ItemHealth == 0)
)
then
    -- Only damaged items may be fixed
    return false
end

Cheers Wink


Attached Files
.lua   oncraftingnorecipe.lua (Size: 4.29 KB / Downloads: 294)
Reply
Thanks given by:
#18
(06-20-2012, 09:41 AM)Taugeshtu Wrote: I appologize, but seems like you forgot "if fixing items are damaged" check Smile
Here's "fixed" oncraftingnorecipe.lua, and below there's added bit of code:
Code:
if (
    (Items[1].m_ItemHealth == 0)    or
    (Items[2].m_ItemHealth == 0)
)
then
    -- Only damaged items may be fixed
    return false
end

Cheers Wink

Your code is wrong. Tools and weapons do not get their health set to 0 when damaged. You need some way of comparing to their values when new.
Reply
Thanks given by:
#19
Oh dear, it seems I didn't use the latest version of FixiesTongue Sorry for that.

Cedeel, are you sure? I think a newly crafted tool gets health of 0 and each time it is used the value increments, until the tool breaks. So what we're calling "health" is actually "damage". So the code should be okay - if at least one of the items is undamaged, don't let the user repair it.
Reply
Thanks given by:
#20
(06-20-2012, 05:49 PM)xoft Wrote: Oh dear, it seems I didn't use the latest version of FixiesTongue Sorry for that.

Cedeel, are you sure? I think a newly crafted tool gets health of 0 and each time it is used the value increments, until the tool breaks. So what we're calling "health" is actually "damage". So the code should be okay - if at least one of the items is undamaged, don't let the user repair it.

Awesome, wasn't around the code to check, it just seemed wrong to meTongue
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)