Results 1 to 3 of 3

Thread: Create a legendary lord form building unlocking

  1. #1

    Default Create a legendary lord form building unlocking

    Hi everybody,
    since it's my first post I'd like to thank all the people in this community since I learned a lot about warhammer modding from this forum.
    I'm currently working on creating a legendary lord and I'd like him to be added to the character pool after unlocking a building, as you can do with a normal agent.
    I tried to add him as a building effect like other agents but it doesn't work so I had to make a script, but since it doesn't work at all and I've no idea how to debug it I'd like to get some help from you.
    Here is the script:
    Code:
    function norsca_dhampir_script()
        out("-------- SCRIPT DHAMPIR START ---------");
        NorVamp_Custom_Listeners();
    end;
    
    function NorVamp_Custom_Listeners()
        out("-------- LISTENER DHAMPIR START ---------");
        core:add_listener(
                "add_Lord_to_Character_Pool",
                "BuildingCompleted",
                function(context)
                        local faction = context:garrison_residence():faction();
                        out("local faction:"..tostring(faction)));
                        return faction:name() == "wh_main_vmp_vampire_counts";
                end,
                function(context)
                        local building_name = context:building():name();
                        local faction_name = context:garrison_residence():faction():name();
                        out("local building faction:"..tostring(building_name;
                        out("local faction:"..tostring(faction_name)));
    
                        if (building_name == "wh_main_vmp_forest_1") and not (cm:get_saved_value("lord_spawn_only_one")) then
                            cm:spawn_character_to_pool("wh_main_vmp_vampire_counts", "names_name_999888777", "", "", "", 18, true, "general", "wh_main_vmp_blood_ritual_great_sorcerer", true, "");
                            cm:set_saved_value("lord_spawn_only_one", true);
                        end;
                end,
                true
            );
    end;
    I put it in script->campaign->main_warhammer->mod->norsca_dhampir_script.lua
    Cheers

  2. #2

    Default Re: Create a legendary lord form building unlocking

    I'm trying to modify start_pos with DAVE to include my lord in character pool instead of scripting, but still no luck here. I modified start_pos_character and start_pos_starting_generals_options.

  3. #3

    Default Re: Create a legendary lord form building unlocking

    MY Pack File Manager was corrupted. Now the script actually spawns the unit but i cannot see the general name.

Posting Permissions

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