Since I don't feel I explained myself clearly enough, I'll post some examples and such. First off I'm trying to do this for a game system I'm working on creating, and am doing so in conjunction with making macros for it so it can have seamless integration in MapTool.
[spoiler=Campaign Properties]
Code: Select all
*display.health (Health):{if(wounds.mortal > 0, "Greviously Injured", if(wounds.heavy > 0, "Seriously Injured", if(wounds.medium > 0, "Injured", if(wounds.light > 0 , "Roughed Up", "Healthy"))))}
*@display.stats (Stats):AP {condition.action.points}, Move {derived.movement}
*display.armour (Armour):{equip.armour.name}
*@display.resistance (Resist):Ki {attrib.brawn + attrib.size.mod + equip.armour.kinetic}, El {attrib.brawn + attrib.size.mod + equip.armour.elemental}, En {attrib.brawn + attrib.size.mod + equip.armour.energy}
*display.weapon.one (Weapon):{if(equip.weapon.one != "", getStrProp(equip.weapon.one, "sor.weapon.name"), "")}
*@display.ammo.one (Ammo):{if(getStrProp(equip.weapon.one, "sor.weapon.clip.max") != "", " (" + getStrProp(equip.weapon.one, "sor.weapon.clip.current") + "/" + getStrProp(equip.weapon.one, "sor.weapon.clip.max") + ")", "")}
attrib.brawn (Br):3
attrib.finesse (Fi):3
attrib.reasoning (Re):3
attrib.Spirit (Sp):3
attrib.size.mod:0
derived.fatigue.max:{attrib.brawn + attrib.spirit}
derived.fatigue.current:0
derived.movement (Mv):{attrib.brawn + attrib.finesse}
defence.dodge
defence.parry
defence.block
wounds.light:0
wounds.medium:0
wounds.heavy:0
wounds.mortal:0
condition.action.points:2
skill.melee.combat:0
skill.ranged.combat:0
skill.awareness:0
skill.dodge:0
equip.armour.name:Clothing
equip.armour.val:0
equip.armour.kinetic:0
equip.armour.elemental:0
equip.armour.energy:0
equip.weapon.one
I used input() to make a rudimentary character sheet, but don't like the limitations on formatting. I did use the tab feature in it, but that still only helps so much.

[spoiler=Rudimentary Character Sheet]
Code: Select all
[h: character.name = token.name]
[h: error = input(
"tab0|Attributes||TAB",
"Name|"+getName()+"",
"Label|"+getLabel()+"",
"Brawn|"+attrib.brawn+" ## Finesse|"+attrib.finesse+" ## Reasoning|"+attrib.reasoning+" ## Spirit|"+attrib.spirit+" ## SizeMod|"+attrib.size.mod+" ## label|SecondaryAttributes||label|span=true",
"tab1|Skills||TAB",
"MeleeCombat|"+skill.melee.combat+" ## RangedCombat|"+skill.ranged.combat+" ## -Projectiles ## -Rayguns ## Awareness|"+skill.awareness+" ## Dodge|"+skill.dodge+"",
"tab2|Equipment||TAB",
"ArmourType|"+equip.armour.name+" ## Protection|"+equip.armour.val+" ## WeaponOne|"+getStrProp(equip.weapon.one, "sor.weapon.name")+""
)]
[h: abort(error)]
[h,if(Name == ""): Name = "Unknown"]
[h,if(Label == 0): Label = ""]
[h: setName(Name)]
[h: setLabel(Label)]
[h: attrib.brawn = Brawn]
[h: attrib.finesse = Finesse]
[h: attrib.reasoning = Reasoning]
[h: attrib.spirit = Spirit]
[h: attrib.size.mod = SizeMod]
[h: skill.melee.combat = MeleeCombat]
[h: skill.ranged.combat = RangedCombat]
[h: skill.awareness = Awareness]
[h: equip.armour.name = ArmourType]
[h: equip.armour.val = Protection]
[r: "Character sheet has been updated."]
I'd really like to use dialog() or frame() for the character sheet, as it has a lot more functionality and can be made to look much nicer, but I also want tabs similar to those available in the input() function. I had found a couple sites talking about how to use CSS to make tabs, but when I tried to integrate them they never worked. Unfortunately I forgot to save those attempts, though I could recreate them if desired.
I even tried encapsulating the links to other pages in the character sheet in borders, but I seem to be messing it up too much. There is a gap between the faux tabs and the page contents, and the current faux tab isn't using the background colour it should (or that I'm trying to get it too, at least).

[spoiler=open.char.sheet Macro]
Code: Select all
[h: link = macroLinkText("[email protected]:tokens", "none")]
[frame("CharacterSheet"): {
[h: page = getStrProp(macro.args, "Page")]
[h,if(page==""): page="Overview"]
<html>
<head>
<link rel="onChangeSelection" type="macro" href="[r:link]">
<link rel="stylesheet" type="text/css" href="[email protected]:tokens"></link>
</head>
<body>
[h: has.permission = 0]
[h: acting.token = getSelected()]
[h: acting.player = getPlayerName()]
[h,if(isOwner(acting.player, acting.token)): has.permission = 1]
[h,if(isGM()): has.permission = 1]
[if(has.permission == 0),code:
{
[r: "You do not have permission to view this token's character sheet."]
};{
[h: "<!-- Stuff -->"]
[h: id = getSelected()]
[h: header.args = strPropFromVars("page, id", "unsuffixed")]
[r,macro("[email protected]:tokens"): header.args]
<br>
[r,macro("char.sheet."+page+"@Lib:tokens"): id]
}]
</body>
</html>
}]
[spoiler=char.sheet.css Macro on Lib:tokens]
Code: Select all
.odd { background-color: #FFFFFF }
.even { background-color: #EEEEAA }
th { background-color: #113311; color: #FFFFFF }
.page { background-color:#BBBBBB; border-width:thin; border-color:#222222 }
.currentPage { background-color:#EEEEEE; border-width:thin; border-color:#222222 }
[spoiler=char.sheet.header Macro on Lib:tokens]
Code: Select all
[h: varsFromStrProp(macro.args)]
[h: currentPage = macro.args]
[h: pages = "Overview,Basic_Skills,Broad_Skills"]
<table>
<td><img src='[r,token(id): getTokenImage(75)]'></img></td>
<td><h1>[r,token(id): token.name]</td>
</table>
<table>
[foreach(page, pages,""), code: {
[h,if (page == currentPage): class="currentPage" ; class="page"]
[h: callback = "[email protected]:tokens"]
<td class="[r: class]">
[r: macroLink(page, callback, "none", "Page="+page)]
</td>
}]
</table>
[spoiler=char.sheet.Overview Macro on Lib:tokens]
Code: Select all
[h: id = macro.args]
[r, if(listCount(id)!=1), code: {};{
[h: link = macroLinkText("[email protected]:tokens", "all")]
<form action="[r:link]" method="json">
<input type="hidden" name="id" value="[r:id]">
<table style="background-color:#EEEEEE; border-width:thin; border-color:#222222">
<tr>
<table>
<td valign="top">
<table>
<tr>
<th colspan="*">Attribute</th>
<th colspan="*">Score</th>
</tr>
[h: attributes = "Brawn, Finesse, Reasoning, Spirit"]
[h: row = "odd"]
[r,foreach(attrib, attributes, ""),code: {
<tr class="[r:row]">
[h: property.name = 'attrib.' + attrib]
<td><b>[r:attrib]</b></td>
<td><input type="text" name="[r:attrib]" value="[r:getProperty(property.name, id)]" size="3" align="right"></td>
</tr>
[h: row = if(row=="odd", "even", "odd")]
}]
</table>
</td>
</table>
<input type="submit" name="edit_btn" value="Submit changes">
</form>
}]
Currently I'm just trying to get the base functionality of the character sheet working, currently working on getting some form of decent looking tab feature functional. I can get the displayed properties and updating token properties working later.
Any and all advice, tips, examples, or explanations on how it cannot be done are welcome.
