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:
    143
    Likes Received:
    69
    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:
    181
    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:
    143
    Likes Received:
    69
    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:
    290
    Likes Received:
    221
    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:
    143
    Likes Received:
    69
    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:
    143
    Likes Received:
    69
    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:
    290
    Likes Received:
    221
    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:
    290
    Likes Received:
    221
    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:
    516
    Likes Received:
    319
    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:
    516
    Likes Received:
    319
    Leighton and wmfear like this.

Share This Page