haganbmj
0/0 Germ
Posts: 13
Favorite Card: Wirewood Symbiote
|
Post by haganbmj on Mar 3, 2021 4:03:35 GMT
Was looking to use scripting to batch the process of adding cards. The new_card function can at least handle the text fields, though I didn't see how to append it to a set so I wound up adding custom menu options that use AddCardsScript instead. I was unable to manipulate the set.cards list, and couldn't find any append methods in either the documentation or the github repo. The documentation makes it seem like it is supposed to automatically add it. magicseteditor.sourceforge.net/doc/function/new_cardWhat I'm still stuck on is the ability to set images to the card object during creation. The documentation seems to imply that an image type can just be the file path, but when I do that using either relative or absolute pathing it just spits out an error that my field is not of the right type. magicseteditor.sourceforge.net/doc/type/imageex. new_card([ image: "/image.jpg" ]) I also tried looking at existing cards in a set I had open so that I could get the formatting that it wants, but accessing the card image via set.cards.0.image just prints the image to the console and trying to to_string that just complains that it can't handle the type conversion. Messing around in the console it was very tricky to get any image to load at all using to_image, but I eventually got it by throwing something in a package inside a subfolder. magicseteditor.sourceforge.net/doc/function/to_imageex. to_image("/whatever.mse-game/images/image.jpg") That same path construction still wasn't enough to satisfy new_card, though. Any advice would be appreciated.
|
|