edited January 2021 in ORK Support
In my game, I drag and drop items on objects in the environment to use items on those objects. Only specific items can be dropped on specific objects of the environment. You can't simply drop items on the ground for no purpose. You can, however, drop items on your teammates to give this item to him/her. To achieve this, I thought I could use a "Drop" Event Interaction component on the environment objects that can be used with specific items. The problem is that if I drop an invalid item on an environment object, it shows the "give" dialog box, like when I give the item to a friend. What is weird is that my items have "Dropable" unchecked and my menu has its "Drop to World" setting unchecked too.

So, what I need is when I drop the wrong item on an object, it is simply returned to the inventory.

How can that be done?

Also, I have an issue with Item requirement checks. In the Requirements section of Items setup, I check a global variable condition. When I play, the first time this condition is false, the item becomes unusable (as expected), however, when I set the ORK global variable to true again, the item stays in its unusable state and there is no way to make it usable afterwards.
Post edited by ArsMagika on
  • Are those interactions also combatants?

    Can you post the details of the variable condition from your requirements? Also, maybe you've enabled checking object variables?
    Generally, the requirement check is done whenever the item is displayed somewhere (e.g. a menu) or you try to use it, i.e. if the variable condition is set up correctly and valid it should be usable, unless something else blocks the use.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2021
    No, the interactions I was able to give items to were not combatant. I was able to give an item to a door! :)

    As long as an object has an event interaction component, I can drop items on it and the items disappears from the inventory.

    As for the item requirement refresh issue, I made some more tests this morning, and I discovered I was able to make them refresh if I click on another (usable) item of the inventory menu. This menu is always shown at the bottom of the interface, but maybe it goes out of focus and then the items it displays are no more refreshed? How can I make sure the inventory menu always stay in-focus? Or... maybe I could try to refresh the menu each time I change the variable? I'll test that!

    Thanks!
    Post edited by ArsMagika on
  • edited January 2021
    Concerning the issue with items refresh, it works when I force-refresh the menu each time I change the variable. So, that's great!

    However, the issue with giving items to doors and such is still there... I also realized that if I drop an object on a "Drop" Event Interaction that doesn't match the object I drop, it triggers the "Give" pop-up menu as well...

    I'd like the Give" pop-up menu to trigger ONLY when I drop an item on a combatant from the player active group, not on enemy combatant and not on game objects with an Event Interaction component. And when I drop the wrong object on game objects with a Drop Event Interaction, I'd like the object to be returned to the inventory as it is the case when I drop an object anywhere else in the environment (since my objects are not "dropable").
    Post edited by ArsMagika on
  • edited January 2021
    Yeah, the inventory menu is not refreshed on variable changes, only on inventory changes (e.g. adding or removing an item).

    I'll look into the drop interaction, it's been some time since I last used them, might need some love :)

    Edit: Alright, tested it and it works fine here.
    The give popup is only triggered on my end if I drop it on a combatant - maybe there is some UI or collider (also used as triggers) that are connected to a combatant between the screen and the interaction?
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2021
    So, I found the issue. If I create a cube with a collider and an interaction drop event at the root of my scene, everything is fine and if I drop anything other than the item specified in the event, it returns in the inventory as it should.

    But... as soon as I parent the same cube to an empty game object, then I can drop any item on it and it will be lost.

    I'm pretty sure this is a bug, isn't it?

    I could circumvent the issue by unparenting all the interactive items from my scene, but it would surely create an organizational mess...
    Post edited by ArsMagika on
  • I'll do some tests, could be a bug.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Tested and still works fine - though I've found an issue where drop interactions use the In Children setting from the click interactions (game controls) instead of the drag/drop settings from the menu settings.

    Could you post your Click Interaction settings (Base/Control > Game Controls) and Drag/Drop Settings (Menus > Menu Settings)?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2021
    You're right... I was wrong with my repro steps. To repro the problem, you need to:
    1) Create an empty Game Object.
    2) Create a cube, parent it under the empty Game Object.
    3) Add an Event Interaction component with drop on the cube and specify an item.
    4) Create a second cube. Parent it under the empty Game Oject too. Move it aside the first cube so they do not intersect.
    5) Add an Add Combatant component to the second cube.

    Now, if you drop an item on the first cube, it's like if you drop an item on the combatant (the second cube).

    This could be explained if the From Root from the interaction settings was true, with In Children, but it is not...

    Anyway, my click interaction settings are:

    Interact key: Left Click
    Start click interaction: true
    Max event steps: 100
    Click Interaction
    Max click Distance: -1
    Layer Mask: Mixed...
    Distance: 100
    In Children: true
    From root: false


    My Drag/Drop settings are:

    RayCast Settings
    Layer Mask: Mixed...
    Distance: 100
    In Children: false
    From Root: false
    Drag Set Selection: false
    Drop Set Selection: false
    Block Tooltips: false
    Dragging Notification
    Show Drag: true
    Drag box: 1:DragIcon
    Cancel Drag Key: 4:Cancel


    Post edited by ArsMagika on
  • Also, is there a way to prevent the player from accidentally dropping items to enemy combatants (combatants not in active player group)? Because it seems that I could break the game by giving specific items. I want to be able to drag and drop items on members of the active player group, but not to combatants outside of this group...
  • Hm, I don't think so - I'll look into that and also do some tests with the new infos :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Alright, found the issue - dropping on combatants always searched from the root game object, i.e. since the interaction didn't use the item it continued with the combatant from the other cube.
    I'll change that in the next update, using the same functionality as for drop interactions (i.e. drag/drop settings).

    Also, there'll be new options to allow drop giving stuff to player, allies and enemies separately.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Great news! So, if I understand the current situation, even if the first cube is not a combatant, because the item is not consumed in the event, it continues its search from the root of the first cube and then, it finds the combatant and gives him the item?

  • Yep, pretty much.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.