Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Google, DotBot

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Object Cost for O Resets
Forum Rules | Mark all | Recent Posts

Object Cost for O Resets
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
* #1 Nov 24, 2014, 11:17 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

So as Dwip and I were going over some stuff today, it came up that objects placed into the game via an O reset get their cost set to zero.

I checked our code in AFKMud. We use cost as would be expected - the object's worth. Our code has no other use case for the field.

Checked SmaugFUSS, it has the same issue. Object cost in an O reset is set to zero. Again, a check for where cost is used yields no reason for why this is happening.

So I checked the official 1.8 branch. Found the same. Checked 1.4. Also the same. Don't have a 1.02 handy but I figure it's the same too.

Does anyone have any idea why this would be done, and ONLY on an O reset? The snippet of code looks like this in reset.c:
            if( count_obj_list( pObjIndex, pRoomIndex->first_content ) < 1 )
            {
               obj = create_object( pObjIndex, number_fuzzy( generate_itemlevel( room->area, pObjIndex ) ) );
               if( num > 1 )
                  pObjIndex->count += ( num - 1 );
               obj->count = pReset->arg2;
               obj->level = UMIN( obj->level, LEVEL_AVATAR );
               obj->cost = 0;
               obj_to_room( obj, pRoomIndex );
            }


Checked the other types, such as G, E, and P. They don't do this.
       
Post is unread #2 Nov 25, 2014, 5:14 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

My only guess would be that some code further downstream sets (or was supposed to set) the value after the new objects got loaded via reset.

I could sortof see the thinking for stuff like shops, where the price varies by how many of a thing exist in the world, but it makes more sense to just leave it alone and hand-adjust them later if that's what you want to do.

Probalby an artifact of C not having a real "undef" type.. IE: 0 gets used to mean both ZERO and "not yet given a value". hate that.
       
Post is unread #3 Nov 25, 2014, 5:19 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

It doesn't really make much sense to set it to 0 if it's not being set anywhere else. Unless for shops it's pulling the Index field for cost and using that to set a cost in the store. I'll have to poke around later and see what I can turn up.
       
Post is unread #4 Nov 25, 2014, 1:12 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

I haven't been able to find anything, and if it made any sense for O resets, why not G, E, or P resets?

I suspect it's just a long standing bug that should get fixed. I'm kind of surprised nobody has ever reported issues with objects of no value they found laying around in all these years though.
       
Post is unread #5 Nov 25, 2014, 7:20 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

Well i think they did that so any item that might have been placed in the rooms when the resets were adjusted would just always be set to 0 so that no one can take advantage of it and they are more likely to report the issue. I recalled seeing it years ago and I just left it since most things that are in a room have no real value unless its of type money and it uses values instead of cost anyways. Im up for what ever yall decide on this though since I know if i set an objects cost it would be handy for any place it is found to have the right cost :)
       
Post is unread #6 Nov 25, 2014, 10:55 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

After looking at the shop code, it appears at first glance to use the index data's cost field in the calculations for sell/buy values. If that really is the case, (I only had a few minutes to spare) then leaving the cost on a reset item as 0 seems like a reasonable setting. The value doesn't really seem used anywhere else. So I don't really see the need to change it, unless some other scrap of information surfaces about it being an issue.
       
Post is unread #7 Nov 26, 2014, 1:05 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Could just be something we changed in AFKMud then. It was impossible to sell the O reset objects to a shopkeeper due to the cost variable being zeroed out.
       
Post is unread #8 Nov 26, 2014, 4:18 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

It's probably also an artifact of Merc blindly ripping out the fully functional and used repair and rent systems from DikuMUD, which *DO* use the item value fields to determine rent/repair costs, right alongside the shop code for selling the items (or buying new ones).

I would probably suggest making the system work properly (IE: not wiping the value field), and then if there's an abuse issue... handle THAT. Don't cripple the code to avoid dealing with a staff issue. :)

PS: If you don't want shopkeepers to buy anything and everything, just limit most of them so they can only buy things they have in their shop inventory. That way, when you collect 5000 rusty daggers from the room they keep resetting in, you have to find the one vendor in the game who actually sells rusty daggers to be able to sell them.. and if your shop code adjusts prices by supply levels, after you sell the first couple, the price will floor anyways.
       
Post is unread #9 Nov 26, 2014, 1:16 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Yeah. Already commented it out in AFKMud. I don't really see the difference between the rusty dagger resetting on the ground vs resetting inside of a chest. It's not logical for the one on the ground to be worthless if the one in the chest sells for 50 gold.
       
Pages:<< prev 1 next >>