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
GodPole
Member
 
Join Date: Feb 2010
Location: Charlotte, NC
Posts: 81

Old October 24th, 2010, 06:09 AM
I'm trying to set up an automatic adjustment condition related to the Haste spell and hitting a snag when trying to set the new speed.

The way the spell is written, if the target's speed is <30, then the new speed is 2x the old speed.
If the target's speed is 30 or higher, the new speed is 30 + the old speed.

I am trying to use the following script to take care of this:

doneif (state.isoutput <> 0)
doneif (field[pIsOn].value = 0)

hero.child[Attack].field[ModCirc].value = hero.child[Attack].field[ModCirc].value + 1
#applybonus[tACDodge, hero.child[ArmorClass], 1]
#applybonus[vMisc, hero.child[vRef], 1]

if (hero.child[Speed].field[tSpeed].value > 29) then
hero.child[Speed].field[BonEnhance].value = maximum(hero.child[Speed].field[BonEnhance].value, 30)
endif

if (hero.child[Speed].field[tSpeed].value < 30) then
hero.child[Speed].field[BonEnhance].value = maximum(hero.child[Speed].field[BonEnhance].value, hero.child[Speed].field[tSpeedMod].value)
endif


However, no matter what the base speed of the hero is, it always adds 30.
I have been using the floating debug screens to make sure that I am referencing the right fields but no matter how I write this, is is still only applying the +30 conditional and not the 2x conditional. I can understand if my calculations in the <30 scenario are written wrong and thus the hero would receive no bonus, but it ALWAYS reads the >29 conditional as true...which is wrong.

Any ideas on what is going on here?
Thanks!
GodPole is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 24th, 2010, 10:22 AM
Phase and priority?

For your >29 scenario, you can reduce the typing with this:

Code:
 
#applybonus[BonEnhance, hero.child[Speed], 30]
Also, for flow control, I'd recommend:

Code:
 
if ( >= 30) then
  ~>= 30 scenario
else
  ~< 30 scenario
  endif
Oh, and in terms of bonus stacking, the attack bonus in the haste spell isn't assigned a type, so use Bonus rather than ModCirc, and dodge bonuses stack, so use simple addition for those (a dodge field hasn't been added to the ref save, so you'll have to use a generic bonus in that case):

Code:
 
hero.child[Attack].field[Bonus].value += 1
hero.child[ArmorClass].field[tACDodge].value += 1
hero.child[vRef].field[Bonus].value += 1
That attack bonus needs to be assigned relatively early in order to be incorporated into all the other attack fields, so I'd recommend splitting the script into two - the first, at PreLevel/10000 or so, for the attack/AC/Ref bonuses, the second, at Final/9000 or so, for the speed.

Last edited by Mathias; October 29th, 2010 at 01:49 PM. Reason: said the wrong thing
Mathias is online now   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 24th, 2010, 10:42 AM
I thought of a better way to handle the speed - you want to add in your speed again, but not add more than 30:

Phase: Final, Priority: 9900

Code:
 
var bonusspeed as number
bonusspeed = minimum(hero.child[Speed].field[tSpeed].value, 30)
#applybonus[BonEnhance, hero.child[Speed], bonusspeed]
For swim, fly, climb, burrow (in the same speed script):

Code:
 
~start by calculating the swim speed
#value[xSwim] = maximum(#value[xSwim], hero.childfound[xSwim].tagmax[Value.?])
~then add 30 (or the current value)
#value[xSwim] += maximum(30, #value[xSwim])
Duplicate that for xFly, xClimb and xBurrow
Mathias is online now   #3 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old October 29th, 2010, 12:57 PM
Quote:
Originally Posted by Mathias View Post
Phase and priority?
Oh, and in terms of bonus stacking, the attack bonus in the haste spell isn't assigned a type, so use Bonus rather than ModCirc, and dodge bonuses don't stack, so use simple addition for those (a dodge field hasn't been added to the ref save, so you'll have to use a generic bonus in that case):
Dodge bonuses do stack though

From the D20 srd
http://www.d20srd.org/srd/theBasics.htm#dodgeBonus

Quote:
Dodge Bonus

A dodge bonus improves Armor Class (and sometimes Reflex saves) resulting from physical skill at avoiding blows and other ill effects. Dodge bonuses are never granted by spells or magic items. Any situation or effect (except wearing armor) that negates a character's Dexterity bonus also negates any dodge bonuses the character may have. Dodge bonuses stack with all other bonuses to AC, even other dodge bonuses. Dodge bonuses apply against touch attacks.

Last edited by bodrin; October 29th, 2010 at 01:01 PM. Reason: Wrong source used!
bodrin is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 29th, 2010, 01:48 PM
Oops, I said "don't" rather than "do" - the rest of my explanation is correct for stacking bonuses - simple addition, rather than the #applybonus[] macro.
Mathias is online now   #5 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 02:35 PM.


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