[Solved]External layout problem

Hey there, I stumbled upon an issue while loading external layouts to my main scene. I use different “checkers” to know what prefab the game should load next.

What is the actual result

There’s already a few external layouts fully loaded at 0;0, while the conditions aren’t even met. I have a scene variable called “Prefab” which has an initial value of 0 but a debugger text shows, it is already 2 from the very beginning.

Related screenshots

Sidenote: Is it normal, if I’m in an external layout and I can pick an instance on the screen, that isn’t even in the layout but only in the main scene? By right clicking on an object and choosing ‘Select instances on the screen’ command?

There’s a little quirk with creating from external layouts where the created objects aren’t available until the event is finished. If you want to delete RightChecker or DownChecker, then put the actions in a new event after the create from external layout event. Currently it’s in the the same event.


What do you mean by that? An external layout is just a file that defines where objects are placed. There’s no code behind or events linked to it. The external layout needs a base scene, and all objects in that scene are available to the external layout. The base scene has events associated with it.

There’s a little quirk with creating from external layouts where the created objects aren’t available until the event is finished. If you want to delete RightChecker or DownChecker, then put the actions in a new event after the create from external layout event. Currently it’s in the the same event.

I tried something like that, but it seems it isn’t the root of the issue. I deleted the ‘Delete object’ epressions altogether, and the problem is still there.
Clarification about the objects:

  • RightChecker is in the main scene, not in an external layout
  • DownChecker is in the ‘RightDown’ external layout

Now, I checked the official debugger and it says this:
GDevelopExtLayoutProb3

I know it creates DownDown objects(a map part) indefinitely (it’s not intended), but the thing is, the required conditions aren’t even met.
See the code below:


You know, it should only create objects from ‘DownDown’ external layout if the Prefab variable is 2 AND the X position of Character is larger.
I’m perplexed because if you check the debugger again, there is no DownChecker on the scene! And there is not any condition that deletes it. The main scene doesn’t have one either.
Somehow, Prefab variable has a value of 2 instantly while its original value is 0.
That’s where my “Sidenote” question comes in:
GDevelopExtLayoutProb4
This is in an external layout, and I can pick an object that is only present in the main scene(RightChecker). Not by clicking on it directly, but right clicking on the object type and selecting an instance.

The conditions can only be true if somehow (I’m probably wrong), the main scene has access to the DownChecker object. How is that possible?

got RightDown and DownDown objects as well as external layout names?

To confirm there is no RightChecker in the external event, open the external event in the editor (top left set of buttons:

image

Then either search or sort the list that appears at the bottom of the editor.



These events will only delete the RightChecker objects that meet the conditions. It may not be removing all of them.

Unless it’s created elsewhere, in order for a DownDown object to be created, the conditions will need to be met.


No, only if the X position of the Character is larger. Once that’s met, you set Prefab to 2, which satisfies the event following.


I don’t understand that statement. If you right click on an object in the objects panel, there is only “Add an instance to the scene” available. This is correct if the External Layout has the main scene as it’s base. All objects in the main scene will be available to that external layout.

Sorry for the late reply, I’ve been busy lately. Thanks for the advice, I managed to solve the issue with another method.