• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
When we find a bug, we report it. But sometimes bug reports slip under the attention of devs, sometimes a bug noted takes ages to fix. So I grow inpatient, try to fix something by myself. As fixes accumulate, I think it's time to claim the title of Unofficial Patch.

steam workshop link: Risa's Unofficial Patch to 1.9.x

Achievements and Compatibility: This mod is written to replace core game rule files (those in common and event folders), so it will disable achievements. It is compatible with any mod who does not alter game rule files. (That is, any mod that does not disable achievements.) It is also compatible with mods who only extend game rules but not alter them. It will probably conflict with mods who also alter core game rule files.

Detailed Fix List:
Legend:
[Major] means some fix I think important.
[Balance] means it is partially bug fix and partially balance change. Pure balance tweak is not in scope of this mod.

# General Mechanics #
- Apply workaround to all diplomatic events, so that clicking close button no longer breaks the event's intended functionality. The actual bug lies in hard code and is beyond power of mod.
- Fix the bug that some special projects trigger event for wrong country, if the project's assigned planet changes owner before project completion. The most serious ones includes non-syntheic-ascended country (even Contingency!) gets cybernetic / synth species change, or non-psionic-ascended country gets access to shroud. This fix is done by changing the way how those special projects are issued. So it doesn't change behaviors of those projects already issued in an ongoing game.

# [Major] Fallen Empire and War in Heaven #
- Fix oversight of possible existence of crisis defender AFE in War in Heaven events, which can lead to chaotic and erroneous WiH.
- Make sure LNAP's leader lose its right when it leaves LNAP.
- Fix some other minor errors in War in Heaven.
- Fix some minor errors in fallen empire quest events.

# [Major] Precursor quest chain #
- Fix all bugs in precursor quest chain, primarily in locating and researching their home system, and also in generating new precursor artifacts to research. This part of mod is also released separately as a mini-mod ( http://steamcommunity.com/sharedfiles/filedetails/?id=867704361 ). See there details of bugs and fixes. Subscribers of this mod have no need to use that mini-mod, as all fixes are already here.

# Crisis events #
- Fix Sentinel fleet generation and Sentinel diplomacy options. Also make Prethoryn initial warning target correct systems.
- Prethoryn now destroys habitats when purge is completed, so that it won't colonize empty habitats, to turn them into infested planets.
- Slightly alter the structure of crisis beginning and ending events, so they won't be broken by custom government forms from other mods.
- Fix some minor issues in Contingency events.

# Horizon Signal events #
- Fix Horizon Signal event chain breaking technosphere event chain.
- [Balance] Tweak reward of event chain's ending (akx.10020), so that it's more reasonable.
- Fix one option of event akx.9310 having wrong name, thus failing localization.

# Technology #
- Fix some techs' drawing weight and ai weight which check wrong scientist in wrong department of research.
- Make tech_psionic_shield unsalvageable, like other psionic techs.
- Re-enable tech_sapient_ai for machine empire, to restore their tech tree integrity.

# Solar System Initializers #
- Fix minor errors in fallen empire system initializers.
- [Balance] Make some moons in some general solar systems that are dominated by gas giants with many moons (basic_init_03) potentially habitable.
- [Balance] Make sure those habitable planets in Enigmatic Fortress system are at least size 10.

# Planet, Planet Modifier, and Megastructure #
- Fix some planet modifier missing reference to alpine and savannah planet type.
- [Balance] Tweak the cost and time of terraforming barren / cold barren planets, so that they make sense.
- Remove capital modifier when the planet is no longer capital.
- Include pc_machine in colonizeable_planet scripted trigger (because it is colonizeable), so that you can't build habitat over it.

# Building #
- Fix habitat's capital building not getting extra unity from expansion tradition.

# Ship Behavior #
- Fix battleship formation behavior so that they correctly stay at max range.

# Ethic and Pop faction #
- Fix indoctrination has wrong effects
- Fix IMPERIALIST_SLAYER, SUPREMACIST_GIANT_MASSACRE, and XENOIST_RECENT_ENLIGHTENMENT demand, so you won't lose them if you complete the last quest of their kind.
- Fix ISOLATIONIST_NO_AGGRESSIVE_WAR and ISOLATIONIST_NO_DEFENSIVE_WAR, so the effect matches their description.

# Leader #
- Fix nervous and unstable_code_base trait, so they're correctly admiral traits, as advertised.

# Species rights #
- Fix a bug on assimilation species right policy, problems including cybernetic empire able to assimilate machine units, and biological ascended empire not able to assimilate hivemind drones.

# Anomalies and their events #
- Fix anomaly Projecting Moon, The Ransomeers, and Ancient Battlefield, so that they can spawn now.
- Fix event anomaly.3127, award energy deposits instead of betharian stone.
- Fix a minor error in event anomaly.4046
- Fix the AI admiral given by anomaly.4030 not correctly classified as Synthetic.
- Rewrite Gas Giant Civilization event chain, make it more robust.
- Fix a mostly harmless bug in anomaly Crystal Manufactory chain, that admiral can get computing expertise trait.

# Other events #
- Fix no-name-no-portrait bug in pop self modification event.
- Fix some event chains not checking location of their PoIs / special projects actually exist or not.
- Fix Mining drone survey chain stuck.
- Fix event colony.183 (Asteroid impact), so that no "magical safe pop number".
- Fix some potential bugs in event chain subterranean civilization.
- Remove observation outpost when the primitive civilization it observes is destroyed.
- Fix titanic life tile blocker set-up event not firing when playing with no tutorial.
- Fix event colony.1504 adding inaccessible mineral deposits to uninhabitable moon, instead of to planet itself as event text indicated.
- Disable tomb world colony events for those being converted into tomb worlds by other events.
- Fix becoming artist's patron not gaining relation boost.
- Fix patron renewal event not scaling cost to your empire size. Also, fixed so patron renewal event won't happen if artist ignores you.
- Fixed so destroying artist's station makes them always ignore you and reduce your relation with them.
- Fix one option's condition of event guardian.1061
- Fixed so blasting enigmatic fortress won't transform your ringworld and/or habitat in that system into molten planets.
- Fix event colony.2018 (Odd factory break), so that it functions as its text indicated.
- Fix event nomad.4 (Nomad settle in) not consider hive mind correctly. Make it also exclude non-servitor machine empire.
- Prevent observation events that may change planet's class from happening on ringworlds.
- Fix some event generated leaders not getting leader traits from cybernetic / synthetic / psionic racial traits.
- Remove abandoned_terraforming modifier left by abandoned terraforming event chain, when you later manually terraform that planet. Also, make the event chain not triggerable on planet already terraformed.
- Fix a bug in cultist event chain that sometimes no cultist fleet is spawned.
- Introduce a curator research agreement renewal event, just like strategic resource trade renewal of trader enclave and patron renewal of artist enclave.
- Fix servitor's morale calculation, so that when its bio-trophy percentage is changed to between 1% and 9% from other ranges, modifiers of other ranges are correctly removed.
- Fix difficulty references in events, to accommodate new very hard difficulty.
- Fix dragon slaying event for gestalt consciousness.
- Fix enigmatic fortress chain for gestalt consciousness.
- Tweak so refugees won't move to planet under occupation. Also pop should not migrate to planet under occupation of crises.
- Fix trigger error of event syndaw.540 (in event syndaw.401), syndaw.521, syndaw.522.
- Fix so you can no longer get mining drone processing hub special project if the hub station is already gone when you first enter the system.
- Cancel shielded planet project when it's opened by another empire.
- [Balance] Add more ships to pirate fleet in ancient drone event chain (colony.1512~1514), so a lone spaceport isn't guaranteed to win any more.

==========

If you find anything wrong in my fix, please tell me in reply here. If you find bug in vanilla game, please report it to official bug report forum. I'll check there from time to time to see if there are some bugs fixable by modding.
You are welcome to merge fixes you like into your own project, as long as giving proper credit.

==========

Due to steamcommunity (therefore, steam workshop) is recently blocked in China, I have to suspend further update. I'll see if situation improves, or if I need to invest some tunneling tool.
 
Last edited:
  • 1
  • 1
Reactions:
This looks less like a fix and more like a 1/3-fix, 1/3-rebalance, and 1/3-changes-to-features-you-don't-like.

edit: This is definitely leaning more toward fixes now. Good work.
 
Last edited:
  • 1
Reactions:
This looks less like a fix and more like a 1/3-fix, 1/3-rebalance, and 1/3-changes-to-features-you-don't-like.
Well, if you use strictest definition, yes. That's why I list those changes in three parts. However, I am confident that those listed as "Most likely bugs" are truly most likely bugs. You can see bug report thread for my reasoning.

As for changes in last part, I can provide reasons, too. For example, Reason for the first change is as follow: In 1.2 and earlier version, habitable zone is between distance of 60 - 120. In 1.3 or later it's changed to between 60 - 100. The initializer script basic_init_03 generates a gas giant with up to 4 moons at distance of 105 or 115. Those are only planets within old habitable zone. Clearly it represents an sci-fi archetype of habitable moons around gas giant. As you can see, the change in 1.3 remove that possibility at all. I argue it is an unintentional collateral damage. So I move that gas giant 20 closer to star, make it within habitable zone again.

Now if you really insist, you can always manually remove some of files you don't like from the mod. Weapon changes are in common\component_templates. System initializer change is in common\solar_system_initializers\misc_system_initializers.txt . Mandate change is in events\mandate_events.txt .
 
As long as the changes are in the spirit of what paradox reasonably would have done then, in my view, its fine to bundle features or changes along with a bug fix. In this instance I do think all of them are reasonable. The only potentially suspect one is the influence mission reward, and you could argue the reward was not updated with the changes made to lengthen missions of this nature.

On a side note I double checked the bug reports mentioned regarding WiH and I'm really disappointed in paradox to see it so jumbled together. It really seems like too obvious of a conflict to miss, but thats merely opinion. It should not be difficult for additional functionality to account for rival FE's and crisis defender co-existing. There are multiple interesting interactions that could occur here where each side can have secondary objectives of rallying support from fighting the crisis instead of each other. Really just looks like a big oversight and kinda disappointing not to see it expanded upon.
 
Some notes to fellow modders, about some buggy / tricky triggers/effects I discovered:

1) About conditional option
There are two formats of conditional option:
option = { trigger = { <condition> } ... } When condition is unmet, this format will hide the option from UI only. It does not disable the option to AI, nor set its ai_chance to zero.
option = { allow = { <condition> } ... } When condition is unmet, this format will nullify effects in the option, as well as set its ai_chance to zero. It does not hide the option from UI. When selected, it behaves as if it's an empty option.
So if we want to truly disable an option when condition is unmet, we need to use both trigger = and allow = together.


Update: Still so in 1.6. Finally addressed in 1.8. Now trigger = { } correctly disable an option.

2) About adding resources to a tile
There are two ways to add resources to a tile.
One is add_deposit = <deposit_key> and its corresponding clear_deposits = yes.
The other is add_resource = { resource = <resource_key> amount = <amount> } and its corresponding clear_resource = yes. This way is deprecated per effect_docs, but still widely used in vanilla scripts.
The two clear_ effects will only clear resources added by their corresponding add_ effects, not the other one.
Now comes the buggy / tricky point. There is an optional component, replace = yes, of add_resource effect. This optional component has the same function as a clear_deposits = yes effect before its add_resource effect. So it will not clear resources added by prior add_resource effect(s).


Update: Still so in 1.6. Also fixed in 1.8. Now add_resource is no longer supported.

3) About adding anomaly to a planet and surveying
The effect add_anomaly = <anomaly_category_key> adds an anomaly to the planet. If the planet is not yet surveyed, surveying it by a science ship will reveal the anomaly. If the planet is already surveyed by a science ship, the anomaly is available immediately. If we use surveyed = { set_surveyed = yes surveyor = <target> } effect to make the planet surveyed before a survey by science ship, no matter prior to or after add_anomaly effect, the anomaly will be forever inaccessible. Because surveyed = { set_surveyed = no surveyor = <target> } does not work.

Update: Still so in 1.8.

4) About diplomatic event
The event with diplomatic = yes line is a diplomatic event. Such event has a close button at upper right corner, which is tied to option with default_hide_option = yes line, or the first option if none contains that line. The tricky point is, clicking the button is not 100% the same as clicking the option it tied to. If the option has is_dialog_only = yes line, clicking the button still closes the event window (so that there's no chance to see the response text, either). If the option has trigger = { <condition> } line and the condition is not met, clicking the button will equal to select an empty option. (This behavior is in contrast of such line in a normal event.)
There is another tricky point about diplomatic event. The after = { } module is executed whenever an option is selected (or the close button clicked), even if the option has is_dialog_only = yes line so that the event isn't over yet.

Update: In 1.5, if the default option is disabled by trigger condition unmet, clicking close button will select the first non-disabled option instead.
No further change in 1.6 and 1.8.
 
Last edited:
  • 1
Reactions:
Update:
Fix precursor event chain ending.

This update includes five new events to cover some situation missed in vanilla event design. It is unfortunately not possible to reuse vanilla event texts, so I have to create new localization contents. I currently has created English localization texts only. Other languages are beyond my ability.
 
Last edited:
With your mod installed, I've had a precursor anomaly pop up which gave me a special project for a different precursor event chain than the one I'd already started. I forgot to record the exact circumstances, but I think this happened after I'd already gotten (but not completed) 6 of the correct projects.
 
With your mod installed, I've had a precursor anomaly pop up which gave me a special project for a different precursor event chain than the one I'd already started. I forgot to record the exact circumstances, but I think this happened after I'd already gotten (but not completed) 6 of the correct projects.
Sometimes you have access to anomalies generated by your vassal / protectorate. That, while clearly not intended, is presented in vanilla as well. It is the limitation of anomaly system, and beyond my ability to fix. Of course, I can change the event to generate special projects directly instead of anomalies, but I'm undecided now such deviant from vanilla for a relative minor issue is a good idea or not.

How's your correct chain going? Does it point to precursor home system? Does it end correctly?
 
Sometimes you have access to anomalies generated by your vassal / protectorate. That, while clearly not intended, is presented in vanilla as well. It is the limitation of anomaly system, and beyond my ability to fix. Of course, I can change the event to generate special projects directly instead of anomalies, but I'm undecided now such deviant from vanilla for a relative minor issue is a good idea or not.

How's your correct chain going? Does it point to precursor home system? Does it end correctly?

Ah, that sounds like what happened, no big deal then. The correct chain led to the Cybrex home system, and unlocking the living metal research, though I also got a message about someone else beating me to it (system was in another empire's territory.)
 
Just started a new game with the most current version of this, didn't get a precursor chain triggering in my home system as you normally would with vanilla. Is that working as designed?
 
Just started a new game with the most current version of this, didn't get a precursor chain triggering in my home system as you normally would with vanilla. Is that working as designed?
WAD. I didn't change the way the event chain starts. It is randomly triggered, as in vanilla.
 
  • 1
Reactions:
Cool.
Played a test game with your latest patch through from the start. It took me a while to locate them (Irassia) but got them in the end - five from anomalies, one 'spawned' anomaly later on after the area was thoroughly surveyed. The precursor chain worked fine up until the home system event, it spawned in an AI's system and the AI got science ships there before I could, although I actually did beat it to surveying the Irassia planet, there were no anomalies and no events.

No message that the chain had ended either, so I imagine it's stuck in my log, much like vanilla - in some ways that's more frustrating for me than just missing out on the reward.

The other changes you've done seem quite good though. I'm using missiles in my game and they actually feel well balanced, not especially strong, but not so bad you'll get necessarily get slaughtered by mass drivers every time.
 
Cool.
Played a test game with your latest patch through from the start. It took me a while to locate them (Irassia) but got them in the end - five from anomalies, one 'spawned' anomaly later on after the area was thoroughly surveyed. The precursor chain worked fine up until the home system event, it spawned in an AI's system and the AI got science ships there before I could, although I actually did beat it to surveying the Irassia planet, there were no anomalies and no events.

No message that the chain had ended either, so I imagine it's stuck in my log, much like vanilla - in some ways that's more frustrating for me than just missing out on the reward.

The other changes you've done seem quite good though. I'm using missiles in my game and they actually feel well balanced, not especially strong, but not so bad you'll get necessarily get slaughtered by mass drivers every time.
You can't reveal anomalies inside border of other empire. Subjects may be exception. Your event chain should end once AI investigate the anomaly it found.

Missiles are better than vanilla. Though still far from balance in my opinion. However, further tweaks are arguably outside the realm of "fixes", and judging from discussions in main forum, mere tweaks are likely insufficient. So I leave it in its current status.
 
  • 2
Reactions:
Oh, well, I learned something new. The game's progressed three or four years since then so I had to check the save.
In gamestate, the planet Irassia has anomaly_category "IRASSIA". I guess that means the AI just needs to get off it's silicate backside and research the anomaly. It's two science ships are happily assisting research on planets, so it may not be a priority for decades to come. That's how it is I guess :)
 
OK, I'm still trying to work out this precursor thing when the Irassia home system spawned within an AI ally's borders, because the chain remains in my log for a few decades now.

I had a look at the save, and also tag switched to the AI in game to make sure. In the save file, the planet has an anomaly of category "IRASSIA", but the AI has surveyed it and not seen that anomaly. They have the Irassia artifacts quest, 2 out of 6 completed. If I understand correctly, looking through both the vanilla code and your fix, they still should have triggered the anomaly when they surveyed Irassia, and subsequently precursor.1601.

Maybe I ruined the anomaly somehow by surveying that planet first? I think they were my federation partner too way back then (it was in the early midgame I'm now in the early lategame), so they wouldn't have been able to survey it after me.

Next time I'll leave it for the AI's science ship next time and see what happens.
 
Last edited:
OK, I'm still trying to work out this precursor thing when the Irassia home system spawned within an AI ally's borders, because the chain remains in my log for a few decades now.

I had a look at the save, and also tag switched to the AI in game to make sure. In the save file, the planet has an anomaly of category "IRASSIA", but the AI has surveyed it and not seen that anomaly. They have the Irassia artifacts quest, 2 out of 6 completed. If I understand correctly, looking through both the vanilla code and your fix, they still should have triggered the anomaly when they surveyed Irassia, and subsequently precursor.1601.

Maybe I ruined the anomaly somehow by surveying that planet first? I think they were my federation partner too way back then (it was in the early midgame I'm now in the early lategame), so they wouldn't have been able to survey it after me.

Next time I'll leave it for the AI's science ship next time and see what happens.
Oh, exactly as what I was afraid. Your survey, as his federation partner, denied its chance to survey with its own science ship, so it couldn't reveal the anomaly. Yet as the system is within its border, no one else can reveal the anomaly, either. So it's a dead lock. It is unsolvable without either paradox changes the way anomaly works, or we ditch precursor homeworld anomaly.
 
  • 1
Reactions:
I wonder if there's a way to create an event that triggers if, for example, you have survey information for the home planet, the home planet is within your borders, but the anomaly hasn't been revealed? I'm not 100% sure how to script that, and even what the outcome should be, but it could clean these dead lock situations.
 
I wonder if there's a way to create an event that triggers if, for example, you have survey information for the home planet, the home planet is within your borders, but the anomaly hasn't been revealed? I'm not 100% sure how to script that, and even what the outcome should be, but it could clean these dead lock situations.
There is no trigger to check if an anomaly is visible or not.
I'm lean to remove homeworld anomaly. It is 100% chance to succeed, anyway, so what's the point of using clumsy anomaly mechanics? Though that change, if implemented, will certainly require a new game to function correctly. It is a rare case right now, so I'm still undecided yet.