Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, dbnu

Members: 1
Guests: 2
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Should I even bother?
Forum Rules | Mark all | Recent Posts

Should I even bother?
< Newer Topic :: Older Topic > If so, HOW?

Pages:<< prev 1 next >>
Post is unread #1 Feb 17, 2010, 8:07 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Okay, I got single room description tags and description auto-tags working great but I just can't seem to get a linked tag system in place. Haven't even tried working on nested ones yet..

What I mean by linked tags is a setup where the current syntax for the tags, #tagname[Text], can be extended to #tag1:#tag2[:#tag3..][Text]. These would work like an if check like so, if( #tag1 == true && #tag2 == true ).

So like the title asks, should I even really bother? What about nested tag support? If anyone thinks I should get one or both of them in, how can I go about it? I've hit a wall on the linked tags. :(

And just so nobody has to ask what the auto-tags do, they work by putting tags using a #tagname#, note the second '#', into a room description which automatically get replaced with whatever they're linked to. Currently only day/month names because I really couldn't think of anything else and adding them in was just a spur of the moment thing heh.

So, I guess I'll give a quick example of them at work. Here's the room desc for the room I've been using to test the system with.

1> This is the office of the Immortal Andril.[NL] A large chair sits behind a massive
2> wooden desk. #rain[A rainy]#lightning[A stormy]#cloudy[An overcast]#clear[A
3> clear] #morning[morning] #anoon[afternoon] #evening[evening] #night[night]
4> sky is visible through a window set in the north wall while a number of old
5> fashioned oil lamps #day[sit unlit, waiting to be used]#night[fill the
6> office with a cheerful glow]#sunset[fight the darkness that comes with the
7> lowering sun].

And here's what it looks like based on the current game time and weather.

This is the office of the Immortal Andril.
A large chair sits behind a massive wooden desk. A stormy morning sky is
visible through a window set in the north wall while a number of old fashioned
oil lamps sit unlit, waiting to be used.

The sky is lit by flashes of lightning and a warm southerly breeze blows. -- weather command
It is 11 o'clock am, Day 19, Natunda, in the Month of Welona. -- time command


And yes, I'll freely admit it. The syntax is influenced by Remcons. If he wants, I'll be happy to change it, but it just makes sense to me this way...
       
Post is unread #2 Feb 18, 2010, 8:35 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Why shouldn't you bother? It seems quite reasonable to me. I might do something like: #{tag1, tag2, tag3}

And sure, nested tags are fine too. The easiest way to process them is to use your tag handler recursively on text inside a tag's text.
       
Post is unread #3 Feb 18, 2010, 5:54 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

Well in the end it all comes down to if you think it is worth it or not. I agree with David's thoughts on it.

Thats fine with me if it was influenced or used from the way I did it. No point in redoing it either way though and just so it is stated I have no problem with it being how it is. Good job btw.
       
Post is unread #4 Feb 18, 2010, 7:59 pm   Last edited Feb 18, 2010, 8:00 pm by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I went a slightly different path with mine:

Unparsed Description:
You are standing within the [#season winter: frigid] expanse of the famous 
Darkhaven Square.  A stone statue of something occupies the square's center, 
surrounded by [#season summer: gardens of flowers in full bloom which enhance 
the air of serenity and peace][#season spring: gardens of budding flowers 
which fill the air with lovely fragrances][#season fall: gardens of wilting 
flowers as winter fast approaches][#season winter: an army of snowmen the
children of the city have built] here in the center of the city. The main
roads lead away in the cardinal directions, while to the northeast and 
northwest are forested paths[#season spring: .][#season summer: .]
[#season fall:  of many colored falling leaves.] [#season winter:  which are 
still lightly covered in snow.] The spires of a cathedral can be seen rising 
to the northwest.

Winter Parsed:
You are standing within the frigid expanse of the famous Darkhaven Square. 
A stone statue of something occupies the square's center, surrounded by 
an army of snowmen the children of the city have built here in the center 
of the city. The main roads lead away in the cardinal directions, while to 
the northeast and northwest are forested paths which are still lightly 
covered in snow. The spires of a cathedral can be seen rising to the 
northwest.

Autumn Parsed:
You are standing within the expanse of the famous Darkhaven 
Square. A stone statue of something occupies the square's 
center, surrounded by gardens of wilting flowers as winter fast 
approaches here in the center of the city. The main roads lead 
away in the cardinal directions, while to the northeast and 
northwest are forested paths of many colored falling leaves. 
The spires of a cathedral can be seen rising to the northwest. 

Spring Parsed:
You are standing within the expanse of the famous Darkhaven Square.  
A stone statue of something occupies the square's center, surrounded by 
gardens of budding flowers which fill the air with lovely fragrances here in 
the center of the city. The main roads lead away in the cardinal directions,
while to the northeast and northwest are forested paths. The spires of a 
cathedral can be seen rising to the northwest.

Summer Parsed:
You are standing within the expanse of the famous Darkhaven Square.  A 
stone statue of something occupies the square's center, surrounded by 
gardens of flowers in full bloom which enhance the air of serenity and 
peace here in the center of the city. The main roads lead away in the 
cardinal directions, while to the northeast and northwest are forested paths. 
The spires of a cathedral can be seen rising to the northwest.


But anyway. They parse recursively, so tags inside tags will evaluate correctly, and what not. THey support standard evaluations (==, <, <=, >, >=, !=) and can test for just about anything.
       
Post is unread #5 Feb 19, 2010, 3:24 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

Yea, mine is done about the same.
Keyword   'PARSE GOLD'~
Updated   1252024752
UpdatedBy Remcon~
Text      This is a check you can put in room descriptions to
check the gold of the looker.
 
Examples:
[#gold > 300: Your gold is above 300.]
[#gold < 300: Your gold is less then 300.]
[#gold = 300: Your gold is 300.]
[#gold ! 300: Your gold is not 300.]

That is just one of the possible checks, but should give you an idea on how its done and it can also handle more then one in it like
[#gold > 300: Your gold is above 300.[#gold < 500: Your gold is less then 500]]

If you had more then 300 gold you see the first one if you also have less then 500 you see the second.
If you have 300 or less you won't see either.
       
Post is unread #6 Feb 19, 2010, 10:33 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

I keep meaning to show how this can be done quite neatly in Lua... you could have almost arbitrary checks, really.
       
Post is unread #7 Feb 19, 2010, 6:41 pm   Last edited Feb 19, 2010, 7:30 pm by Andril
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Wow, thanks for making me feel stupid Kayle! :) Seriously though, that looks pretty nice.

Think I'm gonna go test something really quick because I might have nested tag support in already and not realize it.

Edit:
Sweet! Nested tags do work with no further modification needed. Now to see about getting multiples working.

Edit 2:
*sigh* They work, sorta. *shrug* Don't feel like trying to deal with it right now.
       
Pages:<< prev 1 next >>