Stand alone init frame [Dev]

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

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Cool. Sorry about them Raiders. :D
My dad lived in Fremont forever, and one of my best friends is still in Berkeley and working for Pixar nearby. I went out to Davis for undergrad before heading all the way over to Providence and Brown for grad school. I'd love to get back to the Bay, but there's that pesky needing money to live on thing.
[/threadjack]
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Okay, I tried to squeeze in one more feature, but it turned out to be more involved than I thought to get it working right, so it'll have to wait.

Here's what (I think) is new since the last update:
1. Pull-down menus to select another entry and a before or after option allow alternate methods of placement in the Add To Init, Add Token To Init Panel, and Manually Set Init options.
2. If you wish, wherever you previously entered a number to set init, you may enter an evaluable dice expression.
3. Hold function added, activated via a rightward arrow following the entry label if entry is not holding, or a left arrow before it if it is. (Does not yet affect any functionality, but it will soon allow held entries to be skipped, according to a new setting already in preferences.)
4. Settings allow for held entries to be indented by a set number of pixels (hence the arrows).
5. Settings allow for HTML color codes to be entered for the overall panel background, the background for the entry currently with init, and for held entries.
6. Access settings have been relabeled Functionality Preferences with a tabbed input: tab 1 is for general functional preferences (so far an option to skip holding entries, and an option to configure if/when entries with durations are auto-deleted), but these settings don't currently DO anything yet. tab 2 is for the old player access settings.
7. Added a macro that receives a json with the fields "Name" and "Init". This will then add an entry for a token by that name and with that initiative score. This can be used to integrate the panel into pre-existing FWs.
8. Added a sample campaign panel macro that calls the macro mentioned in 7 after rolling 1d20+4 for init. It collects the name of a selected token automatically.

I think that's it for now. Next things I'm working on are allowing skipping of entries that are holding/delaying; and the ability to auto-delete event entries when their durations are reduced to a certain point. (Both can be turned off or on via settings mentioned above.)

Here's a new pic too (note the indented, holding entries and the new color scheme - which is configurable):
Init Demo 2.jpg
Init Demo 2.jpg (22.05 KiB) Viewed 2274 times
Attachments
Plo's Init Panel 6-17-10.cmpgn
(666.33 KiB) Downloaded 93 times
Display Init Panel.mtmacro
(715 Bytes) Downloaded 87 times
Add Token To Init.mtmacro
(724 Bytes) Downloaded 88 times
Sample FW Init Macro (put in campaign or global panel).mtmacro
(803 Bytes) Downloaded 85 times
lib_init.rptok
(689.52 KiB) Downloaded 84 times
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Raoden
Dragon
Posts: 381
Joined: Fri Dec 18, 2009 2:33 am
Location: San Diego

Re: Stand alone init frame

Post by Raoden »

plothos wrote:Cool. Sorry about them Raiders. :D
My dad lived in Fremont forever, and one of my best friends is still in Berkeley and working for Pixar nearby. I went out to Davis for undergrad before heading all the way over to Providence and Brown for grad school. I'd love to get back to the Bay, but there's that pesky needing money to live on thing.
[/threadjack]
[threadjack]
I grew up in Palo Alto too, plothos! And have been living there again for the last year and a half ... though I'm moving away on Monday. Hey, I can even make this relevant to the topic by mentioning that moving preparations are the reason I haven't gotten around to trying this init panel out yet ...
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0

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

Re: Stand alone init frame

Post by CoveredInFish »

Opening plos token in b63 works fine. It was probably a backward compatibility thing with aliasmasks.

Had no time to check out the changes yet but this looks promising.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Okay, found a trio of major issues, and fixed two of them. The third, I think, is a bug in MT.

First off, when using the init panel on a map that doesn't have the lib on it, the images weren't loading. I fixed this by storing the image asset id's to the lib when the entries are created. This actually should speed up performance overall, if anything, and works just fine. Only drawback is the images in init won't update if the token images are changed. Not a huge deal, I hope.

Second, again when you're not on the lib's map, advancing init would cause a problem, but a simple change of macro.args to getMacroLocation() in one line of code fixed it.

Third, the big problem: it seems if you have ANY frame open on any map that gets refreshed with onChangeToken when you type anything directly to chat you get the following error message.
Error message
java.lang.NullPointerException
at net.rptools.maptool.client.ui.htmlframe.HTMLFrame$3.run(HTMLFrame.java:170)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:24)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
What's especially weird is this problem does not come up if you impersonate. I hope that helps a dev track the problem down.

I've also added a setting that lets you turn off selection on centering, so you can turn it off if you're not running b68+

Updated Token:
Attachments
lib_init.rptok
(689.94 KiB) Downloaded 79 times
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

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

Re: Stand alone init frame

Post by aliasmask »

Yeah, I noticed that problem too when using onChangeToken... in fact, it may be worse than you think. You can see the thread here: Thread

Basically, while the frame is open, any macro from any lib that changes data on a token and uses execLink will need to refresh the frame. I discovered this when I was using macroIO tool when the frame was open. I have a test campaign that shows the error in the thread as well. I thought it was just an MT fact of life, but it may be an unintended error.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Thanks to Craig, Azh should be able to put a fix for this in the impending b70, so here's hoping. :D
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

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

Re: Stand alone init frame

Post by aliasmask »

That's good news. Where did you hear about this?

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

Re: Stand alone init frame

Post by Azhrei »

@am: PM's.

It's in SVN. I plan to do b70 around 2-3 PM today.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Good news folks: the lib is drag-n-droppable into b70 and the error no longer appears when typing to the chatlog with the panel open.
Thanks to Azh and Craig.

Now I just need to get those pesky skip-holding and auto-delete options working and it'll be mostly set.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Argh, so I've got the skip holding worked out, and I have the auto-delete worked out.
But I'm having trouble getting them to play nice.

Hopefully will get that sorted out and have an update today.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Okay, I believe I have got all that sorted out.
New to this version, which I'm now officially labeling a full beta version v0.1:
1. option to skip held entries will cause the next function to pass over anything holding. (previous will not do so, though I could probably code up something if that's an issue for people)
2. option to set deletion of expired durations should work, at least if set to 0. I have not tested it for other elements, and normally the durations won't be lowered below 0 anyway. If anybody thinks they should, let me know.
3. if an even expires with auto-delete on, and if the entry is NOT hidden or if the option to let players see everything is enabled, a report will be generated stating that the effect has expired.
Attachments
lib_init v0.1.rptok
(519.93 KiB) Downloaded 75 times
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

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

Re: Stand alone init frame

Post by aliasmask »

Cool. I look forward to checking this out.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

The existing FW addition macro is missing a change required for images to work. Here's the new macro.
Attachments
Add Token From Existing FW.mtmacro
(1.17 KiB) Downloaded 75 times
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Stand alone init frame

Post by plothos »

Okay, on the attached lib I have a couple of functions defined within an onCampaignLoad macro on the lib. But this macro is NOT RUNNING when the campaign is loaded. I have to manually activate it, at which point it all works fine. All the macro does is defined two functions. They report 0 with isFunctionDefined() at startup and report 1 after I click this macro. I've triple-checked the name of the macro and it looks right to me. Is there any reason anybody can see why this macro isn't running on load?

EDIT: This is happening for both b63 and b70
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

Post Reply

Return to “Drop-In Macro Resources”