To set unit lights on, for all the units of a player, you can use SetAllVehicleLightsForPlayer from the
OLD SDK. (I believe it's in OP2Helper.cpp)
example code, would turn on lights for all players:
for (int i=0; i<TethysGame::NoPlayers()-1; i++) {
SetAllVehicleLightsForPlayer(i, 1);
}
(PlayerID cant be -1, you have to go thru and do each one like that)
Here's the code for that function, in case you don't have it from the old SDK:
// Note: can NOT use playerNum = -1 for all players
void SetAllVehicleLightsForPlayer(int playerNum, int bOn)
{
PlayerVehicleEnum unitEnum(playerNum); // Enumerate vehicles for given player
Unit curUnit;
// Enumerate through all vehicles of this player
while (unitEnum.GetNext(curUnit))
{
curUnit.DoSetLights(bOn); // Turn on the headlights
}
}
Setting cargo in Factories:
factory.SetFactoryCargo(bayId, contents, cargoWeaponType);
bayId is a number 0-5 that chooses the bay to set.
contents and cargoWeaponType are the map_ids of the unit/structure, and cargo/weapon it carries, if any, in the bay. (Set cargoWeaponType = mapNone if youre doing a struct fac)
Message Command. There are two ways to do it:
TethysGame::AddMessage(int pixelX, int pixelY, char *message, int recipientPlayerNum, int soundID);
TethysGame::AddMessage(class Unit owner, char *message, int recipientPlayerNum, int soundID);
the owner is a unit its associated with, pixelX/pixelY are the location in Pixels on the map its associated with. (For a tile position, take the tile X,Y and multiply each by 32. None of the typical tile position offsets apply here, so 0,0 is the upper left corner of the map) If you don't need the message to be associated with a location use the first form with pixelX and pixelY both -1.
playerNum, is who sees the message. Use -1 for all players.
soundID is the ID of the sound file to use for the message. 0 is the generic beep. The list of sounds is in EnumSoundID.h.