Changing the title screen when player reaches certain points of the game

Started by Vel, Fri 20/02/2004 09:14:25

Previous topic - Next topic

Vel

Hey again.
is it possible to change a sprite at the title screen if the player has reached a certain point of the game (not necessarily the end)?

Gilbert

Yes, one way I can thoght of is to write to some file using FileWrite(), etc. whenever the player had reached some progress.
So in the title screen it will read the generated file to check for the progress and do whatever suitable actions.

SSH

If you only change the sprite/title screen once, then you don't even have to read the file: just try opening it and if it exists, it will succeed, if it fails it will not.


Or you could save a game in one of the "invisible" slots and check if that slot exists.

Or if you want to be really clever and risky, you could try opening the game exe itself in append mode and adding some stuff on the end, and check if that stuff is there or not. I don't know if you can open the exe while it is running, though.
12

Vel


Scummbuddy

why not just do a search of a global int in the before room fades in, to see if that int is a certain thing, and if so, change the background  frame accordingly?

edit.i see how this wouldn't work, forgive my blindness.  ;)
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Darth Mandarb

Why would you be going back to the title screen?

Do you mean, like in MarioKart 64, after you have accomplished certain goals in the game, when you cold-load the game it uses a different screen?

I can think of several ways I guess.  Most have been mentioned.  You could just create a different room with the changed background too ... and just change which room the game considers the title screen.

Is there a way to alter the 'default' value of a global variable?  Meaning, the first time you start the game it's set to 0, but after you accomplish something it changes to 1 BUT when/if you reset the game it stays at 1 rather than going back to the default of 0.

That would be one way of doing it if it's possible.

Then the game says:
if global variable is 0 go to this title screen
else if global variable is 1 go to this title screen

This way you could actually have multiple changes too.

~ d

Gilbert

No, it's not with going back to the title screen I suppose. I think he wanted the change to take place next time the player executes the game.

SSH

Here's my example:

stick this in the before fadein of intro room

   int handle=FileOpen("intro.cfg", FILE_READ);
   if (handle==0) {
     FileOpen("intro.cfg", FILE_WRITE);
     if (handle != 0) {
       FileWrite (handle, "Intro has been seen");
       FileClose(handle);
     }
   } else {
     FileClose(handle);
     NewRoom(SKIP_INTRO_ROOM);
     return;
   }
12


SMF spam blocked by CleanTalk