PDA

View Full Version : CoreRPG ( and 5e ) - Add new linkable record type



st4lk3r87
May 28th, 2019, 00:20
Hi!

Is there any step by step tutorial that can teach me how to add a new type of "link" to a story? I'd like to open a custom window when a link is clicked in a "Story". Can anyone point me to the right direction?

LordEntrails
May 28th, 2019, 01:15
No step-by-step tutorial. The DOE: OLE extension might do something similar to what you want. BUt, I would think that by investing the different link types you can add to a story now would point you in the right direction. Not sure though, as I don't do extensions like those :)

damned
May 28th, 2019, 01:52
Try this video... https://www.youtube.com/watch?v=c9RyzgeiQOI
Its not exactly answering your question explicitly but I create a new data type called pcclass and this is draggable into a story as a link.

st4lk3r87
May 28th, 2019, 20:47
Try this video... https://www.youtube.com/watch?v=c9RyzgeiQOI
Its not exactly answering your question explicitly but I create a new data type called pcclass and this is draggable into a story as a link.

Found it. It's actually pretty simple! Thank you! I wonder if there's a way to trigger some script by pressing a link or am I forced to open a window?

celestian
May 28th, 2019, 21:28
Found it. It's actually pretty simple! Thank you! I wonder if there's a way to trigger some script by pressing a link or am I forced to open a window?

Add an "on click" to the control for the link.

Just keep in mind people click when drag/dropping (if you're allowing that).

st4lk3r87
May 28th, 2019, 21:36
Add an "on click" to the control for the link.

Just keep in mind people click when drag/dropping (if you're allowing that).

Mmmh but wouldn't it automatically open the window? What I want is to send a message in the chat ( a slash command ) when the user click a link in the story without opening a new window.

celestian
May 28th, 2019, 21:49
Mmmh but wouldn't it automatically open the window? What I want is to send a message in the chat ( a slash command ) when the user click a link in the story without opening a new window.

Yeap, it will open the window if you're using the link control type. Just add the display chat code in your "on click".

You could also display the chat text anytime the window is opened using an onInit for that window but it really depends on your use case.

st4lk3r87
May 28th, 2019, 21:51
Yeap, it will open the window if you're using the link control type. Just add the display chat code in your "on click".

You could also display the chat text anytime the window is opened using an onInit for that window but it really depends on your use case.

Ok, thank you! I wonder if I can close the window immediately so it will not prompt the user with one more "useless" ( in this case ) window.

celestian
May 28th, 2019, 22:00
Ok, thank you! I wonder if I can close the window immediately so it will not prompt the user with one more "useless" ( in this case ) window.

Can you explain the full list of functionality you are going for? Do you not actually WANT it to open the window of that record?

st4lk3r87
May 28th, 2019, 22:09
Click the link -> Call a lua function without opening a window record.

celestian
May 28th, 2019, 22:13
Click the link -> Call a lua function without opening a window record.

Override the link control on button click (return true I think does it) or just don't use the link control at all and use your on onbutton click control.

I've done the latter on my own for some custom features with npc ability features/notes in the NPC sheets/CT. I just used the shortcut icon and it looks the same. Mine adds tooltip and some other stuff. You could also make it so they click on the text instead? If you write your own you can do whichever you want.

Trenloe
May 28th, 2019, 22:17
@st4lk3r87 You mention in post #1 that you want to link to be in a story. Is that what you're actually looking to do? If so, you're very limited in the functionality you can attach to a link in a story record (formattedtextcontrol control) - basically, you have to open a specific <windowclass> and have code in there - you can make the window virtually unnoticeable and close it after the code is ran, but you still need to open that windowclass.

st4lk3r87
May 28th, 2019, 22:21
@st4lk3r87 You mention in post #1 that you want to link to be in a story. Is that what you're actually looking to do? If so, you're very limited in the functionality you can attach to a link in a story record (formattedtextcontrol control) - basically, you have to open a specific <windowclass> and have code in there - you can make the window virtually unnoticeable and close it after the code is ran, but you still need to open that windowclass.

Yes exactly. That's the workaround I have in mind for now.

This is the example. If you know how the RFI extension works I want to trigger some slash command when the user click the link.
https://i.imgur.com/W0Pj0Bj.jpg

Trenloe
May 28th, 2019, 22:48
This is the example. If you know how the RFI extension works I want to trigger some slash command when the user click the link.
I'm not that familiar with it.

I don't think you can call a slash command directly from code (i.e. output the slash command to chat and the slash handler trigger) - but you can call the code that the RFI extension runs - e.g. RFISlash.onSlashCommand(sCommand, sParams)

st4lk3r87
May 28th, 2019, 22:50
I'm not that familiar with it.

I don't think you can call a slash command directly from code (i.e. output the slash command to chat and the slash handler trigger) - but you can call the code that the RFI extension runs - e.g. RFISlash.onSlashCommand(sCommand, sParams)

Yes. That's the plan or, anyway, something similar.