Added some debug commands (quit and set-shading-color) which shoudl be useful for AI development
This was SVN commit r11671.
This commit is contained in:
parent
e765f6865f
commit
fee0ec6648
@ -27,6 +27,11 @@ function handleNotifications()
|
||||
"text": notification.message
|
||||
});
|
||||
}
|
||||
else if (notification.type == "quit")
|
||||
{
|
||||
// Used for AI testing
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Only display notifications directed to this player
|
||||
|
@ -34,6 +34,12 @@ function ProcessCommand(player, cmd)
|
||||
cmpGuiInterface.PushNotification({"type": "chat", "player": player, "message": cmd.message});
|
||||
break;
|
||||
|
||||
case "quit":
|
||||
// Let the AI exit the game for testing purposes
|
||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
|
||||
cmpGuiInterface.PushNotification({"type": "quit"});
|
||||
break;
|
||||
|
||||
case "control-all":
|
||||
cmpPlayer.SetControlAllUnits(cmd.flag);
|
||||
break;
|
||||
@ -502,6 +508,16 @@ function ProcessCommand(player, cmd)
|
||||
cmpBarter.ExchangeResources(playerEnt, cmd.sell, cmd.buy, cmd.amount);
|
||||
break;
|
||||
|
||||
case "set-shading-color":
|
||||
// Debug command to make an entity brightly colored
|
||||
for each (var ent in cmd.entities)
|
||||
{
|
||||
var cmpVisual = Engine.QueryInterface(ent, IID_Visual)
|
||||
if (cmpVisual)
|
||||
cmpVisual.SetShadingColour(cmd.rgb[0], cmd.rgb[1], cmd.rgb[2], 0) // alpha isn't used so just send 0
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
error("Invalid command: unknown command type: "+uneval(cmd));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user