You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The oncreate event of a copy is called before the oncreate event of the room. According to the documentation it should be the other way round
To Reproduce
Steps to reproduce the behavior:
Create a game with Catnip
Create a room
Add a 'Room start' event
Add a "Log to console" block with the parameter 'room'
Create a sprite template
Add a 'Creation' event
Add a "Log to console" block with the parameter 'copy'
Place a copy of the template in the room
Launch the game
The debug console shows 'copy' and then 'room'
Expected behavior
The output should be 'room' and then 'copy'.
System information report
Ct.js v5.2.1 😽 (packaged)
Well, I'm not changing the execution order as it will break projects, so it is a documentation issue instead. Rooms' Creation event runs after copies are created, and it had been this way for a couple years now.
I was trying to initialize some global variables, which the copies need. Is there a way to start a Catnip script before the room and copies are created?
If you need to do something at the start of the game, you can use custom scripts in the Project tab, or use Script asset type and mark them to run on game start.
Describe the bug
The oncreate event of a copy is called before the oncreate event of the room. According to the documentation it should be the other way round
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The output should be 'room' and then 'copy'.
System information report
Ct.js v5.2.1 😽 (packaged)
NW.JS v0.72.0
Chromium v109.0.5414.87
Node.js v19.3.0
Pixi.js v7.3.2
WebGL available
WebGL vendor Google Inc. (NVIDIA)
WebGL renderer ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 Direct3D11 vs_5_0 ps_5_0, D3D11)
OS win32 x64 // Windows_NT 10.0.22621
The text was updated successfully, but these errors were encountered: