Tylermon
There isn't really an issue, not exactly, just some coding and C2 objects functionality Q&A
I was hoping for a way to have instance methods in C2. There isn't such a thing right now. I was hoping for an existing behavior that might provide this functionality. It doesn't exist. PixelRebirth made the point that calling onFunction events, passing in the instance.UID as first param pretty much duplicates the behavior I described in OP.
The issue, if we in fact have one, is does the Object.PickByUID action iterate every instance to locate/return the one instance I want by it's UID. Or does it somehow directly select/Pick an instance in memory with the UID. If the latter, than onFunction(inst.UID, param1, parm2..) will be fine for now or maybe forever. If the former, I need to start thinking about building a custom behavior.
Which of the following illustrates how Object.PickByUID works...
// 1
Monster.PickByUID(paramUID) {
foreach(allMonsterInsts as m) {
if (m.UID = paramUID) return m
}
}
// 2
Monster.PickByUID(paramUID) {
return allMosterInsts[paramUID]
}
[/code:24ajdh7c]
If PickByUID action works like 2, then I'm fine with just using onFunction and passing in the UID. If it's 1, then we need something better like instance methods as I described in the OP. Or perhaps a way to pass an actual object instance reference into onFunction like @PixelRebirth said.