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

Users who are viewing this thread

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.
 
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.
 
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).
 
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:
 
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.
 
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.
 
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?
 
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.
 
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.
 
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.
 
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.
 
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.
 
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:
 
Back
Top Bottom