Page 2 of 2
Re: Kirel MOUL and Guild Shirts
Posted: Fri Dec 24, 2010 4:36 am
by Sirius
I'm not really good in Python, so Java won't help

and I don't (yet) know how to use
for. I didn't found it because this variable wasn't declared.
Isn't "varKey" used after to find if avatar don't already have a guild shirt ?
Code: Select all
if ((varName.find('Torso_GuildBlue') != -1)...or (varName.find('Torso_GuildWhite') != -1))))):
It would be better to avoid removing this line. I don't really know why the .getKey() isn't working with "varnode"...
Re: Kirel MOUL and Guild Shirts
Posted: Sat Dec 25, 2010 4:45 am
by diafero
Well, that line only uses varName, or do I miss something?
Re: Kirel MOUL and Guild Shirts
Posted: Sat Dec 25, 2010 6:28 am
by Sirius
varName needs varKey in this line:
Code: Select all
varKey = varnode.getKey()
varName = varKey.getName()
Would it be possible to remove the line "if((..." ?
As the line deleting the entry from the vault is a test, maybe it could work...
Code: Select all
if playerCNode.removeNode(childNode):
print 'xTakableClothing: Delete was a success.'
else:
print 'xTakableClothing: Delete failed.'
I'll try this. But I really don't understand why the getKey() isn't working...
Re: Kirel MOUL and Guild Shirts
Posted: Sat Dec 25, 2010 11:01 am
by diafero
You could comment out the entire function "IRemoveOtherGuildShirt" (replace it by "pass"), but then of course the old guild shirt will not be removed from the closet. That weird code is doing nothing but scanning your closet for other guild shirts and removing them, and it seems the way they used in MOUL does not work in POTS. There might be other ways, I don't know.
Re: Kirel MOUL and Guild Shirts
Posted: Tue Dec 28, 2010 7:12 am
by Sirius
I removed the buggy line and replaced it by this:
Code: Select all
def IRemoveOtherGuildShirt(self):
playerCNode = ptVault().getAvatarClosetFolder()
print ('xTakableClothing: getAvatarClosetFolder Type = ' + str(playerCNode.getType()))
print ('xTakableClothing: getAvatarClosetFolder Child Node Count = ' + str(playerCNode.getChildNodeCount()))
if (playerCNode.getChildNodeCount() > 0):
playerCNodeList = playerCNode.getChildNodeRefList()
for folderChild in playerCNodeList:
PtDebugPrint(('xTakableClothing: looking at child node ' + str(folderChild)), level=kDebugDumpLevel)
childNode = folderChild.getChild()
if (childNode != type(None)):
print 'xTakableClothing: Child Node Node ID'
SDLNode = childNode.upcastToSDLNode()
if (type(SDLNode) != type(None)):
rec = SDLNode.getStateDataRecord()
print ('xTakableClothing: getStateDataRecord().getName(): ' + str(rec.getName()))
SDLVarList = rec.getVarList()
for var in SDLVarList:
varnode = rec.findVar(var)
if varnode:
if (varnode.getType() == 4):
print 'xTakableClothing: Let\'s see if player have another guild shirt. Deleting Old Guild Shirt.'
try:
playerCNode.removeNode(childNode)
print 'xTakableClothing: Delete was a success.'
except:
print 'xTakableClothing: Player don\'t have any guild shirt yet.'
return
I don't have any problem in Kirel now, it works fine. The logs says "Delete was a success".
But the shirts are still present in my closet. Is that because of the file for avatar custom or a problem with my xTakableClothing ? Ah, I'll never get it working...
Re: Kirel MOUL and Guild Shirts
Posted: Tue Dec 28, 2010 9:56 am
by D'Lanor
That "buggy line" is actually there to identify the clothing item which has to be removed. Edit: What you are doing should remove all clothing. But to make that final I think you need to save the vaultnode after editing it: playerCNode.save()
I don't think that you can remove a single clothing item from the closet through Python in Uru:CC. ptAvatar has an addWardrobeClothingItem attribute but there is nothing that does the opposite, simply because it was not needed.
In MOUL Cyan apparently added that getKey attribute to ptSimpleStateVariable to work around this limitation. It seems they are now editing the clothing SDL directly, which IMO is not how this should be done (another item on the long list of lame MOUL workarounds). Why they didn't just add a removeWardrobeClothingItem attribute to ptAvatar instead is beyond me.
Re: Kirel MOUL and Guild Shirts
Posted: Wed Dec 29, 2010 5:57 am
by Sirius
It worked ! Thanks D'Lanor.
D'Lanor wrote:What you are doing should remove all clothing. I don't think that you can remove a single clothing item from the closet through Python in Uru:CC.
In MOUL Cyan apparently added that getKey attribute to ptSimpleStateVariable to work around this limitation.
I don't really understand... do you mean by taking a guild shirt it would remove everything from the closet ? Anyway, at least it works fine now. I'll see if there are any side effects.
And then... I'll try to make the Nexus working...

Re: Kirel MOUL and Guild Shirts
Posted: Wed Dec 29, 2010 6:31 am
by D'Lanor
Sirius wrote:I don't really understand... do you mean by taking a guild shirt it would remove everything from the closet ? Anyway, at least it works fine now. I'll see if there are any side effects.
Not everything, just the reward clothing you have collected: Yeesha and Zandi shirts, tie-dye, backpack etc.