Creation and Trainers

Posted by Zelfius on Sat 10 Jul 2004 05:42 PM — 2 posts, 12,637 views.

#0
I am creating a new Rom Mud from scratch and I have a couple questions.

1. After creating a character is there a way to send or create the actual chracter to another room or vnum?

2. I can't seem to make a mob where I can train, learn, or gain points, What am I doing wrong? I tried and it says in the game that you can't do that here!

Thanks!
Australia Forum Administrator #1
Even if you are not an experienced coder, looking at the source code always helps to answer questions like that. For instance, looking in the do_train function (in act_move.c) shows us this:


    /*
     * Check for trainer.
     */
    for ( mob = ch->in_room->people; mob; mob = mob->next_in_room )
    {
        if ( IS_NPC(mob) && IS_SET(mob->act, ACT_TRAIN) )
            break;
    }

    if ( mob == NULL )
    {
        send_to_char( "You can't do that here.\n\r", ch );
        return;
    }



So, this puts us in the right spot. do_train is called when you type "train", and there is the error message "You can't do that here.".

Now we need to see what condition is met, to *not* get the error message. The ACT_TRAIN bit is needed (that sound logical).

So in the Area Editor you would set the "Train" flag in the "Actions" tab for the mob that you want to make a trainer.

For your other question, the room for new characters (I presume you mean new players), if you look in comm.c you see that when a new player is created this line is done:


char_to_room( ch, get_room_index( ROOM_VNUM_SCHOOL ) );


Also in merc.h we find this:



/*
 * Well known room virtual numbers.
 * Defined in #ROOMS.
 */
#define ROOM_VNUM_LIMBO               2
#define ROOM_VNUM_CHAT             1200
#define ROOM_VNUM_TEMPLE           3001
#define ROOM_VNUM_ALTAR            3054
#define ROOM_VNUM_SCHOOL           3700
#define ROOM_VNUM_BALANCE          4500
#define ROOM_VNUM_CIRCLE           4400
#define ROOM_VNUM_DEMISE           4201
#define ROOM_VNUM_HONOR            4300


So it seems clear that new players will be put into room 3700. To change that, change the line there to make 3700 into something else, and recompile everything, or at least the files that use ROOM_VNUM_SCHOOL (comm.c and db.c).