Results 1 to 7 of 7

Thread: Coding generals to command a certain number of units

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    MathiasOfAthens's Avatar Comes Rei Militaris
    Join Date
    Nov 2006
    Location
    Stockholm, Sverige
    Posts
    22,877

    Default Coding generals to command a certain number of units

    Is it possible to write some sort of code that limits a commander to a certain number of units. Say if his command level is low he can only command 5 units. If it rises he can command 10, etc.

  2. #2
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Coding generals to command a certain number of units

    no
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  3. #3
    MathiasOfAthens's Avatar Comes Rei Militaris
    Join Date
    Nov 2006
    Location
    Stockholm, Sverige
    Posts
    22,877

    Default Re: Coding generals to command a certain number of units

    Yeah I didnt think so. Damn that would be so cool if you could.

    What about writing code to make the more units a army has the higher the upkeep or costs to maintain? Anything?

  4. #4

    Default Re: Coding generals to command a certain number of units

    How about this limited variance:

    Add traits whose triggers check for example command points and a certain percentage of bodyguard units.
    That trait would decrease the morale of the army because the soldiers wouldn't think the general is capable of leading so big an army and would more easily rout.

    Example (for export_descr_character_traits.txt):
    Spoiler Alert, click show to read: 
    ;;; Place this at the beginning of the file
    Trait InsufficientLeadership
    Characters family

    Level Leadership_insufficient
    Description Leadership_insufficient_desc
    EffectsDescription Leadership_insufficient_effects_desc
    Threshold 1

    Effect TroopMorale -2

    ;;;Place this at the end of the file
    Trigger General_not_capable_enough_1
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and PercentageUnitAttribute general_unit > 5
    and Attribute Command < 5
    and Trait InsufficientLeadership <> 1

    Affects InsufficientLeadership 1 Chance 100


    This particular example should decrease the overall morale of the army by one if the general has only 4 or less command stars and there are more than 9 unit in the generals army at the start of the turn (asuming that the generals bodyguard has about half as many units as a normal unit and that all units are full, adjust to your liking).

    Not tested, cannot guarantee for anything...
    Last edited by Bungo Baggins; November 04, 2011 at 09:15 PM.

  5. #5
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Coding generals to command a certain number of units

    Quote Originally Posted by Bungo Baggins View Post
    Not tested, cannot guarantee for anything...
    I can see it wouldn't work without testing it. We have to use conditions with requirements exported by the event.

  6. #6

    Default Re: Coding generals to command a certain number of units

    Thank you for mentioning it, I took the original idea to check the general_unit attribute from your post...

  7. #7
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Coding generals to command a certain number of units

    lol OK, so the new me is stupid and the previous me knew what he was talking about.
    For some reason I thought PercentageUnitAttribute required the army to be exported from the event

    Your trait looks totally fine to me now...
    Last edited by Taiji; November 05, 2011 at 06:17 AM.

Posting Permissions

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