Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

Collecting Scripts

Coder-centric area for programming advice and questions.

Collecting Scripts

Postby WarrantyVoider » 06 May 2013, 21:14

Here I wanna collect useful scripts for scriptcompiler, I start with a mesh scanner

Spoiler:
//Written by WarrantyVoider
using System.IO;
using System.Collections.Generic;
using ME3Explorer;
using ME3Explorer.Scripting;
using ME3Explorer.Unreal;

namespace ME3Explorer
{
public class MyScript : IScript.IScript
{
public BasicFunction BF;
public string result;

public string RunScript()
{
Init();
Exec();
CleanUp();
return result;
}

public void Init()
{
BF = new BasicFunction();
result = "Done.";
}

public void Exec()
{
string MeshName = "HGR";//"YOUR_MESH_NAME_HERE";
MeshName = MeshName.ToLower();
string path = ME3Directory.cookedPath;
string [] files = Directory.GetFiles(path, "*.pcc");
int count = 0;
foreach(string file in files)
{
PCCObject pcc = new PCCObject(file);
for(int i=0; i<pcc.Exports.Count; i++)
if(pcc.Exports[i].ClassName == "SkeletalMesh"
&& pcc.Exports[i].ObjectName.ToLower().Contains(MeshName))
{
BF.DebugPrintln("Found Mesh in File:");
BF.DebugPrintln(file);
BF.DebugPrintln("in Object #" + i + " \"" + pcc.Exports[i].ObjectName + "\"");
}
if((count++)%10==0)
BF.DebugPrintln("File " + (count + 1) + "/" + files.Length);
}
}

public void CleanUp()
{
BF = null;
}
}
}


greetz WV
always backup your files!
mess with the best or die like the rest!
"I tried everything!" - "mkay, please list that..." ; please dont pm me for help, we have a help section
User avatar
WarrantyVoider
Emeritus
 
Posts: 2270
Joined: 22 Aug 2012, 11:33
Has thanked: 480 time
Have thanks: 626 time

Return to Coders' Help

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred