5E Character Create Playlist
Page 1 of 2 12 Last
  1. #1

    Dice string with "macros" exist already?

    So I'm beginning to hack at a part of the 5e ruleset that has been something I've been asked about a lot and that is dice strings with "macros", specifically things like damage for spells based on level of caster. So instead of having to adjust the spells damage when you level it will automatically do it for something like fireball with "LVLd6" damage string.

    Has any other ruleset or extension done this sorta thing before? I'm curious how it was handled and the UI portion. Wanting to see what worked and what didn't.

    Right now I'm looking at having a toggle for Dice or Text "mode" for the spell. I "store" the "ArcaneLevel" or "DivineLevel" as the character levels up so depending on the type I'll replace the "LVL" or "Level" with the level for that type of spell.

    Sorta like this.



    And the "Text" version looks like this.



    Eventually I plan to do the same thing for duration.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Have a look at spell actions for 3.5E/PF - there are some adjustments based of CL (Caster Level).
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096

    Dice input

    If part of your question involves the input mechanism for dice:
    I am doing that in the Generators extension. I could not figure out a way through the interface to get a mixture of dice in the drag, so I have a text field where you can enter a dice expression (e.g. 2d2+3d4+5, for a ridiculous example). To do this, I overrode the onClick on the existing dice field (which was just a drop zone for dice) so it invoked my own string field to enter the dice. This is the template necessary for the dice entry:

    Code:
    	<template name="dice_input_string">
    		<stringcontrol>
    			<anchored to="dice" position="over"  />
    			<script>
    				local aSaveDice;
    				function onGainFocus()
    					if aSaveDice then
    						return;
    					end
    					local nodeWindow=window.getDatabaseNode();
    					aSaveDice=DB.getValue(nodeWindow,"dice",{});
    					if #aSaveDice~=0 then
    						local sDice=StringManager.convertDiceToString(aSaveDice);
    						setValue(sDice);
    					end
    					TableManager.setRollGuard(true);
    					DB.setValue(nodeWindow,"dice","dice",{});
    					TableManager.setRollGuard(true);
    				end
    				function onLoseFocus()
    					if StringManager.trim(getValue())=="" then
    						TableManager.setRollGuard(true);
    						DB.setValue(nodeWindow,"dice",aSaveDice);
    						TableManager.setRollGuard(false);
    						destroy();
    					elseif textOK() then
    						local aDice, nMod = StringManager.convertStringToDice(getValue());
    						local nodeWindow=window.getDatabaseNode();
    						TableManager.setRollGuard(true);
    						DB.setValue(nodeWindow,"dice","dice",aDice);
    						TableManager.setRollGuard(false);
    						DB.setValue(nodeWindow,"mod","number",nMod);
    						destroy();
    					else
    						setFocus();
    					end
    				end
    				function textOK()
    					if StringManager.isDiceMathString(getValue()) then
    						return true;
    					else
    						TableManager.notifyError("error_gen_bad_dice");
    						return false;
    					end
    				end
    			</script>
    		</stringcontrol>
    	</template>
    Here is the modification to the existing dice drop zone: (note that I use join=merge in the parent window so that my modified "dice" inherits everything except the below stuff from the CoreRPG ruleset)

    Code:
    			<basicdice name="dice">
    				<script>
    					function onClickDown(button,x,y)
    						return true;
    					end
    					function onClickRelease(button,x,y)
    						window.createControl("dice_input_string","user_dice_input");
    						window.user_dice_input.setFocus();
    						return true;
    					end
    				</script>
    			</basicdice>
    So, when the user clicks and releases, the code adds a new control that is the dice input string. Once that control loses focus, it updates the database field and destroys itself. The original dice control picks up the database update through its own handler and updates the dice content of that control. Note that the calls to TableManager are my own code. One of them is a semaphore to prevent infinite looping associated with update events (SetRollGuard), and the other handles displaying an error message. You would need to put your own stuff in there for mine.

  4. #4
    Quote Originally Posted by Trenloe View Post
    Have a look at spell actions for 3.5E/PF - there are some adjustments based of CL (Caster Level).
    That is exactly what I was looking for. Much more mechanical input with less dependence on "formatting" knowledge to make it work. Even deals with "max" size. I like it a lot.

    Quote Originally Posted by Bidmaron View Post
    If part of your question involves the input mechanism for dice:
    I am doing that in the Generators extension. I could not figure out a way through the interface to get a mixture of dice in the drag, so I have a text field where you can enter a dice expression (e.g. 2d2+3d4+5, for a ridiculous example). To do this, I overrode the onClick on the existing dice field (which was just a drop zone for dice) so it invoked my own string field to enter the dice.

    So, when the user clicks and releases, the code adds a new control that is the dice input string. Once that control loses focus, it updates the database field and destroys itself. The original dice control picks up the database update through its own handler and updates the dice content of that control. Note that the calls to TableManager are my own code. One of them is a semaphore to prevent infinite looping associated with update events (SetRollGuard), and the other handles displaying an error message. You would need to put your own stuff in there for mine.
    Thanks Bidmaron. I'll review the code and see how I might be able to use it.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  5. #5
    This seems to somewhat match the PF/3.5 e version and meets the needs of AD&D.

    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  6. #6

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    As long as all you want is a set of dice of the form xdy, where x is number of dice and y is sides, that will work. The code I posted lets you do arbitrarily complex dice expressions (not really sure when you would need them though honestly for this.)

  7. #7
    Just out of interest - you guys do know that a lot of this has already been done (no, not all of it, but a hell of a lot) with the UDR (Universal Die Roller) in the new DORCore Ruleset - don't you?
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  8. #8

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Dulux, can you (meaning me) change the inheritance of PF or another nested ruleset to include DORCore? Sounds dangerous.

  9. #9
    Quote Originally Posted by Bidmaron View Post
    Dulux, can you (meaning me) change the inheritance of PF or another nested ruleset to include DORCore? Sounds dangerous.
    You could try it - with a new campaign, obviously - but I'm not sure what will break (if anything).

    You actually have two options:
    1. Change the DORCore to be a child of PF, or
    2. Change the 3.5E to be a child of DORCore - as the DORCore was designed to be at a "low-level" in the Ruleset-Stack this is what I'd be looking at, BUT it hasn't been tested (primarily because I'm not arrogant enough to believe that SW would change the Ruleset-Stack for their "official" Rulesets - I'm arrogant, yes, but not THAT arrogant )


    In either case, my expectation straight off the bat is that "something" will break - but yes, it can be done.

    As a side-note, my vision for the DORCore was for all of the Community Ruleset Devs to consider it for their Ruleset-Stack for new (or newly-ported) Rulesets. All of my Community Rulesets, for example, use the DORCore as the basis on which to build their own Rules. What I had not considered was people might want to "slip it into" the Ruleset-Stack of SW's "offical" Rulesets - however, if people want to try then the Ruleset-Stack should run CoreRPG=>DORCore=>"offical" Ruleset.
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  10. #10
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by dulux-oz View Post
    You could try it - with a new campaign, obviously - but I'm not sure what will break (if anything).

    You actually have two options:
    1. Change the DORCore to be a child of PF, or
    2. Change the 3.5E to be a child of DORCore - as the DORCore was designed to be at a "low-level" in the Ruleset-Stack this is what I'd be looking at, BUT it hasn't been tested (primarily because I'm not arrogant enough to believe that SW would change the Ruleset-Stack for their "official" Rulesets - I'm arrogant, yes, but not THAT arrogant )


    In either case, my expectation straight off the bat is that "something" will break - but yes, it can be done.

    As a side-note, my vision for the DORCore was for all of the Community Ruleset Devs to consider it for their Ruleset-Stack for new (or newly-ported) Rulesets. All of my Community Rulesets, for example, use the DORCore as the basis on which to build their own Rules. What I had not considered was people might want to "slip it into" the Ruleset-Stack of SW's "offical" Rulesets - however, if people want to try then the Ruleset-Stack should run CoreRPG=>DORCore=>"offical" Ruleset.
    DORCore breaks stuff even on a simple ruleset like MoreCore.
    The Universal Dice Roller you have coded Dulux_Oz is awesome but it isnt really what this is looking to do.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in