Member
Join Date: Jun 2011
Posts: 36
|
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 Thank you. Last edited by Slywolfe; September 15th, 2011 at 07:25 PM. |
#1 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
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.
|
#2 |
Member
Join Date: Jun 2011
Posts: 36
|
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.
|
#3 |
Senior Member
Join Date: Aug 2010
Location: Dayton, Ohio
Posts: 165
|
field[usrChosen1].ischosen is probably a Boolean (1 or 0) while field[usrChosen1].value is probably the number of the attribute.
|
#4 |
Member
Join Date: Jun 2011
Posts: 36
|
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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). |
#6 |
Member
Join Date: Jun 2011
Posts: 36
|
Quote:
I'll check it out. |
|
#7 |
Member
Join Date: Jun 2011
Posts: 36
|
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. |
#8 |
Junior Member
Join Date: Sep 2011
Posts: 16
|
Try using this in your second script?
#applypenalty[type, pick, bonus] [example ] #applypenalty[BonMorale, hero.child[skStealth], -2] |
#9 |
Member
Join Date: Jun 2011
Posts: 36
|
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. |
#10 |
|
|