public abstract class Triggers
extends Object
Modifier and Type | Field and Description |
---|---|
vector |
cInvalidVector
The invalid vector (-1,-1,-1).
|
int |
cNumberPlayers
Total number of players, mother nature included.
|
vector |
cOriginVector
The vector indicating the bottom of the map, i.e.
|
Modifier and Type | Method and Description |
---|---|
void |
trAddToPlayerCustomScore(int player,
int deltaScore)
Adds to the player's custom score bonus.
|
void |
trAIFunc(int playerID,
string functionName,
float param)
Fires a function in the current AI file.
|
bool |
trArmyDispatch(string SrcArmy,
string ProtoName,
int Count,
float x,
float y,
float z,
int Heading,
bool Clear)
Creates the units in the army specified.
|
bool |
trCheckGPActive(string godPower,
int playerID)
Returns whether that GP type, for that player, is currently in effect.
|
void |
trClearCounterDisplay()
Clears a counter display.
|
void |
trCounterAbort(string name)
Abort a counter
|
void |
trCounterAddTime(string name,
int start,
int stop,
string message,
int eventID)
Start a counter that may or may not fire an event.
|
void |
trCounterAddUnit(string name,
int playerID,
int count,
string protoUnit,
string message,
int eventID)
Start a counter that may or may not fire an event.
|
int |
trCountUnitsInArea(int centerUnitID,
int matchPlayer,
int matchType,
float range)
Returns the number of units in an area that match the params.
|
void |
trDelayedRuleActivation(string rulename)
Adds a rule to the runtime to be activated on the next update.
|
void |
trEcho(string echoString)
Prints the given string to the RTS3banglog.txt file in the AoM folder.
|
void |
trEchoStatValue(int playerID,
int statID)
Fetch a stat value from the KB and echo to chat.
|
void |
trEndGame()
Signal that the game has ended
|
void |
trEventFire(int eventID)
Cause an event to occur.
|
void |
trEventSetHandler(int eventID,
string handlerFunction)
Sets a handler function f(int status) for an eventID.
|
void |
trForbidProtounit(int playerID,
string protoname)
Adds protounit to the forbidden list.
|
void |
trGameLoadScenario(string scenarioName)
Start a game using scenario.
|
void |
trGamePause(bool pause)
Pause or unpause the game.
|
void |
trGenerateLush()
Force generation of lush from a pre-placed building.
|
int |
trGetGPUsedTime(string godPower,
int playerID)
Returns the time when that GP was first used, or -1 for unused.
|
int |
trGetStatValue(int playerID,
int statID)
Fetch a stat value from the KB
|
int |
trGetWorldDifficulty()
Returns the world difficulty.
|
void |
trHidePersistentScoreMessage()
Hide the peristent score message.
|
void |
trMessageSetText(string message,
int timeout)
Displays a message box at the top of the screen with the given message.
|
void |
trMinimapFlare(int playerID,
float duration,
vector position,
bool flash)
Sends a Minimap flare to a certain player.
|
void |
trModeEnter(string modeName)
Enters the mode specified.
|
void |
trModifyProtounit(string protoUnit,
int playerID,
int field,
float delta)
Modifies protounit data for this scenario only.
|
void |
trObjectiveSetID(int missionNum,
int objectiveID)
Sets the objective text.
|
void |
trRateConstruction(float rate)
Modify construction rate.
|
void |
trRateResearch(float rate)
Modify research rate.
|
void |
trRatesNormal()
Restore all rates to normal.
|
void |
trRateTrain(float rate)
Modify training rate
|
void |
trRevealEntireMap()
Shows whole map, similar to how revealed mode works.
|
void |
trSetCivilizationNameOverride(int playerID,
string civName)
Override display name of a civilization dynamically.
|
void |
trSetCounterDisplay(string text)
Sets the current fake-counter text.
|
void |
trSetDisableGPBlocking(bool b)
Enable or Disable GP blocking (e.g.
|
void |
trSetFogAndBlackmap(bool fog,
bool blackmap)
Turn fog and black map on/off.
|
void |
trSetLighting(string setName,
float fadeTime)
Fades to the specified lighting set over a given fadeTime.
|
void |
trSetPauseInObjectiveWindow()
Automatically pauses the game if the Objectives windows opens.
|
void |
trSetPauseOnAgeUpgrade()
Automatically pauses the game if the Age Advancement windows opens.
|
void |
trSetPlayerCustomScore(int player,
int newScoreValue)
Sets the player's custom score bonus.
|
void |
trSetRelicType(int techID)
Changes the effect of the selected relic to this custom techID.
|
void |
trSetTimeOfDay(float alpha)
Sets the time of day: 0.0 - 1.0.
|
void |
trSetTimeOfDayPeriod(float period)
Sets the day-night cycle period in seconds.
|
void |
trShowChoiceDialog(string maintext,
string choice1,
int event1ID,
string choice2,
int event2ID)
Displays dialog with 2 choices, and activates a trigger in response.
|
void |
trShowPersistentScoreMessage(int player)
Shows the player's kill/loss ratio as the score persistently.
|
void |
trShowScoreMessage(int player,
string soundfile)
Shows the player's kill/loss ratio as the score.
|
void |
trShowWinLose(string text,
string soundfile,
float volume)
Shows a win/lose message and plays a sound.
|
void |
trStartGameRecord()
Starts recording the game.
|
void |
trStopGameRecord()
Stops recording the game.
|
void |
trTechGodPower(int playerID,
string techName,
int numUses)
Adds X uses to the specified god power.
|
void |
trTechGodPowerAtPosition(int playerID,
string techName,
int numUses,
int slot)
Adds X uses to the specified god power in a specific GP slot (1-4).
|
void |
trTechInvokeGodPower(int playerID,
string techName,
vector pos1,
vector pos2)
Invokes the specified god power.
|
void |
trTechSetStatus(int playerID,
int techID,
int statusID)
Sets the technology status for the player.
|
bool |
trTechStatusActive(int playerID,
int techID)
Returns true if technology is active for player.
|
bool |
trTechStatusResearching(int playerID,
int techID)
Returns true if technology is being researched for player.
|
int |
trTime()
Returns the current game time in Seconds.
|
int |
trTimeMS()
Returns the current game time in Milliseconds.
|
void |
trUnforbidProtounit(int playerID,
string protoName)
Removes proto unit from the forbidden list.
|
void |
trWriteToLog(string message)
Writes text to the rts3banglog
|
public final int cNumberPlayers
public final vector cOriginVector
public final vector cInvalidVector
public void trAIFunc(int playerID, string functionName, float param)
public bool trArmyDispatch(string SrcArmy, string ProtoName, int Count, float x, float y, float z, int Heading, bool Clear)
public bool trCheckGPActive(string godPower, int playerID)
public void trClearCounterDisplay()
public void trCounterAbort(string name)
public void trCounterAddTime(string name, int start, int stop, string message, int eventID)
public void trCounterAddUnit(string name, int playerID, int count, string protoUnit, string message, int eventID)
public int trCountUnitsInArea(int centerUnitID, int matchPlayer, int matchType, float range)
public void trDelayedRuleActivation(string rulename)
xsEnableRule(string)
public void trEcho(string echoString)
public void trEchoStatValue(int playerID, int statID)
public void trEndGame()
public void trEventFire(int eventID)
trEventSetHandler(myEventID, "eventHandler");
.
Next, this piece of code is appended at the end of the eventHandler function:
case myEventID: { xsEnableRule("_My Trigger"); trEcho("Trigger enabling rule My Trigger"); break; }
public void trEventSetHandler(int eventID, string handlerFunction)
public void trForbidProtounit(int playerID, string protoname)
public void trGameLoadScenario(string scenarioName)
public void trGamePause(bool pause)
public void trGenerateLush()
public int trGetGPUsedTime(string godPower, int playerID)
public int trGetStatValue(int playerID, int statID)
public int trGetWorldDifficulty()
public void trMessageSetText(string message, int timeout)
public void trMinimapFlare(int playerID, float duration, vector position, bool flash)
public void trModeEnter(string modeName)
modeEnter(string)
public void trModifyProtounit(string protoUnit, int playerID, int field, float delta)
protoUnit
- The name of the protounit to modify.playerID
- The player for which the modifications should occur.field
- TriggerParamType.PUFIELD
delta
- The (relative) amount to change.public void trObjectiveSetID(int missionNum, int objectiveID)
public void trRateConstruction(float rate)
public void trRateResearch(float rate)
public void trRatesNormal()
public void trRateTrain(float rate)
public void trRevealEntireMap()
trSetFogAndBlackmap(bool, bool)
public void trSetCivilizationNameOverride(int playerID, string civName)
public void trSetCounterDisplay(string text)
public void trSetDisableGPBlocking(bool b)
public void trSetFogAndBlackmap(bool fog, bool blackmap)
trRevealEntireMap()
instead.fog()
,
blackmap()
public void trSetLighting(string setName, float fadeTime)
public void trSetPauseInObjectiveWindow()
public void trSetPauseOnAgeUpgrade()
public void trSetRelicType(int techID)
public void trShowChoiceDialog(string maintext, string choice1, int event1ID, string choice2, int event2ID)
public void trShowWinLose(string text, string soundfile, float volume)
public void trStartGameRecord()
public void trStopGameRecord()
public void trTechGodPower(int playerID, string techName, int numUses)
public void trTechGodPowerAtPosition(int playerID, string techName, int numUses, int slot)
public void trTechInvokeGodPower(int playerID, string techName, vector pos1, vector pos2)
public void trTechSetStatus(int playerID, int techID, int statusID)
public bool trTechStatusActive(int playerID, int techID)
public bool trTechStatusResearching(int playerID, int techID)
public int trTime()
public int trTimeMS()
public void trUnforbidProtounit(int playerID, string protoName)
public void trWriteToLog(string message)
public void trShowScoreMessage(int player, string soundfile)
public void trShowPersistentScoreMessage(int player)
public void trHidePersistentScoreMessage()
public void trSetTimeOfDay(float alpha)
public void trSetTimeOfDayPeriod(float period)
public void trSetPlayerCustomScore(int player, int newScoreValue)
public void trAddToPlayerCustomScore(int player, int deltaScore)