An item with the same key has already been added

Started by Jabbage, Fri 09/02/2024 21:44:17

Previous topic - Next topic

Jabbage

I'm really hoping someone can help me, I've apparently really screwed up my game! ???

I had a room and some characters which were placeholders from an earlier phase of development for my game, and I figured I'd delete them since they were no longer being used.
(In future I'll always back up BEFORE doing this kind of thing, if I do it at all but... too late now I guess, argh.) 

I deleted the room and one of the characters, at which point AGS froze and then crashed.

Now whenever I try to open the game I was working on in AGS (the .agf file), it won't open and I get this message:


I have a backup from yesterday which is working fine so it's not the end of the world, but I'd really really love to not have to redo all the work I did today!
Unless I can open the file in AGS I'm not sure what I can do.

Does anyone have any ideas? Is there more information I can provide that would be helpful?

Thanks so much!

Jabbage

Just as an update - I figured it was easier to just redo the work than figure out this mess. It took my Saturday morning, but I think I'm back where I was before this happened! I'm still interested to know what the heck I did to cause this, but it's no longer a pressing thing.

An excellent reminder to backup before making big changes, and that keeping daily backups can save your bacon!

I was also really pleased that I log all the changes I make on a spreadsheet, which let me know exactly what work I'd done before this happened which had been lost.

Khris

You can open the broken .agf file with an editor like VS Code and check the XML structure. My guess is that you somehow ended up with two character folders of the same name.

The relevant section starts like this:

Code: xml
  <Characters>
    <CharacterFolder Name="Main">

Crimson Wizard

Since backing game up came up in this thread, I might also recommend learning "source version control" tools, such as Git, Mercurial, SVN etc. In very simple terms, these tools create a record of history of changes, where each step has an optional description, and you can see what did you change, and even revert to previous steps if necessary.

kursh

Quote from: Crimson Wizard on Sun 11/02/2024 15:48:46Since backing game up came up in this thread, I might also recommend learning "source version control" tools, such as Git, Mercurial, SVN etc. In very simple terms, these tools create a record of history of changes, where each step has an optional description, and you can see what did you change, and even revert to previous steps if necessary.

It sounds really interessant. Could you give me/us a hint where to start to make our ags games source version control??  :shocked:  thanksss

Crimson Wizard

#5
Quote from: kursh on Sun 18/02/2024 19:37:48
Quote from: Crimson Wizard on Sun 11/02/2024 15:48:46Since backing game up came up in this thread, I might also recommend learning "source version control" tools, such as Git, Mercurial, SVN etc. In very simple terms, these tools create a record of history of changes, where each step has an optional description, and you can see what did you change, and even revert to previous steps if necessary.

It sounds really interessant. Could you give me/us a hint where to start to make our ags games source version control??  :shocked:  thanksss

Well, you could start searching for the ones mentioned above, and learning how they work.
Each of them have a version with GUI which make working easier for beginners.

This, for example, is for Git:
https://git-scm.com/downloads/guis

But it will take a while if you have never used version control.
It's best to train on a dummy project rather than a real one.

kursh


SMF spam blocked by CleanTalk