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_ » May 24th, 2017, 10:11 am

I would assume you can modify the evasion bonuses with a hex editor, though I haven't tried editing the Assembly-CSharp.dll that way so not sure how difficult it would be to find the correct value to alter. If it's any help, the -50 to hit against enemies in cover is in the Mob class GetChanceToHit method. There's also some other constants, like a +10 to hit bonus if the attacker is wielding a melee weapon and attacking a target with a ranged weapon, and a further +40 bonus if they're crouched.

Code: Select all

if (weaponTemplate is ItemTemplate_WeaponMelee && target is Mob && (target as Mob).stats.GetWeaponTemplate(false) is ItemTemplate_WeaponRanged)
{
	num += 10;
}
if (weaponTemplate is ItemTemplate_WeaponMelee && target is Mob && (target as Mob).isCrouching)
{
	num += 40;
}
...
if (weaponTemplate is ItemTemplate_WeaponRanged)
{
	if (this.TargetInCover(target, position))
	{
		num2 = -50;
		...
	}
	else if (target is Mob && (target as Mob).isCrouching)
	{
		num2 = -20;
	}
	if (this.isCrouching || this.inCover)
	{
		num3 = 10;
	}
}
The elevation to hit modifiers are in the GetChanceToHitEnvironmentBonus method:

Code: Select all

float num = position.y - targetPos.y;
if (num >= 2f)
{
	result = 25;
}
else if (num <= -2f)
{
	result = -15;
}

sjblack2014
Initiate
Posts: 11
Joined: October 18th, 2014, 7:14 am

Re: Wasteland 2: now with improved modding capabilities!

Post by sjblack2014 » May 28th, 2017, 8:20 pm

Thanks for the info, I'll look into it.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 19th, 2017, 4:24 am

Hi there! :)

I just wanna mod the armor and penetration behavior. my own edited gauge12 guns is absolutley worseless in the mid - endgame because every fucking mob has more than 6 armor and shots from my shotgun do "0" damage overall..

Can someone help? :)

Edit: found it : Table_PartialPenetration ... NICENICENICE :D

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 19th, 2017, 3:33 pm

displayName : "<@>High Capacity Mag"
grammaticalName : "<@>(a/[COUNT]) high capacity mag(/s)"
description : "<@>A few extra rounds capacity can mean the difference between life and death."

stats : {
chanceToJam : -2.0
clipSize : 4.0


both stats diddnt work anymore? they wont show up ingame?

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 20th, 2017, 11:00 am

Are you sure you didn't forget the closing curly bracket?

Also, try checking the debug_import.txt in the Mods folder to see if it's reporting any errors.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 20th, 2017, 2:56 pm

yep iam sure. } comes after 2 other stats(both work fine) ... and no errorline for this, but some other "missing files" ... he ignor this two stats completly, and the -1AP from meleetape too.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 21st, 2017, 9:27 am

You're right, it was indeed bugged. New version 0.9.2b available here: https://www.dropbox.com/sh/x36syu96ku75 ... g80ka?dl=0

Shortly before the release of 0.9.2 I added some code to validate certain changes made in MSON files. It worked fine in most cases, except I forgot that some stats (such as "chanceToJam", "clipSize", "actionPointReload") aren't given their own DerivedStat by the base game. So when the game tried to check them while loading the MSON files, it couldn't find them and rejected them as invalid. Hence why the game was outputting "Could not find an object of type BaseStat named 'chanceToJam'.", etc. to debug_import.txt.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 21st, 2017, 12:28 pm

You are the best! thx! :D

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 22nd, 2017, 5:20 pm

Another question: i love scorpitron battle and... wanna insert scorpitron in some randomencounters... edited following:

{
description : "<@>You see Dugan's Workerbots approaching your position."

outdoorsmanRequiredToSkip : 8
overrideScene : ""
requiresWSBoolFalse : ""
requiresWSBoolTrue : ""
encounterWSBoolToTrue : ""
rangedNpcNames : [ CA_RE_DuganWorker, CA_RE_DuganWorker, Scorpitron ]
meleeNpcNames : [ CA_RE_DuganWorker, CA_RE_DuganWorker, Scorpitron ]
venderNpcNames : [ ]
civilianNpcNames : [ ]
}

worldmaprandomencounter\CA_RE_DuganWorkers_Medium ... and some others..

but... the scorpitron wont show up... did i something wrong? another file that i must edit too?

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 23rd, 2017, 1:59 am

I haven't really tested modding world map encounters, a lot of it is hard-coded and it'll take quite a bit of work to make them mod-friendly. Just another item on my extensive todo list.

In your specific example, are the CA_RE_DuganWorker showing up? I would hope they would, as they're listed as one of the universally available NPCTemplates in "Mods\Export\MobTemplate\NPCTemplate". Only Scorpitron - Mini is available for scorpitrons though, with the others being scene-specific.

Making scene-specific objects available in other scenes would be a complex undertaking. The code for loading most objects from the data files is in the EXE. Option A would be to tell the EXE to load a scene that contains the needed scene-specific objects, mark those so they won't be destroyed, then unload the rest of the scene. This approach, while much quicker from the programming standpoint, would produce very long loading times. Option B would entail replicating all the EXE code for reading prefabs and whatnot. While this method would be the fastest from the perspective of game load times, it would take a lot more effort to implement, particularly on the debugging front.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 23rd, 2017, 9:54 am

Yep the DuganWorker show up. and option A is good for me, have SSD drive and a really good computer.. ;)

oh and : "n your specific example, are the CA_RE_DuganWorker showing up? I would hope they would, as they're listed as one of the universally available NPCTemplates in "Mods\Export\MobTemplate\NPCTemplate". " ....

look at my debug import:
MSON 936: MobTemplate 'Scorpitron - Mini' "MobTemplate/NPCTemplate/Scorpitron - Mini.mson"
MSON 937: MobTemplate 'Scorpitron' "MobTemplate/NPCTemplate/Scorpitron.mson"
...
MSON 1080: WARNING: there is already an existing universal object of type MobTemplate with the name 'Scorpitron'
Existing: "MobTemplate/NPCTemplate/Scorpitron.mson"
Ignoring: "LosAngeles/CA19_Cops10/MobTemplate/NPCTemplate/Scorpitron.mson"
MSON 1081: WARNING: there is already an existing universal object of type MobTemplate with the name 'Scorpitron'
Existing: "MobTemplate/NPCTemplate/Scorpitron.mson"
Ignoring: "LosAngeles/LosAngelesWorldMap/MobTemplate/NPCTemplate/Scorpitron.mson"
......
it would be very VERY cool when i can fight scorpitrons randomly :D

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 23rd, 2017, 12:42 pm

Was the Scorpitron.mson in "MobTemplate/NPCTemplate/" already, or did you copy it from one of the 'LosAngeles' scenes? The game doesn't support creating new NPCTemplates yet, so even though the debug_import.txt will say it's ignoring the 'LosAngeles' Scorpitron.msons, it'll actually end up using those and ignoring the one in "MobTemplate/NPCTemplate/" since there's no universal scorpitron object to override.

Note there's a bug with the export feature sometimes dumping scene-specific objects in the wrong scene, and if it couldn't find a scene name, it might've ended up writing the MSON file in the universal NPCTemplate folder.

EDIT: Correction - the "MobTemplate/NPCTemplate/Scorpitron.mson" will be used, but only in scenes that already have a NPCTemplate object named 'Scorpitron'. I forgot that the game preferentially overrides using files from the universal folders.
Last edited by Executor_ on July 23rd, 2017, 4:53 pm, edited 2 times in total.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 23rd, 2017, 3:17 pm

I copy it from LosAngeles mobtemplate... was hoping it works but.. hmm.. :)

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 24th, 2017, 4:36 pm

I've looked into this since I needed a break from wrangling tooltips for 0.9.3, and I've been able to get scorpitrons working with random encounters aside from the "Scorpitron Summon Minis" SpecialAttack. I'll see about releasing a 0.9.2c tomorrow.
Last edited by Executor_ on July 27th, 2017, 4:26 am, edited 1 time in total.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 25th, 2017, 4:45 am

Great!! :D this type of game is my favorite since xcom, enemy unknown 1993, and guy´s like you make them even much more greater! Big thx! :)

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 25th, 2017, 12:05 pm

New version 0.9.2c available here: https://www.dropbox.com/sh/x36syu96ku75 ... g80ka?dl=0

To have the game load a scene and retain specific objects from it, create a file named LoadSceneObjects.mson in the "Mods\Import\Table" folder.

Example file:

Code: Select all

{
	scenes : [
		{
			sceneName : AZ02_Highpool
			objects : [
				{ type : NPCTemplate, name : AZ2_PoleAxe }
			]
		}
		{
			sceneName : CA19_Cops10
			objects : [
				{ type : NPCTemplate, name : Scorpitron }
				{ type : GameObject, name : ImpactPoint_Left_Front }
				{ type : GameObject, name : ImpactPoint_Left_Rear }
				{ type : GameObject, name : ImpactPoint_Right_Front }
				{ type : GameObject, name : ImpactPoint_Right_Rear }
			]
		}
	]
}
But to just make the scorpitron available, the following will suffice:

Code: Select all

{
	scenes : [
		{
			sceneName : CA19_Cops10
			objects : [
				{ type : NPCTemplate, name : Scorpitron }
			]
		}
	]
}
Also, make sure there's a Scorpitron.mson in "Mods\Import\MobTemplate\NPCTemplate" containing:

Code: Select all

{
	specialAttacks : [ "Scorpitron Head Sweep" ]
}
so that the "Scorpitron Summon Minis" SpecialAttack is disabled.

The scene loading will be done during the black screen right before the main menu at game start. I would've liked to have it earlier in the loading process, but that was causing issues (likely caused by my object database) which would take a while to fix.

Also, the StatusEffect bug I reported a while back wasn't actually affecting 0.9.2 since it already had the proper code. I did fix a similar bug which could lead to items based on newly-added ItemTemplates disappearing from the inventory after a load.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Sebastian » July 26th, 2017, 11:16 am

Nice! it works! :D started a new game and inserted scorpitron for a test in every random encounter... and i got defeated versus the first spawn, scorpitron rip me in pellets.. :D the specialattack summon minis is difficult to implement?

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 26th, 2017, 1:48 pm

It shouldn't be too hard. I'd need to edit the Spawner code to manually attach the four ImpactPoint GameObjects required for that SpecialAttack if a scorpitron is missing them. They need to positioned correctly though, and since I haven't really fiddled around with Transforms before, it'll take some testing to get it all done correctly.

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

Re: Wasteland 2: now with improved modding capabilities!

Post by Executor_ » July 27th, 2017, 3:42 pm

New version 0.9.2d available here: https://www.dropbox.com/sh/x36syu96ku75 ... g80ka?dl=0

The "Scorpitron Summon Minis" SpecialAttack should work now.

LoadSceneObjects.mson in the "Mods\Import\Table" folder should contain the following:

Code: Select all

{
	scenes : [
		{
			sceneName : CA19_Cops10
			objects : [
				{ type : NPCTemplate, name : Scorpitron }
				{ type : GameObject, name : ImpactPoint_Left_Front }
				{ type : GameObject, name : ImpactPoint_Left_Rear }
				{ type : GameObject, name : ImpactPoint_Right_Front }
				{ type : GameObject, name : ImpactPoint_Right_Rear }
			]
		}
	]
}
Also, don't forget to undo any changes to the 'specialAttacks' field in the Scorpitron.mson NPCTemplate otherwise "Scorpitron Summon Minis" will remain disabled.

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 4th, 2017, 4:42 pm

Are all the MOBTemplates being exported, or am I maybe doing something incomplete/wrong? Reason I ask, is I'm searching for MSON files for specific characters, and they're not in the respective subfolder in Export. Currently in my NPCTemplate folder, for example, I have about 216 files; I'm pretty sure there are more characters than that in the game.
"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."

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests