The Dink Network

Changing status bars mid-game

November 26th, 06:38 PM
dinkdead.gif
Having trouble using init()...

I have custom status bars, if they are loaded in the ini file they work fine, however I want to switch status bars at different points in the game.

If this is used to switch graphics:
init("load_sequence_now graphics\myfolder\status\stat- 180 BLACK");

Then the game crashes as soon as draw_status() is called after that (crash = freeze for a second then instantly exit, like kill_game).

What am I missing?
November 26th, 06:41 PM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
save them in irfanview
November 26th, 06:43 PM
dinkdead.gif
They work fine if loaded "normally", so I don't think it's the graphics themselves. It's using init where there's a problem.
November 26th, 07:06 PM
wizardg.gif
LeprochaUn
Peasant Male Japan xbox steam bloop
Responsible for making things not look like ass 
It could be that you have to use set_mode() to remove the current status bars before changing them. I don't see why it would matter but eh, maybe it'll work?

I guess also make sure that whatever you're loading doesn't have more frames than the initial status bars. (I'm like 90% sure this can cause the type of crashes you're experiencing.)

November 26th, 08:22 PM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
shamelessly steal from dinky dimensions, which is inexplicably not v1.00 still.
November 27th, 10:22 AM
spike.gif
SlipDink
Peasant Male United States bloop
2nd generation. No easy way to be free. 
Whats this? Are you reviving work on "Shrine of the Dragon"? If so, then by all means please add some details to the "Preview" thread on that subject to whet our increasing appetites for more dmods!
November 27th, 03:56 PM
spike.gif
scratcher
Bard Male Finland bloop
cigarette bonca 
Try doing load_sequence without init? I'm not sure what the function of the init() command is, to be honest.

November 27th, 06:04 PM
duck.gif
toof
Peasant Male
I disagree. 
init() in DinkC is an abbreviation of the I've_never_intended_this() function. So yeah... You can omit that part
November 27th, 08:13 PM
boncag.gif
JugglingDink
Peasant Male United Kingdom steam
wagwarn 
I struggled with this a while back making a DMOD with characters you could switch between (much like Resident Evil 0), though sadly I never got around to finishing it. I can't remember the exact solution, but I seem to remember a large part of it having to do with compressing both the status bars I wanted into a single dir.ff file much like the compression used in the original release of the game.

This included having to recompress the original status bars into the new dir.ff along with the alternate ones I was adding.
November 28th, 05:57 AM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
If you can upload a sample D-Mod with this issue, I can debug the issue and figure out the root problem.
November 28th, 09:13 AM
dinkdead.gif
I'll try all these suggestions tonight

Redink - will do, thanks. Would it be easier if I emailed it to you rather than upload here?

SlipDink - Nope sorry, this is something else... Though SotD will probably also use different status bars, so this will come in useful there.
November 28th, 10:32 AM
spike.gif
SlipDink
Peasant Male United States bloop
2nd generation. No easy way to be free. 
@Sparrowhawk:
I'll try all these suggestions tonight

Well, which one worked? We are all students of DinkC, no matter how long we've played with it.

SlipDink - Nope sorry, this is something else... Though SotD will probably also use different status bars, so this will come in useful there.

Hmmmm. So, SotD is still coming; but not before this "something else...", right?

Well, tell us something about this "something else..." in the Previews threads then, no matter what it is... please? (Insert additional groveling here.)
November 28th, 04:59 PM
dinkdead.gif
"set_mode() ... maybe it'll work?"
Nope.

"make sure that whatever you're loading doesn't have more frames than the initial status bars"
It's the same.

"shamelessly steal from dinky dimensions"
This appears to do exactly what I'm doing.

"Try doing load_sequence without init?"
Could not get this to work, it's just ignored. How? Brackets? Quotes? Tried all sorts.

"save them in irfanview"
Didn't do nuffin.

"So, SotD is still coming; but not before this "something else...", right?"
Right. Eventually.

"Well, tell us something about this "something else...""
No

Redink - it's uploaded, in the rejected list. See readme.txt. Thanks
November 28th, 05:12 PM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
well at least i'm not alone in things not functioning for absolutely no reason whatsoever.
November 28th, 10:14 PM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
I tried out your demo, and it works with DinkHD v1.91 and FreeDink 108.4, but does indeed crash classic Dink v1.08.

Found the problem: your stat-06.bmp is a little too big: it is 3 x 61 pixels, but it needs to be 3 x 55 pixels. I used paint to resize it to 3 x 55, and it stopped crashing in v1.08.
November 29th, 05:34 AM
dinkdead.gif
Wow. Ok, I'll try that. But but why then does it work when used from the beginning?

Also, even when using init, the "magic loading" shows with the new stat-06.bmp. It's only draw_status which kills it, but at that point the bmp in question is already drawn.
November 29th, 11:22 AM
spike.gif
scratcher
Bard Male Finland bloop
cigarette bonca 
Could not get this to work, it's just ignored. How? Brackets? Quotes? Tried all sorts.

I meant just using load_sequence like it's used in dink.ini. I tried playing around with removing the init() parts from dink's scripts at some point, and everything seemed to work just as usual. I'm not sure what version of Dink I was using, though... Probably FreeDink.

Wow. Ok, I'll try that. But but why then does it work when used from the beginning?

Maybe the .bmps just need to be the same size, but the actual size doesn't matter. I tried using a status bar like this in v1.08, and it worked just fine.
November 30th, 04:35 AM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
I don't have a good explanation as to why it crashes. Maybe for the status bar it stores the original size of the images for later use, and when new imaged of a different size are used it gets confused somehow? (Kinda like a cratchet suggested).
December 2nd, 06:19 AM
dinkdead.gif
Didn't work
No change. Tried with Irfanview and GIMP for good measure. Maybe it's something to do with bit depth... I'll try lowering my status graphics to 8 bit if possible and see what happens. Is that all you did? Just shrink stat-06.bmp to 55px high?
December 2nd, 06:11 PM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
I could've sworn I just used mspaint to shrink the image. I had tried changing color depth beforehand, maybe I had those changes active too. I won't be home for a day or so, so I can't check at the moment.
December 2nd, 06:16 PM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
dink need more file format support...