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 ➜ Adding obj level variable

Adding obj level variable

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


Pages: 1  2 

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #15 on Thu 12 May 2005 04:44 PM (UTC)
Message
Yes it turns out mset wasn't setting the index var. But now if I set the index variable, save/foldarea, and hotboot, it'll reset to 0.

Level: 7 (7)
(foldarea, hotboot)
Level: 7 (0)

Does anyone know why?

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

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #16 on Thu 12 May 2005 05:09 PM (UTC)
Message
As was mentioned to me before when working out the hotboot / rare items issues, it's probably one of two broad possibilities. Either it's not saving properly and thus not being read properly back in (the level I mean) OR it is saving properly but just not reading back in properly and therefore taking the default / initial value of zero.

I realize that's no exact solution but that's all I can suggest, that maybe something is off in fread_obj or fwrite_obj somehow?


"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #17 on Thu 12 May 2005 05:30 PM (UTC)

Amended on Thu 12 May 2005 05:31 PM (UTC) by Zeno

Message
I don't even see where it saves index data. Looking at item_type (since this saves the index):

fwrite obj:
    if ( obj->item_type != obj->pIndexData->item_type )
        fprintf( fp, "ItemType     %d\n",       obj->item_type       );


fread_obj:
            KEY( "ItemType",    obj->item_type,         fread_number( fp ) );

...
                    obj->item_type = obj->pIndexData->item_type;


Now the last line... that wouldn't be it would it? I doubt it, since each obj level is unique. (IE, if spawned off a mob its that mobs level)

Here's object level:

fwrite_obj:
    if ( obj->level )
      fprintf( fp, "Level        %d\n", obj->level                   );


fread_obj:
            KEY( "Level",       obj->level,             fread_number( fp ) );


That's it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.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.


53,834 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.