Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Sat Dec 10, 2016 9:01 am

gamecorpstudio wrote:
X3M wrote:Do you mean a Function or an Expression :
- Expression means : Alert(Mesh.Name)
- Function means : Set mesh name to ("Box")

Yes whatever that is I will add it.



Yea i meant Function... if that is the one that alters the Mesh Name.
something like the bellow image... i just cloned a function in the action common.js just its not linked to anything so errors all over the place.

Image

the above image should change the bellow value

Image


@gamecorpstudio You had the same conversation with X3M that i had days ago requesting the same action and talking about the same things.

I also requested be able to change the name of the mesh in that properties in the left tab using events, and in the same way i sent him some screenshots, but told me this was unable to do because something that how C2 manage that and is imposible change the name of a mesh in runtime.

In one of this conversations was born the MeshArray to at least to pick coins in one event, instead to create a pick event for every single coin(Coin001, Coin002,etc...) like in one of the early templates.

---

The big problem actually on Babylon3D is manage the duplicate/clone mesh objects and their instances that breaks totally the C2 workflow. Maybe we can't explain what exactly we want, or maybe the Babylon3D or C2 SDK plugin not allows the things we are requesting in the way we want, and this conversations always seems to go nowhere.

So, I suggest ask for help to @rexrainbow or @R0J0hound that are possible the most experienced members doing plugins for construct to fix this problem once in the best possible way.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sat Dec 10, 2016 12:30 pm

@matriax I am going to add the Change mesh name function, but be aware that the things you two wanna do are just not going to work.
I'm talking from the point of view of a coder.
Does C2 have a Sprite array plugin like the MeshArray ? I guess not ...
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Sat Dec 10, 2016 1:59 pm

X3M wrote:@matriax I am going to add the Change mesh name function, but be aware that the things you two wanna do are just not going to work.
I'm talking from the point of view of a coder.
Does C2 have a Sprite array plugin like the MeshArray ? I guess not ...


For us, we think like how C2 do the things with the sprite objects, their name, UID and the way that duplicate/clone and using family works, and the idea is have the same for 3D objects.

If you say the change mesh name will not works, then we have to think in other way to solve that. We all want the same. For that i said ask help for users with big experience on plugins, to see if there is any way to solve this problem.

In 2D if we duplicate the Sprite.Object in the C2 layout all they have the same name with different UID. In events if we said:
On Hero Colides with Sprite.Object > do something . Will be applied to all the instances of that Sprite.object that have all the same name but different UID.

But in 3D if we have 10 instances of the same object only will be applied to one Mesh.Object , the first one created because applies to the Mesh name in the properties. So we have to find a solution to manage 3D Mesh.Objects in the same way C2 do for Sprite.Objects.

For us the first thing come to our mind is the action to change the Mesh.Name. Because we can have a family that have a Coin.Object and when start do some "for each" and change their names automatically and then use that family to apply an action to all the instances. BTW, this is still more a patch than a solution.

The problem:
Seems in 3D every mesh object need to have a different name, even for an instance of the same object to apply some action.

Possible Solution
Some way that the mesh name of the 3D object is the name of the Mesh.Object we create in the C2 layout. For duplicate objects Internally set the mesh name as "Object.Name"+"UID". So every 3D mesh in runtime will have a different name, but in the C2 layout we only see the name we set on top of the left tab, as we have for Sprite.Objects.

And when we do an action on events related to a Mesh.Object this action will be applied to all instances of that Mesh.Object with their different UID.


We don't know how C2 exactly do that for Sprite.Objects and how do the same for 3D, for this reason i think will be a good idea ask for help to @rexrainbow or @R0J0hound that maybe they know how to fix this problem.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sat Dec 10, 2016 5:23 pm

i think now its a good time to give us some tutorials in screenshots or better in youtube, for step by step instructions (at least the basics ). it will promote the project better. And some tweets of the tutorials will give more publicity to your plugin and of course more incomes
B
18
S
3
G
1
Posts: 248
Reputation: 2,348

Post » Sat Dec 10, 2016 8:00 pm

X3M wrote:@matriax I am going to add the Change mesh name function, but be aware that the things you two wanna do are just not going to work.
I'm talking from the point of view of a coder.
Does C2 have a Sprite array plugin like the MeshArray ? I guess not ...



no C2 has no mesh array like plugin, but C2 has the sprites like this ... take for example sprite1 is duplicated... right? you dont have to call each sprite by a index... u just call the name of it acting like a container for all. like all are part of a familly. which is what we mean by being able to change the name of newmesh. if u want to understand better play a bit with the sprite object C2 has ul see what we are meaning by it.
B
70
S
20
G
67
Posts: 1,315
Reputation: 42,303

Post » Sat Dec 10, 2016 8:50 pm

@gamecorpstudio Can you please provide and example (capx) explaining how you make several clones of a sprite by calling their names?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Sat Dec 10, 2016 9:10 pm

X3M wrote:@gamecorpstudio 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.

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.
B
70
S
20
G
67
Posts: 1,315
Reputation: 42,303

Post » Sat Dec 10, 2016 9:35 pm

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.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Sat Dec 10, 2016 9:37 pm

X3M wrote: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.
B
70
S
20
G
67
Posts: 1,315
Reputation: 42,303

Post » Sat Dec 10, 2016 10:00 pm

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.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Demkamen and 3 guests