PixelRick / CyberpunkSaveEditor

A tool to edit Cyberpunk 2077 sav.dat files
MIT License
320 stars 44 forks source link

Adding a "new constant"?! #39

Open Sonatine1 opened 2 years ago

Sonatine1 commented 2 years ago

Hi!

The new version loads just fine and most things I know seems to work. I have one problem, though.

When I choose a new item (weapon or whatever), I can't add a "new constant" under "Stats" in the "item data" menu. With existing weapons, clothing etc. which I already edited with a old version (same savegame), it works (it just doesn't shows my old edits anymore... it only shows one totally empty constant).

Any new things I have to consider or am I just too tired to remember that I have to do some steps before?

Best regards Sona

New stuff: new

Already edited stuff: old

PixelRick commented 2 years ago

Stats data type name changed in 1.3 to "gameStatModifierData_Deprecated" so we can expect some changes. In this particular case however, some items were this way already. I just have to create the stats data entry from scratch.

PixelRick commented 2 years ago

I checked a 1.5 save, and I cannot find any item with stats.. do you ? If not then it's really deprecated now and better to search for their new way of storing stats..

Sonatine1 commented 2 years ago

Hey...

OLD Savegames (from 1.1 to 1.5 updated all the time):

NEW Savegame (1.5):

I will edit here if I find out something new.

PixelRick commented 2 years ago

Ok I think I know what is wrong then.. edit: new savegame working fine is definitely what makes it weird.

PixelRick commented 2 years ago

Can you send your save with the Preset_Dian_Yinglong that has previous changes that are still active in game but no longer visible in the editor ? When you say the changes still work, do they after you reload the updated-to-1.5 save ?

Sonatine1 commented 2 years ago

Hey... I'm currently in the train. When I'm home I'll send you everything.

Sonatine1 commented 2 years ago

Finally home.

The old Savegame (it's my test savegame) has been updated to 1.5. I used your tool before 1.3 and it worked fine. Back then it showed me a whole list of the changes I made (constants added). Now ONLY the weapons I already edited back in early 2021 can be changed with "new constant". When I add a new gun via CET console, it doesn't show me the option "new constant".

And then there is the NEW Savegame, I created a few days ago (because I want to play the game again after 8 months). Here I can choose any gun or item I want and add new constants PLUS (!) these changes are shown afterwards and I have a list of the added constants - on the old savegame, the editable items actually take over these changes in the game itself as well, but it DOESN'T show the new constants afterwards. The list stays empty (only shows them in the running session).

Old Savegame (basically my test char): https://ufile.io/zc2t0e4k

New Savegame: https://ufile.io/ftavzyad

PixelRick commented 2 years ago

Thanks ! Made some progress. I see they now use "modifiersBuffer", it is a DataBuffer with basically looks like a serialized statModifiers array. Probably to defer load it... I don't know which one has precedence over the other yet, but I can find out with forged stats.

PixelRick commented 2 years ago

1060_1500_stats_comparison edit: last zero field is probably of type gameStatsBundleOwnerType. (default is 9 and it's the only enum with "Invalid" == 9 that makes sense).

Sonatine1 commented 2 years ago

Ah, wow. That's cool! :) So it's basically all the information in one string?! But they didn't change the file system, right?

Glad that you are able to make some progress. The tool is such a great thing. :)

Sonatine1 commented 2 years ago

Can you post when you have some Updates? If I can help you, ask me... I can see what I can do. :)

*Edit: I tested some more and now the changes seem to stay visible in the tool on the old Savegame (I try to do it agin... dunno how I did it) - but (!) I still can't edit new added items!

PixelRick commented 2 years ago

Yes I will ! It's my second day at work so I have a new coding style and workflow to get used to. So I'll be probably be too tired to work seriously on it for a few days. This week-end should do.

If you edit a 1.5 save, then load and re-save, does the new save still has your changes visible in the editor ? (I'd like to know if they move old stats to new stats only when converting on read, or whenever we save.)

Sonatine1 commented 2 years ago

I'll check this evening and then let you know.

Sonatine1 commented 2 years ago

Okay. Tested it - both, the old Savegame (updated to 1.5) and the 1.5 Savegame. Reloaded both and saved again.

Constants are disappearing! Looks then again like on my previously posted Screenshot named "New stuff".

PixelRick commented 2 years ago

Actually that's good, it means i can implement the new buffer and no longer care about the deprecated impl.

Sonatine1 commented 2 years ago

Ahhh, I'm sorry... I mean it looks like the Screenshot "Already edited stuff".

Jesus... I hope I didn't make you work on a totally false end now. I'm sorry!

PixelRick commented 2 years ago

Current pb on my side: I have to add a pre-serialize step just for this object kind to "commit" the edits into the buffer. However it's hard to hook that in the current rtti implementation. I tried to work on my new rtti impl but I haven't enough free time atm, it will improve now that I'm used to the codebase at work. Seberoth started integrating cybercat in the Wolvenkit. So maybe they'll have the weapon mods editing ready sooner than me. (Probably can't work on it this week-end because I'm moving.. maybe in the evenings next week)

Sonatine1 commented 2 years ago

Okay, thanks for the update. :)

PixelRick commented 2 years ago

I will probably discontinue this project. The WolvenKit is gonna have the same features soon. They have plenty of devs so things go fast (and some now work at CDPR so they have insider info). Feels bad to not be able to help them out directly, I hate C# too much.

Sonatine1 commented 2 years ago

Oh man, I feel sorry for you. Can't they involve you? I mean you spent so much work with this. :/ And will the WolvenKit have the exact same feature?

joshuabaker commented 1 year ago

@PixelRick Would love to be able to access this. Is this the “entity editor” you note in the latest release?