Bubbel Boy:
The idea of events is that rather than telling a function directly in its face to perform an action, you let the function wait for given commands and perform when such a command occurs.
It's kind of like an army, a general won't instruct all his 1000 soldiers individually what to do (this is how non-event programming works), but the general just gives a generic signal (or he has someone play a trumpet or horn) and then the soldiers listen to it and act according to it. The advantage? In the first case it would mean that more soldiers would've mean more function calls (or a bigger FOR loop), in the event case, nothing more needs to be done. As long as you create a function that listens to a certain signal, it'll work. If such a listening function is not present, nothing will happen.
There are plenty eventhook examples in the forums. Stuff to look for: EventHook, EmitEvent, TEvent
The idea of events is that rather than telling a function directly in its face to perform an action, you let the function wait for given commands and perform when such a command occurs.
It's kind of like an army, a general won't instruct all his 1000 soldiers individually what to do (this is how non-event programming works), but the general just gives a generic signal (or he has someone play a trumpet or horn) and then the soldiers listen to it and act according to it. The advantage? In the first case it would mean that more soldiers would've mean more function calls (or a bigger FOR loop), in the event case, nothing more needs to be done. As long as you create a function that listens to a certain signal, it'll work. If such a listening function is not present, nothing will happen.
There are plenty eventhook examples in the forums. Stuff to look for: EventHook, EmitEvent, TEvent