Okay a quick Explanation:
There are two Kind of Event calls:
Postevent(string eventname, int delay, string arguments, [arguments])
Event(string eventname, string arguments, [arguments])´
And Postevent will be "scheduled" and will run paralell to the other functions.
And Event will be done before the rest of the code continues, so ist similar as an function call.
In an Event function you will often see the GetEventData() function. This function picks up the arguments which are given.
In the string arguments you declare which arguments are passed to this Event.
You use the following letters:
l = int
s = string
i = aref
f = float
Those are the ones I know from the top of my head at least.
So say you want to pass a character index and experience and skillname you do it like this:
Code:
int idx = 0;
int exp = 100;
string skillname = "cannons";
Postevent("myevent",1000,"lls",idx,exp,skillname);
You Need a place where the Event is declared. This can be done with an Event_handler which you will see an example of in the top part of leveling.c.
You can also use the function(I believe) SetEventHandler(string eventname, string functionname, bool something)
I dont know what the something is, I haven't found out what is different. Maybe it has something to do with if it is allowed to run paralell or not.
If you use the SetEventHandler you can also use the DelEventHandler(string eventname, string functionname) to remove it again.
Say we set an Event handler for the function void fubar() and the Event Name is myevent then the fubar function would look like this:
Code:
void fubar()
{
int idx = GetEventData();
int exp = GetEventData();
string skillname = GetEventData();
SomeFunctionToUseIt(idx, exp, skillname);
}
Now after 1 second (1000 ms) after the post Event is called this function will be executed and it will get the data which was send with the post Event.
I hope this is clear enough?