 |
John Gilmore Beginner
Joined: 22 Mar 2003 Posts: 19 Location: Park City Utah
|
Posted: 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? |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
 |
|
|