The inventory event inside the 'OR' condition is not triggering properly


I’m building my own inventory system, but I’ve run into an issue with an ‘OR’ condition event.
The event shown above adds an item to the inventory upon contact with an item on the ground. The disabled event labeled ‘inventory add item’ works perfectly on its own. However, because there were too many overlapping conditions, I tried to consolidate them into ‘inventory add item 2’ using an ‘OR’ statement, but it no longer functions. I don’t understand why the event fails to trigger even though the logic seems correct with the ‘OR’ condition

I tried to create an ‘inventory add item 2’ event by using an ‘OR’ statement with the original ‘inventory add item’ event, but it’s not working. I can’t figure out why the event with the ‘OR’ condition isn’t triggering.The core of my problem lies within a single ‘OR’ condition. If the issue is rooted in the ‘OR’ event logic itself, is there any possibility of this being improved or fixed in future updates?

I think it’s the way that OR works. The OR condition evaluates every sub-condition even if the 1st sub-condition is true. If the result is true for any condition then it triggers the action but if any condition is false then those objects don’t get picked.

In your case, if either condition is false then either the item_background or item object won’t get picked. I didn’t expect it to apply to the inventory condition but I tested it and it does. If my item wasn’t in inventory that the item was no longer picked. So, the item couldn’t be referenced in any other subevent.

Normally, I would recommend using pick all objects after the or but it’s within a repeat for each object and that would select all of the objects.

You could put the object’s name into a variable and then in a subevent use the variable in the inventory subevent that way it wouldn’t unpick the object.

ObjName is a string variable

For each object
ObjName = item.objectName()
… … If one of the following
… … … Inventy contains ObjName

Another option is to combine a set of and conditions within the OR and reference the objects in each And. One And would have the false version and the other the true version.

For example

If one of the following 
  If all of the following
       A=1
        Object is visible  
   If all of the following
       A=7
       [inverted] Object is visible  
2 Likes

That was my idea

But Ddsf found other solution on discord so i did not recommend it

2 Likes