Re: DG Scripts and multiple evetns per char

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 08/11/00


Chuck Carson wrote:
>
> I am using the latest version of DG scripts (and am quite new to them). I
> have it working and have a simple command a player can type to basically
> delays some output to the character.
> Moving on to bigger things now. I created an event pointer for each pc/npc
> to point to any events that belong to them so I can free them if the pc is
> extracted, etc... However, what if a player has multiple events pending, how
> can I possibly reference them all. From initial thoughts I think this would
> require some kind of linked list that contains pointers to each event for
> each player. This is much uglier than I really want it to be. Am I making
> this harder than it needs to be? Has anyone else came across this problem? I
> must admit my C has become quite rusty over the last 2 years so I do not
> really feel like hacking a linked list out.

Well, a linked list is your best bet, but you don't have to actually add
a new structure to make it up, just add a new pointer to the event_info
structure to point to the next event for that player.

Linked lists are really a great tool in C, work with them and get used
to them and they will become one of the most powerfull tools you can use
to program in C.

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT