MedHelp - Medievia Help System
Movement | Information | Communication | Newbie | Object
Combat | General | Clans | Socials | Spells | Special | FAQs

GMCP

Generic MUD Communication Protocol

GMCP is a protocol that allows communication of game data to the client
behind the scenes. Medievia currently implements two GMCP modules,
Char.Vitals and Room.Info. What this means to the user is these arrays
will be automatically populated by the game without the need to use
triggers to extract data from a prompt, or use script logic to extract
the room name that youre currently in.

GMCP is available in Mudlet which is our preferred client. The examples
below assume that someone is using Mudlet. Other clients such as
TinTin++ and MUSHClient also support GMCP and the data may be made
available in those clients in some other form.

Typing in Mudlet, lua gmcp, will show you the entire GMCP array that
contains data from the game server. Below are listings of the mentioned
Char.Vitals and Room.Info data:

Char.Vitals Module:
Typing lua gmcp.Char.Vitals will show you the data currently in the
Char.Vitals module. A full set of vitals are sent upon login, and each
minute. An updated value is provided when it changes, immediately.

You will see something like this:
{
br = 100,
hp = 359,
mana = 574,
maxHp = 359,
maxMana = 574,
maxMv = 660,
mv = 660,
mounted = 0
}

If you are in formation and fighting, there will be two additional
fields that provide the health information of your lowest form member.
fmPct = 90,
fmVict = PlayerName

These values are then available to the user for use in scripting, just
use the variable as listed with the gmcp.Char.Vitals prefix.
Example:
gmcp.Char.Vitals.hp     -- This is your current HP
gmcp.Char.Vitals.maxHp  -- This is your max HP

If the player client sends a GMCP request with a Char.Vitals message,
lua sendGMCP(Char.Vitals.Get) on the command line, or
sendGMCP(Char.Vitals.Get) as a script command, they will receive a full
Char.Vitals message. This can be useful when a player has done a
resetProfile() and would like to receive a full update immediately
without waiting out the minute delay before the game sends a full update
automatically. This request may only be done once per minute and will
reset the minute timer between full updates.

Char.Afflictions Module:
Character afflictions (spell affects) are also reported by GMCP. When a
player gains a spell affect they will receive via GMCP a
Char.Afflictions.Add message containing:
{
name = Name of the spell affect,
ticks = Number of ticks remaining for this affect,
modifier = The modifier this spell affect will apply
}

When a player loses a spell affect they will receive a
Char.Afflictions.Remove message containing:
{
name = Name of the spell affect
}

If the player client sends a GMCP request with a Char.Afflictions.Get
message, for example in Mudlet lua sendGMCP(Char.Afflictions.Get)
on the command line, or sendGMCP(Char.Afflictions.Get) as a script
command, they will receive an array of spell affects they are currently
affected by, in a Char.Afflictions.List message back to the client.
{
afflictions = [
{
name = Name of the first spell affect,
ticks = Number of ticks remaining for this affect,
modifier = The modifier this spell affect will apply
},
{
name = Name of the second spell affect,
ticks = Number of ticks remaining for this affect,
modifier = The modifier this spell affect will apply
}
]
}

As with the above Char.Vitals request, this request will be granted once
per minute.

Room.Info Module:
Typing lua gmcp.Room.Info will show you the data currently in the
Room.Info module. New data is provided each new room you visit.

You will see something like this:
{
exits = {
s = A Prismatic Hallway
},
name = Office of Kymbahl
}

These values are then available to the user with the gmcp.Room.Info
prefix.
Example:
gmcp.Room.Info.name     -- This is your current room name
gmcp.Room.Info.exits.s  -- This is the room name of the room to the
South