the movement pad

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

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

Post Reply
User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

the movement pad

Post by CoveredInFish »

Born from this discussion I'd like to give this little drop in tool to the community.

the movement pad
screen_movpad_1_5.png
screen_movpad_1_5.png (241.88 KiB) Viewed 7477 times
Full Bleed wrote: One of the things MT doesn't yet do is measure and restrict movement.

I've been thinking that maybe we can kind of add that functionality through a macro by creating a small movement pad in its own frame with directional arrows that people can click on to move their tokens (presumably 8-way in a grid.)

Given that people have custom frames for character sheets, I figure that having a movement pad should be pretty doable.

So instead of picking up and dragging their token, players would move by clicking on directional arrows in the pad. Each click would move the token one square in the correct direction (using a combination of getTokenX, getTokenY, moveToken, and goto.) We could then, with each click, subtract the consequent distance from a movement property, and make it so that they couldn't move any more if they were out of movement. They would, of course, always be able to grab their token and move it outside the bounds of the movement pad (unless Locking Player Movement can stop that while still allowing movement with the pad, thereby forcing them to use the pad if we so chose.)

I think there is a lot of room to customize such a pad with additional functionality for specific systems, but a core pad might get people headed in the right direction and give them something to build on if they want this sort of functionality.


Using and Installing the movePad
Install the movePad
-------------------

Open your campaign (or a new one).
Drop the lib-token "lib_cifMovPad_v1_7_final.rptok" on the map.
Import the tables "tbl_graphics.mttable" and "tbl_footsteps.mttable".
If you like you can drop the "lib_events.rptok" and "tkn_secretDoor.rptok" as well, these are needed for specific features of the pad.

This is a good time to execute the "onCampaignLoad"-macro of the lib-token.

Next we create the footpath tokens.
Drop a new clean token (any will do) to your map.
Copy the macro "Create footpath tokens" (its in the SETUP group way down the list) to your campaign macros.
Select the new token and execute the "create footpath tokens"-macro.
This will create a bunch of tokens used for displaying the moved paths.
You can delete the macro from your campaign macros as well as the dropped token.

Depending on your settings you might have to create some states here. The graphics are in the states-folder. Note that you can switch off the state usage at all as well as set the names of the states used (to make it work with your preferred states set).

Copy the "Open" and "Settings" from "copy me to campaign"-group of the lib token to your campaign macros. It would be a good practice to create a macro group "MovePad" for them but that is entirely you business ;)

If you use those features you might want to copy "Setup events/terrain" and "Setup token" as well.

Execute "Settings". I'll explain all the stuff in detail later, but here is what you must change to your setup.

Map and Cost -> Map grid ad Map cost settings
Misc -> Movement Property
States -> either set to existing state names or uncheck them

Basic Using
-----------
Open the pad using the "Open" macro.
Select a token you wish to move.
Click the center button of the pad. The token(s) selected is now stored in the pad.
If you click on the arrow buttons you would move if your token would have any movement (it might depending on your setup).
The movePad-menu contains the following:
- Undo a step
- Undo all steps
- Switch "perform 5-foot-step" mode. Activated it allows a single step.
- Switch "peek" mode. This allows moving the token one field in a direction to set its vision - thus allowing it to peek around a corner.
- End turn. This will refresh the movement property and resets path, states, etc ...
- Switch "Change facing" mode. Activated the buttons will not move but change the facing of the token.
- "Add to movement" can be used to add (or subtract if you enter negatives) to you movement property.
For start press "End turn" once.
Now you should be able to move the token. Play around...

Note that the features "vbl blocks movement", "terrain modifier" and "events" slow down the pad. Deactivate them if you dont make use of them.

The Settings in detail
----------------------

*Map and cost*

Map grid: use Square, vertical or horizontal grid

Movement cost settings:
The pad can use the map settings for cost calculations. Note that to have th metric "ONE_TWO_ONE" work correctly you have to check "fix ONE_TWO_ONE bug".
If you dont use the map defaults you can set your own cost. This works with decimal numbers. You can set different cost for diagonal movement. The actual payed amount is the multiplie times the units per cell.

Face changing:
If checked face changes will cost. If you enter a single number changing face costs that much regardless of the angle. You can enter a list of costs as well, so that a 45° turn might be free (0) but a 90°+ turn costs 1 and a 180° turn costs 2.

Backpedaling and strafing can costs differently. You can set up modifier that will be added or multiplied. If you dont want to use this set them 1 and multiply (or 0 and add).



*Display*
Pad style: some clients have problems with image links I used for displaying the pad. If you experience ignored clicks you can switch the pad to html form buttons that work more reliable.

Display selection: show a list of selected tokens under the pad.

Center screen to moved token: after a step (or selection) is performed the map is centered on the token.

Show selection on center: replace the center button of the pad with the selected token.

Show movement: shows the amount of movement for the selected tokens under the pad.

Show path with footprints: the moved token will leave a trail of footprints (will be cleared by "end turn")

Show origin of peek: If peeking a copy of the token will show where you peek from. The state "isOrigin" (settable later) will be activated so that it can be dimmed or marked otherwise.

Name or id of token used to show footprints: the footprints marking the moved path will be made with copies of this token. Note that you can set a token to use other footprint tokens (thus making different paths).

Map where FP-token can be found, empty for current: the map where the footprint tokens are placed must be set here.

*Misc.*
Change selection automatically: the token set in the movepad changes automatically if you change the selection (making use of the onSelection event).

Block movement by VBL: VBL will block the movement of your token. Note that this will slow down the pad. Note as well that your token can get stuck if the VBL are not according to the grid - but undo will help.

Use terrain modifiers: movement cost will be modified if you move over specifically set up terrain tokens. This will slow down the pad.

Use event tokens: event macros will be called if you move over specifically set up event tokens. This will slow down the pad.

Lib:token for events: to ease the setup of events the token set here will be scanned for macros. If you use the "setup event/terrain" macro the macros will be selectable there.

Allow diagonal movement: you can deactivate the buttons to move diagonal.

Dont set any facing: check this and the pad wont mess with token facing anymore.

Adjust token facing to move direction: if you move in a direction token facing will be set the same.

Change facing prior to move: You can only move in facing direction, otherwise facing will be set.

Allow movement for token with initiative only: only tokens having initiative can be move. This is recommended!

Get GM approval for peeking: peeking will now send a link to the gm, if he approves the peek/clicks the link, the peek will be performed.

Movement property: this is the property to keep track of the actual movement left. It will be refreshed by the max. Movement field, that can be a property, a number of even a function (the field will be evaled).



**Buttons**
You can display the functions in the menu bar you like and hide others.



**States**
You can set the states movepad should use as well as their actual names here.

There are 3 different sets of states.

isPeeking and isOrigin will be used in peeking mode.

walking/hustling/running will be set if your movement is a certain part of your max movement. Eg would the walking state shown if you used movement is less than 25% of your max movement. You can set up those percentages here as well.

5foot will be set if a 5foot-step was performed.



Q&A
---
How can i set up showing the movement left on the token.

You need to set up many many states with those numbers and modify the macro "showMovementHookIn" to actually set/unset those states. You could set here bars as well.


Latest version: v1.8.3 this version requires MT v1.3b70+
get it from the announcement
Version history
v1.0: release

v1.1:
  • example movecost management
  • change selection onSelection event
  • goto moved token
  • show movement in frame (not formatted at all)
  • show the selection in the center of the pad (or a + sign if there are more tokens selected)
  • all changes are made optional
  • minor bug fixes
v1.2:
  • Selection now centers the token (if centering is on). This should get rid the odd first move thing.
  • you can allow/forbid diagonal moves
  • added setting units per cell
  • default behaviour is now to get movement cost from map defaults (i use getDistanceXY())
  • movement can be locked to initiative
  • replaced the lib token image
  • undo last step
v1.3:
  • added support for vertical and horizontal hex grids
  • using the nice undo icon instead of text link
  • i made some changes to get rid off the unknown token bug. Not sure if its enough...
v1.4:
  • movement & max-movement property via settings
  • refreshToken functionality to be included in your endTurn-macro
v1.5:
  • peek mode
  • 5foot step
  • images now in a table, not image tokens
  • fixed some bugs
  • moved path shown
  • undo: single steps, all, to point on path
v1.6:
  • terrain modifier, events, changes in appearance, more buttons
v1.7:
  • to do
v1.8:
  • sped up a lot
  • combined undo function
Last edited by CoveredInFish on Sun Aug 15, 2010 11:59 am, edited 12 times in total.

User avatar
Scubba
Cave Troll
Posts: 90
Joined: Fri Oct 30, 2009 12:47 pm
Location: Oakland, CA

Re: the movement pad

Post by Scubba »

May I assume that this is square-grid only (no hexes)?

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

EDIT: It now supports hex maps.
It is.

But i think it should not be to hard to support hex maps. I dont use hex maps, so i had no use for it .. I'll have a look at how difficult it would be.
Last edited by CoveredInFish on Tue Apr 13, 2010 9:09 am, edited 2 times in total.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: the movement pad

Post by Full Bleed »

Nice additions.

But I ran into a bug.

When I turn off "Use Map Defaults" and use these settings:

Straight Movement: 1
Diagonal Movement: 1.5
Units Per Cell: 5

It seems to work, but if I try to run settings again I get:

Code: Select all

d != java.math.BigDecimal
and it won't let me get into the settings again.



Anyway, here are a couple buttons for in-frame options.

Undo: Currently a link. I figure an icon would be nice. I made it 25x25. At that size 4 buttons will fit above the MovPad comfortably.

Peek (On/Off): This isn't currently supported, but in case you are interested in implementing it, here are a couple icons. Right now "undo" doesn't really allow a player who's used up all of their movement to peek around an obstacle and then move back without using movement. So there needs to be a way for a player to click on "peek", move a step, look, and then move back without using movement. Additionally, if a player is behind a tree or a column they should be able to "peek" around either side without it costing them movement. If they have movement left they could move/undo, move/undo, etc. But turning on a "Peek Mode" would be cooler. ;) When Peek was turned on it would allow you to move 1 step any direction from center, without cost, but will always return you to center when you turn it off. I made two icons, one for when it's "on" and one for when it's "off".
Attachments
MovPad Undo-FB.png
MovPad Undo-FB.png (3.68 KiB) Viewed 7628 times
MovPad Peek Off-FB.png
MovPad Peek Off-FB.png (3.73 KiB) Viewed 7628 times
MovPad Peek On-FB.png
MovPad Peek On-FB.png (3.4 KiB) Viewed 7628 times
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

Thanks fullbleed. I'll integrate the undo button and think about the peek function.

The error is just a problem in the setting dialog. For a quick fix edit the setting macro: i use strformat to build the input dialog. I chose %d as palceholder for values - digits - but this seems to be a flawed choice. Just replacing it by %s should repair it.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: the movement pad

Post by Full Bleed »

CoveredInFish wrote:The error is just a problem in the setting dialog. For a quick fix edit the setting macro: i use strformat to build the input dialog. I chose %d as palceholder for values - digits - but this seems to be a flawed choice. Just replacing it by %s should repair it.
Yep, that took care of it!


Now for some more brain-storming. :)

I know that there is still a lot on the plate... but I’ve been thinking about how terrain modifiers or events might be done.

For the purpose of this post, let's look at terrain modifiers (since they should be easier.)
  • First, we would need to create some Terrain States and what the modifiers of those states would be. I’m thinking that a table or lib properties should be use for defining them.

    Second, we would lay down terrain modifiers on the map by using "Terrain Mod Tokens.” The Terrain Mod Token would probably be a completely transparent token (NPC) or maybe some kind of translucent overlay so that it didn’t obstruct the GM’s view of the map. The GM would attach a Terrain State to the Token to represent the modifier that they’d want that cell to apply.

    Third, then when using the MovPad it would "getTokens" at the current location each step. If there was a Terrain Mod Token at the current location with a Terrain State it could apply the modifier of that state to the movement cost.

Note 1: If “getTokens” can grab a token off the hidden layer, then you could deploy Terrain Tokens there and you wouldn’t have to worry about accidentally selecting them or z-order stacking.

Note 2: I chose to use states so that they could be stacked (i.e. "Mud" and "Steep Incline") and so that GM's could make the terrain mod symbols visible only on mouse-over if they wanted and the screen didn't have to be cluttered.


Does that make sense? Or am I complicating the idea?
Last edited by Full Bleed on Tue Apr 13, 2010 4:15 am, edited 1 time in total.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

Makes sense.

You could place lists or coordinates with terrain modifiers in tables or some kind of self written data storage but that would complicate the map making i think. But you wouldnt have to place tons of tokens on your map (performance?). Hmm ... you could have a token that can be placed anywhere and has a macro on it ("make terrain"). If you click that macro its current position will be stored with the additional given terrain information. But you couldnt see what terrain would be where ..

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

@HEX

Hmm .. it seems not so easy as i hoped. The way I constructed the pad makes it a bit complicated. You press the arrow, the corresponding macro is called and gives the x/y-offset to the moveMacro. Only this macro "knows" about the actual position of the tokens. As far as i found out the offsets are depended of the position in hexmaps. :? ATM i dont see a way to work on this without changing the complete architecture (its not so much code, so that would be an option if i had more time) but i keep thinking about it.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: the movement pad

Post by Full Bleed »

Maybe there should be a "Location" property on the token? You could eval the location in the token property and just pull from that.

That's probably the way I would have done things... but only because I would not have been able to do things the way you did them without hurting myself. ;)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

Update!

Latest version: 1.3 download

Now with support for horizontal and vertical hex maps!

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: the movement pad

Post by Full Bleed »

Nice work on the Hex support. That was fast!

Bug Report--

Getting this error:

Code: Select all

Error executing getTokenLocation unknown token .
When I have "Change selection automatically (use onSelection event)" selected and I click on a blank space on the map.


PS: You don't need to give me credit for the graphics on the map. Thanks for the thought though.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

Adding hex support was easier as i feared .. after i dropped the hope it was possible without altering working code :mrgreen:

@bug
a bummer. I'll look into this next!

@credit:
I'd leave it since it doesnt cost me a thing and feels right .. but if you insist i remove it :)

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

I fixed this bug. I could only recreate it by deleting a token. Then a token is still stored as selected and the "center screen on selected" goes fail. I added a check to see if the token exists.

Just replace the select macro by this:
select

Code: Select all

[h: selectedTokens = getSelected()]

[r, if( selectedTokens != ""), code: {
  [h: setLibProperty(getPlayerName()+"_selectedTokens", selectedTokens, "Lib:cifMovPad")]
  changed movpad selection to: 
  [r, foreach(id, selectedTokens), code: {
   [r, if(findToken(id)!=""):  getName(id); "UNKNOWN TOKEN"]
  }]
  [h, macro("showPad@Lib:cifMovPad"):""]
};{}]

[h, if(getLibProperty("useGoto", "Lib:cifMovPad")), code: {
  [h: selectedTokens = getLibProperty(getPlayerName()+"_selectedTokens", "Lib:cifMovPad")]
  [h: token = listGet(selectedTokens, 0)]
  [h, if( findToken(token)!="" ), code: {
  [h: x = getTokenX(0,token)]
  [h: y = getTokenY(0,token)]
  [h: goto(x,y)]
  };{}]
};{}]

[h, macro("showPad@Lib:cifMovPad"):""]
 

User avatar
mfrizzell
Dragon
Posts: 762
Joined: Sat Feb 13, 2010 2:35 am
Location: California

Re: the movement pad

Post by mfrizzell »

I've got a dumb question, but I've only been playing with it for a little while. How do Tokens recover lost movement? I move my Token then what, how does he move again next round? Is there a mechanism for refreshing movement each round? I tried putting tokens in the initiative panel and cycling through but once moved they had no more for the next round. Am I missing a step?
Thanks this has great potential and I love the images.
DCI/RPGA# 7208328396 Skype ID mfrizzell77
Characters:
Strabor - Dwarf Avenger 5th Level
Tikkanan - Human Warlock 2nd Level
----------------------------------------------------
"People are more violently opposed to fur than leather because it's safer to harass rich women than motorcycle gangs."

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: the movement pad

Post by CoveredInFish »

Short:There is no "Refresh Movement"-function implementet by the pad ATM.

Long:As this would belong to the rules-related framework (what ever you use) I have not included it. I could provide it and thus making the pad work somewhat stand alone.

You would need some "Max Movement" property. And the pad doesnt know which tokens need to be refreshed (maybe all, maybe selected, maybe only PCs?). You would have to trigger a "end of round"-macro (or a "refresh movement"-macro or whatever you or i will call it). Note that a lot of frameworks already have such a macro and it would be easy to hook in there.

Let me know if you need such a function added to the pad and how you'd like it to work.

Post Reply

Return to “Drop-In Macro Resources”