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
➜ Turning room flags into extended bit vectors and getting errors
|
Turning room flags into extended bit vectors and getting errors
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Sun 11 Dec 2005 04:26 AM (UTC) |
| Message
| I have used a guide to turn my room flags into extended bit vectors and ive had quite a problem with this error, I managed to get it down to 3 errors.
build.c: In function `fold_area':
build.c:6192: warning: int format, pointer arg (arg 3)
build.c:6194: warning: int format, pointer arg (arg 3)
mapout.c: In function `add_new_room_to_map':
mapout.c:365: `rm' undeclared (first use in this function)
mapout.c:365: (Each undeclared identifier is reported only once
mapout.c:365: for each function it appears in.)
Here is 6192 and 6194 of build.c
room->sector_type, room->tele_delay, room->tele_vnum, room->tunnel );
fprintf( fpout, "0 %d %d\n", print_bitvector(&room->room_flags), room->sector_type );
mapout.c 365
xSET_BITS(location->room_flags, rm->room_flags);
| | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #1 on Sun 11 Dec 2005 04:41 AM (UTC) |
| Message
| This is what I have:
build.c:
fprintf( fpout, "0 %s %d %d %d %d\n", print_bitvector(&room->room_flags),
room->sector_type,
room->tele_delay,
room->tele_vnum,
room->tunnel );
mapout:
xSET_BITS(location->room_flags, rm->room_flags);
Looks like you forgot to declare rm in the mapout code? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #2 on Sun 11 Dec 2005 05:54 AM (UTC) |
| Message
| | I guess so The above code doesnt look any different...and im not exactly sure what rm is x_x is it remove? | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #3 on Sun 11 Dec 2005 06:17 AM (UTC) |
| Message
| | Well it should be a room data index. As for the first code, the %d was changed to a %s. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #4 on Sun 11 Dec 2005 06:51 AM (UTC) |
| Message
| | Rock on that fixed the first code up, where would i find the room data indexes at? Thanks alot Zeno you are so helpfull =P | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #5 on Sun 11 Dec 2005 04:29 PM (UTC) |
| Message
| | Can you show me the instruction in the guide that told you to add that line in mapout? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #6 on Sun 11 Dec 2005 05:42 PM (UTC) |
| Message
| sure thing.
mapout.c
location -> room_flags = ROOM_PROTOTYPE && rm -> room_flags;
becomes
xCLEAR_BITS(location->room_flags);
xSET_BITS(location->room_flags, rm->room_flags);
xSET_BIT(location->room_flags, ROOM_PROTOTYPE);
| | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #7 on Sun 11 Dec 2005 05:47 PM (UTC) |
| Message
| Well since you had a rm in the previous mapout, which was changed, it should be fine. Seems like you did something wrong?
location -> room_flags = ROOM_PROTOTYPE && rm -> room_flags;
|
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #8 on Sun 11 Dec 2005 05:51 PM (UTC) |
| Message
| | Im not too sure what was done wrong, I followed the guide word for word. Any idea where to even look for an error? | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #9 on Sun 11 Dec 2005 06:00 PM (UTC) |
| Message
| | Revert mapout.c to the original state? If it compiles, then rm was declared and you for some reason had removed that declaration. I don't even know if it's initialized now, so declaring it may not do much. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #10 on Sun 11 Dec 2005 06:11 PM (UTC) |
| Message
| | I just removed it all together, since mapout is just used to making maps. And I dont like those maps...Now my problem is when i try to put a flag on a room it sets it as a different flag x_x | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #11 on Sun 11 Dec 2005 07:01 PM (UTC) |
| Message
| | What's the lines in do_redit that sets the flag? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #12 on Sun 11 Dec 2005 07:08 PM (UTC) |
| Message
|
if( !str_cmp( arg, "flags" ) )
{
if( !argument || argument[0] == '\0' )
{
send_to_char( "Toggle the room flags.\n\r", ch );
send_to_char( "Usage: redit flags <flag> [flag]...\n\r", ch );
return;
}
while( argument[0] != '\0' )
{
argument = one_argument( argument, arg2 );
value = get_rflag( arg2 );
if( value < 0 || value > MAX_BITS )
ch_printf( ch, "Unknown flag: %s\n\r", arg2 );
else
{
if( 1 << value == ROOM_PROTOTYPE && get_trust( ch ) < LEVEL_GREATER )
send_to_char( "You cannot change the prototype flag.\n\r", ch );
else
xTOGGLE_BIT( location->room_flags, 1 << value );
}
}
return;
}
| | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #13 on Sun 11 Dec 2005 07:12 PM (UTC) |
| Message
| | Ooh i got the error fixed, thanks for your help bro! | | Top |
|
| Posted by
| Conner
USA (381 posts) Bio
|
| Date
| Reply #14 on Sun 11 Dec 2005 09:24 PM (UTC) |
| Message
| | You really should post how you fixed it so others will know if they run into the same problem. |
-=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 |
|
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.
59,515 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top