-
July 23rd, 2005, 17:08 #1
- Join Date
- Mar 2005
- Posts
- 540
Help with numbercontrols from the developers
I have created a new button on the desktop next to the combattracker called countertracker. I have put several numbercontrols in it like this:
Code:<root> <windowclass name="countertracker"> <frame name="countertracker" /> <datasource /> <defaultsize width="300" height="33" /> <sheetdata> <numbercontrol name="number1"> <bounds rect="2,5,28,23" /> </numbercontrol> <numbercontrol name="number2"> <bounds rect="167,5,34,23" /> <nodrag /> <nodrop /> <source name="number1" op="+" /> </numbercontrol> </sheetdata> </windowclass> </root>
line in there. Is the character sheet the only place where you can use the source name? If not, how can I get it to work here.
-
July 25th, 2005, 18:19 #2
Re: Help with numbercontrols from the developers
Originally Posted by Cantstanzya
In your case, I'd recommend creating a dummy datasource (call it e.g. "numbertracker"), and linking to a certain record in there by adding the following to the bit defining the button on the desktop:
Code:<datasource name="mynumbers" />
Tero Parvinen
Fantasy Grounds Guru
-
July 26th, 2005, 00:02 #3
- Join Date
- Mar 2005
- Posts
- 540
Thanks, I will give this a try. I may have some more questions and would definatly appreciate any help you can give me. I am trying to impliment a counter that will increment/decrement as each round passes to keep track of spell duration and such. Thanks again.
-
July 31st, 2005, 16:39 #4
- Join Date
- Mar 2005
- Posts
- 540
I have tried doing this many ways with no success, and this is how I have it right now (I think I am getting close).
In the base.xml file I have added the following line:
Code:<staticdata source="rulesets\AD&D_UA\database\numbertracker.xml" />
Code:<root> <node name="numbertracker"> <node name="mynumbers"> <intvalue name="number1" value="0" /> <intvalue name="number2" value="0" /> </node> </node> </root>
Code:<root> <windowclass name="countertracker"> <frame name="countertracker" /> <datasource name="mynumbers"/> <defaultsize width="300" height="33" /> <sheetdata> <numbercontrol name="number1"> <bounds rect="2,5,28,23" /> </numbercontrol> <numbercontrol name="number2"> <bounds rect="167,5,34,23" /> <nodrag /> <nodrop /> <source name="number1" op="+" /> </numbercontrol> </sheetdata> </windowclass> </root>
Thanks in advance
-
August 4th, 2005, 02:32 #5
- Join Date
- Mar 2005
- Posts
- 540
Anything to help point me in the right direction?
-
August 4th, 2005, 10:32 #6Originally Posted by Cantstanzya
The windowclass definition and everything inside it can be thought of as the prototype for a particular piece of information. RPGs typically have lots of stat blocks or such, and one sheet type will typically represent one of them. This is the windowclass data source, and it will be the first node in the database (in this case, "numbertracker").
However, this is not enough information for the application to present the information needed. You also have to specify the specific item whose data you want to represent in the mentioned format. This is the record name of the data item. For the usual case, FG will count it up from "00001" (it could in theory also be e.g. an item's or a character's name, but this will cause some technical problems which is the reason why FG usually contains this simply in a field). In this case the record name is "mynumbers", and it is on the second level in the node tree.
Due to the difference in these two things, the windowclass never contains references to the exact data. It always needs the record name. Usually it comes from a window open control (e.g. the ones in the list scrolls) and is defined dynamically as the one for that list item. However, in your case you need to define it manually. Still, you need to define it outside the windowclass tag, and the correct place to do it is in the windowopencontrol tag.
So change your windowclass definition to:
Code:<windowclass name="countertracker"> ... <datasource name="numbertracker"/> ... </windowclass>
Code:<windowopencontrol ...> <class name="countertracker" /> <datasource name="mynumbers" /> </windowopencontrol>
Tero Parvinen
Fantasy Grounds Guru
-
August 4th, 2005, 17:24 #7
- Join Date
- Mar 2005
- Posts
- 540
Wow, it seems like a lot of information to wrap my head around. Now that I have read it twice it seems to make sense. I will give it a try when I get home from work. I almost want to leave work early to give it a try.
-
August 5th, 2005, 02:56 #8
- Join Date
- Mar 2005
- Posts
- 540
Thanks so much, that worked great! I am one step closer to making my round counter that will keep track of spell durations based off of what round it is. I am now creating a datasource in the Db.xml file. It looks like this:
Code:<node name="numbertracker"> <node name="mynumbers"> <intvalue name="round" value="4" /> <node name="player"> <node name="00001"> <stringvalue name="effect" value="Held" /> <intvalue name="effectduration" value="8" /> <stringvalue name="name" value="Player 1" /> <intvalue name="roundeffect" value="0" /> </node> <node name="00002"> <stringvalue name="effect" value="Sanctuary" /> <intvalue name="effectduration" value="6" /> <stringvalue name="name" value="Player 2" /> <intvalue name="roundeffect" value="0" /> </node> </node> </node> </node>
With the knowledge I have now I am almost positive I can at least have a round counter that is a fixed number of nodes. If you have a way that I can access data from one node into another node I can make the list grow dynamically rather than it being fixed.
-
June 11th, 2006, 00:12 #9Originally Posted by Goblin-King
Does the datasource name have to be hard-coded or is it possible to use a field to define it?
e.g.
Code:<windowopencontrol ...> <class name="countertracker" /> <datasource field="record_name" /> </windowopencontrol>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks