Jump to content


nikurizo

Member Since 19 Aug 2009
Offline Last Active May 20 2013 01:41 AM

Topics I've Started

User defined events

08 February 2013 - 06:37 AM

Hello I've been thinking in an option to put a name to your user events. I use many parent objects and I often use the user events to reduce code in child objects, but when I have a lot of user events in different objects, I usually get confused with what a user event does in a specific object.

An example of the way I use user events is having a parent for all the alive objects, and there define a user event to loose life and put a code like "life-=10", then call that event when for example a bullet hits a child object of the alive parent. The advantage of this is that if you don't want to loose 10 of life in all your objects you can change the user event to loose less or more life in an individual object.

The problem its that when I have many user events I don't remember what a user event was for, adding that the use of user events change in different parent objects, calling them its just confusing.

So the idea is have a name of reference in the object proprieties window, in the code editor would be nice but I don't have any idea of how. Maybe with a constant that stores the event number, example for the user event 5 that is called "loose life" have a constant "EVloose_life", and call it as event_user(EVloose_life);.

Other thing that would be REALLY nice to have is arguments in these events, but i see that harder to implement...