[Tech Demo] Parsing Text

Hey guys,

So I am not completely in love with the way command/warp signs are done currently… So I thought I would create another demo.

Plugin Details
Destinations - Forum Topic
Source Code

Comments
Please tell me what you think, give me suggestions, and keep on learning!

Updates

  1. Added titles to parsed text: (title)[w:warp] or [c:command](title)
10 Likes

Looking fantastic! I would personally add function linking to be like so [c:weather day](Make it day!).

Why? Useful to know what text should represent the function. This way it is use agnostic, could simply be hover text, command, command suggestion, it could be a link etc and you wouldn’t have to code it to say weather or time (which are awfully vague).

2 Likes

Yeah I plan on working out a good way to do that… just haven’t came up with it yet.

@wingz done. Check the update section in original post!

1 Like

Hold on, reporting a problem with Discourse to the staff room.

I can only like this topic once. ;_;

7 Likes

Shut up and take my money!

4 Likes

Is it me or are most of the plugins on Sponge a bit Better than Bukkit Plugins. Bukkit plugins never had this sweet pagination, or these SWEET sign things.

3 Likes

it seems the bukkit devs just got used to certain things and stuck with them…

It’s nice to see fresh ideas and nice things enhancing the usability of plugins :slight_smile:

3 Likes

Actually quit a few Bukkit plugins had pagination: WorldGuard, CommandBook, MyWarp, MyHome, Essentials, Warptastic - just to name a few. I think the real game-changer for Sponge is the access to the new message format that Mojang implemented with 1.7. In Bukkit there was no native way to use it.

What @mmonkey shows is that this function has a lot of potential. Hopefully some plugins coming from Bukkit will pick up some of his ideas and take them further. I know I will.

2 Likes

Oh yeah, I meant the fancy click pagination library thing.

This is similar to the chat parsing idea I proposed. People should be able to mention warps by name with a prefix and have it linkable in chat as well, very similar to what you have shown in the video.

Edit: And I should have watched the whole video before commenting, very well done.

The only change I would make, is attempting to recognize /command in chat as a command, and provide tool tips instead of c:weather clear But it could be awkward to try to detect when the end of the command is.

1 Like

Yeah I think determining the end of a command, would be particularly difficult. That’s why I chose to wrap it with [c: ].

The real problem is that signs have limited characters per line. Maybe if you could edit a sign you are looking at like:

/sign setline 3 [c:/give @p minecraft:carrot](CARROTZPLS!)

would make so that if you click on the sign on the third line the command would be executed. This should also add support for multiple commands per sign (max. 4, of course.)

Also, being able to add entity selector parameters should be a feature, since

[c:/kill @a[type!=Player]](Kill all)

would be broken completely. I suggest adding an escape character/sequence, or some kind of checks.

2 Likes

@Lambder These are great suggestions! My final version of Destinations wont actually allow for command signs, it is just going to support warps and other location based things.

Currently, when you click a sign, there is no way to tell what text was clicked or which line was clicked. So the only one command will fire. I am sure there will be some fancy way to present a list to the player and allow them to choose a specific command if there is multiple on a sign.

I love the /sign setline idea! In fact, I think we can take it one step further:

  1. Place a sign and edit the text like so:

    Hey you…
    Click me!
    {{command}}
    Some more text

  2. Then when we parse the text of the sign, and come across this: {{command}} it will ask for user input:

    [Destinations] Please input a command for the sign:

  3. The you would enter a command:

    [c:/gamemode creative](Go Build!)

  4. The sign then gets the text above as desired.

So essentially you can set placeholders, then the plugin would prompt you for each placeholder on the sign / book whatever. And essentially the plugin doesn’t care what you name the placeholder, it just has to have {{ }} or something.

Other thoughts
I would really like to build a plugin to specifically handle text parsing, instead of building it straight into Destinations. To me this will make more sense. I think we should compile our ideas together, and I (and whoever else wants to) can start writing that plugin.

Just need to come up with a catchy name… @FerusGrim I dunno why, but this seems like a job for you ;).

You could have a “complex” sign that when clicked would output text to the clicking entity’s chat window with clickables and hover text. Useful for multi-commands and more information, or commands that require a confirmation.

Yeah that seems like the obvious solution. It will absolutely do the job, but eventually to have some awesome UI to handle this, in my mind, would be ideal.

Then of course, if you format the text neatly, then it would be awesome… Time to brush up on our ASCII artwork skills!

Hahah yeah! I’m just dying to have Mojang implement multi-windows for chat. Text boxes with tabs determined server-side, whilst positioning determined client-side.

@FerusGrim explodes under pressure.

2 Likes

You might even be able to troll people with the messages, like "Hey guys! I found a [w:stronghold](Stronghold!)", but really it warps you to a lava pool.

What if the warp text was colored to the blocks it was near? Or even just change the colors to where the warps are in a range of areas on the y-axis? You could also simply just add the coordinates to the hover text, just to allow players to judge if it’s safe or not. There are so many different things you can do with this plugin.

With other commands, you could even just display the description of the command to the player to the hover text.

This plugin makes SMP look fun ^-^

I totally didn’t just create an account just to post on this thread or anything ._.

3 Likes

Yeah someone could totally do that, and I am ok with it. :smile:

If I really wanted to get crazy, I could make a “preview” option to any warp. If you use the preview option you will be sent there in spectator mode (but are limited to looking around and not moving) then you can either accept the warp (changes mode back) or you can cancel the warp (changes mode, and goes back to previous location).

^ but that’s just crazy talk * shifty eyes *

5 Likes

Even crazier talk:
Use this to create an automatic Server (sightseeing) tour. The player clicks in a sign and is then send to different locations for a certain amount of time.

1 Like