The Unit Udex you use for event registration. When to create the struct and when to remove it. The Alloc, well, I don't really know why it works, or even how, just that you use the library to make the commands you do?
Yes, I've used indexer for event registration - you asked for code that removes an instance if given unit (farm) is removed, that is why I needed an indexer. However, I wanted you to tell me this

You need to read the manual to get better insight about structs and then move to structs that extends array i.e array of struct type.
I've used alloc frankly because I'm lazy to write allocation over and over again. We use struct when we want to implement objects - connect fields with behaviour i.e methods. If so, each instance has to be allocated before we can actually use it. Destroy method allows struct to clean up shit left behind given instance and recycle it's index.
but I can understand it must be bothersome to see the same guy post quesion after question..? (You will see alot less of my spam when school starts, hopefully.)
Not at all. If I wasnt here to help, I wouldnt even open the thread. I'm aware that someone might need plenty of statements to finaly understand what it is all about
I just need to see what you did inside a real trigger so I can understand how to implement it properly, I can't get it to work so you can't see a code. I mean, even your globals outside a library or a scope(?) is confusing to someone like me.
Again, I didn't want to paster everything including custom allocation and deallocations so you get confused with code bloat. Of course you should put this inside library or scope - because of "private" my code wouldn't even compile - those can be placed only within scope/library.
Why did you use the "API" from the UDex system as opposed to GetUnitUserData(farm)?
I wanted to mark that I'm using an indexer library without actually writing all the necessary stuff (library + requirements / or static if with GetHandleId in case you don't have any indexer etc.).
I'm out for today, good luck with studing structs.
Congrats muzzel, instead of being helpfull, you are just creating useless spam. Penguins are ashamed of you.