Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register


This is a discussion on "Smaug Code Help Please" in the Top Mud Sites MUD Coding forum :

Greetings, I have attempted to add some code to get the speech trigger to work on an item in inventory(SMAUG 1.4a). I think I need some help with oprog_wordlist_check and was wondering if there was anyone deeply familiar with this part of the code. If you are, and would like to assist me on this, please contact me off list at admin@perishedlands.com and I will give you the specifics of what I have done. TIA, KL...



You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today!

If you have any problems with the registration process or your account login, please contact us.

If you are a registered member of the old TMS forums, please click here
Reply
 
LinkBack Thread Tools
Old 07-11-2002, 09:49 PM   #1
Klered
Member
 
Join Date: Apr 2002
Location: Boston USA
Posts: 39
Klered is on a distinguished road
Greetings,

I have attempted to add some code to get the speech trigger to work on an item in inventory(SMAUG 1.4a).

I think I need some help with oprog_wordlist_check and was wondering if there was anyone deeply familiar with this part of the code. If you are, and would like to assist me on this, please contact me off list at admin@perishedlands.com and I will give you the specifics of what I have done.

TIA,

KL
Klered is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-11-2002, 10:38 PM   #2
erdos
 
Posts: n/a
In order to make speech triggers trigger items in a char's inventory, you need to adjust the "oprog_speech_trigger" function in mud_prog.c.  You'll notice that this small function loops through the items on the floor.  So just add 1 or 2 loops to loop through the items in the person's inventory (and, optionally, to loop through the inventories of other people in the room).  So if you want it to loop through everyone's inventories, the new oprog_speech_trigger will look like this:

void oprog_speech_trigger( char *txt, CHAR_DATA *ch )
{
   OBJ_DATA *vobj;
   CHAR_DATA *vchar;

   /* supermob is set and released in oprog_wordlist_check */
   for ( vobj=ch->in_room->first_content; vobj; vobj = vobj->next_content )
if ( HAS_PROG(vobj->pIndexData, SPEECH_PROG) )
   oprog_wordlist_check(txt, supermob, ch, vobj, NULL, SPEECH_PROG, vobj);

   for ( vchar = ch->in_room->first_person; vchar; vchar = vchar->next_in_room )
   for ( vobj = vchar->first_carrying; vobj; vobj = vobj->next_content )
   if ( HAS_PROG( vobj->pIndexData, SPEECH_PROG ) )
   oprog_wordlist_check( txt, supermob, ch, vobj, NULL, SPEECH_PROG, vobj );

return;
}
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-12-2002, 09:42 PM   #3
Klered
Member
 
Join Date: Apr 2002
Location: Boston USA
Posts: 39
Klered is on a distinguished road
Wow.

Im speechless!

I have been trying to figure this out for a week, and thought that the problem was in the set_supermob code. I even went to ROD and spoke with 2 immortals there to see if they had implemented it.

Thankyou so much. *bow*

Klered
Klered is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools


Smaug Code Help Please - Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I learn to code? fleshofchaos MUD Coding 7 01-23-2006 04:44 AM
um..how do I code? Asalyt MUD Coding 12 05-26-2004 05:03 AM
Gun Code Shadow MUD Coding 1 07-10-2002 05:17 PM
Teaching myself to Code, but... Vesper MUD Coding 4 07-05-2002 10:33 AM
I would like to code! Zellius Advertising for Staff 1 07-03-2002 08:59 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 10:23 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Style based on a design by Essilor
Copyright Top Mud Sites.com 2007