I’m able to use transitions easily enough using a collectionproxy for the screen I want to show. However, if I use a collectionfactory, then because the collectionfactory has some unknown ID I can’t provide a URL to the factory for all use cases. Is there someway to accomplish this I don’t know of? If I use proxies then I am hitting the max world buffers even if I uncheck preload. The engine seems to count all of them against the limit prior to me loading them.
The Monarch documentation for Transitions mentions that you should use an id, not a url. The id should be the id of a script in your collection which can handle the transition messages.
Not that you should use the id you assigned to the script in the editor. Monarch will look up the generated if from the id assigned from then editor.
Hmm, I set the Id of a gui script this way:
Then in the main collection I’m using for the Monarch menus I have set the screen_factory.script with these values:
However no transition is shown. I’m probably misunderstanding what you mean by the script ID.
Sorry, I wasn’t clear enough. When collectionfactory.create() is called it returns a Lua table with a lookup between game object ids (set in editor) and generated ids for your instances. These are used to look up where to send transition and focus messages:
So you need to provide the full id of the game object containing the script. You can pprint(screen.factory_ids) or use the debugger if you’re uncertain of which id to use.
Thanks! It’s working great now. For anyone else confused, I edited monarch.lua to print the screen.factory_ids which showed this:
{ --[[0000020F85284C00]]
hash: [/go] = hash: [/collection1/go]
}
I then provided the screen_factory.script with the Id “/go” for both transition and focus. This solves the transition issue!
I know I marked as solved, but now I’m running into a more complex case. If I have one menu which constructs another menu as popup, then the hash: [/go] = hash … is still shown when I print the screen_ids. However, if I use the /go for the transition/focus URLs then the menu pops up without a transition and I can’t click anything within it. If I use anything else the window works as normal but still lacks transition effects. Is there some way to get the ID of a nested collectionfactory using screen_ids?
Not sure what the problem is in this case. If you can open a ticket in the Monarch repo and include a minimal repro case then I can take a look.