• 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

Trying to make Warlock class in Herolab..

Pezmerga

Well-known member
Ok I have a little bit of a problem...I am trying to implement the Warlocks Energy Resistance into Herolab for the class. But there are several things I cannot figure out how to implement. I am very new to this, so I apologize if this is a confusing question, and if my code is just ugly! lol

First, The custom warlock I made has energy resist to two types at
5th level equal to 5, then at 10th level this increases to 10 for both., then 15 at 15, and 20 at 20... under the Class Abilities Tab while viewing a character Portfolio (in this case the "warlock" tab) I want this to show up at each level with the resistance it granted at that level and not give you the option to keep choosing 2 more resistances... Even though choosing different ones does nothing to the "Special" tab, or change the character sheets resistances, It is still kinda hokey.

is my only option for the first thing to make another ability, give it same code, and take out the code for the selection boxes? maybe just Have it say Energy Resistance 10 at level 10? or is there a way for it to check what was selected at level 5 (lets say it was fire and cold) and list those as Energy Resistance 10: Fire, Cold.

Second, How do I make sure someone doesn't choose the same resistance twice? Ill show code in below...Im not quite sure how to write it out.

If this is confusing I can email my user database. just make a level 10 warlock and you will see what i mean.

Here is my eval scripts code...

I modified the Inquisitors Resistance Judgement code...lol Best thing I could find as a basis..

Phase- Post Levels, Priority- 10,000, Index-1
Code:
var bonus as number
var level as number
var resist as number
bonus = field[xIndex].value * 5
level = field[xAllLev].value
if (level < 10) then
resist = 5
elseif (level >= 10) then
if (level < 15) then
resist = 10
elseif (level >= 15) then
if (level < 20) then
resist = 15
elseif (level = 20) then
resist = 20
endif
endif
endif

field[abValue].value += (round(field[xAllLev].value / 5,0,-1)) * 5

field[listname].text = field[thingname].text & " " & resist

field[livename].text ="Energy Resistance" & " " & field[abValue].value


~apply the bonus to the correct energy type
if (compare(field[usrChosen1].chosen.idstring,"selEnAcid") = 0) then
#applyresist[xDamRsAcid,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnCold") = 0) then
#applyresist[xDamRsCold,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnElec") = 0) then
#applyresist[xDamRsElec,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnFire") = 0) then
#applyresist[xDamRsFire,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnSoni") = 0) then
#applyresist[xDamRsSoni,field[abValue].value]
endif

Phase - Post-Levels, Priority - 5000, Index- 2
field[usrCandid1].text = "component.SelectHelp & Selection.Energy"
field[usrCandid2].text = "component.SelectHelp & Selection.Energy"
 
Last edited:
Ok I figured out that
field[usrCandid1].text = "component.SelectHelp & Selection.Energy"
field[usrCandid2].text = "component.SelectHelp & Selection.Energy"

Is what gives the user the selection options. Now I just need to figure out how to hide these at level 10 when the improved resistances are displayed on the "warlock" tab, and how to make the second one either not display what was chosen in the first box, or show an error if they are both the same.

Somthing like
if field[usrCandid1].text = field[usrCandid2].text then
etc. etc.not really sure what syntax to use. Im gonna look for something similar, but I can't think of an ability or class feature that would be similar at the moment.
 
As for the displaying 5 at 5 and 10 at 10 for the resist values in the class tabs, I think I got that figured out.
var resist as number

field[abValue].value += field[xCount].value
resist = field[xIndex].value * 5
~Displays information in the Class tab
field[listname].text = "Energy Resistance " & resist
~Displays info in the Special tab
field[livename].text ="Energy Resistance" & " " & resist


~apply the bonus to the correct energy type
if (compare(field[usrChosen1].chosen.idstring,"selEnAcid") = 0) then
#applyresist[xDamRsAcid,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnCold") = 0) then
#applyresist[xDamRsCold,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnElec") = 0) then
#applyresist[xDamRsElec,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnFire") = 0) then
#applyresist[xDamRsFire,field[abValue].value]
elseif (compare(field[usrChosen1].chosen.idstring,"selEnSoni") = 0) then
#applyresist[xDamRsSoni,field[abValue].value]
endif


Also the other problem is halfway fixed...

~only run the rest for the first copy
doneif (tagis[Helper.FirstCopy] = 0)
field[usrCandid1].text = "component.SelectHelp & Selection.Energy"
field[usrCandid2].text = "component.SelectHelp & Selection.Energy"

I shoulda figured this out sooner! lol this one prevented the selection tabs for the energy resistances on later levels.

Now I just need to somehow figure out how to make sure both selections cannot be the same. Even though they dont add, it would be nice to eliminate that possibility.
 
Last edited:
Simpler than setting the usrCandid fields in the script is to find the "Select From" and "Second Selection From" options in the editor - select "Energy Type" or "Energy Type - Base 4" in those lists.

You were pretty close to figuring this out, so great work. Here's how I'd refine that script:

Put this in an Eval Rule, instead of an Eval Script, so that you can run the test to make sure the same thing wasn't chosen as part of it:

Phase: Post-Levels, Priority: 10000
message: "Same energy type selected twice"

Code:
var resist as number
resist = field[xIndex].value * 5
field[listname].text = field[thingname].text & " " & resist
 
~if we're not shown yet, just get out now
validif (tagis[Helper.ShowSpec] = 0)
 
~if we're not the first copy, we don't show a selection, then get out
if (tagis[Helper.FirstCopy] = 0) then
  field[usrCandid1].text = ""
  field[usrCandid2].text = ""
  @valid = 1
  done
  endif
 
~we apply a resistance of 5 times our copy count
field[abValue].value += 5 * field[xCount].value
 
field[livename].text = field[thingname].text & " " & field[abValue].value
 
if (field[usrChosen1].ischosen <> 0) then
  if (field[usrChosen1].tagis[BloodEner.Acid] <> 0) then
    #applyresist[xDamRsAcid, field[abValue].value
  elseif
  elseif
  elseif
  elseif
    endif
  endif
 
if (field[usrChosen2].ischosen <> 0) then
  if (field[usrChosen2].tagis[BloodEner.Acid] <> 0) then
    #applyresist[xDamRsAcid, field[abValue].value
  elseif
  elseif
  elseif
  elseif
    endif
  endif
 
~make sure the same thing wasn't chosen for both selections
validif (field[usrChosen1].uniqindex <> field[usrChosen2].uniqindex)

Then make sure your class is assigning copies of this class special at levels 5, 10, 15, and 20.

Obviously, I didn't finish writing out the various energies. The BloodEner tags you're looking for are:

BloodEner.Acid
BloodEner.Cold
BloodEner.Elec
BloodEner.Fire
BloodEner.Sonic
 
Simpler than setting the usrCandid fields in the script is to find the "Select From" and "Second Selection From" options in the editor - select "Energy Type" or "Energy Type - Base 4" in those lists.

You were pretty close to figuring this out, so great work. Here's how I'd refine that script:

Put this in an Eval Rule, instead of an Eval Script, so that you can run the test to make sure the same thing wasn't chosen as part of it:

Phase: Post-Levels, Priority: 10000
message: "Same energy type selected twice"

Code:
var resist as number
resist = field[xIndex].value * 5
field[listname].text = field[thingname].text & " " & resist
 
~if we're not shown yet, just get out now
validif (tagis[Helper.ShowSpec] = 0)
 
~if we're not the first copy, we don't show a selection, then get out
if (tagis[Helper.FirstCopy] = 0) then
  field[usrCandid1].text = ""
  field[usrCandid2].text = ""
  @valid = 1
  done
  endif
 
~we apply a resistance of 5 times our copy count
field[abValue].value += 5 * field[xCount].value
 
field[livename].text = field[thingname].text & " " & field[abValue].value
 
if (field[usrChosen1].ischosen <> 0) then
  if (field[usrChosen1].tagis[BloodEner.Acid] <> 0) then
    #applyresist[xDamRsAcid, field[abValue].value
  elseif
  elseif
  elseif
  elseif
    endif
  endif
 
if (field[usrChosen2].ischosen <> 0) then
  if (field[usrChosen2].tagis[BloodEner.Acid] <> 0) then
    #applyresist[xDamRsAcid, field[abValue].value
  elseif
  elseif
  elseif
  elseif
    endif
  endif
 
~make sure the same thing wasn't chosen for both selections
validif (field[usrChosen1].uniqindex <> field[usrChosen2].uniqindex)

Then make sure your class is assigning copies of this class special at levels 5, 10, 15, and 20.

Obviously, I didn't finish writing out the various energies. The BloodEner tags you're looking for are:

BloodEner.Acid
BloodEner.Cold
BloodEner.Elec
BloodEner.Fire
BloodEner.Sonic

Thanks will try this out!

Edit: took out eval script and put it in as an eval rules

got this : Syntax error, invalid use of reserved word on line 22...
Which I believe is this line
if (field[usrChosen1].tagis[BloodEner.Acid] <> 0) then

also
validif (field[usrChosen1].uniqindex <> field[usrChosen2].uniqindex)
is causing a syntax error.

Any ideas?
 
Last edited:
oops, field[usrChosen1].chosen.tagis[BloodEner.Acid]

and

field[usrChosen1].chosen.uniqindex

Sorry, typing too fast.
 
Hey not a problem! Thanks for the help, it is much appreciated.

Although if I do use the item selections in the editor it allows the drop down boxes in the later levels in the class tab. but i just used this code and deselected the item selections and it works fine.
~only run the rest for the first copy
doneif (tagis[Helper.FirstCopy] = 0)
field[usrCandid1].text = "component.SelectHelp & Selection.Energy"
field[usrCandid2].text = "component.SelectHelp & Selection.Energy"
 
Last edited:
Are the copies that are offering a selection the ones that are not available yet?

If you add all 20 levels, I think the selections will go away.

Swap the order of the test for FirstCopy and the test for ShowSpec - if this copy isn't the first one, you want it to not show the selectors. If it is the first copy, then you can ask the question of whether it's reached the correct level, but currently, I have it exiting the script without clearing the selections if it hasn't reached the correct level.

Could you copy exactly what's being displayed as the name? I can't tell what exactly is happening yet.
 
Are the copies that are offering a selection the ones that are not available yet?

If you add all 20 levels, I think the selections will go away.

Swap the order of the test for FirstCopy and the test for ShowSpec - if this copy isn't the first one, you want it to not show the selectors. If it is the first copy, then you can ask the question of whether it's reached the correct level, but currently, I have it exiting the script without clearing the selections if it hasn't reached the correct level.

Could you copy exactly what's being displayed as the name? I can't tell what exactly is happening yet.

Switching those two worked

Also the display is fine now. I had the user text enabled and I guess that somehow caused the "????"
 
If I wanted to make a drop down box for someone to select a saving throw with "field[usrCandid1].text = "component.SelectHelp & Selection."
What would the id be that i need? Energy is simple enough, but I tried Saves and that doesnt work. It also doesnt list Saves in the Item selection area in the editor.

I am trying to implement Dark One's Own Luck and it gives you a save bonus equal to your charisma modifier to one save for 24 hours (not exceeding your class level). So when i Activate it I need a drop down box to select one save. Is this one a bit beyone the skope of a custom ability? I know the judgements all have seperate class specials and they are a little bit similar.
 
Code:
component.BaseSave
(Oh, and you can just enter that in the "Custom Expression" option just under "Select From", rather than specifying it as part of the script).

In the script, you can then access the save directly, without having to worry about checking tags or names:


Code:
~if we're not shown yet, just get out now
doneif (tagis[Helper.ShowSpec] = 0)
 
~if we're not the first copy, just get out now
doneif (tagis[Helper.FirstCopy] = 0)
 
field[abValue].value += #attrmod[aCHA]
 
field[livename].text = field[thingname].text & " (" & signed(field[abValue].value & ")"
 
~if nothing's been selected, there's nothing we can do
doneif (field[usrChosen1].ischosen = 0)
 
field[usrChosen1].chosen.field[Bonus].value += field[abValue].value
 
Code:
component.BaseSave
(Oh, and you can just enter that in the "Custom Expression" option just under "Select From", rather than specifying it as part of the script).

In the script, you can then access the save directly, without having to worry about checking tags or names:


Code:
~if we're not shown yet, just get out now
doneif (tagis[Helper.ShowSpec] = 0)
 
~if we're not the first copy, just get out now
doneif (tagis[Helper.FirstCopy] = 0)
 
field[abValue].value += #attrmod[aCHA]
 
field[livename].text = field[thingname].text & " (" & signed(field[abValue].value & ")"
 
~if nothing's been selected, there's nothing we can do
doneif (field[usrChosen1].ischosen = 0)
 
field[usrChosen1].chosen.field[Bonus].value += field[abValue].value

hmm the only problem is that the selector box wants to show up in the "class tab" and not the "in play tab". Is there a way to get it to show in the "in play tab" only? basically only one save bonus can be applied at once, sort of like a judgement or something for the inquisitor. And it can be changed at will, so clicking back between tabs seems counter-intuitive. Im thinking maybe having 3 options in the in play tab under activated abilities would work, which is how the judgements work, but that seems cluttery for just one spell like ability (not like its a class feature).Thanks for all the help, and sorry If I am being a nuisance with my questions! :)

edit: I see the Activation #2 box, but no third one so that wont work either since I need 3 save choices.
 
Last edited:
Ok I have Dark One's Own Luck as a Custom Ability. It reads...
You are favored by the dark powers if you have this invocation. You gain a luck bonus equal to your Charisma bonus (if any) on Fortitude saves, Reflex saves, or Will saves (your choice each time you use this ability) for a period of 24 hours. You can’t apply this ability to two different save types at the same time. This bonus can never exceed your class level.

The only real solution I can think of is to Make a Class Special for each of the Saves and have those granted by the Custom ability, but how would I Validate that only one was active at a time? I know the Judgements are somewhat Similar, but they are all Class Specials. Maybe Make Dark One's Own Luck point (Custom Ability) to another Dark One's Own Luck (Class Special) and set it up like the Judgements?
 
Why not use a Custom Ability instead with an Count of only 1. Then they will be able to select only one of Three Custom abilities. Those three abilities each will be tied to a single save type. Its easy to change and the edit checking is built in as you have it set to only allow one Custom Ability.
 
Why not use a Custom Ability instead with an Count of only 1. Then they will be able to select only one of Three Custom abilities. Those three abilities each will be tied to a single save type. Its easy to change and the edit checking is built in as you have it set to only allow one Custom Ability.

I tried what I stated above and it seems to work well, since it is an at will that can change the save boosted anytime.

Only thing Id like to do now is make Ability Focus work with the Warlocks Invocations and Eldritch Blast.

Im gonna post the updated Class in User data in a minute. I also fixed Charm, I had it as a Least invocation.
 
Is there a way to hide abilities in the Class tab? Not that its a huge deal but the way I did Dark One's own luck shows up like this if you select the invocation.

1 Dark One's Own Luck
1 Dark One's Own Luck - Fortitude
1 Dark One's Own Luck - Reflex
1 Dark One's Own Luck - Will
1 Eldritch Blast - 1d6
etc.

It's not a huge deal but it would be nice to hide the individual saves that are tied to the master ability.

Oh and I thought of one more thing....How would I designate a bonus to the saves as a "Luck" bonus? For stacking issues that probably won't come up often , but still :).

Heres the code for the reflex option for Dark Own's own luck.

Code:
field[abValue].value = #attrmod[aCHA]

if (field[abValue].value > #levelcount[Warlock]) then
field[abValue].value = #levelcount[Warlock]
endif

field[livename].text = field[thingname].text & " (" & signed(field[abValue].value) & ")"


~only run the rest if we're activated
doneif (field[abilActive].value = 0)

hero.child[svRef].field[Bonus].value += field[abValue].value

~if we're active, tell that to the hero, so we can enforce the
~restriction on the number of save bonuses active at once

perform forward[Custom.DarkLuck]
 
Last edited:
Back
Top