How to use objects with other objects?

  • #1, by Robert Damien Ulf RubinoThursday, 27. April 2017, 01:51 3 years ago
    Hi again! I've since learned how the layering issue is and how to combine objects and they are even draggable from my inventory! However, if I want to use an object on something else, how would that work?
    For example:
    In the first scene I combine a book and an inkwell to make a key, which then you need to use to "unlock" the door and change to the next scene. However, I'm stumped as to how you can then use the key on the door like which actions I need or conditions?

    In the second scene, I want to be able to use a spear that's made from combining a rock and a stick to interact with a tree so the player will receive a key in the inventory.

    Sorry if this is vague!

    Newbie

    5 Posts


  • #2, by afrlmeThursday, 27. April 2017, 02:28 3 years ago
    Hi again! I've since learned how the layering issue is and how to combine objects and they are even draggable from my inventory! However, if I want to use an object on something else, how would that work?
    For example:
    In the first scene I combine a book and an inkwell to make a key, which then you need to use to "unlock" the door and change to the next scene. However, I'm stumped as to how you can then use the key on the door like which actions I need or conditions?

    In the second scene, I want to be able to use a spear that's made from combining a rock and a stick to interact with a tree so the player will receive a key in the inventory.

    Sorry if this is vague!
    Check out my screenshot (below).

    https://i.gyazo.com/626c8e907d589306eae80d0bad4a4a23.png

    It's a bit basic, but it'll do as a starting point...

    For locked scene objects like doors & chests & cupboards, etc you should probably create a condition for them in which you can check if the object in question is locked or open. After you have used the key on said item you would change the condition state to let the engine know that the door or whatever it is is now unlocked. Next step would be creating a command action for the default command/use/open - depending on how you have setup your command interface - inside of this you could add an if query along the lines of...

    if condition "door_unlocked" is true
     play animation "open_door"
     change condition "door_open" -- or something to hide or change the door object state
    end if

    Imperator

    6818 Posts

  • #3, by Robert Damien Ulf RubinoSaturday, 29. April 2017, 03:26 3 years ago
    @AFRLme

    I just wanted to let you know all of your explanations were a success and I really loved the outcome of my video game! It wouldn't have had the same mechanics/feel without it. Thank you so much for the quick, thorough replies and I hope you'll be here in the future if I ever run into anymore issues smile

    Newbie

    5 Posts

  • #4, by afrlmeSaturday, 29. April 2017, 03:57 3 years ago
    @AFRLme

    I just wanted to let you know all of your explanations were a success and I really loved the outcome of my video game! It wouldn't have had the same mechanics/feel without it. Thank you so much for the quick, thorough replies and I hope you'll be here in the future if I ever run into anymore issues smile
    haha. No worries mate. I'm always here - well, not always... but, my post count probably begs to differ. wink

    Imperator

    6818 Posts

Write post