CreateTimeTrigger(1, 1, 1000, "Blight");
SCRIPT_API void Blight()
{
// Setup Blight
GameMap::SetVirusUL(LOCATION(8+31, 19-1), 1); // Spawn the Blight
TethysGame::SetMicrobeSpreadSpeed(60); // Set the Blight's spread speed
// Warning Message
TethysGame::AddMessage(1248, 576, "Microbe growth detected!", -1, 152);
}
GameMap::SetVirusUL(LOCATION(x, y), spread);
TethysGame::SetMicrobeSpreadSpeed(number);
// Function for Setting All "Ancient Lava Flows" to lava-possible
void SetAllLava()
{
int x,y,tile;
LOCATION mapsize(512,256); // create a point wayoff the map
//mapsize.Clip(); // clip it, so we have the mapsize
for (y=0; y<mapsize.y; ++y) // run through all rows
{
for (x=0; x<mapsize.x; ++x) // check every tile on each row
{
tile=GameMap::GetTile(LOCATION(x,y)); // get the tile on that position
if ( ((tile>=0x1C7) && (tile<=0x1F8)) // is this one a lavarock...
|| ((tile>=0x22F) && (tile<=0x25E)) ) // ...or an edge ?
{
GameMap::SetLavaPossible(LOCATION(x,y),true); // -> then set it to LavaPossible
}
}
}
}
// Function for Setting All S1 and S2 Celltypes to lava-possible
void SetAllLava()
{
int x,y,tile;
LOCATION mapsize(512,256); // create a point wayoff the map
//mapsize.Clip(); // clip it, so we have the mapsize
for (y=0; y<mapsize.y; ++y) // run through all rows
{
for (x=0; x<mapsize.x; ++x) // check every tile on each row
{
tile=GameMap::GetCellType(LOCATION(x,y)); // get the celltype on that position
if ( (tile==cellSlowPassible1)
|| (tile==cellSlowPassible2) ) // If celltype = S1 or S2
{
GameMap::SetLavaPossible(LOCATION(x,y),true); // -> then set it to LavaPossible
}
}
}
}
void SetAllLava()
{
// code for whichever method you chose here
}
int InitProc()
{
// some other code
SetAllLava();
// maybe some more code here too
}
// Functions for setting up volcano animations
void SouthEastFlowAni ( int x, int y)
{
GameMap::SetTile(LOCATION(x, y), 0x489);
GameMap::SetTile(LOCATION(x, y+1), 0x4A0);
GameMap::SetTile(LOCATION(x+1, y+1), 0x4AB);
GameMap::SetTile(LOCATION(x+1, y), 0x494);
}
void SouthFlowAni( int x, int y)
{
GameMap::SetTile(LOCATION(x, y), 0x474);
GameMap::SetTile(LOCATION(x, y+1), 0x47E);
}
void SouthWestFlowAni ( int x, int y)
{
GameMap::SetTile(LOCATION(x+1, y), 0x453);
GameMap::SetTile(LOCATION(x, y), 0x447);
GameMap::SetTile(LOCATION(x, y+1), 0x45E);
GameMap::SetTile(LOCATION(x+1, y+1), 0x469);
}
// Functions for stopping volcano animations
void SouthEastFlowStopAni ( int x, int y)
{
GameMap::SetTile(LOCATION(x, y), 0x490);
GameMap::SetTile(LOCATION(x, y+1), 0x4A8);
GameMap::SetTile(LOCATION(x+1, y+1), 0x4B2);
GameMap::SetTile(LOCATION(x+1, y), 0x49C);
}
void SouthFlowStopAni( int x, int y)
{
GameMap::SetTile(LOCATION(x, y), 0x47B);
GameMap::SetTile(LOCATION(x, y+1), 0x486);
}
void SouthWestFlowStopAni ( int x, int y)
{
GameMap::SetTile(LOCATION(x+1, y), 0x45A);
GameMap::SetTile(LOCATION(x, y), 0x44F);
GameMap::SetTile(LOCATION(x, y+1), 0x465);
GameMap::SetTile(LOCATION(x+1, y+1), 0x470);
}
int InitProc()
{
// Start a south-east volcano animation on the Plymouth Starship map
SouthWestFlowAni(113+31, 12-1);
// Code from previous lessons here
}
int InitProc()
{
// Manually set some tiles to lava-possible
GameMap::SetLavaPossible(LOCATION(113+31, 13-1), true);
GameMap::SetLavaPossible(LOCATION(113+31, 14-1), true);
GameMap::SetLavaPossible(LOCATION(113+31, 15-1), true);
GameMap::SetLavaPossible(LOCATION(113+31, 16-1), true);
// Code from previous lessons here
}
TethysGame::SetEruption(113+31, 13-1, 45); // X, Y, speed(?)
TethysGame::SetLavaSpeed(45); // Set spread speed, just in case
int InitProc()
{
// Code from previous lessons
Trigger trig; // Create a trigger variable. If you don't know what that means, don't worry about it.
trig = CreateOnePlayerLeftTrigger(1, 0, "NoResponseToTrigger"); // NoResponseToTrigger is a generic catch-all function that does nothing when invoked
CreateVictoryCondition(1, 0, trig, "Eliminate your opponents."); // Use that trigger to create a victory condition
}
CreateVictoryCondition(1, 0, Trigger To Use, "Text");
Trigger trig;
// Evacuation Module
trig = CreateCountTrigger(1, 1, -1, mapEvacuationModule, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Evacuate 200 colonists to the starship.");
// Food Cargo
trig = CreateCountTrigger(1, 0, -1, mapFoodCargo, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Evacuate 10000 units of food to the starship.");
// Rare Metals Cargo
trig = CreateCountTrigger(1, 0, -1, mapRareMetalsCargo, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Evacuate 10000 units of Rare Metals to the starship.");
// Common Metals Cargo
trig = CreateCountTrigger(1, 0, -1, mapCommonMetalsCargo, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Evacuate 10000 units of Common Metals to the starship.");
// Phoenix Module
trig = CreateCountTrigger(1, 0, -1, mapPhoenixModule, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Phoenix Module.");
// Orbital Package
trig = CreateCountTrigger(1, 0, -1, mapOrbitalPackage, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Orbital Package.");
// Stasis Systems
trig = CreateCountTrigger(1, 0, -1, mapStasisSystems, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Stasis Systems.");
// Sensor Package
trig = CreateCountTrigger(1, 0, -1, mapSensorPackage, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Sensor Package.");
// Habitat Ring
trig = CreateCountTrigger(1, 0, -1, mapHabitatRing, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Habitat Ring.");
// Command Module
trig = CreateCountTrigger(1, 0, -1, mapCommandModule, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Command Module.");
// Fueling Systems
trig = CreateCountTrigger(1, 0, -1, mapFuelingSystems, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Fueling Systems.");
// Fusion Drive
trig = CreateCountTrigger(1, 0, -1, mapFusionDriveModule, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Fusion Drive Module.");
// Ion Drive
trig = CreateCountTrigger(1, 0, -1, mapIonDriveModule, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Launch the Ion Drive Module.");
// Skydock
trig = CreateCountTrigger(1, 0, -1, mapSkydock, mapNone, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 0, trig, "Place the Skydock in orbit.");
CreateCountTrigger(Enabled, One-Time, Players, Unit Type, Cargo Type, How Many, Comparison Type, "Trigger Function);
//Valid comparisons:
cmpEqual
cmpGreater
cmpLower
cmpLowerEqual
cmpGreaterEqual
static void __fastcall SetVirusUL(LOCATION location, int bBlightPresent);
Trigger vitoryTrig;We normally Define the trigger the moment it's created. Your code creates the trigger, then leaves it hanging before being defined/assigned its value (game can still catch the victory condition between the two lines of code, if I recall correctly. Whatever value it's given before you assign its value in the next line may be good for the victory condition to trigger).
vitoryTrig = CreateCountTrigger(1, 0, 1, mapConVec, mapAny, 25, cmpGreaterEqual, "NoResponseToTrigger");