How can I make the doore to appear after collecting 4 items?

  • #1, by steph-koSaturday, 20. February 2021, 10:57 3 years ago
    Hi, I am new to visionaire. I worked with the tutorials and set up a room, in which the character should collect 4 opjecjts/ items ( objejts are set to invisible and item appeares in the inventory). Now the door should appear( condition is on deflaut/ untrue). It workes if I set the command with one Objekt (change condition of the door to true). Could you help me with that? Something like, if all 4 items are in the inventory the doore should appear.
    Thanks smile

    Newbie

    2 Posts


  • #2, by afrlmeSaturday, 20. February 2021, 13:07 3 years ago
    A'llo, there are multiple solutions you could use.

    1. Create a called by other action in the actions tab section for the scene & rename it to something relevant like: "check_items", now add some action parts along the lines of this to it - I'm just going to assume that you are using conditions to update when the player has picked up the relevant items.

    if condition "item1" is true
     if condition "item2" is true
      if condition "item3" is true
       if condition "item4" is true
        set condition "door_visible" to true
       end if
      end if
     end if
    end if

    The general idea behind this solution is that each time the player picks up an item you use the call action action part & call the called by other action you just created, which will then check if all of the conditions are met & if they are then the door should be unhidden.

    2. A more ideal solution would be to link a value to the door instead & increment the value by 1 each time one of the items is picked up & put into your inventory. Values are a lot more flexible than conditions because unlike conditions which can only return true or false, values can check if the value associated with it is: equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to, etc. which makes them really good for objects/puzzles that contain multiple states.

    Think of states along the lines of this: you have a door, the door is locked (1). The player finds a key & uses it to unlock the door. The door is now unlocked, but it's still closed (2). The player opens the door. The door is now open (3).

    Quick note: you mentioned that you have watched some tutorials, so I am assuming that you already know how to assign conditions or values to scene objects to control whether they are visible/active or hidden/inactive.

    Imperator

    7278 Posts

  • #3, by NigecSaturday, 20. February 2021, 13:11 3 years ago
    you could give each object a value.
    here's an example were you collect 5 coins to use to get a drink from the machine, it also creates a stack of coins in inventory which decreases as you feed the machine

    Key Killer

    627 Posts

  • #4, by steph-koSaturday, 20. February 2021, 15:00 3 years ago
    Thanks, that helps a lot smile

    Newbie

    2 Posts