Page 2 of 4
Re: cloneObject for LoG2
Posted: Sun Nov 30, 2014 1:07 pm
by cromcrom
Hi JKos, it seems that
Code: Select all
cloneObject{ name = "crom_iron_ore",
baseObject = "rock",
components = {
{
class ="Item",
uiName = "Iron ore",
weight = 0.8,
description = "Iron Ore. Used in crafting."
},
}
}
cloneObject{ name = "crom_iron_chunks",
baseObject = "ore",
components = {
{
class ="Item",
uiName = "Iron chunks",
weight = 0.4,
description = "Bits of iron ore. Used in crafting."
},
}
}
only returns iron_chunks. I would like to create both iron or and iron chunks, both cloning the rock model.
Re: cloneObject for LoG2
Posted: Sun Nov 30, 2014 1:49 pm
by JKos
You have defined ore as a baseObject of the crom_iron_chunks. Maybe you should change it to rock?
Code: Select all
cloneObject{ name = "crom_iron_ore",
baseObject = "rock",
components = {
{
class ="Item",
uiName = "Iron ore",
weight = 0.8,
description = "Iron Ore. Used in crafting."
},
}
}
cloneObject{ name = "crom_iron_chunks",
baseObject = "rock",
components = {
{
class ="Item",
uiName = "Iron chunks",
weight = 0.4,
description = "Bits of iron ore. Used in crafting."
},
}
}
Re: cloneObject for LoG2
Posted: Sun Nov 30, 2014 2:02 pm
by cromcrom
Thanks JKos, this ore stuff was a mistake. Cloning both items to rock still returns iron chunks instead of iron ore.
When I put the iron ore cloned object below the chunks, the chunks are ore. So maybe your script overrides the prvious item clones, and only keep the last one ?
Re: cloneObject for LoG2
Posted: Sun Nov 30, 2014 2:07 pm
by JKos
Ok, I tested it and now I understand what you mean, this seems to be a bug in cloneObject, I'll try to fix it.
Re: cloneObject for LoG2
Posted: Sun Nov 30, 2014 2:23 pm
by JKos
Yeah, it's confirmed that cloneObject has a pretty serious bug. Sorry about that to everyone, but I will fix it.
Re: cloneObject for LoG2
Posted: Sun Nov 30, 2014 2:45 pm
by cromcrom
Thank you so much for taking the time to test. I am glad I helped find a bug

Take care

Re: cloneObject for LoG2 (important bug fix 31.11)
Posted: Sun Nov 30, 2014 3:13 pm
by JKos
Ok, I fixed it, let's hope that there is no more bugs

Re: cloneObject for LoG2 (important bug fix 30.11)
Posted: Sun Nov 30, 2014 4:33 pm
by Aisuu
After update it give me this error:
clone_object.lua:46: bad argument #1 to 'insert' (table expected, got nil)
Re: cloneObject for LoG2 (important bug fix 30.11)
Posted: Sun Nov 30, 2014 4:36 pm
by cromcrom
same here, it seems that
Code: Select all
if component.name == name or string.lower(component.class) == name then
the component.class returns nil
line 24
Re: cloneObject for LoG2 (important bug fix 30.11)
Posted: Sun Nov 30, 2014 4:41 pm
by JKos
Ok, I made a bugfix for the bugfix, maybe it works now?
