Help with Skill check Marco

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
Envyus
Cave Troll
Posts: 57
Joined: Thu Sep 13, 2012 2:56 am

Help with Skill check Marco

Post by Envyus »

To be exact I found a good skill check macros that I really like. But I don't understand macros too well so I am only capable of doing very basic edits. I want to edit my marco in a way that makes it so I can add the 5e advantage disadvantage system in. This is pretty easy normally I just make it so that the numbers repeat twice and we take first number unless it is in play. I just can't figure out how to do that on this macro.

Code: Select all

[h: success = input("Skill | Acrobatics, AnimalHandling, Arcana, Athletics, Deception, History, Insight, Intimidation, Investigation, Medicine, Nature, Perception, Performance, Persuasion, Religion, SleightofHand, Stealth, Survival  
 | Roll: | RADIO|value=string")]    [H: abort(success)]    [H: Result = ""]  <table><tr><td><span><b>Skill Check</b> <tr><td><b>[Skill]</b></td></tr>  - Natural Roll: [Roll = 1d20] <br> 
[H:Result = if(Skill== "Acrobatics",Roll+Acrobatics+DexMod, Result)] 
[H:Result = if(Skill== "AnimalHandling",Roll+AnimalHandling+WisMod, Result)]
[H:Result = if(Skill==  "Arcana",Roll+Arcana+IntMod, Result)] 
[H:Result = if(Skill== "Athletics",Roll+Athletics+StrMod, Result)]
[H:Result = if(Skill==  "Deception",Roll+Deception+ChaMod, Result)] 
[H:Result = if(Skill== "History",Roll+History+IntMod, Result)] 
[H:Result = if(Skill== "Insight",Roll+Insight+WisMod, Result)] 
[H:Result = if(Skill== "Intimidation",Roll+Intimidation+ChaMod, Result)] 
[H:Result = if(Skill==  "Investigation",Roll+Investigation+IntMod, Result)]
[H:Result = if(Skill== "Medicine",Roll+Medicine+WisMod, Result)] 
[H:Result = if(Skill== "Nature",Roll+Nature+IntMod, Result)] 
[H:Result = if(Skill== "Perception",Roll+Perception+WisMod, Result)] 
[H:Result = if(Skill==  "Performance",Roll+Performance+ChaMod, Result)] 
[H:Result = if(Skill==  "Persuasion",Roll+Persuasion+ChaMod, Result)] 
[H:Result = if(Skill== "Religion",Roll+Religion+IntMod, Result)] 
[H:Result = if(Skill== "SleightofHand",Roll+SleightofHand+DexMod, Result)] 
[H:Result = if(Skill== "Stealth",Roll+Stealth+DexMod, Result)] 
[H:Result = if(Skill==  "Survival",Roll+Survival+WisMod, Result)]  - Total: <b>[Result]</b>

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Help with Skill check Marco

Post by Irrlicht »

To add advantage/disadvantage, edit the initial input() as follows (note that there is no need to assign the input to a variable (success) and add a separate [H: abort(success)]; you can remove the separate abort() and do:

Code: Select all

[h: abort(input(
"Skill|Acrobatics, AnimalHandling, Arcana, Athletics, Deception, History, Insight, Intimidation, Investigation, Medicine, Nature, Perception, Performance, Persuasion, Religion, SleightofHand, Stealth, Survival|Roll|RADIO|VALUE=STRING",
"Advantage|None, Advantage, Disadvantage|Adv/Disadv|RADIO|VALUE=STRING"
))]
Then add immediately after [Roll = 1d20]:

Code: Select all

[h, if(Advantage == "Advantage"): Roll = max(Roll, 1d20)]
[h, if(Advantage == "Disadvantage"): Roll = min(Roll, 1d20)]
And to make the use of Adv/Disadv visible in the chat output (so that a player can't cheat and use advantage without anyone knowing, for example), add at the end of the macro:

Code: Select all

[r, if(Advantage != "None"): " -" + Advantage + " gained-"]


That macro could be made better in many ways, but for that, more informations are needed. Is every single skill a different token property? They'd better be grouped in a json object.

But in case they're all separate, instead of a separate IF for each skill, you can do the following:

Code: Select all

<!-- Set statMod as the mod of the most used stat among skills (I guess Int). -->
[h: statMod = IntMod]

<!-- Make lists of skill divided per stat used, then set statMod as the actual mod, if the chosen skill doesn't use the most common stat. -->
[h: StrSkillList = "StrSkill1, StrSkill2, StrSkill3, etc."]
[h: DexSkillList = "DexSkill1, DexSkill2, DexSkill3, etc."]
[h: ConSkillList = "ConSkill1, ConSkill2, ConSkill3, etc."]
[h: WisSkillList = "WisSkill1, WisSkill2, WisSkill3, etc."]
[h: ChaSkillList = "ChaSkill1, ChaSkill2, ChaSkill3, etc."]

[h, if(listContains(StrSkillList, Skill) == 1): statMod = StrMod]
[h, if(listContains(DexSkillList, Skill) == 1): statMod = DexMod]
[h, if(listContains(ConSkillList, Skill) == 1): statMod = ConMod]
[h, if(listContains(WisSkillList, Skill) == 1): statMod = WisMod]
[h, if(listContains(ChaSkillList, Skill) == 1): statMod = ChaMod]

[h: Result = getProperty(Skill) + statMod]
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

Envyus
Cave Troll
Posts: 57
Joined: Thu Sep 13, 2012 2:56 am

Re: Help with Skill check Marco

Post by Envyus »

All the skills are separate Token Properties. Cause I have no idea what I json object is. I did not make this macro. (Though I did edit it to work for my game changing skill names around and such.)

Anyway I will try this out.

In fact there are a ton of ways I could make my properties better. But I almost don't want to because it would mean starting over and redoing most of the tokens I have created.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Help with Skill check Marco

Post by Irrlicht »

Eh, been there more than once, having to remake things from the start, but at a certain point, if you want to improve things, you have to do it.

Anyway, a json object is like a box with lots of properties and values in it (or well, not lots, but as many as you need, and you can always add more or remove some).
For example:
["Str":12,"Dex":15,"Con":11]
They're keys:values, and values can be children json objects.
For example:
["Acrobatics":{"Stat":"Dex","Ranks":4,"Other":0},"Bluff":{"Stat":"Cha","Ranks":2,"Other":2}]

There are also json arrays, which instead of key:value pairs are lists of values.
For example:
["Bedroll","Blanket","Whetstone"]
And they can be combined with json objects.

Look up json functions in the wiki to learn how to use them, starting with jsonSet() and jsonGet().
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Help with Skill check Marco

Post by wolph42 »

["Str":12,"Dex":15,"Con":11]
bad example (wrong even, as is the other example), I think you mean
{"Str":12,"Dex":15,"Con":11}

if you are familiar with variable and value, e.g. [x=5] (so variable 'x' has the value '5') then there are different 'types' of values. These are:

number: 5

string: "hello" or "5" (note the difference with the number)

list: "1,2,3,4,5" or "one, two, three, whatever, etc, andsoon"

strproplists: "str=12;dex=15;con=11"

(json)array:["str=5", "str=6", "str=12", "con=2"] or [1,2,3,4,10] or ["one", "two", "hello there"] (basically a 'list' with brackets and values with quotes, but with extra functionality)

and

(json)objects:{"Str":12,"Dex":15,"Con":11} (again a list, but ALWAYS in a "key":"value" pair combination, where EVERY key must be unique!!!)

(I might forget a type, but these are the main ones)

all these types have their own advantage and their own function() set to operate them.
For these different types, the placement of the "quotes" [brackets] and {braces} are ESSENTIAL, which is why the former example was wrong, it was a mix up of an array and an object. To make things really complex, you *can* mix up the types but its tricky. Most common is the array of objects e.g.:
[{"str":12},{"str":"no value"},{"str":14}] this you do when you want to use non-unique keys in objects. And thus you can have a stringproperty list inside a 'normal' list inside an object inside an array.

Concerning the earlier discussion, I would strongly suggest the use of strPropLists.

as for the code request and Irlichts suggestions, the most important change is to structure your code into INPUT, PROCES and OUTPUT. Mixing up those three is usually a bad thing.
so I would do it like this

Code: Select all

<!-- INPUT -->
[h:abort(input(
    "skill | Acrobatics, AnimalHandling, Arcana, Athletics, Deception, History, Insight, Intimidation, Investigation, Medicine, Nature, Perception, Performance, Persuasion, Religion, SleightofHand, Stealth, Survival|Roll:|RADIO|value=string"),
    "advantage|None, Advantage, Disadvantage|Adv/Disadv|RADIO|VALUE=STRING"
))]

<!-- PROCESSING -->
[h,switch(skill):
    case "Acrobatics":        result    = Acrobatics        + DexMod;
    case "AnimalHandling":    result    = AnimalHandling    + WisMod;
    case "Arcana":            result    = Arcana            + IntMod;
    case "Athletics":        result    = Athletics            + StrMod;
    case "Deception":        result    = Deception            + ChaMod;
    case "History":            result    = History            + IntMod;
    case "Insight":            result    = Insight            + WisMod;
    case "Intimidation":    result    = Intimidation        + ChaMod;
    case "Investigation":    result    = Investigation        + IntMod;
    case "Medicine":        result    = Medicine            + WisMod;
    case "Nature":            result    = Nature            + IntMod;
    case "Perception":        result    = Perception        + WisMod;
    case "Performance":        result    = Performance        + ChaMod;
    case "Persuasion":        result    = Persuasion        + ChaMod;
    case "Religion":        result    = Religion            + IntMod;
    case "SleightofHand":    result    = SleightofHand        + DexMod;
    case "Stealth":            result    = Stealth            + DexMod;
    case "Survival":        result    = Survival            + WisMod;
    default: broadcast("ERROR: apparently a typo has been made in the skill list. Check the code for Skill: "+skill)
]

[h:roll    = 1d20]
[h,if(advantage == "Advantage"):    roll = max(roll, 1d20)]
[h,if(advantage == "Disadvantage"):    roll = min(roll, 1d20)]

<!-- OUTPUT -->

<b>Skill Check: [r:Skill]</b> - Natural Roll result: <i>[r:roll]</i> - Total: <b><i>[roll + result]</b></i> (Advantage: [r:advantage])
 

User avatar
Dervish
Giant
Posts: 121
Joined: Thu Sep 15, 2011 7:52 pm

Re: Help with Skill check Marco

Post by Dervish »

I deal with skills in three parts the first of which is inputting them. In this scenario Each skill is its own object optimally i would like to see all skill information under one object as it would clean up the token a bit

Code: Select all

[h:AcrPro = json.get(Acrobatics,"Proficient")]
[h:AcrExp = json.get(Acrobatics,"Expert")]
[h:ArcPro = json.get(Arcana,"Proficient")]
[h:ArcExp = json.get(Arcana,"Expert")]
[h:AthPro = json.get(Athletics,"Proficient")]
[h:AthExp = json.get(Athletics,"Expert")]
[h:DecPro = json.get(Deception,"Proficient")]
[h:DecExp = json.get(Deception,"Expert")]
[h:HisPro = json.get(History,"Proficient")]
[h:HisExp = json.get(History,"Expert")]
[h:HusPro = json.get(Husbandry,"Proficient")]
[h:HusExp = json.get(Husbandry,"Expert")]
[h:InsPro = json.get(Insight,"Proficient")]
[h:InsExp = json.get(Insight,"Expert")]
[h:IntPro = json.get(Intimidation,"Proficient")]
[h:IntExp = json.get(Intimidation,"Expert")]
[h:InvPro = json.get(Investigation,"Proficient")]
[h:InvExp = json.get(Investigation,"Expert")]
[h:MedPro = json.get(Medicine,"Proficient")]
[h:MedExp = json.get(Medicine,"Expert")]
[h:NatPro = json.get(Nature,"Proficient")]
[h:NatExp = json.get(Nature,"Expert")]
[h:PercPro = json.get(Perception,"Proficient")]
[h:PercExp = json.get(Perception,"Expert")]
[h:PerfPro = json.get(Performance,"Proficient")]
[h:PerfExp = json.get(Performance,"Expert")]
[h:PersPro = json.get(Persuasion,"Proficient")]
[h:PersExp = json.get(Persuasion,"Expert")]
[h:PrePro = json.get(Prestidigitation,"Proficient")]
[h:PreExp = json.get(Prestidigitation,"Expert")]
[h:RelPro = json.get(Religion,"Proficient")]
[h:RelExp = json.get(Religion,"Expert")]
[h:StePro = json.get(Stealth,"Proficient")]
[h:SteExp = json.get(Stealth,"Expert")]
[h:SurPro = json.get(Survival,"Proficient")]
[h:SurExp = json.get(Survival,"Expert")]

[h:status = input(
	"Tab1|Proficiency||Tab",     
	"AcrobaticsPro|"+AcrPro+"|Acrobatics|Check",
	"ArcanaPro|"+ArcPro+"|Arcana|Check",
	"AthleticsPro|"+AthPro+"|Athletics|Check",
	"DeceptionPro|"+DecPro+"|Deception|Check",
	"HistoryPro|"+HisPro+"|History|Check",
	"HusbandryPro|"+HusPro+"|Husbandry|Check",
	"InsightPro|"+InsPro+"|Insight|Check",
	"IntimidationPro|"+IntPro+"|Intimidation|Check",
	"InvestigationPro|"+InvPro+"|Investigation|Check",
	"MedicinePro|"+MedPro+"|Medicine|Check",
	"NaturePro|"+NatPro+"|Nature|Check",
	"PerceptionPro|"+PercPro+"|Perception|Check",
	"PerformancePro|"+PerfPro+"|Performance|Check",
	"PersuasionPro|"+PersPro+"|Persuasion|Check",
	"PrestidigitationPro|"+PrePro+"|Prestidigitation|Check",
	"ReligionPro|"+RelPro+"|Religion|Check",
	"StealthPro|"+StePro+"|Stealth|Check",
	"SurvivalPro|"+SurPro+"|Survival|Check",

	  "Tab2|Expert||Tab",
	 "AcrobaticsExp|"+AcrExp+"|Acrobatics|Check",
	"ArcanaExp|"+ArcExp+"|Arcana|Check",
	"AthleticsExp|"+AthExp+"|Athletics|Check",
	"DeceptionExp|"+DecExp+"|Deception|Check",
	"HistoryExp|"+HisExp+"|History|Check",
	"HusbandryExp|"+HusExp+"|Husbandry|Check",
	"InsightExp|"+InsExp+"|Insight|Check",
	"IntimidationExp|"+IntExp+"|Intimidation|Check",
	"InvestigationExp|"+InvExp+"|Investigation|Check",
	"MedicineExp|"+MedExp+"|Medicine|Check",
	"NatureExp|"+NatExp+"|Nature|Check",
	"PerceptionExp|"+PercExp+"|Perception|Check",
	"PerformanceExp|"+PerfExp+"|Performance|Check",
	"PersuasionExp|"+PersExp+"|Persuasion|Check",
	"PrestidigitationExp|"+PreExp+"|Prestidigitation|Check",
	"ReligionExp|"+RelExp+"|Religion|Check",
	"StealthExp|"+SteExp+"|Stealth|Check",
	"SurvivalExp|"+SurExp+"|Survival|Check")]
	
[h:Acrobatics = json.set("{}","Proficient",AcrobaticsPro,"Expert",AcrobaticsExp)]
[h:Arcana = json.set("{}","Proficient",ArcanaPro,"Expert",ArcanaExp)]
[h:Athletics = json.set("{}","Proficient",AthleticsPro,"Expert",AthleticsExp)]
[h:Deception = json.set("{}","Proficient",DeceptionPro,"Expert",DeceptionExp)]
[h:History = json.set("{}","Proficient",HistoryPro,"Expert",HistoryExp)]
[h:Husbandry = json.set("{}","Proficient",HusbandryPro,"Expert",HusbandryExp)]
[h:Insight = json.set("{}","Proficient",InsightPro,"Expert",InsightExp)]
[h:Intimidation = json.set("{}","Proficient",IntimidationPro,"Expert",IntimidationExp)]
[h:Investigation = json.set("{}","Proficient",InvestigationPro,"Expert",InvestigationExp)]
[h:Medicine = json.set("{}","Proficient",MedicinePro,"Expert",MedicineExp)]
[h:Nature = json.set("{}","Proficient",NaturePro,"Expert",NatureExp)]
[h:Perception = json.set("{}","Proficient",PerceptionPro,"Expert",PerceptionExp)]
[h:Performance = json.set("{}","Proficient",PerformancePro,"Expert",PerformanceExp)]
[h:Persuasion = json.set("{}","Proficient",PersuasionPro,"Expert",PersuasionExp)]
[h:Prestidigitation = json.set("{}","Proficient",PrestidigitationPro,"Expert",PrestidigitationExp)]
[h:Religion = json.set("{}","Proficient",ReligionPro,"Expert",ReligionExp)]
[h:Stealth = json.set("{}","Proficient",StealthPro,"Expert",StealthExp)]
[h:Survival = json.set("{}","Proficient",SurvivalPro,"Expert",SurvivalExp)]
Then I have the presentation portion where my players can excecute them right from their character sheets

Code: Select all

[h:id=getName()]
<!-----Skills------->


	
<table width='125' cellpadding=1>
	<tr>
		<td>
		<a href="macro://Proficient@Lib:Character/none/Impersonated">
		<font size=3><b>Proficiencies</b>
		</a>
	<tr>
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Acrobatics">
		<font size=2>Acrobatics
		</a>
		</td>
		
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Arcana">
		<font size=2>Arcana
		</a>
		</td>
	</tr>
	<tr>
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Athletics">
		<font size=2>Athletics
		</a>
		</td>
	
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Deception">
		<font size=2>Deception
		</a>
		</td>
	</tr>	
	<tr>		
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?History">
		<font size=2>History
		</a>
		</td>
		
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Husbandry">
		<font size=2>Husbandry
		</a>
		</td>
	</tr>
	<tr>
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Insight">
		<font size=2>Insight
		</a>
		</td>
			
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Intimidation">
		<font size=2>Intimidation
		</a>
		</td>
	</tr>	
	<tr>		
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Investigation">
		<font size=2>Investigation
		</a>
		</td>

			
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Medicine">
		<font size=2>Medicine
		</a>
		</td>
	</tr>	
	<tr>		
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Nature">
		<font size=2>Nature
		</a>
		</td>
		
		<td>
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Perception">
		<font size=2>Perception
		</a>
		</td>
	</tr>	
	<tr>
		<td>		
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Performance">
		<font size=2>Performance
		</a>
		</td>	

		<td> 
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Persuasion">
		<font size=2>Persuasion
		</a>
		</td>
				
	</tr>	
	<tr>		
		<td>
			<a href="macro://_skillCheck@Lib:Character/all/impersonated?Prestidigitation">
			<font size=2>Prestidigitation
			</a>
		</td>
	
		
		<td>			
		<a href="macro://_skillCheck@Lib:Character/all/impersonated?Religion">
		<font size=2>Religion
		</a>
		</td>		
	</tr>	
	<tr>		
		<td>
			<a href="macro://_skillCheck@Lib:Character/all/impersonated?Stealth">
			<font size=2>Stealth
			</a>
		</td>

					
		<td>
			<a href="macro://_skillCheck@Lib:Character/all/impersonated?Survival">
			<font size=2>Survival
			</a>
		</td>
	</tr>	
	
	
</table>

Finally i have the actual execution of the macro That i have Aliasmask to thank for the overwhelming majority of the code I just adapted it for my play style. However if i were to change the structure of the my first macro i would have to adjust this macro and that is something that i has held me back my understanding of Accessing nested objects for use in a macro is limited

Code: Select all

[h:skillName = macro.args]
[h:Skill = skillName]

[h:Str = getProperty("Strength")]
[h:Dex = getProperty("Dexterity")]
[h:Con = getProperty("Constitution")]
[h:Int = getProperty("Intelligence")]
[h:Wis = getProperty("Wisdom")]
[h:Cha = getProperty("Charisma")]

[h, switch(skillName):
case "Acrobatics": statName = Dex;
case "Arcana": statName = Int;
case "Athletics": statName = Str;
case "Deception": statName = Cha;
case "History": statName = Int;
case "Husbandry": statName = Wis;
case "Insight": statName = Wis;
case "Intimidation": statName = Cha;
case "Investigation": statName = Int;
case "Medicine": statName = Wis;
case "Nature": statName = Int;
case "Perception": statName = Wis;
case "Performance": statName = Cha;
case "Persuasion": statName = Cha;
case "Prestidigitation": statName = Dex;
case "Religion": statName = Int;
case "Stealth": statName = Dex;
case "Survival": statName = Wis;
case "Strength_Save":StatName= Str;
case "Constitution_Save":StatName= Con;
case "Dexterity_Save":StatName= Dex;
case "Intelligence_Save":StatName= Int;
case "Wisdom_Save":StatName= Wis;
case "Charisma_Save":StatName= Cha;
]

[h:skill = eval(skillName)]
[h:proficient = json.get(Skill,"Proficient")]
[h:expert = json.get(Skill,"Expert")]
[h:proficiency = getProperty("Proficiency")]
[h,if(proficient == 1): SkillMod1 = proficiency;SkillMod1 = 0]
[h,if(expert == 1): SkillMod2 = proficiency;SkillMod2 = 0]
[h:SkillMod = SkillMod1 + SkillMod2]

[h:statMod = floor((statName - 10)/2)]


[H: hasFumble = 0]
[H: hasCrit = 0]
[H: bothCrit = 0]
[H: isFumble = 0]
[H: isCrit = 0]
[H: output = ""]
[H, code: {
   [H: roll1 = d20]
   [H: roll2 = d20]
   [H, if(roll1 == 20 || roll2 == 20): hasCrit = 1]
   [H, if(roll1 == 20 && roll2 == 20): bothCrit = 1]
   [H, if(roll1 == 1 || roll2 == 1): hasFumble = 1]
   [H, if(roll1 == 20): isCrit = 1]
   [H, if(roll1 == 1): isFumble = 1]
   [H: baseCheck = roll1 + statMod + SkillMod]
   [H, if(roll2 < roll1), code: {
      [H: disadCheck = roll2 + statMod + SkillMod]
      [H: advCheck = baseCheck]
   };{
      [H: disadCheck = baseCheck]
      [H: advCheck = roll2 + statMod + SkillMod]
   }]
   
   [H:
      tip = strformat('<html><table style="border-style:solid;border-width=1pt;padding:0px;">     
         <tr style="padding:0px;"><td style="padding:0px;padding-right:5px;text-align:right;">Roll 1:</td><td style="padding:0px;padding-right:5px;">%{roll1}</td></tr>
         <tr style="padding:0px"><td style="padding:0px;padding-right:5px;text-align:right;">Roll 2:</td><td style="padding:0px;padding-right:5px;">%{roll2}</td></tr>

<tr style="padding:0px"><td style="padding:0px;padding-right:5px;text-align:right;">Skill Proficiency:</td><td style="padding:0px;padding-right:5px;">%{SkillMod}</td></tr>
 <tr style="padding:0px"><td style="padding:0px;padding-right:5px;text-align:right;">Stat Mod:</td><td style="padding:0px;padding-right:5px;">%{statMod}</td></tr>
 



         </table></html>'
   )]
   [H: tip = replace(tip,'"',""")]
   [H, if(hasFumble): disadCheck = "<font color=red size=+1>"+disadCheck+"</font>"]
   [H, if(hasCrit): advCheck = "<font color=green size=+1>"+advCheck+"</font>"]
   [H, if(bothCrit): disadCheck = "<font color=green size=+1>"+disadCheck+"</font>"]
   [H, if(isFumble): baseCheck = "<font color=red size=+1>"+baseCheck+"</font>"]
   [H, if(isCrit): baseCheck = "<font color=green size=+1>"+baseCheck+"</font>"]
   [H:
      output = json.append(output,strformat('
         <span title="%{tip}"><b>
            %{skillName}'
   ))]
 
   [H:
      output = json.append(output,strformat('
            Result:%{baseCheck}  (Adv: %{advCheck} / Dis: %{disadCheck})<br></b>
         </span>'
   ))]
}]
[R: json.toList(output,"<br>")]

Just something for you to consider

Envyus
Cave Troll
Posts: 57
Joined: Thu Sep 13, 2012 2:56 am

Re: Help with Skill check Marco

Post by Envyus »

Ah Macros are so complex to me. The fact that I would have to redo my framework alone makes me not too keen on some of this. Even though I am not doing things as well as I could.

User avatar
Dervish
Giant
Posts: 121
Joined: Thu Sep 15, 2011 7:52 pm

Re: Help with Skill check Marco

Post by Dervish »

Yes Macro's are complex. whether you have them as buttons on the token or macrolinks a on character sheet. Redesigning from the ground up does suck but sometimes its good to return to the well as it were i will not advocate binning your current framework but i would ask you to open a new framework and experiment with some of the concepts you have been exposed to.

Post Reply

Return to “Macros”