Hi all,
Well, I am at it again, the muddling guy trying to understand all this stuff. With a LOT of help, I added room dimensions to smaug, at least partially. Right now, using 'redit rsize' I can assign x, y, and z variables such as 10 x 10 x 10 to any room. It saves, loads, etc. I haven't really done anything with those variables yet though, and I am stuck on a simple part. If I was more intelligent and less bullheaded, I would just give up. Anyway, all I am trying to do right now is get the assigned sizes to display after the room name.
This is added to build.c, to give a room three dimensions x, y, and z.
It works, and saves, and loads. But I can't figure out how to access those numbers, to display them after the room name.
/* added to for rsize */
if ( !str_cmp( arg, "rsize" ) )
{
char xcoord[MAX_STRING_LENGTH];
char ycoord[MAX_STRING_LENGTH];
char zcoord[MAX_STRING_LENGTH];
argument = one_argument( argument, xcoord);
argument = one_argument( argument, ycoord);
argument = one_argument( argument, zcoord);
//Putting this here to verify that what your entering is valid
if ( !xcoord || xcoord[0] == '\0' || !ycoord || ycoord[0] == '\0' || !zcoord ||zcoord[0] == '\0')
{
send_to_char( "Set the room size: width, length, height.\n\r", ch );
send_to_char( "Usage: redit rsize <value> <value> <value>\n\r", ch );
return;
}
//Didn't realize it was location and not room
location->x = atoi(xcoord);
location->y = atoi(ycoord);
location->z = atoi(zcoord);
ch_printf(ch, "Room size set to:\n\r\tWidth: %d\n\r\tLength %d\n\r\tHeight %d\n\r", location->x, location->y, location->z);
return;
}
Here is do_look:
/* 'look' or 'look auto' */
set_char_color( AT_RMNAME, ch );
send_to_char( ch->in_room->name, ch );
send_to_char( " Size: %d X %d X %d\n\r",
location->x,
location->y,
location->z );
This won't work, because location isn't declared, etc. How do I grab the variables?
I just can't get this stuff, dang it. How can I access the variables x, y, and z, that I set in build with rsize function? I want to be able to have 'look' show:
A Small Cottage Size: <x> X <y> X <z>
Where x, y, and z are the variables set in the room. Those variables are part of room_index_data.
Thanks,
Gadush |