Wasteland 2: now with improved modding capabilities!

For community content (fan-art, fanfic, etcetera) for Wasteland 2.

Moderator: Ranger Team Alpha

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 29th, 2017, 12:39 am

Behind the scenes, there's 3 different types of attacks: Attack, ConeAttack, and AreaAttack. The reason why that's not working is because only shotguns use the 'coneAngle' stat. Only energy weapons use the 'conductiveMultiplier' and 'nonConductiveMultiplier' stats. Only ItemTemplate_WeaponAoe and ItemTemplate_WeaponBoobyTrap use 'aoeRadius'.

I haven't thought about weapons using non-standard attack types before, but implementing it might not be too difficult. You'd specify in the fireMode the attack type, eg. 'coneAttack' or 'energyAttack'. Most of the work would come from going through the code and stripping out references to specific types of ItemTemplate_Weapons for each attack. Doubt it'll make it into the 0.9.3 update though, but I can include it in 0.9.4. That update won't involve a massive number of changes like 0.9.3 so it should only take about a month.


Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 29th, 2017, 9:36 am

Thank you. I'll try to get that implemented once 0.9.3 is done.

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » September 9th, 2017, 2:57 pm

0.9.3 alpha version updated, still HIGHLY EXPERIMENTAL and so not for playing the campaign with:
In the "Experimental" shared Dropbox folder: https://www.dropbox.com/sh/x36syu96ku75 ... g80ka?dl=0
Direct link: https://www.dropbox.com/sh/x36syu96ku75 ... delta?dl=0

As always with a new version, delete your "Export" folder.

I haven't been able to work much on the game this past week, so not as much progress as I would've liked. The main difference from the previous alpha version is UI support for multiple ItemTemplate_Ammo using the same Caliber. I also drastically rewrote the CHA_AttributeEditor and CHA_SkillEditor classes since inXile's implementation was a mess as well as being occasionally buggy, like with the Disparnumerophobia quirk. Finally, I've fixed up a lot of the bugs I created while working on 0.9.3. Traits are still only partly functional, though.

There's a test mod available at: https://www.dropbox.com/sh/x36syu96ku75 ... d.zip?dl=0
Extract it so it overwrites your "Mods" folder. It includes some example ammos and mods that you can play around with. If you load a save, the game will put a bunch of them in your first character's inventory if the MSON files have been correctly extracted (EDIT: must have at least 2 party members).

Trait mod has had some minor adjustments: https://www.dropbox.com/sh/x36syu96ku75 ... d.zip?dl=0
Brawling mod (unchanged): https://www.dropbox.com/sh/x36syu96ku75 ... ng_mod.zip

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » October 9th, 2017, 12:43 pm

Release of the 0.9.3 update should be fairly soon. I've finished testing all the Traits, fixing quite a few bugs I created. Now I just need to do a bunch of general gameplay testing, mostly playing the game for a ton of hours. Unless I find lots of serious and time-consuming to fix bugs, 0.9.3 should be available within a week.

Sebastian
Initiate
Posts: 11
Joined: July 19th, 2017, 3:57 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » October 11th, 2017, 4:43 am

:D :!:

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » October 13th, 2017, 2:50 pm

0.9.3 now available here

CHANGELOG
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
MODDING
  • BaseStats now far more moddable
  • new Skills (except Skill_Challenge) can be added
  • 'statModifiers' replace previous 'stats' fields; far more flexible and can situationally apply bonuses and penalties (see earlier discussion here)
  • new Calibers, ModClasses and ModSlots can be added
  • any ItemTemplate_Equipment can have ModSlot(s), not just weapons
  • UI now supports multiple ammo types for a Caliber
  • ItemTemplate_WeaponRanged 'chanceToJam' field now a float
  • health state boundaries and difficulty modifiers editable, in "Table" directory in the "PC.mson" and "Game.mson" files, respectively
  • 'requiredStatValues' field for quirks now functions
  • SerializableDictionaries now case-insensitive
  • fixed up buggy base game implementation of SerializableDictionary's generic object methods; base game doesn't really use them but was causing issues with UnityEngine.Object.Instantiate when a PCTemplate was overriden
  • "&:" now appends to the array/list if no index is provided, previously would override elements starting from 0 if no index provided
  • arrays/lists/dictionaries/strings/objects can now be set to null
AVAILABLE MODS
Two small mods can also be downloaded from here
Extract them so they overwrite your "Mods" folder, default location is "...\Steam\steamapps\common\Wasteland 2 Director's Cut\Build\WL2_Data\Mods\".
  • TraitMod: perks now cost multiple points, but you receive 2 perk points per level
  • BrawlingMod: Brawling no longer gets +1 damage per character level, instead the Brawling Skill now gives a damage bonus
Like always after a new release, delete your "Export" folder. If you've done any modding previously, you might need to quite a bit of updating to your MSON files in the "Import" folder.

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » October 14th, 2017, 4:16 am

Needless to say, I've rewritten a ton of stuff. 0.9.2 --> 0.9.3 entails more changes than all my previous updates combined. It still remains backward-compatible savegame-wise though. A lot of the alterations are to the game's backend, so won't be immediately visible. How all the various stats (combat speed, chance to hit, damage, etc.) are calculated has been completely reworked. Also redone is how the text for most tooltips is generated. In fact, probably two-thirds of the time I spent on 0.9.3 was fiddling around with tooltips.

If you experience any crashes, bugs, slower performance compared to the base game, or simply odd behaviour, please let me know. In case of a crash or serious bug, check the output_log.txt file in the "Wasteland 2 Director's Cut\Build\WL2_Data\" directory for anything marked "exception" and post it here.

Additional modding notes:

You can set the game to output calculations to the 'debug_statcalc.txt' file in the "Mods" folder. Example:

Game.mson in "Mods\Import\Table\"

Code: Select all

{
	debugStats : [
		{
			statName : damage
			mobName : ""
			combatOnly : true
			targetedOnly : true
		}
		{
			statName : chanceToHit
			mobName : ""
			combatOnly : true
			targetedOnly : true
		}
	]
}
Note that not all objects that applied a modifier to a stat will show up in the outputted log section. For instance, the damage done is adjusted by game difficulty and certain traits before being applied.

The defaults for the Skill_Challenge field 'theOdds' are in "Table\SkillMetered.mson". The defaults for the Skill field 'xpNextLevelCost' are in "Table\Table_SkillLeveling.mson". Perception, Outdoorsman, Weaponsmithing, Field Medic, and Surgeon Skills have lots of custom code not yet moddable.

Some modding examples:

chanceToHit.mson in "Mods\Import\BaseStat\DerivedStat\"

Code: Select all

{
	initialValues &: [
		{
			when : [ Situation.HealthBelow75Percent ]
			value : -5
		}
		{
			when : [ Situation.HealthBelow50Percent ]
			value : -5
		}
		{
			when : [ Situation.HealthBelow25Percent ]
			value : -5
		}
	]
}
would result in PC/NPCs receiving a penalty to chanceToHit of up to -15 as their health drops. A list of Situations can be found in "Mods\Export\enums.txt" after running the modded game for the first time.

strength.mson in "Mods\Import\BaseStat\Attribute\"

Code: Select all

{
	statModifiers &: [
		{
			when : [ Situation.ThrownWeapon ]
			statName : attackRange
			tooltipId : "thrown"
			
			table : [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ]
		}
	]
}
attackRange.mson in "Mods\Import\BaseStat\DerivedStat\"

Code: Select all

{
	tooltipStrings &: [
		{
			id : "thrown"
			text : "<@>Range<@> - <@>Thrown"
		}
	]
}
would result in PCs receiving an range bonus for throwing grenades equal to their Strength score.

If you wanted to reduce the impact of initiative/Awareness/Speed on combat, you could do something like

initiative.mson in "Mods\Import\BaseStat\DerivedStat\"

Code: Select all

{
	initialValues &: [
		{
			value : 10
		}
	]
}
which would result in PC/NPCs starting with a base score of 10 in initiative, before any other modifiers.

Note: you don't need to include default values for fields in the MSON file; 'when' and 'subset' field defaults to [ Situation.Always ], 'operation' field defaults to Operation.Add.

straightedge85
Initiate
Posts: 2
Joined: October 12th, 2017, 7:51 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by straightedge85 » October 19th, 2017, 3:32 am

This is fantastic. I'm really enjoy the game again with this!!

Thanks a lot.

However there's one question for the voice.
I would like to add audio & sound for my pc character.

But even if I add those on the ranger_male/female.mson,
It doesn't apply to actual save file.
(if it isn't flagged as "CNPC", whole audio related part dissapears)

Is there anyway to add this stuff??

Thanks again!

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » October 19th, 2017, 7:22 am

Not possible at the moment. WL2 only looks for sound files in the game's data files. Changing that would require editing the Assembly-CSharp-firstpass.dll file which contains most of the audio-related stuff.

Shadow Jack
Initiate
Posts: 1
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » October 25th, 2017, 8:11 am

First of all thanks a lot Executor_ for your amazing work! You gave a reason to replay this game. I want to ask you couple of questions. As I understood you have full access to game code. Does it means that you can edit quests? Can you tell me(or PM me) what tools you are using? I have very basic coding skills but I want to try to fix Prison quest(I really want to return an option(from Beta version of a game) to wipe out Scorpions during initial visit of the prison(before visiting Damonta).

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » October 25th, 2017, 1:13 pm

Sent you a PM.

straightedge85
Initiate
Posts: 2
Joined: October 12th, 2017, 7:51 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by straightedge85 » October 27th, 2017, 7:21 am

Executor_ wrote:
October 19th, 2017, 7:22 am
Not possible at the moment. WL2 only looks for sound files in the game's data files. Changing that would require editing the Assembly-CSharp-firstpass.dll file which contains most of the audio-related stuff.
Aha. Got it! Thx for fast reply. I have one more question. Can I make the character who failed to say, disarm the alarm, but to still get exp?

ps. I'm not native in English, so my grammar may be weird.

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » October 27th, 2017, 11:59 am

Sorry, can't do that either.

It would lead to game-y situations if you got experience for failing skill checks though, as it would encourage you to use characters with minimal skill levels in order to farm XP. I could add the ability to give XP when a PC critically fails in the next update, as you can only do that once.

Nikita-S-D
Initiate
Posts: 9
Joined: August 16th, 2017, 1:32 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » November 3rd, 2017, 5:02 pm

9.3 Is perfect, I'm very exited that you made this patch! I'm almost done with making mods for different items and finished with bullet types.
But I can't figure how to change DropSets.
For example, I want to change Ammo drop set, so I add "Tier 1 Ammo.mson" in to Mods/Import/DropSet with content like this:

Code: Select all

{
	associatedSkill : NONE    // DropSet.DropSkills enumeration; skill level determined by 'minSkill' in a Drop object
	
	drops : [
		{
			minSkill : 0
			
			chanceToDrop : 100
			minRolls : 1
			maxRolls : 1
			
			dropClass : 0
			dropItems : [
				{
					myType : ITEM // DropItem.DropType enumeration; determines whether 'item' or 'dropset' will be used
					item : Ammo_EnergyCell
					dropset : null
					
					percent : 15  // chance to drop
					min : 23      // minimum quantity dropped; only for items which can be stacked
					max : 25      // maximum quantity dropped; only for items which can be stacked
				}
				{
					myType : ITEM // DropItem.DropType enumeration; determines whether 'item' or 'dropset' will be used
					item : Ammo_45_S
					dropset : null
					
					percent : 20  // chance to drop
					min : 23      // minimum quantity dropped; only for items which can be stacked
					max : 26      // maximum quantity dropped; only for items which can be stacked
				}
				{
					myType : ITEM // DropItem.DropType enumeration; determines whether 'item' or 'dropset' will be used
					item : Ammo_12-00
					dropset : null
					
					percent : 15  // chance to drop
					min : 23      // minimum quantity dropped; only for items which can be stacked
					max : 26      // maximum quantity dropped; only for items which can be stacked
				}
				{
					myType : ITEM // DropItem.DropType enumeration; determines whether 'item' or 'dropset' will be used
					item : Ammo_50_S
					dropset : null
					
					percent : 10  // chance to drop
					min : 23      // minimum quantity dropped; only for items which can be stacked
					max : 26      // maximum quantity dropped; only for items which can be stacked
				}
				{
					myType : ITEM // DropItem.DropType enumeration; determines whether 'item' or 'dropset' will be used
					item : Ammo_762mm_S
					dropset : null
					
					percent : 30  // chance to drop
					min : 23      // minimum quantity dropped; only for items which can be stacked
					max : 26      // maximum quantity dropped; only for items which can be stacked
				}
				{
					myType : ITEM // DropItem.DropType enumeration; determines whether 'item' or 'dropset' will be used
					item : Ammo_9mm_S
					dropset : null
					
					percent : 10  // chance to drop
					min : 23      // minimum quantity dropped; only for items which can be stacked
					max : 26      // maximum quantity dropped; only for items which can be stacked
				}
			]
		}
	]
}

And after restarting game, all Tier_1_AmmoCrates are empty.

All I want is to add drops for my new ammo types and weapon mods.
Will appreciate for any help, cos I spend lot's of hours and tried all possible combinations, nothing helps.

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » November 4th, 2017, 1:14 am

I renamed quite a few fields in 0.9.3, and will likely do so again in future updates since I lack impulse control. In your specific case, I renamed myType to type and item to itemTemplate. That's why I always say to delete your "Export" folder after a new update, otherwise you can end up editing obsolete MSON files.

Also, it's a good idea to check the debug_import.txt file in the "Mods" folder if you're having any issues when modding. With your example, it would be saying "No field or property named 'myType' in class DropItem."

Nikita-S-D
Initiate
Posts: 9
Joined: August 16th, 2017, 1:32 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » November 4th, 2017, 9:01 am

Thank you mate! You save my day :)) I always delete Mods folder when update to new version, but in Mods/Export/DropSet no files and some other folders are empty too.
So I just downloaded Export.zip from your old post in "Massive data dump" thread.

I found 2 bugs, with bullet types.
1) When I have for example 100x Ammo_38_S bullets and only 2x Ammo_38_AP bullets, when I load _AP ones, and if I want to swith back to _S - I can do it only from inventory. And most important, when I shoot all Ammo_38_AP, and my magazine now empty (I only have 100x Ammo_38_S left in inventory) I can't switch bullet types even from inventory any more on this weapon without having at least 1x Ammo_38_AP bullet in inventory.

2) I add 12 Gauge SSG Ammo with coneAngle stat

Code: Select all

	statModifiers : [
		{
			when : [ Situation.Always ]
			statName : coneAngle
			tooltipId : ""
			
			subset : [ Situation.Always ]
			operation : Operation.Add
			value : 60.0
		}
	]
And this effect apply only if I switch bullets in inventory (not sure if it's only a UI bug).

To easily test this you can use my bullet types which you can find from first vendor after making new game.

https://drive.google.com/file/d/14Mlwam ... sp=sharing

Executor_
Acolyte
Posts: 98
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » November 5th, 2017, 1:18 am

0.9.3b now available here
CHANGELOG
  • fixed issue with multiple ammo types for a caliber wherein the currently loaded ammo type was being ignored if not also present in the inventory
  • bug fixed with character stats not being recalculated if the ammo type changed
  • slightly reworked how reloading works with multiple ammo types for a caliber, now only reloads automatically if previous ammo type available
  • jam chance previously did not utilize modifiers from Attributes/Skills/Traits/StatusEffects/etc., only weapon mods

Nikita-S-D wrote:
November 4th, 2017, 9:01 am
Thank you mate! You save my day :)) I always delete Mods folder when update to new version, but in Mods/Export/DropSet no files and some other folders are empty too.
So I just downloaded Export.zip from your old post in "Massive data dump" thread.
You probably exited the game before it had a chance to finish writing all the MSON files. After deleting your "Export" folder, it's best to let the game run for another 10-20 secs after reaching the main menu since there's a lot of files and it's a low-priority background task. It'll continue where it left off the next time you run the game if it didn't write them all previously.

The bugs you reported are fixed in the new 0.9.3b update. Hopefully I haven't introduced new bugs, since I didn't test everything again.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests