Re: DG Scripts

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 07/30/00


Torgny Bjers wrote:
>
> Hello Peter,
>
> There's one slight problem.  How can I target a player with a random
> trigger?  It doesn't have any variables that can target players, has it?  Or
> if it does, please explain how I would write a script that somehow loops
> through ALL the characters in a specific room and then use like REWARD on
> them or something like that.

From the DG Scripts web site documentation, variable fields...

Characters

...

next_in_room
The next character in the room, or an empty return.

...

Rooms

...

people
The first character in the room, or an empty return.

So given a room trigger you would do something like this...

set nextplr %self.people%
while ("%nextplr%" != "")
  *
  * Do stuff with %nextplr% here.
  *
  set nextplr %nextplr.next_in_room%
done

Note, these are both fairly new fields for DG Scripts, if you have an
older version of DG Scripts you'll have to add them to the source, you
can download the latest patch, then just open up the file and pull the
two fields right from the patch itself and add them to your source
(hint, search the patch for "next_in_room" and "people" with the
quotes).

Regards, Peter


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT