>I too have coded this. The code is fairly simple. There's no real >reason (at least, if the objects aren't tossing spells) to have the >furniture point at the characters. Add a pointer to an obj_data to >the char_data structure. When someone sits, point it at the furniture >(with appropriate checks that there aren't too many people sitting >there already). Then clear the pointer to the furniture in >char_from_room and init_char. Only downside is using "at" undoes >someone sitting on a piece of furniture (not a prob for morts). The spells are kinda fun. You don't NEED to have the chair cast spells (in fact, by default they don't, you have to set them to do so) One way to solve the at problem is to add in support in the at command to look for chairs....just save the chair if they happen to be sitting, then, after the command, set them back in it. It's seamless, and transparent. >Works well. Might add a check in extract_obj to make sure no one is >sitting on a piece of furniture if it were to go away. That's the main reason I have the pointer back to the player, so you can get them off their butts if the chair vanishes. The only problem it creates is a lack of multiple player sitting support....but that's easily fixed if you don't mind adding adding another linked list to struct char_data for next_in_chair. If there are other ways that are more efficient, I would love to hear them. >I would suggest making a new type of object for this type of code, and >using the values array for things like how many can sit in it, minimum >position (maybe not, it's possible to sleep in chairs, just not >hard). Also, add one for the preposition that is used when a char >plops down (sitting in a chair, on a couch, under a tree, at a table, >etc, etc). Yeah, new object type is the best way. As to the message, you can always use the action_description for that. It's not used on most object anyways :) --- "One hundred years from now, none of this will matter because you and I will be dead -- unless the Grim Reaper has switched his record-keeping to a Windows 95-based system, in which case we all might live forever. " -- Associated Press +------------------------------------------------------------+ | 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