How do I update a different layout?

0 favourites
  • 7 posts
From the Asset Store
This music pack covers differents situations for visual novels, anime games and many more!
  • How do I update a different layout without loading the layout. I want to change objects in a different layout, but the changes don't seem to update until the layout is loaded.

    Is there anyway to force these updates?

  • What are you trying to change?

  • I want a variable that is triggered in layout 1 to spawn an object in layout 2.

    The problem I have is when the variable is triggered it only triggers once i actually load layout 2.

  • That is by design.

    Only a single layout "lives" in memory at a time, and objects on a layout are loaded when the layout is loaded.

    As soon as you go to a different layout, all objects/instances (except for those which are explicitly global in their properties) will be destroyed.

    It is still not clear what exactly you are trying to do.

    The big picture, "updating an object on a different layout" is the solution you decided was answering what you were trying to do.

    What are you trying to do exactly ?

  • I want to destroy an object in layout one, and for every object destroyed in layout 1, I want it to create the same amount of objects in layout 2.

    If you guys know of a way to do this differently than what I'm trying to do, I welcome all ideas.

    Right now I have a global variable, that when changed it adds an object to layout 2, but will only work once, and only when layout 2 is loaded.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You would simply keep a count of destroyed objects in a global value from layer 1. Then when you go to layer 2, using the ‘on layout loaded’ event you create the number of objects based off the number in the global value.

    Andy

  • You would simply keep a count of destroyed objects in a global value from layer 1. Then when you go to layer 2, using the ‘on layout loaded’ event you create the number of objects based off the number in the global value.

    Andy

    Appreciate the help guys! I set two variables (OLD, NEW)

    When I destroy the object in layout 1 I add to the OLD variable.

    Then when I move to layout 2 I use a REPEAT action to create an object,

    REPEATED (OLD - NEW) number of times.

    Then as each object is created it adds 1 to NEW.

    I do the reverse so I can move between layouts without creating or destroying extra objects.

    This is how I figured I could do it, let me know if you guys see any problems with this method.

    So far no bugs.

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