Coding Environment for Android - Gengar-lab/BombSquad-Ballistica-mods GitHub Wiki
This page will help you to Set up Coding Environment on Android. You can create, compile, debug, and format your mods in this environment. You can also create computer-like IDE on your Device.
Note: This isn't the info of how to 'make prefab' for Android.
-
You need to have little knowledge of how to change directory using cd.
-
Your Device must have 500+ mb of space.
-
Have BombSquad installed on your Device.
-
You have to install:
- My App Sharer (By Jones Chi),
- Pydroid 3,
- Pydroid Repository Plugin,
from Play Store.(NOT SPONSORED)
-
You have to install ES File Explorer File Manager v4.1.9.5.2 from Google or anywhere else.
After installing ES File Explorer, Restrict the app's Data and Wifi Usage and disable Auto-Update in its Settings. Since it was removed from Play Store because of Data Theft and Fraud.
- Open My App Sharer.
- Click on BombSquad, Share, Export to SD.
- Now choose the location where you want to save the apk. (Let us suppose assume location Downloads)
Here we saved the BombSquad apk.
- Open ES File Explorer.
- Go to Downloads, Long Click on BombSquad apk, A list of options will appear on bottom screen, Click on More, Open as, Other, ES Zip Viewer, This time only.
- Now Click on assets, ballistica_files, ba_data, Long click on python and with it select python-site-packages and data.
- Tap on Extract and then on Ok.
Here we now have extracted the inner files/scripts of BombSquad which we need.
- Now a new folder will be there in the Downloads with name net.froemling.bombsquad.
- Rename the folder to whichever name you want (Let us suppose the name Froemling).
- Open Froemling, click on assets, ballistica_files, ba_data, python-site-packages.
- Move all the contents of folder to folder python and delete folder python-site-packages. Now move python and data folder to Downloads/Froemling.
- Now delete assets folder.
Here we have simplified the directory structure.
- Now open the Ballistica Repo on Google Chrome.
- Click on assets, src, ba_data/python, _ba.py.
- Click on Raw Button, Now click on 3 vertical dots in the up left corner and then click on download webpage button.
- Now _ba.py will be downloaded in the Downloads Folder.
- Open Downloads folder in File Explorer and copy _ba.py to the python folder which is there in Froemling Folder.
Here we have downloaded _ba.py, which is a dummy module. The actual real _ba.py exists inside the game. Without having the dummy _ba.py in our python folder, our IDEs would not work and give errors. Nutshell: It helps our IDEs to work properly while compiling scripts.
- Open Pydroid 3, Click on 3 horizontal dots in the top left corner, Click on Terminal.A screen will appear.
- Type
pip install pylib
and press enter. Now wait till pylib is installed. After that typepip install autopep8
. - After both are installed you can exit Pydroid 3.
Here we have downloaded all the necessary packages to work with compiling of scripts.
If you have experience with Pycharm or any other IDE, and want to use computer-like IDEs on your Device, continue to follow the following steps.
- Open Pydroid Terminal and type
pip install nodejs
. After this is installed typepip install ipynb-py-convert
.
Here we have downloaded necessary packages to work with IDE called JupyterLab.
- Type
pip install jupyterlab
.
Here we have installed our IDE.
Now your Setup is Ready for Coding.
It is a Editor not IDE. You can use it to edit .py files but to run file, you will need Pydroid 3 or JupyterLab.
You can code and run the script in this IDE itself. It also has dark mode.
To use Jupyter Lab you will need to do the following steps.
- Open Pydroid 3 Terminal and type
jupyter lab
. A Chrome page will open. Chooose desktop site on Chrome. This page will be your IDE. - Now navigate to your workspace.
If you are going to use existing file, go to your Workspace where file is present using cd in terminal and type ipynb-py-convert <filename>.py <filename>.ipynb
(This is to be done because this IDE can only open .ipynb files. No code data will be lost)
Else you can create a new file in JupyterLab.
- After editing code, you can compile and run the code.
- After Saving the file, you will need to convert the file back to .py.To do that, go to your workspace where file is present using cd in Pydroid Terminal. Type
ipynb-py-convert <filename>.ipynb <filename>.py
JupyterLab also has dark theme.
Now it depends on you which IDE to use. If you are familoar with computer IDEs, go with JupyterLab which will give you a good experience. Else you can use Pydroid 3.And to edit code, you can use any of the three. I(Benefit-Zebra) usually uses ES File Explorer to edit my code.
Once you have written your code, move your file to Downloads/Froemling/python. Open your file in Pydroid 3 and click on Run/Play Button.
If there are no errors, it will show [program finished].
On JupyterLab, you can tap on the Run button in the Top Bar.
It will only show Syntax errors. User Error and Runtime Error has to be handled by you as usual.
Follow the Coding Style Guide.
To automatically format your code to PEP8, open Terminal in Pydroid 3. Use cd to go to the folder where script is there(Downloads/Froemling/python).
After this, type autopep8 --in-place --aggressive --aggressive <filename>
For any doubts, Contact me(Benefit-Zebra).