Giter Club home page Giter Club logo

Comments (10)

efroemling avatar efroemling commented on May 24, 2024

Are you perhaps trying to edit them directly in the build directory?
In release builds you currently have to blow away the associated .pyc file before changes to the .py file will get detected. If you edit in the source directory and rebuild then the .pyc should be updated automatically.

This explains more: https://github.com/efroemling/ballistica/wiki/Knowledge-Nuggets#python-cache-files-and-release-builds

from ballistica.

Dliwk avatar Dliwk commented on May 24, 2024

🤦‍♂️ Oh, thanks, I forgot about it.

Hmm, ok, but I can't seem to redefine hooks from Python code; it feels like the internal layer is using a copy of them.

from ballistica.

Dliwk avatar Dliwk commented on May 24, 2024

And it seems make update doesn't work (it doesn't detect new files and/or directories)... Perhaps I should create another issue for this purpose 🤔

from ballistica.

efroemling avatar efroemling commented on May 24, 2024

If 'make update' isn't working for you then yes that could be a separate bug unto itself. Or if you want to diagnose it yourself, it is not doing anything too crazy; make update just calls tools/update_project which will itself call tools/update_assets_makefile to rewrite part of assets/Makefile based on what files it finds. The result should be that new files you add under assets/src/ should end up listed in assets/Makefile after you run make update. Is that not happening for you?

from ballistica.

efroemling avatar efroemling commented on May 24, 2024

🤦‍♂️ Oh, thanks, I forgot about it.

Hmm, ok, but I can't seem to redefine hooks from Python code; it feels like the internal layer is using a copy of them.

The only 'copy' of them it could be using is the .pyc file I think. Did you delete that for sure or are you working in the assets source directory for sure?

As a test, I just edited assets/src/ba_data/python/ba/_hooks.py and added a 'print("hello world")' under the launch_main_menu_session() function. Then I ran make prefab-debug and got the 'hello world' output when the game launched. Do those same steps not work for you?

from ballistica.

Dliwk avatar Dliwk commented on May 24, 2024

I haven't tools/update_assets_makefile... And tools/update_project just do nothing if it can't find this executable.

If 'make update' isn't working for you then yes that could be a separate bug unto itself. Or if you want to diagnose it yourself, it is not doing anything too crazy; make update just calls tools/update_project which will itself call tools/update_assets_makefile to rewrite part of assets/Makefile based on what files it finds. The result should be that new files you add under assets/src/ should end up listed in assets/Makefile after you run make update. Is that not happening for you?

from ballistica.

efroemling avatar efroemling commented on May 24, 2024

🤦🏼‍♂️
That is definitely a bug. That file is supposed to be there. I'll get that fixed now..

from ballistica.

Dliwk avatar Dliwk commented on May 24, 2024

The only 'copy' of them it could be using is the .pyc file I think. Did you delete that for sure or are you working in the assets source directory for sure?

As a test, I just edited assets/src/ba_data/python/ba/_hooks.py and added a 'print("hello world")' under the launch_main_menu_session() function. Then I ran make prefab-debug and got the 'hello world' output when the game launched. Do those same steps not work for you?

Yes, this way works fine, but I can't use something like ba._hooks.filter_chat_message = my_filter_chat_message
Hmm, now it works but... yesterday I couldn't do it 🤔 🤔

from ballistica.

Dliwk avatar Dliwk commented on May 24, 2024

Ok, I think this issue may be closed.

from ballistica.

efroemling avatar efroemling commented on May 24, 2024

Ok; I got the update_assets_makefile script added. You should now be able to do make update and see new scripts show up in assets/Makefile and in builds. Please let me know if not.

from ballistica.

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.