Giter Site home page Giter Site logo

tww3_dynamic_disasters's Introduction

Dynamic Disasters

Dynamic Disasters is a mod/framework for Warhammer 3 which allows to easily build customizable disasters, with custom conditions/behaviors/missions... Kinda like endgames, but far more extensible.

Documentation

Each disaster included in this mod has its behavior documented at the start of its script, in script/campaign/dynamic_disasters/. If you want to know what each disaster does, go there and check it.

How to make new disasters

This mod dinamically loads disasters from lua scripts present in the script/campaign/dynamic_disasters/ folder. Files should be called disaster_whateveryouwant.lua. A disaster file needs to contain an lua object, a few associated functions, and must return the lua object at the end of the script. For an example, check disaster_example.lua. It contains all the stuff needed to just run, with specific documentation about each thing in the script. A couple of extra things to take into account:

  • The framework calls disaster:set_status() on load. Use it to initialize listeners.
  • The framework calls disaster:check_start() at the beginning of each turn, if nothing else causes the disaster to not trigger, like not being at the minimum turn. Use it to put conditions on when to trigger the disaster.
  • Remember to call disaster_example:finish() to properly mark the disaster as finished.
  • MCT integration is optional. MCT settings are updated when closing the MCT dialog or at the start of each turn, before processing disasters for that turn.
  • To add custom MCT settings for a disaster, add the key of the setting to the mct_settings table and the framework will try to load any setting called disaster_name_setting_key into disaster.settings.setting_key when loading settings. For an example, check the "enable_rifts" setting in the chaos invasion disaster.

Unit Mod integrations/Submods

For spawning armies, this mod uses hardcoded army templates (similar to what the endgames script uses). This means custom units will not appear by default in disaster-spawned armies. That can be solved by making a unit mod integration. Similar to how disasters are loaded, unit mod integrations are scripts dinamically loaded from script/campaign/dynamic_disasters_integrations/. The script just needs one line per unit/template/faction calling dynamic_disasters:add_unit_to_army_template. The framework will take care to ensure to only load the integration if the unit is valid, reporting any error to the logs. For more guidance, check the example.lua integration, or any of the other ones.

Currently, the framework has mod integrations with the following mods:

  • Cataph's Kraka Drak: the Norse Dwarfs 3.0
  • Cataph's Southern Realms (TEB) 3.0
  • Dead's Cathay Unit Pack
  • Dead's Kislev Units
  • Dwarf Thunderbarge
  • Expanded Roster - Beastmen
  • Expanded Roster - Dark Elves
  • Expanded Roster - Greenskins - Goblin Pack
  • Expanded Roster - Greenskins - Orc Pack
  • Expanded Roster - Norsca
  • Expanded Roster - Vampire Counts
  • Lost & Found: Dwarfs Collection
  • Skaven Doom Walker
  • Yin-Yin, the Sea Dragon & Warriors of the Jade Sea

The same goes for submods manipulating anything (including trigger conditions) of a disaster. You can overwrite any function of a disaster with your own, altering its behavior, using a lua script in the integrations folder. That's guaranteed to only load after Dynamic Disasters has been fully initialized.

Credits

  • Frodo45127: I made the whole mod.
  • The guys at the CnC discord: they helped me with all the issues I had with lua.

tww3_dynamic_disasters's People

Contributors

frodo45127 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

imrikus

tww3_dynamic_disasters's Issues

Bretonnian crusade fails turn after spawn

Bretonian mid-game crusade fails the turn after spawn (dyn_dis_bretonain_crusades_bad_end). Effect is still active on spawned armies.

Mods used (mod list from the mod manager):
2854131314|2859968660|2869552176|2789887182|2885767563|2949216752|2790197553|2922534576|2789858755|2795542235|2789853654|2810936088|2907466537|2790055541|2789854789|2918137037|2914599323|2914955087|2935815665|2926849712|2927235297|2915203772|2933549532|2961852689|2789921931|2789878031|2853433455|2864811951|2790490527|2877071147|2886173394|2926733791|2809686435|2789857593|2789906398|2789896451|2854849373|2856219244|2853474600|2878565209|2853069797|2843420163|2927955021|2867163312|2858804223|2853974146|2806090102|2860018514|2806090945|2860741213|2806052263|2793127003|2789857945|2791465729|2858832821|2857612635|2861006090|2794064207|2791241084|2790774407|2859802328|2854219972|2961085509|2789865816|2792727547|2943940309|2853228292|2857954773|2856679508|2862340751|2853029812

Log here
script_log_210423_0132_backup_dynamic_disaster_log.txt

Dwarf Endgame Not Triggering (3.0.1)

The Dwarf endgame does not trigger at the end of the warning timer.

I've attached a zipped save file that is 1 turn before the endgame is supposed to trigger.

Yvresse-1TurnB4DwarfEndgame2.1353271060598.zip

Note: I've got 57 mods active in this save (including this mod) and I'm not sure how to share the modlist in case that's helpful. (Let me know if there's some file somewhere that might log all of this that I can share)

I do have a number of mods that add/modify races. In case it helps in debugging (especially if the cause might be incompatibility), these are the race mods that are active in my save:

  • Cataph's Kraka Drak
  • Cataph's Southern Realms
  • Marienburg: The Merchant Empire
  • Legendary Characters 3.0
  • Mixu's Legendary Lords
  • Mixu's Slayer
  • Dead Of The Orient
  • OvN Lost Factions: Albion
  • OvN Lost Factions: Citadel of Dusk
  • OvN Lost Factions: Fimir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.