Re: Multiple Start Rooms

jmlemke@icaen.uiowa.edu
Date: 06/06/96


	For newbie start rooms, hometown start rooms, whatever...  
In config.c, follow the definition for mortal_start_room...
Sorta like:
	sh_int newbie_start_room = 18801;
	sh_int hometown1_start_room = 19001;
In db.c, add the checks to make sure that the start rooms exist, and add 
the conversion between vnum and rnum.
You can look at the examples with frozen_start_room and 
immort_start_room, follow those examples and it will work...

Then change the loading code in interpreter.c to check the chars for 
hometown, check their level, whatever... and set load_room to whatever...
Here's what the code looks like now..
	/* If char was saved with NOWHERE, or real_room above failed... */
	if (load_room == NOWHERE) {
	  if (GET_LEVEL(d->character) >= LVL_IMMORT) {
	    load_room = r_immort_start_room;
	  } else {
	    load_room = r_mortal_start_room;
	  }
	}
	if (PLR_FLAGGED(d->character, PLR_FROZEN))
	  load_room = r_frozen_start_room;

	char_to_room(d->character, load_room);

You can add checks like: if(GET_LEVEL(d->character) == 1) {
	 		   load_room = r_newbie_start_room;
or:		 	 if(GET_HOME(d->character) == 1) {
			   load_room = r_hometown1_start_room;
			 if(GET_HOME(d->character) == 2) {
			   load_room = r_hometown2_start_room;

You can also mess with recall code and stuff so that players would recall 
to their hometown, etc... Lots of possibilities...
P.S. Don't forget your extern sh_int newbie_start_room and stuff 
whereever necessary...

> 
> Hi,
>     I'm new to the list (Hi all) and to implementing in general.   Here's my
> problem:
> 
>     I am trying to make it so that players will enter the room at different
> locations.  What I mean by this is that I want new players to start at one
> location and players the quit or have NOWHERE defined as their start location
> to start at another room.  The reason for this is because I have a start up
> sequence of rooms I want new characters to go thru and I only want this to
> happen once.  My problem is that I don't entirely understand the process by
> which players are assigned their starting room.
> 
> I noticed when the character is created there is the following:
> 
> if (GET_PFILEPOS(d->character) < 0)
>    GET_PFILEPOS(d->character) =
>                    					   create_entry(GET_NAME(d->character));init_char(d->character);
> save_char(d->character, NOWHERE);
> SEND_TO_Q(motd, d);
> SEND_TO_Q("\r\n\n*** PRESS RETURN: ", d);
> 
> Changing the save_char() location at this point from NOWHERE to the new start
> room doesn't work becuase there is another save_char() down under case 1 of the
> main menu
> 
>    case '1':
>       reset_char(d->character);
>       if (PLR_FLAGGED(d->character, PLR_INVSTART))
> 	GET_INVIS_LEV(d->character) = GET_LEVEL(d->character);
>       if ((load_result = Crash_load(d->character)))
> 	d->character->in_room = NOWHERE;
> ----> save_char(d->character, NOWHERE);
>       send_to_char(WELC_MESSG, d->character);
>       d->character->next = character_list;
>       character_list = d->character;
> 
>     <after this point it checks for special loading circumstances>
> 
> 
> My question is what is the first save_char() for when the player is created and
> is there any way I can set the start location there for new players?  Or, is
> there any special flag that is set when a player is first created that I can
> key on?  In the future I would like to create multiple start towns and I can
> see that being a slight problem with the way the characters are loaded into the
> game.  Has anyone encountered this before?  And, if so how was it solved?
> 
> Also, does save_char() expect the vnum or rnum of the room?
> 
> Thanks in advance for any help you can provide,
> 
>  	Brian aka Haddixx
> 
> __
> 
> 
> 
> 
> 
> 
> 
> -- 
> "Take my advice and go back to the time	| Brian Menges
> you came from.  The future isn't what 	| NASA Ames Research Center
> it used to be."--G'kar, "The Long Dark" | Mail Stop: N262-2
> 	          0__0			| Phone: (415) 604-0069
> =============ooO==(__)==Ooo=============| menges@eos.arc.nasa.gov
> 



This archive was generated by hypermail 2b30 : 12/18/00 PST