Custom graphics for objects in inter_objlook possible?

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
User avatar
meadwarrior
Journeyman
Posts: 91
Joined: Sat Dec 01, 2018 1:02 am

Custom graphics for objects in inter_objlook possible?

Post by meadwarrior »

Hello!

When players take a closer look at an inventory object (by dragging it on the eye), I'd like to display something like this:

Image

Preferably, it would be a custom inter_objlook graphic for every single object that doesn't display the name or the weight.
Is this something that can be done without much hassle, or is this going to require a lot of code?

Thanks!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Custom graphics for objects in inter_objlook possible?

Post by Sophia »

I'm actually not sure what you're asking. If you just want to add a textual description to an object, you probably don't want to have the text as a separate image, but rather just have DSB insert the text for you. You can do that with a longdesc arch property or exvar.

I could also add support for an arch to define a custom background that is drawn instead of inter_objlook if that would help you. (Actually, this seems handy and it's general purpose enough, so I'll do this anyway!)

Otherwise, if you want to make more extensive changes to what you see when you drag an object over the eye, you can edit sys_render_object but that will probably require a decent amount of code.
User avatar
meadwarrior
Journeyman
Posts: 91
Joined: Sat Dec 01, 2018 1:02 am

Re: Custom graphics for objects in inter_objlook possible?

Post by meadwarrior »

Sophia wrote: Sat Dec 15, 2018 12:44 am I could also add support for an arch to define a custom background that is drawn instead of inter_objlook if that would help you. (Actually, this seems handy and it's general purpose enough, so I'll do this anyway!)
That sounds good!
The way I'd imagine it would look something like

Code: Select all

obj.testobject = {
	type=...
	...
	objlook = gfx.testobject_objlook
}
Just so one could provide custom graphics for every object archetype.

Thanks!
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Custom graphics for objects in inter_objlook possible?

Post by Gambit37 »

Are you preparing graphics for this with the text already pre composed? That will become a nightmare to update, trust me, been there done that 😉. If you have lots of text to use, it's better to use the longdesc property as Sophia mentioned (but that will use the standard DM font). If you want to use a different font, that's more complex but I can write up a tutorial for that as I've lots of experience with DSB custom fonts by now.
User avatar
meadwarrior
Journeyman
Posts: 91
Joined: Sat Dec 01, 2018 1:02 am

Re: Custom graphics for objects in inter_objlook possible?

Post by meadwarrior »

You're right and it's true, I'm thinking about preparing everything in Photoshop... I'm already used to having lots of slightly different graphics around, so I guess it's the less nightmarish nightmare for me ;)

Image

Being able to put everything I want inside that field in any way possible makes up for it, though.

:arrow: That said, I'd really appreciate a tutorial on replacing the standard DM font! :!:
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Custom graphics for objects in inter_objlook possible?

Post by Sophia »

There is really nothing about that example graphic that isn't doable in sys_render_object, and doing it that way will be better in the long run because the graphic is being dynamically created by DSB rather than you being stuck with a static image. It'll also save a decent amount of memory!
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Custom graphics for objects in inter_objlook possible?

Post by Gambit37 »

How would DSB handle the two different style fonts in the last line?
User avatar
meadwarrior
Journeyman
Posts: 91
Joined: Sat Dec 01, 2018 1:02 am

Re: Custom graphics for objects in inter_objlook possible?

Post by meadwarrior »

While I absolutely agree with what you say, I'd still argue that the custom background (instead of objlook) support is something worthwile to have, particularly for edge cases like, say, smeared or otherwise obfuscated text (for puzzles), for easy text effects (different fonts, outlines and highlights, like with 'Arva' above) and other unique things that only happen with certain, singular items.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Custom graphics for objects in inter_objlook possible?

Post by Sophia »

Gambit37 wrote: Sat Dec 15, 2018 6:37 pm How would DSB handle the two different style fonts in the last line?
Not automatically, but you can specify a font in dsb_bitmap_textout so it's still doable with multiple calls to that function.
meadwarrior wrote: Sat Dec 15, 2018 6:42 pm I'd still argue that the custom background (instead of objlook) support is something worthwile to have, particularly for edge cases like, say, smeared or otherwise obfuscated text (for puzzles), for easy text effects (different fonts, outlines and highlights, like with 'Arva' above) and other unique things that only happen with certain, singular items.
Oh, yeah, don't worry, custom objlook support is still happening. :mrgreen:
User avatar
meadwarrior
Journeyman
Posts: 91
Joined: Sat Dec 01, 2018 1:02 am

Re: Custom graphics for objects in inter_objlook possible?

Post by meadwarrior »

Sophia wrote: Sat Dec 15, 2018 7:59 pm Oh, yeah, don't worry, custom objlook support is still happening. :mrgreen:
:mrgreen:
Post Reply