Wasteland 2: now with improved modding capabilities!

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

Moderator: Ranger Team Alpha

Post Reply
scramjetbooster
Initiate
Posts: 12
Joined: December 15th, 2017, 5:48 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by scramjetbooster » January 9th, 2018, 6:51 am

Thanks! Works like a charm! Oh, btw my debug_import.txt shows this error:

Code: Select all

	WARNING: the ItemTemplate name 'Sniper_Tier_1_2' is reserved for internal game use; ignoring "ItemTemplate/ItemTemplate_Equipment/ItemTemplate_Weapon/ItemTemplate_WeaponRanged/Sniper_Tier_1_2.mson"
Does that mean the item's mson is off limit to editing?

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 10th, 2018, 9:24 am

Nah, it's fine, just ignore that warning.

I should fix it so it only outputs that warning if you're actually creating a new ItemTemplate rather than merely editing an existing one. There's a TemplateSubstitutions dictionary in the original code wherein it'll try a different ItemTemplate name if it can't find a match on the first attempt.

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 13th, 2018, 6:08 am

Hi Executor_, I have a question:
I am trying to achieve a situation when attached mod will give same result(damage, range, peteration etc.) while being attached to different weapons.
So I've tried something like this:
statModifiers : [
{
when : [ Situation.Always ]
statName : clipSize
tooltipId : ""

subset : [ Situation.Always ]
operation : Operation.Multiply
value : 0.0
}
{
when : [ Situation.Always ]
statName : clipSize
tooltipId : ""

subset : [ Situation.Always ]
operation : Operation.Add
value : 40.0
}

]
But unfortunately only Operation.Multiply is taken into account regardless of order I put it. Is there some way to drop stat to zero and then add desired bonus?
Thanks a lot.

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 13th, 2018, 9:05 am

No, not possible. The reason being is that you can't control the order that StatModifiers are added up. Let's say there's a perk, a trinket, and a weapon mod all affecting the same stat. If what you wanted was possible, the outcome could be different depending on whether the weapon mod StatModifiers went first, second, or last. The current implementation does multipliers last to ensure the calculated result is always the same.

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 13th, 2018, 10:53 am

Actually, now that I think about it, yes. You'd have to use the subset fields as each subset is calculated separately before being added up to get the total stat value.

However, you'd first have to set the clipSize field for all relevant weapons to 0, and add to each weapon's statModifiers something like:

Code: Select all

{
	statModifiers : [
		{
			when : [ Situation.Always ]
			statName : clipSize
			tooltipId : null
			
			subset : [ Situation.LightArmor, Situation.HeavyArmor, Situation.Unconscious ]
			operation : Operation.Add
			value : #
		}
	]
}
subset being any combination of Situations that no perk, etc. would ever use for calculating clipSize; basically anything unique to your mod. Fill in the value (ie. the '#') with the original clipSize number. "null" for the tooltipId so that it'll never be shown on any tooltips; "" (blank string) being the default tooltip display text.

Then in your weapon mod, you would do something along the lines of:

Code: Select all

{
	statModifiers : [
		{
			when : [ Situation.Always ]
			statName : clipSize
			tooltipId : null
			
			subset : [ Situation.LightArmor, Situation.HeavyArmor, Situation.Unconscious ]
			operation : Operation.Multiply
			value : 0
		}
		{
			when : [ Situation.Always ]
			statName : clipSize
			tooltipId : ""
			
			subset : [ Situation.Always ]
			operation : Operation.Add
			value : 40
		}
	]
}

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 13th, 2018, 11:17 am

I see, thanks for the quick answer. Another question: Is it possible to affect initial equipment rangers get at the gamestart via .mson files?

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 13th, 2018, 11:27 am

Yes. Edit the startingGear field in Skills. Look at fieldMedic, doctor and the weapon Skills for examples.

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 13th, 2018, 11:35 am

Worked like a charm so it is possible after all, thanks! I cant say that I understood why subsets magic is working but it works(I think there were detailed explanations earlier in this thread - I will read them)!

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 13th, 2018, 12:14 pm

Subsets can use any arbitrary combination of Situations since they don't actually care what the current "situation" is (ie. ranged weapon, or NPC target, or point blank range). Subsets are just a way of subdividing a stat calculation, mostly if you want to only apply a multiplier to a specific component.

Functionally, the subset field is just the name. When designing the StatModifiers, I could've used any enum in place of Situations for the subset, or indeed a string or number. I think I originally had some other ideas for the subset field, which is why it ended up as a bunch of Situations.

The important thing when using subsets is that unlike the when field, which allows partial matches, subsets must be identical to affect one another (the order of the Situations isn't important though).

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 14th, 2018, 3:22 am

Thanks for an explanation.
1. Is it possible to make visible those stats?
actionPointCostToUnjam :
actionPointCostToReload :

2. Do tags have some usage?
3. Is it possible to add some text (explanation) to the firing mod?
4. Can you give an example of " requiredAttributeValues : { }" syntaxis(e.g strength : 5, heavygun : 4)?

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 14th, 2018, 9:35 am

1. Those and the under pressure penalty I never got around to adding to item tooltips when I was working on 0.9.3. I'll get it done eventually.

2. Tags aren't used too much by the game, mostly some quest scripts. There's a list of the ones used by the base game in the miscellaneous.txt file in your "Mods\Export\" folder.

3. Not at the moment. Wouldn't be too hard for me to add the ability to display a custom string, though, so I'll add it to my todo list.

4. Blunt_Tier_5_1_Truth uses requiredAttributeValues:

Code: Select all

	requiredAttributeValues : {
		coordination : 5
		strength : 7
	}
Note that it's limited to Attributes, so you can't use Skills. The penalties are tied to Table_MissingAttributeRequirements, found in the "Mods\Export\Table\" folder.

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 15th, 2018, 2:05 pm

0.9.4b now available here.

Make sure to also download the Localization.zip and extract the contents into your "...\Steam\steamapps\common\Wasteland 2 Director's Cut\Build\WL2_Data\StreamingAssets\Localization" folder.

Like always after a new release, delete your "Mods\Export\" folder if it exists.

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
UPDATED GAME BUG FIXES
  • enabling the "Bird's-Eye View Camera" on the Gameplay tab in the Options menu now updates the render distance for the currently loaded map; before, would only do so when future maps were loaded
  • text for Bomberman and Focused Shooter/Confident Shooter/Zen Shooter perks no longer applied to every item
  • Master Thief perk text was not being displayed on the Lockpicking and Safecracking Skill tooltips
  • the encumbrance icon displayed above the HUD portrait was not being updated immediately after firing a weapon
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
MODDING
  • can now enter custom display names for FiringModes
  • new Situations
    • Buying and Selling; only set when calculating Price DerivedStat
    • PiercedArmor; attack calculation order:
      1. whether target was hit
      2. whether target was crit (if so, CriticalHit Situation added)
      3. whether target's armor was penetrated (if so, PiercedArmor Situation added)
  • corrected unnecessary warnings output to debug_import.txt when editing the Bladed_Tier_1_3, Handgun_Tier_1_3, and Sniper_Tier_1_2 ItemTemplates

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 16th, 2018, 2:46 pm

Thanks a lot for the new features, Executor_!

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 16th, 2018, 3:56 pm

Executor_ wrote:
January 14th, 2018, 9:35 am

4. Blunt_Tier_5_1_Truth uses requiredAttributeValues:

Code: Select all

	requiredAttributeValues : {
		coordination : 5
		strength : 7
	}
Note that it's limited to Attributes, so you can't use Skills. The penalties are tied to Table_MissingAttributeRequirements, found in the "Mods\Export\Table\" folder.
1. Does that mean that only two types of penalties are available(Chance to hit and combat speed), or you can somehow edit them?
2. I am trying to implement one idea for a firing mod. If your target is in cover you just shoot through the cover with penetration penalties but with decreased chance to hit penalties. I've tried code below but I can't tell if it is working(changes where not shown im tooltip). Any suggestions how to make it visible?


firingModeInfos : [

{
displayName : "Long Burst"
actionPointCost : 9
shotsPerAttack : 5
chanceToHitPenalty : 10

statModifiers : [ ]
}
{
displayName : "Through The Cover"
actionPointCost : 6
shotsPerAttack : 1
chanceToHitPenalty : 0

statModifiers : [

when : [ Situation.RangedWeapon, Situation.Target_InCover ]
statName : chanceToHit
tooltipId : null

subset : [ Situation.Target_InCover ]
operation : Operation.Add
value : 15

when : [ Situation.RangedWeapon, Situation.Target_InCover ]
statName : armorPenetration
tooltipId : null

subset : [ Situation.Target_InCover ]
operation : Operation.Add
value : -2

]
}
]

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 17th, 2018, 12:27 am

1. Yeah, those are the only penalties currently available. It's part of the original game's code, and I haven't gotten around to making it more moddable yet.

2. In your "Mods\Import\Table\" folder, create a file named Game.mson and put the following inside:

Code: Select all

{
	debugStats : [
		{
			statName : chanceToHit
			mobName : ""
			combatOnly : true
			targetedOnly : true
		}
		{
			statName : armorPenetration
			mobName : ""
			combatOnly : true
			targetedOnly : true
		}
	]
}
If you already have a Game.mson, just add the debugStats portion to it.

In combat, shoot a target, then press Escape to pause the game. Alt-Tab out and open the debug_statcalc.txt file in the "Mods" folder and scroll down to the bottom. All the modifiers applied to the calculations will be listed there.

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 17th, 2018, 10:32 am

Executor_ wrote:
January 17th, 2018, 12:27 am
1. Yeah, those are the only penalties currently available. It's part of the original game's code, and I haven't gotten around to making it more moddable yet.

2. In your "Mods\Import\Table\" folder, create a file named Game.mson and put the following inside:

Code: Select all

{
	debugStats : [
		{
			statName : chanceToHit
			mobName : ""
			combatOnly : true
			targetedOnly : true
		}
		{
			statName : armorPenetration
			mobName : ""
			combatOnly : true
			targetedOnly : true
		}
	]
}
If you already have a Game.mson, just add the debugStats portion to it.

In combat, shoot a target, then press Escape to pause the game. Alt-Tab out and open the debug_statcalc.txt file in the "Mods" folder and scroll down to the bottom. All the modifiers applied to the calculations will be listed there.
Thanks for the explanation.
Concerning penalties, how can I choose wich penalty to apply(e.g. low strength character has combat speed penalty)?

Is it possible to apply stat modifier to all team members. (e.g weaponsmith skill lowers chance to jam to the whole team)?

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 17th, 2018, 10:44 am

You can't choose which penalty to apply at the moment. Weapons always get the chanceToHit one, while armor gets the combatSpeed reduction.

No. I've put some thought into party-wide StatModifiers but it remains on the backburner for now, since it would require quite a bit of work to implement.

Shadow Jack
Novice
Posts: 34
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » January 18th, 2018, 12:00 am

I think I found a bug. If you copy heavyGun.mson from Export to Import game fails to load initial menu. Other weapon skill msons work fine.
Below are the contents of the named mson.
{
displayName : "<@>Heavy Weapons"
description : "<@>Heavy machine guns are the three hundred pound gorillas of the weapon world. Take this training if you like big guns that fire a lot of bullets.\n\nStrengths\n[00cc00]+ High damage\n+ Good Armor Penetration\n+ Large clip size[-]\n\nWeaknesses\n[cc0000]- High AP cost to attack\n- Can slow movement speed in combat\n- Cannot use Precision Strikes[-]"
hotkeyDescription : ""
tooltipStrings : [
{
id : ""
text : "<@>Heavy Weapons"

valueAsPrefix : true
displayMethod : StatDisplayMethod.Difference
reverseSign : false
includeUnits : true
}
]
supplementalTooltipStrings : [ ]

atlas : WL2_Icons // sprite database
spriteName : T_AntiTank // name of the image to use from the sprite collection
category : Category.Combat

xpNextLevelCost : [ ] // skill point cost to gain respective skill level; if empty, uses defaults
isLocked : false // if true, an ItemTemplate_UsableXPGiver is required to unlock this skill
isHidden : false
mimicXPsOf : "" // name of the skill to copy the skill points of; mostly for use with hidden skills
associatedAttribute : AttributeEnum.None // AttributeEnum.None is treated as an attribute score of 10 for determining any limits on max skill level
limits : [ ] // constraints on max skill level due to 'associatedAttribute' score

SuccessXP : 10 // unused
CriticalSuccessXP : 15 // unused

statModifiers : [
{
when : [ Situation.Always ]
statName : chanceToHit
tooltipId : base

subset : [ Situation.Always ]
operation : Operation.Add
table : [ 20.0, 45.0, 51.0, 57.0, 64.0, 71.0, 78.0, 86.0, 94.0, 102.0, 110.0 ]
useBaseValue : false // if true, any adjustments to the Attribute/Skill from items, StatusEffects, etc. will be ignored while finding the entry in the 'table'
}
{
when : [ Situation.Always ]
statName : criticalHitChance
tooltipId : base

subset : [ Situation.Always ]
operation : Operation.Add
table : [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ]
useBaseValue : false // if true, any adjustments to the Attribute/Skill from items, StatusEffects, etc. will be ignored while finding the entry in the 'table'
}
{
when : [ Situation.SpecialAttack ]
statName : chanceToHit
tooltipId : baseSpecialAttack

subset : [ Situation.SpecialAttack ]
operation : Operation.Add
table : [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ]
useBaseValue : false // if true, any adjustments to the Attribute/Skill from items, StatusEffects, etc. will be ignored while finding the entry in the 'table'
}
]

startingGear : [
{ itemTemplate : MachineGun_Tier_1_1, minQuantity : 1, maxQuantity : 1 }
{ itemTemplate : Ammo_556mm_S, minQuantity : 45, maxQuantity : 45 }
]
}

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 18th, 2018, 6:10 am

0.9.4c now available here.

Just fixes the heavyGun Skill override crash.

Executor_
Scholar
Posts: 180
Joined: August 11th, 2014, 5:38 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » January 20th, 2018, 1:06 am

I've going to begin work on 0.9.5 now. First steps:
  • Go to PC class. Select all. Cut. Paste into Mob class.
  • Go to PCStats class. Select all. Cut. Paste into MobStats class.
  • Go to PCTemplate class. Select all. Cut. Paste into MobTemplate class.
I'm finally going to do NPC stats (including perks), proper NPC inventories, and add a durability score to items, like I promised a long while ago. It'll include a lot of related stuff, like randomly generating appropriate stats and items + mods + ammo for NPCs, so don't expect another game update for quite a while.

Better NPCs should address the difficulty problem in the game, ie. on Supreme Jerk difficulty, NPCs do double damage while your squad does half damage. Once NPCs have a level and Attribute/Skills/Traits, they can simply be "levelled up" on higher difficulties rather than receiving such crude bonuses.

Item durability will hopefully help fix the in-game economy. You soon end up with way more scrap than you have things to spend it on. Once you need to repair your weapons and armor frequently, it'll drain a lot of that scrap out of the game. Dropped weapons from NPCs will mostly be in poor condition, and higher tier weapons will cost far more to repair.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest