|
hodgkinr Wanderer
Joined: 05 Jan 2002 Posts: 55 Location: United Kingdom
|
Posted: Sat Feb 15, 2003 6:36 pm
Trigger help required |
Hi could you help me with a trigger please.
I am trying to create a sailing trigger my problem is making the trigger wait for the shipp to move to the next square/room. this is a copy of part of my screen. Other lines do appear on the screen but I have deleted them for ths post.
There are 7 ships in the water here.
Docks can be seen not far from here.
Land blocks you from sailing east, south and north
sail west
The ship is pointed west.
745 hps|376 sp|505 mp >
The ship sails west.
Land blocks you from sailing north.
sail south
The ship is pointed south.
The ship sails south.
Land blocks you from sailing east.
sail south
The ship is pointed south.
The ship sails south.
Only the wide open ocean can be seen.
sail south
The ship is pointed south.
The ship sails south.
Only the wide open ocean can be seen.
I want to eventually make various triggers to sail to various destinations.
Thanks in anticipation
Bob
Bob Hodgkins
Processor: Dual PIII 1ghz
Memory: 512mb RIMM
Video: Creative GeForce 4 64mb DVI
Windows: Win 2000 Proffesional + Updates
ZMud: Version 6.40
ZMapper: Version 1.15 Beta |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Feb 15, 2003 8:11 pm |
Put the message of the ship sailing in another state, so the trigger waits for that message. Example:
#TRIGGER {The ship is pointed %w.} {}
#COND {The ship sails %w.} {whatever you need to do}
Kjata |
|
|
|
hodgkinr Wanderer
Joined: 05 Jan 2002 Posts: 55 Location: United Kingdom
|
Posted: Sat Feb 15, 2003 10:06 pm |
Well thanks for that it works fine but is it possible to make a change of direction.
I have another command that is:
whereami
Only the wide open ocean can be seen.
You are at.....
(39, -39)
i thought if i used this in place of my sail command e.g.
#TRIGGER {The ship is pointed %w.} {}
#COND {The ship sails %w.} {whereami}
I could test to see where I am then change direction at a specific co-ord. Perhaps with a IF command.
What do you think?
Thanks for the help by the way.
Bob
Bob Hodgkins
Processor: Dual PIII 1ghz
Memory: 512mb RIMM
Video: Creative GeForce 4 64mb DVI
Windows: Win 2000 Proffesional + Updates
ZMud: Version 6.40
ZMapper: Version 1.15 Beta |
|
|
|
hodgkinr Wanderer
Joined: 05 Jan 2002 Posts: 55 Location: United Kingdom
|
Posted: Sun Feb 16, 2003 10:32 am |
Ok
I have been thinking about this some more and I thought it would be best to test where I was and then sail to a co-ordinate so I came up with this:
this is what my screen says when i type "whereami"
whereami
Only the wide open ocean can be seen.
You are at.....
(39, -39)
sail out
#wait 5000
sail north
#wait 5000
whereami
#TRIGGER {^~(%d, (%d)~)} {#if (%2 = -39) {sail north}}
The the trouble is it don't seem to be triggering to the co-ords. Do I need to trigger from the text on the previous line? I would like to do another test to check where I am with something like #if (%2 > -37) {sail north} and when i have reached the right northing #if (%1 >11) {sail west}.
Any ideas would be much appreciated.
Bob
Bob Hodgkins
Processor: Dual PIII 1ghz
Memory: 512mb RIMM
Video: Creative GeForce 4 64mb DVI
Windows: Win 2000 Proffesional + Updates
ZMud: Version 6.40
ZMapper: Version 1.15 Beta |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 16, 2003 11:56 am |
Instead of creating a trigger each time you move, create a permanent trigger that fires on the coords and makes you sail in the right direction in order to get to where you want. Example:
#TRIGGER {You are at.....$~((%n), (%n)~)} {#IF (%1 < @lon) {sail east} {#IF (%1 > @lon) {sail west} {#IF (%2 < @lat) {sail north} {#IF (%2 > @lat) {sail south} {#SAY You have arrived at your destination.}}}}}
Now all you have to do is enter you destination's coordinates in @lon and @lat and have the trigger that fires on the message that you have sailed in some direction send the wherami command.
Kjata |
|
|
|
hodgkinr Wanderer
Joined: 05 Jan 2002 Posts: 55 Location: United Kingdom
|
Posted: Sun Feb 16, 2003 5:58 pm |
Ok Kjata I have it working now with 2 triggers, yours and one that does a whereami. The trouble is I have islands to navigate around so I cannot let the trigger do its own thing. Therefore I have to navigate to specific Co-ord's.
At the moment i am entering the required co-ords manually in the trigger as follows
#variable lon 11
#variable lat 11
#IF (%1 < @lon) {sail east} {#IF (%1 > @lon) {sail west} {#IF (%2 < @lat) {sail north} {#IF (%2 > @lat) {sail south} {SAY You have arrived at your destination.}}}}
Is there a way I can send the co-ords to the trigger from the zmud command line?
Thanks
Bob
Bob Hodgkins
Processor: Dual PIII 1ghz
Memory: 512mb RIMM
Video: Creative GeForce 4 64mb DVI
Windows: Win 2000 Proffesional + Updates
ZMud: Version 6.40
ZMapper: Version 1.15 Beta |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 16, 2003 7:19 pm |
Break the path into little pieces. Suppose that to get around the island you first need to go to (7, 9), then to (1, 9), and then to (0, 4), then first set the coordinates to (7, 9) and do a "whereami" to start the process, after it finishes set the coordinates to (1, 9) and do another "whereami" and after that one finishes set the coorinates to (0, 4) and do the final "whereami".
Kjata |
|
|
|
hodgkinr Wanderer
Joined: 05 Jan 2002 Posts: 55 Location: United Kingdom
|
Posted: Sun Feb 16, 2003 7:31 pm |
Yep Ok I got that thanks very much!.
But is there no way to input to the variable from the command line or do I have to keep updating the trigger manually?
But it works fine as is and i'm well pleased.
Thanks
Bob
Bob Hodgkins
Processor: Dual PIII 1ghz
Memory: 512mb RIMM
Video: Creative GeForce 4 64mb DVI
Windows: Win 2000 Proffesional + Updates
ZMud: Version 6.40
ZMapper: Version 1.15 Beta |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 16, 2003 9:06 pm |
Yes, you can update the variables through the command line. Just use the varname=value syntax. Example:
lon=11
lat=11
Also, you can enter the #VAR command into the command line:
#VAR lon 11
#VAR lat 11
Kjata |
|
|
|
hodgkinr Wanderer
Joined: 05 Jan 2002 Posts: 55 Location: United Kingdom
|
Posted: Sun Feb 16, 2003 9:48 pm |
Thanks thats reall great
Bob
Bob Hodgkins
Processor: Dual PIII 1ghz
Memory: 512mb RIMM
Video: Creative GeForce 4 64mb DVI
Windows: Win 2000 Proffesional + Updates
ZMud: Version 6.40
ZMapper: Version 1.15 Beta |
|
|
|
|
|