Page 3 of 3

Re: [Gamma World] Framework Adaptation

Posted: Thu Mar 31, 2011 5:12 pm
by Rumble
Okay, here's the fix: import this macro to your Campaign Macros, and run it before you copy a token (it will also work after you copy the token, but if you wait until after, you need to run it on each copy of the token, individually).

All you have to do is select the token you want to copy, run this macro, and then do Ctrl-C/Ctrl-V as usual. What the macro does is simply clear any cached character sheet information, which should keep the switchToken() error from popping up.

Re: [Gamma World] Framework Adaptation

Posted: Thu Mar 31, 2011 5:48 pm
by Ian_Backlund
Interesting. Works great. Thanks.

Re: [Gamma World] Framework Adaptation

Posted: Thu Mar 31, 2011 7:42 pm
by Rumble
Ian_Backlund wrote:Interesting. Works great. Thanks.
No problem - thanks for finding the bug!

Re: [Gamma World] Framework Adaptation

Posted: Wed Apr 06, 2011 3:23 am
by Ian_Backlund
Ok, think I got another bug for you. I noticed that when I used the quicksheet to launch an attack, and attempted to target more than one enemy, I got an error in chat:

Error executing "switchToken": the token name or id "Ukj,Bruce Brucinski" is unknown.

The same attack works fine targeting two characters when I launch it from the selection pane macros.

Re: [Gamma World] Framework Adaptation

Posted: Thu Apr 07, 2011 3:19 am
by Ian_Backlund
I have a small fix.

Ongoing damage is not reported to the chat window.

To Fix:
The last line of rfw.processOngoing reads:

Code: Select all

[r:token.name] takes <b>[r:DmgValue]</b> damage.
change it to:

Code: Select all

[h:link = macroLinkText("rfw.deferDmgNote@this", "all",json.append("[]", token, DmgValue, DmgType), token)]
[r:execLink(link, 1)]

Re: [Gamma World] Framework Adaptation

Posted: Fri Apr 08, 2011 3:08 am
by Ian_Backlund
OK I have some more info about the "multiple target" error bug.

at the end of rfw.processDamage there is this line:

Code: Select all

[h,if(isFrameVisible("Quick Reference Sheet")),CODE:
{
    [macro("rfw.CharSheet@this"):target]
}]
Whenever the Quick Sheet is open and you are resolving damage against more that one target, the rfw.CharSheet call throws a "switchToken" error.
Right here at the top of rfw.CharSheet:

Code: Select all

[h:context = getSelectedNames()]
[h,if(startsWith(context, "Lib:") || context == "Dummy_Target"): abort(0)]
[h:debug("context")]
[h:switchToken(context)]
If you have more than one target, getSelectedNames returns a list of target names and then switchToken gags on the list.

I confess I am not 100% sure why rfw.processDamage is even making this call. The target quicksheats should never be open during an attack, only the attacker's quicksheet. Maybe if you are on a different computer than your attacker, this code updates your hitpoints on your quick sheet? I removed those last four lines from rfw.processDamage and that takes care of the error, but I can't tell if I am causing other bugs.

Re: [Gamma World] Framework Adaptation

Posted: Fri Apr 08, 2011 8:32 am
by Rumble
Ian_Backlund wrote:OK I have some more info about the "multiple target" error bug.

at the end of rfw.processDamage there is this line:

Code: Select all

[h,if(isFrameVisible("Quick Reference Sheet")),CODE:
{
    [macro("rfw.CharSheet@this"):target]
}]
Whenever the Quick Sheet is open and you are resolving damage against more that one target, the rfw.CharSheet call throws a "switchToken" error.
Right here at the top of rfw.CharSheet:

Code: Select all

[h:context = getSelectedNames()]
[h,if(startsWith(context, "Lib:") || context == "Dummy_Target"): abort(0)]
[h:debug("context")]
[h:switchToken(context)]
If you have more than one target, getSelectedNames returns a list of target names and then switchToken gags on the list.

I confess I am not 100% sure why rfw.processDamage is even making this call. The target quicksheats should never be open during an attack, only the attacker's quicksheet. Maybe if you are on a different computer than your attacker, this code updates your hitpoints on your quick sheet? I removed those last four lines from rfw.processDamage and that takes care of the error, but I can't tell if I am causing other bugs.

Truthfully, I don't remember either. I'll take a look at it when I get a chance and see if I can remember why I did that - it could be that it was copied in from some other macro but doesn't actually need to be done, and I just forgot to remove it from processDamage.

Re: [Gamma World] Framework Adaptation

Posted: Fri Apr 08, 2011 6:34 pm
by Ian_Backlund
Another Small Fix:
Under the GM Utilities for PC Tokens, the Power Library button allows you to assign a PCpower to a PC. Some code is in there for adding an NPC power to a NPC, but it is incomplete.

To Fix:
replace rfw.addPowerFromLibrary with this:

Code: Select all

[h:info = arg(0)] 
[h:prsName = "PCPowers"]

[if(isNPC()),CODE:
{
   [h:prsName = "NPCPowers"]
}]

[h:Pwrs = getLibProperty(prsName, "Lib:PowerLibrary")]
[h:pcplist = json.fields(Pwrs)]

[h,foreach(p, pcplist),CODE:
{
   [if(json.contains(info, p)),CODE:
   {
      [mcbInfo = json.get(Pwrs, p)]
      [h:rfw.makeMacro(mcbInfo)]
   }]
}]
Now you should be able to select an NPC hit the Power Library button and assign an NPC Power.

Re: [Gamma World] Framework Adaptation

Posted: Wed May 11, 2011 6:29 pm
by zoboro
Are powers suppose to be applying damage to the token the attack was made against? If so I am having issues with this.

Never mind, I found the toggle button. :oops:

Re: [Gamma World] Framework Adaptation

Posted: Fri Jun 17, 2011 4:09 pm
by TheOtherRuss
Hi! Thank you SO much for creating a framework for Gamma World. I'm a first time MapTool user, and I have a few questions regarding your framework.

First, is there an option for player decks? In Gamma World the player generally has their own deck of Alpha Mutations (and Omega Tech, but I'm not planning on using the Omega player decks, as it seems silly that the players would always find the same stuff, and it would be just what they wanted)

While you can play the game using the GMs Alpha Deck, it's nice for the players to have their own decks that they construct, this provides them an opportunity to select powers that follow a theme.

So, am I missing something, and I haven't figured out how to make player decks yet? Or if there currently isn't a player deck, I'm fairly familiar w/ coding, though I haven't messed w/ Java much, is it something I can duplicate based on the GMs deck, and port that to each player token? Please let me know! Thanks again for making this awesome framework!! This framework + Maptools is going to enable me to game w/ a group of friends I haven't played with in about a decade. :)

Re: [Gamma World] Framework Adaptation

Posted: Fri Jun 17, 2011 7:05 pm
by Rumble
TheOtherRuss wrote:Hi! Thank you SO much for creating a framework for Gamma World. I'm a first time MapTool user, and I have a few questions regarding your framework.

First, is there an option for player decks? In Gamma World the player generally has their own deck of Alpha Mutations (and Omega Tech, but I'm not planning on using the Omega player decks, as it seems silly that the players would always find the same stuff, and it would be just what they wanted)

While you can play the game using the GMs Alpha Deck, it's nice for the players to have their own decks that they construct, this provides them an opportunity to select powers that follow a theme.

So, am I missing something, and I haven't figured out how to make player decks yet? Or if there currently isn't a player deck, I'm fairly familiar w/ coding, though I haven't messed w/ Java much, is it something I can duplicate based on the GMs deck, and port that to each player token? Please let me know! Thanks again for making this awesome framework!! This framework + Maptools is going to enable me to game w/ a group of friends I haven't played with in about a decade. :)
No, there's no player deck functionality. However, I see no reason why duplicating the deck property to the player tokens, and writing macro code to have them draw from their own decks (note that it's not Java, it's a homegrown scripting language) wouldn't work. It'll be complicated, but if you start with the GM deck macros you can probably dope out how to do it.

Re: [Gamma World] Framework Adaptation

Posted: Sat Jun 18, 2011 12:18 pm
by TheOtherRuss
Thanks for the info. Do you mind if I pm you if I get stuck?

Re: [Gamma World] Framework Adaptation

Posted: Fri Jul 10, 2015 10:37 am
by jwfitt
This might not be supported anymore, but if anyone could lend a hand I would be super grateful!

When clicking "Manage Origins (F3)" under "GM Utilities for PC Tokens" in the Campaign settings, I get the following error message:

Code: Select all

 Error in body of roll.       
Statement options (if any): h,if(which == "Add New"),CODE       
Statement Body (first 200 characters): { [h:odets = json.set("{}", "bprimary", "None", "bskill", "None", "bdef", "None", "boc")] [h:oname = "Add New"] [h:oprim = json.get(odets, "bprimary")] [h:oskill = json.get(odets, "bskil

Re: [Gamma World] Framework Adaptation

Posted: Sat Jul 11, 2015 2:44 am
by jwfitt
jwfitt wrote:This might not be supported anymore, but if anyone could lend a hand I would be super grateful!

When clicking "Manage Origins (F3)" under "GM Utilities for PC Tokens" in the Campaign settings, I get the following error message:

Code: Select all

 Error in body of roll.       
Statement options (if any): h,if(which == "Add New"),CODE       
Statement Body (first 200 characters): { [h:odets = json.set("{}", "bprimary", "None", "bskill", "None", "bdef", "None", "boc")] [h:oname = "Add New"] [h:oprim = json.get(odets, "bprimary")] [h:oskill = json.get(odets, "bskil

This seems to have done the trick...

Changing:

Code: Select all

[h,if(which == "Add New"),CODE:
{
   [h:odets = json.set("{}", "bprimary", "None", "bskill", "None", "bdef", "None", "boc")]
   [h:oname = "Add New"]
   [h:oprim = json.get(odets, "bprimary")]
   [h:oskill = json.get(odets, "bskill")]
   [h:odef = json.get(odets, "bdef")]
   [h,if(!json.contains(odets, "boc")): ovrc = "Bio"; ovrc = json.get(odets, "boc")]

};
To:

Code: Select all

[h,if(which == "Add New"),CODE:
{
   [h:odets = json.set("{}", "bprimary", "None", "bskill", "None", "bdef", "None", "boc", "None")]
   [h:oname = "Add New"]
   [h:oprim = json.get(odets, "bprimary")]
   [h:oskill = json.get(odets, "bskill")]
   [h:odef = json.get(odets, "bdef")]
   [h,if(!json.contains(odets, "boc")): ovrc = "Bio"; ovrc = json.get(odets, "boc")]

};