• 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

Armor Hit Point adjustment

bodrin

Well-known member
I'm trying to develop an adjustment that shows the Hit point total of a selected armor.

I've managed to create this

Final Phase 10000

Code:
~ If we're not enabled, get out now
      doneif (field[pIsOn].value = 0)

~ Lets multiply our armor bonus by 10 which should give us our HP total
  field[abValue].value += round(field[arBonus].value * 10,0,-1) 

~ Now lets add to the Hit point total to our name 
  field[livename].text &= "Armor HP " & field[abValue].value

which compiles but I get this error when HL loads

HTML:
Attempt to access field 'arBonus' that does not exist for thing 'pBodObHdHp'

Likewise same error if I substitute arBonus with tACArmor.
Any suggestions.:confused:
 
Code:
~ Lets multiply our armor bonus by 10 which should give us our HP total
  field[abValue].value += round([B]field[arBonus].value[/B] * 10,0,-1)
Your problem is on this line in the bolded section. You didn't give any transition so HL is looking for arBonus on the adjustment itself (thingid.pBodObHdHp). Basically your saying hero.child[pBodObHdHp].field[arBonus].value which an adjustment does not have that field.

So I assume you set the selection menu to armor so you would want to change the script to the following:

Code:
~ If we're not enabled, get out now
doneif (field[pIsOn].value <> 1)
~ If nothing chosen, get out now
doneif (field[pChosen].ischosen <> 1)

~ Lets multiply our armor bonus by 10 which should give us our HP total
field[abValue].value += round(field[pChosen].chosen.field[arBonus].value * 10,0,-1) 

~ Now lets add to the Hit point total to our name 
field[pChosen].chosen.field[livename].text &= "Armor HP " & field[abValue].value
 
Can't see the wood for the trees sometimes. :o

I'd tried pChosen earlier but discarded the code due to numerous errors on compile.

I was tinkering with the code and just trying to get it to compile first!:cool:
 
It is interesting that HL doesn't currently display this, but for the most part you usually need to know HP for NPC items more often than PC. GM's don't frequently Sunder PC items, but PC do GM's NPC items.
 
It is interesting that HL doesn't currently display this, but for the most part you usually need to know HP for NPC items more often than PC. GM's don't frequently Sunder PC items, but PC do GM's NPC items.

Unless that GM is a *cough* slightly vindictive *cough* GM that likes to see players gawp at the unexpected audacity. /Evil Grin :rolleyes:
 
Hit Point and Hardness Adjustment

weapon.JPGarmor HP.JPG

Okay I have something working but I just can't quite get it correct.

Heres some of the code i'm using and a screenshot of current state.

Code:
~ Set up some variables to use later
    Var ObjHard as Number
     Var ObjHp as Number
      Var ObjSize as Number

~ Set the Variables to 0 as a base number
  ObjHard = 0
   ObjHp = 0
    ObjSize = 0

~ Lets multiply our weapon bonus by 10 and 2 for each +1 enchantment
  field[abValue].value += round(field[pChosen].chosen.field[wBonus].value * 10,0,-1)
  field[abValue2].value += round(field[pChosen].chosen.field[wBonus].value * 2,0,-1)

   ~ Now lets check our material
     [COLOR=Red]if (#hasability[eAdamant] = 1) then
      ObjHard = 20
      ObjHp = 40[/COLOR]
       endif
I can't get the above red code to apply the special material Hp and Hardness values (20 Hardness / 40 HP)

What am I missing??? Should I be checking the weapon / armor Gizmo?

Also notice the Non Magical Longsword in the Screenshot HP 0 Hardness 0 so just a minor annoyance there.

But notice the Armor HP total which currently displays (almost) correctly. Hardness code to be applied after the weapon scripts are working properly.
:cool:
 
Last edited:
#hasability[] is a function that looks at abilities on the hero. You need to look at this particular item to see if it's adamantine.
 
#hasability[] is a function that looks at abilities on the hero. You need to look at this particular item to see if it's adamantine.

I've checked the tags on the weapon and I saw ability.eAdamant so I presumed #hasability would check for the eAdamant tag.

The only other thing I can see is wMagMat which relates to the material. Is this something I ought to investigate?
 
In the SGG community data set their is a bunch of special magic powers that only go on to Dragonhide armor. Its like the 5 bullet point Dragonhide file. I have the checks correctly looking for the presence of the special material Dragonhide.

You could look that up for reference if you want.
 
In the SGG community data set their is a bunch of special magic powers that only go on to Dragonhide armor. Its like the 5 bullet point Dragonhide file. I have the checks correctly looking for the presence of the special material Dragonhide.

You could look that up for reference if you want.

Will do, thanks for the heads up.:)
 
weapon HP error 2.JPG

Well almost, Its applying the correct HP and Hardness value, however all the time. :(

Regardless of Material too.

Script follows

Code:
~ If we're not enabled, get out now
  doneif (field[pIsOn].value <> 1)

~ If nothing chosen, get out now
  doneif (field[pChosen].ischosen <> 1)

  ~ Set up some variables to use later
  Var ObjHardB as Number 
   Var ObjHpB as Number
    Var ObjHard as Number
     Var ObjHp as Number
      Var ObjSize as Number

   ~ Now lets check our material
     if (hero.childlives[eAdamant] <> 1) then
      ObjHard += ObjHard + 20
      ObjHp += ObjHp + 40
       endif

~ Lets multiply our weapon bonus by 10 and 2 for each +1 enchantment
  field[abValue].value += round(field[pChosen].chosen.field[wBonus].value * 10,0,-1)
  field[abValue2].value += round(field[pChosen].chosen.field[wBonus].value * 2,0,-1)
        
     ~ Now lets use abValues to store the value
       field[abValue2].value += ObjHard
        field[abValue].value += ObjHp

~ Now lets add to the Hit point total to our name
 field[pChosen].chosen.field[livename].text &= field[livename].text & " HP " & field[abValue].value

~ Now lets Show our Hardness total on our name
      field[pChosen].chosen.field[livename].text &= field[livename].text & " Hardness " & field[abValue2].value

Help me Obi Wolf, you're my only hope! :D
 
Still having problems trying to get this to work so i'm leaving it as a work in progress.

It calculates the Base HP and Hardness values of Magic Armor and Weapons only, but at least its a start!:rolleyes:

weapon Hp and Hardness.JPG

armor HP and Hardness.JPG
 
For every point of Enhancement Bonus, doesn't hardness increase by 1 and Hp by 10? I don't see that in the screencaps
 
For every point of Enhancement Bonus, doesn't hardness increase by 1 and Hp by 10? I don't see that in the screencaps

Hardness increases by 2 and HP by 10.

Pathfinder table says

1 Add +2 for each +1 enhancement bonus of magic items.
2 The hp value given is for Medium armor, weapons, and shields. Divide by 2 for each size category of the item smaller than Medium, or multiply it by 2 for each size category larger than Medium.
3 Add 10 hp for each +1 enhancement bonus of magic items.
4 Varies by material; see Table: Substance Hardness and Hit Points.

The screen caps were to show what was currently achieved, wrong figures and all, the scripts amended as of today calculate only the BASE MAGIC ITEM hardness and HP correctly, I amended the value mathematics to reflect the Pathfinder CRB.

Copy and paste is my enemy sometimes.:cool:
 
I will take a look at this when I can Bodrin as I think it would make a nice adjustment for many groups. I just worked stupid long hours yesterday and honestly didn't feel like turning on the PC when I got home. :D

I may get time tonight to look hopefully.
 
I will take a look at this when I can Bodrin as I think it would make a nice adjustment for many groups. I just worked stupid long hours yesterday and honestly didn't feel like turning on the PC when I got home. :D

I may get time tonight to look hopefully.

Go right ahead, it's in Dropbox ready for tinkering.

I just started it as an experiment to see if it was possible.

Frustration set in regarding the material issue, then the maths began acting weird.

Many work arounds later I thought, "to much time is being spent basically trying to get functionality that is easy to calculate once the base values are known, so revert the code just to display Base Values!"

Behold Bodrins unfinished symphony No 1. ;)

Oh and stupid early long work hours are the bane of my life to. :P
 
Go right ahead, it's in Dropbox ready for tinkering.
Ok here is the code you need to see if a special material is on the weapon or not.
Code:
~ If adamantine add 40 hit points and 20 hardness
If (field[pChosen].chosen.tagis[Ability.eAdamant] <> 0) Then
  field[abValue].value += 40
  field[abValue2].value += 20
Endif

I just started it as an experiment to see if it was possible.
Enough time and money and I can make the Hero Lab software read my mind. :D

Frustration set in regarding the material issue, then the maths began acting weird.
See everything is possible actually the important question is do you have the time?

Many work arounds later I thought, "to much time is being spent basically trying to get functionality that is easy to calculate once the base values are known, so revert the code just to display Base Values!"

Behold Bodrins unfinished symphony No 1. ;)
Its a good idea but I can see a bunch of work in trying to figure out how many handed the weapon is to take into account the base values. Then adding in the special materials and magic bonuses. But that is what is nice about computers to do that number crunching for us lazy humans.

Oh and stupid early long work hours are the bane of my life to. :P
Yea no doubt. Combined with 3 days of working with IBM support staff to be told its a "WAD" (Works as Designed). And to have to take a crash course in XA Architecture methodology to figure out why a Java programs J2EE connections are affecting the internal memory pointers for a trigger program. Because of course it makes perfect sense that an external process can mess with the Internal Memory Pointers that are getting lost which causes the programs to crash. Yea right that does not sound like a bug at all IBM!!!! :mad:

blah! I think its time to get some sleep. :)
 
Ok here is the code you need to see if a special material is on the weapon or not.
Code:
~ If adamantine add 40 hit points and 20 hardness
If ([COLOR="Red"]field[pChosen].chosen.tagis[Ability.eAdamant[/COLOR]] <> 0) Then
  field[abValue].value += 40
  field[abValue2].value += 20
Endif


Enough time and money and I can make the Hero Lab software read my mind. :D

I knew it had to test for the eAdamant ability, see the first code efforts using
#hasability macro. That didn't work and from that error the code path began its dark and twisted route.

Curse you twisted route, you're a twisty turny thing that twists and turns like a twisty turny thing in the twisted turning parade.:o:

Its a good idea but I can see a bunch of work in trying to figure out how many handed the weapon is to take into account the base values. Then adding in the special materials and magic bonuses. But that is what is nice about computers to do that number crunching for us lazy humans.

Which is why I wanted to code it, I'd already realised that we'd need to test for Size, Material, Weapon Class, Handedness and hafted. Custom tags forwarded from a bootstrapped ability to add the needed values were going to be my solution.

Yea no doubt. Combined with 3 days of working with IBM support staff to be told its a "WAD" (Works as Designed). And to have to take a crash course in XA Architecture methodology to figure out why a Java programs J2EE connections are affecting the internal memory pointers for a trigger program. Because of course it makes perfect sense that an external process can mess with the Internal Memory Pointers that are getting lost which causes the programs to crash. Yea right that does not sound like a bug at all IBM!!!!

blah! I think its time to get some sleep. :)

In that case I'd have declared Pimms 'o Clock :D

WAD? I thought that was "Where's all the Data?" aka Doom / Quake files.
 
And I would love to have the code fu skills to make HL read my mind.:rolleyes:

I even made a pretty flow chart with variable nodes and branches this time to show the data route.:eek:

That's how deadly experimental I was to get this to work.:cool:
 
Back
Top