The Custom Alcove Thread. (Neikun, Batty and Crisman)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: (Object Asset) Empty Catacomb as Alcove

Post by Neikun »

There is now a video of my chocolate pillar antics.
Also, edited upper alcove so you don't have to reach so far.

Code: Select all

defineObject{
      name = "dungeon_catacomb_alcove_upper",
      class = "Alcove",
      anchorPos = vec(0.5, 1.85, 0.3),
      targetPos = vec(0.5, 1.70, 0.2),
      targetSize = vec(0.6, 0.5, 0.6),
      placement = "wall",
      replacesWall = false,
      editorIcon = 92,
}
"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
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: (Object Asset) Empty Catacomb as Alcove

Post by Neikun »

I have a new fun one. Wall hooks holding a sword.
Image

Code: Select all

defineObject{
   name = "wall_hook_alcove",
   class = "Alcove",
  anchorPos = vec(0, 1.50, -0.1),
   targetPos = vec(0, 1.50, -0.1),
   targetSize = vec(0.6, 0.5, 0.6),
   model = "assets/models/env/metal_hooks_wall.fbx",
   placement = "wall",
   replacesWall = false,
   editorIcon = 92,
}
The only problem is that you would have to edit what things can be placed there.
EDIT: With long_sword only option
any idea how one might add multiple strings of the onInsertItem = function?

Code: Select all

defineObject{
   name = "wall_hook_alcove",
   class = "Alcove",
  anchorPos = vec(0, 1.50, -0.1),
   targetPos = vec(0, 1.50, -0.1),
   targetSize = vec(0.6, 0.5, 0.6),
   model = "assets/models/env/metal_hooks_wall.fbx",
	onInsertItem = function(self, item)
		return item.name == "long_sword" and self:getItemCount() == 0
	end,
   placement = "wall",
   replacesWall = false,
   editorIcon = 92,
}
"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!
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Batty »

This is getting wild now! lol

Everyone needs a place to hang their sword...

Just do this to add items:

Code: Select all

 return item.name == "long_sword" or "rock" and self:getItemCount() == 0
I don't understand what returning self:getItemCount() == 0 does though.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Neikun »

I stole it out of the eye socket alcove. it's what makes sure you can only place certain items in it.
EDIT: This works and hey! This also stops more than one item being in an alcove at the same time!
Double edit: Oh no, it breaks the part where only that type of item can be placed.
"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!
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Batty »

ok, I think I got it, this only lets either the sword or shaman staff in and only one at a time:

Code: Select all

return item.name == "long_sword" and self:getItemCount() == 0 or item.name == "shaman_staff" and self:getItemCount() == 0
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Neikun »

Batty wrote:ok, I think I got it, this only lets either the sword or shaman staff in and only one at a time:

Code: Select all

return item.name == "long_sword" and self:getItemCount() == 0 or item.name == "shaman_staff" and self:getItemCount() == 0
Looks good. I'm going to expand it for all items that fit the hook. brb

Here it is:

Code: Select all

defineObject{
   name = "wall_hook_alcove",
   class = "Alcove",
  anchorPos = vec(0, 1.50, -0.1),
   targetPos = vec(0, 1.50, -0.1),
   targetSize = vec(0.6, 0.5, 0.6),
   model = "assets/models/env/metal_hooks_wall.fbx",
	onInsertItem = function(self, item)
		return item.name == "long_sword" and self:getItemCount() == 0 
or item.name == "shaman_staff" and self:getItemCount() == 0
or item.name == "nex_sword" and self:getItemCount() == 0
or item.name == "dismantler" and self:getItemCount() == 0
or item.name == "lightning_blade" and self:getItemCount() == 0
or item.name == "lightning_blade_empty" and self:getItemCount() == 0
or item.name == "legionary_spear" and self:getItemCount() == 0
or item.name == "fire_blade" and self:getItemCount() == 0
or item.name == "fire_blade_empty" and self:getItemCount() == 0
	end,
   placement = "wall",
   replacesWall = false,
   editorIcon = 92,
}
Thanks for the help, Batty
"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
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Neikun »

This one uses a model not used in the base game (though it was made for it) I guess it was just an extra.
It's called a wall_fountain, but it doesn't make any water. My guess is that it was supposed to work with the water flask, but that feature got cut.
No matter for it looks like a dandy little shelf.
My philosophy? You can never have too many places to put things.
Here's the code for your object.lua file.

Code: Select all

defineObject{
	name = "wall_shelf",
	class = "Alcove",
	anchorPos = vec(0, 1.0, -0.2),
	targetPos = vec(0, 1.0, -0.2),
	targetSize = vec(0.3, 0.3, 0.3),
	model = "assets/models/env/wall_fountain.fbx",
	placement = "wall",
	replacesWall = false,
	editorIcon = 92,
}
Image
"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!
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Batty »

Neikun wrote:
Looks good. I'm going to expand it for all items that fit the hook. brb

Here it is:

Code: Select all

defineObject{
   name = "wall_hook_alcove",
   class = "Alcove",
  anchorPos = vec(0, 1.50, -0.1),
   targetPos = vec(0, 1.50, -0.1),
   targetSize = vec(0.6, 0.5, 0.6),
   model = "assets/models/env/metal_hooks_wall.fbx",
	onInsertItem = function(self, item)
		return item.name == "long_sword" and self:getItemCount() == 0 
or item.name == "shaman_staff" and self:getItemCount() == 0
or item.name == "nex_sword" and self:getItemCount() == 0
or item.name == "dismantler" and self:getItemCount() == 0
or item.name == "lightning_blade" and self:getItemCount() == 0
or item.name == "lightning_blade_empty" and self:getItemCount() == 0
or item.name == "legionary_spear" and self:getItemCount() == 0
or item.name == "fire_blade" and self:getItemCount() == 0
or item.name == "fire_blade_empty" and self:getItemCount() == 0
	end,
   placement = "wall",
   replacesWall = false,
   editorIcon = 92,
}
Thanks for the help, Batty
Here's a cleaner way of checking a group of items for alcove management:

Code: Select all

onInsertItem = function(self, item)
	  local allowed = {"long_sword", "shaman_staff", "nex_sword", "dismantler", "lightning_blade",
			         "lightning_blade_empty", "legionary_spear", "fire_blade", "fire_blade_empty"}
	  for i = 1, #allowed do
		 if item.name == allowed[i] then
			 return item.name == allowed[i] and self:getItemCount() == 0
		 end
	  end	
end,
You only need to add/remove strings from the table to change what is allowed in the alcove. Legionary spear fits in the hooks incredibly well!

The fountain is cool but it really needs a higher res texture looks like it got abandon quickly.
Last edited by Batty on Mon Oct 01, 2012 6:42 am, edited 1 time in total.
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by SpacialKatana »

Nice one Batty, I'll very likely use that in STW sometime soon ;)
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: (Object Assets) Empty Catacomb as Alcove and other alcov

Post by Neikun »

Batty wrote: Legionary spear fits in the hooks incredibly well!
inorite?
Good job on cleaning up the code. We work well together =D
"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!
Post Reply