Mailing List
Home
Forum Home
MUD Dev - Discussion of MUD system design, development, and implementation
Mac Game - Mac game development
Rivers of MUD - a Diku and Merc based multiuser dungeon
SMAUG
Subjects
Getting UDP through NAT/firewalls/whatever for a game
Getting UDP through NAT/firewalls/whatever for a game
QuickTime errors
Python script as stand alone MUD server
Various sound problems
Fragment Shaders & GL TEXTURE RECTANGLE EXT
Timers and global variables
Re: Language and platform for Text MUD server
Apparent acquisition of Yantis (mysupersales) by IDE
HID keyboard
Getting UDP through NAT/firewalls/whatever for a game
Microsoft Sparkle
Director MX
Congratulations Horizons
Yet more problems fullscreen mode
Apple Dev Kitchen Them 's tasty vittles, Maw!
NSOpenGLContext, Pbuffers, and drawables
More DCR "theft " naughtiness
dynamic sprite creation and imaging lingo
Re: Find stuff in Flash array?
Effects of skill imbalances?
QuickTime errors
Rom 2 4/Quickmud Enhancement/Bug fix
Working with XML files/CFURL
smooth scrolling/subpixel tweening
RE: (Ron help me?) Flash text
Flash Racing
MudDev FAQ 2
Browser based games
Installing GLUT
Special character in Flash XML
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Counting objects in a room

Counting objects in a room

2003-12-07       - By Atm

 Back
Reply:     1     2     3     4  

Ok list.  Its time to learn :-p  
I was just piddling with this and want to learn how to make the
code count the number of objects (that match the argument)
and display it to the character (i know, this function is kind-of
useless but its a way for me to understand the code better)

I also know that this function is missing a chunk of code or two ;)
All im asking for is a gentle kick or shove in the right direction, maybe
some chunks of the exsisting code to look at :)

Flames, help, ect are welcome.  

void do_objroom(CHAR_DATA *ch, char *argument )
{
char buf[MIL];
OBJ_DATA *obj;
OBJ_INDEX_DATA *pObjIndex;

int nMatch = 0;
int count = 0;
char arg[MSL];

if ( argument[0] == '\0' )
   {
   send_to_char( "You can't count nothing?\n\r", ch );
   return;
   }

if ( IS_NPC(ch) )
   stc("Yeah, Whatever.\n\r", ch);
       return;

/*   insert code that counts the number *
*   of (argument) that are in the room */

obj->short_descr = arg;
sprintf(buf,
   "This room has (%d)%s in it\n\r",
   count, arg);
stc(buf,ch);
return;
}

--
Atm of Forgotten Empire!


__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ___
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

--
ROM mailing list
ROM@(protected)
http://www.rom.org/cgi-bin/mailman/listinfo/rom

Earn $52 per hosting referral at Lunarpages.