I'm having trouble with doors. Same level, different entrance location

I’m trying to make it so you end up on the right side of the room depending on where you came from.

i found a pretty old discussion about this, but idk how much is relevant now Make a Door teleport player when Key pressed...

@F3Art, I would just have 2 separate saves with the same name to not trigger the outputs.

If your wondering where the player goes in Level 2, check the “New Type 8” object.

@JR01 , the player still always shows up on the left

That’s what you meant, that’s because global’s output when you set them.

1 Like

well if you use door 1 and it brings to door 2 then you can use a circuit (if that was what the correct term was) that checks the objects name so it can disable the option for door 1 and open up the option for door 2 taking you door 1

oh sorry, i think i worded my question poorly then. is there a way to fix that?

i just realized, i had “spawnpoint1” twice in one level and “spawnpoint2” twice in another level lol. that was a pretty stupid mistake. it works now i think.

@F3Art, it pains me to see that its not instant to the side you need.
Here’s my fix, with the timer set to 0:

1 Like

@F3Art, placing the player in specific spots affects the results as well.
Instead of a Once and a timer, I would use another global from one of the “spawn2” objects.

Interesting, I may have figured out a new mechanic or bug. I’ll have to test around with it later.

what did you figure out?

@F3Art, the order of the objects is also the order of the numbers used when the game start, especially for global’s.

In the the same frame, the object in the top left corner of the game will send its global variable before objects on the bottom right corner of the game send its global variable. So if you want to use the data on the first frame, you need to use the last object (in the bottom right corner) in the game.

This happens because objects are scanned like a CRT tv screen, where they are scanned left to right, top to bottom on every frame. If you wonder why some objects sometimes works (like gates) depending on where you move it, this would be why because this scanning method is also used for the behaviors.

So to make it instant would mean to:

  • place the object specifically where you need it (place the player first and use switches).
  • use a timer of 1 instead of 0.
  • or use a save in the player to read the location he would need to go in the next level.

sorry to bother you, but could i get a screenshot of what that would look like in the editor?

@F3Art, those were 3 different options I was suggesting. I could if you tell me which idea you want to use.

Option 2 would be the easiest though, since you already have everything. The timer I said to set to 0 in the image above, try setting it to 1 instead. That should give enough time for the objects to load in and extract before you load the save behaviors.

Option 1 was to work with the “issue”, and 3 is to use the get behavior and have premade locations set in the player based on the save and level.

1 Like