RPTools.net

Discussion and Support

Skip to content

It is currently Mon Feb 19, 2018 4:59 am 






Reply to topic  [ 11 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Wrathgon Spell Manager Update
PostPosted: Wed Dec 07, 2011 10:22 am 
I have spent quite a bit of time updating Wrathgon's Spell Manager to learn MTScript better and to hopefully make it a solid Spell Manager. Please try to break it so I can make it better. In the meantime, I plan to fix the remaining last bit of correcting the spell database and add some features I would like.

Due to having to break the way the code was wrote in many places tokens from previous versions will not work!

Update procedures:

1. Ensure the campaign properties match the following (notice I changed EH to System to better represent what the property is being used for) (Also, you can see that everything is broken out between 3.5 and Pathfinder. This allows flexibility to possibly even add other systems like Trailblazer.):

Code:
---|Wrathgon|---
BloodlineList
BloodlineListPF
ClassDetail
ClassDetailPF
DomainList
DomainListPF
System
SchoolSpells
SchoolSpellsPF
SLATemplate
SLATemplatePF
SpellCastingInfo
SpellCastingInfoPF
Spells
SpellsPF


2. Replace old Lib:Magic token with my version and ensure that the properties are on the token and contain data.
3. Replace the code on the campaign window for the Wrathgon macros with the below respectively.

Code:
@@ @<b>Cast</b> Wrathgon
@PROPS@ fontColor=white ; autoExecute=true ; fontSize=11pt ; sortBy=1.2 ; color=blue ; playerEditable=true ; applyToSelected=true ; group= ; tooltip=Wrathgon ; minWidth=80 ;
[H: ids = getSelected()]
[H: countIDs = listCount(ids)]
[H: abort(if(ids == "" || countIDs > 1, 0, 1))]
[H: tokenID = ids]
[H: classInfo = getProperty("CasterInfo")]
[H: tclassData = json.isEmpty(classInfo)]
[H, if(tclassData == 0): classList = json.fields(classInfo)]
[H, if(listCount(classList) > 1): classViewed = listGet(classList, 0)]
[H, if(listCount(classList) <= 1): classViewed = classList]
[R, if(tclassData == 0), CODE:
   {
   [H: tVar = json.append("", ids, classViewed)]
   [macro("Get Object@Lib:Magic"): tVar]
   [H: tclassData = macro.return]
   [H: tokenName = getName(tokenID)]
   [Frame(tokenName+" Spells"):
      {
      [H: macroVar = json.append("", tokenID, classViewed, 1)]
      [macro("Spell Cast Text@Lib:Magic"): macroVar]
      }]
   }; {
   [R, S: "You are not a spellcaster!"]
   }]

!!


Code:
@@ @<b>SLA</b> Wrathgon
@PROPS@ fontColor=white ; autoExecute=true ; fontSize=11pt ; sortBy=1.3 ; color=blue ; playerEditable=true ; applyToSelected=true ; group= ; tooltip=Wrathgon ; minWidth=80 ;
[H: ids = getSelected()]
[H: countIDs = listCount(ids)]
[H: abort(if(ids == "" || countIDs > 1,  0, 1))]
[H: tokenID = ids]
[H: classInfo = getProperty("CasterInfo")]
[H: tclassData = json.isEmpty(classInfo)]
[H, if(tclassData == 0): classList = json.fields(classInfo)]
[H, if(listCount(classList) > 1): classViewed = listGet(classList, 0)]
[H, if(listCount(classList) <= 1): classViewed = classList]
[R, if(tclassData == 0), CODE:
   {
   [H: tVar = json.append("", ids, classViewed)]
   [macro("Get Object@Lib:Magic"): tVar]
   [H: tclassData = macro.return]
   [H: tokenName = getName(tokenID)]
   [Frame(tokenName+" Spells"):
      {
      [H: macroVar = json.append("", tokenID, classViewed)]
      [macro("Spec Abil Main Text@Lib:magic"): macroVar]
      }]
   }; {
   [R, S: "You are not a spellcaster!"]
   }]

!!


Code:
@@ @<b>Spell Menu</b> W
@PROPS@ fontColor=white ; autoExecute=true ; fontSize=11pt ; sortBy=1.1 ; color=blue ; playerEditable=true ; applyToSelected=true ; group= ; tooltip=Wrathgon ; minWidth=80 ;
[H: ids = getSelected()]
[H: countIDs = listCount(ids)]
[H: abort(if(ids == "" || countIDs > 1, 0, 1))]
[H: macroVar = json.append("", ids, "None")]
[H, macro("Spell Main@Lib:Magic"): macroVar]

!!


Code:
@@ @Clear Class Info
@PROPS@ fontColor=white ; autoExecute=true ; fontSize=11pt ; sortBy=ZZZ ; color=blue ; playerEditable=true ; applyToSelected=false ; group= ; tooltip=Wrathgon ; minWidth=80 ;
[H: ids = getSelected()]
[H: countIDs = listCount(ids)]
[H: abort(if(ids == "" || countIDs > 1, 0, 1))]
[H: macroVar = json.append("", ids, "None")]
[macro("Remove_ClassInfo@Lib:Magic"): macroVar]
[macro("Spell Main@Lib:Magic"): macroVar]

!!


4. Drop token on map and have at it!


File comment: Fixed maxKnownSpells error for Inquisitor
Fixed Alchemist so it actually preps spells
Fixed problem with Special Groups

LibMagic12E.rptok [420.93 KiB]
Downloaded 110 times

_________________
Image
Time-Zone information UTC -5


Last edited by neofax on Tue Oct 23, 2012 6:17 pm, edited 4 times in total.
Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Wed Dec 07, 2011 11:31 am 
One thing I would suggest since the code is fairly small(and you noted it was not backwards compatible anyway) is to
  • use some type of prefix for your properties(see below)
  • ditto "local" variables within each macro, like say:
    Code:
    [h: nf.local.domainlist = getProperty("nf.props.Domainlist")]
  • (I think you do this already) but use getProperty and setProperty instead of direct variable modification.

Just some advice to keep your drop in from breaking someone else's framework and visa versa...

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Wed Dec 07, 2011 2:44 pm 
jfrazierjr wrote:
One thing I would suggest since the code is fairly small(and you noted it was not backwards compatible anyway) is to
  • use some type of prefix for your properties(see below)
  • ditto "local" variables within each macro, like say:
    Code:
    [h: nf.local.domainlist = getProperty("nf.props.Domainlist")]
  • (I think you do this already) but use getProperty and setProperty instead of direct variable modification.

Just some advice to keep your drop in from breaking someone else's framework and visa versa...

All good advice. What do you mean by "local"? Variables that are only used within the block of code and do not "share" across macros? If so, no I did not do this, but I plan to continue maintaining this Spell Manager so I will work these in.

_________________
Image
Time-Zone information UTC -5


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 8009
Location: Bay Area
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Wed Dec 07, 2011 3:33 pm 
neofax wrote:
jfrazierjr wrote:
One thing I would suggest since the code is fairly small(and you noted it was not backwards compatible anyway) is to
  • use some type of prefix for your properties(see below)
  • ditto "local" variables within each macro, like say:
    Code:
    [h: nf.local.domainlist = getProperty("nf.props.Domainlist")]
  • (I think you do this already) but use getProperty and setProperty instead of direct variable modification.

Just some advice to keep your drop in from breaking someone else's framework and visa versa...

All good advice. What do you mean by "local"? Variables that are only used within the block of code and do not "share" across macros? If so, no I did not do this, but I plan to continue maintaining this Spell Manager so I will work these in.

He means, don't refer to the token props directly in your macro writing. Since you don't know what may be a token prop from a random framework, he suggests using a prefix to make your variables unique. So, that big long list of variable names you give for token props disappears and is irrelevant because you will be using getProperty and setProperty for all the token variables. He suggests using names in your macros with prefixes so as to not inadvertently overwrite a token property. This is also called "scoping".

I only scope when I think it may be an issue, like when a macro calls another macro that shares the "scope" (see Wiki: defineFunction()), or if I think it will conflict with a token property. What I suggested was kind of the opposite, instead of worring about scoping your macros, just scope the token properties. If I were writing a spell manager, I would save my variables on the token as am.sm.propertyName. Also, to help in keeping your variables unique, be descriptive in the name of the variable as well. Don't use acronyms, for example.

Spells is a horrible name for a token property because it is very likely that the name will be used somewhere else by another programmer somewhere in their macro writing. Since they intend it to be only local and don't expect it as a "visible" token property, this will cause some problems. I can think of one with my own code. Ideally, you wouldn't want to have any token visible properties. Instead you'd use hidden property and use the get/set method. Those hidden props would also have your own unique prefix added so another programmer won't accidentally overwrite your "spells" property (although they should be using prefixes too).

_________________
Downloads:


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Wed Dec 07, 2011 5:27 pm 
Thanks! I will change the code this weekend and update the thread.

Would people be interested in having the ability to change output styles? I like having color coding and icons in the output for school, SR, saving throw, components... Similar to some of the 4E style frameworks or just plain bold, italic black and white text.

_________________
Image
Time-Zone information UTC -5


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Fri Mar 28, 2008 11:30 pm
Posts: 1870
Location: Layfayette Hill, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Fri May 18, 2012 9:59 am 
I am going to incorporate this iteration into my framework as the base Wrathgon code is just to buggy to be used generally and this fork seems to have some ongoing support!

_________________
D&D3.5 / Pathfinder Framework


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Sat May 19, 2012 2:39 pm 
lmarkus001 wrote:
I am going to incorporate this iteration into my framework as the base Wrathgon code is just to buggy to be used generally and this fork seems to have some ongoing support!

I will send you my latest update.

**UPDATE: Most recent code is in the first post.

_________________
Image
Time-Zone information UTC -5


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Oct 15, 2012 5:58 pm
Posts: 3
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Thu Oct 18, 2012 6:44 pm 
I have no idea how much work has been put into this but thank you. Having a difficult time with the inquisitor, trying to use the auto pilot to set one up and i get this for an error:

java.lang.IndexOutOfBoundsException: Index: 6, Size: 1 error executing expression knownMaxLvl = json.get(knownMax, FullCL).

my code reading skills are quite limited and I have no idea how to fix this. I am Using 12D and have followed the instructions to the letter. Not sure if there is some other macro or function i need to run to get it smoothed out or some other silly thing i missed. Any help with this issue would be greatly appreciated.


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Sat Oct 20, 2012 3:37 pm 
Ulijikaru wrote:
I have no idea how much work has been put into this but thank you. Having a difficult time with the inquisitor, trying to use the auto pilot to set one up and i get this for an error:

java.lang.IndexOutOfBoundsException: Index: 6, Size: 1 error executing expression knownMaxLvl = json.get(knownMax, FullCL).

my code reading skills are quite limited and I have no idea how to fix this. I am Using 12D and have followed the instructions to the letter. Not sure if there is some other macro or function i need to run to get it smoothed out or some other silly thing i missed. Any help with this issue would be greatly appreciated.

I have version 12E that works better and fixes alot of Inquisitor problems, but one remains that I have encountered with it's domain spells. I will work on this again when I get more time. If you want my current release, send me an email at neofax99 <AT> gmail DOT com.

_________________
Image
Time-Zone information UTC -5


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Tue Oct 23, 2012 6:18 pm 
Updated OP with 12E which fixes Ulijikaru's problem.

_________________
Image
Time-Zone information UTC -5


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Wed Oct 05, 2011 10:03 am
Posts: 133
Location: Warminster, PA
 Post subject: Re: Wrathgon Spell Manager Update
PostPosted: Sat Jan 05, 2013 12:30 pm 
Is your latest Wrathgon Spell Manager update included in IMarkus001's MT1.3b87.02 Campaign Framework (LATEST VERSION)? If not, Can your latest update just be dropped in?

viewtopic.php?f=53&t=19985

Edit: I think I answered my own question. It had the 12B version, so I download the new 12E version, removed the 12B and dropped in the 12E.

_________________
Yeah... I'm a Druid. No... I don't hung trees, I kick a**.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 11 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman