So, even though my game is early in development, I already have some plans for the game to have a sequel.
And one feature that I would love to implement in a "stop&swap" sort of thing, where, if the player acquires a certain item in the first game, they'll be able to use it in the second game.
Can you recommend me any good way to implement this? Maybe using global variables, and telling the player to transfer the file from one game to the next? Or are there any other good ways to get this to work?
Any direct data transfer will require you to have the second game use the same database as the first one. It can be done but it will limit what you can do in the second game.
There are two other options that would be much easier to implement:
1) give a code or password for transfering to the next game, then ask the player in an event there for the code (see the official blog tutorial on how to implement passwords if you don't know how).
Those codes could be used without playing the first game as soon as someone posted them somewhere, but that is usually not a problem
2) use a plugin to save a list of what the player has, ask him/her to transfer this new file to the other game and have a plugin there load the list and react to it.
Requires javascript knowledge, but allows for more options than simple codes.
I guess a better option is to somehow transfer the status of a switch or variable
If you want items, weapons and armors to persist, then you pretty much need to have every item,weapon,armor (and even states, animations and anything else that items use) on the database of game 1 to be present on the very same spot on game 2's database.
well, what about plugins for global switches / variables?
The only way plugins can transfer data outside the game is the method I already mentioned as 2) in my post above.
If you read the descriptions of those existing "global switch" plugins, you'll learn that they are intended only between the savefiles of the same project, not between different projects.
If you copy the savefile, you are (like said above) absolutely required to have the same database on both projects - basically you would not make a new game but only an addition to the old game.
I see. Well then, I'll either try to find a plugin that can read/write external files (like .txt files), or just use a password system.
Thanks for the info.
Honestly, the only idea I have is option 2, although if you could save it into %Appdata%/Roaming/<Your Company>/<Your game> and read that same file from your plugin, none of your players would have to copy anything manually.