oh yeah, and this isnt like the gridmaker snippet on kyndig, or at least not supposed to be, theres a file called area.txt with a 10x10 grid thing(thanks to richard lindsey for help with all that, i used that function again in the previous part of this command) and what the first part does is creates each room, and depending on what character it finds in the file it sets the sector to that type, that works great, it creates 100 rooms and sets their individual sectors, this next part is supposed to put them together so it looks similar to the area.txt grid file, except each character in the file has now become a room...

the idea is to be able to make areas really quickly and using the asciimap.c snippet(sorry, i forgot the author) show the area in the form of a map to the player, and sorry for two emails back to back:p

>From: "Tristan M" <[EMAIL PROTECTED]>
>To: [email protected]
>Subject: RE: isolating 1 character from a string
>Date: Wed, 12 May 2004 20:13:08 +0000
>
>Ok, ive been mucking around with this for hours now with no luck, ill try to explain what this is supposed to do...
>
>every room that it checks is already there, that happens earlier in the function and it works perfectly, what this part is supposed to do is go through each room(vnums 1000-1100[its going to become MUCH larger afterwards, just until i get it working) and link them up into a big square where every room is linked to one another...
>
>this is what ive got so far, you guys got any ideas?
>
>{
>blah blah blah....other code is here, that works successfully
>}
>    for( room = 1000 ; room < 1100 ; room++)
>    {
>            int firstchar;
>            int nvalue;
>            char *original;
>            char string1;
>            char *string2;
>
>
>            ch->desc->editor = ED_ROOM;
>
>            sprintf(buf,"%d",room);
>            do_goto(ch, buf );
>            string2 = "";
>
>            original = buf;
>            if ( original[0] != '\0' )
>            {
>                    string1 = original[0];
>                    string2 = &original[3];
>            }
>
>            sprintf(buf,"%c",string1);
>            firstchar = atoi(buf);
>            sprintf(buf,"%c",string2);
>            nvalue = atoi(buf);
>
>
>            if ( firstchar == 100 )
>            {
>
>                    if ( nvalue == 0 )
>                    {
>                            /*Room South*/
>
>                            do_redit(ch, buf);
>                            offset = room + 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room East*/
>
>                            do_redit(ch, buf);
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                    }
>                    if (( nvalue >= 1 ) && ( nvalue <= 8 ))
>                    {
>                            /*Room South*/
>
>                            do_redit(ch, buf);
>                            offset = room + 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room East*/
>
>                            do_redit(ch, buf);
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                            /*Room West*/
>
>                            do_redit(ch, buf);
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_west(ch, buf2 );
>                    }
>                    if ( nvalue == 9 )
>                    {
>                            /*Room South*/
>
>                            do_redit(ch, buf);
>                            offset = room + 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room West*/
>
>                            do_redit(ch, buf);
>                            offset = room - 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                    }
>            }
>
>            if ( firstchar == 101 )
>            {
>                    if ( nvalue == 0 )
>                    {
>                            /*Room North*/
>
>                            do_redit(ch, buf);
>                            offset = room - 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room South*/
>
>                            do_redit(ch, buf);
>                            offset = room + 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room East*/
>
>                            do_redit(ch, buf);
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                    }
>                    if (( nvalue >= 1 ) && ( nvalue <= 8 ))
>                    {
>                            /*Room North*/
>
>                            do_redit(ch, buf);
>                            offset = room - 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room South*/
>
>                            do_redit(ch, buf);
>                            offset = room + 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room East*/
>
>                            do_redit(ch, buf);
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                            /*Room West*/
>
>                            do_redit(ch, buf);
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_west(ch, buf2 );
>                    }
>                    if ( nvalue == 9 )
>                    {
>                            /*Room North*/
>
>                            do_redit(ch, buf);
>                            offset = room - 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room South*/
>
>                            do_redit(ch, buf);
>                            offset = room + 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room West*/
>
>                            do_redit(ch, buf);
>                            offset = room - 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                    }
>            }
>
>            if ( firstchar == 109 )
>            {
>                    if ( nvalue == 0 )
>                    {
>                            /*Room North*/
>
>                            offset = room - 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room East*/
>
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                    }
>                    if (( nvalue >= 1 ) && ( nvalue <= 8 ))
>                    {
>                            /*Room North*/
>
>                            offset = room - 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room East*/
>
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                            /*Room West*/
>
>                            offset = room + 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_west(ch, buf2 );
>                    }
>                    if ( nvalue == 9 )
>                    {
>                            /*Room North*/
>
>                            offset = room - 10;
>                            sprintf(buf2, "%s", offset);
>                            redit_south(ch, buf2 );
>                            /*Room West*/
>
>                            offset = room - 1;
>                            sprintf(buf2, "%s", offset);
>                            redit_east(ch, buf2 );
>                    }
>            }
>    }
>
>_________________________________________________________________
>MSN Premium includes powerful parental controls and get 2 months FREE* http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>--
>ROM mailing list
>[email protected]
>http://www.rom.org/cgi-bin/mailman/listinfo/rom


_________________________________________________________________
Add photos to your e-mail with MSN Premium. Get 2 months FREE* http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines


Reply via email to