The Dink Network

set_mode()

September 10th, 06:08 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Just been trying various things with opening intros, and wanted to have some sprites play a sequence fading down and up between them before the game starts, so tried doing it before the set_mode(2) command, but it was behaving a little weird for me, as if there was a time limit and I could only have about 8 seconds or maybe 10 before the sprites would stop playing. Fade_down() seems to be not possible to after set_mode(2) has been called.

Never quite figured it out, so just decided to launch the game on a black screen and run the intro after calling set_mode(2) which let me run various sprites with fade_down and fade_up etc, just did a sp_nodraw() on Dink until intro was over.

Anyone know of any other info on the set_mode(), or the various mode states and what commands are possible?

It seems the sprite 1 as a mouse and clicking sprites as buttons is all fine and dandy in mode 1, but I'm not sure what else is... anything that causes the game to wait() seems to be no good until mode is set to 2, which automatically goes to mode 3 once set according to the DinkC reference.
September 10th, 09:29 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
Mode zero is triggered in two scenarios. The first occurs on initial launch after dink.ini/hard.dat load, and also when restarting using the escape or dinfo game over menus. In mode zero, the player sprite's values are reset to defaults and the engine ver text sprite at the bottom of the screen is drawn, after which main() in the start script is called.

After all of this eventuates, mode one is automatically set. Mode one hands player sprite control over to mouse input which will be forced within the boundary of the (full) screen, but otherwise allows for pretty much everything else should one want to manually script it in.

Mode two must be triggered by the scripter, and will set mode three automatically, and also load the screen specified by the player_map value, draw it, and then init the status bar health value. This all occurs in that order.

Pretty much everything should be possible in mode one and later. I've used waits extensively on the title screen with no trouble, and button brains will also work regardless of mode. I can't remember if drawing the screen cancels a fade, however.
September 11th, 10:30 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Thanks, not sure what I was doing the other day, but yeah, it all works before set_mode(2) is called, say_stop_xy(), fade_down(), fade_up(), brain 7 sprites playing. Ah the joys of DinkC and being old.....