I have a text file (Types.txt) that controls which 'AI' is used by a specific mob. It would look somthing like this
AI1,AttackOnSight,1,1,1,1,1,0
AI2,WaitForPlayerAttack,0,1,0,1,1,0
AI3,WanderAndAttack,1,1,1,1,1,1
AI4,DontAttack,1,0,1,0,0,0
I am trying to seperate this into these variables:
Index,Comment,Option1,Option2,Option3,Option4,Option5,Option 6
EG: Calling line 3
textfile = 'Types.txt'
line = 3
I would get:
Index = AI3
Comment = WanderAndAttack
Option1 = 1
Option2 = 1
Option3 = 1
Option4 = 1
Option5 = 1
Option6 = 1
I am not sure how I would going about doing this
If this helps, The AI may be a DANTOM on its own or an OBJ, but probbably a Datom
ID:160143
Nov 9 2008, 5:28 am (Edited on Nov 23 2008, 1:09 pm)
|
|
However, it may be easier to use the format that a savefile produces with ExportText and then just use ImportText to convert it to a save file for easy reading and writing.