Results 1 to 7 of 7

Thread: Automatically giving Legendary Lords quest items (as the AI gets)?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    edders's Avatar Senator
    Join Date
    Jan 2006
    Location
    Around the world
    Posts
    1,397

    Default Automatically giving Legendary Lords quest items (as the AI gets)?

    I've been messing around with wh_quests.lua in the main campaign script folder and character_skills_tables in the db to try and give the human player their Legendary lord items as soon as the Lord hits the required level, yet I can't get anywhere with it. I've tried lowering the required ranks in both wh_quests.lua and character_skills_tables to see if I can at the very least trigger the quests at a different rank, but nothing happens in-game despite the UI listing them in the skills tree as "Unlocked at Rank 2". I've tried editing wh_quests.lua and replacing Karl Franz' Reikland Runefang quest with the ancillary quest (which presumably automatically gives the AI that item) but this doesn't work either. Has anybody been able to get this working?

  2. #2

    Default Re: Automatically giving Legendary Lords quest items (as the AI gets)?

    Hi.
    Have you tried to edit this particular part (located below) of the .lua script? There is the code which allows the ai to automatically get the items instead of the quest. I haven't tried to implement that one for human players, 'cause I like doing the quests. But I removed it so the ai won't get the items anymore, because I significantly lowered the required level which made the ai characters op at the start.
    Code:
    function set_up_rank_up_listener(quests, faction_str, subtype)
        for i = 1, #quests do
            cm:add_listener(
                quests[i][3],
                "CharacterTurnStart",
                function(context) return context:character():character_subtype(subtype) and context:character():rank() >= quests[i][4] end,
                function(context)
                    -- do not start the quest if it has already been started
                    if not cm:get_saved_value(quests[i][3]) then
                        -- if the character is player controlled then begin the quest chain
                        if context:character():faction():is_human() then
                            -- save the quest name in order to not issue it multiple times
                            cm:set_saved_value(quests[i][3], true);
                            
                            -- get the character's faction name, as it might have changed - if they have been confederated!
                            local faction_name = context:character():faction():name();
                            
                            if quests[i][1] == "mission" then
                                if quests[i][5] and cm:is_multiplayer() then
                                    cm:trigger_mission(faction_name, quests[i][5], true);
                                else
                                    cm:trigger_mission(faction_name, quests[i][3], true);
                                end;
                            else
                                cm:trigger_dilemma(faction_name, quests[i][3], true);
                            end;
                        -- if the character is AI controlled then give them the ancillary
                        else
                            -- save the quest name in order to not issue it if the player gains control of this character via confederation
                            cm:set_saved_value(quests[i][3], true);
                            
                            local char_str = char_lookup_str(context:character());
                            cm:force_add_ancillary(char_str, quests[i][2]);
                        end;
                    end;
                end,
                false
            );
        end;
    end;
    As for the level when one gets the quest, you need to edit the entries in the .lua file and the corresponding db file (character_skill_level_details).

  3. #3
    edders's Avatar Senator
    Join Date
    Jan 2006
    Location
    Around the world
    Posts
    1,397

    Default Re: Automatically giving Legendary Lords quest items (as the AI gets)?

    Hi larynja, thanks for the reply. I have tried editing the script to look like this:

    if context:character():faction():is_human() then
    -- save the quest name in order to not issue it multiple times
    cm:set_saved_value(quests[i][3], true);
    local char_str = char_lookup_str(context:character());
    cm:force_add_ancillary(char_str, quests[i][2]);

    but character_skill_level_details_tables only shows skills like Leader of Men or Deathclaw, not the quest items.

    edit: Unfortunately that didn't work even when I reached level 8 with Franz and waited a few turns.
    Last edited by edders; November 11, 2016 at 08:45 AM.

  4. #4

    Default Re: Automatically giving Legendary Lords quest items (as the AI gets)?

    Quote Originally Posted by edders View Post
    but character_skill_level_details_tables only shows skills like Leader of Men or Deathclaw, not the quest items.
    Indeed you're right, they changed that with the patch. Skill Level Details used to contain all the Lord Skills located in the topmost row in the skill window. Such as you said the mounts, but also the skills which unlock the quest line (you just don't have to put a skill point into them). As of the latest patch the quest skills are only located in the normal character_skills_table, for example wh_main_skill_emp_lord_unique_balthasar_cloak_of_molten_metal, you have to adjust the required level as mentioned before in that table now.

  5. #5
    edders's Avatar Senator
    Join Date
    Jan 2006
    Location
    Around the world
    Posts
    1,397

    Default Re: Automatically giving Legendary Lords quest items (as the AI gets)?

    Thanks for your reply. No luck, unfortunately. Setting the Reikland Runefang to rank 1 (which unlocks it at level 2) or rank 2 (unlocks at level 3) in the normal character_skills_table and setting the reikland runefang to unlock at 2 instead of 8 in the quests script:

    -- type, ancillary key, mission key, rank required, [optional] mission key if playing MPC
    local karl_franz_quests = {
    {"mission", "wh_main_anc_weapon_the_reikland_runefang", "wh_main_emp_karl_franz_reikland_runefang_stage_1", 2, "wh_main_emp_karl_franz_reikland_runefang_stage_1.1"},
    {"mission", "wh_main_anc_weapon_ghal_maraz", "wh_main_emp_karl_franz_ghal_maraz_stage_1", 13},
    {"mission", "wh_main_anc_talisman_the_silver_seal", "wh_main_emp_karl_franz_silver_seal_stage_1", 18}
    };

    also does nothing except change the listed rank in the characters skills table ingame. If I check the skills window after levelling up to level 2 it says it has been unlocked and the chains are gone, but no quest triggers and no item appears in the item list or in Karl Franz' inventory

    edit: As a side note, I booted up the same mod but chose Skarsnik. I waited a couple of turns before wandering over to Grunbad or w/e that town in Reikland is called, and found Karl Franz there at level 2 with both The Silver Seal and The Reikland Runefang. Can't remember if AI got those items automatically before the required level in the vanilla game. It shouldn't be the result of mods as I changed nothing about the Silver Seal.
    Last edited by edders; November 12, 2016 at 11:25 AM.

  6. #6

    Default Re: Automatically giving Legendary Lords quest items (as the AI gets)?

    Quote Originally Posted by edders View Post
    Thanks for your reply. No luck, unfortunately. Setting the Reikland Runefang to rank 1 (which unlocks it at level 2) or rank 2 (unlocks at level 3) in the normal character_skills_table and setting the reikland runefang to unlock at 2 instead of 8 in the quests script:

    also does nothing except change the listed rank in the characters skills table ingame. If I check the skills window after levelling up to level 2 it says it has been unlocked and the chains are gone, but no quest triggers and no item appears in the item list or in Karl Franz' inventory
    That's because of the changes you did to the script, the part you replaced for the player with the part from the ai characters, it prevents the triggering from legendary lord quests. If you reverse it back to its original state the quest will be unlocked and triggered at the level you entered.
    As for why exactly the changed script part which unlockes the item instead of quest doesn't work for the player the way you entered it, I can't really tell you right now. The scripts are really sensitive, if you just miss as much as a semicolon it can screw up the whole game. I did some testing in that script when I removed the trigger for the ai getting those items - which worked well, but as it turned out for some reason it also changed Malagors starting position to the one from Khazrak... After I redid the same thing for the second time it worked properly though. In other words the less experience you have with scripting the harder it is to actually get it working as you want it to, without strange side effects. You probably have to adjust the script part a bit to work for the human player.

  7. #7
    edders's Avatar Senator
    Join Date
    Jan 2006
    Location
    Around the world
    Posts
    1,397

    Default Re: Automatically giving Legendary Lords quest items (as the AI gets)?

    No luck, unfortunately. I've tried deleting the mod entirely, importing both files from the CA packs using PFM, solely changing the Reikland Runefang rank so that it triggers at level 2, and get the same result - character skill screen says the quest has unlocked, yet no quest is ever given, regardless of how many other levels I gain or turns I wait. I've tried deleting all mods and downloading a couple of other mods that change the quest unlock level to reverse engineer them, but none of them seem to work (quest says it's unlocked but the mission is never given out). They must be outdated or something, I don't know.

    Thanks for all your help anyway, but I'll just give this a miss and play minor factions without the quest battle nonsense instead

Posting Permissions

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