Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

got it! Thanks for replying my flurry of questions and giving me leads to overcome my issues :)

I'm documenting my fix here, in case someone has similar needs.

1. Adding a template script.

I have created a view function in the prototype's template script, calling me.init[], the function that uses internal widgets to restore persistent data

on view do
  me.init[]
end

2. Exposing the inner init function.

The init function is located in the prototype's script, so it cannot be reached from a contraption's script. It has to be exposed by creating a get_x function in that same script

on init do
  # here should be some logic to restore persistent data
end
on get_init do
  # expose init function, so that it can be called from outside the prototype's script
  init
end

With these two changes: every contraption made from that prototype is created with that view function, which lets me send "synthetic" view events & the way these events are processed is still relying on the prototype's functions.