• 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

User activated AC Bonus

Cidiak

New member
I need the collective wisdom of the crowd. I am trying to create a racial ability that adds +1 to AC when an ally is next to the creature. I wanted to code this as a user activated ability, but for the life of me, I can't get the AC to change. This is the script:

if (field[actUser].value <> 0) then
hero.child[ArmorClass].field[Bonus].value += 1
endif

It works without the if/then wrap, but I can't workout how to get it to change on ticking the box in the In-Play tab.

Secondly, I have created a bunch of spell casters that when I select spells (via Racial spells tab), I get validation errors for too many spells, even if I just put in one spell.
 
This is the script:

Code:
if (field[actUser].value <> 0) then
hero.child[ArmorClass].field[Bonus].value += 1
endif

actUser is normally a user requested value that gets used if you have the Choose Amount of Activation? checkbox checked - it's the value that the user selects.

I think you want

Code:
if (field[[B]abilActive[/B]].value <> 0) then
hero.child[ArmorClass].field[Bonus].value += 1
endif

Secondly, I have created a bunch of spell casters that when I select spells (via Racial spells tab), I get validation errors for too many spells, even if I just put in one spell.

I'm not sure what you mean here. If you chose Spellcasting in the Spellcasting Helper button did you provide a caster level? I don't think it works without it.
 
dungeonguru thanks for the correct script, works beautifully.

Re Spellcasting. The issue has gone away. I have no idea why. Clearly the fear of your scrutiny caused it to behave. 😊


This is what I was going to say...

I'll rephrase. I've created a low level mage. I've set spellcaster helper to xSpellcast, caster level 4, intelligence attribute and wizard spell list.

When back in Herolab and I am creating the NPC, it generated Validation errors for too many spells or cantrips as soon as I select any spells in the Racial Spells tab
 
dungeonguru thanks for the correct script, works beautifully.

Re Spellcasting. The issue has gone away. I have no idea why. Clearly the fear of your scrutiny caused it to behave. 😊

Haha, not likely.

A word of advice I heard a long time ago from ShadowChemosh needs to be passed along from time to time. Using the Test Now button is not 100% bulletproof - there are times when bootstrapped "things" just don't load right and you just need to save your change, exit the editor and restart HL before you get a clean test.

The weird test results usually happen for me when I'm messing with adding class abilities, new classes, and definitely configurables or things that open up new tabs in the UI. I normally just reload HL after I get things to Test Now without any obvious errors and then reload before I trust my results.
 
Back
Top