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

正在查看此主题的用户

Fei Dao 说:
Ha, that would be very useful. Do you mind if I post up a little simplified non-Dionisia version that I made based off of yours here?

Not at all, I posted it so that people could use it.
 
Can anyone inform me as to where the module_scripts.py file is? I cant find it for some reason. It is not hidden(that I am aware of) and not in the M&B file folder. (windows vista 64)
 
Mirathei 说:
Verito 说:
Getting this error everytime I use this, when I run build module.bat:

插入代码块:
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 11, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
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:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 59, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
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:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Exporting quest data...
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\process_o
perations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Documents and Settings\Colin\Desktop\Chris\M&B\ModuleSystem\module_sc
ripts.py", line 19177
    ("cf_formation",
    ^
IndentationError: unexpected indent

______________________________

Script processing has ended.
Press any key to exit. . .

Since I have to go now, and don't have time to read through other posts, I want to know if any of you guys can help me out. (No doubt it's something simple. Bah, I'm terrible at this stuff.)
Looks like you copied my scripts into the middle of one that was already there.
I added it underneath the lead_charge thing, and I put the one that was meant to go in module scripts at the bottom. It doesn't work.

And also, my module_scripts is refusing to open. The rest of them are fine.
 
[quote author="Mirathei"]You somehow missed the first trigger. Adding them to module_variables just makes it so that the mod system won't know that there's an incorrect variable usage.[/quote]
I've checked it a couple of times, so no, I made everything right. And it still worked better, then the previous release of your script.
But just now I removed the variables from the module_variables.py and compiler built the module without any problems. Guess, I had a python bug yesterday.
 
Mirathei or anyone else who has this working properly, maybe you should post the entire lead_charge template so they can see how it is supposed to be.  I'd do it, but I haven't added this in yet.  I can show where to put the scripts though.

module_scritps:
at the end of the file, there is a ']', place everything before the ']'
ex:

scripts
scripts
scripts

]

Nothing can go below the last ']'
 
grailknighthero 说:
..maybe you should post the entire lead_charge template so they can see how it is supposed to be.
It was posted above already. Maybe it should be added to the OP, though.
Anyway, in mission_templates.py find the lines below:

"lead_charge",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [
    (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
    (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
    (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
    (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
    ],
    [


    #TACTICAL TRIGGERS SHOULD BE HERE#
       
      (ti_on_agent_spawn, 0, 0, [],
      [
        (store_trigger_param_1, ":agent_no"),
        (call_script, "script_agent_reassign_team", ":agent_no"),
        ]),


And paste the scripts where the red text in my example is (it won't be any in your mission_templates.py).
 
In what map do i find this mission_template. Mount and blade/Modules/Native/? And can some one copy all the files instead cause im not sure where to put or if i have to jump one line down so, please copy everything in the text. I mean the whole mission template text thats in there after putting in the things. Same to that module thing.

BTW can you update it so you have fire command to archers?
 
you have to download the module system. The topic is sticked in this forum.

Then, open the module_mission_template file for the first half of the code, and the module_script file for the second half.

Be sure to give a look to the basic module system instructions (found in a sub-section of the forge)
 
插入代码块:
     (0, 0, 0,
      [(key_clicked, key_o),    #O is for orders
    (str_clear, s1),
    (str_store_string, s1, "@J - Form Ranks^H - Form Line^G - Form Wedge^P - Disassemble Formation^T - Display Cohesion Information^Y - Rally Your Troops^V - Call for Reinforcements"),
    (tutorial_message, s1),
    ], []),

Put the above code right underneath this:

    (0, 0, 0,
      [(key_clicked, key_4),     
      (assign,"$formation",grc_cavalry),
        ], []),

The only problem is that once you click the "o" key, the text stays there in the corner until the end of battle.
 
Fei Dao 说:
The only problem is that once you click the "o" key, the text stays there in the corner until the end of battle.

That's because you got rid of the "$dmod_chel_help" variable and try condition.  All you had to do was get rid of the (eq, "$dmod_chel_mirathei_battle", 1) line, change the trigger key to whatever you wanted, and adjust the help text...  If you want to make it completely neutral, you can rename "$dmod_chel_help"; getting rid of it completely breaks the toggle functionality.
 
:oops: I'm still not very good at this, as you can tell  :lol:

插入代码块:
  (0, 0, 0,
      [(key_clicked, key_o),    #O is for orders
      (str_clear, s1),
      (try_begin),
         (eq, "$formation_help", 0),
         (str_store_string, s1, "@J - Form Ranks^H - Form Line^G - Form Wedge^P - Disassemble Formation^T - Display Cohesion Information^Y - Rally Your Troops^V - Call for Reinforcements"),
         (assign, "$formation_help", 1),
      (else_try),
         (str_store_string, s1, "@ "),
         (assign, "$formation_help", 0),
      (try_end),
      (tutorial_message, s1),
    ], []),

Better?
 
This is really odd but when I pasted it into the module system it all shows up in one line(without enters)

Like that:

(ti_before_mission_start, 0, 0, [], [ (assign,"$formation",0),(assign,"$infantryformationtype",0),(assign,"$archerformationtype",0),(assign,"$cavalryformationtype",0),]),(0, 0, 0,[(key_clicked, key_2), (assign,"$formation",grc_infantry),], []),(0, 0, 0,[(key_clicked, key_3), (assign,"$formation",grc_archers),], []),(0, 0, 0,[(key_clicked, key_4), (assign,"$formation",grc_cavalry),], []),(0, 0, 0,[(key_clicked, key_j), (get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,"$formation"),(call_script,"script_cf_formation"),(try_begin),(eq,"$formation",grc_infantry),(assign,"$infantryformationtype",1),(else_try),(eq,"$formation",grc_archers),(assign,"$archerformationtype",1),(else_try),(eq,"$formation",grc_cavalry),(assign,"$cavalryformationtype",1),(end_try),(display_message,"@Forming_ranks."),], []),(0, 0, 0,[(key_clicked, key_p), (get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,"$formation"),(call_script,"script_cf_formation_stagger"),(call_script,"script_cf_formation"),(try_begin),(eq,"$formation",grc_infantry),(assign,"$infantryformationtype",3),(else_try),(eq,"$formation",grc_archers),(assign,"$archerformationtype",3),(else_try),(eq,"$formation",grc_cavalry),(assign,"$cavalryformationtype",3),(end_try),(display_message,"@Forming_a_line."),], []),(0, 0, 0,[(key_clicked, key_k), (get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,"$formation"),(call_script,"script_cf_formation_wedge"),(call_script,"script_cf_formation"),(try_begin),(eq,"$formation",grc_infantry),(assign,"$infantryformationtype",2),(else_try),(eq,"$formation",grc_archers),(assign,"$archerformationtype",2),(else_try),(eq,"$formation",grc_cavalry),(assign,"$cavalryformationtype",2),(end_try),(display_message,"@Forming_a_wedge."),], []),(0, 0, 0,[(key_clicked, key_u), (get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,"$formation"),(call_script,"script_formation_end"),(call_script,"script_cf_formation"),(try_begin),(eq,"$formation",grc_infantry),(assign,"$infantryformationtype",0),(else_try),(eq,"$formation",grc_archers),(assign,"$archerformationtype",0),(else_try),(eq,"$formation",grc_cavalry),(assign,"$cavalryformationtype",0),(end_try),(display_message,"@Formation_disassembled."),], []),(5.0, 0, 0,[(try_for_agents,":agent"),(agent_is_human,":agent"),(neg|agent_is_ally,":agent"),(assign,":enemy",":agent"),(end_try),(gt,":enemy",-1),(agent_get_team ,reg0, ":enemy"),(assign,reg1,grc_cavalry),(call_script,"script_formation_end"),(assign,reg1,grc_infantry),(call_script,"script_formation_end"),(assign,reg1,grc_archers),(call_script,"script_formation_end"),], []),(5.0, 0, 0,[(assign,":enemy",-1),(assign,":infantry",0),(assign,":cavalry",0),(try_for_agents,":agent"),(agent_is_human,":agent"),(agent_is_alive,":agent"),(neg|agent_is_ally,":agent"),(assign,":enemy",":agent"),(agent_get_class ,":class", ":agent"),(try_begin),(eq,":class",grc_cavalry),(val_add,":cavalry",1),(else_try),(val_add,":infantry",1),(end_try),(end_try),(gt,":enemy",-1),(agent_get_team ,reg0, ":enemy"),(assign,":ratio",":infantry"),(val_div,":ratio",":cavalry"),(try_begin),(gt,":ratio",2),(lt,":cavalry",10),(team_give_order, reg0, grc_everyone, mordr_dismount),(else_try),(team_give_order, reg0, grc_everyone, mordr_mount),(end_try),], []),(5.0, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(val_add,reg0,2),(assign,reg1,grc_cavalry),(call_script,"script_formation_end"),(assign,reg1,grc_infantry),(call_script,"script_formation_end"),(assign,reg1,grc_archers),(call_script,"script_formation_end"),], []),(5.0, 0, 0,[(neq, "$battle_won", 1),(assign,":infantry",0),(assign,":cavalry",0),(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(val_add,reg0,2),(try_for_agents,":agent"),(agent_is_human,":agent"),(agent_is_alive,":agent"),(agent_get_team ,":team", ":agent"),(eq,":team",reg0),(agent_get_class ,":class", ":agent"),(try_begin),(eq,":class",grc_cavalry),(val_add,":cavalry",1),(else_try),(val_add,":infantry",1),(end_try),(end_try),(assign,":ratio",":infantry"),(val_div,":ratio",":cavalry"),(try_begin),(gt,":ratio",2),(lt,":cavalry",10),(team_give_order, reg0, grc_everyone, mordr_dismount),(else_try),(team_give_order, reg0, grc_everyone, mordr_mount),(end_try),], []),(0.2, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,grc_infantry),(try_begin),(eq,"$infantryformationtype",1),(call_script,"script_cf_formation"),(else_try),(eq,"$infantryformationtype",2),(call_script,"script_cf_formation_wedge"),(else_try),(eq,"$infantryformationtype",3),(call_script,"script_cf_formation_stagger"),(else_try),(call_script,"script_formation_end"),(end_try),], []),(0.2, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,grc_archers),(try_begin),(eq,"$archerformationtype",1),(call_script,"script_cf_formation"),(else_try),(eq,"$archerformationtype",2),(call_script,"script_cf_formation_wedge"),(else_try),(eq,"$archerformationtype",3),(call_script,"script_cf_formation_stagger"),(else_try),(call_script,"script_formation_end"),(end_try),], []),(0.2, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(assign,reg1,grc_cavalry),(try_begin),(eq,"$cavalryformationtype",1),(call_script,"script_cf_formation"),(else_try),(eq,"$cavalryformationtype",2),(call_script,"script_cf_formation_wedge"),(else_try),(eq,"$cavalryformationtype",3),(call_script,"script_cf_formation_stagger"),(else_try),(call_script,"script_formation_end"),(end_try),], []),(0.2, 0, 0,[(try_for_agents,":agent"),(agent_is_human,":agent"),(neg|agent_is_ally,":agent"),(assign,":enemy",":agent"),(end_try),(gt,":enemy",-1),(agent_get_team ,reg0, ":enemy"),(store_normalized_team_count,":num", reg0), (gt,":num",5),(assign,reg1,grc_infantry),(call_script,"script_cf_formation"),], []),(0.2, 0, 0,[(try_for_agents,":agent"),(agent_is_human,":agent"),(neg|agent_is_ally,":agent"),(assign,":enemy",":agent"),(end_try),(gt,":enemy",-1),(agent_get_team ,reg0, ":enemy"),(store_normalized_team_count,":num", reg0), (gt,":num",5),(assign,reg1,grc_archers),(call_script,"script_cf_formation_stagger"),], []),(0.2, 0, 0,[(try_for_agents,":agent"),(agent_is_human,":agent"),(neg|agent_is_ally,":agent"),(assign,":enemy",":agent"),(end_try),(gt,":enemy",-1),(agent_get_team ,reg0, ":enemy"),(store_normalized_team_count,":num", reg0), (gt,":num",5),(assign,reg1,grc_cavalry),(call_script,"script_cf_formation_wedge"),], []),(0.2, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(val_add,reg0,2),(store_normalized_team_count,":num", reg0), (gt,":num",5),(assign,reg1,grc_infantry),(call_script,"script_cf_formation"),], []),(0.2, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(val_add,reg0,2),(store_normalized_team_count,":num", reg0), (gt,":num",5),(assign,reg1,grc_archers),(call_script,"script_cf_formation_stagger"),], []),(0.2, 0, 0,[(get_player_agent_no,":player"),(agent_get_team ,reg0, ":player"),(val_add,reg0,2),(store_normalized_team_count,":num", reg0), (gt,":num",5),(assign,reg1,grc_cavalry),(call_script,"script_cf_formation_wedge"),], []),



anyone know what might be the problem?
 
Mirathei 说:
Mirathei 说:
Press reply with quote and copy the codes from there. The forum code box is bugged for some reason.

Thank you


EDIT:

I need some help,
I am trying to make Pikemen and Arquebusiers the only troops that use formation while all other troops behave the way they do in native.
I'm thinking about giving them a specific item and the script could recognize that item and only make troops with those items stand in formations. Or give tham a tag and have the script recognize the tag.

Could someone please point out some ways I could go about doing this?
 
+1

An easy to follow method of specifying that trp_type_x doesn't use formations, or uses a particular kind of formation, would be great!

 
This should do it for you if you use it as a replacement for the default formation script. Pay particular attention to the parts in red.

  ("cf_formation",
  [(team_get_leader, ":teamleader", reg0),
    (gt,":teamleader",-1),
    (assign,":leader",-1),
    (agent_get_class,":class",":teamleader"),
    (try_begin),
      (eq,":class",reg1),
      (get_player_agent_no,":player"),
      (neq,":teamleader",":player"),

      (agent_get_troop_id,":troop", ":teamleader"),
      (this_or_next|eq,":troop","trp_first_formation_troop"),
      (eq,":troop","trp_next_formation_troop"),
      (neq,":troop","trp_unwanted_formation_troop"),

      (assign,":leader",":teamleader"),
    (else_try),
      (assign,reg2,-1),
      (assign,":max_xp",0),
      (try_for_agents,":agent"),
          (agent_is_alive,":agent"),
          (agent_is_human,":agent"),
          (agent_get_team,":team",":agent"),
          (eq,":team",reg0),
          (agent_get_class,":class",":agent"),
          (eq,":class",reg1),
          (get_player_agent_no,":player"),
          (neq,":player",":agent"),

      (agent_get_troop_id,":troop", ":agent"),
      (this_or_next|eq,":troop","trp_first_formation_troop"),
      (eq,":troop","trp_next_formation_troop"),
      (neq,":troop","trp_unwanted_formation_troop"),

          (agent_get_troop_id,":troop", ":agent"),
          (troop_get_xp, ":mad:p", ":troop"),
          (gt,":mad:p",":max_xp"),
          (assign,":max_xp",":mad:p"),
          (assign,reg2,":agent"),
      (end_try),
      (gt,reg2,-1),
      (assign,":leader",reg2),
    (end_try), 
    (gt,":leader",-1), 
    (agent_get_position,1,":leader"),
    (position_move_x,1,100),
    (assign,":collumn",1),
    (try_for_agents,reg(5)),
      (neq,reg5,":leader"),
      (agent_is_alive,reg(5)),
      (agent_is_human,reg(5)),
      (agent_get_team  ,":team", reg5),
      (eq,":team",reg0),
      (agent_get_class ,":class", reg5),
      (eq,":class",reg1),     

      (agent_get_troop_id,":troop", reg5),
      (this_or_next|eq,":troop","trp_first_formation_troop"),
      (eq,":troop","trp_next_formation_troop"),
      (neq,":troop","trp_unwanted_formation_troop"),
                           
      (agent_set_scripted_destination,reg(5),1),
      (position_move_x,1,100),
      (try_begin),
          (eq,":collumn",12),
          (position_move_x,1,-12*100),
          (position_move_y,1,-200),
          (assign,":collumn",1),
      (else_try),
          (val_add,":collumn",1),
      (end_try),
    (end_try)]),
 
...formations ordered to hold their position keep falling back when the enemy comes, and even during the fight they seem to move around somehow like a big body of men.

I assume it's not related to cowardy.

 
Thanks Mirathei, I'm trying it now.

Nikephoros 说:
...formations ordered to hold their position keep falling back when the enemy comes, and even during the fight they seem to move around somehow like a big body of men.

I assume it's not related to cowardy.
I think it's because the formation is following a single "leader", who is just acting like a normal troop.
Notice how single soldiers in native walk back and charge again, well now it's just more noticeable because the whole army is following that single soldier.

 
后退
顶部 底部