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 ➜ Problem with putting an object underneath another..

Problem with putting an object underneath another..

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


Posted by Tribio   Belgium  (3 posts)  Bio
Date Mon 25 Dec 2006 01:50 PM (UTC)
Message
Greetings all,

My girlfriend and I have just recently started our own MUD (as an experiment, and to learn a new progging language). All goes well, but there is one thing I just can't seem to get figured out:

I create two objects (a welcome mat and a mansion key), and I'd like the key to be under the mat when the area resets. The object creating was as follows:

ocreate 5000 welcome mat
oset 5000 short a Welcome mat
oset 5000 long a doormat, greeting you with a warm Welcome, is here on the ground..
oset flags covering

ocreate 5001 mansion key
oset 5001 short the key to the mansion
oset 5001 long a beautifully adorned key is lying here..
oset 5001 type key

But now, every time I want to put key under mat I get the message "It won't fit in there."

Anyone an idea what I'm missing here?
Thanks in advance,
Sincerely,
Tribio

In Auril's name, from winter's veil,
My claw tears through the frozen air,
Neither your might nor earthly means,
Will save you from your deaths despair.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Mon 25 Dec 2006 03:54 PM (UTC)
Message
It depends on the weight, I believe. The item to put it under needs to have more weight than the object you're trying to put under it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Tribio   Belgium  (3 posts)  Bio
Date Reply #2 on Mon 25 Dec 2006 05:37 PM (UTC)
Message
Hello,

Well, I tried altering the weight of the mat and the key, and in neither of the two cases (mat > key and key > mat) am I able to put the key under the mat..

If the key weighs more than the mat, I get "It won't fit under there.". On the other hand, if the mat weighs more, I get "It won't fit."

Darn odd if you ask me.. Other suggestions are accepted, since I've got no idea what the prob could be..


And something different:
Have browsed the net a bit, and found that some people use 'reset add obj put 5001 5000' for instance, but reset only works with the following params on my machine:

Usage: reset area
Usage: reset list
Usage: reset randomize <direction>
Usage: reset delete <number>
Usage: reset hide <objname>
Usage: reset trap room <type> <charges> [flags]
Usage: reset trap obj <name> <type> <charges> [flags]

So I have no idea how to use the commands from 'help resetcmds'..


Already thanks for the input.
Greetings,
Tribio

In Auril's name, from winter's veil,
My claw tears through the frozen air,
Neither your might nor earthly means,
Will save you from your deaths despair.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Tue 26 Dec 2006 12:10 AM (UTC)
Message
        if ( (IS_OBJ_STAT(container, ITEM_COVERING)
        &&   (get_obj_weight(obj) / obj->count)
          > ((get_obj_weight(container) / container->count)
          -   container->weight)) )
        {        
            send_to_char( "It won't fit under there.\n\r", ch );
            return;
        }


        /* note use of get_real_obj_weight */
        if ( (get_real_obj_weight(obj) / obj->count)
           + (get_real_obj_weight(container) / container->count)
           >  container->value[0] )
        {
            send_to_char( "It won't fit.\n\r", ch );
            return;
        }


That is the code for what you're getting. You're sure the container has the covering flag, correct?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #4 on Tue 26 Dec 2006 01:14 AM (UTC)
Message
The reset system was changed for SmaugFUSS, the reset add obj... only works in Smaug 1.4a, SmaugFUSS uses the new reset system which only has the parameters you've listed, so your best bet is to get everything the way you want it and just let instaroom create the right resets for you.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #5 on Tue 26 Dec 2006 08:10 AM (UTC)
Message
It's kind of a subtle problem, but a covering item is a container. Containers not only have weight, but they also have capacity. It's the capacity that is often overlooked. I suspect that's where your problem lies here.

The first portion of the code checks raw weight. If the object weighs less than the item that it should be sitting under, then it should slide in and be done with it. But it doesn't.

The second portion of the code is called regardless of whether or not the original conditions were met. This is where that subtle capacity figure comes in.

The container item needs to have a capacity set on its value[0]. For the purposes of your floor mat, it should have a capacity which is greater than the key's weight. Once this is set you should be able to put the key under the mat.
Top

Posted by Tribio   Belgium  (3 posts)  Bio
Date Reply #6 on Tue 26 Dec 2006 12:27 PM (UTC)
Message
Hello,

Already thanks very much for the input.. And still I find it odd that it just doesn't work at all.. I'll post here what I do exactly in order to create my objects and to try to put it underneath.. Who knows I might be overlooking the easiest thing?

ocreate 5002 welcome mat
oset 5002 type container
oset 5002 flags covering
oset 5002 weight 50
oset 5002 value0 100
drop mat

ocreate 5003 mansion key
oset 5003 type key
oset 5003 weight 1
put key mat

And then I get the errors.. Do I need to save the area first before even attempting to put something under the mat? Or am I forgetting instarooms or something like that?
I'm totally clueless, so any help is very appreciated..

Sincerely,
Tribio

In Auril's name, from winter's veil,
My claw tears through the frozen air,
Neither your might nor earthly means,
Will save you from your deaths despair.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Tue 26 Dec 2006 06:39 PM (UTC)
Message
Maybe the items can't be prototype? Also it seems you're forgetting the 'take' wear flag on the key.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Tertullian   (1 post)  Bio
Date Reply #8 on Mon 15 Oct 2007 06:41 PM (UTC)
Message
I know it's been over a year and hopefully you've found a solution by now. But just in case, here's my thoughts.

I utilized the "covering" flag in the first area I made. It works fine even though the covering object is NOT a container.

However, I cannot put items under the object, which in this case is a piece of furniture - a table. I had to utilize the "put" reset to get the covered objects there. We're using SMAUG 1.4a, not SmaugFUSS, so I'm not sure what you would have to do to replicate this.

In my case, once an object has been removed from under the table, you cannot replace it back under the table. As far as I know, the only way to put objects underneath other objects is to use the "put" reset.
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.


30,544 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.