manila35 wrote: ↑Sat Nov 12, 2022 2:52 pm
When I open the Item or Inventory script I only see a bunch of ???; the fields don't get populated for me..
Can you give us a step-by-step guide on how to modify/add factors to an item?
Thank you.
I don't want to sound like 'that guy'...but...
If the script was not working, you wouldn't get anything. The fact that you got anything means records were found. If your seeing ???'s then that means the entries you are looking at are blank entries, and this is normal. If you click the box and got nothing at all, then the script failed. Because of the nature of how this script functions, sometimes that is normal. Restarting the game should fix it.
I have not added the ability to modify/add factors to the script, because it's not in a format that is understandable. There is four 8 byte sections in memory that controls factors, but I don't know if it's one part of the 8 bytes or the entire 8 bytes. I don't yet know how to change the scaling/numbers etc. in the 8 bytes. The only thing I can do is copy one factor from one item to another.
I have not added the ability to change items, because it's not in a format that is understandable. I figured out the pointer address to change the item base, but there is an 8 byte section in memory that changes the item type, and, again, I don't know if it's one part or the entire 8 bytes. The only thing I can do is copy one item format to another.
The step-by-step IS the script. The there is also a website that explains how I did it in the script.
This script is a dev tool, while you can change some things, it does not do it safely. It's also possible that it could break on a version update, although I tried to minimize it. This is why it's under a section for testing, and there is a warning that it could break your game if used. Also, the only thing this tool is ever supposed to do is reveal addresses. If your expecting to edit things, then your expectations for what this tool is for is a bit high.
If this doesn't apply to you then...
These scripts are for helping find locations in memory that contain data. Not specific data like ATK, INT, etc - but rather a generalized location for finding that specific data. I gave you the spreadsheet, not the cells; the book, not the words; the array, not the elements; the class instance, not the class properties; the orange, not the juice, or however it is stored. You still got to experiment to figure out where and how this specific data is stored. Sometimes it's pretty simple. You might find the value your looking for in plain sight. Other times you got to mess around a bit until something changes or breaks.
Do I know what I'm looking at? No. I just have a lot of time on my hands at playing around with things. If you write scripts, you know how it is. All I guarantee is that this may be a better starting point for your search than trying to scan everything. And that it might even be possible to stumble upon things we didn't even know existed in the game.
I really emphasize that the general use of this tool is to be used in the dissect data structure utility, where you can compare records side-by-side to help you find exactly what your looking for. Because not all records will have information in plain sight, and it's way more useful to look at and compare several records to "expose those secrets". I only added a few fields as an example to show everyone how I was using this tool. I only ever expected the record addresses to be used. So when I say 'Item+20' it makes sense to anyone looking at the dissect data structures utility.
It is with my hope, that once this happens devs will be able to write their own scripts - and hopefully not in the bloody mess that mine is in. Preferably by changing the game's code in how it handles the data and not the data directly. It would be cleaner, faster, stable, and more understandable that what I'm doing. If it breaks, you wouldn't have to read a novel of code to fix it.
Also, check the first post. I have included a list of known offsets in the developer section.
So yeah...I want people to get excited, because we found some really cool stuff. And I want people to know it's still being worked on.
But I don't want people to get so excited they start breaking their games or making an assumption that this is something they can use to to change stuff.
It's on it's way though!
I updated the scripts a bit. Removed some stored structure metadata to reduce size. Also included more offsets, including the ones I discussed here and previously. Again, I encourage developers to test things out. If your not a developer and want to poke around anyways, know that things could potentially break and that, while you can change things, it's not intuitive or easy.
Upon a bit more digging....
The first half of the Item Records appear to reflect the Items in shops?
There is several classes related to Shops I can bring in to the mix to see if it points to these items.
After that, there is a section of Items Records that belong in your inventory.
We already know that Inventory+10 is a pointer to the first Item (in your inventory).
I just found out Inventory+18 is a pointer to just after the last Item (in your inventory).
This is the Inventory 0 Record
Then there is a section of Items Records that are empty.
Same offset details as above.
It's purpose is unknown at this time.
This is the Inventory 1 Record
Then there is another section of Items Records that belong in your inventory.
Same offset details as above.
Changing these Records don't seem to do anything(?)
It's purpose is also unknown at this time.
This is the Inventory 2 Record
It might be possible to use the Inventory Records to look up items, much like Item Records use a base pointer to find item stats. That way, all items are looked up, but you can separate them between what is relevant or not.....perhaps. It may even be possible to edit the entries first part of the Item Record to have shops sell whatever you want(?)
By just using the Item Records, I was able to change an item the vendor was selling into another item. The shop interface refreshes the Item Records if you navigate away (left/right/close/category/etc) but if you move up/down the list you can avoid it. The item name in the item list (in game) wont reflect changes, but if you select another item (up/down), it will reflect on the details screen when you go back to it. This seems like a good entry point for adding any item you want into the game.
Item+40 (8 Byte) Seems related to who has the item equipped and possibly what slot.
Now that I can see shops editing memory, I can find the routine that's responsible for adding items to a shop list. We are missing some offsets shops require, so it would be nice to know what these values are.
Item+10 (8 Bytes) - Unknown
Item+18 (4 Bytes) - Unknown
Item+20 (8 Bytes) - Item Base Pointer
Item+28 (8 Bytes) - Unknown
Item+30 (4 Bytes) - Quantity (For shop, probably 0)
Item+38 (8 Bytes) - Recent Items Counter/Sort? Increases with every item obtained. (For Shop, probably 0)
Item+40 (8 Bytes) - User/Slot Equipped on. (For Shop, probably 0)
Item+48 (4 Bytes) - Unknown
Item+4C (1 Bytes) - Unknown
Item+50 to Item+6F - Factors 1-4
I'm probably done for the day
I was able to identify more of the Item Structure
Whatever values Factor represents is the same between reloads (Not to be confused with persistent saving)