Wasteland 2: now with improved modding capabilities!

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

Moderator: Ranger Team Alpha

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 4th, 2017, 4:56 pm

Check the "Arizona" and "LosAngeles" directories in "Export". Each scene will get its own folder in one of those two directories as they're loaded in-game, including any scene-specific MobTemplates.

Note there's a bug wherein sometimes objects from a previous map will also get exported to subsequently loaded ones.

User avatar
Grave
Scholar
Posts: 142
Joined: June 14th, 2012, 7:52 pm
Location: At Scott's Bar, waiting for this radiation cloud to blow past...

Re: Wasteland 2: now with improved modding capabilities!

Post by Grave » August 5th, 2017, 5:34 am

Executor_ wrote:
August 4th, 2017, 4:56 pm
Check the "Arizona" and "LosAngeles" directories in "Export". Each scene will get its own folder in one of those two directories as they're loaded in-game, including any scene-specific MobTemplates.

Note there's a bug wherein sometimes objects from a previous map will also get exported to subsequently loaded ones.
So will the LA And AZ directories only show up once you load the maps in-game? I don't have those directories in my Export folder.
"One thing about the desert: anything goes. It's just one big lawless sandbox. Do anything you want, but just don't get yourself killed. That tends to shorten your life span incredibly. Good luck, and may your Uzi never jam."

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 5th, 2017, 5:58 am

Yeah, they'll be automatically created.

Are you sure you're using the latest version of the DLL: 0.9.2?

User avatar
Grave
Scholar
Posts: 142
Joined: June 14th, 2012, 7:52 pm
Location: At Scott's Bar, waiting for this radiation cloud to blow past...

Re: Wasteland 2: now with improved modding capabilities!

Post by Grave » August 5th, 2017, 11:43 am

Executor_ wrote:
August 5th, 2017, 5:58 am
Yeah, they'll be automatically created.

Are you sure you're using the latest version of the DLL: 0.9.2?
I'm pretty sure I am, but I'll have to wait until I get home to verify.

I don't suppose you could zip up those folders (with the MOBTemplates) and attach them to a post? I want to mod the characters before I start a new game.

Mainly what I'm trying to do is give each unique character their own portrait.
"One thing about the desert: anything goes. It's just one big lawless sandbox. Do anything you want, but just don't get yourself killed. That tends to shorten your life span incredibly. Good luck, and may your Uzi never jam."

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 5th, 2017, 3:41 pm

ZIP with all the Spawners/MobTemplates in the game: https://www.dropbox.com/s/d54az3bv8jlkvqd/npcs.zip?dl=0
Put files in the "Mods\Import\" folder to override.

Since a lot of the MobTemplates are used by multiple NPCs, it might be better in some cases to edit the Spawner instead.

You don't need to use the entire exported MSON file for the overrides, ie. you can prune them down to just the fields you want to edit; eg.

NPCTemplate:

Code: Select all

{
	portraitTexture : wl2_portrait_kekahbah
}
Spawner:

Code: Select all

{
	bOverridePortrait : true
	overridePortrait : wl2_portrait_Priestess
}
It'll mean faster loading times and be less likely to cause bugs.

Also, don't include filename extensions (eg. ".png"). The game will first look for any PNG/JPG/JPEG file that matches the provided 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 the built-in game portraits is included in the ZIP file.

EDIT: Updated download link. Previous ZIP was missing a bit of data.

User avatar
Grave
Scholar
Posts: 142
Joined: June 14th, 2012, 7:52 pm
Location: At Scott's Bar, waiting for this radiation cloud to blow past...

Re: Wasteland 2: now with improved modding capabilities!

Post by Grave » August 5th, 2017, 8:00 pm

Man, you rock Executor! Thanks for going above and beyond with helping me out. I definitely have my work cut out for me now.

And I verified... I have 0.9.2. installed.
"One thing about the desert: anything goes. It's just one big lawless sandbox. Do anything you want, but just don't get yourself killed. That tends to shorten your life span incredibly. Good luck, and may your Uzi never jam."

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » August 16th, 2017, 1:50 am

Executor_ wrote:
March 15th, 2017, 11:03 am
[*]added new constant to WeaponModClass enum: MachineGun
[*]heavy machine gun items now have the modClass field set to WeaponModClass.MachineGun rather than WeaponModClass.None; WeaponModClass.MachineGun defaults to zero mod slots
I still didn't find a way to make special Barrel WeaponMod only for MachineGun (Heavy Machine Gun Rifled Barrel). Will be great to see ability to add custom new ModSlots not only for Weapons but even for Armor.
As well, will very appreciate if you'll add ability to change armorPenetration with WeaponMods or even Ammo.Caliber consumption (with adding a new calibers or ammo mods).

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 16th, 2017, 2:50 pm

Yeah, you can't create new ModSlot types at the moment. But looking at the related code, it might not take much work to allow adding new ones. If so, I'll try to include it in 0.9.3.

As for armorPenetration, that's already moddable in 0.9.3, along with every other derived stat I could find, like the conductive/non-conductive multipliers for energy weapons, ranged weapon burst fire size, AoE radius, etc. You'll also be able to influence when modifiers are applied thanks to several dozen Situations like Standing, Crouching, Human, NPC, RangedWeapon, UnderLeader, Target_ConductiveArmor, Target_MeleeWeapon, Target_Crouching, Target_InCover, Target_Synth, etc. which you can mix and match. Furthermore, you'll also have quite a bit of control over how the calculations are done.

ItemTemplate_Ammo, as well as FiringModeInfo (for ItemTemplate_WeaponRanged) and SpecialAttack will be capable of modifying whatever stat they like in 0.9.3. The classes that are already capable of doing so (ItemTemplate_Equipment, ItemTemplate_Mod, StatusEffect, and Trait) via their various "stats" fields will now use the new system. Attributes and Skills will also have it, as it's been migrated over from DerivedStat.

Getting multiple ammo types for each caliber to work fine would take quite a bit of effort though, as the UI isn't set up to support it.

0.9.3 is probably still a month away from release. The new stat calc system is working. The main thing left on my plate is porting as many Traits over to it as possible, as right now they're all pretty much hard-coded. After that is an extensive series of tests to make sure I haven't broken the game somehow.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » August 17th, 2017, 3:56 am

That sounds awesome, looking forward to see this changes! I'd like to suggest you to upload your source in to GitHub or GitLab, and I will be able to help you with coding at free time. As well I can help you with UI art for reloading or with images for ammo types.
ImageImage
Last edited by Nikita-S-D on August 17th, 2017, 5:40 am, edited 1 time in total.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 17th, 2017, 5:32 am

Nikita-S-D wrote:
August 17th, 2017, 3:56 am
That sounds awesome, looking forward to see this changes! I'd like to suggest you to upload your source in to GitHub or GitLab, and I will be able to help you with coding at free time.
I've thought about it, but I doubt that inXile would be pleased, and I prefer to keep the legal issues to a minimum.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 17th, 2017, 2:37 pm

OK, done some work on this. New ModSlot types can now be created, as well as ModClasses. ItemTemplate_Armor (along with all the other ItemTemplate_Equipment derived classes) can have mods added.

http://i.imgur.com/o1QymSa.jpg
http://i.imgur.com/APKytkK.jpg
http://i.imgur.com/pNNkUVz.jpg
http://i.imgur.com/ac0Ot1f.jpg
In the above screenshots, I created a couple new ModSlots: "HMG Barrel" and "HMG Mag". "Open Choke" ItemTemplate_Mod was overrided to use the "HMG Barrel" ModSlot for testing.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » August 18th, 2017, 7:27 am

More ammo images, in case if Executor_ will make an ability for WeaponMods to change ammoCaliber or bulletType.
Vanilla images on the left.
ImageImageImage

ImageImageImage

ImageImageImageImage

ImageImageImageImageImage

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 18th, 2017, 5:13 pm

Those are really nice. I'd definitely appreciate any help with the graphical side of WL2 modding, as my artistic talents only extend as far as MSPaint. I'm mostly focused on making the game more moddable right now rather than creating complex MSON mods for it, as a lot of the stuff I want to change is still hard-coded or not implemented.

If anyone wants to preview the upcoming changes in 0.9.3, I'm making the latest HIGHLY EXPERIMENTAL build available:
In the "Experimental" shared Dropbox folder: https://www.dropbox.com/sh/x36syu96ku75 ... g80ka?dl=0
Direct link: https://www.dropbox.com/sh/x36syu96ku75 ... pha.xdelta

Delete your "Export" folder before running it. Best to rename your "Import" folder too as any existing MSONs will probably need to be updated.

Don't actually play the campaign with that build as there's going to still be lots of bugs. It's more for loading up a save and messing around with all the new modding possibilities. If you experience crashes, search for 'exception' in output_log.txt in "Steam\steamapps\common\Wasteland 2 Director's Cut\Build\WL2_Data\" folder.

0.9.3 encompasses a ton of changes, although a lot of them are to backend code. BaseStats and ItemTemplates have been altered quite a bit. New Skills can be created, though Skill_Challenge isn't fully done yet. Not all Situations (for 'statModifiers' fields) are implemented yet, and 'UnderPressure' is definitely buggy. Traits are likely only semi-functional. To add to ModSlots and ModClasses, Calibers can now be created/edited. After running the modded game once, check the classes.txt and enums.txt files in the "Export" folder, along with all exported MSON files, to find class changes.

I haven't tested how well it works with ranged weapons, but you should be able to design new ItemTemplate_Ammos. Just make sure to create a "Sprite" folder in the "Mods\Import\" directory and place your PNG/JPG files in there. Afterwards, set the 'atlas' and 'spriteName' field to the name (no extension) of the picture, ie. if there's a "Mods\Import\Sprite\newAmmo1.png" that you want to link to, the MSON override would contain

Code: Select all

{
	atlas : newAmmo1
	spriteName : newAmmo1
}
Also available are two small mods to adjust gameplay:
Trait mod: https://www.dropbox.com/sh/x36syu96ku75 ... it_mod.zip
Brawling mod: https://www.dropbox.com/sh/x36syu96ku75 ... ng_mod.zip
Extract them so they overwrite your "Mods" folder.

The Trait mod changes perks so that they now require multiple points to acquire. Each character receives 2 perk points on each level up rather than 1 every four levels.

In the base game, brawling weapons receive +1 damage per character level. The Brawling mod disables that and instead adjusts the "brawling" Skill so that it grants additional damage with higher skill level.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 19th, 2017, 5:10 am

Let's say you want to make a Trait/ItemTemplate_Trinket/StatusEffect/etc. that reduces point blank range chance to hit penalties.

example #1:

Code: Select all

statModifiers : [
	{
		when : [ Situation.Always ]
		statName : pointBlankChanceToHit
		tooltipId : ""
			
		subset : [ Situation.Always ]
		operation : Operation.Multiply
		value : 0.5
	}
]
Assault rifles and snipers rifles have penalties at point blank range, while handguns, shotguns, SMGs have bonuses. The above would indeed work for assault/sniper rifles, but it would also halve the bonuses of other ranged weapons.

example #2:

Code: Select all

statModifiers : [
	{
		when : [ Situation.Always ]
		statName : pointBlankChanceToHit
		tooltipId : ""
			
		subset : [ Situation.Always ]
		operation : Operation.MultiplyNegative
		value : 0.5
	}
]
This would only affect weapons with negative values for point blank chance to hit, halving the penalty.

example #3:

Code: Select all

statModifiers : [
	{
		when : [ Situation.Always ]
		statName : pointBlankChanceToHit
		tooltipId : ""
			
		subset : [ Situation.Always ]
		operation : Operation.Add
		value : 20
	}
]
All weapons would be affected, adding a flat +20 to their chance to hit at point blank range.

example #4:

Code: Select all

statModifiers : [
	{
		when : [ Situation.Always ]
		statName : pointBlankChanceToHit
		tooltipId : ""
			
		subset : [ Situation.Always ]
		operation : Operation.ReduceNegative
		value : 20
	}
]
This would only affect weapons with a penalty to their chance to hit at point blank range. That penalty would be reduced to a minimum of 0, eg. if before pointBlankChanceToHit was -10, it would now become 0; if before pointBlankChanceToHit was -35, it would now become -15.

example #5:

Code: Select all

statModifiers : [
	{
		when : [ Situation.Always ]
		statName : pointBlankChanceToHit
		tooltipId : ""
			
		subset : [ Situation.Always ]
		operation : Operation.ReducePositive
		value : 10
	}
	{
		when : [ Situation.RangedWeapon ]
		statName : attackRange
		tooltipId : ""
			
		subset : [ Situation.Always ]
		operation : Operation.Add
		value : 4
	}
]
This would reduce any point blank chance to hit bonus, down to a minimum of 0. Weapons with a penalty would be unaffected. All ranged weapons would receive the +4 range bonus.

example #6:

Code: Select all

statModifiers : [
	{
		when : [ Situation.Always ]
		statName : chanceToHit
		tooltipId : ""
			
		subset : [ Situation.UnderPressure ]
		operation : Operation.MultiplyNegative
		value : 0.7
	}
]
This reduces any under pressure penalty by 30%, but leaves the rest of the chance to hit calculation unaffected.

example #7:

Code: Select all

statModifiers : [
	{
		when : [ Situation.MeleeWeapon, Situation.Crouching, Situation.Target_Crouching ]
		statName : minDamage
		tooltipId : "damage"
			
		subset : [ Situation.Always ]
		operation : Operation.Multiply
		value : 1.25
	}
	{
		when : [ Situation.MeleeWeapon, Situation.Crouching, Situation.Target_Crouching ]
		statName : maxDamage
		tooltipId : null
			
		subset : [ Situation.Always ]
		operation : Operation.Multiply
		value : 1.25
	}
]
If the attacker is wielding a melee weapon, and both the attacker and the target are crouching, the attacker does +25% extra damage.

_________________________________________________

Subsets are a way of dividing a stat calculation into smaller pieces. Each subset is unique, ie. "subset : [ Situation.UnderPressure ]" and "subset : [ Situation.UnderPressure, Situation.Crouching ]" are calculated separately before being added up. Subset multipliers are always applied at the end. The actual calculation for each subset:

Code: Select all

        public float total
        {
            get
            {
                if (this.values[(int)Operation.Add] < 0)
                {
                    return Mathf.Min(0, this.values[(int)Operation.Add] + this.values[(int)Operation.ReduceNegative]) * this.values[(int)Operation.Multiply] * this.values[(int)Operation.MultiplyNegative];
                }
                else if (values[(int)Operation.Add] > 0)
                {
                    return Mathf.Max(0, this.values[(int)Operation.Add] - this.values[(int)Operation.ReducePositive]) * this.values[(int)Operation.Multiply] * this.values[(int)Operation.MultiplyPositive];
                }

                return 0;
            }
        }
All non-Situation.Always subsets are totaled up first then added to the Situation.Always subset, which then does its own calculation. That sum is the value of the DerivedStat/Attribute/Skill.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 20th, 2017, 4:25 pm

It's alive!!
http://i.imgur.com/oEmRQQI.jpg
http://i.imgur.com/gMUtQRd.jpg

Took me all day, but I got it working. Still need to do a bit of stuff like showing the amount of ammo, but the core part functions, ie. showing a radial menu with all the ammo of the right caliber, and clicking on one causing your character to reload.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » August 21st, 2017, 9:11 am

This is amazing changes, looking forward to test them asap! I'm so exiting! It will improve gameplay, and i think you can later post this on Steam, so more people can enjoy this features.
I made pretty sweet UI concept for ammo types, if it's possible for you to customize UI, if so, I can send you images with opacity, with hover effects in any format.

If you click on circle with bullets icon, on the right will be shown panel with different ammo types for this weapon.

http://87.230.59.84/wasteland/ui/gMUtQRd1.png

Image

http://87.230.59.84/wasteland/ui/gMUtQRd2.png

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » August 21st, 2017, 9:31 am

At that moment I'm working on Modification Slot icons for Armor and Heavy Machine Gun.

It would be great to add mods like Tactical Glasses(increase accuracy)/Heavy strong plates(increase armor)/Water storage tank(increase water capacity), Military fabric joint(increase evade). My english not so good, but you can understand the idea.

For Heavy Machine Gun, would be great to see Heavy Machine Gun Barrel Group slot (changes range) and Heavy Machine Gun Receiver slot (decrease jam chance). And Specially for Miniguns I had an idea to add Minigun Clutch slot that will increase bullets consumption (but i think it's too hard to to make).
For Shotguns it would be great to see if slug ammo (green one), will change hit angle, as well it might be very hard to programm, but great idea imo.

Minigun clutch in real life:
Image

Slug vs gauge ammo irl:
Image

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » August 21st, 2017, 12:25 pm

Nikita-S-D wrote:
August 21st, 2017, 9:11 am
It will improve gameplay, and i think you can later post this on Steam, so more people can enjoy this features.
Eventually I will, but I want to get a lot more features done first, particularly full stats & perks for NPCs. Also an item degradation/condition system to force the player to spend their money repairing their weapons and armor and thus hopefully balance the economy.
Nikita-S-D wrote:
August 21st, 2017, 9:11 am
I made pretty sweet UI concept for ammo types, if it's possible for you to customize UI, if so, I can send you images with opacity, with hover effects in any format.

If you click on circle with bullets icon, on the right will be shown panel with different ammo types for this weapon.
Feel free to send it to me, I've already PM'd you my email. Pretty much everything in the UI should be alterable, it just takes time, and right now I want to get 0.9.3 finished. But I'll get around to it eventually. I'm currently mostly re-using the UI for precision attacks against body parts because it takes the least effort on my part.
Nikita-S-D wrote:
August 21st, 2017, 9:31 am
It would be great to add mods like Tactical Glasses(increase accuracy)/Heavy strong plates(increase armor)/Water storage tank(increase water capacity), Military fabric joint(increase evade). My english not so good, but you can understand the idea.

For Heavy Machine Gun, would be great to see Heavy Machine Gun Barrel Group slot (changes range) and Heavy Machine Gun Receiver slot (decrease jam chance). And Specially for Miniguns I had an idea to add Minigun Clutch slot that will increase bullets consumption (but i think it's too hard to to make).
For Shotguns it would be great to see if slug ammo (green one), will change hit angle, as well it might be very hard to programm, but great idea imo.
All of that should already be possible in 0.9.3. Equipable items like armor and trinkets have a 'validModSlots' field in 0.9.3, which you can fill in with a ModSlot, including ones that you make like a "Heavy Machine Gun Barrel" or "Heavy Machine Gun Receiver". Then it's just a matter of creating new ItemTemplate_Mods with the 'modSlot' field set to the appropriate one. Ammo and mod items can change any stat, whether it be 'coneAngle', 'shotsCount' (ie. extra rounds fired in a burst), 'combatSpeed', 'strength', etc.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » August 24th, 2017, 11:05 am

Cant await 0.9.3 ! :D this changes are really awesome!

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Nikita-S-D » August 28th, 2017, 3:59 pm

Just in case you didn't know, I was playing with new features of experimental 0.9.3, and wanted to add secondary firingMode for HeavyMachineGuns:

Code: Select all

	firingModeInfos : [
		{
			actionPointCost : 1
			shotsCount : 10
			chanceToHitPenalty : 0
		}
		{
			actionPointCost : 2
			shotsCount : 20
			chanceToHitPenalty : 20
			statModifiers : [
				{
					when : [ Situation.Always ]
					statName : coneAngle
					tooltipId : ""
					
					subset : [ Situation.Always ]
					operation : Operation.Add
					value : 40.0
				}
			]
		}
	]
Tooltips are working ok, but coneAngel are not showing and looks like not working at all, because HeavyMachineGun always hit only selected enemy, I think with other weapon types all the same.

I thought adding this code will help me:

Code: Select all

	coneAngle : 10

	baseMissAngle : 5                                        // default miss cone angle size
	burstingAdditionalMissAngle : [ ]
But it looks like you need more work and time to make coneAngel statModifire to work for different firingModes.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests