BabyJS Posted November 22, 2016 Share Posted November 22, 2016 I'm using Construct2(C2) for my games. A developer is doing a plugin to use Babylon.js that allow us do 3D games. This was my first test, it's not a big thing but for something we have to start: Here to play: https://kronbits.itch.io/proto3d Preview: - The actual plugin is a "Scene Loader". You do the level on a 3D editor and export the .Babylon file to C2. There you set camera controls and actions using events to do the game. One of the problems is how to solve the action for a group of duplicate mesh objects that have different name. Now, for every mesh we have to create an object on C2 layout, set the 3D name on editor and add all the properties or behaviours we want. The problem is, if the level have 100 coins, each coin have a different mesh name, so we will have to add 100 objects on the layout to set the behaviours or actions, which will be pain. The unique thing we made is more a patch than a solution, some kind of array on we set: Name: Coin Start of index: 0 Ending Index: 100 Padding: (true) So for a Coin and Coin001, Coin002, etc... until Coin100 will set the properties or behaviours or whatever but limit other options to other plugins and other stuff in C2. Also only will works for Blender and 3Dmax, the Unity nomenclature breaks this solution. Here are how the Duplicate models looks in the 3D Editors Babylon can be exported: Blender: Coin, Coin.001, Coin.002, etc... 3Dmax : Coin, Coin001, Coin002, etc... Unity5 : Coin, Coin(1), Coin(2), etc... Maybe there is a solution that we not found, or a Babylon function that solve this, but if not i want to make a request if is possible. Request for Babylon exporters: ------------------------------------------------------------ Add some kind of ID for all the objects, maybe "Babylon_Mesh_ID" or whatever that are the same for all the mesh with the same properties. Then for: Coin, Coin.001, Coin.002,etc... will have the "Babylon_Mesh_ID=COIN". So in the C2 we only will have to create an unique object that refers to "COIN" and add an actions like: On Player collides with COIN > Destroy COIN / Add 1 to COIN.Counter, etc... When the player collides with a mesh with the ID "COIN" will do the events/actions no matter the mesh name. No arrays, patch or other stuff. Is possible? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.