RPTools.net
http://forums.rptools.net/

[Gamma World] Framework Adaptation
http://forums.rptools.net/viewtopic.php?f=58&t=16538
Page 3 of 3

Author:  Rumble [ Thu Mar 31, 2011 4:12 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

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.

Attachments:
clearCachedQuicksheet.mtmacro [986 Bytes]
Downloaded 119 times

Author:  Ian_Backlund [ Thu Mar 31, 2011 4:48 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

Interesting. Works great. Thanks.

Author:  Rumble [ Thu Mar 31, 2011 6:42 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

Ian_Backlund wrote:
Interesting. Works great. Thanks.


No problem - thanks for finding the bug!

Author:  Ian_Backlund [ Wed Apr 06, 2011 2:23 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

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.

Author:  Ian_Backlund [ Thu Apr 07, 2011 2:19 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

I have a small fix.

Ongoing damage is not reported to the chat window.

To Fix:
The last line of rfw.processOngoing reads:
Code:
[r:token.name] takes <b>[r:DmgValue]</b> damage.

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

Author:  Ian_Backlund [ Fri Apr 08, 2011 2:08 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

OK I have some more info about the "multiple target" error bug.

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

Code:
[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:
[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.

Author:  Rumble [ Fri Apr 08, 2011 7:32 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

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:
[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:
[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.

Author:  Ian_Backlund [ Fri Apr 08, 2011 5:34 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

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:
[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.

Author:  zoboro [ Wed May 11, 2011 5:29 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

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:

Author:  TheOtherRuss [ Fri Jun 17, 2011 3:09 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

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. :)

Author:  Rumble [ Fri Jun 17, 2011 6:05 pm ]
Post subject:  Re: [Gamma World] Framework Adaptation

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.

Author:  TheOtherRuss [ Sat Jun 18, 2011 11:18 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

Thanks for the info. Do you mind if I pm you if I get stuck?

Author:  jwfitt [ Fri Jul 10, 2015 9:37 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

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:
 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

Author:  jwfitt [ Sat Jul 11, 2015 1:44 am ]
Post subject:  Re: [Gamma World] Framework Adaptation

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:
 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:
[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:
[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")]

};

Page 3 of 3 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/