PDA

View Full Version : XML-> Operation * 10



Nouny
June 15th, 2005, 19:55
Hello hello,

In my character sheet, I want to calculate the intelligence modifier * 10 but I just can't find how to do it.. can someone help me!? Here's my code for now... I tried 1 or 2 things but I guess I'm no good at xml... he hehe

<numbercontrol name="intimateknowledgeintelligence">
<value type="modifier" />
<bounds rect="260,84,34,23" />
<nodrop />
<noreset />
<displaysign />
<hideonvalue value="0" />
<source name="intelligencebonus" op="*" />
<description text="Intelligence x 10" />
</numbercontrol>

Crusader
June 15th, 2005, 21:34
Too bad if the op="*" doesn't work since I have use for it myself, but one thing that I notice about your code (if the op="*" indeed does work), is that you tell the program to multiply the intelligencebonus, but not what to multiply it with. I don't have any example code to look at now so I don't know what codes to use but if you can assign the value 10 to this control and then perform the op="*". Maybe that would work?

Cantstanzya
June 16th, 2005, 02:00
Give this a try:


<numbercontrol name="always-zero">
<invisible />
</numbercontrol>

<numbercontrol name="intimateknowledgeintelligence">
<value type="modifier" />
<bounds rect="260,84,34,23" />
<nodrop />
<noreset />
<displaysign />
<hideonvalue value="0" />
<source name="intelligence" op="+" />
<source name="always-zero" op="*" valuemap="0:10" />
<description text="Intelligence x 10" />
</numbercontrol>

What I have done is create a number control called "alway-zero", which will always be zero and I use it for defaults throughout my character sheet. In the "intimateknowledgeintelligence" number control I take the value of intellingence, lets say it is 17 and since always-zero is zero it will multiply it by the 17 times 10. This should give you the results you want.

Nouny
June 17th, 2005, 14:14
It worked!!!! Thanks a lot!!!!! :)