It's all about creating conditions and having actions performed when those conditions are met.
want to use another textfile?
on conditions met - use another text file
want the player to attack?
on conditions met (answer answered correctly) - set the actions for attack.
The textfile could be set with a variable changing I guess
if variable is 1 load textfile 1, etcetera.