Setting up MT for D&D
Moderators: dorpond, trevor, Azhrei
Along with Pillbox's question I can see good use to those tables in token macros.trevor wrote:Pillbox, do you mean running the table, or using the result in a larger result ?
To give a token a macro for Force Thurst, I need to have player roll a Use The Force v. target Strength modified via size table.
Ultimately, I'd love to see the token macro language become a major full blown system, capable of calulating any situation that arise in a typical DnD or SW game.
For the above, I can hard code most of the values, but then when the character goes up in levels, I have to make sure to make changes. I' love to be able to code the whole thing so that off my base stats the equation can be written to adapt over levels as need. Perhaps this is already there, but I have not read or found the macro docs and looked them over yet, been just reading forum posts as I go along.
On the idea of more macro language is a beautiful thing, here is a big gotcha in the system right now. The Macro editing UI is, sorry for this, terrible. Writing more than about 12 characters in that dialog box is very frustrating. Perhaps if the dialog box remembered the size I stretch it to every time, that would help. But I'd like to see a popup window of some sort that lets me see the entire macro like in a normal text ed.
Great work and I hope to see much more in this area. I think it is a very important aspect of MT. Since I don't see MT and DMG ever talking to each other, I'd like to see MT as programmable as possible to allow me to do a lot of what DMG does for me in running my games.
Again, great work by all the developers.
-David
Yeah I'd love an alternative - maybe text based (think the table editing) system to do this. It'd also be great to support multiple submenus so you could keep all your skills, checks, weapons, powers/spells in submenus to make it easier.drswoboda wrote:On the idea of more macro language is a beautiful thing, here is a big gotcha in the system right now. The Macro editing UI is, sorry for this, terrible. Writing more than about 12 characters in that dialog box is very frustrating. Perhaps if the dialog box remembered the size I stretch it to every time, that would help. But I'd like to see a popup window of some sort that lets me see the entire macro like in a normal text ed.
I just realized that I am referring to lookup tables and not roll tables.
Can MT use a lookup table yet? I see the tables option in Campaign Properties seem to be only roll tables.
I have become very intrigued by the idea of token macros the past few days, and I'd love to be able to do DMG style scripting in some sort of language (JavaScript?) to really make them dance to my wishes
-David
Can MT use a lookup table yet? I see the tables option in Campaign Properties seem to be only roll tables.
I have become very intrigued by the idea of token macros the past few days, and I'd love to be able to do DMG style scripting in some sort of language (JavaScript?) to really make them dance to my wishes
-David
What about like...
/tbl skill Jump
would return
/emit Jump (Str; Armor Check Penalty)
Check <br>The DC and the distance you can cover vary according to the type of Jump you are attempting (see below). <br>Your Jump check is modified by your speed. If your speed is 30 feet then no modifier based on speed applies to the check. If your speed is less than 30 feet, you take a -6 penalty for every 10 feet of speed less than 30 feet. If your speed is greater than 30 feet, you gain a +4 bonus for every 10 feet beyond 30 feet... (etc.)
?
(I have only used tables once in a miniatures game with MapTool so I may not really know what I'm talking about)
/tbl skill Jump
would return
/emit Jump (Str; Armor Check Penalty)
Check <br>The DC and the distance you can cover vary according to the type of Jump you are attempting (see below). <br>Your Jump check is modified by your speed. If your speed is 30 feet then no modifier based on speed applies to the check. If your speed is less than 30 feet, you take a -6 penalty for every 10 feet of speed less than 30 feet. If your speed is greater than 30 feet, you gain a +4 bonus for every 10 feet beyond 30 feet... (etc.)
?
(I have only used tables once in a miniatures game with MapTool so I may not really know what I'm talking about)
Say a table like this:trevor wrote:
What would you consider a lookup table that's not a roll table ?
Colossal = 20
Gargantuan = 15
...
Medium = 0
...
Fine = -20
Then in my macro for Force Thrust I would have somthing like this: (not in proper MT macro format)
If 1d20 + ForceThrust + ?MiscATT => 1d20 +TargetStrMOD + (?TableSIZE) + ?MiscTAR Then "Hit" DO Damage Routine
The mechanic of this would be an Input box for MiscATT value (defaulting to value allowing ENTER to pass), followed by a Dialog with a dropdown allowing selection of SizeMOD in a ComboBox like UI, and then the MiscTAR input value. The user get 3 prompts (with defaults) to finish attack.
For sure what I am asking is beyond a simple roll macro. I am, I quess, asking for a full script language like in DMG, where I can do LOGIC processing. Grabing VARS from the tokens and coding them to do complex roll or effects calculations for me. DMG lite, on a token basis.
Probably pie in the sky, but oh would that be so so sweet.
DMG uses, of course, Visual Basic scripting, and that is not cross platform. JavaScript seems the obvious choice for MT.
Am I just dreaming here?
-David
Excellent use of table for DM/Player in game data display. I like this a lot.Hawke wrote:What about like...
/tbl skill Jump
would return
/emit Jump (Str; Armor Check Penalty)
Check <br>The DC and the distance you can cover vary according to the type of Jump you are attempting (see below). <br>Your Jump check is modified by your speed. If your speed is 30 feet then no modifier based on speed applies to the check. If your speed is less than 30 feet, you take a -6 penalty for every 10 feet of speed less than 30 feet. If your speed is greater than 30 feet, you gain a +4 bonus for every 10 feet beyond 30 feet... (etc.)
?
(I have only used tables once in a miniatures game with MapTool so I may not really know what I'm talking about)
While not MT specific, here is some code I wrote for DMG and DnD3.0. It automated the process of disarming your target. If MT ever had this type of ability and still stayed system agnostic, it would be a great day of rejoicing.
Code: Select all
'In the General Scripting Editor replace the scripting for the Action Button 24 with the script below.
'Start of Action Button 24
'Buttons 24-29 are shown on the far right of the Attacks tab. In lower res display size this button may not be visible. It can be moved to any button you prefer.
'Button Label: Prompted Disarm
'Tooltip: Advanced diceless Disarm script
Public Sub ActionButton24()
'
' Auto-Disarm code 30APR2006 by DrS
rev = "1.0.2"
version = "Improved Disarm Script v" + rev
' This script is for the D&D 30e Rules. (Improved Disarm is different than v3.5)
'
' This script was designed for use in my campaign. Feel free to modify it to your needs.
' I have borrowed code from several coders on the Official Forums for DM Genie.
' Special thanks for Ktaal and Azhrei for code and advice.
'
' This script makes use of 5 new Conditions: "Gauntlets, locked", "Disarm, Dropped Weapon", "Disarm, Lost Weapon",
' "Grabbed Opponent's Weapon", "Provoked AoO"
' There is 1 new item with scripting, called "Gauntlet, locked"
'
' Check to make sure the attacker has at least a partial action available, if not, then quit.
if cr.CanAct = FALSE then
MsgBox "You must be able to perform a melee attack action to attempt a disarm. You can not currently act!", vbInformation, version
exit sub
end if
' IF Attacker has Improved Disarm inform player they do not provoke an AoO
if cr.HasFeatName("Improved Disarm") = TRUE then
msg1 = cr.Name & " has Improved Disarm and does not provoke an AoO'd during the disarm attempt (PHB p.83). Also, you can not be disarmed. " & vbcr & "You and the defender make opposed attack rolls with your respective weapons. If the weapons are different sizes, the combatant with the larger weapon gets a bonus on the attack roll of +4 per difference in size category. If the defender is using a weapon in two hands, he gets an additional +4 bonus. If you beat the defender, the defender is disarmed. If you attempted the disarm action unarmed, you now have the weapon. Otherwise, it's on the ground at the defender's feet. If you fail, then the defender may immediately react and make an attempt to disarm you with the same sort of opposed melee attack roll." & vbcr & vbcr & "Note: A defender wearing spiked gauntlets can't be relieved of the gauntlets by a disarm action. A defender using a weapon attached to a locked gauntlet gets a +10 bonus to any disarm attempt made by an opponent."
ReplyButton = MsgBox (msg1 ,vbInformation, version)
ReplyButton = VBYes
else
msg1 = "As a melee attack, you may make a disarm attempt (PHB p.137). In doing so, you provoke an attack of opportunity from the defender. Then you and the defender make opposed attack rolls with your respective weapons. If the weapons are different sizes, the combatant with the larger weapon gets a bonus on the attack roll of +4 per difference in size category. If the defender is using a weapon in two hands, he gets an additional +4 bonus. If you beat the defender, the defender is disarmed. If you attempted the disarm action unarmed, you now have the weapon. Otherwise, it's on the ground at the defender's feet. If you fail, then the defender may immediately react and make an attempt to disarm you with the same sort of opposed melee attack roll." & vbcr & vbcr & "Note: A defender wearing spiked gauntlets can't be relieved of the gauntlets by a disarm action. A defender using a weapon attached to a locked gauntlet gets a +10 bonus to any disarm attempt made by an opponent." & vbcr & vbcr & "Do you want to Roll for the Disarm Now? For AoO Choose NO!"
ReplyButton = MsgBox (msg1 ,vbInformation + VBYesNo, version)
end if
if ReplyButton = VBYes then
'check for a current target
dim disarmtarget
msg = "Which Creature do you want to attempt to Disarm?"
if cr.Enemy then ' Improved code with Ktaal suggestion
Set disarmtarget = func.ChooseCreature(cSTR(msg), 2, False, True)
if disarmtarget Is Nothing then
'MsgBox "Made it here! 1" & vbcr & vbcr & "Remove after Testing",vbExclamation,"DEBUG"
Exit Sub
end if
else
Set disarmtarget = func.ChooseCreature(cSTR(msg), 2, True, False)
if disarmtarget Is Nothing then
'MsgBox "Made it here! 2" & vbcr & vbcr & "Remove after Testing",vbExclamation,"DEBUG"
Exit Sub
end if
end if
'
'Check if Defender has Improved Disarm feat. IF so, then they can not be disarmed. EXIT routine.
if disarmtarget.HasFeatName("Improved Disarm") = TRUE then
func.AddToCombatLog "\par\b1\cf1 " & disarmtarget.Name & "'s \b0 has the Improved Disarm feat and can not be disarmed. \cf0\par"
Exit Sub
end if
' This routine makes the assumption that the Defender has his Current Weapon selected.
' See code below to allow the DM to select a weapon for Defender. Still need to figure out how to make that
' selection the current weapon. . .
'
DefAttNo = disarmtarget.LastAttack ' How do I take DefAttObj and stuff it into LastAttack?
' Ensure the Defender has a weapon selected
' Use this code to allow the Defender to select his weapon
'set DefAttObj = disarmtarget.ChooseOneAttack("Choose the Defender's weapon", True)
'if DefAttObj is nothing then
'exit sub
'end if
set DefAttObj = disarmtarget.Attack(DefAttNo)
DefWeapName = DefAttObj.Name ' Defender's Weapon Name
AttAttNo = cr.LastAttack
set AttAttObj = cr.Attack(AttAttNo)
AttWeapName = AttAttObj.Name ' Attacker's Weapon Name
' Check to see if Attacker is "Unarmed" or "Strike,"
if (inStr(1, AttAttObj.Name, "Unarmed", VBTEXTCOMPARE) = 1 or inStr(1, AttAttObj.Name, "Strike,", VBTEXTCOMPARE) = 1) then AttIsUnarmed = 1
'AttIsUnarmed = inStr(1, AttAttObj.Name, "Unarmed", VBTEXTCOMPARE)
'MsgBox AttWeapName & " " & AttIsUnarmed & vbcr & vbcr & "Remove after Testing",vbExclamation,"DEBUG"
'Exit Sub
' Figure out the genders and use these VARS in the combat string to get the gender messages correct.
if disarmtarget.Gender = "Male" or disarmtarget.Gender = "male" Then
DefGend = "his"
elseif disarmtarget.Gender = "Female" or disarmtarget.Gender = "female" Then
DefGend = "her"
else
DefGend = "his/her"
end if
if cr.Gender = "Male" or cr.Gender = "male" Then
AttGend = "his"
elseif cr.Gender = "Female" or cr.Gender = "female" Then
AttGend = "her"
else
AttGend = "his/her"
end if
' Check to make sure Defender is Armed and not wearing Spiked Gauntlets
' Search the inventory for "Gauntlet, spiked"
' Changed logic for Spiked Gauntlets in version 1.0.2
lookFor = "Gauntlet, spiked"
ItemCnt = 0
for i = 1 to disarmtarget.NumItems
it = disarmtarget.itemName(i)
compare = left(it, 16)
if (strcomp(compare, lookFor, 1) = 0) then ' Found "Gauntlet, spiked"
LastItem = it
e = disarmtarget.GetItemStat(i, "Equipped") ' 0 = unequipped, -1 = equipped
ItemCnt = ItemCnt + 1
if e = (-1) then
Eqp = e ' Guantlets are Equipped!
end if
end if
next
if (ItemCnt = 0) then
SpikedGauntlets = FALSE
elseif (ItemCnt >= 1 and Eqp = -1) then
SpikedGauntlets = TRUE
elseif (ItemCnt >= 1 and Eqp = 0) then
SpikedGauntlets = FALSE
func.AddToCombatLog "\par\b1\cf1 " & disarmtarget.Name & " \b0 has Spiked Gauntlets, but they are not currently equipped. \cf0\par"
end if
if SpikedGauntlets = FALSE then
' Check the Defender for a current Unarmed Attack ("Unarmed" and "Strike,")
if (inStr(1, DefAttObj.Name, "Unarmed", VBTEXTCOMPARE) = 1 or inStr(1, DefAttObj.Name, "Strike,", VBTEXTCOMPARE) = 1) then IsUnarmed = 1
'IsUnarmed = inStr(1, DefAttObj.Name, "Unarmed", VBTEXTCOMPARE)
if IsUnarmed = FALSE then
'
'Calculate the Attacker Opposed Roll
'
dim cAtt
set cAtt = cr.GetCurrentAttack
'if not func.ValidAt(cAtt) then exit sub
AttRoll = func.RollDice("1d20")
AttRoll = Inputbox("Enter Manual Attack Roll (1d20):" & vbcr & vbcr & AttWeapName, cr.Name, AttRoll)
'Prompt for which attack #? for Characters with Multiple attacks
attnum = 1
attnumstr = ""
if (cAtt.AB(2) <cAtt> -90) then
'Generate the question dialog
s = "attnum = func.choose(""Which attack does " & cr.Name & " use to attempt a Disarm?"", "
for i = 1 to 5
if (cAtt.AB(i) > -90) then
s = s & """#" & i & ": +" & cAtt.AB(i) & """, " & i & ", "
end if
next
s = mid(s,1,len(s)-2)
s = s & ")"
execute(s)
if attnum <1> -90) then
s = s & """#" & i & ": +" & cDef.AB(i) & """, " & i & ", "
end if
next
s = mid(s,1,len(s)-2)
s = s & ")"
execute(s)
if attnum < 1 then exit sub
attnumstr = ", #" & attnum
end if
IsTwoHanded = DefAttObj.HandUsed ' 3=Two-Handed
if IsTwoHanded = 3 then
IsTwohanded = 4 'Att Bonus for TwoHanded Weapon
else
IsTwoHanded = 0
end if
' The following section requires that you add a new Condition called "Gauntlets, locked".
' I will include this Condition data file with the script.
'
' If you have equiped the scripted item, "Gauntlet, locked" then it will set
' the condition "Gauntlets, locked" = TRUE
'
DefGauntletsLocked = 0
if disarmtarget.GetCondition("Gauntlets, locked") then
DefGauntletsLocked = 10
end if
DefAB = cDef.AB(attnum)
DefWeapsize = func.GetSizeValue(cDef.SizeStr) * 4
DefTotal = DefRoll + DefAB + DefWeapsize + IsTwoHanded + DefGauntletsLocked
s = func.MakeRollString ((DefTotal), (DefRoll), DefAB, "Attack Bonus", DefWeapsize, "Weapon Size ", IsTwoHanded, "Two-Handed", DefGauntletsLocked, "Locked Gauntlets")
func.AddToCombatLog "\b1 " & disarmtarget.Name & " \b0 (" & cDef.Name & attnumstr & ") makes " & DefGend & " Disarm Defense : " & s
' Start figuring how won the oppossed roll
'
' Check for Attacker rolling 1, this is an Auto-miss as per 30e MainFAQv06272003.pdf!
if AttRoll = 1 then
func.AddToCombatLog "\b1\cf1 " & cr.Name & "'s \b0 rolled a 1 on Disarm attack and FAILS! \b1" & disarmtarget.Name & " \b0 may now immediately react and make an attempt to Disarm " & cr.Name & " using " & AttGend & " (" & DefWeapName & "). Switch current characters and run the Disarm Script again. \cf0\par"
Exit Sub
elseif AttRoll = 20 then
' Cheapo way to force an automatic hit without writing more code or changing scructure. I'm a lame-donkey.
AttTotal = 9999
end if
' It's a Tie! Use the the Grapple tie-breaker rules from "Rules of the Game- All about the Grapple"
' Because a grapple check is an opposed check, the combatant with the higher total wins the check.
' If the check is a tie, the combatant with the highest total grapple modifier (base attack bonus + Strength modifier + special size modifier + any miscellaneous that might apply).
' If there is a tie and both combatants have the same grapple modifier, roll again to break the tie.
'
If AttTotal = DefTotal then
AttNotes = ""
DefNotes = ""
AttG = cr.GrappleTotal(AttNotes, True, False)
DefG = disarmtarget.GrappleTotal(DefNotes, True, False)
func.AddToCombatLog "\b1 " & cr.Name & " \b0 and \b1" & disarmtarget.Name & " \b0 have \b1\cf2 TIED! \b0\cf0"
func.AddToCombatLog "Checking Grapple MODS."
func.AddToCombatLog " \b1 " & cr.Name & " \b0" & AttG & AttNotes
func.AddToCombatLog " \b1 " & disarmtarget.Name & " \b0" & DefG & DefNotes
If AttG = DefG then
func.AddToCombatLog " \b1\cf1 It is still a TIE! Run the Disarm script again to break the tie! \b0\cf0"
Exit Sub
End if
AttTotal = AttG
DefTotal = DefG
End if
' Attacker Wins!
'
If AttTotal > DefTotal then
' In version 1.0.2 I removed all code that deleted weapon from inventory and weapon attack
' until I figure out how to transfer items between creatures.
' IF the Attacker is "Unarmed" then they take possession of the weapon item
' TODO: need to find the proper way to copy or transfer an item from creature to creature
' instead of creating a new item and Attack on the Attacker.
'
if AttIsUnarmed = 1 then
'MsgBox AttWeapName & " " & AttIsUnarmed & vbcr & " Need to add weapon and attack to creature" & vbcr & "Remove after Testing",vbExclamation,"DEBUG"
disarmtarget.SetCondition "Disarmed, Weapon Lost", True, 99 'You have taken the Defender's dropped weapon
func.AddToCombatLog "\b1\cf2 " & cr.Name & "'s Disarm attack is a SUCCESS! You have grabbed " & DefGend & " (" & DefWeapName & ") and now have control of it. " & disarmtarget.Name & " is now unarmed. Change defenders attack manually next round, and the weapon should be removed from " & DefGend & " inventory. \b0\cf0\par"
cr.SetCondition "Grabbed Opponent's Weapon", TRUE, 99 ' Set a condition reminder on the Attacker that he has weapon.
else
'
' You must setup a new Condition called "Disarmed, Dropped Weapon" for the next line to fuction
disarmtarget.SetCondition "Disarmed, Dropped Weapon", True, 99 'Creature has dropped weapon
func.AddToCombatLog "\b1\cf2 " & cr.Name & "'s Disarm attack is a SUCCESS! " & disarmtarget.Name & "'s weapon (" & DefWeapName & ") is now laying on the ground at " & DefGend & " feet. It should be removed from " & DefGend & " inventory and they are now unarmed. Change defenders attack manually next round. \b0 \cf0\par"
end if
'The Defender wins!
Elseif AttTotal < DefTotal then
func.AddToCombatLog "\b1\cf1 " & cr.Name & "'s \b0 Disarm attack is a FAILURE! \b1" & disarmtarget.Name & " \b0 may now immediately react and make an attempt to Disarm " & cr.Name & " using " & AttGend & " (" & DefWeapName & "). Switch current characters and run the Disarm Script again. \cf0\par"
End if
' No weapon to Disarm
else
func.AddToCombatLog "\par\b1\cf1 " & disarmtarget.Name & "'s \b0 current attack is \b1" & DefWeapName & "\b0; there is no weapon to Disarm. \cf0\par"
end if
' Spiked Gauntlets
else
func.AddToCombatLog "\par\b1\cf1 " & disarmtarget.Name & " \b0 is wearing Spiked Gauntlets and cannot be Disarmed. \cf0\par"
end if
' if ReplyButton = VBNo then QUIT
else
func.AddToCombatLog "\par Disarm Action CANCELED \par"
end if
End Sub
'End of Action Button 2
If that lookup worked correctly we could create a d20srd based template with all feats, skills, and even spells that could be called.
Also, I would suggest a /metbl command that would display table results to only you. I know it gets complicated if the table result has /emit but I can see where I'd like the skill to be listed for everybody and other times as a DM I might want to look up the spell a badguy is about to cast without the players knowing that's what is going to happen and the mechanics behind it. I guess if you did all the commands to yourself it would work...
Also, I would suggest a /metbl command that would display table results to only you. I know it gets complicated if the table result has /emit but I can see where I'd like the skill to be listed for everybody and other times as a DM I might want to look up the spell a badguy is about to cast without the players knowing that's what is going to happen and the mechanics behind it. I guess if you did all the commands to yourself it would work...