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)
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.
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