Thread: Help: Simple Number Counter
-
July 26th, 2016, 12:47 #1
Help: Simple Number Counter
New question ... I'm trying to implement a point counter on the character sheet, similar to the total loaded weight field (CoreRPG Ruleset).
I've been looking at record_char_inventory.xml and found this:
Code:<simplenumber name="encumbranceload" source="encumbrance.load"> <anchored to="encumbranceframe" position="insidetopleft" offset="160,30" width="55" height="20" /> <frame name="fieldlight" offset="7,5,7,5" /> <readonly /> </simplenumber>
Where is this source?
For example: I have numeric fields A, B and C. I want the sum of these three elements displayed in numeric field "D". I guess i need to store the values of A,B and C somewhere so D can read this as a source???
How should I proceed?
Thanks in advance for any help."A saint does what is right. A leader does what is necessary."
-
July 26th, 2016, 13:37 #2
Add some equipment with weight to the Inventory. Give the equipment names like BBBB, CCCC and DDDD and then /save in chat. Open the db.xml and you will see where how these were saved.
Next you want to find the code that accepted them. You want to use notepad++ (or any similar tool) and its Find in Files feature, an unpacked copy of CoreRPG and start tracking down the code that works for Inventory. Inventory is more complex than some code as it uses lists but thats ok - you will find your code
-
July 26th, 2016, 14:43 #3
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
And inventory has lots of derived classes in the various rulesets. Which ruleset are you using?
-
July 26th, 2016, 15:08 #4
In the campaign database. More info on the FG database here: https://www.fantasygrounds.com/modguide/database.xcp
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!
-
July 26th, 2016, 19:58 #5"A saint does what is right. A leader does what is necessary."
-
July 26th, 2016, 19:58 #6
-
July 26th, 2016, 20:02 #7"A saint does what is right. A leader does what is necessary."
-
July 26th, 2016, 21:53 #8
So... another question.
I have this simple numeric counter getting the info from the "forca" in db.xml. It works as intended.
Code:<simplenumber name="maxencumbranceload" source="forca"> <anchored to="encumbranceframe" position="insidetopleft" offset="160,60" width="55" height="20" /> <frame name="fieldlight" offset="7,5,7,5" /> <readonly /> </simplenumber>
Code:<forca type="number">4</forca> <resistencia type="number">3</resistencia> <habilidade type="number">1</habilidade> <inteligencia type="number">1</inteligencia>
Searching the template_char in the 3.5E ruleset i have found this:
Code:<number_linked> <frame name="fieldlight" offset="7,5,7,5" /> <displaysign /> <rollable /> <hideonvalue>0</hideonvalue> <source><name>stat</name><op>+</op></source> <source><name>state</name><op>+</op></source> <source><name>...encumbrance.armormaxstatbonusactive</name></source> <source><name>...encumbrance.armorcheckpenalty</name><op>+</op></source> <source><name>ranks</name><op>+</op></source> <source><name>misc</name><op>+</op></source>
Code:<simplenumber name="maxencumbranceload"> <source><name>forca</name><op>+</op></source> <anchored to="encumbranceframe" position="insidetopleft" offset="160,60" width="55" height="20" /> <frame name="fieldlight" offset="7,5,7,5" /> <readonly /> </simplenumber>
"A saint does what is right. A leader does what is necessary."
-
July 26th, 2016, 23:14 #9
You only have one <source> defined - "forca" and no other sources being added using <op>, so this will only display the data held in forca, it won't add anything else to it. This also assumes that the "forca" database field is accessible from the database node that the window is anchored to.
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!
-
July 26th, 2016, 23:20 #10
I have used just one source as an example, because when i use <whatever source="forca"> it works ok, but when i do <whatever><source>forca</source></whatever> or <whatever><source><name>forca</name></source></whatever> it does nothing... should'nt it be the same thing? I'm a little confused by this...
"A saint does what is right. A leader does what is necessary."
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks