09 Mar, 2009, Guest wrote in the 1st comment:
Votes: 0
With my rom quickmud, when i set an objects condition in olc to 100, then asave, with both identify %d obj->condition and ostat say condition 0, anyone know why so i can correct this?
09 Mar, 2009, Skol wrote in the 2nd comment:
Votes: 0
Oh dang, yeah, object condition in Rom is way messed up.
I completely retooled that so that 100 is perfect, 0 is broken etc.
Look in the save routine, you'll find that it sets it to 0 in the area saving.
09 Mar, 2009, Guest wrote in the 3rd comment:
Votes: 0
theres this… (below) in save_object (olc_save.c)

if (pObjIndex->condition > 90)
letter = 'P';
else if (pObjIndex->condition > 75)
letter = 'G';
else if (pObjIndex->condition > 50)
letter = 'A';
else if (pObjIndex->condition > 25)
letter = 'W';
else if (pObjIndex->condition > 10)
letter = 'D';
else if (pObjIndex->condition > 0)
letter = 'B';
else
letter = 'R';

fprintf (fp, "%c\n", letter);


and this (below) in load_objects (db2.c)

/* condition */
letter = fread_letter (fp);
switch (letter)
{
case ('P'):
pObjIndex->condition = 100;
break;
case ('G'):
pObjIndex->condition = 90;
break;
case ('A'):
pObjIndex->condition = 75;
break;
case ('W'):
pObjIndex->condition = 50;
break;
case ('D'):
pObjIndex->condition = 25;
break;
case ('B'):
pObjIndex->condition = 10;
break;
case ('R'):
pObjIndex->condition = 0;
break;
default:
pObjIndex->condition = 100;
break;
}



if i changed it to…
fprintf( fp, "%d\n", pObjIndex->condition);

pObjIndex->condition		= fread_number( fp );


would i need to open every area and asave them?
09 Mar, 2009, Guest wrote in the 4th comment:
Votes: 0
i put the one addition into save object, then did a asave world then put the other addition in load_objects and put obj->condition to 100 in create_object. seems to be working ok, just gotta put item damaging in.. should be set.. thanks
09 Mar, 2009, Skol wrote in the 5th comment:
Votes: 0
Yep, looking good. Also in 'wear_obj()' I think is the one (in act_obj.c), have it check obj->condition and at 'broken' condition, make it not wearable. I also did damage in battle, then have a new act2 act_repairman, guy that repairs for X cost etc. Some things shouldn't be repairable. You might also try changing the object type to trash on those, as well as doing like: sprintf (buf, "A broken %s lies here." obj->short_descr); then putting that in for it's long etc. Something to break it.
Maybe have armor also check condition for how well it protects etc.

Anyway, it's a lot of fun and really adds to the game if you get it working right. I can put mine up as a snip if you want to compare.
0.0/5