Results 1 to 3 of 3

Thread: files for one ancillary?

  1. #1

    Default files for one ancillary?

    Long time modder (other games), first time poster.

    I would like to add an ancillary (retainer) but I cannot find all the related files. Using pack manager, I open data.pack and look into export_ancillaries.lua. This contains:
    Code:
    --[[ s2anc_ainu_servant_trigger ]]--
    events.CharacterRankUpNeedsAncillary[#events.CharacterRankUpNeedsAncillary+1] =
    function (context)
     if conditions.CharacterType("geisha", context) and not conditions.CharacterInHomeRegion(context) and conditions.FactionwideAncillaryTypeExists("s2anc_ainu_servant", context) == false then
      if conditions.DateInRange(1500, 1900, context) then 
       effect.ancillary("s2anc_ainu_servant", 50,  context)
      end
      return true
     end
     return false
    end
    This defines one ancillary, s2anc_ainu_servant. But, where is the (a) text that appears for the ancillary when the level-up dialog appears, (b) image that appears, (c) code which shows the in-game effect of this ancillary? There are 18K files to sort through in data.pack alone; none of the filenames appear to relate to "ancillary" or "retainer" except for this one.

    EDIT: found (a) in local_en.pack, ancillaries.loc. It seems each ancillary has a tag name/value pair "ancillaries_onscreen_name_s2anc_ainu_servant" and a tag pair "ancillaries_colour_text_s2anc_ainu_servant". Using PFM on the db\ancillaries table shows the icon ID reference which is a pointer to (b) with more to investigate. Another table ancillary_to_effects gives "line_of_sight_mod" for the effect, but then I can't track any further. Table "effects" just gives some icon information.

    How do I trace down to the actual effect of an ancillary?
    Last edited by davidlallen; June 25, 2011 at 11:51 AM.

  2. #2

    Default Re: files for one ancillary?

    Hi,

    With the PFM open up patch 5 (use that a base as a rule of thumb atm - its the chunkiest, unless later patches contain the same files) - then expand (+) the db folder. You should now see about 6 juicy ancillary tables - i haven't gotten into ancillaries myself but modding their effects should be pretty straight forward. Adding a new ancillary might be problematic, i wouldn't know but completey changing the picture, effects, in game text, etc etc should all be pretty fathomable from there.

    One word of caution, the PFM doesn't always save every change so make your changes and then save and then immediately check to make sure the changes have truly been saved. Rince repeat.

    Have fun.

    [Edit] Extract the files you want when you've identified them (right click, extract selected) then open a 'new' PFM and right click, add files (or directory) and THEN make changes and save as - never overwrite the vanilla files, a 20 gig mandatory steam download is painful, to put it mildy.
    Last edited by Fr3Nzy; July 05, 2011 at 03:54 PM.

  3. #3

    Default Re: files for one ancillary?

    Thanks for the suggestion. I have now created a mod which adds 20 new ancillaries, each with an effect that none of the base game ancillaries have. For example, "Peasant Farmer" adds +15% to farm income. I can see the effects in the general's summary dialog; but there is a problem. I cannot see the effect in the city summary dialog. It still shows the same value for farm income.

    In the attached mod, you can see the tables I added for ancillaries. In table db/ancillary_to_effects_table/newanc, I added ancillary s2anc_newanc_farmer. It has the effect "building_mod_income_farms 15". It may be that this particular effect is not supported on ancillaries; but there is no message from the game, and the text does show up on the general's dialog.

    Can anybody suggest what I may be missing to have these effects do what they are supposed to do?

    In related news,

    1. In other games I have modded, there is a way to "autoplay" a few turns. That is, to have the AI play my own position for a fixed number of turns, without me pushing any buttons. I can set up the game to autoplay 50 turns and walk away. Then 20 minutes later, I can take over again and see what all the AI's have done. This is handy for testing.

    ==> Is there any similar "autoplay" concept in TWS2?

    2. For the database directories such as db/ancillary_to_effects_table, I can add a new file such as newanc, and rows in this file will override the main file. However, this does not work for the localization strings. I added a new file in text/db called newanc.loc which was supposed to override the definitions in text/db/ancillaries.loc; but my new values were ignored. So instead I put a full copy of the file ancillaries.loc, with my new rows added. This is not good from a maintenance standpoint.

    ==> Is there any way to override strings from text/db without copying the whole localization file?

    3. In order to add the ancillaries, I have edited export_ancillaries.lua to put my calls to "events.CharacterRankUpNeedsAncillary" into the same place as all the base game calls. However, this means that I have added a hundred lines into this public file. I would prefer to keep my added lines into my own file, again for ease of maintenance. I am not sure of the loading and calling order for the lua files.

    ==> Can I put my lua code into a new file and make sure it is sourced at the right time during initialization?

Posting Permissions

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