Attempting to create a text based item bag (just strings) for an rpg.
<edit>
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
sens = cont.sensors[‘sensor’]
st = own[‘Text’]
print ("
Reading your text file.")
text_file0 = open(“write_it.txt”, “r”)
s = text_file0.readlines()
if sens.positive:
s.append(own[‘Text’])
text_file1 = open(“write_it.txt”, “w”)
lines = s
text_file1.writelines(lines)
print (s)
okay, I got my script down to this and it works great for storing and reading. However, I’ve been trying to apply it to a second plane (text prop) that will display the items. any ideas?