Member
Join Date: Apr 2012
Location: Washington, D.C.
Posts: 76
|
Hey guys,
I've added a few templates for reducing level adjustments per the Unearthed Arcana rules, and I was looking for a quick tip. Since the coding to make HL automatically compute and deduct the proper amount of XP would be well above my programming ability, I've been doing that manually. But, I would like to add a prereq for the template so that it can only be taken if the character's level adjustment is greater than zero. Can anyone help me on the code for that? Thanks, |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Try:
Code:
herofield[tLevelAdj].value > 0 |
#2 |
Member
Join Date: Apr 2012
Location: Washington, D.C.
Posts: 76
|
Thanks, I'll give that a shot after work.
|
#3 |
Member
Join Date: Apr 2012
Location: Washington, D.C.
Posts: 76
|
That worked as far as selecting the template. But now, I have a validation message. By virtue of reducing the level adjustment to zero, I'm violating the above code. Any thoughts there?
|
#4 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Well, there's another field that we could look at called "tLastAdj". I don't know exactly what this field does, but it seems to match tLevelAdj. When I modified tLevelAdj, tLastAdj didn't change with it (perhaps because of timing?). So, my first thought would be to change the above pre-req code to:
Code:
herofield[tLastAdj].value > 0 I don't know for sure what goes into this field (tLastAdj), but barring any bizarre corner cases I think this will work for you. If anyone has any further insight to this, I'm all ears (or eyes, I guess, in this case). Incidentally, not sure if you know this or not, but I found these fields by selecting from the HL menu "Develop -> Floating Info Windows -> Show Hero Fields". I've found this and the other options in this menu to be quite helpful in finding what fields and/or tags I need (even if I don't always know what they do). Last edited by Sendric; September 5th, 2012 at 06:04 AM. |
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
tLastAdj is calculated from tLevelAdj, and is used to generate the "1-3" you'd see if a 3HD race was the first thing on your character, and then keep track of the fact that the first class level you add will be level 4, not level 1. Adjust tLevelAdj, not tLastAdj - the tLastAdj changes will be properly calculated if you get the tLevelAdj changes right.
Why not just right-click the levels. Fewer clicks to get to the debugging information in most cases than going through the develop menu. |
#6 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
We are definitely trying to adjust tLevelAdj. The problem that's arising is that if you set a pre-req based on the tLevelAdj field then change that field, you'll get a validation error. In this case, the tLevelAdj is (presumably) 1. The pre-req is that it be greater than 0. So far, so good. However, the template reduces that field to 0, and now you have an error. I was trying to find a way around this issue. Unfortunately, that didn't work so well (shocking, I know). Quote:
Code:
herofield[cLastAdj].value > 0 Thanks, Mathias. |
||
#7 |
|
|