Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

hi (covers face) It's Me Again 

thanks for the tip about the toolbars!

OK next question i got the animation running (used the canvas overlaying bc that's what made most immediate sense to my workflow) and i put the on view do / end frames script onto a canvas, but it seems like when the script is running the buttons and other widgets don't work while it's looping on view? i did some variants like only accessing the animation on click rather than looping, but while the animation is running on click it has to cycle completely before buttons become accessible again (and ofc the on click means it doesn't loop? but just cycles once)

im using millie's janky sequencer and jankytunes but even with her new trick to play continously across cards, it completely pauses on this card with the animation. and i added the retune button to try and start the music player manually, but it doesn't work, either.

pls lmk what i'm doing wrong lmao!! i've been staring at this for hours bc im so embarassed i don't understand

(4 edits) (+2)

Oh no! Don't worry, this was my bad. I didn't explain enough about 'sleep' -- it puts everything in Decker to sleep for the duration, including the ability to click buttons, or Jankytunes' ability to 'draw' music.

This is (usually) fine for the silly things I get up to but obviously you've run into one of the major downsides and I'm really sorry I didn't clarify this aspect of sleep[] in the previous post.

(I'm going to edit this shortly but I just wanted to assure you first that you're not doing anything wrong.)

Is your ideal outcome for this card a looping animation? And does it use consistent timing between frames?

EDIT: (I forgot about this one...) Inside of Wigglykit (there's a contraption which lets you paste a series of images inside of the properties menu that opens up from the widget. You can copy it from the Wigglykit deck or copy-paste this into your deck:

%%WGT0{"w":[{"name":"wp1","type":"contraption","size":[69,63],"pos":[115,92],"script":"on release pos do\n if snap.value me.pos:pos end\nend","def":"wigglyPlayer","widgets":{"c":{"size":[69,63],"draggable":1},"fr":{"size":[69,20],"value":{"text":["i","i","i"],"font":["","",""],"arg":["%%IMG2AEUAPwD/AP8A/wAsAQEAKwECABMBAgABAQMAKQELAAoBCAAhAQIABgEOAAEBAgACAQkAIAEEAAYBGwAgAQMACgEBAAMBDQADAQQAIAEDAA8BAgADAQUABQEDACEBAwAdAQMAIgEDAB0BBAAhAQMAHgEEACABAwAfAQMAIAEDAB4BAwAhA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BAwAhAQMAHgEDACEBAwAeAQMAIQEDAB4BBAAgAQMAHgEDACEBAwAeAQMAIQEDAB0BAwAiAQMAHgEDACEBAwAeAQMAIQEDAB0BAwAiAQMAHAEEACIBAwAcAQQAIgEDABwBBAAiAQMAHAEEACIBAwAcAQQAIgEDABwBAwAjAQMAHAEEACMBAwAEAQIAAwEBAAEBCAACAQoAJAEDAAEBHgAiAR8AAQECACIBCAACAQYAAgEHAAEBAQABAQIAKAEFAEEBAgD/AP8A/wC1"]}},"or":{"size":[69,20],"value":"[0,1,2]"},"fl":{"size":[41,20],"pos":[0,111]},"em":{"pos":[78,-49]},"cbo":{"size":[100,13],"pos":[78,0]},"cst":{"size":[100,12],"pos":[78,20]},"cd":{"size":[100,13],"pos":[78,38],"value":1}}}],"d":{"wigglyPlayer":{"name":"wigglyPlayer","size":[100,100],"resizable":1,"margin":[1,1,1,1],"description":"A viewer and storage location for wiggly animations, which is also suitable as a \"Fancy Puppet\" for use with Puppeteer.","version":1.2,"script":"on frames do fr.images end\non order  do or.data end\n\non set_value x do\n if x.frames fr.images:x.frames..copy[] end\n or.data: (range count x.frames) unless x.order\nend\non get_value do\n r.frames:frames[]\n r.order :order[]\n r\nend\n\non view do\n f:frames[]\n o:order[]\n c.border:cbo.value\n c.show:card.show\n c.draggable:cd.value\n c.clear[]\n if count f\n  i:f[o[(count o)%sys.frame/5]]\n  i:if fl.value i.copy[].transform[\"horiz\"] else i end\n  if get_stretch[]\n   c.paste[i 0,0,card.size]\n  else\n   c.paste[i .5*c.size-i.size]\n  end\n end\nend\n\non get_border do cbo.value end\non set_border x do c.border:x cbo.value:c.border end\non get_stretch do cst.value end\non set_stretch x do cst.value:x end\non get_frames do fr.value end\non set_frames x do fr.value:x end\non get_order_text do \",\" fuse order[] end\non set_order_text x do or.data: 0+\",\" split x end\non get_animate do view end\non get_flip do fl.value end\non set_flip x do fl.value:x end\non get_emotes do em.data end\non set_emotes x do em.data: x end\non set_emote x do or.data:() unless get_emotes[][x] end\non get_draggable do cd.value end\non set_draggable x do cd.value:x end\n","template":"on click do\n \nend\n\non drag do\n \nend\n\non release do\n \nend","attributes":{"name":["border","draggable","stretch","frames","order_text"],"label":["Border","Draggable","Stretch to Fit","Frames","Frame Order"],"type":["bool","bool","bool","rich","string"]},"widgets":{"c":{"type":"canvas","size":[100,100],"pos":[0,0],"locked":1,"animated":1,"volatile":1,"script":"on click pos do\n card.event[\"click\" pos]\nend\non drag pos do\n if get_draggable[]\n  card.pos:pos+(pointer.pos-pointer.start)\n  me.pos:0,0\n  card.event[\"drag\" pos]\n end\nend\non release pos do\n if get_draggable[]\n  card.event[\"release\" pos]\n end\nend","border":1,"scale":1},"fr":{"type":"field","size":[100,20],"pos":[0,-77],"locked":1,"show":"none"},"or":{"type":"field","size":[100,20],"pos":[0,-49],"locked":1,"show":"none","style":"plain"},"fl":{"type":"button","size":[60,20],"pos":[0,148],"locked":1,"show":"none","style":"check"},"em":{"type":"field","size":[100,20],"pos":[109,-49],"locked":1,"show":"none","style":"plain"},"cbo":{"type":"button","size":[100,20],"pos":[109,0],"locked":1,"show":"none","style":"check","value":1},"cst":{"type":"button","size":[100,20],"pos":[109,31],"locked":1,"show":"none","style":"check","value":1},"cd":{"type":"button","size":[100,20],"pos":[109,61],"locked":1,"show":"none","style":"check","value":0}}}}}

This might also work for what you're doing.

( your project is looking amazing!)

thanks so much!!! also my friend figured out a workaround using Some Kind of Wizardry but it had to do with how I was implementing jankytunes? I want to both have looping bg animations And on-click animations. I think the workaround? was to use millies play across cards thing but to fix a few bugs I had in my implementation. 

that makes sense about sleep!! 

ty for ur support, I  hope to share this game at the end of the month for the decker jam! 

Hi, just want to check what the issue with jankytunes was here - was it just that it paused when the script was in "sleep" mode or was it something else?

There are some tricks you can do, like writing a little loop in the code where, instead of sleeping for 60 frames, it calls the animation bits and then sleeps for 1 frame, 60 times. I think in lil you'd use like an "each x in range 60" thing to do this? But you'll probably want to read the lil doco for more details.

It sounds like you got it sorted out though?

yes! that's the issue, it's paused when the script is in sleep mode. (actually the workaround didn't end up working, so i'd love some more help with it, i'll dm you on discord

(+2)

For the benefit of others in the thread, this is what I suggested

each x in range 60
 #do the thing that you need for the animation
 sleep[1]
end
(+3)

and it worked like a charm!! :3

(2 edits) (+2)

To de-mystify a little, when Dialogizer is displaying a dd.say[] modal, it's doing something similar to the following:

while !pointer.down
 blink_cursor[]
 deck.card.event["animate"]
 sleep[1]
end

The "animate" event which is being sent to the current card provides the opportunity to make other things happen while the dialog box is idling and waiting for user input. Puppeteer uses this hook to animate puppets, and it can be used to give other modules and contraptions a chance to do their thing as well.

Any "blocking" scripts you write yourself can use a similar approach; a synchronous animation script becomes responsible for explicitly routing the events to everything that needs to do work on every frame, whereas an asynchronous script allows Decker to handle some of that plumbing automatically.

(+1)

thanks!!! :0

(+2)

Just in case it helps, the Decker reference manual has a section about scripted animation that describes "synchronous" vs. "asynchronous" approaches and the tradeoffs therein. I also recently wrote an article about making action games in Decker that talks about similar issues through a more practical/applied lens.

thanks!!!!!