Moon Wizard
January 9th, 2009, 03:26
OK, I've been working on implementing the ability to drop dice rolls onto tokens in order to add some more capabilities to the rulesets I support. There are a couple challenges that I came across that I wanted to provide feedback, or get some help with.
* Tokens will not allow drops if the Modifiable flag has been set to false. The only way to allow clients to drop onto a token is to make it modifiable, which means that players can now rotate, move and delete NPC tokens. Not a good thing for my game, since my players like to occasionally torment me. Drops should be enabled even if a token is marked non-modifiable.
* The other challenge that I've come across is with the onDrop handler on the client side. By default, there is no access to the tokens that I could find from the client side. In my rulesets, I have a client combat tracker which uses the token ID and refnode values to call the populateFromImageNode function to generate a reference. However, I ran into 2 problems with this approach. First, if the combat tracker is opened before the map is shared or even before it is fully loaded, then the references are not correct and the onDrop handler does not fire. Second, when a new entry is added to the combat tracker by the GM, the onInit handler on the client side is not called for the combat tracker entry window, so the reference does not get generated.
Anybody have any ideas on getting the combat tracker and map tokens to reference consistently?
Thanks,
JPG
* Tokens will not allow drops if the Modifiable flag has been set to false. The only way to allow clients to drop onto a token is to make it modifiable, which means that players can now rotate, move and delete NPC tokens. Not a good thing for my game, since my players like to occasionally torment me. Drops should be enabled even if a token is marked non-modifiable.
* The other challenge that I've come across is with the onDrop handler on the client side. By default, there is no access to the tokens that I could find from the client side. In my rulesets, I have a client combat tracker which uses the token ID and refnode values to call the populateFromImageNode function to generate a reference. However, I ran into 2 problems with this approach. First, if the combat tracker is opened before the map is shared or even before it is fully loaded, then the references are not correct and the onDrop handler does not fire. Second, when a new entry is added to the combat tracker by the GM, the onInit handler on the client side is not called for the combat tracker entry window, so the reference does not get generated.
Anybody have any ideas on getting the combat tracker and map tokens to reference consistently?
Thanks,
JPG