Hometown help...

From: Mielikki (mielikki@exilemud.com)
Date: 09/07/01


Ok, first of all, I should explain what I am trying to do I guess.
Basically I want to make each race have its own hometown. Fairly
straightforward there I think, the problem is I cannot figure out the
best way to make each individual class go to its own guildhall within
the chosen hometown. Below is my code for hometown choice (it prolly has
some errors in it, would not surprise me). Can someone please tell me if
I should include the check for class in the switch or if I should go
about it some other way. I have had 5 people tell me five different ways
and each sounds like more coding than is necessary. (Bear in mind that
each of these 5 people have never even played a mud let alone coded in
one. They were astounded when they saw the code that the mud runs on.
Their experience is purely university.)

MY CODE

const char *elf_hometown_menu (*arg);
const char *human_hometown_menu (*arg);
const char *dwarf_hometown_menu (*arg);
const char *hobbit_hometown_menu (*arg);
const char *half_elf_hometown_menu (*arg);
int parse_hometown (char arg);
long find_hometown_bitvector (char arg);

If CON_QRACE == ELF
    const char *elf_hometown_menu =
    "\r\n"
    "Select hometown: \r\n"
    "    1)  Midgaard\r\n";

    int parse_hometown (char arg){
        switch (arg){
            case '1': return HOMETOWN_MIDGAARD
          default: return HOMETOWN_UNDEFINED
  }
}
if CON_QRACE == HUMAN
    const char *human_hometown_menu =
    "\r\n"
    "Select hometown: \r\n\"
    "    1)  Midgaard\r\n";

  int parse_hometown (char arg){
      switch (arg){
          case '1': return HOMETOWN_MIDGAARD
        default: return HOMETOWN_UNDEFINED
   }
 }
 if CON_QRACE == DWARF
    const char *dwarf_hometown_menu =
    "\r\n"
    "Select hometown: \r\n\"
    "    1)  Midgaard\r\n";

  int parse_hometown (char arg){
      switch (arg){
          case '1': return HOMETOWN_MIDGAARD
        default: return HOMETOWN_UNDEFINED
    }
  }
  if CON_QRACE == HOBBIT
    const char *hobbit_hometown_menu =
    "\r\n"
    "Select hometown: \r\n\"
    "    1)  Midgaard\r\n";

  int parse_hometown (char arg){
      switch (arg){
          case '1': return HOMETOWN_MIDGAARD
        default: return HOMETOWN_UNDEFINED
    }
 }
 if CON_QRACE == HALF_ELF
    const char *half_elf_hometown_menu =
    "\r\n"
    "Select hometown: \r\n\"
    "    1)  Midgaard\r\n";

  int parse_hometown (char arg){
      switch (arg){
          case '1': return HOMETOWN_MIDGAARD
        default: return HOMETOWN_UNDEFINED
    }
 }


For the sake of making this letter shorter I only give one choice to all
for HT but intend to add more later. Any help would be appreciated as I
am well and truly stumped.

AJ

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST