> My events will be set up like ACMDs, in the format of 'EVENT(FireBall2)' etc. > and I call the events by 'set_event(ch, FireBall2)'. However, all the arguments > in the ACMD where I call set_event() are not parsed onto the EVENT(FireBall2) > function. I was thinking of making another argument to set_event() in which > you parse the ACMD's argument, but then I'll have to apply two_arguments() etc. > to the argument in every single EVENT(). well..the way dg events does this is by creating an event_object struct, then attach that to the event struct in the queue..as an example..this would be your event struct struct event_info { EVENT(*func); void *event_object; ... then when you parse the event you have a custom struct like: struct fireball2_event_obj { struct char_data *target; bool succeed; ..etc.. then when you parse the arguments in the ACMD, you would create a new event object and put in the information..liek: ACMD(do_whatever) { struct fireball2_event_obj *ev_o; ... CREATE(ev_o, struct fireball2_event_obj, 1); ev_o->target = vict; ev_o->succeed =(GET_SKILL(ch, FIREBALL) > number(1, 101)) ? TRUE : FALSE; then pass this struct as an argument to your set_event func, or if you have a pointer to the event attached to the char_data struct (or if set_event returns a pointer to the event) you could attach the information directly..like: ch->current_action->event_object = ev_o; in the event itself, you will have to typecast the event object back to your custom struct (frmo a void *) like: EVENT(fireball2) { struct fireball2_event_obj *ev_o = (struct fireball2_event_obj *) event_object; struct char_data *vict = ev_o->target; ... this assumes that your event macro looks something like: #define EVENT(func) void *(func) (void *event_object) notice how it passes the info to the event as an argument..if anything was unclear, email me private, and i'll clarify.. siv +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST