Download

Communication between two mods / ForEachLoop limit?

So my mod http://steamcommunity.com/sharedfiles/filedetails/?id=543828831 is able to sort items into storage containers.
The issue is, there seems to be no way to actually communicate with other mods without already having their blueprints in my local devkit.

I’ve tried using actor tags, which will find their containers, but cannot return the inventory properly
(http://puu.sh/lmeCC/dd78fda3d2.jpg)

I’ve tried getting components based on the base storage box inventory component, which does indeed return their inventory component, but the current inventory array is empty.
(http://puu.sh/ln0Q8/8f87549b02.jpg)

I’ve also tried a blueprint interface and distributed it to another mod maker, which caused crashes when it was placed outside of his mod’s directory.
When placed in his mod’s directory it didn’t work since mine was trying to fire the function through my version of the interface, and his version of the interface couldn’t receive it since I imagine they were two separate instances.

My next idea is to have another mod create a ‘dummy’ version of my actor, and have it add itself to an array variable on the dummy. Which hopefully in a real server would attempt to set the variable on my mod so long as it was running, and do nothing if it wasn’t (since the cast would fail).

Another issue I’ve run into is people with larger bases will see my mod not firing the event a significant portion of the time.
My event is ‘RELIABLE Replicated from client’ so it should fire no matter what. It seems there is a sort of limit on ForEachLoop, so when my multi-box-trace returns all the actors in the area, on larger bases it doesn’t finish the ForEachLoop.

In your first screenshot, have you tried it without the second cast from “MyInventoryComponent” to “PrimalInventoryBP_…”? You should be fine by just getting “MyInventoryComponent”.