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

Users who are viewing this thread

kalarhan said:
LootingScumbag said:
I think I know what you mean regarding plugins.

Native module_scripts.py file: ~50k lines of code
A new feature usually involves changing several files.
Try to find the code for a feature among those hundred of thousands of lines of code.

Plugin system: you can create a new folder or file just for the feature. You can put all together (scripts, triggers, events, strings, ...) in one place. Much easier and sane way to developer software.

Or in other words: Native is like coding in the 1970s. Wreck is the 2000s.

Haha, understood.
 
I really want to get back into modding but WSE is not compatible with steam. So I want to use WRECK, wich I did until June. But is WRECK compatible with the steam version?
 
So, I fixed an error the same as Cable's 1 or 2 pages back, in module_info_pages.py I just have a question though.

Code:
 ("overall", "Calradian Lore", "."),
 ("kingdom1", "Kingdom of Swadia", "."),
 ("kingdom2", "Vaegir Confederation", "."),
 ("kingdom3", "Khövgüüd Khergits", "The Khövgüüd Khergits..."),
 ("kingdom4", "Kingdom of Nords", "."),
 ("kingdom5", "Democratic Kingdom of Rhodoks", "."),
 ("kingdom6", "Sarranian Empire", "."),
Code:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... FAILED.
MODULE `info_pages` ERROR:
Traceback (most recent call last):
  File "compile.py", line 91, in <module>
    from module_info_pages import *
  File "C:\Users\Ryan\Desktop\Warband Module Tools\WarbandModuleSystem\Module_sy
stem 1.166\module_info_pages.py", line 15
SyntaxError: Non-ASCII character '\xc3' in file C:\Users\Ryan\Desktop\Warband Mo
dule Tools\WarbandModuleSystem\Module_system 1.166\module_info_pages.py on line
15, but no encoding declared; see http://www.python.org/peps/pep-0263.html for d
etails


COMPILATION FAILED.

Displaying W.R.E.C.K. performance information.
Use show_performance_data = False directive in module_info.py file to disable.

    0.146 sec spent to load module data.

    >>> 0.147 sec total time spent. <<<

Press any key to continue . . .
In this case, the code would not compile because "Khövgüüd" had unusual letters, apparently. Although even if I changed the page button name to simply be "Khergits", the error would still appear because in the description text, the characters were still present, despite the fact it's visual text for the game and not actual coding.

So, why does Python or the module system not like these characters being used? It makes using foreign names of nations or people somewhat hard to accomplish.
 
Druidic said:
So, why does Python or the module system not like these characters being used?

google for "python encoding" to learn more about it. Its easy to adapt your code.

In a very short description: encodes have a collection of characters (like letters), you can't use a character outside that range (like a Chinese character if you encode is latin). You can experiment with changing your compiler encode range, but that doesn't mean it will work in the game (different things: compiler is what generates the .txt, engine or the .exe is what you use to run the game)
 
Did I messed up?
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... FAILED.
MODULE `troops` ERROR:
Traceback (most recent call last):
  File "compile.py", line 198, in <module>
    get_globals()[entity_name] = check_syntax(get_globals()[entity_name], [entit
y_def['parser']], entity_def.get('uid', 0))
  File "C:\Users\HP\Desktop\Giochi\Editor\WRECK\integrated_ms\compiler.py", line
1619, in check_syntax
    output.append(check_syntax(entity[index], parser[0], uid))
  File "C:\Users\HP\Desktop\Giochi\Editor\WRECK\integrated_ms\compiler.py", line
1598, in check_syntax
    output.append(check_syntax(entity[index], subparser, uid))
  File "C:\Users\HP\Desktop\Giochi\Editor\WRECK\integrated_ms\compiler.py", line
1617, in check_syntax
    for index in xrange(len(entity)):
TypeError: object of type 'VAR_FACTION' has no len()


COMPILATION FAILED.

Displaying W.R.E.C.K. performance information.
Use show_performance_data = False directive in module_info.py file to disable.

    3.940 sec spent to load module data.
    0.000 sec spent to load plugins.
    0.520 sec spent to check module syntax.

    >>> 4.470 sec total time spent. <<<

Premere un tasto per continuare . . .
Everything I did was creating this mother****er
["roman_npc", "Caius", "Caius", tf_hero|tf_unmoveable_in_party_screen|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_gloves|tf_guarantee_shield|tf_guarantee_ranged, no_scene, reserved, fac.i_legio, [itm.roman_helm_cent,itm.roman_armor_white,itm.roman_greaves_greek,itm.roman_shield_square,itm.roman_pilum_3,itm.roman_spear_3,itm.roman_gladius_3], def_attrib|level(22), wp(200), knows_common|knows_power_throw_5|knows_power_strike_5|knows_leadership_4, bandit_face1, bandit_face2 ],
From this unit
["centurio", "Legio I Centurio", "Legio I Centuriones", tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_gloves|tf_guarantee_shield|tf_guarantee_ranged, no_scene, reserved, fac.i_legio, [itm.roman_helm_cent,itm.roman_armor_white,itm.roman_greaves_greek,itm.roman_shield_square,itm.roman_pilum_3,itm.roman_spear_3,itm.roman_gladius_3], def_attrib|level(22), wp(200), knows_common|knows_power_throw_5|knows_power_strike_5|knows_leadership_4, bandit_face1, bandit_face2 ],
But he was causing probems with the scene thing, so I redone everything,
["npc17","Caius","Caius", tf_hero|tf_unmoveable_in_party_window, scn.town_1_tavern, 0,reserved, fac.commoners,[itm.pilgrim_disguise,itm.pilgrim_hood,itm.roman_gladius_3,itm.roman_greaves_caligea],str_15|agi_10|int_12|cha_9|level(22),wp(250),knows_warrior_npc|knows_trade_2|knows_weapon_master_3|knows_ironflesh_4|knows_wound_treatment_1|knows_athletics_5|knows_first_aid_1|knows_leadership_4,0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000],
But when I cancelled him, that error occured
 
First off, this compiler is excellent!  Can't imagine modding without it now.

I have a question though.  I wanted to start using the extra string registers that are made available (up to 127 as the main post states) but if I try to inject them into another string...
Code:
(str_store_string, s120, "@world"),
(str_store_string, s1, "@Hello {s120}"),
... I get "Hello UNRECOGNIZED TOKEN <s120>"

I have verified the register is working by storing a value, copying it to a lower register, and injecting it there but I don't want to have to do that each time.  Any suggestions?
 
Madijeis said:
["npc17","Caius","Caius", tf_hero|tf_unmoveable_in_party_window, scn.town_1_tavern, 0,reserved, fac.commoners,[itm.pilgrim_disguise,itm.pilgrim_hood,itm.roman_gladius_3,itm.roman_greaves_caligea],str_15|agi_10|int_12|cha_9|level(22),wp(250),knows_warrior_npc|knows_trade_2|knows_weapon_master_3|knows_ironflesh_4|knows_wound_treatment_1|knows_athletics_5|knows_first_aid_1|knows_leadership_4,0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000],

It looks like when you set the scene, you left ", 0" in also so the "reserved" entry is being read as the faction.

Code:
["npc17","Caius","Caius", tf_hero|tf_unmoveable_in_party_window, scn.town_1_tavern, reserved, fac.commoners,[itm.pilgrim_disguise,itm.pilgrim_hood,itm.roman_gladius_3,itm.roman_greaves_caligea],str_15|agi_10|int_12|cha_9|level(22),wp(250),knows_warrior_npc|knows_trade_2|knows_weapon_master_3|knows_ironflesh_4|knows_wound_treatment_1|knows_athletics_5|knows_first_aid_1|knows_leadership_4,0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000],

Edit:  I don't have any experience with single player modding but you might also need to add something along the lines of "| entry(1)" after the scene.  "scn.town_1_tavern | entry(1)".
 
Kipper said:
Madijeis said:
["npc17","Caius","Caius", tf_hero|tf_unmoveable_in_party_window, scn.town_1_tavern, 0,reserved, fac.commoners,[itm.pilgrim_disguise,itm.pilgrim_hood,itm.roman_gladius_3,itm.roman_greaves_caligea],str_15|agi_10|int_12|cha_9|level(22),wp(250),knows_warrior_npc|knows_trade_2|knows_weapon_master_3|knows_ironflesh_4|knows_wound_treatment_1|knows_athletics_5|knows_first_aid_1|knows_leadership_4,0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000],

It looks like when you set the scene, you left ", 0" in also so the "reserved" entry is being read as the faction.

Code:
["npc17","Caius","Caius", tf_hero|tf_unmoveable_in_party_window, scn.town_1_tavern, reserved, fac.commoners,[itm.pilgrim_disguise,itm.pilgrim_hood,itm.roman_gladius_3,itm.roman_greaves_caligea],str_15|agi_10|int_12|cha_9|level(22),wp(250),knows_warrior_npc|knows_trade_2|knows_weapon_master_3|knows_ironflesh_4|knows_wound_treatment_1|knows_athletics_5|knows_first_aid_1|knows_leadership_4,0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000],

Edit:  I don't have any experience with single player modding but you might also need to add something along the lines of "| entry(1)" after the scene.  "scn.town_1_tavern | entry(1)".
I know mate,  but now the compiler is acting wierd as hell, giving me an error I never had before. I'm messing with the compiler, but looks like I'll have to reinstall everything

P.S.: Nice mod Nord Invasion, I'm a Commando, "SPQR_Sir_Madijeis". Continue with the good work
 
Madijeis said:
giving me an error I never had before.

one of the benefits of this compiler is that it has better feedback on bugs/syntax errors than the Native one. Don't be afraid of new error messages, just read them and follow the instructions

you can ask here or in the Q&A thread for further help (remember to include your code and the compiler messages)
 
kalarhan said:
Madijeis said:
giving me an error I never had before.

one of the benefits of this compiler is that it has better feedback on bugs/syntax errors than the Native one. Don't be afraid of new error messages, just read them and follow the instructions

you can ask here or in the Q&A thread for further help (remember to include your code and the compiler messages)
Ok, but the fact that that error appeared only after I tried this thing with Caius and persisted after I removed him, even with completely untouched files really is suspicious. I never touched the compiler as well.
 
hello everyone this is my first time using WRECK and i encountered these errors i tried to fix for more then 5 hours today but i couldn't now i'm pissed it worked great when i just copied the files from "Copy_n_Forget" Folder
but when i try to add it to my module system(1.171 latest) for full and advanced features this is what i encountered
P8EF1YN.jpg
thanks in advance
Edit : just a question is it because i'm using module system 1.171 'and i'm testing all of this in a copy native module)
 
You have an unexpected character somewhere in the string that it doesn't recognize. You can try using Notepad++ to force convert the strings to whatever encoding format it expects (utf8 probably)
 
Somebody said:
You have an unexpected character somewhere in the string that it doesn't recognize. You can try using Notepad++ to force convert the strings to whatever encoding format it expects (utf8 probably)
thanks that worked for me ( i did some typos )
but now i'm getting this when i try to use the advanced feature of plugins i tried everything but it keeps giving me this error dunno why here look
pwvaHQs.jpg
any help would be great i changed everything but still didn't get it to work its either i'm too damn stupid that i'm missing something or i really did something !thanks in advance!!
 
Somebody said:
The list of factions to append should not be a string (you're not supposed to do injections there). Look at the sample plugin code please.
i don't understand i tried everything and i get a new error in all of them
i mean i'm not trying to do something big i'm just testing how the injection work by adding 3 new factions with their own troops
but what's the problem now lol after trying what you suggested i'm getting the error of

Code:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... FAILED.
MODULE `new_factions` ERROR:
Traceback (most recent call last):
  File "compile.py", line 53, in <module>
    from module_info import *
  File "E:\Games\taleworlds\Mount&Blade Warband1.170\Modules\WOS Test 1\Module S
ystem 1.165\module_info.py", line 50, in <module>
    import new_factions
  File "E:\Games\taleworlds\Mount&Blade Warband1.170\Modules\WOS Test 1\Module S
ystem 1.165\new_factions.py", line 21, in <module>
    ["Aki_Peasent",                    "Aki Peasent",                    "Aki Pe
asent",                    tf_guarantee_boots|tf_guarantee_armor,
                                    0,0,fac_kingdom_1,[itm_scythe,itm_nomad_vest
,itm_nomad_boots],                                       def_attrib|level(4),wp(
60),knows_common,swadian_face_younger_1, swadian_face_middle_2],
NameError: name 'fac_kingdom_1' is not defined


COMPILATION FAILED.

Appuyez sur une touche pour continuer...
 
imado552 said:
but what's the problem now lol after trying what you suggested i'm getting the error of

you need to re-read the OP (original post), and maybe study the code sample (modsys) that comes with WRECK 1.0.

Lav said:
  • Vanilla compiler requires two sets of entity references: static references contained in ID_*.py files (icon_player) and quoted references ("icon_player") which are calculated at compile-time. This creates a number of problems. For example, it's impossible to simply add a new icon and a new party which will use that icon: modder must add a new icon, compile the module to regenerate the ID files, and only then he can add a new party. W.R.E.C.K. offers a solution to this problem by introducing a dynamic reference (icon.player) which can be used freely and everywhere, replacing both types of vanilla references. Note that while W.R.E.C.K. sticks to standard Warband prefixes, strings are referenced as s.<string_name> instead of str.<string_name>. This is the only deviation from the scheme, necessitated by the fact that str is a global keyword in Python.

you either use fac.XXXX or "fac_XXXX", not fac_XXXX
 
Just started working with this as an alternative to modmerger. So far, it's great! I'd complain about having to edit the native code to inject stuff but its so much easier than Modmerger that I really can't  :razz:

Kudos!

 
mercury19 said:
kalarhan said:
mercury19 said:
Ok new question, is it possible to import something from a different folder;

New Question 2: I'm getting an illegal reference error on an item added by the plugin that's defined by a constant.  Using the constant works just fine in the scripts, but it fails in the mission templates.

-snip-

2) move your constants to higher level files (like I mentioned earlier). A good example here would be to add this constant on header_items.py. Or see (1) to learn how to import things, and remember to ONLY import the constant, not the entire file

Hmm, I think looking into making it multi-folder will come another day. Thanks for the info though!

2) None of these have worked so far. I moved it to header_items, got the same error. I tried to import the constant using "from tpe_constants import wp_tpe_enhanced_shield", in both tpe_mission_templates and plugin_tpe. Same error. I'm wondering if it has something to do with the way I set up the multiple files.

As of now, I have the master file, "plugin_tpe", which is registered in WRECK as a plugin, and has all of my injections. Then I have a bunch of other files labeled "tpe_[module name]" for the other files(scripts, game_menus, etc.), which are not registered as plugins and not imported in the "module_info file". Finally I have a file called "tpe_imports", which atm looks like this:

Code:
from compiler import *


## NATIVE IMPORTS
from module_troops import wp

## OTHER PLUGINS
from gpu import *

## LOCAL PLUGIN
from tpe_constants import *
from tpe_game_menus import *
from tpe_items import *
from tpe_mqs import *
from tpe_mission_templates import *
from tpe_presentations import *
from tpe_scripts import *
from tpe_simple_triggers import *
from tpe_strings import *
from tpe_troops import *

I then have "from tpe_imports import *" in all of my "tpe_" folders, except for the constants one. Maybe I've messed something up here? I've tried a few variations of importing, including moving the compiler import out of the "imports" file and into the individual ones, but nothing has worked.

I can't copy and paste the error from the compiler but I'll try and type it out, in case there's something I'm missing there also:

Code:
MODULE mission_templates AGGREGATOR ERROR:
failed to compile trigger for mission template tpe_tournament_standard (#50)
   command [1729, 2, <1.agent_self[@1224979298644774912]>, 'itm_tpe_enhanced_shield_red'] compilation fails in mt.tpe_tournament_standard(#50).repeat_trigger(1.0).body on line 94
      failed to parse operand 'itm_tpe_enhanced_shield_red' for operation agent_has_item_equipped in mt.tpe_tounament_standard(#50).repeat_trigger(1.0).body on line 94
         illegal reference 'itm.tpe_enhanced_shield_red'

It shouldn't be a spelling error either, I've double and triple checked that. Any spelling errors above are from transcribing the error code.

Again thanks for all your help!

At kalarhan's suggestion I'm moving my question here.
 
mercury19 said:
I'm moving my question here.

suggestion: post your code, it would be a lot easier to look at it then to try to figure out things from the multiple posts. But only if you are OK with making it public (even as a working version). Dropbox, Github, etc.
 
Back
Top Bottom