chunchun's Recent Forum Activity

  • It would be great if it was available!

  • I've been experimenting with different theme skins recently, and I want to see what you use.

    Hoping to get some inspiration.,I am using proui now .

  • 1. I may be wrong, but I think currently scene graph only works with sprites.

    Maybe you're right.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1.When I add text as a child to the parent, text disappears 。

    2.At the beginning of the scene, I bound some objects to the parent object 【A】. When I click with the mouse and recreate 【A】, I can only create a separate a without any child objects.

    I tried to use the container. When I recreate [A], all the sub-objects are at the center of a. This is not what I want.

    I hope that when I bind a parent-child relationship, the positions of all child objects will be fixed and unified when I recreate them.

  • Hello,

    every script you create in the Construct 3 Scripts Folder is accessable everywhere in the runtime. So you could do something like this on your "Startscript".

    1. Create a global variable to store the current active layout.
    2. Add an event listener and a corresponding function to every layout.
    3. In the Tick function call your layout Tick functions and check if the current layout is active.
    4. The onbeforelayoutstart functions and the specific Tick functions are in their corresponding layout script files.

    > let g_currentLayout = "Layout 1";
    
    runOnStartup(async runtime =>
    {
    	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
    });
    
    async function OnBeforeProjectStart(runtime)
    {
    
    	runtime.getLayout("Layout 1").addEventListener("beforelayoutstart", () => onBeforeLayoutStart_Layout1(runtime));
    	runtime.getLayout("Layout 2").addEventListener("beforelayoutstart", () => onBeforeLayoutStart_Layout2(runtime));
    
    	runtime.addEventListener("tick", () => Tick(runtime));
    }
    
    function Tick(runtime)
    {
    	if(g_currentLayout == "Layout 1")Tick_layout1(runtime);
    	if(g_currentLayout == "Layout 2")Tick_layout2(runtime);
    }
    

    Here is a possible project structure:

    On every layout script page you now have:

    > function onBeforeLayoutStart_Layout1(runtime){
    	
    }
    
    function Tick_layout1(runtime){
    
    }
    

    Hope this helps.

    Hello! Now we have another problem. If I have several pages, they are all on the same layout. I want to add "start" and "tick" to every page. The above method can satisfy that each page corresponds to one layout, but what about multiple pages corresponding to one layout?

    If I use the above method, add a listener to each page, just change the name of the function behind, it feels too troublesome.

    Is there a way to declare a layout listener that can be placed on multiple page pages?

  • Hello,

    every script you create in the Construct 3 Scripts Folder is accessable everywhere in the runtime. So you could do something like this on your "Startscript".

    1. Create a global variable to store the current active layout.
    2. Add an event listener and a corresponding function to every layout.
    3. In the Tick function call your layout Tick functions and check if the current layout is active.
    4. The onbeforelayoutstart functions and the specific Tick functions are in their corresponding layout script files.

    > let g_currentLayout = "Layout 1";
    
    runOnStartup(async runtime =>
    {
    	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
    });
    
    async function OnBeforeProjectStart(runtime)
    {
    
    	runtime.getLayout("Layout 1").addEventListener("beforelayoutstart", () => onBeforeLayoutStart_Layout1(runtime));
    	runtime.getLayout("Layout 2").addEventListener("beforelayoutstart", () => onBeforeLayoutStart_Layout2(runtime));
    
    	runtime.addEventListener("tick", () => Tick(runtime));
    }
    
    function Tick(runtime)
    {
    	if(g_currentLayout == "Layout 1")Tick_layout1(runtime);
    	if(g_currentLayout == "Layout 2")Tick_layout2(runtime);
    }
    

    Here is a possible project structure:

    On every layout script page you now have:

    > function onBeforeLayoutStart_Layout1(runtime){
    	
    }
    
    function Tick_layout1(runtime){
    
    }
    

    Hope this helps.

    This is great!!!!!!!!~~~~~~~~ Thank you!!!!!!!!, brother! That's exactly what I want! Thank you for your careful answer!

  • > I think when you click on the object-based layer, you can also run it separately to preview the current object-based layer. No connection with other layers and game scenes

    Layer, or layout? I don't see where you would want to preview every scene graph on that layout.

    There should be an option to run an individual scene graphs animation like we can view objects animations in the editor.

    Then an option/checkbox to not run an asset object layer sounds like it would solve everything.

    Sorry, typing error, it's Layout!

    I think when you click on the object-based layout, you can also run it separately to preview the current object-based layout. No connection with other layers and game scenes.

    I think a similar animation editing window is also good. Or a separate window that can be edited and previewed. (can modify, view layers and layers, can preview).

    In addition, I think the event table should provide a way to accurately filter out the child objects under the parent object. Just like the container does now. (it will be more complicated, because there may be sub-objects under the sub-objects, and the hierarchical relationship will be more complex. I hope to be able to accurately select(pick) all the sub-objects

  • > Make sure that if you go to that layout just to edit something it doesn't run that layout...

    By this logic, when you switch to a layout you do want to preview, it won't run that layout either.

    I think when you click on the object-based layer, you can also run it separately to preview the current object-based layer. No connection with other layers and game scenes

  • Currently, there is only one tick and OnBeforeLayoutStart,. I want to put the function into them. I can only go to the first js page and put it in.

    How can I have a tick and OnBeforeLayoutStart, in every page without affecting and covering other pages?

    I've written a lot of methods in class that ready and update, correspond to c3 tick and OnBeforeLayoutStart.

    But there is only one tick and OnBeforeLayoutStart function. This allows me to put all the things I need to call in the only one.

  • My advice is to check out how Prefabs work in Unity.

    I believe that's pretty much what we all want from this scene graph feature.

    I agree with this view. The Prefabsof UNITY and the NODE of godot are good references.

  • > Thanks for making this, it's interesting to get a better idea of how people imagine the scene graph working.

    >

    > I like the approach of having a hierarchy bar that shows all the connections as a tree.

    >

    > At the moment the proposed way of treating "scenes" like "object types" is awkward to fit in to Construct's current architecture. An object type is something that directly has instances, variables, behaviors, picking capability in events etc. itself, and scenes don't seem to be quite the same kind of thing as that, so I think it would be better to approach that differently. Perhaps there could be a separate view that shows all objects at the root of a graph, which is what a "scene" appears to basically be.

    >

    > The scene editor also seems to duplicate a lot of what the Layout View does - it seems to make sense to me to just do all that in the Layout View directly.

    I want to be able to filter out all the objects under the tree structure through the parent object.

    For example, if A collides with B, let A> A1 > aa change the transparency. Let A > a2 > a_text.text= "dmg"

    I think it is very important to be able to accurately select the required child objects under the parent structure.

    In many games, the enemy's head will have <a blood bar>, and the top of the blood bar is the <text> of the blood bar (100 /100). Then these can be used as children of the enemy. When the player collides with the enemy, it can accurately change the blood bar and text on the enemy's head. (that is, the blood strips and words on the enemy's head can be changed based on the enemy's own variables. For example, hp_text.text=self.parent.hp;). It can select the variables of its parent object.

    This is the example I would like to cite.

    The parent object can easily obtain and change the variables or properties of the child object you want, and the child object can also obtain the attributes and variables of its parent object through self.parent.***.

    To put it simply, through child objects or parent objects, you can easily filter out any objects based on the tree and manipulate them.

  • Thanks for making this, it's interesting to get a better idea of how people imagine the scene graph working.

    I like the approach of having a hierarchy bar that shows all the connections as a tree.

    At the moment the proposed way of treating "scenes" like "object types" is awkward to fit in to Construct's current architecture. An object type is something that directly has instances, variables, behaviors, picking capability in events etc. itself, and scenes don't seem to be quite the same kind of thing as that, so I think it would be better to approach that differently. Perhaps there could be a separate view that shows all objects at the root of a graph, which is what a "scene" appears to basically be.

    The scene editor also seems to duplicate a lot of what the Layout View does - it seems to make sense to me to just do all that in the Layout View directly.

    I want to be able to filter out all the objects under the tree structure through the parent object.

    For example, if A collides with B, let A> A1 > aa change the transparency. Let A > a2 > a_text.text= "dmg"

    I think it is very important to be able to accurately select the required child objects under the parent structure.

    In many games, the enemy's head will have <a blood bar>, and the top of the blood bar is the <text> of the blood bar (100 /100). Then these can be used as children of the enemy. When the player collides with the enemy, it can accurately change the blood bar and text on the enemy's head. (that is, the blood strips and words on the enemy's head can be changed based on the enemy's own variables. For example, hp_text.text=self.parent.hp;). It can select the variables of its parent object.

    This is the example I would like to cite.

    The parent object can easily obtain and change the variables or properties of the child object you want, and the child object can also obtain the attributes and variables of its parent object through self.parent.***.

chunchun's avatar

chunchun

Member since 20 Jun, 2019

Twitter
chunchun has 1 followers

Trophy Case

  • 5-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies