Implemented MapTools N State Tokens

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Implemented MapTools N State Tokens

Post by Lord.Ashes »

Update: A rewrite of the N-State Framework is available: N-State Framework Rev 1.0

A download for the N-State Framework campaign file along with documentation can be obtained at the following link:

http://www.mediafire.com/folder/6ec1aty ... _Framework

The N-State Framework campaign file also includes examples (which are discussed in the documentation) that show off some of the Frameworks features.


Description:

The N-State framework provides functionality for N-State icons and corresponding macro functions.
The framework is geared towards a card game system but benefits of the N-State can be applied
equally to Roleplaying campaigns and other MapTool uses.

The N-State framework allows each tokens to be associated with multiple images from a table and
provides easy to use Library macro functions for navigating between these images. Although many
campaigns already alter token images on-the-fly, the process is done through scenario specific
macros instead of a universal framework. This is where the N-State framework comes in. It takes
care of tracking the available states for each token and providing the necessary functions to
manipulate them, so that the creator can focus on the campaign as opposed to campaign implementation.


Features:

* N-State Tokens

* N-State Token Actions (Macros) and corresponding Library Token Actions (Macros)

* Player Tokens

* Player Token Actions (Macros) and corresponding Library Token Actions (Macros)

* Shadow Token For Tokens That Are Owned By Others

* Tattoos On Shadow Tokens To Indicated Which Player Owns Them

* Examples


Documentation:
N-State Framework Rev 1.txt
(23.38 KiB) Downloaded 184 times
Attachments
N-State Framework.Rev1.zip
(3.38 MiB) Downloaded 107 times
Last edited by wolph42 on Thu Nov 19, 2015 4:15 am, edited 2 times in total.
Reason: While the size of the framework didn't exceed 4mb I've added it here to the post, in case MF goes down or deletes it.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Implemented MapTools N State Tokens

Post by Azhrei »

Lord.Ashes wrote:Tokens that can have any number of states. However, unlike the State overlays of MapTools, these are true states in that they can be totally different and not just overlays. Obviously I mostly use it to shift between my card face down and card face up tokens with some games employing additional states such as tapped but the same technique can be used for any application.
Cool. I'm always glad to hear about people finding other uses for MT, even if they do need to modify the code a bit.

But I'm not sure I understand. There can be any number of states on a token, so what do N States add? Existing states can be "totally different", but maybe you mean that your N States are mutually exclusive? So you're referring to them as states in a finite state machine, for example, where an object can only be in a single state at a time, instead of an object possibly being in multiple states at once with each state being boolean?

Wouldn't the same thing be possible using macros? For example, if I want a card to show the face or the back I create a state called Back as an overlay that 100% covers the token. When I turn it on the face is obscured and only the Back is visible.

If a card's position is important, ie. how it's rotated, then states wouldn't help and a macro to change TOP_DOWN facing would be needed instead.

In any case, it sounds interesting. :)

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Implemented MapTools N State Tokens

Post by JamzTheMan »

I don't think I'm getting it either? A token currently can have unlimited "states" as it were with the current engine? Are we talking additional/different functionality with this? Or is there some limit to states? Like Az said, could you create state Jack, Queen & King with an overall image of those cards? Or do your N states show the images differently?

Maybe a screenshot?
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: Implemented MapTools N State Tokens

Post by Lord.Ashes »

Sorry...I think the confusion is my use of the work "State" which actually had a different meaning (that I am intending) in MapTools.

My N-State Framework allows a token to be associated with multiple images (as opposed to using MapTool "States"). You provide list of possible images in a table (or multiple tables) and then by configuring the token you can determine which image table it uses to get its images and which images it uses.

For example, consider a D6 die. Very simple to implement in MapTools...you create a table with the 6 states and then roll off that table. Now consider that you want to make a loaded die which favors certain results more than others. You could introduce those sides more often in the roll table but this then limits each roll table to a specific loaded die (i.e. if we add more entries in the table with the value 6 then the die is loaded towards 6 but the same table can not be used to load the die towards 1).

My Framework overcomes by providing properties on the Token to select the different states. To continue with the above example, I would still only provide the 6 states in my table. If I wanted a regular die I would configure my token with:

States: 1,2,3,4,5,6

If I wanted to use the same table to create a die that is loaded towards 6, I would just configure the token as:

States: 1,2,3,4,5,6,6,6

If I wanted to use the same table to create a die that is loaded towards 2, I would just configure the token as:

States: 1,2,2,2,3,4,5,6

The same concept can be applied to other kinds of tokens. Say I have a game where heroes earn levels but these levels are groups in tiers. If I want to distinguish the look of the hero tokens based on this tier system, I could use the MapTool (overlay) State function to somewhat modify the look of the token but if I want to significantly change the look of the character token then the overlay States aren't really a good solution. I could have the different tokens ready and then swap them but then, if the tokens have other dynamic properties, you would need to copy the properties to the new token. My N-State token solution, would resolve this by providing the necessary tools to load the new images without having to do any hard work.

As I said, the Framework comes with a bunch of macros to help use the Framework. A Setup macro helps convert regular tokens to tokens that support the necessary properties for the Framework. I am working on a Macro that will copy tokens, so that when you use the Framework for actual cards, you don't need to create each card tokens manually. Lastly a set of Library macros and token macros (which all the library macros) are provided to easily shift between the different states (e.g. go to the next state, go to the previous state, go to a random state, go to the previous state jumping to the last state if on the first state, go to the next state looping back to the first state if on the last state, shuffling z-order of states, piling tokens all on to one cell, fanning out the tokens, etc).

I developed this system for my Card Game implementation because I needed a good way for the tokens to be able to switch between a card down and card up image. Originally I though of using card face up tokens and then applying a MapTools overlay State to them to "cover" the face up card token with the face down card image. However, this does not work because the Portrait view (which I require for displaying card details for games with complex cards) does not show the overlay States and thus mousing over a face down card token would show the contents on the Portrait view. So instead I use this N-State implementation to actually swap between the two (or more) states.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Implemented MapTools N State Tokens

Post by JamzTheMan »

Ah, ok, got it. MT is a binary state and your states are open ended. You could still use mt states but it requires a little more setup (state dieSide6_1, dieSide6_2, etc with more props and macro code).

Thanks for sharing, always cool to see what others hack into MT :)
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Implemented MapTools N State Tokens

Post by Azhrei »

Yes, thanks for clarifying. Now I get it. :)

User avatar
Simetradon
Cave Troll
Posts: 55
Joined: Fri Mar 16, 2012 5:39 pm

Re: Implemented MapTools N State Tokens

Post by Simetradon »

I just make the states so they can overlap. I can get about 6 states on a token, with a symbol in each corner, an overlaying color, and a potential graphic on top.

With the wounded States for Silhouette, I have one for Flesh Wound, and a second for Deep Wound, each are just blood spatters, but the Deep Wound is quite a bit more blood. Then, of course, Dead is a Skull. Then there's potential for symbols on each corner.

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: Implemented MapTools N State Tokens

Post by Lord.Ashes »

Simetradon wrote:I just make the states so they can overlap. I can get about 6 states on a token, with a symbol in each corner, an overlaying color, and a potential graphic on top.

With the wounded States for Silhouette, I have one for Flesh Wound, and a second for Deep Wound, each are just blood spatters, but the Deep Wound is quite a bit more blood. Then, of course, Dead is a Skull. Then there's potential for symbols on each corner.
Yes. The States in MT work great if the base shape of the icon remains the same and you are just adding things on top (hence "Overlay") such as wounds, dazed, unconscious or whatever else you want to come up with. However, if you want the different states to significantly change the token then it becomes harder (or you start to use the States Overlay as a replace image). Consider a level 1 hero token that appears in peasant clothing and is huddled (because he is a scared noobie), the next state is a level 5 token which has finer clothing and a regular stance, the next state might a level 10 squire token dressed in some basic armor and in ready crouch, the last state might be a level 15 knight in full battle armor in a overhead swing state. Due to the different stances, this would be hard to achieve using MT States because the states would need to cover each other. Now, I suppose you could make it a empty token (or a tiny dot token) and then use the States as the actual images but now consider that each player has such a customized token. Now either all player tokens would have all the player states available or you would need to create custom token types for each player so that they only show their corresponding type. I'm not saying it can not be done, but I think my framework simplifies this a bit...I'm not pushing it on anyone...just letting people know that I have implemented it for anyone that thinks they can make use of it.

I almost forgot one of the other advantages over MT States...Portrait View. MT States do not show up in Portrait View (you can display them in the Stats block if you write macros to do this) but the actual MT States overlay images are not displayed on the Portrait View. My N-State Framework keeps track of both the token image and the token portrait so that when the token state is changed using the framework, the Portrait View will also reflect that state.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Implemented MapTools N State Tokens

Post by JamzTheMan »

Ya, you're code would be awesome for shapeshifters and disguises. The current system has some limitations are easily changing token images via macro.

Id almost call this something more like stateView or something. What does you getNState return btw?
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: Implemented MapTools N State Tokens

Post by Lord.Ashes »

JamzTheMan wrote:Ya, you're code would be awesome for shapeshifters and disguises. The current system has some limitations are easily changing token images via macro.

Id almost call this something more like stateView or something. What does you getNState return btw?
Sorry but I am not sure I understand the question. The title "N State" refers to "Arbitrary Number Of States". Typically when showing examples of something that can have any number of entries, a sample entry is shown with N in place of the actual number. For example,

Troll-1
Troll-2
...
Troll-N

I think this is where the term "N State" came from.

There is no actual getNState function in my framework. The frame work consist of token properties for using the N state functionality (basically one property for indicating which state the token is in and a second property for listing all the states that the token can go through). This allows the use of a common image table but still allows the tokens to use only select images for the different token states. In addition, as I mentioned, the framework has a bunch of macros for manipulating the state. So, for example, there is a macro for moving to the next state, the previous state, to the first state, to the last state, to any specific state identified by the index, plus there are versions of the next and previous state macros which loop to the end or start if you go beyond the bounds of the state list, and so on. I have two sets of these macros in the framework: one for the tokens (which just make calls to the library token) and the library token macros which actually carry out the various state manipulations.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: Implemented MapTools N State Tokens

Post by Lord.Ashes »

A total revamp of the N-State Framework is available at:

http://www.mediafire.com/folder/6ec1aty ... _Framework

It includes the Framework campaign file (which includes samples), documentation, and extracted Library Token, Token and Player token macro sets.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

Post Reply

Return to “User Creations”