PDA

View Full Version : Automatic Linking of Reference Links without Draginfo



sciencephile
September 7th, 2013, 20:53
Greetings, I am creating a ruleset where there are a static list of skills. I also have a reference library that I created to give the definitions of these skills (along with a lot of other game info).

It works to drag from the library to the reference link (because I can take the draginfo information and set it to the database node.

The question is whether anyone knows if one can automatically initialize these reference links to the reference library references (say within the OnInit() function or something similar). It should also test to see if the reference library exists.

Simplified pseudocode:

if reference_library exists then
skill_reflink.setValue(reference_library.link);
end


If it is not possible, no big deal - I can continue to leave it manual. Just thought it would be good to have links automatically generated when the character is created since they never change.

Thanks,
Danny

Moon Wizard
September 7th, 2013, 21:05
You can set the link to any value using:

setValue( windowclassname, recordname)

The record name would be of the form:
<XML data path in module>@<name of module>

You could also change the auto-populate script in most rulesets to include a default link value for each skill that is used when constructing the default skills.

The main issue is that the links will only work when the module is loaded. Otherwise, an error message will be output to chat window.

Regards,
JPG

sciencephile
September 7th, 2013, 23:18
Yeah, I had the intention of testing for the module's existence. It if existed then it pre-populated. I fooled around with it and got errors with the @ sign. I am missing something, I am sure.

JPG, I appreciate your response but I don't want to take up any more time with this. This was a slight nice to have, not really that important. I will leave as the typical "drag" to the sheet to get the link (like the rest of the rulesets, such as Pathfinder). I will go back to more important aspects of ruleset development :-)

Thank you anyway.

Danny