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))))):
if ((varName.find('Torso_GuildBlue') != -1)...or (varName.find('Torso_GuildWhite') != -1))))):
varKey = varnode.getKey()
varName = varKey.getName()
if playerCNode.removeNode(childNode):
print 'xTakableClothing: Delete was a success.'
else:
print 'xTakableClothing: Delete failed.'
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
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.
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.
Users browsing this forum: No registered users and 0 guests