Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+2)

Hi! Probably basic question incoming, but I’m stuck…

I’m trying to track whether the player is wearing a cloak to display certain widgets or to send them to a specific card. I’ve created a checkbox for this, and when manually clicked on/off, the conditionals are tracked properly.

The issue I’m running into is that I can’t seem to change the value of that checkbox via Lil directly. As in, if the player click the Start button, the checkbox is enabled (because they wear the cloak at the start of the game), and if the player clicks the button “Hang Cloak”, the checkbox is disabled. Or it should be.

~~So far, I’ve tried:

Cloakroom.widgets.WearCloak.value:true

and

Cloakroom.widgets.WearCloak.value:true
Cloakroom.widgets.WearCloak.event["change" Cloakroom.widgets.WearCloak.value]

~~ I feel like I’m missing something but I don’t know what/how… EDIT: I FOUND THE ISSUE! I wrote true instead of 0/1….

Also, follow up question: if the display of the checkbox is “Invisible”, is the value of the Checkbox still accessible? (If not, I’ll just hide it behind some text :P )

Thanks in advance!

(3 edits) (+2)

As a follow up, I’ve tried creating variables too, but it didn’t work either.

I’m trying to make an invisible counter tracking the amount of time a player visited a card (and could be reset), so like a numerical variable…

EDIT AGAIN: Counters. That’s how it works. then add +1 to the text. Got it.

(+1)

Just for the record, you can represent counters using a field widget via its .text or .data attributes, or alternatively you could use a slider widget via its .value attribute. Sliders are slightly more convenient than fields for representing numeric values within a known range, since their .value is always a number and is automatically "clamped".

Widgets set to "Show None" behave identically to visible widgets from a scripting perspective; they "remember" their contents across events and when the deck is saved. If there are any widgets whose contents you don't want preserved, you can mark them as Volatile. Sometimes volatile widgets are useful for "resetting" the state of a game.

Does that help clarify?

(+1)

It does! Thanks a lotT