Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 13th, 2007, 11:05 AM
I am trying to work out an Eval script which will add "n" extra times per day, to the class abilites Rage and Smite.

I've looked at the Extra Turning feat script and I can figure out what it does,

hero.child[xTurning].field[hTotal].value += 4 (add 4 to Turning)

but how and where do I find the Syntax / Naming convention for the Rage and Smite abilities.

I've tried this

hero.child[xRage].field[hTotal].value += 2 Doesn't work!

hero.child[cBbnRage].field[hTotal].value += 2 Still doesn't work!!

Help again!! ops:

P.s

I know i'll ask this one later.

How would I make Damage Reduction a Pre-Requisite for a feat, and also increase the Damage Reduction figure, because of the new feat, by "+ n" each time a level gain increases the DR for example a 13th level Barbarian has DR 3/-, with the feat I propose it increases to DR 4/- then at 16th level it becomes 5/- instead of 4/-?
bodrin is offline   #1 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 13th, 2007, 12:29 PM
At 12:05 PM 7/13/2007, you wrote:
Quote:
I am trying to work out an Eval script which will add "n" extra times per day, to the class abilites Rage and Smite.

I've looked at the Extra Turning feat script and I can figure out what it does,

hero.child[xTurning].field[hTotal].value += 4 (add 4 to Turning)

but how and where do I find the Syntax / Naming convention for the Rage and Smite abilities.

I've tried this

hero.child[xRage].field[hTotal].value += 2 Doesn't work!

hero.child[cBbnRage].field[hTotal].value += 2 Still doesn't work!!
Colen is out of town for a little bit of R&R right now, and this is his area of expertise. I'll see what help I can provide, but I'm not sure if I'll be able to provide complete and accurate answers, so this may have to wait until Tuesday (when Colen returns). With that disclaimer established, here's my (potentially flawed) analysis....

Looking at the issue with Smite, there are multiple different "Smite" abilities in the data files. There is the "Smite Evil" of the Celestial template (and "half" flavor), the "Smite Good" of the Fiendish template (and "half" flavor), the "Smite Evil" of the Blackguard prestige class, and the "Smite Good" of the Paladin class. Each of these is currently distinct from one another, although, as I look at this in detail, it might be worthwhile to collapse the good/evil flavors of each type into one instance that is configured for good or evil. Is the "Smite" adjustment you want to perform applicable to all four of these flavors of Smite? Or just two of them?

If the feat can apply to the Celestial/Fiendish flavors, then you simply need to increment the counts for those two abilities. This would be done via the following lines of script:
*** hero.child[xFieSmite].field[hTotal].value += 2
*** hero.child[xCelSmite].field[hTotal].value += 2

For the Paladin and Blackguard abilities, there appears to be a niggly problem in the way the data files are setup. The count is initialized properly and the display text is setup in the same script. This means that any changes you make will not be shown properly in the text, but will in the tracking counter. The code you need for these two adjustments is:
*** hero.child[cPalSmite1].field[hTotal].value += 2
*** hero.child[cBlkSmite1].field[hTotal].value += 2

Making these changes, however, will display something along the lines of what's shown below.
*** Smite Good (1/day)** < 0/3 >

The value shown in the text is not modified correctly, but the usage tracker does show the correct value. We'll have to get this fixed.

The exact same bug in the data files exists for the Barbarian Rage ability. The displayed text is setup at the time the value is initialized, so any subsequent changes to the value won't be included. However, the usage tracker will show the proper total value. The line you list above for modifying the Rage count is correct, so it should look like the following:
*** hero.child[cBbnRage].field[hTotal].value += 2

We'll need to tweak the data files so that the displayed text is setup separately, allowing modifications from other feats to be applied before the text is generated. In the meantime, the above changes should get the appropriate behaviors implemented. You'll just need to ignore the text description and focus on the value shown in the usage tracker (e.g. "0/3") until we fix this in the next update.

Hope this helps,
Rob
rob is offline   #2 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 13th, 2007, 12:51 PM
At 12:05 PM 7/13/2007, you wrote:
Quote:
How would I make Damage Reduction a Pre-Requisite for a feat, and also increase the Damage Reduction figure, because of the new feat, by "+ n" each time a level gain increases the DR for example a 13th level Barbarian has DR 3/-, with the feat I propose it increases to DR 4/- then at 16th level it becomes 5/- instead of 4/-?
Again, with Colen out of town, I'm going to take my best shot at this. But Colen is the expert on this stuff and my knowledge of the d20 details is limited. So you might need to wait for Colen if this post doesn't get you the info you need.

There are 8 different "flavors" of damage reduction. Their ids are all of the form "xDmRad???". If you want to setup a pre-requisite on a specific type of damage reduction, you can do so very easily by checking for the existence of the damage reduction pick. If you need to test for generic DR, it would look like this:
*** if (hero.pickexists[xDamRd] > 0) then
******* @valid = 1
******* endif

If you want to check for multiple different flavors of damage reduction, you would need to test for each one. The easiest way to do this is to add up the results from assorted "pickexists" tests. If the total is non-zero, you know you've got at least one of them. This would look something like the following:
*** if (hero.pickexists[xDamRd] + hero.pickexists[xDamRdMag] + hero.pickexists[xDamRdIron] > 0) then
******* @valid = 1
******* endif

Increasing the DR for a character requires modifying the "Value" field of the appropriate DR pick. So, to increase the generic DR, it would look like the following:
*** hero.childfound[xDamRd].field[Value].value += 1

If you need to ensure that you observe the non-stacking behavior of DR, then the line of script would look like below instead. This will ensure that the DR rating is the maximum of the current value and the new DR value (i.e. non-stacking). However, I don't think this behavior applies to the feat you're working with.
*** hero.child[xDamRd].field[Value].value = maximum(hero.child[xDamRd].field[Value].value,newdrvalue)

The "xDamRd" pick will NOT always exist on a hero. It is only added when damage resistance applies. As a result, you need to use "childfound" instead of "child" to ensure that HL doesn't report errors whenever the pick isn't found. If you are certain that the pick will always exist (or should exist), then it's probably better to use "child" instead of "childfound". In this case, though, your pre-requisite test won't stop the user from adding the feat - it will only report a validation error. So a user could add the DR adjustment feat without having any DR to start with, so your script should accommodate this by gracefully skipping the DR adjustment that can't be applied (by using "childfound").

Hope this helps,
Rob
rob is offline   #3 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 14th, 2007, 04:28 AM
Quote:
Originally Posted by rob
At 12:05 PM 7/13/2007, you wrote:
Is the "Smite" adjustment you want to perform applicable to all four of these flavors of Smite? Or just two of them?
Rob
The feat requires any Smite ability regardless of what flavour, therefore applicable to all the classes that have Smite whether through Class, Template, Race or Feats!

Thanks for the prompt reply, i'll try the scripts as soon as I can!
bodrin is offline   #4 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 14th, 2007, 05:03 AM
Quote:
Originally Posted by rob
At 12:05 PM 7/13/2007, you wrote:

There are 8 different "flavors" of damage reduction. Their ids are all of the form "xDmRad???". If you want to setup a pre-requisite on a specific type of damage reduction, you can do so very easily by checking for the existence of the damage reduction pick. If you need to test for generic DR, it would look like this:
if (hero.pickexists[xDamRd] > 0) then
@valid = 1
endif
The feat only requires Damage reduction as a class or innate ability, however I will presume that sooner or later a splat book will introduce a feat, magic item or something else that will confer DR in the future so this feat may be applicable! :?

Quote:
Originally Posted by rob
If you want to check for multiple different flavors of damage reduction, you would need to test for each one. The easiest way to do this is to add up the results from assorted "pickexists" tests. If the total is non-zero, you know you've got at least one of them. This would look something like the following:
if (hero.pickexists[xDamRd] + hero.pickexists[xDamRdMag] + hero.pickexists[xDamRdIron] > 0) then
@valid = 1
endif

Increasing the DR for a character requires modifying the "Value" field of the appropriate DR pick. So, to increase the generic DR, it would look like the following:
hero.childfound[xDamRd].field[Value].value += 1

If you need to ensure that you observe the non-stacking behavior of DR, then the line of script would look like below instead. This will ensure that the DR rating is the maximum of the current value and the new DR value (i.e. non-stacking). However, I don't think this behavior applies to the feat you're working with.
hero.child[xDamRd].field[Value].value = maximum(hero.child[xDamRd].field[Value].value,newdrvalue)

The "xDamRd" pick will NOT always exist on a hero. It is only added when damage resistance applies. As a result, you need to use "childfound" instead of "child" to ensure that HL doesn't report errors whenever the pick isn't found. If you are certain that the pick will always exist (or should exist), then it's probably better to use "child" instead of "childfound". In this case, though, your pre-requisite test won't stop the user from adding the feat - it will only report a validation error. So a user could add the DR adjustment feat without having any DR to start with, so your script should accommodate this by gracefully skipping the DR adjustment that can't be applied (by using "childfound").

Hope this helps,
Rob
The DR doesn't stack, so only the highest value should be applied.
It doesn't affect anything else!
If DR isn't there then the feat can't be applied!

If the character has multiple instances of DR this feat only increases one DR value, which the player chooses, what would the method be to actually increase the one DR value that the player picks?

Is there a Script example that does this already within HL?

It also states that this feat may not be taken more than once!

The Smite and Rage ability Scripts work excellently, the text 1/day not changing doesn't matter as the class ability is 1/day but the feat allows an extra 2 times per day so just having the charges shown is a handy reminder.

I just changed the Hero.Child to hero.Childfound on all four smite scripts and managed to suppress the error messages that 3 smite abilities didn't exist on a test hero.
bodrin is offline   #5 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 14th, 2007, 05:17 PM
At 06:03 AM 7/14/2007, you wrote:
Quote:
The DR doesn't stack, so only the highest value should be applied.
If DR isn't there then the feat can't be applied!
Using "pickexists" or "childfound" ought to handle the optional nature of the DR nicely. Using the "maximum" approach should handle the non-stacking behavior properly.

Quote:
If the character has multiple instances of DR this feat can only increase one DR value, players choice! It doesn't affect anything else!
I don't think the d20 files are setup yet to allow you to add your own custom user-selection for the feat (for picking the type of DR). I'm pretty sure this is on the todo list for addition prior to GenCon, but Colen needs to verify that.

Quote:
The feat also states that it may not take this feat more than once! [img]./modules/mdforum/images/smiles/icon_sad.gif[/img]
That part is easy. Just make the feat "unique", like most feats are handled, and it can only ever be added once. :-)
rob is offline   #6 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old July 19th, 2007, 09:44 AM
Rob Bowes wrote:

> If the character has multiple instances of DR this feat can only
> increase one DR value, players choice! It doesn't affect anything else!
>
>
> I don't think the d20 files are setup yet to allow you to add your own
> custom user-selection for the feat (for picking the type of DR). I'm
> pretty sure this is on the todo list for addition prior to GenCon, but
> Colen needs to verify that.


This is something that might get into the next update, but may get
delayed until later. Until then, you can just set the feat to allow the
user to enter 'freeform text' and type in the DR that you want to increase.


--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
Colen is offline   #7 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old July 19th, 2007, 09:46 AM
bodrin wrote:
>
>
> *rob wrote:*
> At 12:05 PM 7/13/2007, you wrote:
>
> There are 8 different "flavors" of damage reduction. Their ids are all
> of the form "xDmRad???". If you want to setup a pre-requisite on a
> specific type of damage reduction, you can do so very easily by checking
> for the existence of the damage reduction pick. If you need to test for
> generic DR, it would look like this:
> if (hero.pickexists[xDamRd] > 0) then
> @valid = 1
> endif
>
>
>
> The feat only requires Damage reduction as a class or innate ability,
> however I will presume that sooner or later a splat book will introduce
> a feat, magic item or something else that will confer DR in the future
> so this feat may be applicable!


So the feat only applies to certain types of damage reduction? What if a
class has DR 10 from a class ability and DR 15 from something else?
Would the feat still apply, even though the DR 10 isn't being used?


--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
Colen is offline   #8 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 20th, 2007, 05:33 PM
Quote:
Originally Posted by Colen
bodrin wrote:

So the feat only applies to certain types of damage reduction? What if a
class has DR 10 from a class ability and DR 15 from something else?
Would the feat still apply, even though the DR 10 isn't being used?

--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
Yes the feat applies to any type of damage reduction applicable, it is limited by the "Can be taken only once!" text in the feat description and the player has to pick which DR it increases!

E.g
DR 5 / Lawful, DR 15 /Magic

The Player decides to increase DR 5 / Lawful the other DR value remains the same!

Even though the DR 15 / Magic is higher than DR 5 / Lawful if somehow the DR 15 is negated the enhanced DR / Lawful then applies!
bodrin is offline   #9 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old July 23rd, 2007, 02:52 PM
bodrin wrote:
>
>
> *Colen wrote:*
> bodrin wrote:
>
> So the feat only applies to certain types of damage reduction? What if a
> class has DR 10 from a class ability and DR 15 from something else?
> Would the feat still apply, even though the DR 10 isn't being used?
>
> --
> Colen McAlister (colen@wolflair.com)
> Chief Engineer, Lone Wolf Development
> http://www.wolflair.com/
>
>
>
> Yes the feat applies to any type of damage reduction applicable, it is
> limited by the "Can be taken only once!" text in the feat description
> and the player has to pick which DR it increases!
>
> E.g
> DR 5 / Lawful, DR 15 /Magic
>
> The Player decides to increase DR 5 / Lawful the other DR value remains
> the same!
>
> Even though the DR 15 / Magic is higher than DR 5 / Lawful if somehow
> the DR 15 is negated the enhanced DR / Lawful then applies!


What about if the DR 5 / Lawful was from a class ability, and the DR 15
/ Magic was from something else, like a template? Would the feat still
be allowed to apply to the DR 15 / Magic?


--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
Colen is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:24 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.