FluffyFishGames / ACNHDesignPatternEditor

An editor for Animal Crossing: New Horizons design patterns.
GNU General Public License v3.0
351 stars 28 forks source link

Cannot transform the design to my own #27

Open willing1234 opened 3 years ago

willing1234 commented 3 years ago

I tried several time, but it is not works. After import and export a design code, it suppose to be edit on you switch, but no matter what I do, it is not working, However, my friend create a file for me, and import the code I upload in community, it is works. Do anyone know what's the problem?

FluffyFishGames commented 3 years ago

I answered this issue in #30. Will continue commenting there.

lottehime commented 11 months ago

Issue https://github.com/FluffyFishGames/ACNHDesignPatternEditor/issues/30 was closed by opener, so continuing conversation here (years later).

Issue https://github.com/FluffyFishGames/ACNHDesignPatternEditor/issues/27 & https://github.com/FluffyFishGames/ACNHDesignPatternEditor/issues/30 are related.

The ACNH file format needs to include the players PlayerID and TownID from main.dat or personal.dat being written to the pattern data and then written back to main.dat at each pattern index.

https://github.com/FluffyFishGames/ACNHDesignPatternEditor/blob/498aa02174c3bce744a9305f4f858d1e4c65e4cb/Assets/Plugins/ACNHFileFormat.cs#L97-L107

Similarly to the way that the ACNL file format reads/writes those bytes:

https://github.com/FluffyFishGames/ACNHDesignPatternEditor/blob/498aa02174c3bce744a9305f4f858d1e4c65e4cb/Assets/Plugins/ACNLFileFormat.cs#L457-L458

But read from the *.dats and written to the pattern byte arrays would be best (not relying on pattern dumps that originate from the user).

Without those IDs written to the start of each pattern array the game marks them as not owned by the player and thus unable to be edited within the game (marked with 🚫).

Refer here for details on the data side.

If I get time I might look over the codebase and implement, but it might be quicker for @FluffyFishGames to action it due to familiarity with the codebase.

I would also recommend not using a trimmed file format for the pattern exports to increase interoperability.