• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Is it possible to ...

vrimage

Member
Greetings.

I am trying to set up a Spell Point system in Hero Lab (based on the old AD&D Player's Option system)
I am trying to make this as dynamic as possible, hoping for compatibility with custom classes etc. Though most of my issues I have found way's around, some questions about the capabilities of Hero Lab's scripting engine have arisen. :cool:

Can you define a new custom variable and place it in a container, (hero container)?

Is it possible to add objects to the ui using scripts only (text to a tab, tracked resource, etc)

Does a switch statement exist?

Can you access things using id from a variable (ex. id="abValue" & 2; debug field[id])


Thanks
 
Can you define a new custom variable and place it in a container, (hero container)?
You can not modify the Hero container or hero fields. You could make new Things and bootstrap them to a mechanic to get them to be attached to all heroes. That would be the easy way to get new fields that can be manupulated on each character.

Is it possible to add objects to the ui using scripts only (text to a tab, tracked resource, etc)
For the most part "no". You could affect livename of Picks which will get displayed. In example if a tracker was on the In-Play tab you could change its Livename field to display something different.

But 99% of the UI in HL is not changeable in a way to make your own tabs.

Does a switch statement exist?
No.

Can you access things using id from a variable (ex. id="abValue" & 2; debug field[id])
I am not 100% following your question. But yes any 'field' on a Pick can be accessed via a script.

So abValue is usually accessed like:
Code:
hero.child[fDodge].field[abValue].value += 2

You can also use a macro:
Code:
#value[fDodge] += 2
 
Last edited:
I am not 100% following your question. But yes any 'field' on a Pick can be accessed via a script.

So abValue is usually accessed like:
Code:
hero.child[fDodge].field[abValue].value += 2

You can also use a macro:
Code:
#value[fDodge] += 2

Thank you so much for your answer. Let me clarify the last question:

Let's say I have a loop going from 2 to four.
To access the different abValues I would check the iteration
Code:
if (i=2) then
hero.child[fDodge].field[abValue2].value += 2
endif
etc...

But if I could use .field[abValue&i] (to get the number part of the field name), then I could save some ifs

Thank you
 
No, field[] must be given the Id of a known field, and cannot use variables.

Thought as much :p

One last question (for now)

How would I go about adding an ability a number of times equal to the number of spellcasting classes present.

Thanks
 
You'd need an appropriate number of bootstraps, each with a slightly different conditional expression, that will make that copy go live at the right level (and above).
 
Back
Top