Can anyone modify that init macro so it will work with new inputs?
Such as Intuition + Reaction + Initiative Dice (1d6) = Initiative.
I can get into the macro to change the output to look different but I still haven't figured out how these more complex dice pool systems work.
His original macro.
http://forums.rptools.net/viewtopic.php?f=59&t=9002
The input code.
Code: Select all
<!-- Veggiesama's inputInit macro, MapTool B55 -->
[MACRO("checkTokenValidity@this"):""]
[H: unloadLibProps()]
<!-- Recall last inputs -->
[H: lastInit = getStrProp(Last, "Init", 1)]
[H: lastIPs = getStrProp(Last, "IPs", 1)]
[H: lastUseEdge = getStrProp(Last, "UseEdge", 0)]
[H: lastWounds = getStrProp(Last, "InitWounds" , 1)]
[H: status = input(
"init | " + lastInit + " | Initiative | TEXT | WIDTH=4",
"ips | " + lastIPs + " | Init passes| TEXT | WIDTH=4",
"useEdge | " + lastUseEdge + " | Rule of six? | CHECK",
"wounds | Do not include, Include P & S, Include P & S &M | Use wounds | LIST | SELECT="+lastWounds
)]
[H: abort(status)]
<!-- Memorize last inputs -->
[H: Last = setStrProp(Last, "Init", init)]
[H: Last = setStrProp(Last, "IPs", ips)]
[H: Last = setStrProp(Last, "UseEdge", useEdge)]
[H: Last = setStrProp(Last, "InitWounds", wounds)]
<!-- Temporary hack, until this input becomes a full-fledged dialog -->
[H, SWITCH(wounds):
case 0: woundMod = "";
case 1: woundMod = getWoundMod(0);
case 2: woundMod = getWoundMod(1);
]
<!-- Build the dice pool object -->
[H: dicePoolObject = "{}"]
[H: dicePoolObject = json.set(dicePoolObject, "Name", "Initiative Test")]
[H: dicePoolObject = json.set(dicePoolObject, "IPs", ips)]
[H: dicePoolObject = json.set(dicePoolObject, "UseEdge", useEdge)]
[H: dicePoolObject = json.set(dicePoolObject, "DicePool", eval(init+woundMod+""))]
[H: dicePoolObject = json.set(dicePoolObject, "DicePoolString", init)]
[H: dicePoolObject = json.set(dicePoolObject, "DicePoolMod", woundMod)]
[H: dicePoolObject = json.set(dicePoolObject, "DicePoolModString", woundMod)]
[H: dicePoolObject = json.set(dicePoolObject, "Gremlins", 0)]
[H: dicePoolObject = json.set(dicePoolObject, "MinGlitch", MINIMUM_TO_GLITCH)]
[H: dicePoolObject = json.set(dicePoolObject, "Notes", "")]
[MACRO("dice@this"):dicePoolObject]
[H: dicePoolObject = json.merge(dicePoolObject, macro.return)]
[MACRO("setupInit@this"):dicePoolObject]
Code: Select all
<!-- Veggiesama's setupInit macro, MapTool B55 -->
<!-- Initialize variables -->
[H: dicePoolObject = macro.args]
[H: unpackDicePoolObject(dicePoolObject)]
[H: initScore = dicePool + hits]
[H: maptoolInit =
if(length(initScore)==1, "0" + string(initScore), initScore)
+ " / " + string(ips) + " IPs"]
[H: removeFromInitiative()]
[H: addToInitiative()]
[H: setInitiative(maptoolInit)]
[H: sortInitiative()]
<!-- Display the final score -->
<table><tr bgcolor="#a9b7d5"><td>
<b> [R: getName()] = [R: maptoolInit] </b>
</td></tr></table>