Can't change images on tokens for some reason.

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
ThermoDyn
Kobold
Posts: 10
Joined: Tue Apr 21, 2020 8:28 am

Can't change images on tokens for some reason.

Post by ThermoDyn »

I have a python program that is generating tokens with macros for me from image files (HL2MT) that seems to works great.

I have an issue though in that once the token is generated - I cannot change the token image. If I click the + icon at the top, I can select another image, the edit token page shows the new image. But when I click ok it reverts back to the old image.

I have an example token with this problem here than can be downloaded:
https://nextcloud.thermo.strangled.net/ ... SoJg3EaZ4E

Would anyone be able to tell me what is going wrong?

I tried looking at the XML but it's hard to pinpoint what to look at because I don't know enough.

User avatar
aliasmask
Deity
Posts: 8603
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Can't change images on tokens for some reason.

Post by aliasmask »

I'm not the expert, but I'm guessing is has to do with these lines:

Code: Select all

<entry>
      <string>Farrah</string>
      <net.rptools.lib.MD5Key>
        <id>cd0fb676b34496fac7b5839d834cc63b</id>
      </net.rptools.lib.MD5Key>
    </entry>
  </imageAssetMap>
  <currentImageAsset>Farrah</currentImageAsset>
Looking at another token, it doesn't specify names for the images since you can't normally have multiple "token" images and then the currentImageAsset locks it in. So, when I tried to change the image, it added the new image to the list rather than replacing the existing one and the currentImageAsset specifies which one to use. I don't think this key is updated when the image is changed since there is usually only one image option.

After removing that line <currentImageAsset>Farrah</currentImageAsset> it fixed the token. It doesn't remove the other image from the token, but does use the first one in the entry list, which is the most recent change.

ThermoDyn
Kobold
Posts: 10
Joined: Tue Apr 21, 2020 8:28 am

Re: Can't change images on tokens for some reason.

Post by ThermoDyn »

Thank you very much for taking the time to focus me in on this section.

I will see what I can do to fix my issue.

Very much appreciated!
Chris

Post Reply

Return to “MapTool”