Wasteland 2: now with improved modding capabilities!

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

Moderator: Ranger Team Alpha

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » May 30th, 2019, 11:31 am

That audio message isn't relevant.

I've tested combat in 0.9.4za without any mods on the Atchison Camp map, in a battle with both melee and ranged enemies, and they attack/reload/take cover/etc.

I assume you've been testing with your mods? Try renaming the "Import" directory in your "Mods" folder to "Import2" or something temporarily and then start the game. Is combat working then?

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » May 30th, 2019, 4:02 pm

I have done so by resetting the mod directory, and the game works as intended without mods.

The mod I've been using (and trying to clean up) is called Red Boots, on Nexus mods. It works (sortof) in version 0.94v; that said, it still has the hangs in that version, and crashes to desktop regardless of version when you attempt to enter the mad monks canyon (forget its proper name as I'm writing this).

The next thing I intend to do with it is start sequentially removing things from the mod that seem unnecessary with the changes I've made to see if I can get at least the weapons modding aspect of it to work properly, since most of the other changes in the mod are not really interesting to me. I'll probably have a look at that tomorrow and get back to you then.

Anyway, in summary, these are the issues I encounter with my alterations to it in each version:

0.94v: game occationally hangs on loading, crash to desktop on loading some areas
0.94za: ai does not execute shooting properly (all other behaviours work as intended); crash to desktop on loading some areas

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » May 31st, 2019, 2:05 am

0.9.4zb now available here

MODDING
  • since 0.9.4x, for NPCs, game was using base ItemTemplate_RangedWeapon clipSize without taking any StatModifiers into account


This should fix the issue with NPCs not shooting with the Red Boots mod. I didn't experience any crashes while loading any of the Canyon/Temple of Titan maps though, so you'd probably have to send me a save if you want me to reproduce that.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » May 31st, 2019, 8:45 pm

Executor_ wrote:
May 31st, 2019, 2:05 am
0.9.4zb now available here

MODDING
  • since 0.9.4x, for NPCs, game was using base ItemTemplate_RangedWeapon clipSize without taking any StatModifiers into account


This should fix the issue with NPCs not shooting with the Red Boots mod. I didn't experience any crashes while loading any of the Canyon/Temple of Titan maps though, so you'd probably have to send me a save if you want me to reproduce that.
I've tested again with version 0.9.4zb, and the CTD no longer occurs when entering Canyon of Titan. I'm not sure what the issue was, but it seems you've resolved it.

EDIT: I've just gotten another loading screen hang. Looks similar to the previous type, this time it seems to be grumpy about a silencer type weapon mod (I'm guessing on my Uzi, thats the only one I've attached since changing zones).

output log:

NullReferenceException: Object reference not set to an instance of an object
at PCInventory.AttachVisibleMods (UnityEngine.GameObject gameObject, .ItemInstance_Weapon weapon) [0x00000] in <filename unknown>:0

at PCInventory._RefreshWeapons () [0x00000] in <filename unknown>:0

at PCInventory.RefreshEquipment (Boolean wearables, Boolean weapons) [0x00000] in <filename unknown>:0

at PCInventory.RefreshEquipment () [0x00000] in <filename unknown>:0

at PCInventory.Init (.PC pc) [0x00000] in <filename unknown>:0

at PC.Init () [0x00000] in <filename unknown>:0

at CNPC.Init () [0x00000] in <filename unknown>:0

at Game.SpawnCNPC (.PCTemplate template, Vector3 position, Quaternion rotation) [0x00000] in <filename unknown>:0

at Game.SpawnParty () [0x00000] in <filename unknown>:0

at Game+<PrivateLoadMap>d__123.MoveNext () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » June 1st, 2019, 11:50 am

0.9.4zc now available here

UPDATED GAME BUG FIXES
  • crashes due to null weapon mods should now be resolved

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 1st, 2019, 3:16 pm

Speedy and efficient as always, good sir :)

On an unrelated note, is there a way to specify the number of spawned mobs in random encounters, or even better, randomize it?

It would be nice to have a bit more variety than "encounter 5 raiders"...notably I'd like to be able to run into anywhere between 2 and 15 :D

Edit: A couple further questions about modding capability:

1. Is it possible to mod in additional keybinds, and inventory scripts associated with keybinds? There are a few things I'd love to be able to add for quality of life:
i) a "flag as junk" keybind
ii) a "field strip" keybind
iii) 7 "move item to party member at position [x]" keybinds
iv) a "swap current party member position with party member at position [x] keybind

2. How does one edit the chance of random encounters occurring in specific areas? I'd like to be able to increase the chance of encounters off of the main storyline paths, in order to offer good farming areas and/or present some extra challenge in going searching for shrines and caches.

3. Is it possible to mod California to also require water management, and add wells as appropriate? I kindof find it a) sortof annoying that the water mechanic, which has perks you can invest in, suddenly becomes obsolete when you fly west, and b) sortof silly to assume that post-apocolyptic Los Angeles would have free, clean drinking water everywhere (lets be honest, it would be full of industrial waste, construction materials, nuclear fallout, and untreated sewage).

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » June 2nd, 2019, 11:25 am

Bigwilleh wrote:
June 1st, 2019, 3:16 pm
On an unrelated note, is there a way to specify the number of spawned mobs in random encounters, or even better, randomize it?

It would be nice to have a bit more variety than "encounter 5 raiders"...notably I'd like to be able to run into anywhere between 2 and 15 :D
Not at the moment. I'm planning on completely overhauling random encounters, but not until after 0.9.5 is out.
Bigwilleh wrote:
June 1st, 2019, 3:16 pm
1. Is it possible to mod in additional keybinds, and inventory scripts associated with keybinds? There are a few things I'd love to be able to add for quality of life:
i) a "flag as junk" keybind
ii) a "field strip" keybind
iii) 7 "move item to party member at position [x]" keybinds
iv) a "swap current party member position with party member at position [x] keybind
Not possible. Would take some effort coding-wise to implement the ability to do so.
Bigwilleh wrote:
June 1st, 2019, 3:16 pm
2. How does one edit the chance of random encounters occurring in specific areas? I'd like to be able to increase the chance of encounters off of the main storyline paths, in order to offer good farming areas and/or present some extra challenge in going searching for shrines and caches.
That data is stored in the WorldMapRandomEncounterZones, however, in 0.9.4 most of them aren't being MSON exported because most are in GameObjects with overlapping names. For instance, ArizonaWorldMap actually has 86 WorldMapRandomEncounterZones, but only 10 unique GameObject names, hence only 10 get exported in 0.9.4. In 0.9.5, I rename them based on their (x, y) coordinates so there aren't any name clashes.
Bigwilleh wrote:
June 1st, 2019, 3:16 pm
3. Is it possible to mod California to also require water management, and add wells as appropriate? I kindof find it a) sortof annoying that the water mechanic, which has perks you can invest in, suddenly becomes obsolete when you fly west, and b) sortof silly to assume that post-apocolyptic Los Angeles would have free, clean drinking water everywhere (lets be honest, it would be full of industrial waste, construction materials, nuclear fallout, and untreated sewage).
There's a setting somewhere that controls whether the game checks for water usage on a world map. Main issue would be adding a bunch of new WorldMapPOIs (Points of Interest), which you can't do right now using the MSON files.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 2nd, 2019, 8:58 pm

I broke it again.

Getting intermittent freezes in combat between turns. Looks like I've prompted out a couple null pointers. The log has repeated entries along these lines:


No audio category with name UIMasterVolume

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)


NullReferenceException: Object reference not set to an instance of an object
at PC+<DelayedMoveRedirection>d__129.MoveNext () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » June 3rd, 2019, 12:23 am

Try using the 'TEST' version from here. If you get any more freezes, look for "WARNING: DelayedMoveRedirection" lines in the output_log.txt and post the whole lines here please.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 3rd, 2019, 7:51 am

Executor_ wrote:
June 3rd, 2019, 12:23 am
Try using the 'TEST' version from here. If you get any more freezes, look for "WARNING: DelayedMoveRedirection" lines in the output_log.txt and post the whole lines here please.
So far is working like a charm.

Will keep you posted.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 3rd, 2019, 8:33 am

Addendum: Minor combat freezes occur at the beginning of each actor's turn in large areas (eg Angel Oracle).

The delayed redirection lines all appear to be identical:

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

WARNING: DelayedMoveRedirection --> (2) eDelayedMoveCur is null

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » June 3rd, 2019, 4:28 pm

Can't replicate the issues with DelayedMoveRedirection.

I did experience game freezes at the start of each PC's combat turn. The Red Boots mod seems to increase the number of action points each character has. The blue/yellow overlay showing which tiles a PC can move to in combat is calculated on the main thread. On high action point + high combat speed characters, this can take significant amounts of time. In the base game, you don't really experience this unless you put all your points in Speed and Coordination.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 3rd, 2019, 6:04 pm

Executor_ wrote:
June 3rd, 2019, 4:28 pm
Can't replicate the issues with DelayedMoveRedirection.

I did experience game freezes at the start of each PC's combat turn. The Red Boots mod seems to increase the number of action points each character has. The blue/yellow overlay showing which tiles a PC can move to in combat is calculated on the main thread. On high action point + high combat speed characters, this can take significant amounts of time. In the base game, you don't really experience this unless you put all your points in Speed and Coordination.
That may very well be what it is.

My customisation of Red Boots restores the AP and speed balance back to the original scaling, but I'm running around with a modded squad for the purpose of testing that everything works, so each character in my party has an absurd pile of AP.

One balance points I've definitely come up with thats on my chopping block from this is I will definitely be removing restocking of the stat increase surgery items, and probably changing them to require massive investment in the surgery skill. Characters with enormous stat pools get game breakingly powerful in combat, so I don't see a reason to be able to legitimately achieve 10 all stat characters before even setting foot in LA.

On a related note to balance, is it possible to set a global variable on pricing such that purchase price cannot be lower than, and sale price cannot be higher than, item base value at a given vendor? I gave valley of titan and the nuke to the DBM on an unsaved file to get the achievement, and as if repeatedly selling all of your stuff to vendors who are about to die isn't enough of an egregious powergaming money move, it turns out the discount you get from the DBM quartermaster for doing this results in being able to sell and purchase things to/from the quartermaster for a net profit, and infinite money farms should never exist in such a simple manner.

On an unrelated side note, one of the first things I changed in red boots was to restore grenades and rockets to default stack size (1), because I found out fairly quickly that stacked grenades do not consume on use, presumably due to an inability of the game to properly find the next item in the inventory. Have you noticed this, and/or has it since been resolved?

Silencedmind
Initiate
Posts: 9
Joined: June 3rd, 2019, 8:31 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Silencedmind » June 3rd, 2019, 8:32 pm

How would one edit the maxcarryweight?

I understand from previous posts i have to make a new file (or copy the export one) into import, then i have to modify the values. I only see initialValues though. putting a number there didnt do anything however.

I have no experience and limited understanding of this. I'm basically a blind mole in modding land. Please help me out.

Shadow Jack
Acolyte
Posts: 51
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » June 4th, 2019, 12:46 am

Silencedmind wrote:
June 3rd, 2019, 8:32 pm
How would one edit the maxcarryweight?
Edit \Import\BaseStat\Attribute\strength.mson

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » June 4th, 2019, 1:02 am

Bigwilleh wrote:
June 3rd, 2019, 6:04 pm
On a related note to balance, is it possible to set a global variable on pricing such that purchase price cannot be lower than, and sale price cannot be higher than, item base value at a given vendor? I gave valley of titan and the nuke to the DBM on an unsaved file to get the achievement, and as if repeatedly selling all of your stuff to vendors who are about to die isn't enough of an egregious powergaming money move, it turns out the discount you get from the DBM quartermaster for doing this results in being able to sell and purchase things to/from the quartermaster for a net profit, and infinite money farms should never exist in such a simple manner.
That should be fairly easy to implement. I'll look into getting it done in a few days when I have more free time.
Bigwilleh wrote:
June 3rd, 2019, 6:04 pm
On an unrelated side note, one of the first things I changed in red boots was to restore grenades and rockets to default stack size (1), because I found out fairly quickly that stacked grenades do not consume on use, presumably due to an inability of the game to properly find the next item in the inventory. Have you noticed this, and/or has it since been resolved?
Probably just a bug with the code I changed in order to allow stacking weapons. When you use a thrown weapon or RPG in the base game, it deletes the current item and looks for a similar one in your inventory to equip. Probably something got borked. I'll see about fixing it.
Silencedmind wrote:
June 3rd, 2019, 8:32 pm
How would one edit the maxcarryweight?

I understand from previous posts i have to make a new file (or copy the export one) into import, then i have to modify the values. I only see initialValues though. putting a number there didnt do anything however.

I have no experience and limited understanding of this. I'm basically a blind mole in modding land. Please help me out.
Most of the adjustments to maxCarryWeight are done by the Strength Attribute, which can be found in "BaseStat\Attribute\strength.mson".

Probably the easiest way to mod is to look through the exported files to find another object that makes similar changes to the one you want. Copy and paste into the object you want to modify, and then edit the values. If you want examples of initialValues changes, "DerivedStat\chanceToHit.mson" is a good one to look at. In the "Export" root folder will be an enums.txt file that'll list all the Situations you can use in StatModifier fields.

After running the game with your mod, make sure to look at debug_import.txt in the "Mods\Export" directory to see if there were any errors while reading your mod. You can also look inside the "ExportImport" folder for files corresponding to the ones you modded. "ExportImport" shows objects as they appear to the game after any MSON changes, and is useful in verifying your mod was correctly applied.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 4th, 2019, 4:17 am

Regarding mob templates:

I decided that mobs in general need more hitpoints. I have tried to do this two ways:

1. I tried doubling NPC maxCon in the baseStat/Derived definitions. This did technically work, but didn't really help with what I was intending, because any time you reload a save, all NPCs in the area were reloaded with their unmodified current con before the double maxCon was implemented.

2. I tried wholesale editing all NPC templates to double their maxCon stat. However, thus far, I have only noticed this has worked for the goats that are following my party. I did check, and both my export and import folders have 216 npc templates, and the import log loaded all mobTemplates successfully.

Have I missed an important template folder somewhere, or is something wonky here?

Shadow Jack
Acolyte
Posts: 51
Joined: October 25th, 2017, 7:53 am

Re: Wasteland 2: now with improved modding capabilities!

Post by Shadow Jack » June 4th, 2019, 5:48 am

Bigwilleh wrote:
June 4th, 2019, 4:17 am
Regarding mob templates:

I decided that mobs in general need more hitpoints. I have tried to do this two ways:

1. I tried doubling NPC maxCon in the baseStat/Derived definitions. This did technically work, but didn't really help with what I was intending, because any time you reload a save, all NPCs in the area were reloaded with their unmodified current con before the double maxCon was implemented.

2. I tried wholesale editing all NPC templates to double their maxCon stat. However, thus far, I have only noticed this has worked for the goats that are following my party. I did check, and both my export and import folders have 216 npc templates, and the import log loaded all mobTemplates successfully.

Have I missed an important template folder somewhere, or is something wonky here?
If I remember correctly your changes will take place only in the new game or in the areas where you have not been yet.

Bigwilleh
Initiate
Posts: 14
Joined: May 27th, 2019, 12:47 pm

Re: Wasteland 2: now with improved modding capabilities!

Post by Bigwilleh » June 4th, 2019, 8:48 am

Shadow Jack wrote:
June 4th, 2019, 5:48 am
If I remember correctly your changes will take place only in the new game or in the areas where you have not been yet.
Yeah, now that I've played a little more that seems to be the case.

Unrelated, I've spotted a new glitch with item stacking: Weapon mods add the weight of the full stack of mods when applied to a weapon, not the weight of one mod.

I would regard this one as low priority as it can be rectified by saving and reloading, or by splitting your weapon mods stack.

EDIT: Another unrelated item: can the modding engine currently handle weapon mods applying modifiers to hit chance at point blank and hit chance beyond optimal; if so, what is the correct syntax; and if not, can this be added? I would like to balance scopes around hit chance modifiers in different regions. I tried to implement it as follows (example is my high power scope), but it didn't work:

statModifiers : [
{
when : [ Situation.Always ]
statName : attackRange
tooltipId : ""

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

subset : [ Situation.Always ]
operation : Operation.Add
value : 20.0
}
{
when : [ Situation.Always ]
statName : hitChanceAtPointBlankRange
tooltipId : ""

subset : [ Situation.Always ]
operation : Operation.Add
value : -45.0
}
{
when : [ Situation.Always ]
statName : pointBlankRange
tooltipId : ""

subset : [ Situation.Always ]
operation : Operation.Multiply
value : 1.5
}
]

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » June 4th, 2019, 11:56 pm

Bigwilleh wrote:
June 4th, 2019, 8:48 am
Unrelated, I've spotted a new glitch with item stacking: Weapon mods add the weight of the full stack of mods when applied to a weapon, not the weight of one mod.
The quantity on the mod applied to the weapon is likely being set incorrectly, ie. it should be set to 1 but it's probably using the mod stack quantity. Doesn't affect weapon bonuses since item quantity is only used for weight and price calculations.
Bigwilleh wrote:
June 4th, 2019, 8:48 am
EDIT: Another unrelated item: can the modding engine currently handle weapon mods applying modifiers to hit chance at point blank and hit chance beyond optimal; if so, what is the correct syntax; and if not, can this be added? I would like to balance scopes around hit chance modifiers in different regions.
statName in a StatModifier should always be the name of an Attribute, Skill, or DerivedStat found in the BaseStat folder. Fields in ItemTemplates and whatnot are often named slightly differently from the stat they affect, so don't rely on them. In your case, you want to be using pointBlankChanceToHit and beyondOptimalChanceToHit.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest