Colour

Posted by Ardentcrest on Sat 29 Nov 2014 11:02 PM — 16 posts, 59,550 views.

#0
I dont want my players to have the choice to pick


Would you like RIP, ANSI or no graphic/color support, (R/A/N)?

how do i get a default N
Australia Forum Administrator #1
Change the code to not ask that question.
#2
I know That. :D

I'm not big on C I know some Z80 and a bit of PHP.

I know where it is but not what to do.
Australia Forum Administrator #3
Well, in comm.c find the lines which ask the question, ie.


...

   write_to_buffer( d, "\r\nWould you like RIP, ANSI or no graphic/color support, (R/A/N)? ", 0 );
   d->connected = CON_GET_WANT_RIPANSI;
}

void nanny_get_want_ripansi( DESCRIPTOR_DATA * d, char *argument )
{
   CHAR_DATA *ch;
   char log_buf[MAX_STRING_LENGTH];

   ch = d->character;

   switch ( argument[0] )
   {
      case 'r':
      case 'R':
         xSET_BIT( ch->act, PLR_RIP );
         xSET_BIT( ch->act, PLR_ANSI );
         break;
      case 'a':
      case 'A':
         xSET_BIT( ch->act, PLR_ANSI );
         break;
      case 'n':
      case 'N':
         break;
      default:
         write_to_buffer( d, "Invalid selection.\r\nRIP, ANSI or NONE? ", 0 );
         return;
   }


We need to not ask the question, and drop into the next thing in the sequence, so something like this should do it:



...
//   write_to_buffer( d, "\r\nWould you like RIP, ANSI or no graphic/color support, (R/A/N)? ", 0 );
//   d->connected = CON_GET_WANT_RIPANSI;
void nanny_get_want_ripansi( DESCRIPTOR_DATA * d, const char *argument );  // prototype
   // skip to next phase
   nanny_get_want_ripansi(d, argument );  
}

void nanny_get_want_ripansi( DESCRIPTOR_DATA * d, const char *argument )
{
   CHAR_DATA *ch;
   char log_buf[MAX_STRING_LENGTH];

   ch = d->character;

   switch ('N')   // or whatever  
   {
      case 'r':
      case 'R':
         xSET_BIT( ch->act, PLR_RIP );
         xSET_BIT( ch->act, PLR_ANSI );
         break;
      case 'a':
      case 'A':
         xSET_BIT( ch->act, PLR_ANSI );
         break;
      case 'n':
      case 'N':
         break;
      default:
         write_to_buffer( d, "Invalid selection.\r\nRIP, ANSI or NONE? ", 0 );
         return;
   }
#4
Ty.

I get : switch ('N') // or whatever

Still trying to get my head around.

void nanny_get_want_ripansi( DESCRIPTOR_DATA * d, const char *argument ); // prototype
// skip to next phase
nanny_get_want_ripansi(d, argument )

But i think I can see what it does.
Australia Forum Administrator #5
Logging in uses, in effect, a state machine. That is, it doesn't just ask a question and wait for a reply, because all the other players would have to wait too.

So for every question it asks, it sets a "state" in the player descriptor (eg. CON_GET_WANT_RIPANSI) and the next time the player sends a line, it knows that the line is a response to that particular question.

So we skip that state, and assume it has already been answered, hence calling the function that deals with the answer.
#6
I compiled SW:FotE and found it has text colour on auto. How do I turn it off to just have plain text

(no RIP or ANSI)
USA Global Moderator #7
Didn't you already ask that same question and get an answer?
#8
No this is a diff one.
a diff codebase for smaug star wars.


The other question was sorted and worked.
USA Global Moderator #9
Quote:
No this is a diff one.
a diff codebase for smaug star wars.

The other question was sorted and worked.

It looks to me like the same question just on a slightly different variant of Smaug.

Anyway, a quick scan of the same file that Nick pointed out earlier for SW:FoTE shows code that says:

/*  Changing this up a bit...automatically sets PLR_ANSI, skips want ansi/msp.

	write_to_buffer( d, "\n\rWould you like ANSI or no graphic/color support, (R/A/N)? ", 0 ); */
	SET_BIT(ch->act,PLR_ANSI);


Comment out that SET_BIT line.
Amended on Mon 29 Dec 2014 11:13 PM by Fiendish
#10
The code earlier was for smaugfuss 1.9.2.....


There is no code any where in SW:FoTE with

Quote:
write_to_buffer( d, "\n\rWould you like ANSI or no graphic/color support, (R/A/N)? ", 0 ); */
SET_BIT(ch->act,PLR_ANSI);


If it had I would know what to do.

BUT...

There are quite a few "SET_BIT(ch->act,PLR_ANSI)"

I will Comment out all the SET_BIT lines and see what happens.
USA Global Moderator #11
Quote:
The code earlier was for smaugfuss 1.9.2.....

And the problem is the same, and the code is derivative, so the answer will be derivative. "Find where the flag is set and don't set it."

Quote:
There is no code any where in SW:FoTE with...

You didn't post any links to code, so I went and found one. Mine does have that.
Amended on Mon 29 Dec 2014 11:55 PM by Fiendish
Australia Forum Administrator #12
Ardentcrest said:

I compiled SW:FotE and found it has text colour on auto. How do I turn it off to just have plain text

(no RIP or ANSI)


Providing a link helps a lot. There are many versions of this code.
#13
Sorry for the late reply.

http://www.smaugmuds.org/files/SWFotE-14-FUSS-309/

PS.

A happy New Year to all.
USA Global Moderator #14
Quote:
There are quite a few "SET_BIT(ch->act,PLR_ANSI)"

I will Comment out all the SET_BIT lines and see what happens.

I checked the link you provided and your method should work fine.
#15
TY