Esempio n. 1
0
def swapPlayer(saveName, oldForm, newForm, flags=0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40):
    """Swaps the player between old and new forms.
    Archives player's current form/stats to oldForm, then changes player into new form."""
    oldForm = intArg(oldForm)
    newForm = intArg(newForm)
    flags = intArg(flags)
    # --Open Save file
    saveName = GPath(saveName)
    saveFile = data.getSaveFile(saveName)
    # --player >> oldForm
    oldFace = PCFaces.save_getPlayerFace(saveFile)
    PCFaces.save_setCreatedFace(saveFile, oldForm, oldFace)
    if not oldFace.gender:
        data.shapeIsMale.touch()
    # --newForm >> player
    newFace = PCFaces.save_getCreatedFace(saveFile, newForm)
    PCFaces.save_setPlayerFace(saveFile, newFace, flags)
    # --Checking
    # printFace(oldFace)
    # printFace(PCFaces.save_getCreatedFace(saveFile,oldForm))
    # printFace(newFace)
    # printFace(PCFaces.save_getPlayerFace(saveFile))
    # --Save and done
    if saveName not in data.saves:
        saveFile.safeSave()
    print u"  %s >> %s..." % (oldFace.pcName, newFace.pcName)
Esempio n. 2
0
def ripAppearance(srcName, destName, srcForm="player", destForm="player", flags=unicode(0x2 | 0x4 | 0x8 | 0x10)):
    """Rips a face from one save game and pastes it into another."""
    flags = intArg(flags)
    srcName = GPath(srcName)
    destName = GPath(destName)
    # --Get source face
    srcFile = data.getSaveFile(srcName)
    if srcForm == "player":
        face = PCFaces.save_getPlayerFace(srcFile)
    else:
        srcForm = intArg(srcForm)
        face = PCFaces.save_getCreatedFace(srcFile, srcForm)
    # printFace(face)
    # --Set destination face
    if srcName == destName:
        destFile = srcFile
    else:
        destFile = data.getSaveFile(destName)
    if destForm == "player":
        PCFaces.save_setPlayerFace(destFile, face, flags)  # --Race, gender, hair, eyes
    else:
        destForm = intArg(destForm)
        PCFaces.save_setCreatedFace(destFile, destForm, face)
        if not face.gender:
            data.shapeIsMale.touch()
    if destName not in data.saves:
        destFile.safeSave()
    # --Done
    print face.pcName, u"...",
Esempio n. 3
0
def swapPlayer(saveName,
               oldForm,
               newForm,
               flags=0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40):
    """Swaps the player between old and new forms.
    Archives player's current form/stats to oldForm, then changes player into new form."""
    oldForm = intArg(oldForm)
    newForm = intArg(newForm)
    flags = intArg(flags)
    #--Open Save file
    saveName = GPath(saveName)
    saveFile = data.getSaveFile(saveName)
    #--player >> oldForm
    oldFace = PCFaces.save_getPlayerFace(saveFile)
    PCFaces.save_setCreatedFace(saveFile, oldForm, oldFace)
    if not oldFace.gender: data.shapeIsMale.touch()
    #--newForm >> player
    newFace = PCFaces.save_getCreatedFace(saveFile, newForm)
    PCFaces.save_setPlayerFace(saveFile, newFace, flags)
    #--Checking
    #printFace(oldFace)
    #printFace(PCFaces.save_getCreatedFace(saveFile,oldForm))
    #printFace(newFace)
    #printFace(PCFaces.save_getPlayerFace(saveFile))
    #--Save and done
    if saveName not in data.saves:
        saveFile.safeSave()
    print u'  %s >> %s...' % (oldFace.pcName, newFace.pcName)
Esempio n. 4
0
def ripAppearance(srcName,
                  destName,
                  srcForm='player',
                  destForm='player',
                  flags=unicode(0x2 | 0x4 | 0x8 | 0x10)):
    """Rips a face from one save game and pastes it into another."""
    flags = intArg(flags)
    srcName = GPath(srcName)
    destName = GPath(destName)
    #--Get source face
    srcFile = data.getSaveFile(srcName)
    if srcForm == 'player':
        face = PCFaces.save_getPlayerFace(srcFile)
    else:
        srcForm = intArg(srcForm)
        face = PCFaces.save_getCreatedFace(srcFile, srcForm)
    #printFace(face)
    #--Set destination face
    if srcName == destName:
        destFile = srcFile
    else:
        destFile = data.getSaveFile(destName)
    if destForm == 'player':
        PCFaces.save_setPlayerFace(destFile, face,
                                   flags)  #--Race, gender, hair, eyes
    else:
        destForm = intArg(destForm)
        PCFaces.save_setCreatedFace(destFile, destForm, face)
        if not face.gender: data.shapeIsMale.touch()
    if destName not in data.saves:
        destFile.safeSave()
    #--Done
    print face.pcName, u'...',
Esempio n. 5
0
def deleteForm(saveKey, formid):
    """Saves changes to savegame. WARNING: NOT TESTED! [3/16/2008]"""
    formid = intArg(formid)
    saveFile = data.getSaveFile(saveKey)
    removedRecord = saveFile.removeRecord(formid)
    removedCreated = saveFile.removeCreated(formid)
    print (u"  No such record.", u"  Removed")[removedRecord or removedCreated]
Esempio n. 6
0
def deleteForm(saveKey, formid):
    """Saves changes to savegame. WARNING: NOT TESTED! [3/16/2008]"""
    formid = intArg(formid)
    saveFile = data.getSaveFile(saveKey)
    removedRecord = saveFile.removeRecord(formid)
    removedCreated = saveFile.removeCreated(formid)
    print(u"  No such record.", u"  Removed")[removedRecord or removedCreated]