Veg 2.32 Bug: Auto-applying states IF token is selected

Framework(s) for D&D 4e, including Veggiesama's.

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

Post Reply
MHolman
Cave Troll
Posts: 26
Joined: Tue Sep 28, 2010 5:46 pm

Veg 2.32 Bug: Auto-applying states IF token is selected

Post by MHolman »

One of the highlights of the new framework is the "Click to toggle" states options. Very cool.

With a power that has a "Click to toggle" state attached: Any token currently selected by any player at the table receives the state WITHOUT CLICKING THE LINK

Situation:
1) Player A, B, and C have selected their own token.
2) Player D executes a power macro that has a "Click to Toggle" option (Slowed, for example).
3) The slowed state is then applied to Tokens A, B, and C (and possibly any tokens the DM has selected)

Steps to Replicate:
1) Have two or more players logged into MT.
2) Have Player A select a token.
3) Have Player B execute a power with a Click to Toggle state. (Result: Auto Application)

WILL NOT REPLICATE:
1) As above, 2 players in MT
2) Player A selects a token
3) Player B impersonates a different token.
4) Player A executes a power with state (Result: No auto application)

Bug?


User avatar
Veggiesama
Dragon
Posts: 619
Joined: Wed Aug 29, 2007 1:18 am

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Veggiesama »

GREAT CATCH. There is no way I would have found that bug by myself.

It was a wild goose chase, but I found the culprit. Wasn't a problem with the code at all. Turns out the properties of one of my macro buttons was screwed up.

Fixed for 2.33, but if you want to fix it right now, click on Lib:Veg, scroll down to the toggleStates button under the powerMacros group (it's in red, very last one). Right click the macro button, edit it, and UNCHECK the box that says "Auto Execute"
My D&D 4e Campaign FrameworkMy Shadowrun 4e Campaign Framework
RPGA#: 5223846427 — Skype: Veggiesama — Fear the ferret.

MHolman
Cave Troll
Posts: 26
Joined: Tue Sep 28, 2010 5:46 pm

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by MHolman »

Have I earned my "Junior Veg Assistant" Merit badge yet? I feel bad that a majority of the posts so far have been 1) by me and 2) saying "great work but......"

User avatar
Veggiesama
Dragon
Posts: 619
Joined: Wed Aug 29, 2007 1:18 am

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Veggiesama »

wolph42 wrote:just out of curiosity, but how do you do that? (code wise I mean).
Cleaned up my code a little to demonstrate (hopefully the formatting isn't too distracting):

Put toggleState on a library token (let's call it Lib:Token):

Code: Select all

<!-- Veggiesama's toggleState macro, MapTool B70 -->

[H: state = macro.args]
[H: currentStatus = getState(state)]
[H: setState(state, !currentStatus)]
Put showMacroLink anywhere, or just copy+paste into chat:

Code: Select all

<!-- Veggiesama's showMacroLink macro, MapTool B74 -->

[H: state = "Your state's name here"]
[H: lib = "Lib:Token"]

<table><tr bgcolor='#D6D7C6'><td><i>
    Click to toggle
</i></td>

<td>
    <img height=15 width=15 src='[R: getStateImage(state)]'></img>
</td><td><b>
    [R: macroLink(state, "toggleState@"+lib, "none", state, "selected")]
</b></td>

<td><i>
    on Selected Target(s)
</i></td></tr></table>
My D&D 4e Campaign FrameworkMy Shadowrun 4e Campaign Framework
RPGA#: 5223846427 — Skype: Veggiesama — Fear the ferret.

User avatar
Veggiesama
Dragon
Posts: 619
Joined: Wed Aug 29, 2007 1:18 am

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Veggiesama »

MHolman wrote:Have I earned my "Junior Veg Assistant" Merit badge yet? I feel bad that a majority of the posts so far have been 1) by me and 2) saying "great work but......"
Heheh. No sweat, though. More bug reports => more fixed bugs => better framework. Besides, I need the exercise.
My D&D 4e Campaign FrameworkMy Shadowrun 4e Campaign Framework
RPGA#: 5223846427 — Skype: Veggiesama — Fear the ferret.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by wolph42 »

Code: Select all

    [R: macroLink(state, "toggleState@"+lib, "none", state, "selected")]
that's it? Which part makes it 'you don't need to click the link' ?

MHolman
Cave Troll
Posts: 26
Joined: Tue Sep 28, 2010 5:46 pm

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by MHolman »

Piggybacking on what the poster above me asked (sort of):

I designed a new state in GIMP. It has been added to the campaign properties. What is the easiest/most straightforward way to make it so that my new state can be toggled through the Power Macro interface?

In other words: How can I add my states to the wonderful list/G.U.I. that you and Ady build?

User avatar
Veggiesama
Dragon
Posts: 619
Joined: Wed Aug 29, 2007 1:18 am

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Veggiesama »

wolph42 wrote:that's it? Which part makes it 'you don't need to click the link' ?
I'm not sure I follow.

For what it's worth, I had no idea Wiki: macroLink() did any sort of auto-executing until I read the fine print of its wiki page's introduction a few hours ago.

The wiki still left some to be desired, so I unearthed a post where Craig talked about the function here. Still didn't solve my problem, but I stumbled across the "Auto Execute" checkbox on my own.

Anyway, it's a weird function. Seems like two functions rolled into one (1. clickable macro text, 2. auto-execution of macros on other people's machines). Anyway, enough complaining.
MHolman wrote:In other words: How can I add my states to the wonderful list/G.U.I. that you and Ady build?
It's so easy you'll smack yourself. Add it like normal to the campaign properties, double-click on Lib:Veg. Under properties, look for the properties named STATES_****** (where *** is main, quarry, etc.). Add your new state's name to the list. All done.
My D&D 4e Campaign FrameworkMy Shadowrun 4e Campaign Framework
RPGA#: 5223846427 — Skype: Veggiesama — Fear the ferret.

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Doc_Waldo »

Hope this has not been discussed, if so please forgive and you may point me in the right direction. I have a monk, and one of his powers, flurry of blows, does damage by the trigger of hitting. I went to set up a power for this but couldn't figure out how to simple apply the damage without actually making an attack roll. Is there a way to create a power without an attack roll and only damage? Thanks.
--DOC

MHolman
Cave Troll
Posts: 26
Joined: Tue Sep 28, 2010 5:46 pm

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by MHolman »

Doc_Waldo wrote:Hope this has not been discussed, if so please forgive and you may point me in the right direction. I have a monk, and one of his powers, flurry of blows, does damage by the trigger of hitting. I went to set up a power for this but couldn't figure out how to simple apply the damage without actually making an attack roll. Is there a way to create a power without an attack roll and only damage? Thanks.
Without a separate line of code (which, if I recall, is rather complex), the framework does not support automatic application of damage (if that is what you're asking for).

However, to create a macro that simply outputs a damage calculation....here are two options that you could use.

Option 1) Do everything as normal for creating an Attack Power macro. Do NOT put anything into the "Primary Attack" section (or any other attack). On execution, select whatever lines you want displayed. In the Custom Code tab, select "Has custom code" and put something to the effect of:
</i> The larget takes damage equal to [3+StrBonus]. <br> If the target wasn't targeted by the triggering attack. the damage increases by 2/4/6"
MAKE THE POWER SUPPLEMENTAL

Option 2) Do NOT use the Create Macro interface. Instead, on a blank spot of your selection screen, right click and select "Add new macro" from the menu. The desired macro might look something like this:

<b> Centered Flurry of Blows</b> does [3+StrBonus] additional damage. <br> If the target wasn't targeted by the triggering attack, the damage equals [3+StrBonus+2/4/6)
This macro is very light and will process quickly. It will not have all the bells and whistles, but it'll get the job done and is very useful for simple calculations like Hunter's Quarry damage, Sneak Attack, and Flurry of Blows where all that matters is a rudimentary damage calculation.

User avatar
Veggiesama
Dragon
Posts: 619
Joined: Wed Aug 29, 2007 1:18 am

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Veggiesama »

Yes, I'd recommend that you make FoB into a Supplemental power, and write how much damage to deal in Custom Code. The "code" doesn't have to be any more complex than [StrBonus+3], as MHolman mentioned.
My D&D 4e Campaign FrameworkMy Shadowrun 4e Campaign Framework
RPGA#: 5223846427 — Skype: Veggiesama — Fear the ferret.

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Veg 2.32 Bug: Auto-applying states IF token is selected

Post by Doc_Waldo »

Great. I do really like the area for the extra coding, very forward thinking.
--DOC

Post Reply

Return to “D&D 4e Frameworks”