Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Wed Mar 05, 2003 7:40 pm   

Several Questions
 
i haven't used zmud in a long time but i am now getting back into mudding. ill jump straight to my questions though because ive forgotten how to do most everything.

1.) when i use #TR (pattern) (command) zMUD takes that as an expression and i have to go in and change it manually, eliminating the reason i wanted to do it in the first place. why is this? am i forgetting to type something or is there a setting i can toggle to make it recognize it as a pattern and not an expression?

2.) I want zMUD to be selective in a trigger. I am working on a trigger that takes one mobile from a 'scan' and persues it. this is a sample scan

A statue of the overlord which is right here to the north.
A castle guard is close by to the north.
A palace servant is rather far off to the north.
Claudia [Player] is right here to the east.
A false prophet is right here to the east.
A small horse is right here to the south.
A small horse is right here to the west.
Talam is right here to the west.

the only way i can think of doing this is a T+/T- trigger but that seems wrong. it doesnt work correctly for some reason. maybe i am leaving something out. i want the triggers to be able to see the small horse to the south and go to it and to ignore the 2nd small horse. how would i accomplish this?

3.) I am trying to set up boundaries for a script. IE i am killing things in "Harvesting Fields" for a room name and moving east and scanning every time i kill something then moving East and scanning again for an unsuccessful scan. How can i make a trigger in relation to the trigger aforementioned in question 2 that will move east upon recieving an unsuccessful scan? that will then eventually run me into a room named "Mudapa Plains" which would cause the script to begin going West again instead of east. I dont know how to reverse it.

Thank you for any help you can provide. i know you zMUD Gurus know all this stuff and im grateful for your assistance.

Brujah

<_,-'
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 05, 2003 9:00 pm   
 
1) Could you post an example of one that gives your problem and how zMUD creates the trigger incorrectly?

2) Yes, using #T- to disable the trigger after it fires the first time is the answer. Again, to find out why it doesn't work an example would be helpful.

3) Keep a variable that contains the direction in which you are currently moving. Then have a trigger fire on the room's name and change the value of the variable.

Kjata
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Wed Mar 05, 2003 9:15 pm   
 
1.) IE: I type #TR (tells you) (smile)
But when someone tells me something and the pattern passes it doesnt fire. When i go into the trigger to edit it, for some reason it is set as a Type: Expression instead of a Type: Pattern. When i change it from an Expression to a Pattern it works swimmingly. but this means i have to go into the trigger editor in the first place, which is what im trying to avoid.

2.)I spoke to a friend and he helped me with the 2nd question.

As for this ive always worked with only triggers. i know this severly limits me but for some reason i cannot grasp the concept of how to make a variable. im dumb :P how would i make a variable to store the direction im moving and what would my trigger have to be in order to change the value of a variable? and lastly, how would i make this use said variable to move around after "has been SLAIN!" pops up as a trigger?

<_,-'
Reply with quote
AzCowboy
Adept


Joined: 09 Nov 2000
Posts: 222
Location: USA

PostPosted: Wed Mar 05, 2003 10:09 pm   
 
Use the curly braces, not parenthesis! {}YES ()NO!
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Wed Mar 05, 2003 10:52 pm   
 
the stupid things we mistake and forget over time. thanks. it works. now all i have left is the 3rd question/problem.

<_,-'
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 05, 2003 11:43 pm   
 
Variables are very easy, just use the #VAR command to set the variable to whatever you want and then use @ when you want to access its value. Example:
#TRIGGER {Mudapa Plains} {#VAR dir "west"}
#TRIGGER {has been SLAIN!} {#EXEC @dir}

The second trigger passes the value of the @dir variable to #EXEC so that it executes this text just as if you had typed it in yourself. You will also need a third trigger (just like the first one) that sets the variable to go in the other direction when you reach the westernmost room.

Kjata
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Mar 06, 2003 12:47 am   
 
excellent. thank you so much. now say that the westernmost border was also "Mudapa Plains" what would i make my trigger in order for it to reverse itself and change the direction of the variable? I imagine it would look something like this because i am trying to use that variable only when i get an unsuccessful scan. how can i script zmud so that it recognizes when a scan is unsuccessful at finding anything i want to kill?

#TRIGGER {Mudapa Plains} {#VAR dir "west"}
#TRIGGER {has been SLAIN!} {scan}
#TRIGGER "Whatever goes here for an unsuccessful scan" {#EXEC @dir}

<_,-'
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Mar 06, 2003 1:28 am   
 
Just to let you know. an unsuccessful scan looks like this. for this example i am using a gnome druid.

You don't see anything to the north.
You don't see anything to the east.
You don't see anything to the south.
You don't see anything to the west.
You don't see anything to the northwest.
You don't see anything to the northeast.
You don't see anything to the southwest.
You don't see anything to the southeast.

I have tried doing it this way.

SCAN CLASS TRIGGERS
#TR {A gnome druid is a brief walk away to the %1.} {%1;%1;%1;%1;kill druid;#T- Scan}
#TR {A gnome druid is close by to the %1.) {%1;%1;kill druid;#T- Scan}
#TR {A gnome druid is not far off to the %1.} {%1;%1;%1;kill druid;#T- Scan}
#TR {A gnome druid is right here to the %1.} {%1;kill druid;#T- Scan}
#TR {You don't see anything to the southeast.} {@dir}

But ive run into the problem that sometimes there IS a mob to the SE or sometimes SE isn't a valid exit and it doesnt show up when scanning. any help on this issue is much appreciate. to finish this line of questioning, i need a solution on how to make my @dir variable reverse itself when it sees "Mudapa Plains" and a solution to my unsuccessful scan problem.

Kjata, you are a big help and i appreciate it greatly.

<_,-'
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Thu Mar 06, 2003 4:20 am   
 
Why not try something like:

#alias scan {#t+ Scan;~scan}

In the Scan class:
#TR {A gnome druid is a brief walk away to the (%w).} {#var found 1;%1;%1;%1;%1;kill druid;#T- Scan}
#TR {A gnome druid is close by to the (%w).) {#var found 1;%1;%1;kill druid;#T- Scan}
#TR {A gnome druid is not far off to the (%w).} {#var found 1;%1;%1;%1;kill druid;#T- Scan}
#TR {A gnome druid is right here to the (%w).} {#var found 1;%1;kill druid;#T- Scan}
#TR {to the southeast.} {#if (@found=0) {@dir}}

Untested.

Iljhar
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Mar 06, 2003 7:57 am   
 
excellent. no, that didn't work but it provided me with the needed information to make it work. thank you kindly. now for the last question. how and the hell do i make a trigger for "Mudapa Plains" change the value of the @dir variable from west to east? :) im sure i will run into more kinks and buggy things in my script but thats what im working on it for. thanks again.

<_,-'
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Mar 06, 2003 4:49 pm   
 
Hmm, since both boundary rooms are named the same, it would have to be the same trigger that changes the value of the variable. The trigger would need to check what the current value is and change it to the opposite. Example:
#TRIGGER {Mudapa Plains} {#VAR dir %if(@dir = "east", "west", "east")}

What the %if does is evaluate the expression given as the first argument (@dir = "east"), and if it is true, it returns the second argument, otherwise it returns the third argument.

Kjata
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Mar 06, 2003 5:56 pm   
 
thank you so much. i had no idea to use a %if.

<_,-'
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Mar 06, 2003 9:07 pm   
 
Heh. now im running into a similar problem with moving north and south. i tried working with this

#TRIGGER {Mudapa Plains} {#VAR dir %if(@dir = "east", "west", "east")}

and inserting "north", "south", "north" but that didnt work at all. i also tried changing it to

#TRIGGER {Mudapa Plains} {#VAR dir %if(@dir = "east", "west", "east") %if{@dir= "north" south)}
but that didnt work either. any suggestions?

<_,-'
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Mar 06, 2003 10:14 pm   
 
Well, the original command was done assuming that you would only be going east-west. If you are going to walk north-south too, then you need to nest the %if's:
#VAR dir %if(@dir = "east", "west", %if(@dir = "west", "east", %if(@dir = "north", "south", "north")))

Now it becomes more complex since you have four different possibilities instead of just two.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net