• 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

Half-way done with custom class

Bob G

Well-known member
Hi everyone, thanks to the invaluable help of the editor community, I have been able to fix about half of my bug list for my custom class on my own. It was a lot of trial and error, but I eventually arrived at a solution, and I did many happy dances. :D

But that still leaves 9 bugs in the class that I am at a loss on how to correct (or in some cases, even how to script). 'If' statements worked out okay for me, but foreach statements are still not sinking in.

If I could humbly ask for the communities help (and guidance) on how to fix these, I will gratefully share my work with any who want a copy. I can't promise elegant code, but it will hopefully work...

Thanks everyone!
 
Bug #1:

I want to code an ability that grants a +1 competence bonus to AC and saving throws to any creature that the character uses as a mount. I recognize that mounts fall into the gizmo category, but if a mount is not added to the character, I get error messages. Any ideas on how to make the bonus conditional based on whether a mount is added or not?

Gracias!
 
On the conditions tab there is a "mounted" condition, which points at any creature the hero is currently riding. You can transition from there to the other hero and make changes as necessary. Here is an example, from the Cavalier's Mounted Mastery ability:

Code:
      ~ get the strength bonus of our current mount
      if (hero.child[pstMounted].field[pMount].ischosen <> 0) then
        field[abValue3].value += hero.child[pstMounted].field[pMount].chosen.minion.child[aSTR].field[aModBonus].value
        endif
 
On the conditions tab there is a "mounted" condition, which points at any creature the hero is currently riding. You can transition from there to the other hero and make changes as necessary. Here is an example, from the Cavalier's Mounted Mastery ability:

Code:
      ~ get the strength bonus of our current mount
      if (hero.child[pstMounted].field[pMount].ischosen <> 0) then
        field[abValue3].value += hero.child[pstMounted].field[pMount].chosen.minion.child[aSTR].field[aModBonus].value
        endif

Okay, that gets me most of the way. The code I'm using is:
Code:
~ Calculate bonus
field[abValue2].value += round(field[xTotalLev].value / 4, 0, -1) + 1

~ Add AC bonus to mount if hero is mounted.
      if (hero.child[pstMounted].field[pMount].ischosen <> 0) then
        hero.child[pstMounted].field[pMount].chosen.minion.child[ArmorClass].field[BonComp].value += field[abValue2].value
        endif
The editor has no problems with the script, and the bonus is being recognized (when I look at the Armor Class breakdown, I see the competence bonus), but the actual armor class of the minion isn't changed.
 
Well, timing is the first thing that comes to mind. When are you running the script?

Also, mind your bonus types and stacking.
 
AAARRRGGGGHHHH!!!! I hate when I forget to check the timing. Changing it from Final/15000 to Post-Attributes/11000 did the trick. Thanks for the millionth save, Aaron!
 
Bug #2

Onward and upward!

Next issue:
Class special ability grants the Amateur Gunslinger feat, and creates a Grit pool with a maximum grit point total of 1+INT modifier.

I copied the Amateur Gunslinger feat, changed it so that INT is the attribute modifier, and the Amateur Gunslinger tab appeared, along with all Deeds that qualify as per the feat.

I then thought that maybe I needed to copy the Grit ability so that I could change the trkMax field. Did that, changed the attribute modifier to INT, set trkMax to aINT value, but grit is still tracking based on WIS instead of INT.

The code I am using is:
Code:
hero.child[trkGrit].field[trkMax].value += hero.child[aINT].field[aBonus].value

field[abText].text = hero.childfound[trkGrit].field[trkMax].value

What is causing the script to still look at WIS for trkMax?

Shalom.
 
Grit is a bit special because there are several pools which combine with it (luck and panache), so there are a series of Helper tags which govern how it works. You can copy trkGrit to see how it is calculating charges and based on what. Or take a look at the Holy Grit class ability, which switches grit to be based on Charisma.
 
Grit is a bit special because there are several pools which combine with it (luck and panache), so there are a series of Helper tags which govern how it works. You can copy trkGrit to see how it is calculating charges and based on what. Or take a look at the Holy Grit class ability, which switches grit to be based on Charisma.

Couldn't figure this one out. I tried using Holy Grit as a model, but I saw nothing in the eval script that referenced CHA and any tracker tags.
 
It's in the Helper Tags on the Bootstrap trkGrit: GrtUseCHA

That helped, thanks! I got it to work by adding the bootstrap tag Helper.GritUseINT when I bootstrapped trkGrit from the Amateur Gunslinger feat. This is now working as intended.
 
Bug #3

Knocked off 12 out of 18 bugs, almost done!:)

Number 3 involves a class special that, when activated, grants DR 2/-.

First, I bootstrapped xDamRed to the ability, made a bootstrap field abSumm with an 'assign' value of "DR " & DamRed & " /-". I also added the bootstrap tags HasAbility.xDamRd, Ability.xDamRd, ActiveList.xDamRd, DescInfo.xDamRd, Activated.xDamRd, SpecType.DR and thingid.xDamRd.

My eval script was next:
(Post Attributes, 10000)
Code:
~ if we're not activated, just get out now
      doneif (field[abilActive].value = 0)

      var DamRed as number
      DamRed = round(field[xTotalLev].value / 4, 0, -1) -1

~Grant damage reduction 
      #applydr[xDamRd,DamRed]

~Change description to reflect scaling
      field[CustDesc].text = "Gain DR " & DamRed & " /-"
      field[abSumm].text = "Gain DR " & DamRed & " /-"
      field[alistName].text = "Gain DR " & DamRed & " /-"
There doesn't seem to be any problem with the code, but I want "DR" plus the value to appear on the specials tab. What I've done so far hasn't worked.
 
Well, I am a little unclear on the issue. Are you saying:

A) I want this special which can be activated to show up on the specials tab always, but it isn't showing.

or

B) I activated this special, and I expected to see Damage Reduction to appear on the specials tab, but it didn't show.

If A), what sort of ability is this, class special or custom special ability? Check that they don't have the Helper.SpecUp tag and that they have Helper.ShowSpec (if a class special).

If B), add a debug to make sure that your script is getting past the activation stop and check the value of your variable is calculated as higher than 1.
 
Wait, do you have damage resistance showing up as a separate ability on the special tab, along with this change in the name of this ability?

All DeltaMasterMind's suggestion is doing is changing the display of this ability - it has nothing to do with really adding damage reduction.
 
Bug #4

Bug #4 involves an ability that grants Fast Healing, but only if the hero's current hit points are lower than 50% of his total hit points.

I believe that the 'tagis[Helper.SpcDisable]' should be applied if the test condition is false, so at least I have something figured out. What I can't seem to find are where current hit points are located. I think I found total hit points in container.child[Totals].field[tHP].value, but I'm not sure if that's the right field or not.

Where do I find the fields for current and total hit points so I can write my test condition?
 
Bug #5

Hopefully this is a simple one. I want a class ability to change the action economy of a previous class ability from a standard action to a swift action.

I can see that the ability to be modified has a tag of abAction.Standard. I'm guessing I want to disable this tag and add a new tag of abAction.Swift. I'm just not sure how to do it. I looked through the tutorials, but couldn't locate anything.

Thanks!
 
Hopefully this is a simple one. I want a class ability to change the action economy of a previous class ability from a standard action to a swift action.

I'm sure there are feats or another class's ability which will do this.
 
I found the "tagreplace" command, but I'm still getting the syntax wrong. The pick is cBLoMedic1, and I want to replace the tag "abAction.Standard" with "abAction.Swift"

Code:
hero.child[cBLoMedic1].tagreplace[abAction.Standard,abAction.Swift]

This produces an error parsing the script. I get the feeling I'm not pointing to the right 'child', but can't for the life of me figure out what it is.
 
Back
Top