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

正在查看此主题的用户

Thanks for the update Mirathei. :smile:

I also changed the keys around when I integrated it - you can put select bowmen/infantry/cavalry to "2,3,4" and they seem to coexist with M&B perfectly well - I also commented out the message lines.  I also reassigned the "disassemble formation" key (U) to F9 (aka Spread Out) - seems to work great.

The only thing I'm slightly confused about is M (Follow/Hold)?  What exactly does the formationmode 0/1 do?  I have some idea - when its set to follow, the troops will follow you and not split off to engage the enemy at all... maybe its just the wording that is confusing.

Now if we could only get the AI to have sensible starting orders it would be super great. :cool:
 
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.

Dain Ironfoot 说:
Mirathei 说:
Dain Ironfoot 说:
Cool... now you just need multiple formations of infantry/cavalry/archers :razz:
But we already have that.  :smile: Ai allies and the player's own party are tactically independant.

Ok, lemme rephrase that :razz: Multiple formations under the players command akin to what GKH is doing with his mod... so vaegir archers would form one fomration, while marksmen would form a seperate formation... o' course, it's possibly impossible :razz: But I still have hope for coordinated strikes like you showed there, under the command of the player (devs should really really really implement something what with the tactical maps and all)
I know, Iknow. I was just being a jackass while I go ahead and work on that.  :razz: You will soon be able to command independent cavalry, archer, and infantry formations to hold, charge or follow, as will the ai. There is no differentiation between units of like class as of yet.

napancux 说:
OK, some feedback.
Formations worked well for .960, morale also seems to work (but do the 'fleeing' thing means taking 2 steps backwards? I thought of something more dangerous).
Though it has some issues. If you order your troops in formation, when the battle starts, they make ranks and stuff, but when they make contact with the enemy (engage in melee - haven't tried with archers yet), the formations breaks and they just charge, as if they would in the beginning of the encounter. You can again order them to make a formation, and they make it again, but instantly after that they charge. So if enemy makes a cavalry charge before his main force arrives, you basically return back to native. Don't know how it works for the AI, though.
So I tried to order them to hold position and then proceed to formations. When my troops made the rank, they returned to the point, where I ordered to hold and assumed the vanilla hold line. But this can be solved by ordering formation follow (the M key) and then formation hold - they will make the formation where you ordered them with formation hold.

Is it something wrong with my game? Or this is how it should be?
I'm going to look at the fleeing. I'm not sure why it's so damn stubborn. The fact that infantry don't adhere too strongly to a scripted destination is nothing I can change, I'm afraid. Commands will be revamped with the next update.

oRGy 说:
Thanks for the update Mirathei. :smile:

I also changed the keys around when I integrated it - you can put select bowmen/infantry/cavalry to "2,3,4" and they seem to coexist with M&B perfectly well - I also commented out the message lines.  I also reassigned the "disassemble formation" key (U) to F9 (aka Spread Out) - seems to work great.

The only thing I'm slightly confused about is M (Follow/Hold)?  What exactly does the formationmode 0/1 do?  I have some idea - when its set to follow, the troops will follow you and not split off to engage the enemy at all... maybe its just the wording that is confusing.

Now if we could only get the AI to have sensible starting orders it would be super great. :cool:
Good ideas on the controlls. I'm going to make that default. Don't worry about the hold\follow distinction. It won't be used that way in the next update. Movement controlls will take place via the native order platform.

 
Just wanted to let you know that I've included this in the latest version of Dionisa; both Mirathei and Chel were credited.  If I missed anyone, I apologize.

Also, I added the following "help menu"; that way you don't have to remember the controls:

插入代码块:
  (0, 0, 0,
   [
    (eq, "$dmod_chel_mirathei_battle", 1),
    (key_clicked, key_h),    #H is for help
    (str_clear, s1),
    (try_begin),
        (eq, "$dmod_chel_help", 0),
        (str_store_string, s1, "@T - Infantry^Y - Bowmen^U - Cavalry^V - Movement^B - Form Ranks^N - Form Line^M - Form Wedge^Comma - Disassemble Formation^J - Display Troop Health, Coherence Information^K - Rally Your Troops^G - Call for Reinforcements"),
        (assign, "$dmod_chel_help", 1),
    (else_try),
        (str_store_string, s1, "@ "),
        (assign, "$dmod_chel_help", 0),
    (try_end),
    (tutorial_message, s1),
    ], []),

Note that this isn't quite plug and play; I modified the controls a little bit.
 
Alright, love these scripts, but there's one issue I encountered:

The "formation, hold this position" command is broken. After a certain amount of time passes, the troops break off from the formation and revert to their native commands.

"Formation, follow" works fine though.
 
Fei Dao 说:
Alright, love these scripts, but there's one issue I encountered:

The "formation, hold this position" command is broken. After a certain amount of time passes, the troops break off from the formation and revert to their native commands.

"Formation, follow" works fine though.

That's exactly what i was talking about.

But even if you order them to follow you normally, not with the "formation will follow" command, they are going to place themselves in a thin line, as they would while normally following.

Is it understandable now?
 
Hmm, I had this problem when I was working with multiple formations, but I fixed it somehow and I dont remember what I did.
 
Mirathei 说:
The fact that infantry don't adhere too strongly to a scripted destination is nothing I can change, I'm afraid. Commands will be revamped with the next update.
W00t! Great work with this scripts nevertheless.
About the morale thing. It seems not very suited for solo gameplay. When I start the battle, being injured, it begins to spam 'Your troops flee in terror' message (and I don't have any troops). Maybe add some check, disabling this messages if there's no players troops?
Also, if I kill in such solo battle one enemy, and then just hang around, my rivals begin to flee. Is it how it should be?
 
[quote author="Nikephoros"]Better explanation to be found in here:..[/quote]
Now that makes things clearer, thanks!
 
Another small bug: When soloing or when all your men are dead, the cohesion messages like "your troops are fleeing" or "your morale wavers!" still pops up, even if you don't have any men.
 
Fei Dao 说:
Alright, love these scripts, but there's one issue I encountered:

The "formation, hold this position" command is broken. After a certain amount of time passes, the troops break off from the formation and revert to their native commands.

"Formation, follow" works fine though.
Fixed it. Just use the native commands for this version, except use the mod commands to get them in\out of formation in the first place.

@all morale bugs: Also tell Chel. Some of them have been my fault (ie. troops not really fleeing) but most are ones he'd like to know about.


Changes:
Multiple formations per ai team now possible.
Holding formations no longer break inexplicably.
Multiple formations can be commanded at once, or moved by the tactics screen.
Fleeing troops actually flee.
Ranged units no longer join wedge.
Player formations can now be ordered to charge without player.


Screenie of two Swadian formations attacking a khergit wedge:
 
Is there anyway to get this without the morale script? I saw the morale script and like it very much, but I do not like the way that they go to the edge of the map and stay there.
 
Yes. Remove the morale scripts and triggers, and delete all lines containing the variables "$rout" and "$ai rout".

As a matter of fact, you could just delete the lines with those two variables, and that would do it, but your game will run smoother if you go ahead and remove all those other scripts that you don't want.

EDIT:
I'll stop being a lazy *******.  :lol:

Triggers:
插入代码块:
######Tactical triggers below##########

(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"),
        ], []),


##########Tactical triggers above########


Scripts:
插入代码块:
  ("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"),
       (assign,":leader",":teamleader"),
    (else_try),
       (call_script,"script_choose_formation_leader"),
       (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_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)]),

  ("cf_formation_stagger",
   [(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"),
       (assign,":leader",":teamleader"),
    (else_try),
       (call_script,"script_choose_formation_leader"),
       (gt,reg2,-1),
       (assign,":leader",reg2),
    (end_try),  
    (gt,":leader",-1), 
    (agent_get_position,1,":leader"),
    (position_move_x,1,100),
    (assign,":move_y",-100),
    (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_set_scripted_destination,reg(5),1),
       (position_move_x,1,100),
       (position_move_y,1,":move_y"),
       (val_mul,":move_y",-1),
    (end_try)]),

  ("cf_formation_wedge",
   [(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"),
          (assign,":fail",0),
          (try_for_range,":ranged_item","itm_jarid","itm_flintlock_pistol"),
             (agent_has_item_equipped,":teamleader",":ranged_item"),
             (assign,":fail",1),
          (end_try),
          (eq,":fail",0),
       (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"),
          (assign,":fail",0),
          (try_for_range,":ranged_item","itm_jarid","itm_flintlock_pistol"),
             (agent_has_item_equipped,":agent",":ranged_item"),
             (assign,":fail",1),
          (end_try),
          (eq,":fail",0),
          (agent_get_troop_id,":troop", ":agent"),
          (troop_get_xp, ":xp", ":troop"),
          (gt,":xp",":max_xp"),
          (assign,":max_xp",":xp"),
          (assign,reg2,":agent"),
       (end_try),
       (gt,reg2,-1),
       (assign,":leader",reg2),
    (end_try),  
    (gt,":leader",-1), 
    (agent_get_position,1,":leader"),
    (assign,":collumn",1),
    (assign,":nc",3),
    (position_move_x,1,-150),
    (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), 
          (assign,":fail",0),
          (try_for_range,":ranged_item","itm_jarid","itm_flintlock_pistol"),
             (agent_has_item_equipped,reg5,":ranged_item"),
             (assign,":fail",1),
          (end_try),
          (eq,":fail",0), 
       (agent_set_scripted_destination,reg(5),1),
       (try_begin),
          (eq,":collumn",":nc"),
          (val_mul,":nc",-150),
          (position_move_x,1,":nc"),
          (position_move_y,1,-300),
          (assign,":collumn",1),
          (val_div,":nc",-150),
          (val_add,":nc",2),
       (else_try),
          (position_move_x,1,150),
          (val_add,":collumn",1),
       (end_try),
    (end_try)]),

  ("formation_end",
   [(try_for_agents,reg(5)),
       (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_clear_scripted_mode,reg5),
     (try_end),]),

  ("choose_formation_leader",
   [(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"),
        (troop_get_xp, ":xp", ":troop"),
        (gt,":xp",":max_xp"),
        (assign,":max_xp",":xp"),
        (assign,reg2,":agent"),
    (end_try),]),
 
Do you have the code for formations by itsself? I am really dumb when it comes to code, and know that I would probably mess something up. :razz:
 
SWEET! Thanks much! Do I have you your permission to use the script in a mod of mine if I give you full credit for it?
 
Yaaaaaaaaaaaaaay Rhodoks can fight proper like now.
Time to be a teaching those swadian ponces that horses be a bad idea.
 
Thanks much! I got another problem though. :razz: Where do I find the module_scripts.py file? :razz: I cannot find it anywhere.
 
vuk 说:
Thanks much! I got another problem though. :razz: Where do I find the module_scripts.py file? :razz: I cannot find it anywhere.

Download the module system.
 
后退
顶部 底部