Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I admittedly am still having some trouble with the last example. I've copied and pasted the code at this point and renamed all of the assets to their placeholder names to miminize accidentally breaking something, but the contraption is still currently completely non-responsive to both the if and else statement, but was working initially with the previous examples.

(+2)

Copy this text to the clipboard, then in Decker you should be able to Edit → Paste Card:

%%CRD0{"c":{"name":"home","widgets":{"highlighter1":{"type":"contraption","size":[128,128],"pos":[224,112],"def":"highlighter","widgets":{"storage":{"image":"%%IMG3AEAAQAKEj6kW7Q/dmrTOiDO0vOsPdqICBlc5il+6plTmLnCMYPRr0/mNb7HPs+w8wCCnKEQak4+jcsmUVJ7QaKN3rf6ap6x2K01Qv07vYVwzjcxlNjeqChPD6LN8em/b2dg43wpQx/AGyCJBiPfXZ3iFuOintnaY1xU5Z3kpOKhYCeb4eOlJ2SnJiTUqg5pqWqkq5kqCWcoaS1Zoq6WJOyu7y6Pr29YbLEq8BGy8+pmcScusDPsciyytkTiso9q0vOksfB3oGvFbty0+1Gy6Ud4CPQ7eLVyCch2pOU8PlxYdjq+rxK3eO0Z/qNniZjAXwoTHAvbjp9DhQ29QBn4zZlEetooS3W0kx3BGFXSiIJ4yKbDjHpJG5rViOdIfPowyrbkoAA=="}}},"sendnum":{"type":"button","size":[96,16],"pos":[112,112],"script":"on click do\n highlighter1.highlighted:5\nend","text":"Send Number"},"happy":{"type":"button","size":[96,16],"pos":[112,144],"script":"on click do\nhighlighter1.highlighted:image[\"%%IMG3AEAAQAKEj6kW7Q/dmrTOiDO0vOsPdqICBlc5il+6plTmLnCMYPRr0/mNb7HPs+w8wCCnKEQak4+jcsmUVJ7QaKN3rf6ap6x2K01Qv07vYVwzjcxlNjeqChPD6LN8em/b2dg43wpQx/AGyCJBiPfXZ3iFuOintnaY1xU5Z3kpOKhYCeb4eOlJ2SnJiTUqg5pqWqkq5kqCWcoaS1Zoq6WJOyu7y6Pr29YbLEq8BGy8+pmcScusDPsciyytkTiso9q0vOksfB3oGvFbty0+1Gy6Ud4CPQ7eLVyCch2pOU8PlxYdjq+rxK3eO0Z/qNniZjAXwoTHAvbjp9DhQ29QBn4zZlEetooS3W0kx3BGFXSiIJ4yKbDjHpJG5rViOdIfPowyrbkoAA==\"]\nend","text":"Send Happy"},"sad":{"type":"button","size":[96,16],"pos":[112,176],"script":"on click do\nhighlighter1.highlighted:image[\"%%IMG3AEAAQAKEj6kW7Q/dmrTOiDO0vOsPdqICBlc5il+6plTmLnCMYPRr0/mNb7HPs+w8wCCnKEQak4+jcsmUVJ7QaKN3rf6ap6x2K01Qv07vYVwzjcxlNjeqChPD6LN8em/b2dg43wpQx/AGyCJBiPfXZ3iFuOintnaY1xU5Z3kpOKhYCeb4eOlJ2SnJiTUqg5pqWqkq5kqCWcoaS1Zoq6WJOyu7y6Pr29YbLAqlYfzJO/MboVOSnEn7+twsKr1XnTYUPbwKvQl8LNwdm51o8g1+jZ0eOEkLPA3b1N5+Tu7+bhrvTf72zc/bKXatkHFC9CTgiYHyBBLL9ychvlyoFFYZY+4hwXsTyWTs1/FiOHtLPnIMeUPhNpEWlxkkeQrWuHVW4rWgGAKkSZbUnj3smTNFAQ==\"]\nend","text":"Send Sad"}}},"d":{"highlighter":{"name":"highlighter","size":[128,128],"margin":[0,0,0,0],"description":"Draws attention to an image","script":"on get_highlighted do storage.copy[] end\non set_highlighted val do\n show[\"called set_image with\" val]\n if \"image\" = typeof val\n  storage.clear[]\n  storage.paste[val]\n else\n  alert[\"%J is not an image\" format val]\n end\nend","image":"%%IMG3AIAAgAUgII5kaZ5oqq5s675wLM90bd94DnCcfvK+oNDEAw6LvaHyl3whmypj6ymULkVIWJa1JUq7OvCSOhWjzLss2Yc+Fl3rVHxEbdvm3pudhGdaS097NXuCK32Ab2V/fIGLOYFniYOScpRRloiQSpqZjpl+UJGenaGkmGx9gnhdmoedXJybaKqxao09qVCFjV6lNKunpk23kLOSu7FpwTJzhVh1xFvGX8t0rbyPYs7P0drTRsjdlNWGYNvWxNbovtxJ4eKM5JfH8r1x0sv4o+3RppPQ+0R5A5cvkblQ3UAFhJUuBrZ17SoRpGblocI74tjNG+iu4MRhllxFZJaxnkKEBunF6/hRI0OXAkvqKQWQJcg3+mBu1GmvJE+SQHKurPmz569vC2f4HIpz259zQJMehcfUokRdJo9eWXcrpsiVXLeKrbqv4cubRcfO/MrPJCuoJNWOVHTurdSpaeXGi8rvClu9qJrCrQcXMMaWDr8WNow3GV07ixlHNfsY2F3J/5aevZcVc2aZlWt6Vkuvq5OMoz07htMvteu1q1/LPv13tu2eeW9L9plbt17evX2T5i1ceMLOxZMrx3F5+evIzhnXjhs9DPSN1Q9fx55dqVXW5ZB3b017VOzuJ6e3xaS+ekJloTmLNw78vDLy7X3XN72z6/bn+9mHG2XorXdcfvfxVyBT4H0moHsPBhahcwqK9d2C621FHoYDjrEhh8K4QSCIRgVRIYnziNgcihquyOKLMMaYnYsymjhfjdbdOCONiemY3Imy8EgfkCoGp9+IWrwXFopElhcgkz4KUx+JCHq1H4gX2ogah0i2+J9rSlpYpW5hBvnlbGVKGOWRgo2ZHo52TRjemsUd1CRrdP5IU5en4Zikm37+E6gsg0onJ2xCsnlofIvqyedkaR7ZX5aQfqhoTEPlWMyZYpaWIFZGMoEbLI0Fh1qjzCkGlaVz9kOpmeREuCWjZLxaZFkParYZJ6zeGsydn+ICbLDs2AJoq7m8ymubMCGZU54DmtHrp0vSEtQpcSbq1VwG/iofWhqJZg8pVdgJKpGWnYupY9JCm+Ar3XrriLlWpltiqhyFFds3YIES7LgA4zsvuG1VIhAiVxUM78La6VSrrf6WpzDCFzn4mIE9NldRYVVCzA1XyP2XX6Me15uWyIuNPCZREiPaGFCwQYRnqH29bChFRaGsI6oxq9Nyw0ADBqi27x52M9HZuCu00tphyGk2XDJdKHdTy4V01VjTEAI=","widgets":{"storage":{"type":"canvas","size":[64,64],"pos":[32,32],"locked":1,"border":0,"scale":1}}}}}

There’s a contraption with an embedded canvas, that draws a border around the image on the canvas to highlight it. The contraption has a .highlighted attribute which allows the canvas image to be set or retrieved. There’s also three buttons, one which sets the .highlighted attribute to a number (which should be rejected) and two which set it to an image (to demonstrate the image is actually being changed).

It’s basically the same as my last example, but I had to change the attribute name from .image to .highlighted. It turns out that contraptions already have a .image property (which refers to the background image of the contraption, like card.image refers to the background image of a card), so you can’t override that with your own set_image{} handler. I wrote my original example based on my experience of attributes in general, but I hadn’t actually tested it as written, sorry.

(+3)

You're all good. Thank you so much for the help! I was finally able to get it working! I'd share a photo of the final results of my testing but the placeholder artwork i am using is just one of those graffiti penises and Im to sleepy to make something more respectable right now.