I do agree. I prefer a dedicated coded cnd. What I'm trying to create is a C2 event listener where the developer defines there own event's. The Event being named a string.
I don't technically need to use Function, but I thought it would be far more elegant and appropriate to use an already established plugin. The alternative is a switch statement, which doesn't exist or a more bulky form
OnCustomEvent
- if EventName = "shoot" -> Function.Call("function0", data)
- if Eventname = "move" -> Function.Call("function1", data)
I had just thought I could get a way with
On Start Layout
-> CustomEvent.RegisterCallback("function0", "shoot")
-> CustomEvent.RegisterCallback("function1", "move"
getting a number isn't really needed for a callback purpose. The idea would be for data processing and triggering based on structured data. Ajax based turn games. where lists of turn actions. Having the option to get a Function to be triggered for the action type of a turn just makes some sense.
structure
Player, Action, Unit, Data
0, Move, 6, [6,4]
0, Shoot, 4, 20
1, Cover, 9, object12
...
Anyways, This was all about tinkering. As there is no official support I will probably just leave it to just tinkering :D
Thanks for the info :)