Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 49

Thread: spawn armies

  1. #21
    Den Stark's Avatar Tiro
    Join Date
    May 2012
    Location
    Vladivostok
    Posts
    248

    Default Re: spawn armies

    As I think, using "general" instead of "named_character"

  2. #22
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: spawn armies

    "general" is for a captain, thus you get only the unit, not a general. A general would spawn, if there was written "named character" instead

  3. #23
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: spawn armies

    Quote Originally Posted by Jadli View Post
    "general" is for a captain, thus you get only the unit, not a general. A general would spawn, if there was written "named character" instead
    Correct, the use of 'general' in scripting is misleading, CA should have used 'captain' instead - as always the first unit is the leader's bodyguard.










  4. #24
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: spawn armies

    Allright thanks ! What about the names then ? Is it the same rules as for named characters with textfiles relations ?

  5. #25
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: spawn armies

    Same rule applies










  6. #26
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    On what factors is it possible to spawn an army? Like could I script it that a rebel army appears when 'heretic' religion gets too high?

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

    Default Re: spawn armies

    All kinds of things; too many to mention.

    Like could I script it that a rebel army appears when 'heretic' religion gets too high?
    Yes, if you mean how much heretic a particular settlement has, e.g. London.

    Code:
    monitor_event CharacterTurnEnd IsRegionOneOf London_Province
      and PopulationHeretic >= 30
      and not FactionType slave
    
      ;spawn somewhere in London region
    
    terminate_monitor
    end_monitor
    terminate_monitor ensures that it only happens once.

  8. #28
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    Well I tried to do it but for some reason it isn't working. Here's what I did:


    Code:
    monitor_event CharacterTurnEnd IsRegionOneOf Carpenter_Wall
      and PopulationHeretic >= 10
      and not FactionType normans
    
            spawn_army 
                faction normans
                character    Rei, general, age 26, x 46, y 151
                unit        Cultist Fanatics        exp 6 armour 0 weapon_lvl 0
            end
    
    terminate_monitor
    end_monitor

    The province started with 20 heretic. I ended turn a few times and nothing occured. Am I missing something?

  9. #29
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    Should I declare counters first at the top of the script?

  10. #30
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: spawn armies

    You need to physically place them before they are used. Common use is to place them just before the monitors where they are used:

    declare_counter 1
    declare_counter 2
    declare_counter 3
    declare_counter 4

    monitor_event with reference to the above counters










  11. #31
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    I'm sorry, I'm still confused about how to do this.
    I put the "declare counter" for one province to try it out. How exactly do I activate it by monitoring? Is there a past example of how it is done? So I could simply copy the template.

    Is there a tutorial for the campaign script somewhere? I'd rather try to read that instead of keep necro-ing this thread.

  12. #32
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: spawn armies

    Did you have a look at the docudemon ? It is the bible of coding !

    And once the topic has been necro-ed, it is not old anymore

  13. #33
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: spawn armies

    IsRegionOneOf requires the regions ID number, not the name. You can get the ID by using the show_cursorstat console command. Also disable the religion line to test the functionality otherwise. Unless you terminate the monitor after the first use, or use random name for the character, you will ask for errors.










  14. #34

    Default Re: spawn armies

    Quote Originally Posted by Gigantus View Post
    IsRegionOneOf requires the regions ID number, not the name. You can get the ID by using the show_cursorstat console command. Also disable the religion line to test the functionality otherwise. Unless you terminate the monitor after the first use, or use random name for the character, you will ask for errors.
    Or the data name, if you're in the campaign_script (but not elsewhere), ie region_nnn. That's a much more reliable choice than the region ID (which is just a number), since it never changes.

  15. #35
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    Well the region code didnt seem to work for me, but this formula did:

    Code:
    monitor_event SettlementTurnStart SettlementName CB4_Kaiu_Shiro
        spawn_army 
                faction normans
                character Amir of Cairo, general, age 26, x 46, y 151,
                unit    Cultist Fanatics        exp 6 armour 0 weapon_lvl 0
            end
            terminate_monitor
    end_monitor
    So now an army is at least created.
    But when I add "and PopulationHeretic >= 10" the script no longer works.

  16. #36
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: spawn armies

    The settlement event does not export the required info for that condition, only a character event does. The docu demons help you to determine what event you need for which condition.

    I just used this monitor in the default campaign after setting Nottingham to 20% heretic and it worked without a hitch. I used 'moors' as the normans are not present.
    Code:
    monitor_event CharacterTurnEnd IsRegionOneOf Nottingham_Province
      and PopulationHeretic >= 10
      and not FactionType moors
                    spawn_army
                        faction france
                        character    random_name, named character, age 37, x 102, y 154
                        unit[TAB]Scots Guard[TAB]exp 2 armour 0 weapon_lvl 0
                    end
    
      terminate_monitor
    end_monitor
    Initially I couldn't get it to work as I copied the code from your example - and copying TAB here doesn't get preserved, it gets replaced with SPACE, see the blue entries. Once I realized that and restored the TAB entries everything worked fine.
    Last edited by Gigantus; June 05, 2017 at 08:02 AM.










  17. #37
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    Nothing.
    With the "CharacterTurnEnd IsRegionOneOf", nothing happens at all.

    This is it now
    Code:
    monitor_event CharacterTurnEnd IsRegionOneOf Carpenter_Wall
            spawn_army 
                faction normans
                character random_name, general, age 26, x 46, y 151
                unit    Cultist Fanatics    exp 6 armour 0 weapon_lvl 0
            end
            terminate_monitor
    end_monitor
    I made sure there were tabs in the needed spaces. Are there supposed to be more? Such as between "CharacterTurnEnd" and "IsRegionOneOf"?

    Am I missing anything? Like other text or another file to edit along with this? The Docudemon only shows the most basic template. Im having trouble understanding how to read it. My problem, I know.

  18. #38
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    The entire script works now, except for that entry. Previously adding the entry would stop the whole script.

  19. #39
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: spawn armies

    Is the faction (normans) listed in the descr_strat file? Are you using the correct definition? It has to be the region's name, not the settlement's, check the spelling in descr_regions (weirder stuff has happened then a misspell) . And it will happen after you press turn end. And you obviously need a character in that region.










  20. #40
    Civis
    Join Date
    Aug 2009
    Location
    Always temporary.
    Posts
    186

    Default Re: spawn armies

    Ah... what kind of character is needed? In the settlement? Or in the region?

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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