[Beta Release] Spell Manager 3.0.0 for b86

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

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

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

[Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

This is a trial release of beta testing the new (massive) rewrite of Plo's Spell Manager.

Do:
Try it out!
Make classes
Cast spells
Fiddle with special abilities
Think of improvements and send ideas my way
Give me detailed notes on any errors

Don't:
Integrate into existing campaigns (I'm going to rework how data is stored/called to speed some things up without mucking with the core)
Plan on keeping what you make (see above)
Poke people in the eye
Last edited by plothos on Sat Aug 20, 2011 10:54 am, edited 1 time in total.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] PSM 3.0.0 for b86

Post by plothos »

Official To-Do List:
1. Ability codes for Pathfinder
2. Speed up interface/change some of the data storage
3. Improve drop-in-ability
4. Creating a class modeled on another should allow copying of abilities
Last edited by plothos on Sat Aug 20, 2011 11:13 am, edited 1 time in total.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

First bug, a minor one. If you run the manager off a token and go to the bookcase and edit class abilities and use the simulate character option, properties on the token can be altered. I'll try to come up with a fix, but it will only rarely show up if you simulate off a token with properties defined for Strength, Dexterity, Constitution, Intelligence, Wisdom, and/or Charisma.
The workaround is simple enough: edit class abilities from the Lib, if you're going to use the simulate option. (You can do this by clicking the macro "Bookcase Starter" in its selection panel.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

Any problems/suggestions?
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by neofax »

Here are some things I found:
  • After swapping out d20 for Pathfinder the frame did not refresh to show I had changed the books.
  • "Class limits the number of spells known" should probably be in the main list with all of the other class questions.
  • Receive error 1 when making a Pathfinder Inquisitor.
  • It allows me to take more spells than I should(Choose Sorcerer 20 and spells known 5 when I should only get 4)
  • The program should roll all of the pertinent checks and damage/heal if applicable.
Error 1
I was using Sorcerer as the spell list, Bard as the Spells Known, Bard as the SPD, Cleric for the Domains.

Code: Select all

Invalid condition in IF(checknum > -1) roll option.       Statement options (if any): if(checknum > -1)       Statement Body : stopeet = 1; levelcheck = levelcheck-1
I played with it while playing a game with the kids for 4 hrs and these are some of the errors or suggestions I have.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

Thanks for the feedback, Neo. As soon as I get done with PF skill data input, I will get on some of those issues. The damage/heal rolls are waiting on expanded AM database work, but I'll try to work out what those errors are about.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by aliasmask »

I found that the data from the wrathgon lib is incompatible with this library. In order to run your lib I have to set casterInfo to {}. I made a button to start up either spell menu with the following code:

Code: Select all

@@ @<b>Spell Menu</b>
@PROPS@ fontColor=white ; autoExecute=true ; fontSize=11pt ; sortBy= ; color=blue ; playerEditable=false; applyToSelected=true; group= ; tooltip= ; minWidth=94 ; 
[H: id = getSelected()]
[H: switchToken(id)]
[H: spellManager = getProperty("am.spellManager")]
[H, if(json.isEmpty(spellManager)), code: {
   [H: abort(input("tip|<html><b>The Plothos and Wrathgon data is incompatible with each other<br>so, this question will only be asked once.</b><br><br><b>Differences</b><br>Plothos: Working Special abilities<br>Wrathgon: additional spell info on casting.<br><br></html>||LABEL|SPAN=TRUE","spellManager|Plothos 3.0 beta,Wrathgon 11GV2.a|Select a Spell Manager|RADIO|SELECT="+spellManager))]
   [H: setProperty("am.spellManager",spellManager)]
};{}]
[H, if(spellManager), code: {
   [H, MACRO("Spell Main@Lib:Magic"): ""] 
};{
   [H, macro("Spell Main@Lib:spells"): ""]
}]
!! 
edit: Updated code to be more descriptive in the differences.
Attachments
Image1.jpg
Image1.jpg (31.76 KiB) Viewed 10316 times
Last edited by aliasmask on Fri Aug 26, 2011 1:14 pm, edited 2 times in total.

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by aliasmask »

Here's a fix for when you rest and don't have any special abilities but try to rest them anyway when you don't have the CI_SpecAbils defined in the token type properties.

Code: Select all

@@ @Rest CI Spec Abils
@PROPS@ fontColor=yellow ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=147 ; 
[H: CI_SpecAbils = getProperty("CI_SpecAbils")]
[H, if(! json.isEmpty(CI_SpecAbils)), code: {
   [h: allcatnames = json.fields(CI_SpecAbils)]
   [h: allgroupnames = json.fields(getProperty("CISA_Groups"))]
};{
   [H: allcatnames = ""]
}]
[h, foreach(catname, allcatnames), code:{
    [if(listFind(allgroupnames, catname)==-1),code:{
        [macro("Rest CI Category@Lib:spells"): catname]
    }; {
        [macro("Rest CI Group@Lib:spells"): catname]
    }]
}]

!!
 

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

Thanks AM. Looking forward to the new DB.
I'm evacuating in the face of Irene, which may result in either lots of coding time or very little for a while. I'll have to see how it all shakes out.

I hope anyone else out there in the path of this storm is taking it seriously. Don't play with your life, health, or well-being.
Best wishes with you all!
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by aliasmask »

That one little change (last post) fixed the one issue, but there are many, many places to update getting CI_SpecAbils and CISA_Groups. So, for the sake of expediency, I just added it to the DnD35 (and Pathfinder) token property as:

Code: Select all

CI_SpecAbils:{}
CISA_Groups:{}
I've made a couple of tweaks to output when using an ability. The ability name will show a tooltip with notes and charges. These are the changes I made:
||| UPDATES |||

Code: Select all

@@ @Use CI Group Abil
@PROPS@ fontColor=yellow ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=94 ; 
[h:power=macro.args]

[h:groupname=json.get(power, "Category")]
[h:groupdata=json.get(CISA_Groups, groupname)]
[h:grouppointsleft=json.get(groupdata,"Uses Left")]
[h:pointname=json.get(groupdata,"Point Name")]

[h:allcatabils=json.get(CI_SpecAbils,groupname)]

[h:powname=json.get(power,"Name")]
[h:powusage=json.get(power,"Usage")]
[h:powgroupdata=json.get(power,"Uses")]

[h,if(powusage=="Code"): powgroupdata=eval(powgroupdata)]

[h:report=""]

[h,if(powusage=="Varies"),code:{
  [screen=input(
    "powgroupdata|1|How many "+pointname+" will this use?|text|width=5"
  )]
  [abort(screen)]
  [if(powgroupdata<0 || powgroupdata>grouppointsleft), code:{
	[assert(0, "Invalid Number Entered. Action Cancelled.", 0)]
  }; {}]
}; {}]

[h:grouppointsleft = grouppointsleft-powgroupdata]
[h,if(powgroupdata>0):report="<br>"+powgroupdata+" "+pointname+" expended"]
[h:groupdata = json.set(groupdata,"Uses Left",grouppointsleft)]
[h:CISA_Groups=json.set(CISA_Groups, groupname, groupdata)]

[H: powerTip = json.set(power,"useLink",0)]
[H, macro("Generate CI Straight Link@Lib:spells"): powerTip]
[h: powTip = strformat("<span title='<html>%s</html>' style='color:blue'>%{powname}</span>",replace(macro.return,"'",","))]

[h:passreport="<b>"+token.name+" uses "+powTip+"</b>"+report]
[h: flavortext = json.get(power, "Flavor Text")]
[h: flavoronly = json.get(power, "Flavor Only")]
[h, if(string(flavortext) != "(None)"), code:{
	[flavortext = eval(string(flavortext))]
	[h, if(flavoronly == 1), code:{
		[passreport = flavortext]
	}; {
		[passreport = string(passreport)+string(flavortext)]
	}]
}; {}]

[h:passinfo=json.set("{}","Ability Name",powname,"Points Used",powgroupdata,"Point Name",pointname)]
[h:pass=json.set("{}","Report",passreport,"Output Class","Special Ability","Specific Type","Group Ability","Use Info",passinfo)]

[macro("Output@Lib:spells"):pass]
[macro("Spec Abil Main@Lib:spells"):"Class-Independent"]

!!
@@ @Use CI Straight Abil
@PROPS@ fontColor=yellow ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=147 ; 
[h:power=macro.args]

[h:powcat=json.get(power,"Category")]
[h:allcatabils=json.get(CI_SpecAbils,powcat)]

[h:powname=json.get(power,"Name")]
[h:powusage=json.get(power,"Usage")]
[h:powusesleft=json.get(power,"Uses Left")]

[h:report=""]
[h:usenum=0]

[r,if(powusage=="Uses" || powusage=="Rounds"),code:{
  [h:powusesleft=powusesleft-1]
  [h:report="<br>1 use/round expended"]
}; {}]

[r,if(powusage=="Charges"),code:{
  [h:powusesleft=powusesleft-1]
  [h:power=json.set(power,"Uses",powusesleft+"*1")]
  [h:report="<br>1 charge expended"]
}; {}]

[r,if(powusage=="Multi Charges"),code:{
  [h:screen=input(
    "chargenum|0|How many charges are you expending? (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h:powusesleft=powusesleft-chargenum]
  [h:power=json.set(power,"Uses",powusesleft+"*1")]
  [h:report="<br>"+chargenum+" charge(s) expended"]
}; {}]

[r,if(powusage=="Bolts"),code:{
  [h:screen=input(
    "boltnum|0|How many bolts would you like to call? (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(boltnum>powusesleft):boltnum=powusesleft]
  [h:powusesleft=powusesleft-boltnum]
  [h:report="<br>"+boltnum+" bolts are called from the heavens."]
}; {}]

[r,if(powusage=="Feet"),code:{
  [h:screen=input(
    "feetnum|0|How many feet of moment are you using? (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(feetnum>powusesleft):feetnum=powusesleft]
  [h:powusesleft=powusesleft-feetnum]
  [h:report="<br>"+feetnum+" feet of travel expended"]
}; {}]

[r,if(powusage=="Levels"),code:{
  [h:screen=input(
    "junkvar|Use one use for each level the metamagic applied would normally increase the level of the spell|This may require multiple uses depending on which metamagic you are using|label",
    "usenum|1|Please enter the number of uses you are expeding (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(usenum>powusesleft):usenum=powusesleft]
  [h:powusesleft=powusesleft-usenum]
  [h:report="<br>Metamagic effect sufficient to raise the spell level "+usenum+" levels may be applied to the spell being cast"]
}; {}]

[r,if(powusage=="Points"),code:{
  [h:screen=input(
    "usenum|1|Please enter the number of points you are using up (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(usenum>powusesleft):usenum=powusesleft]
  [h:powusesleft=powusesleft-usenum]
  [h:report="<br>"+usenum+" points expended"]
}; {}]

[h:newpower=json.set(power,"Uses Left",powusesleft)]
[h:allcatabils=json.set(allcatabils,powname,newpower)]
[h:CI_SpecAbils=json.set(CI_SpecAbils,powcat,allcatabils)]

[H: powerTip = json.set(power,"useLink",0)]
[H, macro("Generate CI Straight Link@Lib:spells"): powerTip]
[h: powTip = strformat("<span title='<html>%s</html>' style='color:blue'>%{powname}</span>",replace(macro.return,"'",","))]

[h:passreport="<b>"+token.name+" uses "+powTip+"</b>"]
[h: flavortext = json.get(power, "Flavor Text")]
[h: flavoronly = json.get(power, "Flavor Only")]
[h, if(string(flavortext) != "(None)"), code:{
	[flavortext = eval(string(flavortext))]
	[h, if(flavoronly == 1), code:{
		[passreport = flavortext]
	}; {
		[passreport = string(passreport)+string(flavortext)]
	}]
}; {}]
[h: passreport = string(passreport)+string(report)]

[h:passinfo=json.set("{}","Ability Name",powname,"Amount Used",usenum,"Usage Type",powusage)]
[h:pass=json.set("{}","Report",passreport,"Output Class","Special Ability","Specific Type","Standard Ability","Use Info",passinfo)]

[macro("Output@Lib:spells"):pass]
[macro("Spec Abil Main@Lib:spells"):"Class-Independent, 0"]

!!
@@ @Use Straight Abil
@PROPS@ fontColor=lime ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=94 ; 
[h: power = json.get(macro.args, "Powdata")]
[h: classviewed = json.get(macro.args, "Classviewed")]
[h: classdata = json.get(CasterInfo, classviewed)]
[h: thiscasterlevel = json.get(classdata, "Caster Level")]
[h: thisclasslevel = json.get(classdata, "Class Level")]
[h: SAdata = json.get(classdata, "SpecAbil Data")]
[h: SAgroupdata = json.get(classdata, "SpecAbil Groups")]

[h: powcat=json.get(power, "Category")]
[h: catdata=json.get(SAdata, powcat)]

[h:powname=json.get(power,"Name")]
[h:powusage=json.get(power,"Usage")]
[h:powusesleft=json.get(power,"Uses Left")]

[h:report=""]
[h:usenum=0]

[r,if(powusage=="Uses" || powusage=="Rounds"),code:{
  [h:powusesleft=powusesleft-1]
  [h:report="<br>1 use/round expended"]
}; {}]

[r,if(powusage=="Charges"),code:{
  [h:powusesleft=powusesleft-1]
  [h:power=json.set(power,"Uses",powusesleft+"*1")]
  [h:report="<br>1 charge expended"]
}; {}]

[r,if(powusage=="Multi Charges"),code:{
  [h:screen=input(
    "chargenum|0|How many charges are you expending? (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h:powusesleft=powusesleft-chargenum]
  [h:power=json.set(power,"Uses",powusesleft+"*1")]
  [h:report="<br>"+chargenum+" charge(s) expended"]
}; {}]

[r,if(powusage=="Bolts"),code:{
  [h:screen=input(
    "boltnum|0|How many bolts would you like to call? (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(boltnum>powusesleft):boltnum=powusesleft]
  [h:powusesleft=powusesleft-boltnum]
  [h:report="<br>"+boltnum+" bolts are called from the heavens."]
}; {}]

[r,if(powusage=="Feet"),code:{
  [h:screen=input(
    "feetnum|0|How many feet of moment are you using? (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(feetnum>powusesleft):feetnum=powusesleft]
  [h:powusesleft=powusesleft-feetnum]
  [h:report="<br>"+feetnum+" feet of travel expended"]
}; {}]

[r,if(powusage=="Levels"),code:{
  [h:screen=input(
    "junkvar|Use one use for each level the metamagic applied would normally increase the level of the spell|This may require multiple uses depending on which metamagic you are using|label",
    "usenum|1|Please enter the number of uses you are expeding (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(usenum>powusesleft):usenum=powusesleft]
  [h:powusesleft=powusesleft-usenum]
  [h:report="<br>Metamagic effect sufficient to raise the spell level "+usenum+" levels may be applied to the spell being cast"]
}; {}]

[r,if(powusage=="Points"),code:{
  [h:screen=input(
    "usenum|1|Please enter the number of points you are using up (remaining: "+powusesleft+")"
  )]
  [h:abort(screen)]
  [h,if(usenum>powusesleft):usenum=powusesleft]
  [h:powusesleft=powusesleft-usenum]
  [h:report="<br>"+usenum+" points expended"]
}; {}]

[h:newpower=json.set(power,"Uses Left",powusesleft)]
[h:catdata=json.set(catdata,powname,newpower)]

[h: SAdata = json.set(SAdata, powcat, catdata)]
[h: classdata = json.set(classdata, "SpecAbil Data", SAdata)]
[h: CasterInfo = json.set(CasterInfo, classviewed, classdata)]

[H: powerTip = json.set(power,"useLink",0)]
[H, macro("Generate CI Straight Link@Lib:spells"): powerTip]
[h: powTip = strformat("<span title='<html>%s</html>' style='color:blue'>%{powname}</span>",replace(macro.return,"'",","))]

[h:passreport="<b>"+token.name+" uses "+powTip+"</b>"]
[h: flavortext = json.get(power, "Flavor Text")]
[h: flavoronly = json.get(power, "Flavor Only")]
[h, if(string(flavortext) != "(None)"), code:{
	[flavortext = eval(string(flavortext))]
	[h, if(flavoronly == 1), code:{
		[passreport = flavortext]
	}; {
		[passreport = string(passreport)+string(flavortext)]
	}]
}; {}]
[h: passreport = string(passreport)+string(report)]

[h:passinfo=json.set("{}","Ability Name",powname,"Amount Used",usenum,"Usage Type",powusage)]
[h:pass=json.set("{}","Report",passreport,"Output Class","Special Ability","Specific Type","Standard Ability","Use Info",passinfo)]

[macro("Output@Lib:spells"): pass]
[macro("Spec Abil Main@Lib:spells"): classviewed]

!!
@@ @Generate CI Straight Link
@PROPS@ fontColor=yellow ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=147 ; 
[h:power=macro.args]

  [h:powname=json.get(power,"Name")]
  [h:powusesleft=json.get(power,"Uses Left")]
  [h, if(string(powusesleft) == "Infinite"): powusesleft = 1]
  [h:powusage=json.get(power,"Usage")]
  [h:powatlevel=json.get(power,"At Level")]
  [h:powatlevelprop=json.get(power,"At Level Property")]
  [h,if(powatlevelprop!="(None)"): atlevelcheck=eval(string(powatlevelprop)); atlevelcheck=0]
  [h:usereport=""]
  [H: uselink = json.get(power,"useLink")]
  [h,if(powusage=="Uses" || powusage=="At-Will" || powusage=="Rounds" || powusage=="Bolts" || powusage=="Feet" || powusage=="Levels" || powusage=="Points" || powusage=="Charges" || powusage=="Multi Charges"), code: {
      [H, if(json.isEmpty(uselink)): uselink=1]
   };{
     [h:uselink=0]
  }]
  [h,if(powusage=="Uses"):usereport=" (x"+powusesleft+") "]
  [h,if(powusage=="Levels"):usereport=" ("+powusesleft+" levels remaining) "]
  [h,if(powusage=="At-Will"):usereport=" (at will) "]
  [h,if(powusage=="Rounds"):usereport=" ("+powusesleft+" rounds remaining) "]
  [h,if(powusage=="Bolts"):usereport=" ("+powusesleft+" bolts remaining) "]
  [h,if(powusage=="Feet"):usereport=" ("+powusesleft+" feet remaining) "]
  [h,if(powusage=="Points"):usereport=" ("+powusesleft+" points remaining) "]
  [h,if(powusage=="Charges" || powusage=="Multi Charges"):usereport=" ("+powusesleft+" charges remaining) "]
  [h:pownote=eval(json.get(power,"Note"))]
  
[H: output = ""]

[h,if(powatlevelprop!="(None)"),code:{
  [h,if(atlevelcheck>=powatlevel && uselink==1),code:{
    [h,if(powusesleft>0 || powusage=="At-Will"): output = output + macroLink(powname,"Use CI Straight Abil@Lib:spells","none",power,token.name); "<u>"+powname+"</u>"]
  }; {
    [h,if(atlevelcheck>=powatlevel): output = output + "<b>"+powname+"</b>"]
  }] 
  [h,if(atlevelcheck>=powatlevel): output = output + usereport+"<font size='-1'><i>"+pownote+"</i></font><br>"]
}; {
  [h,if(uselink==1 && powusage!="At-Will"),code:{
    [h,if(powusesleft>0): output = output + macroLink(powname,"Use CI Straight Abil@Lib:spells","none",power,token.name); "<u>"+powname+"</u>"]
  }; {
    [h,if(powusage=="At-Will"): output = output + macroLink(powname,"Use CI Straight Abil@Lib:spells","none",power,token.name)]
  }]
  [h,if(uselink==0): output = output + "<b>"+powname+"</b>"]
  [h: output = output + usereport+"<font size='-1'><i>"+pownote+"</i></font><br>"]
}]
[R: output]
[H: macro.return = output]

!!
edit: I noticed there's no option for using "charges" that's not from a permanent item or "uses" that allows more than 1 to be used. The power I created is really a spell effect that gives me 19 uses of a touch spell. I'm using the "points" option, but it's more of a use that is being expended and I can use it more than once a round (once for each successful attack). I also just updated the code to close the </html> and made the power blue to standout and let user know there is a tooltip there.

edit: Also, when editing a power, the power description is overwritten with the default description. I'll see if I can fix that.
Attachments
Image2.jpg
Image2.jpg (11.96 KiB) Viewed 10318 times

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by aliasmask »

Here's the update to fix the description being overwritten on edit:
||| UPDATES |||

Code: Select all

@@ @Modify Spec Abil Click
@PROPS@ fontColor=lime ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=147 ; 
[h: passed = macro.args]
[h: classviewed = json.get(passed, "Classviewed")]
[h: classdata = json.get(CasterInfo, classviewed)]
[h: SAdata = json.get(classdata, "SpecAbil Data")]
[h: powdata = json.get(passed, "Abildata")]

[h: oldpowname = json.get(powdata, "Name")]
[h: powcategory = json.get(powdata, "Category")]
[h: catdata = json.get(SAdata, powcategory)]
[h: powatlevel = json.get(powdata, "At Level")]
[h: powatlevelprop = json.get(powdata, "At Level Property")]
[h: powusage = json.get(powdata, "Usage")]
[h: powuses = json.get(powdata, "Uses")]
[h: powusesleft = json.get(powdata, "Uses Left")]
[h: pownote = json.get(powdata, "Note")]
[h: powflavor = json.get(powdata, "Flavor Text")]
[h: powflavoronly = json.get(powdata, "Flavor Only")]
[h, if(string(powflavor)=="(None)" || string(powflavor)==""), code:{
	[inptext = "addflavor|0|Add flavortext?|check"]
	[quote3 = 0]
	[quote4 = 0]
}; {
	[inptext = "powflavor|"+powflavor+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=90##quote3|1|Put quote at head of flavor text?|check##quote4|1|Put quote at end of flavor text?|check##powflavoronly|Supplement,Override|Flavor text interacts with default output how?|radio|select="+powflavoronly+" orient=h"]
	[addflavor = 0]
}]

[h: usagelist="As an AT-WILL power,As a Number of BOLTS that can be called in large numbers,As an ITEM with permanently expeded CHARGES used 1 at a time,As an ITEM with permanently expended CHARGES used in varying amounts,As a number of FEET that can be called in large numbers,As a number of LEVELS normally added to apply metamagic,As a constantly active PASSIVE power,As a number of POINTS that can be used in large numbers (e.g. for absorbtion),As a number of ROUNDS used one at a time,As a number of USES used one at a time (like casting a spell)"]
[h: shortusagelist="At-Will,Bolts,Charges,Multi Charges,Feet,Levels,Passive,Points,Rounds,Uses"]
[h: usagestart = listFind(shortusagelist, powusage)]

[h:screen3=input(
  "powname|"+oldpowname+"|Name|text|width=50",
  "powatlevel|"+powatlevel+"|Reveal number|text|width=3",
  "powatlevelprop|"+powatlevelprop+"|Reveal property ('(None)' to always display)|text|width=50",
  "powusage|"+usagelist+"|How should the manager treat the way it is used?|list|select="+usagestart+" value=number",
  "powuses|"+powuses+"|Code for uses per day ('Automated' for pre-coded options)|text|width=50",
  "powusesleft|"+powusesleft+"|Number of uses left now|text|width=5",
  "pownote|"+pownote+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=75",
  "quote1|1|Put quote at head of note?|check",
  "quote2|1|Put quote at end of note?|check",
  inptext
)]
[h:abort(screen3)]

[h, if(addflavor == 1), code:{
	[screen = input(
		"powflavor|"+powflavor+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=90",
		"quote3|1|Put quote at head of flavor text?|check",
		"quote4|1|Put quote at end of flavor text?|check",
		"powflavoronly|Supplement,Override|Flavor text interacts with default output how?|radio|select="+powflavoronly+" orient=h"
	)][abort(screen)]
}; {}]

[h, if(powusage == 0 || powusage == 6): powuses = "Infinite"]
[h: powusage = listGet(shortusagelist, powusage)]

[h, if(!isNumber(powatlevel)): powatlevel = 0]
[h, if(!isNumber(powusesleft)): powusesleft = 0]
[h, if(isNumber(powuses)): powuses = powuses+"*1"]
[h, if(powusage == 0 || powusage == 6): powusesleft = "Infinite"]

[h, if(string(powuses) == "Automated"), code:{
	[screen = input(
		"codepick|Number,Infinite,Ability Modifier (D&D rules),Number+Ability Modifier,Straight Up Token Property,Token Property/2 (Round Down),(Manual Entry)|How should the manager calculate uses per day|radio|select=2 value=string orient=h"
	)][abort(screen)]

	[h,if(codepick=="Number"),code:{
		[screen4=input(
			"powuses|50|Enter how many uses this ability should have"
		)]
		[h:abort(screen4)]
		[powuses=powuses+"*1"]
	}; {}]

	[h,if(codepick=="Infinite"),code:{
		[powuses="Infinite"]
	}; {}]

	[if(codepick=="(Manual Entry)"),code:{
		[screen6=input(
			"powuses|3+floor((Charisma-10)/2)|Enter your code"
		)][abort(screen6)]
	}; {}]

	[if(codepick=="Ability Modifier (D&D rules)"),code:{
		[screen7=input(
			"propertypick|Intelligence|Enter the name of the token property holding your ability score"
		)][abort(screen7)]
		[powuses="floor(("+propertypick+"-10)/2)"]
	}; {}]

	[if(codepick=="Number+Ability Modifier"),code:{
		[screen7=input(
			"propertypick|Intelligence|Enter the name of the token property holding your ability score",
			"numberpick|3|Enter the number to add"
		)][abort(screen7)]
		[powuses=numberpick+"+floor(("+propertypick+"-10)/2)"]
	}; {}]

	[if(codepick=="Straight Up Token Property"),code:{
		[screen7=input(
			"propertypick|Level|Enter the name of the token property to use"
		)][abort(screen7)]
		[powuses=propertypick]
	}; {}]

	[if(codepick=="Token Property/2 (Round Down)"),code:{
		[screen7=input(
			"propertypick|Level|Enter the name of the token property to use"
		)]
		[abort(screen7)]
		[powuses="floor("+propertypick+"/2)"]
	}; {}]
}; {}]

[h,if(quote1==1):quote1=" ' "; quote1=""]
[h,if(quote2==1):quote2=" ' "; quote2=""]
[h:pownote=quote1+trim(pownote)+quote2]
[h,if(quote3==1):quote3=" ' "; quote3=""]
[h,if(quote4==1):quote4=" ' "; quote4=""]
[h:powflavor=quote3+trim(powflavor)+quote4]

[h: newpower=json.set("{}","Name",powname,"Category",powcategory,"Uses",powuses,"Uses Left",powusesleft,"Usage",powusage,"At Level",powatlevel,"At Level Property",powatlevelprop,"Note",pownote,"Flavor Text",powflavor,"Flavor Only",powflavoronly)]

[h: catdata = json.remove(catdata, oldpowname)]
[h: catdata = json.set(catdata, powname, newpower)]
[macro("Alphabetize Object@this"): catdata]
[h: catdata = macro.return]
[h: SAdata = json.set(SAdata, powcategory, catdata)]
[h: classdata = json.set(classdata, "SpecAbil Data", SAdata)]
[h: CasterInfo = json.set(CasterInfo, classviewed, classdata)]

[macro("Manage SA Main@Lib:spells"): classviewed]

!!
@@ @Modify Group Abil Click
@PROPS@ fontColor=lime ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=147 ; 
[h: passed = macro.args]
[h: classviewed = json.get(passed, "Classviewed")]
[h: classdata = json.get(CasterInfo, classviewed)]
[h: SAdata = json.get(classdata, "SpecAbil Data")]
[h: powdata = json.get(passed, "Abildata")]

[h: oldpowname = json.get(powdata, "Name")]
[h: powcategory = json.get(powdata, "Category")]
[h: catdata = json.get(SAdata, powcategory)]
[h: powatlevel = json.get(powdata, "At Level")]
[h: powatlevelprop = json.get(powdata, "At Level Property")]
[h: powusage = json.get(powdata, "Usage")]
[h: powuses = json.get(powdata, "Uses")]
[h: pownote = json.get(powdata, "Note")]
[h: powflavor = json.get(powdata, "Flavor Text")]
[h: powflavoronly = json.get(powdata, "Flavor Only")]
[h, if(string(powflavor)=="(None)" || string(powflavor)==""), code:{
	[inptext = "addflavor|0|Add flavortext?|check"]
	[quote3 = 0]
	[quote4 = 0]
}; {
	[inptext = "powflavor|"+powflavor+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=90##quote3|1|Put quote at head of flavor text?|check##quote4|1|Put quote at end of flavor text?|check##powflavoronly|Supplement,Override|Flavor text interacts with default output how?|radio|select="+powflavoronly+" orient=h"]
	[addflavor = 0]
}]

[h: usagelist="Set Number (0 for At-Will),Varies (Use Calls An Input),Code (Enter)"]
[h: shortusagelist="Fixed, Varies, Code"]
[h: usagestart = listFind(shortusagelist, powusage)]

[h:screen3=input(
  "powname|"+oldpowname+"|Name|text|width=50",
  "powatlevel|"+powatlevel+"|Reveal number|text|width=3",
  "powatlevelprop|"+powatlevelprop+"|Reveal property ('(None)' to always display)|text|width=50",
  "usagepick|"+usagelist+"|How should the manager treat the way it is used?|list|select="+usagestart+" value=number",
  "pownote|"+pownote+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=75",
  "quote1|1|Put quote at head of note?|check",
  "quote2|1|Put quote at end of note?|check",
  inptext
)]
[h:abort(screen3)]

[h, if(addflavor == 1), code:{
	[screen = input(
		"powflavor|"+powflavor+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=90",
		"quote3|1|Put quote at head of flavor text?|check",
		"quote4|1|Put quote at end of flavor text?|check",
		"powflavoronly|Supplement,Override|Flavor text interacts with default output how?|radio|select="+powflavoronly+" orient=h"
	)][abort(screen)]
}; {}]

[h: powusage = listGet(shortusagelist, usagepick)]

[h, if(!isNumber(powatlevel)): powatlevel = 0]

[h, if(usagepick == 0), code:{
	[screen=input(
		"groupdata|0|Enter the number of group points this ability will use up with each use (0 for At-Will)|text|width=5"
	)]
	[abort(screen)]	
}; {
	[if(usagepick == 1): groupdata = 0]
}]

[h,if(usagepick==2),code:{
  [screen=input(
    "groupdata|max(0,14-Intelligence)|Enter code to determine group point usage|text|width=50"
  )]
  [abort(screen)]
}; {}]

[h,if(quote1==1):quote1=" ' "; quote1=""]
[h,if(quote2==1):quote2=" ' "; quote2=""]
[h:pownote=quote1+trim(pownote)+quote2]
[h,if(quote3==1):quote3=" ' "; quote3=""]
[h,if(quote4==1):quote4=" ' "; quote4=""]
[h:powflavor=quote3+trim(powflavor)+quote4]

[h:powertoadd=json.set("{}","Name",powname,"Category",powcategory,"Usage",powusage,"Uses",groupdata,"At Level",powatlevel,"At Level Property",powatlevelprop,"Note",pownote,"Flavor Text",powflavor,"Flavor Only",powflavoronly)]

[h: catdata = json.remove(catdata, oldpowname)]
[h: catdata = json.set(catdata, powname, powertoadd)]

[macro("Alphabetize Object@this"): catdata]
[h: catdata = macro.return]
[h: SAdata = json.set(SAdata, powcategory, catdata)]
[h: classdata = json.set(classdata, "SpecAbil Data", SAdata)]
[h: CasterInfo = json.set(CasterInfo, classviewed, classdata)]

[macro("Manage SA Main@Lib:spells"): classviewed]

!!
@@ @Modify CI Spec Abil Click
@PROPS@ fontColor=yellow ; autoExecute=true ; fontSize=11pt ; sortBy=3 ; color=blue ; playerEditable=false ; applyToSelected=false ; group=11 Special Abilities ; tooltip= ; minWidth=147 ; 
[h: powdata = macro.args]
[h: oldpowname = json.get(powdata, "Name")]
[h: powcategory = json.get(powdata, "Category")]
[h: powatlevel = json.get(powdata, "At Level")]
[h: powatlevelprop = json.get(powdata, "At Level Property")]
[h: powusage = json.get(powdata, "Usage")]
[h: powuses = json.get(powdata, "Uses")]
[h: powusesleft = json.get(powdata, "Uses Left")]
[h: pownote = json.get(powdata, "Note")]
[h: powflavor = json.get(powdata, "Flavor Text")]
[h: powflavoronly = json.get(powdata, "Flavor Only")]
[h, if(string(powflavor)=="(None)" || string(powflavor)==""), code:{
	[inptext = "addflavor|0|Add flavortext?|check"]
	[quote3 = 0]
	[quote4 = 0]
}; {
	[inptext = "powflavor|"+powflavor+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=90##quote3|1|Put quote at head of flavor text?|check##quote4|1|Put quote at end of flavor text?|check##powflavoronly|Supplement,Override|Flavor text interacts with default output how?|radio|select="+powflavoronly+" orient=h"]
	[addflavor = 0]
}]

[h: usagelist="As an AT-WILL power,As a Number of BOLTS that can be called in large numbers,As an ITEM with permanently expeded CHARGES used 1 at a time,As an ITEM with permanently expended CHARGES used in varying amounts,As a number of FEET that can be called in large numbers,As a number of LEVELS normally added to apply metamagic,As a constantly active PASSIVE power,As a number of POINTS that can be used in large numbers (e.g. for absorbtion),As a number of ROUNDS used one at a time,As a number of USES used one at a time (like casting a spell)"]
[h: shortusagelist="At-Will,Bolts,Charges,Multi Charges,Feet,Levels,Passive,Points,Rounds,Uses"]
[h: usagestart = listFind(shortusagelist, powusage)]

[h:screen3=input(
  "powname|"+oldpowname+"|Name|text|width=50",
  "powatlevel|"+powatlevel+"|Reveal number|text|width=3",
  "powatlevelprop|"+powatlevelprop+"|Reveal property ('(None)' to always display)|text|width=50",
  "powusage|"+usagelist+"|How should the manager treat the way it is used?|list|select="+usagestart+" value=number",
  "powuses|"+powuses+"|Code for uses per day ('Automated' for pre-coded options)|text|width=50",
  "powusesleft|"+powusesleft+"|Number of uses left now|text|width=5",
  "pownote|"+pownote+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=75",
  "quote1|1|Put quote at head of note?|check",
  "quote2|1|Put quote at end of note?|check",
  inptext
)]
[h:abort(screen3)]

[h, if(addflavor == 1), code:{
	[screen = input(
		"powflavor|"+powflavor+"|Provide descriptive text surrounded by single quotes (accepts code; see help menu)|text|width=90",
		"quote3|1|Put quote at head of flavor text?|check",
		"quote4|1|Put quote at end of flavor text?|check",
		"powflavoronly|Supplement,Override|Flavor text interacts with default output how?|radio|select="+powflavoronly+" orient=h"
	)][abort(screen)]
}; {}]

[h, if(powusage == 0 || powusage == 6): powuses = "Infinite"]
[h: powusage = listGet(shortusagelist, powusage)]

[h, if(!isNumber(powatlevel)): powatlevel = 0]
[h, if(!isNumber(powusesleft)): powusesleft = 0]
[h, if(isNumber(powuses)): powuses = powuses+"*1"]
[h, if(powusage == 0 || powusage == 6): powusesleft = "Infinite"]

[h, if(string(powuses) == "Automated"), code:{
	[screen = input(
		"codepick|Number,Infinite,Ability Modifier (D&D rules),Number+Ability Modifier,Straight Up Token Property,Token Property/2 (Round Down),(Manual Entry)|How should the manager calculate uses per day|radio|select=2 value=string orient=h"
	)][abort(screen)]

	[h,if(codepick=="Number"),code:{
		[screen4=input(
			"powuses|50|Enter how many uses this ability should have"
		)]
		[h:abort(screen4)]
		[powuses=powuses+"*1"]
	}; {}]

	[h,if(codepick=="Infinite"),code:{
		[powuses="Infinite"]
	}; {}]

	[if(codepick=="(Manual Entry)"),code:{
		[screen6=input(
			"powuses|3+floor((Charisma-10)/2)|Enter your code"
		)][abort(screen6)]
	}; {}]

	[if(codepick=="Ability Modifier (D&D rules)"),code:{
		[screen7=input(
			"propertypick|Intelligence|Enter the name of the token property holding your ability score"
		)][abort(screen7)]
		[powuses="floor(("+propertypick+"-10)/2)"]
	}; {}]

	[if(codepick=="Number+Ability Modifier"),code:{
		[screen7=input(
			"propertypick|Intelligence|Enter the name of the token property holding your ability score",
			"numberpick|3|Enter the number to add"
		)][abort(screen7)]
		[powuses=numberpick+"+floor(("+propertypick+"-10)/2)"]
	}; {}]

	[if(codepick=="Straight Up Token Property"),code:{
		[screen7=input(
			"propertypick|Level|Enter the name of the token property to use"
		)][abort(screen7)]
		[powuses=propertypick]
	}; {}]

	[if(codepick=="Token Property/2 (Round Down)"),code:{
		[screen7=input(
			"propertypick|Level|Enter the name of the token property to use"
		)]
		[abort(screen7)]
		[powuses="floor("+propertypick+"/2)"]
	}; {}]
}; {}]

[h,if(quote1==1):quote1=" ' "; quote1=""]
[h,if(quote2==1):quote2=" ' "; quote2=""]
[h:pownote=quote1+trim(pownote)+quote2]
[h,if(quote3==1):quote3=" ' "; quote3=""]
[h,if(quote4==1):quote4=" ' "; quote4=""]
[h:powflavor=quote3+trim(powflavor)+quote4]

[h: newpower=json.set("{}","Name",powname,"Category",powcategory,"Uses",powuses,"Uses Left",powusesleft,"Usage",powusage,"At Level",powatlevel,"At Level Property",powatlevelprop,"Note",pownote,"Flavor Text",powflavor,"Flavor Only",powflavoronly)]

[h: catdata = json.get(CI_SpecAbils, powcategory)]
[h: catdata = json.remove(catdata, oldpowname)]
[h: catdata = json.set(catdata, powname, newpower)]
[macro("Alphabetize Object@this"): catdata]
[h: catdata = macro.return]
[h: CI_SpecAbils = json.set(CI_SpecAbils, powcategory, catdata)]

[macro("Manage CISA Main@Lib:spells"): "Class-Independent, 0"]

!!

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

Still without power at home due to Irene, and this has slowed me, but I'm through Ranger in the Pathfinder class abilities coding, and have made Healer and Warmage classes for 3.5 without problems that I can see.

I hope to get PF done soon and then get on those bugs AM has uncovered, and look at integrating some of his tweaks.

How comes the database, AM?
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by Azhrei »

plothos wrote:Still without power at home due to Irene,
Wow, I'm sorry to hear that. I know that half-a-million people (and more) were initially without power. Our local power companies in the Tampa area have sent employees up the coast to help out as much as possible...

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by plothos »

Yeah, dominion power in VA and NC had 1.2 million powerless. They *hope* to have 95% of those back online by Friday night.
I'm not complaining, though. Others have it worse than I, and I made some great new friends as a refugee.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [Beta Release] Spell Manager 3.0.0 for b86

Post by aliasmask »

One suggestion for the spell manager. Have a token specific name for the frame like Spells: Token Name. That way I can open multiple frames for multiple tokens. Also, always set the target with macro links [macroLink(text, macroName, output, args, target)].

At the various macroLink macros you'll have to make a check for the token. If the currentToken is blank that probably means the token is not on the current map, instead of using getSelected.

Code: Select all

[H: onMap = if(currentToken() != "",1,0)]
[H: assert(onMap,"<b><font color=red>Failed to Process Form Data:</font><BR>Token is not on current map.</b>",0)]
This could also be do to the id of the token changing, so before that you could do another check, but you would also need to pass the token name in the arguments and use findToken with token name to verify token is on map. I will probably do this for myself, but not right now. I'll let you know if/when I do this and post an update.

Post Reply

Return to “Drop-In Macro Resources”