The doors in the example work on 2 objects, door indicator and the door itself (collision)
While entering the door, it checks if:
The door has (is collision with) an indicator and which one is it (A, B,C etc)
If it is: It finds another door that has (is collision with) the same indicator (A, B, C etc) and moves player there
Well I mean, most of the doors in the example just change scene but still puts you in the door that has the same indicator
How do I actually even achieve the same result? I tried several ways, not even the exact same but with no effect
Are you sure you need separate Indicator objects?
__
You can add a global variable “DoorID” for example.
Then add a variable “ID” for the door object,
then on your 2 scenes in the instance variables set them to the appropriate values - which door leads to which
If player collides with door object, set global var ID to Door ID
When you enter the scene you create the “Player” object at the position of the desired door, here are the events:
Making such doors for one scene turned out to be unnecessarily complicated, maybe someone will suggest a more concise way, but here’s how to do it:
_
Add globalvar “DoorID”
Add global bool “SwitchAllowed” (False by default)
_
Add object variable “ID” for your door object
Add object bool “JumpAllowed” for your door object (False by default)
_
Assign the same ID numbers to the instances of your doors that you want to connect
Well, I’ve decided to not do door behaviour in the same scene
But, idk what went wrong, this straight up doesn’t work, it worked before when instead of using CurrentSceneName() + WoodenDoor.VariableString(ID) I did CurrentSceneName() + "1" (but then it put me in the same scene, but in the same door I went into) (edit: actually it doesn’t work too, idk what worked before like that)
(I don’t want to hardcode every door every single scene)
another edit, sorry: I realized that it also counts the number, im so srupid, how do I not count it tho?
(as in I have scene1, I want to move to it from scene2 but it takes scene2 and adds the 1 to it making it scene21)
You probably need 2 variables for your doors, one that would tell to which scene it leads, and the second one that would tell to which door on that scene it leads
the 0 and 5 works like everything between those won’t be counted, right?
So if like, I would change the 5 into highter number it would still work, but with highter cap
oookay well uhh, now for unknown reasons it doesn’t create the hitbox (thing with player behaviour) and leaves Player sprites (the thing on top of it) just floating where it was originally put
The 0 is the starting position, and the 5 is the length of the word “scene”. So if all your scenes are named: scene1, scene2, scene3… etc… then SubStr will take away the number at the end just like you asked. But it is kind of counter intuitive because you could just say it should go to “Scene + DoorID”. But I was just answering that small portion of this topic about taking away the number at the end.
I don’t have much time for large explanations so I made a small example project for you that might help.
(ps: yeah idk why I didnt put the hitbox before, also I wasn’t (your example), the way in example just didnt worked in mine somehow, probably bad transcribtion, but)
idk why it straight up ignores the “change position if variable of ID of Door…” no matter what, it would fix th problem with the “not moving to the door”
GotoRoomID is used to move you to specific room with same ID (Move to Room2) FromRoomtoID is used to detect teh door you exit through (If moved from Room2 to this room (Room1), move to this door)
Used for external event, gathered from room, name can be anything as long as it is the room’s name but without the number
Thank you all for help! @Epicsleeper@7ToGo and (I guess) @jumpingj
I guess I will now work with the saving of what happened in the scene, like saving what enemies were killed or where they are, but I will figure that out