PDA

View Full Version : MK Linker



mattekure
May 7th, 2020, 01:15
Now Available on the Fantasy Grounds Forge: https://forge.fantasygrounds.com/shop/items/61/view

This extension adds a simple method of creating clickable links to URL's or Files.

In order for the link to be triggered, it must be entered in the correct format.

Links to URLs are in the standard format such as https://www.youtube.com/watch?v=hU6OlMAgGQg

On Windows (I dont know Macs), links to files should be formatted like this: file:///C:\Users\John\Downloads\fief.pdf
Start the link with file:/// and followed by the path to the file to open.

Instructions:
To create a link, open the linker window.
https://i.imgur.com/xhcOVwQ.png

Enter the link title and URL on the lines and click the "Create Link" button.
https://i.imgur.com/crVJur3.png

The clickable link will be created in the chat window and can be dragged onto story entries, or any other formatted field.
https://i.imgur.com/wtZSxuO.png

TheVirtualDM
May 8th, 2020, 00:48
This is fantastic. I have been looking for a replacement for the DOE: OLE Extension as I am concerned it will break at some point since it is no longer supported. Thank you so much for taking the time to put this little extension together. This will work perfectly as a fast and simple way to add external links inside of stories, maps, ETC that easily access webpages and documents outside of the Fantasy Ground environment. I use this as a "lazy DM" way of reusing content from my online world builder and document library. Cheers and thanks again.

mattekure
May 8th, 2020, 00:50
Glad you find it useful. It turned out to be quite a bit simpler than I originally thought :D

mattekure
May 24th, 2020, 00:27
Updated to work with the Better Menu extension

Kelrugem
May 24th, 2020, 00:30
Oh, I just see it now :)

Out of curiosity: FG already allows links, you copy&paste it into the chat and it will create a link (for drag&drop into story entries etc.). What is the difference to your extension? :) (except the way how one creates the link pin)

Kelrugem
May 24th, 2020, 00:32
ah, nevermind, I see now that is not just about websites :D

mattekure
May 24th, 2020, 00:37
Oh, I just see it now :)

Out of curiosity: FG already allows links, you copy&paste it into the chat and it will create a link (for drag&drop into story entries etc.). What is the difference to your extension? :) (except the way how one creates the link pin)

Hmm, I was originally under the impression that the FG link generation only conveted links from things with http or https. but further testing shows you can create a link with anything containing the pattern ://. So this extension may not be needed at all. file://C:/Users/John/Downloads/fief.pdf pasted into the chat works just fine for me to create a link.

Kelrugem
May 24th, 2020, 00:51
Hmm, I was originally under the impression that the FG link generation only conveted links from things with http or https. but further testing shows you can create a link with anything containing the pattern ://. So this extension may not be needed at all. file://C:/Users/John/Downloads/fief.pdf pasted into the chat works just fine for me to create a link.

Exactly, but your extension certainly speeds up the process of interchanging \ with / :) (and one sadly has the former when using file links)

mattekure
May 24th, 2020, 00:53
LOL. It actually doesnt fix the links for you, you have to format them correctly I'll leave it here, but I'm not sure its really needed. every link I've tried creating in the chat using file:// or anything else seems to work fine.

Kelrugem
May 24th, 2020, 00:56
LOL. It actually doesnt fix the links for you, you have to format them correctly I'll leave it here, but I'm not sure its really needed. every link I've tried creating in the chat using file:// or anything else seems to work fine.

well, I just tried, it fixed the slashes for me :D not sure whether you intended that :D (but I manually added file:// in front, but I kept the other slashes as I copied them from my Windows UI :) )

mattekure
May 24th, 2020, 00:58
Its not a bug, its a feature;)

mattekure
May 24th, 2020, 00:59
It must be FG fixing the slashes, because the code just looks like this.


function mkCreateLink()
local msg = {
text="(LINK)",
shortcuts={
{ description="testShortcut", class="url", recordname=DB.getValue("MKLinker.linkText") }
}
}

Comm.addChatMessage(msg);
end

Kelrugem
May 24th, 2020, 01:07
Its not a bug, its a feature;)

;)


It must be FG fixing the slashes, because the code just looks like this.


function mkCreateLink()
local msg = {
text="(LINK)",
shortcuts={
{ description="testShortcut", class="url", recordname=DB.getValue("MKLinker.linkText") }
}
}

Comm.addChatMessage(msg);
end

Hm, interesting; while your extension fixes the slashes for me, the copy&paste into the chat doesn't correctly parse it. Moreover, I can even create a correct link with your extension without the file:// in front :D Thence, the chat copy&paste seemingly follows a slightly different code somewhere :) Never really looked at the chat codes though

mattekure
May 24th, 2020, 01:22
that is very interesting. I'll need to look into that and see what I can find.

vaughnlannister
August 21st, 2020, 10:52
Hey Mattekure, if it links to files on my computer, then my players, won't see it when they click the link correct? Because they don't have the file on their PCs, it will get triggered from my end though?So this would be only for DMs that use FGs in an around the table session?

mattekure
August 21st, 2020, 12:34
Hey Mattekure, if it links to files on my computer, then my players, won't see it when they click the link correct? Because they don't have the file on their PCs, it will get triggered from my end though?So this would be only for DMs that use FGs in an around the table session?

Correct, it doesnt share any files. If you link to a file on your PC, the link will only work for you.

vaughnlannister
August 21st, 2020, 13:07
Ok thanks Mattekure!

Ludd_G
August 21st, 2020, 17:59
Hi,

I'm using Unity (which I'm guessing is likely the issue! :) ), Ruleset 5e, Windows 10, and I can't seem to get this to work (either using MK-Linker or just typing into chat and letting FG create the link) I end up with (LINK) in chat bit no draggable button. Any suggestions?

Also, should I be able to use this to trigger local audio files to play in their media player (just as though I'd double clicked on them in windows File Explorer)? I'd love to be able to populate maps with local audio triggers to use alongside 'Syrinscape Sounds'

Cheers,

Simon

mattekure
August 21st, 2020, 18:07
I just tested on Unity and it seems to work fine for me. Both file links and URLs are created just fine. Try creating a clean campaign with no other extensions enabled and see if it works there. Its possible another extension is affecting it.

Ludd_G
August 21st, 2020, 19:02
Hi,

yeah, it was conflicting with another extension, now the fun part to find out which one!

One thing that I'm having a problem with is that before pasting the file path, I seem to need to first type any character, then paste the address straight after it, then back arrow through the address till i get to the original random character and then delete it, before the link made actually triggers the file. If I don't do that for some weird reason it seems to open the FG root folder? I've noticed that, after the very first link I create on opening FGU, the cursor seems to be left aligned but the text is centre aligned, if that makes sense and is any help?

Anyhoo, with this work around I've managed to get it working consistently (fingers crossed!), now for the extension conflict hunt!

Cheers,

Simon

Ludd_G
August 21st, 2020, 20:31
Ok, I've found the source of the problem I was having.

I was copying the file address from the top of the Security tab, on the audio files Properties display (is there another place where I can copy the full address, including the actual file name, is from, 'cause I can't find one?) and when I pasted it into MK-Linker it was adding a seemingly hidden character right at the start of the address. Once I delete this the link creation works fine.

Cheers,

Simon

Ludd_G
August 22nd, 2020, 21:02
Hi John,

I've discovered that it was the On Demand Manual Dice that was causing the link button to not show for some reason.

I know it's probably not worth the bother but do you think there may be a really really easy and quick tweak you could do to make them compatible? No worries if not.

Cheers, Simon

mattekure
August 23rd, 2020, 04:41
I've taken a look and I dont see anything obvious. it will take more testing to see whats going on.

Ludd_G
August 23rd, 2020, 11:24
Thanks for having a look, it's much appreciated.

mattekure
August 23rd, 2020, 21:00
I took a look, and its actually not an incompatibility with my extension at all. The same error occurs with just that ondemand extension loaded. There is some kind of bug in that extension that is breaking the link generation. I have reported it on that extensions thread for that author to take a look.

Ludd_G
August 23rd, 2020, 21:12
Thank you, I'll check the other thread and keep my fingers crossed.

mattekure
August 24th, 2020, 17:05
The author of the other extension posted an update that should fix it.

Ludd_G
August 24th, 2020, 17:24
Just checked it and all is working now! Thanks for your help!

Egheal
September 12th, 2021, 20:22
Thanks for this extension. Is there a way to send the created link to my players in the chat ? (could be usefull when i want to share a web page directly in FGU and not on Discord).

abragg
November 23rd, 2021, 21:53
I might be dumb, but when i click to get the ext. it says its owned. But where does it go? I have a custom install location, so its not in my extensions folder, any ideas?

mattekure
November 23rd, 2021, 22:07
I might be dumb, but when i click to get the ext. it says its owned. But where does it go? I have a custom install location, so its not in my extensions folder, any ideas?

The forge link was set to Vault, so it was in the vault folder. You have to manually switch it and it appears I forgot. I have switched it to data, so after you update it should appear in your extensions folder.

abragg
November 23rd, 2021, 22:22
Great quick reply, it worked, thanks!

_JackDoor_
May 4th, 2022, 20:23
Hi There, I think I used this extension when it first came out, but now it won't work using forge.
I'm trying to create links to sound files on my PC, but the file will not connect using Linker. Is this only for a certain set of files?

mattekure
May 4th, 2022, 20:47
Hi There, I think I used this extension when it first came out, but now it won't work using forge.
I'm trying to create links to sound files on my PC, but the file will not connect using Linker. Is this only for a certain set of files?
FG changed how it handles links a few updates back and links to local files no longer works. So this extension can no longer create those links. They will simply not open.

micael
December 16th, 2023, 15:52
FG changed how it handles links a few updates back and links to local files no longer works. So this extension can no longer create those links. They will simply not open.

Hi,
After the last updates, the linker button is no longer existent- can you please update:


[12/16/2023 4:47:07 PM] [ERROR] Script execution error: [string "Linker:LinkerManager.lua"]:12: attempt to call field 'registerSidebarStackButton' (a nil value)

Thanks
Micael

mattekure
December 16th, 2023, 18:16
Hi,
After the last updates, the linker button is no longer existent- can you please update:


[12/16/2023 4:47:07 PM] [ERROR] Script execution error: [string "Linker:LinkerManager.lua"]:12: attempt to call field 'registerSidebarStackButton' (a nil value)

Thanks
Micael

Wow, this one was really out of date and in need of an overhaul. I have uploaded a new version, should be good to go now.

v1.4 I updated the image used for the link and a total overhaul of the window code to more fully support theming. should look nicer in all themes now (hopefully)