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 »

Could you whip up a code-change for the form button idea. I have never used html forms before, so a demo would be handy. The relevant code macros would be primarily "Init Panel HTML" and "Limited Init Panel HTML", though if you just did the former I could port it to the latter.

Can you also expand on pt. 1?

Image-wise, I think I use this one I just purloined from somewhere.
Attachments
unknown.jpg
unknown.jpg (7 KiB) Viewed 1911 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: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Stand alone init frame

Post by aliasmask »

When you use onChangeToken in a frame (your init panel) the frame is refreshed whenever any token that you can see or access is changed. So, with data put on a lib file that changes, all the clients will have their frames refreshed.

You can see an application of its use here: PropMonitor. This is still fairly beta, but the guts of it is in frameContent, openDialog and compareChanges.

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

Re: Stand alone init frame

Post by plothos »

I guess I'm confused because I already have onChangeToken set for the frames, so I know all that, but you seem to suggesting there's something missing in the code. (Or something that needs to be cut out? I left the macro refreshes in because onChangeToken is somewhat unreliable.)
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: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Stand alone init frame

Post by aliasmask »

plothos wrote:I guess I'm confused because I already have onChangeToken set for the frames, so I know all that, but you seem to suggesting there's something missing in the code. (Or something that needs to be cut out? I left the macro refreshes in because onChangeToken is somewhat unreliable.)
Why do you post a link to the chat? (I haven't actually looked through your code for that). I'm suggesting to do init panel updates to clients relying only on the onChangeToken hook. I gathered from what you said about the blank line that you're doing the execLink method to update the client init panels.

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

Re: Stand alone init frame

Post by plothos »

Ah, I see the confusion. No, the execLink is to announce to all players when a PC has received initiative. It was the only way I could figure out how to get the output sent to all in only that instance and nothing else sent otherwise. At least the blank line should only appear for the person clicking Next.
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: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Stand alone init frame

Post by aliasmask »

I see how to get rid of the blank spaces. Change the "self" to "none" when calling "Advance Init" in the 2 macro calls. You can also change the R to H in "Advance Init" because your output is done as an execLink which has it's own output and is not restricted by the caller.

edit:
Have you been getting that frame error? When I use the macroIO importer, it gives me the error with the init frame is open. I just figured out a fix for that. But it requires adding a line of code to other libs that take certain actions, like use execLink.

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

Re: Stand alone init frame

Post by aliasmask »

I made the change for the blank lines, added the campaign macros, added an onCampaignLoad and a couple of UDFs. Changes are in yellow, UDFs in blue, macro buttons orange.

I try to program all in UDFs myself, so I keep my macro names in variable naming formats. I stole the good idea of using a foreach loop to name my functions from CoveredInFishes.

I'm attaching my version and I'll start working on the form buttons.

Oh, I still don't get the state images to show up... I haven't looked at that part of the code yet.

I added the UDF checkInitPanel() to be used by other programs that use execLink in their code. It will need to go at the bottom of their code (whatever execLink is calling) to avoid the html.frame error.

And I added your image from above after cleaning it up a little.
Attachments
lib_init_alias.rptok
MT version 1.3b69
(484.83 KiB) Downloaded 85 times
Last edited by aliasmask on Thu Jun 17, 2010 7:30 pm, edited 1 time in total.

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 »

This is a great tool! My compliments ...

You might already now this ... if i drag/drop that token in b63 it throws an exception. If i throw it in b69 it flicker and then there are 3 tokens: "unknown", "compass_rose_silver_beve_bw", "E". None of them contain any macro (and no libtoken at all).

If i use the mt library it works fine in b69 - b63 still throws the exception.


aliasmask wrote:I stole the good idea of using a foreach loop to name my functions from CoveredInFishes.
Hey, I need that back ;-)

EDIT: Have you thought of ways to integrate this into other macro packages? Is there some kind of interface to add events/token via macro? To advance init?

Have you considered using the MT initiative sytem to benefit from the ini lock? (I think of setting mt-initiatives and advancing it via macro in way that the current token in the S.A.I.F keeps beeing the same as in MT-Init and so the ini-lock would still work. dont invested further thought than this initial idea though)

EDIT2: If i add something to the ini-list it would be nice if non-numbers for initiative count could be evaled, so i could enter "15" as well as "3d6".

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

Re: Stand alone init frame

Post by aliasmask »

CoveredInFish wrote:You might already now this ... if i drag/drop that token in b63 it throws an exception. If i throw it in b69 it flicker and then there are 3 tokens: "unknown", "compass_rose_silver_beve_bw", "E". None of them contain any macro (and no libtoken at all).
Hmm... I was hoping that went away after I saved it in b69... same thing happened when I drag/dropped for myself. Maybe it's a but with the extra images in b69? Saved in b69 which isn't compatible with b63.
CoveredInFish wrote:EDIT: Have you thought of ways to integrate this into other macro packages? Is there some kind of interface to add events/token via macro? To advance init?
I asked for a general init package so I could integrate with it with a new framework I'm working on.
CoveredInFish wrote:Have you considered using the MT initiative sytem to benefit from the ini lock? (I think of setting mt-initiatives and advancing it via macro in way that the current token in the S.A.I.F keeps beeing the same as in MT-Init and so the ini-lock would still work. dont invested further thought than this initial idea though)
There are some good things here not easily done with the init panel, but I'm pushing for some kind of syncing between the two. That way, you could use the built in init panel only while others use this init panel (like the GM). So, far plothos has done a lot of great work and I'm only just now starting to dink with it. I'll get him to use UDFs eventually :P
CoveredInFish wrote:EDIT2: If i add something to the ini-list it would be nice if non-numbers for initiative count could be evaled, so i could enter "15" as well as "3d6".
That would be pretty easy to do, just wrap the variable in an eval(string()).

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

Re: Stand alone init frame

Post by plothos »

Thanks, Fish. I'm glad you like it. :D

I didn't know about any exception in b63. I haven't seen it. Can you explain?
The b69 thing is a problem with b69, and it happens to any token dragged in with multiple images. Azh has been informed and is working on it.

I have been coding a bunch more and will have an update in a few hours. It will contain a macro to receive info from a framework in the form of a json object with the fields "Name" and "Init". You can code your init rolls however you like and then just call that reception macro.

I will code the current add macro to allow evaluations. That should be easy.

Will update you on what else I've added in a bit.
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: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Stand alone init frame

Post by aliasmask »

Here's the cleaned up image from above.
Attachments
unknown.png
unknown.png (7.51 KiB) Viewed 1882 times

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 »

plothos wrote:I didn't know about any exception in b63. I haven't seen it. Can you explain?
I cant explain but i can the stuff mt throws at me ...
exception dump

Code: Select all

java.lang.InstantiationError: java.util.Map$Entry
	at sun.reflect.GeneratedSerializationConstructorAccessor61.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:62)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:257)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:124)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:66)
	at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:63)
	at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:54)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
	at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:188)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
	at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
	at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:138)
	at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:123)
	at net.rptools.maptool.util.PersistenceUtil.loadToken(PersistenceUtil.java:400)
	at net.rptools.maptool.client.TransferableHelper.handleFileList(TransferableHelper.java:133)
	at net.rptools.maptool.client.TransferableHelper.getAsset(TransferableHelper.java:76)
	at net.rptools.maptool.client.TransferableHelper.importData(TransferableHelper.java:238)
	at javax.swing.TransferHandler.importData(Unknown Source)
	at javax.swing.TransferHandler$DropHandler.drop(Unknown Source)
	at java.awt.dnd.DropTarget.drop(Unknown Source)
	at javax.swing.TransferHandler$SwingDropTarget.drop(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Unknown Source)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(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)
I have been coding a bunch more and will have an update in a few hours.
Kewl.

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

Re: Stand alone init frame

Post by aliasmask »

@CoveredInFishes
I think you may be talking about my saved file ?? I saved it in b69... so it's not backwards compatible with b63 and plothos explained the b69 bug.

@plothos - if you need a b63 version to see my code changes, I'll go ahead and do that... just let me know.

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

Re: Stand alone init frame

Post by plothos »

aliasmask wrote:@plothos - if you need a b63 version to see my code changes, I'll go ahead and do that... just let me know.
I have b69, so I can open it up there and copy anything I need to by b63 instance. (BTW, just saw you're from the bay area. Whereabouts? I grew up in Palo Alto and Mill Valley.)

I probably won't get to it until tomorrow night, but I will def. have a good look then.

@Fish: it's odd that you're getting any exception (and no, I don't get it either) if you're dragging my lib, because I was made and saved in b63 (it has one bit of code that only works in b68, but I've been coding for b63, to keep it viable in older formats). If you were maybe using AM's lib, that might explain it, as I guess it's b69? I'm thinking b68 might be the magic number for this bad boy. :D

Update in a few min.
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: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Stand alone init frame

Post by aliasmask »

plothos wrote:(BTW, just saw you're from the bay area. Whereabouts? I grew up in Palo Alto and Mill Valley.)
I grew up in the Bay Area, mostly east bay (Oakland, Alameda, Concord, Richmond, Pleasant Hill, El Cerrito, Union City) then I moved up to the Chico area for college. I stayed there forever, but I have recently moved back to Alameda.

Post Reply

Return to “Drop-In Macro Resources”