Wasteland 2: now with improved modding capabilities!

For community content (fan-art, fanfic, etcetera) for Wasteland 2.
Post Reply
karlito31
Initiate
Posts: 7
Joined: March 16th, 2019, 12:46 am

Thanks for answer. I allready did new skill via 0.9.4.x and that works as it should, but Im after something somewhat beefier in a way (introduce/reintroduce stealth to the game) so I was corious about exact mechanics. Ther is InitSkills in Pcstatmanager. Is that where you loding your skill data to dictionary? And if so, can (and how) I hook there for my needs? hope not to bothering you.
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

In InitSkills, I'm loading the Skill data from Resources, just like in the base game. The base game only has a Skill class, but since I also created Skill_Weapon and Skill_Challenge classes, I need to copy the data over and delete the originals. atWeapons and heavyGun are one Skill in the base game, I separate them into two. Afterwards, I adjust some values and enter data into any fields I created.

So yes, that's where you'd start. But most of the work would be UI and AI changes. CheckAggro in the NPC class would be one method to check out.
karlito31
Initiate
Posts: 7
Joined: March 16th, 2019, 12:46 am

Yes, I allready located method of interest here, "isinperceptioncone" in Mob and by some simple changes I was able to make my party completely invisible for mobs, right in front of them. So now it is a metter of fine tuning two variables there,is num < num2, and for that I need to know is skill active and how many points are in it. That is basicaly all I need from skill. So in the end, It is likely that I will just create it with 0.9.4x :)
systemjack
Initiate
Posts: 2
Joined: March 16th, 2019, 11:01 am

Thanks for the great work! I'm seeing an issue with portrait snapshots during character creation. I can take one snapshot for a given character and it appears darkened. After the initial snapshot, no further presses of the "Take Snapshot" button save any image. Looks like all the snapshots are saved darkened compared to in-game experience (using external viewer) including the ones from before DLL patch so the lighting must happen in the code. In fact if I restart the game the singular snapshot from the previous run will be available and look normal. I confirmed the behavior with no files in the Import folder and that the correct behavior returned when reverting to original DLL. Also reviewed the logs and did not see any errors. Thanks again.
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

0.9.4y now available here.

UPDATED GAME BUG FIXES
  • taking multiple snapshots during character creation works again
  • fixed saved snapshot appearing too dark in-game until the game was restarted
systemjack
Initiate
Posts: 2
Joined: March 16th, 2019, 11:01 am

Wow, nice response time ;-) Fix confirmed.
sqparadox
Initiate
Posts: 1
Joined: March 15th, 2012, 6:01 pm

Can't increase Attributes when using a controller (both Steam Controller and Xbox) with this installed.

Either have to change to mouse and keyboard or go back to the unmodded Assembly-CSharp.dll in order to spend attribute points. Not a huge deal but an annoyance nonetheless.
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

Yeah, I haven't really tested it with a controller, so not surprising there are UI issues using one. I'll try to get around to fixing it eventually.
User avatar
crimsoncorporation
Novice
Posts: 45
Joined: January 26th, 2017, 3:50 pm

I'm not even sure if this is a bug as such, more of a design flaw... In my recent playthrough I tried to recruit Pizepi, which I did have enough charisma for via the "radiant personality" perk. But of course the total actual charisma of the group was still below the Pizepi threshold, so she did not appear in the first place. Any other NPC the perk would have worked on, but for her to appear the charisma check does not consider the perk.

Sure enough, when I returned a little later with Dan Q, Pizepi was there, because he pushed the actual charisma value over the threshold.

Any way this can be fixed? Should it even be fixed?
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

Can it be fixed? Yes. But it would entail writing new dialogue as there's currently none for the party having insufficient Charisma.
User avatar
crimsoncorporation
Novice
Posts: 45
Joined: January 26th, 2017, 3:50 pm

Ah okay, hardly worth the effort then. I assumed it's theoretically possible to have the charisma check that makes Pizepi appear take "radiant personality" into account.

On a different note, do you think it is theoretically possible/feasable to improve the AI (in a future mod for instance) from what you've seen in the code? Its biggest fault seems to be that it always runs towards you until it gets in range, thus wasting valuable action points.
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

crimsoncorporation wrote: April 11th, 2019, 5:03 am Ah okay, hardly worth the effort then. I assumed it's theoretically possible to have the charisma check that makes Pizepi appear take "radiant personality" into account.
Oh, sorry, misread your initial post the first time. The game IS taking Radiant Personality perk into consideration when calculating whether you have the required Charisma for her to join. Are you sure you had enough Charisma? The cnpcCharismaRequirement for her is 22, which you must at least equal. Radiant Personality only doubles the Charisma of the character with the perk, not the whole party.
crimsoncorporation wrote: April 11th, 2019, 5:03 am On a different note, do you think it is theoretically possible/feasable to improve the AI (in a future mod for instance) from what you've seen in the code? Its biggest fault seems to be that it always runs towards you until it gets in range, thus wasting valuable action points.
Yes, quite possible. Already had to make some adjustments to the AI in 0.9.5 due to all the NPC changes, but haven't had the time yet to actually try to make it smarter. But it's definitely a long-term goal.
User avatar
crimsoncorporation
Novice
Posts: 45
Joined: January 26th, 2017, 3:50 pm

Executor_ wrote: April 11th, 2019, 8:08 am Are you sure you had enough Charisma? The cnpcCharismaRequirement for her is 22, which you must at least equal. Radiant Personality only doubles the Charisma of the character with the perk, not the whole party.
Yes, I had 4x 1 CHA on my main party, plus Ralphy (4), Takayuki (3) and Vulture's Cry (4), for a total of 15. I gave Vulture's Cry the radiant personality perk, so that gave me 19 total. My party had two spiked collars at that point, so I was very happy when an RSM cuddly puppy dropped another one, as that raised my total to 22 if worn, which my party did before they left the Darwin installation.

So I'm not sure what went wrong then, but I heard a mention that the required charisma for Pizepi can actually vary, some seem to have gotten it with less, and maybe sometimes more is needed? Not sure what version of the game this is though, and also not how reliable those reports are. At any rate Pizepi didn't appear with the mentioned constellation. She did later on, when I had replaced Ralphy with Dan Q (9).
Shadow Jack
Acolyte
Posts: 95
Joined: October 25th, 2017, 7:53 am

crimsoncorporation wrote: April 11th, 2019, 12:21 pm
Executor_ wrote: April 11th, 2019, 8:08 am Are you sure you had enough Charisma? The cnpcCharismaRequirement for her is 22, which you must at least equal. Radiant Personality only doubles the Charisma of the character with the perk, not the whole party.
Yes, I had 4x 1 CHA on my main party, plus Ralphy (4), Takayuki (3) and Vulture's Cry (4), for a total of 15. I gave Vulture's Cry the radiant personality perk, so that gave me 19 total. My party had two spiked collars at that point, so I was very happy when an RSM cuddly puppy dropped another one, as that raised my total to 22 if worn, which my party did before they left the Darwin installation.

So I'm not sure what went wrong then, but I heard a mention that the required charisma for Pizepi can actually vary, some seem to have gotten it with less, and maybe sometimes more is needed? Not sure what version of the game this is though, and also not how reliable those reports are. At any rate Pizepi didn't appear with the mentioned constellation. She did later on, when I had replaced Ralphy with Dan Q (9).
Try savescumming, it worked for me.
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

Yeah, the game only checks whether to show or hide her when the map is loaded (also the way its handled for most NPCs), so if you only reach the required 22 whilst on the map, you'll need to save and reload like Shadow Jack said in order to force the game to check again.
AliceInChains
Initiate
Posts: 7
Joined: April 14th, 2019, 2:50 am

Nikita-S-D wrote: June 27th, 2018, 7:19 am Here you can download update sprites that I use, feel free to use them whatever you want, maybe for ammo mod or grenades mod.
Your .zip file also contained some WL2 Atlas files (.png) and correct me if I'm wrong, but the WL2_Icons.png seemed to have some minor modifications. I tried adding my modified one (based on yours) to the Sprite folder and editing the corresponding .mson file in UIAtlas but that does not seem to work. Is it part of one of the assets or resources files perhaps (and thus should be reinserted)? If so, could you let me know which one?

Edit: I also tried to set Atlas and name directly to a .png file in the Sprite folder (without extension) but the icon still won't show up in Character skill tab (trying to add a new icon to a newly created skill: skill shows, but without icon)
Last edited by Drool on April 14th, 2019, 9:43 am, edited 1 time in total.
Reason: If you close tags, it won't look like you're just quoting without adding anything
karlito31
Initiate
Posts: 7
Joined: March 16th, 2019, 12:46 am

AliceInChains wrote: April 14th, 2019, 9:28 am Edit: I also tried to set Atlas and name directly to a .png file in the Sprite folder (without extension) but the icon still won't show up in Character skill tab (trying to add a new icon to a newly created skill: skill shows, but without icon)
I've had exactly the same problem. For a week I was smashing my head seeking a solution, but an icon for my Silent Move skill did not want to appear. In the end, I added my icon to the original WL2_Icons.png through the code. Every time I launch the game, my icon is added to WL2_Icons.png. Then you have to create a new object of "UISpriteData" type with the required coordinates, size and name of the new sprite and add it to the UIAtlas.spriteList. The name must correspond with the name assigned to the skill.spriteName ) Obviously, this requires a direct intervention in Assembly_CSharp.dll, but I did not find another way. Now everything works great. If you decide to use the Assembly approach, I can post the code later when I return home. In any case, if the executor_ has no solution to the problem through the modding interface, dnSpy is the best (and possibly the easiest) option.
Last edited by karlito31 on April 15th, 2019, 1:19 am, edited 1 time in total.
Executor_
Explorer
Posts: 319
Joined: August 11th, 2014, 5:38 am

The built-in icon files are only exported for reference purposes, they aren't designed to be modified. The patch notes for 0.9.2 explained how to add new icons:
  • can create new UIAtlas, the game's sprite databases
    • place picture files in a "Sprite" directory in "Import", valid extensions: PNG, JPG, JPEG
    • modded game will create a new UIAtlas from the image, with the UIAtlas having one item in the spriteList with the same name
    • refer to the picture as the filename without extension
    • eg. if you have testShotgun.png in your "Mods\Import\Sprite\" folder

      Code: Select all

      {
      	atlas : testShotgun
      	spriteName : testShotgun
      }
    • game probably resizes images automatically
    • don't forget about transparencies when creating pictures so that they look OK against the background
karlito31
Initiate
Posts: 7
Joined: March 16th, 2019, 12:46 am

Yes, but that doesn't work for skills, I think. I was creating new atlases in code from my "image.png" using all available functions (create, fromstring, my own variations, etc) and adding it to my skill, along with sprite name, same as atlas name, but icon never showed up. Only when I added it to WL2_Icons.png and placed new UISpriteData to iconAtlas instance, icon finaly showed up. I might be completely wrong here, obviously.
AliceInChains
Initiate
Posts: 7
Joined: April 14th, 2019, 2:50 am

Executor_ wrote: April 15th, 2019, 12:46 am The built-in icon files are only exported for reference purposes, they aren't designed to be modified. The patch notes for 0.9.2 explained how to add new icons:
Doesn't work for Skill icons then. I did do exactly that after altering the WL2_Icons.png + .mson files had the icon not show up. It does work perfectly for changing icons of items in inventory/on character (black leather pants really are black leather now).
karlito31 wrote: April 15th, 2019, 12:21 am If you decide to use the Assembly approach, I can post the code later when I return home. In any case, if the executor_ has no solution to the problem through the modding interface, dnSpy is the best (and possibly the easiest) option.
If you could, that would be great.
Post Reply

Return to “Wasteland 2: Community Content”