• 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

Ability with Variable + Calculated Value

blzbob

Well-known member
I need this calculation to show up in the Specials tab.

For each day spend transmuting material, the alchemist creates a volume of the material with a value in silver pieces of 1d20 + the alchemist level + the alchemist’s Intelligence modifier.

I simply want it to say 1d20 +[calculated value] sp/day.

I tried to do the Automatic Calculations but that shows a flat value instead of the 1d20+ part that I want. I also can't create a custom tag that says "sp/day." I found one for GP but not for SP and I can't use the "/" in my new tag.

Any suggestions?
 
Post-Attributes/10000
Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ If we've been Disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

~ Calc bonus of level + Intelligence modifier
field[trkMax].value += field[xTotalLev].value + #attrmod[aINT]
~ Set live name to be 1d20+Bonus sp/day
field[livename].text = field[name].text & " d20" & signed(field[trkMax].value) & " sp/day"

Add the above script and remove any tags or check boxes for auto-calculating stuff.
 
So as I said, that worked beautifully. I didn't think about two discoveries that would have an impact on this. Here they are:

=================
Noble Metamorphosis:
The alchemist has discovered one of the secrets of easier, and more profitable, metamorphosis. When using base metamorphosis, the alchemist creates a volume of material with a value equal to double his class level + his Intelligence modifier in sp each day. An alchemist must be at least 6th level before selecting this discovery.

So here's the code I am using:

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ If we've been Disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

~ Calc bonus of level + Intelligence modifier
field[trkMax].value += field[xTotalLev].value *2 + #attrmod[aINT]
~ Set live name to be 1d20+Bonus sp/day
field[livename].text = field[name].text & " d20" & signed(field[trkMax].value) & " sp/day"


=================
Royal Metamorphosis:
The alchemist has discovered all the secrets of easier, and more profitable, metamorphosis. When using base metamorphosis, the alchemist creates a volume of material with a value equal to five times his class level + his Intelligence modifier in sp each day. An alchemist must have noble metamorphosis and be at least 12th level before selecting this discovery.

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ If we've been Disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

~ Calc bonus of level + Intelligence modifier
field[trkMax].value += field[xTotalLev].value *5 + #attrmod[aINT]
~ Set live name to be 1d20+Bonus sp/day
field[livename].text = field[name].text & " d20" & signed(field[trkMax].value) & " sp/day"


Both are showing up exactly as they should but there is one problem. They should replace the previous ability. I tried to have it Append Reference Information but that doesn't seem to do what I thought it would. I thought it would replace the old ability with the new one.

So how do I go about having these replace the lower options?
 
I would recommend studying up on the tutorials. There's a very similar issue that's covered there. In the editor, select the Help menu, then "Help on Using the Editor". Then, follow the "Adding the Alchemist (Tutorial 7)" link, and then "Class Specials, part 4: poisoning and being poisoned". There, it discusses how to build a class ability that changes its name as the character gains levels in that class.
 
Thanks. I will check that out. Coincidentally this has to do with adding abilities to the alchemist.
 
Mathias, I think that tutorial is for class abilities, isn't it? I believe blzbob is adding new discoveries, which are custom class abilities, so each added ability is unique rather than being a new bootstrapped copy of the same class ability.
 
Blzbob, there are 2 ways to handle this I see. Have the custom class ability be a single thing added multiple times but have only 1 show and change it's livename appropriately (similarly to the deadly range rogue trick). The other way is a bit more simple, have 3 different abilities, and have each hide the previous one. That's the method I'd recommend below.

Say the unique Ids of your things are cAlcMeta1 (the first one), cAlcMeta2 (the second one) and cAlcMeta3 (the last one). Of course, just replace these unique IDs with your own.

cAlcMeta1 does not need any changes. On cAlcMeta2 add the following eval around post level 10000:

Code:
perform hero.childfound[cAlcMeta1].assign[Helper.SpecUp]
perform hero.childfound[cAlcMeta1].delete[User.Tracker]
hero.childfound[cAlcMeta1].field[trkMax].value = 0

Then on cAlcMeta3 add the same eval script, but tagetting cAlcMeta2 instead of cAlcMeta1
 
Thanks Aaron. I had only looked at the tutorial for about 15 minutes before I had to head out to work. I was hoping that I could spend more time with it after I got home to see if I was missing something. You are correct that these are new discoveries.

Mathias, I will need to go through that tutorial in more detail since I plan on entering some new classes so thanks for pointing it out. I will need it.

Aaron, that's precisely what I needed. That worked 100% perfectly. Now that I know how to do that, I think I can work on some other classes that have been befuddling me.
 
For some reason the first ability is working perfectly. When I just add the *2 modifier to the second one and the *5 modifier to the third one, they no longer add the Intelligence bonus.

So, why won't HL calculate this correctly for me?

If I can be shown why the first one isn't working I can fix the second one.

I want it to calculate calculate the twice the level plus the Intelligence modifier. Here's the script:

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ If we've been Disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

~ Calc bonus of level + Intelligence modifier
field[trkMax].value += field[xTotalLev].value*2 + #attrmod[aINT]
~ Set live name to be 1d20+Bonus sp/day
field[livename].text = field[name].text & " d20" & signed(field[trkMax].value) & " sp/day"
 
Nevermind. It was the timing. I'm not used to having to look at different timing for the same ability.
 
Back
Top