MXP: Howto send a hidden tag?

Posted by Galen on Thu 13 May 2004 02:25 AM — 4 posts, 15,755 views.

Australia #0
Greetings,

Firstup great work Nick, good to see another aussie coder establishing himself well.

I have embarked on extending my MUDS MXP support and one of the things i would like to do is send hidden tags to the players each round, detailing the status of their group.

These tags would only be sent under certain circumstances but they would just contain variables for their clients.
Eg:
<Groupmate Name=Vyper CurrentHp=5000 MaxHp=7000>

Now i am still pretty new at the whole MXP thing but i have been able to send the standard Prompt HP and MAXHP to the players clients which set their associated Hp and MaxHP client variables. This allowed for each scripting on their behalf.

I would hope to achieve a similiar solution by setting their client variables but the information isnt actually displayed.

The questions i have are as follows -:
1) Would sending this data in a custom element as above with these attributes be able to set client variables?

2) If not, what would be the best way to do this, keeping in mind that the information isnt actually displayed to the user.

Most of our users unfortunatly are Zmud, so could the answers to these questions please be generic enough to work on both Zmud and Mushclient.

Thanks in Advance
Galen
Australia Forum Administrator #1
Quote:

Firstup great work Nick, good to see another aussie coder establishing himself well.


Thanks. :)

Quote:

Would sending this data in a custom element as above with these attributes be able to set client variables?

If not, what would be the best way to do this, keeping in mind that the information isnt actually displayed to the user.


What I would do is set up an entity - this is available as a variable in zMUD I believe, and in MUSHclient you can access it via scripting.

eg.


<!ENTITY hp "1234" >


Then in MUSHclient you can do this:


hp = GetEntity ("hp")


I am not sure of the exact syntax in zMUD, but I think it just becomes a client variable there.
Australia #2
Nick,

Thanks for your reply.

I thought i actually tried this, but perhaps i got the approach wrong.

I have successfully setup this
MXPTAG("!ELEMENT Hp FLAG='Set Hp' OPEN")

And then during the prompt parsing sent:
<Hp>1234</Hp>

This worked for cases where i didnt mind the information being displayed to the user. But what im trying to achieve is not having to display the data.

My understanding (with my brief skimming of the documentation), the ENTITIES and ATTRIBUTES are defined like an XML DTD, and sent generally at the beginning of each connection once the negotiation is complete.

Are you suggesting i could send <!ENTITY hp=*> tags during normal game operation?

Australia #3
Sheesh *embarassed* i have been confusing !ELEMENT and
!ENTITY

Sorry for wasteing your time folks.