Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [testing] a better way for making floor plans in wiki?  (Read 981 times)

sphr

  • Bay Watcher
    • View Profile
[testing] a better way for making floor plans in wiki?
« on: January 11, 2008, 01:53:00 pm »

I hate to do this, adding a testing post in a regular forum, but there is no preview button, and the other forum uses a different color scheme that will not do.

For those of you who did not heed the subject and ignore this testing post, this is a pasting test of a wiki-generated floorplan.  The color looks negated when I paste it in the edit box.  I only hope that it will appear right after I saved the post...

code:

█████ █████
█¡.░█ █¡.░█
█░[░█ █░[░█
█.o.█ █.o.█
██┼█████┼██
█....>....█
██┼█████┼██
█¡.░█ █¡.░█
█░[░█ █░[░█
█.o.█ █.o.█
█████ █████


╔═══┼╦┼═══╗
║≡===║===≡║
║====║====║
┼===┼╩┼===┼
╠═══╣<╠═══╣
┼===┼╦┼===┼
║====║====║
║≡===║===≡║
╚═══┼╩┼═══╝


key
.    space
█    wall
┼    door
=    stockpile
≡    zone
<    stairs up
>    stairs down
X    stairs up/down

║ ╠ ╣ ╚ ╩ ╝
╔ ╦ ╗ ═ ╬ O
   smoothed walls
¡.░
░[░
.o.
   Mason's Workshop


EDIT: Might as well turn this into a potentially useful thread.  I've been trying to find a way to create and store small floorplans easily in the wiki.  It sort of differs from the existing RawTile or RT? templates in the following ways:

- It uses and stores "plans" as semantic tiles.  One specifies stuff like "wall" and "door" and "space" instead of trying to find or copy and paste the tiles that represents them.

- It features both the wiki table mode and non-table mode with only minor differences in the template name (easy to automate by external scripts or apps or even just lexical search and replace)

-It uses a variant of 2d-array meta-template I hacked together with great help from VengefulDonut.  So I can do things like store the 3x3 workshop tile in a "2d-array data page" and then recall the individual tiles by coordinates in the actual plan.

-there's also support for default mouse-over text.  You just mouse over and the html title popup will show you what tile it is like "door" or "rough wall".

-there's also partial support for customizable description too, so you can set customized description when mouseover the tile (ideally, all tiles should support, but I haven't got around to fixing all the templatelets one by one)

-and since the reference is semantic, if somebody updates how the original tiles look or change the font, all the dependent floor plans will get "updated" automagically.

-Currently, it does have one drawback : because I'm using my own user subpages as templates, the template names are a little long, but if it seems useful to the rest of wiki users, we can move them into the default template namespace to shorten the code somewhat:

below is a sample non-table version wiki template that is supposed to generate 2 rows for a plan like the ones shown above. should be easier to read the meanings too.

code:

{{t/rwall}}
{{t/rwall}}
{{t/rwall}}
{{t/rwall}}
{{t/door}}
{{t/rwall}}
{{t/door}}
{{t/rwall}}
{{t/rwall}}
{{t/rwall}}
{{t/rwall}}


{{t/rwall}}
{{t/stockpile}}
{{t/stockpile|desc=Stone Stockpile with description!}}
{{t/stockpile}}
{{t/stockpile}}
{{t/rwall}}
{{t/stockpile}}
{{t/stockpile}}
{{t/stockpile}}
{{t/stockpile}}
{{t/rwall}}


If I find time next, I wanted to see if it can be made even shorter using repetition/for-loop kind of template meta-programming, to do things like

code:

//defining tiles using a list
{{t/a|5|rwall/stockpile|zone|zone|door}}

// generates
█=≡≡┼

//defining tiles using repetition
{{t/r|5|rwall}}

//generates
█████


The next step (if I ever get that far) is to try to make use of the 2d array framework to try to store and recall entire plans semantically.  (Currently, the 2d array are just used to store the representational tiles for things like 3x3 workshop)  Ideally, there should be an easier way to include a "subplan" in a bigger plan, but I think that's asking too much of the wiki (esp when our wiki seems to lacks some of the more programming-friendly parser functions)

So here's to all the wiki users/template gurus: how to improve things or make things even easier?

Before I forget... these is the link

test page

BTW: I finally get the "preview button".  Seems like it is created by javascript and noscript was blocking it.  I didn't expect the forum to depend functionally on javscript before so I never looked into that.

EDIT: trimmed to example code coz the forum does not wrap code.

[ January 12, 2008: Message edited by: sphr ]

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: [testing] a better way for making floor plans in wiki?
« Reply #1 on: January 11, 2008, 04:48:00 pm »

You aren't getting the preview button?  We have one now...  it was sort of hacked in though, so I'm not sure if you need some kind of javaish thing enabled to get it.  It should be just to the left of the Add Reply button once it's working.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Railick Stonemane

  • Bay Watcher
    • View Profile
    • Stonemane Library
Re: [testing] a better way for making floor plans in wiki?
« Reply #2 on: January 11, 2008, 04:50:00 pm »

He is saying he isn't getting the preview buttun on a diffrent forum, not this one. Though I don't know why he didn't use the preview button here instead of posting ;P
Logged
"And call a dog a cow-that don't change the way the thing'll taste!" Bruenor Battlehammer

http://railickstonemane.wordpress.com/
http://stonemane.hostei.com/

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: [testing] a better way for making floor plans in wiki?
« Reply #3 on: January 11, 2008, 11:14:00 pm »

Ah, I thought the OP meant the Dwarf forums versus something like our Various Nonsense section.
Logged
The Toad, a Natural Resource:  Preserve yours today!

sphr

  • Bay Watcher
    • View Profile
Re: [testing] a better way for making floor plans in wiki?
« Reply #4 on: January 11, 2008, 11:47:00 pm »

hmm I don't get the preview button at all.  I think I better go check the browser settings.  could be some script getting blocked or some other stuff getting stuck or whatever...

The other forums actually refers to the anything go forum for bay12.  Originally wanted to test there, but the color scheme is drastically different.

Never thought about it, but is there a way to change text color using ubb code?

[ January 11, 2008: Message edited by: sphr ]

Javis

  • Bay Watcher
    • View Profile
Re: [testing] a better way for making floor plans in wiki?
« Reply #5 on: January 12, 2008, 05:23:00 am »

The [color] tag changes the color of the text, but it looks like it's not enabled on this board.
Logged