Trying to improve the init tracker...

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Shadow Wizard
Giant
Posts: 183
Joined: Mon Apr 11, 2011 8:11 pm

Trying to improve the init tracker...

Post by Shadow Wizard »

Well, I have been looking at the init tracker, and realized, well, it kinda sucks (unless there are features I am missing...)
One of the biggest things it seems to be missing, is the ability to keep track of "time remaining" on effects.
For example, someone casts "Greater Invisibility" on themselves, and it lasts 6 rounds, I want to be able to track it, so we know when its done.
I have been using an init tracker I found in the forums somewhere, but is is so full of bugs its crazy (likely because it is written to work in an older version of maptool. So maybe not bugs, but just doesn't work right anymore) and I don't have the skillset to fix it.
So, if there is a way to do what I want to do natively in Maptool, or anyone can think of an addon to do it, then please let me know, and my questions below may not even matter :) And if course if there is a better way to do this, I am all ears.. that is if I can figure out hot to implement the suggestion with my limited programming knowledge.
So, my idea is, to put a bunch of "placeholder" tokens on a "Data" map, and then when I need to add greater invisibility for example a macro will find an unused "placeholder" token and add that token, called "Init 1" (there will be several "placeholder" tokens, numbered 1-9) to the initative, and rename it to whatever it is told to rename it to plus a number to count down rounds. So it might be called "Greater Invisibility on Thorg 10."
Then I will have a macro that advances the init. That macro will check what token its on, if its on a placeholder token, will reduce the number at the end by one, and advance the init. If the placeholder tokens number is 0, it will rename the placeholder token back to "Init 1" and remove it from the init tracker.
So, 2 lines into the code, I am already stuck with a question, lol. How do I get the ID of a token for a map that I am not currently on? These IDs are, I think, the best way to reference these tokens, especially since the only way I can see to rename a token, the setName() function, requires the ID.
Yea, a bit long winded, but I didn't want to make 2 posts, asking if there is a better option out there, and asking how to do this..

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

Re: Trying to improve the init tracker...

Post by aliasmask »

Now that we have initiative handlers, it probably much easier to do now. Imo, you'll need a data structure for each tracker, ie whether effect ends at start or end token turn, or on a specific initiative. There are other things, so it could be a big project, especially some new to macroscript. But doing will definitely expedite your learning of it. That's what I did when I first joined the community. First thing I did was write a spell library for 3.5 then PF.

To answer your question, indirectly, lib tokens are there so you can access the data from any map... although there are other ways to do this. Keeping all the data in one location is the best option. Making new tokens wouldn't be optimal. I would keep trackers out of the init panel and either have a window per client, or just post tracker updates to chat as they change which would be the easiest way of doing it. Foundry kind of does that with PF2 where at the beginning of each players turn it posts active states. Trackers are kept in the overlay.

Shadow Wizard
Giant
Posts: 183
Joined: Mon Apr 11, 2011 8:11 pm

Re: Trying to improve the init tracker...

Post by Shadow Wizard »

Unfortunately that just won't work for us :(
So, I still need to know how to obtain a token ID from a map that is not current.
Basically, what command do I use to return the Token ID of the token naked "Init 1" located on map "Holdermap" assuming "Holdermap" is not the current map.

Shadow Wizard
Giant
Posts: 183
Joined: Mon Apr 11, 2011 8:11 pm

Re: Trying to improve the init tracker...

Post by Shadow Wizard »

Thought I should mention, I managed to find it. I am using findToken() That seems to work.

Shadow Wizard
Giant
Posts: 183
Joined: Mon Apr 11, 2011 8:11 pm

Re: Trying to improve the init tracker...

Post by Shadow Wizard »

However I just ended up an an issue that make break everything....
Each map has its own init panel! I can't bring tokens from another map into the init panel....
Please tell me there is a way to change this, so there is one init panel across all maps, or there is a way to bring tokens from another map into the current maps init panel.... Without this, my plans for my init panel are destroyed.

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

Re: Trying to improve the init tracker...

Post by aliasmask »

It doesn't natively do it, but it can be done with a macro. I usually have a macro move tokens from map to map rather than cut/pasting the tokens. It would be easy enough to check the token and see if in initiative before the move then when putting on new map add it to initiative in the same order.

Shadow Wizard
Giant
Posts: 183
Joined: Mon Apr 11, 2011 8:11 pm

Re: Trying to improve the init tracker...

Post by Shadow Wizard »

I had thought of that.. But there is a whole massive slew of questions that will go long with that..
So, If I bring the tokens to the current map, they need to be kept out of the way.. So I could just pile them all at location 10000,10000 or something as something that far over is unlikely to be used. With this increase the memory requirements of the map? i.e. Does maptool load the entire map, and dedicate every square a spot in memory?
Will this increase the file size of the map? Again, there will be a lot of blank space between the middle of the map and 10000,10000, does it need to save every space? I know the rpmap files are compressed, but they need to be decompressed for reading.. So I guess this kind of boils down to memory requirements again..
Can you think of a batter place to place these tokens they way far out of the way?
If I hide the tokens (Either on the hidden layer, or by unchecking "Show to player") and add them to the init tracker, will they be visible to players in the init tracker?
Well, I guess that is all the questions for now.. This will make the programming much much more complex, as now I will need to search maps for the tokens in case they go astray..

Post Reply

Return to “MapTool”