Page 1 of 1

' instead of " in player:target_NPC and player:merchant

Posted: Mon Mar 29, 2010 7:40 pm
by rock5
I noticed I've been encountering more and more NPCs with " in their names such as "Anemone" Tadesha.

When running createpath.lua and pressing keypad 4 or 5 it creates waypoint entries that wont work. For instance;

Code: Select all

player:target_NPC(""Anemone" Tadesha");
player:merchant(""Anemone" Tadesha");
I've been changing them manually like so;

Code: Select all

player:target_NPC('"Anemone" Tadesha');
player:merchant('"Anemone" Tadesha');
but it would be good if createpath.lua used ' by default. I can't see any downside, off the top of my head.

You just need to change lines 29 and 30 of createpath.lua to;

Code: Select all

p_merchant_command = "player:merchant(\'%s\');";
p_targetNPC_command = "player:target_NPC(\'%s\');";
Thank you.

Re: ' instead of " in player:target_NPC and player:merchant

Posted: Mon Mar 29, 2010 8:20 pm
by Administrator
There's a better solution. Edit rom/createpath.lua. Find this:

Code: Select all

				hf_line = hf_line .. "\t\t" .. sprintf(p_merchant_command, v.npc_name) .. "\n";
Change to:

Code: Select all

				hf_line = hf_line .. "\t\t" .. sprintf(p_merchant_command, string.gsub(v.npc_name, "\"", "\\\"")) .. "\n";
You'll have to make that change for both merchant and NPC.

Re: ' instead of " in player:target_NPC and player:merchant

Posted: Mon Mar 29, 2010 9:30 pm
by rock5
So I take it you'll change it in the next update?

Re: ' instead of " in player:target_NPC and player:merchant

Posted: Mon Mar 29, 2010 10:39 pm
by Administrator
rock5 wrote:So I take it you'll change it in the next update?
Test it for me and make sure it's working properly. If it does, I'll include it.

Re: ' instead of " in player:target_NPC and player:merchant

Posted: Mon Mar 29, 2010 11:59 pm
by rock5
Just tested it. It works fine. Thank you.