Quick Help

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
CixrTyx
Cave Troll
Posts: 38
Joined: Thu Aug 26, 2010 2:54 pm

Quick Help

Post by CixrTyx »

Hey Everybody,
I have some code I can't seem to figure out I just want it to set the TempHP if they are greater than current and then set my bar to that new total as max. Here is my code but I keep getting "java.lang.NullPointerException error executing expression bar.Temp-Full = TempHP / TempHP)."

Code: Select all

[h: status = input("temphpChange|0|Temporary Hit Points Gained")]
[h: abort(status)]
[h: TempHP = max(temphpChange, TempHP)]
[h: bar.Temp-Full = TempHP / TempHP)]
[r: token.name] gains [r:TempHP)] temporary hit points.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Quick Help

Post by Irrlicht »

I don't know what bar.Temp-Full is and where it is from (Bag of Tricks? It looks like a function name, and funtions don't work like that), so I can't say what's wrong with it.
What I can say for sure is that "TempHP / TempHP" is *always* 1, so maybe you want to change the formula or just use a direct 1. Or use the normal bar functions (http://www.lmwcs.com/rptools/wiki/Category:Bar_Function).
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Quick Help

Post by wolph42 »

its not from the BoT. There are actually 3 issues. the '-' and x/x=1 which Irrlicht mentioned and the third is the fact that TempHP is nowhere defined in your code.

the first mention is here
[h: TempHP = max(temphpChange, TempHP)]
which you could thus roughly read as:
[h: TempHP = max(temphpChange, unknown_value)]

Post Reply

Return to “Macros”