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
John Gilmore
Beginner


Joined: 22 Mar 2003
Posts: 19
Location: Park City Utah

PostPosted: Thu Oct 22, 2009 5:55 pm   

Return to to #Trigger
 
I am trying to write a small script for training purposes. I want it to look something like this
#TRIGGER {DEAD} look
#TRIGGER {You see a door to the west.}
#color bold,yellow
open west
west
south
open west
west
k tenth
#TRIGGER {dark room.}
#color yellow,bold
open east
east
north
open e
east
k tenth

I am a novice, but I can make basic scripts work. What I am trying to do is set the TRIGGER to trigger after a look command. But, I am getting the script all screwed up.
Does anyone know how to return to a command line if a condition is not met?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4769
Location: Pensacola, FL, USA

PostPosted: Thu Oct 22, 2009 6:20 pm   
 
You should always be at the command line, hoever you are missing brackets arout the actions of your triggers

#TRIGGER {DEAD} {look}
#TRIGGER {You see a door to the west.} {
#color bold,yellow
open west
west
south
open west
west
k tenth}
#TRIGGER {dark room.} {
#color yellow,bold
open east
east
north
open e
east
k tenth}
_________________
Discord: Shalimarwildcat
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 22, 2009 7:30 pm   
 
It sounded to me like he really wanted a multi-state trigger.

Code:
#TRIGGER {DEAD} {look}
#cond{You see a door to the west.} {
#color bold,yellow
open west
west
south
open west
west
k tenth}
#cond{dark room.} {
#color yellow,bold
open east
east
north
open e
east
k tenth}
_________________
Asati di tempari!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4769
Location: Pensacola, FL, USA

PostPosted: Thu Oct 22, 2009 7:52 pm   
 
i think they are both optional, now i think of it... in which case they should be classed together and have the first trigger turn the class on, and the other two turn it back off, like so

#TRIGGER {DEAD} {
#T+ deadLook
look
}
#CLASS deadLook
#TRIGGER {You see a door to the west.} {
#color bold,yellow
open west
west
south
open west
west
k tenth
#t- deadLook
}
#TRIGGER {dark room.} {
#color yellow,bold
open east
east
north
open e
east
k tenth
#T- deadLook
}
#CLASS 0
_________________
Discord: Shalimarwildcat
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