Retrieving the name of a parent on a pick
This is probably something super-obvious that I'm just not getting at the moment, but I have Components for certain skill bonuses in my system like the following:
Code:
<!-- SkillBonus component --> Code:
<thing Code:
<thing id="bckCrime" name="Crime Lord" description="You probably didn’t get your lawless hands very dirty, but you definitely know some people who did — and they did it on your orders.\n\n{b}Bonus Skill Ranks:{/b} +2 Deceive, +2 Economics {i}or{/i} History, +2 Inspire {i}or{/i} Negotiate" compset="Bckgrnd" uniqueness="unique"> |
Ah, I think "root" is what I want.
|
Hmm... and either I misunderstand something about field histories or I implemented this incorrectly. My current SkillBonus:
Code:
<!-- SkillBonus component --> Code:
perform field[usrChosen1].chosen.field[trtBG].modify[+,bonus,field[skbName].text] Code:
<mouseinfo mousepos="middle+above"><![CDATA[ |
And, with further debug statements, it seems that I'm not getting the field I expect. field[skbName] is empty at the time of evaluation.
|
I am pretty sure that finalize script is meant to set a value for the UI. Meaning its done very late in processing. For example from Pathfinder the abDC field would finalize with a script that sets a value of "DC X" where X is the value of abDC.
I think you want to not use a finalize script and instead use a component script that runs semi early so that skbName gets a name. This way you are 100% in control of when the script executes. :) |
Also, I would not use a static field for something you intend to use a finalize script for. I'm not certain about it, but that seems likely to run into HL's speed optimizations - where if a field's doesn't change, HL doesn't recalculate things based on it, which may include the finalize script - see the acHPSumm field in actor.str in the skeleton files for an example of how a field that's only used for its finalize value has been set up - as a numerical derived field that stores a value that's designed to change if any of the elements that go into it change, and then with the finalize script to handle the text.
|
But, in order to use the field in a history, you'll need to change it to be a derived string field (skip the finalize), and make sure to set it before the script that's trying to use it to build the text for the history entry.
|
Minor follow-up, that's exactly what I needed to do, was to move it into an eval and do it earlier.
Code:
<!-- SkillBonus component --> |
All times are GMT -8. The time now is 05:19 AM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.