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 ➜ Help with Overland

Help with Overland

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


Posted by Lerkista   (57 posts)  Bio
Date Sun 14 Sep 2014 09:25 PM (UTC)
Message
Hi, anyone have Overland snippet running in Smaugfuss 1.9??

I´ve patched all the files, but overland.c givme a lot of errors like:


overland.c:186: error: deprecated conversion from string constant to 'char*'
....(many other errors about line 186: const struct sect_color_type sect_show[])...
overland.c:201: error: deprecated conversion from string constant to 'char*'
.....(many other errors about line 201: char *landmark_distances[]).....
overland.c: In function 'void fread_landmark(LANDMARK_DATA*, FILE*)':
overland.c:699: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'void add_landmark(short int, short int, short int)':
overland.c:821: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'void do_survey(CHAR_DATA*, char*)':
overland.c:931: error: format '%d' expects type 'int', but argument 3 has type 'double'
overland.c: In function 'void do_setmark(CHAR_DATA*, char*)':
overland.c:997: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'void fread_entrance(ENTRANCE_DATA*, FILE*)':
overland.c:1121: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'void modify_entrance(ENTRANCE_DATA*, short int, short int, short int, short int, short int, short int, int, char*)':
overland.c:1292: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'void add_entrance(short int, short int, short int, short int, short int, short int, int)':
overland.c:1314: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'void load_mapfile(char*, short int)':
overland.c:1985: error: deprecated conversion from string constant to 'char*'
overland.c: In function 'void load_maps()':
overland.c:2035: error: invalid conversion from 'const char*' to 'char*'
overland.c:2035: error:   initializing argument 1 of 'void load_mapfile(char*, short int)'
overland.c: In function 'ch_ret process_exit(CHAR_DATA*, short int, short int, short int, int)':
overland.c: In function 'void reload_map(CHAR_DATA*)':
overland.c:3319: error: invalid conversion from 'const char*' to 'char*'
overland.c:3319: error:   initializing argument 1 of 'void load_mapfile(char*, short int)'
overland.c: In function 'void do_mapedit(CHAR_DATA*, char*)':
overland.c:3502: error: invalid conversion from 'const char*' to 'char*'
overland.c: In function 'char* bamf_print(char*, CHAR_DATA*)':
overland.c:3602: error: field precision should have type 'int', but argument 4 has type 'long int'
overland.c:3602: error: field precision should have type 'int', but argument 4 has type 'long int'
make[1]: *** [o/overland.o] Error 1


Anyone can help me with this errors?? i don´t know much about type definitions and how to make it interact with other types and that stuff

Thanks
Top

Posted by Lerkista   (57 posts)  Bio
Date Reply #1 on Sun 14 Sep 2014 10:45 PM (UTC)
Message
I have fixed all of the errores except this one:


make -s smaug
  Compiling o/overland.o....
overland.c:186: error: braces around scalar initializer for type 'const sect_color_type*'
make[1]: *** [o/overland.o] Error 1
make: *** [all] Error 2


this is the code:


const struct sect_color_type *sect_show[SECT_MAX] = {
/*   Sector Type		Color	Symbol Description	Passable?	Move  R  G  B	*/

   {SECT_INSIDE, "&x", " ", "indoors", FALSE, 1, 0, 0, 0},
   {SECT_CITY, "&Y", ":", "city", TRUE, 1, 255, 128, 64},
   {SECT_FIELD, "&G", "+", "field", TRUE, 1, 141, 215, 1},
   {SECT_FOREST, "&g", "+", "forest", TRUE, 2, 0, 108, 47},
   {SECT_HILLS, "&O", "^", "hills", TRUE, 3, 140, 102, 54},
   {SECT_MOUNTAIN, "&w", "^", "mountain", TRUE, 5, 152, 152, 152},
   {SECT_WATER_SWIM, "&C", "~", "shallow water", TRUE, 2, 89, 242, 251},
   {SECT_WATER_NOSWIM, "&B", "~", "deep water", TRUE, 2, 67, 114, 251},
   {SECT_AIR, "&x", "?", "air", FALSE, 1, 0, 0, 0},
   {SECT_UNDERWATER, "&x", "?", "underwater", FALSE, 5, 0, 0, 0},
   {SECT_DESERT, "&Y", "~", "desert", TRUE, 3, 241, 228, 145},
   {SECT_RIVER, "&B", "~", "river", TRUE, 3, 0, 0, 255},
   {SECT_OCEANFLOOR, "&x", "?", "ocean floor", FALSE, 4, 0, 0, 0},
   {SECT_UNDERGROUND, "&x", "?", "underground", FALSE, 3, 0, 0, 0},
   {SECT_JUNGLE, "&g", "*", "jungle", TRUE, 2, 70, 149, 52},
   {SECT_SWAMP, "&g", "~", "swamp", TRUE, 3, 218, 176, 56},
   {SECT_TUNDRA, "&C", "-", "tundra", TRUE, 2, 54, 255, 255},
   {SECT_ICE, "&W", "=", "ice", TRUE, 3, 133, 177, 252},
   {SECT_OCEAN, "&b", "~", "ocean", FALSE, 1, 0, 0, 128},
   {SECT_LAVA, "&R", ":", "lava", FALSE, 2, 245, 37, 29},
   {SECT_SHORE, "&Y", ".", "shoreline", TRUE, 3, 255, 255, 0},
   {SECT_TREE, "&g", "^", "impass forest", FALSE, 10, 0, 64, 0},
   {SECT_STONE, "&W", "^", "impas mountain", FALSE, 10, 128, 128, 128},
   {SECT_QUICKSAND, "&g", "%", "quicksand", FALSE, 10, 128, 128, 0},
   {SECT_WALL, "&P", "I", "wall", FALSE, 10, 255, 0, 255},
   {SECT_GLACIER, "&W", "=", "glacier", FALSE, 10, 141, 207, 244},
   {SECT_EXIT, "&W", "#", "exit", TRUE, 1, 255, 255, 255},
   {SECT_TRAIL, "&O", ":", "trail", TRUE, 1, 128, 64, 0},
   {SECT_BLANDS, "&r", ".", "blasted lands", TRUE, 2, 128, 0, 0},
   {SECT_GRASSLAND, "&G", ".", "grassland", TRUE, 1, 83, 202, 2},
   {SECT_SCRUB, "&g", ".", "scrub", TRUE, 2, 123, 197, 112},
   {SECT_BARREN, "&O", ".", "barren", TRUE, 2, 192, 192, 192},
   {SECT_BRIDGE, "&P", ":", "bridge", TRUE, 1, 255, 0, 128},
#ifdef DRAGONFLIGHT
   {SECT_ROAD, "&Y", ":", "road", TRUE, 1, 215, 107, 0},
   {SECT_LANDING, "&R", "#", "landing", TRUE, 1, 255, 0, 0}
#else
   {SECT_ROAD, "&Y", ":", "road", TRUE, 1, 215, 107, 0}
#endif
};


Any help??

Thanks
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 15 Sep 2014 06:07 AM (UTC)
Message
Can you post the declaration for sect_color_type?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lerkista   (57 posts)  Bio
Date Reply #3 on Mon 15 Sep 2014 06:35 AM (UTC)
Message
In overland.h:


extern const struct sect_color_type *sect_show[];

struct sect_color_type                 
{
   short sector;  /* Terrain sector */
   char *color;   /* Color to display as */
   char *symbol;  /* Symbol you see for the sector */
   char *desc; /* Description of sector type */
   bool canpass;  /* Impassable terrain */
   int move;   /* Movement loss */  
   short graph1;  /* Color numbers for graphic conversion */
   short graph2;
   short graph3;
};
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 15 Sep 2014 08:00 PM (UTC)
Message
Why is sect_color_type an array of pointers and not just an array? Try this:


const struct sect_color_type sect_show[SECT_MAX] = {

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 16 Sep 2014 04:07 AM (UTC)

Amended on Tue 16 Sep 2014 04:08 AM (UTC) by Nick Gammon

Message
Also try changing the three char * in the struct to const char *.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lerkista   (57 posts)  Bio
Date Reply #6 on Thu 18 Sep 2014 12:26 PM (UTC)
Message
Hi

I've this errors:


o/overland.o: In function `do_setmark(char_data*, char*)':
/home/lerkista/Mud/overland-smaug/src/overland.c:1109: undefined reference to `do_setmark'
o/overland.o: In function `do_setexit(char_data*, char*)':
/home/lerkista/Mud/overland-smaug/src/overland.c:1455: undefined reference to `do_setexit'
/home/lerkista/Mud/overland-smaug/src/overland.c:1507: undefined reference to `do_setexit'
o/overland.o: In function `do_mreset(char_data*, char*)':
/home/lerkista/Mud/overland-smaug/src/overland.c:1876: undefined reference to `do_mreset'
/home/lerkista/Mud/overland-smaug/src/overland.c:2010: undefined reference to `do_mreset'
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1


I've the same type of errors with the house snippet, it seems like it can't find their own functions, i've declared in mud.h, overland.h etc and nothing works

Any idea??

Thankx
Top

Posted by Lerkista   (57 posts)  Bio
Date Reply #7 on Thu 18 Sep 2014 02:15 PM (UTC)

Amended on Thu 18 Sep 2014 08:45 PM (UTC) by Nick Gammon

Message
Well, i already fix the errors and have overland working, sort of, now i don't know how to config it

i only get this rooms:


Somewhere on the Continent of C1
[Exits: Norte Este Sur Oeste Noreste Noroeste Sureste Suroeste]
+-----------+ If you can read this description online, then something REALLY
| O O O | bad has happened, contact the immortals at once. You should be
| \|/ | seeing the ASCII color map of the continent instead of this
| O O-O-O O | lousy description :)
| \|/|\|/ |
| O-O-@-O-O |
| /|\|/|\ |
| O O-O-O O |
| /|\ |
| O O O |
+-----------+ 


Any help??
The documentation in the snippet don't help, it asumes you're an experiencer smaug programmer :P

thankx
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.


21,447 views.

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.