Arx-Game / arxcode

A text-based/web game using Evennia.
MIT License
47 stars 42 forks source link

Combat and Borders - Trigger Friendly Formatting! #265

Open somethingfinite opened 4 years ago

somethingfinite commented 4 years ago

Is your feature request related to a problem? Please describe. My feature request is a quality of life fix that should probably be pretty simple. Making some minor changes that make the game more readable by client triggers.

Describe the solution you'd like So, combat stats is very nice and very cool. But what would be awesome for the purpose of triggers would be to have your current HP total reported back to you when you are damaged in combat. That way, you can make a fun little trigger in your client to monitor your HP without resorting to weird, roundabout methods! (Related: Borders for common commands should have a different 'start' and 'end' border so they're more easily parsed by 'Start Line' 'End Line' methods.)

Describe alternatives you've considered My current way of getting around this has been to make some very strange and roundabout queries of 'combatstats' and writing very convoluted triggers.

Additional context

Say I wanted to filter out a given prompt, and the border looks like this:

------------------------------------------------------------------------------

Text

------------------------------------------------------------------------------

Something like this:


+----------------------------------------------------------------------------

Text

-----------------------------------------------------------------------------+

Makes it infinitely more grabbable by triggers!

Additionally, I think the combat thing could literally just grab the combatstat value and when you're damaged say:

Soandso hits you for like (3) and your armor mitigates 105 of the damage.
Health: 30/100 or whatever.

Just spitballing.

Zironic commented 4 years ago

I don't know what kind of trigger engine you're using but in almost every case you should probably be using regex and the regex isn't particularly easier or harder based on if the start/end is distinct or not.

Assuming you want to capture your combat status from +cs, your trigger would look like this:

\| Combatant [\S\s]*\n\| (NAMEGOESHERE) *\| (\w*) *\| (\d*)

Your health will go into /1 and your fatigue into /2.

That said, the game telling you your current health and fatigue without making you check cs or +combatstats would be helpful. I also think that when a hit puts an opponent into a new damage bracket, that should be part of the damage output. Like

YOU attack Opponent 25 vs 12: glancing hit for moderate damage (20). Opponent is seriously injured.
somethingfinite commented 4 years ago

Oh, I've got my triggers rigged together with bubblegum and tape, so it's not a matter of being unable to achieve the desired result, it's more a matter of needing to query +cs for it at all.

For instance, my current solution checks for a 'you take damage' command, fires +cs, suppresses cs from output and the log, and spawns a window with my current HP. A bit clunky to achieve the result I'm hoping for, which is, 'Something happened to you, and here is where you're at now'.

As you pointed out, this is also an issue with inflicting damage.

somethingfinite commented 4 years ago

To add to this, giving Combat a unique set of borders would be helpful for culling out false-positives when trying to capture 'combat round' information.

This border is used for a lot of different things, like actions, and is variable in length. something even as simple as changing the pluses to make it distinctly a combat border would save me a lot of grief in line-capture land.


+-----------+----------+---------+--------+--------+
| Combatant | Damage   | Fatigue | Action | Ready? |
+-----------+----------+---------+--------+--------+
| Sydney    | serious  | 0       | pass   | no     |
| Tanith    | grievous | 0       | None   | no     |
+-----------+----------+---------+--------+--------+

x-----------x----------x---------x--------x--------x
| Combatant | Damage   | Fatigue | Action | Ready? |
x-----------x----------x---------x--------x--------x
| Sydney    | serious  | 0       | pass   | no     |
| Tanith    | grievous | 0       | None   | no     |
x-----------x----------x---------x--------x--------x
somethingfinite commented 4 years ago

Specifically, here's the situation I am attempting to avoid. I love isolating my combat stuff into one neat little BeipMU popup window. It looks great when it works!

But here's the problem. That border is used elsewhere. So many elsewheres. And because it expands based on combatant names, the only way to actually catch it is regex. Which catches every single one with a similar convention.

Like Events.

image

Among other things. Basically, if combat has a unique border, it's doable. Bonus points if it's a unique open and a unique close border, so one can just catch the opening line and tell it to catch until the close line.