Got it. Turns out my directory WAS off. I did a little experimenting, and I guess they automatically save and open from desktop. I didn’t know this, so my saved file was trying to go like this:
C:/Users/Britany/Desktop/C:/Users/Britany/Desktop/ on so on…
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
['-3.30305886269,-3.27693843842,-0.0341884605587']
Traceback (most recent call last):
File "maincourse.py", line 530, in <module>
w = World()
File "maincourse.py", line 97, in __init__
self.blaze.setPos(self.SavedPos)
TypeError: NodePath.setPos() argument 1 must be VBase3, not list
**** End of process output ****
readLines gives you a list of strings, one for each line in the file. That list will need further processing to get it back into the form of floats or VBase3 instances. The error message is telling you this when it says “argument 1 must be VBase3, not list”. A simple parsing loop might look something like this:
for line in self.SavedPos:
# strip spaces out of the string
line = line.replace(" ", "")
# split into three strings split at the commas
xstr, ystr, zstr = line.split(",")
# convert the strings to float values and create a Pos3 object
pos = Pos3(float(xstr), float(ystr), float(zstr))
# set the position
self.blaze.setPos(pos)
Okay, so you only had one nodepath in your code so with multiple positions you’ll have to work out how to decide what nodepaths to apply them to in what order.
At least you got it working. I made a mistake in my example. I wrote Pos3, that was supposed to be Point3, but anyway setPos can also take 3 individual floats.
No problem.
I found I could just write pieces of a text in a task, then continue it forever, that way my text files update every frame. I did that, and separated everything by using \n for a new row.
Then I just read the text file, and used certain lines from their. Works great.