cloneObject is nil
Posted: Sun Aug 16, 2015 1:18 am
Hi all,
Intro
It's been a while since I've been on the forums and I'm back for a little help. I scripted back in Legend of Grimrock I but am just starting in Legend of Grimrock II and having a little trouble.
Background
I've been scripting in lua for about 12 years now and am proficient with lua itself and am also very comfortable with OOP specifically in C#, but OOP none-the-less.
The Problem
So, I'm trying to clone an object using the scripting tutorial's most basic example by placing the following code in the items.lua file in my mod_assets/scripts folder and calling the import function for the items.lua file in my init.lua file.
For some reason, whenever I load or reload the project i get an error that says "mod_assets/scripts/items.lua: 4 attempt to call 'cloneObject' (a nil value)".
I've been trying to solve this for about 5 hours, reading forum posts, watching tutorials and searching google as well as experimenting on my own. I've even triple checked my game files to be sure I am up-to-date. I'm sure I'm doing something wrong but I just can't figure out what it is. This is maddening
, any tips or direction would be most appreciated.
Intro
It's been a while since I've been on the forums and I'm back for a little help. I scripted back in Legend of Grimrock I but am just starting in Legend of Grimrock II and having a little trouble.
Background
I've been scripting in lua for about 12 years now and am proficient with lua itself and am also very comfortable with OOP specifically in C#, but OOP none-the-less.
The Problem
So, I'm trying to clone an object using the scripting tutorial's most basic example by placing the following code in the items.lua file in my mod_assets/scripts folder and calling the import function for the items.lua file in my init.lua file.
Code: Select all
cloneObject{
name = "super_machete",
baseObject = "machete",
uiName = "Super Machete",
attackPower = 12,
damageType = "shock",
description = "This machete radiates with strange energy.",
}
I've been trying to solve this for about 5 hours, reading forum posts, watching tutorials and searching google as well as experimenting on my own. I've even triple checked my game files to be sure I am up-to-date. I'm sure I'm doing something wrong but I just can't figure out what it is. This is maddening
