Results 1 to 2 of 2

Thread: Is there a condition I can use to recognize if a general's bodyguard unit is infantry or cavalry?

  1. #1

    Default Is there a condition I can use to recognize if a general's bodyguard unit is infantry or cavalry?

    Is there a condition I can use to make the game recognize if a general's bodyguard unit is infantry or cavalry? What I want to do is to make a trait so that when I switch my bodyguard units to infantry, they will get a hidden trait. This trait will then give them a higher bodyguard number by using Effect BodyguardSize 1 etc. Here is an example: My general is a heavy cavalry unit with 10 men (2.5*4, the lowest possible number). I use the bodyguard switcher mod by Withwnar (which I have made changes to) and change this to a unit of heavy infantry. The logic here is that knights were payed 24d per day and infantry (armoured men) were payed 6d per day. Therefore the general has 40 heavy infantry because they only cost 1/4 the price of a knight and the general can afford more men as a result. In my submod I control the number of men in a general's unit with ancillaries. These ancillaries represent lordships and each lordship give the general 3*2.5 bodyguards. The problem here is that a lordship will increase a heavy cavalry unit's number of men by 8, but an infantry unit should in theory get 4 times as many men if we use payment as the logic here. So, is there a condition I can use to make the game recognize if a general's bodyguard unit is infantry?

    I have been searching through the files of Stainless steel to see if there are any and these are the only ones I have found, but they doesn't solve my problems though.

    and PercentageUnitAttribute general_unit >= 10

    and PercentageUnitCategory infantry > 75

    Isn't there a way to make the game recognize the actual unit's name?
    "Alea iacta est"

  2. #2

    Default Re: Is there a condition I can use to recognize if a general's bodyguard unit is infantry or cavalry?

    You can, of course, assign a custom attribute to these infantry bodyguard units and use PercentageUnitAttribute > 0 with whatever event you want to get confirmation that an unknown character (name/label not specified) has the unit in their army and then assign the trait in script or an EDCT trigger if so. This will return a false positive if, for whatever reason, there is such a unit in their army but it isn't their bodyguard (two generals in one army).

    It seems like the simplest solution is to just add the BodyguardSize trait directly in the BG switcher script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •