I need to know what is wrong with this code:
It tells me there is no file of the name "Male0.npc", even though I have made a folder and placed all the NPCs in it. The second NPC doesn't load either. Please tell me if I did something wrong in my code. I really appreciate any help.
Also, I can't supply the rest of the script, so if you have any questions, just ask.
Code:
def generate_dialogue
filename = "NPCS/#{@sex}#{@person}.npc"
if FileTest.exist?(filename)
file = File.open(filename, 'r')
dialogue = file.readlines
return dialogue
else
return ["DIALOGUE ERROR: This NPC's dialogue could not be found.", "To fix the error, create the file \"#{filename}\""]
end
end
It tells me there is no file of the name "Male0.npc", even though I have made a folder and placed all the NPCs in it. The second NPC doesn't load either. Please tell me if I did something wrong in my code. I really appreciate any help.
Also, I can't supply the rest of the script, so if you have any questions, just ask.