In auto factory, a function needs to know the variables from live_game (including eco and some others, model.maxEnergy, model.maxMetal etc), and the status of a toggle I put in live_game_options_bar. Before the last big patch it worked because the options bar was not in its own scene. I moved the toggle code from the object in live_game to an object in live_game_options_bar to get it working with the new scene: Code: var tAutoFactory_op_bar = (function () { var tAutoFactory_op_bar = {}; tAutoFactory_op_bar.active = ko.observable(true); return tAutoFactory_op_bar; })(); (function () { //visible to knockout model.tAutoFactory_op_bar = tAutoFactory_op_bar; //add toggle to ui $(".div_ingame_options_bar").prepend("<div class=\"btn_ingame_options div_af_toggle_cont\"><a href=\"#\" data-bind=\"click: function () { model.tAutoFactory_op_bar.active(!model.tAutoFactory_op_bar.active()) }\"><!-- ko if: model.tAutoFactory_op_bar.active() --><img src=\"coui://ui/mods/tAutoFactory/live_game/af_on.png\" /><!-- /ko --><!-- ko ifnot: model.tAutoFactory_op_bar.active() --><img src=\"coui://ui/mods/tAutoFactory/live_game/af_off.png\" /><!-- /ko --></a></div>"); })(); Unfortunately, coherent doesn't magically allow the tAutoFactory object in live_game to see the tAutoFactory_op_bar object in live_game_options_bar. How can this be solved?
A scene is a separate process (there is what, 30-some of them during play now) I've not noticed any any abstraction in the code that attempts to put a facade over that fact. (Might be an interesting ko extension) You're going to have to send messages and set up handlers, just like every other scene in the game.
Awesome, thanks for the quick responses. It seems it's time to learn how to use handlers. They look pretty easy actually, I've skipped them so far in my how to bodge through javascript adventures