Re: DG script help

From: Mark A. Heilpern (heilpern@mindspring.com)
Date: 04/09/99


At 06:21 PM 4/8/99 -0600, you wrote:
>I'm trying to set a variable to a list of spells, like
>set teach_spells fireball curse blindness
>ok, I print that out it works fine, now I setup a command script on a mob
>which fires on the command practice, which also works, the problem is, I'm
>trying to use a new feature that isn't that well documented in the pl6 version
>of DG scripts. here's what I have.
>if %teach_spells.contains(%arg%)%
>say I can teach you %arg%
>end
>
>The mob never says that line, I thought maybe the spaces on teach_spells was
>throwing it off, I changed set teach_spells to fireballcurseblindness, still
>didn't work, I tried changing the if statement to if
>%teach_spells%.contains(%arg%), doesn't work, %teach_spells.contains(arg)%
>doesn't work either, tried %arg.contains(%teach_spells%)%.  Any ideas on how
>to make this work ?
>

Without looking at source too hard, I think the problem is
    %arg.contains(%teach_spells%)%
contains a variable within a variable. That is, %teach_spells%, which is the
argument to your contains-call; I'm not certain subfields (the data with
()'s of
a variable) get processed as variables. You MAY be able to correct this by
swapping the order of "if (text_processed...." and "else if
(!str_cmp(field, "global"....."
in find_replacement(). Then again, that might not work, I just don't have
the time
to test it out. Sorry.

mah


     +------------------------------------------------------------+
     | 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 : 12/15/00 PST