'bout the first one: we've been working on something similar, but I think that either never worked out or we just dropped it
no idea, but I guess it could be done...
the second one: yes, it can be done.
first of all, you have to select the command:
Commando:=GetFreeSel();
SelectDevice(Commando, m.OwnerShip, InSet(the set of the command));
Com1:=Pick(Commando);
well... I don't know, but it's either that or this (more probably this):
Commando:=GetFreeSel();
SelectBoats(Commando,S.class=#the shipclass of the commnado ferry);
Com1:=Pick(Commando);
then, set a "Breached" rule:
> Breached
An enemy boat has breached into the ship (commando). E.location: the ship, E.ship: the boat
Like this:
Rule event Breached
E.location=M.BreachedShip&E.ship=Com1 //the one we have given earlier
:action
//and here we add the line in question
M.BreachedShip:Race:=#race_player;
(...)
:end
END
of course, this will only worked for an scripted event in particular (in theory, I would have to test this...), not as part of an ai machine, in order to do that you'll have to write a few more lines of coding, and start a whole process of debugging and all that I frankly don't feel like doing at 5:54 in the morning