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
immortalking
Newbie


Joined: 07 Apr 2003
Posts: 8

PostPosted: Fri May 07, 2004 2:22 am   

Hitpoints Trigger
 
Hello
I am pretty new to zmud and i would like to know if theres a way to set up this kind of trigger.

I would like to create a trigger to move my character once his hp gets below a point.
My prompt looks like this:
<Health 2,636/3160 Armor: 2,208 Energy 13,343/31400>

For example his hp drops below 700 i want him to move south then east Only one time.

How would i do this?
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Fri May 07, 2004 3:53 am   
 
I would do something like this:
Code:

#TRIGGER "wimpy" {^~<Health (%n)/%n Armor: %n Energy %n/%n~> {
#if (%1 < 700) {
south
east
#t- wimpy
}
}
#alias bewimpy {#t+ wimpy}


There's a better way to do it with trigger states, but I'm a little rusty. What this should do is:
If you have less than 700 Health, move and disable the trigger
When you want to have it active again (like, after you healed or whatever), just type "bewimpy" and you're set.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 07, 2004 4:12 am   
 
#TR {~<Health (%n)/%d} {#IF (%1 > 700) {#VAR lowhp 0}} {} {prompt|nocr}
#TR {~<Health (%n)/%d} {#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;south;east}} {} {prompt|nocr}

More likely to be useful:
#VAR flee {south;east}
#TR {~<Health (%n)/%d} {#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;#EXEC @flee}} {} {prompt|nocr}

EDIT: Corrected (added }s)
Reply with quote
immortalking
Newbie


Joined: 07 Apr 2003
Posts: 8

PostPosted: Fri May 07, 2004 8:22 pm   
 
#TR {~<Health (%n)/%d} {#IF (%1 > 700) {#VAR lowhp 0} {} {prompt|nocr}
#TR {~<Health (%n)/%d} {#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;south;east} {} {prompt|nocr}

I Seem to be having a problem with this.
When i type it in all it does is it spams {#IF.
I went into my Triggers window and it says
{#IF
^ syntax error

Am I doing something Wrong?

Before i Fogot to include what the trigger is for really. On this mud i have to train stats and every time you train it your hp will drop. Its not for battles.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri May 07, 2004 8:35 pm   
 
Lightbulb has this bad habbit of forgeting a few }'s alot of the time :P Fix is below in red Basicly after whichever of his triggers you want to use add another } after #EXEC @flee}

#TR {~<Health (%n)/%d} {#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;#EXEC @flee}} {} {prompt|nocr}

EDIT: Fixed my mistake as per Lightbulb's post.
Reply with quote
immortalking
Newbie


Joined: 07 Apr 2003
Posts: 8

PostPosted: Fri May 07, 2004 10:07 pm   
 
Sorry to be asking what im doing wrong again.
I keep getting the message and the Trigger doesnt work still.
#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;west;up;south} {}
^ syntax error
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri May 07, 2004 10:47 pm   
 
In the trigger editor window remove the bracket giving you the error, don't be afraid to try and fix a trigger the help files are a wonder :P
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 08, 2004 7:58 am   
 
nexela identified the problem correctly, but got the fix wrong.

Corrected version (originals also fixed):
#TR {~<Health (%n)/%d} {#IF (%1 > 700) {#VAR lowhp 0}} {} {prompt|nocr}
#TR {~<Health (%n)/%d} {#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;south;east}} {} {prompt|nocr}

More likely to be useful:
#VAR flee {south;east}
#TR {~<Health (%n)/%d} {#IF ((%1 < 700 AND (@lowhp = 0)) {#VAR lowhp 1;#EXEC @flee}} {} {prompt|nocr}
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