This content has been marked as final. Show 4 replies
The general tool for reading and writing text files is the fileIO xtra,
implementing it involves some learning curve.
The easy way to store user settings like high scores is the setPref,
getPref functions which store text in a predefined location and works
with shockwave, unlike fileIO xtra.
The larger effort might be involved in getting the scores from the
stored text version back to whatever variables scheme you store them in.
value(somestring) converts a text representation of a number back to an
integer or float.
you can even store list variables as text
x = [["bob", 123], ["Jim", 567], ["Sally", 778]]
savePref "scoreFile", string(x)
-- retrieved with
x = value(getPref("scoreFile"))
thanks for that JB, I was hoping to stay away from fileIO as it hasn't been mentioned on my course. I had a thought that a could concantate the name and hits variables and enter them as the property and have the scores as the value in a property list. Then when retrieving them somehow separate the name and hits but that seemed overly complicated. I'm still not sure what to do
I think I showed an example saving a SINGLE property list with the
simple savePref fucton.
You might need a bi of code to parce the property list, converting the
content to a display text table.
By any chance are you creating a 2D game and if you are are you baseing it on the FSO game created on a macromedia director as this is wot ure game sounds like, and if yes if this game goes up on to the internet may i now the website name where i may download the game to see what you have done with it