|
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jan 28, 2002 6:51 pm |
Thanks, Troubadour, that would do it.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|