Results 1 to 6 of 6

Thread: Besieged Settlement Script question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Besieged Settlement Script question

    I want to make a besieged settlement to be able to recruit specific units (peasant levies for example), is that possible?

    Also, another question, is this possible to make a script that, a besieged settlement could surrender through a Yes/No Event and his army would leave? If the besieged force is too small, the script would happen.

    Regards.
    Last edited by Polycarpe; February 23, 2012 at 07:21 PM.

  2. #2

    Default Re: Besieged Settlement Script question

    That would be quite handy, and you could justify it by recruiting directly from your cities population. It doesn't make sense that you cannot recruit even militia while under siege, since Militia are essentially drafted peasants.


    I've always wanted to remove the "Attrition" effect of sieges. Would you happen to know anything about that Poly ?
    Signature by Lucarius.

  3. #3

    Icon1 Re: Besieged Settlement Script question

    Polycarpe: No, you need to use a script to place units in a besieged settlement. The ‘capture_settlement’ command will evict an AI faction from a settlement and give it to the local faction (human player);
    Spoiler Alert, click show to read: 
    Code:
    capture_settlement 
    Availability:  campaign 
    Usage:  capture_settlement <settlement name> : evicts any resident characters and armies and gives the settlement to the local player
    Code:
    console_command capture_settlement Shire

  4. #4
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: Besieged Settlement Script question

    Quote Originally Posted by TNZ View Post
    Polycarpe: No, you need to use a script to place units in a besieged settlement. The ‘capture_settlement’ command will evict an AI faction from a settlement and give it to the local faction (human player);
    Spoiler Alert, click show to read: 
    Code:
    capture_settlement 
    Availability:  campaign 
    Usage:  capture_settlement <settlement name> : evicts any resident characters and armies and gives the settlement to the local player
    Code:
    console_command capture_settlement Shire
    Again TNZ, you help me once again, +rep.

  5. #5
    Lazy's Avatar Biarchus
    Join Date
    Jul 2011
    Location
    Aachen
    Posts
    661

    Default Re: Besieged Settlement Script question

    You can write a script that makes it look like you have recruited a unit...

    You need a counter/event that happens when a settlement is besieged.

    monitor_event SettlementBesieged ( this is spelled wrong but I know it exists in the docudemons )
    Condition SettlementName bla ( it could have been I_SettlementName too )
    set_counter bla 1
    end_monitor

    Then in EDB ( as this event is true ) the ubnit starts to be recruitable...

    some unit 0000 { some faction } and event_counter bla 1

    Then you can add this unit into the queue, of course it will not be build but you can create a monitor at FactionTurnsStart that checks if that unit is inside the ques and let it be spawned via script!

    Now you only have to find out if you can remove this unit from the queue to prevent it beeing built the turn after the siege... but the AI will never use it!
    Quote Originally Posted by SirWarts View Post
    ...the woman trampled didn't look impenetrable. So they ran through her.

  6. #6
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Besieged Settlement Script question

    Nice one Lazy. It would need to be set_event_counter though.

    I gather that the AddedToTrainingQueue is the signal that it has been added to queue? Script could possibly spawn the unit as soon as that happens rather than during a FactionTurnStart/End.

    Once the siege is over - if there is another monitor tracking that and in turn unsetting the counter - then the unit is no longer recruitable. This should remove it from the queue automatically I think.

Posting Permissions

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