I don’t like to ask questions about completely different libraries developed independently by 2 (fantastic) developers, but I’m really confused about this and I feel like the problem I’m having may lie in my misunderstanding of the way collections and collection proxies work.
OK, so here’s my basic setup. I have more folders but I’m only showing the 2 relevant folders, game and main. The game folder holds everything needed to run game.collection which is also located inside the game folder. The main folder contains folders for each collection with collection proxies and other stuff as well as a main script to navigate to a specific collection.
game (folder)
|___ bullet
|___ enemy
|___ joystick
^^^ (these folders contain respective game objects)
|___ player
|___ player.go
|___ player_sprite
|___ player_script
|___ camera.script (reference to camera.script in rendercam folder)
|___ bullet_factory
|___ basic_collisionobject
|___ game.collection
|___ camera.go (reference to camera.go in rendercam folder)
|___ game.go (contains factories for spawning some stuff as well as the GUI and some other stuff)
|___ player.go (reference to player.go in player folder)
main (folder)
|___ main.collection
|___ main.go
|___ main.script
|___ game.go
|___ game_collectionproxy (linking to game.collection)
|___ screen.script (reference to screen.script in monarch folder)
That’s the basic setup. The two libraries I’m using are Monarch by @britzl and Rendercam by @ross.grams.
Here’s my problem -
When I have my bootstrap collection pointed to game.collection, everything is working perfectly. The game opens up in game.collection
and game.script
gets run. game.script
calls rendercam.follow("player#player", false)
. This tells the camera to start following the player. The camera works as it should and there are no errors.
But I want to open in main.collection
and then open game.collection
from main.script
. When I set up my bootstrap collection in game.project
to be main.collection
, main.script
successfully opens game.collection
but the input doesn’t seem to be working. (the 2 joysticks I have aren’t working) The on_input
function never gets called when I click or drag. (all this worked fine before)
I get a bunch of errors -
ERROR:SCRIPT: /rendercam/rendercam.lua:239: ERROR - rendercam - NO ACTIVE CAMERA!
stack traceback:
[C]: in function 'error'
/rendercam/rendercam.lua:239: in function 'calculate_view'
/rendercam/rendercam.render_script:31: in function </rendercam/rendercam.render_script:29>
ERROR:SCRIPT: /rendercam/rendercam.lua:239: ERROR - rendercam - NO ACTIVE CAMERA!
stack traceback:
[C]: in function 'error'
/rendercam/rendercam.lua:239: in function 'calculate_view'
/rendercam/rendercam.render_script:31: in function </rendercam/rendercam.render_script:29>
ERROR:SCRIPT: /rendercam/rendercam.lua:239: ERROR - rendercam - NO ACTIVE CAMERA!
stack traceback:
[C]: in function 'error'
/rendercam/rendercam.lua:239: in function 'calculate_view'
/rendercam/rendercam.render_script:31: in function </rendercam/rendercam.render_script:29>
ERROR:SCRIPT: /rendercam/rendercam.lua:239: ERROR - rendercam - NO ACTIVE CAMERA!
stack traceback:
[C]: in function 'error'
/rendercam/rendercam.lua:239: in function 'calculate_view'
/rendercam/rendercam.render_script:31: in function </rendercam/rendercam.render_script:29>
ERROR:SCRIPT: /rendercam/rendercam.lua:239: ERROR - rendercam - NO ACTIVE CAMERA!
stack traceback:
[C]: in function 'error'
/rendercam/rendercam.lua:239: in function 'calculate_view'
/rendercam/rendercam.render_script:31: in function </rendercam/rendercam.render_script:29>
ERROR:SCRIPT: /monarch/monarch.lua:364: /monarch/monarch.lua:156: Could not send message 'transition_show_in' from 'controller:/game#game_screen' to 'game:/go#game'.
stack traceback:
[C]: in function 'assert'
/monarch/monarch.lua:364: in function 'on_message'
/monarch/screen.script:32: in function </monarch/screen.script:19>
So it seems the main problem is the first error - no camera found. Does the reference to camera.go
need to be in main.collection
? I tried doing this but it didn’t change anything. I’m not sure if the input problem is a separate problem or it has to do with the buggy code. I’m really confused and I would appreciate any help.
Thanks for reading this. Hope to hear somebody’s thoughts/suggestions.
I really need this camera/screen-transition bug fixed before I move on to adding pages for a shop and inventory.