How can I check if a layout is 100% loaded?

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Custom Loading Icons to Enhance Your Loading Screens
  • How can I check if a layout is 100% loaded?

    Currently, I'm checking if any item from the layout is visible. Is there a more effective way?

    I've already tried the events: On End Of Layout & On Loader Layout Complete, but neither of them triggers when the layout is fully loaded so that I can perform actions.

  • As per layout-by-layout loading, when a layout starts, Construct has already loaded all the objects initially placed on the layout.

    If you dynamically create objects that are not initially placed on the layout, it's not possible for Construct to know when all of those have finished - after all, you could start such loads at any time. In that case it's up to your own event logic to determine when it's ready, such as by using the system memory actions.

  • thanks by u support Ashley

    I'm making an multiplayer game, which uses websocket.

    When I receive the message below, it causes the error

    js code using js :

     }else if (comando === "SetName") {
    
     const paramNicks = partes[1];
     const paramNickTeam = partes[2];
    
     const tempNickTeam1 = runtime.objects.player1nick.getFirstInstance();
     const tempNickTeam2 = runtime.objects.player2nick.getFirstInstance();
    
     console.log("nick = "+paramNicks);
     console.log("team1 = "+paramNickTeam);
    
     if (paramNickTeam == 1){
     tempNickTeam1.text = ` ${paramNicks} `; // LINE 187
     }else if (paramNickTeam == 0){
     tempNickTeam2.text = ` ${paramNicks} `; // LINE 189
     }
    
     }

    console error :

    javaScriptInEvents.js:189 Uncaught (in promise) TypeError: Cannot set properties of null (setting 'text')
     at WsMessager (javaScriptInEvents.js:189:32)
     at Authevents_Event8_Act1 (javaScriptInEvents.js:318:3)
     at C3.Action.RunUserScript (c3runtime.js:958:16692)
     at C3.EventBlock._RunActions_ReturnValue (c3runtime.js:918:11888)
     at C3.EventBlock._RunAndBlock (c3runtime.js:918:10848)
     at C3.EventBlock.Run (c3runtime.js:918:9650)
     at C3.EventSheet._ExecuteTrigger (c3runtime.js:913:6088)
     at C3.EventSheet._TriggerForClass (c3runtime.js:913:4265)
     at C3.EventSheet._Trigger (c3runtime.js:913:3959)
     at C3.EventSheetManager._Trigger (c3runtime.js:908:6223)
    
    javaScriptInEvents.js:187 Uncaught (in promise) TypeError: Cannot set properties of null (setting 'text')
     at WsMessager (javaScriptInEvents.js:187:32)
     at Authevents_Event8_Act1 (javaScriptInEvents.js:318:3)
     at C3.Action.RunUserScript (c3runtime.js:958:16692)
     at C3.EventBlock._RunActions_ReturnValue (c3runtime.js:918:11888)
     at C3.EventBlock._RunAndBlock (c3runtime.js:918:10848)
     at C3.EventBlock.Run (c3runtime.js:918:9650)
     at C3.EventSheet._ExecuteTrigger (c3runtime.js:913:6088)
     at C3.EventSheet._TriggerForClass (c3runtime.js:913:4265)
     at C3.EventSheet._Trigger (c3runtime.js:913:3959)
     at C3.EventSheetManager._Trigger (c3runtime.js:908:6223)
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's hard to tell from just that. You generally will need to share an actual openable Construct project for anyone to be able to help you. All I can say is it looks like tempNickTeam1 and tempNickTeam2 are null.

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