Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ruffalufacus
Newbie


Joined: 04 Jun 2016
Posts: 7

PostPosted: Sat Jun 04, 2016 11:16 pm   

Help with a multi-state trigger.
 
So on the MUD I play my character has an AoE ability that hits multiple (up to 3) monsters at once in a room.
I'm trying to create a multi-state trigger that works in conjunction with my "sensing" trigger that finds my target.
What I do is set my target variable to the monster I am hunting, then I fire off the "sense" ability that senses for
the monster and the MUD prompts me of what direction it is in then moves in that direction and senses again.
After doing this until I am finally in the same room as my target it triggers a message about how I am already
in the same room as my target and from there I set my trigger to fire off a single usage of my AoE ability.
Here is where my problem occurs. From this point I am trying to create a multi-state trigger that will do the following...

When my AoE ability fires, the next line determines how many, if any, targets are hit.
I need to create a multi-state here with conditions on if ANY targets are hit it will fire my AoE ability again, and
if NO targets are hit (resulting in just my AoE abilities syntax to scroll with no targets hit on the very next line)
that it fires off my "sense" trigger again to continue searching for more of my @target. Any input on how I can
accomplish this feat?

I'm guessing,
#TRIG {AoE Syntax that appears on the mud}
#COND... and from here I have no idea....

P.S. I am extremely new to multi-state triggers and complex scripting ect. =(
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Jun 05, 2016 1:07 am   
 
i assume the damage messages for each critter are on seperate lines?
If so then you would want a named alarm, and likely don't need to bother with a state at all, just triggers for the damage messages.

#ALARM "keepSensing" +2 {sense}

With it being named, the fact that it fires multiple times won't matter, each call with just refresh the time state
So long as the delay is long enough for all the messages to be processed, you will only get sense sent to the game once.

If there is a specific message for hitting nothing, or wrapping up the AoE ability, all the better.
_________________
Discord: Shalimarwildcat
Reply with quote
Ruffalufacus
Newbie


Joined: 04 Jun 2016
Posts: 7

PostPosted: Sun Jun 05, 2016 1:44 am   
 
When I use the AoE ability it sends the abilities text to the screen. If there are no NPCs to hit it will just show that text and nothing after it.
If there are NPCs to hit it'll hit them on the next line. Being that it can hit multiple enemies how can I make a trigger that will keep firing
the AoE as long as it's still hitting targets and also have another condition where it will move to sense more targets if it hits nothing?
Reply with quote
Ruffalufacus
Newbie


Joined: 04 Jun 2016
Posts: 7

PostPosted: Sun Jun 05, 2016 1:54 am   
 
Also I don't think the #ALARM would work for me because I wouldn't be able to trigger off the AoE hitting nothing.
Thus a multi-state trigger would allow me to trigger off MOBs being hit, with more AoE'ing, as well as no MOBs
being hit, with going back to sensing for more targets.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Jun 05, 2016 3:42 am   
 
The first trigger state would be the ability's basic text, the second state would be type within lines 1, and would match everything: ^(*)$ . You can then check in the trigger body if %1 (the entire line) matches whatever the NPC being hit looks like. Without seeing actual MUD output it would be hard to provide more than that, sorry.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Jun 05, 2016 3:49 am   
 
%trigger("keepSensing") would let you know if the alarm exists though, and you could have another alarm that checks against that on a shorter timer.

#ALARM "sensor" +1 {#IF (%trigger("keepSensing")) {#NOOP Nothing happens here} {Nothing was hit commands}}
_________________
Discord: Shalimarwildcat
Reply with quote
Ruffalufacus
Newbie


Joined: 04 Jun 2016
Posts: 7

PostPosted: Sun Jun 05, 2016 8:48 pm   
 
I'm positive I do not want to use an #ALARM.

Say when I use my AoE the following output hits the screen, "You cast your AoE."
On the very next line, if there are NPCs in the room, it will show their HP bars. "[=======-]"
If there are no NPCs it will just show "You cast your AoE." and then nothing on the very next line.

What I would like to do is create a multistate trigger that if targets are hit on that very
next line, it fires another AoE usage, and if nothing is hit it fires "sense @target".
Reply with quote
Ruffalufacus
Newbie


Joined: 04 Jun 2016
Posts: 7

PostPosted: Sun Jun 05, 2016 8:55 pm   
 
Also when the AoE hits target(s) it doesn't show the NPCs name just a health bar pops up with damage numbers next to them.
I don't need it to recognize the target names, just that it actually hit something.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Jun 05, 2016 9:35 pm   
 
Code:
#TR {~[[=-]~]} {hit=1}
#TR {You cast your AoE.} {
  #WAIT 2000
  #IF (@hit=0) {no hit commands} {
    hit=0
    hit commands
  }
}


To my knowledge there is no way to set commands for if a state fails to match.
And if it doesn't send anything on the fail, then you are left waiting for some other line to come along.
This two trigger approach avoids that possible need.
_________________
Discord: Shalimarwildcat
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Jun 05, 2016 9:50 pm   
 
Code:
#trigger {^You cast your AoE.$} {}
#cond {^(*)$} {#if (%1 = "") {sense @target} {cast aoe}} {Within Lines|1}
Reply with quote
Ruffalufacus
Newbie


Joined: 04 Jun 2016
Posts: 7

PostPosted: Sun Jun 05, 2016 10:07 pm   
 
Daern that worked perfectly. Thank you so much.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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