Blimba / PyWC3

Script template for creating Warcraft III map scripts in python. Uses python-lua as translator to generate lua code for warcraft.
MIT License
18 stars 2 forks source link

PyWC3 not picking up new python files in pysrc #1

Closed MSre-zz closed 4 years ago

MSre-zz commented 4 years ago

When I add a new file PyWC3 doesn't seem to pick it up with build. Below I've added classtest.py and mytest1.py. Neither show up as "appended" when running the build command.

C:\Users\xx\Documents\GitHub\vamp-beast-py>py PyWC3 test.w3x --build PyWC3 version 1.2.1 by Bart Limburg

Generating python definitions from map source: temp/src/war3map.lua. Definitions created in pysrc\df\test.py Building map test.w3x

Generating distribution map files... Writing lua header... Appended translated file pysrc\std\index.py. Appended translated file pysrc\std\handle.py. Appended translated file pysrc\std\event.py. Appended translated file pysrc\std\player.py. Appended translated file pysrc\lib\math3d.py. Appended translated file pysrc\std\effect.py. Appended translated file pysrc\std\timer.py. Appended translated file pysrc\lib\cyclist.py. Appended translated file pysrc\lib\periodic.py. Appended translated file pysrc\std\unit.py. Appended translated file pysrc\lib\particle.py. Appended translated file pysrc\lib\itimer.py. Appended translated file pysrc\mytest.py. Appended translated file pysrc\test.py. Build completed.

C:\Users\xx\Documents\GitHub\vamp-beast-py>dir pysrc Volume in drive C has no label. Volume Serial Number is CA55-3E2E

Directory of C:\Users\xx\Documents\GitHub\vamp-beast-py\pysrc

04/19/2020 19:06

. 04/19/2020 19:06 .. 04/19/2020 19:06 .idea 04/19/2020 19:06 446 classtest.py 04/18/2020 16:03 df 04/18/2020 18:40 lib 04/18/2020 18:42 329 mytest.py 04/19/2020 19:06 337 mytest1.py 04/18/2020 16:03 std 04/18/2020 18:40 1,205 test.py 04/18/2020 15:59 0 init.py

Blimba commented 4 years ago

did you include the file from test.py (can you show the file test.py)? It is not supposed to pick up new files when they are not included: like that you can have multiple maps. I would also advice against new files directly into the pysrc folder, as they might conflict with map names. Use a different subfolder for map-specific scripts.

Also note that only from xxx import xxx statements are supported.

MSre-zz commented 4 years ago

I did not import the file into the main file. I've spent some time looking at the code and trying some things with init.py to import everything in a subfolder. Nothing is working yet. I'm a total newb with python so maybe I can figure it out given enough time. Hopefully it will work with init.py. Otherwise I'll try changing the build script at my own risk.

I'd like it to be similar to vJASS where there are no additional steps needed after adding the initializer (in this case AddScriptHook). At this point this should no longer be considered an issue since I was just using it wrong.

Thanks for making this. I'm using it to learn python in an environment I'm familiar with.

MSre-zz commented 4 years ago

from ${folder_name} import * did the trick. Took my way too long to figure that out haha.