radekg
March 3rd, 2015, 10:46
Hello, I'm trying different permutations of how to call function on a field from attached script but to no avail.
field is defined like:
<number_linked name="attribute">
<source>
<name>attributes.dexterity.user</name>
<op>+</op>
</source>
</number_linked >
number_linked has script "number_linked.lua" attached from CoreRPG. It works great on its own.
What I need to do is to add another source from lua script from "completely" different part of ruleset. number_linked.lua has function "AddSourceWithOp" defined. So I try do something like:
window.getDatabaseNode().getChild("attribute").addSourceWithOp("attributes.strength.step", "+");
It does not allow that with message
attempt to call field 'addSourceWithOp' (a nil value)
I have no idea how can I achieve this. Help?
field is defined like:
<number_linked name="attribute">
<source>
<name>attributes.dexterity.user</name>
<op>+</op>
</source>
</number_linked >
number_linked has script "number_linked.lua" attached from CoreRPG. It works great on its own.
What I need to do is to add another source from lua script from "completely" different part of ruleset. number_linked.lua has function "AddSourceWithOp" defined. So I try do something like:
window.getDatabaseNode().getChild("attribute").addSourceWithOp("attributes.strength.step", "+");
It does not allow that with message
attempt to call field 'addSourceWithOp' (a nil value)
I have no idea how can I achieve this. Help?