Platform Builder Forums
Help and Support => Working with Platform Builder => Topic started by: Free_Eagle on October 12, 2023, 11:28:05 AM
-
Hello me again :-[.
I'm so sorry, I tried to solve the problem for 2 days...
I want to unlock a secret path with a key and lock. As in the video Lesson 6 "Secret Exits"
I created the key and lock as an item myself.
Unlocking to secret works, but I can't say "with key".
Lock = blue
Key = blue
But the wombat walks past it with and without a key. Why?
!Addendum!
I changed "Pick up" to "Standard" for the lock
Now the wombat always goes into the lock, even without a key
-
I don't understand the question, sorry. can you help me visualize it?
-
Oh ok.
A level can be completed normally. But it also has a lock and a key to find. The lock opens a secret level.
I created the key and lock myself as a "custom item".
Now I have the problem of telling the program that the lock can only be opened with the key.
I also tried with variables. I just can't find the "then"
if Key =1 then ....?
...or so
-
This is how you would write a conditional:
if key=1
secret exit
However, I think you're better off using normal keys and gates instead of creating "custom" ones. You can place a real gate and then put whatever you want behind it, like a secret exit.
-
Using the original key and door was my first attempt. Just "press" unlocking it and "press" going in, wasn't what I wanted. The avatar should go in straight away if the key fits.
I have defined the variable key = 0 in the "Area Settings".
"game var key = 0"
The lock was defined in "loop".
If key=1
secret exit
The key has not yet been defined to test it
But the avatar always goes in, even without a key.
I don't know why, because the variable key should be 0.
-
I've now managed to get it to work with the key and lock.
The problem was old settings that I no longer remembered while experimenting.
I am so sorry :-[.
Now I have the problem that the wombat picks up the lock.
Even without a key. The lock could always be shown because the wombat would then leave the level.
I couldn't find a "don't pick up" for the lock anywhere...
-
I assume there is no solution for this? ???