Skip to main content

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

fourmisant

2
Posts
A member registered 83 days ago

Recent community posts

Thanks for the quick response! Initially, I thought this might be that `home.widgets.frobnicate` is copied by reference, now I see that Interface values are more to this. They look more like modifiable "values" instead of "variable names", and after assigning them to a name, making changes to the attributes under that name actually interacts with the "value" instead of replacing it with a new one.

Hi! In this post, you mentioned that:

If we wanted clicking on chester to toggle frobnicate, we'd write a script for him like so:
on click do
 home.widgets.frobnicate.value:!home.widgets.frobnicate.value
end
Or, to be a bit less repetitive,
on click do
 f:home.widgets.frobnicate 
 f.value:!f.value
end

It seems that in this case, assigning to `f.value` actually modifies `home.widgets.frobnicate`.


However, when running this in the Listener:

x.a:1 x.b:2 x.c:3
show[x] # {"a":1,"b":2,"c":3}
y:x y.a:42
show[y] # {"a":42,"b":2,"c":3}
show[x] # {"a":1,"b":2,"c":3} still the same!

The behavior is different, `y.a:42` doesn't modify `x`.

Could you explain why?