Fantasy Grounds Fridays Pre
Page 3 of 3 First 123

Thread: NPC User Guide

  1. #21
    dradams,

    I always like to use a concrete example of something that should work. (i.e. a creature from a core bestiary with the example text)

    In this case, I found the "Demon, Vrock" in the 3.5E Bestiary module (OGL data) that has the special quality field text of
    "Damage reduction 10/good, darkvision 60 ft., immunity to electricity and poison, resistance to acid 10, cold 10, and fire 10, spell resistance 17, telepathy 100 ft."
    This seems to match your example.

    I tested dropping this creature into the combat tracker, and it successfully parsed the special qualities (and other fields) to produce the following effect:
    "DR: 10 good; IMMUNE: electricity; IMMUNE: poison; RESIST: 10 acid; RESIST: 10 cold; RESIST: 10 fire; DMGTYPE: chaotic,evil"

    Regards,
    JPG

  2. #22

    NPC User Guide

    Hi Moon Wizard,

    Thanks for the post. I'm glad to see that your example worked--that is always a good reality check. However, that means that my analysis of the code is flawed somehow. Could you look and see if you could see what my error was? I can't make an exhaustive guide until I understand how the script works and I'm clearly missing something.

    Also, your example seems to have lost the spell resistance?

    -D

  3. #23

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,905
    Quote Originally Posted by dradams View Post
    The first question is how the StringManager function works.
    I went to https://github.com/joshuha/Fantasy-G...master/scripts, but I'm not sure which core script this is included in (or if it is a Lua builtin). The reason that this is important is that you can't tell from the local context how the isWord method defines a word. That is important to know to help understand what delimiters work. The key line appears to be

    Code:
    local aSQWords = StringManager.parseWords(sSpecialQualities);
    Bit of a hint. Go to the base.xml of the ruleset you're using, and look for where "StringManager" is defined - it should point to a LUA script. This script should contain the "parseWords" function. You can then look at how it parses words. If you don't find it in the ruleset you're looking at (3.5 or Pathfinder, I assume) then you need to go look at the base.xml file in the ruleset that it's derived from (CoreRPG in many cases). You should find a line like:

    Code:
    <script name="StringManager" file="scripts/manager_string.lua" />
    The LUA script file is relative to the folder you found the base.xml file containing the line.

    Also, it's easier to dig through the code locally rather than visiting someone's github repository. Just copy the ruleset ".pak" file to a ".zip" file and unzip it.

  4. #24
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    22,942
    Blog Entries
    1
    This code: https://github.com/joshuha/Fantasy-G...master/scripts
    belongs to an old ruleset Foundations Core which has little relation to the CoreRPG and 3.5e/PFRG rulesets which you are documenting.
    Do as Andraax suggests and unpack these rulesets and examine them.

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  5. #25
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,188
    Quote Originally Posted by dradams View Post
    Also, your example seems to have lost the spell resistance?
    SR is populated in a specific field in the combat tracker (in Defenses). It is no an effect, so you won't see it there.
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    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!

  6. #26
    dradams,

    You asked for why your analysis was incorrect. I'm not sure exactly which example you are referring to, so I'll respond to this one:
    http://www.fantasygrounds.com/forums...l=1#post377181

    If the special qualities field is "Damage reduction 10/good", then aSQWords = { "damage", "reduction", "10", "good" }.

    The following code sequence follows, and produces an effect of "DR: 10 good". Note: I only include the relevant lines where conditionals match. If I didn't list that code, it's not triggered and thus not relevant.

    Code:
    local i = 1;
    while aSQWords[i] do
      ...
      elseif StringManager.isWord(aSQWords[i], "dr") or (StringManager.isWord(aSQWords[i], "damage") and StringManager.isWord(aSQWords[i+1], "reduction")) then
        if aSQWords[i] ~= "dr" then
          i = i + 1;
        end
        if StringManager.isNumberString(aSQWords[i+1]) then
          i = i + 1;
          local sDRAmount = aSQWords[i];
          local aDRTypes = {};
          while aSQWords[i+1] do
            ...
            elseif StringManager.isWord(aSQWords[i+1], DataCommon.dmgtypes) then
              table.insert(aDRTypes, aSQWords[i+1]);
            ...
            i = i + 1;
          end
          local sDREffect = "DR: " .. sDRAmount;
          if #aDRTypes > 0 then
            sDREffect = sDREffect .. " " .. table.concat(aDRTypes, " ");
          end
          table.insert(aEffects, sDREffect);
        end
      ...
      i = i + 1;
    end
    if #aEffects > 0 then
      EffectManager.addEffect("", "", nodeEntry, { sName = table.concat(aEffects, "; "), nDuration = 0, nGMOnly = 1 }, false);
    end
    JPG

  7. #27
    I haven't had a chance to work on this for a while, but I was just wondering if any effort is being made to update the pathfinder 1.0 ruleset now that the Unity version of FG is being developed. For instance, is there an effect that will prevent critical hits on a monster that is immune to them?

  8. #28
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    2,538
    Quote Originally Posted by dradams View Post
    I haven't had a chance to work on this for a while, but I was just wondering if any effort is being made to update the pathfinder 1.0 ruleset now that the Unity version of FG is being developed. For instance, is there an effect that will prevent critical hits on a monster that is immune to them?
    There is already such one for a long time IMMUNE: critical

  9. #29
    Quote Originally Posted by Kelrugem View Post
    There is already such one for a long time IMMUNE: critical
    Thank you. Great!!

  10. #30
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    2,538
    Quote Originally Posted by dradams View Post
    Thank you. Great!!
    https://fantasygroundsunity.atlassia...d+3.5E+Effects

    There is a list of effects (but I just saw that this piece of information is not there, but that effect exists Besides immunity against crits, there is also immunity against sneak attacks by IMMUNE: precision (make sure that sneak attacks have the precision damage type then) )

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
  •  
Joshua Stream Pre

Log in

Log in