hey guys, simple question about cloneObjects. "Where" exactly does that code go?
Does it go into a lua script, or am I creating a new file to add to the in game assets? I've found plenty of code on how to clone objects, just not what to do with the code. Thanks!
cloneObject
Re: cloneObject
You put every cloneObject block into .\mod_assets\scripts\objects.lua file in your mod directory.
Remember that for editor to see the items you've added you have to reload project from the file menu.
I think you may also put those definitions in any other lua script i guess (in the same directory) - like customObjects.lua (you can easilly move various object definitions between projects that way)
Then just put import "mod_assets/scripts/customObjects.lua" into your init.lua script which loads when the mam starts.
Maybe you'd want to share a few of your ideas (not going into specifics of course) ?
Remember that for editor to see the items you've added you have to reload project from the file menu.
I think you may also put those definitions in any other lua script i guess (in the same directory) - like customObjects.lua (you can easilly move various object definitions between projects that way)
Then just put import "mod_assets/scripts/customObjects.lua" into your init.lua script which loads when the mam starts.
Maybe you'd want to share a few of your ideas (not going into specifics of course) ?
Re: cloneObject
this official doc page explains about that:
http://www.grimrock.net/modding/creating-custom-assets/
the folder they're referring to is within your Documents folder, on Windows 7 or Vista something like:
C:\Users\YOURNAME\Documents\Almost Human\Legend of Grimrock\Dungeons\YOURDUNGEON\mod_assets
http://www.grimrock.net/modding/creating-custom-assets/
the folder they're referring to is within your Documents folder, on Windows 7 or Vista something like:
C:\Users\YOURNAME\Documents\Almost Human\Legend of Grimrock\Dungeons\YOURDUNGEON\mod_assets
Finished Dungeons - complete mods to play
Re: cloneObject
awesome! thanks guys
quick followup question regarding the spider hatchlings
function breakEggs(level, x, y)
local facing = (party.facing + 2)%4
spawn("spider", level, x, y, facing)
end
im crashing the game with this:
function breakEggs(level, x, y)
local facing = (party.facing + 2)%4
spawn("spider", 1, 4, 14, 1)
end
any idea whats wrong? the "level, x, y" is defining parameters correct? so if I input the rest, this should work....
quick followup question regarding the spider hatchlings
function breakEggs(level, x, y)
local facing = (party.facing + 2)%4
spawn("spider", level, x, y, facing)
end
im crashing the game with this:
function breakEggs(level, x, y)
local facing = (party.facing + 2)%4
spawn("spider", 1, 4, 14, 1)
end
any idea whats wrong? the "level, x, y" is defining parameters correct? so if I input the rest, this should work....
-
- Posts: 163
- Joined: Fri Sep 14, 2012 6:20 pm
Re: cloneObject
Should be ----> spawn("spider", self.level,self.x,self.y,self.facing)tyterrio wrote: im crashing the game with this:
function breakEggs(level, x, y)
local facing = (party.facing + 2)%4
spawn("spider", 1, 4, 14, 1)
end
any idea whats wrong? the "level, x, y" is defining parameters correct? so if I input the rest, this should work....
You're likely spawning into a closed square with your coords, which will crash the game.
Working code for hatcing eggs is :-
Code: Select all
cloneObject{
name = "Spider_eggs_hatching",
baseObject = "spider_eggs",
health = 20,
evasion = -1000,
hitSound = "spider_eggs_hit",
hitEffect = "hit_goo",
editorIcon = 56,
onDie = function(self)
local facing = (party.facing + 2)%4
spawn("spider", self.level, self.x, self.y, facing)
end
}