STAR TREK 2d20
Page 17 of 36 First ... 7151617181927 ... Last
  1. #161
    Ah, right

    Of other interest might be this from the npc_flavors_data.lua file

    If you f.ex. take the bodyparts section.
    Code:
        ["bodyparts"] = {
            construct = constructPCS,
            prefix = {
                 "beautiful", "big", "broken", "calloused", "clean", "dazzling", "dirty", "enormous", "filthy", "infected", "long",
                 "mangled", "miniscule", "missing", "painted", "pierced", "rotten", "scarred", "short", "shrunken", "small",
                 "smelly", "stubby", "swollen", "tattooed", "ugly", "withered", "wounded"
            },
            color = tColors,
            suffix = {
                 "arm", "arms", "ear", "ears", "eye", "eyes", "finger", "fingers", "head", "knee", "knees", "left arm", "left ear",
                 "left eye", "left knee", "left leg", "left shoulder", "leg", "legs", "middle finger", "nose", "right arm",
                 "right ear", "right eye", "right knee", "right leg", "right shoulder", "shoulder", "shoulders", "teeth", "thumb",
                 "thumbs", "tooth", "torso"
            }
        },
    It defines prefixes, colors and suffixes to be used. And it tells the function to construct the flavor using "constructPCS" (construct with prefix, color and suffix)
    Tt the top of the file you have the construction definition:
    Code:
    local constructPCS = {
        {prefix = { 100 }},
        {color = { 15 }},
        {suffix = { 100 }}
    };
    This defines that there is a 100% chance to apply a suffix, a 15% chance to apply a color and a 100% chance to apply a suffix.
    So most of the time something like "ugly nose"
    And sometimes "ugly green nose"

    Another of the construction (used in behavior and fur) definitions says:
    Code:
    local constructPS = {
        {prefix = { 100, 30 }},
        {suffix = { 100 }}
    };
    This says 100% chance for a prefix, 30% chance for a second prefix and 100% chance for a suffix.
    So most of the time "considerate saunter"
    And some of the time "considerate self-absorbed saunter"

    Just in case you want to mess around with that as well

  2. #162
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,259
    Blog Entries
    9
    Awesome, thanks for the info.

    Why I'm looking is that I'm considering making some changes for my own use. I find that sometimes the 'flavors' are just too long. Not that I have taken note of how often, but of course since I only remember the ones that annoy me... So I was considering editing the lists to remove some of the longer elements. Maybe if I mess with percentages that will get me where I want too.

    Thanks

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  3. #163
    Hi,

    I'm getting the same errors as an earlier poster, latest version of the extension

    Script Error: [string "scripts/manager_npc_flavors.lua"]:101: attempt to concatenate local 'npcTypeWithFlavor' (a nil value)


    no extensions, other than the npc flavours, in PFRPG set

    I'd love some pointers

    only spews errors for monsters which don't seem to have a type in npc_flavours_data.lua

    from what I gather it's concatenating the name and type and substring matching, but it doesn't like not finding monsters that have nothing matching after it does that

    in my case, magical beasts (spawning 10 x owlbear) (type: N Large magical beast)
    and also, animals (spawning monitor lizards) (type: Medium Animal)

    in both cases it spawns the first one, then writes the error to console window as it spawns the second, and stops with the rest

    in the attempt at a solution I tried to add a new class of npc type in npc_flavors_data.lua (animal), but alas same error when spawning lizards... so that didn't work *shrug*

    (no other creatures, no PCs in CT)

    Do you have any pointers?

    Thanks in advance
    Last edited by Zygmunt Molotch; September 4th, 2020 at 17:18.

  4. #164
    Hi Zygmunt Molotch,

    Thank you for the report.

    Yes, it seems the bit that parses the PF types returns nil if it doesn't find a type that it can understand. It is supposed to return whatever is put into the function instead.

    If you're comfortable changing the code / running it from an unzipped folder, I think this could possibly be a temporary fix for you:

    In npc_flavours_data.lua on line 335, the npcGetType function, change
    Code:
    local _, _, type = s:match( "(.+) (.+) (.+)");
    return type;
    to
    Code:
    local _, _, type = s:match( "(.+) (.+) (.+)");
    if type then
      return type;
    end
    If that does not work, I can have a closer look during this weekend.


    With that said, I'll have a new version releasing soon since we've started playing 2E, and I'll start to support flavors by type for that.
    So I'll take a look at the code and make sure the type parsing / determination is more robust.


    But let me know how it goes. We don't want those monsters destroyed before they make it to the battle, just because they want to be a little extra

    Regards,
    Tideturner

  5. #165
    Hey!

    Thanks for the hotfix, and thanks in advance!

    that does work, if I replace the line in manager_npc_flavours.lua it bypasses trying to assign them a flavour! and no errors are thrown out

    since these are (with the exception of humanoid), the two most common types of monsters (magical beasts and animals)

    I've added these two with the
    ["animal"] = {
    NPCFlavorData.Flavors.build,
    NPCFlavorData.Flavors.behavior
    }


    Fixed Later edit:

    Ok so as I'm editing editing npc_flavors_by_npctypes.lua, I notice weirdly the array has to be alphabetical
    so animal must fit below aberration.shapechanger, and before beast

    (but I assume this is a weird thing with LUA because it's a fake array and not an object..., so that's easy to bypass, the types must just be in alphabetical order... (I suspect this could be related to color appearing before prefix, in the npc_flavours_data.lua file, whereyou wrote 'to be investigated' though It could not! ))

    second thing...

    something and I think it's the npcGetType function is not working with uppercase letters, in fact it's likely the fix you suggested, I guess!

    something typed as : Medium Animal/Animal, will not register
    while medium animal/animal, will register, same for all, Beast vs beat etc

    tl;dr animal works, Animal does not


    Third thing
    npc_flavors_by_npctypes.lua

    line 32: ends in ,
    line 72: ends in ,
    line 81: ends in ,

    I don't know if those trailing , are a problem in LUA or not, they might not be!
    Last edited by Zygmunt Molotch; September 5th, 2020 at 12:48.

  6. #166
    Hi Zygmunt,

    Glad the workaround works.

    And thank you so much for the code review. I'll make sure to look over all the details you provided.

    Weird with the alphabetical order in the array. My LUA knowledge comes solely from whatever this extension demanded of me, so I'm kinda strangely looking forward to investigating that one

    The npc types used for flavoring comes from 5E, since that was all I had access to at the time I first wrote this. And they looked to be close enough to how PF named their types that PF got supported as well, but from the same set.
    In the new upcoming version I'll have separate sections for 5E, PF and 2E.

    Again, thank you so much for taking the time to look at the code

    Regards,
    Tideturner

  7. #167
    Happy to prod and try to break things!

    yeah the alphabetical thing was odd, but when I added animal as a group at the end after undead it did _not_ work

    I don't get the regex for stripping upper or lowercase, do you have a suggestion for that bit?

    (the second thing)

  8. #168
    Hi,

    If you convert the type to lowercase before the regex, it should work.

    Line 323 in manager_npc_flavors.lua
    Code:
    function npcGetType(s)
        s = s:lower();
    However I just notice that you say the type for the Monitor Lizard is "Medium Animal", Which the regex will not be able to identify as a known type.
    I only have the some PFRPG Essentials which say the type is "N Medium animal", and that will get parsed as "animal", since it throws away the first two words.

    I might have some old outdated data modules. Can you point me to the ones you use? I'll look into updating the parser code then.

    Regards,
    Tideturner

  9. #169
    Quote Originally Posted by Tideturner View Post
    Hi,

    If you convert the type to lowercase before the regex, it should work.

    Line 323 in manager_npc_flavors.lua
    Code:
    function npcGetType(s)
        s = s:lower();
    However I just notice that you say the type for the Monitor Lizard is "Medium Animal", Which the regex will not be able to identify as a known type.
    I only have the some PFRPG Essentials which say the type is "N Medium animal", and that will get parsed as "animal", since it throws away the first two words.

    I might have some old outdated data modules. Can you point me to the ones you use? I'll look into updating the parser code then.

    Regards,
    Tideturner
    actually I just looked, I think it's the problem it's self is the module, that monster was from an old module which is included in FG ,"well met in kith'takharos", and "carnivorous lizard"


    regardless with the first fix you suggested, the worst case is now that it generates no 'flavour' and it's cool


    there's two ways to progress

    1- do nothing, that monster is likely ... entered incorrectly, and thus not really 'your' problem
    2- don't throw away the first two words as they're alignment-size and wont substring match a monster 'type' anyway


    HOWEVER

    what is strange is it works when it's lower case and there's only 1 word...

    I'm going to play some more,... back in a short while
    Last edited by Zygmunt Molotch; September 5th, 2020 at 09:15.

  10. #170
    going to write a new comment, sorry about following one after the other

    even if the type is just manually changed to "beast" it works

    if it's "Beast" it does not

    (I have added beast class in the npc_flavors_by_npctypes.lua file)

    I will now try forcing lowercaseCapture.PNG


    EDIT/update
    ok forcing lower case works for Beast

    and Animal, but not for Medium Animal.. hmm
    Last edited by Zygmunt Molotch; September 5th, 2020 at 09:20.

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