Code Monkey home page Code Monkey logo

mta-resource-tool's People

Contributors

alexrazor1337 avatar ricksterhd123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ricksterhd123

mta-resource-tool's Issues

Implement settings.

3 base settings for start:

  • 1. Obfuscation level.
  • 2. Silent mode Error levels.
  • 3. List of skipped file types when copying.

About implementation:
Preferred way of storing and loading is JSON.
When starting a script for the first time it creates settings file with default value. At the next starts this file would be checked and loaded.

Build resource for model loading

  1. Encode model files by any tool(TODO)
  2. Analyze count of model files in directory(perhaps they are encoded or you don't need encoding)
  • If there are too few free ID's(you can add them in config), the script will give error and stop
  1. Generate client file with load/replace model/col/txd
  • ID's can be assigned randomly and then this will be saved to "assignment model" which will be JSON file with fields like: "file_name: model_id" e.g ("building: 13232")
  • ID's can be assigned from the existing assignment model (so it won't break existing work) and if there are new game files, the model will be updated
  • There are should be linking rules for some situations. By default, "file_name" will be loaded as dff+txd as a skin, dff+txd as a vehicle, dff+txd+col as a world object, probably differentiated by folder name. But sometimes few world models are having the same txd file. For simplicity, they should have the same substring in their name, so for e.g: World1.dff and World2.dff are using World.txd, so there are must be linking rule like World.txd: "World"
  1. Use metagen script to generate meta for the resource
  2. Use compiling script to compile client file

Resource config

Some resources need "oop" in their meta(#4), ACL rights(ACL request) and it can be useful for versioning, saving description and etc.
The idea is to have a file something like "resource.json" in resource folder which will contain this settings, example:

{
  "oop": true,
  "rights": {
    "general.ModifyOtherObjects": true, 
    "function.startResource": true,
  }
}

Meta.xml generator

Tool to generate meta.xml
It should parse all files inside a specified folder and add them to meta.xml unless they had restricted file type (should be specified in settings from #1 ).

There are must be a set(sets?) of rules how to determine is it clientside file or serverside.
Variants:

  • File prefix(e.g c_client.lua)
  • Directory name(e.g \Server\core.lua)
  • Looking for clientside/serverside function only(e.g dxDrawText is clientside function only, so file is clientside) (questionable)

In any way, a case may arise when it is not possible to set the type. (no prefix, no directory, all functions are shared). So ability to set it manually is required.

Exported functions generator

Automatically add exported functions to generated meta.xml (#4)

To declare that function is exported it should be stated in function header:

function foo() --exported
end

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.