Blocking items are of type "FLOORUPRIGHT".
Here's a very simple example of an archetype for a pillar:
(note that you'll have to provide a
gfx.pillar for this to work right)
Code: Select all
obj.pillar = {
type="FLOORUPRIGHT",
class="DECO",
col = true,
front=gfx.pillar
}
If you want a more complicated example, check out
dm2table.lua included with the
test_dungeon.
The
col property is short for collision, and it determines what hits what when. If it's just
true, the object is fully solid, but it can also be a function to allow for stranger behavior. Take a look at
dm2table.lua. You can probably just copy its
col function verbatim because a DM2 table has the exact behavior you want; dungeon objects can go through it but the party will bump into it. Allowing all objects to pass but setting
no_monsters means only items can move through it, which I think is what you want.
Making the blocker clickable requires you set
clickable to
true and define an
on_click function. Here is basic code to make your clickable floorupright behave just like a wallitem.
Code: Select all
obj.pillar = {
type="FLOORUPRIGHT",
class="DECO",
col = true,
front=gfx.pillar,
clickable = true,
on_click = wallitem_click,
esb_take_opby_targets = true
}
That last property,
esb_take_opby_targets, is optional, but it makes it a lot easier to work with your new object in ESB because that tells it to display the normal opby and target selectors, which aren't normally shown for flooruprights.
To make a tree that gives apples, you have two options:

In ESB, set the target to an "item_action" instance (the IA with an arrow, available in FloorFlats/Mechanics) that will move a "Newly Created" instance of an apple into the mouse hand.

Write a custom function (like
give_apple) and assign that to the new arch's
on_click instead of behaving like a generic wallitem.