Re: [Circle] [Code]Boat Spec_proc [Help] on a similar issue

From: Argus (
Date: 08/25/96

> SPECIAL(moonshadow_dock)
> {
>   struct obj_data *ship;
>   int ship_num = 10039, dock_num = 2110, docked = 0;
>   char *fname(char *namelist);
> while ((docked == 0) && (time_info.hours == 14)) {
>     ship = read_object(ship_num, VIRTUAL);
>     obj_to_room(ship, real_room(dock_num));
>     docked = 1;
> }
> while ((docked == 1) && (time_info.hours == 15)) {
>       obj_from_room(ship);
               What is ship?? Where are you getting this info?  the 
while is calling it.. but ship will never be assigned because it is 
inside the other while loop

>       act("The Moonshadow has left port and headed down river.\r\n", FALSE, ch, 0, 0, TO_ROOM);
>       docked = 0;
> }
> return 0;
> }

Chuck did you ever get this to work?

I am tring to do something similar and ran across your mail message 
in my archives.  Except I loading and unloading the "ship" in 
weather.c  I can call it from the time stuff there... However I am 
having crash problems with the "departure of the ship".  It will 
crash because it's not sure where the mob is.  (At least as far as I 
can tell)  it tries to char_from_room an unknown mob (which I think 
may be the same problem you are having... (see above)

My code is below:

void shipdocking(void)
struct char_data *victim;

int r_num;

    r_num =real_mobile(18203);
    victim = read_mobile(r_num, REAL);
    char_to_room(victim, real_room(18295));
    act("The Ship of Fools docks with a hearty thump.", FALSE, victim, 0, 0, TO_ROOM);
    act("The captain walks down the gangplank and is ready to start boarding passengers.", FALSE, victim, 0, 0, TO_ROOM);


void shipleaving(void)
struct char_data *victim;

int r_num;

    r_num = real_mobile(18203);
    victim = read_mobile(r_num, REAL);
    act("The captain boards the ship and barks the orders to depart. ", FALSE, victim, 0, 0, TO_ROOM);
    act("The Ship of Fools raises her sails and slowly departs the harbor.", FALSE, victim, 0, 0, TO_ROOM);
                         ^^^^ It can't find vicitm :(

I define it in the start of weather.c 
void shipdocking (void);
void shipleaving(void);

then at the times it is supposed to trigger I just call the function:
case 6:
case 7:

Shipdocking works... shipleaving does not...  
  Any ideas what i am doing wrong anyone??  I tried adding: 
find_target_room(victim, victim);  but that doesn't work either...  
as far as I can tell it is not finding the victim. 
telnet: 7777

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |

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