DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    DCC Question: How to add a new spell?

    To be more precise, I know already how to add a new spell in the DCC spell book.
    I would like to know how to add the table of different spell effects, and get on the chat the spell effect according to the caster's roll.
    Already existing spells show the effects in a table, but simply adding a table in the new spell or even copy/paste an existing table is not working

    It feels like some black magic is needed, something needs to be parsed? some xml tag?

    Sorry if the topic has discussed somewhere else, I haven't been able to find it.

  2. #2
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Currently these results are referenced from a data file in the ruleset, not read from the text table in the spell record - that's just a visual reference for the judge/player. I can create an extension for you. You will need to open the 'scripts/data_spell_custom.lua' file and add the casting table results, but it will work.

    In theory, spell and class records can be coded so that this information can be pulled for chat messages or auto-populating the character sheet, but it would be a big project for me. Classes would be especially complicated. Maybe I will get to it at some point, but for now, perhaps the extension can provide what you need.

  3. #3
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Here is a template for a custom spells extension - download the file to your 'extensions' data folder. To enter a custom spell, open the 'scripts/data_spell_custom.lua' file, and enter the casting table results for your spells. The "example spell" shows you the format in which to code these. If you have any trouble, let me know...

    EDIT: The custom spells extension is obsolete. The current ruleset version allows users to enter the results table directly into the spell record. Disable the extension to avoid script errors.
    Last edited by leozelig; March 13th, 2021 at 14:19.

  4. #4
    oh! WOW! thanks a lot Leozelig, this is great!
    I really appreciate this!
    I understand the logic of the script but I failed at make it work properly
    I followed your instructions and got something like this

    castingtable = {
    ["Flamebrand"] = {
    { roll = 12, result = "Hello world" },
    { roll = 14, result = "not bad roll" },
    { roll = 18, result = "closer to crit but..." },
    { roll = 20, result = "Rock & Roll" },

    I have created a new Spell called Flamebrand, added to a pc sheet, but when casting there is no message on the chat. Either cast alone or to a target

    I tried to read the code in manager_action_power.lua but my coding is not that good to get all the stuff in there.

    I made a several test by removing " from different places and repeating the test to see where i get a lua error
    I would say the file is loaded properly when launching FG, and the table is also read properly (a lua error triggers after rolling when I remove " from a specific result)
    maybe sSpellResult gets lost somewhere before printing in the chat? as said my coding skills fall too short :-(

  5. #5
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Ah, simple fix I think. The spell names should be lower case. Otherwise, it looks good.

    Just change ["Flamebrand"] to ["flamebrand"]...

  6. #6
    Brilliant!!!! works perfectly!!!
    Thanks a lot Leozelig!!

  7. #7

  8. #8
    Quote Originally Posted by leozelig View Post
    ... To enter a custom spell, open the 'scripts/data_spell_custom.lua' file, ...
    I'm having trouble finding the location of this in Unity version. Would anyone be able to provide me a hint?

    Update:
    I have figured it out. I did not realize that the .lua file was in the extension itself (I'm new to this)
    If anyone else comes along, here is what you do.
    Make a copy of the Custom Spell extension.
    Rename the .ext to .zip
    Unzip it, then find the 'scripts/data_spell_custom.lua' file and open with notepad++
    Last edited by RaSepReTep; December 6th, 2020 at 06:30.

  9. #9
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Quote Originally Posted by RaSepReTep View Post
    I'm having trouble finding the location of this in Unity version. Would anyone be able to provide me a hint?

    Update:
    I have figured it out. I did not realize that the .lua file was in the extension itself (I'm new to this)
    If anyone else comes along, here is what you do.
    Make a copy of the Custom Spell extension.
    Rename the .ext to .zip
    Unzip it, then find the 'scripts/data_spell_custom.lua' file and open with notepad++
    Hi RaSepReTep... Thanks for your question.

    The current version of the DCC ruleset can parse the casting table results from the spell description. Follow the format used for the spells from the core rules when making the casting table. Some useful shortcuts for tables are CTRL-6 (create table), CTRL-TAB (create column), and CTRL-PLUS (increase column width). The custom spells extension should still work if you prefer to do it that way.

    Let us know if you have any problems!

  10. #10
    is the DCC ruleset available for Unity already?

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
  •  
FG Spreadshirt Swag

Log in

Log in