Creating an actual table for interaction combinations

Hello everyone, I’m working on Unreal 5.4.
I’m currently trying to make a table to cross check interactions, it would be even better to make it in CSV and then load it into the engine, but I don’t know how to do it cleanly.
What I’m trying to do is something like this:

A KNIFE GRINDER ROLLINGPIN TOMATO MEAT DOUGH
KNIFE UNSET BREAK UNSET UNSET UNSET UNSET
GRINDER BREAK UNSET BREAK UNSET UNSET UNSET
ROLLING PIN UNSET BREAK UNSET UNSET UNSET UNSET
TOMATO SLICE GRIND WASTE UNSET UNSET UNSET
MEAT SLICE GRIND UNSET UNSET UNSET UNSET
DOUGH SLICE WASTE FLATTEN UNSET UNSET UNSET

Horizontally are the “activators”, vertically the “activated”, so I know for example that if a tomato is activated by a knife, it will be sliced, but if you activate the knife with a tomato nothing will happen.
I have a large set of items that all have cross interactions, and I’m also using one enum for items, and one enum for interactions, to have zero risks of typos, and to have a finite switch case for the logic.
To me having a table like this seems like the simplest way to have complex interactions without wasting computation power on exceedingly complex logic, but the only way I know to do such a thing would be to create a datatable of names with names as keys, that should make it possible to import as a CSV, but wouldn’t work for the enumerator thing, and doesn’t seem a clean implementation of a simple table.
Any clues how to do this simple thing?

2 Likes

Hello! Add details please, not sure what this is about.

Sorry I had sent the message by mistake before completing it, never used this new site before! Now it’s explained.

2 Likes

Does really no one know how is this done? It felt like it should be trivial!

Why wouldn’t it work? Enumeration is a field that fits right there.


I’d use an interface for this.

:hocho: → message Use Knife on target actor (:tomato:) → :tomato:'s implementation of Knife UseSlice

In short: an activator (as you call it) would send a generic use message. And it’s up to the target actor to determine what activator’s request is interpreted as. An interface works both ways and can return data. So:

:hocho::meat_on_bone::cut_of_meat:

The meat on bone’s implementation of `Use Knife returns a slice of meat. Were you to stab a rock, the rock would return an indication of a broken knife.


Combine it with inheritance to minimise duplication. If there’s only half a dozen of potential knife uses, I would not bother with a data table (but you can). If you need the query available globally, you could use a function library.

Hello! Add details please, not sure what this is about.