Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Bing, DotBot

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Buffer Length
Forum Rules | Mark all | Recent Posts

Buffer Length
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 25, 2008, 1:44 pm
Go to the top of the page
Go to the bottom of the page

Krylan
Fledgling
GroupMembers
Posts39
JoinedApr 14, 2005

Alright, next question. I've never been able to figure this out for the life of me, but one of the main requests from builders was the ability to create really long lines in the buffer. They're interested in it just being one line until they press enter, so they can have really long programs.

Basically:

Instead of this:

like if you typed a long sentence like this and tried to post it in one line for a prog 
1) like if you typed a long sentence like this and
2) tried to post it in one line for a prog
3) it automatically breaks it up like this which screws your progs up

I want this:
like if you typed a long sentence like this and tried to post it in one line for a prog 
1) like if you typed a long sentence like this and tried to post it in one line for a prog 

       
Post is unread #2 Mar 25, 2008, 3:05 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

I believe Cronel's editor snippet allows > 80 length lines.
       
Post is unread #3 Mar 25, 2008, 3:06 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

Take a look at build.c function edit_buffer
probably something like this
   if( edit->size + strlen( argument ) + 1 >= MAX_STRING_LENGTH - 1 )
      send_to_char( "You buffer is full.\r\n", ch );
   else
   {
      int b_end;
      int bm = 75;
      int bp = 0;
      int ep = 0;

      strcpy( buf, argument );

      b_end = strlen( buf );

      while( bp < b_end )
      {
         while( buf[bm] != ' ' && bm > bp )
            bm--;

         if( bm == bp )
            bm += 75;

         if( bm > b_end )
            bm = b_end;

         ep = 0;
         while( bp < bm )
         {
            edit->line[edit->on_line][ep] = buf[bp];
            bp++;
            ep++;
         }

         bm = bp + 75;
         bp++;

         edit->line[edit->on_line][ep] = '\0';
         edit->on_line++;

         if( edit->on_line > edit->numlines )
            edit->numlines++;
         if( edit->numlines > max_buf_lines )
         {
            edit->numlines = max_buf_lines;
            send_to_char( "Buffer full.\r\n", ch );
            save = TRUE;
            break;
         }
      }
   }

This is the part that wraps the text around that you put in.
Keep in mind that you are kind of limited by this in mud.h
struct editor_data
{
   short numlines;
   short on_line;
   short size;
   char line[49][81];
};

The line part is where the data is put so you have a size limit there. If you increase the size line can be etc... you need to find all the things that like to mess with the editor_data and make sure they are set to work right with the new size also.
       
Post is unread #4 Mar 25, 2008, 3:50 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

If you want to raise the size of the individual line buffers, then you need to alter the editor_data struct in mud.h, as Remcon has pointed out already. Specifically, the line[49][81] part. That controls two things:
1. The number of lines (49) and,
2. The number of characters per line (81).

Also keep in mind, C starts counting with 0, and you can't use the last number in the list, so you're really talking about lines 0 thru 47, and characters 0 thru 80. Either way raising this and making sure the build.c code matches what you've changed will give you the extra line length you want. But I'm not sure it's going to be all that useful to allow people to create programs with 500 lines, each 1024 characters long since that would seriously bloat the area files.
       
Pages:<< prev 1 next >>