So hi everyone, how y´all doing?!
In my game I have a puzzle that I want to keep because when doing playtesting some people tought that it was very well implemented.
The concept of the puzzle is very simple, is the good old combination padlock, but with every detail in mind.
We previosuly had this puzzle working great with a custom script on Unity 2019.4.7f1 (we where not using AC at the time, rather all systems was custom made from scratch, bad idea I know. Ac literally saved the game) , it was implemented by a programmer friend I have contact still but prefer not to bother If and only If you can help me solve it.
So here´s how the puzzle works, it basicaly uses sound to feedback the player into solving it, but you have to be meticulous with the mouse movements
THE Goal of the puzzle is to open the padlock in the CloseUp and gain access to a locker where there ´s some items the player needs to advance...
Here´s an old super accelerated GIF of the thing, so you can get an idea of it:
A- You move the dial clockwise or counterclockwise to get to the right numbers (four numbers in total)
B- The little red button resets the puzzle (takes the dial back to 0) -so you can try again if you mess up-
C- You have to input them following a specific "directional" order, just like a real padlock works (I guess) this is the clue you get:
The player starts by moving counterclockwise to the number 35, as pictured in the image, when you reach it, a distinct "clicking" sound will be heard, different from the rest of "click" sounds the dial makes when you move it... this is the "sound" part of the puzzle.
As the rest of the numbers are scribbled, the player will have to listen carefully when moving the dial
If the player gets the four numbers right, the padlock opens up.
I see two inmediate problems:
1) To make the center dial arrow thingy (we have an individual sprite for this) to be draggable an "rotateable" with the mouse.
2) Migrate all the puzzle´s logic into AC?? How? I have attached a copy of the LockerController Script the programmer made here, hope it´s useful
The current version of Unity I am using is 2020.3.38f1
Current AC version: v1.77.1
Hope we can get it to work, this is probably the coolest puzzle of the first part of the game and i´d be thrilled to get it working in AC, plus it will make it possible for me to design further stuff like this.
Thanks in advance!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I'm not too clear on your meaning here - in what way does the gif above differ from your intent?
If the script already gives you your intended mechanics, it's best to continue with it rather than try to replace it with AC.
The script itself should be able to work alongside AC - so it's mainly a case of how you want it to integrate it. For example, prevent input while an AC cutscene is running.
For that, you can replace the line:
with:
Hi Chris! First, thank you for you jumping on to help with this..
Nothing differs from the GIF, the dial arrow is a sprite that should be rotated using the mouse, what I mean is how can this be achieved with AC? Or should just replacing the script line you mentioned be enough for this to work?
If I understand correctly (I am not a coder) you want me to forfeit input while the CloseUp is showned? Is that right? But if I do this how can the player move the dial?
I'm saying that there's no need to re-invent the wheel, if the script already achieves the gameplay you're after.
If you convert the scene into an AC scene, the puzzle itself should still work - but you'll likely get undesired side-effects, such as being able to turn the dial during an AC cutscene.
The line change I suggested merely prevents input while not in AC gameplay. You're not limited to that, however, and I can suggest alternatives - but I'd need to know how you want the puzzle to behave when AC is running. That is best done by having AC run alongside it and see what issues need to be ironed out.
Okay, I understand, yes, I think is better to use what was already coded and works, so where do I Start? In the old project, the whole CloseUp is a Prefab with the spirtes and scripts inside Gameobjects... let´s say I put a Game Camera pointing at it, what should I disable AC-wise and what not to make it work?
You can use AC's Engine: Manage systems Action to disable e.g. the Movement and Interaction systems if you want to prevent the Player from moving and Hotspots from being interactive. You shouldn't technically need to disable anything on the AC side to make it work, however.
Again, it really comes down to what you want. If the camera is facing it (with a GameCamera), then the script should still behave as intended. The best approach is to place the prefab in the scene, point the camera at it, and see what you have. If you want to make changes to have it work better with the rest of your gameplay (e.g. disable itself after the player solves it) let me know - but I'd need to know the specifics of how it should work differently in order to advise.