_Player.GetColorNumber();
Unit.DoBuildUnit(enum map_id unitType, enum map_id weaponType); /* for VF */
Unit.DoResearch(int techID); /* For labs */
Unit.DoTrainScientists(int numScientists); /* For universities */
Unit.Load/Unload(int bay); /* for use with Garages and factories */
Unit.Bulldoze(int x1, int y1, int x2, int y2); /* For RoboDozers */
/* Perhaps Scatter for groups of units */
Unit.Repair
Unit.Reprogram
Unit.ExitMap
_Player.Ally()
if timetrigger expires then
check if exists (vehiclefactory)
check if emped (vehiclefactory)
if all is FALSE then createunit(zeritou's template); reset timetrigger. else reset timetrigger. end if
end if
y is checking a problem?lol, That will create a vec without a vehicle factory.
its like with plain text:Code: [Select]if timetrigger expires then
check if exists (vehiclefactory)
check if emped (vehiclefactory)
if all is FALSE then createunit(zeritou's template); reset timetrigger. else reset timetrigger. end if
end if
"check if exists". this is a part.Quotey is checking a problem?lol, That will create a vec without a vehicle factory.
its like with plain text:Code: [Select]if timetrigger expires then
check if exists (vehiclefactory)
check if emped (vehiclefactory)
if all is FALSE then createunit(zeritou's template); reset timetrigger. else reset timetrigger. end if
end if
UnitRecord unitRecord1[] =
{
{ map_Vehicle_Factory, 0x30, 0x10, 0, 0, map_None, 0x10, 0, 0 },
{ map_Structure_Factory, 0x30, 0x14, 0, 0, map_None, 0x10, 0, 0 },
{ map_Command_Center, 0x30, 0x17, 0, 0, map_None, 0x10, 0, 0 },
{ map_Common_Ore_Smelter, 0x30, 0x1A, 0, 0, map_None, 0x10, 0, 0 },
{ map_Rare_Ore_Smelter, 0x30, 0x1E, 0, 0, map_None, 0x10, 0, 0 },
{ map_Tokamak, 0x23, 0x03, 0, 0, map_None, 0x10, 0, 0 },
{ map_ConVec, 0x32, 0x14, 0, 0, map_None, 0x10, 0, 0 },
{ map_Cargo_Truck, 0x34, 0x10, 0, 0, map_None, 0x10, trck_Rare_Metal, 1000 },
{ map_Tiger, 0x34, 0x17, 0, 0, map_Thors_Hammer, 0x10, 0, 0 },
{ map_None, 0, 0, 0, 0, map_None, 0, 0, 0 }
};
UnitBlock unitBlock1(unitRecord1);
Unit u1, u2, u3, u4, u5, u6, retUnit;
TethysGame::CreateUnit(u2, map_Vehicle_Factory, LOCATION(48, 15), 0, map_None, 0);
BuildingGroup &bld= CreateBuildingGroup(Player[0]);
bld.TakeUnit(u2);
bld.RecordVehReinforceGroup(bld,5);
bld.SetTargCount(map_Tiger,map_Thors_Hammer,15);
bld.RecordUnitBlock(unitBlock1);
bld.SetRect(MAP_RECT(48,15,90,90));
assign a number to each chassis/weapon
for instance
lynx=1
panther=2
tiger=3
laser=1
starflare=2
rail=3
thor=4
wright a line of code that says something to the effect of:
pick random number: 1 through 3
assign said number to variable X
pick random number: 1 through 4
assign said number to variable Y
produce unit X/Y
so say it picks X=2 and Y=1
unit X/Y would be a panther-laser
begin production of panther-laser
and then you would plug this into the script for a human player instead of where the the script that determines what the human player wants by where he or she clicked
Anyways, you're overlooking exactly the problem I thought you might. EMP wears off, so if the VF is EMP but then recovers by the time the trigger fires, the unit will still build, with no delay in building time. Same thing if the vehicle factory is disabled due to damage but then repaired before the trigger fires. If you want it accurate, you can't just use a trigger because things can happen to the VF between the time for the trigger firing.if timetrigger expires then
check if built (vehiclefactory)
if all is FALSE then createunitThat'll create a unit only if the building isn't built. :lol:
Hmm, DLL programming isn't exactly like replacing user input with scripted input. It's more like an alternative form of input. There's nothing stopping the game from using both, and you can't exactly get rid of the user input