Writing Player Data Heartbeat Plugins

Started by James de Monet, August 27, 2014, 06:24:49 AM

Extracted from Nathvaan's Promps, who needs them?! (changed) thread.

I really like a lot of the ideas proposed in that thread, but using more than one or two of them would make your prompt multiple lines long.  I don't know how other client plugin tools work, so maybe 137 or someone more knowledgeable can chime in here, but maybe it would be more helpful to create some kind of heartbeat that a client can latch onto and use to display all this info in some kind of (truly) graphical status bar somewhere other than at your prompt?

For example, there isn't a time heartbeat, but since it's based on real time, we can calculate and display it outside of the client.

Quote from: Harmless on August 27, 2014, 02:04:46 AMA visual or very shortened depiction of the time. If it could use color that'd be sexy.

So you could, for example, make a clock that goes elsewhere on your screen, like I did in that other thread (and others have done before).  Now, if we could get some way of getting all this other data, and putting all of that into some kind of toolbar as well, that would be downright rocksauce.  Even if it required staff to code the heartbeat (almost certainly not trivial), and it was left to players to write the toolbar or use said heartbeat as they will, I still think we could make a community effort of it.  I know I would be down to help...


Maybe I'm far afield of the kind of feedback Nathvaan was looking for, but it seemed pertinent to the discussion, I just didn't want to derail.
Quote from: Lizzie on February 10, 2016, 09:37:57 PM
You know I think if James simply retitled his thread "Cheese" and apologized for his first post being off-topic, all problems would be solved.

This is a good idea partixularly if you wanted to display a stun cooldown timer for example in a custom client, but it could also take pretty much anything from the prompt and display it more elaborately.
Useful tips: Commands |  |Storytelling:  1  2

I'm not really sure how you could pull any other relevant information other than time into a non-client based tool. And this "heartbeat"(weird name yo) that attaches onto the client sounds pretty complicated, and how far would the support go? Just Zmud and Mushclient? I'm pretty sure the program would need to be tailored specifically and individually to each persons client, and there's a lot of them.


I love the idea in general, but I'm not sure if anything other than a client-based script, like Agent_137's mushclient toolbar would be feasible. The more things Nathvaan adds to the prompt the more things that can be conveniently and aesthetically managed with those sorts of toolbars.

heartbeat is a standard programming term for a "ping" (a small packet of data) sent regularly without stimulus to the client.

Arma currently doesn't have heartbeats, but actions that occur automatically without player input function like heartbeats. Examples are time messages, vNPC emote echos, etc. A heartbeat like this would be an toggleable packet of more useful data sent to the client much more often (such as every second at the fastest), giving the player's client constant updates to information that goes in the prompt.

The results could be convenient for people who like to keep a close eye on the prompt. This is probably not the majority of players, but for some it could be very convenient. An example is to be able to see if your character is recovering their hp, stun, mana, or moves without having to press the return key.

Unless I am totally wrong about this, in which case JdM can correct me.
Useful tips: Commands |  |Storytelling:  1  2

No, you summed it up pretty well.  :)
Quote from: Lizzie on February 10, 2016, 09:37:57 PM
You know I think if James simply retitled his thread "Cheese" and apologized for his first post being off-topic, all problems would be solved.

Could be a cool thing to have, although I suspect it's tangential to Nathvaan's quest of adding more information options to the prompt - probably a good idea to be in a separate thread.  Some random thoughts:

The 'infobar' already provides a heartbeat for your health, stamina, stun, etc.  This stuff comes to the client just like any other text (but with additional information that tells your terminal where to position the stuff on the screen).  It's therefore possible that, at least in some clients, you could write triggers off of infobar updates.  I experimented with it a little at some point but didn't get far.

To turn the heartbeat idea on its head, you could have your client send heartbeats to the server instead.  (Players already do this manually when they hold the return button, which was mentioned.)  Every 1 or 2 seconds, just send a "return" - if you have brief prompt on, a new prompt will only be displayed when it's ready.  To avoid spamming yourself, you could also have your client squelch the incidental linebreaks that appear.

nerds in this thread
The neat, clean-shaven man sends you a telepathic message:
     "I tried hairy...Im sorry"

True...and actually, I just did some Googling and found out that it is possible to have MUSHclient send heartbeats to an external program. With a squelched prompt, and an external handler, you could probably get all the info you needed for such a status bar just fine using the prompt info. The only difference between that and a server-side heartbeat would be the need to press enter and/or tap into the infobar.

Hmmmmmm.

>em puts on his plotting face
Quote from: Lizzie on February 10, 2016, 09:37:57 PM
You know I think if James simply retitled his thread "Cheese" and apologized for his first post being off-topic, all problems would be solved.

I guess this isn't really what a "heartbeat" is, but I do have my client automatically input the "time" command for me every ten minutes, so my logs have a record of every in game hour that passes.  The only thing I don't like about it is that it kind of messes me up when I use the in game text editor, or use the  "gone" command. 

If the mud would just spit the time at me every ten minutes, without me having to invoke my client's timer powers, that would be better.
Child, child, if you come to this doomed house, what is to save you?

A voice whispers, "Read the tales upon the walls."

Quote from: LauraMars on August 27, 2014, 05:03:26 PM
I guess this isn't really what a "heartbeat" is, but I do have my client automatically input the "time" command for me every ten minutes, so my logs have a record of every in game hour that passes.  The only thing I don't like about it is that it kind of messes me up when I use the in game text editor, or use the  "gone" command.  

If the mud would just spit the time at me every ten minutes, without me having to invoke my client's timer powers, that would be better.

In the in-game text editor, I think you can do something like .x <command> and it will perform <command> without you exiting the editor.  Random idea - it would be cool if, when you did ".x <command>" outside the editor it, it performed <command> just the same.  Then a ".x time" heartbeat (from your end) every ten minutes would never mess up ongoing edits.

Edited to add: Mars, you could just "alias .x time" in-game and then ".x time" would be safe no matter if it were in the editor or not - you'd always get your time pulse.
The neat, clean-shaven man sends you a telepathic message:
     "I tried hairy...Im sorry"

August 27, 2014, 06:57:51 PM #9 Last Edit: August 27, 2014, 07:00:54 PM by James de Monet
Wouldn't that depend upon whether the alias refactors or simply translates?

If it recalculates your input based on the alias and then basically reenters the text, then entering ".x time" while editing would alias to "time time" and still put "time time" in your text. I think. Also, you couldn't use ".x" for anything else, then.

The text editor is weird. I know you can't nest them. If you try to write a bio using .x while writing a rumor, for example, it will kick you out of the rumor editor into the bio editor. Not sure of how the aliases codedly work, though.
Quote from: Lizzie on February 10, 2016, 09:37:57 PM
You know I think if James simply retitled his thread "Cheese" and apologized for his first post being off-topic, all problems would be solved.

Quote from: James de Monet on August 27, 2014, 06:57:51 PM
Wouldn't that depend upon whether the alias refactors or simply translates?

If it recalculates your input based on the alias and then basically reenters the text, then entering ".x time" while editing would alias to "time time" and still put "time time" in your text. I think. Also, you couldn't use ".x" for anything else, then.

I should've said using the MUD's in-game alias system, not a client-side alias.  Outside the editor, .x time would 'refactor' to "time time" which would still output the time; inside the editor, .x time would just send 'time' to the mud.  So it would be safe in both situations, if hackish.  I haven't tested any of this btw.

Quote from: James de Monet on August 27, 2014, 06:57:51 PM
The text editor is weird. I know you can't nest them. If you try to write a bio using .x while writing a rumor, for example, it will kick you out of the rumor editor into the bio editor. Not sure of how the aliases codedly work, though.

Presumably you can't inadvertently access your aliases from inside the editor, that would be bonkers and probably a bug.  LauraMars will bravely try it out for us and tell us how it goes!
The neat, clean-shaven man sends you a telepathic message:
     "I tried hairy...Im sorry"

Quote from: CodeMaster on August 27, 2014, 06:38:25 PMEdited to add: Mars, you could just "alias .x time" in-game and then ".x time" would be safe no matter if it were in the editor or not - you'd always get your time pulse.

Yeah, I can try this.  Good idea!
Child, child, if you come to this doomed house, what is to save you?

A voice whispers, "Read the tales upon the walls."