Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Weapon Variables

Weapon Variables

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Halomantis   (27 posts)  Bio
Date Sun 28 Sep 2003 06:04 PM (UTC)
Message
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.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Sun 28 Sep 2003 06:49 PM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #2 on Tue 30 Sep 2003 02:39 PM (UTC)
Message
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.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zuccuss   (8 posts)  Bio
Date Reply #3 on Thu 15 Jan 2004 04:51 PM (UTC)
Message
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?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Thu 15 Jan 2004 07:32 PM (UTC)
Message
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?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Zuccuss   (8 posts)  Bio
Date Reply #5 on Thu 15 Jan 2004 10:45 PM (UTC)
Message
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.
Top

Posted by Zuccuss   (8 posts)  Bio
Date Reply #6 on Fri 16 Jan 2004 04:28 AM (UTC)
Message
Well I upped the structure size to 44 so all my variables fit and now it works fine. Thank you!
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #7 on Fri 16 Jan 2004 04:56 AM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,965 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.