Quick question how could you make it so that weapons have more than 5 variables. I want to add a variable for speed and damage to small, med/large char and other little dnd stuff.
Weapon Variables
Posted by Halomantis on Sun 28 Sep 2003 06:04 PM — 8 posts, 28,042 views.
The quick answer is that you don't. :)
Actually, you have 6 object values available to play with. But that's still not enough for what you need.
Basically, objects aren't stored in a format that depends on their type. All objects share the same format.
So, what you would need to do is to increase the size of the values array in the obj_data structure, AND the obj_index_data stucture (the prototype.)
Then, you'd have to edit all save and load routines to incorporate the added size, as well as many other functions that depend on the magic number '6' as being the amount of values that are stored.
You'll have to change functions such as fold_area, save_char_obj, and the read functions... and a whole bunch of others.
I'd recommend that you not do this unless you know how to program comfortably, and are not worried about having all your area and player files trashed in the event of an error... that kind of thing can happen quite frequently when you're dealing with stuff like this.
Actually, you have 6 object values available to play with. But that's still not enough for what you need.
Basically, objects aren't stored in a format that depends on their type. All objects share the same format.
So, what you would need to do is to increase the size of the values array in the obj_data structure, AND the obj_index_data stucture (the prototype.)
Then, you'd have to edit all save and load routines to incorporate the added size, as well as many other functions that depend on the magic number '6' as being the amount of values that are stored.
You'll have to change functions such as fold_area, save_char_obj, and the read functions... and a whole bunch of others.
I'd recommend that you not do this unless you know how to program comfortably, and are not worried about having all your area and player files trashed in the event of an error... that kind of thing can happen quite frequently when you're dealing with stuff like this.
Just a note, there was a string a little while back about adding new variables to thge mob structure, 2 methods were note, if you decide to do it, check that out if your unfamiliar with what to do.
How about this? I'm trying to add more flags to the item flags category. I added the new flags to every list of item flags in the ibuild.c file, the handler.c file, the build.c file, and to the item_extra_flags struct in mud.h. However, whenever I try to
'oset *vnum* flags *newflag*'
it still says Unknown Flag. Any ideas?
'oset *vnum* flags *newflag*'
it still says Unknown Flag. Any ideas?
Note that you can only have so many flags. If you go above the limit (32 I think? - BV0 to BV31) it probably won't find it.
Did you remember to specify the flag name in build.c?
Did you remember to specify the flag name in build.c?
I added 10 flags which makes 44 flags (so there must have origionally been 34). On build.c I added the flags to:
char * const o_flags [] =
I think that's the only place in build.c where you'd need them.
char * const o_flags [] =
I think that's the only place in build.c where you'd need them.
Well I upped the structure size to 44 so all my variables fit and now it works fine. Thank you!
If you're not using extended flags, this won't work, you should know. It may seem to work, but it may not actually be working.
Check the flags after setting them; make sure they're exactly what you expect them to be.
Check the flags after setting them; make sure they're exactly what you expect them to be.