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

Reply
 
Thread Tools
Old 01-20-2003, 12:53 AM   #1
Verboden Faction
 
Posts: n/a
I ask a lot, but hey, how else can I learn? Right? Well, i need to add a enw wear location. And I can't find all the points to add info about it at. help? I use the latest rom
  Reply With Quote
Old 01-20-2003, 08:50 AM   #2
jornel
Member
 
Join Date: Sep 2002
Location: Canada
Posts: 73
jornel is on a distinguished road
I don't know ROM but I'll show you what you have to do in smaug and you can just do what applies in your case.  I'll assume the new wear location is called a 'greedle'.

First you want to define a new 'wear flag' for objects.  In mud.h insert your new

     #define ITEM_WEAR_GREEDLE  ??

just before the ITEM_WEAR_MAX and increment that constant as well.  Similarly, insert a WEAR_GREEDLE in the wear_locations enum just before MAX_WEAR.

Next you want your builders to be able to set and reset that bit on objects, so in build.c you have to place the element "greedle" at offset ?? in the w_flags[] array.  In smaug 1.4 there is also a duplicate of that array called item_w_flags[] which is only referenced by mprog.c  Add "greedle" there too.  Perhaps one day they will eliminate that redundancy.

At this stage, I would do a make clean and reboot the mud just to make sure you can set and reset this flag in OLC, as well as see it set when you ostat an item.  Once you are satisfied that you have control over this flag it is time to make the flag actually do something.

In act_info there is an array called where_name[] which is used when someone looks at someone else and sees what they are wearing in which location.  Here we insert the string "<worn on greedle>" at the appropriate offset.

In act_obj.c in function wear_obj() there is a big switch statement that you have to add a new case for WEAR_ITEM_GREEDLE.   I made this one by copying the case statements for case WEAR_ITEM_FACE, and changing all the FACEs to GREEDLEs like this:

[code]
 case ITEM_WEAR_GREEDLE;
   if ( !remove_obj( ch, WEAR_GREEDLE, fReplace ) )
      return;
   if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
   {
     act( AT_ACTION, "$n places $p on $s greedle.",   ch, obj, NULL, TO_ROOM );
     act( AT_ACTION, "You place $p on your greedle.", ch, obj, NULL, TO_CHAR );
   }
   equip_char( ch, obj, WEAR_GREEDLE );
   oprog_wear_trigger( ch, obj );
   return;
[/quote]
Your code may look different, but you get the general idea.
 
Recompile, reboot, and show off your new greedle to the world!
jornel is offline   Reply With Quote
Old 01-27-2003, 11:31 AM   #3
Terloch
Member
 
Join Date: Apr 2002
Location: Chicago, Illinois
Posts: 152
Terloch is on a distinguished road
Veratio,

I'm at work right now and can't get to all of my files, but I have a system that makes it very easy to add wearbits AND to get them to sort in any order that you choose. One of the first things I did when I started up my mud was to add in new wearbits, but I didn't want to just add them in at the bottom of the current list, so I redid all of the resets, wearbits, and so on, which was a HUGE pain in my arse. The last time I added in new slots for things like knees, shins, etc, we figured out how to sort it all using the existing information, and just adding a couple of new things to make it show differently...

I'll pull out what is needed tonight, drop me a PM on here, or an email...

Terloch
Terloch is offline   Reply With Quote
Reply


Thread Tools


Wear location - Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken World have changed location! mikosevaar MUD Announcements 0 10-23-2006 04:49 AM
Complex wear positions karlan Advanced MUD Concepts 2 06-29-2003 11:15 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

All times are GMT -4. The time now is 10:33 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014