[BUG?] Editor crashs with monster onMove (details inside)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

[BUG?] Editor crashs with monster onMove (details inside)

Post by Mebaru »

Code: Select all

cloneObject{
	name = "spider_other",	
	baseObject = "spider",
	uiName = "The Other Spider",
	sight = 0, -- blind spider
	onMove = function(self, direction)
		for j in entitiesAt(2, self.x, self.y) do
			print(j:getUIname())
		end
		return true
	end,
}
See the code. When try to use ANY methods of j like getUIname(), destroy() or setSubtileOffset() editor (or game if I export it) crashes constantly with "bad object" error.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [BUG?] Editor crashs with monster onMove (details inside

Post by Neikun »

I.. don't think there's a uiName string for cloned monsters, as the players will never pick them up.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: [BUG?] Editor crashs with monster onMove (details inside

Post by petri »

Yeah, unfortunately scripts that are written outside the editor are unprotected so any error in them causes the editor to crash. We'll try to address this issue when we do a patch/update.
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

Re: [BUG?] Editor crashs with monster onMove (details inside

Post by Mebaru »

Neikun wrote:I.. don't think there's a uiName string for cloned monsters, as the players will never pick them up.
It's not about uiName cloned monsters only. As I wrote it crashes on every other method, for example destroy(). And actually it crashes on any object in my case, I have an item in a tile and want to destroy it:

Code: Select all

	onMove = function(self, direction)

		for j in entitiesAt(2, self.x, self.y) do
			local allowed = {"rat_shank", "grim_cap","pitroot_bread"}
			for i = 1, #allowed do
				j:destroy()
			end
		end
		return true

	end,
What I am doing wrong?
Post Reply