[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]  Specific containers

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Specific containers
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
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 Gadush   (92 posts)  [Biography] bio
Date Mon 09 Feb 2004 04:21 PM (UTC)  quote  ]
Message
Thanks Greven, that is an excellent suggestion. Now I have a direction to go in. By the way, you may have noticed I am trying to work on smaller things, to help with learning, rather than my favorite idea of tactical movement. But someday, after I have learned more, I will revisit that idea, and thanks to folks like you, maybe I will actually make it work.
Gadush
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Mon 09 Feb 2004 03:46 PM (UTC)  quote  ]
Message
I think the easiest thing to do would be to simply use existing container, but utilize the unused value fields. For example, you could put a check in do_put:
if (obj->value[3] > 0 && obj->value[3] != putobj->type)
send_to_char("That container cannot hold that type of item!", ch);
return;


Then in build.c, you could simple use "oset <obj> v3 <itemvalue>", or write something that would accept a word rather than a number. This could be done by copying "oset <obj> type <word>", but make it affect v3 instead of obj->type, since its stored as a number anyways.

This avoids a large headache with new container, because there is lots of code dealing with them that might be above a beginners head. Plus this method does not require more fields or object type, just a little bit more code.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Gadush   (92 posts)  [Biography] bio
Date Mon 09 Feb 2004 03:01 PM (UTC)  quote  ]
Message
I am interested in developing/implementing a new container type specific_container, that will only allow a certain object to be put into it. Does anyone think this is possible?
My first idea would be to use this for sheaths and scabbards, that would only hold specific weapons. Then I could implement a Draw and Sheathe command for taking the weapon out and automatically wielding it, or unwielding the weapon and automatically putting it into the sheath container, which is worn.
How hard is it to implement a new container type?
Any help/thoughts on this are appreciated.
Gadush
[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.


1,408 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]