gmcp.Chars.Items.List does not update while following someone?

by Nihta

Back to Mechanic's Corner.

Nihta2011-10-20 20:43:16
I was playing around with the GMCP and noticed that if you follow someone, gcmp.chars.items.list does not update when following someone. I then made a trigger to quicklook whenever I followed someone somewhere, and it seemed to update the gmcp.chars.items.list but for the last room I was in, not the current one.

Is there a way to force it to update to the current room?
Vadi2011-10-20 20:57:08
They use a funny mechanism of gmcp.chars.items.add, gmcp.chars.items.update, and gmcp.chars.items.remove (to save bandwidth) with means that you have to do the tracking yourself of what's "actually" in the room (something like this): http://www.ironrealms.com/gmcp-doc
Ssaliss2011-10-20 20:58:44
BUG that in-game. I don't think there's a way to get another GMCP.Char.Items list for the room though; it should happen automatically as you move rooms.
Ssaliss2011-10-20 20:59:48
Vadi:

They use a funny mechanism of gmcp.chars.items.add, gmcp.chars.items.update, and gmcp.chars.items.remove (to save bandwidth) with means that you have to do the tracking yourself of what's "actually" in the room (something like this): http://www.ironrealms.com/gmcp-doc

There's also Char.Items.List though (sent by the server).
Nihta2011-10-20 21:21:58
Well usually as you move through rooms, the char.items.list gets provided just fine, and then if you remain in that room, it will send char.items.add and char.items.remove as nessessary untill you move to the next room and a new char.items.list is provided ( as far as I can tell ).

but this happens specifically when you are following someone and they enter a new room and you get the "you follow so and so in some direction" message. As far as I can tell, neither the add, remove or list tables are updated, although as objects are added or removed to the new room, they will show up in the list.


Here is the code I am using to track everything into a table:
(no judgements, I am not exactly a great programmer)


using gmcp.room as an event handler:
function create_object_table()
myvars.objects_in_room = {}

for i,t in pairs(gmcp.Char.Items.List.items) do

myvars.objects_in_room = t.name
end
end


using gmcp.char.items.add as a handler:
function object_table_add()
if gmcp.Char.Items.Add.location == "room" then
myvars.objects_in_room=gmcp.Char.Items.Add.item.name
end
end

using gmcp.char.items.add as a handler:
function object_table_add()
if gmcp.Char.Items.Add.location == "room" then
myvars.objects_in_room=gmcp.Char.Items.Add.item.name
end
end


These 3 functions seem to work pretty well at tracking the objects in the room while I am moving about alone, but when I am following someone, myvars.objects_in_room seems to either not update at all since I start following someone, or update but with the last room I was in. So if I was in a room with a statue of japhiel and I follow someone east to a room with a statue of methrenton, then myvars.objects_in_room will say the room has japhiel in it, then If I follow east again, the next room will say it has a statue of methrenton in it, even though it has a statue of kalila or something.

I started displaying the actual table I was drawing from display(gmcp.Char.Items.List.Items) and found that they seemed to do the same thing as the table I was generating. (minus the adds and removes). Just to be sure, I made an alias that runs create_object_table() to make sure it is just not that gcmp.room does not update when following.

So I am pretty sure something is up, but I am not sure exactly what, especially since I can get it to update for the last room I was in.

I was thinking of submitting it as a bug but I wasn't sure if it was by design, or if I was just using gmcp wrong (as I said I am not exactly a good programmer, just a determined one)
Ssaliss2011-10-20 21:26:58
Nah, it's not being sent properly. I don't get a Char.Items.List either when following.
Unknown2011-10-26 06:58:47
This is correct. gmcp.Chars.Items.List is not sent on following like it should. You can't use add/remove to display what is in a room upon entry because those tables aren't for that. They are for changes made in the room or your inventory.

I can understand using add/remove for tracking room changes, but as it stands, their uses are limited anyway. It doesn't even update the death of a mob properly (currently you have to request the list by looking at the room or tracking when a mob's corpse was picked up). GMCP overall is simply not working as it should, and also triggers too many events for single actions!
Unknown2011-10-31 10:20:16
I bugged this over on Aetolia months ago and it was promptly deleted with no response. Bugged again and same thing happened, so I am guessing it's not going to be changed anytime soon. :(
Iosai2011-10-31 21:34:18
I've looked in to a way to have Char.Items.List trigger on following. It will need some testing to see if it works, and if not we'll have to revert, but hopefully this will resolve some of your concerns. It will be available after a reload.
Ssaliss2011-10-31 21:40:05
Iosai:

I've looked in to a way to have Char.Items.List trigger on following. It will need some testing to see if it works, and if not we'll have to revert, but hopefully this will resolve some of your concerns. It will be available after a reload.

If it helps, Room.Info already triggers when you follow someone around. Not sure if it's as simple as just having Char.Items.List happen at the same time, but... yeah.
Iosai2011-11-01 10:24:18
I've had to shelve the change for a little while due to a problem with Dreamweaving, but I will look into other ways to implement this after talking to Roark.