5E Character Create Playlist
Page 1 of 3 123 Last
  1. #1
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,470

    Damned's Init/Combat tracker questions

    Quote Originally Posted by damned View Post
    sadly my code looks completely different... im still stumped.
    It should look very similar - put rMessage.type = "dice"; in your onRoll() result handler for your initiative action manager. Put it after rMessage is created and before Comm.deliverChatMessage is called.

    I'm curious as to why you want to enable dragging of initiative when the last initiative action you were writing stored the result in the correct place as part of the onRoll result handler.

    MODERATOR: Moved to it's own thread.
    Last edited by Trenloe; November 30th, 2014 at 15:36.
    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. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,709
    Blog Entries
    1
    Hi Trenloe - when you drag a character to the CT its INIT is correctly pulled from Character Sheet.
    I cant seem to find how to update the INIT at the start of the round or when INIT changes on Character Sheet.

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,470
    Quote Originally Posted by damned View Post
    Hi Trenloe - when you drag a character to the CT its INIT is correctly pulled from Character Sheet.
    I cant seem to find how to update the INIT at the start of the round or when INIT changes on Character Sheet.
    Assuming that the Init score in the character sheet and the Init total on the combat tracker are different fields in the database then you will need to write a database onUpdate event handler against the database field in the character sheet that will be triggered when the field changes. See "Handler Functions" at the bottom of this page: https://www.fantasygrounds.com/modguide/scripting.xcp

    But, in the end, there is really no need to store Initiative in the character sheet - it really should be stored against the record in the combat tracker as this is the place where it takes effect and has any meaning. Storing it directly in the combat tracker will mean there is no need for any onUpdate event handlers from the character sheet, and will put the result directly where it needs to be. Look at the Castles and Crusades scripts\manager_action_init.lua file - this uses the notifyApplyInit function at the end of the result handler onResolve to send the init result to the GM (via OOB messaging) to be added to the combat tracker initresult field using DB.setValue(ActorManager.getCTNode(rSource), "initresult", "number", nTotal);
    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. #4
    @damned: I just shot you an email... I think you will be pleased with the contents. 11 lines of Lua goodness that gets you up and running.

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,709
    Blog Entries
    1
    You are absolutely correct - I *am* storing the INIT twice - I didnt really think about that - and that is silly, pointless and over complicating things in the long run.

    Would it not be more correct to store it in the Character Sheet and have the CT use the Character Sheet record?
    Because your Character may roll INIT before being added to the CT?

    Let me explore that further.

  6. #6

  7. #7
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,709
    Blog Entries
    1
    @Trenloe - I need to explore this whole thing further because I want to also add the following fields to the CT:

    Endurance (from record_char_main.xml)
    Wounds (from record_char_combat.xml)
    Armour Rating (from record_char_combat.xml)

    So I will want to be looking them up from the DB - and the Wounds also needs to update as it changes...

  8. #8
    Also @damned... Love the theme you used for your ruleset!

  9. #9

  10. #10
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,470
    Quote Originally Posted by damned View Post
    @Trenloe - I need to explore this whole thing further because I want to also add the following fields to the CT:

    Endurance (from record_char_main.xml)
    Wounds (from record_char_combat.xml)
    Armour Rating (from record_char_combat.xml)

    So I will want to be looking them up from the DB - and the Wounds also needs to update as it changes...
    In the Castles and Crusades ruleset see ct\scripts\ct_entry.lua - the linkPCFields() function defines the database links in the charsheet record and ties these with the relevant controls in the combat tracker - the controls have to be defined using the <number_ct_crosslink> template - see the entries in ct\ct_host.xml. Once these links are defined then if the linked field in the database changes then the field in the linked control will be updated.

    Quote Originally Posted by damned View Post
    Would it not be more correct to store it in the Character Sheet and have the CT use the Character Sheet record?
    Because your Character may roll INIT before being added to the CT?
    That's not how it's done in any of the main FG rulesets (3.5e, Pathfinder, C&C, etc.). Having an initiative total on the character sheet is a waste of space on the character sheet as it is only relevant to an entry in the combat tracker. Yes, a player may roll INIT before being placed in the combat tracker, but this would be a rare occasion - just get them to roll again or manually populate it with the original roll once the PC record is in the combat tracker; this is what all the other main rulesets do.
    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!

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
  •  
DICE PACKS BUNDLE

Log in

Log in