[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Editor indentation problem
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Editor indentation problem

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


Posted by Karianna   (7 posts)  [Biography] bio
Date Wed 16 Apr 2003 06:59 PM (UTC)

Amended on Wed 16 Apr 2003 10:38 PM (UTC) by Nick Gammon

Message
I notice that the online editor has an indentation problem with the first line.


I typed redit desc
I then typed three spaces to indent, so it would look like this:
   The room blah blah blah blah blah blah blah
blah blah blah blah blah blah.

I then typed /s.
I then typed savearea.


When I typed look, the formatting was there, but after reboot the three spaces are taken out of the first line, so it starts flush left.

Does anyone know how to fix this problem so I can format more freely on the first line?

Thanks,
Kari
[Go to top] top

Posted by Karianna   (7 posts)  [Biography] bio
Date Reply #1 on Wed 16 Apr 2003 07:02 PM (UTC)
Message
Well my example was supposed to show the indents, heh. Anyway you all get the point. Help would be appreciated, thanks.
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #2 on Wed 16 Apr 2003 09:38 PM (UTC)

Amended on Wed 16 Apr 2003 09:39 PM (UTC) by Boborak

Message
The reason that happens is due to the way that SMAUG reads strings from a file. It allows for a variable amount of 'space' at the begining of a string. So, when a string is read from a file..

DESCR      Blah Blah Blah~

is the same as

DESCR              Blah Blah Blah~

The only real 'fix' for this, is to have your coder add a check for a . (or other non-alphanumeric char) at the begining of your room descriptions and parse them out on display. Then add a . to the begining of any description you want to start with spaces. So now we get..

DESCR      .           Blah Blah Blah~

The mud will read from the period on. Then, when the text is displayed the period is dropped (or hidden if you prefer to look at it that way).
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 16 Apr 2003 10:39 PM (UTC)
Message
Quote:

Well my example was supposed to show the indents, heh.


You need to use the [code] blah blah [/code] "forum codes" in your post, and check "forum codes" check box. I have edited your post to do that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #4 on Wed 16 Apr 2003 11:29 PM (UTC)
Message
I'll make it easy for you ;-)

Replace (located in do_look() in act_info.c):

if ( arg1[0] == '\0'  || ( !IS_NPC(ch) && !IS_SET(ch->act, PLR_BRIEF)) )
            send_to_char( ch->in_room->description, ch );

With:

if ( arg1[0] == '\0'  || ( !IS_NPC(ch) && !IS_SET(ch->act, PLR_BRIEF)) )
{            
    if ( ch->in_room->description[0] == '.' )
                send_to_char( ch->in_room->description+1, ch );
        else
                send_to_char( ch->in_room->description, ch );
}


Of course.. this is considering you A) have the source and B) know how to recompile ;-)

Disclaimer: I never actually tested that.. I just kinda figure it'll work ;-P
[Go to top] 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.


3,349 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]