Jump to content

Welcome to Obsidian Forum Community
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

[Tutorial] Editing abilities, talents and items


  • Please log in to reply
9 replies to this topic

#1
Staehrminator

Staehrminator

    (1) Prestidigitator

  • Members
  • 12 posts

In my other tutorial (https://forums.obsid...side-of-combat/) I explained how to edit the game files by using UABE and a hex editor. But, a hex editor will only get us so far. It will work fine for just changing values and setting properties, but if we want to do more advanced stuff we need a better way to edit these files.

 

Let's say we want to edit the Rogue's Dirty Fighting ability to give it a bonus to Interrupt as well as hit-to-crit conversion. How do we do that? Read on.

 

 

Step 1: The file

Read my other tutorial to figure out how to find Dirty Fighting's .unity3d file and open it with UABE (Disunity will not work). Again, find the biggest MonoBehaviour and look at it. This is a GeneralAbility, and it has a StatusEffects array which is interesting. Open it, and you'll see a StatusEffect that modifies one stat by 1.1. This is the 10% extra hit-to-crit chance. Ideally, we would have a second StatusEffect in this array, for the extra Interrupt. But since this is too tedious to do with a hex editor, let's do it the proper way!

 

 

Step 2: Exporting

Close down all the UABE windows except the first one, where it says CAB-xxxxetc. Click the Export button. It will prompt you for a location and a file name, let's call it Export.assets (the file type doesn't matter). Use UABE to open the file you just exported. It will take you straight to the assets info screen, with one important difference that we'll come back to later. For now, just highlight the largest MonoBehaviour and click Export Dump. Save it as Dump.txt.

 

 

Step 3: Editing

Now, open the Dump.txt you just saved. Here is our ability, in a nice readable format. And, what's more, we can now edit this text file, import it back into the asset and our changes will be applied! So, scroll down and find the StatusEffects array. Inside it is an item, starting with a [0] line.

 

Now, we could just copy that whole item (from [0] down to and including m_deserializeInitiated), then go in and change the extra stat, but then we would need to figure out what value represents Interrupt in the ModifiedStat property, which requires opening up the game code in ILSpy. A much easier way is to find the Interrupting Blows' .unity3d file, export it to a dump in the same way we did earlier, and copy that item's StatusEffect into this file, changing the Value for the interrupt bonus from 15 to whatever you like. Whichever way you do it, remember to change the second [0] to [1], and set the array's Size to 2. 

 

Now you're done editing, so let's reimport the file.

 

 

Step 4: Importing

Open up Export.assets again, and select the largest MonoBehaviour. Now, click the Import Dump button (this one only appears when you open assets files, hence why I mentioned that it's an important difference) and select your dump.txt. Nothing much will happen, but it has now imported your changes. In the current window, press File->Save. It won't let you save as the file you have opened, so call it Import.assets. All right, now open the Dirty Fighting .unity3d, and choose Import. Select Import.assets. Again, no confirmation, but it has imported the asset file back into the bundle. Save this file (from the window where it says CAB-xxxxx), as DirtyFighting2.unity3d. If you want, you can open the file you just saved, go in and look at the info, and the StatusEffects array should now have a second item which modifies Interrupt.

 

You're done! Rename the edited .unity3d file to the same name as the one in the game's directory, and put it there (back up the old one first). Then enjoy your new ability in-game.


Edited by Staehrminator, 19 April 2016 - 12:58 AM.

  • MaxQuest likes this

#2
hrwd

hrwd

    (3) Conjurer

  • Members
  • 124 posts

mother****er! My UABE says "The assets file index is out of range" when I try to import. Are you talking about the Import button UNDER the CAB-xyz thingy?

 

...why do I've a nose I'll have to do my modding via the hex-editing method...



#3
Staehrminator

Staehrminator

    (1) Prestidigitator

  • Members
  • 12 posts

mother****er! My UABE says "The assets file index is out of range" when I try to import. Are you talking about the Import button UNDER the CAB-xyz thingy?

 

...why do I've a nose I'll have to do my modding via the hex-editing method...

You need to follow the recipe very carefully. I haven't done this myself in a long while, but as long as you do it exactly the way I've outlined it should work fine. Remember to have the correct index on your added effect, and to increase the array's size to 2.


  • hrwd likes this

#4
hrwd

hrwd

    (3) Conjurer

  • Members
  • 124 posts

 

mother****er! My UABE says "The assets file index is out of range" when I try to import. Are you talking about the Import button UNDER the CAB-xyz thingy?

 

...why do I've a nose I'll have to do my modding via the hex-editing method...

You need to follow the recipe very carefully. I haven't done this myself in a long while, but as long as you do it exactly the way I've outlined it should work fine. Remember to have the correct index on your added effect, and to increase the array's size to 2.

 

 

Sorry, sometimes I fail at tiny details. Hence my problems with maths(I understand it a-ok, but when solving problems...the mistakes like these happen). I most likely forgot about the array size thingy.



#5
Rolandur

Rolandur

    (3) Conjurer

  • Members
  • 108 posts

Seems the newest version of UABE now (2.0) allows directly editing raw exports. So no more need for a hex editor. Use Export Dump and Import Dump to update the files.


Edited by Rolandur, 29 August 2016 - 12:30 PM.


#6
hrwd

hrwd

    (3) Conjurer

  • Members
  • 124 posts

Seems the newest version of UABE now (2.0) allows directly editing raw exports. So no more need for a hex editor. Use Export Dump and Import Dump to update the files.

 

Oh lol. I've got v1,0 lol


Edited by hrwd, 29 August 2016 - 12:49 PM.


#7
Rolandur

Rolandur

    (3) Conjurer

  • Members
  • 108 posts

 

Seems the newest version of UABE now (2.0) allows directly editing raw exports. So no more need for a hex editor. Use Export Dump and Import Dump to update the files.

 

Oh lol. I've got v1,0 lol

 

 

Now the real question, for me, is how to edit files *but* use some kind of override directory instead of copying my editing resources back over the original.

 

I much prefer to do this 'mod like' and not have to directly change the installation files.



#8
hrwd

hrwd

    (3) Conjurer

  • Members
  • 124 posts

My real question is...I don't understand the Array part. Do I need to edit the Array size no matter what I change or only if I add functionality? What if I remove a functionality? What if I just change the value of dmg(for the lack of better term)?

 

Also, what zero lol(there's LOTS of them)? Care to do it via screenshots or elaborate further? If I just edit a value do I still need to change 0 to 1?

 

Thanks!



#9
Ragniz

Ragniz

    (1) Prestidigitator

  • Members
  • 15 posts

Edit: wrong thread


Edited by Ragniz, 30 January 2017 - 07:32 AM.


#10
dam

dam

    (3) Conjurer

  • Members
  • 169 posts
  • Location:France
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

My real question is...I don't understand the Array part. Do I need to edit the Array size no matter what I change or only if I add functionality? What if I remove a functionality? What if I just change the value of dmg(for the lack of better term)?

 

Also, what zero lol(there's LOTS of them)? Care to do it via screenshots or elaborate further? If I just edit a value do I still need to change 0 to 1?

 

Thanks!

 

From my understanding, your array contains X abilities and is therefore of size X.

 

This, is an array with 2 entries :

[ array ] [ entry 0 ]

[ array ] [ entry 1 ]

 

If you edit values inside these entries, you need not expand your array.

If you want to add a new entry :

[ array ] [ entry 2 ]

 

Then you need to expand your array so the 3rd entry fits.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users