Page 3 of 3 FirstFirst 123
Results 41 to 56 of 56

Thread: Creating Localised Re-Emerging Factions without using the Horde Ability

  1. #41
    Lifthrasir's Avatar A Clockwork Orange
    Content Staff Moderation Mentor

    Join Date
    Jan 2010
    Location
    Dunkirk - France
    Posts
    11,832
    Blog Entries
    4

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    We're using this script to let factions to re-emerge in SSHIP. However, even if it works as intended, sometimes the faction re-emerges in weird locations, like cumans in South of France f.e.
    In the OP, it says:
    1. The settlement the faction is re-emerged from is not garunteed as the public order decreasing building only makes it go so far down and if the player has another settlement with PO that is 0 then it could lead to problems.
    Looking at the post above, I'm wondering it the script proposed by QuintusSertorius allow the re-emerging feature in specific places or areas? That would make it far more realistic actually
    Note that I'm a complete nood for scripting Very simple explanations are needed
    Many thanks in advance.
    Last edited by Lifthrasir; October 28, 2019 at 09:41 AM. Reason: typo
    Under the patronage of Flinn, proud patron of Jadli, of the Imperial House of Hader



    Polls up. Vote for your favourites.

  2. #42

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    Can someone please explain the purpose of using the faction_emerge command? It seems like everyone in this thread wants to emerge the faction at a specific settlement but can't because the faction_emerge command only emerges the army at the settlement with lowest public order. So why not just... spawn an army and attack the specific settlement?

    You can use all the same conditions, CityRiot, etc., for the emergence. You can use historic_event to display a message for the emergence. You can even randomly decide which settlement to emerge at. All a non-horde faction needs is a general (who automatically becomes a family member) and a settlement by the time their turn starts. As long as they have those things, they're happy.

    Please enlighten me - what is superior about using faction_emerge?

  3. #43
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,447
    Blog Entries
    24

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    The RE in the 're-emerging faction' is the crux. It's about non horde factions that got defeated previously and that now get brought back into the game.

    Being defeated means that they have got nothing (your comment: 'all they need...a settlement'). The re-emerging process gives them that settlement(s), remember the baron's alliance spawning?

    I do however remember that Warhammer had a faction (the beastmen?) that got spawned directly. Got very irritating after a while as the scripting options are limited to that faction (the above works with any defeated faction) and co-ordinates. I think it's achieved by the 'dead_until_emerged' (or 'dead_until_resurrected'?) setting in descr_strat without a corresponding horde setting.
    This way of spawning obviously will not give them a settlement and that's where the irritating element comes into play. Unless you script a autowin siege right after the spawn that will really put off players.
    Last edited by Gigantus; November 03, 2019 at 05:54 AM.



  4. #44

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    Spawn_army will absolutely 're-emerge' a previously defeated faction. If the spawned army captures the target settlement, the faction will emerge. If you want, you can use auto-win to ensure the settlement is captured or perhaps only auto-win if the settlement is AI controlled. Or don't auto-win and only emerge if the spawned army wins the battle.

    I do remember the Baron's Alliance script in Britannia. CA must have wanted the barons to emerge at the settlement with lowest public order. But it seems everyone in this thread is going to lengths to circumvent that behavior and get the faction to emerge at a specific location instead. Even with buildings and public order commands it's still not guaranteed and in fact not even likely to work for localized settlements (based on what has been said about SSHIP, etc.). So why not use spawn_army?

    I don't know what script they were using in the Warhammer mod but the simple spawn_army script I'm talking about is not limited to a single faction any more than the faction_emerge script in the OP. In fact, a spawn_army script is significantly shorter and simpler. Using spawn_army does not require dead_until_emerged or anything else special in DS or horde tags in descr_sm_factions. You can use completely run of the mill DS and descr_sm_factions tags for the faction and they will emerge normally using spawn_army + capture settlement. Yes, the spawned army will need to capture a settlement before their turn or the faction won't survive (army goes rebel) but I don't see how that would put off players any more than the faction_emerge script where there isn't even a chance for a battle and the region is just given to the emerged faction outright.

    Here is a test script to demonstrate what I mean by spawn_army + capture settlement.

    Code:
        declare_counter t_presses
        
        monitor_event ShortcutTriggered ShortcutTriggered strat_ui test_button            ;SHIFT + T shortcut to test effects
            
            if I_CompareCounter t_presses == 1
                spawn_army
                    faction milan
                    character    random_name, named character, age 26, x 250, y 249, direction W, label rohan_reemergence_1
                    traits        GoodManRace 1
                    unit        Rohan Royal Spearmen                exp 4 armour 0 weapon_lvl 1
                    unit        Rohan Riders                        exp 2 armour 0 weapon_lvl 1
                    unit        Rohan Medium Spearmen                exp 1 armour 0 weapon_lvl 0
                    unit        Rohan Militia Archers                exp 0 armour 0 weapon_lvl 0
                    unit        Rohan Riders                        exp 2 armour 0 weapon_lvl 1
                    unit        Rohan Medium Spearmen                exp 1 armour 0 weapon_lvl 0
                    unit        Rohan Militia Archers                exp 0 armour 0 weapon_lvl 0
                    unit        Rohan Riders                        exp 2 armour 0 weapon_lvl 1
                    unit        Rohan Medium Spearmen                exp 1 armour 0 weapon_lvl 0
                    unit        Rohan Militia Archers                exp 0 armour 0 weapon_lvl 0
                    unit        Rohan Riders                        exp 2 armour 0 weapon_lvl 1
                    unit        Rohan Medium Spearmen                exp 1 armour 0 weapon_lvl 0
                    unit        Rohan Militia Archers                exp 0 armour 0 weapon_lvl 0
                    unit        Rohan Riders                        exp 2 armour 0 weapon_lvl 1
                    unit        Rohan Medium Spearmen                exp 1 armour 0 weapon_lvl 0
                    unit        Rohan Militia Archers                exp 0 armour 0 weapon_lvl 0
                    unit        Westron Catapult                    exp 0 armour 0 weapon_lvl 0
                end
                console_command auto_win attacker
                siege_settlement rohan_reemergence_1, Kings_Land, attack
                terminate_monitor
            end_if
            if I_CompareCounter t_presses == 0
                inc_counter t_presses 1
                console_command surrender_regions milan
            end_if
            
        end_monitor
    As you can see, the first time the shortcut is triggered, the faction is destroyed using surrender_regions. This is confirmed by the "Faction Destroyed" message and the rankings scroll showing all stats go to 0. Then, an arbitrary number of turns later, I can use the shortcut a second time to re-emerge the faction with spawn_army + capture settlement. The character does not need a specific name. The character does not need to be a family member (he will become one, as well as faction leader, when he spawns). The stats in the faction rankings scroll will jump up again from 0 and the faction will be very much alive henceforth. The emerged faction's AI works normally. The emerged faction retains all of the diplomacy it had before it was killed (although our mod has a script that sets all diplomacy to neutral when any faction dies to fix the dead faction diplomacy bug).

    Here are the DS tags for this faction.

    Code:
    faction    milan, balanced genghis
    ai_label default
    denari            10000
    denari_kings_purse    1000
    Nothing out of the ordinary. Here is the descr_sm_factions entry.

    Code:
    faction                        milan
    culture                        northern_european
    religion                    northmen
    symbol                        models_strat/symbol_milan.CAS
    rebel_symbol                models_strat/symbol_rebels.CAS
    primary_colour                red 80, green 62, blue 0
    secondary_colour            red 193, green 193, blue 118
    loading_logo                loading_screen/symbols/symbol128_milan.tga
    standard_index                11
    logo_index                    FACTION_LOGO_MILAN
    small_logo_index            SMALL_FACTION_LOGO_MILAN
    triumph_value                5
    custom_battle_availability    yes
    can_sap                        no
    prefers_naval_invasions        no
    can_have_princess            no
    has_family_tree                yes
    Not a horde. So, given that this faction emerges at a settlement of our choice without issue, what am I missing? Is there something in our mod that makes this work but isn't present in other mods? Or is there some other reason to use faction_emerge?

  5. #45
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,447
    Blog Entries
    24

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    Interesting find, wonder what changed, was under the opinion that respawning a dead faction required fancy footwork. This certainly makes things easier - just need to use a reliable way to test if a faction is really dead if it is a horde, else it's easy, and find a suitable condition.



  6. #46

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    For our dead faction diplomacy script, we use:

    Code:
    if I_FactionLeaderAttribute faction_name Command < 999
    to test if a faction is alive. I don't remember where we got this condition from but we did not invent it. If this condition returns false, then the faction is dead even if it's a horde. Indeed, you can use whatever conditions you want to emerge the faction and you can emerge them at whatever settlement you want and the player can fight the emergence by fighting the battle if they happen to own the settlement in question.

    I am 100% certain that our mod team did not discover the spawn_army + capture region method for emerging non-horde factions. In fact, I seem to recall someone mention it in passing here on TWC. I suppose this means there is no advantage to using the faction_emerge command unless you want to replicate the behavior in the Britannia campaign where the faction emerges more organically at the settlement with lowest public order.

    We are currently using the spawn_army + capture settlement method to revive dead factions in our mod and the only issue so far has been that the "Faction Leader Dies" message pops up when the faction is reemerged. I haven't found a way to fix that yet. It is curious that it pops up at all.

  7. #47
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,447
    Blog Entries
    24

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    The attribute check originates with withnwar I think, I vaguely remember having had some discussion with him on it.

    Maybe you can get rid of the "Faction Leader Dies" message by giving the faction one of the two 'emerging' descr_strat settings? Or give the spawning character right away the faction leader attribute?



  8. #48

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    Quote Originally Posted by Gigantus View Post
    The attribute check originates with withnwar
    I have no trouble believing it.

    I don't know how you would make a character a faction leader via script, but since the spawned army has the only general who exists for the faction he automatically becomes the faction leader. In my last test, I tried giving him the 'family' attribute and now I get two instances of "leader dies" when surrendering regions and another instance at the start of the next turn but I don't get the message when reviving the faction. This suggests it's an artifact my test method for killing the faction and not a problem in general.

  9. #49
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,447
    Blog Entries
    24

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    You spawn the character with the 'leader' entry, just like in descr_strat. My thought being that because the faction has existed previously spawning a character that has to become the leader by default requires for the old one to die. Now if he gets spawned already as leader that 'dying' might not happen.

    When surrendering regions you should at least get one 'dying' message, after all you are killing off all characters.



  10. #50
    Lifthrasir's Avatar A Clockwork Orange
    Content Staff Moderation Mentor

    Join Date
    Jan 2010
    Location
    Dunkirk - France
    Posts
    11,832
    Blog Entries
    4

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    That's really a nice 'trick' actually. Well done
    How this spawn feature works? I mean, how does it happen?
    Last edited by Lifthrasir; November 04, 2019 at 07:15 AM. Reason: typo
    Under the patronage of Flinn, proud patron of Jadli, of the Imperial House of Hader



    Polls up. Vote for your favourites.

  11. #51

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    @Lifthrasir - As mentioned, all a non-horde faction needs is one general and one region. If they're missing either of those things by their turn, the faction will not survive. So you simply spawn in an army (general) belonging to the dead faction and get him to attack a settlement. If he takes the settlement then the faction will survive their turn and henceforth be revived. The 'trick' is just realizing that the game will let you spawn an army from a dead faction. I posted a test script above, you can use the same effects with whatever conditions you want for the (re)emergence.

    @Gigantus - I didn't know 'leader' and 'heir' worked in CS.

  12. #52
    Lifthrasir's Avatar A Clockwork Orange
    Content Staff Moderation Mentor

    Join Date
    Jan 2010
    Location
    Dunkirk - France
    Posts
    11,832
    Blog Entries
    4

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    So if I got it right, you can spawn an dead faction army in a specific region, preferably close to a settlement, to let it besieging the settlement and taking it, all in 1 turn. Beside, a condition like a certain level of unrest f.e. can be associated. Very interesting Thanks a lot
    Under the patronage of Flinn, proud patron of Jadli, of the Imperial House of Hader



    Polls up. Vote for your favourites.

  13. #53

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    No, the entry "leader" and "heir" doesn't work in spawn_army of campaign script.

    I've tested it, the compiler will simply return a syntax error: https://www.twcenter.net/forums/show...1#post15843419

  14. #54
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,447
    Blog Entries
    24

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    Good to know, I reckon your finding that the heir will be only appointed in the next turn may relate to the messages Callistonian was getting. then my remaining hope would be that using 'family' could be of help.



  15. #55

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    Right, I tried with 'family' as mentioned above and it did get rid of the "Leader Dies" message when the faction is re-emerged. But I still get spammed with "Leader Dies" messages when the faction is killed. This is because of the artificial way I'm killing them with surrender_regions. The game is somehow killing the leader candidates in order and therefore giving multiple messages. I've tested killing the faction "normally" (by conquest) instead of surrender_regions and the "Leader Dead" spam isn't a problem.

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

    Default Re: Creating Localised Re-Emerging Factions without using the Horde Ability

    How about this instead of surrender_regions...

    retire_characters {faction} named_character

Page 3 of 3 FirstFirst 123

Posting Permissions

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