NPC write/read from txt.

Play Now

Funpire

Dedicated Member
Dedicated Member
Jan 21, 2007
29
0
28
I have a question about NPC's and I hope Iam not asking it the second time.

Is it possible that an NPC can write names in a .txt file and that another NPC can read those names from the same .txt file?

For example:
If you click on NPC Homer it writes down the following in Test.txt

===Test.txt===
Marge
Lisa
Maggie
Skinner
Willey
============

Then when you click on NPC Bart you can choose:
Whos 1st? Whos 2nd? Whos 3rd? Whos 4th? Whos 5th?

Let's say you click on "Whos 3rd?", then what the NPC says next is:

"The 3rd on the list is Maggie!."

So basically I need to know how an NPC can write and read lines in a .txt file.

Thanks for any help.
 

Akuma

xDEATHx FTW
Golden Oldie
Dec 6, 2006
694
1
25
115
yes, you can use

checknamelist homer.txt
addnamelist homer.txt
checknotinnamelist homer.txt

hope this help

VirUs
 
Upvote 0

lifco

Untrusted Member
Legendary
Golden Oldie
Loyal Member
Jul 6, 2004
3,400
66
175
UK/Italy
yes, you can use

checknamelist homer.txt
addnamelist homer.txt
checknotinnamelist homer.txt

hope this help

VirUs

this made me smile :) checknotinnamelist

i think the command you are looking for is checknamelistposition

lif
 
Upvote 0

jasper

Golden Oldie
Golden Oldie
Sep 10, 2005
890
3
105
added to TD releases
Release: 0904200701
• Added 2 new npc 'check' commands (since a certain someone keeps nagging to me about it lol)
CHECKNOTONMAP mapname (checks if you arent on the map :p)
CHECKNOTINNAMELIST filename (checks if your charname is not in the filename :p)
 
Upvote 0

Funpire

Dedicated Member
Dedicated Member
Jan 21, 2007
29
0
28
Thanks for the replies but Iam afraid Iam looking for something quite different.

CHECKNAMELIST only browses through the text file to see if the name is there.

ADDNAMELIST only stacks the names one by one in a txt file.

CHECKNAMELISTPOSITON only looks if the name is on a certain line in the txt file.

What I need is a command that knows how to write/read independant lines in a txt file.
 
Upvote 0