Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke conversion script from the game binary #29

Closed
TheJJ opened this issue Oct 27, 2014 · 7 comments
Closed

Invoke conversion script from the game binary #29

TheJJ opened this issue Oct 27, 2014 · 7 comments
Labels
improvement Enhancement of an existing component lang: c++ Done in C++ code lang: python Done in Python code

Comments

@TheJJ
Copy link
Member

TheJJ commented Oct 27, 2014

The openage.convert script should be invoked by the game.

The game launches its own Python interpreter to perform the conversion.
The input path could be queried interactively someday,
the output path equals the userassets directory which will be ~/.openage/ later.

  • Create openage --convert invokation
  • Load python interpreter in the game (cpp/python.cpp)
  • Modify sys.path
  • AGE2DIR equals the argument to --convert
  • Invoke openage.convert.__main__.main()
@TheJJ TheJJ added improvement Enhancement of an existing component lang: c++ Done in C++ code lang: python Done in Python code labels Oct 27, 2014
@Qquanwei
Copy link

I agree,but now I can't find this file openage.convert >_<

@TheJJ
Copy link
Member Author

TheJJ commented Oct 31, 2014

The script is currently called by make media, which invokes the script located in py/openage/convert/__main__.py. The script is available as

import openage.convert

that's where the name comes from 😉

@franciscod
Copy link
Contributor

how should the game decide if it's necessary? how we deal with the game NOT reconverting everything on each run? should we have a sentinel file, like assets/is_converted?

@zuntrax
Copy link
Contributor

zuntrax commented Nov 4, 2014

I'm not sure what's the best way to do it now, but when we have nyan, we might just check if the main nyan file exists.

@TheJJ
Copy link
Member Author

TheJJ commented Feb 11, 2015

This will be done by #217.

@goto-bus-stop
Copy link
Contributor

This is finished, isn't it? /cc @TheJJ

@TheJJ
Copy link
Member Author

TheJJ commented Dec 26, 2015

Yea, it is :) Thx4hint.

@TheJJ TheJJ closed this as completed Dec 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Enhancement of an existing component lang: c++ Done in C++ code lang: python Done in Python code
Projects
None yet
Development

No branches or pull requests

5 participants