DICE PACKS BUNDLE
Page 4 of 4 First ... 234
  1. #31
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    so - ive been barking up the wrong tree a little...
    many apologies Lundgren for appropriating your thread for my own use!

    • I dont think I can use the dynamic list and scroll bar on a partial frame - its all or nothing
    • I was trying to dynamically link NPC stats between NPC record and the CT entry - not the way its done in FG3 rulesets - once you drag an NPC to the CT it is its own entity - this allows you to drag multiple instances of the one NPC


    So I still have a few things I need help with

    • I am now using the following method of adding attacks/weapons to my NPCs - similar to other CoreRPG rulesets.

      I need to parse the text and break it down - eg Spear [45] [43] (2d6) Translates to
      Weapon: Spear
      Attack Roll (under): 45
      Defense Roll (under): 43
      Damage (2d6)
      I have it rolling d100,d10 (%) on clicking the string but I really need help with:
      1. Splitting string into Weapon / Attack / Defense / Damage
      2. Comparing the Attack Roll with the Attack value
      3. Comparing the Defense Roll with the Defense Value
      4. Executing the Damage Roll

    • Initiative - I need to either make the CT INIT field clickable to roll Initiative or I need Initiative to roll automatically on Round Start.
      I know C&C does this - the code looks quite complex and my first effort at stealing code from this wasnt successful.
      Pointers welcome - should I go back to C&C and retry or should I make the CT clickable

    • My Wounds were locked but once I changed the DB name they are now editable in the CT directly so that is ok now.


    So if any of you kind gurus have some bandwidth available to point me in the right direction on these... Id be much obliged



    FG Con 6 – April 17-19th 2015 - register at www.fg-con.com for all the latest info.

  2. #32
    Quote Originally Posted by damned View Post
    many apologies Lundgren for appropriating your thread for my own use!
    Just nice it being used. It also makes it easier to find, when I'm trying to figure out the same things

    I need to parse the text and break it down - eg Spear [45] [43] (2d6) Translates to
    Weapon: Spear
    Attack Roll (under): 45
    Defense Roll (under): 43
    Damage (2d6)
    I have it rolling d100,d10 (%) on clicking the string but I really need help with:
    1. Splitting string into Weapon / Attack / Defense / Damage
    2. Comparing the Attack Roll with the Attack value
    3. Comparing the Defense Roll with the Defense Value
    4. Executing the Damage Roll
    Any specific reason why you have it as one text field, instead of four separate fields from the start?

    I'm still not familiar enough with LUA to whip up some code for it. But for the parsing part, you basically could:
    • Look for the first left bracket, then store everything before it as the weapon name (dropping any trailing spaces)
    • From the position of the former left bracket, look for the next right bracket. Store anything between them as the attack value
    • From the position of the former right bracket, look for the next left bracket (so it doesn't matter if there was a space in between them or not). From there, look for the next right bracket and store anything in between as the defense value.
    • From the position of the former right bracket, look for the next left parenthesis. From there, look for the next right parenthesis and store anything in between as the damage.

    string.find and string.sub should work to find the positions and extract the information, if they are available in FG scripts.
    So, from a "basically" point of view, it should be quite straight forward. The tricky part is to handle the input errors. Someone might add brackets in the weapon name, or using the wrong type, etc. It can easily become 10% code to handle a correctly typed string, and 90% of the code to handle all of the other odd cases that could creep up.

  3. #33
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    Quote Originally Posted by Lundgren View Post

    Any specific reason why you have it as one text field, instead of four separate fields from the start?
    This is how its done in most of the CoreRPG rulesets for NPC attacks... this allows the GM to run the NPC combat from the CT and not have to have a NOC sheet open for each NPC in the fight.

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
  •  
5E Character Create Playlist

Log in

Log in