Link items to chat
Ellypse opened this issue ยท 2 comments
In Total RP 2 (and GHI :P) we could link an item to chat. A special string would be inserted and people who would receive the message with that string would see it as a special link. Clicking on it would request the tooltip information for that item.
This feature is still missing in Total RP 3: Extended and has already been requested a couple of times. It would be really great to add it to the add-on.
Total RP 2 was using ~ as a delimiter for links (~my item~
). I think it would be more obvious to people without the add-on if the string was something like [TRP3E:my item]
instead. Note that I'm not sure we can use the item name, since they are not unique, and we might have to use the id instead. That might not look as pretty for non-users.
Now that I think of it, instead of placing the entire item ID, a solution would be to create numerical IDs everytime we create an item link. Store the link to the numerical ID and resolve it.
So when we link item My coin of creation ID fsfk54JLB35 it creates a numerical ID 1, we send [TRP3:1:My coin]. When people will request the tooltip data for us we can look at the numerical IDs table and trace it back to fsfk54JLB35 and send them the data. It will look nicer to people without the add-on and would also use less characters than the full creation ID.
Update on this:
We're using Total RP 3's core chat links module. The stuff that needs to support chat links in Extended are:
- Creations in the database
- Items
- Campaigns
- Documents
- Items in the inventory
- In containers
- In character sheet
- In inspector frame
- Campaigns in the quest log
Some notes:
- Currently, the implementation on the branch feature/chat_links is incorrect and should be reworked to account for sub-creations being of different types that the parent creations (campaign containing an item)
- The tooltip info should always come from the clicked item and be decorated as such.
- The data transferred should always be the root creation.
- The action upon importing the item should correspond to type of the clicked item
- I might have to build a layer on top of the chat links system to have this cross-type behavior working and dispatch the right actions.