Kirel MOUL and Guild Shirts

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Re: Kirel MOUL and Guild Shirts

Postby Sirius » Fri Dec 24, 2010 4:36 am

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"...
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Kirel MOUL and Guild Shirts

Postby diafero » Sat Dec 25, 2010 4:45 am

Well, that line only uses varName, or do I miss something?
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Kirel MOUL and Guild Shirts

Postby Sirius » Sat Dec 25, 2010 6:28 am

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...
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Kirel MOUL and Guild Shirts

Postby diafero » Sat Dec 25, 2010 11:01 am

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.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Kirel MOUL and Guild Shirts

Postby Sirius » Tue Dec 28, 2010 7:12 am

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...
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Kirel MOUL and Guild Shirts

Postby D'Lanor » Tue Dec 28, 2010 9:56 am

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.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Kirel MOUL and Guild Shirts

Postby Sirius » Wed Dec 29, 2010 5:57 am

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... :roll:
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Kirel MOUL and Guild Shirts

Postby D'Lanor » Wed Dec 29, 2010 6:31 am

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.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Previous

Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 10 guests