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,068
    Blog Entries
    7
    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,068
    Blog Entries
    7
    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...

    https://www.dropbox.com/s/aw7f6tk9zx...pells.ext?dl=0

  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,068
    Blog Entries
    7
    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!!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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

Log in

Log in