The Dink Network

Dink 1.09 and the undocumented "show_popup()" function

October 24th 2013, 08:57 AM
Peasant They/Them Australia
When Seth first came here a while ago with an announcement of a new Dink release we were all incredibly thrilled. When we got to play the beta version what probably was most intriguing were those funny boxes that popped up explaining how to feed the pigs and save your game etc.

Although RTSoft released documentation of a few new commands such as get_platform() in 1.09, there's at least one they didn't explain which is called show_popup(). It takes a rttex file as its first argument and a time value in milliseconds that determines the delay before showing it. Now, making an rttex file is quite simple. First of all you must check out the rtsoft SVN server in order to get the RTPack tool.

Then you must run it from the command line like so "RTpack -8888 'my infile.jpg'" which will spit out an .rttex file of the same name. From there you may copy that file to your DMOD dir and use it for your own purposes like this example. I have not tested whether or not show_popup() will accept a BMP file as an argument, but it is certainly possible. It seems to be hard-coded to play "tip_start.wav" upon showing it which is sort of annoying but whatever.
October 24th 2013, 10:28 AM
I was certainly "intrigued" by how dorky that sound is, and how the trend of the day is to hold the player's hand to an extreme.

Nonetheless, this is very interesting. Do the pop-ups behave in any curious ways, as opposed to something like copy_bmp_to_screen() or show_bmp()? I noticed they scroll to the screen in Dink HD, and you can close them by clicking/tapping the screen... Haven't tested the actual command yet.
October 24th 2013, 01:32 PM
Bard He/Him United States
Please Cindy, say the whole name each time. 
Your example had me laughing pretty hard. Thanks for that.
October 24th 2013, 10:06 PM
Peasant They/Them Australia
Upon the popup appearing, the game is paused and the background dimmed until it's dismissed with the space bar or a click after which it plays another wav file that sounds like a whooshing noise. It's much more polished that show_bmp() is, although the two seem to serve different purposes.

What may be interesting is that almost any image format may be converted to rttex and I suppose the next step is testing whether or not they may be loaded from dink.ini.