Eclipse Phase: Skill Rolls

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Crouchingtabby
Kobold
Posts: 4
Joined: Sun Apr 04, 2010 11:28 am

Eclipse Phase: Skill Rolls

Post by Crouchingtabby »

Ok, so I'm still new at this but learning fast. I'm making a skill rolling macro for Eclipse phase. I can easily add skills to properties and automate the first part so that difficulty is the only user input, but for now I'm just getting a user input for skill level and difficulty modifier.

So, the current macro does a percentile roll and compares it to the required target number, then tells you your margin of success or failure. However, I am at a loss as to how to indicate a critical/excellent success or failure. For those not familiar with eclipse phase, there are two types of "criticals." Excellent Success (or terrible failure) and a critical Success/failure. Excellent success is any percentile roll 30+ under the target number, (visa versa for terrible failures) and Criticals happen on doubles (failure if the number is higher than the target, success if lower). 99 is always a critical fail, and 100 is always a critical success.

So...

1) how can I compare the "Margin" to see if it is 30 or higher, and display "Terrible Failure" or "Excellent Success"?
2) How can I compare Skillroll to see if it is a 11,22,33,44,55,66,77,88,99, or 100 and display "Critical Success" or
Critical Failure"?

If a roll were both a critical success and an excellent success, both would need to appear. Thanks for any assistance!


{input("Skill","Difficulty")}
[h:SkillRoll = 1d100]
[h:Skill = Skill]
[h:Difficulty = Difficulty]
[h:TargetNumber = Difficulty+ Skill]

[h,if(SkillRoll <= TargetNumber), code:
{
[SkillResult = "SUCCEEDED"]
[Margin = TargetNumber-SkillRoll]
};
{
[SkillResult = "FAILED"]
[Margin = SkillRoll-TargetNumber]
Case 2
}]
You rolled a {SkillRoll} and needed a {TargetNumber} <BR>
YOU {SkillResult} BY {Margin}

the_meek
Cave Troll
Posts: 99
Joined: Fri Aug 01, 2008 9:18 am

Re: Eclipse Phase: Skill Rolls

Post by the_meek »

Assuming I understand (which is rarely safe), these will test for #2:

Code: Select all

[R, IF(Skillroll / 11 == floor(Skillroll / 11)): "Critical"]
[R, IF(Skillroll == 99): "Critical failure"]
[R, IF(Skillroll == 100): "Critical success"]
You could just throw that at the end.

User avatar
humupower
Cave Troll
Posts: 31
Joined: Mon Jul 23, 2007 10:50 am
Location: Cincinnati, Ohio

Re: Eclipse Phase: Skill Rolls

Post by humupower »

I am not an expert with writing macros, but I think option #1 would look something like this - these codes may not work as is, the syntax may not be quite right, but the logic should be right or close to right.

[h: margin = absolutevalue(Skillroll - RequiredSkillRoll)]
[h: if(Skillroll <= RequiredSkillRoll): Result = "Success"; Result = "Failure"]
[if(margin >= 30): "Excellent "; ""]
[Result]

If the margin is not more than 30 it will only show you "success" or "failure". If it is >30 you will get an output that looks something like

"Excellent"
"Success"


What you may need to do is weave these two suggestions(mine and the last guy) together with a slight bit of logical restructuring -
so it will judge if it is a critical and an excellent outcome or failure.

What you can do is use a few if statements
and so something like this
If critical then result = add(result, "critical")
If margin >= 30 excellent, result = add(result, "excellent")
If success or failure, result = add(result, "success") or result = add(result, "failure")

And then you can display [result] at the end which will have an additional piece added on by each if statement.

The final output will spit out "critical excellent success", or "failure", or "major failure", or "critical failue"... depending on the "piece" of the result that gets added to each string by each if statement.
Humuhumunukunukuapua'a!

Crouchingtabby
Kobold
Posts: 4
Joined: Sun Apr 04, 2010 11:28 am

Re: Eclipse Phase: Skill Rolls

Post by Crouchingtabby »

Thanks guys! Here's what I finally came up with--I was tinkering and didn't see your post about dividing by 11 so the code isn't as clean as it might be if I'd used that, but here it is. It's not perfect, since you can still for instance roll a 100 and it will indicate that you had a severe failure, but at least it also prints in bold that a critical success overrides that. It still prints a few numbers which I assume are variables that I can't figure out how to get rid of--but it doesn't affect the outcome, it just looks a little messy still.

{input("Skill","Difficulty")}
[h:SkillRoll = 1d100]
[h:Skill = Skill]
[h:Critical = 0]
[h:Difficulty = Difficulty]
[h:TargetNumber = Difficulty+ Skill]

[h,if(SkillRoll <= TargetNumber), code:
{
[SkillResult =1]
[Margin = TargetNumber-SkillRoll]
};
{
[SkillResult =0]
[Margin = SkillRoll-TargetNumber]
}]
[h,if(Margin<30 && Skillresult==1): SuccessType=1]
[h,if(Margin<30 && Skillresult==0): SuccessType=2]
[h,if(Margin>30 && Skillresult==1): SuccessType=3]
[h,if(Margin>30 && Skillresult==0): SuccessType=4]

[r,if(Successtype==1): "Normal Success"]
[r,if(Successtype==2): "Normal Failure"]
[r,if(Successtype==3): "Excellent Success"]
[r,if(Successtype==4): "Severe Failure"]
<BR>

Your Skill level is {Skill}. <BR>
Difficulty Modifier is {Difficulty}
You rolled a {SkillRoll} and needed a {TargetNumber} or less <BR>

[r,if(SkillRoll==11 || SkillRoll==22 ||SkillRoll==33 ||SkillRoll==44 ||SkillRoll==55 ||SkillRoll==66 ||SkillRoll==77 ||SkillRoll==88 ): Critical=1]
[r,if(SkillRoll==99): Critical=2]
[r,if(SkillRoll==100): Critical=3]
<b>
[r,if(Critical==1 && SkillResult==1): "CRITICAL SUCCESS"]
[r,if(Critical==1 && SkillResult==0): "CRITICAL FAILURE"]
[r,if(Critical==2): "CRITICAL FAILURE OVERRIDE"]
[r,if(Critical==3): "CRITICAL SUCCESS OVERRIDE"]
<B>

Littlespoon
Kobold
Posts: 7
Joined: Tue May 04, 2010 2:51 am

Re: Eclipse Phase: Skill Rolls

Post by Littlespoon »

Im also intrested in EP macros and have so far managed to cobble together this macro from some examples and the ones above:

Code: Select all

[H: status = input(
  "targetnumber | 42 | Target Number"
)]
[H: abort(status)]

[H: dieroll = 1d100]

[H: margin = absolutevalue(targetnumber -  dieroll) ]
[if(dieroll <= targetnumber): Result = "Success"; Result = "Failure"]
[if(margin >= 30): "Excellent "; ""]

<b>Skill Rolll: <span style="color:red">{dieroll}</span> Vs <span style="color:green"> {targetnumber}</span>. Margin of {Result}<span style="color:blue"> {margin}</span>.</b>
[R, if(dieroll / 11 == floor(dieroll / 11)) : "Critical"]
But it shows like:
« Result = "Failure" = Result = "Failure" = Failure » « "Excellent " = "Excellent " = Excellent  » Skill Rolll: 76 Vs 42. Margin of Failure 34.

Could anybody help me remove the << Result = Failure" =..blah blah up to Skill Roll please. Note the 42 is just a place holder till i link it to some token stats.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Eclipse Phase: Skill Rolls

Post by Rumble »

Littlespoon wrote:Im also intrested in EP macros and have so far managed to cobble together this macro from some examples and the ones above:

Code: Select all

[H: status = input(
  "targetnumber | 42 | Target Number"
)]
[H: abort(status)]

[H: dieroll = 1d100]

[H: margin = absolutevalue(targetnumber -  dieroll) ]
[if(dieroll <= targetnumber): Result = "Success"; Result = "Failure"]
[if(margin >= 30): "Excellent "; ""]

<b>Skill Rolll: <span style="color:red">{dieroll}</span> Vs <span style="color:green"> {targetnumber}</span>. Margin of {Result}<span style="color:blue"> {margin}</span>.</b>
[R, if(dieroll / 11 == floor(dieroll / 11)) : "Critical"]
But it shows like:
« Result = "Failure" = Result = "Failure" = Failure » « "Excellent " = "Excellent " = Excellent  » Skill Rolll: 76 Vs 42. Margin of Failure 34.

Could anybody help me remove the << Result = Failure" =..blah blah up to Skill Roll please. Note the 42 is just a place holder till i link it to some token stats.

Go to Edit > Preferences and check "Use Tooltips for Inline Rolls" on the right hand side of the first tab.

Akodo Makama
Giant
Posts: 249
Joined: Mon Apr 20, 2009 9:31 pm

Re: Eclipse Phase: Skill Rolls

Post by Akodo Makama »

Littlespoon wrote:

Code: Select all

[if(dieroll <= targetnumber): Result = "Success"; Result = "Failure"]
[if(margin >= 30): "Excellent "; ""]

<b>Skill Rolll: <span style="color:red">{dieroll}</span> Vs <span style="color:green"> {targetnumber}</span>. Margin of {Result}<span style="color:blue"> {margin}</span>.</b>
[R, if(dieroll / 11 == floor(dieroll / 11)) : "Critical"]
Check out the roll formatting options. Without a format option (like r: or h:), MapTool will default to the unformated (u:) option, which has all the <<>> markup.

http://lmwcs.com/rptools/wiki/Macros:Roll:types

Shosuro
Kobold
Posts: 2
Joined: Tue Dec 10, 2013 4:17 am

Re: Eclipse Phase: Skill Rolls

Post by Shosuro »

This works for me quite nicely.

I just forwarded the 1d100-1 throw (0-99) to a library token as I want to expand the framework. Also Bonus and Target I used some fixed values here.
Spoiler
<!-- Comment: Definition of variables --->
[h:Target = 50]
[h: Bonus = 10]
[h:grade = ""]
[h:result = ""]

<!-- Comment: Pass to library token --->

[h:passedVariables = json.append( "", Bonus)]
[macro("Roll_dice@Lib:Dice"): passedVariables]
[h: roll = macro.return]

<!-- Comment: define result value --->
[h:margin = absolutevalue(roll-target)]
[h, if(roll <= target): result = "Success"; result = "Failure"]
[h, if(margin >=30 && result == "Success"): grade = "Excellent"]
[h, if(margin >=30 && result == "Failure"): grade = "Severe"]
[r, if(roll / 11 == floor(roll / 11)): grade ="Critical"]
[r, if(roll == 99): result = "Failure"]
[r, if(roll == 00): result = "Success"]

<!-- Comment: Output --->
<br><span style="color:red">Roll of [r:roll] incl. Bonus of [r:Bonus] vs. [r: Target]. Margin of [r:result] of [r: margin] ==> [r:grade] [r:result]

Post Reply

Return to “Macros”