TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Newlines in #map file

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
rigrig



Joined: 03 Feb 2011
Posts: 10

PostPosted: Fri Sep 09, 2016 2:31 pm    Post subject: Newlines in #map file Reply with quote

Using TinTin++ 2.01.0 on Linux:

Map files break when descriptions/data contains newlines:
Code:
#map create
#MAP CREATE ROOM     1 {}.
#MAP: 50000 room map created, use #map goto 1, to proceed
#map goto 1
#MAP GOTO: MOVED TO ROOM 1 {}.
#map set roomdesc {test\n123}
#MAP SET: roomdesc set to: test
123
#map write test.map
#MAP: Map file written to {test.map}.
#map read test.map
#MAP: INVALID COMMAND {49} {123} {} {} {} {} {1.000}} ON LINE 16. ABORTING READ..

test.map:
Code:
C 50000

CE <078>
CH <118>
CP <138>
CR <178>

F 8

I 1

L * # #  # |   #        x


R {    1} {0} {} {} { } {test
123} {} {} {} {} {1.000}

Quite a few rooms on my MUD have newlines in their description, so trying to save room descriptions as-is results in an unloadable map file.
I'm now manually replacing them with a bunch of spaces, but I expect this will give me troube/extra work when I get to matching rooms by their description.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Sep 11, 2016 6:12 pm    Post subject: Reply with quote

I'll change #map set to leave \n and other escapes as they are.

Right now you can save the desc to a variable, then use #replace {var} {\n} {\\n}, next use #map set.

Next release that will be #replace {var} {\n} {\n}

Alternatively you can replace new lines with spaces this way. That's probably the easiest solution, and use #replace before performing a map search.

tintin is unfortunately not very consistent in handling escapes. I can kind of streamline it now because of the #line substitute escapes option, which allows you to force the substitution of escape codes.
Back to top
View user's profile Send private message Send e-mail
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Mon Sep 12, 2016 6:22 pm    Post subject: Reply with quote

I remember having fun in the past with multi-line descriptions - I think I had to double the leading '\' in '\n' as well - but IIRC it made the #map info for a room not display the same for that field as an #ECHO of a variable populated from the map (or was it the direct display of that same variable from the #VAR command) - I'm so rusty on TinTin++ I can't be certain; though it does sound like the same issue with escapes. I even recall that I had to code my room description indexing system to parse line feeds in the description as two separate characters '\' and 'n'. Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group