Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
TalMeta
Member
 
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75

Old August 27th, 2012, 02:57 PM
I'm trying to code a legacy weapon, and want to control the dex bonus it grants as the wielder increases in level.

I tried using

if (#totallevelcount[] >= 17) & (#hasfeat[fToBGLDW]) then
#enhancementbonus[hero.child[aDEX], 6]
elseif (#totallevelcount[] >= 14) & (#hasfeat[fToBL2DW]) then
#enhancementbonus[hero.child[aDEX], 4]
elseif (#totallevelcount[] >= 7) & (#hasfeat[fToBLLDW]) then
#enhancementbonus[hero.child[aDEX], 2]
endif

but it seems to be crapping out on my use of "& (#hasfeat[xxxx]") as it was working fine before I added that bit. Suggestions?
TalMeta is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 27th, 2012, 03:00 PM
Use nested ifs:

Code:
 
if (#hasfeat[fToBLLDW] <> 0) then
  if (#totallevelcount[] >= 17) then
  elseif (#totallevelcount[] >= 14) then
  elseif (#totallevelcount[] >= 7) then
    endif
  endif
Mathias is offline   #2 Reply With Quote
TalMeta
Member
 
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75

Old August 27th, 2012, 03:19 PM
Quote:
Originally Posted by Mathias View Post
Use nested ifs:

Code:
 
if (#hasfeat[fToBLLDW] <> 0) then
  if (#totallevelcount[] >= 17) then
  elseif (#totallevelcount[] >= 14) then
  elseif (#totallevelcount[] >= 7) then
    endif
  endif
Thank you!
TalMeta is offline   #3 Reply With Quote
TalMeta
Member
 
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75

Old August 27th, 2012, 03:43 PM
Okay, so I plug in

if (#totallevelcount[] >= 17) then
if (#hasfeat[fToBGLDW] <> 0) then

elseif (#totallevelcount[] >= 14) then
if (#hasfeat[fToBL2DW] <> 0) then

elseif (#totallevelcount[] >= 7) then
if (#hasfeat[fToBLLDW] <> 0) then
endif
endif
endif
endif

but its no longer giving me the +2 DEX at level 7 when the feat is known (or at any level). Did I miss something?

NVM. My eyes are tired. LOL

Last edited by TalMeta; August 27th, 2012 at 03:49 PM. Reason: duh!
TalMeta is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 27th, 2012, 03:49 PM
Code:
if (#totallevelcount[] >= 17) then
  if (#hasfeat[fToBGLDW] <> 0) then
 
  elseif (#totallevelcount[] >= 14) then
    if (#hasfeat[fToBL2DW] <> 0) then
 
    elseif (#totallevelcount[] >= 7) then
      if (#hasfeat[fToBLLDW] <> 0) then
        endif
      endif
    endif
  endif
I've added indentation to what you wrote - look at how things line up - look at what tests are nested inside other tests. Is that what you intended to code?
Mathias is offline   #5 Reply With Quote
TalMeta
Member
 
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75

Old August 27th, 2012, 04:19 PM
Quote:
Originally Posted by Mathias View Post
Code:
if (#totallevelcount[] >= 17) then
  if (#hasfeat[fToBGLDW] <> 0) then
 
  elseif (#totallevelcount[] >= 14) then
    if (#hasfeat[fToBL2DW] <> 0) then
 
    elseif (#totallevelcount[] >= 7) then
      if (#hasfeat[fToBLLDW] <> 0) then
        endif
      endif
    endif
  endif
I've added indentation to what you wrote - look at how things line up - look at what tests are nested inside other tests. Is that what you intended to code?
Pretty much. I forgot to add back in the "#enhancementbonus[hero.child[aDEX], 2]" bit before. Which is why I came back and edited my post.
TalMeta is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 27th, 2012, 11:12 PM
Don't you want:

Code:
 
if (#totallevelcount[] >= 17) then
  if (#hasfeat[fToBGLDW] <> 0) then
    endif
elseif (#totallevelcount[] >= 14) then
  if (#hasfeat[fToBL2DW] <> 0) then
    endif
elseif (#totallevelcount[] >= 7) then
  if (#hasfeat[fToBLLDW] <> 0) then
    endif
  endif
The way you had it written, it won't do anything until you're level 17. This way, it will check the other two level options if you're not level 17 yet.
Mathias is offline   #7 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 09:42 PM.


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