Page 1 of 1

Object with More than 1 offset or surface??

Posted: Mon Feb 09, 2015 10:42 am
by Eleven Warrior
Hi all.

I am using the book shelf from cosy dungeons and was wondering is it possible to have more than 1 surface component on the object, that way I can have items on the middle, bottom and top shelves?

Thxs for any help :)

Code: Select all

defineObject{
	name = "ph_temple_bookshelf_alcove",
	baseObject = "dungeon_alcove",
	tags = { "ph_cosy_dungeon" },
	components = {
	{
	class = "Model",
	model = "mod_assets/cosy_dungeon/TempleBookShelfAlcove.fbx",
	staticShadow = true
	},
	{
	class = "Surface",               ---Can I add more surfaces to this object or do I have to add socket component ---
	offset = vec(0, 0.6, 0.26),
	size = vec(1.6, 0.1, 0, 0),
	--debugDraw = true
	},
	{
	class = "Clickable",
	offset = vec(0, 0.62, 0.17),
	size = vec(1.2, 0.8, 0.6),
	--debugDraw = true
	}
	}
}

Re: Object with More than 1 offset or surface??

Posted: Mon Feb 09, 2015 11:41 am
by minmay
Multiple SurfaceComponents work, but ClickableComponents will always try to go for the "first" SurfaceComponent. So, in the onClick function for all of your ClickableComponents you should disable all SurfaceComponents except for the one that you want to accept the item.