Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: Expanding missions questions

  1. #1
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Expanding missions questions

    I have been poking into descr_missions for a long time to figure out what can I do with it for my TES UP modification. I wanted to get rid of the "council of nobles" quests and add more guild quests, which definitely seems doable. Though, I wanted to mainly focus it against rebel/undead/deadric armies (via Fighters/Mages guilds mainly).

    From what I have found, it is for sure possible to allow certain missions to only some factions, and target it only at certain religions/factions, so not bad.

    But my ultimate idea was, that I would have several various rebel/daedric/undead armies being randomly spawned and roaming around the land, and also possibly stationed in permanent forts (which would represent "dungeons" etc), and that the missions would target them. I believe by the mechanics it is not possible, but I will ask anyway. Is it possible to do it, so that the mission would be for example killing an enemy general in battle (I know there is missions to assassinate), or anything like that? As I of course would rather save settlements to be be settlements and dunegons...

    In case it is not, I assume scripting comes in play. I think doing it via scripts would be possible, right? Though of course it wouldnt be using missions mechanics, but just pop up scrolls on players turn...

    And I know finishing missions can be connected to scripts, triggers via paybacks etc, but can it be done the other way? Such as, that a script would initiate mission? In the list of cheats there are some cheats to create missions, could that be used?

    And also, have someone figured out a way to have more missions in the same time (except papal missions)?

    Thanks for help!

    (BTW, I have read "A guide for missions" from DarkKnight)
    Last edited by Jadli; April 04, 2020 at 08:00 AM.

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    If you don't know the target's name\label then you can't script a mission. Comparable to the kill_character command.

    Which means you can only target 'once off' scripted spawns as those leaders (need to be named characters) can be given labels.

    I do seem to remember that the teutonic 'noble' missions were somehow linked to the script as the character required spawning before he could be given the mission, check the 'crusading noble' set up in the script versus the descr_mission entries to check how it is linked.

    Edit: here is how the missions got triggered via script (mission, mission faction, target name), memories come back from designing an assassin mission on king Adolf of Sweden in my 1648 mod, used the kill_crusader mission as template.

    Code:
            create_mission adventure_crusader teutonic_order crus1
            create_mission kill_crusader lithuania crus1
    Edit2: found some code I had written for 1648 with the goal to assassinate random catholic generals based on religion and piety level by protestant factions, should come handy for your purpose. The supporting\explanatory text is in German but google should be able to handle that
    I think it's based on one of the assassination missions from the teutonic campaign. Can't find the code for the Adolf assassination.

    Tip: using an unusual combination of attribute and\or level and giving corresponding hidden traits to the victims should work just fine.

    Code:
    ;=== Beispiel einer automatischen "Kill" Mission fuer protestantische Reichsfraktionen, Ziel: General der katholischen Liga
    
    mission    assassinate_general prot_assassinate_cath_general ;Protestanten Anschlag auf katholischen General
    {
        ORDER_COUNCIL_MISSION
        duration 30                ; Dauer der Mission
        exclude_duration 45            ; Haeufigkeit dieser Mission
        score_modifier 1.2
        difficulty_threshold 0.4        ; Erfolgsrate fuer Meuchelmord muss groesser sein als 40%
    ;    difficult_turn_start    0
    ;    turn_start            0
        factions { russia, turks, moors, sicily, scotland, byzantium, }    ; Alle protestantischen Reichs Fraktionen koennen diesen Auftrag bekommen
        paybacks
        {
        random 0.33    payback_id council_mod_income
        random 0.5    payback_id council_mod_unit
                payback_id council_mod_unit_best
        }
       
        enemy_modifier    30.0
        own_region_modifier    50.0
        per_unit_modifier    4.0
        character_type    named_character    ; Character Type
        attribute_type    Piety        ; Eigenschaft des Opfers
        attribute_min_threshold    4    ; Mindestniveau der Eigenschaft
        target_religion    catholic    ; Ziel Religion (katholisch)
        target_faction    milan        ; Ziel Fraktion (Katholische Liga )
        killed_by_any_means            ; auf jede erdenkliche Weise toeten, entfernen wenn nur Meuchelmord gewuenscht
        expire_on_hide_disabled        ; verstecken des Opfers macht Mission nicht ungueltig
    }
    
    ;=== data\text\missions: ===
    
    {prot_assassinate_cath_general_EXPIRY_ALLIED}Dieser Mann ist zu unserem Verbündeten geworden. Es ist nicht mehr erforderlich, ihn zu beseitigen.
    {prot_assassinate_cath_general_EXPIRY_DEATH}Die Zielperson ist gestorben. Es ist nicht mehr erforderlich, einen Anschlag auf sie zu verüben.
    {prot_assassinate_cath_general_EXPIRY_HIDING}Die Zielperson hat sich versteckt. Es ist nicht mehr erforderlich, einen Anschlag auf sie zu verüben.
    {prot_assassinate_cath_general_EXPIRY_RELIGION}Dieser Mann hat seinen Irrtum erkannt und sich von seinem ketzerischem Glauben abgewandt. Es ist nicht mehr erforderlich, ihn zu beseitigen.
    {prot_assassinate_cath_general_FAILURE}Ihr habt diese Person nicht eliminiert. Der Rat nimmt an, dass dies zu Eurem brillanten Plan gehört.
    {prot_assassinate_cath_general_PROPOSAL}Dieser Gotteslästerer ist ein Schandfleck auf Gottes Erde und der Rat wünscht, dass Ihr ihn entfernt. Beseitigt diese Person sofort!
    {prot_assassinate_cath_general_SUCCESS}Glückwunsch, Euer Anschlag auf diese Person war erfolgreich. Der Rat ist von Eurer Skrupellosigkeit beeindruckt.
    {prot_assassinate_cath_general_TITLE}Beseitigt den ketzerischen General
    
    ;=== ui folder, event_pics: ===
    
    mission_assassinate.tga
    mission_success.tga
    mission_message.tga
    mission_failed.tga
    Last edited by Gigantus; April 04, 2020 at 08:43 AM.










  3. #3
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    Splendid! Gonna test all this stuff! Will let you know how it goes...

    Some additional questions:
    Can I script an army to fortify itself once it spawns, or something like that?

    Through the descr_rebel factions, which sets the types of rebels, could I somehow make a label that those rebels would get on spawn by default? Otherwise I will just have to do it through scripts. Also, when spawning a rebel army, can I somehow set what rebel faction they belong to (I mean the name of rebel faction)? Or is it simply gonna be the original name of rebels in the region?
    Last edited by Jadli; April 04, 2020 at 09:42 AM.

  4. #4
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    And is it possible to make a tile inaccessible via script? I know its possible for regions.... It would work teriffically well for my idea with dungeons, as I could have them "hiden" until allowed by the mission...

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    descr_rebel_factions label - not possible
    script spawned rebel armies do not get the local label of the 'regular' rebel spawns afaik, they get the default description (army of...)
    inaccessible tile\region - you must be thinking of the 'restrict_clickable_area' command. Because I know of no command that can change the properties of a tile, only whether the player can access it (clicking, map scrolling etc)










  6. #6
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    Quote Originally Posted by Gigantus View Post
    inaccessible tile\region - you must be thinking of the 'restrict_clickable_area' command. Because I know of no command that can change the properties of a tile, only whether the player can access it (clicking, map scrolling etc)
    I assume thats what I meant . So if I have a fort, and I use this command on its coordinates,it will make it impossible to besiege until I waive the restrictions? Great... Ill test it....

  7. #7
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    there is a command for specific tiles but it all actually works the other way... yay ... I assume the issue with the "sea region" was never solved?
    Last edited by Jadli; April 04, 2020 at 02:28 PM.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    sea region: if you do the show_cursorstat thing over an open spot of sea you get this:




    And if you then do search in the data\text directory you will find this in 'shared':

    Line 225: {ST_THE_SEA}The Sea

    Good chance that if you use 'the_sea' as region name in a script that it will be accepted, the region ID certainly will be acceptable provided it can be used, eg IsRegionOneOf. A similar entry can be found in descr_disasters but without the underscore:
    Code:
    event        storm
    frequency    4
    winter        true
    summer        false
    warning        false
    region        the sea
    min_scale    2
    max_scale    5










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

    Default Re: Expanding missions questions

    Quote Originally Posted by Gigantus View Post
    script spawned rebel armies do not get the local label of the 'regular' rebel spawns afaik
    They don't, no.

    There is a solution here but it involves using a second, 'hidden' faction.

    An alternative might be this: spawn this army using a named character with a label, then kill that character via his label. That will put a captain in charge: a game-generated character, not a script-spawned captain, so he might pick up the attributes of the region he was created in.

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    Very unlikely the killing will have an effect on the designation of the army but then I have seen stranger things.










  11. #11
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    Quote Originally Posted by Withwnar View Post

    An alternative might be this: spawn this army using a named character with a label, then kill that character via his label. That will put a captain in charge: a game-generated character, not a script-spawned captain, so he might pick up the attributes of the region he was created in.
    Thanks! I however tried do what you suggest, and it doesnt seem to work (But I swear on the first attempt it truly happened, but when I was doing the same and then as well with some small variations at least 10 times, it did never happen again. So I assume the first one was hallucination...)


    Quote Originally Posted by Gigantus View Post
    sea region: if you do the show_cursorstat thing over an open spot of sea you get this:




    And if you then do search in the data\text directory you will find this in 'shared':

    Line 225: {ST_THE_SEA}The Sea

    Good chance that if you use 'the_sea' as region name in a script that it will be accepted, the region ID certainly will be acceptable provided it can be used, eg IsRegionOneOf. A similar entry can be found in descr_disasters but without the underscore:
    Code:
    event        storm
    frequency    4
    winter        true
    summer        false
    warning        false
    region        the sea
    min_scale    2
    max_scale    5
    It seems it will not work, I even tried to put it together with other region into the command, it worked for the region but not for the sea (i tried the sea, the_sea, The_Sea, etc), while if it the sea region didnt exist the whole command wouldnt work I assume.... so it seems it just the same issue that guy in the thread I linked had, it seems its not possible to do it for sea ... It is no great issue, my idea with missions will work great even without it

    Though, I was looking for example how did the do the america reveal in the vanilla and I found out there is no command in the script to make Amercia hidden or inaccessible, there is just a command to make all part of map visible via "restrict_strat_radar false" later in the game. How did they do it? Was it somehow already in the map files itself that its hidden (via the fog of war or how is it called)? And the fact that you could sail there suddenly was done how? By innaccessiblity/fog or perhaps by putting there deep water which you were able to sail through only due to better ships being allowed from some point?

    Quote Originally Posted by Gigantus View Post
    If you don't know the target's name\label then you can't script a mission. Comparable to the kill_character command.

    Which means you can only target 'once off' scripted spawns as those leaders (need to be named characters) can be given labels.

    I do seem to remember that the teutonic 'noble' missions were somehow linked to the script as the character required spawning before he could be given the mission, check the 'crusading noble' set up in the script versus the descr_mission entries to check how it is linked.

    Edit: here is how the missions got triggered via script (mission, mission faction, target name), memories come back from designing an assassin mission on king Adolf of Sweden in my 1648 mod, used the kill_crusader mission as template.

    Code:
            create_mission adventure_crusader teutonic_order crus1
            create_mission kill_crusader lithuania crus1
    I imported these missions and scripts and I got it working very easily on first attempt for my factions, works great . I will now proceed with more extensive changes to the missions itself to suit my idea better.

    Although, I got a question

    Code:
     
    monitor_event FactionTurnStartFactionType slave
            declare_counter    crusader1_active 0
            declare_counter crusader2_active 0
            declare_counter crusader3_active 0
    
    
            add_events            
                event    counter    crusader1_timer
                event    counter    crusader2_timer
                event    counter crusader3_timer
                 date    0
             end_add_events
            
               generate_random_counter    crusader1_timer 0 10
              generate_random_counter    crusader2_timer 0 10
            generate_random_counter    crusader3_timer 0 30
            terminate_monitor
        
        end_monitor
        
        ;increment crusader spawn timers
        monitor_event FactionTurnStart FactionType slave
            
            inc_event_counter crusader1_timer 1
            inc_event_counter crusader2_timer 1
            inc_event_counter crusader3_timer 1
            
        end_monitor
    What exactly does "generate_random_counter" do? Does it sometimes just also randomly add 1 once during the turn period chosen? I would have though the counter was already sufficiently set up by the "add_events" part, which says it starts conting from turn 0 and the "inc_event_counter" is already increasing it by by 1 each turn? (the timer is used to for spawning of the crusading armies, the missions etc, so it can be controlled when it happens). I might not need this in the end for my purpose but would like to know what it does anyway ... (just so you know, Im not good with counters )


    Also, before I was wondering how is this event taking into account whether you already have a mission or not, and I found out it doesnt! Its the same like crusade mission, so this one doeesnt count as a normal mission, so it can be given to you when you already have a mission, and as well when you have this teutonic event, you can still get random events (such as council of nobles). And just for fun I tried how many missions can you have this way in the same time, I tested 4 and it worked... I guess I could explore whats the hardcoded limit here....

    Anyway, the teutonic crusade mission spawn you a character (a crusading nobleman from Europe...) which you are supposed to send fight the pagans. And its supposed to reward you based on how much pagas he killed.... I couldnt find anything in the script or anywhere that would be counting "his kills". How is it coded in? I assume its somehow hardcoded?

    (EDIT: nvm
    Spoiler Alert, click show to read: 
    Its handled through those lines in descr_missions
    Code:
        initial_cash		500
        win_cash			500
        win_siege_cash		1000
        win_withdraw_cash		0
        loss_cash			-750
        loss_siege_cash		-1500
        loss_withdraw_cash		-250
        exterminate_cash		2000
    	success_cash_threshold	501
        target_religion		catholic
        target_faction		england

    )


    And lastly, is there some script command that would check if there a tile is occupied? I was thinking I could use something like that to respawn "monsters" into the dungeons after some time once the player leaves it. I found "IsFortGarrisoned" in the documendos, but not sure how to use. Do I just write there coordinates behind it?


    Thanks a lot for help gentlemen
    Last edited by Jadli; April 05, 2020 at 04:56 AM.

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    generate_random_counter - will generate a (new) value for the specified (event)counter every time it's executed, based on the max\min values provided. Note that the relevant monitor is terminated - the command thus sets the base value for that event_counter. If not terminated that base value will be created over and over again making the increases in the following monitors futile.

    Hiding the americas is a combination of using the radar map restriction and the 'unexplored' version fog of war (black instead of white).

    Testing for tile occupation does work to a certain extent using the various 'neartile' conditions with a zero range, it does however require some additional conditions to be useful in this context.

    The 'IsFortGarisoned' condition is a bit odd given the requirements for it - only some mission events and the 'UngarisonedFort' event actually export it.










  13. #13
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    Quote Originally Posted by Gigantus View Post
    generate_random_counter - will generate a (new) value for the specified (event)counter every time it's executed, based on the max\min values provided. Note that the relevant monitor is terminated - the command thus sets the base value for that event_counter. If not terminated that base value will be created over and over again making the increases in the following monitors futile.
    Ah, I understand now


    Quote Originally Posted by Gigantus View Post
    Hiding the americas is a combination of using the radar map restriction and the 'unexplored' version fog of war (black instead of white).
    Alright, so I can use is then...

    Quote Originally Posted by Gigantus View Post
    Testing for tile occupation does work to a certain extent using the various 'neartile' conditions with a zero range, it does however require some additional conditions to be useful in this context.
    I think I know what you mean, Ill try to figure it out

    Quote Originally Posted by Gigantus View Post
    The 'IsFortGarisoned' condition is a bit odd given the requirements for it - only some mission events and the 'UngarisonedFort' event actually export it.
    Well, what do I have to do with it to make it work? Which missions events export it? Or not suitable for anything I want?

  14. #14
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    How to make it work? Best to look in the docudemons what are the requirements of the condition, check for events that export it and then figure out a way how to make it work the way you want it to.










  15. #15
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    Getting to test that soon, though I came upon other issue:

    Spoiler Alert, click show to read: 

    Code:
    ;spawn an army with the labelled Slaver character
        
        monitor_event FactionTurnStart I_EventCounter dres_slaver1_timer >= 0
            and I_CompareCounter dres_argonians_allied = 0
            and I_EventCounter dres_slaver1_timer <= 5
            and I_NumberOfSettlements russia > 0
            and I_IsFactionAIControlled hungary
            and I_IsFactionAIControlled milan
            and I_IsFactionAIControlled sicily
            and I_IsFactionAIControlled poland
            and not I_PlayerHasMission dunmer_slaver
            and FactionBuildingExists >= slavers_guild
            
            set_counter dres_slaver1_active 1
            
            if FactionBuildingExists = slavers_guild
               and not FactionBuildingExists >= m_slavers_guild
                spawn_army
                    faction        timurids
                    character    Eris, admiral, age 38, x 396, y 94, direction S
                    unit        cog                exp 0 armour 0 weapon_lvl 0
                end
            
            
                spawn_army 
                    faction timurids
                    character    random_name, named character,  x 396, y 94, label dres1
                    traits Dunmer 1, LoyaltyStarter 1 , GoodCommander 1 , ReligionStarter 1 , HighPersonalSecurity 3,  GoodAttacker 1 , Loyal 1  , ReligionStarter 1,  Intelligent 1,  Aesthetic 1, PublicFaith 1
                    unit    Dres Bodyguard            exp 0 armour 0 weapon_lvl 0
                end
            end_if
            
            if FactionBuildingExists = m_slavers_guild
               and not FactionBuildingExists = gm_slavers_guild
                spawn_army
                    faction        timurids
                    character    Eris, admiral, age 38, x 396, y 94, direction S
                    unit        holk                exp 1 armour 0 weapon_lvl 0
                end
            
            
                spawn_army 
                    faction timurids
                    character    random_name, named character,  x 396, y 94, label dres1
                    traits Dunmer 1, LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , HighPersonalSecurity 3, GoodAttacker 1 , Loyal 1 , NaturalMilitarySkill 1 , GoodDefender 1 , ReligionStarter 1,  Intelligent 1,  GoodRiskyAttacker 1, PublicFaith 1, StrategyDread 1, BattleDread 1
                    unit    Dres Bodyguard            exp 2 armour 1 weapon_lvl 1
                    unit    Dres Men At Arms        exp 1 armour 1 weapon_lvl 0
                    unit    Dres Bowmen                exp 1 armour 1 weapon_lvl 0
                end
            end_if
            
            if FactionBuildingExists = gm_slavers_guild
                spawn_army
                    faction        timurids
                    character    Eris, admiral, age 38, x 396, y 94, direction S
                    unit        galleass            exp 2 armour 0 weapon_lvl 0
                end
            
            
                spawn_army 
                    faction timurids
                    character    random_name, named character,  x 396, y 94, label dres1
                    traits Dunmer 1, LoyaltyStarter 1 , GoodCommander 3 , , HighPersonalSecurity 3, ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , NaturalMilitarySkill 2 , GoodDefender 2 , ReligionStarter 1,  Intelligent 2,  GoodRiskyAttacker 2, PublicFaith 1, StrategyDread 2, BattleDread 2
                    unit    Dres Bodyguard            exp 4 armour 2 weapon_lvl 2
                    unit    Dres Raiders            exp 2 armour 1 weapon_lvl 1
                    unit    Dres Javelinmen            exp 2 armour 1 weapon_lvl 1
                end
            end_if
    
    
            create_mission dunmer_slaver timurids dres1
            create_mission kill_dunmer_slaver russia dres1
    
    
            terminate_monitor
        
        end_monitor


    This is modified version of teutonic "adventure_crusader" missions, it all worked fine until I added the "if" parts that would spawn different initial stacks based on level of the guild, and I cant figure out whats wrong... any help?
    The log is saying this
    Code:
    15:20:16.284 [game.script] [error] Script execution error for <if>, at line 425, in mods/The_Elder_Scrolls/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionBuildingExists> condition
    15:20:16.284 [game.script] [error] Script execution error for <if>, at line 442, in mods/The_Elder_Scrolls/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionBuildingExists> condition
    15:20:16.284 [game.script] [error] Script execution error for <if>, at line 460, in mods/The_Elder_Scrolls/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionBuildingExists> condition
    15:20:16.285 [game.script] [error] Script execution error for <create_mission>, at line 477, in mods/The_Elder_Scrolls/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    Could not create mission.
    
    
    15:20:16.285 [game.script] [error] Script execution error for <create_mission>, at line 478, in mods/The_Elder_Scrolls/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    Could not create mission.

  16. #16
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Expanding missions questions

    Rookie error: you used a condition in the IF loop that isn't a I_xyz condition, eg FactionBuildingExists.










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

    Default Re: Expanding missions questions

    IF, WHILE and monitor_conditions can only use conditions which have no Trigger Requirements - see Docudemons for those. FactionBuildingExists does have trigger requirements (faction). Most conditions do.

  18. #18
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    The game always surprises you and add new obstacles when you think you are in the finish... Alright, I guess Ill need to add more counters to reflect the guild level, or just divide it into three events but that would take too much space, so will try my luck with counters...
    Last edited by Jadli; April 10, 2020 at 10:06 AM.

  19. #19
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    And so the peasants rejoiced!
    Code:
     ;########################################
        ;########### Slavers Guild ###########
        ;########################################
        
        ;setup Ambitious Slaver counters
        
        monitor_event FactionTurnStart
        
            declare_counter dres_argonians_allied 0
            declare_counter    dres_slaver1_active 0
            declare_counter dres_slaver2_active 0
            declare_counter dres_slaver3_active 0
            declare_counter    dres_slaver_guild 0
    
    
            add_events            
                event    counter    dres_slaver1_timer
                event    counter    dres_slaver2_timer
                event    counter dres_slaver3_timer
                 date    0
             end_add_events
            
            generate_random_counter    dres_slaver1_timer 0 10
            generate_random_counter    dres_slaver2_timer 0 20
            generate_random_counter    dres_slaver3_timer 0 30
            
            terminate_monitor
        
        end_monitor
        
        
        ;monitor the alliance status of Argonians and the Dres
        monitor_event FactionAllianceDeclared FactionType timurids
            and TargetFactionType russia
            
            set_counter dres_argonians_allied 1
            
        end_monitor
        
        monitor_event FactionAllianceDeclared FactionType russia
            and TargetFactionType timurids
            
            set_counter dres_argonians_allied 1
            
        end_monitor
        
        monitor_event FactionBreakAlliance FactionType timurids
            and TargetFactionType russia
            
            set_counter dres_argonians_allied 0
            
        end_monitor
        
        monitor_event FactionBreakAlliance FactionType russia
            and TargetFactionType timurids
            
            set_counter dres_argonians_allied 0
            
        end_monitor
        
        ;increment slaver spawn timers
        monitor_event FactionTurnStart FactionType timurids
            
            inc_event_counter dres_slaver1_timer 1
            inc_event_counter dres_slaver2_timer 1
            inc_event_counter dres_slaver3_timer 1
            
        end_monitor
        
        ;guild check
        monitor_event FactionTurnStart FactionType timurids
            and FactionBuildingExists = slavers_guild
            and not FactionBuildingExists > slavers_guild
        
            set_counter    dres_slaver_guild 1
            
        end_monitor
        
        monitor_event FactionTurnStart FactionType timurids
            and FactionBuildingExists = m_slavers_guild
            and not FactionBuildingExists = gm_slavers_guild
        
            set_counter    dres_slaver_guild 2
            
        end_monitor
        
        monitor_event FactionTurnStart FactionType timurids
            and FactionBuildingExists = gm_slavers_guild
        
            set_counter    dres_slaver_guild 3
            
        end_monitor
        
        monitor_event FactionTurnStart FactionType timurids
            and not FactionBuildingExists >= slavers_guild
        
            set_counter    dres_slaver_guild 0
            
        end_monitor
    
    
    
    
        ;spawn an army with the labelled Slaver character
        
        monitor_event FactionTurnStart I_EventCounter dres_slaver1_timer >= 15
            and I_CompareCounter dres_argonians_allied = 0
            and I_EventCounter dres_slaver1_timer <= 20
            and I_NumberOfSettlements russia > 0
            and I_IsFactionAIControlled hungary
                    and I_IsFactionAIControlled milan
                    and I_IsFactionAIControlled sicily
            and I_IsFactionAIControlled poland
            and not I_PlayerHasMission dunmer_slaver
            and I_CompareCounter dres_slaver_guild > 0
            
            set_counter dres_slaver1_active 1
            
            if I_CompareCounter dres_slaver_guild = 1
                spawn_army
                    faction        timurids
                    character    Eris, admiral, age 38, x 396, y 94, direction S
                    unit        cog                exp 0 armour 0 weapon_lvl 0
                end
            
            
                spawn_army 
                    faction timurids
                    character    random_name, named character,  x 396, y 94, label dres1
                    traits Dunmer 1, LoyaltyStarter 1 , GoodCommander 1 , ReligionStarter 1 , HighPersonalSecurity 3,  GoodAttacker 1 , Loyal 1  , ReligionStarter 1,  Intelligent 1,  Aesthetic 1, PublicFaith 1
                    unit    Dres Bodyguard            exp 0 armour 0 weapon_lvl 0
                end
            end_if
            
            if I_CompareCounter dres_slaver_guild = 2
                spawn_army
                    faction        timurids
                    character    Eris, admiral, age 38, x 396, y 94, direction S
                    unit        holk                exp 1 armour 0 weapon_lvl 0
                end
            
            
                spawn_army 
                    faction timurids
                    character    random_name, named character,  x 396, y 94, label dres1
                    traits Dunmer 1, LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1 , HighPersonalSecurity 3, GoodAttacker 1 , Loyal 1 , NaturalMilitarySkill 1 , GoodDefender 1 , ReligionStarter 1,  Intelligent 1,  GoodRiskyAttacker 1, PublicFaith 1, StrategyDread 1, BattleDread 1
                    unit    Dres Bodyguard            exp 2 armour 1 weapon_lvl 1
                    unit    Dres Men At Arms        exp 1 armour 1 weapon_lvl 0
                    unit    Dres Bowmen                exp 1 armour 1 weapon_lvl 0
                end
            end_if
            
            if I_CompareCounter dres_slaver_guild = 3
                spawn_army
                    faction        timurids
                    character    Eris, admiral, age 38, x 396, y 94, direction S
                    unit        galleass            exp 2 armour 0 weapon_lvl 0
                end
            
            
                spawn_army 
                    faction timurids
                    character    random_name, named character,  x 396, y 94, label dres1
                    traits Dunmer 1, LoyaltyStarter 1 , GoodCommander 3 , , HighPersonalSecurity 3, ReligionStarter 1 , GoodAttacker 2 , Loyal 2 , NaturalMilitarySkill 2 , GoodDefender 2 , ReligionStarter 1,  Intelligent 2,  GoodRiskyAttacker 2, PublicFaith 1, StrategyDread 2, BattleDread 2
                    unit    Dres Bodyguard            exp 4 armour 2 weapon_lvl 2
                    unit    Dres Raiders            exp 2 armour 1 weapon_lvl 1
                    unit    Dres Javelinmen            exp 2 armour 1 weapon_lvl 1
                    unit    Dres Cavalry        exp 2 armour 1 weapon_lvl 1
                end
            end_if
    
    
            create_mission dunmer_slaver timurids dres1
            create_mission kill_dunmer_slaver russia dres1
    
    
            terminate_monitor
        
        end_monitor
    
    
    
            monitor_event MissionFinished MissionID dunmer_slaver
    
    
            ;kill the slaver merchant
            if I_CompareCounter dres_slaver1_active = 1
                kill_character dres1
                set_counter dres_slaver1_active 0
            end_if
            
            if I_CompareCounter dres_slaver2_active = 1
                kill_character dres2
                set_counter dres_slaver2_active 0
            end_if
            
            if I_CompareCounter dres_slaver3_active = 1
                kill_character dres3
                set_counter dres_slaver3_active 0
            end_if
    I assume upcoming huge amount of triggers is not going to to slow down the game much, or is it?
    Last edited by Jadli; April 10, 2020 at 10:46 AM.

  20. #20
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Expanding missions questions

    Managed to bring it to even better perfection, now the level of the guild will not only affect how good slaver you get, but also how often you would get the mission (united the timers under one)
    Code:
    ;guild check and increment slaver spawn timers
    	monitor_event FactionTurnStart FactionType timurids
    		and FactionBuildingExists = slavers_guild
    		and not FactionBuildingExists > slavers_guild
    	
    		set_counter	dres_slaver_guild 1
    		inc_event_counter dres_slaver_timer 1
    		
    	end_monitor
    	
    	monitor_event FactionTurnStart FactionType timurids
    		and FactionBuildingExists = m_slavers_guild
    		and not FactionBuildingExists = gm_slavers_guild
    	
    		set_counter	dres_slaver_guild 2
    		inc_event_counter dres_slaver_timer 2
    		
    	end_monitor
    	
    	monitor_event FactionTurnStart FactionType timurids
    		and FactionBuildingExists = gm_slavers_guild
    	
    		set_counter	dres_slaver_guild 3
    		inc_event_counter dres_slaver_timer 3
    		
    	end_monitor
    	
    	monitor_event FactionTurnStart FactionType timurids
    		and not FactionBuildingExists >= slavers_guild
    	
    		set_counter	dres_slaver_guild 0
    		
    	end_monitor

Page 1 of 2 12 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
  •