Key To Open Door Variant

Discussion in 'How Can I...?' started by wmfear, Oct 20, 2021.

  1. wmfear

    wmfear Avid Boxer

    Joined:
    Apr 6, 2018
    Messages:
    165
    Likes Received:
    89
    Hi guys.

    I`m trying to achieve something that will be similar to the "get key to open door" thing in the Adventure template.

    I want my character to find some explosives in once place, and when he goes near a heap of stones (another place) they "explode" away.. Is this something that can be done? Is there any tutorial on how to set up something similar to this?
     
  2. Leighton

    Leighton Avid Boxer

    Joined:
    Jan 31, 2018
    Messages:
    373
    Likes Received:
    182
    Hey :)
    I just want some details of this and ill see if I can make something for you.
    Does the player just need to go passed the explosives? Then go to another place and they will explode?
    Does the player need to pick them up and place them?
     
  3. wmfear

    wmfear Avid Boxer

    Joined:
    Apr 6, 2018
    Messages:
    165
    Likes Received:
    89
    Well, the player would just need to walk through the explosives to pick it up, a text would appear that he’s got it. Then he walks to the rocks, and when he is within a certain distance, the rocks would «explode». So he does not need to pick up and place it, would be kind of automatic.
     
  4. Tars Tarkas

    Tars Tarkas Avid Boxer

    Joined:
    Jul 17, 2018
    Messages:
    303
    Likes Received:
    228
    When the explosives collide with your player it sends an event (with the Send node). The rocks Receive (node) that event and switches to another state (State Machine node) where it has an If Collide node with the character. Make the if collide's collision shape larger. And when the character gets near the rocks it will trigger the if collide node and BUM.
    I don't know if this is what you are looking for.
     
    wmfear likes this.
  5. wmfear

    wmfear Avid Boxer

    Joined:
    Apr 6, 2018
    Messages:
    165
    Likes Received:
    89
    Thanks, I guess this is what I’m looking for, though I’m not quite sure how to set it up properly. I will try it out a bit and see if I can get it working properly.
     
  6. wmfear

    wmfear Avid Boxer

    Joined:
    Apr 6, 2018
    Messages:
    165
    Likes Received:
    89
    Ok, so I managed to make some of this happen. The character picks up the explosives (ball) and the stones "explode" with a 2 second delay:
    https://www.dropbox.com/s/qmy4fnxu7e3pebq/explosives.mp4?dl=0

    I`ve not been able to figure out how the character can pick up the explosives, and walk around without the "explosion" happening, until he reaches a certain distance of the stone wall.

    I`m sure you already explained that in your post, @Tars Tarkas , but I`m still a bit confused :)
    A bit more trying and failing might fix this, but if someone sees what I need to do, please let me know (or want to explain it step-by-step)
     
  7. Tars Tarkas

    Tars Tarkas Avid Boxer

    Joined:
    Jul 17, 2018
    Messages:
    303
    Likes Received:
    228
    you are sending an event to your rocks? use a state machine in the rocks with the first state empty and the second state with an if collide with the character. Link the receive node to this second state.
    bum.JPG
     
    wmfear likes this.
  8. Tars Tarkas

    Tars Tarkas Avid Boxer

    Joined:
    Jul 17, 2018
    Messages:
    303
    Likes Received:
    228
    check the image. make the if collide collision shape bigger, the size of the safe area around the rocks.
     
    wmfear likes this.
  9. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    There's no need for the state machine there just an event that will enable the if collider will do the trick
     
    wmfear likes this.
  10. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    Leighton and wmfear like this.

Share This Page