Page 3 of 36
Re: (Object Asset) Empty Catacomb as Alcove
Posted: Sat Sep 29, 2012 4:07 pm
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,
}
Re: (Object Asset) Empty Catacomb as Alcove
Posted: Sat Sep 29, 2012 6:04 pm
by Neikun
I have a new fun one. Wall hooks holding a sword.
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,
}
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sat Sep 29, 2012 7:10 pm
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.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sat Sep 29, 2012 7:48 pm
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.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sat Sep 29, 2012 9:03 pm
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
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sat Sep 29, 2012 9:25 pm
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
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sun Sep 30, 2012 2:29 am
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,
}
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sun Sep 30, 2012 2:38 am
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.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sun Sep 30, 2012 2:49 am
by SpacialKatana
Nice one Batty, I'll very likely use that in STW sometime soon
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Sun Sep 30, 2012 3:02 am
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