View Single Post
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,730

Old December 16th, 2016, 09:52 AM
Originally Posted by Minous View Post
I've been digging around both the almost non-existent documentation and random forum posts, Im drowning here. HL uses its own proprietary language that isnt quickly learned, and is confusing as hell to a programmer.
So I agree mostly with what your finding here about HL scripting. On the other hand you are dealing with Gizmo's which is REALLY hard place to do scripting. You didn't just jump into the deep end of HL scripting you went in with rocks on your feat and sharks in the water.

Overall you are actually doing really well.

The issue above is transitioning to the correct Pick in HL. Transitioning means to have a pointer to the correct location or the correct Xpath if you are use to XML.

In an XML structure:
So for the above if I wanted to reference Part Description I would have "transition" down the Xpath to it. Like so:

This concept works exactly the same in HL which is built on XML tech:
Top Level Container (Hero)
-Picks live on the Hero (child)
--A feat on the character (fDodge)
---Fields on fDodge
---Tags on fDodge
--A weapon on the character (wLongsword)
---Fields on wLongsword
---Tags on wLongsword
--A Magic Weapon (gizmo)
---Longsword Pick (wLongsword)
Based on the above if I wanted to access the non-magical longsword I would do this:
If in a script you have "just" a field name:
HL adds in the transition logic "This" for you meaning you are getting the field from the Pick you are actually on.
The last thought is "eachpick" which means a generic pointer name that transitions to the Pick that the foreach loop grabbed.

And finally we have "setfocus" which is another generic pointer that is used to place a memory pointer at a single specific Pick. From the HL example above I could say "setfocus" to the fDodge feat. Once I have set that pointer I can access any "field" or "tag" on the fDodge feat by using the "focus" keyword which has all the "transition" logic built in from the setfocus.
~ Set pointer
perform hero.child[fDodge].setfocus
~ Did the pointer actually set to the fDodge fea?
doneif (state.isfocus = 0) 

~ Increase the abValue field on the fDodge feat by 1
focus.field[abValue].value += 1

~ Set the disable feat tag on to fDodge
perform focus.assign[Helper.ftDisable]
So now based on all the above can you see what is wrong here? Is "state" anything I have listed above for transitioning? Is "field[actName]" not a complete transition?

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.
ShadowChemosh is offline   #17 Reply With Quote