Sending orders from Lua
Posted: Mon Apr 11, 2016 3:29 pm
Hello,
For my master thesis, I'm developing an AI module, where most of the actual decision making is done in a Lua-Script (the module is to be used in AI courses for students with no experience in C, so a simple API and not needing the build chain set up are the main goals).
Based on the API docs I understand there are no Lua methods yet for giving orders to units and cities, setting taxes etc., so I started implementing these. But I am unsure, if I am calling the right functions. Should I use the handle_unit_do_action and handle_unit_change_activity functions or rather unit_perform_action and unit_activity_handling(_targeted)?
Another question: today my supervisor asked, if it was feasible to modify a client and implement the AI there instead of a server-side module, so that the AI could handle only some decisions (a kind of client-side advisor). Would the calls to send orders be similar to the ones the AI uses on the server side or would I have to rewrite my Lua extensions completely?
Thanks,
Alexander
For my master thesis, I'm developing an AI module, where most of the actual decision making is done in a Lua-Script (the module is to be used in AI courses for students with no experience in C, so a simple API and not needing the build chain set up are the main goals).
Based on the API docs I understand there are no Lua methods yet for giving orders to units and cities, setting taxes etc., so I started implementing these. But I am unsure, if I am calling the right functions. Should I use the handle_unit_do_action and handle_unit_change_activity functions or rather unit_perform_action and unit_activity_handling(_targeted)?
Another question: today my supervisor asked, if it was feasible to modify a client and implement the AI there instead of a server-side module, so that the AI could handle only some decisions (a kind of client-side advisor). Would the calls to send orders be similar to the ones the AI uses on the server side or would I have to rewrite my Lua extensions completely?
Thanks,
Alexander