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
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Mon Jan 21, 2002 5:26 am   

Trigger Conditions
 
This one might be a little complicated, but I'll explain as best I can. My MUD output looks like this:

The road of Darkwater (n,ne,e,w,nw).
Artur Hawkwing the Sprite //<Player in red text>
A villager walking around //<Mob in purple text>
434Hp 1334Sp 236700Xp 19Kg>

Basically, I need to be able to make a trigger that will fire if there are no players in the room, or continue on the slow walking path if there are a player AND a mob in the room. I know how to make triggers off of line color, so that part isn't a problem, but I need 2 seperate triggers, which is where I can't get it to work.

uhhuh
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 21, 2002 6:30 am   
 
#TR {player} {#VAR playerhere 1}
#TR {mob} {#VAR mobhere 1}
#TR {%dHp %dSp %dXp %dKg} {#IF (@mobhere {#IF (@playerhere) {#VAR playerhere 0;#VAR mobhere 0;#STEP} {#VAR playerhere 0;#VAR mobhere 0;kill mob(?)}} {#VAR mobhere 0;#VAR playerhere 0;#STEP}

First trigger detects players, second detects mobs. Third trigger (should probably be nocr|prompt) detects end of room description, checks for mobs and players, and takes appropriate action.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Thu Jan 24, 2002 6:56 pm   
 
The only problem with that is that is doesn't reset the mobhere and playerhere variables. Is there any way to do that, when my MUD doesn't have any static text for EVERY time you enter or leave a room?

uhhuh
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jan 25, 2002 8:04 pm   
 
Why doesn't it reset @mobhere and @playerhere? I included reset code for all the possible conditions.

#TR {%dHp %dSp %dXp %dKg} {#IF (@mobhere {#IF (@playerhere) {#VAR playerhere 0;#VAR mobhere 0;#STEP} {#VAR playerhere 0;#VAR mobhere 0;kill mob(?)}} {#VAR mobhere 0;#VAR playerhere 0;#STEP}

LightBulb
All scripts untested unless otherwise noted
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Mon Jan 28, 2002 9:24 am   
 
A missing parenthesis and bracket may be the culprits.

#TR {%dHp %dSp %dXp %dKg} {#IF (@mobhere) {#IF (@playerhere) {#VAR playerhere 0;#VAR mobhere 0;#STEP} {#VAR playerhere 0;#VAR mobhere 0;kill mob(?)}} {#VAR mobhere 0;#VAR playerhere 0;#STEP}}

Troubadour
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 28, 2002 6:51 pm   
 
Thanks, Troubadour, that would do it.

LightBulb
All scripts untested unless otherwise noted
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