B Tutorial Module System [HOW TO] Compile script on Linux

Users who are viewing this thread

By default, it is impossible to compile Module System on Linux. But with few lines you can do this. :wink:
Of course You need to have installed python, in Debian/Ubuntu based can you do this with Synaptic, Ubuntu Software Center or just this simple command:
Code:
sudo apt-get install python
Thats all, no Path editing or other Windows **** :razz:


This is default code from build_module.bat:
Code:
@echo off
python process_init.py
python process_global_variables.py
python process_strings.py
python process_skills.py
python process_music.py
python process_animations.py
python process_meshes.py
python process_sounds.py
python process_skins.py
python process_map_icons.py
python process_factions.py
python process_items.py
python process_scenes.py
python process_troops.py
python process_particle_sys.py
python process_scene_props.py
python process_tableau_materials.py
python process_presentations.py
python process_party_tmps.py
python process_parties.py
python process_quests.py
python process_info_pages.py
python process_scripts.py
python process_mission_tmps.py
python process_game_menus.py
python process_simple_triggers.py
python process_dialogs.py
python process_global_variables_unused.py
python process_postfx.py
@del *.pyc
echo.
echo ______________________________
echo.
echo Script processing has ended.
echo Press any key to exit. . .
pause>nul

And this is my build_module for Linux:

Code:
#!/bin/bash
cd /media/witelon/427EFB097EFAF50F/Gry/Mount*nd/Modules/Sclavinia/Module_system
python process_init.py
python process_global_variables.py
python process_strings.py
python process_skills.py
python process_music.py
python process_animations.py
python process_meshes.py
python process_sounds.py
python process_skins.py
python process_map_icons.py
python process_factions.py
python process_items.py
python process_scenes.py
python process_troops.py
python process_particle_sys.py
python process_scene_props.py
python process_tableau_materials.py
python process_presentations.py
python process_party_tmps.py
python process_parties.py
python process_quests.py
python process_info_pages.py
python process_scripts.py
python process_mission_tmps.py
python process_game_menus.py
python process_simple_triggers.py
python process_dialogs.py
python process_global_variables_unused.py
python process_postfx.py
rm *.pyc
echo \
echo ______________________________
echo \
echo Script processing has ended.
read -n1 -r -p "Press any key to exit. . ."
Just copy and paste to the new file. Now You must replace my path to module system with yours. Then You must make possible to run this file as script. There are two ways:
-in console write:
Code:
chmod +x /path/to/your/file
-right mouse button click on file>Properties>Permissions>Allow to run as program or something like that.

Now You can compile scripts in Linux by running that file.
 
Nice, I fiddled around to get it to work on my machine a while ago; here are some things others may want to note if they're making mods on/for Linux (and OS X!):
  • The default build_module.bat has Window's newline characters, you can't copy paste it then modify it, unless you remove all line endings
  • On Archlinux and a few other distros the command 'python' corresponds to python3, not python2. You will need to review your distro's documentation as to how to install and run python2 in this script
  • The Warband Script Extender will NOT work on Linux, unless the developer releases a Linux version it likely never will

Point number three should definitely be considered when Windows developers release mods - unless the explictly check for the presence of WSE and handle it alternatively, their code will break!
Same goes for OS X.

This build script should also work for OS X if python is installed.
 
When I try to run that script (modified for the correct directory), I get the following errors:

build_module.sh: line 2: cd: $'/home/lhossangren/source\r': No such file or directory
': [Errno 2] No such file or directorypy
': [Errno 2] No such file or directoryl_variables.py
': [Errno 2] No such file or directorygs.py
': [Errno 2] No such file or directorys.py
': [Errno 2] No such file or directory.py
': [Errno 2] No such file or directorytions.py
': [Errno 2] No such file or directorys.py
': [Errno 2] No such file or directorys.py
': [Errno 2] No such file or directory.py
': [Errno 2] No such file or directorycons.py
': [Errno 2] No such file or directoryons.py
': [Errno 2] No such file or directory.py
': [Errno 2] No such file or directorys.py
': [Errno 2] No such file or directorys.py
': [Errno 2] No such file or directorycle_sys.py
': [Errno 2] No such file or directory_props.py
': [Errno 2] No such file or directoryau_materials.py
': [Errno 2] No such file or directoryntations.py
': [Errno 2] No such file or directory_tmps.py
': [Errno 2] No such file or directoryes.py
': [Errno 2] No such file or directorys.py
': [Errno 2] No such file or directorypages.py
': [Errno 2] No such file or directoryts.py
': [Errno 2] No such file or directoryon_tmps.py
': [Errno 2] No such file or directorymenus.py
': [Errno 2] No such file or directorye_triggers.py
': [Errno 2] No such file or directorygs.py
': [Errno 2] No such file or directoryl_variables_unused.py
': [Errno 2] No such file or directoryx.py
rm: cannot remove '*.pyc'$'\r': No such file or directory
build_module.sh: line 33: $'echo\r': command not found
______________________________
build_module.sh: line 35: $'echo\r': command not found
Script processing has ended.
build_module.sh: line 37: $'\r': command not found

I don't understand why it keeps telling me all the files don't exist.  I have Python 2.7.3 installed, and it is the default option when I check which Python.  ( I also have 3.8 ).
 
Back
Top Bottom