Thanks for all of the tips offered here about the food items collected by Spongebob for the game created by Camper, which looks cool by the way, great artwork too.
I gave the codes suggested a try as a beginner to the C Language, but have a question or two regarding the implementation of the scripting. While I can save and load the clone.0 actor, clones.1, 2, 3 etc won't save or load from my set up. I can successfully save/load textNumbers, like score, player lives, etc, but clones I haven't been able to get working yet and it's the most important part of saving, so an unlocked door will stay unlocked on load, etc.
I tried including a zip file of the basic process I attempted, but it didn't load up here for some reason.
Game includes: 1 player. 1 save key, 1 load key, 500 food items for example that become transparent (1.000) when the player contacts them in a test file. (It's actually less than 500 in the actual game, but just want to keep in line with this thread for the consistency).
Question 1: Are these codes in the right locations?
-------------
foodswitch variable created inside the script editor? Yes. Set to array, 500 number set, for 500 food items. Integer Global. Save group is "savegame" ( or savegame ).
-------------
player/events/collision with food/repeat on/script editor:
foodswitch[cloneindex]=1;
-------------
food/events/create actor/script editor:
transp=foodswitch[cloneindex];
-------------
Where does this code go? I tried putting it into a few script editor locations like above, but it brings up an error message and prevents it. I'm guessing it's not needed if a variable was already created though, true?
int foodSwitch[ActorCount("food")];
-------------
player/keydown/ s / script editor //s keydown means Save when pressing "s" on the keyboard
foodswitch[cloneindex]=transp;
saveVars("savegame.gdt", "savegame"); //variable being the second item in quotes, "savegame".
-------------
player/keydown/ l / script editor //the letter "L" meaning load game on the keyboard. "L" meaning "l".
loadVars("savegame.gdt", "savegame");
transp=foodswitch{cloneindex}; // I tried entering numbers in the cloneindex area, but it rejects the load code.
-------------
Any suggestions are greatly appreciated, as it will allow the player to save and load their progress in a giant adventure game created in Game Editor, 100MB+. Thanks!