The Dink Network

Main dialogue colour

February 8th 2013, 11:41 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Does anyone know what the mark is for the main colour text (yellow)? I'd like to change it for a choice menu, but I can't find the correct colour mark.
February 8th 2013, 11:50 AM
goblins.gif
I'm not really sure where it's originally determined ( I guess at the beginning of the game sometime), but I believe it can be changed like so:

//color index is the number that would appear after the ` in the beginning of say()
//red, green and blue are numbers between (0-255)
set_font_color(Color index, red, green, blue)


Just bear in mind that any changes made are not saved with the savegame data.
Also, I can't quite remember what Dink's default number is, but it's seems to either be based on the default colors table: `! `@ or `$

edit: It's `$, or maybe 14 is what the script wants

EDIT: Okay yeah it would be
set_font_color(14, red, green, blue);
then you have your own default color
February 8th 2013, 12:19 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Nope, that doesn't seem to work. And btw, I do know how to change the colour. I'm just trying to figure out how to change the default/main colour.
February 8th 2013, 12:24 PM
goblins.gif
Hmm, I haven't tested the code myself, but according to the DinkC reference it should have worked. It says the default is `$ (14).

And yeah, I would be pretty impressed if you made HH2 without knowing how to change dialog color.
February 8th 2013, 12:28 PM
goblins.gif
Okay, I just did a test. I put in main.c:

set_font_color(14, 255, 255, 255);


It worked and made all of Dink's text white. It didn't effect menus like when you press escape though. I don't have any idea how to change that default.

Edit: Oh, I noticed your post changed...

This should work
set_title_color 14
February 8th 2013, 12:34 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Well, after looking it into a bit more, I did get Dink's dialogue colour changed. But the choice menu colour seems to be a bit more tricky.
February 8th 2013, 02:34 PM
spike.gif
Maybe one of the other yellow colours controls that? (There are what, two or three at least?) That would be pretty cool, actually.

EDIT: The choice colours seem to be unchangeable via set_font_color. Boo!
February 8th 2013, 04:47 PM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
I worked some magic for HSL2 that can change choice menu option colors. Would you like me to send you the stuff through Skype/PMs? Or even on here, if others are interested.
February 8th 2013, 04:55 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Oh yes! Send them here. Wouldn't make sense to deny others this information.
February 8th 2013, 04:56 PM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
Alright. While I'm organizing the scripts for posting, this is what the result looks like: Link (forgot to last time)

One of the perks opens up more dialogue options, and they're grayed out or green if they're locked or unlocked, respectively.
February 8th 2013, 05:01 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Looks great! And seems much more useful than I actually first thought.
February 8th 2013, 05:16 PM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
Alright, I'm terrible at explaining things but the gist of it is: The engine absolutely does not care if we say that choices are different colors, so we have to do the entire things by hand. A lot of the stuff in this script that may seem complicated is really just drawing a choice box and putting text over it. The variable &ch is used to determine which choice we are on, and it is increased or decreased when the player hits the arrow keys, and the choice is redrawn. I've annotated some things, but as I've said, I'm terrible at showing my work. I'll try to troubleshoot problems as they arise, but hopefully it won't be too sloppy.

------
Script
------
The script below is an updated, cleaner version This URL leads to the older version, with checks for a sidequest variable and some censored dialogue.

void main(void)
{
        //This checks if the player has perk 12, the Speech perk.
  external("perks", "getPerk", 12);
  int &speech = &return;
  int &text;
  int &text2;
  int &text3;
  int &text4;
  int &text5;
  int &text6;
  int &text7;
  int &title;
  int &title2;
  int &ch;
  &ch = 1;
  int &kara = get_sprite_with_this_brain(16, &current_sprite);
}
 
void talk(void)
{
 
  if(&speech > 0)
  {
    &ch = 1;
  }
 
  if(&speech < 1)
  {
    &ch = 2;
  }
  freeze(1);
  freeze(&current_sprite);
  wait(100);
 
  //Left, Mid/Mid2, and Right create the choice box
  int &left = create_sprite(151, 286, 0, 30, 2);
  sp_que(&left, 9000);
 
  int &mid = create_sprite(325, 270, 0, 30, 3);
  sp_que(&mid, 9000);
 
  int &mid2 = create_sprite(383, 270, 0, 30, 3);
  sp_que(&mid, 9000);
 
  int &right = create_sprite(525, 285, 0, 30, 4);
  sp_que(&right, 9000);
 
  //1a, 1b, etc. are the wooden arrows that point at the current choice. They are invisible by default.
  int &1a = create_sprite(155, 222, 6, 456, 1);
  sp_nodraw(&1a, 1);
  sp_seq(&1a, 456);
  sp_que(&1a, 9001);
  int &1b = create_sprite(525, 222, 6, 457, 1);
  sp_nodraw(&1b, 1);
  sp_seq(&1b, 457);
  sp_que(&1b, 9001);
  int &2a = create_sprite(155, 245, 6, 456, 1);
  sp_nodraw(&2a, 1);
  sp_seq(&2a, 456);
  sp_que(&2a, 9001);
  int &2b = create_sprite(525, 245, 6, 457, 1);
  sp_nodraw(&2b, 1);
  sp_seq(&2b, 457);
  sp_que(&2b, 9001);
  int &3a = create_sprite(155, 265, 6, 456, 1);
  sp_nodraw(&3a, 1);
  sp_seq(&3a, 456);
  sp_que(&3a, 9001);
  int &3b = create_sprite(525, 265, 6, 457, 1);
  sp_nodraw(&3b, 1);
  sp_seq(&3b, 457);
  sp_que(&3b, 9001);
  int &4a = create_sprite(155, 202, 6, 456, 1);
  sp_nodraw(&4a, 1);
  sp_seq(&4a, 456);
  sp_que(&4a, 9001);
  int &4b = create_sprite(525, 202, 6, 457, 1);
  sp_nodraw(&4b, 1);
  sp_seq(&4b, 457);
  sp_que(&4b, 9001);
  int &5a = create_sprite(155, 205, 6, 456, 1);
  sp_nodraw(&5a, 1);
  sp_seq(&5a, 456);
  sp_que(&5a, 9001);
  int &5b = create_sprite(525, 205, 6, 457, 1);
  sp_nodraw(&5b, 1);
  sp_seq(&5b, 457);
  sp_que(&5b, 9001);
  int &6a = create_sprite(155, 162, 6, 456, 1);
  sp_nodraw(&6a, 1);
  sp_seq(&6a, 456);
  sp_que(&6a, 9001);
  int &6b = create_sprite(525, 162, 6, 457, 1);
  sp_nodraw(&6b, 1);
  sp_seq(&6b, 457);
  sp_que(&6b, 9001);
  int &7a = create_sprite(155, 285, 6, 456, 1);
  sp_nodraw(&7a, 1);
  sp_seq(&7a, 456);
  sp_que(&7a, 9001);
  int &7b = create_sprite(525, 285, 6, 457, 1);
  sp_nodraw(&7b, 1);
  sp_seq(&7b, 457);
  sp_que(&7b, 9001);
 
  //////CHOICES
  //We aren't using an actual choice menu, so we have to make the title ourselves.
  &title = say_xy("`3Title", 25, 115);
  //Title never dies (it's just missing in action)
  sp_kill(&title, 0);
  //Loop to draw text in correct colors
loop:
  freeze(1);
  wait(1);
  //nodraw ALL the arrows
  sp_nodraw(&1a, 1);
  sp_nodraw(&1b, 1);
  sp_nodraw(&2a, 1);
  sp_nodraw(&2b, 1);
  sp_nodraw(&3a, 1);
  sp_nodraw(&3b, 1);
  sp_nodraw(&4a, 1);
  sp_nodraw(&4b, 1);
  sp_nodraw(&5a, 1);
  sp_nodraw(&5b, 1);
  sp_nodraw(&6a, 1);
  sp_nodraw(&6b, 1);
  sp_nodraw(&7a, 1);
  sp_nodraw(&7b, 1);
 
  sp_active(&text, 0);
  //The choice is 1, so we nodraw(0) the arrows and create some standard text (In White, since it's selected)
  if(&ch == 1)
  {
    sp_nodraw(&5a, 0);
    sp_nodraw(&5b, 0);
    &text = say_xy("`%Option 1",25,190);
   
  }
 
  external("perks", "getPerk", 12);
  int &speech = &return;
  if(&ch != 1)
  {
    if(&speech > 0)
    {
      &text = say_xy("`0Option 1 - Green",25,190);
    }
   
    if(&speech < 1)
    {
      &text = say_xy("`7Option 1 - Grey",25, 190);
    }
   
  }
 
  sp_kill(&text, 0);
  sp_que(&text, 9001);
 
  sp_active(&text2, 0);
  if(&ch == 2)
  {
    sp_nodraw(&1a, 0);
    sp_nodraw(&1b, 0);
    &text2 = say_xy("`%Option 2 - Selected",25, 210);
  }
 
  if(&ch != 2)
  {
    &text2 = say_xy("`!Option 2 - Not Selected",25, 210);
   
  }
  sp_kill(&text2, 0);
 
  sp_active(&text3, 0);
  if(&ch == 3)
  {
    sp_nodraw(&2a, 0);
    sp_nodraw(&2b, 0);
    &text3 = say_xy("`%Option 3 - Selected?",25, 230);
  }
 
  if(&ch != 3)
  {
    &text3 = say_xy("`!Option 3 - Not Selected", 25, 230);
  }
 
  sp_kill(&text3, 0);
  sp_que(&text3, 9001);
 
 
 
  sp_active(&text4, 0);
  if(&ch == 4)
  {
    sp_nodraw(&3a, 0);
    sp_nodraw(&3b, 0);
    &text4 = say_xy("`%Option 4 - Selected",25, 250);
  }
 
  if(&ch != 4)
  {
      &text4 = say_xy("`!Option 4 - Not Selected",25, 250);
  }
  sp_kill(&text4, 0);
 
 
 
 
 
 
  sp_active(&text5, 0);
  if(&ch == 5)
  {
    sp_nodraw(&7a, 0);
    sp_nodraw(&7b, 0);
    &text5 = say_xy("`%Option 5 - Selected",25, 270);
  }
 
  if(&ch != 5)
  {
   
    &text5 = say_xy("`!Option 5 - Not Selected",25, 270);
  }
  sp_kill(&text5, 0);
 
 
 
  //18 is up, 12 is down
  wait_for_button();
  //Regular choice menus allows for left and right as well. We're just as good as them!
  if(&result == 14)
  {
    goto down;
   
  }
 
  if(&result == 16)
  {
    goto up;
  }
 
  if(&result == 1)
  {
  //Kill all the stuff, we're choosing things now
    playsound(17,22050,0,0,0);
    sp_active(&text, 0);
    sp_active(&text2, 0);
    sp_active(&text3, 0);
    sp_active(&text4, 0);
    sp_active(&text5, 0);
    sp_active(&left, 0);
    sp_active(&mid, 0);
    sp_active(&mid2, 0);
    sp_active(&right, 0);
    sp_active(&title, 0);
    sp_active(&title2, 0);
    sp_active(&1a, 0);
    sp_active(&1b, 0);
    sp_active(&2a, 0);
    sp_active(&2b, 0);
    sp_active(&3a, 0);
    sp_active(&3b, 0);
    sp_active(&4a, 0);
    sp_active(&4b, 0);
    sp_active(&5a, 0);
    sp_active(&5b, 0);
    sp_active(&6a, 0);
    sp_active(&6b, 0);
    sp_active(&7a, 0);
    sp_active(&7b, 0);
   
    if(&ch == 1)
    {
    //They picked option 1! Option 1 things here!
    unfreeze(1);
        unfreeze(&current_sprite);
        return;
    }
   
    if(&ch == 2)
    {
        //Option 2
      unfreeze(1);
      unfreeze(&current_sprite);
      return;
    }
   
   
   
   
    if(&ch == 3)
    {
        //Option 3
      say_stop("Spoilers.",1);
      unfreeze(1);
      unfreeze(&current_sprite);
      return;
    }
   
    if(&ch == 4)
    {
      //Option 4
          unfreeze(1);
          unfreeze(current_sprite);
          return;
     
    }
   
   
   
    if(&ch == 5)
    {
        //Option 5
      unfreeze(1);
      unfreeze(&current_sprite);
      return;
    }
   
  }
 
 
 
  if(&result == 12)
  {
down:
    playsound(11,22050,0,0,0);
    freeze(1);
    if(&ch == 1)
    {
      &ch = 2;
      goto loop;
    }
   
    if(&ch == 2)
    {
      &ch = 3;
      goto loop;
    }
   
    if(&ch == 3)
    {
      &ch = 4;
      goto loop;
    }
   
    if(&ch == 4)
    {
      &ch = 5;
      goto loop;
    }
   
    if(&ch == 5)
    {
      if(&speech > 0)
      {
        &ch = 1;
      }
     
      if(&speech < 1)
      {
        &ch = 2;
      }
      goto loop;
    }
   
   
  }
 
  if(&result == 18)
  {
up:
    freeze(1);
    playsound(11,22050,0,0,0);
    if(&ch == 1)
    {
      &ch = 5;
      goto loop;
    }
   
    if(&ch == 2)
    {
     
      if(&speech > 0)
      {
        &ch = 1;
      }
     
      if(&speech < 1)
      {
        &ch = 5;
      }
      goto loop;
    }
   
    if(&ch == 3)
    {
      &ch = 2;
      goto loop;
    }
   
    if(&ch == 4)
    {
      &ch = 3;
      goto loop;
    }
   
    if(&ch == 5)
    {
      &ch = 4;
      goto loop;
     
    }
   
    else
    {
      goto loop;
    }
    //unfreeze(1);
    //unfreeze(&doc);
    //say("Not right now, thanks.",1);
    //return;
  }
 
  goto loop;
}

February 8th 2013, 05:22 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Great script! This opens up some interesting roleplaying options.