TobyFox2002
Well-known member
I'm trying to deepen my knowledge of hero labs code and break into some of the more crazy aspects of the code.
So this is completely new territory for me hehe.
I am trying to create a custom ability with a chooser that references an element within a gizmo. I have found a way to grab the name of the specific entity that I want to grab, but I cannot find a way to use that in the custom expression.
What I want to do is have a dropdown that selects each settlement in the kingdom so I can make adjustments on buildings do in each settlement and a variety of other operations.
I can grab the name of each settlement and display it in the debug using a script but I cant figure out a way to use this to create a custom expression to create a custom ability which uses the Name of the Settlement for the choice rather than the name of the parent terrain type (which is the parent element the gizmo is attached to). Or the name of the settlement tag (either Settlement or Settlement Expansion)
Render/9000
Using the above code I can grab the name settlements and the id if the terrain but neither is very useful for creating a custom expression.

I am trying to create a custom ability with a chooser that references an element within a gizmo. I have found a way to grab the name of the specific entity that I want to grab, but I cannot find a way to use that in the custom expression.
What I want to do is have a dropdown that selects each settlement in the kingdom so I can make adjustments on buildings do in each settlement and a variety of other operations.
I can grab the name of each settlement and display it in the debug using a script but I cant figure out a way to use this to create a custom expression to create a custom ability which uses the Name of the Settlement for the choice rather than the name of the parent terrain type (which is the parent element the gizmo is attached to). Or the name of the settlement tag (either Settlement or Settlement Expansion)
Render/9000
Code:
~ Seach the Kingdom Hexes and find those with a settlement
foreach pick in hero from KingHex where "HexFeature.Settle"
debug "Settlement Names: " & eachpick.field[hxName].text
debug "Settlement IDSTRING: " & eachpick.idstring
debug "thingid." & eachpick.idstring & "|"
nexteach
Using the above code I can grab the name settlements and the id if the terrain but neither is very useful for creating a custom expression.