damned
July 16th, 2018, 10:10
Hi team,
Im trying to create a string-cycler with numeric values - eg Descriptions shown but Numbers stored.
How do I eliminate the blank value that always appears in all my cyclers?
This is an issue as Im running an onValueChanged script on the cycler and it does some math so when it gets around to the blank value it generates a script error.
Samples of code:
<template name="cycler_cover">
<button_stringcycler>
<parameters>
<labels>None|Light|Heavy|Entrenched</labels>
<defaultlabelres mergerule="replace">None</defaultlabelres>
<values>0|2|4|6</values>
</parameters>
</button_stringcycler>
</template>
[code] <cycler_cover name="five" source="five">
<anchored to="combatframe" position="insidetopright" offset="20,112" width="64" />
<default>0</default>
<script>
function onValueChanged()
local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
local nodeWin = window.getDatabaseNode();
local nReflexes = nodeWin.getChild("abilities.reflexes.tempmodifier").getValue();
local nEquipment = nodeWin.getChild("four").getValue();
local nCover = nodeWin.getChild("five").getValue();
local nDefence = nReflexes+nEquipment+nCover+10;
nodeWin.getChild("defence").setValue(nDefence);
end
</script>
</cycler_cover>
Any suggestions?
Im trying to create a string-cycler with numeric values - eg Descriptions shown but Numbers stored.
How do I eliminate the blank value that always appears in all my cyclers?
This is an issue as Im running an onValueChanged script on the cycler and it does some math so when it gets around to the blank value it generates a script error.
Samples of code:
<template name="cycler_cover">
<button_stringcycler>
<parameters>
<labels>None|Light|Heavy|Entrenched</labels>
<defaultlabelres mergerule="replace">None</defaultlabelres>
<values>0|2|4|6</values>
</parameters>
</button_stringcycler>
</template>
[code] <cycler_cover name="five" source="five">
<anchored to="combatframe" position="insidetopright" offset="20,112" width="64" />
<default>0</default>
<script>
function onValueChanged()
local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
local nodeWin = window.getDatabaseNode();
local nReflexes = nodeWin.getChild("abilities.reflexes.tempmodifier").getValue();
local nEquipment = nodeWin.getChild("four").getValue();
local nCover = nodeWin.getChild("five").getValue();
local nDefence = nReflexes+nEquipment+nCover+10;
nodeWin.getChild("defence").setValue(nDefence);
end
</script>
</cycler_cover>
Any suggestions?