User:Mras0/pdxparse

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Discussion about the work being done on pdxparse (add any comments/requests in the talk section). Code available here. On Windows I recommend using WSL2 (In settings.yml point steam_dir to "/mnt/c/Program Files (x86)" if steam is installed in the default location).

Based on the original version by Hairy Dude with improvements by IgnoredAmbience and Grotaclas. Some major changes are:

  • Most widely used commands/conditions supported (as of 1.31.3). Exceptions are listed below
  • Generates wiki code for mission trees
  • Tracks event triggers (including weighting for random events)
  • Generates the opinion modifier template

Unsupported/TODO

  • The generated text is very mechanical. It might be worth looking into whether some commonly used patterns could be recognized and rewritten in a more "human-friendly way" (e.g. All provinces in the X area, Limited to None of Is a core, .... Our country gains a permanent claim on this province, or None of: XXX is at least -> XXX is less than).
  • Only partial support for showing the names of trade nodes (the easy cases - where the primary trade node province is referenced - should work though)
  • Scripted triggers aren't "properly" supported. They have to be added manually like normal commands/conditions.
  • A bunch of commands/conditions (153 as of 17:57, 25 May 2021 (UTC)) that are only used in one or two files (notably many things related to the revolution, industrialization events, consort events and mercenary events).
  • Disasters are parsed, but only for the purpose of determining event triggers. Stub pages could be generated, but that currently doesn't seem to be worth the effort.
  • The handling of pronouns (e.g. root, capital and in particular from) is not as good as it could probably be.

Talk

(See also the history of this page for concluded/stale discussions)

1.32 issues

so far I noticed the following issues when using pdxparse with 1.32:

  • a lot of formation decisions now have code like NOT = { has_idea_group = AKS_ideas } to check if the country already has the new national ideas. pdxparse uses the icon template for the ideas here(e.g. {{icon|AKS_ideas|28px}}) which does not exist. Ideally pdxparse would detect which are idea groups and only use the icon template for those. Or the idea groups could just be taken from a fixed list.
    • Should be better now. Mras0 (talk)
      • group national ideas like pirate_ideas are still wrong --Grotaclas (talk) 17:52, 14 November 2021 (UTC)
    • Right, maybe fixed now? :) Mras0 (talk) 20:36, 14 November 2021 (UTC)
  • change_ adm/dip/mil and the removal of fixed=yes(fixed is the default now) and force_republican_names are not handled by defineDynMember
    • Should be fixed now. I saw on the forums that the meaning of max_random_adm/dip/mil has changed, but since I haven't verified it, I've kept the descriptions as is. - Mras0 (talk) 14:03, 13 November 2021 (UTC)
  • remove_heir/kill_heir is not yes/no anymore
    • Should be fixed, but I don't know what "allow_new_heir=no" does, so it just adds as a wiki comment in MsgHeirDies for now Mras0 (talk)
  • several cult relate change_cult, select_primary_cult, has_primary_cult, num_of_unlocked_cults
    • Done - Mras0 (talk) 14:03, 13 November 2021 (UTC)
  • create_colony_mission_reward
    • Added MsgColonyMissionReward, but description is lacking Mras0 (talk)
      • I improved the message --Grotaclas (talk) 17:52, 14 November 2021 (UTC)
  • unlock_estate_privilege adds an icon template, but I don't think that estate privileges will ever be important enough for the icon template. I think it would be sufficient to write "Unlock the “X” estate privilege" without using an icon --Grotaclas (talk) 17:52, 14 November 2021 (UTC)
    • That wasn't intended (copy/paste error). Should be fixed. Mras0 (talk) 20:36, 14 November 2021 (UTC)

1.33 issues

  • native_americans.6 transforms change_adm = 0 into "Administrative power.png 0 administrative skill", but it should be either "+0" or the line should be omitted, because it has no effect -- Grotaclas (talk) 06:09, 12 March 2022 (UTC)
    • Fixed. Seemed better to just omit them, and I've done the same for change_dip and change_mil as well (even though there aren't any cases like that yet). Mras0 (talk) 16:56, 13 March 2022 (UTC)