Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Colour

Colour

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Ardentcrest   (47 posts)  Bio
Date Sat 29 Nov 2014 11:02 PM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 29 Nov 2014 11:46 PM (UTC)
Message
Change the code to not ask that question.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ardentcrest   (47 posts)  Bio
Date Reply #2 on Sun 30 Nov 2014 12:21 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 30 Nov 2014 03:19 AM (UTC)
Message
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;
   }

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ardentcrest   (47 posts)  Bio
Date Reply #4 on Sun 30 Nov 2014 11:10 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Sun 30 Nov 2014 08:18 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ardentcrest   (47 posts)  Bio
Date Reply #6 on Mon 29 Dec 2014 04:19 PM (UTC)
Message
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)
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #7 on Mon 29 Dec 2014 07:13 PM (UTC)
Message
Didn't you already ask that same question and get an answer?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Ardentcrest   (47 posts)  Bio
Date Reply #8 on Mon 29 Dec 2014 08:34 PM (UTC)
Message
No this is a diff one.
a diff codebase for smaug star wars.


The other question was sorted and worked.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #9 on Mon 29 Dec 2014 11:07 PM (UTC)

Amended on Mon 29 Dec 2014 11:13 PM (UTC) by Fiendish

Message
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.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Ardentcrest   (47 posts)  Bio
Date Reply #10 on Mon 29 Dec 2014 11:15 PM (UTC)
Message
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.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #11 on Mon 29 Dec 2014 11:53 PM (UTC)

Amended on Mon 29 Dec 2014 11:55 PM (UTC) by Fiendish

Message
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.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #12 on Tue 30 Dec 2014 01:21 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ardentcrest   (47 posts)  Bio
Date Reply #13 on Thu 01 Jan 2015 10:40 PM (UTC)
Message
Sorry for the late reply.

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

PS.

A happy New Year to all.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #14 on Fri 02 Jan 2015 01:31 AM (UTC)
Message
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.

https://github.com/fiendish/aardwolfclientpackage
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


43,090 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.