It is currently Tue Dec 02, 2008 5:49 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Clothing becoming invisible
PostPosted: Tue Sep 11, 2007 5:23 am 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
I am fairly certain this is a core bug, probably introduced with pol097rc4 (as part of 096.7 bugfixes.)

I went to 097rc5 and players started to notice that their player vendors and henchmen started to get clothing becoming invisible.

eg Our player vendor has a verbal command 'name wear' and you target an item of clothing. They will put it on. However, anything that was already equipped anywhere on their equip layers goes invisible. Paperdoll reacts the same way if it's open. All I have to do it go offscreen and back again to see they are in fact wearing all the clothes.

I looked through the changes from rc3 to rc5 and nothing seems to apply except maybe a bug in the 096.7 change:

Quote:
4-23 MuadDib
Added : Realm checks in transmitting of packets to clients "in range".


Our realm is on britannia_alt.

I am still working through ways of fixing this, but so far the obvious one of IncRevision(npc); and setname(npc, npc.name); didn't work.


Last edited by OldnGrey on Thu Sep 13, 2007 9:26 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 11, 2007 5:53 am 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
Same bug as reported in:
http://forums.polserver.com/viewtopic.p ... highlight=

Reproducable on non britannia realm.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 11, 2007 11:30 am 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
OnG this may be a rellated issue to the multi bug that I reported here. I think Maud put the core change in because of that bug though since they don't put a year in the dates in corechanges I can't be totally sure. Might be that this change created a new bug.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 11, 2007 5:19 pm 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
Yukiko.
This core bug wasn't there in 097rc3 and first appeared in rc4 or rc5.
I doubt it was rc5 related because that was mainly the packethook memory leak fix release. (I never tried rc4)

That places it somewhere between April and August this year. So I think that it won't be directly related to your bug from last year.


On an npc you see this because only the last item equipped by the npc is visible.


I also have reports of players dropping items of clothing on their own player paperdolls and having them vanish. (this is more what Coltain mentioned in the other post I linked above). I can't reproduce this yet but the npc one is 100% reproducable.


Just to re-iterate the npc one:
realm: britannia_alt
core 097rc5
client: 4.0.3, 5.0.9.1
An npc responds to the 'wear' spoken command by offering a target cursor to select the item to equip. The item is equipped, but all previously equipped items become invisible. All items are still equipped but you need to move offscreen and back to see them all.
IncRevision(npc) and SetName(npc, npc.name) which usually tell the core to update the client do NOT work.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 12, 2007 12:26 am 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
OnG I tried reproducing this bug. It definitely is there for me too but only when using the player vendor "wear" command. I used the .equip command and the player vendor did not lose his clothes. I haven't had time to research the scripts more but here is the code for the .equip command I have. Maybe it will be of help in deciphering what is happening.

Code:
use uo;

program textcmd_equip( speaker )
    SendSysMessage( speaker, "What shall be equipped?" );

    var what := Target( speaker );
    if (!what)
        return;
    endif

    SendSysMessage( speaker, "On whom shall " + what.desc + " be equipped?" );
    var who := Target( speaker );
    if (!who)
        return;
    endif

    var res := EquipItem( who, what );
    if (res)
        SendSysMessage( speaker, "Done!" );
    else
        SendSysMessage( speaker, "Unable to equip item: " + res.errortext );
    endif
endprogram


Pretty straight forward stuff. Anyway, like I said this doesn't cause a loss of clothing in brit_alt like the vendor command does.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 12, 2007 1:06 am 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
Interesting. Thanks for the comments. I knew it wasn't totally straightforward otherwise creating a clothed npc wouldn't work. You've helped me look a bit further.

Looking further into the code for vendors wearing an item, it appears all clothing is first stripped from the npc, then the new item equipped, then the rest are equipped. Thing is, they are equipped from the storage area which appear to be always created in britannia realm.

ie from:
inv_pb := find_or_create_item(storage, me.serial + " PB", 0xE7C);

So therefore the bug appears to be caused when an item is equipped from a different realm.



Here's the code that will show the problem:
Code:
function wear_item(byref item, byref you)
   foreach thing in ListEquippedItems(you)
      if ( thing == item )
         Say("But you're wearing that!");
         return 0;
      endif
   endforeach

   foreach thing in ListEquippedItems(me)
      MoveItemToContainer(thing, inv_pb);
   endforeach

   EquipItem(me, item);

   foreach thingie in ListRootItemsInContainer(inv_pb)
      if ( !EquipItem(me, thingie) )
         if ( GetObjProperty(thingie, "mine") )
            DestroyItem(thingie);
         else
            MoveObjectToLocation(thingie, me.x, me.y, me.z, me.realm, MOVEOBJECT_FORCELOCATION);
         endif
      endif
   endforeach
endfunction




Even more this makes me think the change responsible is still:

Quote:
4-23 MuadDib
Added : Realm checks in transmitting of packets to clients "in range".


If the item starts from a different realm, perhaps we are prevented from seeing it even when it's being equipped.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 12:04 am 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
The items do reappear if you leave the visible area of the NPC and go back though don't they? I can't see how this would be a realm dependant thing but then again I don't know how POL works internally either. Hopefully Maud will get a chance to check this out.

In the meantime maybe the "wear" function needs to be rewrtten to only remove any item already equipped on the layer that the targetted item will be equipped on. That way ya don't get a totally stripped NPC.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 5:56 am 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
I've got workarounds for npcs as posted already. I simply translate them to a spot in britannia and back again a few mS later.

But for players it's harder since a lot of players like to equip directly from special containers which are in britannia (like the bank) and I know of no way to make the item visible on a player without logging off and on again. Players on my shard have seen this happen, but I haven't been able to replicate it. That's why I posted the npc code to replicate the problem and not talked so much about players equipping. There is possibly a workaround for the players equipping, but because I haven't seen it, I can't work with it.

The bug is not so easy to define is it? Maybe it's the doubleclick to equip rather than drag on-cursor to paperdoll. More testing to be done.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 1:24 am 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
Might need to look into the 'use' scripts for the equippables. I remember WoD was written to make D/Cing an item equip it. I gather you haven't tested the effect of the 'use' equip script versus the drag and drop equipping method. Maybe there's something different when a script equips an item versus the drag method although I can't see how.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 3:38 am 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
I've been asking the players. They all report dragging on the mouse pointer to equip from their bankbox is the problem.

Doubleclick (ie usescript) doesn't work in this instance because the scripts prevent you equipping if it's not in your backpack.


There's not a lot more I can do now. I'd love a core developer to look at this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 10:18 pm 
Offline

Joined: Tue Mar 20, 2007 7:17 am
Posts: 106
Location: Poland
Simple test:

Player is in Ilshenar (for eg.)
Equip armor (dragging) from bankbox - armor equiped is invisible
Equip armor (dragging) from backpack - armor equiped is visible

i`ll try to change my equip scripts (when player is in other realm then britannia first move item to place in this realm and then equip)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 11:18 pm 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
You will find you can't do anything with the item in the 'equipscript' entry. It's supposed to return 1 or 0. It's a nice way to generate an exception if you try to move it to their backpack first.

I am currently doing a total hack workaround in the equipscript - ie stop them equipping from a different realm. I'd much rather the core fix though :)

Since this script is run also during shard startup you only want it run when the player is online and dragging the item. eg:

Code:
   if ( character.ip )
      if ( character.realm != item.realm )
         SendSysMessage(character, "Equip this item from your backpack.");
         return 0;
      endif
   endif


If the item has a "script" entry, I do a similar thing but I simply prevent doubleclicking to equip from working anywhere except form their backpack.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 12:06 pm 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
OnG I tried to work around this with the following code for equip.src but POL throws me an exception and gave me a core dump, which is 0 bytes in size.

Code:
use uo;
use os;
use cfgfile;

include "include/client";
include "include/attributes";
include "equip";

program equipweapon(who, item)

    if(!item.IsA(POLCLASS_CONTAINER))
   MoveItemToContainer(who.backpack, item);
   EquipItem(who, item);
    endif
    var val := HandleMods(who, item);
    return val;
endprogram


Hope the devs can tell me what's wrong there.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 12:25 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 225
Yukiko wrote:
Code:
use uo;
use os;
use cfgfile;

include "include/client";
include "include/attributes";
include "equip";

program equipweapon(who, item)

    if(!item.IsA(POLCLASS_CONTAINER))
   MoveItemToContainer(who.backpack, item);
   EquipItem(who, item);
    endif
    var val := HandleMods(who, item);
    return val;
endprogram

I'm not a dev, nor have I tested out this bug you have, but isn't the code above running into eternal loop?

Equipping item launches the equipscript, where it gets equipped again and launches the equipscript and gets equipped again and ---.

If that is the problem, maybe setting a cprop into an item and ignoring it if that cprop exists could solve that? Something like this:

Code:
program equipscript(who, item)
    if (GetObjProperty(item, "#IgnoreEquip"))
        EraseObjProperty(item, "#IgnoreEquip");
        return 1;
    endif

    SetObjProperty(item, "#IgnoreEquip", 1);
    // Do rest of the normal equipping stuff.
endprogram


Another way could be testing if item to be equipped is in backpack already, and if it's not, moving it into it.

Didn't test this though, just got this idea. Don't know if I got any of that right.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 3:39 pm 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
That's a good question.

Does using the POL function EquipItem() call the item's equip script?

Since the modified equip script is calling an internal POL function I didn't think it was but you might be right.

The problem mentioned by OnG seems to be that items equipped (dragged onto a character) from special containers, which are "kept" in the britannia realm, don't properly display on a mobile when that mobile is in any other realm other than britannia. So what I wanted to do was unequip the item, move it to the realm the character is in and re-equip it from that realm, hopefully fast enough that it wouldn't be visible.

Anyway, maybe someone can let me know if I am causing an infinite loop there. Like I said I thought using the EquipItem() function would bypass the equip script but who knows.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 4:01 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 225
Yukiko wrote:
Does using the POL function EquipItem() call the item's equip script?

http://docs.polserver.com/pol096/singlefunc.php?funcname=EquipItem&xmlfile=uoem.xml.

PolDoc wrote:
EquipItem( mobile, item )
Runs the Item's Equiptest and Equip scripts, if any.


Yukiko wrote:
Anyway, maybe someone can let me know if I am causing an infinite loop there.

Best way would be testing. I'm middle of something way different right now, but I'll check this one out later, if no-one else does that by then.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 5:33 pm 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
The equipscript value in itemdesc is run when the item is equipped, and is also run whenever the shard is started for each and every npc.

You cannot DO anything with the item in the equipscript all you can do is return 0 to deny the equipping.

As I posted earlier the only way I have found so far is to simply deny equipping if it's a player and the item starts from a different realm.

I also found out why I wasn't seeing the bug myself. It was because I had moved all existing players and items to britannia_alt. A new player gets their bankbox created in britannia and so they see the bug.


In any case this remains a core bug and I hope the devs will sort it out soon. So far a dev hasn't told us they have seen this thread.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 9:16 pm 
Offline
Certified POL Expert
User avatar

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1222
Location: Southern Central USA
Thanks ncrsn. I should have followed my own advice and looked at the docs.
: P

OnG, is there anyway to create your new player's bank boxes in britannia_alt?

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 9:38 pm 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 580
Yukiko,
The command for creating the storage container has no realm parameter and it doesn't follow _DEFAULT_REALM.
So I am guessing no. :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 6:16 pm 
Offline

Joined: Fri Feb 10, 2006 8:29 am
Posts: 21
Hi everyone.

Today Ive updated my POL to 07-25 and noticed the same lil buggy.
As far as I noticed, POL simply doesnt send worn update for player and players around him, when item is equipped from different realm.
Bigger problem causes mounting (if your script is equiping it from brit), because player cant get off mount, unless he trigger MoveObject on himself.

Ive done temporarily my own send packet after EquipItem, so everyone gets correct update.

Code:
    EquipItem(master,mount);

    if(master.realm != REALM_BRITANNIA)
      var Packet := CreatePacket(0x2E, 15);
      Packet.SetInt32(1, mount.serial);
      Packet.SetInt16(5, mount.graphic);
      Packet.SetInt8(7, 0);
      Packet.SetInt8(8, LAYER_MOUNT);
      Packet.SetInt32(9, master.serial);
      Packet.SetInt16(13, mount.color);

      foreach Obj in ListObjectsInBox(master.x-18, master.y-18, -127, master.x+18, master.y+18, 127, master.realm)
        if(Obj.acctname)
          Packet.SendPacket(Obj);
        endif
      endforeach
    endif


Works well, for mount.
I think, its doable in can equip script, so you can know previous location of item, but havent tested it yet. I hope we will get this bug fixed shortly :)


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: Yahoo [Bot] 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