Re: Transportation devices

From: Phillip A. Ames (kirk47@JUNO.COM)
Date: 08/28/98


Okie all, sorry to bring this back up, but having gotten the beamup
function of this to work, I'm trying to add in a beamdown one that will
send them back to the room they beamed up from.  However, I'm having a
bit of trouble.  What happens is below...

32000H/32000H 32000M/32000M 32000V/32000V > wear all
You wear a test communicator badge as a communicator badge.

32000H/32000H 32000M/32000M 32000V/32000V > beamup
Sorry, but you cannot do that here!

32000H/32000H 32000M/32000M 32000V/32000V > beamdown
You must be wearing a communicator to use any of it's functions!

... And the code...


SPECIAL(comm_badge)
{
        extern int top_of_world;
        int beamup_room, beamdown_room;
        struct obj_data *badge = (struct obj_data *) me, *vehicle;

if (!GET_EQ(ch, WEAR_COMM) && CMD_IS("beamup") || CMD_IS("beamdown")) {
    send_to_char("You must be wearing a communicator to use any of it's
functions!\r\n", ch);
    return 1;
  }
if (!CMD_IS("beamup") || !CMD_IS("beamdown") ){
        return 0;
}

        if (CMD_IS("beamup")) {
                vehicle = find_vehicle_by_vnum(GET_OBJ_VAL(badge, 0));
                if (!vehicle) {
                        send_to_char("ERROR!  Vehicle doesn't exist.
Someone's been screwing around...", ch);
                        mudlog("SYSERR: **BAD** Vehicle doesn't exist!
Purged?", BRF, LVL_IMMORT, TRUE);
                } else if (GET_OBJ_VAL(badge, 2) != 0) {
                        send_to_char("You cannot beam up if you are
already aboard a starship!\r\n", ch);
                        send_to_char("However, if you are not aboard a
starship, contact an immortal for assistance.\r\n", ch);
                } else {
                        beamup_room = GET_OBJ_VAL(badge, 1);
                        GET_OBJ_VAL(badge, 2) = (ch->in_room);
                        act("$n beams up to $p.\r\n", TRUE, ch, vehicle,
0, TO_ROOM);
                        act("You beam up to $p.\r\n", TRUE, ch, vehicle,
0, TO_CHAR);
                        if (real_room(beamup_room) == NOWHERE) {
                                send_to_char("Small error in vehicle
code...\r\n", ch);
                                act("You quickly abort your beamup to $p
as you realize it is incomplete.", TRUE, ch, vehicle, 0, TO_CHAR);
                                act("$n aborts the beamup to $p,
realizing it is somewhat incomplete.", TRUE, ch, vehicle, 0, TO_ROOM);
                                mudlog("SYSERR: **BAD** Beamup room is
equal to nowhere!", BRF, LVL_IMMORT, TRUE);
                        } else {
                                char_from_room(ch);
                                char_to_room(ch, real_room(beamup_room));
                                look_at_room(ch, 0);
                                act ("$n arrives from a sparkling
transporter beam", TRUE, ch, 0, 0, TO_ROOM);
                        }
                }
                return 1;
        } else if (CMD_IS("beamdown")) {
                vehicle = find_vehicle_by_vnum(GET_OBJ_VAL(badge, 0));
                if (!vehicle) {
                        send_to_char("ERROR!  Vehicle doesn't exist.
Someone's been screwing around...", ch);
                        mudlog("SYSERR: **BAD**Vehicle doesn't exist!
Purged?", BRF, LVL_IMMORT, TRUE);
                } else if (real_room(GET_OBJ_VAL(badge, 2) ) == NOWHERE
|| (ch->in_room) != GET_OBJ_VAL(badge, 2) ){
                        send_to_char("You must be aboard a ship if you
want to beam down!", ch);
                        send_to_char("However, if you are already aboard
a ship, contact an immortal for assistance.", ch);
                } else {
                        GET_OBJ_VAL(badge, 2) = NOWHERE;
                        act("$n beams down from $p", FALSE, ch, vehicle,
0, TO_ROOM);
                        act("You beam down from $p.", TRUE, ch, vehicle,
0, TO_CHAR);
                        if (real_room(beamup_room) == NOWHERE) {
                                send_to_char("Beamdown aborted!  Target
room is nothing!!\r\n", ch);
                                act("$n quickly leaps off the transporter
pad, realizing the beamdown room is nowhere.", TRUE, ch, 0, 0, TO_ROOM);
                                mudlog("SYSERR: **BAD** Beamdown room is
equal to nowhere!", BRF, LVL_IMMORT, TRUE);
                        } else {
                                char_from_room(ch);
                                char_to_room(ch,
real_room(beamdown_room));
                                look_at_room(ch, 0);
                                act ("$n leaves the ship in a sparkling
transporter beam", TRUE, ch, 0, 0, TO_ROOM);
                        }
                }
        }
}

Can anyone see any reason why this may be happening?


Phillip Ames    | Satisfaction is not guaranteed.
kirk47@juno.com | -Ferengi Rule of Acquisition #19
ICQ: 8778335    | AOL IM: Grathol
http://members.xoom.com/Gowron/index.html(Unfinished)

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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