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

Users who are viewing this thread

It was my oversight actually.

Compiler can use either regular headers or the bundled ones from the headers subfolder, but prefers to use the bundled ones if they're available. Which is fine for as long as they're compatible with the normal header_*.py files. Which is the case with Native but is not the case with Native modified by yours truly.

Essentially, the module files encoded item parameters using improved bitmask, while compiler has detected that a bitmask was used for item parameters, correctly decided that vanilla encoding was used (and it was, albeit modified) and attempted to decode them using standard vanilla bitmasks which are only partially compatible with the versions used in my improved Native module system.

So, hilariously enough, my compiler conflicted with my variant of module system. :lol: :lol: :lol:

Slow-mo has the same origin, it's not mission speed, it's weapon speeds that were corrupted.

Okay, since there were a couple of other minor bugfixes, I guess I'll have to release 0.6.3 now.
 
W.R.E.C.K. v0.6.3 RC2 Released.
Download W.R.E.C.K. 0.6.3 RC2 (1.25 Mb file size) from:
Nexus Mods | Lav's Warband Workshop

Changelog for 0.6.3 RC2 said:
  • Textfix: compiler was printing 'DONE' even if compilation stage has failed.
  • Bugfix: plugin data injections were performed before plugin dependency issues were sorted. Now done in correct order.
  • Bugfix: fixed compiler crash when encountering non-tuple data where a top-level tuple is expected. Now handled gracefully.
  • Bugfix: removed 'headers' folder from 'copy_n_forget' installation variant as it was causing conflicts with module systems that have their header files modified in a certain manner.
 
Teaser for next version.

Changelog for 0.6.4 RC2 said:
Properties of the following entries can now be retrieved and used as values in module system code:
  • Items. Accessible properties: flags, capabilities, price, weight, head_armor, body_armor, leg_armor, difficulty, hp, speed, missile_speed, size, max_amount, swing (combined binary-packed value), swing_damage, swing_damage_type, thrust (combined binary-packed value), thrust_damage, thrust_damage_type, abundance, modifiers (as imodbit mask), food_quality, accuracy, horse_maneuver, horse_speed, weapon_length, horse_charge.
  • Scenes. Accessible properties: flags, min_x, min_y, max_x, max_y, water_level, water_level_cm, terrain_seed, river_seed, flora_seed, size_x (0..1023), size_y (0..1023), valley (0..127), hill_height (0..127), ruggedness (0..127), vegetation (0..127), terrain (see header_terrain_types.py), polygon_size (2..5), disable_grass (0..1), shade_occlude (0..1), place_river (0..1), deep_water (0..1).
  • Item modifiers. Accessible properties: price_coeff (per cent), rarity_coeff (per cent).
  • Factions. Accessible properties: flags, coherence (per cent), default_color.
  • Parties. Accessible properties: flags_field (icon+flags binary-packed value), icon, flags, default_menu, template, faction, personality, ai, ai_target, start_x (rounded), start_x_cm (in 1/100ths, rounded), start_y (rounded), start_y_cm (in 1/100ths, rounded), angle (degrees), angle_100 (1/100th degrees).
  • Party templates. Accessible properties: flags_field (icon+flags binary-packed value), icon, flags, default_menu, faction, personality.
  • Troops. Accessible properties: flags, scene, faction, level, strength, agility, intelligence, charisma, wp_1h, wp_2h, wp_polearms, wp_archery, wp_crossbows, wp_thrown, wp_firearms, skills (combined bitmask), facecode_1, facecode_2, upgrade_path_1, upgrade_path_2.
Examples:
Code:
  (assign, ":sword_avg_damage", (itm.sword.swing_damage + itm.sword.thrust_damage) / 2),
Code:
  (assign, ":water_level", scn.bulugha_castle.water_level_cm),
Code:
  # Village will be automatically positioned 5 units to the east from Castle, meaning we can change both parties coordinates simultaneously.
  ("castle", "Castle", icon.castle_c|pf_castle, 0, pt.none, fac.commoners, 0, ai_bhvr_hold, 0, (72.3, -31.8), [], 311),
  ("village", "Village", icon.village_a|pf_village, 0, pt.none, fac.commoners, 0, ai_bhvr_hold, 0, (p.castle.start_x + 5.0, p.castle.start_y), [], 43),
Code:
  # All castles automatically inherit properties from "castle_tpl" party template at compile time.
  ("castle_1", "Culmarr Castle", icon.castle_a|pt.castle_tpl.flags, pt.castle_tpl.default_menu, pt.castle_tpl, pt.castle_tpl.faction, pt.castle_tpl.personality, pt.castle_tpl.ai, pt.castle_tpl.ai_target, (-101.3, -21), [], 50),
  ("castle_2", "Malayurg Castle", icon.castle_b|pt.castle_tpl.flags, pt.castle_tpl.default_menu, pt.castle_tpl, pt.castle_tpl.faction, pt.castle_tpl.personality, pt.castle_tpl.ai, pt.castle_tpl.ai_target, (97.5, -2.2), [], 75),
  # (...)
Support for this feature has actually been present in the compiler for quite a time, so actually implementing it for many different entities was quite easy.

Of course, all this is compile-time only, so you won't be getting terrain seed from a scene reference in run-time. :smile:
 
I am trying to use your integrated_ms. But when I double-click on compile.bat, I get only a command window for a slpit second without the ability to read anything, and nothing has been exported. What am I doing wrong? Note: Besides the export path I did not change anything at all.
 
DerGreif said:
I am trying to use your integrated_ms. But when I double-click on compile.bat, I get only a command window for a slpit second without the ability to read anything, and nothing has been exported. What am I doing wrong? Note: Besides the export path I did not change anything at all.
Hmm, I would guess Python installation issues. Or maybe write-protection. In short, something that makes the compiler fail entirely.

Try changing compile.bat to...
Code:
@python compile.py
...and see what happens.
 
Lav said:
Hmm, I would guess Python installation issues. Or maybe write-protection. In short, something that makes the compiler fail entirely.

Try changing compile.bat to...
Code:
@python compile.py
...and see what happens.
Thank you for the quick reply. Sadly, the same happened. A slit second of a command window and nothing else. Which python version do I need?

EDIT: If it helps: I have now the compiled header files and colorama files in their respective folders (those ending .pyc).
 
Okay, then this:
Code:
@python compile.py
@pause
For Python, any 2.7 will do. If you have regular module system running, you should have W.R.E.C.K. running as well.
 
Lav said:
Okay, then this:
Code:
@python compile.py
@pause
For Python, any 2.7 will do. If you have regular module system running, you should have W.R.E.C.K. running as well.
That seems to be the problem. I have python 2.5 running, which seems to be fine for native compiler but not for yours because of certain key words. Thanks to the pause (worked so far) I got a syntax error referring to "with" which would become a key word in python 2.6. I install a newer version of python.
 
Hmm, I wonder if I can manage to fix the code so the W.R.E.C.K. would become less demanding to Python version... Not sure though, I'm quite used to 2.7 and there are probably quite a number of other incompatibilities (sigh).

Oh well, at least this highlighted the need for a more user-friendly compile.bat file.
 
Lav said:
Hmm, I wonder if I can manage to fix the code so the W.R.E.C.K. would become less demanding to Python version... Not sure though, I'm quite used to 2.7 and there are probably quite a number of other incompatibilities (sigh).

Oh well, at least this highlighted the need for a more user-friendly compile.bat file.
Well, it worked now!  :grin: Thank you again for all your advice! And so quickly! Like your new compiler - 7.4 seconds - woooot!
 
W.R.E.C.K. v0.6.4 RC2 Released.
Download W.R.E.C.K. 0.6.4 RC2 (1.25 Mb file size) from:
Nexus Mods | Lav's Warband Workshop

Changelog for 0.6.4 RC2 said:
  • Modified compile.bat file to be more user-friendly in situations where compiler fails due to a system error or misconfiguration.
  • Added Python version check to compiler, it will now gracefully terminate with a message if incompatible Python version is detected.
  • A number of entity attributes can be accessed directly from the module system code at compile-time (see changelog on the first page for details).
On this note, the active development phase is over, expect only hotfix and plugin releases in the nearest future. I plan to wait for at least a month or two (preferably more) before making the 1.0 release. Hopefully most issues will be sorted by that time.
 
Well, firstly.. Good job LAV! :smile:


Secondly, i think ive found a problem. Im using the brytenwalda module system, heavily edited by myself. Though when i use your compiler it messes the menus up. If i compile the exact same module files with natives compiler, its absolutely fine.


 
The start up menus have been changed in my module files, for instance when choosing your characters background etc. If i use your compiler, it seems to try to revert the menus back to native, meaning dead ends and not being able to continue.

Yet if i use natives compiler (even after using yours to compile the same source) its completely fine and uses the correct modified menus.



*edited for clarification.
 
With your newest version (v0.6.4 RC2) I get the following error when trying to compile. Nothing will be compiled. I am running now the latest version of python. The previous version works fine though.

Code:
'#' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
 
DerGreif said:
With your newest version (v0.6.4 RC2) I get the following error when trying to compile. Nothing will be compiled. I am running now the latest version of python. The previous version works fine though.

Code:
'#' is not recognized as an internal or external command,
operable program or batch file.
Erm... Looks like I automatically used Python-style comments in the bat file. Sloppy. :oops: Well, it's just resulting in garbage output and shouldn't affect anything. I have re-uploaded the archive to be on the safe side, or you could just remove the rubbish lines from the compile.bat if you wish.

DerGreif said:
Code:
'python' is not recognized as an internal or external command,
operable program or batch file.
This is standard error when Python is misconfigured - if you reinstalled Python your path to it has probably changed, so you need to fix the system's %PATH% variable.

DerGreif said:
I am running python 2.78 and it works perfectly fine with the previous version 0.6.3 RC2.
Curious. This could happen if you work from a console window and didn't restart it after upgrading Python. Version 0.6.3 starts in a new console with all current settings, while 0.6.4 stays in the current console and won't get them. But that's a pretty rare scenario I guess, even if one quite familiar to myself as I happen to work primarily from Far. :smile:
 
Back
Top Bottom