Giter VIP home page Giter VIP logo

ceres's People

Contributors

elusivemori avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ceres's Issues

Building sample mpq map from template project: ceres.exe hangs on WIndows 10

After cloning the pure Lua template and running the build command:

> ceres build -- --map mpq.w3x --output mpq

The build prints complete and produces the map in target/ but the exe never returns control to the shell:

> ceres build -- --map mpq.w3x --output mpq
> Received build command
>     Input: mpq.w3x
>     Retain map script: true
>     Output type: mpq
> Loaded map mpq.w3x
> Loaded map script from mpq.w3x
> Successfuly built the map
> Writing artifact [mpq] to target/mpq.w3x
> Build complete!
^C  ### Had to CTRL-C at this point to get my terminal back.
>

Map info API

An API to modify misc map data should be present. This will require .w3i parsing as well as modifying MiscData.txt and other files with game constants.

Self-contained map development

Master issue for the map modification API.

Ceres must be able to create WC3 maps entirely from scratch, without using any existing map files (exceptions may be files embedded within Ceres for convenience).

This includes but is not limited to:

  • Object data modification
  • Terrain modification
  • .w3i modification
  • Game constant modification
  • .doo file generation

Unrelated but lacking direct communication

You once mentioned to me that there was a method of modifying unit fields, like units builds array in either war3mapextra or wa3mapmisc, do you remember how that was done?

Terrain modification/querying API

An API to modify/query terrain would be very useful for dynamic terrain operations, esp. pathing and the likes. Must be able to generate a terrain from scratch.

Add unit and functional tests to the project

Already tested:

  • Lua parser is verified against Lua's test suite

Some good candidates for unit testing:

  • Slk/func parsers in ceres-formats
  • Object data parsers in ceres-formats
  • Tests for querying metadata
  • Tests for inserting/getting object fields

Ideas for functional testing:

  • Make asserts via lua and run lua tests via cargo test
  • Test the whole stack, maybe create a test project for this purpose

elseif does not allow paranthesis like if does.

ceres does not seem to be able to parse () if its used in "elseif", as in "if".

This means that:

if (group.orderType == Ids.orderTypes.ORDER_GOLDMINE) then
elseif (group.orderType == Ids.orderTypes.ORDER_GOLDMINE) then
end

Will throw an error.
And:

if (group.orderType == Ids.orderTypes.ORDER_GOLDMINE) then
elseif group.orderType == Ids.orderTypes.ORDER_GOLDMINE then
end

Will run just fine.

the error message is akin to:

[�[31mERROR�[0m] -> Could not run map.
[�[31mERROR�[0m] -> Cause: Could not build map.
[�[31mERROR�[0m] -> Cause: Could not build the script.
[�[31mERROR�[0m] -> Cause: Parsing error in xxx\src\AIWorker.lua
[�[31mERROR�[0m] -> Cause: --> 47:63
|
47 | elseif (group.orderType == Ids.orderTypes.ORDER_GOLDMINE) then␍␊
| ^---
|
= expected StmtReturn, Stmt, Index, MethodCall, or Args

Too many locals because of modules

Currently all modules are defined as local functions, they should just be functions.
Because of this when you reach 200 modules, it will no longer run.

Build fail

build.zip

Hi. When I put this to src and rename Main.lua to main.lua I get:

=> main λ (~/tmp/purescript/ps-to-lua-test/ceres) = ceres build -- --map WorldEditTestMap.w3x
> Received build command
>     Input: WorldEditTestMap.w3x
>     Retain map script: true
>     Output type: mpq
> Loaded map WorldEditTestMap.w3x
> WARN: Could not extract script from map WorldEditTestMap.w3x: File not found
> WARN: Map script won't be included in the final artifact
> Building without including original map script
> ERR: Map build failed:
> Could not compile module [castl.constructor.error.error] ("src/castl/constructor/error/error.lua"):
Cyclical dependency found involving module castl.internal

But when I use original Lua interpreter, it works fine

=> main λ (~/tmp/purescript/ps-to-lua-test/ceres/src) = lua main.lua
Power of PureScript!

Is it possible to make it work?

I use http://www.purescript.org as a scripting language

It compiles to JavaScript and then I use https://github.com/PaulBernier/castl to compile it from JavaScript to Lua. castl/ directory comes from lua/castl in the previously mentioned repository and it contains runtime for JavaScript

CreateUnitAtLoc does not seem to work

It seems all the parameters work except unit id.

How do I get a unit id from a 4-character string?
I have tried two functions, FourCC and UnitId, no success.
Calling CreateUnitAtLoc(Player(0), FourCC('hfoo'), GetPlayerStartLocationLoc(Player(0)), 0)
as a custom script works fine.

Additionally, when looking at the compiled version, FourCC has two arguments.

EDIT: When removing the first variable in the compiled FourCC function, it seems to work.
That means the compiled FourCC might be the problem.

Require accepts wrong syntax

The require function accepts the syntax 'event/spell', when it should only accept 'event.spell'. Using both forms causes modules to be loaded twice, leading to... weird issues.

Windows release UX - cannot open .tar.gz

The Windows release being provided in the releases is a .tar.gz which Windows cannot unpack with native tools. So providing that as the Windows release is a little cumbersome.

If you could switch the Windows release to be packaged as a .zip, while maybe increasing the size would make it instantly usable on Windows machines.

No graphics API option in [run]

This option (-graphicsapi) is crucial for wc3 to work in some systems. Shouldn't be hard to add, since window_mode option is present already. Could do it myself, if only I was accustomed to the project and the language.

Object data API

Implement a Lua API for manipulating object data at compiletime. Initial version must have these features:

  • Reading stock object data (embedded into Ceres)
  • Reading custom object data (object files only) from the map
  • Automatically reading and merging all available object data in the default build-script
  • Writing object data back into the map
  • Object writer should automatically discard unmodified objects and fields to preserve space

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.