The only oddity is, I decided I wanted the players to be able to "Name" up to 2 Lore skills (PF 2e), so I have a Lore1a, Lore1b, Lore2a, Lore2b set, "A"'s are the names and "B"'s are the modifier. No matter what I do, I can't get the macro to pull the modifier from ONLY the lore keypairs. Everything else works, and I can pull the Names of the Lore pairs just fine. If I ask the macro to roll an Acrobatics check or a Medicine check, it works just fine.
In the code snippet, I even tried using number() on the Lore1 code and just variable = variable on the Lore2 code. Both instances result in a completely blank skill modifier. By putting random [r:] junk text into the if() branches, I know the if() branches are working properly. And if I put a [Lore1b] randomly in the beginning of the macro, I can see that it is pulling a number from the MainSkill property.
What am I missing?
Code: Select all
[h: gmOnly = isNPC()]
[h: varsFromStrProp(MainSkills)]
[h: Lore1 = Lore1a)]
[h: Lore2 = Lore2a)]
[h: status = input(
strformat("skillToRoll|Acrobatics, Arcana, Athletics, Crafting, Deception, Diplomacy, Intimidation, %{Lore1a}, %{Lore2a}, Medicine, Nature, Occultism, Perception, Performance, Religion, Society, Stealth, Survival, Thievery|Skill to Roll|RADIO|SELECT=12 VALUE=STRING"),
strformat("gmOnly|%{gmOnly}|Secret Roll|CHECK")
)]
[h:abort(status)]
[ if(skillToRoll == Lore1), CODE:
{
[h: skillModifier = number(Lore1b)]
};{}]
[ if(skillToRoll == Lore2), CODE:
{
[h: skillModifier = Lore2b]
};{
[h: skillModifier = getStrProp(MainSkills, skillToRoll)]
}]
[h: Random.Roller(20)]
[h: dieRoll = number(outputRoll)]
[h: skillRoll = dieRoll + skillModifier + TempSkillModifier]
[h: totalModifier = skillModifier + TempSkillModifier]
[h: output.tip = strformat("<html>
<table><tr><td colspan=2><b><center>%{skillToRoll} Check</center></b></td></tr>
<tr><td>Skill Modifier:</td><td>%{skillModifier}</td><td>Temporary Modifiers:</td><td>%{TempSkillModifier}</td></tr>
<tr><td>D20 Roll:</td><td>%{dieRoll}</td><td>Final Modifier: %{totalModifier}</td></tr>
</table></html>")]
[h: outputText = strformat("<b>%{skillToRoll}</b> check = %{skillRoll}.")]
[r: nad.lib.Text()]