I am trying to figure out your Initiative calculations in the Init Tool 1.1. Default D&D settings file, and I don't "get" what is going on there. Have you checked that bit of code lately? It seems a bit strange to me. I have gone back to your original file, just to make sure I didn't mess something up with my work on SWS.
So here are my observations on this issue.
I start with a character with 12's in all stats so the Dex Mod is +1.
I press the INIT button to roll initiative and get a 19, which then shows in the log, the Total box and after the name in list. So far so good. Now I want to see that values that were used so I go to the properties for the character by double-clicking in the list. I open up the Combat tree, then the Initiative Modifier tree. Then I look at the values and they make no sense too me. They are as follows:
Initiative = 19
Initiative Modifier = 0
Initiative Modifier (tree) = 1
Base = 0
Current = 1
Mods = 0
Modifiers = null
Temp = 0
Roll Initiative = 9
Display Roll Initiative = Roll initiative: 6
Now looking at the XML I see:
Code: Select all
<property name="itInitiative" type="NUMBER" group="Combat" display="Initiative"><description>Initiative for this creature.</description></property>
<property name="itInitiativeModifier" type="SCRIPT" group="Combat" display="Initiative Modifier">
<description>The initiative modifier for this creature.</description>
<script>root.initModifier.current</script>
</property>
<property name="initModifier" type="MAP" group="Combat" display="Initiative Modifier" extends="modifiableValue">
<description>The initiative modifier for this creature.</description>
<properties>
<property name="current" type="SCRIPT">
<description>Current initiative modifier.</description>
<script>root.dex.currentMod + totalModifiers + userMod</script>
</property>
<property name="rollInitiative" type="SCRIPT">
<description>Roll the initiative and set it</description>
<script cacheable="false">root.itInitiative = (1d20 + current)</script>
</property>
<property name="displayRollInitiative" type="SCRIPT">
<description>Display the initiative roll.</description>
<script cacheable="false">'Roll initiative: ' + rollInitiative</script>
</property>
</properties>
</property>
So what is really going on here? Then I noticed that as you click on some of the properties in the tree they change values! What is that? That seems very strange. Why would you want those values to change by just clicking the properties?
I'm sure you are already aware of some of this, but if not I'd take a look at this for the next build.
Actually, this part is the first area where it all really seems a bit convoluted and a bit confusing to the user. As you develop this code, I feel pretty sure that you need to come up with a better way to generate/display the dice rolls used here. Users will want assurance of how that number fits into the chain of events. As it is now, perhaps due to my lack of understanding this bit, there is not a clear indicator of the die roll. Not to mention the changing numbers as you view the properties tree and the possible error in this calculation.
For my SWS hacked sheet my calculation is going to be very simple as it is the final total of the characters Initiative Skill, and that is already calculated before I get to the initiative code. I will just need to roll a d20 and add them together for my total Initiative.
But before I can write that code I need to understand what your existing initiative code is actually doing so I can fudge it for Star Wars rules.
One other note while I am here. Going back to the original settings file, I noticed that the editor had removed or changed my code from this starting base. In particular, the 'cacheable="false"' lines have been stripped out in my current version. This must have happened during the early stages when I still trying to do the work in the editor. I am now doing everything in Notepad++ as you suggested earlier. My code doesn't crash with those changes, so it must be alright, but I did not make those changes to the file.
Thanks for listening.
-David