PDA

View Full Version : Adding rolls to "formatted text"



Varsuuk
May 10th, 2021, 05:39
I am adding spells to MoreCore. In some I have textual and linked tables where you can roll.
But sometimes in addition to rolling on the table, I might want to just roll 2d6 to get number affected as per the table.

Or, in a Formatted Text entry, I might just want to embed /roll 1d20 or something for ease.

Do I need to go to Rolls sidebar create a "roll" then drag it over to embed it? Or is there another way inside the text? (I am not parsing these atm like for example 5E does)

I assume if possible it is not a "fast to type" answer, pointing me to a thread, entry in docs, or YouTube video is fine ;) as is giving me a search phrase for it.


--Thanks

Varsuuk
May 10th, 2021, 05:42
Another more complicated thing was in S&W "Contact other Plane" has a d20 roll for results that vary on the table depending if you ask 1, 2, 3, ... 6 questions with diff dice spread between Insanity/Right/Wrong results.

I didn't want to create 6 charts so I just did a "text table" in the spell description without a real table link.

-- I do not run games yet, so very little experience creating content vs lua coding (note I don't list xml, takes me hour to do simple UI change...)

damned
May 10th, 2021, 05:47
Rolls being the MoreCore Roll variety only work from Character sheets, Combat Tracker and NPC Sheets.
They must be associated with an entity. They will not work from Hot Keys or even from with the Roll Library itself.

superteddy57
May 10th, 2021, 05:53
I am adding spells to MoreCore. In some I have textual and linked tables where you can roll.
But sometimes in addition to rolling on the table, I might want to just roll 2d6 to get number affected as per the table.

Or, in a Formatted Text entry, I might just want to embed /roll 1d20 or something for ease.

Do I need to go to Rolls sidebar create a "roll" then drag it over to embed it? Or is there another way inside the text? (I am not parsing these atm like for example 5E does)

I assume if possible it is not a "fast to type" answer, pointing me to a thread, entry in docs, or YouTube video is fine ;) as is giving me a search phrase for it.


--Thanks

damned laid out how MoreCore handles the rolls, but I wanted to also relay that formattedtext controls can't setup the highlight and roll as you may see in some combat tracker and npc records in some rulesets. The reason is some of the APIs that make that work are unfortunately not available for formattedtext controls. So it would have to be a string control to assist in that behavior.

Varsuuk
May 10th, 2021, 07:14
Cool info from both of you, thank you again.

Superteddy, what would be involved in using these APIs? Simply adding a string control and then populating it with? Like is there a "CoreRPG"-based set of "phrases/keywords" used?
I don't need this stuff atm, just asking to learn me some stuff.

Nighters until the 'morrow.

superteddy57
May 10th, 2021, 07:20
I would check out the campaign/scripts/npc_roll.lua file for an example of what is involved in breaking down and parsing a string control and then setting the highlight and an action to that click on that text.

Varsuuk
May 10th, 2021, 15:28
At work now but saw this.

I loaded the file earlier this morning and saw "parseComponents" and how calls the to dice method then creates the table and handles hover/dbl click.

Then I searched to see what controls use it and see npc_roll is only connected to "skills" in record_npc which is great for self-contained and "simple example which looks like I can use in future.
But curiosity - I couldn't search for similar uses elsewhere due to morning meeting but is this one example chosen for simple-self-contained and there are other places where CoreRPG does the dice scanning as well? Or is it all in NPC (and other rulesets like 5E run with it more)?

I guess I can search and find out later - but asking anyhow ;)

damned
May 11th, 2021, 00:37
on the MoreCore Char sheet the Attacks section also does this sort of parsing.