Welcome to the Builder Academy

Question Tab spaces and wrapping in dg_script output

More
02 May 2017 01:00 #6677 by krell
Hi,

Is there a recommended way of putting in tab spaces or line wrapping in dg_script generated output such as echoes or sends? I'm attempting to perform a dynamic room description, which is actually working and is set off by the conditional statements as expected. The only problem is that each new string sent is capitalized and any white space, including tabs, get discarded.

So my room description is there, it just looks a bit odd and, of course, doesn't quite flow. Breaks the whole immersion factor. XD

Thanks in advance.

Krell

Please Log in or Create an account to join the conversation.

More
02 May 2017 21:43 #6679 by Parnassus
I'd like to see line wrapping but I don't think there's anything that can do that because it's based on line width. What I do is base my lines on a certain length so I can arrange a nice looking line in most cases although it will often look short.

For the beginning of the lines, I use a colour code. That's why my dynamic lines are sometimes an odd colour. Usually I set them to the colour I see but not all clients show the same colour. Since the colour code is the first character, it's invisible but escapes the capitalization and space removal. You may find though that your lines need to be a bit short because the line length still counts all the characters in the code.

Don't forget to normalize the colour code at the ends of the lines for safety although that cuts available characters even more. And don't forget to enable the colour code. I think its /t.

An oddity to this is that the codes won't show up when you look at the trigger although sometimes you can tell that they're there because the trigger code shows in odd colours.

Please Log in or Create an account to join the conversation.

More
03 May 2017 02:12 #6681 by krell
Hi Paranassus,

Yeah, I had somewhat figured out that using the @'s to generate spaces shortly after I made my post though I haven't found something I like enough to use just yet. Of course, I just got back from an odd job that I do occasionally after work so I haven't had enough time yet to play around with the idea. I'll keep your pointers in mind though as they sound like really good advice. =)

That's too bad about the line wrapping. I'll have to alter my code a bit then to accommodate for that. I was trying to use the @'s to simulate a line wrap but I haven't stumbled across any "undocumented features" that would allow for that. XD.

Thanks,
Krell

Please Log in or Create an account to join the conversation.

More
03 May 2017 22:51 #6693 by Parnassus
I've always figured that it was too hard to do the wrapping because I've seen many muds that say they wrap to fit the client (they ask how many characters your width is) but I don't think I've ever seen one that actually does anything when I input numbers. For example, if I tell them that my width is 50 characters, the lines should be shorter than if I said 80 characters but I've never seen a difference. However, I generally use old clients and odd methods so it might be that it usually does but I can't see it happening. In fact, this is why some of my colour codes are odd, because my old clients don't actually work with all the colours.

If you find anything, please let me know :)

Please Log in or Create an account to join the conversation.

More
03 May 2017 23:19 #6695 by krell
Yeah, I don't think I'll be able to properly simulate line wrapping. The best I can seem to reasonably hope for is to fake it, again using @ based characters and toggling them.

Please Log in or Create an account to join the conversation.

More
04 May 2017 02:32 #6697 by WhiskyTest
Krell how much 'dynamicness' are you adding in?
I'm trying to imagine other ways to implement this and two ideas came to mind...

I had a PvP game with Orks and SpaceMarines. I added three new fields to all objects: ork_name, ork_long_desc, ork_short_desc
The builders would create an object and fill out extra descriptions for them, one for the SpaceMarines point of view and another for the Orks.

So a Marine would see "a crude bolt pistol lies discarded here."
But an Ork would see "a nice shiny shoota has been dropped here"

For rooms you could have a 'night_description' that displays at night time only.
Add other conditions here...
Might be a bit restrictive for your builders as hard coding in different conditions would take time..

My second idea was similar to the above but copying the way extra descs are added to the room.
Builders can pick from a set of predefined conditions and add a description to it..

Please Log in or Create an account to join the conversation.

Time to create page: 0.212 seconds