Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(3 edits)

hey ij!

is there a way to write a single line of command to copy and paste more than one widget from one card to another?

i have widgets X, Y and Z stored in card A, and so far i can import each of them separately to card B by writing

card.add[deck.cards.A.widgets.X]
card.add[deck.cards.A.widgets.Y] 
card.add[deck.cards.A.widgets.Z]

but i can't really nail a way to import all three of them with a single line (unless i call all three lines with an .eval[]).

i saw in the decker manual that you can use the .add[] command to import a list or dictionary of widgets from another card, but i don't see how.

thank you!

( 4)

Hi, I'm not IJ but I did some experimentation and I think I've figured it out - it seems the card.copy and card.paste commands let you copy multiple widgets at once.

So you'd do like this:

card.paste[A.copy[A.widgets.X,A.widgets.Y,A.widgets.Z]]

(As a side note, if you're referring to a card in a script you can just use the card's name, you don't need the deck.cards in front of it)

Let me know if this works for you!

( 1)

oooooooooo!!! thank you so much, millie! i'll try as soon as i can!

( 1)

worked like a charm <3 thank you once again!

( 4)

Just to build on this, if the only widgets on card A are X, Y, and Z, you can copy them all with:

A.copy[A.widgets]

And here's one other slightly more concise way to select a bunch of widgets by name:

A.copy[A.widgets @ "X","Y","Z"]
( 1)

i learned so much today!