Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
LordValerius
Junior Member
 
Join Date: Oct 2011
Posts: 29

Old October 13th, 2011, 02:45 PM
Quote:
Originally Posted by ShadowChemosh View Post
Hero Lab is a case sensitive language. So helper.quadraped is not the same as Helper.Quadraped.
My bad for not capping it in my description of the problem, but it is properly capped in the script. Error states ->tag 'Helper.Quadraped' not defined.

Val

Last edited by LordValerius; October 13th, 2011 at 02:48 PM.
LordValerius is offline   #11 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old October 13th, 2011, 02:54 PM
Quote:
Originally Posted by LordValerius View Post
My bad for not capping it in my description of the problem, but it is properly capped in the script. Error states ->tag 'Helper.Quadraped' not defined.

Val
LOL try Helper.Quadruped I mean its not getting raped.

That is what I get for trusting Lawful_g and doing a Copy/Paste.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #12 Reply With Quote
LordValerius
Junior Member
 
Join Date: Oct 2011
Posts: 29

Old October 13th, 2011, 02:56 PM
Quote:
Originally Posted by ShadowChemosh View Post
LOL try Helper.Quadruped I mean its not getting raped.

That is what I get for trusting Lawful_g and doing a Copy/Paste.
ROFL...yanno...I looked at that but the bell never rang for me..Sheesh. Ok, noob title still deserved at this point.

Thanks!

Val

Last edited by LordValerius; October 13th, 2011 at 04:13 PM.
LordValerius is offline   #13 Reply With Quote
LordValerius
Junior Member
 
Join Date: Oct 2011
Posts: 29

Old October 13th, 2011, 04:14 PM
Bah, well that fixed the error I was getting but the item doesn't seem to add the increase at all..and it is most likely due to my inability to understand parts of the language...Not sure if I am supposed to be changing any of the script as written in the example...such as lines like 'var newstr as number' and etc. I did type out all the size and quadrUped info as directed, but some of those lines, I just don't understand. This is what I have so far...See any glaring problems? Besides what I probably didn't understand and left in when I shouldn't have? Heh.

doneif (field[gIsEquip].value = 0)

var newstr as number
var newmaxwt as number
var newmedwt as number
var newlitwt as number

~ If we have enhancement bonus 1 or higher, we don't stack, so stop now.
doneif (hero.child[aSTR].field[BonEnhance].value >= 1)

~ Get our strength +1
newstr = hero.child[aSTR].field[aFinalVal].value + 1

~ Generate our new max encumberance...
if (newstr = 29) then
newmaxwt = 1400
elseif (newstr = 28) then
newmaxwt = 1200
elseif (newstr = 27) then
newmaxwt = 1040
elseif (newstr = 26) then
newmaxwt = 920
elseif (newstr = 25) then
newmaxwt = 800
elseif (newstr = 24) then
newmaxwt = 700
elseif (newstr = 23) then
newmaxwt = 600
elseif (newstr = 22) then
newmaxwt = 520
elseif (newstr = 21) then
newmaxwt = 460
elseif (newstr = 20) then
newmaxwt = 400
elseif (newstr = 19) then
newmaxwt = 350
elseif (newstr = 18) then
newmaxwt = 300
elseif (newstr = 17) then
newmaxwt = 260
elseif (newstr = 16) then
newmaxwt = 230
elseif (newstr = 15) then
newmaxwt = 200
elseif (newstr = 14) then
newmaxwt = 175
elseif (newstr = 13) then
newmaxwt = 150
elseif (newstr = 12) then
newmaxwt = 130
elseif (newstr = 11) then
newmaxwt = 115
elseif (newstr = 10) then
newmaxwt = 100
elseif (newstr = 9) then
newmaxwt = 90
elseif (newstr = 8) then
newmaxwt = 80
elseif (newstr = 7) then
newmaxwt = 70
elseif (newstr = 6) then
newmaxwt = 60
elseif (newstr = 5) then
newmaxwt = 50
elseif (newstr = 4) then
newmaxwt = 40
elseif (newstr = 3) then
newmaxwt = 30
elseif (newstr = 2) then
newmaxwt = 20
elseif (newstr = 1) then
newmaxwt = 10
endif

if (hero.tagis[Helper.Quadruped] <> 0) then

if (herofield[tSize].value >= 4) then
newmaxwt *= 24

elseif (herofield[tSize].value >= 3) then
newmaxwt *= 12

elseif (herofield[tSize].value >= 2) then
newmaxwt *= 6

elseif (herofield[tSize].value >= 1) then
newmaxwt *= 3

elseif (herofield[tSize].value >= 0) then
newmaxwt *= 1.5

elseif (herofield[tSize].value >= -1) then
newmaxwt *= 1

elseif (herofield[tSize].value >= -2) then
newmaxwt *= .75

elseif (herofield[tSize].value >= -3) then
newmaxwt *= .50

elseif (herofield[tSize].value >= -4) then
newmaxwt *= .25

endif

if (hero.tagis[Helper.Quadruped] = 0) then

if (herofield[tSize].value >= 4) then
newmaxwt *= 16

elseif (herofield[tSize].value >= 3) then
newmaxwt *= 8

elseif (herofield[tSize].value >= 2) then
newmaxwt *= 4

elseif (herofield[tSize].value >= 1) then
newmaxwt *= 2

elseif (herofield[tSize].value >= 0) then
newmaxwt *= 0

elseif (herofield[tSize].value >= -1) then
newmaxwt *= .75

elseif (herofield[tSize].value >= -2) then
newmaxwt *= .50

elseif (herofield[tSize].value >= -3) then
newmaxwt *= .25

elseif (herofield[tSize].value >= -4) then
newmaxwt *= .125

endif
endif

~ Now that we have the max wt, we need to define out medium encumberance and light encumberance limits. Fortunately they are merely 2/3 and 1/3 of our max, rounded down to the nearest pound.

newmedwt = round(newmaxwt *.66, 0, -1)
newlitwt = round(newmaxwt *.33, 0, -1)

~ Now compare our values to the current encumberance values and adjust them up
var diff as number

diff = newmaxwt - herofield[tEncumHvy].value
herofield[tEncumHvy].value += diff

diff = newmedwt - herofield[tEncumMed].value
herofield[tEncumMed].value += diff

diff = newlitwt - herofield[tEncumLgt].value
herofield[tEncumLgt].value += diff

endif
LordValerius is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old October 13th, 2011, 04:25 PM
You didn't note what phase & priority you are running this script at.

Also, there's a code button among the advanced reply options on this forum - it looks like a "#" - if you post something as code, that preserves the formatting, like indentations. Seeing the indentations you've used would be very helpful in tracking where your ifs and endifs match up.

(You can edit existing posts)

(I think there may be some mis-placed if/endifs among the quadruped section, but I can't quite tell - the quadruped = 0 part may be within the quadruped <> 0 portion).
Mathias is online now   #15 Reply With Quote
LordValerius
Junior Member
 
Join Date: Oct 2011
Posts: 29

Old October 13th, 2011, 05:02 PM
Hmm..Used the Code function in Advanced, but it looks the same to me...As far as Phase and Timing goes...that's a whole different issue...Blah...I think I had it set at Phase - Post Attributes, no specific timing,

Code:
doneif (field[gIsEquip].value = 0)

var newstr as number
var newmaxwt as number
var newmedwt as number
var newlitwt as number

~ If we have enhancement bonus 1 or higher, we don't stack, so stop now.
doneif (hero.child[aSTR].field[BonEnhance].value >= 1)

~ Get our strength +1
newstr = hero.child[aSTR].field[aFinalVal].value + 1

~ Generate our new max encumberance...
if (newstr = 29) then
newmaxwt = 1400
elseif (newstr = 28) then
newmaxwt = 1200
elseif (newstr = 27) then
newmaxwt = 1040
elseif (newstr = 26) then
newmaxwt = 920
elseif (newstr = 25) then
newmaxwt = 800
elseif (newstr = 24) then
newmaxwt = 700
elseif (newstr = 23) then
newmaxwt = 600
elseif (newstr = 22) then
newmaxwt = 520
elseif (newstr = 21) then
newmaxwt = 460
elseif (newstr = 20) then
newmaxwt = 400
elseif (newstr = 19) then
newmaxwt = 350
elseif (newstr = 18) then
newmaxwt = 300
elseif (newstr = 17) then
newmaxwt = 260
elseif (newstr = 16) then
newmaxwt = 230
elseif (newstr = 15) then
newmaxwt = 200
elseif (newstr = 14) then
newmaxwt = 175
elseif (newstr = 13) then
newmaxwt = 150
elseif (newstr = 12) then
newmaxwt = 130
elseif (newstr = 11) then
newmaxwt = 115
elseif (newstr = 10) then
newmaxwt = 100
elseif (newstr = 9) then
newmaxwt = 90
elseif (newstr = 8) then
newmaxwt = 80
elseif (newstr = 7) then
newmaxwt = 70
elseif (newstr = 6) then
newmaxwt = 60
elseif (newstr = 5) then
newmaxwt = 50
elseif (newstr = 4) then
newmaxwt = 40
elseif (newstr = 3) then
newmaxwt = 30
elseif (newstr = 2) then
newmaxwt = 20
elseif (newstr = 1) then
newmaxwt = 10
endif

if (hero.tagis[Helper.Quadruped] <> 0) then

if (herofield[tSize].value >= 4) then
newmaxwt *= 24

elseif (herofield[tSize].value >= 3) then
newmaxwt *= 12

elseif (herofield[tSize].value >= 2) then
newmaxwt *= 6

elseif (herofield[tSize].value >= 1) then
newmaxwt *= 3

elseif (herofield[tSize].value >= 0) then
newmaxwt *= 1.5

elseif (herofield[tSize].value >= -1) then
newmaxwt *= 1

elseif (herofield[tSize].value >= -2) then
newmaxwt *= .75

elseif (herofield[tSize].value >= -3) then
newmaxwt *= .50

elseif (herofield[tSize].value >= -4) then
newmaxwt *= .25

endif

if (hero.tagis[Helper.Quadruped] = 0) then

if (herofield[tSize].value >= 4) then
newmaxwt *= 16

elseif (herofield[tSize].value >= 3) then
newmaxwt *= 8

elseif (herofield[tSize].value >= 2) then
newmaxwt *= 4

elseif (herofield[tSize].value >= 1) then
newmaxwt *= 2

elseif (herofield[tSize].value >= 0) then
newmaxwt *= 0

elseif (herofield[tSize].value >= -1) then
newmaxwt *= .75

elseif (herofield[tSize].value >= -2) then
newmaxwt *= .50

elseif (herofield[tSize].value >= -3) then
newmaxwt *= .25

elseif (herofield[tSize].value >= -4) then
newmaxwt *= .125

endif
endif

~ Now that we have the max wt, we need to define out medium encumberance and light encumberance limits. Fortunately they are merely 2/3 and 1/3 of our max, rounded down to the nearest pound.

newmedwt = round(newmaxwt *.66, 0, -1)
newlitwt = round(newmaxwt *.33, 0, -1)

~ Now compare our values to the current encumberance values and adjust them up
var diff as number

diff = newmaxwt - herofield[tEncumHvy].value
herofield[tEncumHvy].value += diff

diff = newmedwt - herofield[tEncumMed].value
herofield[tEncumMed].value += diff

diff = newlitwt - herofield[tEncumLgt].value
herofield[tEncumLgt].value += diff 

endif

Last edited by LordValerius; October 13th, 2011 at 05:58 PM.
LordValerius is offline   #16 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old October 13th, 2011, 06:07 PM
A helpful thing when you have a lot of tests is to use indentations to make everything clearer.

if
else
elseif

are not indented, but the things within them are indented some amount (we use 2 spaces for each indent for our own code in Hero Lab).

So:

Code:
if (hero.tagis[Helper.Quadruped] <> 0) then
 
  if (herofield[tSize].value >= 4) then
    newmaxwt *= 24
 
  elseif (herofield[tSize].value >= 3) then
    newmaxwt *= 12
When there's lots of if statements, that's useful to me in tracking where one ends and the next begins.
Mathias is online now   #17 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old October 13th, 2011, 06:13 PM
Looks like you need to be after Post-Attributes/1000, and before Post-Attributes/2000.

1950 looks like a good priority, then.
Mathias is online now   #18 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old October 13th, 2011, 06:41 PM
Yeah, that phase/priority looks like it should work, but it is not.

The variables being set return the correct value, but it looks like the value of the herofields are not able to be added to for some reason.

Last edited by Lawful_g; October 13th, 2011 at 06:43 PM.
Lawful_g is offline   #19 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old October 13th, 2011, 07:44 PM
Alright, I finally discovered the problem, in the previous code medium non quadraped characters were multiplying their newmaxstr times 0, when they should have multiplied by 1. Also it looks like some lines in the table round up, and others round down. I changed it to round up here.

Code:
      doneif (field[gIsEquip].value = 0)

      var newstr as number
      var newmaxwt as number
      var newmedwt as number
      var newlitwt as number
      var diff as number

      ~ If we have enhancement bonus 1 or higher, we don't stack, so stop now.
      doneif (hero.child[aSTR].field[BonEnhance].value >= 1)

      ~ Get our strength +1
      newstr = hero.child[aSTR].field[aFinalVal].value + 1

      ~ Generate our new max encumberance...
      if (newstr = 29) then
        newmaxwt = 1400
      elseif (newstr = 28) then
        newmaxwt = 1200
      elseif (newstr = 27) then
        newmaxwt = 1040
      elseif (newstr = 26) then
        newmaxwt = 920
      elseif (newstr = 25) then
        newmaxwt = 800
      elseif (newstr = 24) then
        newmaxwt = 700
      elseif (newstr = 23) then
        newmaxwt = 600
      elseif (newstr = 22) then
        newmaxwt = 520
      elseif (newstr = 21) then
        newmaxwt = 460
      elseif (newstr = 20) then
        newmaxwt = 400
      elseif (newstr = 19) then
        newmaxwt = 350
      elseif (newstr = 18) then
        newmaxwt = 300
      elseif (newstr = 17) then
        newmaxwt = 260
      elseif (newstr = 16) then
        newmaxwt = 230
      elseif (newstr = 15) then
        newmaxwt = 200
      elseif (newstr = 14) then
        newmaxwt = 175
      elseif (newstr = 13) then
        newmaxwt = 150
      elseif (newstr = 12) then
        newmaxwt = 130
      elseif (newstr = 11) then
        newmaxwt = 115
      elseif (newstr = 10) then
        newmaxwt = 100
      elseif (newstr = 9) then
        newmaxwt = 90
      elseif (newstr = 8) then
        newmaxwt = 80
      elseif (newstr = 7) then
        newmaxwt = 70
      elseif (newstr = 6) then
        newmaxwt = 60
      elseif (newstr = 5) then
        newmaxwt = 50
      elseif (newstr = 4) then
        newmaxwt = 40
      elseif (newstr = 3) then
        newmaxwt = 30
      elseif (newstr = 2) then
        newmaxwt = 20
      elseif (newstr = 1) then
        newmaxwt = 10
        endif

      if (hero.tagis[Helper.Quadruped] <> 0) then
        if (herofield[tSize].value >= 4) then
          newmaxwt *= 24
        elseif (herofield[tSize].value >= 3) then
          newmaxwt *= 12
        elseif (herofield[tSize].value >= 2) then
          newmaxwt *= 6
        elseif (herofield[tSize].value >= 1) then
          newmaxwt *= 3
        elseif (herofield[tSize].value >= 0) then
          newmaxwt *= 1.5
        elseif (herofield[tSize].value >= -1) then
          newmaxwt *= 1
        elseif (herofield[tSize].value >= -2) then
          newmaxwt *= .75
        elseif (herofield[tSize].value >= -3) then
          newmaxwt *= .50
        elseif (herofield[tSize].value >= -4) then
          newmaxwt *= .25
          endif
      elseif (hero.tagis[Helper.Quadruped] = 0) then
        if (herofield[tSize].value >= 4) then
          newmaxwt *= 16
        elseif (herofield[tSize].value >= 3) then
          newmaxwt *= 8
        elseif (herofield[tSize].value >= 2) then
          newmaxwt *= 4
        elseif (herofield[tSize].value >= 1) then
          newmaxwt *= 2
        elseif (herofield[tSize].value >= 0) then
          newmaxwt *= 1
        elseif (herofield[tSize].value >= -1) then
          newmaxwt *= .75
        elseif (herofield[tSize].value >= -2) then
          newmaxwt *= .50
        elseif (herofield[tSize].value >= -3) then
          newmaxwt *= .25
        elseif (herofield[tSize].value >= -4) then
          newmaxwt *= .125
          endif
        endif

      ~ Now that we have the max wt, we need to define out medium encumberance and light encumberance limits. Fortunately they are merely 2/3 and 1/3 of our max, rounded up to the nearest pound.
      newmedwt = round(newmaxwt *.66, 0, 1)
      newlitwt = round(newmaxwt *.33, 0, 1)

      ~ Now compare our values to the current encumberance values and adjust them up
      diff = newmaxwt - herofield[tEncumHvy].value
      herofield[tEncumHvy].value += diff

      diff = newmedwt - herofield[tEncumMed].value
      herofield[tEncumMed].value += diff

      diff = newlitwt - herofield[tEncumLgt].value
      herofield[tEncumLgt].value += diff
Lawful_g is offline   #20 Reply With Quote
Reply

Thread Tools
Display Modes

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 05:18 PM.


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