Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Event OnExport(string eventName, string strArg, float numArg, Form sender)
- startstackprofiling()
- Cell celCurrent = (GetPlayer() as ObjectReference).GetParentCell()
- String strFileName = "GameToMod Export " + celCurrent.GetName()
- SetTextOptionValue(iExportOID, "Exporting...")
- ;Trace("sFileName:" + sFileName)
- CloseUserLog(strFileName)
- OpenUserLog(strFileName)
- TraceUser(strFileName, ";CELL;" + IntToHexString(celCurrent.GetFormID()) + ";" + celCurrent + ";" + celCurrent.GetName())
- ; TraceUser(strFileName, ",ObjectID,FormID,Source Mod,Position.X,Position.Y,Position.Z,Rotation.X,Rotation.Y,Rotation.Z,XSCL - Scale,NAME - Base,FULL - Name,Enabled,Deleted,MotionType")
- CreateKeyframedOjectsList() ;populate the list of objects locked down with Jaxonz Positioner
- string sESPname
- int iType = 1
- int iModsBitField = giModsBitFields[iGVIndex].GetValueInt()
- int iOptsBitField = giOptsBitField.GetValueInt()
- iTypesBitField = giTypesBitField.GetValueInt()
- While iType < 135
- If ShouldExport(iType)
- int iRefs = celCurrent.GetNumRefs(iType) - 1
- while iRefs > 0
- ObjectReference objRef = celCurrent.GetNthRef(iRefs, iType)
- int iModIndex = RightShift((objRef.GetBaseObject().GetFormID()),24)
- If iGVIndex != (iModIndex/20) as Int
- iGVIndex = (iModIndex/20) as Int
- iModsBitField = giModsBitFields[iGVIndex].GetValueInt()
- EndIf
- ;Trace("objRef:" + objRef + ", iModIndex:" + iModIndex + ", iGVIndex:" + iGVIndex + ", iTypesBitField:" + iTypesBitField + ", LogicalAnd(iTypesBitField, pow(2, iModIndex) as int):" + LogicalAnd(iTypesBitField, pow(2, iModIndex) as int))
- If LogicalAnd(iModsBitField, pow(2, iModIndex) as int) ;if mod selected for export
- If ((objRef.GetFormID() <= 0) && LogicalAnd(iOptsBitField, 0x1)) || ((objRef.GetFormID() != 0) && LogicalAnd(iOptsBitField, 0x2))
- TraceUser(strFileName, ";" + IntToHexString(objRef.GetFormID()) + ";" + IntToHexString(objRef.GetBaseObject().GetFormID()) + ";" + GetModName(iModIndex) + ";" + RoundTo(objRef.X, 1) + ";" + RoundTo(objRef.Y, 1) + ";" + RoundTo(objRef.Z, 1) + ";" + FixAngle(objRef.GetAngleX(), 1) + ";" + FixAngle(objRef.GetAngleY(), 1) + ";" + FixAngle(objRef.GetAngleZ(), 1) + ";" + RoundTo(objRef.GetScale(),2) + ";" + objRef.GetBaseObject().GetName() + ";" + objRef.GetDisplayName() + ";" + objRef.IsEnabled() + ";" + objRef.IsDeleted() + ";" + IffString(flstKeyframed.HasForm(objRef),"4", "0"))
- Else
- trace("objRef.GetFormID():" + objRef.GetFormID() + ", iOptsBitField:" + iOptsBitField)
- EndIf
- EndIf
- iRefs -= 1
- If iRefs % 10 == 0 ;show progress
- SetTextOptionValue(iExportOID, "Type " + iType + ", " + iRefs + " to go")
- EndIf
- EndWhile
- EndIf
- iType += 1
- EndWhile
- MessageBox("Operation complete!\nCell data written to " + strFileName + ".0.log\nWhich can usually be found in the directory Documents\\my games\\skyrim\\Logs\\Script\\User")
- SetTextOptionValue(iExportOID, "Create File")
- StopStackProfiling()
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment