Babylon3D: Standard Edition

1 favourites
From the Asset Store
12 unique hits, slashes and spells in transparent PNG sequences
  • Can you please provide and example (capx) explaining how you make several clones of a sprite by calling their names?

  • Can you please provide and example (capx) explaining how you make several clones of a sprite by calling their names?

    was about to do that when i posted but had to leave... il do it now il edit this post here.

    edit: here is the capx of 1 sprite duplicated 10 times, and set on a everytick condition to move up or down,

    as comparing with NewMesh object the Babylon plugin has, each new clone of the sprite in C2 act independently, while in Babylon the newmesh if is duplicated, they dont, unless we place them on screen manually and rename them 1 by 1 by hand. or by using the clone mesh array.

    other plugins that do 3d are acting similar as C2 sprite, is not something that isn't possible to do.

    Plus as i said, you already made it in the properties list, so its just a matter to give it a expression. it should be possible, since its already implemented like 99% .

    the only thing you are missing is giving the new duplicate a new name or pick it by the iid instead of meshname ? im not sure how sprites are picked by C2 Ashley could clarify that, better.

    but its way easier to just create 10 -100-N numbers of the same object with system create expression instead of using a clone mesharray then use that as a placeholder then run a index loop to control those clones... which are limited by the loopindex its running trough.

    P.S when i said calling the duplicates i meant i dont need to call their individual name, but the sprite object that is the name that should count for all. in C2 all objects have IID which is individual index value of the same type object, while uid is just a order that is spawned collectively with other types of objects.

    when u create the same sprite 10 times, C2 picks each duplicate by its own IID i guess as being a entire entity, and then picks all Sprites named Sprite, as a family group if im not mistaken, its something same group type of object type of thing, if you understand what i mean, i can get confusing in writing.

    Also i think this 2 manual articles are explaining the best how C2 Sprites work, and what drives the individual clones to act independent.

    Object Types And Sprite

    And a quote entry from object types.

    [quote:33qtfy6o]

    Events are made to apply to an object type. The event then filters the instances that meet the condition. For example, the event "Bullet collides with Alien" is an event that applies to all instances of the Bullet and Alien object types. However, when the event runs, the actions only apply to the specific instances involved in the collision.

  • Again, in your example you are not choosing which sprite to move by its name . So whats the point of cloning a sprite if you cannot access the clone you want ? You let C2 grab whatever sprite and change its position.

    To be clear: You cannot go to the event and choose Sprite 5 -> and then apply whatever action to it , But using my method, you can do that easily with the MeshArray.

    I want a capx where you clone a sprite and access several clones.

  • Again, in your example you are not choosing which sprite to move by its name . So whats the point of cloning a sprite if you cannot access the clone you want ? You let C2 grab whatever sprite and change its position.

    To be clear: You cannot go to the event and choose Sprite 5 -> and then apply whatever action to it , But using my method, you can do that easily with the MeshArray.

    I want a capx where you clone a sprite and access several clones.

    yes but the capx i did, if i do the same thing for Babylon3d objects they dont act like that. that is what i meant. i can pick each same sprite by the iid. if i want without having to rename them they all have a different id or name in their own sort. let me do another capx.

    here is the new capx

    notice how i didn't had to rename none of them. if u do this in babylon the new duplicates wont react at all. i tried it didn't work. only the 1st instance created reacts the rest are just like unpickable objects or just canvas draws that are not objects. even if you set the pickable enable.

  • For now, the New plugins and the SLE plugins can be used together since they are following the same naming system , for example you can use a MeshArray plugin in both a scene created from scratch or in a loaded scene. This is the biggest advantage of the name expression.

    But, what you are requesting can be done if I ditch the naming method and let C2 name the meshes like this : "Mesh"+this.uid

    Therefore you could pick any mesh by its UID. BUT, fromnow on , in case you all agree to ditch the name expression and to allow picking meshes by UID , you should know that you will not be able to use different plugins in the same projet anymore.

    So its either : C2 names the meshes so you get to pick them in event OR you name them and you get to pick them by name.

    I know that so many things will not be possible to do anymore if I change to UID instead of name. So I won't take any responsiblity for this.

  • well personally i like how you did the naming pick, im not saying that, i was just asking if is possible, to implement1 expression/function what ever is it called im not js coder?

    that sets the newmesh.name when we create newmesh 10 times set name to box&loopindex or something. couldn't that be solved like that? or atleast giving a try see what complications are ? maybe you overthinking the implementation?

    btw im not trying to offend you in anyway what so ever.

    was just trying to understand if is possible if not, no biggie, you call the implementations not us.

    we just suggest, if its to big of a hustle or by implementing it drops other features that are cool, then dont.

    P.S we dont request the ditch of naming, u understood wrong.

    we where requesting to have the ability to set the newmesh.name by calling "set name" lets say using events if i create 10 instances of the same object.

    i hate forum posting, talking with voice is so easy to make urself understood.

  • I was not offended in any way lol !?!? Yes ofcourse I'll add it in 0.6.

    Is there any other requests ?

  • I was not offended in any way lol !?!? Yes ofcourse I'll add it in 0.6.

    Is there any other requests ?

    was thinking maybe i got to harsh in typing or something or got you the impression i was pushing it to far i apologize if i did that, wasn't intended, im actually "coolio" .

    as for implementations or request not that i can think of, no.

    maybe 1 thing... babylon audio plugin and ffx effects ? that wold be dope real 3d audio placement in C2

    playing audio at object in 3d coordinates id be jamming all day )

    but maybe that is in the future plans

  • X3M Yesterday i worked on debug various things and maybe i found the problem, or one of the problems.

    When you clone a mesh using events you only clone the mesh in the 3D scene not the NewMesh.object that C2 can manage a thing that happens with Sprite.Objects. If you do a lot of mesh clones using events you only will access to the objects you created in the C2 layout(That have a name, UID, instances,etc..) but not the ones you cloned in realtime because this ones not have an UID to be accesed, instances or whatever C2 can control and assign actions.

    So, when we use the event "Clone mesh" and set a name , Babylon3D have also to create a NewMesh.Object and add the name in the properties , in the same way the Sprite.Objects does when in events you create an object, "spawn another object" etc... if not we can't manage this mesh using events because C2 not have idea this one exists, only exists in the Babylon scene render.

    Or maybe i'm wrong?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yesterday i worked on debug various things and maybe i found the problem, or one of the problems.

    When you clone a mesh using events you only clone the mesh in the 3D scene not the NewMesh.object

    ................

    if not we can't manage this mesh using events because C2 not have idea this one exists, only exists in the Babylon scene render.

    Or maybe i'm wrong?

    not really, you clone both just when they are cloned they are not linked as 1 object. that is why the visual object clone is not reacting. unless u set the name in the properties. which you cant since the function "set name" cant be called by event expression.

    but im waiting for the version 0.6(because atm its a to big hustle to clone 1000 items and move them around, and i dont want to visual place 1000 objects in the editor and rename each of them and then add extra variables to each of them by hand), but maybe things will work as we where thinking. and maybe Babylon3d will also get to keep its current behaviors and effects.

    In response to the 2nd worry u had, i dont think that is a issue, C2 not being able to know if the object exists... as a example Q3D does exactly what we are talking about 3d objects that are cloned dont use mesh arrays, they act like the normal C2 sprites there is no need for extra names or id's.

    And if ur thinking well is different... i dont think Three.js is to big of a difference from Babylon.js both use a variety of libraries inside and the one that renders the 3d object is the same. so it should be possible for Babylon also to be able to replicate the Sprite object recognition. unless X3M made a core build that object picking is to hard at this point in development to change, unless he re-codes everything. which wold be a big delay and extra work.

    As i seen in the common.js and runtime... the newmesh is picked mainly by the mesh.name and if a same name object exists then the new one doesn't get pick if i remember correctly there is a comment in runtime where it says "no need to duplicate", but might not be related.

  • So, when we use the event "Clone mesh" and set a name , Babylon3D have also to create a NewMesh.Object and add the name in the properties , in the same way the Sprite.Objects does when in events you create an object, "spawn another object" etc... if not we can't manage this mesh using events because C2 not have idea this one exists, only exists in the Babylon scene render.

    X3M How about "New Mesh Array" for "New Scene" object?

  • [quote:dfvjqorl]not really, you clone both just when they are cloned they are not linked as 1 object. that is why the visual object clone is not reacting. unless u set the name in the properties. which you cant since the function "set name" cant be called by event expression.

    X3M can you tell us if the NewMesh.Object is also cloned on "Clone Mesh" or only the 3D object in the Babylon Scene Render?

    No in my tests, Using the Babylon action of "Clone Mesh" The NewMesh.objects are not cloned only the objects in the 3D scene of the Babylon render.

    Create a NewMesh object, set clone mesh in events 10 times. Then add a textbox that on press any key show NewMesh.Count. This will show one, because you only have one object created that C2 can handle without Babylon3D action/functions, but in the render you will see 10 mesh objects, one that C2 can manage because exist internally with their UID etc... and the others that only exists in the 3D render that are invisible for the C2 native functions.

    About the second thing, i'm not saying is a issue, i'm saying that we can't do all that because C2 don't know that exists, Q3D can have it in the same way, but we are not doing another Q3D, i want Babylon3D be much more in all ways and have a great potential to be, just i can't believe there is no way to manage mesh.objects like sprite.objects without mesh arrays, set names and other stuff

  • fuego96 Yes that is going to done

    matriax Well the thing is, I can make the System->Create object compatible, but this would make a lot of features that depend on Name expression non functional. And making it would mean rewriting the new plugins all over again.

    Currently I'm going to add the Change name function, 3D sound plugin and New Mesh Array so that instead of cloning, you will just have to create new meshes 50 times for example by only one NewMeshArray, here is an explenation :

    NewMeshArray

    Box[1-50]

    Distance between clones : 0,50,0

    Var X = 0;

    Var Y = 20;

    Var Z = 0;

    NewMeshArray-> Translate by( Suffix ID: 21, X,Y,Z); // Translate the mesh Box21 by 20 on Y axis.

    This will make everything much clear and simple, you wont have to make 50 New Mesh instance on the C2 Editor.

    But for now, I need to verify each plugin and add all remaining functions that I left and also retest everything.

    So 0.6 will take some time to finish.

  • Create a NewMesh object, set clone mesh in events 10 times. Then add a textbox that on press any key show NewMesh.Count. This will show one, because you only have one object created that C2 ...

    <object>.Count

    .Count is a C2 method which can only count the objects that exist in the C2 application/variable scope.

    When cloning multiple meshes from a NewMesh source, a duplicate of that model/mesh is created in the NewScene (BabylonJS scope). That mesh may have a C2 reference, but NewMesh.Count's .Count method, which is strictly a C2 method, will not be able to introspect the "New Mesh" object for any count information until some additional coding is done.

    The real quesion for X3M is, can the .Count method be overridden with a BabylonJS implementation (without affecting C2.Count operations) OR a New Mesh.MeshCount method be created?

    X3M, Correct me if that's not the right concept.

  • X3M Thanks for the reply to the NewMesh Array question.

    Hey, will there ever be a "Mesh" collider implementation? I'm trying to do particles (like raindrops) bouncing off an umbrella. The umbrella being curved is a big challenge when all i have are boxes and (perfectly round) spheres as colliders. No rush, just asking.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)