Sample Image
  • Home
  • News and Events
  • the project
  • about 'nu'
  • Sign In
Edit - Delete
Show Media ItemShow Media Item - Utility Script: Add links to inter-player messages

Utility Script: Add links to inter-player messages

« Back to Developers

2672 days, 23 hours, 25 minutes ago
View big beefer's profile
big beefer
Utility Script: Add links to inter-player messagesWrite Reply
Here is an add-on to help teammates and allies coordinate actions more easily. It scans your diplomatic messages and replaces certain strings in the message with clickable links to objects (ships, planets, bases) in the game.

The strings that are searched for are:

s#XXX
p#XXX
b#XXX

where the first letter is for ship, planet, or base (can be uppercase or lowercase), and XXX is the id of the object you want to reference.

So for example, if I want to tell my ally to move ship 143 to planet 45, I could send a message something like:

"Move s#143 to p#45."

And if they have this add-on installed, the message would appear as:

Move S#143: MEAN GORBIE to P#45: Planet X.

And if they click on either of the highlighted parts it will open the map and take them directly to the ship or planet.

This is obviously only really useful if both sides of the communication are using it, but if you want to test it out, it will work on outgoing messages too so you can try it easily enough.

Note: these links are added client side so the RECEIVER must have the add-on installed to see them. No changes are made to the actual messages sent. ie. Even if you have the add-on installed and send the above message to someone who does not, they will simply see the original message:
"Move s#143 to p#45." which should be understandable enough still.

http://userscripts.org/scripts/show/131091
2672 days, 14 hours, 56 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Add links to inter-player messagesWrite Reply
Yeah! I never thought about this, but I'm already missing it.
Great things you come up with!
2671 days, 23 hours, 57 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Add links to inter-player messagesWrite Reply
Thanks, glad you enjoy it! I just posted a new version that shows a hover for ships when they are moused over.
2663 days, 3 hours, 30 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Add links to inter-player messagesWrite Reply
It would be great if we could produce those links for notes as well. But I just can't figure out how that could work, because the only way you can actually click the notes text is in the notes editbox ...
2662 days, 9 hours, 44 minutes ago
Profile Image
cb1
RE: Utility Script: Add links to inter-player messagesWrite Reply
Can you make other messages clickable?

Planet xxx is losing colonists due to climate.
Meteor strike (race to rescue, or send a freighter).
Combat.
Mine field.
Clear to colonize.

Most messages that discuss an object require that action be taken on the object.

It would probably be a big job, given how many message types there are, but it would be a big help.

2658 days, 22 hours, 53 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Add links to inter-player messagesWrite Reply
Anything for you Helmet! I've posted a new version (0.3) that shows notes at the bottom of the ship/planet screen and adds links as requested. I think I won't show the links in the edit box, so players can see and edit the raw text that will actually be sent through the message system.

I'll look into adding links in the ship/planet lists as well, and also at adding them for non-player messages
2658 days, 3 hours, 7 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Add links to inter-player messagesWrite Reply
Yeehaaw. Great!
2656 days, 3 hours, 49 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Add links to inter-player messagesWrite Reply
OK, new version posted (0.5) adds links to system generated messages as well. Takes a little longer to load them from the additional parsing, which is not terribly efficient. The script has no concept of message context (would have been much more effort) and simply looks for strings of "ship_name ID#XXX" and "planet_name ID#XXX" and adds a link if that object is known to the player. It may have strange results in odd circumstances like a ship and planet having both the same id and name, but those cases seem unlikely enough.

Also, I'm finding the link colors (currently the browser default I think) to be somewhat difficult to read on some of the backgrounds we've had, so may hard code it to something else if anyone has any input on what would be a good color.
2656 days, 2 hours, 51 minutes ago
Profile Image
cb1
RE: Utility Script: Add links to inter-player messagesWrite Reply
Works beautifully! You're right about the colour. Maybe leave it the same colour as the surrounding text, but underline it, or make it bold or larger.
2261 days, 7 hours, 25 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Add links to inter-player messagesWrite Reply
 A slight update (version 0.7), changes the link color to cyan so they look like links in the new client.

Note that links in the new version don't seem to work perfectly for things you don't own (link takes you to the right spot on the map but doesn't open the info screen for it), I might see if I can fix that later, but for now it's functional enough for the most common uses.