Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Armor Hit Point adjustment (http://forums.wolflair.com/showthread.php?t=45045)

bodrin July 28th, 2013 11:54 AM

Armor Hit Point adjustment
 
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 Code:

Attempt to access field 'arBonus' that does not exist for thing 'pBodObHdHp'
Likewise same error if I substitute arBonus with tACArmor.
Any suggestions.:confused:

ShadowChemosh July 28th, 2013 02:09 PM

Quote:

Originally Posted by bodrin (Post 161590)
Code:

~ Lets multiply our armor bonus by 10 which should give us our HP total
  field[abValue].value += round(field[arBonus].value * 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


bodrin July 28th, 2013 02:47 PM

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:

risner July 28th, 2013 03:19 PM

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.

bodrin July 28th, 2013 08:57 PM

Quote:

Originally Posted by risner (Post 161597)
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:

bodrin July 30th, 2013 09:14 AM

Hit Point and Hardness Adjustment
 
2 Attachment(s)
Attachment 2396Attachment 2395

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
    if (#hasability[eAdamant] = 1) then
      ObjHard = 20
      ObjHp = 40

      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:

Mathias July 30th, 2013 09:40 AM

#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.

bodrin July 30th, 2013 09:55 AM

Quote:

Originally Posted by Mathias (Post 161725)
#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?

ShadowChemosh July 30th, 2013 12:04 PM

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.

bodrin July 30th, 2013 01:02 PM

Quote:

Originally Posted by ShadowChemosh (Post 161739)
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.:)

bodrin July 30th, 2013 02:18 PM

1 Attachment(s)
Attachment 2397

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

bodrin July 31st, 2013 06:55 AM

2 Attachment(s)
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:

Attachment 2399

Attachment 2400

Aaron July 31st, 2013 08:23 AM

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

bodrin July 31st, 2013 09:18 AM

Quote:

Originally Posted by Aaron (Post 161777)
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.

Quote:

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:

ShadowChemosh July 31st, 2013 10:50 AM

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.

bodrin July 31st, 2013 11:08 AM

Quote:

Originally Posted by ShadowChemosh (Post 161780)
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

ShadowChemosh July 31st, 2013 08:07 PM

Quote:

Originally Posted by bodrin (Post 161782)
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

Quote:

Originally Posted by bodrin (Post 161782)
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

Quote:

Originally Posted by bodrin (Post 161782)
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?

Quote:

Originally Posted by bodrin (Post 161782)
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.

Quote:

Originally Posted by bodrin (Post 161782)
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. :)

bodrin July 31st, 2013 09:10 PM

Quote:

Originally Posted by ShadowChemosh (Post 161814)
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


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:

Quote:

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.

Quote:

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.

bodrin July 31st, 2013 09:16 PM

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:

Portilis February 24th, 2014 04:19 AM

Thread necromancy!

Bodrin, did you ever get this all working? If you did, I'd be rather interested in it :)

Aaron February 24th, 2014 07:08 AM

Necromancy is against the law! Halt, evildoer!

ShadowChemosh February 24th, 2014 09:50 AM

Quote:

Originally Posted by Portilis (Post 176361)
Thread necromancy!

Bodrin, did you ever get this all working? If you did, I'd be rather interested in it :)

Oh man I had the last part to try and get this to work and I totally dropped the ball. Let me add this to my to-do list right now so I don't forget. Yes I really have a to-do list in Evernote I created to try and get more organized. :D

bodrin February 24th, 2014 12:09 PM

Quote:

Originally Posted by Portilis (Post 176361)
Thread necromancy!

Bodrin, did you ever get this all working? If you did, I'd be rather interested in it :)

I've not had the opportunity to work on anything for a while.

My real life work has encroached upon the coding hobby, I'm currently learning a new software system which is proving quite challenging, considering that my field of work was more hands on manufacturing rather than virtual manufacturing, and spending 8 hours a day in front of a monitor means that in my spare time I don't necessarily want to be in front of a monitor.

As shadow says he'd only got the last part to implement so I passed the baton onto him.
:o
Sorry.

blzbob February 24th, 2014 08:16 PM

This is certainly something I would also be interested in.

Portilis February 24th, 2014 11:32 PM

Don't worry Shadow, I have my own to-do list of things to get done. Sadly, a lot of the work I'm doing isn't much use outside of our local games at the moment as it is mostly house rules.

If you've got a significant list of things you need to do before this, feel free to PM me what you've got and a note of what needs doing and I'm happy to have a go at finishing it off.

karrel July 9th, 2015 09:58 AM

Did anyone get this to work, i would love to have it for my games.


All times are GMT -8. The time now is 06:19 AM.

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