Directional Bitmaps

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. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Ser Xav
Lo Master
Posts: 449
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Directional Bitmaps

Post by Ser Xav »

Can DSB display bitmaps for objects dependent on view direction? For example, like the DM2 CROSS_1 object (it's called FLOORITEM_CROSS_1 in RTC).

Ie, If a bitmap is seen whilst the party faces north:
FLOOR_DECOR_FRONT0_N
FLOOR_DECOR_FRONT1_N
FLOOR_DECOR_FRONT2_N
FLOOR_DECOR_FRONT3_N

If a bitmap is seen whilst the party faces east:
FLOOR_DECOR_FRONT0_E
FLOOR_DECOR_FRONT1_E
FLOOR_DECOR_FRONT2_E
FLOOR_DECOR_FRONT3_E

And for side views:
FLOOR_DECOR_SIDE0_N....
FLOOR_DECOR_SIDE0_E....
etc

Sorry if I missed this in the wiki. Thanks :)
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Directional Bitmaps

Post by Sophia »

DSB accomplishes the same result through different means.

The viewangle property of an archetype specifies the direction(s) that it's visible from. This can either be a single direction, or a table containing booleans for all four directions, e.g., { true, false, true, false } would only be visible when looking north/south.

By creating objects that are only visible from certain directions and overlapping them on a tile, you can create the appearance of an object that looks different from different directions. The process of spawning the "sub-objects" can be automated, too, of course; look at the dm2 table for an example. I'd be happy to help you write some code to automate this task, as well, if needed.
User avatar
Ser Xav
Lo Master
Posts: 449
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: Directional Bitmaps

Post by Ser Xav »

Hi Sophia, thanks for your response. What would be very useful is a simple example of the code implementation, explaining how the viewangle property works within the archetype. Am not quite sure I fully understand where it goes and how it's configured. Many thanks.
User avatar
Gambit37
Should eat more pies
Posts: 13770
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Directional Bitmaps

Post by Gambit37 »

Check the DM2 table in the test dungeon, that's a clear example.
You place one table in ESB, and the engine will automatically spawn the one that's viewed from the other angle.
User avatar
Ser Xav
Lo Master
Posts: 449
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: Directional Bitmaps

Post by Ser Xav »

Oh, apologies, I didn't see the DM2 table in ESB test dungeon.... will study it. Thanks. :)
Post Reply