Page 1 of 1

options in LuaAI.lua

Posted: 23 Apr 2010, 11:17
by zwzsg
C++ AI can have options. That is cool. Can LuaAI have options too?

I did try the following in my LuaAI.lua:

Code: Select all

return {
	{
		name="Kernel Panic AI",
		desc="Can now play all three factions and ONS!",
		version = 4,
		options =
		{
			{
				key="difficulty",
				name="AI Difficulty Level",
				desc="1 means, the AI plays very poor, 5 means, it gives its best",
				type   = 'number',
				def    = 3,
				min    = 1,
				max    = 5,
				step   = 1,
			},
		},
	},
	{
		name="Fair KPAI",
		desc="Does not build much more than opponents.",
	},
}
SpringLobby ignored the version and options fields.
- Maybe I am using the wrong syntax, in which case tell me the right one.
- Maybe AI options are not supported for LuaAI, in which case that is my feature request.

Note: I know SpringLobby support C++ AI options because for BaczekKPAI the option shows fine.

Re: options in LuaAI.lua

Posted: 23 Apr 2010, 11:51
by hoijui
engine/unitsync do not support LuaAI options.
the lobbies do to even know if an AI is Lua or not. there is certainly no change needed there.

Re: options in LuaAI.lua

Posted: 23 Apr 2010, 12:26
by zwzsg
Yeah, sorry, I wasn't clear, this is indeed an unitsync request, not a lobby request.