playMaker

Author Topic: Simple door unlocking system issues. [SOLVED]  (Read 6543 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #15 on: September 22, 2014, 04:16:11 PM »

You can do it with or without globals. Your implementation looks different from what I was suggesting. You aren't even specifying any bools to check in the Bool All True action?

How would it be done without globals?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #16 on: September 22, 2014, 04:26:36 PM »
When you pick up the items, they must change some bool to True, it makes absolutely no difference where this information is at, just that you can get to it. Easiest way is to just stick it on the player since he's the one entering the trigger.

Now that you're getting a bool true on the player, when he enters the trigger just make the trigger Get Fsm Bool on all of the bools you need and do a Bool All True action to see if they're true or not.

If that happens every time the player enters the trigger then you have a fantastic gate system that can decide if the door should open or not. Very simple.

Like that.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #17 on: September 23, 2014, 12:36:35 AM »
When you pick up the items, they must change some bool to True, it makes absolutely no difference where this information is at, just that you can get to it. Easiest way is to just stick it on the player since he's the one entering the trigger.

For starters, does that mean I can use bool all true in the same fsm?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #18 on: September 23, 2014, 03:50:24 AM »
In the suggestion there, Bool All True would be on the Trigger.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #19 on: September 23, 2014, 10:19:53 PM »
In the suggestion there, Bool All True would be on the Trigger.

That is the locked door right?

Now that you're getting a bool true on the player, when he enters the trigger just make the trigger Get Fsm Bool on all of the bools you need and do a Bool All True action to see if they're true or not.

This is another element to the whole door puzzle that I have a difficult time wrapping my head around.

#1 Does that mean I create two local bool variables that are true?

#2 What about the keys/objects since they have the standard trigger event, send event, get parent, destroy actions that a regular pickup item would have.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #20 on: September 24, 2014, 03:56:07 AM »
In the suggestion there, Bool All True would be on the Trigger.

That is the locked door right?

Quote
This is another element to the whole door puzzle that I have a difficult time wrapping my head around.

#1 Does that mean I create two local bool variables that are true?

They start as false. If you do have the key, they should be true.

Quote
#2 What about the keys/objects since they have the standard trigger event, send event, get parent, destroy actions that a regular pickup item would have.

I don't know what you mean here. The only thing that needs to happen is very simple:

Create a bool for each key you need.
When the item is picked up, change the bool to true.
When you touch the trigger, check the bools that are required to unlock the door.
If they're all true then you must have all of the keys, so continue opening the door.
If any are false then the door does not open.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #21 on: September 24, 2014, 02:36:54 PM »
They start as false. If you do have the key, they should be true.

If those bool variables are local? Because I had to make two separate variables local.

Create a bool for each key you need.
When the item is picked up, change the bool to true.

Does that mean each key has a Set Bool FSM action or Get Bool FSM?


When you touch the trigger, check the bools that are required to unlock the door.
If they're all true then you must have all of the keys, so continue opening the door.
If any are false then the door does not open.

With Get Fsm Bool and Bool All True? Regardless of my key setup, when the player collides with the trigger it disappears.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #22 on: September 24, 2014, 02:59:31 PM »
If those bool variables are local? Because I had to make two separate variables local.

That can work.

Quote
Does that mean each key has a Set Bool FSM action or Get Bool FSM?

Sure, that can work.

Quote
With Get Fsm Bool and Bool All True? Regardless of my key setup, when the player collides with the trigger it disappears.

You're on the right track, tweak it until it works. Figure out what isn't working and try stuff until it does. Experimentation is the best way to learn.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #23 on: September 25, 2014, 10:46:26 PM »

Does that mean each key has a Set Bool FSM action or Get Bool FSM?

Sure, that can work.

For the action Set FSM Bool, when you set up game object button is there a difference between Use Owner and Specify? Since we are talking about a FSM for the keys. Plus how would that be different from using Get Fsm Bool?


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #24 on: September 26, 2014, 07:21:05 AM »
Set fsm bool would change the property of the target bool. Owner as default will target the gameobject that the current fsm is on. Specify would let you target something else.

Get fsm bool will get the bool from some other fsm and store it in a local variable.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #25 on: September 27, 2014, 11:58:32 PM »
I see. For the door I have a trigger event, and it has a Store Colllider option. Does it matter if it is set to None?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #26 on: September 28, 2014, 07:21:43 AM »
Sure doesn't. It's optional.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #27 on: September 28, 2014, 05:27:40 PM »
Going back to the player. How would managing a bool system work on the player when theirs a state with a basic movement system?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple door unlocking system issues.
« Reply #28 on: September 28, 2014, 06:19:27 PM »
You don't have to manage the bools locally on the player, other FSM's can access those variables and change them remotely.

Otherwise, you could just put another FSM on the Player.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: Simple door unlocking system issues.
« Reply #29 on: September 28, 2014, 07:04:34 PM »
You don't have to manage the bools locally on the player, other FSM's can access those variables and change them remotely.

Otherwise, you could just put another FSM on the Player.

And this second FSM attached to the player would have the same 'state' info as the door?