The Dink Network

Status bar

April 7th 2013, 06:35 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
We all know what is contained in Dink Smallwoods interface. The status image is loaded and hooks up with main.c or something:

Bunch o' numbers telling us Dink stats (&strength, &defense, &magic in main.c)
Amount of hitpoints which is a bar (&life).
Amount of coins (&gold).
Experience and weapons and magic bla bla ALL THESE THINGS. When Dink gets a magic potion, a new image containing a higher number is put up on the interface.

Is it possible to disable and alter the appearance of these with just scripts? Like this stupid example...

Let's make a new scripted status bar! YAY:

All I want in my status bar is four magic slots with different kind of spells chosen from the inventory somehow and nothing else, just four boxes with pictures of the chosen spells and that cool cooldown bar wrapped around them. No numbers or stuff changing or appearing when gaining exp etc. on the status bar.

Is this possible to do without changing source code of Dink Smallwood (not DinkC story folder) and whatnot? Is the status bar lightly coded in DinkC and can be altered by the user?
April 7th 2013, 07:05 PM
wizardg.gif
I believe so. You'd have to figure out the xy values, and that'd be a major pain, but other than that I don't think it'd be too hard. I'm not looking into the main right now so I don't know for sure.

However the cooldown bar on each could present a problem. I expect you'd want every spell to have their own cooldown rate, and this is where I'm not sure what to do.
April 7th 2013, 08:29 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
The bad: The status-bar is hard-coded into the engine; you can't directly change any of the elements, though you may be able to get very close by faking it.

The good: sp_noclip() exists, so you can place sprites over the status bar area.

The ugly: You'll have to do everything yourself. Everything.

How to get rid of everything:

I'm not sure if it'll work, but if you keep &update_status at 0, and never call draw_status(), I'm thinking the statusbar will never appear! Keep in mind that selecting an item or a spell in the inventory screen will automatically call draw_status(). You can disable the inventory screen by putting some nonsense code into button4.c.

If that doesn't work, or if you need to go into the inventory screen and the status bar *does* draw itself. Well...

To make the strength, defense, magic, gold, exp, HP, and level displays disappear, you'll have to load empty graphics into their sequences. If &magic and &magic_cost are ever greater than 0, the charge bar will appear, so you may want to load empty graphics into those sequences as well.

Anyway, this should give you either an empty status area, or a status bar without any status on it. Now it's time to create_sprite() some replacement icons there. Make sure to use sp_noclip(). 0 means "Can't appear on statusbar", 1 means "Being on the statusbar is awesome!".

Finally, you need to make sure to redraw everything once the screen changes, as even sprites wit sp_noclip() set to 1 will disappear. The easiest way would be through an infinite loop that's started using spawn() somewhere. You'll need to loop anyway to make sure that your own recharge bars are updated.

It's definitely not impossible, but it's involved. Good luck!
April 8th 2013, 03:18 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
I must say that I haven't tried, but couldn't you just place an empty black sprite on top of the status bar to stop it from appearing? That would save the hassle of preventing draw_status() all the time...
April 8th 2013, 03:50 AM
dinkdead.gif
I messed with the status bar in Bug Mania.

I didn't add new features to it but I did use the existing strength/magic/whatever as a score counter.
IIRC I made new status bar graphics and smaller sprites to cover whichever stats I wasn't using.
Thinking about it now maybe it would've been easier to create one large status bar-sized sprite with holes in for the stats I wanted to show... don't remember now really.

Anyway, my point is that using sprites there is easy enough, just mess with the depth que too.
April 8th 2013, 05:03 AM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
I will definitely tinker around with this and thanks for all the input so far . If you know other dmods that have modified status bars except graphics, post them here. I will help myself checking out Bug Mania, Sparrowhawk.
April 8th 2013, 07:44 AM
anon.gif
shevek
Ghost They/Them
 
maybe it would've been easier to create one large status bar-sized sprite with holes

I don't think that's possible, unless you put that sprite as a "real" sprite over the hardcoded statusbar; the number are written on top of it, and holes are ignored.

Also, the number sprites are copied to the status area without regard for their white pixels. In PyDink, I currently have an exception specifically for that (but I'll probably move that to the code which converts Dink info into PyDink info, so "native" PyDink DMods don't have to care about it). It means that all numbers, except for Dink's level, cannot have transparency.
April 8th 2013, 09:01 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
It means that all numbers, except for Dink's level, cannot have transparency.

Yes, when tinkering around with removing elements from the status bar without scripts this is a hassle. Else it would be as easy as just changing the graphics to 1 by 1 white pixels and be done with it, but as it stands it will show those white pixels now instead of being transparent
April 8th 2013, 12:04 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
hello shevek how do i get your dink editor downloaded again? The git links don't seem to work anymore. Have you a new server?
April 8th 2013, 04:48 PM
dinkdead.gif
"unless you put that sprite as a "real" sprite over the hardcoded statusbar"

That's what I meant.

" the number are written on top of it, and holes are ignored"

Not sure what you mean? I meant to make a normal sprite with noclip and a high depth que and to leave white (ie transparent) areas where I wanted the numbers to show through.
April 9th 2013, 08:12 AM
anon.gif
shevek
Ghost They/Them
 
how do i get your dink editor downloaded again? The git links don't seem to work anymore. Have you a new server?

Ah, of course. I've moved my server to a new place.

To avoid such problems in the future, I've put everything on github.

All the source is there; you probably only want release.zip, which is the latest version (well, the snapshot of the last time I created a release). It contains gui.py, so you don't need to separately get that (even though the readme says you should).

Please read the README.md file (shown below the file list on github) for installation instructions. If anything is unclear, please let me know.
April 9th 2013, 08:18 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
Thanks for that. I'll give it a go some time later this week.