-
February 24th, 2007, 16:48 #1
- Join Date
- Feb 2007
- Posts
- 81
Set initial value in a number or string control
How can we set an initial value in a number or string control.
for example I would like to set the attributes to be at minimum 1 so a new sheet would already have the value at 1 (number control)
Same for string control.
Thanks
-
February 27th, 2007, 22:48 #2
- Join Date
- Feb 2007
- Posts
- 81
Anybody know about this. I am know about fantasy grounds and trying to do my ruleset.
Thanks
-
February 28th, 2007, 02:06 #3
something like this might work
this will give a starting value of 3....change the value map to get a different value
<numbercontrol name="startingvalue">
<invisible />
</numbercontrol>
<numbercontrol name="strength">
<bounds rect="165,238,36,30" />
<noreset />
<description text="Strength" />
<source name="startingvalue" op="+" valuemap="0:3" />
</numbercontrol>
-
February 28th, 2007, 03:34 #4
- Join Date
- Feb 2007
- Posts
- 50
The following bit of XML is from d20_adventure.xml
Code:<stringcontrol name="name"> <bounds rect="45,12,-52,20" /> <empty value="« New Personality »" /> <createidentity /> </stringcontrol>
The following is from Charsheet.xml
Code:<numbercontrol name="acbasehelper"> <invisible /> </numbercontrol> <numbercontrol name="ac"> <bounds rect="289,423,34,23" /> <nodrop /> <nodrag /> <noreset /> <source name="acdexbonus" op="+" /> <source name="acsizebonus" op="+" /> <source name="acarmorbonus" op="+" /> <source name="acshieldbonus" op="+" /> <source name="acmiscbonus" op="+" /> <source name="acbasehelper" valuemap="0:10" /> </numbercontrol>
That's sort of a sloppy hackish way to accomplish the simple task of setting a default value, but that's how Smiteworks seems to do it.Last edited by Archmage; February 28th, 2007 at 03:41.
-
February 28th, 2007, 04:18 #5
You'll be glad to hear in FG 2.0 its much easier but what Archmage posted above will work.
-
February 28th, 2007, 15:37 #6
- Join Date
- Feb 2006
- Location
- Fairfax County, Virginia
- Posts
- 499
Note that in FG1, using <source ...> to set the default value of a control doesn't work exactly as you might expect. If you try to import that value into another sheet (e.g., combat tracker), the imported value will be off by whatever the sourced value is. This is because the way a numbercontrol works, it has its own value, and then any source tags are added onto that for the purposes of the display, but when the value of the numbercontrol is imported elsewhere, only the actual value (ignoring the source tags) gets imported.
As long as you're not getting too fancy, though, it will work how Archmage said.
-
February 28th, 2007, 17:44 #7
- Join Date
- Feb 2007
- Posts
- 81
Thanks for your help I will try this tonight
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks