• 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

Bootstrap Conitional

Mergon

Well-known member
I am currently trying to create a Class Ability.

This ability has a Custom expression that permits a selection of a necrotic cantrip from any class.

I have added all (2) necrotic cantrips to the Ability's bootstraps.

What I need is a condition for these bootstraps that checks to see if the selected cantrip matches the bootstrapped cantrip.

i.e.: The spChilTouc (Chill Touch) bootstrap needs to check and see if selected from the Custom Expression menu.

I've tried several ideas but Bootstrap conditionals are still giving me issues figuring out. :)
 
In an eval script running before the bootstrap condition, check to see which spell is selected, and then set a field value (like abValue) based on that. Then have the bootstrap condition check for the value of abValue.
 
In an eval script running before the bootstrap condition, check to see which spell is selected, and then set a field value (like abValue) based on that. Then have the bootstrap condition check for the value of abValue.

That is so simple, and makes so much sense, that I am ashamed I didn't think of it. I always look at the most complicated way of doign something first . . . :eek:
 
Now I have a different problem related to the same issue.

On the bootstraps I added a conditional 'fieldval:abValue5 = #' where # is based on the number of cantrips I have available (2 currently, so the first is 1 and the 2nd is 2).
Phase: First, Priority: 2500.

I have an Eval Script which sets abValue5 to an integer based on which spell I select via the menu.

This works to the point it sets abValue5 to 1 for Chill Touch and 2 for Spare the Dying when I check the fields on the ability.

I've tried a variety of Phases and timings, but the bootstrap never becomes active . . .
 
You left out the phase & priority of your eval script. Seeing that eval script would also be best.
 
Phase: Post-levels, Priority: 2499


doneif (tagis[Helper.ShowSpec] = 0)

doneif (tagis[Helper.Disable] <> 0)

perform field[usrChosen1].chosen.pulltags[thingid.?]
if (field[usrChosen1].chosen.tagis[thingid.spChilTouc] <> 0) then
field[abValue5].value = 1
endif

if (field[usrChosen1].chosen.tagis[thingid.sp5CSpareD] <> 0) then
field[abValue5].value = 2
endif

I'm still playing with Phases and Priorities on the Eval script . . .

I'm probably doing something stupidly simple wrong. :)
 
Btw, the abValue5 is showing up on the Show Debug Fields when I select a cantrip.

Also, the cantrip activates fine if I remove the conditional.

Something interesting; if I remove the eval script and set the abValue5 manually, on the ability, the bootstrap appropriate to the abValue5 becomes active. :/
 
Last edited:
Helper.ShowSpec won't be added until Post-Levels/300 or so, meaning this script will always exit at the first line if you're running it early.

Also, why pull the thingid tag, and then look it up on the chooser, not on the pick? You're looking for the tag in its original location, not the location you just pulled it to, so what's the pulltags intended to do?

Also, never move thingid tags anywhere. thingid means "this is what we are", so you never want to change them or copy them (like pulling the ones from another pick, which creates a copy).
 
The pull thingid was a leftover from a previous method I was try. I removed it sicne I posted . . .
 
Is this a class ability which is gained at higher than 1st level? If so, it's good that you are checking for ShowSpec, since that indicates you are high enough level to get the bootstrap activated. Unfortunately, as Mathias says, you can't rely on ShowSpec when messing around with bootstrap conditions, because ShowSpec is assigned in early Post Levels, and bootstrap conditions have to execute in early First. So, there is a workaround I sometimes use.

The Class Level field on the actual class helper (cTotalLev) is set way earlier than the Class Level fields on Custom Abilities (xTotalLev) and Class Abilities (xAllLev). So, first call the "foctoclass" procedure, which navigates from a class special to the class helper it is associated with, and sets the focus to that class helper. Then, instead of looking for Helper.ShowSpec, compare the value of cTotalLev to the tag value of the ClSpecWhen tag on this class special.

For example, say you have your bootstrap conditions at First 500, add the following eval script:

First 400
Code:
call foctoclass

doneif (state.isfocus = 0)

doneif (focus.field[cTotalLev].value < tagvalue[ClSpecWhen.?])

doneif (tagis[Helper.Disable] <> 0)

if (field[usrChosen1].chosen.tagis[thingid.spChilTouc] <> 0) then
  field[abValue5].value = 1
  endif

if (field[usrChosen1].chosen.tagis[thingid.sp5CSpareD] <> 0) then
  field[abValue5].value = 2
  endif
 
Just sat back down and saw this. I immediately had to try it. Unfortunately I get the followign error:

Hero Lab was forced to stop compilation after the following errors were detected:

'eval' script for Thing 'cClrReaper' (Eval Script '#1') calls a non-existent procedure for the active script context

'call foctoclass' may not exist in 5e Community pack . . .

It might be something we want to add mind you. :)
 
Well, damn. I hadn't realized we split off the 5e branch that long ago. I feel like I've been using foctoclass forever. Alright, here is the content of the procedure, and I'll make sure to set the procedure up in the core program for 5e before next release.

foctoclass procedure
Code:
      doneif (isroot = 0)

      if (root.tagis[component.Class] <> 0) then
        perform root.setfocus
      elseif (root.tagis[component.Configure] <> 0) then
        perform root.setfocus
      else
        if (root.islinkage[table] <> 0) then
          perform root.linkage[table].setfocus
        elseif (root.islinkage[varies] <> 0) then
          perform root.linkage[varies].setfocus
          endif
        endif

    doneif (state.isfocus = 0)

    ~ We could also be in a table on a configureable, so stop if that is where
    ~ we are.
    doneif (focus.tagis[component.Configure] <> 0)
 
Took me a while to figure out how to set up the procedure but I finally figured it out. Now the Death Doman abilities all work.

Debating on putting the .user file on GIT. Should I wait until you implement the foctoclass procedure in to the 5e Core?

Thanks all for all the help.
 
Debating on putting the .user file on GIT. Should I wait until you implement the foctoclass procedure in to the 5e Core?
Yes you would have to wait. Until then we could add a community version or simply add the logic above directly into the class script and don't make a procedure. Then when the procedure is out update the scripts to use foctoclass. In that case I simply use a a mod mark of "TODO" in the script allow me or anyone to do a grep search across the files to see what need to be done.

But if you add it to GitHub and I pull down I will have HL fall into safe mode and load NO .user files.
 
ShadowChemosh:

I kind of thought there might be issues. :)

For my own scripts it works fine and I can change things when I get a conflict error when it is added to the Core :)
 
ShadowChemosh:

I kind of thought there might be issues. :)

For my own scripts it works fine and I can change things when I get a conflict error when it is added to the Core :)
Honestly if it was me I would add the procedure foctoclass as "5Cfoctocls". Then once I saw foctoclass released officially do a simple "find/replace" grep of 5Cfoctocls to foctoclass. Or could even have F5foctocls call foctoclass and not change anything. Leaving the door open to do any Community Specific logic if we want.

But hey that's me. :)
 
I'm learning more about Hero Lab scripting now than when I was running Pathfinder; and I did a lot of scripting for stuff I added then.
 
Back
Top