howto query: Visible but inaccessible alcove

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

howto query: Visible but inaccessible alcove

Post by kaypy »

Hi

Ive been playing around with making a covered alcove where there is a barrier that prevents the player grabbing the contents of the alcove. The only way I found to prevent the player grabbing stuff "through" the barrier was by making a fake alcove+item graphic and substituting that until the barrier was lowered.

Is there a way I can make an arbitrary* item visible but not getable?

Here is a minimal example of my hacky version
http://en.file-upload.net/download-1063 ... a.zip.html

--

* ie I'd like to have it show whatever is in the alcove without needing any specific code matching the content of the alcove
Friends don't let friends eat worm round
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: howto query: Visible but inaccessible alcove

Post by Saumun »

I did a similar thing where i copied and renamed the firestaff bitmaps, then cloned the firestaff but made it a deco wallitem... I then shifted the x and y to make it appear in the right position, and used a qswapper in ESB to swap it for the real firestaff when an objective was completed.
Worked fine. Pretty simple and needed no coding.

However, i don't think this is what you want... right?
Are you looking for a command that can simply stop you picking up the object?
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: howto query: Visible but inaccessible alcove

Post by Sophia »

If you have a wallitem with draw_contents set to true, DSB will draw whatever is inside the wallitem on top of it, which will look like items in an alcove. This is in effect generating your "fake" graphic but DSB is doing it automatically. You can then set up an on_click function that will only make the alcove operate when you want it to.

Take a look at test_dungeon/doublealcoves.lua for an example of making an alcove this way.
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: howto query: Visible but inaccessible alcove

Post by kaypy »

Saruman: That sounds an awful lot like my hacky version

Sophia: Thanks. I had actually thought "is there anything in the test_dungeon that does something like this" but had dismissed looking at the small alcove because it hides everything when disabled...

Anyhow, here is the fixed version of the test example, in case it is useful for anyone
http://en.file-upload.net/download-1063 ... a.zip.html
Friends don't let friends eat worm round
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: howto query: Visible but inaccessible alcove

Post by Saumun »

Sorry Kaypy... I confess i hadn't actually looked in all of your lua files, as i was on my way to work. It is indeed almost the same.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: howto query: Visible but inaccessible alcove

Post by kaypy »

No apology required- I was just highly amused that our solutions matched right down to the faked object being the firestaff 8-)

(I guess it is the most obvious candidate, but even so...)
Friends don't let friends eat worm round
Post Reply