skill macro

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
gioppo
Giant
Posts: 145
Joined: Tue Dec 16, 2008 9:09 am
Location: Torino (Italy)
Contact:

skill macro

Post by gioppo »

Ok here is an hack of the skill macro from pathfinder campaign.
My goal is to add the list of DC for the various skills for usually do not like to search through pages for the DC of a particular action and have no mind to remember them.
Now after having asked you for the skill another dialog appear to ask you for which balance skill (the example is for Balance, but will add more actions for other skills) are you using.
For now it print the DC for the chosen action, but I'm still working on some other stuff.
I'd like to keep the data outside the macro, but how could it be done?
Note that this is to be used with the PC imported from PCgen since it ask for a number in the StatBonus.
Here is the first draft:

Code: Select all

[H: action1Balance = "desc=7-12 inches wide;dc=10;critfail=0;critsuc=0"]
[H: action2Balance = "desc=2-6 inches wide;dc=15;critfail=0;critsuc=0"]
[H: action3Balance = "desc=Less than 2 inches wide;dc=20;critfail=0;critsuc=0"]
[H: action4Balance = "desc=Uneven flagstone;dc=10;critfail=0;critsuc=0"]
[H: action5Balance = "desc=Hewn stone floor;dc=10;critfail=0;critsuc=0"]
[H: action6Balance = "desc=Sloped or angled floor;dc=10;critfail=0;critsuc=0"]

[H: skillAction1= ";"] 
[H: skillAction1 = setStrProp(skillAction1, "1", encode(action1Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "2", encode(action2Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "3", encode(action3Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "4", encode(action4Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "5", encode(action5Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "6", encode(action6Balance))] 
[H: skillActions = ";"] 
[H: skillActions = setStrProp(skillAction1, "Balance", encode(skillAction1))] 

[H: numSkills = countStrProp(Skills)]
[H: skillList = ""]
[H, C(numskills, ""): skillList = skillList + indexKeyStrProp(Skills, roll.count) + ", "]
[H: secret = getStrProp(Private, "SecretSkill")]
[H: secret = if(secret == "", 0, secret)]

[H: success = input(
   "tempSkill | " + skillList + " | Select a skill | LIST | VALUE=STRING SELECT=" + listFind(skillList, getStrProp(Private, "LastSkill")),
   "tempBonus | 0 | Temporary bonus",
   "secret|Public, Secret|Secret?|RADIO|ORIENT=H SELECT=" + secret
)]
[H: abort(success)] 

[H: tSkill = getStrProp(Skills, tempSkill)]
[H: tStatB = getStrProp(SkillStat, tempSkill)]
[H: tACP = ArmorCheckPenalty * getStrProp(SkillArmor, tempSkill)]

[H: tActions = getStrProp(skillActions,tempSkill)]
[H: tActions = decode(tActions)]
[H: numActions = countStrProp(tActions)]
[H: actionList = ""]

[COUNT(numActions, ""), CODE: {
  [H: anAction = decode(indexValueStrProp(tActions, roll.count))]
  [H: actionList = actionList + getStrProp(anAction,"desc") + ", "]
}]

[H: success1 = input(
   "tempAction | " + actionList + " | Select an action for " + tempSkill + " | LIST | VALUE=NUMBER"
)]
[H: abort(success1)] 

[H: theAction = decode(indexValueStrProp(tActions, tempAction))]
[H: actionDesc = getStrProp(theAction,"desc")]
[H: actionDC = getStrProp(theAction,"dc")]

[H: Private = setStrProp(Private, "LastSkill", tempSkill)]
[H: Private = setStrProp(Private, "SecretSkill", secret)]

[H: dieroll = 1d20]
[H: sCheck = dieroll + tSkill + tStatB + tACP + SkillMisc + tempBonus]
[IF(secret == 1 && isGM()), CODE: 
  {
    [H: success = input(
       "junk|" + sCheck + "|" + tempSkill + "Check|LABEL",
       "junk2|DieRoll=" + dieroll + " Skill=" + tSkill + " StatBonus=" + tStatB +" ACP=" + tACP +" SkillMisc=" + SkillMisc +" temp=" + tempBonus +"|Details|LABEL"
    )]
    [H: abort(0)] 
  };
  {
    <b> [R: tempSkill] Check: </b> [T(sCheck):  dieroll + tSkill + tStatB + tACP + SkillMisc + tempBonus]<br/>[R:actionDesc] (DC[R:actionDC])
  }
]

User avatar
gioppo
Giant
Posts: 145
Joined: Tue Dec 16, 2008 9:09 am
Location: Torino (Italy)
Contact:

Re: skill macro

Post by gioppo »

OK here is an update of the macro.
It check actions for skill, check for critical faliure and critical success, and calculate time needed to use skill.
For now just two skill, but is possible to add all the actions for all the skill ... just need time :lol:
In any case any advie is well accepted.
Luca

Code: Select all

[H: action1Balance = "desc=7-12 inches wide;dc=10;critfail=5;critsuc=0;time=1d4;failT=you cannot move for 1 round;critfT=you fall"]
[H: action2Balance = "desc=2-6 inches wide;dc=15;critfail=5;critsuc=0;time=1d4;failT=you cannot move for 1 round;critfT=you fall"]
[H: action3Balance = "desc=Less than 2 inches wide;dc=20;critfail=5;critsuc=0;time=1d4;failT=you cannot move for 1 round;critfT=you fall"]
[H: action4Balance = "desc=Uneven flagstone;dc=10;critfail=5;critsuc=0;time=1d4;failT=you cannot move for 1 round;critfT=you fall"]
[H: action5Balance = "desc=Hewn stone floor;dc=10;critfail=5;critsuc=0;time=1d4;failT=you cannot move for 1 round;critfT=you fall"]
[H: action6Balance = "desc=Sloped or angled floor;dc=10;critfail=5;critsuc=0;time=1d4;failT=you cannot move for 1 round;critfT=you fall"]
[H: skillAction1= ";"] 
[H: skillAction1 = setStrProp(skillAction1, "1", encode(action1Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "2", encode(action2Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "3", encode(action3Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "4", encode(action4Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "5", encode(action5Balance))] 
[H: skillAction1 = setStrProp(skillAction1, "6", encode(action6Balance))] 

[H: action1DD = "desc=Simple;dc=10;critfail=5;critsuc=10;time=1;failT=you can try again;critfT=Activates;critsT=you can bypass without disarm"]
[H: action2DD = "desc=Triky;dc=15;critfail=5;critsuc=10;time=1d4;failT=you can try again;critfT=Activates;critsT=you can bypass without disarm"]
[H: action3DD = "desc=Difficult;dc=20;critfail=5;critsuc=10;time=2d4;failT=you can try again;critfT=Activates;critsT=you can bypass without disarm"]
[H: action4DD = "desc=Wicked;dc=25;critfail=5;critsuc=10;time=2d4;failT=you can try again;critfT=Activates;critsT=you can bypass without disarm"]
[H: skillAction2= ";"] 
[H: skillAction2 = setStrProp(skillAction2, "1", encode(action1DD))] 
[H: skillAction2 = setStrProp(skillAction2, "2", encode(action2DD))] 
[H: skillAction2 = setStrProp(skillAction2, "3", encode(action3DD))] 
[H: skillAction2 = setStrProp(skillAction2, "4", encode(action4DD))] 

[H: skillActions= ";"] 
[H: skillActions = setStrProp(skillActions, "Balance", encode(skillAction1))] 
[H: skillActions = setStrProp(skillActions, "DisableDevice", encode(skillAction2))] 

[H: numSkills = countStrProp(Skills)]
[H: skillList = ""]
[H, C(numskills, ""): skillList = skillList + indexKeyStrProp(Skills, roll.count) + ", "]
[H: secret = getStrProp(Private, "SecretSkill")]
[H: secret = if(secret == "", 0, secret)]

[H: success = input(
   "tempSkill | " + skillList + " | Select a skill | LIST | VALUE=STRING SELECT=" + listFind(skillList, getStrProp(Private, "LastSkill")),
   "tempBonus | 0 | Temporary bonus",
   "secret|Public, Secret|Secret?|RADIO|ORIENT=H SELECT=" + secret
)]
[H: abort(success)] 

[H: tSkill = getStrProp(Skills, tempSkill)]
[H: tStatB = getStrProp(SkillStat, tempSkill)]
[H: tACP = ArmorCheckPenalty * getStrProp(SkillArmor, tempSkill)]

[H: tActions = getStrProp(skillActions,tempSkill)]
[H: tActions = decode(tActions)]
[H: numActions = countStrProp(tActions)]
[H: actionList = ""]

[COUNT(numActions, ""), CODE: {
  [H: anAction = decode(indexValueStrProp(tActions, roll.count))]
  [H: actionList = actionList + getStrProp(anAction,"desc") + ", "]
}]

[H: success1 = input(
   "tempAction | " + actionList + " | Select an action for " + tempSkill + " | LIST | VALUE=NUMBER"
)]
[H: abort(success1)] 

[H: theAction = decode(indexValueStrProp(tActions, tempAction))]
[H: actionDesc = getStrProp(theAction,"desc")]
[H: actionDC = getStrProp(theAction,"dc")]
[H: actionDCcf = getStrProp(theAction,"critfail")]
[H: actionDCcs = getStrProp(theAction,"critsuc")]
[H: actionTime = getStrProp(theAction,"time")]
[H: actionft = getStrProp(theAction,"failT")]
[H: actioncft = getStrProp(theAction,"critfT")]

[H: Private = setStrProp(Private, "LastSkill", tempSkill)]
[H: Private = setStrProp(Private, "SecretSkill", secret)]

[H: dieroll = 1d20]
[H: sCheck = dieroll + tSkill + tStatB + tACP + SkillMisc + tempBonus]
[H: resStr = ""]
[IF(sCheck>=actionDC), CODE: 
{
  [IF(actionDCcs!=0 && sCheck>(actionDC+actionDCcs)),CODE:
  {
   [H:resStr ="High Success: It takes " +eval(actionTime)+" rounds"]
  };
  {
   [H:resStr ="Success: It takes " +eval(actionTime)+" rounds"]
  }
  ]
};
{
  [IF(actionDCcf!=0 && sCheck<(actionDC-actionDCcf)),CODE:
  {
   [H:resStr ="Critical Faliure: " +actioncft]
  };
  {
   [H:resStr="Faliure: " +actionft]
  }
  ]
}
]

[IF(secret == 1 && isGM()), CODE: 
  {
    [H: success = input(
       "junk|" + sCheck + "|" + tempSkill + "Check|LABEL",
       "junk2|DieRoll=" + dieroll + " Skill=" + tSkill + " StatBonus=" + tStatB +" ACP=" + tACP +" SkillMisc=" + SkillMisc +" temp=" + tempBonus +"|Details|LABEL",
       "junk3|"+actionDesc+" (DC="+")"+"|Action|LABEL"
    )]
    [H: abort(0)] 
  };
  {
    <b> [R: tempSkill] Check: </b> [T(sCheck):  dieroll + tSkill + tStatB + tACP + SkillMisc + tempBonus]<br/>[R:resStr]<br/>[R:actionDesc] (DC[R:actionDC])<br/>
  }
]

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: skill macro

Post by Azhrei »

gioppo wrote:OK here is an update of the macro.
It check actions for skill, check for critical faliure and critical success, and calculate time needed to use skill.
This is very cool and I appreciate you sharing the code, but... There are no critical successes or failures for skills. At least, not in the PF Beta nor the SRD.

User avatar
gioppo
Giant
Posts: 145
Joined: Tue Dec 16, 2008 9:09 am
Location: Torino (Italy)
Contact:

Re: skill macro

Post by gioppo »

not so sure.
Take for example Disable Device
If you roll 10 higher you manage to bypass without disarming the device
and if you fail by more than 5 you activat the device.
Not all have this behaviour and this is taken into account (if you set 0 to the crit props)
Luca

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: skill macro

Post by Azhrei »

gioppo wrote:If you roll 10 higher you manage to bypass without disarming the device
and if you fail by more than 5 you activat the device.
Not all have this behaviour and this is taken into account (if you set 0 to the crit props)
Luca
True. But those are not "critical successes or failures", those are just successes or failures. ;) The phrase "critical success" in the SRD, IIRC, means a "roll that always succeeds". The obvious cases being a 20 on an attack roll.

User avatar
gioppo
Giant
Posts: 145
Joined: Tue Dec 16, 2008 9:09 am
Location: Torino (Italy)
Contact:

Re: skill macro

Post by gioppo »

I just needed something to distinguish simple faliure or success from something that is a bit higher faliure and success.
Since there is not a definition around we can invent something for our own we can say BIG :D
Luca

Post Reply

Return to “MapTool”