I have a variable that serves as a counter and works like some kind of process bar. Now I want to create a save slot with this exact current value as its name. Just doing SaveGameSlot(PBCounter,"%d", PBCounter) doesn't seem to work when I test the game. It says I have the "wrong number of parameters". Doing "" instead gives me a blank list item at the list of restorable save files.
How do I autoname a savegame like this then?
Cheers
Kumpel
This is probably a long shot but when you add "," to format string it takes that as paramater. Can you try String.Format("%d", PBCounter)? I don't know if it works but worth trying.
Or you can simply wait for Khris to answer.
Yes, this is exactly like
SaveGameSlot(PBCounter, String.Format("%d", PBCounter));
String.Format returns a formatted string, which is in turn used as a second argument to SaveGameSlot, which is a shorter way of doing -
String s = String.Format("%d", PBCounter);
SaveGameSlot(PBCounter, s);
(more elaborate, but longer variant)
Similarily you can create formatted string anywhere. There is just limited number of functions that allow to format a string right away, like Display and Say.