Hello! This looks like a charming game already.
When you want to create a variable in decker to be referred back to later you need to store them in a widget. A temporary variable can be created within a specific script while it's running, but these temporary variables aren't stored anywhere and can't easily be edited unless you put them inside a widget.
But it's pretty easy to do exactly that!
For things where you want to track true/false (has the flower been picked?) a checkbox-style button is really useful. If you created a checkbox called "pickedflower" and gave it the value 1 like this:
pickedflower.value:1
.value means different things for different widgets, but generally it refers to the kind of information stored in them. I'll keep it simple and say that in the case of buttons (including checkboxes) they can only store a boolean 0/1 (false/true) as their value.
To check this value in your if statement you can write it like this:
if pickedflower.value # the rest of your script here end
But... since the checkbox is a widget that will live on a specific card, you'll need to put it somewhere.
From what you explained about your game you want to set the variable while picking up the flower on one card... and then check the variable on another card later to give the flower to someone later, right?
So we also have to talk about how to refer to a widget that's on another card.
If the "pickedflower" checkbox lived on a card called "garden", you could refer to it this way on your scripts, when you need to refer to it's stored value from other cards:
garden.widgets.pickedflower.value
It's a little long to write it like this, but I think that's okay when you only have a couple things to check. If you have a lot of things to track, let me know and I'll come up with some suggestions for how to store them and refer to them more easily!
Also, you can set your checkbox to show:"none" and it'll be completely hidden to your player.
Or you can store all your game state-related widgets on a card that the player never sees (I recommended this if you have a lot of them!)
Optionally, if you don't want to store a variable this way at all... there's other ways to do something similar.
For example: you can check the current visibility of your flower canvas to see if it's been hidden or not:
if theflower.show="none" # something that happens only if the flower's canvas is hidden end
And you can also lock a button if you no longer want it to be clickable.
thebutton.locked:1
If you do this make sure to add unlocking it (thebutton.locked:0) to your reset button too.
I'm happy to explain more if it would be helpful. But I wanted to get an answer for you quickly so you could get started playing around with it.
THANK YOU SM! As long as I can tell right now it works in different cards!