Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support
Action.WriteINI "savedgames.ini",savedgameindex,1,frametosave
For Each X in InventoryItemObject
I=I+1
ItemArray(I)=X.tag
Next
Action.WriteINI "savedgames.ini",savedgameindex,2,I
For counter=1 to I
Action.WriteINI "savedgames.ini",savedgameindex,counter+2,ItemArray(counter)
next
Action.WriteINI "savedgames.ini",savedgameindex,counter+3,WindowObject.Variables.Count
For i = 1 To WindowObject.Variables.Count
Action.WriteINI "savedgames.ini",savedgameindex,counter+3+i,WindowObject.Variables.Item(i).Name+" "+cstr(WindowObject.Variables.Item(i).Value)
Next
Action.WriteINI "savedgames.ini",savedgameindex,counter+4+WindowObject.Variables.Count,WindowObject.VariablesVariant.Count
For i = 1 To WindowObject.VariablesVariant.Count
Action.WriteINI "savedgames.ini",savedgameindex,counter+4+WindowObject.Variables.Count+i,WindowObject.VariablesVariant.Item(i).Name+" "+WindowObject.VariablesVariant.Item(i).Value
Next
Lyberodoggy wrote:To load integer variables from the string variables that are delimited in the INI you need to use ConvertToNumber
For i = 1 To WindowObject.Variables.Count
IntArray=Split(Action.ReadINI(filex,"INT",i),";")
WindowObject.Variables.Item(i).Value= ConvertToNumber(IntArray(1))
MsgBox "Int = " & WindowObject.Variables.Item(i).Value
Next
Sub AGENTSAVE()
frametosave=Action.GetCurrentFrameName
If frametosave="menu" Then frametosave="1.1.1"
I=0
For Each X in InventoryItemObject
I=I+1
A=X.tag
Action.WriteINI filename+".agent",1,I,A
Next
For i = 1 To WindowObject.Variables.Count
Action.WriteINI filename+".agent",2,i,WindowObject.Variables.Item(i).Name
Action.WriteINI filename+".agent",3,i,WindowObject.Variables.Item(i).Value
Next
For i = 1 To WindowObject.VariablesVariant.Count
Action.WriteINI filename+".agent",4,i,WindowObject.VariablesVariant.Item(i).Name
Action.WriteINI filename+".agent",5,i,WindowObject.VariablesVariant.Item(i).Value
Next
Action.WriteINI filename+".agent",6,i,frametosave
End Sub
filenamefull=FileBoxObject(2).FileName
For I=2 to 50
savedinventoryitem=Action.ReadINI(filenamefull,1,I)
If HasItem(cstr(savedinventoryitem))=False Then
Action.AddItem cstr(savedinventoryitem)
End If
Next
For C=1 to 50
Action.ReadINI(filenamefull,3,C)=Action.ReadINI(filenamefull,2,C)
Action.ReadINI(filenamefull,5,C)=Action.ReadINI(filenamefull,4,C)
Next
UnloadControl FileBoxObject(2)
UnloadControl TextBoxObject(3)
Action.GoToFrame Action.ReadINI(filenamefull,6,1)
Return to Post Your Own Tutorials
Users browsing this forum: No registered users and 0 guests