Need help with several macros

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

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

Post Reply
SzassT
Cave Troll
Posts: 30
Joined: Sun Apr 30, 2017 4:32 pm
Location: Fort Smith, AR

Need help with several macros

Post by SzassT »

I'm trying to set up a few macros to make life easier on my players and could use some help with them.

First, I put one in to select vision type since several of my players use spells/magic items to change their vision. The macro works as a Campaign Macro, but does nothing if I put it on a selected token. This is manageable, I was just wondering why its doing that. Here's the Macro:

Code: Select all

[h: dude = getSelected()]
[h: VisionTypeList = "Blind Fighting, Blindsense 20ft, Blindsense 30ft, Blindsense 40ft, Blindsense 60ft, Blindsight 30ft, 
Blindsight 60ft, Blindsight 90ft, Blindsight 120ft, Darkvision 60ft, Darkvision & Lowlight, 
Darkvision 60ft & Superior Low-Light, Darkvision 90ft, Darkvision 90ft & Superior Low-Light, Darkvision 120ft, Keen Senses, 
Lowlight, Tremorsense 30ft, Tremorsense 60ft"]
[h: status=input(
 "VisionType|"+VisionTypeList+"|Power Type|LIST|Value=STRING"
   )]
[h: switchToken(dude)]
[h: setSightType(VisionType)]
 
I'm also wanting to create a macro that sets elevation. I have many players with climb, burrowing, and flight capabilities from various sources so they are often at different heights. I have Elevation set as a token property that displays on everyone's sheet, so I was wanting a macro that would bring up an input box where they could just type in the number of feet up or down they are (such as -10 for burrowed 5 feet, 60 for flying 60 feet up) and a dropdown box to set their state to Flying, Burrowing, Climbing, Swimming or remove any of those four states (for if they switch to just walking). Ideally, and this last part is just because because I like everything to look nice, the macro would also automatically add "ft." to the end of their elevation (so in the above example it would display -10ft. or 60ft.).

The last macro I was wanting is for a shapechanger. One of my players is a lycanthrope, is there a macro I could use to switch his token between Hybrid Form, Animal Form, and Human Form? I have a separate token saved for each form with his adjusted states on each of them. Also worth noting, the forms aren't the same size if that would make a difference.

Thank you for your help!
Last edited by wolph42 on Tue Aug 22, 2017 6:08 pm, edited 2 times in total.
Reason: changed 'quote' to 'code'

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

Re: Need help with several macros

Post by aliasmask »

Make sure your macro has Apply to Selected checked.

Here is some code I use to display elevation on tokens: http://forums.rptools.net/viewtopic.php ... 12#p252812

Changing shape is more intricate than changing the image. For changing images I wrote the Disguise code that can be found in Lindsay's 3.5/PF framework. For us to help you create your code you'll have to make some attempts and share what you have.

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

Re: Need help with several macros

Post by wolph42 »

aliasmask wrote:Make sure your macro has Apply to Selected checked.
That makes little sense as he's using

[h: dude = getSelected()]
...
[h: switchToken(dude)]
[h: setSightType(VisionType)]

IF you turn on apply to selected then you MUST remove the top two lines so you have left:
...
[h: setSightType(VisionType)]

@OP: I would however as good practive NOT put macros on the tokens. This is difficult to manage (if you change a macro you need to update all the tokens that have that macro) and it weighs to the total load of the token (which is usually negligible but still...)

and updated version of 'disguise' can also be found on the Bag of Tricks (link in sig).

SzassT
Cave Troll
Posts: 30
Joined: Sun Apr 30, 2017 4:32 pm
Location: Fort Smith, AR

Re: Need help with several macros

Post by SzassT »

Thank you both. I got the shapechanging setup in a way that works for what I was trying to accomplish and now understand why the Set Vision macro works as campaign and not Selection and why it shouldn't be Selection. As for the elevation macro, the ones provided by AliasMask does far more than I want in several capacities, but is a good basis for what I'm wanting. Could someone help me edit that code to do the following:

From the Text Box:
Remove "Either set current elevation or put adjustment value in."
Replace "Current Elevation" with "New Elevation"
Remove "*Fly, Levitate, Climb, and Above are Positive while the others appear as negative."
Remove "Adjust Elevation"
Remove "*Elevation Adjustment for Fly is halved going up and doubled going down."
(All of this much I can do, but doing it makes me unsure of what else needs to be changed)

After these have been removed, My "Elevation Types" which are called "Movement Types" for me, but I can change the name to Elevation if that makes it easier, are "Burrowed, Climbing, Flying, Swimming". Additionally, I do not need it to calculate distance change, if it is allowed by movement, etc... I just want it to change the Property: Elevation to the entered value and change their Movement state as appropriate.

Basically, I just need
[h: input("Elevation|0ft.|New Elevation")]
with a List added that can set their current Movement State. I don't need or want anything else. Thanks again for any help!

Post Reply

Return to “Macros”