Junior Member
Join Date: May 2015
Posts: 14
|
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. 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 |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Quote:
But 99% of the UI in HL is not changeable in a way to make your own tabs. No. Quote:
So abValue is usually accessed like: Code:
hero.child[fDodge].field[abValue].value += 2 Code:
#value[fDodge] += 2 Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. Last edited by ShadowChemosh; May 1st, 2017 at 10:16 AM. |
|||
#2 |
Junior Member
Join Date: May 2015
Posts: 14
|
Quote:
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 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 |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
No, field[] must be given the Id of a known field, and cannot use variables.
|
#4 |
Junior Member
Join Date: May 2015
Posts: 14
|
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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).
|
#6 |
|
|