STAR TREK 2d20
Page 5 of 10 First ... 34567 ... Last
  1. #41
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by ShakyLuigi View Post
    What can I do to get the script to ignore all errors involving a nil value?
    There are a few options:

    1) Test for the nil value first. or use slightly different code.

    You can test for not nil values with something like the following, only doing the code if the object exists:

    Code:
    function onValueChanged()
        local nodeWin =window.getDatabaseNode();
        local nodetotS = nodeWin.getChild("totS");
        local nS = "";
        if notetotS then
             nS = notetotS.getValue();
        end
    ...
    end
    2) However, in this instance, if totS is always going to be in the database for correct operations, use the node.createChild API call - this will use the child node if there already or create it if not - https://fantasygroundsunity.atlassia...de#createChild You'll need to add an extra argument of "type" so it knows what type of child to create. I don't know if this makes sense in your code, so it may not be an option in this case.

    3) Another way is to use the DB global package getValue function as this allows the default value to be returned if the function can't find a valid value: https://fantasygroundsunity.atlassia...82/DB#getValue

    So, in this case, you could use something like:

    Code:
    function onValueChanged()
        local nodeWin =window.getDatabaseNode();
        local nS = DB.getValue(nodeWin, "totS', "");
        if nS  ~= "" then
    -- do stuff
        end
    ...
    end
    Last edited by Trenloe; October 3rd, 2022 at 01:14.
    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!

  2. #42
    Thanks a lot Trenloe!

    Good thing you gave me so many choices, because I needed to use both solution 1 and 2 in different places to get everything to work.
    But now it seems to function.

    That removed 6 Error messages in one go

  3. #43
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by ShakyLuigi View Post
    Thanks a lot Trenloe!

    Good thing you gave me so many choices, because I needed to use both solution 1 and 2 in different places to get everything to work.
    But now it seems to function.

    That removed 6 Error messages in one go
    Woo hoo! Nice one. Happy to help.
    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!

  4. #44
    Hey this is awesome! Just about to join a WFRP campaign and came across this. You should slap this bad boy in the forge!

  5. #45
    Small update this time.

    - Fixed a whole bunch of error messages when creating a character.
    - Fixed the error for creating new items in the trappings list.
    - Small graphic changes.

    WRFP 4th edt.pak

    Thanks daddyogreman! I would love to get some feedback on what works and doesn't if your group ends up using the ruleset!

    I have actually thought about adding this to the Forge.
    Not sure if it is allowed though. I am not adding anything that is copyrighted by Games Workshop or Cubicle 7, but the gaming system is not mine.
    I have tried to see if there are any limitations in the Forge Rules, but haven't seen any. Haven't found anything that says I'm allowed either.

    Is there someone more knowledgable than me that could answer this?

  6. #46
    Oh on a side note - you're titling the file WRFP 4th edt.pak when I think you're meaning WFRP 4th edt.pak.

    And it'd just be me using it for a character sheet/automation, not the entire group. I'll tread lightly for the moment and keep a paper copy of my character sheet and bring dice, but I'll certainly be seeing that this ruleset can do! Thanks for all the work!
    Last edited by daddyogreman; October 27th, 2022 at 21:42.

  7. #47
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    Quote Originally Posted by ShakyLuigi View Post
    Small update this time.

    - Fixed a whole bunch of error messages when creating a character.
    - Fixed the error for creating new items in the trappings list.
    - Small graphic changes.

    WRFP 4th edt.pak

    Thanks daddyogreman! I would love to get some feedback on what works and doesn't if your group ends up using the ruleset!

    I have actually thought about adding this to the Forge.
    Not sure if it is allowed though. I am not adding anything that is copyrighted by Games Workshop or Cubicle 7, but the gaming system is not mine.
    I have tried to see if there are any limitations in the Forge Rules, but haven't seen any. Haven't found anything that says I'm allowed either.

    Is there someone more knowledgable than me that could answer this?
    Game Mechanics are not copyrightable in the US
    Make sure that your ruleset states it is Unofficial or Community etc
    Dont represent it as a licensed/authorised version and dont include copyright material

  8. #48
    Quote Originally Posted by ShakyLuigi View Post
    Small update this time.

    - Fixed a whole bunch of error messages when creating a character.
    - Fixed the error for creating new items in the trappings list.
    - Small graphic changes.

    WRFP 4th edt.pak

    Thanks daddyogreman! I would love to get some feedback on what works and doesn't if your group ends up using the ruleset!

    I have actually thought about adding this to the Forge.
    Not sure if it is allowed though. I am not adding anything that is copyrighted by Games Workshop or Cubicle 7, but the gaming system is not mine.
    I have tried to see if there are any limitations in the Forge Rules, but haven't seen any. Haven't found anything that says I'm allowed either.

    Is there someone more knowledgable than me that could answer this?
    Thx for the work

    with the last updated hardy is not editable

  9. #49
    Hehe, that is actually not a bug, but a feature.

    If you add "Hardy" to the talents, and set the "Count" to 1, then it should sum it by itself!

    I removed the edit option to keep my players from editing themselves, so I could force them to test out the function.

  10. #50
    Well, i've slapped it on the Forge!

    At the same time I fixed the combat tracker, so the relevant info is transfered correctly.

    And that's about it for this time.

    Happy gaming!

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