Warband Refined & Enhanced Compiler Kit (v1.0.0 @ Mar 01, 2015)

Best answers
0
kalarhan said:
What happens when you open a terminal/console and type “python” and hit Enter?

>python
Thanks for helping me out, kalarhan.

First time I type in "python" it says:
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

I try it again, and it yields:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined

So now I'm thoroughly confused. First seems like it recognizes python, but then it says it's not defined... But I'm guessing you know what these mean?
 

kalarhan

Count
WBWF&SNWVC
Best answers
0
The Textbook Philosopher said:
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32
you know what these mean?
that was checking if Python 2.x was installed on your system (first step).

now move your code to a folder you know you have permission. Most people test on desktop folder. It is temporary. And try to compile from there (step 2, verify you can modify files)

"c:\Users\You_name\Desktop\my_mod\" -> something similar to this, you need to find the folder on your current Win installation (win7, 8, 10, ...)
 
Best answers
0
kalarhan said:
that was checking if Python 2.x was installed on your system (first step).

"c:\Users\You_name\Desktop\my_mod\" -> something similar to this, you need to find the folder on your current Win installation (win7, 8, 10, ...)
So, you mean exporting the ModSys from winrar to a folder on my desktop?

Trying this...Ok, I've exported to desktop, and ran compile.bat again, it gave an error for improper syntax where I put in the "from compiler import *" in the module_game_menus.py . . . So I took that bit out, tried again, and after a few dozen lines of files it says are "in_deepcopy", it fails and I get:
TypeError: __call__() takes exactly 4 arguments (2 given)
 

kalarhan

Count
WBWF&SNWVC
Best answers
0
The Textbook Philosopher said:
So, you mean exporting the ModSys from winrar to a folder on my desktop?
why are you trying to run code from the winrar file? That wont work. You need to decompress the files into a coding folder.

The Textbook Philosopher said:
Trying this...Ok, I've exported to desktop, and ran compile.bat again, it gave an error for improper syntax where I put in the "from compiler import *" in the module_game_menus.py . . . So I took that bit ou
if your leg hurts what do you do? Cut if off, or try to find the cause and treat it?

Now if you the compilation going you need to fix the bugs you have like that one.

You should create a new thread on the Forge (or try here if its about WRECK) and post your issues there. Remember that when talking about code  you need to show it. Copy and paste it using the code tag. And also copy the log message from compiler/game.
 

PiEtiarna

Recruit
Best answers
0
I was eventually able to compile the game without any more errors stopping it from completing, (still two reported) but the game will still not start.


This is where it stops: (large image)


Here's my completed compilation, with some errors reported:
 

kalarhan

Count
WBWF&SNWVC
Best answers
0
PiEtiarna said:
I was eventually able to compile the game without any more errors stopping it from completing, (still two reported) but the game will still not start
compile without error message is not the same as not having errors on your compilation.

Example: from 1000 things that can go wrong, the compiler tests only 50. The game launcher tests another 500. The rest is up to when the code is called.

so check if your generated code is OK (compare files size with the download VC files), like scripts.txt and so on. If any of them is smaller or even empty, you know something went wrong in there.

you will then have to go deeper to find what you did wrong and fix it.
 

KratosMKII

Squire
Best answers
0
Is there any way to organize my files into subfolders and make the compiler work while using modmerger? By this i mean:

ID files go to ID subfolder
Freelancer files go to Freelancer subfolder
CTT files go to CTT subfolder
etc

???
 

kalarhan

Count
WBWF&SNWVC
Best answers
0
KratosMKII said:
Is there any way to organize my files into subfolders and make the compiler work while using modmerger? By this i mean:

ID files go to ID subfolder
Freelancer files go to Freelancer subfolder
CTT files go to CTT subfolder
etc

???
sure

easiest way - for non coders - is to use a build folder for the compilation. Copy all your source files to there at that moment, run the process, delete the files.

/source
  /subfolder1
  /subfolder2
      /subsubfolder1
  ...
/build
/compiled


you can use any language you like for that, from a simple batch job to code in Python or whatever you know how to use

the alternative is to mess with Python imports, which is doable, just requires actual Python know-how
 

KratosMKII

Squire
Best answers
0
kalarhan said:
KratosMKII said:
Is there any way to organize my files into subfolders and make the compiler work while using modmerger? By this i mean:

ID files go to ID subfolder
Freelancer files go to Freelancer subfolder
CTT files go to CTT subfolder
etc

???
sure

easiest way - for non coders - is to use a build folder for the compilation. Copy all your source files to there at that moment, run the process, delete the files.

/source
  /subfolder1
  /subfolder2
      /subsubfolder1
  ...
/build
/compiled


you can use any language you like for that, from a simple batch job to code in Python or whatever you know how to use

the alternative is to mess with Python imports, which is doable, just requires actual Python know-how
Thank you.

I organized all the files into subfolders (compiler files included) in the main source directory, then made a batch file that does the following:

1. Creates a build folder if it doesn't already exist
2. Copies all files from the subfolders into this build folder
3. Executes the compile.bat
4. Waits 10-15 seconds
5. Copies all ID files to ID subfolder in the main source folder
6. Deletes build folder.

I hope this helps someone else in the future that wishes to do a similar thing.
 

Arch3r

Count
M&BWBNW
Best answers
0
For anyone looking to use the
plugin_list_system.py
note that there is a flaw in the list_at function. I made a fix though.

Code:
def list_at(destination, list_no, index):
  return [
    (troop_get_slot, ":num_elements", list_no, 0),
    (try_begin),
      (ge, index, 1),
      [color=green](val_add, ":num_elements", 1),[/color]
      (le, index, ":num_elements"),
        (troop_get_slot, destination, list_no, index),
    (else_try),
      (assign, destination, 0),
    (try_end),
  ]
Adding the (val_add, ":num_elements", 1), fixes it, as there is an upper bound check, that does not take into account that the slot index of 0 is used for the list size. Therefor, the num_elements should always add 1, as it also does with the other functions. I ran into bugs without it, but this fix solved it according to my test.

Unsure if this is the right thread, but the plugin is included in the download and I could not find a separate thread.
 
Top