PDA

View Full Version : Trying to get km/h values via MATH tag



Fitz
Sep 28th, '05, 06:50 PM
I'm trying to export km/h values with the following:

<!--MATH-->RUNNING_TOTAL * SPD_TOTAL * 0.3<!--/MATH-->/<!--MATH-->RUNNING__NONCOMBAT_TOTAL * SPD_TOTAL * 0.3<!--/MATH--> km/h

But regardless of the actual numbers involved, it always returns a result of "-1/-1 km/h"

What am I doing wrong?

Simon
Sep 28th, '05, 06:59 PM
You're using "RUNNING_TOTAL" instead of "<!--RUNNING_TOTAL-->" (etc.)

Fitz
Sep 28th, '05, 07:05 PM
If I include the comment surrounds, I get an export error citing "----*0.3" as the offending string. When I removed them it gave me no export error, but the behaviour mentioned above.

I also tried using RUNNING_PRIMARY_NUMBER etc. which still returned "-1/-1 km/h" when used inside the MATH tag, and a blank field when I tried it outside the tag.

[edit]

Aha! If I remove the reference to SPD_TOTAL I get a result (i.e, changing it to <!--RUNNING_TOTAL--> * 0.3), but of course not the one I need.

Simon
Sep 28th, '05, 07:06 PM
Do what I told you.

RUNNING_TOTAL is not an export tag and will result in a -1 when the MATH export process tries to parse it.

You use export tags inside of the math container, just like anywhere else.

Simon
Sep 28th, '05, 07:10 PM
Also note the nesting of the tags, as noted in the export tag matrix (sticky thread at the top of this forum). In particular, the "if blocks" that surround the tags you are trying to use.

Fitz
Sep 28th, '05, 07:18 PM
OK, in my cut-'n-paste frenzy I had moved the block outside the IF_RUNNING block.

Changing the string to

<!--MATH--><!--RUNNING_TOTAL--> * <!--SPD--><!--SPD_TOTAL--><!--/SPD--> * 0.3<!--/MATH-->/<!--MATH--><!--RUNNING_PRIMARY_NONCOMBAT_NUMBER--> * <!--SPD--><!--SPD_TOTAL--><!--/SPD--> * 0.3<!--/MATH--> km/h)

finally worked.

Bloodstone
Sep 30th, '05, 01:51 AM
bblackmore just posted a day or two ago that he has a template that does this sor to of thing:

http://www.herogames.com/forums/showthread.php?t=36831&page=2