Author Topic: Credits.tbl  (Read 1718 times)

0 Members and 1 Guest are viewing this topic.

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
I was hoping to get a little more control for the credits screen.

Basically, the images currently are chosen at random.. sorta of. I watched it a couple different times and checked out the code. I'm pretty sure that currently FSO chooses one random start image index and the plays through the credits images in sequence. I'm 99% sure this is the way it works.

I'm thinking to simply add a check for a flag in the credits table (say.. $Start Image Index) where if the flag exists use that as the starting index, but if the flag is not present, go ahead and use the rand function (like it currently does).

I was wondering if anyone might be able to add this little option in there for me?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Easily done.  Remind me later if someone else hasn't done it by then.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Great. Since it seems so easy, I went ahead and put a mantis request in.

http://scp.indiegames.us/mantis/view.php?id=2453
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 
5 minute hack attempt to get @Goober5000 started - I'm not 100% about the file string handling.

Code: [Select]
Index: credits.cpp
===================================================================
--- credits.cpp (revision 7239)
+++ credits.cpp (working copy)
@@ -210,7 +210,7 @@
 static int Credits_frametime; // frametime of credits_do_frame() loop in ms
 static int Credits_last_time; // timestamp used to calc frametime (in ms)
 static float Credits_counter;
-static int Credits_artwork_index;
+static int Credits_artwork_index = -1;
 static int Credits_bmps[NUM_IMAGES];
 
 char *Credit_text = NULL;
@@ -326,6 +326,11 @@
  read_file_text("credits.tbl", CF_TYPE_TABLES);
  reset_parse();
 
+ if ( optional_string( "$Start Image Index:" ) )
+ {
+ stuff_int( &Credits_artwork_index );
+ }
+
  // keep reading everything in
  strcpy(Credit_text, fs2_open_credit_text);
     
@@ -505,7 +510,10 @@
  Buttons[EXIT_BUTTON][gr_screen.res].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
 
  Background_bitmap = bm_load(Credits_bitmap_fname[gr_screen.res]);
- Credits_artwork_index = rand() % NUM_IMAGES;
+ if ( Credits_artwork_index == -1 )
+ {
+ Credits_artwork_index = rand() % NUM_IMAGES;
+ }
  for (i=0; i<NUM_IMAGES; i++){
  Credits_bmps[i] = -1;
  }


edit: Should mention that you put $Start Image Index: <integer> at the start of the table, and there's no bound checking done.
edit2: Should also mention that this hasn't really been tested...
« Last Edit: June 12, 2011, 10:08:14 pm by portej05 »
STRONGTEA. Why can't the x86 be sane?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Heh... I've already coded it, but I did something very similar to what you did.  Except I included bounds checking. :p

Anyway, I'm committing it.  Though Mjn.Mixael, Mantis is really supposed to only be used for bugfixes, not feature requests.