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
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 67

Old March 8th, 2010, 07:56 PM
I'm trying to make the Easy Travel armor property (from Magic Item Compendium) work. The property lets the wearer carry up to a medium load as if it were a light load -- ignoring max Dex, check penalty, speed reduction, etc. (It also lets the wearer walk longer, but that's not a thing that affects the character sheet, so it doesn't need any real implementation.)

What I thought I'd do is check to see if the hero is at medium encumbrance; if so, reset the encumbrance level to light. This is what I put in the eval script:

Code:
~ If hero is at medium encumbrance, make it light
if (hero.tagis[Encumbered.Medium] >= 0) then
  herofield[tEncumLev].value = 0
~  herofield[tEncumAbbr].value = 0
endif
It doesn't really work; if I set the timing late enough, it does change the tEncumLev -- but it doesn't affect the max Dex, check penalty, or speed. (Changing the tEncumAbbr values causes it to display as being light encumbrance, but doesn't change the numbers.)

I'm not sure if it's a timing issue or not -- I tried several different stages and values, including PreLevel/10000 & before (which, IIRC, is when armor check penalties are applied), but then nothing works.

So, I suspect that altering tEncumLev (and/or tEncumAbbr) won't work. Unless there's a specific phase & time where it will work, maybe?

Anybody have any ideas on what needs to be changed? And when -- when are the encumbrance-based penalties applied?
coyote6 is offline   #1 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 8th, 2010, 08:14 PM
I suspect you should try deleting the Medium Encumberance tag and assigning the Light Encumberance tag. Try that at various phases and priorities and see if something it is corrected.
Lawful_g is offline   #2 Reply With Quote
Mindcloud
Member
 
Join Date: Jan 2009
Posts: 95

Old March 9th, 2010, 06:04 AM
Here you go I dug up some code I wrote for D20 before I moved to Pathfinder.

Set it at timing user post levels 11000

Code:
~ If we're armor, change our class if necessary - we become one class
~ lighter.
      var result as number
      if (container.parent.tagis[component.BaseArmor] <> 0) then
        if (container.tagis[mClass.Medium] <> 0) then
          result = container.delete[mClass.Medium]
          result = container.assign[mClass.Light]
          result = container.delete[mCategory.Slows]
        elseif (container.tagis[mClass.Heavy] <> 0) then
          result = container.delete[mClass.Heavy]
          result = container.assign[mClass.Light]
          result = container.delete[mCategory.Slows]
          endif
        endif
Mindcloud is offline   #3 Reply With Quote
Mindcloud
Member
 
Join Date: Jan 2009
Posts: 95

Old March 9th, 2010, 06:09 AM
Here is the rest of that code I don't remember what power it was for.

phase="UserPostLv" priority="2500"
Code:
      ~ If we're a armor, reduce our penalties now - we have to wait until
      ~ now to do it because our armor check penalty won't have been set until now
      if (container.parent.tagis[component.BaseArmor] <> 0) then
        container.parent.field[mArcFail].value -= 15
        container.parent.field[mMaxDex].value += 2
        container.parent.field[mArmorChk].value += 3
        endif
Not sure why I had Arcane failure twice in the same power.

<eval phase="UserPreLv" priority="5000"
Code:
~ Make our weight 1lb
      container.parent.field[gWeight].value = 1
      container.parent.field[mArcFail].value -= 15
Mindcloud is offline   #4 Reply With Quote
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 67

Old April 8th, 2010, 08:20 PM
<cast raise thread>

So, the D&D game took an extended hiatus, and that plus the proverbial Other Stuff has kept me distracted. But, I took another run at it, with this code, at Post-Attributes 2100:

Code:
var result as number

~ If hero is at medium encumbrance, make it light
if (hero.tagis[Encumbered.Medium] <> 0) then
  hero.child[Totals].field[tEncumLev].value = 0
  hero.child[Totals].field[tEncumAbbr].value = 0
  result = hero.delete[Encumbered.Medium]
  result = hero.assign[Encumbered.Light]
endif
So this makes it look like the medium-encumbered hero is at light encumbrance, yet the skills & speed still reflect the Medium encumbrance penalties. So while it deletes the .Medium tag and adds the .Light tag, it doesn't do it before the encumbrance takes effect.

I don't want to just set tArmorChk to 0 & reset the speed, because the character might be wearing armor that inflicts an armor check penalty and/or reduces speed, and Easy Travel only affects encumbrance levels. So when can I alter Encumbrance such that the medium load penalties aren't invoked?

I looked at timing.xml and the Task List, but I don't couldn't figure out when the encumbrance level gets translated into armor check penalties & speed reduction.

Any ideas?

Thanks,

-Bob
coyote6 is offline   #5 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old April 10th, 2010, 01:01 PM
I'm taking a crack at this now... I see what you mean, so I am trying a different tack.
Lawful_g is offline   #6 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old April 10th, 2010, 02:51 PM
I've got it, the main issue was that I wasn't realizing that Armor Checks on the armors are negative values. 2 Eval Scripts

Eval Script #1
Post Attributes 2050
~ Are we equipped?
if (field[gIsEquip].value <> 0) then

~ This ability only takes place if we are at medium encumberance
if (hero.tagis[Encumbered.Medium] = 0) then
done
endif

~ First check to see our equipped armor's ACP
var ArmPen as number

foreach pick in hero from BaseArmor where "Helper.CurrArmor"
ArmPen += each.field[mArmorChk].value
nexteach

~ Then check to see our equipped shield's ACP
var ShlPen as number

foreach pick in hero from BaseArmor where "Helper.CurrShield"
ShlPen += each.field[mArmorChk].value
nexteach

~ If our total ACP from armor and shield are greater than 3, do nothing

var TotPen as number
TotPen = ShlPen + ArmPen

if (TotPen <= -3) then
done
endif

~ We have passed all tests so far, so apply the changes to skills, reducing the penalty from 3 to the Total Penalty...
foreach pick in hero from BaseSkill where "Helper.ArmorChk1"
each.field[Penalty].value += (3 + TotPen)
nexteach

foreach pick in hero from BaseSkill where "Helper.ArmorChk2"
each.field[Penalty].value += 6 + (TotPen * 2)
nexteach

endif



Eval Script #2
Post Attributes 2100
if (field[gIsEquip].value <> 0) then
hero.child[Totals].field[tEncumLev].value = 0
hero.child[Totals].field[tEncumAbbr].value = 0
perform hero.delete[Encumbered.Medium]
perform hero.assign[Encumbered.Light]

~ Now check to see if we are wearing medium or heavy armor, if so do nothing. If not, make our speed as normal.
foreach pick in hero from BaseArmor where "Helper.CurrArmor"
if (each.tagis[mClass.Medium] <> 0) then
done
endif

if (each.tagis[mClass.Heavy] <> 0) then
done
endif
nexteach

perform hero.delete[Hero.ArmorSpeed]

endif
Lawful_g is offline   #7 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old April 10th, 2010, 02:55 PM
Hope that helps Coyote6.
Lawful_g is offline   #8 Reply With Quote
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 67

Old April 12th, 2010, 06:13 PM
Quote:
Originally Posted by Lawful_g View Post
Hope that helps Coyote6.
It did indeed. I got it working. FWIW, here's the final scripts I used:

#1:
Code:
~ If we aren't equipped, get out
if (container.parent.field[gIsEquip].value = 0) then
  done
endif

~ This ability only takes place if we are at medium encumberance
if (hero.tagis[Encumbered.Medium] = 0) then
  done
endif

~ First check to see our equipped armor's ACP
var ACP as number

foreach pick in hero from BaseArmor where "Helper.CurrArmor"
  ACP += each.field[mArmorChk].value
nexteach

foreach pick in hero from BaseArmor where "Helper.CurrShield"
  ACP += each.field[mArmorChk].value
nexteach

~ If our total ACP from armor and shield are > 3, do nothing
if (ACP <= -3) then
  done
endif

~ We have passed all tests so far, so apply the changes to skills,
~ reducing the penalty from 3 to the Total Penalty...
foreach pick in hero from BaseSkill where "Helper.ArmorChk1"
  each.field[Penalty].value += (3 + ACP)
nexteach

foreach pick in hero from BaseSkill where "Helper.ArmorChk2"
  each.field[Penalty].value += 6 + (ACP * 2)
nexteach

#2:
Code:
~Again, get out if not equipped or not at Medium encumbranec

if (container.parent.field[gIsEquip].value = 0) then
  done
endif
if (hero.tagis[Encumbered.Medium] = 0) then
  done
endif

~ Set encumbrance to none/light
hero.child[Totals].field[tEncumLev].value = 0
hero.child[Totals].field[tEncumAbbr].value = 0
perform hero.delete[Encumbered.Medium]
perform hero.assign[Encumbered.Light]

~ Now check to see if we are wearing medium or heavy armor, if so do
~ nothing & exit. If not, make our speed as normal.
foreach pick in hero from BaseArmor where "Helper.CurrArmor"
  if (each.tagis[mClass.Medium] <> 0) then
    done
  endif
  if (each.tagis[mClass.Heavy] <> 0) then
    done
  endif
nexteach

perform hero.delete[Hero.ArmorSpeed]
coyote6 is offline   #9 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:48 AM.


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