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

Thread: Trying to fix the ancillaries

  1. #1

    Icon5 Trying to fix the ancillaries

    Hello!

    After some time in-game one can realize that some ancillaries are a little bit problematic.
    I would like to include fixes for ancillaries to my "Minor Fixes" mod, emphasizing ancillaries that are gained but will not show up in the agent's/general's ancillary pool (issue 1) and ancillaries that are never gained due to problems in triggers (issue 2) or other mistakes.

    Issue 1
    For the first issue, the solution is usually easy to fix. For example the ancillary "Portable loom" (seen in the DLC "Empire Divided") is usually received when a general is in a province with manufactuing buildings (this is my guess). It is usually gained in the first couple turns by the faction leader. But despite seeing the notification I was never able to see the item and assign it to my generals. I checked the tables and the item was missing from "ancillary_included_subcultures" and "ancillary_to_included_agents". After adding an entry for it in the tables I finally got it working. So any ancillary that suffers from the same issue (gained but not available) shoud probably be able to get fixed this way. Now the problem is to find all the affected ancillaries somehow



    Issue 2
    (the most important)
    I am pretty confident I found the reason why this one happens but I need a lot of help. Let me describe it first. If I understand correctly the ancillaries' triggers are found in lua_scripts/export_ancillaries.lua. Ok so I checked this .lua file (using PFM) and I noticed that some ancillaries (that I have never seen in-game) have some wrong building requirements. The actual building is not wrong but the id is wrong. Example: the ancillary "Priest of Horus" (r2_sp_anc_egyptian_religious_horus) is said in the triggers to require the building "rom_HELLENIC_temple_ptolemaic_Horus_4" which is called "Precinct of Horus". What is wrong here is that this building "Precinct of Horus", after a patch I guess some years ago, has now a different ID name: "greek_religious_egypt_horus_4". I believe if I replace the wrong ID name with the correct ID name the ancillary trigger will work. The problem now (since I know nothing about scripts, how they work nor how they are edited) is...Do I actually import the export_ancillaries.lua in the mod and type/replace stuff? Or do I have to open the export_ancillaries.lua with a notepad first, somehow?


    Any advice, any suggestion, is invaluable and immensely appreciated.

  2. #2
    Jake Armitage's Avatar Primicerius
    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    3,652

    Default Re: Trying to fix the ancillaries

    I'm not sure what's the cause of these missing ancillaries, we have tried a couple of ways but weren't able to erase completely this bug (speaking of DeI).
    Anyway the 2 things you've reported are surely to be checked.

    You can edit the export_ancillaries.lua as you wish. best way is to copy/paste the entire sheet into notepad++, do the changes and then repaste the entire script (overwriting the old script ofc).
    I would advice you to use RPFM. It is overall better than PFM (except for copy/paste from/to excel): https://www.twcenter.net/forums/show...rozen-columns!

    you have the complete list of lua functions here: http://www.mediafire.com/file/96nv9z..._v1.0.ods/file
    and some explanations (coming from Attila) here: http://www.mediafire.com/file/ibimjj7rwodvvxr/attila_wiki.txt/file



  3. #3

    Default Re: Trying to fix the ancillaries

    Hey, how have you been? Thanks for replying.

    Ok so a few hours ago I used the extract -> edit with notepad++ -> import in mod method, using pfm and had some success with it but I will check everything you posted!

    Let me give you a (almost) successful example so that you can criticize my steps.

    I saw an ancillary that I haven't seen before, called Brennus' sword (inv_brennus_sword), intended for the Rise of the Republic DLC.
    I exctracted the lua file using PFM, and edited with notepad++. I changed the function (am I calling it right?) for the ancillary a little bit for practice. I suppose that little number in the red circle is the chance of the ancillary being received by the character?

    Click image for larger version. 

Name:	brennus1.png 
Views:	6 
Size:	17.7 KB 
ID:	360256

    So I replaced the 0 with 100, erased some requirements like this one:

    "context:character():has_region() and context:character():region():name() == "inv_senonia_ariminum"

    Then I saved the modified export_ancillaries.lua file, created a new pack with PFM and imported it and then created the test mod.
    And I then expected it to be gained after every successful battle. And it worked, I got a few Brennus' swords using different characters. But I wonder why it has no special description (both name and desccription is "Brennus' sword") and why was it set to zero chances? Maybe it was unfinished. And the requirements were weird, you were supposed to get it when defending Ariminum when playing as the Senones? It is a rare thing to happen, but can happen, so why the developers set it to zero?

    And "context:character():has_region()" I guess means that the character is in the region I guess?

    Am I even doing it right?
    I am waiting for your criticism and any advice
    Generally I am looking to fix rather than create. But if an ancillary has at least some basic information in the files and it only needs a few modifications to get it working, I consider it a fix.

    Oh and I gave the lua functions list a look and I don't really understand it. All i see in export_ancillaries.lua is words, so how do I use the spreadsheet?


    EDIT: The fix I found for ancillaries being seen in notifications but not actually being available to characters, is that the ancillary must have a correct entry in "ancillary_to_included_agents" and "ancillary_included_subcultures". For example, if your Roman general receives an ancillary that that is not for subculture "sc_rom_roman" and is not for "general" then even though you see the notification, the ancillary pool won't include the item. If you save the game and add the entries , the ancillary will be visible and usable. This is my two cents that I understand and I can provide.
    Last edited by Athanasios55; December 20, 2019 at 02:22 PM.

  4. #4

    Default Re: Trying to fix the ancillaries

    Is this for vanilla or for a specific mod?

    For vanilla, I believe the retained some of the old buildings to make sure its save compatible but at this point no one would have those saves with those buildings anymore. Its possible that some of the ancillaries are no longer used and their triggers were not updated.

    ---

    For the names & triggers, many vanilla ones are unused or were unfinished. Thats why they are set to 0.
    Last edited by Dresden; December 20, 2019 at 02:39 PM.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  5. #5

    Default Re: Trying to fix the ancillaries

    Hello!

    Edit: Yes it is for vanilla. I am trying to fix all these weird ancillaries... The annoying invisible "Priest of Seth" ancillary is the reason I got suspicious there are many ancillary bugs. Turns out it is intended only for Egyptian generals but the script gives it to all Hellenic factions. That is why it is invisible for the rest
    Last edited by Athanasios55; December 20, 2019 at 03:19 PM.

  6. #6
    Jake Armitage's Avatar Primicerius
    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    3,652

    Default Re: Trying to fix the ancillaries

    why the developers set it to zero?
    Could be that ancillary is given via incident/dilemma (the cdir tables). Otherwise they forgot or erased it.

    ------------------------
    function analyzed:

    --[[ inv_brennus_sword ]]-- NOTES: when you have 2 "--" it means this line won't be read (for titles, descriptions, notes, whatever)

    function inv_brennus_sword_impl (context) -- NOTES: here begins the function
    return char_is_general_with_army(context:character()) and context:character():won_battle() and not context:character():has_ancillary("inv_brennus_sword") and context:character():has_region() and context:character():region():name() == "inv_senonia_ariminum" and not context:character():model():campaign_name("prologue_01") and context:character():faction():name() == "inv_senones"
    -- NOTES: all the things above are Rome 2 lua functions (the ones listed into the excel) and they are set to be conditions for triggering the function itself
    end

    events.CharacterCompletedBattle[#events.CharacterCompletedBattle+1] = -- NOTES: this is an "event function", they already contain "event callbacks". You have a list of all the possible events inside the excel file.
    function (context)
    if inv_brennus_sword_impl(context) then -- NOTES: here you're checking if all the conditions you've set in the function above are true
    if conditions.DateInRange(-10000, 10000, context) then -- NOTES: here you can set the year window for triggering the event
    effect.ancillary("inv_brennus_sword", 0, context) -- NOTES: here we apply something, in this case giving an ancillary with a % chance
    end
    return true
    end
    return false
    end
    ------------------------

    context:character():has_region()"
    This means the character is deployed in any of the map regions (not sure about sea honestly). It is a way to check if the character is deployed or is a politician (you have a function for politicians too)

    Am I even doing it right?
    Yeah, it seems you're doing everything fine. When the game works fine and you obtained what you were searching it means you're doing it right.

    Oh and I gave the lua functions list a look and I don't really understand it. All i see in export_ancillaries.lua is words, so how do I use the spreadsheet?
    The excel is a list of all Rome 2 lua functions. By combining them you write a script.
    Check this tutorial if you're interested into knowing more.
    http://www.mediafire.com/file/mz55e8...ial_3.odt/file

    The fix I found for ancillaries being seen in notifications but not actually being available to characters
    This is interesting, thx for the tip, we'll see if we have set everything correctly.
    Last edited by Jake Armitage; December 20, 2019 at 02:49 PM.

  7. #7

    Default Re: Trying to fix the ancillaries

    I believe it would make sense if I tried to make Brennus' Sword be gained after Brennus sacks Roma and make its description 'Vae Victis". It would make more sense than the conditions of the existing function.

    But how can I check these cdir files? I must because if the sword is used by a dilemma then it doesn't need my fixing and I shouldn't touch it. Maybe it is indeed gained when sacking Rome. But if it is unfinished then yes I will give new requirements.

    I need to study all the new info you guys provided to me. If I understand correctly the spreadsheet actually lists all the available functions that we can use? And what about the C column (Function: #)?

    I will practise more and report any more findings/results and stuff as always.

  8. #8
    Jake Armitage's Avatar Primicerius
    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    3,652

    Default Re: Trying to fix the ancillaries

    But how can I check these cdir files?
    It is... complicated to explain. best way is to have a mod with custom incidents/dilemmas so to understand how they work.
    Anyway, do not bother with them, just do your script, until it has "and not context:character():has_ancillary("inv_brennus_sword")" you shouldn't get it twice.
    Your script and the eventual cdir can't conflict.

    the spreadsheet actually lists all the available functions that we can use?
    yes, you'll have to undderstand the scripting chains though. Some are described into the tutorial. You'll see others by checking modders' scripts.

    And what about the C column (Function: #)?
    They are nothing, just datas, don't bother with them. They come out when you retrieve them (via script).

  9. #9

    Default Re: Trying to fix the ancillaries

    After a (quite challenging!) 6 hour campaign as Senones I got Brennus to Roma and sacked it. No sword nor "weighted scale" (inv_weighted_scale) gained nor anything else. You only get some payment reward if you sack Roma during the chapter 4 or 5 I think, it is just a chapter objective (invasion.pack/campaigns/main_invasion/missions.txt.)

    There actually many events/dilemmas, for example one is about... (minor spoilers ahead)
    Spoiler Alert, click show to read: 
    a Great Hunt in which one of the options will result in receiving a "Trophy Stag" ancillary


    But I see that these ancillaries used by the events are not used in export_ancillaries.lua. So the most reasonable conclusion is that ancillaries with zero chance are just unfinished and probably not received by other means.

    There are a few other unfinished ancillaries for Rise of the Republic like "Illyrian Captain" (for pirates), "Illyrian Traitor", "Horned Helmet" (for Iolei), "Weighted Scale" (For Rome. And provides a bonus when looting settlements. Shouldn't this be for Senones?), "Dionysius Poetry" (for Syracuse), "Statue of Juno" (For Rome, after winning a battle in Vei from what I see)

    I want to add them in the game as it was intended but the conditions for their appearance are a little bit weird. Is it appropriate to take initiative and create new, proper/logical/historical conditions for them or would it be too much creativity for a "bugfixing" mod?
    For example I would like a general/admiral to receive "Illyrian Traitor" after a victory against the Illyrian Pirates (it provides bonus attack against Illyrian Pirates) but right now the conditions for this ancillary show that it will be gained by the Pirates, not other factions.

    In the meantime, as I await advice, I will skip these for now and continue to the rest problematic ancillaries that have more obvious solutions (like wrong building ids, wrong availabilities, etc) and report back again.

  10. #10
    Jake Armitage's Avatar Primicerius
    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    3,652

    Default Re: Trying to fix the ancillaries

    I don't really think you should follow too much vanilla's tabs...
    There are so many unfinished/bugged things that a couple of non appearing ancillaries are the least of the problems.
    Just mod the game as you wish.

  11. #11

    Default Re: Trying to fix the ancillaries

    I began fixing availability, effect and script of all ancillaries. Alphabetically. I am now in r2_sp_anc_barbarian_arts_bard. I have a long way left. The inconsistencies can make someone go mad. I encountered stuff like ancillaries supposed to be gained by germanic factions but not available for the germanic culture. And there is no pattern like the bodyguard bug that I knew that all bodyguards of a DLC are missing their entry. Now I have to check each and every ancillary and everything about it.

    May I ask whether the effect_scope "this_general" works interchangeably with "this_agent" when the effect affects a character, like a +1 authority effect? It will be a huge help.
    Last edited by Athanasios55; December 23, 2019 at 02:41 AM.

  12. #12
    Jake Armitage's Avatar Primicerius
    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    3,652

    Default Re: Trying to fix the ancillaries

    to see how scopes work check "campaign_effect_scopes_tables". You should be able to add some new too, or at least so it has been done for DeI.
    here is an excel file with a list of every Rome 2 effect and scope
    http://www.mediafire.com/file/03v9j0..._LIST.ods/file

    I think "this_general" will work for deployed land generals only while "this_agent" should work for anyone (general, admiral, politician, agent)

  13. #13

    Default Re: Trying to fix the ancillaries

    Quote Originally Posted by Jake Armitage View Post
    to see how scopes work check "campaign_effect_scopes_tables". You should be able to add some new too, or at least so it has been done for DeI.
    here is an excel file with a list of every Rome 2 effect and scope
    http://www.mediafire.com/file/03v9j0..._LIST.ods/file
    Thanks for the document!

    I think "this_general" will work for deployed land generals only while "this_agent" should work for anyone (general, admiral, politician, agent)
    I see, it makes sense. By the way, I just realized I didn't check the "ancillaries'' table. That was stupid of me. So how important is this table? Are these "REPLACE_ME" values correct?

    Click image for larger version. 

Name:	anc1.jpg 
Views:	7 
Size:	303.1 KB 
ID:	360262



    Anyway I just finished reviewing the scripts of all ancillaries and their database info. I corrected many obvious scripting mistakes, added missing entries in db, and created a few scripts for some greek naval ancillaries to test them in-game. It is still work in progress. There is too much work to be done.

  14. #14
    valerius karamanus's Avatar Libertus
    Join Date
    Dec 2018
    Location
    Constantinopolis
    Posts
    76

    Default Re: Trying to fix the ancillaries

    Of course table is important, once you assign an ancillary in lua script, game checks that table to confirm it. Also you have the opportunity to choose which slot your ancillary will appear, uniqueness etc by table editing. REPLACE_ME values are useless as far as I know. You can make everything _9999 and should still work.

    Do you plan to make a complete overhaul? If so I can send you my research documents about the historical ancillaries mod I worked on for some time. I won't be modding anytime soon so might as well give it to someone enthusiastic about it.

  15. #15

    Default Re: Trying to fix the ancillaries

    Hello!

    I am working on fixing mistakes and bugs mostly, and maybe just add in the game any unfinished households. Nothing too creative But every bit of help and support is greatly appreciated!
    I already released a mod that fixes quite a few minor database bugs but ancillaries are a Learnaean Hydra. After every ancillary you fix, you discover another 10. I will continue working on them after I finish some more fixes I am working on that seem to be a bit easier. I am still wondering why I got "Plebian Turncoat" as Rome while the script for this ancillary clearly shows that Rome can't get it. Of course I couldn't use it, I had to enter it to the "ancillary_included_subcultures" and then it showed up. But the script forbids Rome from getting it in the first place....Maddening!

    How did your mod go btw? Why did you stop?
    Last edited by Athanasios55; December 27, 2019 at 05:41 PM.

  16. #16
    valerius karamanus's Avatar Libertus
    Join Date
    Dec 2018
    Location
    Constantinopolis
    Posts
    76

    Default Re: Trying to fix the ancillaries

    Oh that sounds very annoying. I just checked that ancillary and it clearly blocks Rome from getting it. I don't know how that happened. And honestly, I have never seen Plebian Turncoat ancillary in my DeI grand campaign Roman playthroughs. Maybe it is a bug you unintentionally created?

    Anyway an ancillary fix would be an awesome contribution and I'm eager to see your work developed!

    Unfortunately I have to stop modding because school+study+job trio really drains my time. I can barely sit few hours a week on pc and when I do, I usually enjoy some L.A Noire. Looking forward to summer..

  17. #17

    Default Re: Trying to fix the ancillaries

    That trio is tough. I wish you a happy and fast graduation! Hold on!!

    Well when I got the ancillary I didn't have my ancillary changes activated, I was checking some other bugfixes I made which in no way can interfere with the ancillary scripts. I got it after capturing a settlement of the Etruscan League. So yes I was fighting a faction of the Roman subculture but still, I was Rome and shouldn't get it. And I doubt my general somehow "stole" the ancillary from the enemy because that means the enemy had it (which is very unlikely) and because generals can't steal ancillaries...or can they? Only spies can do that with the "thief" skill if I remember correctly.

    Anyway here is the screen. It is not a big deal anyway, what troubles me a lot though is that this means I am missing something important on how ancillaries actually work even though I thought I had understood the scripts.

    I was playing vanilla Rome 2 btw. No mods, only the specific bugfix I was testing

    Click image for larger version. 

Name:	20191225173516_1.jpg 
Views:	7 
Size:	279.6 KB 
ID:	360299

  18. #18

    Default Re: Trying to fix the ancillaries

    I think I found why it happens. Besides the export_ancillaries.lua file in the data_rome2.pack there is a second export_ancillaries.lua file inside data.pack. The script of the latter doesn't forbid Rome from getting the Plebian Turncoat.

    Which means that both files are read by the game. How is that even possible? Shouldn't the file loaded first override the other?

  19. #19
    Jake Armitage's Avatar Primicerius
    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    3,652

    Default Re: Trying to fix the ancillaries

    yes it should... as every other file into data with the same name...
    who knows, maybe there's something hardcoded defining their coexistence...
    but I think that in DeI we have problems even with brand new ancs (which are obviously not defined into vanilla's script) so I'm pretty skeptical this can be a reason.
    it always worth trying though.

    we're trying to track down this issue too and this thing could be the reason (not sure 100%, so it's a speculation)

    What I fear is the following:

    1) the assignement of the ancs is given by a effect.ancillary("anc_name", %, context) function
    2) is this function actually a real "game_interface" function? I don't think so. I think the effect.ancillary is a "son" (defined somewhere into some hardcoded script) of the main function force_add_ancillary:
    Description: Grant the specified character the specified ancillary. Uses standard character lookup system Usage: force_add_ancillary("faction:france,surname:Bonaparte", "Anc_Balloonist")
    3) and here might be our problem: the fact that this function assigns the anc through the character surname
    4) the kill_script I've put into PIGS works really similar, through the surname
    5) this means that if 2 characters do not meet the same conditions but have the same surname then we can't be sure if the thing we want to trigger will be applied to the correct character (the one that meets the condtions).
    6) why is that? because the "conditions block" and the "trigger block" are actually unrelated (ivenpera confirmed me this logic months ago).
    7) and in fact CA noticed this and the kill function for warhammer depends on the cqi (which is a sort of individual ID for every character) and no more on surnames (ivanpera told me that).

    If what above is correct it means the anc bug is not solvable at all.
    Or it could simply be some lack into db tables (or export_ancillaries.lua)
    Or it could be that the relation between the scripted dice rolls for the anc function and the consequent tirggered incident (when a windows appears in-game telling you got an anc) are badly coded.
    Only trials can tell us what the truth is.
    Last edited by Jake Armitage; January 05, 2020 at 10:39 AM.

  20. #20

    Default Re: Trying to fix the ancillaries

    I lack a lot of knowledge in order to understand these mechanics. But since I am near completion of my simpler project, I want to ask something important.

    I discovered two tables called "ancillary_triggers" and "ancillary_trigger_effects". I can only see them when using the Assembly Kit, I can't fInd their location with PFM.

    Are they merely generated from the export_ancillaries.lua file or are they completely separate? If I want to add a new script (yes I do) should I add it in these tables too? In former attempts to use the Assembly kit and generate a startpos file it failed me, I think because I use the new launcher... (I ended up using EditSF, I only made a few simple changes only anyway). So, should I care about these tables? How do I find them with PFM?

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
  •