Wasteland 2: now with improved modding capabilities!

For community content (fan-art, fanfic, etcetera) for Wasteland 2.
Post Reply
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

Patch download: WL2_0.9.4.076.zip file at https://www.dropbox.com/sh/x36syu96ku75 ... g80ka?dl=0

Extract, replacing the Assembly-CSharp.dll file (make a backup first!) found in the "Wasteland 2 Director's Cut/Build/WL2_Data/Managed/" folder, which in most cases will be located at "C:/Program Files/Steam/steamapps/common/".

Make sure to also download the Localization.zip and extract the contents into your "/WL2_Data/StreamingAssets/Localization/" folder.

NOTE:
  • Gamepad support is currently bugged, so you must use a mouse.
  • Save format is unchanged, so can always go back to the original DLL and continue your progress.
  • A few small mods that were previously separate are now bundled in the updated DLL. They can be enabled in the Options-->Modding panel from the main menu. They are best turned on before or at the start of a new campaign, as not all effects are retroactive.


PATCH NOTES
(refer to the links for full notes, including on modding changes)

0.8.2
0.8.3
0.8.4
0.8.5
0.9.0
0.9.1

0.9.2
GENERAL CHANGES
  • the tooltips shown when mousing over Attributes or Skills will now display all the DerivedStats that are modified by it
  • certain tooltips have been adjusted
    • some of the base game's tooltips did not accurately reflect how the game does its calculations
      • for example, using the original Assembly-CSharp.dll: 1) start with even Luck and Awareness scores, 2) add 1 point to each, 3) Evasion value shown in lower-left of the screen remains unchanged, even though supposedly each point was adding +0.5%
      • same with the vision range displayed for Awareness, value should be rounded off rather than showing decimals
    • Perception Skill now also shows its effect on vision range and perception radius
    • when mousing over the current Attribute value, will show affected DerivedStats rather than remaining blank
    • fixed minor display bug from the base game; when hovering over the current Attribute value, would sometimes erroneously show a point cost of 12
    Image
0.9.2b
0.9.2c
0.9.2d

0.9.3
BASE GAME BUG FIXES
  • loaded ammo is no longer weightless
  • weapon fieldstripping drop chances now match the values displayed in the popup message
    • actual drop chances in the base game are half the listed values
    • eg. if popup message says chances are 40% Sturdy Mag, 10% Underbarrel Flashlight, 50% Junk Weapon Parts, real odds are 20% Sturdy Mag, 5% Underbarrel Flashlight, 75% Junk Weapon Parts
  • "Ruined Weapon" precision strike effect was reported to cause crashes when used on certain NPCs like the Scorpitron; all NPC-only weapons can no longer be destroyed
  • if you had accrued enough XP to gain multiple levelups at once, the bonus hitpoints from Luck could be incorrectly calculated
  • the bonus hitpoints gained due to Luck by recruitable NPCs would be lost if they were dismissed then later rejoined
  • base game incorrectly uses Mob.HatesParty rather than Mob.IsEnemy when determining if there are any nearby enemy mobs to apply the under pressure penalty for assault/sniper rifles, leading to two adjacent hostile NPCs giving each other under pressure penalties while a PC will have no effect on a NPC
  • several fixes to the range gradient shown directly above your current weapon on the main HUD
    • would assume beyondOptimalChanceToHit was always negative, even though some sniper rifles don't have any
    • wouldn't show bonus falloff from pointBlankChanceToHit in optimalRange
    • some weapons, like the Bullpup Sniper Rifle, would cause the gradient to end up too wide
  • StatusEffect tooltips would not show their evasion & damage modifiers in some cases
  • small memory leak in EventManager.Publish
  • Disparnumerophobia quirk, if applying a debuff, wouldn't let you raise an Attribute by only 1 point
  • first weapon tooltip after you switched to a different character's inventory would occasionally not be set wide enough and text would end up getting unnecessarily wrapped
  • in rare circumstances, text wrapping was causing unnecessary line returns to be added
  • on the character screen, Skill bar ticks would often end up grayed out and would require mousing over to return them to their proper color (blue grey)
  • on the character screen, Skill bar ticks would occasionally not be clickable if the mouse had previously been hovering over the Skill name
  • when adding perks to a character that had none, the perks would sometimes show up halfway down the learned perks panel
  • Ascetic Trait no longer gives Attribute and Skill points again if starting a new game and importing a veteran character with the quirk
  • On the Mend perk was previously increasing the amount healed by the PC's medkits by 10%, including when applied to other squad members
  • Master Hunter perk tooltip was incorrectly stating a -75% Friendly Fire chance when it was actually -100%
  • the unlearned perks list was not correctly updating after adding a perk, eg. if you acquired Precise Hunter, you would need to leave the character screen entirely then come back to be allowed to select Master Hunter
  • if you equipped an item that boosted max carry weight, the label in the inventory screen wouldn't update until you left the inventory screen
  • after unjamming a weapon, the Reload button on the main HUD would still show the Unjam tooltip rather than switching to the Reload one
  • the rare legs precision effect is now permanent like all other precision strike StatusEffects
  • in a few places, the base unmodified (ie. no items) Skill level was being incorrectly utilized
  • Free For All perk was affecting Blunt weapons too
  • lots of other minor tooltip and UI fixes
GAMEPLAY CHANGES
  • some differences in how calculations are rounded
  • bonus hitpoints due to Luck added for CNPCs; previously, all had none, regardless of their Luck scores
  • added 3 Attribute points to Gary Wolfe and 2 Skill points to Brother Thomas as they did not have the appropriate amount given their levels
  • no longer allowed to spend more than 10 points in an Attribute (base game allowed it if score was being penalized by an item or StatusEffect)
  • Glancing/Opportune/Strategic Strike perks will now attack enemies passing near the PC; before it would only attack if they started their turn adjacent to the PC
  • required Attribute scores for certain weapons and armor now use adjusted Attribute values (ie. including modifiers from items and StatusEffects) rather than base Attribute scores
  • Hypochondriac and On the Mend Traits now also affect the amount healed when reviving an unconscious PC
  • base game gives melee attackers +40 hit vs targets crouching in the open, now targets crouching in low cover are also similarly penalized (moddable via the chanceToHit DerivedStat)
GENERAL CHANGES
  • tooltips more informative, some things not previously shown were nonetheless happening in background; notably impacted are the Strength, Perception and crouch/stand tooltips
  • when using the Field Medic skill, you can now click on a PC's model to heal them rather than only being able to click on their portrait
  • Mercaptain's vendor screen slightly improved
  • Careful/Precise/Master Hunter perks now directly affect chanceToHit, so will show up as a reduced chance to hit friendlies whenever hit chances are displayed
  • tooltip backgrounds made darker, the base game's are a little too transparent and so can occasionally be hard to read
  • when in combat, the rogue chance on the character screen will now be properly updated to reflect certain CNPC's hate for some enemies; tooltip also shows which NPCs are causing the extra rogue chance
  • if an item has multiple Attribute score requirements, the tooltip will now properly display which missing Attribute is causing which penalty
  • tooltips on vendor screen kept overlapping the panel on the right, defeating its purpose, so now tooltips on vendor screen appear to the left of the item
  • armor tooltip no longers combines the combat speed penalty with that from any Attribute requirements
  • Attribute and Skill bar ticks only ever show the base, permanent value, ie. points spent plus any bonuses/penalties from Traits
  • game should be more consistent in how it selects a PC for Skill usage when the "Highest Skill Character Used" gameplay option is enabled, always deferring to the currently selected PC in cases where another PC has the same Skill level
0.9.3b

0.9.4
BASE GAME BUG FIXES
  • when hovering over a portrait in the HUD, the keycode (eg. "[F2]") wasn't being displayed on the tooltip because the display code was interpreting it as a text formatting command
  • on the vendor screen, the comparison tooltip showing a currently equipped item was treating the equipped item as if it was a vendor-owned item when calculating the price
  • several minor bugs fixed in the portrait panel during character creation
  • fixed bug with visible mods often not appearing on the avatar's weapon in the inventory screen
  • visible weapon mods will now be shown on weapons carried on a character's back
  • when a CNPC was being asked to rejoin a full squad, the stats and equipment from the base CNPC were being displayed, even if the CNPC had leveled up or now had different equipment
GENERAL CHANGES
  • additional settings added to to the Gameplay tab on the Options menu
    • Staehrminator's Free Combat Camera mod now integrated
    • "Bird's-Eye View Camera" option available if you want to zoom the camera out even further
    • "Allow revisiting shrines" replaces the old TrackShrinesIndividually setting from "Table\Game.mson"
  • Modding tab added to the Options menu
    • settings.ini no longer used, any changes will need to be re-done using the new Modding Options panel
  • during character creation, can now select portraits for any gender or NPC
    • game now supports "Male" and "Female" directories in the "Import\Portrait\" and "Custom Portraits" (usually at "Documents\My Games\Wasteland2DC\Custom Portraits\") folders; portraits in the base folders are assumed to be Neuter gender
    • Image
  • encumbrance now shown on loot windows
    • Image
    • Image
  • extra tooltips added to weapon stats on the HUD and inventory
    • Image
  • level and XP now shown on the tooltip when hovering over a portrait in the HUD
  • game no longer generates the text for every tooltip (hundreds of them!) each time the attributes/skills window is brought up or an attribute/skill is increased
0.9.4b
BASE GAME BUG FIXES
  • vendor price of weapons with mods attached now properly calculated; before, the mods would be ignored entirely
  • item stacks would sometimes have a price disparity
    Image
  • on the item description panel on the right of the vendor screen, hovering over a ModSlot that was filled with a weapon mod would cause the whole item description to be scrolled up and out of sight
  • on the CNPC dismissal screen when attempting to recruit a CNPC when the squad is already full, hovering over a weapon of a party CNPC would cause the game to scroll over and center on that CNPC unnecessarily
  • the encumbrance icon displayed above the HUD portrait was not being updated immediately after depositing items in the Ranger storage locker
GENERAL CHANGES
  • price tooltip added to item description panel on right of the vendor screen
    Image
    • small (0.15 second) delay added before item description panel switches to another item being hovered on
  • on the Modding tab in the Options menu, entering a custom mod folder name that doesn't exist will now cause it to be created rather than disabling the custom folder option
0.9.4c
0.9.4d
0.9.4e
0.9.4f
0.9.4g
0.9.4h
0.9.4i
0.9.4j
0.9.4k
0.9.4l
0.9.4m
0.9.4n
0.9.4o
0.9.4p
0.9.4q
0.9.4r

0.9.4s
BASE GAME BUG FIXES
  • Trait_GlancingStrike_Blunt line of perks did not always function properly as the perk was expecting WeaponType.Melee and some blunt weapons are set to WeaponType.Melee_2H
    • affected weapons: Blunt_Tier_3_1_TheOrder, Blunt_Tier_4_1, Blunt_Tier_5_1, Blunt_Tier_5_1_Truth, Blunt_Tier_5_2, Blunt_Tier_6_1, Blunt_Tier_6_2
0.9.4t
0.9.4u
0.9.4v

0.9.4w
BASE GAME BUG FIXES
  • hostile party followers will have their hate reset when a savegame is loaded
0.9.4x
BASE GAME BUG FIXES
  • Bloodthirsty perk was incorrectly displaying that your character gained an action point from an ambush, even though no action point would be received on the following turn
0.9.4y
0.9.4z
0.9.4za
0.9.4zb
0.9.4zc
0.9.4zd
0.9.4ze
0.9.4zf

0.9.4zg
GENERAL CHANGES
  • Vulture's Cry will now have her equipment placed in her inventory if it is recovered from Harold
0.9.4zh
GENERAL CHANGES
  • can now allow modifying the clothes worn by CNPCs by going into Options --> Modding tab; turn this off if you want to dismiss them as that option is obscured while this is active
0.9.4zi
GENERAL CHANGES
  • can now disable the laser pointer visual effect of the underbarrel weapon mod by going into Options --> Modding tab
0.9.4zj

0.9.4zk
BASE GAME BUG FIXES
  • MobInfoTooltip should no longer obscure the health bar above a character's head
0.9.4zl

0.9.4zm
BASE GAME BUG FIXES
  • large item tooltips will no longer start offscreen; exceedingly tall tooltips will be scaled down to fit the screen
0.9.4zn

0.9.4zo
GAMEPLAY CHANGES
  • when hovering over a skill value that unlocks a perk, the tooltip will now also show the perk benefits instead of only the perk name
  • some items that have no use in quest or dialogue have been set to 'junk'
0.9.4zp
BASE GAME BUG FIXES
  • Gary "NaCl" Wolfe can be recruited if you accept Sadler's quest
0.9.4zq
BASE GAME BUG FIXES
  • eight hats that were available at character creation lacked a name or description
  • Brother Stahl's mission will be promptly cleared if the DBM take control of the canyon
0.9.4zr
BASE GAME BUG FIXES
  • Ranger Citadel and Prison maps were missing level music
0.9.4zs
BASE GAME BUG FIXES
  • the hospital patients inside the Titan bunker all had the same castIds, which would mean the Surgeon skill was not usable on any remaining patients after a reload
GAMEPLAY CHANGES
  • if dismissed, Angela Deth will now return to Ranger Citadel, inside at the museum
0.9.4zt
BASE GAME BUG FIXES
  • resolved issues with Ralphy getting stuck at the playground
    • if loading a save where Ralphy had already bugged out at the playground, he'll now properly run home
  • Josie in Hollywood was incorrectly included in a Salt Thugs combat group, causing her to go hostile alongside them
    • if already hostile, that should be removed upon loading
GAMEPLAY CHANGES
  • Ralphy's mom will now offer her son to the Rangers repeatedly
0.9.4zu
0.9.4zv

0.9.4zx
BASE GAME BUG FIXES
  • previously saved speaker settings were not being loaded on game start
GAMEPLAY CHANGES
  • added additional tooltips on the character screen
  • clown costume worn by PCs with the Raised in the Circus quirk can now be disabled by going to the Modding section in the Options screen
0.9.4zy
GAMEPLAY CHANGES
  • weight displayed will be for a single unit on the popup screen when you right-click on an item
0.9.4zz
FEATURES
  • added supersampling antialiasing (SSAA) to the game, available in the Display Options
    • will internally render at twice the resolution width and height before downsampling for output, producing much better image quality than other forms of antialiasing
    • no blurriness like with FXAA
    • particularly effective at lower resolutions like 1080p
    • much more GPU-intensive as four times the pixels need to be generated, ie. 1080p --> 4K, 4K --> 8K
    • UI not affected, still need to figure out how to get that working
    • screenshot comparisons at 1080p (zoom in to see the actual differences):
  • completely rewrote code for overhead health bar and icons, should now remain a more consistent distance above a character's head, and icons (such as the merchant indicator) should no longer end up being overlapped by the health bar
0.9.4.053
0.9.4.054
0.9.4.055
0.9.4.056
0.9.4.057
0.9.4.058
0.9.4.059
0.9.4.060
0.9.4.061
0.9.4.062

0.9.4.063
BASE GAME BUG FIXES
  • game should do a better job of showing drop percentages when field stripping
0.9.4.064
GENERAL CHANGES
  • FOWRevealRange changes are now propagated promptly
0.9.4.065
0.9.4.066

0.9.4.067
BASE GAME BUG FIXES
  • rabbit leap animation was bugging out half the time, preventing the attack from completing
0.9.4.068

0.9.4.069
GENERAL CHANGES
  • ammo display on main HUD now also includes the amount of ammo remaining in the inventory
0.9.4.070
GENERAL CHANGES
  • loading times should be quicker now
  • adjusted the timing of dodge animations when attacked by ranged weapons
0.9.4.071

0.9.4.072
GENERAL CHANGES
  • non-hostile NPCs now have blue health bars
  • item tooltips reworked to be more readable
  • precision strike tooltips provide more information
  • original pre-Director's Cut conversation font now available on Gameplay Options screen as 'Consola'; game default is 'Arial'
GAMEPLAY CHANGES
  • removed limit on the number of times Scotchmo will ask to join the Rangers
BASE GAME BUG FIXES
  • Sadler's dialogue was not being displayed correctly
  • some interactable objects in Rodia were not showing all applicable skills
0.9.4.073
GAMEPLAY CHANGES
  • Ruined Weapon effect from arm precision strike can now destroy melee weapons
BASE GAME BUG FIXES
  • Tom's quest in Canyon of Titan will be resolved if he dies, rather than remaining unfinished in the journal
  • some interactable objects in Angel Oracle were not showing all applicable skills
  • Paladino no longer yells about his watch once it has been recovered
  • Nurse Flinkman's 'Thief' dialogue option is removed once the quest is complete
  • resolved movement issue with crucifix in Angel Oracle
  • Takayuki displayed text now matches the "That ain't right." spoken audio
0.9.4.074
GENERAL CHANGES
  • expanded clothing options available in character creation
  • swapped weapon model and inventory icon for AK-47 and AK-97
BASE GAME BUG FIXES
  • at Fletcher's Hideout, text for the event was still showing up when the actual characters were no longer present
0.9.4.075
GENERAL CHANGES
  • status effect indicators will now appear on the overhead health bars
  • increased the size of the status effect icons on the HUD
    • can be turned off in Gameplay options
  • inventory icons for some items changed to utilize sprites that were previously unused
  • Glancing Strike line of melee feats now show ambush overhead icon above character while active
  • in Highpool, Jackhammer's appearance has been adjusted
  • a few skin colors adjusted; Black and VeryBlack were light brown at best before
    • character creation shows skin as darker than they will appear in-game
GAMEPLAY CHANGES
  • looting radius increased by 30%
BASE GAME BUG FIXES
  • if target of an ambush was moving, they would sometimes teleport to their destination after the attack finished
    • Wasteland 3 supposedly also suffers from this bug
    • fix was simple, in AIAction_Path.IsComplete method, change "if (this.navMeshAgent.pathPending)" to "if (!this.pathCalculated)"
    • Unity's NavMeshAgent seems to have an issue where not all values are immediately updated and require waiting until the next frame
    • remainingDistance property will report 0, even though destination is correctly set and actual distance to destination is definitely greater than 0
0.9.4.076


MODDING
THE FOLLOWING INFORMATION IS NOW OLD AND MAY BE OUT OF DATE
  • Export object data: "Export All Objects" in Options-->Modding tab. Game objects like ItemTemplates, NPCTemplates, DropSets, StatusEffects, etc. will all be written to the "Export" folder to assist with modding. 'Scene' (map) specific objects will be written the first time the scene is loaded.
  • Allows applying override files to more object types: Traits, CNPCTemplates, DropSets, SpecialAttacks, AIWeightTemplates, WorldMapRandomEncounters, etc. previously could not be altered via MSON files.
  • All fields are now writeable to: the base game has issues with properly reading MSON files in certain circumstances, and hence fields like validMods in ItemTemplate_Weapon could not be modified.
  • Improved object referencing: the base game has only a limited capacity for finding and linking to other objects, therefore many fields that require a reference to other objects cannot be changed. Currently, the modified game only allows linking to objects already loaded by the time the main menu is reached after starting the game, which includes:
    • all: ItemTemplate, StatusEffect, JournalEntryTemplate, WorldMapRandomEncounter, WearableInfo
    • many: AIWeightTemplate, DropSet, MobTemplate, SpecialAttack
    This will eventually be expanded so 'scene' (map) specific objects can reference other scene-specific objects (non-scene-specific objects will never be allowed to reference scene-specific to avoid problems of inconsistent availability). Note that if a MSON override provides an object name the modified game can't find, it'll leave the field unchanged, so if there was already a valid object reference there, it'll stay that way.
  • Expanded support for enumerations: enums can now be used as array/list indices, while for fields expecting a certain enum type, the enum name can be optionally provided. Enums are NOT case-sensitive.

    For example, the modClass field in ItemTemplate_Weapon is of type WeaponModClass enum. All the following are equivalent:

    Code: Select all

    modClass : SHOTGUN
    modClass : WeaponModClass.Shotgun
    modClass : 5
    Both the following are equivalent, altering only the 8th-element in the array.

    Code: Select all

    equipment :& [ EquipmentSlot.WeaponR : Energy_Toaster_Gamma_Ray ]
    equipment :& [ 7 : Energy_Toaster_Gamma_Ray ]
    Refer to the enums.txt file created in the "Export" folder after running the modified game for the first time for a list of enumerations and their constant names.
  • Set custom mod path: The game can be redirected to search for the "Mods" folder anywhere on a hard drive. The default "Mods" folder location is in the "Wasteland 2 Director's Cut\Build\WL2_Data\" directory (eg. "C:\Program Files\Steam\steamapps\common\Wasteland 2 Director's Cut\Build\WL2_Data\Mods\"). Since Windows doesn't normally like filepaths of more than 260 characters and some objects are heavily nested, you can create a folder like "C:\WL2" and then enter that path into CustomPath in the settings.ini to point the game to it.
  • Enable/disable the inXile logo movie: PlayLogo option in settings.ini. If you're tired of clicking through the logo movie for the millionth time.
inXile has a handy modding tutorial on their website, which will help familiarize you with the MSON format.

The modified game behaves just like the base one. MSON override files go in the "Mods\Import\" folder, and the same nested folder structure is used. You can find out where to place files by looking at the directories in the "Export" folder if the FullExport option in settings.ini is turned on.

Any messages concerning the loading of MSON files will be outputted to the debug_import.txt file in the "Mods" folder, so if a change doesn't seem to be working, check for any error messages there.

Note that even though the MSON files written to the "Export" folder will have a lot of data in them, the MSON overrides in the "Import" folder need only contain the field(s) that you wish to change. For instance, if you have FullExport turned on, then the AZ0_AngelaDeth_PC.mson file will be written to the "Mods\Export\MobTemplate\PCTemplate\CNPCTemplate\" folder. Yet if you only want to change her portrait, then a file called AZ0_AngelaDeth_PC.mson in "Mods\Import\MobTemplate\PCTemplate\CNPCTemplate\" containing the following is sufficient:

Code: Select all

{
	portraitTexture : wl2_portrait_kekahbah
}
For portrait object fields, don't include filename extensions (eg. ".png"). The game will first look for any PNG/JPG/JPEG file that matches the name in the "Mods/Import/Portrait/" folder, then in "%userdata/.../Custom Portraits/" (eg. "My Documents\My Games\Wasteland2DC\Custom Portraits\"), then finally the game will check all the built-in portraits. A list of built-in game portraits will be outputted to your "Export" folder after you run the modified game the first time.

Bear in mind that some NPCs have multiple NPC_Templates and Spawners that are used at different times, so depending on what you wish to accomplish, you may have to modify them all.

If you're editing the validMods field on weapons, I recommend removing all mods from any weapons that will be affected first (including those in your storage locker at Ranger Citadel), because it's doubtful the game will appreciate you loading up a savegame containing a weapon with a no longer legitimate mod attached to it.

Please inform me of any other issues you may have.
Last edited by Executor_ on November 19th, 2021, 12:35 pm, edited 128 times in total.
natty_dread78
Initiate
Posts: 16
Joined: January 3rd, 2017, 2:30 am

Nice, thxs a lot for sharing! I have downloaded the file. I will try the patch shortly and let you know how it works for me. I will be testing mainly the addition of status effects on shotguns.
natty_dread78
Initiate
Posts: 16
Joined: January 3rd, 2017, 2:30 am

Hello,
I have successfully tested your patch. The application of the patch was done very easily (I directly used an xdelta.exe in command line).
I tested the addition of the "blocked" status effect on shotguns, and then the addition of the "blocked" and "concussion" status effects.
Then I just kept the "blocked" effect (feels a bit OP otherwise), and played for about 2 hours.
I had 1 crash, but I don't think it is related to your mod. It happened when I quick reloaded in the middle of a "cutscene" (specifically when the pods attack people at the east greenhouse in AG, when they say they are in love with Kathy). We'll see if I have other crashes.
Next, I will change the valid mods on shotguns. Until now, I used the submachine guns modclass on them.
To summarize, the patch has been very successful for me so far. Thanks again for sharing!
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

If you have further crashes, try scrolling down to the bottom of the output_log.txt file in the "\Steam\steamapps\common\Wasteland 2 Director's Cut\Build\WL2_Data\" directory immediately afterwards and see if it mentions any errors.

Regarding StatusEffects, "Blocked" is a stackable -1 action point debuff, so it seems balanced. "concussion", however, is only -1 to Awareness, and I don't believe NPCs actually have attributes, so they're unaffected. Personally, I'd change "concussion" to something like:

Code: Select all

{
	expires : true
	duration : 1200
	
	statEffects : [
		{statName : actionRechargeRate,  amount : -2} // combat initiative
		{statName : actionPoints,  amount : -1}
		{statName : chanceToHit,  amount : -5}
	]
}
which should be fine since it wouldn't stack (unless you change the stackable field to true).
natty_dread78
Initiate
Posts: 16
Joined: January 3rd, 2017, 2:30 am

Ok, I'll make a copy of the output_log.txt file next time I have a crash.
Executor_ wrote:

Code: Select all

{
	expires : true
	duration : 1200
	
	statEffects : [
		{statName : actionRechargeRate,  amount : -2} // combat initiative
		{statName : actionPoints,  amount : -1}
		{statName : chanceToHit,  amount : -5}
	]
}
That is a very good idea, thxs! I'll experiment with that later.
natty_dread78
Initiate
Posts: 16
Joined: January 3rd, 2017, 2:30 am

I tested the modding of the concussion status effect (effect applied on all shotguns), as follows:

Code: Select all

{
   expires : true
   duration : 40
   stackable : true
   
   statEffects : [
      {statName : actionRechargeRate,  amount : -1} // combat initiative
      {statName : actionPoints,  amount : -1}
      {statName : chanceToHit,  amount : -5}
      { statName : chanceToEvade, amount : -5 }
   ]
}
Everything works correctly (duration, stackable, statEffects). No crashes so far (but only ~1hour of play).
Next I'll test the valid mods on shotguns, enabling barrels, chokes, underbarrels and magazines. Now the open choke will be useful since it will be possible to negate the range decrease by the long barrel.
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

Hmm, I think I didn't put enough checks around the code that disables the inXile logo movie. Shouldn't cause any crashes, but if PlayLogo is false in the settings.ini, then all movies will auto-cancel.

EDIT: OK, problem is resolved with patch_v0.8.1.xdelta. You'll need to download it from here or the updated link in the first post. Remember to restore to the original Assembly-CSharp.dll before applying the XDELTA patch.
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

0.8.2 released, link to download
  • fixed a probably quite rare crash bug related to my object database
  • improved method for bypassing inXile logo movie, before it was merely mimicking a button press, now circumvents playing movie entirely (I've tested this quite extensively, but if anyone has trouble reaching the main menu, let me know and I can revert to previous method)
  • some enums listed in the enums.txt weren't actually available for use in MSON files
  • the deserializer (import) now ignores the case of fields, so pretty much everything in a MSON file should now be case-insensitive
  • colon/ampersand order now ignored, ie. "&:" and ":&" considered equivalent
  • portraits.txt now outputted to "Export" folder, listing all the built-in portraits
  • can specify the folder for built-in portraits, though I only noticed a single minor differences, with "NPC/Wrecking Crew 2" vs "Male/Wrecking Crew 2" one being slightly more zoomed in, otherwise the portraits with the same name seem to be identical
    • if no portrait folder is specified, will default to "NPC/" folder, so the following works fine:

      Code: Select all

      {
      	portraitTexture : "Wrecking Crew 2"
      }
I'm currently working on getting the object database to update probably after each 'scene' (map) is loaded. Was intending to finish that prior to releasing the next version, but noticed the crash bug so decided to make sure a fix was available in case anyone was affected.
Felis7
Initiate
Posts: 3
Joined: January 22nd, 2017, 7:55 am

Hello.
First thank you for this amazing work.
I have a question about modding, is it possible to mod skills in this game? and to alter the way armor works, like in this mod "AlterativeArmorSystem" http://www.nexusmods.com/wasteland2/mods/12/?
sorry for bad english)
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

The game logic that determines how skills, traits (perks), armor, and everything else works is in the Assembly-CSharp.dll and hence really difficult to change. MSON files only allow altering the input values that the methods inside the Assembly-CSharp.dll use to produce an outcome.

I'll eventually get around to re-balancing the game, but for now I'm just trying to get everything related to MSON files working properly.
Felis7
Initiate
Posts: 3
Joined: January 22nd, 2017, 7:55 am

I see, but MSON files for perks are exist, aren't there files for skills?
The only way to change formulas is to hex-edit Assembly-CSharp.dll? There won't be easier method?

And one more question) You prevously posted "Massive data dump", are this data files outdated? DropSet files don't match newly created.
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

Felis7 wrote:I see, but MSON files for perks are exist, aren't there files for skills?
The latest version of the modded game does output the Skill class to the classes.txt. If you take a look though, you'll notice there's very few fields in there. Skills are mostly logic spread across hundreds of methods in dozens of classes. There are, however, several classes which I intend to make moddable eventually called Table_ChanceToHit, Table_SkillDifficulty, Table_XPFromSkillUse, etc. They just store arrays with various values. For example:

Table_ChanceToHit

Code: Select all

		Table_ChanceToHit.columns.Add("brawling", new int[]
		{
			25,
			65,
			70,
			75,
			79,
			83,
			87,
			91,
			96,
			102,
			110
		});
		Table_ChanceToHit.columns.Add("energyWeapons", new int[]
		{
			15,
			50,
			55,
			60,
			66,
			72,
			78,
			85,
			92,
			100,
			110
		});
Table_SkillDifficulty

Code: Select all

public static int[][] levelTables = new int[][]
	{
		new int[0],
		new int[]
		{
			0,
			0,
			1,
			2,
			4,
			5,
			6
		},
		new int[]
		{
			0,
			2,
			3,
			4,
			6,
			7,
			8
		},
		new int[]
		{
			0,
			3,
			4,
			5,
			7,
			8,
			9
		},
...
Felis7 wrote:The only way to change formulas is to hex-edit Assembly-CSharp.dll? There won't be easier method?
There are tools to make editing the Assembly-CSharp.dll easier. I can insert a new class of my own design without any difficulty. Some of the simpler innate game classes can also be re-compiled without issue. However, not everything de-compiles properly. The classes in the Assembly-CSharp.dll are littered with IEnumerable and IEnumerator methods which end up as special compiler-generated classes with convoluted code. Most .NET IL viewers will not de-compile this.

There is a tool that will de-compile the IEnumerable and IEnumerator methods around 97% of the way. It makes a few obvious mistakes that can be corrected without much effort, but it also at times leaves the odd line of code out. This is extremely dangerous. Because even if you can successfully re-compile the class containing the IEnumerable/IEnumerator, you don't know for sure that it's behaving exactly the same way as the original code without painstaking analysis of the resulting IL assembly or lots of in-game testing.

That is why I've confined myself to mostly inserting IL assembly when editing the innate game classes. I try to call a compiled method in one of the classes I added as soon as possible, because adding IL by hand is mind-numbingly slow work. A few lines of code in Visual Studio can be 10-15 lines of IL assembly which can take 10 minutes or more to insert into the DLL. You have to link every method and field reference used by looking them up yourself. If the existing method already contains local variables, and you want to insert another local variable ahead of them, you'll likely need to modify all the existing variable references. If you're adding IL around the location of a branch/switch target, you need to verify that the branch/switch was properly updated.

Most mistakes will promptly crash the game. Much more serious are those that don't. Then you don't know what's really going on behind the scenes and have no idea of the long-term consequences.

I'm not going to do anything to encourage this. People will start releasing "mods", secretly broken versions of the Assembly-CSharp.dll which don't crash very often but are corrupting data. Then everyone's going to stop using all the modified DLLs, including mine. I spend an inordinate amount of time testing, and even I can't guarantee nothing will slip through. I don't trust others to put in the same effort.
Felis7 wrote:And one more question) You prevously posted "Massive data dump", are this data files outdated? DropSet files don't match newly created.
The output should be pretty much identical, except for enums being outputted slightly differently. The base game's deserializer (import) doesn't accept the "EnumName.EnumConstant" format, only "EnumConstant" (eg. "WeaponModClass.Shotgun" vs "Shotgun"). The modified game supports both, and I find "EnumName.EnumConstant" easier to read.

Besides exporting additional classes like Drama_Vendor, the only other change I can recall is that there was a small bug in the output of CNPCTemplates in the old "Massive data dump". The data in the hateDisplayNames field wasn't always quoted when it needed to be.

The "Massive data dump" wasn't complete and only contained the output for several maps. I recommend using the FullExport option in the settings.ini, since then you'll get the MSON files for objects in every map you load.
Felis7
Initiate
Posts: 3
Joined: January 22nd, 2017, 7:55 am

thanks for the detailed answer.
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

Updated 0.8.3 version now available: link

CHANGELOG
  • Skills can now be edited (will be exported to "Mods/Export/BaseStat/Skill" folder if FullExport option turned on in settings.ini)
    • associatedAttribute by default is always "AttributeEnum.None", probably intentionally to disable the skill limit system
    • Skills can be limited by attribute score, from my limited testing, seems to function
      example:

      Code: Select all

      	associatedAttribute : AttributeEnum.Coordination
      	intLimits : [
      		{ intLevel : 1, allowedSkillLevel : 2 }
      		{ intLevel : 3, allowedSkillLevel : 4 }
      		{ intLevel : 5, allowedSkillLevel : 7 }
      		{ intLevel : 7, allowedSkillLevel : 10 }
      	]
  • Tables can now be edited (will be exported to "Mods/Export/Table" folder if FullExport option turned on in settings.ini)
    • contain lots of key values for skills, armor, experience/levels, etc.
    • best to test thoroughly if you change the size of the arrays (Table_Leveling should be safe though)
      • the UI likely only supports 10 skill levels, though I haven't tried increasing it yet
    • you can confirm changes have been correctly loaded by looking in the "ExportImport" folder, assuming ExportAfterMSONOverride option in the settings.ini is turned on
      • might want to set OverwritePreviousExportImports to true as well
    • note that you can use '&:' to make small changes easier
      • indices automatically incremented for succeeding values unless an index is provided
    • examples:
      Table_ChanceToHit.mson

      Code: Select all

      {
      	// will only change the first, second, and eleventh elements in the array
      	// (arrays/lists use zero-based indexing, so first element has index 0)
      	bluntWeapons &: {
      		columns :& [ 0: 30, 40, 10 : 120, ]
      		critMultiplier : 3
      	}
      	// will retain entire original columns
      	smg :& { 
      		critMultiplier : 7
      	}
      }
      Table_SkillDifficulty.mson

      Code: Select all

      {
      	// using enums as array indices
      	levelTables_3 :& [
      		SkillLevelCategory.Medium : 6
      		SkillLevelCategory.Impossible : 11
      	]
      }
      Table_Leveling.mson

      Code: Select all

      {
      	rows :& [
      		50 : 141000
      		51 : 146400
      		52 : 151900
      		53 : 157500
      		54 : 163200
      		55 : 169000
      		56 : 2147483647
      	]
      	ranks &: [
      		30 : "<@>2nd Lieutenant", "<@>1st Lieutenant"
      		"<@>Captain"
      		"<@>Major"
      		"<@>Lieutenant Colonel", "<@>Colonel"
      	]
      }
  • Deserializer (import):
    • fixed logic for whether to accept non-indexed values in arrays/lists
    • quoted strings could cause line numbers to be incorrectly tracked
    • fields of type non-UnityEngine.Object-derived class object that weren't arrays/lists of objects wouldn't actually get a value written to them as it was forgetting to update the field with a reference to the newly created object
    • deserializer should recover from errors better now
    • certain array/list fields now have a fixed-size based on what the base game expects
  • Serializer (export):
    • Item property in structs now ignored (still have no idea where it comes from)
    • AIWeightTemplate layout and comments redone
      • if you have FullExport on, might want to delete the existing ones in the "Mods/Export/AIWeightTemplate/" directory so they get re-exported
  • OverwritePreviousExportImports option added to settings.ini
  • inXile log now outputted if DebugMode is true in settings.ini; contains messages from the base game
  • loading portraits from the "Mods/Import/Portrait" folder wasn't working in 0.8.2 as it wasn't providing the full path
  • very rare NullReferenceException should no longer appear in output_log.txt
    • eg.

      Code: Select all

      NullReferenceException
        at (wrapper managed-to-native) UnityEngine.Component:get_gameObject ()
        at CHA_AttributeEditor.OnDestroy () [0x00000] in <filename unknown>:0
    • at first I thought I might've caused it, so I re-inserted all my changes into the original DLL, yet still saw it happen once in a while
    • took a look at the CHA_AttributeEditor.OnDestroy() code, and it uses two fields (plusButton and minusButton) but only did a null check on one of them
    • inXile probably didn't bother to fix it since it happened only rarely and I think the code is only called when the game is being exited anyway
Last edited by Executor_ on January 27th, 2017, 1:15 am, edited 1 time in total.
spectrefps
Initiate
Posts: 3
Joined: January 22nd, 2017, 2:51 pm

Awesome work! I have used this to make some tweaks to some of the Heavy Weapons and related perks to make them more competitive with ARs. However, I seemed to have hit a wall when it comes to implementing a custom StatusEffect (as opposed to simply changing/overriding a pre-existing one). The custom status effect is custom_MG_sap.mson (located in Import/StatusEffect) and is a full copy of AllTiedUp.mson with some specific stat value changes (for chanceToHit, combatSpeed, ActionRechargeRate).

I have the following lines in one of my Machine Guns that I am testing this with:

Code: Select all

percentToApplyStatusEffect : 99			// set high for testing purposes
statusEffect : [ custom_MG_sap ]		// custom status effect file located in the \Import\StatusEffect folder
This fails to apply the status effect to the weapon, and produces this line in debug_import.txt:

Error [Line 23 at 'custom_MG_sap'] Could not find an object of type StatusEffect named 'custom_MG_sap'.

I took a look at the custom object reference variations in the InXile WL2 modding guide and tried the following variations, with no luck:

Code: Select all

custom_MG_sap.mson					// error: cannot find object
@"custom_MG_sap.mson"					// error: cannot find object
@"StatusEffect\custom_MG_sap.mson"		// error: invalid character in name (assuming it's the "\") 
@"StatusEffect\custom_MG_sap"			// error: invalid character in name (ditto)
@"StatusEffect.custom_MG_sap.mson"		// error: cannot find object
Been at this for a few days now, no progress so far. Anything I'm missing with this? Your patches work like a charm for modifying practically ANY of the core assets. Could it simply be that the game just won't recognize any status effect files are not specifically overriding existing ones (in some hardcoded list)?

Id appreciate any insight you have on this, as your knowledge of the game's data structures (especially for modding purposes) is very impressive to say the least!
User avatar
sear
Developer
Posts: 2733
Joined: March 21st, 2012, 8:30 am
badge image for 4o80c0.png

I just want to chime in and say that I think it's super cool for you to be doing this. I'm not a programmer, so I won't pretend I know the details on that end, but we're always excited to see what players cook up with respect to mods. ;)
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

spectrefps wrote:Been at this for a few days now, no progress so far. Anything I'm missing with this? Your patches work like a charm for modifying practically ANY of the core assets. Could it simply be that the game just won't recognize any status effect files are not specifically overriding existing ones (in some hardcoded list)?
Yeah, it won't work. It's actually something I've been working on since the initial release of the modded game, but I got distracted the past few days while I got the Tables editing working. The base game only supports adding new ItemTemplates and DropSets, as they're the only ones that have a FromString method written for them. Adding DropSets might still function in the modded game right now, new items probably not.

I intend to get ItemTemplates and DropSets working again in the next major release, as well as being able to add new StatusEffects and Traits. Although the latter two might be really easy to enable, so I might do an interim release just for them.

Also, this reminds me of one of the items on my long todo list: write an issues list! :P

NOTE: Full 0.8.3 patch changelog now available; post has been edited above.
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

0.8.4 now available (link)

CHANGELOG
  • new StatusEffects can now be added to the game
  • new Traits can now be added to the game (screenshot)
    • good example of subTraits and requiredTraits usage can be found at "Mods/Export/BaseStat/Trait/Trait_CarefulHunter/Trait_PreciseHunter.mson" if you have FullExport turned on in settings.ini
  • refer to mod-created objects like you would any other UnityEngine.Object, ie. just the filename, without extension (ie. ".mson") and no folder path, in quotes if there's a space in the name
  • will need to provide a full MSON file for a new object, as every important field will need to be filled
  • make sure new objects are placed in the correct folder, as the game will crash otherwise
    • I haven't written enough checks yet so it'll create a blank placeholder object then a while later try to override it and won't be able to find the MSON file if it's in the wrong directory
  • Table_PCStats now also available for editing, will be exported to "Table" folder like the rest of them
    • has leadership, chaBonusPercent, and barterSkillLevelPriceAdjustment fields
  • requiredStatValues field in overrided Traits probably wasn't doing doing anything before
  • 0.8.3 likely wasn't exporting portraits.txt when it should've
Last edited by Executor_ on January 28th, 2017, 1:28 am, edited 1 time in total.
spectrefps
Initiate
Posts: 3
Joined: January 22nd, 2017, 2:51 pm

Just read the update notes, amazing work yet again! And thanks for the fast response to my previous issue, read it at work but didn't get a chance to respond until now. Thought I was messing up the file/folder-reference syntax until I read your response. Now to get to work making some new traits for SMGs and Shotguns (to bring them to par with my machineguns of doom XD). Once again, amazing job with your updates! Definitely breathing new life into WL2 (and enabling so many modding possibilities)! :D
Executor_
Explorer
Posts: 341
Joined: August 11th, 2014, 5:38 am

Just tested and object inheritance (ie. copying an existing object) seems to work. It's an alternative to a MSON file for a new object with every field provided.

Examples:
Mods/Import/StatusEffect/adrenalineShot - Copy.mson

Code: Select all

adrenalineShot : {
	displayName : "<@>Adrenaline Shot II"
}
Mods/Import/BaseStat/Trait/Trait_AdrenalineRush/Trait_AdrenalineRush - Copy.mson

Code: Select all

Trait_AdrenalineRush : {
	displayName : "<@>Adrenaline Rush - Improved"
}
Sequence of events is:
  1. Built-in StatusEffects/Traits loaded
  2. Placeholder objects created for any StatusEffect/Trait MSON whose name doesn't match one of the above built-in ones
  3. Object database created
  4. MSON overrides applied
Since the built-in StatusEffects/Traits are added to their lists first, they'll get their overrides applied before any mod-created objects inherit from them.
Post Reply

Return to “Wasteland 2: Community Content”