simple Save/Load kismet

Not that it can be of much interest to the coders here(I consider my self to be on the bottom of the food chain when it comes to code) , but yesterday while doing my regular dumpster diving in the archived forums :smiley: ive found this nice kismet script that lets you save most stuff without the need of a dll. And I tested that the save works on 64bit and 32bit.And even the save from the 32 bit one works on the 64 bit and viceversa.


*class SaveLoad_Object extends Object;*

*var int iValue;*
*var float fValue;*
*var int bValue;*
*var vector vValue;*
*var string sValue;*

*defaultproperties*
*{*
*iValue = 0*
*fValue = 0.0*
*bValue = 0*
*vValue = (X=0,Y=0,Z=0)*
*sValue = ""*
*} *


class SeqAct_SaveLoadString extends SequenceAction;

event Activated()
{
local SaveLoad_Object savedObject;
local SeqVar_Int IntVar;
local SeqVar_Float FloatVar;
local SeqVar_Bool BoolVar;
local SeqVar_Vector VectorVar;
local SeqVar_String StringVar;

if (InputLinks[0].bHasImpulse)
{
OutputLinks[0].bHasImpulse = TRUE;
foreach LinkedVariables( class'SeqVar_Int', IntVar, "Ints" )
{
savedObject = new class'SaveLoad_Object';
savedObject.iValue = IntVar.IntValue;
class'Engine'.static.BasicSaveObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(IntVar.VarName) $ ".bin", true, 0);
}
foreach LinkedVariables( class'SeqVar_Float', FloatVar, "Floats" )
{
savedObject = new class'SaveLoad_Object';
savedObject.fValue = FloatVar.FloatValue;
class'Engine'.static.BasicSaveObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(FloatVar.VarName) $ ".bin", true, 0);
}
foreach LinkedVariables( class'SeqVar_Bool', BoolVar, "Bools" )
{
savedObject = new class'SaveLoad_Object';
savedObject.bValue = BoolVar.bValue;
class'Engine'.static.BasicSaveObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(BoolVar.VarName) $ ".bin", true, 0);
}
foreach LinkedVariables( class'SeqVar_Vector', VectorVar, "Vectors" )
{
savedObject = new class'SaveLoad_Object';
savedObject.vValue = VectorVar.VectValue;
class'Engine'.static.BasicSaveObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(VectorVar.VarName) $ ".bin", true, 0);
}
foreach LinkedVariables( class'SeqVar_String', StringVar, "Strings" )
{
savedObject = new class'SaveLoad_Object';
savedObject.sValue = StringVar.strValue;
class'Engine'.static.BasicSaveObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(StringVar.VarName) $ ".bin", true, 0);
}
}
if (InputLinks[1].bHasImpulse) // Load
{
OutputLinks[1].bHasImpulse = TRUE;
foreach LinkedVariables( class'SeqVar_Int', IntVar, "Ints" )
{
savedObject = new class'SaveLoad_Object';
if(class'Engine'.static.BasicLoadObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(IntVar.VarName) $ ".bin", true, 0))
IntVar.IntValue = savedObject.iValue;
}
foreach LinkedVariables( class'SeqVar_Float', FloatVar, "Floats" )
{
savedObject = new class'SaveLoad_Object';
if(class'Engine'.static.BasicLoadObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(FloatVar.VarName) $ ".bin", true, 0))
FloatVar.FloatValue = savedObject.fValue;
}
foreach LinkedVariables( class'SeqVar_Bool', BoolVar, "Bools" )
{
savedObject = new class'SaveLoad_Object';
if(class'Engine'.static.BasicLoadObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(BoolVar.VarName) $ ".bin", true, 0))
BoolVar.bValue = savedObject.bValue;
}
foreach LinkedVariables( class'SeqVar_Vector', VectorVar, "Vectors" )
{
savedObject = new class'SaveLoad_Object';
if(class'Engine'.static.BasicLoadObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(VectorVar.VarName) $ ".bin", true, 0))
VectorVar.VectValue = savedObject.vValue;
}
foreach LinkedVariables( class'SeqVar_String', StringVar, "Strings" )
{
savedObject = new class'SaveLoad_Object';
if(class'Engine'.static.BasicLoadObject(savedObject, "..\\..\\SavedKismetVariables\\" $ string(StringVar.VarName) $ ".bin", true, 0))
StringVar.strValue = savedObject.sValue;
}
}
}

defaultproperties
{
ObjName="Save/Load String Variables"
ObjCategory="Sim"

bAutoActivateOutputLinks=FALSE

InputLinks.Empty
InputLinks(0)=(LinkDesc="Save")
InputLinks(1)=(LinkDesc="Load")

OutputLinks.Empty
OutputLinks(0)=(LinkDesc="Saved")
OutputLinks(1)=(LinkDesc="Loaded")

VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Int',LinkDesc="Ints",bWriteable=TRUE)
VariableLinks(1)=(ExpectedType=class'SeqVar_Float' ,LinkDesc="Floats",bWriteable=TRUE)
VariableLinks(2)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Bools",bWriteable=TRUE)
VariableLinks(3)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vectors",bWriteable=TRUE)
VariableLinks(4)=(ExpectedType=class'SeqVar_String',LinkDesc="Strings",bWriteable=TRUE)
}

Here is a simple example of touching a trigger>hiding a cube>save and after that load the level with the cube now hidden.

https://i.postimg.cc/K1t6tKZc/saving.jpg

It also works on ¨¨play from here¨¨ and it creates a folder SavedKismetVariables with the .bin saves in your udk game installation folder automatically.

So I might be leaving Krushas Ultimate save system as its a 32bit dll only and go full 64bit build with this thing.Hope someone finds it to be useful in the future

it’s the Kismet version of the good old savegame system UDN gem :wink:

Sapitu or the save game state?

Edit:
Save game state.Well, I never knew that hehe.

Im not sure if im in the right conversation but you can also make a sabe game with .inis don’t you?