Loading Text File

I have a game and when I try to load the saved txt file it only loads the string variables and nothing else. Any help would be appreciated and if you need to see more code please let me know.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
ifstream Load1, Load2, Load3;
	int file;
	char name[30];

	string Name, KingdomName;
	string File1Name, File2Name, File3Name;
	int File1Save, File2Save, File3Save;
	char Save;
	char Class;
	int LocationX, LocationY;

	double Level, MaxGold, CurrentGold, MaxHP, CurrentHP;
	double MaxXP, CurrentXP;
	int LPotion, Potion, SPotion;
	int Iron, Calcium, Niacin, Zinc, Folate;
	int IronStat, CalciumStat, NiacinStat, ZincStat, FolateStat;
	int Kingdom, KingdomX, KingdomY;
	double Treasure;

	double MaxMana, CurrentMana, MaxRage, CurrentRage, MaxEnergy, CurrentEnergy, MaxFocus, CurrentFocus;
	double Stamina, Strength, Agility, Intellect, Spirit;
	double BaseStamina, BaseStrength, BaseAgility, BaseIntellect, BaseSpirit;
	double BaseAP, CurrentAP, BaseSP, CurrentSP, ManaRegen;
	double Defense, DefenseRating;
	double Dodge, Parry, BaseBlock, BaseBlockValue, Armor, ArmorReduction, Speed, Crit, SpellCrit, Hit, SpellHit;
	int SpendPoints, DefensePoints, CritPoints, HitPoints, SpeedPoints;
	int SpeedVariable;

Load1.open("Game 1.txt", ios::in | ios::beg);

		if ((Load1.is_open()) && (Load1.good())){

				Load1 >> Name;
				User.setName(Name);
				Load1 >> File1Name;
				User.setFile1Name(File1Name);
				Load1 >> File1Save;
				User.setFile1Save(File1Save);
				Load1 >> Class;
				User.setClass(Class);
				Load1 >> LocationX;
				User.setLocationX(LocationX);
				Load1 >> LocationY;
				User.setLocationY(LocationY);
				Load1 >> Level;
				User.setLevel(Level);
				Load1 >> MaxGold;
				User.setMaxGold(MaxGold);
				Load1 >> CurrentGold;
				User.setCurrentGold(CurrentGold);
				Load1 >> LPotion;
				User.setLPotion(LPotion);
				Load1 >> Potion;
				User.setPotion(Potion);
				Load1 >> SPotion;
				User.setSPotion(SPotion);
				Load1 >> Iron;
				User.setIron(Iron);
				Load1 >> IronStat;
				User.setIronStat(IronStat);
				Load1 >> Calcium;
				User.setCalcium(Calcium);
				Load1 >> CalciumStat;
				User.setCalciumStat(CalciumStat);
				Load1 >> Niacin;
				User.setNiacin(Niacin);
				Load1 >> NiacinStat;
				User.setNiacinStat(NiacinStat);
				Load1 >> Zinc;
				User.setZinc(Zinc);
				Load1 >> ZincStat;
				User.setZincStat(ZincStat);
				Load1 >> Folate;
				User.setFolate(Folate);
				Load1 >> FolateStat;
				User.setFolateStat(FolateStat);
				Load1 >> KingdomName;
				User.setKingdomName(KingdomName);
				Load1 >> Kingdom;
				User.setKingdom(Kingdom);
				Load1 >> KingdomX;
				User.setKingdomX(KingdomX);
				Load1 >> KingdomY;
				User.setKingdomY(KingdomY);
				Load1 >> Treasure;
				User.setTreasure(Treasure);
				Load1 >> SpendPoints;
				User.setSpendPoints(SpendPoints);
				Load1 >> DefensePoints;
				User.setDefensePoints(DefensePoints);
				Load1 >> SpeedPoints;
				User.setSpeedPoints(SpeedPoints);
				Load1 >> CritPoints;
				User.setCritPoints(CritPoints);
				Load1 >> HitPoints;
				User.setHitPoints(HitPoints);
				Load1 >> SpeedVariable;
				User.setSpeedVariable(SpeedVariable);
			

				cout << "File 1 Loaded!" << endl;
				Load1.close();
				Load2.close();
				Load3.close();
				setStats(User, Monst);
				getMiniMenu(User, Monst);
				break;
				}
		

			else{

				cout << "\nUnable to open file." << endl;
				getLoad(User, Monst);
				break;
				}
Topic archived. No new replies allowed.