The Dink Network

Hanging hags

Lost Forest Romp

October 9th 2012, 06:25 PM
anon.gif
shevek
Ghost
 
I've spent quite some time levelling up so I can take on the hags. I succeeded in that I can beat them. However, when I kill any two (doesn't matter which), the last one will freeze and it's impossible to hit it any further. I won't die as long as I don't touch it, but I can't kill it either, and there's a screen lock. Looks like a bug to me. Am I not supposed to be able to beat them? In that case I have no idea what else I could still do...
October 9th 2012, 07:22 PM
spike.gif
scratcher
Bard Male Finland bloop
cigarette bonca 
Yikes! I assume you're playing on FreeDink?

I actually had quite a few problems when I tried the dmod on both FreeDink and DinkHD. ;/ I rather lacked the inclination to fine tune it for other versions besides v1.08 (Aural+) at that point (it's super annoying, since there's nothing technically wrong with the code...) though I probably should have.

When two of the hags are dead, this code in the third one's hit procedure should run:
if (&story == 19)
{
sp_hitpoints(&current_sprite,0)
sp_brain(&current_sprite,19)
spawn("4fend")
}


There are two things that I think are most likely to freeze it there:

1. 4fend.c seems to be saved with unicode encoding, rather than the ANSI encoding usually used in scripts. Try opening the script and saving it again in ANSI encoding. This might remove some Äs and Ös from the script, but I'm not sure if that's a problem (they're only used in variable names). (I tried uploading an ANSIed version of the script on my website, but apparently the internet hates line breaks or something. )

2. Finding sprites by a fake brain might not work in FreeDink? There is this code in the beginning of 4fend.c:
freeze(1)
int &hag1 = get_sprite_with_this_brain(19,0)
sp_brain(&hag1,0)
sp_touch_damage(&hag1,0)
October 10th 2012, 02:29 AM
anon.gif
shevek
Ghost
 
I assume you're playing on FreeDink?

Yes.

unicode encoding, rather than the ANSI encoding

That sounds likely. I'll try it with a converted version.

Finding sprites by a fake brain might not work in FreeDink?

It does. If the code at the start wouldn't work, the hags would freeze before they even started.

I'll let you know about the result, but not right away, as I have other things to do now.

Thanks! (And by the way, it's a nice dmod! )
October 10th 2012, 06:02 AM
anon.gif
shevek
Ghost
 
unicode encoding, rather than the ANSI encoding

Utf-8 would probably work, but this was utf-16. I'm surprised that regular Dink can handle it, actually. Anyway, saving it with ANSI encoding did the trick.

Thanks!
October 10th 2012, 11:41 AM
spike.gif
scratcher
Bard Male Finland bloop
cigarette bonca 
Glad you liked it. I think there are a few other scripts with that encoding, so I think I'll change them to ANSI and upload a new version of the dmod sometime.

Did you have other problems playing it on FreeDink? I actually couldn't blow up rocks with bombs like you're supposed to when I tried it. ;/
October 13th 2012, 03:11 AM
custom_magicman.gif
magicman
Peasant Netherlands steam duck
Mmmm, pizza. 
Just tried it on my 1.08 installation with a testfile encoded as utf-16. Didn't work either. Looking at the 1.08 source code, there's nothing weird happening. But: the strlen() function (and presumably all other string functions) in the C library that Dink is compiled with in Windows looks at the system's locale, and reads files as if that's the file locale.

So: reading utf-16 encoded files on an utf-16 Windows system? No worries. Using utf-16 encoded files on any other system? Nope.

(which makes me wonder why reading ANSI-encoded files on an utf-16 Windows works, as evidently scratcher is able to play other people's D-Mods, because reading ANSI files as if it was utf-16 results in utter garbage, but that's probably a Windows backward-compatible thing)