Coder Social home page Coder Social logo

Comments (5)

Kagamia avatar Kagamia commented on July 22, 2024 1

Amazing works 😃

You can create a separate project with WcR2.WzLib, loading wz files and export to jsons and image files.

Here's an example.

void Main()
{
    var wzs = new Wz_Structure();
    try {
        wzs.Load(@"X:\Your-MapleStory-Directory\Base.wz");
        var npc = wzs.WzNode.FindNodeByPath(@"Npc\9000162.img", true);
        string json = WzNodeToJson(npc);
    } finally {
        wzs.Clear();
    }
}

string WzNodeToJson(Wz_Node node)
{
    var v = node.Value == null ? "" : string.Format(@"""__value"":{0} ", NodeValueToJson(node));
    var c = string.Join(",", node.Nodes.Select(child => string.Format(@"""{0}"":{1}", child.Text, WzNodeToJson(child))));
    return "{" + v + (v != "" && c != "" ? "," : "") + c + "}";
}

string NodeValueToJson(Wz_Node node)
{
    switch (node.Value)
    {
        case Wz_Png png:
            string path = "Your-Image-Save-Path.png";
            png.ExtractPng().Save(path);
            return "\"" + path + "\"";
        case Wz_Vector vector:
            return string.Format(@"{{""x"":""{0}"",""y"":""{1}""}}", vector.X, vector.Y);
        case Wz_Uol uol:
            return "\"" + uol.Uol + "\"";
        default:
            return "\"" + node.Value.ToString() + "\"";
    }
}

from wzcomparerr2.

Kagamia avatar Kagamia commented on July 22, 2024

What will it be used for? 😃

from wzcomparerr2.

txiaocao avatar txiaocao commented on July 22, 2024

@Kagamia study and play...^_^
I try use javascript React and Phaser html5 engine make an map emluator...
like this
image
but the map data has many wrongs ...can`t parallactic movement

from wzcomparerr2.

txiaocao avatar txiaocao commented on July 22, 2024

thanks for your help....^_^

from wzcomparerr2.

txiaocao avatar txiaocao commented on July 22, 2024

so cool!! I found the WzComparerR2 can dump xml data...haha~~~

from wzcomparerr2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.