playMaker

Author Topic: Door key code/punch code  (Read 1966 times)

PsYcHoSiD

  • Playmaker Newbie
  • *
  • Posts: 8
Door key code/punch code
« on: March 23, 2018, 04:35:55 PM »
Hey guys new to playmaker. I’ve tried searching the forums and I can’t seem to find anything on this topic so I’m wondering if someone can point me to a tutorial for locked doors that involve a code. Like if it’s a key pad that has code “2432” or whatever. I’ve already found that and now I need to punch it in. I’m not sure if I’m supposed to use GUI buttons (and replace the art) or have physical meshes in the world (like how in Dishonored you rotate the numbers on the safe).

Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Door key code/punch code
« Reply #1 on: March 24, 2018, 06:16:44 AM »
Hi.
Both can work, so it depends on what you want.

I am on a weekend trip at the moment, i can make a sample on monday.

Basically you do :

On mouse down do a mouse follow or rotate towards,
Then on release get the rotation
Then use a float compare and use some tolerance.
And repeat for each number.

PsYcHoSiD

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Door key code/punch code
« Reply #2 on: March 24, 2018, 05:57:11 PM »
So I made some progress on it, but I have a slight error. Essentially I can get through the code (to play a song right now as I prototype it). Code 2, 3, 1. And it works. I tried setting up some fail states - first with multiple mouse events and that didnt work - it just triggered the whole FSM. Anyway right now I'm using Game Object tags to compare, but for some reason it wont trigger the "Wrong Code" fail state. For button 4 (really button 1) I still have the multiple mouse inputs set up and that works just fine at the moment. Here is what I have: https://imgur.com/ONyj0wy   https://imgur.com/5yDxl0b https://imgur.com/a/gZW1f https://imgur.com/a/phO2E
Edit to add images.

Thanks!
« Last Edit: March 25, 2018, 10:50:24 AM by PsYcHoSiD »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Door key code/punch code
« Reply #3 on: March 26, 2018, 01:58:53 AM »
Hi,
I made you a quick sample (see attachment below)

If you don't understand, i will make a video tonight after work :)

PsYcHoSiD

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Door key code/punch code
« Reply #4 on: March 26, 2018, 08:02:48 AM »
I think I understand. You're storing the game object with the mouse picker event. Your array is also in the sequence of the order of "game objects". So you're checking if you clicked on the correct game object and plugging it into your array. I really appreciate you putting this together.

I have to go to work, but I'll attempt to recreate it tonight and post if I have any more questions.

Thank you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Door key code/punch code
« Reply #5 on: March 26, 2018, 01:33:25 PM »
Hi.
No problem, happy to help.