Modding Question - How To Mod Backpack Carry Weight Addition

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

Moderator: Ranger Team Alpha

Post Reply
dan0001
Initiate
Posts: 13
Joined: February 10th, 2014, 12:49 am

Modding Question - How To Mod Backpack Carry Weight Addition

Post by dan0001 » November 15th, 2016, 3:45 am

Hi,

I have read through the wiki docs and it looks like a straighforward process to change stats of an existing item (in this case i would like to increase the carry weight of the backpack at some point during my first playthrough as i know i will run out being a bit of a hoarder!).

However, I cannot figure out how I am supposed to find out the exact detail of the entries for the overriding mson file i am supposed to generate for this. I have the file name (ArmyIssueBackpack.mson), path (ItemTemplate/ItemTemplate_Equipment/ItemTemplate_Trinket/) and the item template (ItemTemplate_Trinket), but I don't know what the entries are meant to be for this trinket.

I think I only need to add entries for the values I am changing (so hopefully in this case, just one entry called something like AddToCarryWeight), but I cannot figure out how to find out this type of detail. The docs have some details of the classes and members for weapons but not for other types of equipment.

Also, if there is a way of finding out these entries for myself for anything that isn't documented, I'll be able to mod other items if needed. I don't know anything about Unity, but I thought maybe if I could see what the current values are for an item like the backpack then I have the ideal starting point for making changes but I have no idea where the game definitions are for these items.

Can anybody help?

dan0001
Initiate
Posts: 13
Joined: February 10th, 2014, 12:49 am

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by dan0001 » November 29th, 2016, 9:30 am

it doesn't seem that there is very much traffic here these days :(

do any of the moderators know the answer to this?

i am sure there must be a simple way to find out the config for existing items which i am guessing would make it easy to then modify to create the new template files (unless the modding templates are maybe different to the base game templates?).

User avatar
Zombra
Global Moderator
Posts: 6176
Joined: March 8th, 2012, 10:50 pm

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by Zombra » November 29th, 2016, 1:09 pm

dan0001 wrote:do any of the moderators know the answer to this?
Don't confuse forum moderators with people who can make "mods" (modifications) for the game. We're not programmers. All I can say is I hope someone can help you figure this out.
Image

dan0001
Initiate
Posts: 13
Joined: February 10th, 2014, 12:49 am

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by dan0001 » November 30th, 2016, 10:03 am

apologies zombra, absolutely right! actually i should have said devs or inxile staff maybe, i saw that sear answered a template question just like this in another post and even updated the wiki with the template so i guess i was hoping he might see this one as well :)

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

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by Executor_ » December 2nd, 2016, 10:31 pm

Open ArmyIssueBackpack.mson in Notepad/Notepad++, and copy+paste the following in and save:

Code: Select all

{
	price : 100
	weight : 0.5
	junk : false

	stats : {
		combatSpeed : -40
		maxWaterCarry : 20
		maxWeight : 20
	}
}
The values above imitate the base ones for the backpack. Change them however you like.

dan0001
Initiate
Posts: 13
Joined: February 10th, 2014, 12:49 am

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by dan0001 » December 3rd, 2016, 4:12 am

wow that's great, huge thanks Executor_ :) i will give that a try later today when i get a few spare moments!

how did you find out what those base values were? if i can find out the method, then i can do any others i need myself and not have to bother the forums :)

cheers
dan

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

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by Executor_ » December 3rd, 2016, 8:42 am

dan0001 wrote:how did you find out what those base values were?
Those values I found by checking in-game and then a bit of trial and error till I got the modded item to match the original trinket.

The more difficult part is figuring out the names of the properties that go with those values. :mrgreen:

dan0001
Initiate
Posts: 13
Joined: February 10th, 2014, 12:49 am

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by dan0001 » December 3rd, 2016, 9:18 am

yeah i can totally believe that!!

i am still hoping that someone in the know will stop by and let us know how to find out what the template structures are by peering into data files or something like that. i am guessing that something like the backpack is in one of the unity asset files, but i tried to download a unity editor from this forum and when i attempted to open a unity file with it, it crashed. it might have been the wrong file i was trying to open, there are loads of them so i picked one at random iirc. i haven't had time since then to dig further and tbh i don't know whether i would even find anything resembling these mson structures inside the asset files - it may be that this was developed purely for the modding side of things and the original game structures are different.

but anyways, i just tried your mson and it worked great! thanks again for taking the time to work that lot out. i would've had a hard time with those property names as my first instinct would be to name them for their effect e.g. my example of AddToCarryWeight in the first post. i think i will have a try with a few others now that you have kindly worked out the naming convention :)

cheers

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

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by Executor_ » December 3rd, 2016, 10:38 am

The most helpful clue I found was in the Armor_Tier_6_Light.mson file in the ItemTemplate_Armor, part of the example mod files. Specifically,

Code: Select all

	stats: {
		armor: 9,
	},
A few weeks ago, I had been trying to adjust some of the skill/attribute modifiers on certain rare weapons. I had given up because I couldn't figure out a way to do so. Yesterday, I just happened to look at the Armor_Tier_6_Light.mson and recalled seeing stats as one of the variables listed in the ItemTemplate_WeaponRanged classes documentation, but that wasn't particularly helpful (" stats : // SerializableDictionary_StringInt "). I tried copying the stats block from Armor_Tier_6_Light.mson into a modded weapon file and it worked! :D After that, it only took a bit of guessing to get your trinket working.
Last edited by Executor_ on December 4th, 2016, 11:50 am, edited 1 time in total.

dan0001
Initiate
Posts: 13
Joined: February 10th, 2014, 12:49 am

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by dan0001 » December 3rd, 2016, 11:38 am

I think I have found something that may help if there are any other stats you are trying to modify! I used Telerik's JustDecompiler to check out the wl2 c-sharp assembly (instructions were in this forum somewhere) and found the PCStatsManager class definition, pasted below (it's quite long!). it has the three properties you found for the backpack and also armor so i reckon it must be the right one for the mson stats section.


public class PCStatsManager : MonoBehaviourSingleton<PCStatsManager>
{
public static string coordination;

public static string luck;

public static string awareness;

public static string strength;

public static string speed;

public static string intelligence;

public static string charisma;

public static string hitPoints;

public static string baseHitpoints;

public static string walkSpeed;

public static string runSpeed;

public static string stealthSpeed;

public static string combatSpeed;

public static string perceptionRadius;

public static string perceptionFOV;

public static string attackRange;

public static string optimalRange;

public static string pointBlankRange;

public static string maxWeight;

public static string chanceToHit;

public static string chanceToEvade;

public static string criticalHitChance;

public static string armor;

public static string actionPoints;

public static string actionRechargeRate;

public static string damage;

public static string gasProtection;

public static string radiationProtection;

public static string maxWaterCarry;

public static string level;

public static string skillPointsPerLevel;

public static string pointBlankChanceToHit;

public static string outsideOptimalChanceToHit;

public static string critDmgModifier;

public static string distanceModifier;

public static string reloadCostModifier;

public static string jammingRateModifier;

public static string shotsPerBurstModifier;

public static string energyWpnDmgModifier;

public static string aoeRadiusModifier;

public static string dmgFalloffModifier;

public static string conPerLevel;

public static string bonusCritDamageMeleeWeapons;

public static string bonusRangedHitChance;

public static string coneAngle;

public static string noiseRadiusBonus;

private static List<Attribute> _attributes;

private static List<Skill> _skills;

private static List<DerivedStat> _stats;

private static List<Trait> _traits;

private static Dictionary<string, Religion> _religions;

private static Dictionary<string, Smokes> _smokes;

private static Dictionary<string, Ethnicity> _ethnicities;

private static Dictionary<string, List<Trait>> _traitRequirements;

private static string[] AttributeNames;

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

Re: Modding Question - How To Mod Backpack Carry Weight Addition

Post by Executor_ » December 3rd, 2016, 12:34 pm

Thanks, that'll definitely come in handy. I'll try out the JustDecompiler too.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests