The Dink Network

crawling into hole warps in DinkHD

March 28th, 08:29 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
So the crawl into a hole warps sometimes don't play the animated sequence in DinkHD, but they do in freedink.

Looking at my scripts versus original Dink game for crawl hole warps, I can't see any functional difference other than I'm attaching the script to sprite 1000 before doing the map change

My script
//hole to Goblin's Lair

void main( void )
{
preload_seq(452);
preload_seq(850);
sp_touch_damage(&current_sprite, -1);

}

void touch( void )
{
freeze(1);
int &acrap = free_items();
if (&acrap < 1)
{
 move_stop(1, 2, 200, 1);
 say("I'd better get rid of some stuff first.", 1);
 unfreeze(1);
 return;
}sp_x(1, 492);
sp_y(1, 172);
sp_seq(1, 452);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
sp_touch_damage(&current_sprite, 0);
sp_brain(1, 0);
wait(2000);
script_attach(1000);
fade_down();
//take Dink to Goblin's Lair
&player_map = 8;
sp_x(1, 315);
sp_y(1, 350);
load_screen(8);
sp_brain(1, 1);
draw_screen();
fade_up();
kill_this_task();


script for s1-hole from original game
void main( void )
{
preload_seq(452);
}

void touch( void )
{
if (&life < 1) return;

freeze(1);
sp_x(1, 274);
sp_y(1, 195);
sp_seq(1, 452);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
sp_touch_damage(&current_sprite, 0);
sp_brain(1, 0);
wait(2000);
sp_brain(1, 1);
&player_map = 131;
sp_x(1, 289);
sp_y(1, 377);
load_screen(131);
draw_screen();
}


Removing the script_attach(1000) doesn't seem to help, as screen stays black, although you can warp back out. But if you go through once and try again, (with the script_attach line back in) it seems to work, so it must be a loading into memory thing, although my script has a preload_seq in the main procedure...

March 29th, 12:52 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
>so it must be a loading into memory thing

This is the source of preload_seq in dink.cpp:

		if (compare(ev[1], (char *)"preload_seq"))
		{
			/*

			h = &h[strlen(ev[1])];
			int32 p[20] = {1,0,0,0,0,0,0,0,0,0};
			if (get_parms(ev[1], script, h, p))
			{
				check_seq_status(g_nlist[0]);
			}

			strcpy(pLineIn, h);
			*/
			return (0);
		}


All that stuff in the middle is a commented-out leftover from 1.08, while at the end it returns zero. i.e. it's an empty function that does nothing.
April 1st, 06:15 AM
seth.gif
Seth
Peasant He/Him Japan
 
Hmm. I could try turning back on that preload_seq... wonder if that would help.. I can't remember anything about that whole system. ^_^;;

The entire system was modified so it can unload all graphics at any time and be able to load things "as needed" without the game breaking. (in theory)

This was useful for save-states and making everything work on low-memory devices like the iPhone 3GS or whatever which required unloading things as memory got tight. (not an issue these days, but still could be useful for playing in browser or weird ports to things like the psp)
April 2nd, 12:39 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
I just tested sob redux in RTDink on the web using Firefox and the error with freezing Dink and not showing the crawl animation wasn't there, but it was there in DinkHD when I jumped back to that.

Only tested the getting thrown into prison and then escaping scene in the first story.
April 3rd, 09:49 PM
seth.gif
Seth
Peasant He/Him Japan
 
Hmm, is there a DMOD zip plus "savestate in a screen nearby" package I could get by any chance? Might help me track the issue! The browser version is a bit out of date, that might be before some optimizations were done to make the script processing much faster.
April 4th, 05:49 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
If you download the latest SOB dmod and then these files

quicksave and continue_state.dat files Story 1

Might help, but when I tried to reload both of these on restarting the SOB dmod it no longer demonstrated the hold error, in either the prison/dungeon scene where Dink has to do one more punch to find the hole to crawl through (the quicksave) nor going 1 screen north and move to the hole in the cliff past the four orange scorpions (the continue_state.dat).

I only get the error the first time Dink tries to crawl through the hole on playing the game, I thought a re-start would replicate the error buy it didn't.

I certainly got it straight after using the F1 quicksave option in the dungeon, but... it didn't replicate when I reloaded and didn't happen when crawling through to Goblin's cave later while playing... so weird...
April 4th, 08:15 AM
seth.gif
Seth
Peasant He/Him Japan
 
Thanks, gonna check it out soon
April 5th, 01:17 AM
seth.gif
Seth
Peasant He/Him Japan
 
Ok, I did see the "missing anim" problem happening in the prison.

I didn't immediately see a reason why sometimes it would work and sometimes it wouldn't, but if I reloaded the scripts completely, (keep in mind savestates get stuck with whatever the scripts are when in memory) then do a new savestate, now the savestate was fixed and it seemed to work every time. Did I accidently fix this somehow (I did do a few changes with signed vs unsigned ints with timing..) , but older savestates would have it broken?

Not sure, but I think I'll call it good unless I can reproduce it with newer savestates.

April 5th, 10:13 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
I think it is unfortunately an intermittent error.

I got it again with the new version 2.05 on Windows PC.

Loaded up a save game that is just after the intro cut scenes, went through the business of getting thrown in to prison, eating five roaches and then trying to punch the wall, and the crawl through animation didn't play.

Here is the save game I'm using to test

SOB Story 1 save 1
April 5th, 11:23 PM
seth.gif
Seth
Peasant He/Him Japan
 
Thanks, will check it out. While these kinds of things can be tricky to find and fix, when it is, it's almost always a case of a tip of the iceberg situation of some deeper underlying problem affecting more, so worth it.