[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Turning room flags into extended bit vectors and getting errors
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Turning room flags into extended bit vectors and getting errors

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1 2  

Posted by Mopop   (115 posts)  [Biography] bio
Date Sun 11 Dec 2005 04:26 AM (UTC)  quote  ]
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);


[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #1 on Sun 11 Dec 2005 04:41 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #2 on Sun 11 Dec 2005 05:54 AM (UTC)  quote  ]
Message
I guess so The above code doesnt look any different...and im not exactly sure what rm is x_x is it remove?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #3 on Sun 11 Dec 2005 06:17 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #4 on Sun 11 Dec 2005 06:51 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #5 on Sun 11 Dec 2005 04:29 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #6 on Sun 11 Dec 2005 05:42 PM (UTC)  quote  ]
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);
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #7 on Sun 11 Dec 2005 05:47 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #8 on Sun 11 Dec 2005 05:51 PM (UTC)  quote  ]
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?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #9 on Sun 11 Dec 2005 06:00 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #10 on Sun 11 Dec 2005 06:11 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #11 on Sun 11 Dec 2005 07:01 PM (UTC)  quote  ]
Message
What's the lines in do_redit that sets the flag?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #12 on Sun 11 Dec 2005 07:08 PM (UTC)  quote  ]
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;
   }


[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #13 on Sun 11 Dec 2005 07:12 PM (UTC)  quote  ]
Message
Ooh i got the error fixed, thanks for your help bro!
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #14 on Sun 11 Dec 2005 09:24 PM (UTC)  quote  ]
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
[Go to top] 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.


5,146 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]