|
Post by parduz on May 7, 2018 0:02:38 GMT
This is part of my style:
extra card field: type: choice name: a_card_background editable: false choice: default
extra card style:
a_card_background: left: {card.im_X} top: {card.im_Y} width: {card.im_W} height: {card.im_H} z index: -18 render style: image image: script: if card.imagepath == "" then { "/Items-Cards.mse-include/Blank.png" }else{ "/Items-Cards.mse-include/" + card.imagepath }
It should load and show the image with the filename specified in the card imagepath field.
card field: # the image path of the item type: text name: imagepath card list visible: true card list column: 3 show statistics: false
I dunno what I am doing wrong.... I've seen this code working, but now i get the Can't convert from function to image error. The image is there, all my other image fields and script works right, althought they are "fixed choices" and not files you need to specify in a field. What should i do?
|
|
|
Post by cajun on May 7, 2018 0:32:19 GMT
Does imagepath include the image's extension?
|
|
|
Post by parduz on May 7, 2018 7:29:36 GMT
Does imagepath include the image's extension? Sure. It is something like "/Weapons/Sword.png" I tried both "\" and "/" as path separators. I really can't catch what's wrong, also 'cause it is not a "file not found" type error. I really don't get what that error means. If you want, i can upload the whole game/style/include/set somewhere.
|
|
|
Post by parduz on May 7, 2018 14:33:10 GMT
Found it. if card.imagepath == "" then { "/Items-Cards.mse-include/Blank.png" }else{ "/Items-Cards.mse-include/" + card.imagepath }
These have to be ( )Geez 
|
|
|
Post by cajun on May 7, 2018 17:29:31 GMT
Oh wow I hadn't even noticed those were curly brackets from the forum font. Yea {} is for starting-stopping a function, not for if-else statements.
|
|
|
Post by parduz on May 7, 2018 21:00:01 GMT
Oh wow I hadn't even noticed those were curly brackets from the forum font. Yea {} is for starting-stopping a function, not for if-else statements. As a C++ programmer, i did'nt even think at that....
|
|