[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  How do ya add a new item type?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: How do ya add a new item type?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Samryn   United Kingdom  (60 posts)  [Biography] bio
Date Mon 22 Aug 2005 01:32 PM (UTC)  quote  ]
Message
I've just done the same thing, and tried to encounted EVERY problem you've had.

Heres some questions for you.

  1. When you declared you ITEM_<NAME> did you put a comma at the end? if you did, remove the last comma. (im sounding like a help desk now, lol) because you souldn't have one there.

  2. Did you mis-spell anything? easy mistake i do it all the time...

  3. on o_types did you add a comma after "chance" ? and did you remember to not put a comma on the new one?

  4. And when you type Ostat are you getting any logs? if so cant you add them on here, cheers.


Hope this helps,
Samryn

ps sorry about sounding like a help desk.

Samryn Medri
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 09 Aug 2005 10:10 PM (UTC)  quote  ]
Message
You'll have to look at the code in do_ostat that picks up the item type. Look at what it's doing, and make sure that you've added fields wherever it's reading from. I can't help you much more since I don't have the code at hand. Consider it a very, very useful learning experience. :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Longbow   (102 posts)  [Biography] bio
Date Tue 09 Aug 2005 09:44 PM (UTC)  quote  ]
Message
Hmm, that's not it. I also went and changed the MAX_ITEM_TYPE definition below the object types in mud.h to read my new type instead of ITEM_CHANCE. Still no go. Something else I need to change, and did I need to change that definition?
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 09 Aug 2005 09:37 PM (UTC)  quote  ]
Message
That is the most likely cause. Unfortunately I don't have the original SMAUG code on-hand to help you; I reworked that part of the code a fair while ago. I don't have the o_types array anymore, for instance.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Longbow   (102 posts)  [Biography] bio
Date Tue 09 Aug 2005 09:31 PM (UTC)  quote  ]

Amended on Tue 09 Aug 2005 09:43 PM (UTC) by Longbow

Message
Ok, I added the lines and it seems to recognize that they are to some sense existant, but when I try to assign the type to an object it says it works, but when you ostat it it says the type is unknown! What would cause this? Perhaps my otype lineup is not correct?

Godbless,
Longbow

[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 09 Aug 2005 09:03 PM (UTC)  quote  ]
Message
In build.c there is an array called o_types that corresponds one-to-one with your item types. You need to add a string entry there in the same relative position as your type is in the mud.h definitions.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Longbow   (102 posts)  [Biography] bio
Date Tue 09 Aug 2005 08:49 PM (UTC)  quote  ]
Message
It's not working in the sense that I can't set an object to be that type. I put an entry under mud.h's itemtypes, in db.c, and in act_obj.c, which are the only places I know to put them. Is there somewhere else, or perhaps do I have to set the type ingame somehow?

Thanks and Godbless,
Longbow
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 09 Aug 2005 06:27 PM (UTC)  quote  ]
Message
Where have you inserted it so far and how is its "not-workingness" manifested?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Longbow   (102 posts)  [Biography] bio
Date Tue 09 Aug 2005 06:23 PM (UTC)  quote  ]
Message
Ok, I've gone and done it this time. I know it's probably a very newbish question to ask, but hey, I'm a very newbish fellow. :) How do you add a new ITEM_TYPE? I grepped Item_Ring and put instances of the new type in each of the places where Item_Ring was, and then when that didn't work I grepped other types too. I've searched the forum's server FAQ and I've even taken the amazing step of actually visiting the SMAUG homepage FAQ, and still no go.

What I'd like is a list of all the places that a new item type should be inserted into the code. If anyone could please post one here I'd be very appriecative.

Thanks and Godbless,
Longbow
[Go to top] 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.


3,309 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]