I guessed so much.
more or less impossible
. Do you mean the compiler or are
Wiki: eval ()and
Wiki: evalMacro ()in groovy not possible? (or both).
About the cap. Pretty cool and definitely a very useful addition. Do I gather from the screenshot that in your version you need to declare your property types up front (so no typecasting)? Not really an issue with that as it promotes cleaner and more understandable code.
Does however your new property system allow for script (and other types like jons objects/arrays) as well?
to give you an idea what is currently possible:
This is my default property set for a character in my games:
(note that the primary stats are automatically rolled when the token is dragged on the map. The secondary stats are derived/calculated based on the primary stats. So the first part is executed once, while the second are executed on each mouseover.)
Code: Select all
--------------|PRIMARY CHARACTERISTICS|------------
WS:[h:WS=20+2d10]
BS:[h:BS=20+2d10]
S:[h:S=20+2d10]
T:[h:T=20+2d10]
Ag:[h:Ag=20+2d10]
Int:[h:Int=20+2d10]
Per:[h:Per=20+2d10]
WP:[h:WP=20+2d10]
Fel:[h:Fel=20+2d10]
Inf
--------------|SECONDARY CHARACTERISTICS|------------
WSB:{1*floor(WS/10)+0}
BSB:{1*floor(BS/10)+0}
SB:{1*floor(S/10)+0}
TB:{1*floor(T/10)+0}
AB:{1*floor(Ag/10)+0}
IB:{1*floor(Int/10)+0}
PB:{1*floor(Per/10)+0}
WB:{1*floor(Wp/10)+0}
FB:{1*floor(Fel/10)+0}
InfB
--------------|CALCULATED CHARACTERISTICS|------------
W:[h:W=eval("10+1d3")]
SW (Starting Wounds):{SW=W}
M:{1*floor(Ag/10)+0}
Fatigue:{TB}
FatePoints:0
FatePool:0
InfPoints:0
InfPool:0
InsanityPoints:0
CorruptionPoints:0
CB:{1*floor(CorruptionPoints/10)+0}
--------------|OTHER CHARACTERISTICS|------------
Skills:{}
Talents:{}
Traits:{}
Deeds:""
Distinctions:""
PsychicPowers:{}
FaithPowers:{}
PsyRating:0
SpecialProperties:PsyClass=0; Navigator=0; Apotheker=0; SuddenDeath=0
Advancements:{}
States:{}
Recharging:{}
tmpStats:[]
tmpSkillBonus:{}
WoundLevel:Healthy
OnBoard
--------------|EQUIPMENT|------------
Weapons:{"Unarmed":{"Category":"Melee","Group":"Primitive","Class":"Natural","Range":0,"SingleShot":0,"SemiBurst":0,"FullBurst":0,"WpnDamDice":1,"WpnDamDiceType":5,"WpnDamMod":-3,"DamType":"Impact","Penetration":0,"Clip":0,"ClipSize":0,"WpnAttMod":0,"NumClips":0,"ClipType":"-","RldTime":"","numHands":1,"Special":"Primitive, Grapple, Unwieldy","SpecialText":"","Weight":0,"Cost":"-","Availability":"-","Page":197,"Source":"DH-CR"}}
Armour:{}
Gear:{}
CurrentlyEquippedArmour:{}
ArmourWearing
PrimaryWeapon:Unarmed
SecondaryWeapon:Unarmed
MountedWeapon
UnarmedWeapon:Unarmed
ReloadingMountedWeapon
--------------|ARMOUR STATS|------------
HeadAP:0
BodyAP:0
ArmPAP:0
ArmSAP:0
LegPAP:0
LegSAP:0
HeadAType:None
BodyAType:None
ArmPAType:None
ArmSAType:None
LegPAType:None
LegSAType:None
Deflector:{}
Cover:{"Type":0,"Head":0,"ArmP":0,"ArmS":0,"Body":1,"LegP":1,"LegS":1,"AP":0}
--------------|DISPLAY INFO|------------
*@Embarked:{OnBoard}
*@WS|BS:{WS}|{BS} ({WSB}|{BSB})
*@S|T:{S}|{T} ({SB}|{TB})
*@Ag|Int|WP:{Ag}|{Int}|{WP} ({AB}|{IB}|{WB})
*@Per|Fel:{Per}|{Fel} ({PB}|{FB})
*@Infamy
*@W|SW:{W}|{SW}
*@M|Chrg|Run:{M}|{M*3}|{M*6}
*@Fat|SFat:{Fatigue}|{TB}
*@IP|CP|FPool|FPoints
*@CP|IPool|IPoints
*@PR:{PsyRating}
*@AP-H|B|A P-S|L P-S:{HeadAP}|{BodyAP}|{ArmPAP}-{ArmSAP}|{LegPAP}-{LegSAP}
*Wearing:[r, if(length(ArmourWearing) > 30): substring(ArmourWearing, 0, 30) + "..." ; ArmourWearing]
*Hands P|S:[r, if(length(PrimaryWeapon) > 30): substring(PrimaryWeapon, 0, 30) + "..." ; PrimaryWeapon]|[r, if(length(SecondaryWeapon) > 30): substring(SecondaryWeapon, 0, 30) + "..." ; SecondaryWeapon]
*Mount:[r, if(length(MountedWeapon) > 30): substring(MountedWeapon, 0, 30) + "..." ; MountedWeapon]
*Dodge|Parry:[h:dodge = json.get(States, "Dodged")][h:parry=json.get(States, "Parried")][r:if(dodge == "" && parry != "", 0, dodge)][r:if(dodge != "" || parry != "", "|","")][r:if(dodge != "" && parry == "", 0, parry)]
*Condition:[r:getStates("Cover")]
*sheet.distance (Distance):[r: distanceStatSheet(currentToken())]
---------------|CREATE TOKEN MACROS AND SYSTEM|---------------
LastMeleeAttack:wpnUsed={PrimaryWeapon} ; action=Standard ; secondaryUsed=0 ; exoticTrained=0 ; attackRollResult=0 ; targetDefensive=0 ; targetProne=0 ; calledShot=0 ; logis=0 ; sureStrike=0 ; assStrike=0 ; targetSurprised=0 ; stunned=0 ; higherGround=0 ; hatred=0 ; allowRighteousFury=0 ; autoRF=0 ; charge=0 ; weaponTech=0 ; calledShotPenalty=-20 ; jumpCharge=0 ; jumpChargeTxt= ; wpnMounted=0 ; bonusHordeDmgDice=0 ; miscHordeDmg=0 ; miscOneTimeHordeDmg=0 ; addCritDmg=0 ; action=Standard ; aim=0 ; outNumbered=0 ; bonusHordeDmgDice=0 ; miscHordeDmg=0 ; miscOneTimeHordeDmg=0 ; terrain=0 ; visibility=0 ; vehicleLocation=0 ; allowRighteousFury=1 ; penMod=0 ; bonusDoS=0 ; addCritDmg=0 ; miscModDam=0 ; miscMod=0 ; token= ; vehicleToken= ;
LastRangedAttack:action= ; move=0 ; aim=0 ; wpnUsed=Autopistol ; exoticTrained=0 ; attackRollResult=0 ; targetSurprised=0 ; stunned=0 ; targetProne=0 ; shootInMelee=0 ; concealed=0 ; calledShot=0 ; logis=0 ; ricochet=0 ; noCohesion=0 ; allowRighteousFury=0 ; autoRF=0 ; noAmmo=0 ; bcTLOption=-1 ; weaponTech=0 ; calledShotPenalty=-20 ; wpnMounted=0 ; ocMode=0 ; bonusHordeDmgDice=0 ; miscHordeDmg=0 ; miscOneTimeHordeDmg=0 ; addCritDmg=0 ; shell= ; indirect=0 ; action=Standard ; aim=0 ; distance=0 ; visibility=0 ; bonusHordeDmgDice=0 ; miscHordeDmg=0 ; miscOneTimeHordeDmg=0 ; sizeTarget=0 ; vehicleLocation=0 ; allowRighteousFury=1 ; penMod=0 ; bonusDoS=0 ; addCritDmg=0 ; miscModDam=0 ; miscMod=0 ; token= ; vehicleToken= ;
LastAutoAttack:wpnUsed= ; targets= ; whichArm=PrimaryWeapon ;
LastPsychicAttack:selPower= ; numDice=1 ; mods=0 ; extraFocusMod=0 ; extraPowerMod=0 ; extraPPMod=0 ;
LastRange:0
globalPenalty:{}
checkForModifiers:1
evasionAction:0
evasionModifier:0
evasionWpn
modifier:0
manualRolls:0
DHFWVersion
macroFrameCache
macroFrameCache2
quickSheetCache
quickSheet2Cache
quickSheet3Cache
fullSheetCache
initiative:0
favour:Fate
---------------|TEMPLATES|---------------
templates:{}
Overall I have 15 or so property types of which the most mental (this was an experiment to see how far I could stretch maptool and it works surprisingly well), used for space ships:
(The idea behind this one is that ship OWNERS can see the stats of the ship and the status of its components. NON-OWNERS see nothing unless they scan the ship. After the scan they can see none,some or all of the ships components. This is reflected in the mouseover statsheet. Now the tricky part is that the scan is done by other ships. So when a user hovers over an enemy ship he sees what his own ship scanned. Thus the code stores the ship ID's of the ships that successfully scanned it and then checks whether the current user owns one of those ships. If so: show the scanned components by the ship owned by the user.)
Code: Select all
--------------| STATS|------------
ShipClass
Hull
Captain
Explorers
numExplorers:4
-------------------------
Speed:0
Man:0
Detection:0
BSMod:0
--------------------------
numShields:0
tmpShields:{numShields}
Armour:0
HI (Hull Integrity):0
SHI (Starting HI):0
CrewPercentage:100
MoralePercentage:100
Components:{"Bridge":{},"PlasmaDrive":{},"WarpDrive":{},"GellerField":{},"VoidShield":{},"LifeSustainer":{},"CrewQuarters":{},"AugurArray":{},"Cargo":{},"Passenger":{},"Augments":{},"Facilities":{},"Upgrades":{},"Macrobattery":{},"Lance":{},"Launcher":{},"Nova":{}}
Weapons:{}
MountedWeapon:[r:MountedWeapon = json.fields(Weapons)]
------------------------------
wcProw:0
wcPort:0
wcStarboard:0
wcDorsal:0
wcKeel:0
TR (Turret Rating):0
TotalPower:0
UsedPower:0
TotalSpace:0
UsedSpace:0
CrewRating:0
States:{}
-----------------------------
currentPlayer:{getPlayerName()}
owned:[r:getPlayerOwned(currentPlayer)]
tokenID:{currentToken()}
owner:{isOwner(currentPlayer)}
classHull:{strformat("%{ShipClass} Class %{Hull}")}
--------------|DISPLAY PROPERTIES SELF|------------
*Class Hull:[r,if(owner):classHull]
Used Power:({UsedPower}\{TotalPower})
complicationsList
------
*Speed|Manouvr.|Detection:[r,if(owner):strformat("%{Speed}VU|%{Man}|%{Detection}")]
*Hull Integrity:[r,if(owner):strformat("(%{HI}|%{SHI})")]
*Crew Number|Morale|Rating:[r,if(owner):strformat("(%{CrewPercentage}|%{MoralePercentage}|%{CrewRating})")]
*Wpn Cap. (Prow| Port| Starb.|Dorsal|Keel):[r,if(owner):strformat("%{wcProw}|%{wcPort}|%{wcStarboard}|%{wcDorsal}|%{wcKeel}")]
*Complications:[r,if(owner):complicationsList]
*Turret Rating|Detection:[r,if(owner):strformat("%{TR}|%{Detection}")]
*Void Shields tmp/full | Armour:[r,if(owner):strformat("(%{tmpShields}/%{numShields})|%{Armour}")]
--------------|get status of components|------------
BridgeStatus:[h:TMPJSON = json.get(Components, "Bridge")] [h:tmpPropLst = ""][h,foreach(tmpProp, BridgeList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:BridgeStatus = tmpPropLst]
PlasmaDriveStatus:[h:TMPJSON = json.get(Components, "PlasmaDrive")] [h:tmpPropLst = ""][h,foreach(tmpProp, PlasmaDriveList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:PlasmaDriveStatus = tmpPropLst]
WarpDriveStatus:[h:TMPJSON = json.get(Components, "WarpDrive")] [h:tmpPropLst = ""][h,foreach(tmpProp, WarpDriveList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:WarpDriveStatus = tmpPropLst]
LifeSustainerStatus:[h:TMPJSON = json.get(Components, "LifeSustainer")][h:tmpPropLst = ""][h,foreach(tmpProp, LifeSustainerList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:LifeSustainerStatus = tmpPropLst]
CrewQuartersStatus:[h:TMPJSON = json.get(Components, "CrewQuarters")] [h:tmpPropLst = ""][h,foreach(tmpProp, CrewQuartersList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:CrewQuartersStatus = tmpPropLst]
GellerFieldStatus:[h:TMPJSON = json.get(Components, "GellerField")] [h:tmpPropLst = ""][h,foreach(tmpProp, GellerFieldList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:GellerFieldStatus = tmpPropLst]
VoidShieldStatus:[h:TMPJSON = json.get(Components, "VoidShield")] [h:tmpPropLst = ""][h,foreach(tmpProp, VoidShieldList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:VoidShieldStatus = tmpPropLst]
AugurArrayStatus:[h:TMPJSON = json.get(Components, "AugurArray")] [h:tmpPropLst = ""][h,foreach(tmpProp, AugurList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:AugurArrayStatus = tmpPropLst]
MacrobatteryStatus:[h:TMPJSON = json.get(Components, "Macrobattery")] [h:tmpPropLst = ""][h,foreach(tmpProp, MacrobatteryList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:MacrobatteryStatus = tmpPropLst]
LanceStatus:[h:TMPJSON = json.get(Components, "Lance")] [h:tmpPropLst = ""][h,foreach(tmpProp, LanceList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:LanceStatus = tmpPropLst]
LauncherStatus:[h:TMPJSON = json.get(Components, "Launcher")] [h:tmpPropLst = ""][h,foreach(tmpProp, LauncherList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:LauncherStatus = tmpPropLst]
NovaStatus:[h:TMPJSON = json.get(Components, "Nova")] [h:tmpPropLst = ""][h,foreach(tmpProp, NovaList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:NovaStatus = tmpPropLst]
CargoStatus:[h:TMPJSON = json.get(Components, "Cargo")] [h:tmpPropLst = ""][h,foreach(tmpProp, CargoList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:CargoStatus = tmpPropLst]
PassengerStatus:[h:TMPJSON = json.get(Components, "Passenger")] [h:tmpPropLst = ""][h,foreach(tmpProp, PassengerList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:PassengerStatus = tmpPropLst]
AugmentsStatus:[h:TMPJSON = json.get(Components, "Augments")] [h:tmpPropLst = ""][h,foreach(tmpProp, AugmentsList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:AugmentsStatus = tmpPropLst]
FacilitiesStatus:[h:TMPJSON = json.get(Components, "Facilities")] [h:tmpPropLst = ""][h,foreach(tmpProp, FacilitiesList): tmpPropLst = listAppend(tmpPropLst, json.get(TMPJSON, tmpProp))] [r:FacilitiesStatus = tmpPropLst]
--------------|show status of components to owner|------------
*-Bridge-:[r,if (owner && BridgeStatus != "intact"):BridgeStatus]
*-PlasmaDrive-:[r,if (owner && PlasmaDriveStatus != "intact"):PlasmaDriveStatus]
*-WarpDrive-:[r,if (owner && WarpDriveStatus != "intact"):WarpDriveStatus]
*-LifeSustainer-:[r,if (owner && LifeSustainerStatus != "intact"):LifeSustainerStatus]
*-CrewQuarters-:[r,if (owner && CrewQuartersStatus != "intact"):CrewQuartersStatus]
*-GellerField-:[r,if (owner && GellerFieldStatus != "intact"):GellerFieldStatus]
*-VoidShield-:[r,if (owner && VoidShieldStatus != "intact"):VoidShieldStatus]
*-AugurArray-:[r,if (owner && AugurArrayStatus != "intact"):AugurArrayStatus]
*-Macrobattery-:[r,if (owner && MacrobatteryStatus != "intact"):MacrobatteryStatus]
*-Lance-:[r,if (owner && LanceStatus != "intact"):LanceStatus]
*-Launcher-:[r,if (owner && LauncherStatus != "intact"):LauncherStatus]
*-Nova-:[r,if (owner && NovaStatus != "intact"):NovaStatus]
*-Cargo-:[r,if (owner && CargoStatus != "intact"):CargoStatus]
*-Passenger-:[r,if (owner && PassengerStatus != "intact"):PassengerStatus]
*-Augments-:[r,if (owner && AugmentsStatus != "intact"):AugmentsStatus]
*-Facilities-:[r,if (owner && FacilitiesStatus != "intact"):FacilitiesStatus]
--------------|DISPLAY PROPERTIES OTHERS|------------
--------------|this creates a list of components per comp. category|------------
PlasmaDriveList:[r:PlasmaDriveList = json.fields(json.get(Components,"PlasmaDrive"))]
WarpDriveList:[r:WarpDriveList = json.fields(json.get(Components,"WarpDrive"))]
LifeSustainerList:[r:LifeSustainerList = json.fields(json.get(Components,"LifeSustainer"))]
CrewQuartersList:[r:CrewQuartersList = json.fields(json.get(Components,"CrewQuarters"))]
GellerFieldList:[r:GellerFieldList = json.fields(json.get(Components,"GellerField"))]
VoidShieldList:[r:VoidShieldList = json.fields(json.get(Components,"VoidShield"))]
CargoList:[r:CargoList = json.fields(json.get(Components,"Cargo"))]
PassengerList:[r:PassengerList = json.fields(json.get(Components,"Passenger"))]
---
BridgeList:[r:BridgeList = json.fields(json.get(Components, "Bridge"))]
PropulsionList:[r:PropulsionList = listAppend(PlasmaDriveList, WarpDriveList)]
PersonnelList:[r:PersonnelList = listAppend(LifeSustainerList, CrewQuartersList)]
FieldsList:[r:FieldsList = listAppend(GellerFieldList, VoidShieldList)]
AugurList:[r:AugurList = json.fields(json.get(Components, "AugurArray"))]
MacrobatteryList:[r:MacrobatteryList = json.fields(json.get(Components, "Macrobattery"))]
LanceList:[r:LanceList = json.fields(json.get(Components, "Lance"))]
LauncherList:[r:LauncherList = json.fields(json.get(Components, "Launcher"))]
NovaList:[r:NovaList = json.fields(json.get(Components, "Nova"))]
AugmentsList:[r:AugmentsList = json.fields(json.get(Components, "Augments"))]
CargoPassList:[r:CargoPassList = listAppend(CargoList, PassengerList)]
FacilitiesList:[r:FacilitiesList = json.fields(json.get(Components, "Facilities"))]
-------------|This list is updated with shipIDs that succesfully scanned this ship|----------------------
classDetected:[]
BridgeDetected:[]
PropulsionDetected:[]
PersonnelDetected:[]
FieldsDetected:[]
AugurDetected:[]
MacrobatteryDetected:[]
LanceDetected:[]
LauncherDetected:[]
NovaDetected:[]
AugmentsDetected:[]
CargoDetected:[]
FacilitiesDetected:[]
--------------|This checks whether the current player owns a ship that has succesfully scanned this ship|----------------------
ClassDetectedOwned:{!json.isEmpty(json.intersection(owned,classDetected ))}
BridgeDetectedOwned:{!json.isEmpty(json.intersection(owned,BridgeDetected ))}
PropulsionDetectedOwned:{!json.isEmpty(json.intersection(owned,PropulsionDetected ))}
PersonnelDetectedOwned:{!json.isEmpty(json.intersection(owned,PersonnelDetected ))}
FieldsDetectedOwned:{!json.isEmpty(json.intersection(owned,FieldsDetected ))}
AugurDetectedOwned:{!json.isEmpty(json.intersection(owned,AugurDetected ))}
MacrobatteryDetectedOwned:{!json.isEmpty(json.intersection(owned,MacrobatteryDetected ))}
LanceDetectedOwned:{!json.isEmpty(json.intersection(owned,LanceDetected ))}
LauncherDetectedOwned:{!json.isEmpty(json.intersection(owned,LauncherDetected ))}
NovaDetectedOwned:{!json.isEmpty(json.intersection(owned,NovaDetected ))}
AugmentsDetectedOwned:{!json.isEmpty(json.intersection(owned,AugmentsDetected ))}
CargoDetectedOwned:{!json.isEmpty(json.intersection(owned,CargoDetected ))}
FacilitiesDetectedOwned:{!json.isEmpty(json.intersection(owned,FacilitiesDetected ))}
--------------|show components ONLY to players that own a ship that succesfully scanned this ship AND NOT own this ship|------------
*Class-:[r,if (ClassDetectedOwned && !owner):classHull]
*Bridge-:[r,if (BridgeDetectedOwned && !owner):BridgeList]
*Propulsion-:[r,if (PropulsionDetectedOwned && !owner):PropulsionList]
*Personnel-:[r,if (PersonnelDetectedOwned && !owner):PersonnelList]
*Fields-:[r,if (FieldsDetectedOwned && !owner):FieldsList]
*Augur-:[r,if (AugurDetectedOwned && !owner):AugurList]
*Macrobattery-:[r,if (MacrobatteryDetectedOwned && !owner):MacrobatteryList]
*Lances-:[r,if (LanceDetectedOwned && !owner):LanceList]
*Launcheres-:[r,if (LauncherDetectedOwned && !owner):LauncherList]
*Nova Cannons-:[r,if (NovaDetectedOwned && !owner):NovaList]
*Augments-:[r,if (AugmentsDetectedOwned && !owner):AugmentsList]
*Cargo space-:[r,if (CargoDetectedOwned && !owner):CargoPassList]
*Facilities-:[r,if (FacilitiesDetectedOwned && !owner):FacilitiesList]
*sheet.distance (Distance):[r: distanceStatSheet(currentToken())]
-------------|SYSTEM|-------------
DHFWVersion
checkForModifiers:1
macroFrameCache
attackResolve:{"wpnsUsed":"{}", operator:""}
tmpStats:[]
LastRange:0
-------------|Redundant but needed for initiative check|-------------
Recharging:{}
onBoard