Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SaveGameAtTarget(Vector loc)
- {
- local Odyssey_SaveGameState SGS;
- local int i;
- SGS = new () class'Odyssey_SaveGameState';
- SGS.AbilitiesUnlocked = abilityInventory.AbilitiesFlags;
- SGS.currentLevel = SaveGameState.currentLevel;
- SGS.posX = loc.X;
- SGS.posY = loc.Y;
- SGS.posZ = loc.Z;
- SGS.bLevelStart = SaveGameState.bLevelStart;
- SGS.CheckpointInt = SaveGameState.CheckpointInt;
- for(i = 0; i < 11; ++i)
- {
- SGS.earthMap[i] = SaveGameState.earthMap[i];
- SGS.WindMap[i] = SaveGameState.WindMap[i];
- SGS.LightMap[i] = SaveGameState.LightMap[i];
- }
- for(i = 0; i < 14; ++i)
- {
- if(SGS.MotherMap[i] > 0)
- SGS.MotherMap[i] = SaveGameState.MotherMap[i];
- }
- for(i = 0; i < 4; ++i)
- {
- SGS.EarthSW[i] = SaveGameState.EarthSW[i];
- SGS.WindSW[i] = SaveGameState.WindSW[i];
- SGS.LightSW[i] = SaveGameState.LightSW[i];
- SGS.MotherSW[i] = SaveGameState.MotherSW[i];
- }
- //ScrubFileName("..\\..\\..\\Saves\\SaveGameState\\odysseysave.bin");
- class'Engine'.static.BasicSaveObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1);
- //`log("Saved game");
- }
- exec function LoadGameSave(string savefilename)
- {
- local Odyssey_SaveGameState SGS;
- local Vector loc;
- local int i;
- SGS = new () class'Odyssey_SaveGameState';
- if( class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\"$savefilename, true, 1) )
- {
- SaveGameState.AbilitiesUnlocked = SGS.AbilitiesUnlocked;
- SaveGameState.currentLevel = SGS.currentLevel;
- abilityInventory.AbilitiesFlags = SaveGameState.AbilitiesUnlocked;
- if(!SGS.bLevelStart)
- {
- loc.X = SGS.posX;
- loc.Y = SGS.posY;
- loc.Z = SGS.posZ;
- SaveGameState.CheckpointInt = SGS.CheckpointInt;
- Pawn.setLocation(loc);
- }
- SaveGameState.CheckpointInt = SGS.CheckpointInt;
- //touchup code:
- for(i = 0; i < 11; ++i)
- {
- SaveGameState.earthMap[i] = SGS.earthMap[i];
- SaveGameState.WindMap[i] = SGS.WindMap[i];
- SaveGameState.LightMap[i] = SGS.LightMap[i];
- }
- for(i = 0; i <14; ++i)
- SaveGameState.MotherMap[i] = SGS.MotherMap[i];
- for(i = 0; i < 5; ++i)
- {
- SaveGameState.EarthSW[i] = SGS.EarthSW[i];
- SaveGameState.WindSW[i] = SGS.WindSW[i];
- SaveGameState.LightSW[i] = SGS.LightSW[i];
- SaveGameState.MotherSW[i] = SGS.MotherSW[i];
- }
- }
- else
- {
- SaveGameState.AbilitiesUnlocked=0;
- SaveGameState.currentLevel=Wind;
- }
- //`log("Loaded game");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement