Splitting the exit output

guzmere
19 Nov 2012, 19:00
Hi folks hope you are all ok and well. Hopefully just an easy question (sez he) is there any way to split the exit output into two lines on the screen.
Eg:- Exits are north, east, west, south
.............N E, NW, SE, SW. instead of
Exits are north, east, south, west, NE, NW, SE, SW
The reason I'm asking is that I think one line would be far too long, and it wouldn't look right.
I know that there is a command (FormatExitList(player.parent.exitslistprefix, ScopeExits(), Template("Or"), ".")) but how could I utilise that to split up the exits. Hope this makes sense. Thanks in anticipation Terry :D :D :D :D
P. S. I only need it to be done on one location.
P. P. S. Or if anyone has any other ideas then I'm all ears.

Pertex
20 Nov 2012, 10:24
Yes, you can do this by editing the function FormatExitList:

  <function name="FormatExitList" type="string" parameters="preList, list, preFinal, postList">
<![CDATA[
result = ""
listLength = ListCount(list)

if (listLength > 0) {
half=0
if (listLength > 5) {
half=listLength / 2
}
count = 0
result = preList + " "
foreach (item, list) {
result = result + GetDisplayNameLink(item, "exit", item.displayverbs)
count = count + 1
if (count = listLength - 1) {
result = result + " " + preFinal + " "
}
else if (count < listLength) {
result = result + ", "
}
if (count=half) {
result = result +"<br />"
}
}
result = result + postList
}
return (result)
]]>
</function>


If there are more than 5 exits, it creates a break. This works for every location, of course

guzmere
20 Nov 2012, 12:02
Hi Pertex hope you are well and all is ok, many many thanks for that reply it works a treat. I've even managed to insert your whitespaces function that you did for me some time ago. And now it moves the second line out from the side a little bit to make it look aesthetically pleasing ( well to my eye anyway ) lol. Once again you've worked your magic, so millions of thanks. Terry :D :D :D :D and one for luck :D :D :D :D :D :D