Page 1 of 1
Can a spectator take over for an ai player?
Posted: 01 Jun 2015, 14:17
by smoth
Say I am playing vs a Lua ai like Craig, can a spectator take over that ai player?
Re: Can a spectator take over for an ai player?
Posted: 01 Jun 2015, 16:05
by Super Mario
Correct me if I'm wrong, but isn't Ai, just consider to be another player in the game?
Re: Can a spectator take over for an ai player?
Posted: 01 Jun 2015, 16:12
by Anarchid
An AI is not just another player, but a Lua AI team should be possible to overtake. You can also "partially overtake" the AI with cheats as-is, e.g. via /team N or /godmode.
Re: Can a spectator take over for an ai player?
Posted: 01 Jun 2015, 23:20
by Silentwings
Spring.AssignPlayerToTeam should do it.
Re: Can a spectator take over for an ai player?
Posted: 02 Jun 2015, 07:30
by smoth
ah, so will the ai try control things once a player has taken over?
Re: Can a spectator take over for an ai player?
Posted: 02 Jun 2015, 08:49
by Silentwings
Yes, you'll have to remove the AI somehow as well.
Re: Can a spectator take over for an ai player?
Posted: 02 Jun 2015, 19:39
by smoth
Is there a way for this or does it have to be part of the AI to step down?
Re: Can a spectator take over for an ai player?
Posted: 02 Jun 2015, 20:19
by Silentwings
I'm not sure, AIs are something I never got into.
Re: Can a spectator take over for an ai player?
Posted: 20 Jun 2015, 17:08
by Google_Frog
The luaAI would have to be told to stop controlling the units. I doubt any luaAIs come with this feature but it sounds easy to add in. The simplest way (which allows the AI to be restarted) would be to replace Spring.GiveOrderToUnit with a function which checks whether the AI is active and blocks the order if it is not.
Re: Can a spectator take over for an ai player?
Posted: 28 Jun 2015, 09:42
by Jools
Sounds a bit like a hack. Wouldn't it just be possible to add a shutdown button into the AI?
Re: Can a spectator take over for an ai player?
Posted: 29 Jun 2015, 07:43
by sprunk
LuaAI can use the PlayerChanged call-in to check if someone joined the AI team to disable itself.
The gadget that calls AssignPlayerToTeam can also notify the LuaAIs itself through GG.