Hello there, I been having trouble with (cloneObject), I heard there might be a bug but not certain. Cloning was easy for me in LGR1 but nat as in 2. I been trying this but get an error
'cloneObject" (a nil value). I been using defineObject at the moment just to get it to work.
Here's what I have so far maybe someone can help.
cloneObject{ name = "test_rock",
baseObject = "rock",
components = {
{
uiName = "Test Rock",
weight = 0.4,
description = "This is a test."
},
}
}
Cloning
Re: Cloning
There is no cloneObject function in Grimrock 2. Instead the functionality is rolled into defineObject. Just include the baseObject field in your defineObject table; you'll get the same behaviour as LoG1's cloneObject, and additionally all components in the baseObject will be added to the new object (except for any that you overwrite by defining new components with the same name). There are plentiful examples in the asset pack.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Cloning
I use the JKos clone script: viewtopic.php?f=22&t=8450Kuro01 wrote:Hello there, I been having trouble with (cloneObject), I heard there might be a bug but not certain. Cloning was easy for me in LGR1 but nat as in 2. I been trying this but get an error
'cloneObject" (a nil value). I been using defineObject at the moment just to get it to work.
Clean and easy