PenUltima Online

It is currently Sun Sep 07, 2008 1:00 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: item.graphic
PostPosted: Wed Apr 02, 2008 4:26 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 217
Yesterday I ran across a very new problem. I tried to change a graphic of an equipped item.

The graphic updated correctly to the character who wore the item.
Characters nearby didn't see the difference - to them, item's graphic stayed the same.
Same happened if the modified item was onto NPC.

Packets sent by POL were absolutely the same. For some reason onlooking clients just did not update the view accordingly.

It wasn't until the character went away and returned back that the item's graphic updated.

I tried this with different items.

I tried sending the 0x2E packet again after .graphic change.

Finally I tried to solve the error by sending delete object packet (http://packets.polserver.com/index.php?op=showpacket&packet=0x1D) just before updating the graphic member, and that seems to solve it.

I tested this using client 5.0.6c, and finally the discussion may begin... Is this something that the newer clients introducted, or just a mistake of mine? If latter, what is the error I made? If this "feature" do exist, is it possible to alter core to do the job, so scripters would not have to create ChangeGraphic()-functions to work around this problem?

Using the 5.0.6c client, the error occurs on both POL097RC5 and POL097 2008-02-26.

--

Just in case someone needs it, this is one way to solve this problem: use the function below instead of item.graphic (when changing graphic of an item equipped to character [using 5.0.6c client {if what said above if valid}])

Code:
function ChangeGraphic( item, graphic )
   var mobile := item.container;
   
   if (mobile)
      var packet := CreatePacket(0x1D, 5);
      packet.SetInt32(1, item.serial);
      
      foreach player in ListMobilesNearLocationEx(mobile.x, mobile.y, mobile.z, 18, LISTEX_FLAG_NORMAL + LISTEX_FLAG_HIDDEN + LISTEX_FLAG_GHOST + LISTEX_FLAG_CONCEALED, mobile.realm)
         if (!player.isa(POLCLASS_NPC))
            if (mobile != player)
               packet.SendPacket(player);
            endif
         endif
      endforeach
   endif
   
   item.graphic := graphic;
   
endfunction


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 9:49 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 549
I wonder if the 'equip from another realm' bug that was introduced in rc5 (?) wasn't properly fixed in POL097 2008-02-26. (ie it only fixed it for self, but not others)

I am still on rc5 and have similar problems when on Ilshenar but was hoping POL097 2008-02-26 was going to fix it.

Equipping an item doesn't change the realm of the item and you have to go offscreen and back to see it updated.

I am doing all my tests on v5.0.9.1 client but we have 4.0.3.d as well.

Knowing your findings I will try and see if I can narrow it down. Thanks for the useful function though. It might just help if there's no other recourse.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 5:46 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 217
Never used multiple realms so cannot tell for sure.

To be more exact, here's a step by step tutorial to test if the mentioned bug exists (note, mobile could be PC, and if it is, his/her client will update the graphic accordingly.):

1. Create a NPC.
2. Add equipment on NPC, for instance a robe.
3. Open NPC's paperdoll.
4. Using .setprop graphic X, or any other way, change the robe's graphic to something else. The internal script should be just "item.graphic := X". New value does not matter as far as it is different than current, it doesn't even have to valid graphic.
5. Report to this thread: did the change of a graphic update to your client correctly?
6. If yes, what core and client did you use for testing? Are you using packethooks that may affect the result?

--

I wrote a packethook that fixes the problem without the need of altering the scripts. But before I publish it, I'd like to know if there are anyone who might need it - so far this is occured using client versions 5.0.1j and 5.0.6c with POL 097 RC5 and POL 097 2008-02-26.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 06, 2008 11:32 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 217
Found this: http://forums.polserver.com/ftopic1085.php.

And responded: http://forums.polserver.com/sutra10656.php#10656.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 06, 2008 11:14 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 549
Very handy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl