Tintin++ setup, designed for RP

Started by VladimirPoutine, May 03, 2016, 12:47:27 PM

Hello there,

I'm a newcomer and somewhat a newbie on muds. I played a few non-RP/slightlyRP muds, but played a lot of RP Ultima Online shards. Since UO lost most of good quality RP shards and since most of the time RP is not as hardcore as I enjoy it, I ended here somehow.

I am a Unix/Linux user and so I am interested in using Tintin++ (or maybe mudlet if Tintin++ proves too challenging, but I always prefer terminal applications). I'm able to program in several languages (for science) but still the very basic (and not very pedagogical) documentation of Tintin++ coupled to my complete ignorance of the behind the scene of my client/server interaction makes me very confused when I try to build my dream interface for the mud.

If someone could help me, here is pretty much my situation:
My mother tongue is not English (it's French) and I'm getting slowly into the mud. I decided I would play a almost completely RP oriented character. From my brief appearances, I found out that I'm easily overwhelmed with most of the information.

Since I speak French and in the mud universe I come across words from outer-of-space, I use a tiling windows manager with the mud opened, a dictionary and wikipedia to which I can refer to very effectively (everything directly with keyboard). The thing is, since I get a bit distracted from the mud window to check out things here and there I get completely lost in the fact that 'someone arrived', 'someone says this', 'someone tell ME something', 'someone give you something', ... I scroll back and take a lot of time to filter out information.

So to me, it would be of a great help if I could sort the information and split it in contextual windows.

OK so I'm command line literate, so I'm able to use tail and my tiling windows manager (or tmux) to get me going with displaying logs of specific entries. My problem is in the logging of different entries and #gaging them out of the main window. Since this is an RP mud, I can't really go into the people and try stuff out until it works, because I would probably just look unresponsive most of the time (mistakenly #gagging every tell, says for example). I tried out just logging everything from one session and study the structure of the data, but still it looks like I can't figure out how to split the information and format it the way I want to.

My objective is to get a mud environment that would look something like that:

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                                   | Possibly an    |
|                                   |   ASCII map    |
|   Pretty much everything that     |                |
|       is not filtered (events)    |                |
|                                   |                |
|___________________________________|_________________
|                                   | Who's there    |
| COMMUNICATIONS                    |-The tattooed,  |
|   Tells one color, say another,...|one-eyed woman  |
|___________________________________|is standing here|
|                                   |-The very tall  |
| Output of the look command        | dwarf sits at  |
|___________________________________| the bar        |
|  Prompt                           |  ....          |
|___________________________________|                |
|>Command                           |                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


I'm alright for the window splitting and tailing part.
The only thing I can't figure out is to properly log those informations to the right files and format them the way I want.

I know this problem is a bit specific to my situation and my tastes, but I'm guess that a lot of people would enjoy such a setup with Tintin++.

Thank you very much for your support.

Colour and/or highlighting says and tells helps a lot.  Here's another thread on tintin++!

http://gdb.armageddon.org/index.php/topic,50400.0.html

tintin++ is awesome and with unix pipes, you can do pretty much exactly what you want!

I'm not a master at tintin++ by any stretch, but there's a few of us that use it.
as IF you didn't just have them unconscious, naked, and helpless in the street 4 minutes ago

I use tintin++ but I am rather simple. I do a lot of color substitutions to do stuff like pictorial representations of the time in my prompt, something I absolutely love for my immersions. I highlight any text in parenthesis or square brackets which is a super easy thing. I am happy to share stuff on an individual basis because people are all after specific things and may not want everything I prefer to have. I do not do automatic scripting of anything.

What you are after above looks interesting but is way out of my league. Good luck!
Useful tips: Commands |  |Storytelling:  1  2

May 05, 2016, 04:00:08 AM #3 Last Edit: May 05, 2016, 06:16:36 AM by azuriolinist
Took longer than I thought it would (particularly anything concerning rooms), but I wrote something up that should work. The files, assuming you start up TinTin++ while in your home dir, are placed in your home directory.

Conversation was fairly simple to work with. The regex may or may not miss something, though, because I haven't tested it out fully, but it works for most whispers, tells, says, shouts and your thinks. It does not log things to conversation.txt that your PC did not hear (e.g., At the bar, the tall, dark-haired man says something.).

For room descriptions and (N)PCs, it ended up pretty hack-y because I couldn't figure out a way to distinguish the room description from the rest of the output with scripting. The script for the room desc. assumes that the desc. loads up after a small amount of time. It takes all the output starting when you enter "look" and ending when a second or two has passed. So if the game outputs anything else between that time, it goes into the look.txt file, and if the description takes any longer to be sent to the client than that set amount of time, it isn't completely logged.

As for the (N)PCs, the script relies on their long-desc being made up of one line, and including one of the keywords in the creature/char-descs variables. I probably missed a few. If objects (like statues, etc.) contain one of the keywords, they'll be logged into the chars.txt file, as well.

If you have a map loaded, the script logs the output (which is assumed to be the room description) that comes after entering a room, and redraws map.txt.


#nop {Escape quotation marks with a back-slash for echoes}
#function {echoEscape} {
 #var {str} {%0};
 #replace {str} {"} {\"};
 #return {$str};
}

#event {MAP ENTER ROOM} {
 #nop {Clear chars.txt so (N)PCs don't add up.};
 #system {> chars.txt};
 #nop {Start logging output 0.5s after moving. Assumes it takes the desc 2.5s to appear fully.};
 #delay {0.5} {#var {room-desc} {true}};
 #delay {2.5} {#var {room-desc} {false}};
 
 #nop {Redraw the map.};
 #map map {80x15} {map.txt} {a};
}

#nop {Log conversation-related things to conversation.txt}

#act {^%s"%+"$} {
 #system {echo "@echoEscape{%0}" >> conversation.txt};
 #line gag;
}

#nop {Log shouts in dark red.}
#act {%+ shout{s?} %+:$} {
 #line substitute colors {
   #system {echo "<daa>@echoEscape{%0}<099>" >> conversation.txt};
 };
 #line gag;
}

#nop {Log tells in azure.}
#act {%+ {(ask|exclaim|say)s?} to %+:$} {
 #line substitute colors {
   #system {echo "<acf>@echoEscape{%0}<099>" >> conversation.txt};
 };
 #line gag;
}

#nop {Log says in orange.}
#act {%+ {(ask|exclaim|say)s?}%+:$} {
 #line substitute colors {
   #system {echo "<fca>@echoEscape{%0}<099>" >> conversation.txt};
 };
 #line gag;
}

#nop {Log OOCs in lime.}
#act {%+, out of character:} {
 #line substitute colors {
   #system {echo "<cfa>@echoEscape{%0}<099>" >> conversation.txt};
 };
 #line gag;
}

#nop {Log whispers in a gray background.}
#act {%* {(whisper|mumble)s?} to %+:$} {
 #line substitute colors {
   #system {echo "<788><g10>@echoEscape{%0}<099>" >> conversation.txt};
 };
 #line gag;
}

#nop {Log thinks in light gray.}
#act {%*{Y|y}ou think:} {
 #line substitute colors {
   #system {echo "<g19>@echoEscape{%0}<099>" >> conversation.txt};
 };
 #line gag;
}

#alias {^l{(ook)?}$} {
 #nop {Start logging to look.txt};
 #var {room-desc} {true};
 #send {look};
 #nop {Assumes it takes 2s for the desc. to be sent to the client.};
 #delay {2} {#var {room-desc} {false}};
 #nop {Clear the chars.txt file so that the list of (N)PCs doesn't add up.};
 #system {> chars.txt};
}

#event {RECEIVED LINE} {
 #if {"${room-desc}" == "true"} {
   #nop {Log long-descs of (N)PCs to chars.txt, as well as what they may be carrying.};
   #if {"%0" == "{The|A}%*{\b(${char-descs}|${creature-descs})\b}%+" || "%0" == "- %+."} {
     #system {echo "@echoEscape{%0}" >> chars.txt};
   };
   #nop {Highlight room titles in bold.};
   #elseif {"%0" == "%+ [{(, |[NESWUD]|Quit|Save)+}]"} {
     #line substitute colors {#system {echo "<188>@echoEscape{%0}<099>" >> look.txt}};
   };
   #nop {Log lines of room description. Skips over your prompt (assuming it begins with digits separated by a slash)};
   #elseif {"%0" != "%d/%d%+"} {
     #system {echo "@echoEscape{%0}" >> look.txt};
   };
   #line gag;
 }
}

#var {char-descs} {armorer|banker|barkeep|beggar|blond|blonde|bouncer|boy|breed|brunette|child|dwarf|elf|elven|elvish|escort|female|figure|giant|girl|guard|half-elf|half-elven|half-giant|herbalist|human|kid|laborer|lad|lass|male|man|mercenary|merchant|mul|prostitute|servant|shopkeeper|slave|soldier|storyteller|tailor|tattooist|teen|teenager|templar|trader|tradesman|urchin|waif|weaponsmith|woman|youth}

#var {creature-descs} {anakore|ant|auroch|bahamet|bat|beetle|braxat|buzzard|carru|chalton|cilops|cockroach|dujat|duskhorn|erdlu|gaj|giths?|goudra|gurth|gwoshi|hawk|horror|inix|insect|irrig|jakhal|jozhal|kagor|kiyet|kryl|kylori|lizard|magera|mekillot|ox|quirri|rantarri|raptor|rat|reptile|ritikki|scorpion|scrab|silt flyer|skeet|snake|spider|stilt|strange shadow|tandu|tarantula|tembo|tregil|turaal|vestric|vulture|wezer|worm}


Here's an example bash script to start up a tmux session with the windows split. The watch command is used for the chars.txt file because it will constantly be overwritten, and that's not particularly pretty on tail. >.> Downside is that you can't scroll the output on the watch command.


#!/bin/bash
tmux new-session -d -s TinTin++ "tt++ splitWindows.tin"
tmux split-window -h -p 40 "tail -Fs .1 map.txt"
tmux split-window -v -p 70 "watch -n .1 cat chars.txt"
tmux select-pane -t 0
tmux split-window -vb -p 60 "tail -Fs .1 look.txt"
tmux split-window -vb -p 50 "tail -Fs .1 conversation.txt"
tmux select-pane -t 0


Doesn't -completely- fit the environment you'd wanted above, and it still needs more testing and stuff.

edit:
The template is something like this:

+----------------------+--------------+
|                      |              |
|   Communication      |   Map        |
|   (says, tells, etc. |              |
|                      |              |
+-------------------------------------+
|                      |              |
| Output of look or    |              |
| the current location |  (N)PCs from |
|                      |  location    |
|                      |  output      |
+----------------------+              |
|                      |              |
|  Main window         |              |
|                      |              |
|                      |              |
+----------------------+              |
| Command bar          |              |
+----------------------+--------------+

I'm very impressed with your answer, I wasn't expecting something that complete, you are a Tintin++ superstar.

Thank you very much for the time you put in there, I will most certainly put that to the test.