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

SonKidd

Knight
Best answers
0
From what I see from the video, the features are amazing :smile:. Hope I find some free time to test it out soon!
 

Windyplains

Grandmaster Knight
WB
Best answers
0
The new video looks great.  I'll have to update the workshop to use the newest version and give it a test run.  I especially like how the formations in the video (the swadian one) are using weapons appropriate to their position in the formation.  Very nicely implemented.
 

Lumos

Section Moderator
WBWF&SNWM&BVC
Best answers
0
Motomataru, I'm having a problem at compile time. It says it can't find "script_get_nearest_enemy_battlegroup_current_position". Such a script does not exist in my formations_scripts_wb file. Any leads on this, please?
There exists a "get_nearest_enemy_battlegroup_location" in formAI_scripts, but is that the needed one with a different name?

EDIT: Turns out it was PBOD-related; I hope that get_..._location is the same, because I replaced the error-making calls with it.
 

motomataru

Squire
M&BWBVC
Best answers
0
Ah, you figured it out. Yeah, originally my code did not supply a rotation with current division position. Caba'drin wrote a version of the function which copied rotation from the division destination. Seeing that, I rewrote the base location function to report the average rotation of troops in the division (for lack of a better alternative). I don't think I reported all this in the changes log.

I think your substitution ought to be good: just check the arguments and return value checking (if any).
 

motomataru

Squire
M&BWBVC
Best answers
0
Compiled Native version (finally) updated:
http://mountandblade.nexusmods.com/mods/2475

Murat ÖZCAN said:
How can I apply this to Warband 1.153 or 1.143?I couldn't use .py files :sad: If you could apply this to 1.153 or 1.143,plz give me the necessary files.PLZ... :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad:
 

dunde

Count
WB
Best answers
0
Motomataru, I use your party AI tweak. I can't find thread about it at TW, so I ask my question here. What's party initiative do? I can't figure it out from the MS.
 

MadVader

Duke
M&BWB
Best answers
0
As far as I can tell from the MS, it determines how likely will parties pursue opportunity targets instead of continuing with their current AI state. The number may be a formula calculated from the distance, strength ratio and speed difference with the enemy party. At least that makes most sense. :smile:
 

motomataru

Squire
M&BWBVC
Best answers
0
I actually haven't a clue. The numbers are used by three Native operations at the end of script_set_ai_state:

      (party_set_aggressiveness, ":party_no", ":aggressiveness"),
      (party_set_courage, ":party_no", ":courage"),
      (party_set_ai_initiative, ":party_no", ":initiative"),

Like MadVader, I took my best guesses:

Aggressiveness: willingness of party to attack. I imagine TW put this in because if you recall in early versions of M&B parties would chase after every wandering farmer, so general offensives would get nowhere.

Courage: willingness of party to defend.

Initiative: readiness of party to do anything. I made some general rules:

Party attacking enemy: initiative 100.
Party default: initiative 80.
Party just following marshal or occupying/patrolling own center: initiative 50.
Party dug in at siege: initiative 20.
Marshal gathering army: initiative 10 (Native)

This last is why I appoint a screening party even when marshal is just gathering.
EDIT: The low siege number is why besieging parties do not run off when defensive relief arrives.
 

dunde

Count
WB
Best answers
0
Thanks for both answers. So, lower initiative point will make the party's leader has more chance to continue his objective without changing his mind in the middle, won't it?

I ask it, because after I implement Moto's tweak, my tournaments attract fewer heroes to join than before. They just come back to their centers in the way to tournament's town because a treat on their villages. I like it, it's more realistic, but I want some bad heroes will neglect the villagers life to look after the glory of tournament.
 

La Grandmaster

Sergeant Knight at Arms
Best answers
0
Im trying to code in the formations osp code by mirathei into a warband mod - iv used the most simple version of the code i could find and to the best of my knowledge i've put it into the game perfectly.

It does seem to work ingame however when i play ingame i get a division by 0 error everytime the trigger fires (every 5 seconds). Iv looked over the code and there are only two sections which contain a division operation (ingame i recieve two different division by 0 errors so im assuming its these two sections which are causing the problems). Here is the first example (the second is almost identical so i wont post it.

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

i cannot understand why it is a division by 0 because surely
        (try_begin),
            (eq,":class",grc_cavalry),
            (val_add,":cavalry",1),
        (else_try),
            (val_add,":infantry",1),
        (end_try),
      (end_try),

sets the values to 1?  Is there something wrong with this section or is it something i've done?

If im honest im not really 100% sure what this section does, im assuiming its something to do with unmounting riders/ mounting unmounted riders. Do i even need it? could i just get rid of it?
 

motomataru

Squire
M&BWBVC
Best answers
0
La Grandmaster said:
If im honest im not really 100% sure what this section does, im assuiming its something to do with unmounting riders/ mounting unmounted riders. Do i even need it? could i just get rid of it?
It dismounts everyone if there are less than 10 cavalry and infantry outnumber cavalry by more than 2 to 1, and mounts everyone otherwise.

You'll get a div-by-zero any time no agent satisfies all the conditions leading to the (val_add,":cavalry",1) statement. For instance, whenever there are no cavalry. I usually solve such problems by adding a condition to make sure the divisor is not zero before the division statement. A good place would be right after the (gt,":enemy",-1) test.
 

motomataru

Squire
M&BWBVC
Best answers
0
I believe the compiled version is save compatible with Native. You would just need to copy the savegame from the Native subdirectory to the new subdirectory (whatever you call it).
 

Soulbourne

Recruit
Best answers
0
Out of curiosity, is there any way to get the code to just patch in the target enemy division?  I'm trying to find some code for it just to slip it into my TEATRC copy, mostly so I can have more precise command over Swadian cavalry.
 

motomataru

Squire
M&BWBVC
Best answers
0
Um, basically, no. You'd have to splice the two source codes together. Even just adding my formations_*.py and turning off my formations in game I don't think will work, because TEATRC seems to have its own division disposition system, which would conflict with mine.

Soulbourne said:
Out of curiosity, is there any way to get the code to just patch in the target enemy division?  I'm trying to find some code for it just to slip it into my TEATRC copy, mostly so I can have more precise command over Swadian cavalry.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
motomataru said:
Um, basically, no. You'd have to splice the two source codes together. Even just adding my formations_*.py and turning off my formations in game I don't think will work, because TEATRC seems to have its own division disposition system, which would conflict with mine.

Soulbourne said:
Out of curiosity, is there any way to get the code to just patch in the target enemy division?  I'm trying to find some code for it just to slip it into my TEATRC copy, mostly so I can have more precise command over Swadian cavalry.
It's really just making agents with certain troop slots line up along the team leader agent, which is either the player or a banner-bearer. There's also some morale magic and agent division reassignment when mounted/dismounted. I have no idea what you mean by "target enemy division" though. Getting cav to stay closer and making them hold position on the other side of the enemy seems to work fine for me.
 

motomataru

Squire
M&BWBVC
Best answers
0
I extended Hold-F1 so that, if the player has selected one division and clicks on an enemy division, the player division will attack it and then return to the player after destroying it. Someone could tack this on to the TEATRC source, except that I put in ANOTHER feature that allows the player to permanently memorize relative division positions for Hold and Follow. It seems TEATRC has a prebattle division positioning system, so these would conflict unless a coder went in and disabled one or the other.

EDIT: see demo at http://www.youtube.com/watch?v=WmA-IxNASVE

Somebody said:
I have no idea what you mean by "target enemy division" though. Getting cav to stay closer and making them hold position on the other side of the enemy seems to work fine for me.
 

koteko

Sergeant at Arms
WBVC
Best answers
0
I tried to integrate the old script from the first post into my own Warband 1.153+Diplomacy mod, but, even with little fixes ($g_battle_won instead of $battle_won for example), as soon as I "lead the charge" the game crashes with an opcode error.

Was it made for the original M&B? Is there a version for Warband so I won't have to include the biggest mod made by motomataru?

Thanks :smile: