Junior Member
Join Date: Dec 2014
Posts: 19
|
So I have been trying to create the data for the Uncanny Trickster. I am very new to coding and Hero Lab. I have gotten all of the "Things" created but I don't even know where to start to add the code which will actually add the correct bonuses. Anyone able to help?
I have attached a zip file with my user file. I think that's how this works. Please let me know if you need anything else. |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Apparently I'm blind because you had not one, but two posts. Again, I apologize for completely missing them. I assume this file is not the completed product?
|
#2 |
Junior Member
Join Date: Dec 2014
Posts: 19
|
It's close. All I have left is to figure out how to create a dropdown of skill tricks on the hero and use the selection in the dropdown to increment the number of charges
Last edited by kazlady; December 5th, 2014 at 09:08 AM. Reason: whoops |
#3 |
Junior Member
Join Date: Dec 2014
Posts: 19
|
Quote:
I think the best way to implement favorite trick would be a dropdown that populates with all of the skill tricks a hero has selected. When the user selects a trick from the dropdown, it would increment the number of available charges. Unfortunately, being so new to coding and Hero Lab, I'm not getting that far very quickly. Any suggestions? |
|
#4 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Yes. Here is what you want to put in the Custom Expression field:
Code:
component.BaseSklTr For your eval script (to increase the number of charges), use the following: Final Phase/1000 Code:
doneif (field[usrChosen1].ischosen = 0) field[usrChosen1].chosen.field[hTotal].value += 1 |
#5 |
Junior Member
Join Date: Dec 2014
Posts: 19
|
WOOHOO!! Worked perfectly. The dropdown populated exactly the way I wanted it to.
Next step is to make it so each skill trick can only be selected once. I don't think the UniqueID thing will work here because I have to grant "Favorite Trick" up to 3 times. I'm thinking I need an if statement in the eval script that omits any skills that already have more than 1 charge. On a side note, most of the problems I'm having are a lack of vocabulary. Is there a glossary of objects I could be referring to? Like something that tells me how to refer to the charges field or describes the object hierarchy in the editor so I can figure out how to get one thing to talk to another? Like I said. I am a complete noob at this so any help is appreciated. |
#6 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Post-Levels/1000 Code:
doneif (hero.childfound[cFavTrick1].field[usrChosen1].ischosen = 0) var srchxpr as string srchxpr = hero.childfound[cFavTrick1].field[usrChosen1].chosen.tagids[thingid.?] field[usrCandid1].text &= " & !" & srchxpr Quote:
Pathfinder has more than d20, so you have to be careful, but most of what is stated there does apply. I reference if quite often. It's also good to check out other things from the community set that do something similar to what you are doing to see how that was coded. Finally, another trick is to look at the fields and tags on things from the portfolio. You can do this a couple of different ways. For instance, in the Skills tab, you can right-click on a skill or skill trick, and select "Show Debug Tags" or "Show Debug Fields". You can also access them through the Develop menu: Develop -> Floating Info Windows -> Show Selection Tags (or Fields) Selecting one of these will bring up a menu of all the things attached to that hero. You can then select which thing you want to look at. If this option is grayed out, select Enable Data File Debugging. This will also allow you to reload code in the portfolio using CTRL-R. |
||
#7 |
Junior Member
Join Date: Dec 2014
Posts: 19
|
Quote:
|
|
#8 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Favored Trick, third level script:
Post-Levels 1001 Code:
if (hero.childfound[cFavTrick1].field[usrChosen1].ischosen <> 0) then var srchxpr as string srchxpr = hero.childfound[cFavTrick1].field[usrChosen1].chosen.tagids[thingid.?] field[usrCandid1].text &= " & !" & srchxpr endif if (hero.childfound[cFavTrick2].field[usrChosen1].ischosen <> 0) then var srchxpr2 as string srchxpr2 = hero.childfound[cFavTrick2].field[usrChosen1].chosen.tagids[thingid.?] field[usrCandid1].text &= " & !" & srchxpr2 endif |
#9 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
|
|
#10 |
|
|