Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old February 23rd, 2011, 02:55 PM
There are pIsOn1 and pIsOn2 that look if checkboxes have been activated, but is there a field I can access for Charges that tells me if I'm using the decrementer or incrementer on the charges? Kind of like a listener? Or anything that returns its value (-1 or +1 in activation mode, 0 when idle)?
Kendall-DM is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old February 23rd, 2011, 03:50 PM
Please explain what you're trying to accomplish here.
Mathias is offline   #2 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old February 23rd, 2011, 06:36 PM
I was trying to automate a process,I misspoke, I meant hIsOn1 and hIsOn2. I have an ability that relies on the number of turn attempts remaining in a day, and that itself used up turn attempts. I call them Auras. So, when I activate an Aura, available equal to the number of turn attempts remaining in the day, it puts a charge on the turning attempts, and a charge on the Aura. For example:

AuraX 0/2 : requires 2 turn attempts to use.

AuraY 0/4 : requires one turn attempt to use.

Turn Undead 0/4

Using one of the AuraX charges, you end up with:

AuraX 1/2

AuraY 0/3

Turn Undead 2/4

So I'm dynamically updating the charges (yeah, I know the dangers, I've worked past them by doing exception catches in the code). So I'm using trustme to make everything work, and the updating is sound. Now I need to know what updating is taking place (decrementing a charge, or incrementing a charge, for resetting essentially). Crazy idea huh?

This is the crazy code, without the listeners present, for a simple effect.

~ Generate our number of uses dependent on turn attempts remaining.
var current as number
trustme
current = hero.child[xTurning].field[hTotal].value - hero.child[xTurning].field[hUsed].value

~ Check for current uses on a selected ability.
field[hTotal].value = current + field[hUsed].value


~ Make sure the uses don't exceed totals.
if (field[hUsed].value > field[hTotal].value) then
field[hTotal].value = field[hUsed].value
endif

~ Determine uses of the turning ability.
if (<listener inc/dec>) then
hero.child[xTurning].field[hUsed].value += 1
~ or -1, depending on what listener returns.
endif

~ Make sure the uses don't exceed totals.
if (hero.child[xTurning].field[hUsed].value > hero.child[xTurning].field[hTotal].value) then
hero.child[xTurning].field[hUsed].value = hero.child[xTurning].field[hTotal].value
endif
Kendall-DM is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old February 23rd, 2011, 06:53 PM
It's hidden, but there's an hChildUsed field, which is used by the charges on a staff to apply however many times each individual spell has been used * the number of charges that spell uses, to the total number of charges spent on the overall staff.

Can you have your alternate thing be a separate special, with a separate tracker, and have it set the hChildUsed field of the main thing equal to its own hUsed * 2?

That way, the user will see two different specials, for auras X and Y. As each one of those is used, the total number of aura charges remaining will change with it.
Mathias is offline   #4 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old February 23rd, 2011, 07:04 PM
Yes, I have them as separate specials. I've tried something very similar to the hChildUsed, and the results kept putting charges on the Auras that weren't being used. No worries, this was just a wild idea I had, I just can't implement it without knowing whether I am decrementing or incrementing the charges used. With that hidden, well, I can't. It was a fancy idea, but I think I'm not going to work on it anymore when I have alot of other things to finish . Thanks for the help!
Kendall-DM is offline   #5 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:01 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.