Jump to content

Photo

Different Dmap Map


  • Please log in to reply
4 replies to this topic

#1 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 21 February 2019 - 10:38 AM

Would it be possible for someone to make a script where when you press the "map" button it shows a different dmap than the one you are on? You could possibly choose the dmap through arguments, and this script would preferably work on a screen by screen basis. 



#2 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 21 February 2019 - 12:22 PM

It would be possible, yes, though not exactly easy. There's no way for scripts to access the built-in map feature, so it'd have to be remade from scratch. It could be done though... sort of. The general idea would be to make a bunch of DrawScreen calls and draw them to a bitmap, then draw the bitmap over the screen and let you pan around/zoom in and out. The problem is that bitmaps aren't nearly big enough to draw an entire map to, so you wouldn't be able to zoom out and see the entire map at once the way you can with the built in map. You could get around that by basically taking a picture of the map, shrinking it down in an external image program, ripping that in as tiles, and drawing those tiles, but then you wouldn't really have a dynamic zoom like the built-in map does. It'd also take up a lot of tile pages and have to be hardcoded on a map by map basis.

To answer your question concisely, it's theoretically possible to an extent, but not really practical, unless you were willing to have just a really zoomed out and/or really zoomed in version.
  • Korben likes this

#3 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 22 February 2019 - 01:35 PM

Ah, okay. Thanks for the reply.



#4 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 01 March 2019 - 12:52 PM

The problem is that bitmaps aren't nearly big enough to draw an entire map to,

In 2.55 you can create custom bitmaps with custom sizes. They are a relatively new feature, though; so they still may have some bugs. (If anyone finds any bugs, please file a report either in the ZC Development forum here, or in the development discord, so that we can get the issue fixed)

 

`bitmap x = Game->CreateBitmap(width, height);`

Various functions for this can be found in the ZScript_Additions.txt file (effectively the zscript.txt for the new 2.55 stuff).



#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 March 2019 - 05:34 AM

In 2.55 you can create custom bitmaps with custom sizes. They are a relatively new feature, though; so they still may have some bugs. (If anyone finds any bugs, please file a report either in the ZC Development forum here, or in the development discord, so that we can get the issue fixed)
 
`bitmap x = Game->CreateBitmap(width, height);`
Various functions for this can be found in the ZScript_Additions.txt file (effectively the zscript.txt for the new 2.55 stuff).


True, but untested. I suppose that you could create a bitmap with the size of the screens that you want to displa, use bitmap->DrawScreen() to put them onto that bitmap, then blit to the screen as desired, with pan variables. Further, you could use the scale args for a zoom effect.
  • Emily likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users