OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

正在查看此主题的用户

Motomataru,

First, thanks for this great mod. In my opinion, MB/WB is not worth playing without it--seriously!

That said, I'd like to be able to add it manually to to other mods myself, and so went back to version 3, which you posted back on 24 June 2010. Installing that version was a snap (even though I am new to MB/WB modding) since each of the code snippets was discrete. After following your directions, that version compiled without errors on the first try!

But of course I would also like to take advantage of the features that you have implemented since then, and so have been trying to install the latest version manually as well. In your readme, however, you mention .dds files that need to be put in the appropriate install folder of the module. But there are no .dds files in the package, just the .py files and the one .brf. Is there something missing? It doesn't seem like it, since that package compiled and ran fine using ModMerger. I assume, then, that ModMerger must be doing something that I don't understand.

Of course, you're probably wondering why I don't just use the ModMerger version to play, right? Well, I could...but ultimately I like to be able to do things myself. I have enjoyed writing simple scripts for other games, and am trying to learn to do the same for MB/WB. Installing mods manually is one way to learn how they are structured and what the various module system files do. Also, since I do not really understand what ModMerger is doing, I'm not sure how to merge its output with other non-ModMerger mods (if that makes any sense) and this limits what I can do with it.

So if you can simply explain the reference to .dds files in the readme and how it affects a manual installation, I'd be very grateful.

Cheers, and thanks again for a great mod!

EDIT: Nevermind, after a little bit of tinkering, I got it to compile without errors and running great. Is perhaps the reference to .dds files in the readme just a carry-over from some previous version?

In any case, thanks again!
 
First off, thank you for the very kind words.

About that .dds file... It no longer exists.  :oops: Caba'drin has since refined that section.

These are resources unrelated to the compile. Typically, they are placed (with the *.txt files produced by the compile) by a mod installer.

Here's my new paragraph for the Readme file:

插入代码块:
In either case, for Warband you need to place the order_frame.brf file in the the "resource" INSTALL subdirectory for the mod you are adding these files to. Then add the line "load_module_resource order_frame" to the module.ini in the main install directory.

About progress, a year or so behind. V4 is almost there: the main components still lacking are the auto-options menu and updating the battle menu to handle formations. This latter I may drop: it'd be a significant amount of tedious work that I'd have to learn in the first place. There are a significant number of unexploited opportunities that Caba and I kind of pick at. We're at 250 team slots and counting (including slots for front-rank that you guys requested)! I have an idea to auto-duplicate the weapons table for stab-only, but we haven't tackled it yet. Attempts to force agents on the battlefield to stab were not successful.

Unfortunately, after the holidays my seasonal employment kicks in again, so it may be early summer before I can present something as v4. Meanwhile, I'm dropping a delta on the guinea pigs at BW mod, and if there is not too much of an outcry, I'll post it here. The Hold-F1 division attack function is WAAAAY cool! Now the player can replicate those AI cav attacks on his archers.
 
Wow, thanks for the speedy reply!

So speedy, in fact, that I didn't even notice it before editing my original post.

Anyway, as I mention there, after a little bit of intuitive tinkering, I got it installed and running great.

Thanks again for your fine work.

I look forward to the next version...whenever you get to it!

EDIT: Since you are updating the readme, perhaps I should also point out that the current instructions don't mention the need to add "order_display" to module_presentations and "order_frame" to module_meshes. I figured it out from the compiler errors I was getting, but including those two steps in the instructions might save other folks some time.
 
NewBie-BR 说:
Wow! This's very good. But i'm newbie, can you show me exactly where i add those script ?
If you wish to simply play, follow the instructions here: http://www.mbrepository.com/file.php?id=2475

If you wish to start writing your own modifications to the game, copy this to your development folder: http://dl.dropbox.com/u/8432316/FormAIv4%20Dev.zip

This can be any folder so long as you change module_info.py to specify the folder into which the compiled files will go. That folder is often the module installation folder (under Modules in the Warband install folder).

Follow the other instructions in the Readme file. In this case, you have modmerger set up for you.
 
motomataru 说:
NewBie-BR 说:
Wow! This's very good. But i'm newbie, can you show me exactly where i add those script ?
If you wish to simply play, follow the instructions here: http://www.mbrepository.com/file.php?id=2475

If you wish to start writing your own modifications to the game, copy this to your development folder: http://dl.dropbox.com/u/8432316/FormAIv4%20Dev.zip

This can be any folder so long as you change module_info.py to specify the folder into which the compiled files will go. That folder is often the module installation folder (under Modules in the Warband install folder).

Follow the other instructions in the Readme file. In this case, you have modmerger set up for you.
Thanks :grin:
 
Well, this is my problem:
插入代码块:
 Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting postfx_params...

______________________________
 
NewBie-BR 说:
Well, this is my problem:
插入代码块:
 Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\NguyenHung\Desktop\Mount&Blade Warband\Modules\Loan 12 Su Quan\
Module_system 1.143\module_scripts.py", line 48585
]
    ^
SyntaxError: invalid syntax
Exporting postfx_params...

______________________________
I've done with it and this is new problem:
插入代码块:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
WARNING: Usage of unassigned global variable: $new_kills
WARNING: Usage of unassigned global variable: $new_kills
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: airout
WARNING: Global variable never used: rout
WARNING: Global variable never used: $new_kills
WARNING: Global variable never used: $new_kills
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
Hello, I was hoping to get some insight into getting this all set up for the mod-merger as I've gone through the process several times and cannot figure out my error.

I install the modmerger files into my mod's module system directory, and the installer creates compiled modmerger_options and modmerger_header files which are then removed after the module is built.

I then copy the formations and formai files into the same directory and make sure they are listed under the active mods section of the modmerger_options file (Don't see any syntax errors).

For some reason however, nothing is added to the game, although it compiles no problem.  The modmerger files do not produce any compiled files however, unlike that whole system file posted by motomataru earlier in the thread.  Changes to regular files, like modules_parties, compile no problem.

Thank you for your assistance, I can provide screenshots of whatever if needed.
 
You've run the modmerger_installer.py file and it gives a report list of "Successfully branded: module_<name_here>.py"?
 
Ah, no it doesn't.  It cuts out after a couple quick operations and I just figured that it had done it's job.
 
rdb_522 说:
Ah, no it doesn't.  It cuts out after a couple quick operations and I just figured that it had done it's job.
Might you have the module system in your Program Files directory, or some other Windows UAC-controlled place? If so, move it to your desktop or documents folder, etc and give it another go.
 
Caba`drin 说:
rdb_522 说:
Ah, no it doesn't.  It cuts out after a couple quick operations and I just figured that it had done it's job.
Might you have the module system in your Program Files directory, or some other Windows UAC-controlled place? If so, move it to your desktop or documents folder, etc and give it another go.

Well UAC is turned off, but I did try running it from C: and off of an external drive with the same cutout.  I did, however install python on a second computer and had no trouble branding the files.  When I brought it back to my main computer, I was able to compile with the formations and formai files no problem.  It's obviously something unique to my computer or windows installation.

Essentially I'm past the trouble so I'm not going to look too much further into it, but if you had any more interest let me know.

Thank you for helping me resolve the issue.
 
For whatever reason I keep getting this errors:

Exporting scripts...
Error: Unable to find object:script_battlegroup_get_position
ERROR: Illegal Identifier:script_battlegroup_get_position
Error: Unable to find object:script_battlegroup_get_position
ERROR: Illegal Identifier:script_battlegroup_get_position

I used the modmerger and in game the formations do work, the only issue is that the formations don't really face each other.


Oh nvm, need to move scripts from formai to formations_ and got it working.

Now a question, does this have "tactical charge" like the form ranks mod used to have? Basically, charging in formation.
 
OK, so after a couple years I've finally gotten round to putting in player options for Formations. Does anyone have any suggestions?

So far I have:
- option to turn off player formations
- option to have formations form at their current location (rather than next to player)
- option to turn auto-rotate off/on
 
motomataru,

Haven't been here for a while, so I just noticed your previous question. In response to that, I am very much in favor of having an option for formations to form at their current location. I can't think of any others right now, but I'll give it some thought.

The reason I came back here, though, was to ask whether the AI ought to be applied to allies when, for example, the player assists or is assisted by another lord.

As I read the code in script_field_tactics, it seems like it should, but in game it always seemed to me like allied lords just gave a "charge" order every time. So I planted a couple fo debug messages in script_field_tactics to indicate when the AI was being used and when it was not. And, as I had suspected, it is not being applied to allied lords and their troops.

Is there any way to fix this?
 
I'm not seeing the logic hole. Perhaps you could point it out?

Here's what I have:
#apply tactics to every AI team
    (set_show_messages, 0),
(try_for_range, ":ai_team", 0, 4),
(team_get_slot, ":ai_team_size", ":ai_team", slot_team_adj_size),
(gt, ":ai_team_size", 0),

(assign, ":do_it", 0),
(try_begin),
(neq, ":ai_team", "$fplayer_team_no"),
(assign, ":do_it", 1),
(else_try),
(main_hero_fallen),    #have AI take over for mods with post-player battle action
(eq, AI_Replace_Dead_Player, 1),
(assign, ":do_it", 1),
(try_end),
(eq, ":do_it", 1),

If, by "charge," you mean the allies always advance into battle, formations intact, there's a caveat: the AI bases it's decision counting in the player troops and always advances if it calculates that it has the advantage. Hence slot_team_adj_size. Try firing your whole party and joining an outnumbered ally. They should take a defensive posture.

I realize an ally's canned decisions affects the player's control over the battle, but this is in keeping with both Native and the general AI approach I've developed.

And in other news, v4 is done. It's gone through one version of Brytenwalda and has now been deployed with a second. If it continues to hold up well, I'll release it. As far as I can tell, the remaining weirdnesses that I've detected are from Native.
 
Thank you for the reply!

To be honest, I didn't see the logic hole either. But then, I wasn't sure how WB assigns teams,  so I modified that section as follows to include some in-game feedback:

#    (set_show_messages, 0),
(try_for_range, ":ai_team", 0, ":num_teams"),
(team_get_slot, ":ai_team_size", ":ai_team", slot_team_adj_size),
(gt, ":ai_team_size", 0),

(assign, ":do_it", 0),
(try_begin),
(neq, ":ai_team", "$fplayer_team_no"),
(assign, ":do_it", 1),
(else_try),
(main_hero_fallen),    #have AI take over for mods with post-player battle action
(eq, AI_Replace_Dead_Player, 1),
(assign, ":do_it", 1),
(try_end),
(eq, ":do_it", 1),

(team_get_slot, ":ai_faction", ":ai_team", slot_team_faction),
(try_begin),
(this_or_next|eq, AI_for_kingdoms_only, 0),
(this_or_next|eq, ":ai_faction", fac_deserters), #deserters have military training
(is_between, ":ai_faction", fac_kingdom_1, fac_kingdoms_end),
(val_mul, ":ai_team_size", 100),
(store_div, ":team_percentage", ":ai_team_size", ":largest_team_size"),
(store_div, ":team_battle_presence", ":ai_team_size", ":battle_size"),
(try_begin),
(eq, ":include_ranged", 1),
(call_script, "script_team_field_ranged_tactics", ":ai_team", ":team_percentage", ":team_battle_presence"),
(display_message, "@Ranged Tactics called."), ## Display message added.
(try_end),
(call_script, "script_team_field_melee_tactics", ":ai_team", ":team_percentage", ":team_battle_presence"),
(display_message, "@Melee Tactics called."), ## Display message added.
(try_end),
(try_end),
#    (set_show_messages, 1),

In short, the two set_show_messages commands have been disabled and two display_message commands have been added after the calls to script_team_field_ranged_tactics and script_team_field_melee_tactics.

Then, in game, I fought a solo battle against Deserters, and got the messages indicating when "Ranged Tactics" and "Melee Tactics" were called, just as one would expect. For that matter they also appeared in a simple custom battle, also as one would expect.

Later, however, I joined a battle with an AI Lord versus some forest bandits. Since AI_for_kingdoms_only = 1, I knew that the forest bandits would not call the tactics scripts, but since the messages never appeared at all, apparently the allied AI lord did not call them either. His troops just charged--no formations, no advance, just every man for himself, full speed ahead--no messages indicting that the tactics scripts had been called. And that, of course, is the same behavior I get in all allied battles, and indeed what caused me to investigate in the first place.

So, as you say, from looking at the code, it seems to me too that the AI should be applied to allied lords. Nevertheless, their actual in-game behavior and my makeshift debug messages lead me to suspect otherwise.

Any thoughts?

In any case, as always, thank you for all the work on this mod. As I have said before, it is the only one I absolutely will not play without!
 
I'm still finalizing AI for v4, trying to make it look natural and effective. Those are not always compatible goals.

Speaking of which, my biggest disappointment with this whole project is the performance of the formations. After everything: stab-only weapons, keeping the back ranks from blocking, rethink to shift focus to nearest enemy, etc., my tests show they decrease in fighting ability on the order of over 80% below the Native mob.

I had thought that the simple physics of formations would have them prevail as they did historically, but something is killing them. I strongly suspect that fighting ability under scripted movement is drastically decreased. On this basis, I had formations stay put in combat, but that actually made their performance noticeably worse. The game, it seems, favors movement -- something MP seems to underscore (the naked guy with the hafted polearm always kills the "tank").

I could fudge it simply by reducing damage taken by troops in a formation by a straight percentage. I strongly dislike this approach, but I'm out of ideas here.

Suggestions? Feelings?
 
I, for one, wouldn't mind having formations take less damage. That would stimulate players to use them.
And you could even make the percentages variable based on different things, and maybe even the player's Tactics skill. :smile:
 
后退
顶部 底部