Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Slywolfe
Member
 
Join Date: Jun 2011
Posts: 36

Old September 15th, 2011, 06:38 PM
Okay, I'm thinking this is an easy one for anyone with a clue. Sadly, that's apparently not me, as I have gone at this for four hours now.

Anyhoo ...

I simply need a ring with two dropdowns allowing attributes to be selected.

The ring gives +4 enhancement to the first attribute chosen and a -2 to the second attribute chosen.

Please advise. It will help me a great deal to see a functioning script on this with my future item additions.

I currently have this for my evalscripts, two individual scripts ...

Code:
~ If nothing chosen, get out now
doneif (field[usrChosen1].ischosen = 0)

~ If nothing chosen, get out now
doneif (field[usrChosen2].ischosen = 0)

      if (field[gIsEquip].value <> 0) then
      if (field[usrChosen1].ischosen = 1) then
        #enhancementbonus[hero.child[aSTR], 4]
        endif
      if (field[usrChosen1].ischosen = 2) then
        #enhancementbonus[hero.child[aDEX], 4]
        endif
      if (field[usrChosen1].ischosen = 3) then
        #enhancementbonus[hero.child[aCON], 4]
        endif
      if (field[usrChosen1].ischosen = 4) then
        #enhancementbonus[hero.child[aINT], 4]
        endif
      if (field[usrChosen1].ischosen = 5) then
        #enhancementbonus[hero.child[aWIS], 4]
        endif
      if (field[usrChosen1].ischosen = 6) then
        #enhancementbonus[hero.child[aCHA], 4]
        endif
        endif
Code:
~ If nothing chosen, get out now
doneif (field[usrChosen1].ischosen = 0)

~ If nothing chosen, get out now
doneif (field[usrChosen2].ischosen = 0)

      if (field[gIsEquip].value <> 0) then
      if (field[usrChosen2].ischosen = 1) then
        hero.child[aSTR].field[Penalty].value -= 2
        endif
      if (field[usrChosen2].ischosen = 2) then
        hero.child[aDEX].field[Penalty].value -= 2
        endif
      if (field[usrChosen2].ischosen = 3) then
        hero.child[aCON].field[Penalty].value -= 2
        endif
      if (field[usrChosen2].ischosen = 4) then
        hero.child[aINT].field[Penalty].value -= 2
        endif
      if (field[usrChosen2].ischosen = 5) then
        hero.child[aWIS].field[Penalty].value -= 2
        endif
      if (field[usrChosen2].ischosen = 6) then
        hero.child[aCHA].field[Penalty].value -= 2
        endif
        endif
The only issue I'm having here is that no matter what is selected in the second dropdown, the -2 applies to STR. When I remove the second script and select STR in the first dropdown, I get the expected +4.

Thank you.

Last edited by Slywolfe; September 15th, 2011 at 07:25 PM.
Slywolfe is offline   #1 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old September 15th, 2011, 08:55 PM
This is just a guess but change your endif statements to elseif apart from the final endif. It appears that all your code is doing is applying the Strength mod then stopping.
bodrin is offline   #2 Reply With Quote
Slywolfe
Member
 
Join Date: Jun 2011
Posts: 36

Old September 15th, 2011, 08:56 PM
It's definitely running the second section of script, but the -2 penalty always only applies to STR for some reason, no matter the selection in the second dropdown.
Slywolfe is offline   #3 Reply With Quote
ValaraukarU
Senior Member
 
Join Date: Aug 2010
Location: Dayton, Ohio
Posts: 165

Old September 16th, 2011, 04:43 AM
field[usrChosen1].ischosen is probably a Boolean (1 or 0) while field[usrChosen1].value is probably the number of the attribute.
ValaraukarU is offline   #4 Reply With Quote
Slywolfe
Member
 
Join Date: Jun 2011
Posts: 36

Old September 16th, 2011, 06:39 AM
Quote:
Originally Posted by ValaraukarU View Post
field[usrChosen1].ischosen is probably a Boolean (1 or 0) while field[usrChosen1].value is probably the number of the attribute.
I get an error when using .value ...

"... defined with an incompatible style. Expected 'normal'."
Slywolfe is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 16th, 2011, 06:55 AM
Can you think of anything that's already in Hero Lab that grants an enhancement bonus to a selected attribute?

Perhaps for a wizard who's skilled in changing things?

(Physical Enhancement - one of the abilities for the Transmuter school - you'll find it on the Class Specials tab, and you can use "New (Copy)" to take a look at its script).
Mathias is online now   #6 Reply With Quote
Slywolfe
Member
 
Join Date: Jun 2011
Posts: 36

Old September 16th, 2011, 07:03 AM
Quote:
Originally Posted by Mathias View Post
Can you think of anything that's already in Hero Lab that grants an enhancement bonus to a selected attribute?

Perhaps for a wizard who's skilled in changing things?

(Physical Enhancement - one of the abilities for the Transmuter school - you'll find it on the Class Specials tab, and you can use "New (Copy)" to take a look at its script).
Are you implying that I'm not even close with my script?



I'll check it out.
Slywolfe is offline   #7 Reply With Quote
Slywolfe
Member
 
Join Date: Jun 2011
Posts: 36

Old September 16th, 2011, 08:54 PM
Alrighty, I gave it my best with absolutely zero success and an exponential frustration rate.

Can anyone help on this? I didn't think this would be tough at all for those with a better grasp on the scripting, and it would really help me better understand what's going on here!

Thank you.
Slywolfe is offline   #8 Reply With Quote
Starcloud
Junior Member
 
Join Date: Sep 2011
Posts: 16

Old September 16th, 2011, 09:49 PM
Try using this in your second script?

#applypenalty[type, pick, bonus]
[example ] #applypenalty[BonMorale, hero.child[skStealth], -2]
Starcloud is offline   #9 Reply With Quote
Slywolfe
Member
 
Join Date: Jun 2011
Posts: 36

Old September 17th, 2011, 06:08 AM
Thanks for that. I can get the adjustments made just fine, though.

All I really need to know is what values are returned on the dropdown menu selection and how to fetch them for an IF statement.

Slywolfe is offline   #10 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 12:37 PM.


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