Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Sun Nov 30, 2014 1:07 pm
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.
A trip of a thousand leagues starts with a step.
JKos
Posts: 464 Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:
Post
by JKos » Sun Nov 30, 2014 1:49 pm
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."
},
}
}
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Sun Nov 30, 2014 2:02 pm
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 ?
A trip of a thousand leagues starts with a step.
JKos
Posts: 464 Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:
Post
by JKos » Sun Nov 30, 2014 2:07 pm
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.
JKos
Posts: 464 Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:
Post
by JKos » Sun Nov 30, 2014 2:23 pm
Yeah, it's confirmed that cloneObject has a pretty serious bug. Sorry about that to everyone, but I will fix it.
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Sun Nov 30, 2014 2:45 pm
Thank you so much for taking the time to test. I am glad I helped find a bug
Take care
A trip of a thousand leagues starts with a step.
JKos
Posts: 464 Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:
Post
by JKos » Sun Nov 30, 2014 3:13 pm
Ok, I fixed it, let's hope that there is no more bugs
Aisuu
Posts: 61 Joined: Fri Oct 31, 2014 2:07 pm
Post
by Aisuu » Sun Nov 30, 2014 4:33 pm
After update it give me this error:
clone_object.lua:46: bad argument #1 to 'insert' (table expected, got nil)
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Sun Nov 30, 2014 4:36 pm
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
A trip of a thousand leagues starts with a step.
JKos
Posts: 464 Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:
Post
by JKos » Sun Nov 30, 2014 4:41 pm
Ok, I made a bugfix for the bugfix, maybe it works now?