PDA

View Full Version : Help with Dead Markers on CoreRPG



damned
March 15th, 2017, 13:15
Hola good people.
Im trying to implement something akin to dead markers in MoreCore.
Switching the tokens/portraits in the Combat Tracker when wounds exceed health but Im having a lot of trouble trying to work out how to trigger/change the portraits/tokens on the map.
The map tokens/images are stored as <prototype> but Im a little lost as to how to reference the correct image/map to make the changes.
There is a dynamic link between the actors names in the CT and the Map but the tokens/portraits are only set on adding them to the map. Changing them after you add them to the map will change them in their entry and in the CT but not on the map...
Anyone got any clever suggestions for me (other than pointing me at Ikaels code...)?

Bidmaron
March 15th, 2017, 13:44
Respectfully, why are you doing this in morecore? This should be in core. Unless the goal is to get it worked out in morecore and then backport to core?

damned
March 15th, 2017, 13:56
Respectfully, why are you doing this in morecore? This should be in core. Unless the goal is to get it worked out in morecore and then backport to core?

CoreRPG has neither Health nor Wounds so you cant do it in CoreRPG.

Spin-Man
March 15th, 2017, 16:23
Hi damned, celestian was talking about a similar function in this thread (https://www.fantasygrounds.com/forums/showthread.php?37186-Couple-Newbie-FG-questions&highlight=token) and although it was for a different ruleset, he may have some insight that could help you out.

Trenloe
March 15th, 2017, 16:31
There is a dynamic link between the actors names in the CT and the Map but the tokens/portraits are only set on adding them to the map. Changing them after you add them to the map will change them in their entry and in the CT but not on the map...
Ikael's approach, I believe, is to use a tiny 1x1 100% transparent token as the placeholder and then to put the blood graphic as a bitmap widget tied to the essentially invisible and non-interactive token placeholder: https://www.fantasygrounds.com/refdoc/bitmapwidget.xcp

I believe these are not tied to the NPC/PC record, they are placed at the same point that the original PC/NPC token was, with that original token being removed from the map.

To get the image window you'll need the windowclass and the database node the window is anchored to then use Interface.findWindow: https://www.fantasygrounds.com/refdoc/Interface.xcp#findWindow Thix will only work if the window is open.

Get the window datasource from a tokeninstance object using getContainerNode: https://www.fantasygrounds.com/refdoc/tokeninstance.xcp#getContainerNode

damned
March 15th, 2017, 23:26
Hi damned, celestian was talking about a similar function in this thread (https://www.fantasygrounds.com/forums/showthread.php?37186-Couple-Newbie-FG-questions&highlight=token) and although it was for a different ruleset, he may have some insight that could help you out.

Yeah celestians prompt is what made me start attempting this. His ruleset is a heavily modded version of 5e so it contains an enormous amount of code not present in CoreRPG. I would peek at it but its not yet available.


Ikael's approach, I believe, is to use a tiny 1x1 100% transparent token as the placeholder and then to put the blood graphic as a bitmap widget tied to the essentially invisible and non-interactive token placeholder: https://www.fantasygrounds.com/refdoc/bitmapwidget.xcp

I believe these are not tied to the NPC/PC record, they are placed at the same point that the original PC/NPC token was, with that original token being removed from the map.

To get the image window you'll need the windowclass and the database node the window is anchored to then use Interface.findWindow: https://www.fantasygrounds.com/refdoc/Interface.xcp#findWindow Thix will only work if the window is open.

Get the window datasource from a tokeninstance object using getContainerNode: https://www.fantasygrounds.com/refdoc/tokeninstance.xcp#getContainerNode

Thanks Trenloe. I am working my way through Ikaels code. I believe that he does it this way because the dead marker can then remain in place after you remove the dead from the tracker which is very neat. I was attempting to swap the token out for a skull or similar but it would disappear when the actor was removed from the CT.

I will follow those pointers - much appreciated.