maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Bug]: setLibProperty only works with integers

Open Lector opened this issue 7 months ago • 10 comments

Describe the Bug

I am working on an addon for MT and mentioned that since v.1.14 (maybe earlier...) something stopped working. I investigated and mentioned that setLibProperty is not working if you pass a string while integers work.

[h: setLibProperty("myProp", 0)] <- myProp is now 0 [h: setLibProperty("myProp", "0")] <- myProp does not change

To Reproduce

  1. Create an addon with a property with no default value including the files prop_1.txt and name it using prop_file_map.txt
  2. call a script that sets this property to 1 using setLibProperty.
  3. broadcast the property (it should work like expected)
  4. call another script that sets the same property to "myString" using setLibProperty.
  5. broadcast the property (it should still remain the value 1)

Expected Behaviour

In my scenario i would expect to see "myString" in the chat because the property was set to this value.

Screenshots

No response

MapTool Info

1.14.3

Desktop

Windows 10

Additional Context

Is important to notice that this is something that was working before. I converted my framework from a libToken to an addon in march 2023. Im pretty sure i tested my feature at the time and everything worked. i have not used this feature a lot and can't tell which MT update caused the problem but i hope you can figure it out.

Here is the discord discussion about this issue with some more infos about what i have tried: https://discord.com/channels/296230822262865920/1191310344568705024

If you have problems testing or need a demo you can try the latest version of my campaign if you like. I currently do not have a smaller demo version of the bug but ill give you a step by step guide to reproduce the issue using this demo DSA5maptool-1.4.0.zip

  1. open the campaign.
  2. click on the book-button (2nd button) in the SL-Frame
  3. Open the handouts tab clicking on the feather-icon
  4. You now see 30 handouts that should be hidden from the players. By clicking on one of the closed eyes the property "sharedHandouts" (prop_1) changes from the default empty string to the number of the clicked handout.
  5. Click another eye. The value is now set to a comma separated list of handout numbers. But the value does not change.

I hope this all helps to identify the problem. If you have further questions or need more infos let me know.

Lector avatar Jan 01 '24 12:01 Lector