![]() |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 439
|
1) My bad. That would be "herofield[tCurrSan].value"; as tCurrSan is a field on the hero, the "." which signals a transition, is not needed between hero and field.
2) svWill is not a field on the hero, it its a pick with multiple fields. The Will save would be travelled to by referring to hero.child[svWill], and the total save is stored in the field svTotal. Thus, field[abDC].value += herofield[tCurrSan].value + hero.child[svWill].field[svTotal].value I'm not a programmer, so I'm rather awkward at actually explaining these. I learned a lot of those things through reading the Pathfinder manual (accessible from the Classic application), parts of the Wiki, and by long experimentation and getting started from existing items... Look at the 3-4 stickied thread, they contain lots of info. |
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 32
|
That got rid of the error message, so thank you! The only issue I'm running into now is that I can't seem to get it to display that field[abDC].value anywhere. Do you have any recommendations?
You explained it just fine, and I do understand the differences better than before - speaking as a children's museum science educator, you don't need to be an expert in the field to teach people things that you're passionate about! |
![]() |
![]() |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 439
|
What thing is that field attached to?
|
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 32
|
I'm honestly not sure... How would I attach it to a thing without breaking the code you made?
The only Feat selections/edits I've made besides this eval script are: Feat Category - Mythos Show in Specials List - Checked Sources - Strange Aeons Custom (my general file name) I've tinkered with other options, but nothing seems to make the ability DC appear anywhere. I assume I need to edit the eval script or add a bootstrap of some sort, but I'm not even sure what I would connect together. |
![]() |
![]() |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 439
|
To be more clear, the DC of what ability are you trying to modify with this script? Each thing corresponding to an ability with a DC has a field[abDC].
Last edited by Lord Magus; March 8th, 2023 at 02:36 AM. |
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 32
|
I guess what I'm trying to do is display the DC of the feat itself? There is no specific spell or ability, I just need something to display somewhere on the character what that number is.
I suppose it doesn't need to specifically be a DC, but just a displayed value within the feat display that the users can reference. I did try changing field[abDC].value to field[abValue].value, but still wasn't able to get any numbers to display. Does that help? |
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 32
|
Alternatively, I could go the route of directly increasing the Sanity score itself just to avoid confusion between Sanity Score and Sanity Checks by combining them into one, which may honestly be the better route. The only problem is that reframing the above code doesn't seem to affect anything either.
Code:
herofield[tSanity].value += hero.child[svWill].field[svTotal].value hero.child[svWill].field[svTotal].value as number Except that only produces an error in HL parsing the script. Any advice? |
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,134
|
That's mixing up declaring a variable:
var sanity as number sanity = hero.child[svWill].field[svTotal].value herofield[tSanity].value += sanity With referencing the value on an external thing. Variables only exist within the script that declares them. Referencing a field on a child pick of the hero is looking up a consistent value. |
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 32
|
Ok, I think that makes sense. Variables for a script need to be described and specified in-script, but what those variables are based on from outside of the script also need to be specified and incorporated using 'x as y' and 'x = z' statements before creating the instructions that use those components. Is that generally true?
I did plug your script in as the new eval script, though, and it still doesn't seem to be working. I have nothing else checked or added anywhere in the feat editor except marking it as a Feat Category - Mythos, and the eval script itself is in the Post-Attributes Phase, Priority 10001. |
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,134
|
Huh?
z as y and x = y are COMPLETELY separate things, so that's where you lost me. The only allowed options for variables are "var X as number" and var X as string". I wasn't proposing a new script - you seemed to be confused by variables vs. normal operations, so I was demonstrating how a variable would be used. The example I created was less efficient than what you had, because it was designed for a demonstration, so I did not suggest you use it. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|