-
November 30th, 2014, 02:30 #1
Damned's Init/Combat tracker questions
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!
-
November 30th, 2014, 02:32 #2
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.
-
November 30th, 2014, 02:52 #3
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!
-
November 30th, 2014, 03:07 #4
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
@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.
-
November 30th, 2014, 03:10 #5
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.
-
November 30th, 2014, 03:11 #6
@DMFirmy - thank you too! Im looking at your code right now.
-
November 30th, 2014, 03:17 #7
@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...
-
November 30th, 2014, 03:18 #8
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
Also @damned... Love the theme you used for your ruleset!
-
November 30th, 2014, 03:20 #9
Thanks @DMFirmy - I gotta few things to go before its ready for use
-
November 30th, 2014, 03:34 #10
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.
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