I'm trying to write a simple Java game. I have a NPC class, with a function Dialog which returns what the npc would say, which would depend on various conditions.
I'm thinking that it would probably make sense to offload the logic of deciding what each npc would say to a scripting language, so that it could be changed updated easily. That way, I can create each NPC instance using something like
npc Mayor = new npc("mayor.php");
or something to that effect. So I googled around and found a bunch of technologies (PHP/Java Bridge, Querticus, Java Servlet SAPI, etc.) but only got confused what each did and whether it provides the functionality I'm looking for.
I'm not really limited to PHP, but that's just the one I'm most used to, and since I have the flag conditions that decide the npc's dialog stored in a local mysql database. I'd rather not have the scripts available online, so maybe a different scripting language would be more useful in this case?
I'm open to any ideas or suggestions on how I should implement this. Thanks!