Ha, yeah embarrasing error. I don't get any errors now after changing to Note, but all variables are still 'nil'. I know the gmcp data is being rceived and I didn't change anything within thte gmcp_demo.xml except to remove the SetStatus commands.
Edit: Okay figured out the problem. I have to actually do SetVariable within the plugin for it to be called:
function ShowHealth ()
hp = tonumber (fulldata.Vitals.hp)
mana = tonumber (fulldata.Vitals.mana)
fatigue = tonumber (fulldata.Vitals.fatigue)
bleeding = tonumber (fulldata.Vitals.bleeding)
SetVariable ("Health_gmcp", hp)
SetVariable ("Mana_gmcp", mana)
SetVariable ("Fatigue_gmcp", fatigue)
SetVariable ("Bleeding_gmcp", bleeding)
end -- ShowHealth
Now, can anyone help me pull the gmcp data for the Char.Team? It seems it's Char.Team.1 for first team member, Char.Team.2 for second team member, etc.
Here's the verbose gmcp data from the mud:
Char.Vitals { "hp":100, "mana":100, "fatigue":0, "bleeding":0 }
gmcpdata serialized: {
Char = {
Team = {
[1] = {
name = "Chiara",
blood = "0",
hp = "100",
leader = "0",
pos = "0",
},
[2] = {
name = "Nicole",
blood = "0",
hp = "100",
leader = "1",
pos = "1",
},
},
Vitals = {
fatigue = "0",
mana = "100",
hp = "100",
bleeding = "0",
},
},
}
Char.Team [{"blood":"0", "hp":"100", "leader":"0", "name":"Chiara", "pos":"0"}, {"blood":"0", "hp":"100", "leader":"1", "name":"Nicole", "pos":"1"}]
gmcpdata serialized: {
Char = {
Team = {
[1] = {
name = "Chiara",
blood = "0",
hp = "100",
leader = "0",
pos = "0",
},
[2] = {
name = "Nicole",
blood = "0",
hp = "100",
leader = "1",
pos = "1",
},
},
Vitals = {
fatigue = "0",
mana = "100",
hp = "100",
bleeding = "0",
},
},
}
|