Class AutoGeneratedFromDoxygen

java.lang.Object
AutoGeneratedFromDoxygen

public class AutoGeneratedFromDoxygen extends Object
AoM Retold Code Reference.
Version:
10/08/2025
Author:
JeHathor
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    abs(float x)
    Returns the absolute value of x as a float.
    float
    acos(float x)
    Returns the arccosine of x.
    int
    aiAddEchoCategory(String categoryName)
    Adds a category with the provided categoryName to the AI Debug Output window, must be a unique name.
    void
    aiAddToResourceBreakdown(int resourceID, int resourceSubTypeID, int numberPlans, int baseID, int[] numNeeded, int[] numWanted, int[] numMax, int[] kbResourceIDs)
    Increments an existing breakdown by the provided number plans and wanted gatherers, kbResourceIDs is optional.
    void
    aiAttemptResign(int promptType)
    Asks the first human player if it's ok to resign.
    void
    aiBreakpointGo(int playerID)
    Restart XS execution after the current breakpoint.
    void
    aiBreakpointSet(int playerID, String filename, int lineNumber, boolean on)
    Sets a breakpoint.
    void
    aiBuyResourceOnMarket(int resourceID)
    Buys 100 of the provided resourceID, this can only be wood / food.
    boolean
    aiCanUseAbility(int unitID, int protoPowerID)
    Checks whether the provided unitID can use the ability associated with the provided protoPowerID.
    boolean
    aiCastGodPowerAtDualPosition(int protoPowerID, Vector position1, Vector position2)
    Casts the given protoPowerID at the provided positions, use this for God Powers that require 2 positions.
    boolean
    aiCastGodPowerAtPosition(int protoPowerID, Vector position)
    Casts the given protoPowerID at the provided position, use this for God Powers that require 1 position.
    boolean
    aiCastGodPowerAtUnit(int protoPowerID, int unitID)
    Casts the given protoPowerID on the specific unitID, use this for God Powers that target units.
    void
    aiChat(int playerID, String chatString)
    Send a CP AI chat message to the provided playerID.
    void
    aiCommsAllowChat(boolean enable)
    Enables or disables the chats from this AI player, also enables/disables all "Comms".
    int
    Returns the sending playerID for provided tauntID.
    int
    aiCommsGetTauntCode(int tauntID)
    Returns the code for the provided tauntID, these map to regular taunts like 1: Yes.
    void
    aiCommsSendStatement(int playerID, int promptType)
    Sends a statement to the provided playerID, constants for this are named like "cAICommPrompt".
    void
    aiCommsSendStatementWithVector(int playerID, int promptType, Vector position)
    Sends a statement to the provided playerID with a flare on the provided position, constants for this are named like "cAICommPrompt".
    void
    aiCommsSetEventHandler(String handlerFunctionName)
    Connects an XS function (handlerFunctionName) to the communications system (empty name unsets the handler).
    void
    aiEcho(String text)
    Adds this text to the AI Debug Output window in the "All" category.
    void
    aiEchoCategory(int categoryIndex, String text)
    Adds this text to the AI Debug Output window in the "All" category and in the provided categoryIndex.
    void
    Adds this text to the AI Debug Output window in the "All" and "Warnings" categories.
    void
    Opens up an error window with the text.
    void
    Opens up an error window with the text belonging to the stringID.
    int
    aiGetAgeUpListByIndex(int age, int index)
    Gets the techID belonging to the Minor God for the provided age + index.
    int
    Returns the number of Minor Gods avaiable for the provided age.
    boolean
    Returns allow buildings on/off.
    float
    Returns the attack response distance.
    int
    Returns the available economy pop, calculated by doing aiGetEconomyPop - aiGetCurrentEconomyPop.
    int
    Returns the available naval military pop, calculated by doing aiGetMilitaryPop - aiGetCurrentMilitaryPop.
    int
    Returns the available naval economy pop, calculated by doing aiGetNavalEconomyPop - aiGetCurrentNavalEconomyPop.
    int
    Returns the available naval military pop, calculated by doing aiGetNavalMilitaryPop - aiGetCurrentNavalMilitaryPop.
    int
    Returns the current economy pop.
    int
    Returns the current military pop.
    int
    Returns the current naval economy pop.
    int
    Returns the current naval military pop.
    int
    Returns the script-defined economy pop.
    float
    Returns the AI's Explore Danger Threshold value.
    int
    Gets the next time when the unit distribution will be updated.
    int
    aiGetMaxAge(int playerID)
    Returns the maximum age for the provided playerID.
    int
    Gets the currently set micro management flags.
    int
    Returns the script-defined military pop.
    int
    Returns the script-defined most hated naval player ID.
    int
    Returns the script-defined most hated player ID.
    int
    Returns the script-defined naval economy pop.
    int
    Returns the script-defined naval military pop.
    int
    Returns the next time when the gatherer distribution will be updated.
    int
    aiGetNumberGatherers(int gathererPUID, int resourceID, int resourceSubType, int resourcePUID)
    Iterates through all gather plans.
    int
    Returns the limit for how many Outposts the AI can build.
    int
    aiGetResourceBreakdownID(int resourceID, int resourceSubTypeID, int baseID)
    Returns the breakdown ID belonging to the provided resourceID + resourceSubTypeID + baseID.
    int
    aiGetResourceBreakdownNumberPlans(int resourceID, int resourceSubTypeID, int baseID)
    Returns the number of plans for the breakdown belonging to the provided resourceID + resourceSubTypeID + baseID.
    int
    aiGetResourceBreakdownPlanPriority(int resourceID, int resourceSubTypeID, int baseID)
    Returns the plan priority for the breakdown belonging to the provided resourceID + resourceSubTypeID + baseID.
    float
    aiGetResourcePercentage(int resourceID)
    Returns the resource percentage for the given resourceID.
    int
    Gets the next time when the unassigned units assigment gets updated.
    aiGetWorldDifficultyName(int difficulty)
    Returns the name of the provided difficulty.
    void
    Normalizes all of the resource percentages to 1.0.
    int
    aiNumberUnassignedUnits(int unitTypeID)
    Returns the number of unassigned (not being in a plan) units of the given type, -1 unitTypeID to ignore it.
    boolean
    aiPlanAddUnit(int planID, int unitID)
    Adds the provided unitID to the provided planID.
    void
    aiPlanAddUnitType(int planID, int unitTypeID, int numberNeed, int numberWant, int numberMax, boolean relative, boolean popImmediately)
    Adds a unit type to the plan, you MUST do this before assigning any unit or the plan won't allow them to be assigned.
    void
    aiPlanAddUserVariableBool(int planID, int variableIndex, String name, int numberValues)
    Adds a bool user variable with the provided input.
    void
    aiPlanAddUserVariableFloat(int planID, int variableIndex, String name, int numberValues)
    Adds a float user variable with the provided input.
    void
    aiPlanAddUserVariableInt(int planID, int variableIndex, String name, int numberValues)
    Adds an int user variable with the provided input.
    void
    aiPlanAddUserVariableString(int planID, int variableIndex, String name, int numberValues)
    Adds a string user variable with the provided input.
    void
    aiPlanAddUserVariableVector(int planID, int variableIndex, String name, int numberValues)
    Adds a vector user variable with the provided input.
    void
    aiPlanAddWaypoint(int planID, Vector waypoint)
    Adds the waypoint to the provided planID.
    int
    aiPlanCreate(String planName, int type, int parentPlanID, int outputCategoryID)
    Creates a plan with the name and type, assigns it as a child of parentPlanID if provided.
    void
    aiPlanDestroy(int planID)
    Sets the destroy flag on the plan assigned to the planID.
    void
    Sets the destroy flag on the plan assigned to the planName.
    int
    aiPlanGetActiveCount(boolean ignoreChildPlans)
    Returns the number of plans we have, doesn't include plans that are going to be destroyed.
    int
    aiPlanGetBaseID(int planID)
    Returns the baseID for the provided planID, this doesn't reset itself if the base goes invalid.
    int
    aiPlanGetChildIDByIndex(int parentPlanID, int index)
    Returns the planID of the child plan at the provided index of the provided parentPlanID, use in combination with aiPlanGetNumberChildren to know how many indexes there are.
    int
    aiPlanGetCurrentPopulation(int planID, int unitTypeID, boolean countLoans)
    Returns how much population the units in the provided planID are currently taking up.
    float[]
    Same mechanic as aiPlanGetFutureNeedsCostPerResource but instead returns an array of costs.
    float
    aiPlanGetFutureNeedsCostPerResource(int planID, int resourceID)
    Returns the future cost of the provided planID for the provided resourceID.
    int
    aiPlanGetIDByActiveIndex(int activeIndex, boolean ignoreChildPlans)
    Return the planID at the provided index from the list of active plans that we have.
    int
    aiPlanGetIDByName(String searchStr, boolean subString)
    Returns the ID of the plan with the exact searchStr name.
    int
    aiPlanGetIDByTypeAndState(int planType, int planState, int index)
    Returns the planID at the provided index from the list of plans that we have for the provided planType + planState.
    int
    aiPlanGetIDByTypeAndVariableIntValue(int planType, int varIndex, int variableValue, int index)
    Return the planID at the provided index from the list of plans that we have for the provided planType + varIndex + variableValue.
    int
    aiPlanGetIDByTypeIndex(int planType, int index)
    Returns the planID at the provided index from the list of plans that we have for the provided planType.
    int[]
    aiPlanGetIDsByType(int planType)
    Returns all the plan IDs for the provided planType, doesn't include plans that are going to be destroyed.
    int[]
    aiPlanGetIDsByTypeAndState(int planType, int planState)
    Returns all the plan IDs for the provided planType + planState, doesn't include plans that are going to be destroyed.
    int[]
    aiPlanGetIDsByTypeAndVariableBoolValue(int planType, int varIndex, boolean variableValue)
    Returns all the plan IDs for the provided planType + varIndex + variableValue (bool), doesn't include plans that are going to be destroyed.
    int[]
    aiPlanGetIDsByTypeAndVariableFloatValue(int planType, int varIndex, float variableValue)
    Returns all the plan IDs for the provided planType + varIndex + variableValue (float), doesn't include plans that are going to be destroyed.
    int[]
    aiPlanGetIDsByTypeAndVariableIntValue(int planType, int varIndex, int variableValue)
    Returns all the plan IDs for the provided planType + varIndex + variableValue (int), doesn't include plans that are going to be destroyed.
    int[]
    aiPlanGetIDsByTypeAndVariableStringValue(int planType, int varIndex, String variableValue)
    Returns all the plan IDs for the provided planType + varIndex + variableValue (string), doesn't include plans that are going to be destroyed.
    int[]
    aiPlanGetIDsByTypeAndVariableVectorValue(int planType, int varIndex, Vector variableValue)
    Returns all the plan IDs for the provided planType + varIndex + variableValue (vector), doesn't include plans that are going to be destroyed.
    Returns the initial position for the provided planID.
    boolean
    aiPlanGetIsIDValid(int planID)
    Returns if the provided planID is valid.
    aiPlanGetLocation(int planID, boolean firstUnit)
    Returns the location for provided planID.
    aiPlanGetName(int planID)
    Returns the name of the provided planID.
    int
    aiPlanGetNumberByType(int planType)
    Returns the number of plans for the provided planType, doesn't include plans that are going to be destroyed.
    int
    aiPlanGetNumberByTypeAndState(int planType, int planState)
    Returns the number of plans for the provided planType + planState, doesn't include plans that are going to be destroyed.
    int
    aiPlanGetNumberByTypeAndVariableIntValue(int planType, int varIndex, int variableValue)
    Returns the number of plans that have an integer value at the provided varIndex that matches the provided variableValue.
    int
    aiPlanGetNumberChildren(int parentPlanID)
    Returns the number of child plans the provided parentPlanID has.
    int
    aiPlanGetNumberMaxUnits(int planID, int unitTypeID)
    Returns the number of max units for provided planID.
    int
    aiPlanGetNumberNeededUnits(int planID, int unitTypeID)
    Returns the number of needed units for provided planID.
    int
    aiPlanGetNumberUnits(int planID, int unitTypeID, boolean countLoans)
    Returns the number of unitTypeID units currently assigned to the provided planID.
    int
    aiPlanGetNumberUserVariableValues(int planID, int variableIndex)
    Returns the number of valueIndexes that can be set for the provided variableIndex for the provided planID.
    int
    aiPlanGetNumberVariableValues(int planID, int variableIndex)
    Returns the number of valueIndexes that can be set for the provided variableIndex for the provided planID.
    int
    aiPlanGetNumberWantedUnits(int planID, int unitTypeID)
    Returns the number of wanted units for provided planID.
    int
    Returns the output category ID for the provided planID.
    int
    aiPlanGetParentID(int planID)
    Returns the parentID of the provided planID.
    int
    aiPlanGetPriority(int planID)
    Returns the priority of the provided planID.
    int
    aiPlanGetState(int planID)
    Returns the state of the provided planID.
    int
    aiPlanGetType(int planID)
    Returns the type of the provided planID.
    int
    aiPlanGetUnitIDByIndex(int planID, int index)
    Returns the unitID at the provided index for the provided planID.
    int[]
    aiPlanGetUnits(int planID, int unitTypeID, boolean countLoans, int[] excludeTypes)
    Returns the units of unitTypeID currently assigned to the provided planID.
    int[]
    aiPlanGetUnitTypes(int planID)
    Returns the unit types assigned to the provided planID.
    boolean
    aiPlanGetUserVariableBool(int planID, int variableIndex, int valueIndex)
    Returns the user bool value that is associated with the provided input.
    float
    aiPlanGetUserVariableFloat(int planID, int variableIndex, int valueIndex)
    Returns the user float value that is associated with the provided input.
    int
    aiPlanGetUserVariableIndex(int planID, String variableName)
    Searches through all user variables assigned to the provided planID and returns the index with the provided variableName, returns -1 if none are found.
    int
    aiPlanGetUserVariableInt(int planID, int variableIndex, int valueIndex)
    Returns the user int value that is associated with the provided input.
    aiPlanGetUserVariableString(int planID, int variableIndex, int valueIndex)
    Returns the user string value that is associated with the provided input.
    aiPlanGetUserVariableVector(int planID, int variableIndex, int valueIndex)
    Returns the user vector value that is associated with the provided input.
    boolean
    aiPlanGetVariableBool(int planID, int variableIndex, int valueIndex)
    Returns the bool value that is associated with the provided input.
    float
    aiPlanGetVariableFloat(int planID, int variableIndex, int valueIndex)
    Returns the float value that is associated with the provided input.
    int
    aiPlanGetVariableInt(int planID, int variableIndex, int valueIndex)
    Returns the int value that is associated with the provided input.
    aiPlanGetVariableString(int planID, int variableIndex, int valueIndex)
    Returns the string value that is associated with the provided input.
    aiPlanGetVariableVector(int planID, int variableIndex, int valueIndex)
    Returns the vector value that is associated with the provided input.
    boolean
    aiPlanHasUnitType(int planID, int unitTypeID)
    Returns if the provided planID already has the provided unitTypeID added.
    boolean
    aiPlanIsFlagSet(int planID, int flag)
    Gets if the flag for the provided planID is set to true, cPlanFlag constants.
    void
    aiPlanRemoveParent(int planID)
    Removes the parent plan from the provided planID.
    void
    aiPlanRemoveUnit(int planID, int unitID)
    Removes the provided unitID from the provided planID.
    void
    Removes the provided unitID from all plans it's in.
    void
    aiPlanRemoveUserVariable(int planID, int variableIndex)
    Removes the user variable at the provided variableIndex for the provided planID.
    void
    Removes all of the user variables from the provided planID.
    void
    aiPlanRemoveUserVariableValue(int planID, int variableIndex, int valueIndex)
    Removes the provided valueIndex for the provided variableIndex for the provided planID.
    void
    aiPlanRemoveVariableValue(int planID, int variableIndex, int valueIndex)
    Removes the valueIndex for the provided variableIndex for the provided planID.
    void
    aiPlanResetBaseID(int planID)
    Sets the baseID for the provided planID to -1.
    void
    aiPlanSetBaseID(int planID, int baseID)
    Sets the baseID for the provided planID.
    void
    aiPlanSetEventHandler(int planID, int eventType, String handlerName)
    Connects an XS function (handlerName) to the provided planID + provided eventType.
    void
    aiPlanSetFlag(int planID, int flag, boolean state)
    Sets the flag for the provided planID to the state, cPlanFlag constants.
    void
    aiPlanSetInitialPosition(int planID, Vector position)
    Sets the initial position for the provided planID.
    void
    aiPlanSetName(int planID, String name)
    Sets the name for the provided planID.
    void
    aiPlanSetNumberUserVariableValues(int planID, int variableIndex, int numberValues, boolean clearCurrentValues)
    Sets the number of possible valueIndexes(numberValues) for the provided variableIndex for the provided planID.
    void
    aiPlanSetNumberVariableValues(int planID, int variableIndex, int numberValues, boolean clearCurrentValues)
    Sets the number of possible valueIndexes(numberValues) for the provided variableIndex for the provided planID.
    void
    aiPlanSetOutputCategory(int planID, int outputCategoryID)
    Sets the provided planID's output category to the provided outputCategoryID.
    void
    aiPlanSetParentID(int planID, int parentPlanID, boolean persistentChild)
    Makes the provided planID a child of the provided parentPlanID.
    void
    aiPlanSetPriority(int planID, int priority)
    Sets the priority for the provided planID.
    void
    aiPlanSetState(int planID, int planState)
    Sets the plan state, "cPlanState" constants.
    void
    aiPlanSetUserVariableBool(int planID, int variableIndex, int valueIndex, boolean value)
    Sets the user contents of the provided input to the provided bool value.
    void
    aiPlanSetUserVariableFloat(int planID, int variableIndex, int valueIndex, float value)
    Sets the user contents of the provided input to the provided float value.
    void
    aiPlanSetUserVariableInt(int planID, int variableIndex, int valueIndex, int value)
    Sets the user contents of the provided input to the provided int value.
    void
    aiPlanSetUserVariableString(int planID, int variableIndex, int valueIndex, String value)
    Sets the user contents of the provided input to the provided string value.
    void
    aiPlanSetUserVariableVector(int planID, int variableIndex, int valueIndex, Vector value)
    Sets the user contents of the provided input to the provided vector value.
    void
    aiPlanSetVariableBool(int planID, int variableIndex, int valueIndex, boolean value)
    Sets the contents of the provided input to the provided bool value.
    void
    aiPlanSetVariableFloat(int planID, int variableIndex, int valueIndex, float value)
    Sets the contents of the provided input to the provided float value.
    void
    aiPlanSetVariableInt(int planID, int variableIndex, int valueIndex, int value)
    Sets the contents of the provided input to the provided int value.
    void
    aiPlanSetVariableString(int planID, int variableIndex, int valueIndex, String value)
    Sets the contents of the provided input to the provided string value.
    void
    aiPlanSetVariableVector(int planID, int variableIndex, int valueIndex, Vector value)
    Sets the contents of the provided input to the provided vector value.
    void
    aiPlanSetWaypoints(int planID, int pathID)
    Sets the waypoints of the provided planID to the waypoints of the given path.
    void
    Call this to make the AI fill out what Minor Gods are available.
    boolean
    aiPrePurchaseGodPower(int protoPowerID, int numUses)
    Pre-purchases the provided number of uses of the provided protoPowerID.
    Returns a random location guaranteed to be on the map.
    void
    aiRemoveResourceBreakdown(int resourceID, int resourceSubTypeID, int baseID)
    Removes the breakdown belonging to the provided resourceID + resourceSubTypeID + baseID.
    void
    Resigns this player.
    boolean
    aiResourceIsLocked(int resourceID)
    Returns whether the provided resourceID is locked.
    void
    aiResourceLock(int resourceID)
    Prevents the provided resourceID from being spent by the AI via plans.
    void
    aiResourceUnlock(int resourceID)
    Allow the provided resourceID to be spent by the AI via plans.
    void
    aiSellResourceOnMarket(int resourceID)
    Sells 100 of the provided resourceID, this can only be wood / food.
    void
    Used to display a notification for the Human Assist AI.
    void
    Used to display a notification for the Human Assist AI.
    void
    Used to display a notification for the Human Assist AI.
    void
    Used to display a notification for the Human Assist AI.
    void
    Sets allow buildings on/off.
    void
    Set the attack response distance.
    boolean
    aiSetAutoCastForUnit(int unitID, boolean state, int abilitySlot)
    Sets the autocasting for the provided abilitySlot to the provided state for the provided unitID.
    void
    The AI automatically ungarrisons units from buildings if they're not in a garrison plan.
    void
    aiSetDefaultStance(int defaultStance)
    Sets your default stance for all of your units.
    void
    Turns on/off if units will be deleted if they got kicked out of too many plans due to pathing, Chairon has this on.
    void
    Set the script-defined economy pop, train plans can't train above this number.
    void
    Turns escrow system on/off, Chairon has this off.
    void
    Sets the AI's Explore Danger Threshold value.
    void
    Sets the next time in MS that the unit distribution is updated.
    void
    aiSetHandler(String handlerName, int eventType)
    Connects an XS function (handlerName) to the provided eventType.
    void
    aiSetMicroFlags(int flags)
    Sets micro management flags, "cMicro" constants.
    void
    If this is set to true then all the military gather points (all bases with a Town Center create one) will block all building placement checks.
    void
    If this is set to true then all the military gather points (all bases with a Town Center create one) will block Dropsite building placements.
    void
    If this is set to true then all the military gather points (all bases with a Town Center create one) will block Wall building placements.
    void
    Set the script-defined military pop, train plans can't train above this number.
    void
    Sets the script-defined most hated naval player ID.
    void
    Sets the script-defined most hated player ID.
    void
    Set the script-defined naval economy pop, train plans can't train above this number.
    void
    Set the script-defined naval military pop, train plans can't train above this number.
    void
    Sets the next time in MS that the gatherer distribution is updated, call with -1 to never do distribution again.
    void
    aiSetOutpostLimit(int limit)
    Sets the limit for how many Outposts the AI can build.
    void
    aiSetResourceBreakdown(int resourceID, int resourceSubTypeID, int numberPlans, int planPriority, int baseID, int[] numNeeded, int[] numWanted, int[] numMax, int[] kbResourceIDs)
    Creates a resource breakdown with the provided paramaters, or overwrites an existing one.
    void
    aiSetResourcePercentage(int resourceID, float percentage)
    Sets the resource percentage for the given resource, you must already provide a roughly normalized value here.
    void
    Sets the next time in MS that the unassigned unit assigment is updated.
    void
    aiSwitchMainBase(int newBaseID)
    Switch the newBaseID to be the main base, all this does is flag setting.
    boolean
    aiTaskBuildUnit(int unitID, int buildingTypeID, Vector position, boolean queue, int heading)
    Does a lightweight (no plan) build tasking for the provided unitID to build the provided buildingTypeID at the provided vector.
    boolean
    aiTaskBuildUnits(int[] unitIDs, int buildingTypeID, Vector position, boolean queue, int heading)
    Does a lightweight (no plan) build tasking for the provided unitIDs to build the provided buildingTypeID at the provided vector.
    boolean
    aiTaskCancelUnit(int unitID, int actionID)
    Does a lightweight (no plan) cancellation of the given actionID for the provided unitID.
    boolean
    aiTaskDeleteUnit(int unitID)
    Deletes provided unitID.
    boolean
    aiTaskDeleteUnits(int[] unitIDs)
    Deletes provided unitIDs.
    boolean
    aiTaskGarrisonUnit(int unitID, int targetID)
    Does a lightweight (no plan) garrison for the provided unitID into the provided targetID.
    boolean
    aiTaskGarrisonUnits(int[] unitIDs, int targetID)
    Does a lightweight (no plan) garrison for the provided unitIDs into the provided targetID.
    boolean
    aiTaskMoveUnit(int unitID, Vector position, boolean attackMove, boolean queue)
    Does a lightweight (no plan) move tasking of the provided unitID to the provided location.
    boolean
    aiTaskMoveUnits(int[] unitIDs, Vector position, boolean attackMove, boolean queue)
    Does a lightweight (no plan) move tasking of the provided unitIDs to the provided location.
    boolean
    aiTaskResearchUnit(int unitID, int techID)
    Does a lightweight (no plan) research tasking for the provided unitID for the provided techID.
    boolean
    aiTaskSpecialPowerUnit(int unitID, int powerID, int targetID, Vector position, boolean setAsQueued)
    Does a lightweight (no plan) ordering for the provided unitID to use the provided powerID.
    boolean
    aiTaskStopUnit(int unitID)
    Does a lightweight (no plan) stopping of the provided unitID.
    boolean
    aiTaskStopUnits(int[] unitIDs)
    Does a lightweight (no plan) stopping of the provided unitIDs.
    boolean
    aiTaskTrainUnit(int unitID, int unitTypeID)
    Does a lightweight (no plan) train tasking for the provided unitID for the provided unitTypeID.
    boolean
    aiTaskUngarrisonUnit(int unitID, Vector position)
    Does a lightweight (no plan) ungarrison for the provided unitID towards the the provided position.
    boolean
    aiTaskUngarrisonUnits(int[] unitIDs, Vector position)
    Does a lightweight (no plan) ungarrison for the provided unitIDs towards the the provided position.
    boolean
    aiTaskWorkUnit(int unitID, int targetUnitID, boolean queue)
    Does a lightweight (no plan) work tasking of the provided unitID on the provided targetUnitID, this is like right-clicking.
    boolean
    aiTaskWorkUnits(int[] unitIDs, int targetUnitID, boolean queue)
    Does a lightweight (no plan) work tasking of the provided unitIDs on the provided targetUnitID, this is like right-clicking.
    boolean
    aiTransformWallIntoGate(int wallLongID)
    Transforms the provided wallLongID into a Gate.
    void
    aiTribute(int playerID, int resourceID, float amount)
    Tributes the provided amount of the provided resourceID to the provided playerID.
    void
    aiUnitAddForbiddenPlanID(int unitID, int planID)
    Adds the provided planID to the unitID's forbidden plan list.
    int[]
    Returns an array of planIDs that the provided unitID is currently banned from.
    void
    aiUnitSetRallyPointToPosition(int sourceUnitID, Vector position)
    Sets the rally point of the provided sourceUnitID to the provided position.
    void
    aiUnitSetRallyPointToUnit(int sourceUnitID, int targetUnitID)
    Sets the rally point of the provided sourceUnitID to the provided targetUnitID.
    void
    aiUnitSetStance(int unitID, int stance)
    Sets the stance for the provided unitID, "cUnitStance" constants.
    void
    aiUnitSetTactic(int unitID, int tacticDBID)
    Sets the tactic for the provided unitID, "cUnitTactic" constants.
    void
    aiUpdateFullUnitAssignment(boolean allowPlanTransfer)
    Force a run of the logic described in aiSetFullUnitAssignmentTime.
    float
    asin(float x)
    Returns the arcsine of x.
    float
    atan(float x)
    Returns the arctangent of x.
    float
    atan2(float y, float x)
    Returns the 2-argument arctangent.
    float
    ceil(float x)
    Rounds x up to the next higher integer and returns it as a float.
    float
    clamp(float val, float minVal, float maxVal)
    Clamps a value to the provided interval.
    float
    cos(float x)
    Returns the cosine of .
    float
    degToRad(float degrees)
    Converts an angle from degrees to radians.
    float
    floor(float x)
    Rounds x down to the next lower integer and returns it as a float.
    float
    hypot(float x, float y)
    Returns the hypothenuse between x and y (i.e., sqrt(x^2 + y^2)).
    kbActionGetName(int actionID)
    Returns the name for the provided actionID, use the cActionType constants for this.
    float
    kbAICostGetProtoUnitCost(int protoUnitID)
    Returns the AI cost for the provided protoUnitID.
    float
    kbAICostGetTechCost(int techID)
    Returns the AI cost for the provided techID.This is calculated by tallying up the individual resource costs of the technology and then potentially multiplied by a custom resource weight.
    float
    kbAICostGetUnitCost(int unitID)
    Returns the current AI cost for the provided unitID.
    float
    kbAICostGetWeight(int resourceID)
    Returns the AI cost weight for the provided resourceID.
    void
    kbAICostSetWeight(int resourceID, float weight)
    Sets the weight the provided resourceID is given during AI cost calculuations.
    boolean
    kbAreaBordersAreaID(int areaID, int borderAreaID)
    Returns if the provided areaID borders the provided borderAreaID.
    int
    kbAreaGetBorderAreaID(int areaID, int index)
    Returns the areaID at the index-th border area in the provided areaID.
    kbAreaGetCenter(int areaID)
    Returns the center of the provided areaID.
    int
    kbAreaGetClosestAreaID(Vector position, int areaType, float minDistance)
    Scans from the provided position for areas of the provided type.
    float
    kbAreaGetDangerLevel(int areaID, boolean averageInBorderAreas)
    Returns the danger rating of the provided areaID.
    int
    kbAreaGetGroupID(int areaID)
    Returns the areaGroupID of the provided areaID.
    int
    Returns the areaID that is located at the provided position.
    int[]
    kbAreaGetIDsByPositionAndRange(Vector position, float range, int[] validTypes, boolean mustBeOnConnectedAreaGroup, int movementType)
    Returns all areaIDs that are within the provided range from the provided position, area's center position is used to calculate this.
    boolean
    kbAreaGetIsIDValid(int areaID)
    Returns if the provided areaID is valid.
    int
    Returns the number of areas the KB has generated.
    int
    Returns the number of black tiles in the provided areaID.
    int
    Returns the number of border areas for the provided areaID.
    int
    Returns the number of fog tiles in the provided areaID.
    int
    Returns the number of tiles in the provided areaID.
    int
    Returns the number of units in the provided areaID.
    int
    Returns the number of visible tiles in the provided areaID.
    float
    Returns what percentage of tiles are either in fog or visible for the provided areaID.
    int
    kbAreaGetType(int areaID)
    Returns the type of the provided areaID, cAreaType constants.
    int
    kbAreaGetUnitID(int areaID, int index)
    Returns the unitID at the index-th unit in the provided areaID.
    int
    Returns the gametime in milliseconds of the last visibility change for the provided areaID.
    boolean
    kbAreaGroupBordersAreaGroupID(int areaGroupID, int borderAreaGroupID)
    Returns if the provided areaGroupID borders the provided borderAreaGroupID.
    int[]
    Returns an array with all area group IDs with the type cAreaGroupTypeLand.
    int
    kbAreaGroupGetAreaID(int areaGroupID, int index)
    Returns the areaID at the provided index of the provided areaGroupID.
    int
    kbAreaGroupGetBorderAreaGroupID(int areaGroupID, int index)
    Returns the areaGroupID of the index-th border area group in the provided areaGroupID.
    kbAreaGroupGetCenter(int areaGroupID)
    Returns the center of the provided areaGroupID.
    int
    Returns the areaGroupID that is located at the provided position.
    boolean
    kbAreaGroupGetIsIDValid(int areaGroupID)
    Returns if the provided areaGroupID is valid.
    int
    Returns the number of area groups the KB has generated.
    int
    kbAreaGroupGetNumberAreas(int areaGroupID)
    Returns the number of areas the provided areaGroupID has.
    int
    Returns the amount of border area groups the provided areaGroupID has.
    int
    kbAreaGroupGetNumberTiles(int areaGroupID)
    Returns the number of tiles the provided areaGroupID has.
    float
    kbAreaGroupGetSurfaceArea(int areaGroupID)
    Returns the surface area of the provided areaGroupID.
    int
    kbAreaGroupGetType(int areaGroupID)
    Returns the type of the provided areaGroupID, cAreaGroupType constants.
    int[]
    Returns an array with all area group IDs with the type cAreaGroupTypeWater/Amphibious that we consider useful.
    void
    Force updates all the areas, use with caution due to performance concerns.
    void
    kbArmyAddUnit(int armyID, int unitID)
    Adds the unitID to the given army.
    int
    kbArmyCreate(String name, boolean exclusiveUnits)
    Creates a army with the given name.
    void
    kbArmyDestroy(int armyID)
    Destroys the given army.
    int
    Returns the creation time for the given army.
    float
    Returns the current AI cost (worth) for the given army.
    float
    Returns the current total hitpoints for the given army.
    float
    kbArmyGetHealth(int armyID)
    Returns the health for the given army.
    int
    Returns the ID of the given army.
    int
    kbArmyGetIDByIndex(int index)
    Returns the index-th army ID.
    boolean
    kbArmyGetIsIDValid(int armyID)
    Return whether the armyID is valid.
    kbArmyGetLocation(int armyID)
    Returns the vector location for the given army.
    float
    Returns the maximum AI cost (worth) for the given army.
    float
    Returns the maximum total hitpoints for the given army.
    int
    Returns the creation time for the given army.
    kbArmyGetName(int armyID)
    Returns the name of the given army.
    int
    Returns the number of armies.
    int
    Returns the number of units in the given army.
    int
    kbArmyGetNumberWithHealth(int armyID, float minimumHealth)
    Returns the number of units with at least the minimum amount of health specified for the given army.
    int
    kbArmyGetNumberWithinLocation(int armyID, Vector location, float range)
    Returns the number of units within range of the given point in the given army.
    int
    kbArmyGetUnitID(int armyID, int unitNumber)
    Returns the appropriate unitID from the given army.
    void
    kbArmyRemoveUnit(int armyID, int unitID)
    Removes the unitID from the given army.
    void
    kbArmyRemoveUnitByIndex(int armyID, int unitIndex)
    Removes the unitIndex-th unit from the given army.
    void
    kbArmyRemoveUnits(int armyID)
    Removes all units from the given army.
    void
    kbAttackRouteAddPath(int routeID, int pathID, boolean addRouteStartAndTargetPoints)
    Adds the provided pathID to the provided routeID.
    void
    kbAttackRouteDestroy(int routeID)
    Destroys the provided routeID.
    int
    Returns the attack route ID with the matching name.
    int
    Returns the index-th attack route ID.
    boolean
    Returns if the provided routeID is valid.
    int
    Returns the number of attack routes the KB has saved.
    int
    Returns how many paths the provided routeID has.
    int
    kbAttackRouteGetPathIDByIndex(int routeID, int index)
    Returns the index-th path ID of the provided routeID.
    void
    kbAttackRouteRemovePathByID(int routeID, int pathID)
    Removes the provided pathID from the provided routeID.
    void
    kbBaseAddUnit(int playerID, int baseID, int unitID)
    Adds the provided unitID to the provided baseID belonging to the provided playerID.
    int
    kbBaseCreate(int playerID, String name, Vector position, float distance)
    Creates a base with the provided parameters.
    boolean
    kbBaseDestroy(int playerID, int baseID)
    Destroys the provided baseID belonging to the provided playerID.
    void
    kbBaseDestroyAll(int playerID)
    Destroys all of the bases for the provided playerID for the KB of the current XS context.
    int
    kbBaseFindOrCreateResourceBase(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
    Searches from the provided position for a KB Resource to make a base for.
    kbBaseGetBackVector(int playerID, int baseID)
    Returns the back vector of the provided baseID belonging to the provided playerID.
    float
    kbBaseGetCloseToEnemyBaseRating(int playerID, int baseID)
    Returns the close to enemy base rating of the provided baseID belonging to the provided playerID.
    float
    kbBaseGetDefenseRating(int playerID, int baseID, boolean includeCloseToEnemyBaseRating)
    Returns the defense rating of the provided baseID belonging to the provided playerID.
    float
    kbBaseGetDistance(int playerID, int baseID)
    Returns the distance of the provided baseID belonging to the provided playerID.
    kbBaseGetFrontVector(int playerID, int baseID)
    Returns the front vector of the provided baseID belonging to the provided playerID.
    int
    kbBaseGetIDByIndex(int playerID, int index)
    Returns the BaseID of the provided playerID at the provided index.
    boolean
    kbBaseGetIsIDValid(int playerID, int baseID)
    Returns if the provided baseID exists for the provided playerID.
    kbBaseGetLastKnownDamageLocation(int playerID, int baseID)
    Returns the last known damage location of the provided baseID belonging to the provided playerID.
    int
    kbBaseGetLastUnderAttackTime(int playerID, int baseID)
    Returns the time when the provided baseID belonging to the provided playerID was last attacked.
    kbBaseGetLocation(int playerID, int baseID)
    Returns the location of the provided baseID belonging to the provided playerID.
    int
    kbBaseGetMainID(int playerID)
    Returns the baseID of the base we consider the main base for the provided playerID.
    kbBaseGetMilitaryGatherPoint(int playerID, int baseID)
    Gets the military gather point of the provided baseID belonging to the provided playerID.
    kbBaseGetNameByID(int playerID, int baseID)
    Returns the name of the provided baseID belonging to the provided playerID.
    int
    Returns the ID of the next base that will be created, can be used for base names.
    int
    kbBaseGetNumber(int playerID)
    Returns the number of bases the provided playerID has.
    int
    kbBaseGetNumberUnitsOfType(int playerID, int baseID, int unitTypeID)
    Returns the number of units that match the provided unitTypeID within the provided baseID belonging to the provided playerID.
    int
    kbBaseGetOwner(int baseID)
    Returns the player ID of the provided baseID's owner.
    int
    kbBaseGetTimeUnderAttack(int playerID, int baseID)
    Returns the number of continuous seconds the provided baseID belonging to the provided playerID has been under attack.
    int[]
    kbBaseGetUnits(int playerID, int baseID)
    Returns the unitIDs of all the units that are within the provided baseID belonging to the provided playerID.
    boolean
    kbBaseIsFlagSet(int playerID, int baseID, int flag)
    Returns if the provided flag is set for the provided baseID + playerID.
    void
    kbBaseRemoveUnit(int playerID, int baseID, int unitID)
    Removes the provided unitID to the provided baseID belonging to the provided playerID.
    void
    kbBaseSetDistance(int playerID, int baseID, float newDistance)
    Sets the distance of the provided baseID belonging to the provided playerID.
    void
    kbBaseSetFlag(int playerID, int baseID, int flag, boolean state)
    Sets the provided flag on the provided baseID + playerID to the provided state.
    void
    kbBaseSetFrontVector(int playerID, int baseID, Vector frontVector)
    Sets the front (and back) of the provided baseID belonging to the provided playerID.
    void
    kbBaseSetMilitaryGatherPoint(int playerID, int baseID, Vector gatherPoint)
    Sets the military gather point of the provided baseID belonging to the provided playerID.
    void
    kbBaseSetPositionAndDistance(int playerID, int baseID, Vector position, float distance)
    Sets position and distance of the provided baseID belonging to the provided playerID.
    void
    kbBuildingPlacementAddAreaID(int bpID, int areaID, int numberBorderAreaLayers, boolean addCenterInfluence)
    Puts the provided bpID into area PlacementType using area calculations, only one Type can be active at a time! You can call this function multiple times per bpID to add multiple areas, that's why it's called "add" and not "set".
    void
    kbBuildingPlacementAddBaseInfluence(int bpID, int baseID, int orientationPreference, float influenceValue, int falloff)
    Adds a base influence to the provided bpID, you can only do this AFTER setting your PlacementType.
    void
    kbBuildingPlacementAddPositionInfluence(int bpID, Vector position, float value, float distance, int falloff)
    Adds the position influence to the provided bpID, you can only do this AFTER setting your PlacementType.
    void
    kbBuildingPlacementAddUnitInfluence(int bpID, int unitTypeID, float influenceValue, float influenceDistance, int falloff, int kbResourceID, int playerOrRelation)
    Adds a unit influence to the provided bpID, you can only do this AFTER setting your PlacementType.
    void
    Resets the provided bpID's PlacementType and influences, allowing you to configure it again without errors.
    int
    Creates a building placement with the provided name (no concurrent duplicates), returns the bpID.
    void
    Destroys the provided bpID, freeing up its name/potential existing lot too.
    int
    Returns the provided bpID's base ID, which is only set via kbBuildingPlacementSetBaseID.
    Returns the best result's position for the provided bpID.
    float
    Returns the best result's value for the provided bpID.
    float
    Returns the buffer space set for the provided bpID.
    int
    Gets the building set by kbBuildingPlacementSetBuildingPUID for the provided bpID.
    boolean
    Returns whether the provided bpID is valid or not.
    int
    Returns the provided bpID's placement type, cBuildingPlacementPlacementType constants.
    int
    Gets the socket ID set for the provided bpID.
    int
    Returns the provided bpID's state, cBuildingPlacementPlacementState constants.
    void
    kbBuildingPlacementSetAreaGroupID(int bpID, int areaGroupID)
    Puts the provided bpID into area PlacementType using area calculations, only one Type can be active at a time! This resets all influences, so do this first! Adds all areas belonging to the areaGroupID to the given bpID.
    void
    kbBuildingPlacementSetBaseID(int bpID, int baseID, int orientationPreference)
    Puts the provided bpID into Base PlacementType using center position calculations, only one Type can be active at a time! This resets all influences, so do this first! Sets the base ID for this bpID which can be fetched via kbBuildingPlacementGetBaseID.
    void
    kbBuildingPlacementSetBufferSpace(int bpID, float bufferSpace)
    Sets the provided bpID's buffer space, must be >= 0.0.
    void
    kbBuildingPlacementSetBuildingPUID(int bpID, int buildingTypeID)
    Sets the building that will be used during all the analysis of the provided bpID.
    void
    kbBuildingPlacementSetCenterPosition(int bpID, Vector position, float distance)
    Puts the provided bpID into CenterPosition PlacementType, only one Type can be active at a time! This resets all influences, so do this first! Read the explanation for kbBuildingPlacementSetStepSize to learn how this works.
    void
    kbBuildingPlacementSetCheckGPExclusion(int bpID, boolean exclusion)
    Sets if the provided bpID will take current GP Exclusion effects into account.
    void
    kbBuildingPlacementSetDockPositions(int bpID, Vector landPosition, Vector waterPosition)
    Puts the provided bpID into Dock building mode with Area PlacementType using area calculations, only one Type can be active at a time! Sets the two points from which the building placement will calculate a possible Dock position.
    void
    kbBuildingPlacementSetEventHandler(int bpID, int eventType, String handlerName)
    Sets an event handler for the provided bpID and event, cBuildingPlacementEvent constants.
    void
    kbBuildingPlacementSetInnerRingRange(int bpID, float innerRingRange)
    Sets the inner ring range value for the provided bpID.
    void
    kbBuildingPlacementSetLOSType(int bpID, int LOSType)
    Sets the given bpID's LOS type.
    void
    kbBuildingPlacementSetMinimumValue(int bpID, float minimumValue)
    Sets the minimum value a spot must have to be considered valid for the provided bpID.
    void
    kbBuildingPlacementSetRandomness(int bpID, boolean randomness)
    Sets if the provided bpID will randomize the results a bit.
    void
    kbBuildingPlacementSetRequiresCompletelyUnobstructed(int bpID, boolean requiresCompletelyUnobstructed)
    Sets if the provided BPID's obstruction check should fail if there is any obstruction at all.
    void
    kbBuildingPlacementSetSocketID(int bpID, int socketID)
    Sets the provided bpID into Socket PlacementType, only one Type can be active at a time! Sets the provided bpID's socket ID, which must be a valid unit ID.
    void
    kbBuildingPlacementSetStepSize(int bpID, float stepSize)
    Sets how big the step sizes are with which the provided bpID goes through the grid assigned to it to analyze.
    void
    Starts the provided bpID's process of analyzing all the possible spots.
    boolean
    kbCanAffordUnit(int protoUnitTypeID, int escrowID)
    Returns true if the player can afford the proto unit.
    boolean
    kbCanAreaPath(Vector pointA, Vector pointB, int movementType, float dangerThreshold, boolean allowPartialPath, int[] ignoreAreas, boolean teleporters)
    Returns if an area path can be made with the provided parameters.
    boolean
    kbCanPath(Vector pointA, Vector pointB, int protoUnitID, float range, int targetID)
    Returns if the provided protoUnitID can path from pointA to pointB.
    kbCivGetName(int civID)
    Returns the civilization (major god) name for the provided civID.
    int
    Converts the provided dbid of a proto action into a cActionType constant.
    int
    kbCreateAttackRouteWithPath(String name, Vector startPoint, Vector targetPoint)
    Creates an attack route and returns the routeID if successful.
    int
    Creates a tech progression of the given name.
    int
    Creates a unit progression of the given name.
    kbCultureGetName(int cultureID)
    Returns the culture name for the provided cultureID.
    boolean
    kbDefaultGetProtoStatBool(int protoUnitID, int statEnumID)
    Returns the value for the provided bool statEnumID for the provided protoUnitID (base values), "KB proto stats: bool" constants.
    boolean
    kbDefaultGetProtoStatFlag(int protoUnitID, int flagEnumID)
    Returns if the provided flagEnumID is sets on the provided protoUnitID (base values), cProtoUnitFlag constants.
    float
    kbDefaultGetProtoStatFloat(int protoUnitID, int statEnumID)
    Returns the value for the provided float statEnumID for the provided protoUnitID (base values), "KB proto stats: float" constants.
    int
    kbDefaultGetProtoStatInt(int protoUnitID, int statEnumID)
    Returns the value for the provided int statEnumID for the provided protoUnitID (base values), "KB proto stats: int" constants.
    kbDefaultGetProtoStatString(int protoUnitID, int statEnumID)
    Returns the value for the provided string statEnumID for the provided protoUnitID (base values), "KB proto stats: string" constants.
    boolean
    Reallocates the current resource stockpile into the escrows.
    int
    kbEscrowCreate(String name, int resourceID, float percentage, int parentID)
    Creates an escrow.
    boolean
    kbEscrowDestroy(int escrowID, boolean promoteChildren)
    Destroys an escrow.
    boolean
    kbEscrowFlush(int escrowID, int resourceID, boolean flushChildren)
    Removes all credits (and puts them into the root escrow) of the given resource type from the given escrow.
    float
    kbEscrowGetAmount(int escrowID, int resourceID)
    Returns the amount of credits in the given escrow for the given resource.
    int
    Returns the ID of the named escrow.
    float
    kbEscrowGetPercentage(int escrowID, int resourceID)
    Returns the percentage of the escrow.
    boolean
    kbEscrowSetCap(int escrowID, int resourceID, float cap)
    Sets the cap of the escrow.
    boolean
    kbEscrowSetPercentage(int escrowID, int resourceID, float percentage)
    Sets the percentage of the escrow.
    int
    kbFindClosestBase(int playerID, int playerRelation, Vector location, int movementType, boolean militaryBasesOnly)
    Gets the nearest base belonging to the provided playerID OR player relation from the location.
    kbFindClosestPassablePoint(Vector startPoint, int movementType, float range)
    Returns the first spot on the map that is not obstructed for the provided movementType.
    int
    kbFunctionUnitGetByIndex(int civ, int function, int index)
    Returns the function unit from the provided civ and function at the provided index.
    int
    kbFunctionUnitGetNumber(int civ, int function)
    Returns the number of function units for the provided civ and function.
    float
    Returns allied trading bonus.
    float[]
    Returns the amount of resources that are still available for the provided areagroupID.
    float
    kbGetAmountValidResourcesByPosition(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
    Returns the combined resource amount of valid KB resources for the provided parameters.
    int
    Returns the hashed ID for a provided animation name.
    boolean
    eturns if the KB is currently automatically creating bases for our OWN units.
    float
    Returns the auto base creation distance for OWN bases.
    float
    Returns the auto base creation distance for OWN Town Center bases.
    boolean
    Returns if the KB is currently automatically creating bases for OTHER player's units.
    float
    Returns the auto base creation distance for OTHER player's bases.
    float
    Returns the auto base creation distance for OTHER player's Town Center bases.
    float
    kbGetCombatEfficiency(int playerID1, int unitTypeID1, int playerID2, int unitTypeID2, boolean ignoreTrainCheck, boolean considerCost)
    Returns the combat efficiency of the comparison (in terms of playerID1's units).
    boolean
    Returns if Free For All is enabled.
    boolean
    Returns if this map is an island map or not.
    boolean
    Returns if the provided location is on the map.
    int
    Returns how long a KOTH needs to be held for for the team to win, in seconds.
    Returns the center vector of the map.
    float
    Returns the X size of the map.
    float
    Returns the Z size of the map.
    float
    kbGetMarketBuyCost(int resourceID)
    Returns the gold amount required to buy 100 of the provided resourceID.
    float
    kbGetMarketSellReward(int resourceID)
    Returns the gold amount received for selling 100 of the provided resourceID.
    int
    Returns the number of mutual allies we have.
    int
    kbGetNumberResourceGatherers(int playerID, String resName)
    Returns the number of gatherers of the provided resName there are for the provided playerID.
    int
    kbGetNumberUnitTypeKilled(String unitTypeName, int playerID)
    Returns the number of units killed of the provided unitTypeName for the provided playerID.
    int
    kbGetNumberValidResourcesByPosition(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
    Returns the number of valid KB resources matching the parameters.
    int
    kbGetPopulationSlotsByUnitTypeID(int unitTypeID, int playerID, int state)
    Returns the number of pop slots currently occupied by the provided unitTypeID for the provided playerID.
    int
    Returns the ID of a random unit among the living units on the map, belonging to any player, including Mother Nature units.
    float
    kbGetResourceAmount(int playerID, int resourceID)
    Returns the current stockpile amount of the provided resourceID of the provided playerID.
    int
    Returns the resourceID, cResource constants.
    kbGetResourceName(int resourceID)
    Returns the name associated with the provided resourceID.
    float
    kbGetResourceSelectorFactor(int type, int resourceID)
    Returns the ResourceSelector Factor value of the provided type and provided resourceID.
    float
    kbGetStatValueFloat(int playerID, int statTypeID, int param)
    Returns the value of a given KB Stat as float.
    int
    kbGetStatValueInt(int playerID, int statTypeID, int param)
    Returns the value of any given KB Stat as integer.
    int
    kbGetTacticDBID(String tacticName)
    Returns the tactic DBID.
    float
    kbGetTotalResourceAmount(int playerID, int resourceID)
    Returns the total amount of the provided resourceID gathered by the provided playerID.
    int
    Returns the unitType ID.
    int[]
    kbGetValidResourcesByPosition(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
    Returns the KB resourceIDs matching the provided parameters.
    boolean
    kbGodPowerCanPrePurchase(int protoPowerID, int playerID)
    Returns if the provided protoPowerID is currently pre-purchasable by the provided playerID.
    TODO.
    int
    TODO.
    int
    TODO.
    boolean
    kbGodPowerCheckActive(int protoPowerID, int playerID)
    Returns if the provided protoPowerID is currently in effect for the provided playerID.
    boolean
    Returns if the provided protoPowerID is currently in effect for any player.
    float
    kbGodPowerGetCost(int protoPowerID, int playerID, boolean includePrePurchased)
    Returns the current cost of the provided protoPowerID for the provided playerID.
    float
    kbGodPowerGetDataCost(int protoPowerID, int playerID)
    Returns the base cost of the provided protoPowerID for the provided playerID, this is the cost for the first re-cast.
    float
    kbGodPowerGetDataRepeatCost(int protoPowerID, int playerID)
    Returns the base repeat cost of the provided protoPowerID for the provided playerID, this is the cost that gets added each cast.
    int
    kbGodPowerGetID(String protoPowerName)
    Returns the ID for the provided protoPowerName.
    int
    kbGodPowerGetIDInSlot(int slotIndex, int playerID)
    Returns the protoPowerID that is currently in the provided slotIndex for the provided playerID.
    boolean
    kbGodPowerGetIsIDValid(int protoPowerID)
    Returns if the provided protoPowerID corresponds to a valid god power.
    kbGodPowerGetName(int protoPowerID)
    Returns the internal name of the provided protoPowerID.
    int
    kbGodPowerGetNumCharges(int protoPowerID, int playerID)
    Returns the number of available charges/uses for the provided protoPowerID for the provided playerID.
    int
    kbGodPowerGetNumPrePurchasedUses(int protoPowerID, int playerID)
    Returns the current number of pre-purchased uses/charges of the provided protoPowerID for the provided playerID.
    int
    kbGodPowerGetNumUsedTimes(int protoPowerID, int playerID)
    Returns the number of times the provided protoPowerID has been used by the provided playerID.
    float
    kbGodPowerGetPrePurchaseCost(int protoPowerID, int playerID, int numUses)
    Returns the current cost of pre-purchasing the provided number of charges of the provided protoPowerID for the provided playerID.
    float
    kbGodPowerGetRadius(int protoPowerID, int playerID)
    Returns the radius of the provided protoPowerID for the provided playerID.
    boolean
    kbGodPowerIsOnCooldown(int protoPowerID, int playerID)
    Returns if the provided protoPowerID for the provided playerID is currently on cooldown.
    boolean
    kbGodPowerIsRepeatable(int protoPowerID, int playerID)
    Returns if the provided protoPowerID is infinitely castable for the provided playerID.
    boolean
    Returns if the provided location is currently fogged.
    boolean
    Returns if the provided location is currently visible.
    void
    kbLookAtAllUnitsOnMap(boolean ignoreNature)
    Cheats and looks at all of the units on the map and adds them to the KB.
    float
    kbMaximumResourceGet(int resourceID)
    Returns the maximum amount of the provided resourceID you can have.
    void
    kbPathAddWaypoint(int pathID, Vector waypoint)
    Adds the provided waypoint to the provided pathID.
    void
    kbPathAddWaypointAfter(int pathID, int waypointIndex, Vector waypoint)
    Adds the provided waypoint to the provided pathID after the provided waypointIndex.
    boolean
    kbPathAreAreaGroupsConnected(int startAreaGroupID, int goalAreaGroupID, int movementType, boolean bool4)
    Returns if the provided area group IDs can be pathed between with the provided movementType.
    float
    kbPathCalculateLength(int pathID, boolean ignoreY)
    Returns the length of the provided pathID after calculating it.
    int
    Creates a path with the provided name.
    int[]
    kbPathCreateAreaGroupPath(int startAreaGroupID, int goalAreaGroupID, int movementType, boolean bool4)
    Returns the area group IDs that need to be pathed over to reach the provided goalAreaGroupID starting from the provided startAreaGroupID using the provided movementType.
    boolean
    kbPathCreateAreaPath(int pathID, int startAreaID, int goalAreaID, int movementType, float dangerThreshold, boolean allowPartialPath, boolean allowTeleporters)
    Creates an area path with the provided parameters and saves it into the provided pathID.
    void
    kbPathDestroy(int pathID)
    Destroys the provided path.
    int
    kbPathGetIDByIndex(int index)
    Returns the index-th pathID, use in combination with kbPathGetNumber to know how many indexes there are.
    int
    Returns the pathID with the matching name.
    boolean
    kbPathGetIsIDValid(int pathID)
    Returns if the provided pathID is valid.
    float
    kbPathGetLength(int pathID)
    Returns the length of the provided pathID.
    kbPathGetName(int pathID)
    Returns the name of the provided pathID.
    int
    Returns the number of paths the KB currently has.
    int
    Returns the number of waypoints the provided pathID has.
    kbPathGetWaypoint(int pathID, int wpIndex)
    Returns the waypoint at the provided wpIndex of the provided pathID.
    void
    kbPathRemoveWaypoint(int pathID, int wpIndex)
    Removes the waypoint at the provided wpIndex of the provided pathID.
    int
    kbPlayerGetAge(int playerID)
    Returns the current age for the provided playerID, cAge constants.
    float
    Returns the building efficiency for the provided playerID, as defined in major_gods.xml.
    int
    kbPlayerGetCiv(int playerID)
    Returns the civilization (major god) for the provided playerID, cCiv constants.
    int
    kbPlayerGetCulture(int playerID)
    Returns the culture for the provided playerID, cCulture constants.
    float
    Returns the extra building efficiency for the provided playerID, as defined in major_gods.xml.
    float
    kbPlayerGetHandicap(int playerID)
    Returns the provided playerID's handicap multiplier (1.0 = no handicap).
    int
    kbPlayerGetMaxPop(int playerID)
    Returns the maximum population for the provided playerID.
    kbPlayerGetName(int playerID)
    Returns the provided playerID's name.
    int
    kbPlayerGetPop(int playerID)
    Returns the current population for the provided playerID, means cheating if used by AI for other players.
    int
    kbPlayerGetPopCap(int playerID)
    Returns the current population cap for the provided playerID, means cheating if used by AI for other players.
    boolean
    kbPlayerGetProtoStatBool(int playerID, int protoUnitID, int statEnumID)
    Returns the value for the provided bool statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: bool" constants.
    boolean
    kbPlayerGetProtoStatFlag(int playerID, int protoUnitID, int flagEnumID)
    Returns if the provided flagEnumID is sets on the provided protoUnitID for the provided playerID, cProtoUnitFlag constants.
    float
    kbPlayerGetProtoStatFloat(int playerID, int protoUnitID, int statEnumID)
    Returns the value for the provided float statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: float" constants.
    int
    kbPlayerGetProtoStatInt(int playerID, int protoUnitID, int statEnumID)
    Returns the value for the provided int statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: int" constants.
    kbPlayerGetProtoStatString(int playerID, int protoUnitID, int statEnumID)
    Returns the value for the provided string statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: string" constants.
    Returns the provided playerID's starting position.
    int
    kbPlayerGetTeam(int playerID)
    Returns the provided playerID's team number.
    float
    Returns the provided playerID's tribute penalty.
    int
    kbPlayerGetVisible(int playerID)
    Returns the provided playerID's visible value (0 = normal, 1 = hidden).
    boolean
    kbPlayerHasLost(int playerID)
    Returns true if the provided playerID has either resigned or has been defeated.
    boolean
    kbPlayerIsAlly(int playerID)
    Returns true if the provided playerID is an ally of us.
    boolean
    kbPlayerIsEnemy(int playerID)
    Returns true if the provided playerID is an enemy of us.
    boolean
    kbPlayerIsHuman(int playerID)
    Returns true if the provided playerID is a a human player.
    boolean
    kbPlayerIsMutualAlly(int playerID)
    Returns true if the provided playerID is a mutual ally (we are ally to the playerID and he is to us as well).
    boolean
    kbPlayerIsNeutral(int playerID)
    Returns true if the provided playerID is neutral towards us.
    boolean
    kbPlayerIsResigned(int playerID)
    Returns true if the provided playerID is resigned.
    void
    kbPlayerSetHandicap(int playerID, float handicap)
    Sets the provided playerIDs handicap multiplier (1.0 = no handicap).
    void
    kbPlayerSetVisible(int playerID, int visible)
    Sets the provided playerID's visible value (0 = normal, 1 = hidden).
    float
    kbProgessionGetTotalResourceCost(int progressionID, int resourceID)
    Returns the total cost of the given resource for this progressionID.
    int
    kbProgressionGetNodeData(int progressionID, int nodeIndex)
    Returns the data at nodeIndex, either UnitID or TechID, depending on the type.
    int
    kbProgressionGetNodeType(int progressionID, int nodeIndex)
    Returns the type of node at the given index, either Unit type or Tech type.
    int
    kbProgressionGetTotalNodes(int progressionID)
    Returns the total number of steps to complete the progression.
    boolean
    kbProtoUnitAvailable(int protoUnitID)
    Returns if the provided protoUnitID is currently available.
    boolean
    kbProtoUnitCanResearch(int protoUnitID, int techID)
    Returns if the provided protoUnitID unit can research the provided techID.
    boolean
    kbProtoUnitCanTrain(int protoUnitID, int trainPUID)
    Returns if the provided protoUnitID unit can train the provided trainPUID.
    float
    kbProtoUnitCostPerResource(int protoUnitID, int resourceID)
    Returns the cost of the provided protounitID for the provided resourceID.
    float
    kbProtoUnitGetActionDamageForType(int playerID, int protoUnitID, String actionName, int damageType)
    eturns total damageType damage stat for the provided unit action.
    int[]
    kbProtoUnitGetActionIDs(int playerID, int protoUnitID)
    Returns the ids of the proto actions the provided protoUnitID has, these match with the cActionType constants.
    float
    kbProtoUnitGetActionMaximumRange(int playerID, int protoUnitID, String action, int type)
    Returns the maximum range of the action for the provided unit action.
    float
    kbProtoUnitGetActionStatFloat(int playerID, int protoUnitID, String actionName, int statEnumID)
    Returns the value for the provided float stat of the provided unit action.
    int
    kbProtoUnitGetActionStatInt(int playerID, int protoUnitID, String actionName, int statEnumID)
    Returns the value for the provided int stat of the provided unit action.
    float
    kbProtoUnitGetBuildingChainRadius(int playerID, int protoUnitID)
    Returns the building chain radius for the provided protoUnitID for the provided playerID.
    float
    kbProtoUnitGetBuildRate(int playerID, int builderPUID, int buildingPUID)
    Returns the build rate that the provided builderPUID has towards the provided buildingPUID for the provided playerID.
    float[]
    kbProtoUnitGetCost(int protoUnitID)
    Returns the costs of the provided protounitID.
    float
    kbProtoUnitGetCostTotal(int protoUnitID)
    Returns the total cost of the provided protounitID.
    kbProtoUnitGetDisplayName(int playerID, int protoUnitID)
    Returns the display name of the provided protoUnitID for the provided playerID.
    float
    kbProtoUnitGetGatherRate(int protoUnitID, int resourcePUID)
    Returns the provided protoUnitID's gather rate towars the provided resourcePUID.
    kbProtoUnitGetIconPath(int playerID, int protoUnitID, int cultureID)
    Returns the icon path of the provided protoUnitID of the provided playerID.
    int
    Returns the protoUnitID of the provided name.
    boolean
    kbProtoUnitGetIsValidID(int protoUnitID)
    Returns if the provided protoUnitID is valid.
    kbProtoUnitGetLongRollover(int playerID, int protoUnitID)
    Returns the long rollover of the provided protoUnitID for the provided playerID.
    kbProtoUnitGetName(int protoUnitID)
    Returns the name of the provided protoUnitID.
    float
    kbProtoUnitGetPower(int protoUnitID)
    Returns the outcome of the same calculation as described in kbUnitGetPower, but health percentage is not a factor here.
    kbProtoUnitGetShortRollover(int playerID, int protoUnitID)
    Returns the short rollover of the provided protoUnitID for the provided playerID.
    float
    kbProtoUnitGetSiegePower(int protoUnitID)
    Returns the outcome of the same calculation as described in kbUnitGetSiegePower, but health percentage is not a factor here.
    int[]
    kbProtoUnitGetTrainers(int protoUnitID)
    Returns an array of all accessible PUIDs that can train the provided protoUnitID.
    boolean
    kbProtoUnitHasTrainCommands(int protoUnitID)
    Returns if the provided protoUnitID can train/build other units/buildings.
    float
    kbProtoUnitInitialResource(int protoUnitID, int resourceID)
    Returns the initial resource amount of the provided protounitID for the provided rsourceID.
    boolean
    kbProtoUnitIsType(int protoUnitID, int unitTypeID)
    Returns if the provided protoUnitID is of the provided unitTypeID.
    int
    kbRelicGetTechID(int unitID)
    Returns the tech ID for the provided unitID (must be a Relic), or -1, if it's invalid.
    void
    kbResourceCombineHerdableResourcesAroundUnit(int unitID, float distance)
    Combines all Herdable KB Resources around the provided unitID within the provided distance.
    float
    kbResourceGet(int resourceID)
    Returns the current amount in the stockpile of the provided resourceID.
    int
    Returns the unitID of the dropsite that is closest to the center of the provided kbResourceID.
    int
    Returns the unitID of the Farm that is furthest away from a dropsite in the provided kbResourceID.
    int
    Returns the KB resourceID at the provided index.
    int
    Returns the kbResourceID of the provided unitID.
    float
    kbResourceGetIncome(int resourceID, float seconds, boolean relative)
    Returns the income we've had for the provided resourceID over the last X seconds.
    boolean
    kbResourceGetIsIDValid(int kbResourceID)
    Returns if the provided kbResourceID is valid.
    int
    Returns the number of KB resources that we currently have in the KB.
    int
    kbResourceGetNumberUnits(int kbResourceID)
    Returns how many units are in the provided kbResourceID.
    int
    kbResourceGetPlanID(int kbResourceID)
    Returns the planID that may be associated with the provided kbResourceID.
    kbResourceGetPosition(int kbResourceID)
    Returns the position of the provided kbResourceID.
    int
    kbResourceGetSubType(int kbResourceID)
    Returns the provided kbResourceID's subtype.
    float
    kbResourceGetTotalResources(int kbResourceID)
    Returns the total amount of resources that are left in the provided kbResourceID.
    int
    kbResourceGetType(int kbResourceID)
    Returns the provided kbResourceID's type.
    int
    kbResourceGetUnit(int kbResourceID, int index)
    Returns the unitID found at the provided index in the provided kbResourceID.
    boolean
    kbResourceIsFlagSet(int kbResourceID, int flag)
    Returns whether the provided flag is set for the provided kbResourceID.
    void
    kbResourceSetFlag(int kbResourceID, int flag, boolean state)
    Sets the provided flag for the provided kbResourceID to the provided state.
    void
    kbResourceSortTowardsPosition(int kbResourceID, Vector position)
    Sorts all the units in the provided kbResourceID towards to position.
    void
    Sets whether or not the KB automatically creates bases for its OWN units.
    void
    Sets the default distance with which OWN bases are made.
    void
    Sets the default distance with which OWN Town Center bases are made.
    void
    kbSetAutoOtherBaseCreation(boolean distance)
    Sets whether or not the KB automatically creates bases for OTHER player's units.
    void
    Sets the default distance with which OTHER player's bases are made.
    void
    Sets the default distance with which OTHER player's Town Center bases are made.
    void
    kbSetResourceSelectorFactor(int type, int resourceID, float val)
    Sets the ResourceSelector Factor value, cTSFactor constants.
    int
    kbSharedFunctionUnitGetByIndex(int function, int index)
    Returns the shared function unit from the provided function at index.Use in combination with kbSharedFunctionUnitGetNumber to know how many indexes there are.
    int
    Returns the number of shared function units for the provided function.This is fetching data from unit_function.xml.
    boolean
    kbTechAffectsUnitType(int techID, int unitTypeID)
    Returns if the provided techID affects the provided unitTypeID.
    boolean
    kbTechAffectsWorkRate(int techID, int resourceID)
    Returns if the provided techID affects work rate in any way.
    boolean
    kbTechCanAfford(int techID, int escrowID)
    Returns if the player can afford the provided techID with the current resource stockpile.
    float[]
    kbTechGetCost(int techID)
    Returns the cost of the provided techID.
    float
    kbTechGetCostPerResource(int techID, int resourceID)
    Returns the cost of the provided techID for the provided resourceID.
    float
    kbTechGetCostTotal(int techID)
    Returns the total cost of the provided techID.
    float
    kbTechGetDataEffectAmount(int techID, int effectIndex)
    Returns the data effect's amount at the provided effectIndex of the provided techID.
    int
    kbTechGetDataEffectData2(int techID, int effectIndex)
    Returns the value saved in data2 for the provided effectIndex for the provided techID, only works on data effects.
    int
    kbTechGetDataEffectData3(int techID, int effectIndex)
    Returns the value saved in data3 for the provided effectIndex for the provided techID, only works on data effects.
    int
    kbTechGetDataEffectData4(int techID, int effectIndex)
    Returns the value saved in data4 for the provided effectIndex for the provided techID, only works on data effects.
    int
    kbTechGetDataEffectData5(int techID, int effectIndex)
    Returns the value saved in data5 for the provided effectIndex for the provided techID, only works on data effects.
    int
    kbTechGetDataEffectData6(int techID, int effectIndex)
    Returns the value saved in data6 for the provided effectIndex for the provided techID, only works on data effects.
    float
    kbTechGetDataEffectRelativity(int techID, int effectIndex)
    Returns the data effect's relativity at the provided effectIndex of the provided techID.
    int
    kbTechGetDataEffectTargetID(int techID, int effectIndex)
    Returns the effect's target ID of the provided techID at the provided effectIndex.
    int
    kbTechGetDataEffectTargetType(int techID, int effectIndex)
    Returns the effect's target type of the provided techID at the provided effectIndex.
    int
    kbTechGetDataEffectType(int techID, int effectIndex)
    Returns the data effect type at the provided effectIndex of the provided techID.
    kbTechGetDisplayName(int playerID, int techID)
    Returns the display name of the provided techID for the provided playerID.
    int
    kbTechGetEffectType(int techID, int effectIndex)
    Returns the effect type of the provided techID at the provided effectIndex.
    boolean
    kbTechGetFlag(int techID, int flag)
    Returns if the flag is set for the provided techID, cTechFlag constants.
    kbTechGetIconPath(int playerID, int techID, int cultureID)
    Returns the icon path of the provided techID for the provided playerID.
    int
    kbTechGetID(String techName)
    Returns the ID of the technology with the provided techName.
    kbTechGetName(int techID)
    Returns the name for the provided techID.
    int
    Returns the number of "" nodes of the tech.
    float
    Returns the percent complete for the provided techID.
    float
    Returns the research points for the provided techID.
    kbTechGetRollover(int playerID, int techID)
    Returns the rollover of the provided techID for the provided playerID.
    int
    kbTechGetStatus(int techID, boolean checkPrereqs)
    Returns the current tech status for the provided techID.
    boolean
    kbTechGetType(int techID, int typeID)
    Returns if the type is set for the provided techID, these types are defined in tech_types.xml.
    boolean
    kbTechIsPreQueued(int techID)
    Returns if the provided techID is prequeued.
    boolean
    kbTechIsQueued(int techID)
    Returns if the provided techID is queued, this means it's not actively researching but in the queue.
    int[]
    kbTechTreeGetAllObtainableTechnologies(boolean needAliveResearcher)
    Returns all technology IDs of the technologies that are obtainable to us (excluding age ups and technologies which prereqs we haven't met), the IDs correspond to the cTech constants.
    int[]
    Returns all PUIDs that are accessible to us and that can research the provided techID.
    int
    kbUnitCount(int unitTypeID, int playerID, int state, boolean excludeKnockedOutUnits)
    Returns a quick unit count of units of the provided unitTypeID belonging to the provided playerID.
    int
    kbUnitGetActionType(int unitID)
    Returns the actionTypeID the provided unitID is currently performing, cActionType constants.
    int
    Returns the area group ID for the provided unitID.
    int
    kbUnitGetAreaID(int unitID)
    Returns the area ID for the provided unitID.
    int
    kbUnitGetArmyID(int unitID)
    Returns the army ID for the provided unitID.
    int
    kbUnitGetBaseID(int unitID)
    Returns the base ID for the provided unitID.
    float
    kbUnitGetCarryCapacity(int unitID, int resourceID)
    Returns the resource carry capacity of the provided unitID of the provided resourceID.
    float
    kbUnitGetCommandCost(int unitID, int techID, int resourceID)
    Returns the in-game cost for the provided resourceID type for the protoUnitCommand that corresponds to the provided techID,while accounting for dynamic bonuses for the provided unitID.
    int
    kbUnitGetContainedUnitByIndex(int unitID, int index)
    Returns the ID of the unit contained at the provided index within the provided unitID.
    int
    kbUnitGetContainer(int unitID)
    Returns the container ID for the provided unitID.
    int
    Returns the ID of the current animation for the provided unitID.
    float
    kbUnitGetCurrentDamageMultiplier(int unitID, int damageType)
    Returns the current damage multiplier the provided unitID has.
    int
    Returns how many train / research actions are currently queued for the provided unitID.
    float
    Returns the current ROF multiplier the provided unitID has.
    float
    kbUnitGetDistanceToPoint(int unitID, Vector point)
    Returns the distance from the provided unitID to the provided point, which includes the unit's radius.
    float
    kbUnitGetDistanceToUnit(int unitID, int otherUnitID)
    Returns the distance from the provided unitID to the provided otherUnitID, which includes both the units' radii.
    int
    kbUnitGetHeading(int unitID)
    Returns the heading for the provided unitID.
    int
    kbUnitGetIdleTime(int unitID)
    Returns the idle time for the provided unitID, in milliseconds.
    boolean
    kbUnitGetIsAffectedByStatusEffect(int unitID, int statusEffectID)
    Returns if the provided unitID is affected by the provided statusEffectID, cStatusEffect constants.
    boolean
    kbUnitGetIsIDValid(int unitID, boolean deadIsValid)
    Returns if the unitID corresponds to a unit that is currently in the game.
    boolean
    Returns if the provided unitID is knocked out.
    int
    kbUnitGetKBResourceID(int unitID, boolean deadIsValid)
    Returns what KB resource the provided unitID is in.
    boolean
    kbUnitGetMaintainActionPausedByIndex(int unitID, int index)
    Currently not really functional since you can't fetch the proper index.
    int
    Returns the number of actions of the provided unitID currently has.
    int
    Returns the number of units contained by the provided unitID.
    int
    kbUnitGetNumberContainedOfType(int unitID, int unitTypeID)
    Returns the number of units contained of the provided unitTypeID by the provided unitID.
    int
    Returns the number of units currently working on the provided unitID.
    int
    kbUnitGetPlanID(int unitID)
    Returns the plan ID for the provided unitID.
    int
    kbUnitGetPlayerID(int unitID)
    Returns the player ID of the owner of the provided unitID.
    kbUnitGetPosition(int unitID)
    Returns the position for the provided unit ID that's saved in the KB.
    float
    kbUnitGetPower(int unitID, boolean ignoreCurrentHealth)
    We first need to establish an initial value that we then potentially multiply due to ignoreCurrentHealth.
    int
    Returns the protounitID if the provided unitID.
    int
    kbUnitGetQueueItemAtIndex(int unitID, int index)
    Returns either the techID or the protoUnitID for the queued item at the provided index for the provided unitID.
    int
    kbUnitGetQueueTypeAtIndex(int unitID, int index)
    Returns either cActionTypeTrain or cActionTypeResearch based on what type of queue item is present for the provided unitID at the provided index.
    float
    kbUnitGetResourceAmount(int unitID, int resourceID)
    Returns the resource amount of the provided unitID of the provided resourceID.
    float
    kbUnitGetResourceAutoGatherRate(int unitID, int resourceID)
    Returns the auto-gather rate value for the provided resourceID of the provided unitID.
    float
    kbUnitGetSiegePower(int unitID, boolean ignoreCurrentHealth)
    The first step of the calculation is to call kbUnitGetPower, this is the first value.
    boolean
    kbUnitGetStatBool(int unitID, int statEnumID)
    Returns the value for the provided bool statEnumID of the provided unitID, "KB unit stats: bool" constants.
    boolean
    kbUnitGetStatFlag(int unitID, int flagEnumID)
    Returns if the provided flagEnumID is sets on the provided unitID, cUnitFlag constants.
    float
    kbUnitGetStatFloat(int unitID, int statEnumID)
    Returns the value for the provided float statEnumID of the provided unitID, "KB unit stats: float" constants.
    int
    kbUnitGetStatInt(int unitID, int statEnumID)
    Returns the value for the provided int statEnumID of the provided unitID, "KB unit stats: int" constants.
    kbUnitGetStatString(int unitID, int statEnumID)
    Returns the value for the provided string statEnumID of the provided unitID, "KB unit stats: string" constants.
    int
    kbUnitGetTactic(int unitID)
    Returns the current tactic DBID for the provided unitID.
    int
    Returns the target unit ID of the provided unitID.
    Returns the true position for the provided unitID.
    int
    kbUnitGetWorkerID(int unitID, int index)
    Returns the index-th worker of the provided unitID, use kbUnitGetNumberWorkers to know how many indexes there are.
    boolean
    kbUnitIsContainedBy(int unitID, int unitTypeID)
    Returns if provided unitID is contained by a container belonging to the provided unitTypeID.
    boolean
    kbUnitIsEmpowered(int unitID)
    Returns if the provided unitUD is currently empowered.
    boolean
    Returns if the provided unitID is currently connected to any building chain, example: favored land for Chinese.
    boolean
    kbUnitIsInLush(int unitID, int playerID)
    Returns if the provided unitID is within terrain lush belonging to the provided playerID.
    boolean
    Returns if the provided unitID is a charmed unit that will disappear at some point.
    boolean
    Returns if the provided unitID is currently Training or Researching.
    boolean
    kbUnitIsType(int unitID, int unitTypeID)
    Returns if the provided unitID is of the provided unitTypeID.
    boolean
    kbUnitPickAddCombatEfficiencyType(int upID, int unitTypeID, float weight)
    Adds an enemy unitTypeID to the provided upID's combat efficiency calculation.
    int
    Creates a unit picker with the provided name and returns the ID of it.
    boolean
    Destroys the provided upID.
    int
    Return the provided upID's attack unit type.
    boolean
    Returns whether or not the provided upID actually went into counter mode, can only be used after kbUnitPickRun.
    boolean
    Returns if the provided upID is valid.
    int
    Returns the number of results for the provided upID, can only be used after kbUnitPickRun.
    float
    Returns the provided upID's preference weight.
    int
    kbUnitPickGetResult(int upID, int index)
    Returns the index-th ProtoUnitID for the provided upID, can only be used after kbUnitPickRun.
    float
    kbUnitPickGetResultFactor(int upID, int index)
    Returns the index-th total factor of the provided upID, can only be used after kbUnitPickRun.
    float[]
    Returns all the result factors of the provided upID, can only be used after kbUnitPickRun.
    int[]
    Returns all the results of the provided upID, can only be used after kbUnitPickRun.
    void
    kbUnitPickRemoveCombatEfficiencyType(int upID, int unitTypeID)
    Removes the provided unitTypeID from the provided upID's combat efficiency calculation.
    void
    Resets all the provided upID's values.
    void
    Resets the enemy unitTypeIDs for the provided upID's combat efficiency calculation.
    void
    Resets the provided upID's movement type to cPassabilityNone.
    int
    kbUnitPickRun(int upID)
    Resets all the previous results and then runs the provided upID again.
    void
    kbUnitPickSetAttackUnitType(int upID, int unitTypeID)
    Sets the provided upID's attack unit type.
    void
    kbUnitPickSetCombatEfficiencyWeight(int upID, float weight)
    Sets the provided upID's Combat Efficiency weight.
    void
    kbUnitPickSetCounterModeExcludeTypes(int upID, int[] types)
    Sets the exclude types that will be used for the query to determine if we should enter counter mode or not for the provided upID.
    void
    kbUnitPickSetEnemyPlayerID(int upID, int playerID)
    Sets the upID's enemy player ID, -1 is allowed to reset the playerID.
    void
    kbUnitPickSetMinimumCounterModeNumberUnits(int upID, int numberUnits)
    Sets the minimum number of enemy units that have to be visible (not seeable only) to turn on counter mode for the provided upID.Can be used together with kbUnitPickSetMinimumCounterModePop, if one of the two is true we will enter counter mode.
    void
    Sets the minimum total pop count of enemy units that have to be visible (not seeable only) to turn on counter enemy mode for the provided upID.
    void
    kbUnitPickSetMovementType(int upID, int movementType)
    Set this before you call kbUnitPickSetPreferenceFactor.
    boolean
    kbUnitPickSetPreferenceFactor(int upID, int unitTypeID, float preferenceFactor)
    Use kbUnitPickSetMovementType first or all units will be filtered away because the movementType is invalid.
    void
    kbUnitPickSetPreferenceWeight(int upID, float weight)
    Sets the provided upID's Preference weight.
    int
    Creates a unit query with the provided name, returns the query ID.
    void
    kbUnitQueryDestroy(int queryID)
    Destroys the provided queryID.
    int
    kbUnitQueryExecute(int queryID)
    Executes the provided queryID (using the query data) and returns the number of units found.
    int
    kbUnitQueryExecuteOnQuery(int currentQueryID, int previousQueryID)
    Executes the provided queryID (using the query data) on the other query and returns the number of units found.
    int
    Returns the number of pop slots currently occupied by the results in the provided queryID.
    float
    kbUnitQueryGetPower(int queryID, boolean ignoreCurrentHealth)
    Returns a power rating for the results in the provided queryID.
    int
    kbUnitQueryGetResult(int queryID, int index)
    Returns the unitID at the provided index of the provided queryID.
    int[]
    kbUnitQueryGetResults(int queryID)
    Returns all unitIDs in the provided queryID.
    float
    kbUnitQueryGetSiegePower(int queryID, boolean ignoreCurrentHealth)
    Returns a siege power rating for the results in the provided queryID.
    float
    kbUnitQueryGetUnitAICost(int queryID, boolean considerHealth)
    Returns the total aiCost of the found units inside the provided queryID.
    float
    kbUnitQueryGetUnitCost(int queryID, boolean considerHealth)
    Returns the total cost of the found units inside the provided queryID.
    float
    kbUnitQueryGetUnitHitpoints(int queryID, boolean considerHealth)
    Returns the total maximum hitpoints of the found units inside the provided queryID.
    int
    Returns the number of results of the provided queryID.
    void
    kbUnitQueryResetData(int queryID)
    Resets the provided queryID's data AND results.
    void
    Resets the provided queryID's results.
    void
    kbUnitQuerySetActionType(int queryID, int actionTypeID)
    Query Data: Sets what action type the units must be performing to be valid for the provided queryID.
    void
    kbUnitQuerySetAreaGroupID(int queryID, int areaGroupID)
    Query Data: Sets what areaGroupID the unit must be in to be valid for the provided queryID.
    void
    kbUnitQuerySetAreaID(int queryID, int areaID)
    Query Data: Sets what areaID the unit must be in to be valid for the provided queryID.
    void
    kbUnitQuerySetArmyID(int queryID, int armyID)
    Query Data: Sets what armyID the unit must be in to be valid for the provided queryID.
    void
    kbUnitQuerySetAscendingSort(int queryID, boolean value)
    Query Data: Sets if the provided queryID will sort its results from closest to furthest in relation to the position.
    void
    kbUnitQuerySetBaseID(int queryID, int baseID)
    Query Data: Sets what base the unit must be in to be valid for the provided queryID.
    void
    kbUnitQuerySetConnectedAreaGroupID(int queryID, int areaGroupID, int movementType)
    Query Data: Sets what areaGroupID the unit's areaGroupID must be connected to via the provided movementType for the provided queryID.
    void
    kbUnitQuerySetExcludeTypes(int queryID, int[] types)
    Query Data: Sets what unit types the provided queryID will skip.
    void
    kbUnitQuerySetIgnoreKnockedOutUnits(int queryID, boolean value)
    Query Data: Sets if the provided queryID will count knocked out units or not.
    void
    kbUnitQuerySetIgnorePlayersThatHaveLost(int queryID, boolean value)
    Query Data: Sets if the provided queryID will include players that have lost or not.
    void
    kbUnitQuerySetMaxCreationTime(int queryID, int time, boolean inclusive)
    Query Data: Sets maximum creation time, in game time milliseconds, for unit to be considered valid for the provided queryID.
    void
    kbUnitQuerySetMaximumDistance(int queryID, float distance)
    Query Data: Sets the maximum distance from the position the provided queryID will search in, it's a circular radius.
    void
    kbUnitQuerySetMinCreationTime(int queryID, int time, boolean inclusive)
    Query Data: Sets minimum creation time, in game time milliseconds, for a unit to be considered valid for the provided queryID.
    void
    kbUnitQuerySetPlayerID(int queryID, int playerID, boolean resetQueryData)
    Query Data: Sets the playerID whose units we will search for on the provided queryID.
    void
    kbUnitQuerySetPlayerRelation(int queryID, int relation, boolean resetQueryData)
    Query Data: Sets the player relation we will search for on the provided queryID.
    void
    kbUnitQuerySetPosition(int queryID, Vector position)
    Query Data: Sets from what position we will begin searching on the provided queryID.
    void
    kbUnitQuerySetState(int queryID, int v)
    Query Data: Sets what unit state we will search for on the provided queryID.
    void
    kbUnitQuerySetUnitType(int queryID, int unitType)
    Query Data: Set what unitType we will search for on the provided queryID.
    void
    kbUnitQuerySetVisibleState(int queryID, int state)
    Query Data: sets the state in relation to LOS for what units are considered valid for the provided queryID.
    float
    kbUnitsGetPower(int[] unitIDs, boolean ignoreCurrentHealth)
    Returns a power rating for the units in the provided unitIDs array.
    float
    kbUnitsGetSiegePower(int[] unitIDs, boolean ignoreCurrentHealth)
    Returns a siege power rating for the units in the provided unitIDs array.
    int
    kbUnitTypeCount(String unitTypeName, int player, int stateID, boolean excludeKnockedoutUnits)
    Returns a quick unit count of units for a player.
    int
    kbUnitTypeCountInArea(String unitTypeName, int player, int stateID, int centerUnitID, float radius)
    Returns a quick unit count of units for a player, within the vicinity of the given center unit.
    kbUnitTypeGetName(int unitTypeID)
    Returns the name of the provided unitTypeID.
    boolean
    kbUnitVisible(int unitID)
    Returns if the provided unitID is currently visible.
    float
    log(float x)
    Returns the natural logarithm of x.
    float
    log10(float x)
    Returns the common logarithm of x.
    float
    log2(float x)
    Returns the binary logarithm of x.
    float
    max(float a, float b)
    Returns the larger of the two values as a float.
    float
    min(float a, float b)
    Returns the smaller of the two values as a float.
    float
    pow(float x, float y)
    Returns the y-th power of x (x^y).
    float
    radToDeg(float radians)
    Converts an angle from radians to degrees.
    boolean
    rmAddClosestLocConstraint(int constraintID, float bufferDist)
    Adds a constraint to the closest point finder, optionally extending (or shrinking) it by the given buffer.
    boolean
    rmAddGlobalHeightNoise(int noiseType, float amplitude, float baseFrequency, int numOctaves, float persistence)
    Adds height noise to the entire map (much faster than a global area would).
    boolean
    rmAddPlayerResource(int playerID, int resourceID, float amount)
    Adds to the specified resource of one player.
    boolean
    Adds a point to the line to place players on.
    boolean
    rmAreaAddCliffEdgeConstraint(int areaID, int typeID, int constraintID, float bufferDist)
    Converts a cliff edge tile to the provided type if all constraints for that type pass (otherwise the default type is used).
    boolean
    rmAreaAddCliffOuterLayerConstraint(int areaID, int constraintID, float bufferDist)
    Adds a constraint that the outer cliff layers have to satisfy to get painted.
    boolean
    rmAreaAddCliffRampAtAngle(int areaID, float fraction, float angle)
    Adds a ramp to the cliff centered at the given angle with the given fraction of the cliff area circumference.
    boolean
    rmAreaAddConstraint(int areaID, int constraintID, float minBufferDist, float maxBufferDist)
    Adds the specified constraint to the area.
    boolean
    rmAreaAddForestConstraint(int areaID, int constraintID, float bufferDist)
    Adds a constraint that a tile must pass for forest to be painted in this area.
    int
    rmAreaAddHeightBlend(int areaID, int blendType, int filterID, int expansionTiles, int numPasses, boolean incrementalExpansion, boolean blendAfterPaint)
    Adds blending parameters that define how smoothly area height blends into its surroundings.
    boolean
    rmAreaAddHeightBlendConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
    Adds a constraint to the height blend with the given index to an area.
    boolean
    rmAreaAddHeightBlendExpansionConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
    Adds a constraint to the height blend with the given index to an area that will be used when blending with tiles reached by expanding.
    boolean
    rmAreaAddHeightConstraint(int areaDefID, int constraintID, float bufferDist)
    Adds the specified constraint to the area's height constraints, ignoring tiles that do not pass all constraints when setting the height.
    boolean
    rmAreaAddInfluencePoint(int areaID, Vector loc)
    Adds an influence point for an area to grow towards.
    boolean
    rmAreaAddInfluenceSegment(int areaID, Vector startLoc, Vector endLoc)
    Adds an influence segment for an area to expand within/towards.
    boolean
    rmAreaAddOriginConstraint(int areaID, int constraintID, float bufferDist)
    Adds the specified constraint to the area's origin (the first tile the area grows from).
    boolean
    rmAreaAddRemoveType(int areaID, int typeID)
    Adds a unit type to remove from tiles that lie inside the area.
    boolean
    rmAreaAddTerrainConstraint(int areaID, int constraintID, float bufferDist)
    Adds a constraint that a tile must pass for forest to be painted in this area.
    boolean
    rmAreaAddTerrainLayer(int areaID, int terrainID, int minTileDistance, int maxTileDistance)
    Adds a terrain layer to an area.
    boolean
    rmAreaAddTerrainMixLayer(int areaID, int mixID, int minTileDistance, int maxTileDistance)
    Adds a terrain layer to an area.
    boolean
    rmAreaAddTerrainReplacement(int areaID, int terrainID, int newTerrainID)
    Adds a terrain replacement rule to the area.
    boolean
    rmAreaAddToClass(int areaID, int classID)
    Adds an area to the given class.
    boolean
    rmAreaBuild(int areaID, boolean doPaint, boolean warnIfBuilt)
    Builds the specified area, returning true if the minimum number of tiles has been reached.
    int[]
    rmAreaBuildAll(boolean doPaint, boolean buildConcurrently)
    Builds all unbuilt areas, returning an array of the IDs of all areas processed.
    int
    rmAreaBuildMany(int[] areaIDs, boolean doPaint, boolean buildConcurrently, boolean warnIfBuilt)
    Builds the given areas.
    int
    Creates a new area.
    boolean
    rmAreaDefAddCliffEdgeConstraint(int areaDefID, int typeID, int constraintID, float bufferDist)
    Converts a cliff edge tile to the provided type if all constraints for that type pass (otherwise the default type is used).
    boolean
    rmAreaDefAddCliffOuterLayerConstraint(int areaDefID, int constraintID, float bufferDist)
    Adds a constraint that the outer cliff layers have to satisfy to get painted.
    boolean
    rmAreaDefAddCliffRampAtAngle(int areaDefID, float fraction, float angle)
    Adds a ramp to the cliff centered at the given angle with the given fraction of the cliff area circumference.
    boolean
    rmAreaDefAddConstraint(int areaDefID, int constraintID, float minBufferDist, float maxBufferDist)
    Adds the specified constraint to the area definition.
    boolean
    rmAreaDefAddForestConstraint(int areaDefID, int constraintID, float bufferDist)
    Adds a constraint that a tile must pass for terrain to be painted in this area.
    int
    rmAreaDefAddHeightBlend(int areaID, int blendType, int filterID, int expansionTiles, int numPasses, boolean incrementalExpansion, boolean blendBeforePaint)
    Adds blending parameters that define how smoothly area height blends into its surroundings.
    boolean
    rmAreaDefAddHeightBlendConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
    Adds a constraint to the height blend with the given index to an area def.
    boolean
    rmAreaDefAddHeightBlendExpansionConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
    Adds a constraint to the height blend with the given index to an area that will be used when blending with tiles reached by expanding.
    boolean
    rmAreaDefAddHeightConstraint(int areaDefID, int constraintID, float bufferDist)
    Adds the specified constraint to the area's height constraints, ignoring tiles that do not pass all constraints when setting the height.
    boolean
    rmAreaDefAddInfluencePoint(int areaDefID, Vector loc)
    Adds an influence point for an area definition to grow towards.
    boolean
    rmAreaDefAddInfluenceSegment(int areaDefID, Vector startLoc, Vector endLoc)
    Adds an influence segment for an area definition to expand within/towards.
    boolean
    rmAreaDefAddOriginConstraint(int areaDefID, int constraintID, float bufferDist)
    Adds the specified constraint to the area's origin (the first tile the area grows from) for the given area definition.
    boolean
    rmAreaDefAddRemoveType(int areaDefID, int typeID)
    Adds a unit type to remove from tiles that lie inside areas of the given definition.
    boolean
    rmAreaDefAddTerrainConstraint(int areaDefID, int constraintID, float bufferDist)
    Adds a constraint that a tile must pass for terrain to be painted in this area.
    boolean
    rmAreaDefAddTerrainLayer(int areaDefID, int terrainID, int minTileDistance, int maxTileDistance)
    Adds a terrain layer to an area definition.
    boolean
    rmAreaDefAddTerrainMixLayer(int areaDefID, int mixID, int minTileDistance, int maxTileDistance)
    Adds a terrain layer to an area definition.
    boolean
    rmAreaDefAddTerrainReplacement(int areaDefID, int terrainID, int newTerrainID)
    Adds a terrain replacement rule to the area definition.
    boolean
    rmAreaDefAddToClass(int areaDefID, int classID)
    Adds areas created from an area definition to the given class.
    int
    Creates a new area definition.
    int[]
    rmAreaDefCreateAndBuildAreas(int areaDefID, int numAreas, boolean doPaint, boolean buildConcurrently)
    Creates multiple areas from an area definiton and builds them.
    int
    rmAreaDefCreateArea(int areaDefID, String nameOverride)
    Creates an area from an area definiton.
    int[]
    rmAreaDefCreateAreas(int areaDefID, int numAreas, String nameOverride)
    Creates multiple areas from an area definiton.
    int
    rmAreaDefGetCreatedArea(int areaDefID, int index)
    Gets the ID of the i-th area created by this area definition.
    int[]
    rmAreaDefGetCreatedAreas(int areaDefID)
    Gets all area IDs created by this area definition.
    int
    Gets the area definition ID for a given area definiton name.
    rmAreaDefGetName(int areaDefID)
    Gets the name for a given area definition ID.
    int
    Gets the number of areas created by this area definition.
    int
    rmAreaDefGetOwnerID(int areaID)
    Gets the owner ID for areas created by this area def, can be used to identify after placement for which player the area was intended for.
    int
    Gets the owner index for areas created by this area def, can be used to identify after placement for which player the area was intended for.
    boolean
    rmAreaDefSetAvoidSelfDistance(int areaDefID, float distance, float bufferDistance)
    Sets the distance that all areas created by this definition should avoid each other by.
    boolean
    rmAreaDefSetBlobDistance(int areaDefID, float minDist, float maxDist)
    Sets the minimum and maximum distance blobs can be from the center of areas from a definition.
    boolean
    rmAreaDefSetBlobs(int areaDefID, int minBlobs, int maxBlobs)
    Sets the minimum and maximum number of blobs for an area definition.
    boolean
    rmAreaDefSetCliffEmbellishmentDensity(int areaDefID, float density)
    Sets the embellishment density for all cliff layers.
    boolean
    rmAreaDefSetCliffLayerEmbellishmentDensity(int areaDefID, int layer, float density)
    Sets the embellishment density for the specified cliff layer.
    boolean
    rmAreaDefSetCliffLayerPaint(int areaDefID, int layer, boolean doPaint)
    Sets whether or not to paint the given cliff layer.
    boolean
    rmAreaDefSetCliffPaintInsideAsSide(int areaDefID, boolean paintTopAsSide)
    If set, the inside of a cliff will be painted with side terrain instead.
    boolean
    rmAreaDefSetCliffRamps(int areaDefID, int count, float size, float variance, float spacing, float angle)
    Adds ramps with the given size, variance, and spacing centering around the given angle to the cliff.
    boolean
    rmAreaDefSetCliffRampSteepness(int areaDefID, float rampSteepness)
    Sets an area definition's cliff ramp steepness.
    boolean
    rmAreaDefSetCliffSideRadius(int areaDefID, int innerRadius, int outerRadius)
    Sets the inner and outer radius in tiles to consider as cliff edge for an area definition (extending the area outwards if necessary, ignoring any constraints).
    boolean
    rmAreaDefSetCliffSideSheernessThreshold(int areaDefID, float sheernessAngleThresh)
    Sets the minimum slope (angle in radians) a cliff side tile must have to be considered as a sheer tile instead (radians within [0, PI/2]).
    boolean
    rmAreaDefSetCliffType(int areaDefID, int cliffID)
    Sets the cliff type for an area definition.
    boolean
    rmAreaDefSetCoherence(int areaDefID, float coherence, float minDistThresh)
    Sets the area definition coherence between 0.0 (randomly) and 1.0 (circular).
    boolean
    rmAreaDefSetCoherenceSquare(int areaDefID, boolean useSquareCoherence)
    Uses square instead of circular coherence, making areas grow as a square instead of a circle.
    boolean
    rmAreaDefSetConstraintBuffer(int areaDefID, float minBufferDist, float maxBufferDist)
    Sets an override for the min/max constraint buffers in meters for the given area definition.
    boolean
    rmAreaDefSetEdgePerturbDistance(int areaDefID, float minPerturbDistanceMeters, float maxPerturbDistanceMeters, boolean perturbOnMapEdge)
    Sets an area definition's edge perturbance distance in meters.
    boolean
    rmAreaDefSetEdgeSmoothDistance(int areaDefID, int smoothDistance, boolean smoothOnMapEdge)
    Sets an area definition's edge smoothing distance.
    boolean
    rmAreaDefSetForestTreeDensity(int areaDefID, float density)
    Sets the probability to place a tree on forest tree tiles in an area definition.
    boolean
    rmAreaDefSetForestType(int areaDefID, int forestID)
    Sets the forest type for an area definition.
    boolean
    rmAreaDefSetForestUnderbrushDensity(int areaDefID, float frequency)
    Sets the probability to place underbrush on forest underbrush tiles in an area definition.
    boolean
    rmAreaDefSetHeight(int areaDefID, float height)
    Sets the height for an area definition.
    boolean
    rmAreaDefSetHeightFactors(int areaDefID, float oneTileFactor, float twoTilesFactor, float threeTilesFactor, float fourTilesFactor)
    Defines the factor to apply to the height of each cliff tile vertex depending on how many cliff tiles the vertex is part of.
    boolean
    rmAreaDefSetHeightNoise(int areaID, int type, float amplitude, float baseFrequency, int octaves, float persistence)
    Adds height noise to the area.
    boolean
    rmAreaDefSetHeightNoiseBias(int areaDefID, float bias)
    Sets the area definition's elevation variation noise bias (-1 means down only, 0 means down and up equally, 1 means up only).
    boolean
    rmAreaDefSetHeightNoiseEdgeFalloffDist(int areaDefID, float dist)
    Sets the area definition's elevation noise to falloff as it gets closer to the area's edge.
    boolean
    rmAreaDefSetHeightRelative(int areaDefID, float height)
    Sets the relative height for an area definition.
    boolean
    rmAreaDefSetLoc(int areaDefID, Vector loc)
    Sets the area location for an area definition.
    boolean
    rmAreaDefSetLocPlayer(int areaDefID, int playerID, int playerLocIndex)
    Sets the area location to a player's location for an area definition.
    boolean
    rmAreaDefSetLocTeam(int areaDefID, int teamID)
    Sets the area location to a team's location for an area definition.
    boolean
    rmAreaDefSetMix(int areaDefID, int mixID)
    Sets the mix for an area definition, overriding the terrain type if set.
    boolean
    rmAreaDefSetOriginConstraintBuffer(int areaDefID, float bufferDist)
    Sets an override for the origin constraint buffer in meters for the given area definition.
    boolean
    rmAreaDefSetOwnerID(int areaID, int ownerID, int ownerIndex)
    Sets the owner ID for areas created by this area def, can be used to identify after placement for which player the area was intended for.
    boolean
    rmAreaDefSetParent(int areaDefID, int parentAreaID)
    Sets an area's parent area to which the areas from this def are restricted to.
    boolean
    rmAreaDefSetPath(int areaDefID, int pathID, float minWidthMeters, float extraWidthMeters)
    Sets an area derived from an area def to follow a previously built path.
    boolean
    rmAreaDefSetPathSegment(int areaDefID, int pathID, int segmentIdx, float minWidthMeters, float extraWidthMeters)
    Sets an area derived from an area def to follow a segment (between two waypoints) of a previously built path.
    boolean
    rmAreaDefSetReveal(int areaDefID, int tiles)
    Sets areas created from the given area definition to be revealed (-1 means don't reveal, 0 means reveal, >0 means reveal plus that number of extra tiles.
    boolean
    rmAreaDefSetSize(int areaDefID, float fraction, float minSuccessFraction)
    Sets the size of an area derived from an area definition as a fraction of the total map and allows to specify a minimum fraction that is required for the area to be reached to be marked as built successfully when building it.
    boolean
    rmAreaDefSetSizeRange(int areaDefID, float minFraction, float maxFraction, float minSuccessFraction)
    Sets the size of areas derived from an area def, randomizing between the provided fraction.
    boolean
    rmAreaDefSetSizeTiles(int areaDefID, int minTiles, int minSuccessTiles)
    Sets the size for an area derived from an area definition in tiles and allows to specify a minimum number of tiles that are required for the area to be marked as built successfully when building it.
    boolean
    rmAreaDefSetSizeTilesRange(int areaDefID, int minTiles, int maxTiles, int minSuccessTiles)
    Sets the size of an area derived from an area def in tiles, randomizing between the provided tile counts.
    boolean
    rmAreaDefSetTerrainType(int areaDefID, int terrainID)
    Sets the terrain type for an area definition.
    boolean
    rmAreaDefSetWarnOnBuildFailure(int areaDefID, int minAcceptedState)
    Makes the debugger break with a warning if an area derived from this area def does not reach at least the specified build state (failed -> incomplete -> complete).
    boolean
    rmAreaDefSetWaterDepth(int areaDefID, float depth)
    Sets the water depth to be used (> 0.0f) for the water painted by this area def.
    boolean
    rmAreaDefSetWaterEdgeHeight(int areaDefID, float height, float bufferDistance)
    Sets the height of the land around the water painted by this area def (applied before the height blend).
    boolean
    rmAreaDefSetWaterHeight(int areaDefID, float height, int heightType)
    Sets the level up to which water will be painted for the area def.
    boolean
    rmAreaDefSetWaterHeightBlend(int areaDefID, int filterID, float smoothDistance, int numPasses)
    Sets the height blend to be applied at the edge of the water painted by this area def up to a given distance away from the edge.
    boolean
    rmAreaDefSetWaterPaintTerrain(int areaDefID, boolean paintEdges)
    If set to true, the water edge terrain (beaches/shores) will be painted for water painted by this area def.
    boolean
    rmAreaDefSetWaterType(int areaDefID, int waterID)
    Sets the water type for an area definition.
    boolean
    rmAreaFindOriginLoc(int areaID)
    (Re-)randomizes the area's origin tile, returning true if one has been found successfully and false otherwise.
    boolean
    rmAreaFindOriginLocClosestToLoc(int areaID, Vector loc, float maxDistMeters)
    (Re-)randomizes the area's origin tile, trying to find the tile that is closest to the provided location while still satisfying the (origin) constraints.
    boolean
    rmAreaFindOriginLocFurthestFromLoc(int areaID, Vector loc, float maxDistMeters)
    (Re-)randomizes the area's origin tile, trying to find the tile that is furthest from the provided location while still satisfying the (origin) constraints.
    int
    rmAreaGetBuildState(int areaID)
    Gets the build state of an area (not started, failed, incomplete, success).
    rmAreaGetClosestLoc(int areaID, Vector loc, int[] constraintIDs)
    Returns the loc fraction of the tile of an area that's closest to the given loc, optionally requiring that it passes the given constraints.
    int
    Gets the area ID for a given area name.
    rmAreaGetLoc(int areaID)
    Gets the fractions of a an area's (origin) location.
    rmAreaGetName(int areaID)
    Gets the name for a given area ID.
    int
    rmAreaGetOwnerID(int areaID)
    Gets the owner ID for this area, can be used to identify after placement for which player the area was intended for.
    int
    rmAreaGetOwnerIndex(int areaID)
    Gets the owner Index for this area, can be used to identify after placement for which player the area was intended for.
    int
    rmAreaGetTileCount(int areaID)
    Gets the number of tiles of a built area.
    rmAreaGetTiles(int areaID, int type, int[] constraints)
    Returns the tiles of an area as an array of vectors of tile coordinates (not meters).
    boolean
    rmAreaPaint(int areaID, boolean warnOnError)
    Paints the specified area (must be built first).
    int[]
    Paints all unpainted (but built) areas.
    int
    rmAreaPaintMany(int[] areaIDs, boolean warnOnError)
    Paints the given areas (must be built first).
    boolean
    rmAreaSetBlobDistance(int areaID, float minDist, float maxDist)
    Sets the minimum and maximum distance blobs can be from the center of an area.
    boolean
    rmAreaSetBlobs(int areaID, int minBlobs, int maxBlobs)
    Sets the minimum and maximum number of blobs for an area.
    boolean
    rmAreaSetCliffEmbellishmentDensity(int areaID, float density)
    Sets the embellishment density for all cliff layers.
    boolean
    rmAreaSetCliffLayerEmbellishmentDensity(int areaID, int layer, float density)
    Sets the embellishment density for the specified cliff layer.
    boolean
    rmAreaSetCliffLayerPaint(int areaID, int layer, boolean doPaint)
    Sets whether or not to paint the given cliff layer.
    boolean
    rmAreaSetCliffPaintInsideAsSide(int areaID, boolean paintTopAsSide)
    If set, the inside of a cliff will be painted with side terrain instead.
    boolean
    rmAreaSetCliffRamps(int areaID, int count, float size, float variance, float spacing, float angle)
    Adds ramps with the given size, variance, and spacing centering around the given angle to the cliff.
    boolean
    rmAreaSetCliffRampSteepness(int areaID, float rampSteepness)
    Sets an area's cliff ramp steepness.
    boolean
    rmAreaSetCliffSideRadius(int areaID, int innerRadius, int outerRadius)
    Sets the inner and outer radius in tiles to consider as cliff edge for an area (extending the area outwards if necessary, ignoring any constraints).
    boolean
    rmAreaSetCliffSideSheernessThreshold(int areaID, float sheernessAngleThresh)
    Sets the minimum slope (angle in radians) a cliff side tile must have to be considered as a sheer tile instead (radians within [0, PI/2]).
    boolean
    rmAreaSetCliffType(int areaID, int cliffID)
    Sets the cliff type for an area.
    boolean
    rmAreaSetCoherence(int areaID, float coherence, float minDistThresh)
    Sets the area coherence between 0.0 (randomly) and 1.0 (circular).
    boolean
    rmAreaSetCoherenceSquare(int areaID, boolean useSquareCoherence)
    Uses square instead of circular coherence, making areas grow as a square instead of a circle.
    boolean
    rmAreaSetConstraintBuffer(int areaID, float minBufferDist, float maxBufferDist)
    Sets an override for the min/max constraint buffers in meters for the given area.
    boolean
    rmAreaSetEdgePerturbDistance(int areaID, float minPerturbDistanceMeters, float maxPerturbDistanceMeters, boolean perturbOnMapEdge)
    Sets an area's edge perturbance distance.
    boolean
    rmAreaSetEdgeSmoothDistance(int areaID, int smoothDistance, boolean smoothOnMapEdge)
    Sets an area's edge smoothing distance.
    boolean
    rmAreaSetFailed(int areaID)
    Marks an area as failed if building has not started yet, meaning it cannot be built anymore and will not be considered by rmAreaBuildAll().
    boolean
    rmAreaSetForestTreeDensity(int areaID, float density)
    Sets the probability to place a tree on forest tree tiles in an area.
    boolean
    rmAreaSetForestType(int areaID, int forestID)
    Sets the forest type for an area.
    boolean
    rmAreaSetForestUnderbrushDensity(int areaID, float frequency)
    Sets the probability to place underbrush on forest underbrush tiles in an area.
    boolean
    rmAreaSetHeight(int areaID, float height)
    Sets the height for an area.
    boolean
    rmAreaSetHeightFactors(int areaID, float oneTileFactor, float twoTilesFactor, float threeTilesFactor, float fourTilesFactor)
    Defines the factor to apply to the height of each tile vertex depending on how many tiles the vertex is part of.
    boolean
    rmAreaSetHeightNoise(int areaID, int type, float amplitude, float baseFrequency, int octaves, float persistence)
    Adds height noise to the area.
    boolean
    rmAreaSetHeightNoiseBias(int areaID, float bias)
    Sets the area's elevation variation noise bias (-1 means down only, 0 means down and up equally, 1 means up only).
    boolean
    rmAreaSetHeightNoiseEdgeFalloffDist(int areaID, float dist)
    Sets the area's elevation noise to falloff as it gets closer to the area's edge.
    boolean
    rmAreaSetHeightRelative(int areaID, float height)
    Sets the relative height for an area.
    boolean
    rmAreaSetLoc(int areaID, Vector loc)
    Sets the area location.
    boolean
    rmAreaSetLocPlayer(int areaID, int playerID, int playerLocIndex)
    Sets the area location to a player's location.
    boolean
    rmAreaSetLocTeam(int areaID, int teamID)
    Sets the area location to a team's location.
    boolean
    rmAreaSetMix(int areaID, int mixID)
    Sets the mix for an area, overriding the terrain type if set.
    boolean
    rmAreaSetOriginConstraintBuffer(int areaID, float bufferDist)
    Sets an override for the origin constraint buffer in meters for the given area.
    boolean
    rmAreaSetOwnerID(int areaID, int ownerID, int ownerIndex)
    Sets the owner ID for this area, can be used to identify after placement for which player the area was intended for.
    boolean
    rmAreaSetPainted(int areaID)
    Marks an area as painted, meaning it cannot be painted and will not be considered by rmAreaBuildAll() or rmAreaPaintAll().
    boolean
    rmAreaSetParent(int areaID, int parentAreaID)
    Sets an area's parent area to which the area is restricted to.
    boolean
    rmAreaSetPath(int areaID, int pathID, float minWidthMeters, float extraWidthMeters)
    Sets an area to follow a previously built path.
    boolean
    rmAreaSetPathSegment(int areaID, int pathID, int segmentIdx, float minWidthMeters, float extraWidthMeters)
    Sets an area to follow a segment (between two waypoints) of a previously built path.
    boolean
    rmAreaSetReveal(int areaID, int tiles)
    Sets the area to be revealed (-1 means don't reveal, 0 means reveal, >0 means reveal plus that number of extra tiles.
    boolean
    rmAreaSetSize(int areaID, float minFraction, float minSuccessFraction)
    Sets the size of an area as a fraction of the total map and allows to specify a minimum fraction that is required for the area to be reached to be marked as built successfully when building it.
    boolean
    rmAreaSetSizeRange(int areaID, float minFraction, float maxFraction, float minSuccessFraction)
    Sets the size of an area as a fraction, randomizing between the provided fraction.
    boolean
    rmAreaSetSizeTiles(int areaID, int minTiles, int minSuccessTiles)
    Sets the size of an area in tiles and allows to specify a minimum number of tiles that are required for the area to be marked as built successfully when building it.
    boolean
    rmAreaSetSizeTilesRange(int areaID, int minTiles, int maxTiles, int minSuccessTiles)
    Sets the size of an area in tiles, randomizing between the provided tile counts.
    boolean
    rmAreaSetTerrainType(int areaID, int terrainID)
    Sets the terrain type for an area.
    boolean
    rmAreaSetWarnOnBuildFailure(int areaID, int minAcceptedState)
    Makes the debugger break with a warning if the area does not reach at least the specified build state (failed -> incomplete -> complete).
    boolean
    rmAreaSetWaterDepth(int areaID, float depth)
    Sets the water depth to be used (> 0.0f) for the water painted by this area.
    boolean
    rmAreaSetWaterEdgeHeight(int areaID, float height, float bufferDistance)
    Sets the height of the land around the water painted by this area (applied before the height blend).
    boolean
    rmAreaSetWaterHeight(int areaID, float height, int heightType)
    Sets the level up to which water will be painted for the area.
    boolean
    rmAreaSetWaterHeightBlend(int areaID, int filterID, float smoothDistance, int numPasses)
    Sets the height blend to be applied at the edge of the water painted by this area up to a given distance away from the edge.
    boolean
    rmAreaSetWaterPaintTerrain(int areaID, boolean paintEdges)
    If set to true, the water edge terrain (beaches/shores) will be painted for water painted by this area.
    boolean
    rmAreaSetWaterType(int areaID, int waterID)
    Sets the water type for an area.
    int
    rmCameraTrackAddWaypoint(int trackIdx, Vector position, Vector forward, Vector up, Vector right, float fov)
    Adds the provided camera position as a waypoint to the given track index.
    int
    rmCameraTrackCreate(String trackName, float durationMs)
    Adds a camera track.
    void
    rmCameraTrackWaypointSetBias(int trackIdx, int waypointIdx, float bias)
    Sets the bias for a provided waypoint index in the given track index.
    void
    rmCameraTrackWaypointSetContinuity(int trackIdx, int waypointIdx, float continuity)
    Sets the continuity for a provided waypoint index in the given track index.
    void
    rmCameraTrackWaypointSetTension(int trackIdx, int waypointIdx, float tension)
    Sets the tension for a provided waypoint index in the given track index.
    void
    rmCameraTrackWaypointSetTime(int trackIdx, int waypointIdx, float timeMs)
    Sets the time for a provided waypoint index in the given track index.
    int
    Defines a new class with the given name.
    int
    Defines a new class with the given name.
    int[]
    rmClassGetAreas(int classID)
    Returns the area IDs that have been added to this class.
    int
    Gets the class ID for a given class name.
    int
    rmClassGetNumberAreas(int classID)
    Returns the number of areas (no defs) that have been added to this class.
    int
    Returns the number of tiles all areas in this class span across the entire map.
    int
    Returns the number of objects (no defs) that have been added to this class.
    int
    rmClassGetNumberPaths(int classID)
    Returns the number of paths (no defs) that have been added to this class.
    int[]
    rmClassGetObjects(int classID)
    Returns the object IDs that have been added to this class.
    int[]
    rmClassGetPaths(int classID)
    Returns the path IDs that have been added to this class.
    void
    Clears the constraints for the closest loc finder.
    int[]
    Computes the players that would get placed with the current player placement if this was a placement call.
    int
    rmCreateAreaConstraint(int areaID, String name)
    Creates a constraint to force something to remain within an area.
    int
    rmCreateAreaDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area at least by the given distance.
    int
    Creates a constraint to make something remain within an area's edge.
    int
    rmCreateAreaEdgeDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area's edge by at least the given distance.
    int
    rmCreateAreaEdgeMaxDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area's edge by no more than the given distance.
    int
    rmCreateAreaMaxDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area by no more than the given distance.
    int
    rmCreateBoxConstraint(Vector startLoc, Vector endLoc, String name)
    Creates a constraint to remain within the specified box.
    int
    rmCreateBoxDistanceConstraint(Vector startLoc, Vector endLoc, float minDist, String name)
    Creates a constraint to avoid the specified box.
    int
    rmCreateBoxMaxDistanceConstraint(Vector startLoc, Vector endLoc, float maxDist, String name)
    Creates a constraint to remain within the specified distance to a square or rectangle.
    int
    rmCreateCircularConstraint(Vector loc, float radiusMeters, float minAngle, float maxAngle, boolean inverted, String name)
    Creates a circular area to avoid.
    int
    rmCreateClassDistanceConstraint(int classID, float distance, int areaDistFunType, String name)
    Creates a constraint to avoid elements of a given class by a distance.
    int
    rmCreateClassMaxDistanceConstraint(int classID, float distance, int areaDistFunType, String name)
    Creates a constraint to remain within the specified distance to elements of a given class.
    int
    Creates a constraint to make something remain within an area's cliff ramp edge.
    int
    rmCreateCliffRampDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area's cliff edge by at least the given distance.
    int
    rmCreateCliffRampMaxDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area's cliff edge by no more than the given distance.
    int
    Creates a constraint to make something remain within an area's cliff edge.
    int
    rmCreateCliffSideDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area's cliff edge by at least the given distance.
    int
    rmCreateCliffSideMaxDistanceConstraint(int areaID, float distance, String name)
    Creates a constraint to avoid an area's cliff edge by no more than the given distance.
    int
    rmCreateFlagDistanceConstraint(int flagID, float distance, boolean state, String name)
    Creates a constraint to avoid units with a certain flag by a distance.
    int
    rmCreateFlagMaxDistanceConstraint(int flagID, float distance, boolean state, String name)
    Creates a constraint to remain within the specified distance to units with certain flag.
    int
    rmCreateLocDistanceConstraint(Vector loc, float minDist, String name)
    Creates a constraint that requires valid tiles to avoid a location by at least the given distance.
    int
    rmCreateLocMaxDistanceConstraint(Vector loc, float maxDist, String name)
    Creates a constraint that requires valid tiles to be within a given disance to the specified location.
    int
    rmCreateMaxHeightConstraint(float height, String name)
    Creates a constraint to avoid terrain with height higher than the provided height.
    int
    Creates a constraint to avoid terrain with water deeper than the provided depth.
    int
    rmCreateMinHeightConstraint(float height, String name)
    Creates a constraint to avoid terrain with height lower than the provided height.
    int
    Creates a constraint to avoid terrain with water less deep than the provided depth.
    int
    rmCreateMultiLocDistanceConstraint(Vector[] locs, float minDist, String name)
    Creates a constraint that requires valid tiles to avoid an array of locations by at least the given distance.
    int
    rmCreateMultiLocMaxDistanceConstraint(Vector[] locs, float maxDist, String name)
    Creates a constraint that requires valid tiles to be within a given disance to at least one of the specified locations.
    int
    rmCreatePassabilityDistanceConstraint(int passabilityType, boolean passable, float distance, String name)
    Creates a constraint to avoid terrain with the given passability by more than the specified distance.
    int
    rmCreatePassabilityMaxDistanceConstraint(int passabilityType, boolean passable, float distance, String name)
    Creates a constraint to remain within the specified distance to terrain with the given passability.
    int
    rmCreatePathDistanceConstraint(int pathID, float minDist, String name)
    Creates a constraint to avoid a path by at least a given a distance (in meters).
    int
    rmCreatePathMaxDistanceConstraint(int pathID, float maxDist, String name)
    Creates a constraint to make something remain within a distance (in meters) of a path.
    int
    rmCreateTerrainTypeDistanceConstraint(int terrainID, float minDist, String name)
    Creates a constraint to avoid terrain of the specified type.
    int
    rmCreateTerrainTypeMaxDistanceConstraint(int terrainID, float maxDist, String name)
    Creates a constraint to make something remain within a distance (in meters) of a terrain type.
    int
    rmCreateTileDistanceConstraint(Vector tile, float minDist, String name)
    Creates a constraint to avoid a tile by a distance.
    int
    rmCreateTileMaxDistanceConstraint(Vector tile, float maxDist, String name)
    Creates a constraint to remain within the specified distance of a tile.
    int
    rmCreateTypeDistanceConstraint(int typeID, float distance, boolean state, String name)
    Creates a constraint to avoid units of a certain type by a distance.
    int
    rmCreateTypeMaxDistanceConstraint(int typeID, float distance, boolean state, String name)
    Creates a constraint to remain within the specified distance to units a certain type.
    int
    rmCreateWaterDistanceConstraint(boolean hasWater, float minDist, String name)
    Creates a constraint to avoid terrain that does (not) have water (shallow and impassable).
    int
    rmCreateWaterMaxDistanceConstraint(boolean hasWater, float maxDist, String name)
    Creates a constraint to make something remain within a distance (in meters) of terrain that does (not) have water (shallow and impassable).
    boolean
    rmCustomCliffAddObject(int cliffID, int layerID, int protoID, float weight)
    Adds a proto and assigns a weight when placing it for one layer of a custom cliff.
    boolean
    rmCustomCliffAddObjectToAllLayers(int cliffID, int protoID, float weight)
    Adds a proto and assigns a weight when placing it for a custom cliff.
    int
    Creates a new custom cliff.
    boolean
    rmCustomCliffSetMix(int cliffID, int layerID, int mixID, float objectDensity)
    Sets the cliff mix and object density for one layer of a custom cliff.
    boolean
    rmCustomCliffSetTerrain(int cliffID, int layerID, int terrainID, float objectDensity)
    Sets the cliff terrain and object density for one layer of a custom cliff.
    boolean
    rmCustomForestAddTreeType(int forestID, int protoID, float weight)
    Adds a tree type to randomize from with the given weight to a custom forest.
    boolean
    rmCustomForestAddUnderbrushType(int forestID, int protoID, float weight)
    Adds an underbrush type to randomize from with the given weight to a custom forest.
    int
    Creates a new custom forest.
    boolean
    rmCustomForestSetMix(int forestID, int mixID)
    Sets the floor mix for a custom forest.
    boolean
    rmCustomForestSetParams(int forestID, float treeDensity, float underbrushDensity)
    Sets the tree and underbrush density parameters for a custom forest.
    boolean
    rmCustomForestSetTerrain(int forestID, int terrainTypeID)
    Sets the terrain type for a custom forest.
    boolean
    rmCustomMixAddObjectEntry(int mixID, int protoID, float weight, float scaleMin, float scaleMax)
    Adds a proto object entry for the custom mix with the given ID.
    boolean
    rmCustomMixAddPaintEntry(int mixID, int terrainID, float weight)
    Adds a terrain paint entry for the custom mix with the given ID.
    int
    Creates a new custom mix.
    boolean
    rmCustomMixSetObjectParams(int mixID, float baseWeight)
    Sets the base weight (weight to not place anything) for a custom mix.
    boolean
    rmCustomMixSetPaintParams(int mixID, int mode, float freq, int octaves, float persistence)
    Sets the terrain paint parameters for the custom mix with the given ID.
    void
    rmEchoError(String errorString)
    Prints an error message to the debugger.
    void
    rmEchoInfo(String echoString)
    Prints an info message to the debugger.
    void
    rmEchoWarning(String warningString)
    Prints a warning message to the debugger.
    float
    rmFractionToAreaRadius(float fraction, boolean clamp, boolean warn)
    Calculates the radius of the area that covers the given fraction of the entire map.
    float
    rmFractionToAreaSquareMeters(float fraction, boolean clamp, boolean warn)
    Converts a fraction of the entire map to an area in square meters.
    int
    rmFractionToAreaTiles(float fraction, boolean clamp, boolean warn)
    Converts a fraction of the entire map to a number of tiles.
    rmFractionToMeters(Vector meters, boolean clamp, boolean warn)
    Converts a vector of fractions to a vector in meters.
    rmFractionToTileIndex(Vector fraction, boolean clamp, boolean warn)
    Converts a vector of fractions to the vector of the closest the closest tile.
    void
    Adds a line to the generation log printed to the debugger once generation finishes.
    boolean
    Gets the internal generation result previously set by rmGenerationSetSuccess().
    void
    rmGenerationSetSuccess(boolean success)
    Sets the internal generation result to true (success) or false (failure).
    rmGetClosestLoc(Vector loc, float maxDistance, boolean additiveConstraints)
    Finds the closest loc to another loc, satisfying the previously added constraints.
    int
    Gets the constraint ID for a given constraint name.
    rmGetConstraintName(int constraintID)
    Gets the constraint name for a given constraint ID.
    float
    Returns the area of the map in square meters.
    int
    Returns the total number of tiles.
    float
    Returns the X size of the map in meters.
    int
    Returns the X size of the map in tiles.
    float
    Returns the Z size of the map in meters.
    int
    Returns the Z size of the map in tiles.
    int
    Returns the number of players that have already been placed.
    int
    Gets the number of players that have already placed for the team with the specified ID.
    int
    rmGetNumberPlayerLocs(int playerID)
    Gets the number of starting locations for a player, or the total number of starting locations if -1 is passed (note that Mother Nature always occupies one as well).
    int
    Gets the number of players on the specified team.
    int
    rmGetPlacedPlayer(int index)
    Gets the ID of the player in the specified index based on the placement order.
    int
    rmGetPlacedPlayerOnTeam(int teamID, int index)
    Gets the player in the specified position on the team (in the order of placement).
    int
    rmGetPlayerCiv(int playerID)
    Gets the civilization ID of the specified player.
    int
    rmGetPlayerColorIndex(int playerID)
    Gets the color index of the specified player.
    int
    rmGetPlayerCulture(int playerID)
    Gets the culture ID of the specified player.
    rmGetPlayerLoc(int playerID, int locIdx)
    Gets a player's starting location, or the location at the given index if a player has more than one.
    rmGetPlayerLocByID(int locID)
    Gets the starting location with the given ID.
    int
    rmGetPlayerLocID(int playerID, int locIdx)
    Gets a player's starting location ID, or the ID of the location at the given index if a player has more than one.
    int
    Gets the player ID associated with the starting location of the given ID.
    int
    Gets the index the given starting locaton ID has for a player (0 for the first location of the player, 1 for the second, etc.).
    rmGetPlayerName(int playerID)
    Gets a player's name.
    int
    rmGetPlayerOnTeam(int teamID, int index)
    Gets the player in the specified position on the team (as loaded into the game).
    int
    rmGetPlayerTeam(int playerID)
    Gets the team the specified player is on.
    boolean
    rmInitializeLand(int terrainID, float height)
    Initializes the terrain to the specified type and height.
    boolean
    rmInitializeMix(int mixID, float height)
    Initializes the terrain to the specified mix type and height.
    boolean
    rmInitializeWater(int waterID, float waterLevel, float waterDepth)
    Initializes the terrain to the specified water type, level, and depth (defaults to the depth value from the waterbody file).
    boolean
    rmIsTileAcceptableForConstraint(int constraintID, int tileX, int tileZ, float bufferDist)
    Checks whether a tile is acceptable under a given constraint.
    boolean
    rmLocGenAddAngleRandomizerSectorPriority(int angleRandomizerID, int startIdx, int endIdx, int priority, int incrementType, boolean isAdditive)
    Prioritizes sectors for an angle randomizer.
    boolean
    rmLocGenAddLocBinding(int locID, int otherLocID, float minDist, float maxDist, boolean mutual)
    Binds one loc to another, forcing them to remain within a min/max distance of each other.
    boolean
    rmLocGenAddLocConstraint(int locID, int constraintID, float bufferDist)
    Add a constraint to this loc that possible tiles must respect when randomizing the loc.
    boolean
    rmLocGenApply(boolean buildAreas, boolean paintAreas)
    Places the objects and builds the areas that have been added to locs, to be run after the locations have been generated.
    int
    Creates a new angle randomizer.
    int
    Creates a new loc to generate.
    int
    Creates a new radius randomizer.
    boolean
    Runs the location generator, returning true if all added locs were generated before the maximum number of iterations has been exhausted.
    float
    Returns the fraction of iterations that was performed during the last run of the location generator relative to the maximum number of iterations.
    rmLocGenGetLoc(int locID)
    Returns the actual location (naming is hard) for a generated loc.
    int
    rmLocGenGetLocArea(int locID)
    Returns the area ID for a loc.
    int
    rmLocGenGetLocIDByOwner(int ownerID, int idx)
    Returns the loc ID based on owner ID and index.
    int
    Returns the object ID for a loc.
    int
    Returns the owner ID for a loc ID.
    int
    Returns the index for a loc ID.
    int
    Returns the number of locs that have been added to the generator.
    int
    Returns the number of locs that have been added for an owner.
    float
    Returns the time it took to run rmLocGenGenerate().
    boolean
    Resets the location generator, cleaning out all loc data.
    boolean
    rmLocGenSetArea(int locID, int areaID)
    Sets an area (not a def) to be built at this loc when calling rmLocGenApply() after generating.
    boolean
    rmLocGenSetDistStrictness(float strictnessThresh)
    Sets a threshold (0-1) for a fraction of iterations after which the location generator will start to loosen the set distance for locs to avoid themselves (e.g., 0.1 -> after 10% of the iterations, the generator will start to linearly reduce the avoidance distances).
    boolean
    rmLocGenSetInArea(int locID, int areaID)
    Sets a loc to remain within an area.
    boolean
    rmLocGenSetInAreaID(int locID, int areaID)
    Sets a loc to remain within an area.
    boolean
    rmLocGenSetLocAngleParams(int locID, boolean randomizeSide, boolean rotateClockwise)
    Sets additional angle parameters for a location, i.e., whether to randomize the side (relative to where forward is) of angles randomized for this loc, and whether to subtract the randomized angle from the forward angle instead of adding it.
    boolean
    rmLocGenSetLocAngleRandomizer(int locID, int angleRandomizerID)
    Sets the angle randomizer for this loc.
    boolean
    rmLocGenSetLocAngleVariance(int locID, float angleVar, boolean useMeters)
    Sets an angle variance for this loc, either in radians to be added/subtracted from the randomized angle, or in meters from the randomized angle using the randomized radius (i.e., computing the 2 points on the circle with the randomized radius that are angleVar meters away from the randomized angle).
    boolean
    rmLocGenSetLocAvoidDistance(int locID, float avoidDist)
    Sets the avoidance distance of this loc to all other locs that are being generated.
    boolean
    rmLocGenSetLocForwardAngle(int locID, float forwardAngle)
    Sets the forward angle for a location.
    boolean
    rmLocGenSetLocOrigin(int locID, Vector loc)
    Sets the origin for a loc.
    boolean
    rmLocGenSetLocOwner(int locID, int ownerID, int ownerIndex)
    Sets the owner ID and index (useful if you have multiple player locs) for a loc.
    boolean
    rmLocGenSetLocRadiusRandomizer(int locID, int radiusRandomizerID)
    Sets the radius randomizer for this loc.
    boolean
    rmLocGenSetLocRadiusVariance(int locID, float radiusVar, boolean isAbsolute)
    Sets a radius variance for this loc, either relative to the randomized radius (as a factor between 0 and 1, 0 meaning no variance) or absolute in meters.
    boolean
    rmLocGenSetLocSquarePlacement(int locID, boolean squarePlacement)
    Whether to use square placement instead of circular (the circle will be stretched to a square) for this loc.
    boolean
    rmLocGenSetMaxIterations(int maxIterations)
    Sets the maximum number of iterations the location generator will run for before giving up.
    boolean
    rmLocGenSetObject(int locID, int objectID, boolean placeAsNature)
    Sets an object (not a def) to be placed at this loc when calling rmLocGenApply() after generating.
    boolean
    rmLocGenSetRadiusRandomizerRadius(int radiusRandomizerID, float minRadius, float maxRadius)
    Sets the min/max radius in meters for a radius randomizer.
    rmMetersToFraction(Vector meters, boolean clamp, boolean warn)
    Converts vector of in meters to a vector in fractions.
    rmMetersToTileIndex(Vector meters, boolean clamp, boolean warn)
    Converts a vector of meters to a vector of a tile position (rounded to the closest tile).
    float
    rmMetersToTiles(float meters)
    Converts a length in meters to a length in tiles.
    boolean
    rmMultiplyPlayerResource(int playerID, int resourceID, float factor)
    Multiplys a player's amount of the specified resource by the given factor.
    boolean
    rmObjectAddConstraint(int objectID, int constraintID, int bufferType, float bufferDist)
    Adds the specified constraint to the given object.
    int
    rmObjectAddItem(int objectID, int protoID, int count, float minClusterDist, float maxClusterDist)
    Adds an item by proto ID to the object.
    boolean
    rmObjectAddToClass(int objectID, int classID)
    Adds an object to the given class.
    int
    Creates a new object.
    boolean
    rmObjectDefAddConstraint(int objectDefID, int constraintID, int bufferType, float bufferDist)
    Adds the specified constraint to the given object definition.
    int
    rmObjectDefAddItem(int objectDefID, int protoID, int count, float minClusterDist, float maxClusterDist)
    Adds an item by proto ID to the object definition.
    int
    rmObjectDefAddItemRange(int objectDefID, int protoID, int minCount, int maxCount, float minClusterDist, float maxClusterDist)
    Adds an item by proto ID to the object definition, randomizing between min/max when deriving an object from this definition.
    boolean
    rmObjectDefAddToClass(int objectDefID, int classID)
    Add objects created from an object definition to the given class.
    int
    Creates a new object definition.
    int
    rmObjectDefCreateObject(int objectDef, String name)
    Creates a new object from an object definition.
    int[]
    rmObjectDefCreateObjects(int objectDefID, int numObjects, String nameOverride)
    Creates multiple objects from an object definiton.
    int
    rmObjectDefGetConstraint(int objectDefID, int idx)
    Get the constraint ID at a given index for an object def.
    int
    rmObjectDefGetCreatedObject(int objectDefID, int index)
    Gets the ID of the i-th object created by this object definition.
    int[]
    Gets all object IDs created by this object definition.
    int
    Gets the object definition ID for a given object definition name.
    rmObjectDefGetName(int defID)
    Gets the name for a given object definition ID.
    int
    Get the number of constraints that have been added to an object def.
    int
    Returns the number of objects created (not necessarily placed successfully) by this object definition.
    int
    rmObjectDefGetOwnerID(int objectID)
    Gets the owner ID for objects created by this object def, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    int
    Gets the owner index for objects created by this object def, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    int[]
    rmObjectDefPlaceAnywhere(int objectID, int playerID, int count, boolean ignoreConstraints)
    Place object def anywhere on the map for given player.
    int[]
    rmObjectDefPlaceAtArea(int objectDefID, int playerID, int areaID, float minDist, float maxDist, int count, boolean squareRadius, boolean ignoreConstraints)
    Place object def for the player at the given area's location.
    int[]
    rmObjectDefPlaceAtLoc(int objectDefID, int playerID, Vector loc, float minDist, float maxDist, int count, boolean squareRadius, boolean ignoreConstraints)
    Place object def at specific location for given player.
    int[]
    rmObjectDefPlaceInArea(int objectDefID, int playerID, int areaID, int count, boolean ignoreConstraints)
    Place object def for the player in the given area.
    int[]
    rmObjectDefPlaceNearLoc(int objectDefID, int playerID, Vector loc, float maxDist, int count)
    Place object def at specific location for given player, flooding outwards until the given distance (or all objects have been placed).
    boolean
    rmObjectDefSetBufferType(int objectDefID, int bufferType, float bufferDist)
    Sets the default constraint buffer type to use for this object definition.
    boolean
    rmObjectDefSetItemPlaceAnywhere(int objectDefID, int itemIdex, boolean placeAnywhere)
    Ignores placement restrictions when placing the item at the given index for an object def.
    boolean
    rmObjectDefSetItemRotation(int objectDefID, int itemIdex, int rotationType, float rotationAngle)
    Sets the rotation type and angle (only for the custom angle rotation type) for the item at the given index for an object def.
    boolean
    rmObjectDefSetItemVariation(int objectDefID, int itemIdex, int variation)
    Sets variation type (0 being the first variation) for the item at the given index for an object def.
    boolean
    rmObjectDefSetOwnerID(int objectID, int ownerID, int ownerIndex)
    Sets the owner ID for objects created by this object def, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    rmObjectGetCentroidLoc(int objectID)
    Gets the centroid of all units placed for an object and its items.
    int
    rmObjectGetConstraint(int objectID, int idx)
    Get the constraint ID at a given index for an object.
    int[]
    rmObjectGetCreatedUnitIDs(int objectID, int itemIdx, boolean includeRemovedUnitIDs)
    Returns the IDs of units that were placed by an item of the given object.
    int
    Gets the object ID for a given object name.
    rmObjectGetLoc(int objectID)
    Gets the location of an object (after it has been placed).
    rmObjectGetName(int defID)
    Gets the name for a given object ID.
    int
    Get the number of constraints that have been added to an object.
    int
    rmObjectGetNumberItems(int objectID)
    Returns the number of items that have been added to the given object.
    int
    rmObjectGetOwnerID(int objectID)
    Gets the owner ID for this object, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    int
    rmObjectGetOwnerIndex(int objectID)
    Gets the owner index for this object, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    int
    rmObjectGetUnitTargetCount(int objectID, int itemIdx)
    Returns the number of units defined in an item of the given object.
    int
    rmObjectiveAdd(String nameStr, String textStr, String hintStr, boolean isPrimary, boolean isVisible)
    Adds a map objective.
    void
    rmObjectiveSetPlayer(int objID, int playerID)
    Restricts the objective to the given player.
    void
    rmObjectiveSetTeam(int objID, int teamID)
    Restricts the objective to the given team.
    boolean
    rmObjectPlaceAnywhere(int objectID, int playerID, boolean ignoreConstraints)
    Place object anywhere on the map for given player.
    boolean
    rmObjectPlaceAtArea(int objectID, int playerID, int areaID, float minDist, float maxDist, boolean squareRadius, boolean ignoreConstraints)
    Place object for the player at the given area's location.
    boolean
    rmObjectPlaceAtLoc(int objectID, int playerID, Vector loc, float minDist, float maxDist, boolean squareRadius, boolean ignoreConstraints)
    Place object at specific location for given player.
    boolean
    rmObjectPlaceInArea(int objectID, int playerID, int areaID, boolean ignoreConstraints)
    Place object for the player in the given area.
    boolean
    rmObjectPlaceNearLoc(int objectID, int playerID, Vector loc, float maxDist)
    Place object at specific location for given player, flooding outwards until a valid tile has been found.
    boolean
    rmObjectSetBufferType(int objectDefID, int bufferType, float bufferDist)
    Sets the default constraint buffer type to use for this object.
    boolean
    rmObjectSetItemPlaceAnywhere(int objectID, int itemIdex, boolean placeAnywhere)
    Ignores placement restrictions when placing the item at the given index for an object.
    boolean
    rmObjectSetItemRotation(int objectID, int itemIdex, int rotationType, float rotationAngle)
    Sets the rotation type and angle (only for the custom angle rotation type) for the item at the given index for an object.
    boolean
    rmObjectSetItemVariation(int objectID, int itemIdex, int variation)
    Sets variation type (0 being the first variation) for the item at the given index for an object.
    boolean
    rmObjectSetOwnerID(int objectID, int ownerID, int ownerIndex)
    Sets the owner ID for this object, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    boolean
    rmPathAddConstraint(int pathID, int constraintID, float cost, float bufferDist)
    Adds a constraint which all tiles of this path have to respect.
    int
    rmPathAddRandomWaypoint(int pathID, float minDistFromPreviousMeters, float maxDistFromPreviousMeters)
    Adds a waypoint to a path, optionally randomizing from within the provided range in meters relative to the last waypoint.
    boolean
    rmPathAddToClass(int pathID, int classID)
    Adds a path to the given class.
    int
    rmPathAddWaypoint(int pathID, Vector loc, float minDistMeters, float maxDistMeters)
    Adds a waypoint (as a vector of fractions) to a path, optionally serving as origin to randomize a waypoint from within the provided range in meters.
    boolean
    rmPathAddWaypointConstraint(int pathID, int waypointID, int constraintID, float bufferDist)
    Adds a waypoint constraint to a path which a waypoint has to respect (useful if the waypoint is randomized one way or another).
    int
    rmPathAddWaypointInArea(int pathID, int areaID, float minOriginDistMeters, float maxOriginDistMeters)
    Adds a waypoint to a path, using the origin tile of an area, optionally randomizing from within the provided range in meters relative to the origin of the area (and still inside of the area).
    boolean
    rmPathBuild(int pathID)
    Builds a path.
    int
    Creates a new path.
    boolean
    rmPathDefAddConstraint(int pathDefID, int constraintID, float cost, float bufferDist)
    Adds a constraint which all tiles of a path derived from this path def have to respect.
    int
    rmPathDefAddRandomWaypoint(int pathDefID, float minDistFromPreviousMeters, float maxDistFromPreviousMeters)
    Adds a waypoint to a path def, optionally randomizing from within the provided range in meters relative to the last waypoint.
    boolean
    rmPathDefAddToClass(int pathDefID, int classID)
    Add paths created from a path definition to the given class.
    int
    rmPathDefAddWaypoint(int pathDefID, Vector loc, float minDistMeters, float maxDistMeters)
    Adds a waypoint (as a vector of fractions) to a path def, optionally serving as origin to randomize a waypoint from within the provided range in meters.
    boolean
    rmPathDefAddWaypointConstraint(int pathDefID, int waypointID, int constraintID, float bufferDist)
    Adds a waypoint constraint to a path def which a waypoint has to respect (useful if the waypoint is randomized one way or another).
    int
    rmPathDefAddWaypointInArea(int pathDefID, int areaID, float minOriginDistMeters, float maxOriginDistMeters)
    Adds a waypoint to a path, using the origin tile of an area def, optionally randomizing from within the provided range in meters relative to the origin of the area (and still inside of the area).
    int
    Creates a new path definition.
    int
    rmPathDefCreatePath(int pathDefID, String nameOverride)
    Creates an path from an path definiton.
    int[]
    rmPathDefCreatePaths(int pathDefID, int numPaths, String nameOverride)
    Creates multiple paths from an path definiton.
    int
    rmPathDefGetCreatedPath(int pathDefID, int index)
    Gets the ID of the i-th path created by this path definition.
    int[]
    rmPathDefGetCreatedPaths(int pathDefID)
    Gets all path IDs created by this path definition.
    int
    Gets the path definition ID for a given path definiton name.
    rmPathDefGetName(int pathDefID)
    Gets the name for a given path definition ID.
    int
    Gets the number of paths created by this path definition.
    int
    rmPathDefGetOwnerID(int pathID)
    Gets the owner ID for paths created by this path def, can be used to identify after placement for which player the path was intended for.
    int
    Gets the owner index for paths created by this path def, can be used to identify after placement for which player the path was intended for.
    boolean
    rmPathDefSetAllowDiagonals(int pathDefID, boolean allowDiagonals)
    Specifies whether paths derived from a path def are allowed to go diagonally.
    boolean
    rmPathDefSetAllTerrainCosts(int pathDefID, float cost)
    Sets the cost for all terrains for a path def.
    boolean
    rmPathDefSetCostNoise(int pathDefID, float minNoise, float maxNoise)
    Adds a random value in the specified range for each tile for a path def, used in addition to terrain costs, distance costs, and constraint costs.
    boolean
    rmPathDefSetIgnoreStartEndConstraints(int pathDefID, boolean ignoreStartEndConstraints)
    Specifies whether the start and end tile of a path derived from a path def should ignore constraints or not.
    boolean
    rmPathDefSetOwnerID(int pathID, int ownerID, int ownerIndex)
    Sets the owner ID for paths created by this path def, can be used to identify after placement for which player the path was intended for.
    boolean
    rmPathDefSetTerrainCost(int pathDefID, int terrainID, float cost)
    Sets the cost for a terrain for a path def, used in addition to distance costs, constraint costs, and noise when building the path.
    int
    Gets the path ID for a given path name.
    rmPathGetName(int defID)
    Gets the name for a given path ID.
    int
    Returns the number of segments a path has.
    int
    rmPathGetOwnerID(int pathID)
    Gets the owner ID for this path, can be used to identify after placement for which player the path was intended for.
    int
    rmPathGetOwnerIndex(int pathID)
    Gets the owner index for this path, can be used to identify after placement for which player the path was intended for.
    rmPathGetTiles(int pathID)
    Returns all tiles of a path as fractions.
    rmPathGetWaypoints(int pathID)
    Returns all waypoints of a path as fractions.
    boolean
    rmPathSetAllowDiagonals(int pathID, boolean allowDiagonals)
    Specifies whether a path is allowed to go diagonally.
    boolean
    rmPathSetAllTerrainCosts(int pathID, float cost)
    Sets the cost for all terrains for a path.
    boolean
    rmPathSetCostNoise(int pathID, float minNoise, float maxNoise)
    Adds a random value in the specified range for each tile for a path, used in addition to terrain costs, distance costs, and constraint costs.
    boolean
    rmPathSetIgnoreStartEndConstraints(int pathID, boolean ignoreStartEndConstraints)
    Specifies whether the start and end tile of a path should ignore constraints or not.
    boolean
    rmPathSetOwnerID(int pathID, int ownerID, int ownerIndex)
    Sets the owner ID for this path, can be used to identify after building for which player the path was intended for.
    boolean
    rmPathSetTerrainCost(int pathID, int terrainID, float cost)
    Sets the cost for a terrain for a path, used in addition to distance costs, constraint costs, and noise when building the path.
    int
    rmPlacePlayer(int playerID, Vector loc)
    Sets the location for the provided player.
    boolean
    rmPlacePlayersOnCircle(float radius, float radiusMetersVar, float angleVar, float angle, float range, Vector originLoc)
    Places players in a circle.
    boolean
    rmPlacePlayersOnEllipse(float xRadius, float zRadius, float radiusMetersVar, float angleVar, float ellipseAngle, float angle, float range, Vector loc)
    Places players in an ellipse.
    boolean
    rmPlacePlayersOnSquare(float xRadiusFraction, float zRadiusFraction, float lineVarMeters, float distVarMeters, Vector loc)
    Places players in a square (or rectangle).
    boolean
    rmPlacePlayersOnWaypointLine(boolean wrap, float lineVarMeters, float distVarMeters, boolean randomStart)
    Places players along a line defined by previously added points with rmAddWaypointLinePlacementPoints().
    float
    rmRadiusToAreaFraction(float meters, boolean clamp, boolean warn)
    Calculates the fraction an area with the given radius in meters covers of the entire map.
    int
    rmRemoveUnitType(int unitType)
    Removes all units with the given type from the map, returning the total number of removed units.
    void
    Restarts script execution.
    boolean
    rmRevealLocToPlayer(int playerID, Vector loc, float revealRadiusMeters, boolean square)
    Reveals tiles around a location.
    boolean
    Sets a default object constraint buffer type to use (if none is provided when adding an object constraint).
    void
    rmSetLighting(String lightingSetName)
    Sets a lighting set.
    void
    rmSetMapRevealed(boolean reveal)
    Sets whether or not to reveal the entirety of the map.
    boolean
    rmSetMapSize(int xTiles, int zTiles)
    Sets the number of tiles for the x and z axis to use.
    void
    rmSetNatureCiv(int civID)
    Sets Mother Nature's civilization, or randomizes from all civs if the civID is -1.
    void
    Randomizes Mother Nature's civilization from the given culture, or from all civs if cultureID is -1.
    boolean
    rmSetPlacementPlayers(int[] playerIDs)
    Sets the players to place.
    boolean
    rmSetPlacementTeam(int teamID)
    Sets the team to place.
    boolean
    rmSetPlacementTeams(int[] teamIDs)
    Sets the teams to place.
    boolean
    rmSetPlayerArea(int playerID, int areaID)
    Deprecated, has no effect.
    boolean
    rmSetPlayerResource(int playerID, int resouceID, float amount)
    Sets one player's amount of the specified resource.
    boolean
    rmSetPlayerResourcesInfinite(int playerID, boolean infinite)
    Grants a player infinite resources if set to true.
    void
    rmSetPostGenWaterBeautification(boolean beautifyWater, boolean beautifyWaterTerrain)
    Determines whether waterbodies will be expanded based on their height to fill gaps, and whether water body terrain will be repainted.
    void
    rmSetProgress(float progress)
    Sets the progress bar to the specified percentage in [0.0, 1.0].
    void
    rmSetShuffleTeams(boolean shuffle)
    Sets whether team placement order will be shuffled (i.e., the order in which teams are placed) before placement with one of the placement functions.
    boolean
    Sets the ordering of players within teams for placement (sorted by ascending color index, random, or lobby order).
    void
    rmSetTeamSpacingModifier(float modifier)
    Sets the team spacing modifier, with values.
    void
    rmSetTOBConversion(boolean convert)
    Sets whether or not objects with the ConvertToTOB flag get automatically converted.
    boolean
    rmSplineAddLoc(int splineID, Vector loc)
    Adds a loc to the spline.
    int
    Creates a new spline with the given name, returning the ID of the created spline.
    rmSplineEvaluate(int splineID, int numPoints)
    Evaluates an initialzed spline in (numPoints - 1) equal intervals, resulting in numPoints interpolated points.
    rmSplineEvaluateAt(int splineID, float t)
    Evaluates an initialzed spline at time t in [0.0, 1.0].
    int
    Gets the spline ID for a given spline name.
    rmSplineGetName(int defID)
    Gets the name for a given spline ID.
    boolean
    rmSplineInitialize(int splineID)
    Initializes a spline with the points added so that it can be evaluated subsequently.
    int[]
    rmSplineToPaths(int splineID, int numPointsPerSplineSegment, boolean allowDiagonals)
    Creates paths from splines, one between each pair of waypoints, and returns the IDs of the created paths.
    float
    rmSquareMetersToAreaFraction(float squareMeters, boolean clamp, boolean warn)
    Converts an area of square meters to a fraction of the map.
    void
    Sets the goal text to be used in the objectives screen.
    void
    Sets the spotlight title to be used in the objectives/summary screen.
    void
    Sets the path for the spotlight image to be used in the objectives/summary screen.
    void
    Sets the spotlight text to be used in the objectives/summary screen.
    void
    Sets the title text to be used in the objectives screen.
    rmTileIndexToFraction(Vector tile, boolean clamp, boolean warn)
    Converts a vector of a tile position to a vector infractions.
    rmTileIndexToMeters(Vector tile, boolean clamp, boolean warn)
    Converts a vector of a tile position to a vector of meters.
    float
    rmTilesToAreaFraction(int tiles, boolean clamp, boolean warn)
    Converts an area tile count to a fraction of the entire map.
    float
    rmTilesToMeters(float tiles)
    Converts a length in tiles to a length in meters.
    boolean
    Adds an XS trigger script to include to the trigtemp.xs trigger script.
    void
    Adds a single line of XS code to the trigtemp.xs trigger script.
    boolean
    rmTriggerAddUnitsToArmy(int playerID, int armyID, int objectDefID)
    Adds all objects placed by an object def to the army of a player.
    int
    rmTriggerCreateArmy(int playerID, String armyName)
    Creates an army for the given player and name.
    boolean
    rmWallsPlace(int playerID, Vector[] waypoints)
    Places walls at the provided waypoints (in fractions).
    boolean
    rmWallsPlaceAroundArea(int playerID, int areaID)
    Places walls around the edge of an area.
    boolean
    rmWallsPlaceLine(int playerID, Vector startLoc, Vector endLoc)
    Places walls in a line between the two provided waypoints (in fractions).
    boolean
    rmWallsPlaceSquare(int playerID, Vector loc, float radiusMeters)
    Places walls in a square around the specified location (in fractions).
    boolean
    rmWallsSetTypeIndex(int functionTypeIndex)
    Sets the wall type (remains until unset), indices are as defined in the unit function data.
    boolean
    rmWaterTypeAddBeachLayer(int waterID, int terrainID, float distance, float variance)
    Adds a beach layer (towards land) when painting water edges for the provided water type.
    boolean
    rmWaterTypeAddShoreLayer(int waterID, int terrainID, float distance, float variance)
    Adds a shore layer (towards water) when painting water edges for the provided water type.
    boolean
    rmWaterTypeSetFloorTerrain(int waterID, int terrainID)
    Sets the floor terrain type to use for the water type with the given ID.
    float
    rmXFractionToMeters(float meters, boolean clamp, boolean warn)
    Converts a fraction of the x axis to a length in meters.
    int
    rmXFractionToTileIndex(float fraction, boolean clamp, boolean warn)
    Converts a fraction of the x axis to the index of the closest tile on the x axis.
    int
    rmXFractionToTiles(float fraction, boolean clamp, boolean warn)
    Converts a fraction of the x axis to a length in tiles (rounded to the closest tile).
    float
    rmXMetersToFraction(float meters, boolean clamp, boolean warn)
    Converts a length in meters to a fraction of the x axis.
    int
    rmXMetersToTileIndex(float meters, boolean clamp, boolean warn)
    Converts a length in meters to a tile index on the x axis (rounded to the closest tile).
    float
    rmXTileIndexToFraction(int tile, boolean clamp, boolean warn)
    Converts a tile position on the x axis to a fraction of the x axis.
    float
    rmXTileIndexToMeters(int tile, boolean clamp, boolean warn)
    Converts the index of a tile on the x axis to meters.
    float
    rmXTilesToFraction(int tiles, boolean clamp, boolean warn)
    Converts a length in tiles to a fraction of the x axis.
    float
    rmZFractionToMeters(float meters, boolean clamp, boolean warn)
    Converts a fraction of the z axis to a length in meters.
    int
    rmZFractionToTileIndex(float fraction, boolean clamp, boolean warn)
    Converts a fraction of the z axis to the index of the closest tile on the z axis.
    int
    rmZFractionToTiles(float fraction, boolean clamp, boolean warn)
    Converts a fraction of the z axis to a length in tiles (rounded to the closest tile).
    float
    rmZMetersToFraction(float meters, boolean clamp, boolean warn)
    Converts a length in meters to a fraction of the z axis.
    int
    rmZMetersToTileIndex(float meters, boolean clamp, boolean warn)
    Converts a length in meters to a tile index on the x axis (rounded to the closest tile).
    float
    rmZTileIndexToFraction(int tile, boolean clamp, boolean warn)
    Converts a tile position on the z axis to a fraction of the z axis.
    float
    rmZTileIndexToMeters(int tile, boolean clamp, boolean warn)
    Converts the index of a tile on the z axis to meters.
    float
    rmZTilesToFraction(int tiles, boolean clamp, boolean warn)
    Converts a length in tiles to a fraction of the z axis.
    float
    round(float x)
    Rounds x to the nearest integer and returns it as a float.
    int
    sgn(float x)
    Returns the signum of x as an integer (1 if x > 0, -1 if x < 0, or 0 if x == 0).
    float
    sin(float x)
    Returns the sine of x.
    float
    sqrt(float x)
    Returns the square root of x.
    float
    tan(float x)
    Returns the tangent of x.
    boolean
    trActivateCheat(int playerID, String command)
    Executes a cheat for the provided player.
    void
    trAddArmyToPlan(String armyName, String planName)
    Adds the units in the specified army to the specified plan.
    void
    trAISetAttackResponseDistance(int playerID, float attackResponseDistance)
    Sets the attack response distance for the provided playerID's AI if it has one.
    boolean
    returns true if any unit is selected.
    void
    trAreaUnitHighlight(int playerID, float duration, String unitType, int centerUnit, float radius)
    highlights all units belonging to the given unitType within the provided area for a player.
    void
    trAreaUnitTask(int playerID, int destUnitID, String unitType, int centerUnit, float radius, int event)
    tasks units belonging to the given unitType within the provided area towards a target for a player.
    boolean
    trArmyAddUnitTypeInArea(String srcArmy, String unitType, int centerUnit, float radius, boolean clearExisting)
    Assigns units of a unittype within the provided area to the given army.
    void
    Clears the given army, removing all unit IDs from army data.
    boolean
    trArmyDispatch(String army, String protoname, int count, float x, float y, float z, int heading, boolean clearExisting, boolean skipBirth)
    creates the units in the army specified.
    boolean
    trArmyDispatchAtUnit(String army, String protoname, int count, int trgUnitID, int heading, boolean clearExisting, boolean skipBirth)
    creates the units in the army specified at the location of the target unit.
    boolean
    trArmyDoWorkOnArmy(String srcArmy, String trgArmy, int eventID)
    Tasks the selected army to perform work on the first valid unit within the given arny.
    void
    trArmySelect(String parameters)
    selects the units in the army specified.
    void
    trArmySelectInt(int playerID, int armyID)
    selects the units in the army specified.
    void
    trArmyUnitChangeName(String newName, String protoUnitName)
    set an override name for a specific unit in an army
    void
    blocks all ambient sounds from this point forward
    void
    trBlockAllSounds(boolean dialog)
    Blocks all sounds from playing from this point forward.
    boolean
    Returns true if the proto unit specified is on the cursor and is a building.
    boolean
    trBuildingTimeShiftAtPos(int unitID, float x, float y, float z)
    cast timeshift on this unit at this position.
    void
    trCameraCut(Vector pos, Vector dir, Vector up, Vector right)
    puts the camera in the specified location.
    void
    trCameraCutPlayer(int playerID, Vector pos, Vector dir, Vector up, Vector right)
    puts the camera in the specified location for the given player.
    void
    trCameraLock(boolean lock)
    Toggles camera movement locking over the current position.
    void
    trCameraLockOnUnit(boolean bEnable, int timer, int eventID)
    Orients the camera to the selected unit, and keeps it locked on that unit.
    void
    trCameraPanWithUnit(boolean bEnable, int eventID)
    Moves the camera in the same direction that a particular unit moves.
    void
    trCameraShake(float shakeDuration, float shakeStrength)
    Makes the camera shake.
    void
    trCameraStateView(int id, int playerID)
    puts the camera in the location of a saved camera state, for the given player, or for all players, if no player is set.
    int
    trCameraTrackAddWaypoint(int trackIdx, Vector position, Vector forward, Vector up, Vector right, float fov)
    Adds the provided camera position as a waypoint to the given track index.
    int
    trCameraTrackCreate(String trackName, float durationMs)
    Adds a camera track.
    void
    Loads a camera track.
    void
    trCameraTrackPlay(float fDuration, int eventID, boolean blendWithGameCamera, float blendDurationMS)
    plays the current camera track, if blend with game camera is true, it will best fit the strategy camera location at the last waypoint and smooth transition to it.
    void
    trCameraTrackPlayPlayer(String camTrackName, int playerID, boolean blendWithGameCamera, float blendDurationMS)
    loads and plays a camera track for a given player, if blend with game camera is true, it will best fit the strategy camera location at the last waypoint and smooth transition to it.
    void
    trCameraTrackWaypointSetBias(int trackIdx, int waypointIdx, float bias)
    Sets the bias for a provided waypoint index in the given track index.
    void
    trCameraTrackWaypointSetContinuity(int trackIdx, int waypointIdx, float continuity)
    Sets the continuity for a provided waypoint index in the given track index.
    void
    trCameraTrackWaypointSetTension(int trackIdx, int waypointIdx, float tension)
    Sets the tension for a provided waypoint index in the given track index.
    void
    trCameraTrackWaypointSetTime(int trackIdx, int waypointIdx, float timeMs)
    Sets the time for a provided waypoint index in the given track index.
    void
    trCampaignBranchChoice(String message, boolean displayPrompt)
    pop up a dialog allowing choice to load a scenario.
    void
    Sets player as defeated within a campaign mission and displays defeat dialog.
    void
    Completes current scenario within campaign, and advances to next scenario or cinematic.
    void
    Completes current scenario within campaign, and displays prompt to progress to next scenario or return to campaign menu.
    void
    trCampaignStartNew(String message, String campaignPath)
    shows dialog for advancing to the given campaign
    void
    trChangeProtoUnitInArea(int playerID, String unitTypeName, float range, String dstProtoName, boolean skipBirth)
    All units within dist of the selected ref object are changed into the given protoUnit.
    void
    trChangeTerrainHeight(float x0, float z0, float x1, float z1, float height, boolean removeWater)
    sets the terrain elevation for the provided rectangular region.
    void
    trChangeTerrainHeightCircular(Vector center, float radius, float height, boolean removeWater)
    sets the terrain elevation for the provided circular region.
    void
    Clears the messages visible on screen.
    void
    forces the chat history to reset
    boolean
    trChatHistoryContains(String text, int playerID)
    Checks whether or not any of the last sent chat messages by a player contain the given text.
    void
    Sets whether the last messages should always remain visible.
    void
    trChatSend(int playerID, String message)
    Changes the chat status.
    void
    trChatSendSpoofed(int playerID, String message)
    Changes the chat status, but does not append player.
    void
    trChatSendSpoofedToPlayer(int playerID, int toPlayer, String message)
    Changes the chat status, but does not append player.
    void
    trChatSendToPlayer(int playerID, int toPlayer, String message)
    Changes the chat status for one specific player.
    void
    trChatSetStatus(boolean status)
    Changes the chat status.
    void
    aborts the cinematic.
    boolean
    returns the abort cinematic status.
    void
    TODO.
    void
    Plays dialgue with the default sound event from this point forward.
    void
    trConvertUnitsInArea(int srcPlayer, int trgPlayer, String unitTypeName, float range)
    All units within dist of the selected ref object that match type are converted to the target player.
    void
    trConvertUnitsInAreaLimited(int centerUnit, int srcPlayer, int trgPlayer, String unitTypeName, float range, int maxUnits)
    Converts to the target player units of a unit type within the provided area up to the given limit.
    void
    abort a counter.
    void
    trCounterAddGenericXS(String name, String msg, String appendMsg, String xsCall, int eventID, int intialVal, int finalVal, boolean finalAsMin, boolean showFinal, boolean reverseCount, boolean startAtZero)
    start an XS-based counter, that may or may not fire an event.
    boolean
    trCounterAddPlayerName(String name, String message, int playerID)
    displays a player name as a counter.
    boolean
    displays a string as 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
    trCounterAddTimeMs(String name, int start, int stop, String message, int eventID)
    start a counter that may or may not fire an event.
    void
    trCounterAddVictory(String name, int start, int stop, String message, int playerID, int eventID)
    start a counter for player victory, that may or may not fire an event.
    void
    trCounterAddVictoryMs(String name, int start, int stop, String message, int playerID, int eventID)
    start a counter for player victory, that may or may not fire an event.
    boolean
    trCounterDecrementManual(String name, int amount)
    decrement the current value of the counter.
    int
    returns the current value of the given counter.
    boolean
    trCounterIncrementManual(String name, int amount)
    increment the current value of the counter.
    void
    trCounterPause(String name, boolean pause)
    pause a counter.
    void
    trCounterPersistent(String name, boolean persistent)
    enables or disables persistency for a counter.
    void
    trCounterPlayerSpecific(String name, boolean playerSpecific, int playerID)
    sets whether or not a given counter should be restricted to specific players, and, if so, assigns the given player to the counter..
    boolean
    trCounterSetManual(String name, int val)
    sets the current value of the given manual counter.
    boolean
    changes the string to be displayed on a given string pseudocounter.
    boolean
    trCounterSetPlayerName(String name, int playerID)
    changes the player name to be displayed on a given player name pseudocounter.
    void
    trCounterSetSpecialType(String name, int value)
    sets the special type of the named counter.
    void
    trCounterSetVisibility(String name, boolean visible)
    hides or displays a counter.
    void
    trCounterTimeDecrement(String name, int value)
    Decrements the current value of a given time counter by the provided value.
    void
    trCounterTimeIncrement(String name, int value)
    Increments the current value of a given time counter by the provided value.
    void
    trCounterTimeSetValue(String name, int value)
    forcibly sets the current value of a given counter.
    void
    trCreateRevealer(int playerID, String revealerName, Vector position, float revealerLOS, boolean blackmapOnly)
    Creates a revealer with the given attributes.
    void
    grouping Units.
    int
    returns the current player.
    void
    trDamageUnit(float damageAmt)
    does a specific amount of damage to HP in instant typeless damage.
    void
    trDamageUnitPercent(float damagePercent)
    does % percent of a unit's total HP in instant typeless damage.
    void
    trDamageUnitsInArea(int playerID, String unitTypeName, float range, float dmg)
    All units within dist of the selected ref object that match type take dmg.
    void
    trDamageUnitsPercentInArea(int playerID, String unitTypeName, float range, float healPercent)
    All units within dist of the selected ref object are damaged by the given factor.
    void
    Defakifies the army.
    void
    Sets the selected unit as not having a fake player.
    void
    Resets all submodels back to using the player colour of the parent model.
    void
    trDelayedRuleActivation(String name, boolean checkForTrigger)
    adds a rule to the runtime to be activated on the next update.
    void
    trDisableConquestCheck(boolean disable)
    temporarily disables or re-enables conquest victory check in a scenario that supports it.
    void
    trDisableNotificationSounds(boolean disable)
    sets whether or not notification sounds should be disabled for this scenario.
    void
    sets whether or not persistent popcap notifications should be disabled for this scenario.
    void
    trDisablePowerNotifications(boolean disable)
    sets whether or not power casting notifications should be disabled for this scenario.
    void
    trDisablePowerTimers(boolean disable)
    sets whether or not displaying timers for active powers should be disabled for this scenario.
    void
    tells the challenge system this rule was activated.
    void
    trDisableTrigger(int eventID)
    Disables (sets active = false) the trigger specified by the given eventID.
    void
    trDisableUnitDeletion(boolean disable)
    sets whether or not unit and building deletion should be disabled for this scenario.
    void
    trEcho(String text)
    Trigger echo.
    void
    trEchoStatValue(int playerID, int statIndex)
    fetch a stat value from the KB and echo to chat
    void
    trEndChallenge(boolean bAchievedVictory)
    player completed the challenge.
    void
    Signal that the game has ended.
    void
    trEnforceAIAssist(boolean enable)
    sets whether or not AI assist support should be enforced for this scenario.
    void
    trEventFire(int eventID)
    cause an event to occur.
    boolean
    trEventSetHandler(int eventID, String functionName)
    sets a handler function for an event id.
    void
    Executes the given console command.
    boolean
    trExecuteOnAI(int playerID, String command)
    Executes a command on the AI player.
    void
    trFadeOutAllSounds(float duration)
    Fades out all sounds over a given duration.
    void
    trFadeOutMusic(float duration)
    Fades out current music over a given duration.
    void
    trFakifyArmy(String armyName, int fakePlayerIndex)
    Fakifies the army to the specified fake player index.
    void
    trFakifySelection(int fakePlayerIndex)
    Sets the selected unit as having the fake player with the specified index (0-7)
    void
    trFakifySelectionSubModelByOverrideName(String overrideName, int fakePlayerIndex)
    Sets named submodels of the selection to fake player with the specified index (0-7)
    boolean
    trForbidProtounit(int player, String protoname)
    adds protounit to the forbidden list
    void
    Forces the objective panel to always display.
    void
    trFormationScale(float scale)
    scales the formation size of formations in the game.
    trFormatString(String format, String[] inserts)
    Inserts (loc)strings into (loc)strings.
    void
    start a game using scenario.
    void
    trGamePause(boolean pause)
    pause or unpause the game.
    void
    Generates lush for all selected buildings, if owning player supports lush generation.
    int
    returns the unit ID for the current skybox, if applicable.
    int
    returns the ID for the next unit to be allocated.
    int[]
    returns an array containing recently created units.
    int
    trGetScenarioUserData(int index, int fallback, String scenarioName)
    NOTE: This function is DEPRECATED *** Gets the scenario user data and returns the default value when it is not present yet.
    int
    returns the variation ID for the given skybox.
    float
    returns the terrain height at the given map position.
    int
    fetches the terrain subtype ID for the given map position.
    int
    fetches the terrain type ID for the given map position.
    int
    fetches the water type ID for the given map position.
    int
    Returns the world difficulty.
    void
    cancels all active god powers.
    void
    trGodPowerEnableBlocking(boolean bEnable)
    Sets whether or not God Power blocking is enabled.
    void
    trGodPowerGrant(int playerID, String protoPowerName, int numUses, int cooldown, boolean useCost, boolean repeatAtEnd)
    grants X uses of the specified God Power to the player.
    void
    trGodPowerGrantAtSlot(int playerID, String protoPowerName, int numUses, int position, int cooldown, boolean useCost, boolean repeatAtEnd)
    grants X uses of the specified god power in a specific God Power UI slot.
    void
    trGodPowerInvoke(int playerID, String protoPowerName, Vector pos1, Vector pos2, boolean ignoreCooldown, boolean setAsQueued)
    invokes the specified God Power.
    boolean
    trGodPowerInvokeAtArmy(int powerPlayerID, String army, String protoPowerName, boolean ignoreCooldown, boolean setAsQueued)
    invokes the specified God Power at the specified army.
    boolean
    trGodPowerPrePurchase(int playerID, String protoPowerName, int numUses)
    pre-purchases X uses of the specified God Power to the player, if applicable.
    void
    trGodPowerRedefine(int playerID, String protoPowerName, String iconPath, String displayName, String rollover)
    replaces the icon, and display name and rollover strings of a power for the given player.
    void
    trGodPowerSetCooldown(int playerID, String protoPowerName, int cooldown)
    sets the cooldown of the specified God Power for the given player.
    void
    trGodPowerSetCost(int playerID, String protoPowerName, float initialCost, float repeatCost)
    sets the cost of the specified God Power for the given player.
    void
    trGodPowerSetUseCount(int playerID, String protoPowerName, int numUses)
    sets the number of charges of the specified God Power for the given player.
    void
    trGodPowerSetUsedTimes(int playerID, String protoPowerName, int numUses)
    overrides the number of timesthe specified God Power has been used.
    void
    trHealUnit(float healAmt)
    adjust the units' hitpoints by the given value.
    void
    trHealUnitPercent(float healPercent)
    heals the selected units by a percentage of their total HP.
    void
    trHealUnitsInArea(int playerID, String unitTypeName, float range, float healAmt)
    All units within dist of the selected ref object have their HPs adjusted by the given value.
    void
    trHealUnitsPercentInArea(int playerID, String unitTypeName, float range, float healPercent)
    All units within dist of the selected ref object have their HPs adjusted by the given factor.
    void
    hides the user's Scoreboard.
    boolean
    Instantly garrisons units inside another unit without considering distance.
    boolean
    returns true if we're currently in gamepad mode.
    boolean
    trInInputContext(String inputContext)
    returns true if we're in the given input context.
    boolean
    trInRadialMenuPage(int radialMenuPageID)
    returns true if the given radial menu page is open.
    boolean
    returns false if dialogue is currently playing
    boolean
    trIsInBuildingChain(int unitID)
    Returns true if the given unit is a building connected to a valid building chain.
    boolean
    returns true if the minimap is expanded.
    void
    trKillAIPlan(int playerID, String planName)
    No help.
    void
    trKillUnitsInArea(int playerID, String unitTypeName, float range)
    All units within dist of the selected ref object that match type are killed.
    void
    Leaves the current game.
    void
    trLetterBox(boolean on, boolean letterbox)
    Turns letter box mode on or off.
    void
    trLightingSetParamBool(int paramID, boolean value)
    sets the given boolean lighting set parameter to the provided value for this scenario only.
    void
    trLightingSetParamColor(int paramID, int r, int g, int b)
    sets the given color lighting set parameter to the provided value for this scenario only.
    void
    trLightingSetParamColorAttr(int paramID, float redAttr, float greenAttr, float blueAttr)
    sets the given color attribute lighting set parameter to the provided value for this scenario only.
    void
    trLightingSetParamFloat(int paramID, float value)
    sets the given floating point lighting set parameter to the provided value for this scenario only.
    void
    trLightingSetParamInt(int paramID, int value)
    sets the given integer lighting set parameter to the provided value for this scenario only.
    void
    trMapMutateUnits(String srcUnitType, String trgProtoName, boolean fullHitpoints)
    transforms all units on the map belonging to the given unit type into the set protoUnit through PU mutation, maintaining original BUnit pointer.
    void
    Resets Market buy and sell prices to default values.
    void
    trMessageSetText(String text, int timeout)
    displays the message text.
    void
    trMinimapFlare(int playerID, float duration, Vector pPosition, boolean unused)
    Sends a Minimap flare to a certain player.
    void
    trModifyProtounitAction(String unitTypeName, String protoUnitActionName, int playerID, int puField, float delta, int relativity)
    modifies proto unit action data for this scenario only.
    void
    trModifyProtounitActionUnitType(String unitTypeName, String actionName, String unitType, int playerID, int puField, float delta, int relativity)
    modifies proto unit action data taking a unittype parameter for this scenario only.
    void
    trModifyProtounitData(String unitTypeName, int playerID, int puField, float delta, int relativity)
    modifies proto unit data for this scenario only.
    void
    trModifyProtounitResource(String unitTypeName, String resource, int playerID, int puField, float delta, int relativity)
    modifies proto unit data taking a resource parameter for this scenario only.
    void
    trModifyProtounitUnitType(String unitTypeName, String trgUnitTypeName, int playerID, int puField, float delta, int relativity)
    modifies proto unit data taking a unit type parameter for this scenario only.
    void
    trMusicPlay(String filename, float duration)
    Plays the music file.
    void
    Plays the current music.
    void
    sets the current music set.
    void
    trMusicSetMood(int moodID, float fadeTimeSeconds)
    Changes the music to mood associated with mood id.
    void
    Stops the current music.
    boolean
    Returns true if the object is currently being worked.
    void
    trObjectiveComplete(int objectiveID, boolean forceComplete, boolean playSound)
    Completes the specified objective.
    void
    trObjectiveCreateMarker(int objectiveID, String name, Vector markerPos)
    DEPRECATED.
    void
    trObjectiveFailed(int objectiveID, boolean playSound)
    Sets the specified objective as failed.
    void
    trObjectiveHide(int objectiveID)
    Hides the specified objective on the UI.
    void
    trObjectiveIncomplete(int objectiveID, boolean playSound)
    Marks a specified objective as incomplete.
    void
    trObjectiveRemoveMarker(int objectiveID, String name)
    DEPRECATED.
    void
    trObjectiveShow(int objectiveID, boolean playSound)
    Shows the specified objective on the UI.
    void
    trObjectivesTracker(String title, String text, String soundfile, int timeout)
    displays the objectives tracker text.
    void
    trOverlayText(String rawText, float time, float textSize, int colorR, int colorG, int colorB)
    puts up a big movie-credits style text overlay
    void
    trPaintTerrain(int terrainType, int terrainSubtype, float minX, float minZ, float maxX, float maxZ, boolean updateObstructions)
    paints a rectangular area by the given terrain type and subtype.
    void
    trPaintTerrainBySubtypeName(String subtypeName, float x0, float z0, float x1, float z1, boolean updateObstructions)
    paints a rectangular area by the terrain identified by the given terrain subtype UI name.
    void
    trPaintTerrainCircular(int terrainType, int terrainSubtype, Vector center, float radius, boolean updateObstructions)
    paints a circular area by the given terrain type and subtype.
    void
    trPaintTerrainCircularBySubtypeName(String subtypeName, Vector center, float radius, boolean updateObstructions)
    paints a circular area by the terrain identified by the given terrain subtype UI name.
    void
    trPaintWater(int waterID, float minX, float minZ, float maxX, float maxZ, boolean circular, boolean updateObstructions)
    paints an area by the water entry identified by the given ID.
    void
    trPaintWaterCircular(String waterName, Vector center, float radius, boolean updateObstructions)
    paints a circular area by the water entry identified by the given name.
    void
    trPaintWaterRectangular(String waterName, float x0, float z0, float x1, float z1, boolean updateObstructions)
    paints a rectangular area by the water entry identified by the given name.
    int
    trPlaceFoundation(String protoName, float x, float y, float z, int heading, int playerID, float pctComplete)
    places a foundation for the given building and returns the ID of the foundation.
    void
    trPlaceStartingUnits(int playerID)
    place start units forall TCs instead of placing the first TC
    void
    trPlayerAdjustScore(int playerID, int delta)
    adjust the overridden score value for a player by the given delta.
    void
    trPlayerAllowAgeUpSpawning(int playerID, boolean allowSpawning)
    Sets whether or not units will be spawned through age-up techs.
    void
    trPlayerAllowBonusUnitSpawning(int playerID, boolean allowSpawning)
    Sets whether or not units will be spawned through bonus unit spawning mechanic.
    void
    trPlayerAllowShades(int playerID, boolean allow)
    Sets whether or not the given player will be allowed to spawn shades.
    void
    trPlayerAllowStartingUnitsSpawning(int playerID, boolean allowSpawning)
    Sets whether or not starting units will be spawned for the given player.
    boolean
    trPlayerAtPopCap(int playerID)
    returns true if player is at pop cap.
    void
    trPlayerChangeProtoUnit(int playerID, String srcUnitType, String trgProtoName, boolean skipBirth, boolean forceFoundation)
    transforms all units for a player belonging to the given unit type into the set protoUnit.
    boolean
    trPlayerControlsSocket(int playerID, int unitID)
    Returns true if the specified player is built on the specified socket.
    void
    trPlayerEnableBuildingChain(int playerID, boolean enable)
    Sets whether or not the Building Chain system will be enabled for the given player.
    void
    trPlayerEnablePartisans(int playerID, boolean allow)
    Sets whether or not partisan spawning will be enabled for the given player.
    void
    trPlayerEnableTimeshift(int playerID, boolean allow)
    Sets whether or not timeshifting will be enabled for the given player.
    boolean
    trPlayerGetCivilization(int playerID, String civilization)
    returns true/false if the player civilization matches the given parameter.
    trPlayerGetDiplomacy(int player1, int player2)
    gets the diplomacy status between players.
    int
    trPlayerGetType(int playerID)
    returns whether the given player is a human or a computer/AI player.
    int
    gets the villager priority preset for player.
    void
    trPlayerGrantResources(int playerID, String resource, int amount)
    advances the campaign.
    boolean
    trPlayerIsActive(int playerID)
    returns true/false if the player is active.
    boolean
    trPlayerIsDefeated(int playerID)
    returns true/false if the player has been defeated.
    boolean
    returns true/false if the player has resigned or has been defeated.
    void
    Kills all of the buildings of a given player.
    void
    Kills all of the current God Powers of a player.
    void
    trPlayerModifyData(int playerID, int dataField, int attribute, float delta, int relativity)
    modifies player data for this scenario only.
    void
    trPlayerModifyLOS(int destPlayer, boolean canSee, int srcPlayer)
    Adds/removes LOS between players.
    void
    trPlayerModifyResourceData(int playerID, int dataField, int resourceID, float delta, int relativity)
    modifies player data for this scenario only.
    void
    trPlayerMutateUnits(int playerID, String srcUnitType, String trgProtoName, boolean fullHitpoints)
    transforms all units for a player belonging to the given unit type into the set protoUnit through PU mutation, maintaining original BUnit pointer.
    void
    trPlayerOverrideArtCulture(int playerID, String culture)
    Overrides the culture used for choosing the player's art.
    void
    trPlayerOverrideCivName(int playerID, String stringID)
    Overrides the string used for the displayed civilization name.
    void
    trPlayerRemoveAllUnits(int playerID)
    Removes all of the units of a given player without affecting Player Stats.
    void
    trPlayerResetBlackMap(int playerID)
    Resets the black map for a given HUMAN player.
    void
    trPlayerResetBlackMapForAllPlayers(Resets the black map for all HUMAN players.
    void
    trPlayerSetActive(int playerID)
    sets the active player.
    void
    trPlayerSetCiv(int playerID, String civName)
    replaces the civilization for the given player.
    void
    trPlayerSetColor(int playerID, int playerColorID, int r, int g, int b)
    Sets the player color for the given player.
    void
    call this when a player is defeated on the local machine (meaning that this func must be called synchronously on all machines, it will not pass around a command.)
    void
    trPlayerSetDiplomacy(int player1, int player2, String status, boolean mutual)
    sets the diplomacy status between players.
    void
    trPlayerSetName(int playerID, String name)
    Sets the displayed name for the given player.
    void
    trPlayerSetScore(int playerID, int score)
    overrides the score for a player by the given value.
    void
    trPlayerSetVictorious(int playerID)
    sets the given player as victorious for the current game.
    void
    trPlayerSetWon(int i, boolean endGame)
    call this when a player has won on the local machine (meaning that this func must be called synchronously on all machines, it will not pass around a command.)
    void
    trPlayerTechTreeEnabledGodPowers(int playerID, boolean bEnable)
    Enables/Disables the Tech Tree from granting God Powers to a player.
    void
    trPlayerTimeshiftAddEntry(int playerID, String protoName, float costRatio, float timeRatio)
    adds a timeshifting entry towards the given protoUnit to a player for this scenario only.
    void
    trPlayerTimeshiftModifyCost(int playerID, String protoName, float delta, int relativity)
    modifies timeshifting cost ratio for a given protoUnit for this scenario only.
    void
    trPlayerTribute(int playerID, String resource, int amount, int toPlayerID)
    tributes resources to a player.
    void
    Plays the next song in the music play list.
    void
    trProtoUnitActionSetEnabled(String protoUnitName, int playerID, String actionName, boolean enable)
    enables or disables an action for a proto unit.
    void
    trProtounitActionSpecialEffect(String unitTypeName, String actionName, int playerID, int effectField, String targetType, int dmgType, float duration, float value)
    modifies proto unit action data by adding a new or adjusting an existing onHitEffect for this scenario only.
    void
    trProtounitActionSpecialEffectActive(String unitTypeName, String actionName, int playerID, int effectField, String targetType, int dmgType, boolean active)
    modifies proto unit action data by setting a specified existing onHitEffect as active or inactive.
    void
    trProtounitActionSpecialEffectDuration(String unitTypeName, String protoUnitActionName, int playerID, int efectType, String targetType, int damageType, float delta, int relativity)
    modifies the duration of an existing onHitEffect within the given protoAction for this scenario only.
    void
    trProtounitActionSpecialEffectModifier(String unitTypeName, String actionName, int playerID, int effectField, String targetType, float value, int modifyType, int dmgType)
    modifies proto unit action data by adding a new or adjusting an existing onHitEffect and assigning a new stat modifier to it for this scenario only.
    void
    trProtounitActionSpecialEffectProtoUnit(String unitTypeName, String actionName, int playerID, int effectField, String targetType, String protoUnit, float duration, float value)
    modifies proto unit action data by adding a new or adjusting an existing onHitEffect taking a protoUnit parameter for this scenario only.
    void
    trProtounitAddCommand(String protoUnitName, int playerID, String puCmdName, int row, int column)
    assigns a protoUnitCommand entry towards the given protoUnit for this scenario only.
    void
    trProtounitAddTech(String protoUnitName, int playerID, int techID, int row, int column)
    assigns a tech entry towards the given protoUnit for this scenario only.
    void
    trProtounitAddTrain(String protoUnitName, int playerID, String trainPUName, int row, int column)
    assigns a train entry towards the given protoUnit for this scenario only.
    void
    trProtounitAssignAction(String unitTypeName, String protoUnitName, String actionName, int playerID)
    assigns an action from the provided proto unit to all units belonging to the given unittype for this scenario only.
    void
    trProtoUnitChangeName(String protoUnitName, int playerID, String nameStrId, String rolloverStrId, String shortRolloverStrId)
    Modify the name and rollover text of a proto unit.
    void
    trProtoUnitHighlight(int playerID, String protoName, float duration, boolean flash)
    highlights all units belonging to the given protounit for a player.
    void
    trProtoUnitMovementType(String unitTypeName, int playerID, String movementType)
    modifies proto unit movement type for this scenario only.
    void
    trProtounitRemoveCommand(String protoUnitName, int playerID, String puCmdName)
    removes a protoUnitCommand entry from the given protoUnit for this scenario only.
    void
    trProtounitRemoveTech(String protoUnitName, int playerID, int techID)
    removes a tech entry from the given protoUnit for this scenario only.
    void
    trProtounitRemoveTrain(String protoUnitName, int playerID, String trainPUName)
    removes a train entry from the given protoUnit for this scenario only.
    void
    trProtoUnitSetFlag(int playerID, String srcUnitTypeName, String unitTypeName, boolean set)
    Sets or unsets the given flag within the given protounit.
    void
    trProtoUnitSetIcon(String protoUnitName, int playerID, String iconPath, String minimapIconPath)
    Modify the icon of a proto unit.
    void
    trProtoUnitSetUnitType(int playerID, String unitTypeName, String unitTypeName2, boolean set)
    Sets or unsets the given unit type within the given protounit.
    void
    trQuestVarCopy(String destName, String fromName)
    copies value of one of the trigger scratch variables
    void
    chats out the value of one of the trigger scratch variables
    float
    retrieve value of a trigger scratch variable, returns zero if unset
    void
    trQuestVarSet(String varName, float val)
    sets one of the trigger scratch variables
    void
    trQuestVarSetFromRand(String varName, float minVal, float maxVal, boolean round)
    sets one of the trigger scratch variables within a random range
    void
    trQuestVarSetFromRandUnique(String varName, float minVal, float maxVal, boolean round)
    sets one of the trigger scratch variables within a random range, while avoiding repeating consecutive values
    void
    trQueueStartingUnits(int playerID)
    Queues starting units for player if they have a starting TC.
    void
    trRateConstruction(float rate)
    modify construction rate.
    void
    trRateResearch(float rate)
    modify research rate.
    void
    Resets all the rates to normal (1.0f).
    void
    trRateTrain(float rate)
    modify training rate.
    boolean
    trRelicCreate(float x, float y, float z, int heading, String relicname)
    creates a new relic from defined relic name.
    boolean
    trRelicForce(int unitID, String relicname)
    changes type of selected relic to the given relic name.
    void
    trRemoveUnitsInArea(int playerID, String unitTypeName, float range, boolean ejectContained)
    All units within dist of the selected ref object that match type are killed.
    void
    trRenderRain(float percent)
    controls rain rendering.
    void
    trRenderSky(boolean val, String skyName, int orientation, float height, boolean terrainHeight)
    Turn sky rendering on/off and set which sky to use.
    void
    trRenderSnow(float percent)
    controls snow rendering.
    void
    resets list of recently-created units.
    void
    restarts the scenario
    void
    shows whole map, similar to how revealed mode works (SP modes only)
    int
    Returns how many units you currently have selected.
    int
    Returns the ID of the selected unit.
    void
    trSetAutoResetRecentUnits(boolean enable)
    sets whether or not the list of recently-created units should be reset at each frame.
    void
    trSetBuildingChainVisible(int playerID, boolean visibile, boolean force)
    toggles visibility for Building Chain range.
    void
    Shows or hides the Global Community Community Event objective display.
    void
    Creates a counter if one does not exist, and sets it's display text.
    void
    trSetCounterDisplayWithType(String message, int specialCounterType)
    Show a counter with the specified special type ID.
    void
    trSetCurrentPlayerStatus(boolean active)
    sets the current player as active or inactive.
    void
    trSetCurrentScenarioUserData(int index, int value)
    NOTE: This function is DEPRECATED *** Sets the current scenario user data.
    void
    Plays dialogue with the specified sound event from this point forward.
    void
    trSetFogAndBlackmap(boolean fog, boolean black)
    turn fog and black map on/off.
    void
    trSetFogAndBlackmapMultiplayer(boolean fog, boolean black)
    turn fog and black map on/off, affecting all players.
    boolean
    trSetFoundationComplete(int unitID, float pctComplete)
    Sets the build progress for an unfinished foundation to the specified percentage.
    void
    trSetLighting(String setName, float fadeTime)
    fades to the specified lighting set over fadetime.
    void
    trSetObscuredUnits(boolean v)
    Sets whether or not units can be drawn obscured or not.
    void
    TODO.
    void
    TODO.
    void
    trSetRevealerActiveState(String revealerName, boolean active)
    Finds the specified revealer and sets it to active or inactive.
    void
    trSetShadowFarClip(boolean enabled, float distance)
    Enable or disables the shadow far clippping plane.
    void
    trSetShowCursor(boolean show)
    forces the cursor (mouse pointer) to be shown/hidden.
    void
    trSetTeamsLocked(boolean locked)
    Toggles locked teams state for this scenario.
    void
    Creates a counter (even if a display counter already exists), and sets it's display text.
    void
    trSetUniqueCounterDisplayWithType(String name, String message, int specialCounterType)
    Creates a counter (even if a display counter already exists), and sets it's display text.
    void
    Sets whether or not units can do their idle processing.
    void
    trSetUserControls(boolean active)
    sets the player controls on or off.
    void
    trSetVictoryPlayers(int[] playerList)
    sets the provided players as victorious
    void
    trShowChoiceDialog(String maintext, String text1, int event1, String text2, int event2)
    displays dialog with 2 choices, and activates a trigger in response
    void
    trShowChoiceDialogForPlayer(int playerID, String maintext, String text1, int event1, String text2, int event2)
    displays dialog with 2 choices for a given player, and activates a trigger in response
    void
    trShowHidePopup(int type, boolean display)
    toggles a popup.
    void
    trShowImageDialog(String imagePath, String subtitle)
    displays a custom image in a dialog, with a subtitle
    void
    trShowLosePopup(String text, String soundfile, boolean ignoreUserControlsState)
    message and sound.
    void
    trShowTextMessage(String noteTitle, String noteText)
    Displays a text box with the specified title and text.
    void
    trShowWinLose(String text, String soundfile, boolean ignoreUserControlsState)
    message and sound.
    void
    trShowWinPopup(String text, String soundfile, boolean ignoreUserControlsState)
    message and sound.
    void
    trSocketBuild(int playerID, int socketID, String protoName)
    Auto-constructs a building over a given socket unit.
    boolean
    trSocketIsEmpty(int unitID)
    Returns true if there isn't a fully-built building occupying the specified socket.
    int
    trSocketPlaceFoundation(int playerID, int socketID, String protoName)
    Places a foundation into this socket unit.
    void
    trSoundPlayDialogue(int playerID, String msgStrID, String speakerStrID, String portraitStrID, String sound, int eventID, boolean ignoreOnAbort, int timeoutMs, boolean overrideSoundLength)
    Plays the sound associated with the dialogue.
    void
    trSoundPlayDialogueTalkingHeads(int playerID, String msgStrID, String speakerStrID, String portraitLeftSideStrID, String portraitRightSideStrID, boolean speakerIsLeftSide, String sound, int eventID, boolean ignoreEventOnAbort, int eventDelaySeconds)
    Plays the sound associated with the dialogue, using the talking heads version of the UI.
    void
    trSoundPlayFN(String filename, int eventID, String subtitle, String portrait)
    Plays the sound associated with the filename.
    void
    trSoundPlayPaused(String filename, String seconds, int eventID, String subtitle, String portrait)
    Plays the sound associated with the filename.
    void
    trSoundsetPlay(String soundsetName)
    Plays the sound associated with the given soundset.
    void
    trSoundsetPlayPlayer(int playerID, String soundsetName)
    Plays the sound associated with the given soundset for the given player.
    void
    trSoundTimer(int ms, int eventID)
    trSoundTimer(int32 milliseconds, int32 eventID) creates a high performance sound timer and passes the eventID as data.
    void
    trTechHideEffects(int techID, int playerID, boolean display)
    sets whether or not effects should be hidden in the rollover for the given technology for this scenario only.
    void
    trTechModifyCost(int techID, int playerID, int resourceID, float delta, int techRelativity)
    modifies the cost of the given technology for this scenario only.
    void
    trTechModifyResearchPoints(int techID, int playerID, float delta, int techRelativity)
    modifies the reseach points of the given technology for this scenario only.
    void
    trTechRemove(int playerID, String protoUnitName, int techID)
    disables the given tech for the player, and removes it from the UI of the given protoUnit.
    void
    trTechReplaceIconByTech(int techID, int playerID, int iconTechID)
    replaces the icon of a technology for this scenario only.
    void
    trTechSetIconPath(int techID, int playerID, String iconPath)
    replaces the icon of a technology for this scenario only.
    void
    trTechSetStatus(int playerID, int techID, int status)
    sets the tech status for the player.
    void
    trTechSetStringID(int techID, int playerID, String stringID, int techStringFieldIdx)
    sets a given string field of a technology to the given string ID for this scenario only.
    boolean
    trTechStatusActive(int playerID, int techID)
    returns true if tech is active for player.
    boolean
    trTechStatusCheck(int playerID, int techID, int status)
    returns true if tech's status is techStatus.
    boolean
    trTechStatusResearching(int playerID, int techID)
    returns true if tech is being researched for player.
    boolean
    trTeleportAreaUnitsToTargetArea(int playerID, String unitTypeName, int fromUnitID, float fromUnitRange, int targetUnitID, float targetUnitRange)
    teleport from unit to unit
    boolean
    trTerrainAtPosition(String subTypeName, Vector position)
    checks if the terrain at the given map position matches the expected terrain subtype.
    boolean
    trTownBellRung(int unitID)
    returns true if town bell has been recently rung on the given unit.
    boolean
    trTownBellUnrung(int unitID)
    returns true if town bell has been recently unrung on the given unit.
    void
    Completes tutorial, and displays prompt to progress to next campaign or return to main menu.
    void
    trUIBlockMinimapExpansion(boolean blocked)
    blocks the minimap from expanding.
    void
    trUIBlockRadialMenu(int menuIndex, boolean display)
    blocks a given radial menu.
    void
    trUIFadeToColor(int r, int g, int b, int duration, int delay, boolean inout, int eventID)
    fade in/out using color specified.
    void
    trUIFlashAbility(String puCmdName, boolean flash)
    flashes the button of a given unit ability in command panel UI.
    void
    trUIFlashAgeUp(boolean flash)
    flashes the age-up button in command panel UI, if applicable.
    void
    trUIFlashCommand(String puCmdName, boolean flash)
    flashes the button of a given protoUnitCommand in command panel UI.
    void
    trUIFlashGodPowerAtSlot(int slotIdx, boolean flash)
    flashes the god power at a given gp slot.
    void
    trUIFlashTech(int techID, boolean flash)
    flashes the button of a given technology in command panel UI.
    void
    trUIFlashTrain(String protoName, boolean flash)
    flashes the button of a given protoUnit in command panel UI.
    void
    trUIGamepadPromptFlash(int promptIndex, boolean flash)
    toggles flashing state for a given gamepad prompt.
    void
    trUIGamepadPromptVisibility(int promptIndex, boolean display)
    toggles visibility for a given gamepad prompt.
    void
    hides the radial menu prompt panel.
    void
    trUIIdleBannerFlash(int bannerIndex, boolean flash)
    toggles flashing state on Minimap gadget.
    void
    trUIMinimapFlash(boolean flash)
    toggles flashing state on Minimap gadget.
    void
    trUIPanelFlash(int panelIndex, boolean flash)
    toggles flashing state for a given HUD panel.
    void
    trUIPanelVisibility(int panelIndex, boolean display)
    toggles visibility for a given HUD panel.
    void
    trUIResourceEntryFlash(int entryIndex, boolean flash)
    toggles flashing state for a given resource entry in the HUD resoruces panel.
    void
    trUIVillagerPriorityButtonFlash(int buttonIndex, boolean flash)
    toggles flashing state on a given Villager Priority Dialog button.
    void
    toggles flashing state on HUD Villager Priority Dialog button.
    void
    Unblocks all ambient sounds that were previously blocked from playing.
    void
    Unblocks all sounds that were previously blocked from playing.
    boolean
    trUnforbidProtounit(int player, String protoname)
    removes protounit from the forbidden list
    void
    trUnitAddModifier(int modifyType, int dmgType, float amount, float duration)
    adds modifier for given modify type and parameter, when applicable, to selected units.
    void
    trUnitAdjustModifier(int modifyType, int dmgType, float delta, int relativity)
    adjust existing modifier for given modify type and parameter, when applicable, to selected units.
    boolean
    Returns true if all selected units are alive.
    void
    trUnitApplyEffect(int effectID, float duration)
    applys a given effect towards the selected units.
    void
    trUnitApplyEffectDamage(int effectID, float duration, float damage, int dmgType)
    applys a given effect with a damage value towards the selected units.
    void
    trUnitApplyEffectProtoUnit(int effectID, float duration, int playerID, String protoName)
    applys a given effect towards the selected units.
    boolean
    trUnitBuildUnit(String protoName, Vector position, Vector forward)
    Selects units and makes the build a unit at specified location.
    void
    Cancels all queued items for the unit.
    void
    set an override name for a specific unit
    void
    trUnitChangeProtoUnit(String protoName, boolean skipBirth, boolean forceFoundation)
    changes the proto unit for a given set of units.
    void
    trUnitConvert(int playerID)
    converts the selected units to player.
    int
    trUnitCreate(String protoName, float x, float y, float z, int heading, int playerID, boolean skipBirth)
    creates a new unit.
    int
    trUnitCreateForced(String protoName, float x, float y, float z, int heading, int playerID, boolean skipBirth)
    creates a new unit, ignoring placement rules.
    boolean
    trUnitCreateFromSource(String protoName, int srcUnitID, int trgUnitID, int playerID)
    creates a new unit.
    boolean
    trUnitCreateFromSourceMulti(String protoName, int srcUnitID, int trgUnitID, int playerID, int count)
    creates multiple units from a source object.
    boolean
    Returns true if all selected units are dead.
    void
    activates delayed transform (e.g.
    boolean
    trUnitDelete(boolean remove)
    removes or kills the selected unit(s).
    boolean
    trUnitDestroy(boolean ejectContained)
    destroys the selected unit(s).
    float
    trUnitDistanceToPoint(float x, float y, float z)
    Returns the shortest distance between the trRT units and the point.
    float
    Returns the shortest distance between the trRT units and the given unit.
    boolean
    trUnitDoWorkOnUnit(int unitID, int eventID)
    Tasks the selected unit(s) to perform work on the given unit.
    boolean
    trUnitFaceUnit(int unitID, int eventID)
    Moves the selected unit(s) to face the given unit.
    boolean
    Returns true if all selected units are fully built.
    void
    trUnitGameSelect(boolean clear)
    selects the given units for the current player
    boolean
    trUnitGarrison(int unitID, int eventID)
    Tasks the selected unit(s) to garrision into another unit.
    int
    trUnitGetHeading(int unitID)
    returns the units heading.
    int
    Fetches number of selected units.
    int
    Returns the playerID of the first selected unit that is valid.
    int
    Returns the playerID of the provided unitID.
    trUnitGetPosition(int unitID)
    returns the unit's position.
    int
    trUnitGetTargetID(int srcUnit, boolean actionOnly)
    Returns the attack target for the given unit.
    boolean
    trUnitHasLOS(int playerID)
    returns true if the player can see the selected unit, otherwise returns false.
    boolean
    trUnitHasTarget(boolean actionOnly)
    Returns true if all selected units have an attack target or are attacking.
    void
    trUnitHighlight(float duration, boolean flash)
    does something to highlight the units selected.
    boolean
    Returns true if all selected units are immobilized by a Freeze Action.
    boolean
    trUnitInLush(int playerID)
    Returns true if all selected units are within terrain lush belonging to the given player.
    boolean
    Returns true if all selected units are attacking.
    boolean
    trUnitIsNotOwnedBy(int playerID)
    determines if the selected units are not owned by the player specified.
    boolean
    trUnitIsOwnedBy(int playerID)
    determines if the selected units are owned by the player specified.
    boolean
    returns if the specified unit is selected.
    void
    trUnitMakeInvulnerable(boolean bEnable)
    Makes a unit invulnerable to damage.
    void
    trUnitModifyResourceInventory(int resourceID, float delta, int relativity)
    modifies resource inventory for the selected units.
    boolean
    trUnitMoveFromArea(float x, float y, float z, int eventID, boolean bAttackMove, int playerID, String unitType, float radius)
    Moves all matching units near the selected unit(s) to the given position.
    boolean
    trUnitMoveFromAreaToUnit(int unitID, boolean bAttackMove, int playerID, String unitType, float radius)
    Moves all matching units near the selected unit(s) to the given target unit.
    boolean
    trUnitMoveToPoint(float x, float y, float z, int eventID, boolean bAttackMove, boolean bUnitRun, float runSpeedMultiplier)
    Moves the selected unit(s) to the given position.
    boolean
    trUnitMoveToUnit(int unitID, int eventID, boolean bAttackMove, boolean bUnitRun, float runSpeedMultiplier)
    Moves the selected unit(s) to the spot occupied by the given unit.
    void
    trUnitMutate(String protoName, boolean fullHitpoints)
    transforms selected units into the given protoUnit through PU mutation, maintaining original BUnit pointer.
    int
    returns the current number of living units selected by the trigger manager.
    boolean
    trUnitPatrolToPoint(float x, float y, float z, boolean bUnitRun, float runSpeedMultiplier)
    Moves the selected unit(s) to the given position.
    int
    returns the percent complete as 0 to 100
    float
    returns the percent damaged as 0 to 100
    void
    trUnitPerformAction(String actionName, int targetID, Vector targetPos, boolean bypassCharge)
    performs a given protoAction through the selected units.
    void
    trUnitPlayerFakifyInArea(int fakePlayerIndex, int srcPlayerID, String unitTypeName, float range)
    Sets all units within dist of the selected ref object as having the fake player with the specified index (0-7).
    void
    Removes the current control action so the next thing can take effect immediately.
    boolean
    trUnitReposition(float x, float y, float z, boolean disableTying, boolean immediate)
    sets the position for the selected units to the given absolute coordinates.
    boolean
    trUnitRepositionToUnit(int unitID, boolean disableTying, boolean immediate)
    sets the position for the selected units to the coordinates of the given unit.
    void
    trUnitReveal(int playerID, boolean reveal)
    Reveals the currently selected units to the given player.
    boolean
    trUnitRotateX(int degrees, boolean disableTying)
    rotates the selected units around the X axis by the given amount of degrees.
    boolean
    trUnitRotateY(int degrees, boolean disableTying)
    rotates the selected units around the Y axis by the given amount of degrees.
    boolean
    trUnitRotateZ(int degrees, boolean disableTying)
    rotates the selected units around the Z axis by the given amount of degrees.
    void
    trUnitSelectByID(int unitID)
    'Selects' the unit in the trigger selection system.
    void
    Clears the units in the trigger selection system.
    boolean
    trUnitSetAnimation(String animName, int versionIndex, boolean loop, int eventID, boolean destroyOnNextControlAction)
    Sets the cinematic animation version for the selected unit(s).
    boolean
    trUnitSetAnimationPath(String animName, String animPath, boolean loop, int eventID, boolean destroyOnNextControlAction)
    Sets the cinematic animation version for the selected unit(s).
    void
    trUnitSetConvertible(int playerID, boolean forbid)
    sets forbid conversion accordingly for the selected units towards the given player.
    void
    trUnitSetFlag(int flagID, boolean set)
    Sets or unsets the provided flagID for the selected unitIDs.
    void
    trUnitSetGatherPointPosForPlayer(int playerID, int sourceID, float x, float y, float z)
    Sets the gather point of the unit on this position.
    void
    trUnitSetGatherPointUnitForPlayer(int playerID, int sourceID, int targetID)
    Sets the gather point of the unit on this unit.
    boolean
    trUnitSetHeading(int degrees)
    sets the units heading.
    void
    trUnitSetHitpoints(float value)
    set the units' hitpoints to the given value, respecting maximum hitpoints.
    boolean
    trUnitSetOrientationForward(int degrees, boolean disableTying)
    rotates the selected units around the Y axis by the given amount of degrees.
    boolean
    trUnitSetOrientationRight(int degrees, boolean disableTying)
    rotates the selected units around the Z axis by the given amount of degrees.
    boolean
    trUnitSetOrientationUp(int degrees, boolean disableTying)
    rotates the selected units around the X axis by the given amount of degrees.
    boolean
    trUnitSetPassiveMode(boolean enable)
    enables or disables Passive Mode for selected Units.
    void
    trUnitSetScale(float x, float y, float z)
    sets the scale for the given set of units.
    void
    trUnitSetShading(int shadingType, float opacity)
    assign the given shading type with the set opacity to the selected units.
    void
    trUnitSetShieldPoints(float value)
    set the units' shield points to the given value, respecting maximum shield points.
    void
    set the stance for the given set of units.
    void
    trUnitSetTactic(int tacticDBID)
    set the tactic for the given set of units.
    boolean
    trUnitSetVariation(int variation)
    sets the variation for the selected units to the given value.
    void
    Sets the veterancy level for the selected units to the given rank, whenever applicable.
    float
    returns the percent damaged for the selected unit's shield as 0 to 100
    boolean
    trUnitTeleport(float x, float y, float z)
    moves units from current position to position specified
    boolean
    Teleport the selected unit(s) to the spot occupied by the given unit.
    void
    trUnitThrow(int direction, float distance, int numBounces, float maxHeight, float maxVelocity, float spinPeriod)
    Throws the selected units with the provided parameters.
    void
    performs the transformation defined by the unit's transform command (e.g.
    boolean
    returns if the cursor is hovering over the given unit type.
    boolean
    trUnitTypeIsSelected(String proto, boolean checkIdle)
    returns if at least one unit of the specified unit type is selected.
    void
    ungarrisons all contained units.
    boolean
    returns true if the player can see the selected unit, and it is on screen.
    boolean
    trWaterAtPosition(String waterTypeName, Vector position)
    checks if the water at the given map position matches the expected water type.
    void
    Adds the waypoint into the trigger selection system.
    void
    Adds the unit's position as a waypoint in the trigger selection system.
    void
    Clears the waypoints in the trigger selection system.
    void
    trWorldSpacePrompt(String id, int unitID, boolean showColor, String stringID, Vector offset, String attachPoint)
    show a world space prompt over a selected unit.
    void
    trWorldSpacePromptArea(String id, Vector location, String stringID, Vector offset)
    show a world space prompt in selected location.
    void
    trWorldSpacePromptArmy(String id, String armyName, boolean showColor, String stringID, Vector offset)
    show a world space prompt over a selected army.
    void
    hide a world space prompt.
    boolean
    trWPFDialogOpen(int wpdDialogID)
    returns true if the given WPF dialog is currently open.
    float
    xsBoolToFloat(boolean b)
    Casts a bool to a float (1.0 if true, 0.0 if false).
    int
    xsBoolToInt(boolean b)
    Casts a bool to an int (1 if true, 0 if false).
    xsBoolToString(boolean b)
    Casts a bool to a string.
    void
    Disables the given rule.
    void
    xsDisableRuleGroup(String ruleGroupName)
    Disables all rules in the given rule group.
    void
    Disables the current rule.
    void
    Prints the time in milliseconds that elapsed since the timer was last started.
    void
    xsEnableRule(String ruleName)
    Enables the given rule, sets the last execution time to current time.
    void
    xsEnableRuleGroup(String ruleGroupName)
    Enables all rule in the given rule group.
    boolean
    xsFloatToBool(float f)
    Casts a float to a bool (false if == 0.0, true otherwise).
    int
    xsFloatToInt(float f)
    Casts a float to an int, truncating the fractional part.
    xsFloatToString(float f)
    Casts a float to a string.
    int
    Returns the current context player ID.
    int
    Returns the current gametime (in seconds).
    int
    Returns the current gametime (in milliseconds).
    boolean
    xsIntToBool(int i)
    Casts an int to a bool (false if == 0, true otherwise).
    float
    xsIntToFloat(int i)
    Casts an int to a float.
    Casts an int to a string.
    boolean
    Returns true if the rule is enabled.
    boolean
    Returns true if any rule in the group is enabled.
    boolean
    xsRandBool(float chanceTrue)
    Returns true with a probability of trueChance in [0.0, 1.0], and false otherwise.
    float
    xsRandFloat(float min, float max)
    Returns a random floating point number in the range (inclusive).
    int
    Gets the current seed of the random number generator.
    int
    xsRandInt(int min, int max)
    Returns a random integer number in the range (inclusive).
    void
    xsRandSetSeed(int seed)
    Sets the seed of the random number generator.
    void
    Ignores the next interval and updates as soon as possible.
    void
    Ignores the next interval and updates as soon as possible.
    void
    xsSetContextPlayer(int playerID)
    Sets the current context player ID (DO NOT DO THIS IF YOU DO NOT KNOW WHAT YOU ARE DOING).
    void
    xsSetRuleMaxInterval(String ruleName, int maxInterval)
    Sets the max interval of the given rule, in seconds.
    void
    xsSetRuleMaxIntervalMS(String ruleName, int maxIntervalMS)
    Sets the max interval of the given rule, in milliseconds.
    void
    xsSetRuleMaxIntervalSelf(int maxInterval)
    Sets the max interval of the current rule, in seconds.
    void
    xsSetRuleMaxIntervalSelfMS(int maxIntervalMS)
    Sets the max interval of the current rule, in milliseconds.
    void
    xsSetRuleMinInterval(String ruleName, int minInterval)
    Sets the min interval of the given rule, in seconds.
    void
    xsSetRuleMinIntervalMS(String ruleName, int minIntervalMS)
    Sets the min interval of the given rule, in milliseconds.
    void
    xsSetRuleMinIntervalSelf(int minInterval)
    Sets the min interval of the current rule, in seconds.
    void
    xsSetRuleMinIntervalSelfMS(int minIntervalMS)
    Sets the min interval of the current rule, in milliseconds.
    void
    xsSetRulePriority(String ruleName, int priority)
    Sets the priority of the given rule.
    void
    xsSetRulePrioritySelf(int priority)
    Sets the priority of the current rule.
    void
    Starts the timer.
    xsStringCharAt(String s, int index)
    Returns the character at the given index of a string as a string(or an empty string on invalid index).
    boolean
    xsStringContains(String s, String sub, boolean caseSensitive)
    Returns true if the given substring is present in the string, and false otherwise.
    boolean
    xsStringEndsWith(String s, String sub, boolean caseSensitive)
    Returns true if the string ends with the given substring, and false otherwise.
    int
    xsStringFindFirst(String s, String sub, int startIdx, boolean caseSensitive)
    Returns the index of the first occurrence of a string in another string, searching from the given index.
    int
    xsStringFindLast(String s, String sub, int startIdx, boolean caseSensitive)
    Returns the index of the last occurrence of a string in another string, searching backwards from the given index.
    int
    Returns the length of a string.
    boolean
    xsStringStartsWith(String s, String sub, boolean caseSensitive)
    Returns true if the string starts with the given substring, and false otherwise.
    xsStringSubstring(String s, int startIdx, int endIdx)
    Returns a substring in the range of the given indices (inclusive) for a string.
    boolean
    Parses a bool from a string(returning false on invalid input).
    float
    Parses a float from a string(returning 0.0 on invalid input).
    int
    Parses an integer from a string(returning 0 on invalid input).
    Returns a string in lower case.
    Returns a string in upper case.
    float
    Returns the angle of a vector around the Y axis in radians.
    float
    Returns the (smaller) angle between two vectors in radians.
    xsVectorCreate(float x, float y, float z)
    Set the 3 components into a vector, returns the new vector.
    Returns the cross product of two vectors.
    float
    Returns the distance between two vectors.
    float
    Returns the squared distance between two vectors.
    float
    xsVectorDistanceToLine(Vector v, Vector pointOnLine, Vector dir)
    Returns the distance between a point and a line defined by a point on the line and a direction.
    float
    Returns the distance between a point and a line defined by two points.
    float
    Returns the distance between two vectors without considering the Y dimension.
    float
    Returns the squared distance between two vectors without considering the Y dimension.
    float
    Returns the dot product of two vectors.
    float
    Returns the length of the given vector.
    Returns a normalized copy of the given vector.
    xsVectorRotateXZ(Vector v, float theta, Vector offset)
    Returns a rotated copy of the vector on the XZ plane by a given angle.
    xsVectorTranslateXZ(Vector v, float radius, float theta)
    Returns a translated copy of the vector on the XZ plane by the given radius and angle.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AutoGeneratedFromDoxygen

      public AutoGeneratedFromDoxygen()
  • Method Details

    • aiAddEchoCategory

      public int aiAddEchoCategory(String categoryName)
      Adds a category with the provided categoryName to the AI Debug Output window, must be a unique name. The int it returns is the ID of the new category that can be used for category output + plan creates.
    • aiEcho

      public void aiEcho(String text)
      Adds this text to the AI Debug Output window in the "All" category.
    • aiEchoCategory

      public void aiEchoCategory(int categoryIndex, String text)
      Adds this text to the AI Debug Output window in the "All" category and in the provided categoryIndex.
    • aiEchoWarning

      public void aiEchoWarning(String text)
      Adds this text to the AI Debug Output window in the "All" and "Warnings" categories. Additionally prefixes the message with "WARNING: ". Makes the XSDebugger break if the DebugAIScript config is set.
    • aiErrorMessage

      public void aiErrorMessage(String text)
      Opens up an error window with the text.
    • aiErrorMessageID

      public void aiErrorMessageID(String stringID)
      Opens up an error window with the text belonging to the stringID.
    • aiPlanCreate

      public int aiPlanCreate(String planName, int type, int parentPlanID, int outputCategoryID)
      Creates a plan with the name and type, assigns it as a child of parentPlanID if provided. outputCategoryID sets the channel it outputs to (alongside "All").
    • aiPlanDestroy

      public void aiPlanDestroy(int planID)
      Sets the destroy flag on the plan assigned to the planID. This won't notify any potential parent plans.
    • aiPlanDestroyByName

      public void aiPlanDestroyByName(String planName)
      Sets the destroy flag on the plan assigned to the planName. This won't notify any potential parent plans.
    • aiPlanSetState

      public void aiPlanSetState(int planID, int planState)
      Sets the plan state, "cPlanState" constants. Setting a plan state like this has a lot of consequences for the plan (different for each type and state). It's mainly exposed because setting a plan to done/failed will properly notify any parent plan of the child being "finished" unlike the "Destroy" syscalls. Handy to know: setting a plan to done/failed sets the destroy flag which means 1 frame later it will be destroyed.
    • aiPlanSetOutputCategory

      public void aiPlanSetOutputCategory(int planID, int outputCategoryID)
      Sets the provided planID's output category to the provided outputCategoryID.
    • aiPlanGetIDByName

      public int aiPlanGetIDByName(String searchStr, boolean subString)
      Returns the ID of the plan with the exact searchStr name. If subString is true it will return the first plan that has the searchStr in its name.
    • aiPlanGetNumberByType

      public int aiPlanGetNumberByType(int planType)
      Returns the number of plans for the provided planType, doesn't include plans that are going to be destroyed.
    • aiPlanGetIDByTypeIndex

      public int aiPlanGetIDByTypeIndex(int planType, int index)
      Returns the planID at the provided index from the list of plans that we have for the provided planType. Use in combination with aiPlanGetNumberByType to know how many indexes there are.
    • aiPlanGetNumberByTypeAndState

      public int aiPlanGetNumberByTypeAndState(int planType, int planState)
      Returns the number of plans for the provided planType + planState, doesn't include plans that are going to be destroyed.
    • aiPlanGetIDByTypeAndState

      public int aiPlanGetIDByTypeAndState(int planType, int planState, int index)
      Returns the planID at the provided index from the list of plans that we have for the provided planType + planState. Use in combination with aiPlanGetNumberByTypeAndState to know how many indexes there are.
    • aiPlanGetNumberByTypeAndVariableIntValue

      public int aiPlanGetNumberByTypeAndVariableIntValue(int planType, int varIndex, int variableValue)
      Returns the number of plans that have an integer value at the provided varIndex that matches the provided variableValue. It searches through all the variableValue indexes to find the value. Doesn't include plans that are going to be destroyed. Attention: this can only be used for varIndexes that hold integer type variableValues!
    • aiPlanGetIDByTypeAndVariableIntValue

      public int aiPlanGetIDByTypeAndVariableIntValue(int planType, int varIndex, int variableValue, int index)
      Return the planID at the provided index from the list of plans that we have for the provided planType + varIndex + variableValue. Use in combination with aiPlanGetNumberByTypeAndVariableIntValue to know how many indexes there are. Attention: this can only be used for varIndexes that hold integer type variableValues!
    • aiPlanGetIDsByType

      public int[] aiPlanGetIDsByType(int planType)
      Returns all the plan IDs for the provided planType, doesn't include plans that are going to be destroyed.
    • aiPlanGetIDsByTypeAndState

      public int[] aiPlanGetIDsByTypeAndState(int planType, int planState)
      Returns all the plan IDs for the provided planType + planState, doesn't include plans that are going to be destroyed.
    • aiPlanGetIDsByTypeAndVariableIntValue

      public int[] aiPlanGetIDsByTypeAndVariableIntValue(int planType, int varIndex, int variableValue)
      Returns all the plan IDs for the provided planType + varIndex + variableValue (int), doesn't include plans that are going to be destroyed. It searches through all the variableValue indexes to find the value.
    • aiPlanGetIDsByTypeAndVariableFloatValue

      public int[] aiPlanGetIDsByTypeAndVariableFloatValue(int planType, int varIndex, float variableValue)
      Returns all the plan IDs for the provided planType + varIndex + variableValue (float), doesn't include plans that are going to be destroyed. It searches through all the variableValue indexes to find the value.
    • aiPlanGetIDsByTypeAndVariableBoolValue

      public int[] aiPlanGetIDsByTypeAndVariableBoolValue(int planType, int varIndex, boolean variableValue)
      Returns all the plan IDs for the provided planType + varIndex + variableValue (bool), doesn't include plans that are going to be destroyed. It searches through all the variableValue indexes to find the value.
    • aiPlanGetIDsByTypeAndVariableStringValue

      public int[] aiPlanGetIDsByTypeAndVariableStringValue(int planType, int varIndex, String variableValue)
      Returns all the plan IDs for the provided planType + varIndex + variableValue (string), doesn't include plans that are going to be destroyed. It searches through all the variableValue indexes to find the value.
    • aiPlanGetIDsByTypeAndVariableVectorValue

      public int[] aiPlanGetIDsByTypeAndVariableVectorValue(int planType, int varIndex, Vector variableValue)
      Returns all the plan IDs for the provided planType + varIndex + variableValue (vector), doesn't include plans that are going to be destroyed. It searches through all the variableValue indexes to find the value.
    • aiPlanGetActiveCount

      public int aiPlanGetActiveCount(boolean ignoreChildPlans)
      Returns the number of plans we have, doesn't include plans that are going to be destroyed. If ignoreChildPlans is true it ignores all plans that have a parent.
    • aiPlanGetIDByActiveIndex

      public int aiPlanGetIDByActiveIndex(int activeIndex, boolean ignoreChildPlans)
      Return the planID at the provided index from the list of active plans that we have. Use in combination with aiPlanGetActiveCount to know how many indexes there are.
    • aiPlanGetIsIDValid

      public boolean aiPlanGetIsIDValid(int planID)
      Returns if the provided planID is valid. If you store plan IDs over multiple frames this is handy to call to make sure the ID is still valid and you won't get warnings using it.
    • aiPlanGetName

      public String aiPlanGetName(int planID)
      Returns the name of the provided planID.
    • aiPlanGetType

      public int aiPlanGetType(int planID)
      Returns the type of the provided planID.
    • aiPlanGetParentID

      public int aiPlanGetParentID(int planID)
      Returns the parentID of the provided planID.
    • aiPlanGetState

      public int aiPlanGetState(int planID)
      Returns the state of the provided planID.
    • aiPlanGetPriority

      public int aiPlanGetPriority(int planID)
      Returns the priority of the provided planID.
    • aiPlanGetUnitTypes

      public int[] aiPlanGetUnitTypes(int planID)
      Returns the unit types assigned to the provided planID.
    • aiPlanGetNumberNeededUnits

      public int aiPlanGetNumberNeededUnits(int planID, int unitTypeID)
      Returns the number of needed units for provided planID. unitTypeID can be left -1 if you don't want to search for any specific type.
    • aiPlanGetNumberWantedUnits

      public int aiPlanGetNumberWantedUnits(int planID, int unitTypeID)
      Returns the number of wanted units for provided planID. unitTypeID can be left -1 if you don't want to search for any specific type.
    • aiPlanGetNumberMaxUnits

      public int aiPlanGetNumberMaxUnits(int planID, int unitTypeID)
      Returns the number of max units for provided planID. unitTypeID can be left -1 if you don't want to search for any specific type.
    • aiPlanGetNumberUnits

      public int aiPlanGetNumberUnits(int planID, int unitTypeID, boolean countLoans)
      Returns the number of unitTypeID units currently assigned to the provided planID. If unitTypeID is set to -1 it will instead just return an unfiltered total. If countLoans is set to true it will also count loaned out units.
    • aiPlanGetUnitIDByIndex

      public int aiPlanGetUnitIDByIndex(int planID, int index)
      Returns the unitID at the provided index for the provided planID. Use in combination with an unfiltered and not counting loans aiPlanGetNumberUnits to know how many indexes there are.
    • aiPlanGetUnits

      public int[] aiPlanGetUnits(int planID, int unitTypeID, boolean countLoans, int[] excludeTypes)
      Returns the units of unitTypeID currently assigned to the provided planID. If unitTypeID is set to -1 it will instead just return all units. If countLoans is set to true it will also return loaned out units.
    • aiPlanGetCurrentPopulation

      public int aiPlanGetCurrentPopulation(int planID, int unitTypeID, boolean countLoans)
      Returns how much population the units in the provided planID are currently taking up. If unitTypeID is set to -1 it will consider all units. If countLoans is set to true it will also consider loaned out units.
    • aiPlanGetLocation

      public Vector aiPlanGetLocation(int planID, boolean firstUnit)
      Returns the location for provided planID. How this position is calculated depends on different factors: If there are units in the plan (not loaned out) it returns the center position of all units. IMPORTANT: the center position can be on a different areaGroupID than the units themselves are, think units standing around a small lake.If firstUnit is true it will return the position of the unit at index 0 instead (if we have units). This is often used when we want a position that we then use for any area lookups since we know it will be on the same areaGroupID as the plan is. If there are no units in the plan we get the following: If the plan has an initialPosition set that will be returned. If the plan has a valid baseID set it will return the position of the base. If you don't want any of these "Backup" positions then first use aiPlanGetNumberUnits(planID, -1, false). If none work out we return cInvalidVector.
    • aiPlanGetInitialPosition

      public Vector aiPlanGetInitialPosition(int planID)
      Returns the initial position for the provided planID.
    • aiPlanGetBaseID

      public int aiPlanGetBaseID(int planID)
      Returns the baseID for the provided planID, this doesn't reset itself if the base goes invalid.
    • aiPlanGetOutputCategoryID

      public int aiPlanGetOutputCategoryID(int planID)
      Returns the output category ID for the provided planID.
    • aiPlanSetName

      public void aiPlanSetName(int planID, String name)
      Sets the name for the provided planID.
    • aiPlanSetPriority

      public void aiPlanSetPriority(int planID, int priority)
      Sets the priority for the provided planID.
    • aiPlanSetParentID

      public void aiPlanSetParentID(int planID, int parentPlanID, boolean persistentChild)
      Makes the provided planID a child of the provided parentPlanID. If the provided planID had children of its own then those are destroyed and the units returned to the planID (unless such a child was a persistent child in which case it becomes it own plan without any parent/child). All units then left in the provided planID are returned to the old parent of the planID if it has one. If persistentChild is set to true it will make the provided planID a persistent child.
    • aiPlanRemoveParent

      public void aiPlanRemoveParent(int planID)
      Removes the parent plan from the provided planID. If the provided planID had children of its own then those are destroyed and the units returned to the planID (unless such a child was a persistent child in which case it becomes it own plan without any parent/child).
    • aiPlanGetNumberChildren

      public int aiPlanGetNumberChildren(int parentPlanID)
      Returns the number of child plans the provided parentPlanID has. This INCLUDES plans that will be destroyed, so filter for that flag if needed.
    • aiPlanGetChildIDByIndex

      public int aiPlanGetChildIDByIndex(int parentPlanID, int index)
      Returns the planID of the child plan at the provided index of the provided parentPlanID, use in combination with aiPlanGetNumberChildren to know how many indexes there are.
    • aiPlanHasUnitType

      public boolean aiPlanHasUnitType(int planID, int unitTypeID)
      Returns if the provided planID already has the provided unitTypeID added.
    • aiPlanAddUnitType

      public void aiPlanAddUnitType(int planID, int unitTypeID, int numberNeed, int numberWant, int numberMax, boolean relative, boolean popImmediately)
      Adds a unit type to the plan, you MUST do this before assigning any unit or the plan won't allow them to be assigned. If relative is set to false these new numbers won't be added onto the previous numbers, but will overwrite the previous numbers instead. If popImmediately is set it will instantly remove any units from the plan that may now be excessive (if you lowered the numbers). If popImmediately is not set and you go above the max the standard periodic unit assignment will do it.
    • aiPlanAddUnit

      public boolean aiPlanAddUnit(int planID, int unitID)
      Adds the provided unitID to the provided planID. If the unitID is currently in the parent plan of the provided planID then the unit will automatically be loaned. If we end up loaning then you don't need to manually call aiPlanAddUnitType, it's automatically done for the unit. You are allowed to directly assign to a child plan without first assigning to the parent plan, if the child plan is done the unit will just not return to the parent and become unassigned.
    • aiPlanRemoveUnit

      public void aiPlanRemoveUnit(int planID, int unitID)
      Removes the provided unitID from the provided planID. It is then assigned back to the next plan it has in its stack, if it has any.
    • aiPlanRemoveUnitFromAllPlans

      public void aiPlanRemoveUnitFromAllPlans(int unitID)
      Removes the provided unitID from all plans it's in.
    • aiPlanSetInitialPosition

      public void aiPlanSetInitialPosition(int planID, Vector position)
      Sets the initial position for the provided planID. The initial position of a plan is actually unused apart from using aiPlanGetPosition backup. It's currently also used for plans that are bound to a waterAreaGroupID to identify that area group but this will change soonish.
    • aiPlanSetWaypoints

      public void aiPlanSetWaypoints(int planID, int pathID)
      Sets the waypoints of the provided planID to the waypoints of the given path. Waypoints are only used for explore plans to make the scouts go to custom vectors.
    • aiPlanAddWaypoint

      public void aiPlanAddWaypoint(int planID, Vector waypoint)
      Adds the waypoint to the provided planID. Waypoints are only used for explore plans to make the scouts go to custom vectors.
    • aiPlanSetBaseID

      public void aiPlanSetBaseID(int planID, int baseID)
      Sets the baseID for the provided planID.
    • aiPlanResetBaseID

      public void aiPlanResetBaseID(int planID)
      Sets the baseID for the provided planID to -1.
    • aiPlanGetNumberVariableValues

      public int aiPlanGetNumberVariableValues(int planID, int variableIndex)
      Returns the number of valueIndexes that can be set for the provided variableIndex for the provided planID. You can increase this (not above the maximum) via aiPlanSetNumberVariableValues.
    • aiPlanSetNumberVariableValues

      public void aiPlanSetNumberVariableValues(int planID, int variableIndex, int numberValues, boolean clearCurrentValues)
      Sets the number of possible valueIndexes(numberValues) for the provided variableIndex for the provided planID. If clearCurrentValues is set the values currently present will be reset.
    • aiPlanRemoveVariableValue

      public void aiPlanRemoveVariableValue(int planID, int variableIndex, int valueIndex)
      Removes the valueIndex for the provided variableIndex for the provided planID. Note here that this is a completely removal and the number of values will decrease too.
    • aiPlanSetVariableInt

      public void aiPlanSetVariableInt(int planID, int variableIndex, int valueIndex, int value)
      Sets the contents of the provided input to the provided int value.
    • aiPlanGetVariableInt

      public int aiPlanGetVariableInt(int planID, int variableIndex, int valueIndex)
      Returns the int value that is associated with the provided input.
    • aiPlanSetVariableFloat

      public void aiPlanSetVariableFloat(int planID, int variableIndex, int valueIndex, float value)
      Sets the contents of the provided input to the provided float value.
    • aiPlanGetVariableFloat

      public float aiPlanGetVariableFloat(int planID, int variableIndex, int valueIndex)
      Returns the float value that is associated with the provided input.
    • aiPlanSetVariableVector

      public void aiPlanSetVariableVector(int planID, int variableIndex, int valueIndex, Vector value)
      Sets the contents of the provided input to the provided vector value.
    • aiPlanGetVariableVector

      public Vector aiPlanGetVariableVector(int planID, int variableIndex, int valueIndex)
      Returns the vector value that is associated with the provided input.
    • aiPlanSetVariableBool

      public void aiPlanSetVariableBool(int planID, int variableIndex, int valueIndex, boolean value)
      Sets the contents of the provided input to the provided bool value.
    • aiPlanGetVariableBool

      public boolean aiPlanGetVariableBool(int planID, int variableIndex, int valueIndex)
      Returns the bool value that is associated with the provided input.
    • aiPlanSetVariableString

      public void aiPlanSetVariableString(int planID, int variableIndex, int valueIndex, String value)
      Sets the contents of the provided input to the provided string value.
    • aiPlanGetVariableString

      public String aiPlanGetVariableString(int planID, int variableIndex, int valueIndex)
      Returns the string value that is associated with the provided input.
    • aiPlanGetNumberUserVariableValues

      public int aiPlanGetNumberUserVariableValues(int planID, int variableIndex)
      Returns the number of valueIndexes that can be set for the provided variableIndex for the provided planID. You can increase this via aiPlanSetNumberUserVariableValues.
    • aiPlanSetNumberUserVariableValues

      public void aiPlanSetNumberUserVariableValues(int planID, int variableIndex, int numberValues, boolean clearCurrentValues)
      Sets the number of possible valueIndexes(numberValues) for the provided variableIndex for the provided planID. If clearCurrentValues is set the values currently present will be reset.
    • aiPlanRemoveUserVariables

      public void aiPlanRemoveUserVariables(int planID)
      Removes all of the user variables from the provided planID.
    • aiPlanRemoveUserVariable

      public void aiPlanRemoveUserVariable(int planID, int variableIndex)
      Removes the user variable at the provided variableIndex for the provided planID. The provided variableIndex will just become unused. If you delete index 3 while you have 5 total, index 4 won't become 3 suddenly.
    • aiPlanRemoveUserVariableValue

      public void aiPlanRemoveUserVariableValue(int planID, int variableIndex, int valueIndex)
      Removes the provided valueIndex for the provided variableIndex for the provided planID. Note here that this is a complete removal and the number of valueIndexes will decrease too.
    • aiPlanGetUserVariableIndex

      public int aiPlanGetUserVariableIndex(int planID, String variableName)
      Searches through all user variables assigned to the provided planID and returns the index with the provided variableName, returns -1 if none are found.
    • aiPlanAddUserVariableInt

      public void aiPlanAddUserVariableInt(int planID, int variableIndex, String name, int numberValues)
      Adds an int user variable with the provided input.
    • aiPlanSetUserVariableInt

      public void aiPlanSetUserVariableInt(int planID, int variableIndex, int valueIndex, int value)
      Sets the user contents of the provided input to the provided int value.
    • aiPlanGetUserVariableInt

      public int aiPlanGetUserVariableInt(int planID, int variableIndex, int valueIndex)
      Returns the user int value that is associated with the provided input.
    • aiPlanAddUserVariableFloat

      public void aiPlanAddUserVariableFloat(int planID, int variableIndex, String name, int numberValues)
      Adds a float user variable with the provided input.
    • aiPlanSetUserVariableFloat

      public void aiPlanSetUserVariableFloat(int planID, int variableIndex, int valueIndex, float value)
      Sets the user contents of the provided input to the provided float value.
    • aiPlanGetUserVariableFloat

      public float aiPlanGetUserVariableFloat(int planID, int variableIndex, int valueIndex)
      Returns the user float value that is associated with the provided input.
    • aiPlanAddUserVariableVector

      public void aiPlanAddUserVariableVector(int planID, int variableIndex, String name, int numberValues)
      Adds a vector user variable with the provided input.
    • aiPlanSetUserVariableVector

      public void aiPlanSetUserVariableVector(int planID, int variableIndex, int valueIndex, Vector value)
      Sets the user contents of the provided input to the provided vector value.
    • aiPlanGetUserVariableVector

      public Vector aiPlanGetUserVariableVector(int planID, int variableIndex, int valueIndex)
      Returns the user vector value that is associated with the provided input.
    • aiPlanAddUserVariableBool

      public void aiPlanAddUserVariableBool(int planID, int variableIndex, String name, int numberValues)
      Adds a bool user variable with the provided input.
    • aiPlanSetUserVariableBool

      public void aiPlanSetUserVariableBool(int planID, int variableIndex, int valueIndex, boolean value)
      Sets the user contents of the provided input to the provided bool value.
    • aiPlanGetUserVariableBool

      public boolean aiPlanGetUserVariableBool(int planID, int variableIndex, int valueIndex)
      Returns the user bool value that is associated with the provided input.
    • aiPlanAddUserVariableString

      public void aiPlanAddUserVariableString(int planID, int variableIndex, String name, int numberValues)
      Adds a string user variable with the provided input.
    • aiPlanSetUserVariableString

      public void aiPlanSetUserVariableString(int planID, int variableIndex, int valueIndex, String value)
      Sets the user contents of the provided input to the provided string value.
    • aiPlanGetUserVariableString

      public String aiPlanGetUserVariableString(int planID, int variableIndex, int valueIndex)
      Returns the user string value that is associated with the provided input. Max length that can be returned is 512.
    • aiPlanSetFlag

      public void aiPlanSetFlag(int planID, int flag, boolean state)
      Sets the flag for the provided planID to the state, cPlanFlag constants. All flags are exposed, but use some of them with caution.
    • aiPlanIsFlagSet

      public boolean aiPlanIsFlagSet(int planID, int flag)
      Gets if the flag for the provided planID is set to true, cPlanFlag constants.
    • aiPlanSetEventHandler

      public void aiPlanSetEventHandler(int planID, int eventType, String handlerName)
      Connects an XS function (handlerName) to the provided planID + provided eventType. All plan events can be found in the constants, search for "PlanEvent". Some plans have unique events to that specific plan type, but most don't. cPlanEventStateChange is available for every plan. It gets called each time the plan changes its state. These hanlders are used to react to plans reaching specific points in their lifetime. If you wish to unset a handler, just call that with an empty handler name.
    • aiSetHandler

      public void aiSetHandler(String handlerName, int eventType)
      Connects an XS function (handlerName) to the provided eventType. All eventTypes can be found in the constants under "XS AI handler type constants". These handlers are used to tell the script some event happened that we might want to react to (not linked to plans). If you wish to unset a handler, just call that with an empty handler name.
    • aiPlanGetFutureNeedsCostPerResource

      public float aiPlanGetFutureNeedsCostPerResource(int planID, int resourceID)
      Returns the future cost of the provided planID for the provided resourceID. Build plans return the cost of their building, if they still need to place the foundation. Research plans return the cost of their upgrade, but only if they have a valid research building alive and if the prereqs are met. Thus if you want to ask the cost of an age upgrade it's more reliable to fetch the age up techID and ask that cost directly, otherwise not having a Temple will give back 0 Food cost for Classical. Train plans return the cost of the units it can train within the next 30 seconds with the available buildings.
    • aiPlanGetFutureNeedsCost

      public float[] aiPlanGetFutureNeedsCost(int planID)
      Same mechanic as aiPlanGetFutureNeedsCostPerResource but instead returns an array of costs.
    • aiGetResourcePercentage

      public float aiGetResourcePercentage(int resourceID)
      Returns the resource percentage for the given resourceID.
    • aiSetResourcePercentage

      public void aiSetResourcePercentage(int resourceID, float percentage)
      Sets the resource percentage for the given resource, you must already provide a roughly normalized value here. Use aiNormalizeResourcePercentages after you set all percentages to normalize them. These percentages are used for nothing in the source, it's just a storing + normalizing mechanic for the script.
    • aiNormalizeResourcePercentages

      public void aiNormalizeResourcePercentages()
      Normalizes all of the resource percentages to 1.0.
    • aiGetNumberGatherers

      public int aiGetNumberGatherers(int gathererPUID, int resourceID, int resourceSubType, int resourcePUID)
      Iterates through all gather plans. Optionally filters out plans based on the provided resourceID and provided resourceSubType (must provide resourceID in order to use resourceSubType). If not provided it just takes all gather plans. Optionally filters on the resourcePUID to look for specific resources. Like cutting from a specific Tree PUID if desired. If a plan has no current valid KB Resource ID it's skipped. Returns how many of gathererPUID the plans combined have (including loaned out units).
    • aiGetResourceBreakdownNumberPlans

      public int aiGetResourceBreakdownNumberPlans(int resourceID, int resourceSubTypeID, int baseID)
      Returns the number of plans for the breakdown belonging to the provided resourceID + resourceSubTypeID + baseID. Returns 0 if the breakdown doesn't exist.
    • aiGetResourceBreakdownPlanPriority

      public int aiGetResourceBreakdownPlanPriority(int resourceID, int resourceSubTypeID, int baseID)
      Returns the plan priority for the breakdown belonging to the provided resourceID + resourceSubTypeID + baseID. Returns 0 if the breakdown doesn't exist.
    • aiSetResourceBreakdown

      public void aiSetResourceBreakdown(int resourceID, int resourceSubTypeID, int numberPlans, int planPriority, int baseID, int[] numNeeded, int[] numWanted, int[] numMax, int[] kbResourceIDs)
      Creates a resource breakdown with the provided paramaters, or overwrites an existing one. Resource breakdowns is the system that controls gather plan creation / deletion for the AI. By default we iterate over all our breakdowns and create missing plans / destroy excess plans every 5 seconds (+0/200ms random offset). ATTENTION: If this system is active then any gather plan that doesn't have a valid breakdown ID assigned will be destroyed each time we analyze the breakdowns. Call aiSetNextGathererDistributionTime(-1) to set the next distribution time to max so it never happens anymore, Chairon does this during BOs. A breakdown is basically an information set for the AI to use to determine where to gather resources and with how many gatherers on what priority. Example breakdown call: numNeeded[2] {3, 6}, numWanted[2] {6, 9}, numMax[2] {12, 12}, kbResourceIDs[2] {15, 24}aiSetResourceBreakdown(cResourceFood, cAIResourceSubTypeHuntAggressive, 2, 80, 3, numNeeded, numWanted, numMax, kbResourceIDs); This will now create 2 food gather plans that will look for Aggressive hunt with 80 priority. They will internally do an aiPlanAddUnitType for cUnitTypeAbstractVillager using the values in the arrays, plan 1 using index 0 and plan 2 using index 1. If you provide the KBResourceIDs, which Chairon only does for Farms, the plans also get assigned those. Otherwise (or if the provided ones run out) they go searching within the assigned base for the resources you said they should collect. So make sure the KB Resources actually exist because those plans won't go wander off outside of the base.
    • aiAddToResourceBreakdown

      public void aiAddToResourceBreakdown(int resourceID, int resourceSubTypeID, int numberPlans, int baseID, int[] numNeeded, int[] numWanted, int[] numMax, int[] kbResourceIDs)
      Increments an existing breakdown by the provided number plans and wanted gatherers, kbResourceIDs is optional.
    • aiRemoveResourceBreakdown

      public void aiRemoveResourceBreakdown(int resourceID, int resourceSubTypeID, int baseID)
      Removes the breakdown belonging to the provided resourceID + resourceSubTypeID + baseID. It doesn't warn when the breakdown doesn't exist since it's often used to just clear out bases in a loop quickly.
    • aiGetResourceBreakdownID

      public int aiGetResourceBreakdownID(int resourceID, int resourceSubTypeID, int baseID)
      Returns the breakdown ID belonging to the provided resourceID + resourceSubTypeID + baseID.
    • aiResourceLock

      public void aiResourceLock(int resourceID)
      Prevents the provided resourceID from being spent by the AI via plans.
    • aiResourceUnlock

      public void aiResourceUnlock(int resourceID)
      Allow the provided resourceID to be spent by the AI via plans.
    • aiResourceIsLocked

      public boolean aiResourceIsLocked(int resourceID)
      Returns whether the provided resourceID is locked.
    • aiGetNextGathererDistributionTime

      public int aiGetNextGathererDistributionTime()
      Returns the next time when the gatherer distribution will be updated. This is the distribution related to the resource breakdowns. When the update happens only gather plans that are requested by the breakdowns will be kept, the rest will be destroyed. And the number of gatherers will be set on the plans as requested by the arrays in the breakdowns. During this update we also set a cap on the gather plans. For example we don't allow more than 2 gatherers per tree left in a resource. Thus if you assign 10 Needed to a wood plan but only 2 trees remain the plan is forced down to 4.
    • aiSetNextGathererDistributionTime

      public void aiSetNextGathererDistributionTime(int time)
      Sets the next time in MS that the gatherer distribution is updated, call with -1 to never do distribution again.
    • aiGetUnassignedUnitAssignmentTime

      public int aiGetUnassignedUnitAssignmentTime()
      Gets the next time when the unassigned units assigment gets updated.
    • aiSetUnassignedUnitAssignmentTime

      public void aiSetUnassignedUnitAssignmentTime(int time)
      Sets the next time in MS that the unassigned unit assigment is updated. The unassigned assignment run is the same logic as the full unit assignment but we're only allowed to find new plans for units that currently have none. Call with -1 to never do the unassigned assignment again.
    • aiGetFullUnitAssignmentTime

      public int aiGetFullUnitAssignmentTime()
      Gets the next time when the unit distribution will be updated.
    • aiSetFullUnitAssignmentTime

      public void aiSetFullUnitAssignmentTime(int time)
      Sets the next time in MS that the unit distribution is updated. This logic will iterate through all main plans and see what units they need. During this run plans can steal from other plans to satisfy their needs, if they're higher prio/NWM. Plans have 2 ways to determine what plan gets priority over what, it's not just the priority you assign it. If I have a plan with 1 priority and 50 Needed units and I have another plan with 100 priority and 0 Needed units but instead 50 Wanted units the following would happen if I have 50 units to divide. All 50 would go to the first plan that has 1 priority. That is because the Need/Want/Max are priority levels of their own. We first try to satisfy every plan's Need number. And if multiple plans have Needs then the assigned priority kicks in to determine who gets first pick. And since in the example plan 2 has 0 Needs it doesn't matter is has 100 priority since the first plan already claimed it all. Build plans have an exception here that they can steal units more easily because we don't want to keep foundations waiting.
    • aiUpdateFullUnitAssignment

      public void aiUpdateFullUnitAssignment(boolean allowPlanTransfer)
      Force a run of the logic described in aiSetFullUnitAssignmentTime.
    • aiChat

      public void aiChat(int playerID, String chatString)
      Send a CP AI chat message to the provided playerID.
    • aiCommsAllowChat

      public void aiCommsAllowChat(boolean enable)
      Enables or disables the chats from this AI player, also enables/disables all "Comms".
    • aiCommsSendStatement

      public void aiCommsSendStatement(int playerID, int promptType)
      Sends a statement to the provided playerID, constants for this are named like "cAICommPrompt". These in turn can be created via the chatsets.xml file in the ai folder.
    • aiCommsSendStatementWithVector

      public void aiCommsSendStatementWithVector(int playerID, int promptType, Vector position)
      Sends a statement to the provided playerID with a flare on the provided position, constants for this are named like "cAICommPrompt". These in turn can be created via the chatsets.xml file in the ai folder.
    • aiCommsSetEventHandler

      public void aiCommsSetEventHandler(String handlerFunctionName)
      Connects an XS function (handlerFunctionName) to the communications system (empty name unsets the handler). In this handler you will receive a tauntID on which you can call aiCommsGetSendingPlayer and aiCommsGetTauntCode.
    • aiCommsGetSendingPlayer

      public int aiCommsGetSendingPlayer(int tauntID)
      Returns the sending playerID for provided tauntID.
    • aiCommsGetTauntCode

      public int aiCommsGetTauntCode(int tauntID)
      Returns the code for the provided tauntID, these map to regular taunts like 1: Yes.
    • aiUnitSetRallyPointToPosition

      public void aiUnitSetRallyPointToPosition(int sourceUnitID, Vector position)
      Sets the rally point of the provided sourceUnitID to the provided position.
    • aiUnitSetRallyPointToUnit

      public void aiUnitSetRallyPointToUnit(int sourceUnitID, int targetUnitID)
      Sets the rally point of the provided sourceUnitID to the provided targetUnitID.
    • aiUnitSetStance

      public void aiUnitSetStance(int unitID, int stance)
      Sets the stance for the provided unitID, "cUnitStance" constants.
    • aiUnitSetTactic

      public void aiUnitSetTactic(int unitID, int tacticDBID)
      Sets the tactic for the provided unitID, "cUnitTactic" constants.
    • aiUnitGetForbiddenPlanIDs

      public int[] aiUnitGetForbiddenPlanIDs(int unitID)
      Returns an array of planIDs that the provided unitID is currently banned from. A unit can get banned from a plan by the source if it can't path towards its destination.
    • aiUnitAddForbiddenPlanID

      public void aiUnitAddForbiddenPlanID(int unitID, int planID)
      Adds the provided planID to the unitID's forbidden plan list.
    • aiSetDeleteUnitsForbiddenPlans

      public void aiSetDeleteUnitsForbiddenPlans(boolean v)
      Turns on/off if units will be deleted if they got kicked out of too many plans due to pathing, Chairon has this on.
    • aiPopulateAgeUpList

      public void aiPopulateAgeUpList()
      Call this to make the AI fill out what Minor Gods are available.
    • aiGetAgeUpListCount

      public int aiGetAgeUpListCount(int age)
      Returns the number of Minor Gods avaiable for the provided age.
    • aiGetAgeUpListByIndex

      public int aiGetAgeUpListByIndex(int age, int index)
      Gets the techID belonging to the Minor God for the provided age + index. Call aiGetAgeUpListCount to know how many indexes there are.
    • aiSellResourceOnMarket

      public void aiSellResourceOnMarket(int resourceID)
      Sells 100 of the provided resourceID, this can only be wood / food.
    • aiBuyResourceOnMarket

      public void aiBuyResourceOnMarket(int resourceID)
      Buys 100 of the provided resourceID, this can only be wood / food.
    • aiSetNavalEconomyPop

      public void aiSetNavalEconomyPop(int v)
      Set the script-defined naval economy pop, train plans can't train above this number.
    • aiGetNavalEconomyPop

      public int aiGetNavalEconomyPop()
      Returns the script-defined naval economy pop.
    • aiGetCurrentNavalEconomyPop

      public int aiGetCurrentNavalEconomyPop()
      Returns the current naval economy pop.
    • aiGetAvailableNavalEconomyPop

      public int aiGetAvailableNavalEconomyPop()
      Returns the available naval economy pop, calculated by doing aiGetNavalEconomyPop - aiGetCurrentNavalEconomyPop.
    • aiSetEconomyPop

      public void aiSetEconomyPop(int v)
      Set the script-defined economy pop, train plans can't train above this number.
    • aiGetEconomyPop

      public int aiGetEconomyPop()
      Returns the script-defined economy pop.
    • aiGetCurrentEconomyPop

      public int aiGetCurrentEconomyPop()
      Returns the current economy pop.
    • aiGetAvailableEconomyPop

      public int aiGetAvailableEconomyPop()
      Returns the available economy pop, calculated by doing aiGetEconomyPop - aiGetCurrentEconomyPop.
    • aiSetNavalMilitaryPop

      public void aiSetNavalMilitaryPop(int v)
      Set the script-defined naval military pop, train plans can't train above this number.
    • aiGetNavalMilitaryPop

      public int aiGetNavalMilitaryPop()
      Returns the script-defined naval military pop.
    • aiGetCurrentNavalMilitaryPop

      public int aiGetCurrentNavalMilitaryPop()
      Returns the current naval military pop.
    • aiGetAvailableNavalMilitaryPop

      public int aiGetAvailableNavalMilitaryPop()
      Returns the available naval military pop, calculated by doing aiGetNavalMilitaryPop - aiGetCurrentNavalMilitaryPop.
    • aiSetMilitaryPop

      public void aiSetMilitaryPop(int v)
      Set the script-defined military pop, train plans can't train above this number.
    • aiGetMilitaryPop

      public int aiGetMilitaryPop()
      Returns the script-defined military pop.
    • aiGetCurrentMilitaryPop

      public int aiGetCurrentMilitaryPop()
      Returns the current military pop.
    • aiGetAvailableMilitaryPop

      public int aiGetAvailableMilitaryPop()
      Returns the available naval military pop, calculated by doing aiGetMilitaryPop - aiGetCurrentMilitaryPop.
    • aiGetMostHatedPlayerID

      public int aiGetMostHatedPlayerID()
      Returns the script-defined most hated player ID.
    • aiSetMostHatedPlayerID

      public void aiSetMostHatedPlayerID(int v)
      Sets the script-defined most hated player ID.
    • aiGetMostHatedNavalPlayerID

      public int aiGetMostHatedNavalPlayerID()
      Returns the script-defined most hated naval player ID.
    • aiSetMostHatedNavalPlayerID

      public void aiSetMostHatedNavalPlayerID(int v)
      Sets the script-defined most hated naval player ID.
    • aiBreakpointSet

      public void aiBreakpointSet(int playerID, String filename, int lineNumber, boolean on)
      Sets a breakpoint.
    • aiBreakpointGo

      public void aiBreakpointGo(int playerID)
      Restart XS execution after the current breakpoint.
    • aiRandLocation

      public Vector aiRandLocation()
      Returns a random location guaranteed to be on the map.
    • aiGetAttackResponseDistance

      public float aiGetAttackResponseDistance()
      Returns the attack response distance.
    • aiSetAttackResponseDistance

      public void aiSetAttackResponseDistance(float v)
      Set the attack response distance.
    • aiSetExploreDangerThreshold

      public void aiSetExploreDangerThreshold(float value)
      Sets the AI's Explore Danger Threshold value. This is in relation to area danger ratings. Some systems in the AI won't want to path through areas with a higher danger rating than this value, most noteably explore plans.
    • aiGetExploreDangerThreshold

      public float aiGetExploreDangerThreshold()
      Returns the AI's Explore Danger Threshold value.
    • aiSetMicroFlags

      public void aiSetMicroFlags(int flags)
      Sets micro management flags, "cMicro" constants.
    • aiGetMicroFlags

      public int aiGetMicroFlags()
      Gets the currently set micro management flags.
    • aiCanUseAbility

      public boolean aiCanUseAbility(int unitID, int protoPowerID)
      Checks whether the provided unitID can use the ability associated with the provided protoPowerID.
    • aiSetMilitaryGatherPointBlocksBP

      public void aiSetMilitaryGatherPointBlocksBP(boolean enabled)
      If this is set to true then all the military gather points (all bases with a Town Center create one) will block all building placement checks. These points will be shown as if another BP already claimed the spot. This defaults to true. If this is false then aiSetMilitaryGatherPointBlocksDropsites/Walls don't do anything anymore.
    • aiSetMilitaryGatherPointBlocksDropsites

      public void aiSetMilitaryGatherPointBlocksDropsites(boolean enabled)
      If this is set to true then all the military gather points (all bases with a Town Center create one) will block Dropsite building placements. This can be false and aiSetMilitaryGatherPointBlocksBP true, causing Dropsites to still be eligible to be built on military gather points, this is also the default setup.
    • aiSetMilitaryGatherPointBlocksWalls

      public void aiSetMilitaryGatherPointBlocksWalls(boolean enabled)
      If this is set to true then all the military gather points (all bases with a Town Center create one) will block Wall building placements. This can be false and aiSetMilitaryGatherPointBlocksBP true, causing Walls to still be eligible to be built on military gather points, this is also the default setup.
    • aiTribute

      public void aiTribute(int playerID, int resourceID, float amount)
      Tributes the provided amount of the provided resourceID to the provided playerID.
    • aiGetWorldDifficultyName

      public String aiGetWorldDifficultyName(int difficulty)
      Returns the name of the provided difficulty.
    • aiGetMaxAge

      public int aiGetMaxAge(int playerID)
      Returns the maximum age for the provided playerID.
    • aiGetAllowBuildings

      public boolean aiGetAllowBuildings()
      Returns allow buildings on/off.
    • aiSetAllowBuildings

      public void aiSetAllowBuildings(boolean v)
      Sets allow buildings on/off.
    • aiResign

      public void aiResign()
      Resigns this player.
    • aiAttemptResign

      public void aiAttemptResign(int promptType)
      Asks the first human player if it's ok to resign. Choice dialogue that will show up will containt the text of the provided promptType.
    • aiNumberUnassignedUnits

      public int aiNumberUnassignedUnits(int unitTypeID)
      Returns the number of unassigned (not being in a plan) units of the given type, -1 unitTypeID to ignore it.
    • aiSwitchMainBase

      public void aiSwitchMainBase(int newBaseID)
      Switch the newBaseID to be the main base, all this does is flag setting.
    • aiSetDefaultStance

      public void aiSetDefaultStance(int defaultStance)
      Sets your default stance for all of your units.
    • aiSetEscrowsEnabled

      public void aiSetEscrowsEnabled(boolean v)
      Turns escrow system on/off, Chairon has this off.
    • aiSetOutpostLimit

      public void aiSetOutpostLimit(int limit)
      Sets the limit for how many Outposts the AI can build. This is linked to the explore plan Outpost building, Obelisks for Priest mainly.
    • aiGetOutpostLimit

      public int aiGetOutpostLimit()
      Returns the limit for how many Outposts the AI can build.
    • aiSetAutomaticallyUngarrisonUnits

      public void aiSetAutomaticallyUngarrisonUnits(boolean v)
      The AI automatically ungarrisons units from buildings if they're not in a garrison plan. Setting this to false turns off that behavior.
    • aiSendNotificationFoundNotEnoughFoodGatheringSpots

      public void aiSendNotificationFoundNotEnoughFoodGatheringSpots()
      Used to display a notification for the Human Assist AI.
    • aiSendNotificationFoundNotEnoughFoodFarmGatheringSpots

      public void aiSendNotificationFoundNotEnoughFoodFarmGatheringSpots()
      Used to display a notification for the Human Assist AI.
    • aiSendNotificationFoundNotEnoughWoodGatheringSpots

      public void aiSendNotificationFoundNotEnoughWoodGatheringSpots()
      Used to display a notification for the Human Assist AI.
    • aiSendNotificationFoundNotEnoughGoldGatheringSpots

      public void aiSendNotificationFoundNotEnoughGoldGatheringSpots()
      Used to display a notification for the Human Assist AI.
    • aiTaskMoveUnit

      public boolean aiTaskMoveUnit(int unitID, Vector position, boolean attackMove, boolean queue)
      Does a lightweight (no plan) move tasking of the provided unitID to the provided location.
    • aiTaskMoveUnits

      public boolean aiTaskMoveUnits(int[] unitIDs, Vector position, boolean attackMove, boolean queue)
      Does a lightweight (no plan) move tasking of the provided unitIDs to the provided location.
    • aiTaskWorkUnit

      public boolean aiTaskWorkUnit(int unitID, int targetUnitID, boolean queue)
      Does a lightweight (no plan) work tasking of the provided unitID on the provided targetUnitID, this is like right-clicking.
    • aiTaskWorkUnits

      public boolean aiTaskWorkUnits(int[] unitIDs, int targetUnitID, boolean queue)
      Does a lightweight (no plan) work tasking of the provided unitIDs on the provided targetUnitID, this is like right-clicking.
    • aiTaskBuildUnit

      public boolean aiTaskBuildUnit(int unitID, int buildingTypeID, Vector position, boolean queue, int heading)
      Does a lightweight (no plan) build tasking for the provided unitID to build the provided buildingTypeID at the provided vector.
    • aiTaskBuildUnits

      public boolean aiTaskBuildUnits(int[] unitIDs, int buildingTypeID, Vector position, boolean queue, int heading)
      Does a lightweight (no plan) build tasking for the provided unitIDs to build the provided buildingTypeID at the provided vector.
    • aiTaskTrainUnit

      public boolean aiTaskTrainUnit(int unitID, int unitTypeID)
      Does a lightweight (no plan) train tasking for the provided unitID for the provided unitTypeID.
    • aiTaskResearchUnit

      public boolean aiTaskResearchUnit(int unitID, int techID)
      Does a lightweight (no plan) research tasking for the provided unitID for the provided techID.
    • aiTaskSpecialPowerUnit

      public boolean aiTaskSpecialPowerUnit(int unitID, int powerID, int targetID, Vector position, boolean setAsQueued)
      Does a lightweight (no plan) ordering for the provided unitID to use the provided powerID. This is unit special attacks.
    • aiTaskDeleteUnit

      public boolean aiTaskDeleteUnit(int unitID)
      Deletes provided unitID.
    • aiTaskDeleteUnits

      public boolean aiTaskDeleteUnits(int[] unitIDs)
      Deletes provided unitIDs.
    • aiTaskGarrisonUnit

      public boolean aiTaskGarrisonUnit(int unitID, int targetID)
      Does a lightweight (no plan) garrison for the provided unitID into the provided targetID.
    • aiTaskGarrisonUnits

      public boolean aiTaskGarrisonUnits(int[] unitIDs, int targetID)
      Does a lightweight (no plan) garrison for the provided unitIDs into the provided targetID.
    • aiTaskUngarrisonUnit

      public boolean aiTaskUngarrisonUnit(int unitID, Vector position)
      Does a lightweight (no plan) ungarrison for the provided unitID towards the the provided position.
    • aiTaskUngarrisonUnits

      public boolean aiTaskUngarrisonUnits(int[] unitIDs, Vector position)
      Does a lightweight (no plan) ungarrison for the provided unitIDs towards the the provided position.
    • aiTaskCancelUnit

      public boolean aiTaskCancelUnit(int unitID, int actionID)
      Does a lightweight (no plan) cancellation of the given actionID for the provided unitID.
    • aiTaskStopUnit

      public boolean aiTaskStopUnit(int unitID)
      Does a lightweight (no plan) stopping of the provided unitID.
    • aiTaskStopUnits

      public boolean aiTaskStopUnits(int[] unitIDs)
      Does a lightweight (no plan) stopping of the provided unitIDs.
    • aiCastGodPowerAtPosition

      public boolean aiCastGodPowerAtPosition(int protoPowerID, Vector position)
      Casts the given protoPowerID at the provided position, use this for God Powers that require 1 position. If you don't have any charges for the protoPowerID it won't automatically buy them (if enough favor banked) like it does for human players. Use aiPrePurchaseGodPower to get more charges.
    • aiCastGodPowerAtDualPosition

      public boolean aiCastGodPowerAtDualPosition(int protoPowerID, Vector position1, Vector position2)
      Casts the given protoPowerID at the provided positions, use this for God Powers that require 2 positions. If you don't have any charges for the protoPowerID it won't automatically buy them (if enough favor banked) like it does for human players. Use aiPrePurchaseGodPower to get more charges.
    • aiCastGodPowerAtUnit

      public boolean aiCastGodPowerAtUnit(int protoPowerID, int unitID)
      Casts the given protoPowerID on the specific unitID, use this for God Powers that target units. If you don't have any charges for the protoPowerID it won't automatically buy them (if enough favor banked) like it does for human players. Use aiPrePurchaseGodPower to get more charges.
    • aiPrePurchaseGodPower

      public boolean aiPrePurchaseGodPower(int protoPowerID, int numUses)
      Pre-purchases the provided number of uses of the provided protoPowerID. The AI makes use of pre-purchasing god powers because just running a god power plan to then find we have not enough favor left the moment we want to invoke makes no sense. So we buy first and then we start the plan.
    • aiTransformWallIntoGate

      public boolean aiTransformWallIntoGate(int wallLongID)
      Transforms the provided wallLongID into a Gate.
    • aiSetAutoCastForUnit

      public boolean aiSetAutoCastForUnit(int unitID, boolean state, int abilitySlot)
      Sets the autocasting for the provided abilitySlot to the provided state for the provided unitID. abilitySlot = 0: the primary ability a unit has. abilitySlot = 1: the aux ability a unit has. abilitySlot = 2: currently only used for toggling if a healer should prioritize healing over damaging.
    • kbArmyGetIsIDValid

      public boolean kbArmyGetIsIDValid(int armyID)
      Return whether the armyID is valid.
    • kbArmyCreate

      public int kbArmyCreate(String name, boolean exclusiveUnits)
      Creates a army with the given name.
    • kbArmyDestroy

      public void kbArmyDestroy(int armyID)
      Destroys the given army.
    • kbArmyGetNumber

      public int kbArmyGetNumber()
      Returns the number of armies.
    • kbArmyGetIDByIndex

      public int kbArmyGetIDByIndex(int index)
      Returns the index-th army ID.
    • kbArmyGetID

      public int kbArmyGetID(String name)
      Returns the ID of the given army.
    • kbArmyGetName

      public String kbArmyGetName(int armyID)
      Returns the name of the given army.
    • kbArmyGetNumberUnits

      public int kbArmyGetNumberUnits(int armyID)
      Returns the number of units in the given army.
    • kbArmyGetUnitID

      public int kbArmyGetUnitID(int armyID, int unitNumber)
      Returns the appropriate unitID from the given army.
    • kbArmyAddUnit

      public void kbArmyAddUnit(int armyID, int unitID)
      Adds the unitID to the given army.
    • kbArmyRemoveUnit

      public void kbArmyRemoveUnit(int armyID, int unitID)
      Removes the unitID from the given army.
    • kbArmyRemoveUnitByIndex

      public void kbArmyRemoveUnitByIndex(int armyID, int unitIndex)
      Removes the unitIndex-th unit from the given army.
    • kbArmyRemoveUnits

      public void kbArmyRemoveUnits(int armyID)
      Removes all units from the given army.
    • kbArmyGetCreationTime

      public int kbArmyGetCreationTime(int armyID)
      Returns the creation time for the given army.
    • kbArmyGetMembershipTime

      public int kbArmyGetMembershipTime(int armyID)
      Returns the creation time for the given army.
    • kbArmyGetLocation

      public Vector kbArmyGetLocation(int armyID)
      Returns the vector location for the given army.
    • kbArmyGetNumberWithinLocation

      public int kbArmyGetNumberWithinLocation(int armyID, Vector location, float range)
      Returns the number of units within range of the given point in the given army.
    • kbArmyGetCurrentHitpoints

      public float kbArmyGetCurrentHitpoints(int armyID)
      Returns the current total hitpoints for the given army.
    • kbArmyGetMaximumHitpoints

      public float kbArmyGetMaximumHitpoints(int armyID)
      Returns the maximum total hitpoints for the given army.
    • kbArmyGetHealth

      public float kbArmyGetHealth(int armyID)
      Returns the health for the given army.
    • kbArmyGetNumberWithHealth

      public int kbArmyGetNumberWithHealth(int armyID, float minimumHealth)
      Returns the number of units with at least the minimum amount of health specified for the given army.
    • kbArmyGetCurrentAICost

      public float kbArmyGetCurrentAICost(int armyID)
      Returns the current AI cost (worth) for the given army.
    • kbArmyGetMaximumAICost

      public float kbArmyGetMaximumAICost(int armyID)
      Returns the maximum AI cost (worth) for the given army.
    • kbPlayerGetPop

      public int kbPlayerGetPop(int playerID)
      Returns the current population for the provided playerID, means cheating if used by AI for other players.
    • kbPlayerGetPopCap

      public int kbPlayerGetPopCap(int playerID)
      Returns the current population cap for the provided playerID, means cheating if used by AI for other players.
    • kbPlayerGetMaxPop

      public int kbPlayerGetMaxPop(int playerID)
      Returns the maximum population for the provided playerID.
    • kbPlayerGetAge

      public int kbPlayerGetAge(int playerID)
      Returns the current age for the provided playerID, cAge constants.
    • kbPlayerGetCulture

      public int kbPlayerGetCulture(int playerID)
      Returns the culture for the provided playerID, cCulture constants.
    • kbCultureGetName

      public String kbCultureGetName(int cultureID)
      Returns the culture name for the provided cultureID.
    • kbPlayerGetCiv

      public int kbPlayerGetCiv(int playerID)
      Returns the civilization (major god) for the provided playerID, cCiv constants.
    • kbCivGetName

      public String kbCivGetName(int civID)
      Returns the civilization (major god) name for the provided civID.
    • kbPlayerGetBuildingEfficiency

      public float kbPlayerGetBuildingEfficiency(int playerID)
      Returns the building efficiency for the provided playerID, as defined in major_gods.xml. This is the rate the second builder builds at.
    • kbPlayerGetExtraBuildingEfficiency

      public float kbPlayerGetExtraBuildingEfficiency(int playerID)
      Returns the extra building efficiency for the provided playerID, as defined in major_gods.xml. This is the rate the third and subsequent builders build at.
    • kbPlayerIsResigned

      public boolean kbPlayerIsResigned(int playerID)
      Returns true if the provided playerID is resigned.
    • kbPlayerHasLost

      public boolean kbPlayerHasLost(int playerID)
      Returns true if the provided playerID has either resigned or has been defeated.
    • kbPlayerGetTeam

      public int kbPlayerGetTeam(int playerID)
      Returns the provided playerID's team number.
    • kbPlayerGetName

      public String kbPlayerGetName(int playerID)
      Returns the provided playerID's name.
    • kbPlayerIsEnemy

      public boolean kbPlayerIsEnemy(int playerID)
      Returns true if the provided playerID is an enemy of us.
    • kbPlayerIsNeutral

      public boolean kbPlayerIsNeutral(int playerID)
      Returns true if the provided playerID is neutral towards us.
    • kbPlayerIsAlly

      public boolean kbPlayerIsAlly(int playerID)
      Returns true if the provided playerID is an ally of us.
    • kbPlayerIsMutualAlly

      public boolean kbPlayerIsMutualAlly(int playerID)
      Returns true if the provided playerID is a mutual ally (we are ally to the playerID and he is to us as well).
    • kbGetNumberMutualAllies

      public int kbGetNumberMutualAllies()
      Returns the number of mutual allies we have.
    • kbPlayerIsHuman

      public boolean kbPlayerIsHuman(int playerID)
      Returns true if the provided playerID is a a human player.
    • kbPlayerGetVisible

      public int kbPlayerGetVisible(int playerID)
      Returns the provided playerID's visible value (0 = normal, 1 = hidden).
    • kbPlayerSetVisible

      public void kbPlayerSetVisible(int playerID, int visible)
      Sets the provided playerID's visible value (0 = normal, 1 = hidden).
    • kbPlayerGetHandicap

      public float kbPlayerGetHandicap(int playerID)
      Returns the provided playerID's handicap multiplier (1.0 = no handicap).
    • kbPlayerSetHandicap

      public void kbPlayerSetHandicap(int playerID, float handicap)
      Sets the provided playerIDs handicap multiplier (1.0 = no handicap).
    • kbPlayerGetStartingPosition

      public Vector kbPlayerGetStartingPosition(int playerID)
      Returns the provided playerID's starting position. This only works in Random Maps, not scenarios.
    • kbPlayerGetTributePenalty

      public float kbPlayerGetTributePenalty(int playerID)
      Returns the provided playerID's tribute penalty.
    • kbUnitQueryCreate

      public int kbUnitQueryCreate(String name)
      Creates a unit query with the provided name, returns the query ID.
    • kbUnitQueryResetData

      public void kbUnitQueryResetData(int queryID)
      Resets the provided queryID's data AND results.
    • kbUnitQueryResetResults

      public void kbUnitQueryResetResults(int queryID)
      Resets the provided queryID's results.
    • kbUnitQueryDestroy

      public void kbUnitQueryDestroy(int queryID)
      Destroys the provided queryID.
    • kbUnitQueryNumberResults

      public int kbUnitQueryNumberResults(int queryID)
      Returns the number of results of the provided queryID.
    • kbUnitQueryGetResult

      public int kbUnitQueryGetResult(int queryID, int index)
      Returns the unitID at the provided index of the provided queryID. Use in combination with kbUnitQueryNumberResults to know how many indexes there are. You can also use the return value of kbUnitQueryExecute, but only if you're not looking for queued units.
    • kbUnitQueryGetResults

      public int[] kbUnitQueryGetResults(int queryID)
      Returns all unitIDs in the provided queryID.
    • kbUnitQueryGetPower

      public float kbUnitQueryGetPower(int queryID, boolean ignoreCurrentHealth)
      Returns a power rating for the results in the provided queryID. This is calculated by doing the same logic as described in kbUnitGetPower for each result.
    • kbUnitQueryGetSiegePower

      public float kbUnitQueryGetSiegePower(int queryID, boolean ignoreCurrentHealth)
      Returns a siege power rating for the results in the provided queryID. This is calculated by doing the same logic as described in kbUnitGetSiegePower for each result.
    • kbUnitQuerySetPlayerID

      public void kbUnitQuerySetPlayerID(int queryID, int playerID, boolean resetQueryData)
      Query Data: Sets the playerID whose units we will search for on the provided queryID. If you for example provide 3 in here, the query will only return units belonging to player 3. resetQueryData bool can be used to instantly reset all query data when using this syscall, so use it BEFORE you set any other data. You can call this with -1 to remove playerID checking from the provided queryID. Use either this function or kbUnitQuerySetPlayerRelation, you must have either one of these two. Default value on new queries: -1 (finds no units).
    • kbUnitQuerySetPlayerRelation

      public void kbUnitQuerySetPlayerRelation(int queryID, int relation, boolean resetQueryData)
      Query Data: Sets the player relation we will search for on the provided queryID. Valid inputs here are the cPlayerRelation constants. If you for example provide cPlayerRelationEnemy in here the query will only find units that are your enemy. resetQueryData bool can be used to instantly completely reset a query when using this syscall, so use it BEFORE you set any other data. You can call this with cPlayerRelationInvalid to remove player relation checking from the provided queryID. Use either this function or kbUnitQuerySetPlayerID, you must have either one of these two. Default value on new queries: invalid (finds no units).
    • kbUnitQuerySetUnitType

      public void kbUnitQuerySetUnitType(int queryID, int unitType)
      Query Data: Set what unitType we will search for on the provided queryID. This can be all cUnitType constants. NOTE: you MUST set this for every query, or it has no idea what to search for. Default value on new queries: -1 (finds no units).
    • kbUnitQuerySetActionType

      public void kbUnitQuerySetActionType(int queryID, int actionTypeID)
      Query Data: Sets what action type the units must be performing to be valid for the provided queryID. This can be all cActionType constants. You can call this with -1 to remove action checking from the provided queryID. AI: If you call this on enemy units and don't have the cUnitQuerySeeableStateVisible state set then it will cheat!!! Default value on new queries: -1 (not filtered on actions).
    • kbUnitQuerySetState

      public void kbUnitQuerySetState(int queryID, int v)
      Query Data: Sets what unit state we will search for on the provided queryID. Valid inputs here are the cUnitState constants. NOTE: you must set this for each query or no results will be returned. If you for example provide cUnitStateAlive in here the query will only find units that are alive. These states are bitflags, so cUnitStateAlive | cUnitStateBuilding will work. Default value on new queries: cUnitStateNone (won't find any units).
    • kbUnitQuerySetPosition

      public void kbUnitQuerySetPosition(int queryID, Vector position)
      Query Data: Sets from what position we will begin searching on the provided queryID. You MUST combine this with kbUnitQuerySetMaximumDistance or it has no effect. You can call this with cInvalidVector to remove position checking from the provided queryID. Default value on new queries: cInvalidVector (not filtered by position).
    • kbUnitQuerySetMaximumDistance

      public void kbUnitQuerySetMaximumDistance(int queryID, float distance)
      Query Data: Sets the maximum distance from the position the provided queryID will search in, it's a circular radius. You MUST combine this with kbUnitQuerySetPosition or it has no effect. You can call this with -1.0 to remove range checking from the provided queryID. Default value on new queries: -1.0 (no distance and thus entire map).
    • kbUnitQuerySetIgnoreKnockedOutUnits

      public void kbUnitQuerySetIgnoreKnockedOutUnits(int queryID, boolean value)
      Query Data: Sets if the provided queryID will count knocked out units or not. If for example this is set to true then a knocked out Arkantos will not be picked up by the query. Default value on new queries: true.
    • kbUnitQuerySetIgnorePlayersThatHaveLost

      public void kbUnitQuerySetIgnorePlayersThatHaveLost(int queryID, boolean value)
      Query Data: Sets if the provided queryID will include players that have lost or not. Default value on new queries: true.
    • kbUnitQuerySetAscendingSort

      public void kbUnitQuerySetAscendingSort(int queryID, boolean value)
      Query Data: Sets if the provided queryID will sort its results from closest to furthest in relation to the position. You MUST combine this with kbUnitQuerySetPosition or it has no effect. Default value on new queries: false (randomly sorted).
    • kbUnitQuerySetBaseID

      public void kbUnitQuerySetBaseID(int queryID, int baseID)
      Query Data: Sets what base the unit must be in to be valid for the provided queryID. Main use for this is with AI scripting where the AI bases can be analyzed. You can call this with -1 to remove base checking from the provided queryID. Default value on new queries: -1 (not filtered on bases).
    • kbUnitQuerySetAreaID

      public void kbUnitQuerySetAreaID(int queryID, int areaID)
      Query Data: Sets what areaID the unit must be in to be valid for the provided queryID. You can call this with -1 to remove area checking from the provided queryID. Default value on new queries: -1 (not filtered on areas).
    • kbUnitQuerySetAreaGroupID

      public void kbUnitQuerySetAreaGroupID(int queryID, int areaGroupID)
      Query Data: Sets what areaGroupID the unit must be in to be valid for the provided queryID. You can call this with -1 to remove area group checking from the provided queryID. Default value on new queries: -1 (not filtered on area groups).
    • kbUnitQuerySetConnectedAreaGroupID

      public void kbUnitQuerySetConnectedAreaGroupID(int queryID, int areaGroupID, int movementType)
      Query Data: Sets what areaGroupID the unit's areaGroupID must be connected to via the provided movementType for the provided queryID. Example: query searches for all Fishing Ships connected to AreaGroupID 5 with cPassabilityWater. Any Fishing Ship that's in another water/amphibious area that could area group path to AreaGroupID 5 will still be valid. You can call this with -1 to remove connected area group checking from the provided queryID. Default value on new queries: -1 (not filtered on connected area groups).
    • kbUnitQuerySetArmyID

      public void kbUnitQuerySetArmyID(int queryID, int armyID)
      Query Data: Sets what armyID the unit must be in to be valid for the provided queryID. You can call this with -1 to remove army checking from the provided queryID. Default value on new queries: -1 (not filtered on armies).
    • kbUnitQuerySetMinCreationTime

      public void kbUnitQuerySetMinCreationTime(int queryID, int time, boolean inclusive)
      Query Data: Sets minimum creation time, in game time milliseconds, for a unit to be considered valid for the provided queryID. Bool inclusive controls whether or not the check for creation time should be inclusive. Default value on new queries: -1 (not filtered by minimum creation time), false (check is not inclusive).
    • kbUnitQuerySetMaxCreationTime

      public void kbUnitQuerySetMaxCreationTime(int queryID, int time, boolean inclusive)
      Query Data: Sets maximum creation time, in game time milliseconds, for unit to be considered valid for the provided queryID. Bool inclusive controls whether or not the check for creation time should be inclusive. Default value on new queries: -1 (not filtered by maximum creation time), false (check is not inclusive).
    • kbUnitQuerySetVisibleState

      public void kbUnitQuerySetVisibleState(int queryID, int state)
      Query Data: sets the state in relation to LOS for what units are considered valid for the provided queryID. A unit can have different visiblity states in the KB that you can uniquely search for. cUnitQuerySeeableStateAllValid: no filtering. cUnitQuerySeeableStateVisible: requires active LOS of the unit. cUnitQuerySeeableStateUnderFog: doppled units, like gold mines and buildings. cUnitQuerySeeableStateNotVisible: units that we once saw but are not visible to us anymore. cUnitQuerySeeableStateSeeable: combination of Visible and UnderFog, so both are valid. cUnitQueryVisibleStateRecentPositionKnown: excludes all units that we know no valid position off. cUnitQueryVisibleStateNoRecentPositionKnown: excludes all units that we have a valid position off.Default value on new queries: cUnitQuerySeeableStateAllValid (no filtering).
    • kbUnitQuerySetExcludeTypes

      public void kbUnitQuerySetExcludeTypes(int queryID, int[] types)
      Query Data: Sets what unit types the provided queryID will skip. This array accepts proto units as well as abstract types. If any of the results are of any of the exclude types they're thrown out of the results. You can call this with an empty array to remove exclude type checking from the provided queryID. Default value on new queries: no exclude types (no filtering).
    • kbUnitQueryExecute

      public int kbUnitQueryExecute(int queryID)
      Executes the provided queryID (using the query data) and returns the number of units found. ATTENTION: if you execute a query multiple times, without resetting the results, the results will stack on top of each other. You can't get duplicate results this way, but accidentally stacking results can lead to unexpected outcomes. Attention: if you're querying for queued units this is the only time you can get the true total back, calling kbUnitQueryGetResults will not have the queued units in it since they're not real units yet and can't be fetched atm.
    • kbUnitQueryExecuteOnQuery

      public int kbUnitQueryExecuteOnQuery(int currentQueryID, int previousQueryID)
      Executes the provided queryID (using the query data) on the other query and returns the number of units found. For example your previousQueryID searches for enemy units and finds 20 of them of which 5 are myth units. Then your currentQueryID looks only for myth units. If you now execute your currentQueryID on your previousQueryID you will get back the 5 myth units you originally found in your previousQueryID.
    • kbUnitQueryGetUnitCost

      public float kbUnitQueryGetUnitCost(int queryID, boolean considerHealth)
      Returns the total cost of the found units inside the provided queryID. If considerHealth is true it will take the current hitpoints of the unit into account. For example if your Hoplite is half hp then only half the cost of the Hoplite is added to the total.
    • kbUnitQueryGetUnitAICost

      public float kbUnitQueryGetUnitAICost(int queryID, boolean considerHealth)
      Returns the total aiCost of the found units inside the provided queryID. Uses values set by kbSetAICostWeight to calculate multipliers. If considerHealth is true it will take the current hitpoints of the unit into account. For example if your Hoplite is half hp then only half the cost of the Hoplite is added to the total.
    • kbUnitQueryGetUnitHitpoints

      public float kbUnitQueryGetUnitHitpoints(int queryID, boolean considerHealth)
      Returns the total maximum hitpoints of the found units inside the provided queryID. If considerHealth is true it will instead return the total of current hitpoints.
    • kbUnitQueryGetPopulationSlots

      public int kbUnitQueryGetPopulationSlots(int queryID)
      Returns the number of pop slots currently occupied by the results in the provided queryID. If this is called on a query that uses a player relation instead of a playerID it will calculate using default population values. If this is called on a query that was also looking queued units the queued units will not be taken into account here. If you need how many population space is taken up by queued units from a player use kbGetPopulationSlotsByUnitTypeID.
    • kbUnitGetIsIDValid

      public boolean kbUnitGetIsIDValid(int unitID, boolean deadIsValid)
      Returns if the unitID corresponds to a unit that is currently in the game. Dead units remain valid for some time after their death, which is why deadIsValid variable exists. If deadIsValid is false then dead units are considered not valid.
    • kbUnitGetPlayerID

      public int kbUnitGetPlayerID(int unitID)
      Returns the player ID of the owner of the provided unitID.
    • kbUnitGetPlanID

      public int kbUnitGetPlanID(int unitID)
      Returns the plan ID for the provided unitID.
    • kbUnitGetBaseID

      public int kbUnitGetBaseID(int unitID)
      Returns the base ID for the provided unitID.
    • kbUnitGetAreaID

      public int kbUnitGetAreaID(int unitID)
      Returns the area ID for the provided unitID.
    • kbUnitGetAreaGroupID

      public int kbUnitGetAreaGroupID(int unitID)
      Returns the area group ID for the provided unitID.
    • kbUnitGetArmyID

      public int kbUnitGetArmyID(int unitID)
      Returns the army ID for the provided unitID.
    • kbUnitGetPosition

      public Vector kbUnitGetPosition(int unitID)
      Returns the position for the provided unit ID that's saved in the KB. The KB doesn't always have the actual position of each unit but instead only updates the position every 5 seconds, only our own units are updated every frame and are thus correct all the time. Hence it can be that if you're looking up a unit not belonging to yourself that you get a position that's 4.99 seconds old. If you really need the actual position of a unit use kbUnitGetTruePosition, that syscall is cheating if used for units you don't have active LOS over. If you're asking the position of an enemy unit (not mother nature) it can be that we haven't seen the unit for a long time If that's the case we still have the unit in our KB but we've modified the position to be cNoRecentPositionKnown. Any unit that isn't visible under fog of war will be set to cNoRecentPositionKnown after 25-26 seconds of losing line of sight of the unit.
    • kbUnitGetTruePosition

      public Vector kbUnitGetTruePosition(int unitID)
      Returns the true position for the provided unitID. Only usecase for this is if you need the exact location of a unit not beloning to yourself and don't want a potentially 4.99 seconds outdated one. If used for enemy units you don't have active LOS over it's cheating.
    • kbUnitGetHeading

      public int kbUnitGetHeading(int unitID)
      Returns the heading for the provided unitID.
    • kbUnitGetIdleTime

      public int kbUnitGetIdleTime(int unitID)
      Returns the idle time for the provided unitID, in milliseconds.
    • kbUnitIsType

      public boolean kbUnitIsType(int unitID, int unitTypeID)
      Returns if the provided unitID is of the provided unitTypeID.
    • kbUnitIsTrainingOrResearching

      public boolean kbUnitIsTrainingOrResearching(int unitID)
      Returns if the provided unitID is currently Training or Researching.
    • kbUnitIsEmpowered

      public boolean kbUnitIsEmpowered(int unitID)
      Returns if the provided unitUD is currently empowered.
    • kbUnitGetActionType

      public int kbUnitGetActionType(int unitID)
      Returns the actionTypeID the provided unitID is currently performing, cActionType constants.
    • kbUnitGetTargetUnitID

      public int kbUnitGetTargetUnitID(int unitID)
      Returns the target unit ID of the provided unitID.
    • kbUnitGetNumberWorkers

      public int kbUnitGetNumberWorkers(int unitID)
      Returns the number of units currently working on the provided unitID.
    • kbUnitGetWorkerID

      public int kbUnitGetWorkerID(int unitID, int index)
      Returns the index-th worker of the provided unitID, use kbUnitGetNumberWorkers to know how many indexes there are.
    • kbUnitGetProtoUnitID

      public int kbUnitGetProtoUnitID(int unitID)
      Returns the protounitID if the provided unitID.
    • kbUnitGetResourceAmount

      public float kbUnitGetResourceAmount(int unitID, int resourceID)
      Returns the resource amount of the provided unitID of the provided resourceID.
    • kbUnitGetCarryCapacity

      public float kbUnitGetCarryCapacity(int unitID, int resourceID)
      Returns the resource carry capacity of the provided unitID of the provided resourceID.
    • kbUnitIsInLush

      public boolean kbUnitIsInLush(int unitID, int playerID)
      Returns if the provided unitID is within terrain lush belonging to the provided playerID.
    • kbUnitGetContainer

      public int kbUnitGetContainer(int unitID)
      Returns the container ID for the provided unitID.
    • kbUnitIsContainedBy

      public boolean kbUnitIsContainedBy(int unitID, int unitTypeID)
      Returns if provided unitID is contained by a container belonging to the provided unitTypeID.
    • kbUnitGetNumberContained

      public int kbUnitGetNumberContained(int unitID)
      Returns the number of units contained by the provided unitID.
    • kbUnitGetNumberContainedOfType

      public int kbUnitGetNumberContainedOfType(int unitID, int unitTypeID)
      Returns the number of units contained of the provided unitTypeID by the provided unitID.
    • kbUnitGetContainedUnitByIndex

      public int kbUnitGetContainedUnitByIndex(int unitID, int index)
      Returns the ID of the unit contained at the provided index within the provided unitID. Use kbUnitGetNumberContained to know how many indexes there are.
    • kbUnitGetIsAffectedByStatusEffect

      public boolean kbUnitGetIsAffectedByStatusEffect(int unitID, int statusEffectID)
      Returns if the provided unitID is affected by the provided statusEffectID, cStatusEffect constants.
    • kbUnitGetNumberActions

      public int kbUnitGetNumberActions(int unitID)
      Returns the number of actions of the provided unitID currently has.
    • kbUnitGetKBResourceID

      public int kbUnitGetKBResourceID(int unitID, boolean deadIsValid)
      Returns what KB resource the provided unitID is in.
    • kbUnitGetCurAnimationID

      public int kbUnitGetCurAnimationID(int unitID)
      Returns the ID of the current animation for the provided unitID.
    • kbUnitGetDistanceToPoint

      public float kbUnitGetDistanceToPoint(int unitID, Vector point)
      Returns the distance from the provided unitID to the provided point, which includes the unit's radius.
    • kbUnitGetDistanceToUnit

      public float kbUnitGetDistanceToUnit(int unitID, int otherUnitID)
      Returns the distance from the provided unitID to the provided otherUnitID, which includes both the units' radii.
    • kbUnitGetResourceAutoGatherRate

      public float kbUnitGetResourceAutoGatherRate(int unitID, int resourceID)
      Returns the auto-gather rate value for the provided resourceID of the provided unitID.
    • kbUnitGetCurrentQueueSize

      public int kbUnitGetCurrentQueueSize(int unitID)
      Returns how many train / research actions are currently queued for the provided unitID.
    • kbUnitGetQueueTypeAtIndex

      public int kbUnitGetQueueTypeAtIndex(int unitID, int index)
      Returns either cActionTypeTrain or cActionTypeResearch based on what type of queue item is present for the provided unitID at the provided index. Use in combination with kbUnitGetCurrentQueueSize to know how many indexes there are.
    • kbUnitGetQueueItemAtIndex

      public int kbUnitGetQueueItemAtIndex(int unitID, int index)
      Returns either the techID or the protoUnitID for the queued item at the provided index for the provided unitID.
    • kbUnitIsInBuildingChain

      public boolean kbUnitIsInBuildingChain(int unitID)
      Returns if the provided unitID is currently connected to any building chain, example: favored land for Chinese.
    • kbUnitIsTemporaryCharmedUnit

      public boolean kbUnitIsTemporaryCharmedUnit(int unitID)
      Returns if the provided unitID is a charmed unit that will disappear at some point.
    • kbUnitGetPower

      public float kbUnitGetPower(int unitID, boolean ignoreCurrentHealth)
      We first need to establish an initial value that we then potentially multiply due to ignoreCurrentHealth. This initial value can be determined in three ways: 1. If the provided unitID has a population cost -> take that. 2. If the provided unitID has a resource cost -> get the total cost (which is modified by kbSetAICostWeight) and divide it by 100.0. 3. If the provided unitID has neither of the above then we default to 1.0. If ignoreCurrentHealth is set to false then the initial value that we got from one of the three methods is multiplied by the health percentage of the provided unitID, otherwise we return the initial value.
    • kbUnitsGetPower

      public float kbUnitsGetPower(int[] unitIDs, boolean ignoreCurrentHealth)
      Returns a power rating for the units in the provided unitIDs array. This is calculated by doing the same logic as described in kbUnitGetPower for each index.
    • kbUnitGetSiegePower

      public float kbUnitGetSiegePower(int unitID, boolean ignoreCurrentHealth)
      The first step of the calculation is to call kbUnitGetPower, this is the first value. Then the second value can be determined in three ways: 1. If the provided unitID is an abstractSiegeWeapon -> 8.0. 2. If the provided unitID is good against buildings (damage bonus / crush damage) -> 4.0. 3. Look at the attacks the provided unitID has how effective they would be against a building -> cap at 1.5. Multiply the first value by the second value, that's the return value.
    • kbUnitsGetSiegePower

      public float kbUnitsGetSiegePower(int[] unitIDs, boolean ignoreCurrentHealth)
      Returns a siege power rating for the units in the provided unitIDs array. This is calculated by doing the same logic as described in kbUnitGetSiegePower for each index.
    • kbUnitGetCommandCost

      public float kbUnitGetCommandCost(int unitID, int techID, int resourceID)
      Returns the in-game cost for the provided resourceID type for the protoUnitCommand that corresponds to the provided techID,while accounting for dynamic bonuses for the provided unitID.
    • kbUnitGetTactic

      public int kbUnitGetTactic(int unitID)
      Returns the current tactic DBID for the provided unitID.
    • kbUnitGetIsKnockedOut

      public boolean kbUnitGetIsKnockedOut(int unitID)
      Returns if the provided unitID is knocked out.
    • kbProtoUnitGetIsValidID

      public boolean kbProtoUnitGetIsValidID(int protoUnitID)
      Returns if the provided protoUnitID is valid.
    • kbProtoUnitIsType

      public boolean kbProtoUnitIsType(int protoUnitID, int unitTypeID)
      Returns if the provided protoUnitID is of the provided unitTypeID.
    • kbProtoUnitAvailable

      public boolean kbProtoUnitAvailable(int protoUnitID)
      Returns if the provided protoUnitID is currently available.
    • kbProtoUnitInitialResource

      public float kbProtoUnitInitialResource(int protoUnitID, int resourceID)
      Returns the initial resource amount of the provided protounitID for the provided rsourceID.
    • kbProtoUnitCostPerResource

      public float kbProtoUnitCostPerResource(int protoUnitID, int resourceID)
      Returns the cost of the provided protounitID for the provided resourceID.
    • kbProtoUnitGetCost

      public float[] kbProtoUnitGetCost(int protoUnitID)
      Returns the costs of the provided protounitID.
    • kbProtoUnitGetCostTotal

      public float kbProtoUnitGetCostTotal(int protoUnitID)
      Returns the total cost of the provided protounitID.
    • kbProtoUnitGetGatherRate

      public float kbProtoUnitGetGatherRate(int protoUnitID, int resourcePUID)
      Returns the provided protoUnitID's gather rate towars the provided resourcePUID.
    • kbProtoUnitHasTrainCommands

      public boolean kbProtoUnitHasTrainCommands(int protoUnitID)
      Returns if the provided protoUnitID can train/build other units/buildings.
    • kbProtoUnitCanTrain

      public boolean kbProtoUnitCanTrain(int protoUnitID, int trainPUID)
      Returns if the provided protoUnitID unit can train the provided trainPUID.
    • kbProtoUnitCanResearch

      public boolean kbProtoUnitCanResearch(int protoUnitID, int techID)
      Returns if the provided protoUnitID unit can research the provided techID.
    • kbProtoUnitGetTrainers

      public int[] kbProtoUnitGetTrainers(int protoUnitID)
      Returns an array of all accessible PUIDs that can train the provided protoUnitID.
    • kbProtoUnitGetName

      public String kbProtoUnitGetName(int protoUnitID)
      Returns the name of the provided protoUnitID. Return value is the name provided in the proto.xml, internal names.
    • kbProtoUnitGetBuildRate

      public float kbProtoUnitGetBuildRate(int playerID, int builderPUID, int buildingPUID)
      Returns the build rate that the provided builderPUID has towards the provided buildingPUID for the provided playerID. If within the same build action there is a direct type match it's always taken over an abstract type match.
    • kbProtoUnitGetBuildingChainRadius

      public float kbProtoUnitGetBuildingChainRadius(int playerID, int protoUnitID)
      Returns the building chain radius for the provided protoUnitID for the provided playerID.
    • kbProtoUnitGetIconPath

      public String kbProtoUnitGetIconPath(int playerID, int protoUnitID, int cultureID)
      Returns the icon path of the provided protoUnitID of the provided playerID. CultureID can be provided to get culture specific icons, or left -1 to get default value.
    • kbProtoUnitGetDisplayName

      public String kbProtoUnitGetDisplayName(int playerID, int protoUnitID)
      Returns the display name of the provided protoUnitID for the provided playerID. Use playerID 0 if you want to exclude upgrade names. Return value is the translated version.
    • kbProtoUnitGetLongRollover

      public String kbProtoUnitGetLongRollover(int playerID, int protoUnitID)
      Returns the long rollover of the provided protoUnitID for the provided playerID. Return value is the translated version.
    • kbProtoUnitGetShortRollover

      public String kbProtoUnitGetShortRollover(int playerID, int protoUnitID)
      Returns the short rollover of the provided protoUnitID for the provided playerID. Return value is the translated version.
    • kbUnitTypeGetName

      public String kbUnitTypeGetName(int unitTypeID)
      Returns the name of the provided unitTypeID. Return values are internal names.
    • kbProtoUnitGetPower

      public float kbProtoUnitGetPower(int protoUnitID)
      Returns the outcome of the same calculation as described in kbUnitGetPower, but health percentage is not a factor here.
    • kbProtoUnitGetSiegePower

      public float kbProtoUnitGetSiegePower(int protoUnitID)
      Returns the outcome of the same calculation as described in kbUnitGetSiegePower, but health percentage is not a factor here.
    • kbUnitGetStatFloat

      public float kbUnitGetStatFloat(int unitID, int statEnumID)
      Returns the value for the provided float statEnumID of the provided unitID, "KB unit stats: float" constants.
    • kbDefaultGetProtoStatFloat

      public float kbDefaultGetProtoStatFloat(int protoUnitID, int statEnumID)
      Returns the value for the provided float statEnumID for the provided protoUnitID (base values), "KB proto stats: float" constants.
    • kbPlayerGetProtoStatFloat

      public float kbPlayerGetProtoStatFloat(int playerID, int protoUnitID, int statEnumID)
      Returns the value for the provided float statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: float" constants.
    • kbUnitGetStatInt

      public int kbUnitGetStatInt(int unitID, int statEnumID)
      Returns the value for the provided int statEnumID of the provided unitID, "KB unit stats: int" constants.
    • kbDefaultGetProtoStatInt

      public int kbDefaultGetProtoStatInt(int protoUnitID, int statEnumID)
      Returns the value for the provided int statEnumID for the provided protoUnitID (base values), "KB proto stats: int" constants.
    • kbPlayerGetProtoStatInt

      public int kbPlayerGetProtoStatInt(int playerID, int protoUnitID, int statEnumID)
      Returns the value for the provided int statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: int" constants.
    • kbUnitGetStatBool

      public boolean kbUnitGetStatBool(int unitID, int statEnumID)
      Returns the value for the provided bool statEnumID of the provided unitID, "KB unit stats: bool" constants.
    • kbUnitGetStatFlag

      public boolean kbUnitGetStatFlag(int unitID, int flagEnumID)
      Returns if the provided flagEnumID is sets on the provided unitID, cUnitFlag constants.
    • kbDefaultGetProtoStatBool

      public boolean kbDefaultGetProtoStatBool(int protoUnitID, int statEnumID)
      Returns the value for the provided bool statEnumID for the provided protoUnitID (base values), "KB proto stats: bool" constants.
    • kbPlayerGetProtoStatBool

      public boolean kbPlayerGetProtoStatBool(int playerID, int protoUnitID, int statEnumID)
      Returns the value for the provided bool statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: bool" constants.
    • kbDefaultGetProtoStatFlag

      public boolean kbDefaultGetProtoStatFlag(int protoUnitID, int flagEnumID)
      Returns if the provided flagEnumID is sets on the provided protoUnitID (base values), cProtoUnitFlag constants.
    • kbPlayerGetProtoStatFlag

      public boolean kbPlayerGetProtoStatFlag(int playerID, int protoUnitID, int flagEnumID)
      Returns if the provided flagEnumID is sets on the provided protoUnitID for the provided playerID, cProtoUnitFlag constants.
    • kbUnitGetStatString

      public String kbUnitGetStatString(int unitID, int statEnumID)
      Returns the value for the provided string statEnumID of the provided unitID, "KB unit stats: string" constants.
    • kbDefaultGetProtoStatString

      public String kbDefaultGetProtoStatString(int protoUnitID, int statEnumID)
      Returns the value for the provided string statEnumID for the provided protoUnitID (base values), "KB proto stats: string" constants.
    • kbPlayerGetProtoStatString

      public String kbPlayerGetProtoStatString(int playerID, int protoUnitID, int statEnumID)
      Returns the value for the provided string statEnumID for the provided protoUnitID belonging to the provided playerID, "KB proto stats: string" constants.
    • kbUnitGetCurrentDamageMultiplier

      public float kbUnitGetCurrentDamageMultiplier(int unitID, int damageType)
      Returns the current damage multiplier the provided unitID has. If a damageType is specified specific damage type boosts are also included.
    • kbUnitGetCurrentROFMultiplier

      public float kbUnitGetCurrentROFMultiplier(int unitID)
      Returns the current ROF multiplier the provided unitID has.
    • kbUnitGetMaintainActionPausedByIndex

      public boolean kbUnitGetMaintainActionPausedByIndex(int unitID, int index)
      Currently not really functional since you can't fetch the proper index.
    • kbProtoUnitGetActionIDs

      public int[] kbProtoUnitGetActionIDs(int playerID, int protoUnitID)
      Returns the ids of the proto actions the provided protoUnitID has, these match with the cActionType constants.
    • kbProtoUnitGetActionMaximumRange

      public float kbProtoUnitGetActionMaximumRange(int playerID, int protoUnitID, String action, int type)
      Returns the maximum range of the action for the provided unit action. If type is specified it will search for a specific typed range, if it's not found the standard range is returned instead.
    • kbProtoUnitGetActionDamageForType

      public float kbProtoUnitGetActionDamageForType(int playerID, int protoUnitID, String actionName, int damageType)
      eturns total damageType damage stat for the provided unit action.
    • kbProtoUnitGetActionStatFloat

      public float kbProtoUnitGetActionStatFloat(int playerID, int protoUnitID, String actionName, int statEnumID)
      Returns the value for the provided float stat of the provided unit action. Valid enums are: KB action stats: float.
    • kbProtoUnitGetActionStatInt

      public int kbProtoUnitGetActionStatInt(int playerID, int protoUnitID, String actionName, int statEnumID)
      Returns the value for the provided int stat of the provided unit action. Valid enums are: KB action stats: int.
    • kbActionGetName

      public String kbActionGetName(int actionID)
      Returns the name for the provided actionID, use the cActionType constants for this.
    • kbGetMapCenter

      public Vector kbGetMapCenter()
      Returns the center vector of the map.
    • kbGetMapXSize

      public float kbGetMapXSize()
      Returns the X size of the map.
    • kbGetMapZSize

      public float kbGetMapZSize()
      Returns the Z size of the map.
    • kbGetIsLocationOnMap

      public boolean kbGetIsLocationOnMap(Vector location)
      Returns if the provided location is on the map.
    • kbAreaGetIsIDValid

      public boolean kbAreaGetIsIDValid(int areaID)
      Returns if the provided areaID is valid.
    • kbAreaGetNumber

      public int kbAreaGetNumber()
      Returns the number of areas the KB has generated.
    • kbAreaGetIDByPosition

      public int kbAreaGetIDByPosition(Vector position)
      Returns the areaID that is located at the provided position.
    • kbAreaGetIDsByPositionAndRange

      public int[] kbAreaGetIDsByPositionAndRange(Vector position, float range, int[] validTypes, boolean mustBeOnConnectedAreaGroup, int movementType)
      Returns all areaIDs that are within the provided range from the provided position, area's center position is used to calculate this. If mustBeOnConnectedAreaGroup is true then the provided movementType will be used to determine if the found area is connected to the area group of the provided position. validTypes is an array consisting of area types that are valid to be returned, cAreaType constants.
    • kbAreaGetGroupID

      public int kbAreaGetGroupID(int areaID)
      Returns the areaGroupID of the provided areaID.
    • kbAreaGetCenter

      public Vector kbAreaGetCenter(int areaID)
      Returns the center of the provided areaID.
    • kbAreaGetNumberTiles

      public int kbAreaGetNumberTiles(int areaID)
      Returns the number of tiles in the provided areaID.
    • kbAreaGetNumberBlackTiles

      public int kbAreaGetNumberBlackTiles(int areaID)
      Returns the number of black tiles in the provided areaID.
    • kbAreaGetNumberVisibleTiles

      public int kbAreaGetNumberVisibleTiles(int areaID)
      Returns the number of visible tiles in the provided areaID.
    • kbAreaGetNumberFogTiles

      public int kbAreaGetNumberFogTiles(int areaID)
      Returns the number of fog tiles in the provided areaID.
    • kbAreaGetVisibilityChangeTime

      public int kbAreaGetVisibilityChangeTime(int areaID)
      Returns the gametime in milliseconds of the last visibility change for the provided areaID. If any of the tiles change their visibility status this timer is updated.
    • kbAreaGetPercentExplored

      public float kbAreaGetPercentExplored(int areaID)
      Returns what percentage of tiles are either in fog or visible for the provided areaID.
    • kbAreaGetNumberUnits

      public int kbAreaGetNumberUnits(int areaID)
      Returns the number of units in the provided areaID.
    • kbAreaGetUnitID

      public int kbAreaGetUnitID(int areaID, int index)
      Returns the unitID at the index-th unit in the provided areaID.
    • kbAreaGetNumberBorderAreas

      public int kbAreaGetNumberBorderAreas(int areaID)
      Returns the number of border areas for the provided areaID.
    • kbAreaGetBorderAreaID

      public int kbAreaGetBorderAreaID(int areaID, int index)
      Returns the areaID at the index-th border area in the provided areaID.
    • kbAreaBordersAreaID

      public boolean kbAreaBordersAreaID(int areaID, int borderAreaID)
      Returns if the provided areaID borders the provided borderAreaID.
    • kbAreaGetClosestAreaID

      public int kbAreaGetClosestAreaID(Vector position, int areaType, float minDistance)
      Scans from the provided position for areas of the provided type. Returns the areaID of the closest matching area. minDistance can be left undefined to set no distance at all, if defined the found areas must be within that distance. areaType MUST be defined.
    • kbAreaGetType

      public int kbAreaGetType(int areaID)
      Returns the type of the provided areaID, cAreaType constants.
    • kbAreaGetDangerLevel

      public float kbAreaGetDangerLevel(int areaID, boolean averageInBorderAreas)
      Returns the danger rating of the provided areaID. If averageInBorderAreas is defined you will get the average rating of the provided areaID plus its border areas.
    • kbAreaUpdateAllAreas

      public void kbAreaUpdateAllAreas()
      Force updates all the areas, use with caution due to performance concerns.
    • kbAreaGroupGetIsIDValid

      public boolean kbAreaGroupGetIsIDValid(int areaGroupID)
      Returns if the provided areaGroupID is valid.
    • kbAreaGroupGetNumber

      public int kbAreaGroupGetNumber()
      Returns the number of area groups the KB has generated.
    • kbAreaGroupGetAreaID

      public int kbAreaGroupGetAreaID(int areaGroupID, int index)
      Returns the areaID at the provided index of the provided areaGroupID.
    • kbAreaGroupGetType

      public int kbAreaGroupGetType(int areaGroupID)
      Returns the type of the provided areaGroupID, cAreaGroupType constants.
    • kbAreaGroupGetNumberAreas

      public int kbAreaGroupGetNumberAreas(int areaGroupID)
      Returns the number of areas the provided areaGroupID has.
    • kbAreaGroupGetNumberTiles

      public int kbAreaGroupGetNumberTiles(int areaGroupID)
      Returns the number of tiles the provided areaGroupID has.
    • kbAreaGroupGetIDByPosition

      public int kbAreaGroupGetIDByPosition(Vector position)
      Returns the areaGroupID that is located at the provided position.
    • kbAreaGroupGetCenter

      public Vector kbAreaGroupGetCenter(int areaGroupID)
      Returns the center of the provided areaGroupID.
    • kbAreaGroupGetSurfaceArea

      public float kbAreaGroupGetSurfaceArea(int areaGroupID)
      Returns the surface area of the provided areaGroupID.
    • kbAreaGroupGetNumberBorderAreaGroups

      public int kbAreaGroupGetNumberBorderAreaGroups(int areaGroupID)
      Returns the amount of border area groups the provided areaGroupID has.
    • kbAreaGroupGetBorderAreaGroupID

      public int kbAreaGroupGetBorderAreaGroupID(int areaGroupID, int index)
      Returns the areaGroupID of the index-th border area group in the provided areaGroupID. Use in combination with kbAreaGroupGetNumberBorderAreaGroups to know how many indexes there are.
    • kbAreaGroupBordersAreaGroupID

      public boolean kbAreaGroupBordersAreaGroupID(int areaGroupID, int borderAreaGroupID)
      Returns if the provided areaGroupID borders the provided borderAreaGroupID.
    • kbAreaGroupGetAllLandAreaGroups

      public int[] kbAreaGroupGetAllLandAreaGroups()
      Returns an array with all area group IDs with the type cAreaGroupTypeLand.
    • kbAreaGroupGetUsefulWaterAreaGroups

      public int[] kbAreaGroupGetUsefulWaterAreaGroups()
      Returns an array with all area group IDs with the type cAreaGroupTypeWater/Amphibious that we consider useful. Useful here means that from that area group we can path towards every land area group there is on the map. Meaning that if we build a Dock + transports there we can reach all land masses for transporting. If the map is not an island map this instead returns an array of all water + amphibious area groups. Amphibious area groups which are smaller than 5 tiles are excluded from the return array.
    • kbPathGetIsIDValid

      public boolean kbPathGetIsIDValid(int pathID)
      Returns if the provided pathID is valid.
    • kbPathCreate

      public int kbPathCreate(String name)
      Creates a path with the provided name.
    • kbPathDestroy

      public void kbPathDestroy(int pathID)
      Destroys the provided path.
    • kbPathGetNumber

      public int kbPathGetNumber()
      Returns the number of paths the KB currently has.
    • kbPathGetIDByIndex

      public int kbPathGetIDByIndex(int index)
      Returns the index-th pathID, use in combination with kbPathGetNumber to know how many indexes there are.
    • kbPathGetIDByName

      public int kbPathGetIDByName(String name)
      Returns the pathID with the matching name.
    • kbPathGetName

      public String kbPathGetName(int pathID)
      Returns the name of the provided pathID.
    • kbPathGetLength

      public float kbPathGetLength(int pathID)
      Returns the length of the provided pathID.
    • kbPathCalculateLength

      public float kbPathCalculateLength(int pathID, boolean ignoreY)
      Returns the length of the provided pathID after calculating it.
    • kbPathGetNumberWaypoints

      public int kbPathGetNumberWaypoints(int pathID)
      Returns the number of waypoints the provided pathID has.
    • kbPathAddWaypoint

      public void kbPathAddWaypoint(int pathID, Vector waypoint)
      Adds the provided waypoint to the provided pathID.
    • kbPathAddWaypointAfter

      public void kbPathAddWaypointAfter(int pathID, int waypointIndex, Vector waypoint)
      Adds the provided waypoint to the provided pathID after the provided waypointIndex.
    • kbPathGetWaypoint

      public Vector kbPathGetWaypoint(int pathID, int wpIndex)
      Returns the waypoint at the provided wpIndex of the provided pathID.
    • kbPathRemoveWaypoint

      public void kbPathRemoveWaypoint(int pathID, int wpIndex)
      Removes the waypoint at the provided wpIndex of the provided pathID.
    • kbPathCreateAreaPath

      public boolean kbPathCreateAreaPath(int pathID, int startAreaID, int goalAreaID, int movementType, float dangerThreshold, boolean allowPartialPath, boolean allowTeleporters)
      Creates an area path with the provided parameters and saves it into the provided pathID. Returns if a path could be created with the provided parameters, especially useful if allowPartialPath was set to false.
    • kbPathAreAreaGroupsConnected

      public boolean kbPathAreAreaGroupsConnected(int startAreaGroupID, int goalAreaGroupID, int movementType, boolean bool4)
      Returns if the provided area group IDs can be pathed between with the provided movementType. If skipPathingCheckOnGoalAreaGroup is set to true the goal area doesn't need to be pathable to with the provided movementType.
    • kbPathCreateAreaGroupPath

      public int[] kbPathCreateAreaGroupPath(int startAreaGroupID, int goalAreaGroupID, int movementType, boolean bool4)
      Returns the area group IDs that need to be pathed over to reach the provided goalAreaGroupID starting from the provided startAreaGroupID using the provided movementType. If skipPathingCheckOnGoalAreaGroup is set to true the goal area doesn't need to be pathable to with the provided movementType.
    • kbCanPath

      public boolean kbCanPath(Vector pointA, Vector pointB, int protoUnitID, float range, int targetID)
      Returns if the provided protoUnitID can path from pointA to pointB. Only performs high level pathing (ignores moveable obstructions like units).
    • kbCanAreaPath

      public boolean kbCanAreaPath(Vector pointA, Vector pointB, int movementType, float dangerThreshold, boolean allowPartialPath, int[] ignoreAreas, boolean teleporters)
      Returns if an area path can be made with the provided parameters.
    • kbFindClosestPassablePoint

      public Vector kbFindClosestPassablePoint(Vector startPoint, int movementType, float range)
      Returns the first spot on the map that is not obstructed for the provided movementType. Scanning begins from the provided startPoint with the provided range. If range is set to below 0.0 it will scan the entire map. If no passable spot could be found it returns cInvalidVector.
    • kbAttackRouteGetIsIDValid

      public boolean kbAttackRouteGetIsIDValid(int routeID)
      Returns if the provided routeID is valid.
    • kbCreateAttackRouteWithPath

      public int kbCreateAttackRouteWithPath(String name, Vector startPoint, Vector targetPoint)
      Creates an attack route and returns the routeID if successful. Create your own KB paths and add them to this route via kbAttackRouteAddPath. And then add the routeID to attack plans if you want the route used. The startPoint/targetPoint are only for the debug display and for when you call kbAttackRouteAddPath with addRouteStartAndTargetPoints on true.
    • kbAttackRouteGetByName

      public int kbAttackRouteGetByName(String name)
      Returns the attack route ID with the matching name.
    • kbAttackRouteDestroy

      public void kbAttackRouteDestroy(int routeID)
      Destroys the provided routeID.
    • kbAttackRouteGetNumber

      public int kbAttackRouteGetNumber()
      Returns the number of attack routes the KB has saved. Attention: this includes deleted attack routes.
    • kbAttackRouteGetIDByIndex

      public int kbAttackRouteGetIDByIndex(int index)
      Returns the index-th attack route ID. Use in combination with kbAttackRouteGetNumber to know how many indexes there are. Attention: this can often return -1 since destroyed attack routes are also fetched by this.
    • kbAttackRouteAddPath

      public void kbAttackRouteAddPath(int routeID, int pathID, boolean addRouteStartAndTargetPoints)
      Adds the provided pathID to the provided routeID. If addRouteStartAndTargetPoints is true the path will be adjusted so its first waypoint is the startPoint of the route and the last waypoint is the targetPoint of the route (if they aren't already). Existing waypoints won't be altered, just new ones insterted potentially.
    • kbAttackRouteGetNumberPaths

      public int kbAttackRouteGetNumberPaths(int routeID)
      Returns how many paths the provided routeID has.
    • kbAttackRouteGetPathIDByIndex

      public int kbAttackRouteGetPathIDByIndex(int routeID, int index)
      Returns the index-th path ID of the provided routeID. Use in combination with kbAttackRouteGetNumberPaths to know how many indexes there are.
    • kbAttackRouteRemovePathByID

      public void kbAttackRouteRemovePathByID(int routeID, int pathID)
      Removes the provided pathID from the provided routeID. Attention: this does not delete the path, use kbPathDestroy for that.
    • kbEscrowCreate

      public int kbEscrowCreate(String name, int resourceID, float percentage, int parentID)
      Creates an escrow.
    • kbEscrowDestroy

      public boolean kbEscrowDestroy(int escrowID, boolean promoteChildren)
      Destroys an escrow.
    • kbEscrowGetID

      public int kbEscrowGetID(String name)
      Returns the ID of the named escrow.
    • kbEscrowGetPercentage

      public float kbEscrowGetPercentage(int escrowID, int resourceID)
      Returns the percentage of the escrow.
    • kbEscrowSetPercentage

      public boolean kbEscrowSetPercentage(int escrowID, int resourceID, float percentage)
      Sets the percentage of the escrow.
    • kbEscrowSetCap

      public boolean kbEscrowSetCap(int escrowID, int resourceID, float cap)
      Sets the cap of the escrow.
    • kbEscrowGetAmount

      public float kbEscrowGetAmount(int escrowID, int resourceID)
      Returns the amount of credits in the given escrow for the given resource.
    • kbEscrowFlush

      public boolean kbEscrowFlush(int escrowID, int resourceID, boolean flushChildren)
      Removes all credits (and puts them into the root escrow) of the given resource type from the given escrow.
    • kbEscrowAllocateCurrentResources

      public boolean kbEscrowAllocateCurrentResources()
      Reallocates the current resource stockpile into the escrows.
    • kbCanAffordUnit

      public boolean kbCanAffordUnit(int protoUnitTypeID, int escrowID)
      Returns true if the player can afford the proto unit.
    • kbSetResourceSelectorFactor

      public void kbSetResourceSelectorFactor(int type, int resourceID, float val)
      Sets the ResourceSelector Factor value, cTSFactor constants. When an AI gather plans searches for the next resource to gather from it runs a resource selector. In there we evaluate different elements of different KB Resources and give a value to each. With this syscall you can determine how much value is given to each element.
    • kbGetResourceSelectorFactor

      public float kbGetResourceSelectorFactor(int type, int resourceID)
      Returns the ResourceSelector Factor value of the provided type and provided resourceID.
    • kbAICostSetWeight

      public void kbAICostSetWeight(int resourceID, float weight)
      Sets the weight the provided resourceID is given during AI cost calculuations.
    • kbAICostGetWeight

      public float kbAICostGetWeight(int resourceID)
      Returns the AI cost weight for the provided resourceID.
    • kbAICostGetUnitCost

      public float kbAICostGetUnitCost(int unitID)
      Returns the current AI cost for the provided unitID. This is calculated by tallying up the individual resource costs of the proto unit (potentially multiplied by a custom resource weight) and then multiplied by the current health percentage the unit has.
    • kbAICostGetProtoUnitCost

      public float kbAICostGetProtoUnitCost(int protoUnitID)
      Returns the AI cost for the provided protoUnitID. This is calculated by tallying up the individual resource costs of the proto unit and then potentially multiplied by a custom resource weight.
    • kbAICostGetTechCost

      public float kbAICostGetTechCost(int techID)
      Returns the AI cost for the provided techID.This is calculated by tallying up the individual resource costs of the technology and then potentially multiplied by a custom resource weight.
    • kbBaseGetIsIDValid

      public boolean kbBaseGetIsIDValid(int playerID, int baseID)
      Returns if the provided baseID exists for the provided playerID.
    • kbBaseSetFlag

      public void kbBaseSetFlag(int playerID, int baseID, int flag, boolean state)
      Sets the provided flag on the provided baseID + playerID to the provided state.
    • kbBaseIsFlagSet

      public boolean kbBaseIsFlagSet(int playerID, int baseID, int flag)
      Returns if the provided flag is set for the provided baseID + playerID.
    • kbGetAutoMyBaseCreation

      public boolean kbGetAutoMyBaseCreation()
      eturns if the KB is currently automatically creating bases for our OWN units.
    • kbSetAutoMyBaseCreation

      public void kbSetAutoMyBaseCreation(boolean v)
      Sets whether or not the KB automatically creates bases for its OWN units.
    • kbGetAutoMyBaseCreationDistance

      public float kbGetAutoMyBaseCreationDistance()
      Returns the auto base creation distance for OWN bases.
    • kbSetAutoMyBaseCreationDistance

      public void kbSetAutoMyBaseCreationDistance(float distance)
      Sets the default distance with which OWN bases are made.
    • kbGetAutoMyBaseCreationDistanceTC

      public float kbGetAutoMyBaseCreationDistanceTC()
      Returns the auto base creation distance for OWN Town Center bases.
    • kbSetAutoMyBaseCreationDistanceTC

      public void kbSetAutoMyBaseCreationDistanceTC(float distance)
      Sets the default distance with which OWN Town Center bases are made.
    • kbGetAutoOtherBaseCreation

      public boolean kbGetAutoOtherBaseCreation()
      Returns if the KB is currently automatically creating bases for OTHER player's units.
    • kbSetAutoOtherBaseCreation

      public void kbSetAutoOtherBaseCreation(boolean distance)
      Sets whether or not the KB automatically creates bases for OTHER player's units.
    • kbGetAutoOtherBaseCreationDistance

      public float kbGetAutoOtherBaseCreationDistance()
      Returns the auto base creation distance for OTHER player's bases.
    • kbSetAutoOtherBaseCreationDistance

      public void kbSetAutoOtherBaseCreationDistance(float distance)
      Sets the default distance with which OTHER player's bases are made.
    • kbGetAutoOtherBaseCreationDistanceTC

      public float kbGetAutoOtherBaseCreationDistanceTC()
      Returns the auto base creation distance for OTHER player's Town Center bases.
    • kbSetAutoOtherBaseCreationDistanceTC

      public void kbSetAutoOtherBaseCreationDistanceTC(float distance)
      Sets the default distance with which OTHER player's Town Center bases are made.
    • kbFindClosestBase

      public int kbFindClosestBase(int playerID, int playerRelation, Vector location, int movementType, boolean militaryBasesOnly)
      Gets the nearest base belonging to the provided playerID OR player relation from the location. movementType can be left empty to not check for area groups. Otherwise the base must be on a connected area group relative to the location. Only returns bases with the military flag set if militaryBasesOnly is defined.
    • kbBaseGetNextID

      public int kbBaseGetNextID()
      Returns the ID of the next base that will be created, can be used for base names.
    • kbBaseGetNumber

      public int kbBaseGetNumber(int playerID)
      Returns the number of bases the provided playerID has.
    • kbBaseGetIDByIndex

      public int kbBaseGetIDByIndex(int playerID, int index)
      Returns the BaseID of the provided playerID at the provided index.
    • kbBaseGetNameByID

      public String kbBaseGetNameByID(int playerID, int baseID)
      Returns the name of the provided baseID belonging to the provided playerID.
    • kbBaseCreate

      public int kbBaseCreate(int playerID, String name, Vector position, float distance)
      Creates a base with the provided parameters.
    • kbBaseFindOrCreateResourceBase

      public int kbBaseFindOrCreateResourceBase(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
      Searches from the provided position for a KB Resource to make a base for. unclaimedOnly means that KB Resources that are already have an attached gather plan are skipped. It takes gather plans a frame to claim a KB Resource so if you call this multiple times in a single frame you can find the same KB Resource each time.
    • kbBaseDestroy

      public boolean kbBaseDestroy(int playerID, int baseID)
      Destroys the provided baseID belonging to the provided playerID.
    • kbBaseDestroyAll

      public void kbBaseDestroyAll(int playerID)
      Destroys all of the bases for the provided playerID for the KB of the current XS context.
    • kbBaseGetLocation

      public Vector kbBaseGetLocation(int playerID, int baseID)
      Returns the location of the provided baseID belonging to the provided playerID.
    • kbBaseGetLastKnownDamageLocation

      public Vector kbBaseGetLastKnownDamageLocation(int playerID, int baseID)
      Returns the last known damage location of the provided baseID belonging to the provided playerID.
    • kbBaseGetOwner

      public int kbBaseGetOwner(int baseID)
      Returns the player ID of the provided baseID's owner.
    • kbBaseSetFrontVector

      public void kbBaseSetFrontVector(int playerID, int baseID, Vector frontVector)
      Sets the front (and back) of the provided baseID belonging to the provided playerID.
    • kbBaseGetFrontVector

      public Vector kbBaseGetFrontVector(int playerID, int baseID)
      Returns the front vector of the provided baseID belonging to the provided playerID.
    • kbBaseGetBackVector

      public Vector kbBaseGetBackVector(int playerID, int baseID)
      Returns the back vector of the provided baseID belonging to the provided playerID.
    • kbBaseGetTimeUnderAttack

      public int kbBaseGetTimeUnderAttack(int playerID, int baseID)
      Returns the number of continuous seconds the provided baseID belonging to the provided playerID has been under attack.
    • kbBaseGetLastUnderAttackTime

      public int kbBaseGetLastUnderAttackTime(int playerID, int baseID)
      Returns the time when the provided baseID belonging to the provided playerID was last attacked.
    • kbBaseGetDefenseRating

      public float kbBaseGetDefenseRating(int playerID, int baseID, boolean includeCloseToEnemyBaseRating)
      Returns the defense rating of the provided baseID belonging to the provided playerID. If includeCloseToEnemyBaseRating is set to true that rating is included as well.
    • kbBaseGetCloseToEnemyBaseRating

      public float kbBaseGetCloseToEnemyBaseRating(int playerID, int baseID)
      Returns the close to enemy base rating of the provided baseID belonging to the provided playerID.
    • kbBaseGetMainID

      public int kbBaseGetMainID(int playerID)
      Returns the baseID of the base we consider the main base for the provided playerID.
    • kbBaseGetMilitaryGatherPoint

      public Vector kbBaseGetMilitaryGatherPoint(int playerID, int baseID)
      Gets the military gather point of the provided baseID belonging to the provided playerID.
    • kbBaseSetMilitaryGatherPoint

      public void kbBaseSetMilitaryGatherPoint(int playerID, int baseID, Vector gatherPoint)
      Sets the military gather point of the provided baseID belonging to the provided playerID.
    • kbBaseAddUnit

      public void kbBaseAddUnit(int playerID, int baseID, int unitID)
      Adds the provided unitID to the provided baseID belonging to the provided playerID.
    • kbBaseRemoveUnit

      public void kbBaseRemoveUnit(int playerID, int baseID, int unitID)
      Removes the provided unitID to the provided baseID belonging to the provided playerID.
    • kbBaseGetNumberUnitsOfType

      public int kbBaseGetNumberUnitsOfType(int playerID, int baseID, int unitTypeID)
      Returns the number of units that match the provided unitTypeID within the provided baseID belonging to the provided playerID.
    • kbBaseGetUnits

      public int[] kbBaseGetUnits(int playerID, int baseID)
      Returns the unitIDs of all the units that are within the provided baseID belonging to the provided playerID.
    • kbBaseSetPositionAndDistance

      public void kbBaseSetPositionAndDistance(int playerID, int baseID, Vector position, float distance)
      Sets position and distance of the provided baseID belonging to the provided playerID.
    • kbBaseGetDistance

      public float kbBaseGetDistance(int playerID, int baseID)
      Returns the distance of the provided baseID belonging to the provided playerID.
    • kbBaseSetDistance

      public void kbBaseSetDistance(int playerID, int baseID, float newDistance)
      Sets the distance of the provided baseID belonging to the provided playerID.
    • kbUnitPickGetIsIDValid

      public boolean kbUnitPickGetIsIDValid(int upID)
      Returns if the provided upID is valid.
    • kbUnitPickCreate

      public int kbUnitPickCreate(String name)
      Creates a unit picker with the provided name and returns the ID of it.
    • kbUnitPickDestroy

      public boolean kbUnitPickDestroy(int upID)
      Destroys the provided upID.
    • kbUnitPickResetAll

      public void kbUnitPickResetAll(int upID)
      Resets all the provided upID's values.
    • kbUnitPickGetPreferenceWeight

      public float kbUnitPickGetPreferenceWeight(int upID)
      Returns the provided upID's preference weight.
    • kbUnitPickSetPreferenceWeight

      public void kbUnitPickSetPreferenceWeight(int upID, float weight)
      Sets the provided upID's Preference weight. We multiply the unit preferences by this amount for a final preference weight. Setting unit preference values is done via kbUnitPickSetPreferenceFactor.
    • kbUnitPickSetEnemyPlayerID

      public void kbUnitPickSetEnemyPlayerID(int upID, int playerID)
      Sets the upID's enemy player ID, -1 is allowed to reset the playerID. When we query to decide if we can go to counter mode we search for units belonging to this playerID. When analyzing the strength of units we take the stats of the units belonging to this playerID.
    • kbUnitPickSetCombatEfficiencyWeight

      public void kbUnitPickSetCombatEfficiencyWeight(int upID, float weight)
      Sets the provided upID's Combat Efficiency weight. We multiply the unit combat efficiencies by this amount for a final combat efficiency weight. Setting combat efficiency values is done via kbUnitPickAddCombatEfficiencyType.
    • kbUnitPickResetCombatEfficiencyTypes

      public void kbUnitPickResetCombatEfficiencyTypes(int upID)
      Resets the enemy unitTypeIDs for the provided upID's combat efficiency calculation.
    • kbUnitPickAddCombatEfficiencyType

      public boolean kbUnitPickAddCombatEfficiencyType(int upID, int unitTypeID, float weight)
      Adds an enemy unitTypeID to the provided upID's combat efficiency calculation. This ONLY works after having used kbUnitPickSetEnemyPlayerID! This is ONLY used when we're NOT in counter mode and have to base our picks off default stats + weights. Example: we're NOT in counter mode and have only 1 combat efficiency set, against AbstractInfantry. We will now analyze all our valid units and test them against all enemy units that are AbstractInfantry. Which will results in our highest picks being units that do well against AbstractInfantry. Note: enemy units of type AbstractInfantry that currently CAN'T be trained by the enemy will not be analized.
    • kbUnitPickRemoveCombatEfficiencyType

      public void kbUnitPickRemoveCombatEfficiencyType(int upID, int unitTypeID)
      Removes the provided unitTypeID from the provided upID's combat efficiency calculation.
    • kbUnitPickSetMovementType

      public void kbUnitPickSetMovementType(int upID, int movementType)
      Set this before you call kbUnitPickSetPreferenceFactor. Sets the upID's movement type, this is used to filter our own units. If any of our units don't have at least one of the specified movement types it's not valid. Use cPassability*** constants for this, you can stack multiple types on top of one another.
    • kbUnitPickResetMovementType

      public void kbUnitPickResetMovementType(int upID)
      Resets the provided upID's movement type to cPassabilityNone.
    • kbUnitPickSetAttackUnitType

      public void kbUnitPickSetAttackUnitType(int upID, int unitTypeID)
      Sets the provided upID's attack unit type. When we're querying to see if we have enough enemies to go into counter mode, this is the unitTypeID we use to query for.
    • kbUnitPickGetAttackUnitType

      public int kbUnitPickGetAttackUnitType(int upID)
      Return the provided upID's attack unit type.
    • kbUnitPickSetPreferenceFactor

      public boolean kbUnitPickSetPreferenceFactor(int upID, int unitTypeID, float preferenceFactor)
      Use kbUnitPickSetMovementType first or all units will be filtered away because the movementType is invalid. Sets the provided upID's Preference Factor for the provided unitTypeID. A preference is a flat value that has two purposes: 1. Adding a unit to the list of our own valid units. If a unit has no preference set it won't be analyzed. 2. Artificially increasing the likelihood a unit does well in our analyzis (the preference is added to the total factor). If you add a preference for AbstractInfantry then all the units that are currently enabled for us with the AbstractInfantry tag will be added to our valid unit list. Setting a preference for a unit multiple times is supported, you just overwrite the previously set preference. Setting a preference of <= 0.0 will completely exclude those units from our valid list.
    • kbUnitPickSetMinimumCounterModeNumberUnits

      public void kbUnitPickSetMinimumCounterModeNumberUnits(int upID, int numberUnits)
      Sets the minimum number of enemy units that have to be visible (not seeable only) to turn on counter mode for the provided upID.Can be used together with kbUnitPickSetMinimumCounterModePop, if one of the two is true we will enter counter mode. kbUnitPickSetCounterModeExcludeTypes explains what counter mode is.
    • kbUnitPickSetMinimumCounterModePop

      public void kbUnitPickSetMinimumCounterModePop(int upID, int pop)
      Sets the minimum total pop count of enemy units that have to be visible (not seeable only) to turn on counter enemy mode for the provided upID. Can be used together with kbUnitPickSetMinimumCounterModeNumberUnits, if one of the two is true we will enter counter mode. kbUnitPickSetCounterModeExcludeTypes explains what counter mode is.
    • kbUnitPickSetCounterModeExcludeTypes

      public void kbUnitPickSetCounterModeExcludeTypes(int upID, int[] types)
      Sets the exclude types that will be used for the query to determine if we should enter counter mode or not for the provided upID. At the beginning of a unit picker run we query for all AttackUnitType units belonging to the target player. If we find enough either pop/raw count we go into counter mode. In counter mode we compare our input units versus the units the query found, aka we compare against the real enemy army we know of. So with kbUnitPickSetCounterModeExcludeTypes we can remove some unit types from this query if we want to ignore them.
    • kbUnitPickRun

      public int kbUnitPickRun(int upID)
      Resets all the previous results and then runs the provided upID again. Returns how many results there are. Final results are calculated like this: Preference Factor * Preference Weight + Combat Efficiency value (determined via analysis) * Combat Efficiency Weight. Before you run a unit picker you should always do the entire setup of all the data again. This is because when you add preferences or combat efficiencies weights the code will look at the current state of the game to fill up its lists. So if you wanted to include AbstractInfantry in your own list of units and were Classical Zeus you only added Hoplites, Jason, and Heracles. But if in the meantime you're now Heroic the system won't have added Hypaspists to that list by itself. You need to set a preference weight for AbstractInfantry again to have Hypaspists added.
    • kbUnitPickGetNumberResults

      public int kbUnitPickGetNumberResults(int upID)
      Returns the number of results for the provided upID, can only be used after kbUnitPickRun.
    • kbUnitPickGetResult

      public int kbUnitPickGetResult(int upID, int index)
      Returns the index-th ProtoUnitID for the provided upID, can only be used after kbUnitPickRun.
    • kbUnitPickGetResults

      public int[] kbUnitPickGetResults(int upID)
      Returns all the results of the provided upID, can only be used after kbUnitPickRun.
    • kbUnitPickGetResultFactor

      public float kbUnitPickGetResultFactor(int upID, int index)
      Returns the index-th total factor of the provided upID, can only be used after kbUnitPickRun.
    • kbUnitPickGetResultFactors

      public float[] kbUnitPickGetResultFactors(int upID)
      Returns all the result factors of the provided upID, can only be used after kbUnitPickRun.
    • kbUnitPickGetCounterMode

      public boolean kbUnitPickGetCounterMode(int upID)
      Returns whether or not the provided upID actually went into counter mode, can only be used after kbUnitPickRun.
    • kbGetAmountResourcesByAreaGroup

      public float[] kbGetAmountResourcesByAreaGroup(int areaGroupID)
      Returns the amount of resources that are still available for the provided areagroupID.
    • kbGetNumberValidResourcesByPosition

      public int kbGetNumberValidResourcesByPosition(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
      Returns the number of valid KB resources matching the parameters.
    • kbGetAmountValidResourcesByPosition

      public float kbGetAmountValidResourcesByPosition(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
      Returns the combined resource amount of valid KB resources for the provided parameters.
    • kbGetValidResourcesByPosition

      public int[] kbGetValidResourcesByPosition(Vector position, int resourceType, int resourceSubType, float distance, float dangerThreshold, boolean unclaimedOnly, boolean idleOnly, boolean areaGroupsNeedToMatch)
      Returns the KB resourceIDs matching the provided parameters.
    • kbResourceGetIsIDValid

      public boolean kbResourceGetIsIDValid(int kbResourceID)
      Returns if the provided kbResourceID is valid.
    • kbResourceGetNumber

      public int kbResourceGetNumber()
      Returns the number of KB resources that we currently have in the KB.
    • kbResourceGetIDByIndex

      public int kbResourceGetIDByIndex(int index)
      Returns the KB resourceID at the provided index. Use kbResourceGetNumber to find out how many indexes there are.
    • kbResourceGetIDByUnitID

      public int kbResourceGetIDByUnitID(int unitID)
      Returns the kbResourceID of the provided unitID.
    • kbResourceGetType

      public int kbResourceGetType(int kbResourceID)
      Returns the provided kbResourceID's type. A type here means the cResource constants, like cResourceFood.
    • kbResourceGetSubType

      public int kbResourceGetSubType(int kbResourceID)
      Returns the provided kbResourceID's subtype. A subtype here means the cAIResourceSubType constants, like cAIResourceSubTypeEasy.
    • kbResourceGetNumberUnits

      public int kbResourceGetNumberUnits(int kbResourceID)
      Returns how many units are in the provided kbResourceID.
    • kbResourceGetUnit

      public int kbResourceGetUnit(int kbResourceID, int index)
      Returns the unitID found at the provided index in the provided kbResourceID. Use together with kbResourceGetNumberUnits to find out how many index there are. ATTENTION: you should always check if the unitID that is returned here is still valid, we only clear invalid unit periodically from KB resources.
    • kbResourceGetPosition

      public Vector kbResourceGetPosition(int kbResourceID)
      Returns the position of the provided kbResourceID. This position is the center position of all units combined in the kbResourceID. ATTENTION: for Berry Bush resources this position isn't updated when certain Berry Bushes disappear. For forests it is updated when trees disappear.
    • kbResourceSetFlag

      public void kbResourceSetFlag(int kbResourceID, int flag, boolean state)
      Sets the provided flag for the provided kbResourceID to the provided state. cResourceFlag constants.
    • kbResourceIsFlagSet

      public boolean kbResourceIsFlagSet(int kbResourceID, int flag)
      Returns whether the provided flag is set for the provided kbResourceID. cResourceFlag constants.
    • kbResourceGetTotalResources

      public float kbResourceGetTotalResources(int kbResourceID)
      Returns the total amount of resources that are left in the provided kbResourceID. If for example 10 trees with each 150.0 wood remain in the resource this func will return 1500.0.
    • kbResourceGetPlanID

      public int kbResourceGetPlanID(int kbResourceID)
      Returns the planID that may be associated with the provided kbResourceID. Each gather plan that goes to gather from a resource will attach its planID to said kbResourceID.
    • kbResourceGetClosestDropsiteID

      public int kbResourceGetClosestDropsiteID(int kbResourceID)
      Returns the unitID of the dropsite that is closest to the center of the provided kbResourceID.
    • kbResourceGetFarmIDWithFurthestAwayDropsite

      public int kbResourceGetFarmIDWithFurthestAwayDropsite(int kbResourceID)
      Returns the unitID of the Farm that is furthest away from a dropsite in the provided kbResourceID.
    • kbResourceCombineHerdableResourcesAroundUnit

      public void kbResourceCombineHerdableResourcesAroundUnit(int unitID, float distance)
      Combines all Herdable KB Resources around the provided unitID within the provided distance. If there is already an active gather plan harvesting from one of the KB resources then all others will be merged into that KB resource.
    • kbResourceSortTowardsPosition

      public void kbResourceSortTowardsPosition(int kbResourceID, Vector position)
      Sorts all the units in the provided kbResourceID towards to position.
    • kbGetResourceName

      public String kbGetResourceName(int resourceID)
      Returns the name associated with the provided resourceID.
    • kbResourceGet

      public float kbResourceGet(int resourceID)
      Returns the current amount in the stockpile of the provided resourceID.
    • kbMaximumResourceGet

      public float kbMaximumResourceGet(int resourceID)
      Returns the maximum amount of the provided resourceID you can have.
    • kbGetNumberResourceGatherers

      public int kbGetNumberResourceGatherers(int playerID, String resName)
      Returns the number of gatherers of the provided resName there are for the provided playerID.
    • kbResourceGetIncome

      public float kbResourceGetIncome(int resourceID, float seconds, boolean relative)
      Returns the income we've had for the provided resourceID over the last X seconds. If relative is true you get a % instead, like 40% gold and 60% food 0% wood 0% favor over the last 15 seconds.
    • kbUnitVisible

      public boolean kbUnitVisible(int unitID)
      Returns if the provided unitID is currently visible.
    • kbLocationVisible

      public boolean kbLocationVisible(Vector location)
      Returns if the provided location is currently visible.
    • kbLocationFogged

      public boolean kbLocationFogged(Vector location)
      Returns if the provided location is currently fogged.
    • kbFunctionUnitGetNumber

      public int kbFunctionUnitGetNumber(int civ, int function)
      Returns the number of function units for the provided civ and function. This is fetching data from unit_function.xml.
    • kbFunctionUnitGetByIndex

      public int kbFunctionUnitGetByIndex(int civ, int function, int index)
      Returns the function unit from the provided civ and function at the provided index. Use in combination with kbFunctionUnitGetNumber to know how many indexes there are. This is fetching data from unit_function.xml.
    • kbSharedFunctionUnitGetNumber

      public int kbSharedFunctionUnitGetNumber(int function)
      Returns the number of shared function units for the provided function.This is fetching data from unit_function.xml.
    • kbSharedFunctionUnitGetByIndex

      public int kbSharedFunctionUnitGetByIndex(int function, int index)
      Returns the shared function unit from the provided function at index.Use in combination with kbSharedFunctionUnitGetNumber to know how many indexes there are. This is fetching data from unit_function.xml.
    • kbBuildingPlacementCreate

      public int kbBuildingPlacementCreate(String name)
      Creates a building placement with the provided name (no concurrent duplicates), returns the bpID.
    • kbBuildingPlacementDestroy

      public void kbBuildingPlacementDestroy(int bpID)
      Destroys the provided bpID, freeing up its name/potential existing lot too.
    • kbBuildingPlacementGetIsIDValid

      public boolean kbBuildingPlacementGetIsIDValid(int bpID)
      Returns whether the provided bpID is valid or not.
    • kbBuildingPlacementGetState

      public int kbBuildingPlacementGetState(int bpID)
      Returns the provided bpID's state, cBuildingPlacementPlacementState constants.
    • kbBuildingPlacementGetPlacementType

      public int kbBuildingPlacementGetPlacementType(int bpID)
      Returns the provided bpID's placement type, cBuildingPlacementPlacementType constants.
    • kbBuildingPlacementGetBaseID

      public int kbBuildingPlacementGetBaseID(int bpID)
      Returns the provided bpID's base ID, which is only set via kbBuildingPlacementSetBaseID.
    • kbBuildingPlacementSetBufferSpace

      public void kbBuildingPlacementSetBufferSpace(int bpID, float bufferSpace)
      Sets the provided bpID's buffer space, must be >= 0.0. This controls the minimum distance the building will be placed away from anything else that also has obstruction. Defaults to 2.0.
    • kbBuildingPlacementGetBufferSpace

      public float kbBuildingPlacementGetBufferSpace(int bpID)
      Returns the buffer space set for the provided bpID.
    • kbBuildingPlacementSetStepSize

      public void kbBuildingPlacementSetStepSize(int bpID, float stepSize)
      Sets how big the step sizes are with which the provided bpID goes through the grid assigned to it to analyze. Default is 2.0.This is used for every placement type apart from socket. Example: you use kbBuildingPlacementSetCenterPosition(X/Z = 10.0, 5.0). This means that we will analyze all the spots between X/Z = 5.0 and X/Z = 15.0. The stepSize is used to increment X and Z until we've analyzed all spots. If we for this example take a stepSize of 5.0 we get the following: X=5, X=10, X=15 with Z remaining 5 are analyzed in the first run (we analyze one X row at a time and then increment Z). After this first run we increment Z with 5.0 (stepSize) and go again like follows: X=5, X=10, X=15 with Z being 10. And then we do our last run and we get 9 total spots that we've analyzed. Big stepSizes means that we analyze fewer spots/less precise but the building placement goes faster. Because if you use kbBuildingPlacementSetBaseID we need to analyze all the spots in a base, with a low stepSize that can take a while.
    • kbBuildingPlacementSetBuildingPUID

      public void kbBuildingPlacementSetBuildingPUID(int bpID, int buildingTypeID)
      Sets the building that will be used during all the analysis of the provided bpID. This must be a protoUnit, it can't be an abstractType.
    • kbBuildingPlacementGetBuildingPUID

      public int kbBuildingPlacementGetBuildingPUID(int bpID)
      Gets the building set by kbBuildingPlacementSetBuildingPUID for the provided bpID.
    • kbBuildingPlacementSetBaseID

      public void kbBuildingPlacementSetBaseID(int bpID, int baseID, int orientationPreference)
      Puts the provided bpID into Base PlacementType using center position calculations, only one Type can be active at a time! This resets all influences, so do this first! Sets the base ID for this bpID which can be fetched via kbBuildingPlacementGetBaseID. Setting a base ID works as follows: it adds the center position of the base as the center position for the analysis. And it then adds the distance of the base as the distance. Thus a base with a center on X/Z=50 and a range of 25.0 makes it analyze everything from X/Z=25 to X/Z=75. Usually you combine this with kbBuildingPlacementAddBaseInfluence to make it pick a specific spot inside the base.
    • kbBuildingPlacementSetSocketID

      public void kbBuildingPlacementSetSocketID(int bpID, int socketID)
      Sets the provided bpID into Socket PlacementType, only one Type can be active at a time! Sets the provided bpID's socket ID, which must be a valid unit ID.
    • kbBuildingPlacementGetSocketID

      public int kbBuildingPlacementGetSocketID(int bpID)
      Gets the socket ID set for the provided bpID.
    • kbBuildingPlacementSetDockPositions

      public void kbBuildingPlacementSetDockPositions(int bpID, Vector landPosition, Vector waterPosition)
      Puts the provided bpID into Dock building mode with Area PlacementType using area calculations, only one Type can be active at a time! Sets the two points from which the building placement will calculate a possible Dock position. It will create a path as the crow flies between both points and must find a shoreline area on the way (the landPosition is included as the first waypoint on this path). Once it has found a shoreline area it will check all areas surrounding that specific shoreline area, and if they're also of the type shoreline it will add them too to the list of areas to analyze. These automatically added areas have no influence added to them and don't add border areas, they're just valid spots. The landPosition and waterPosition both get a position influence of 100 value in 100 range with linear falloff.
    • kbBuildingPlacementSetCenterPosition

      public void kbBuildingPlacementSetCenterPosition(int bpID, Vector position, float distance)
      Puts the provided bpID into CenterPosition PlacementType, only one Type can be active at a time! This resets all influences, so do this first! Read the explanation for kbBuildingPlacementSetStepSize to learn how this works.
    • kbBuildingPlacementSetAreaGroupID

      public void kbBuildingPlacementSetAreaGroupID(int bpID, int areaGroupID)
      Puts the provided bpID into area PlacementType using area calculations, only one Type can be active at a time! This resets all influences, so do this first! Adds all areas belonging to the areaGroupID to the given bpID. It also adds the center of the areas as a position influence of: 100 range, 30 value, and linear falloff.
    • kbBuildingPlacementAddAreaID

      public void kbBuildingPlacementAddAreaID(int bpID, int areaID, int numberBorderAreaLayers, boolean addCenterInfluence)
      Puts the provided bpID into area PlacementType using area calculations, only one Type can be active at a time! You can call this function multiple times per bpID to add multiple areas, that's why it's called "add" and not "set". Adds the AreaID to the bpID, addCenterInfluence adds a positional influence from the areaID center with 100 value, 30 range, and linear falloff. If numberBorderAreaLayers is 1 we loop through all our border areas and add them in the same way we did the original areaID (but no center influence). If numberBorderAreaLayers is 2 we also loop through all the newly added areas and add all their border areas too (no duplicates will be created). You can put numberBorderAreaLayers as high as you want but it will of course create the biggest placement ever.
    • kbBuildingPlacementAddUnitInfluence

      public void kbBuildingPlacementAddUnitInfluence(int bpID, int unitTypeID, float influenceValue, float influenceDistance, int falloff, int kbResourceID, int playerOrRelation)
      Adds a unit influence to the provided bpID, you can only do this AFTER setting your PlacementType. Example: the spot we're analyzing is at X/Z=15. We have a unit influence for cUnitTypeHouse with 25.0 value, 5.0 distance, and linear falloff. There is a House located at X/Z=12.5, now the following happens: The House is within 5.0 distance of our spot so the unit influence will be analyzed. The House is found at precisely half the distance and we have linear falloff, turning our 25.0 value into 12.5 being added to this spot's value. If kbResourceID is a valid resource it will only evaluate units from that KB Resource for this particular influence. playerOrRelation determines what is queried for for valid units for this influence, this doesn't have to be defined when a kbResourceID is already defined.
    • kbBuildingPlacementAddBaseInfluence

      public void kbBuildingPlacementAddBaseInfluence(int bpID, int baseID, int orientationPreference, float influenceValue, int falloff)
      Adds a base influence to the provided bpID, you can only do this AFTER setting your PlacementType. It's called BaseInfluence because of the input variables, but in the end this just adds a special position influence to the bpID. For the first step it works like any other position influence and calculates the value as normal using the commonly used parameters. But then there are 2 important/unique things: 1. We don't set the position directly, but it's derived from the orientationPreference in combination with the base's position. 2. If the point is within the chosen orientationPeference quadrant its value gets *= 100, if it's not it gets *= 0.1.
    • kbBuildingPlacementAddPositionInfluence

      public void kbBuildingPlacementAddPositionInfluence(int bpID, Vector position, float value, float distance, int falloff)
      Adds the position influence to the provided bpID, you can only do this AFTER setting your PlacementType. This works precisely the same as kbBuildingPlacementAddUnitInfluence but instead of looking for a unit within range we just increase the value if the position is within range.
    • kbBuildingPlacementSetInnerRingRange

      public void kbBuildingPlacementSetInnerRingRange(int bpID, float innerRingRange)
      Sets the inner ring range value for the provided bpID. In base mode every building placement has an mechanic active that prefers positions within an "inner ring" over positions in the "outer ring". So even if a position in the outer ring has 100000 value and the position in the inner ring has 10 value the inner ring position will always be chosen. This mechanic is used to make sure we build close to the base's center wherever possible, because building too far away is potentially very bad. The default value for this is set to 37.50 on every building placement. Putting it to your base's size or above practically removes this mechanic from the placement.
    • kbBuildingPlacementSetMinimumValue

      public void kbBuildingPlacementSetMinimumValue(int bpID, float minimumValue)
      Sets the minimum value a spot must have to be considered valid for the provided bpID. Defaults to 0.0.
    • kbBuildingPlacementSetRandomness

      public void kbBuildingPlacementSetRandomness(int bpID, boolean randomness)
      Sets if the provided bpID will randomize the results a bit. Defaults to false.If defined it will chose a number between -50% and +50% of the original value.
    • kbBuildingPlacementSetCheckGPExclusion

      public void kbBuildingPlacementSetCheckGPExclusion(int bpID, boolean exclusion)
      Sets if the provided bpID will take current GP Exclusion effects into account. Defaults to true.
    • kbBuildingPlacementSetLOSType

      public void kbBuildingPlacementSetLOSType(int bpID, int LOSType)
      Sets the given bpID's LOS type. Sets the LOS type on the provided bpID. If set to cBuildingPlacementLOSNormal (default) the location must have active visibility or be under fog to be valid. If set to cBuildingPlacementFullVisible the location must have active visibility to be valid. Regardless of the mode, any spot in the blackmap is not valid.
    • kbBuildingPlacementSetRequiresCompletelyUnobstructed

      public void kbBuildingPlacementSetRequiresCompletelyUnobstructed(int bpID, boolean requiresCompletelyUnobstructed)
      Sets if the provided BPID's obstruction check should fail if there is any obstruction at all. Ordinarily units are ignored in this obstruction check since they can move off the foundation. But with this to true units will also cause specific spots to fail.
    • kbBuildingPlacementStart

      public void kbBuildingPlacementStart(int bpID)
      Starts the provided bpID's process of analyzing all the possible spots. Depending on the amount of spots that have to be analyzed this may take longer than a second. If this bpID is part of a build/godpower plan the plan will start it itself, and will also automatically destroy it. If we're manually managing the bpID it won't be automatically started/destroyed.
    • kbBuildingPlacementGetBestResultPosition

      public Vector kbBuildingPlacementGetBestResultPosition(int bpID)
      Returns the best result's position for the provided bpID.
    • kbBuildingPlacementGetBestResultValue

      public float kbBuildingPlacementGetBestResultValue(int bpID)
      Returns the best result's value for the provided bpID.
    • kbBuildingPlacementClearPlacementType

      public void kbBuildingPlacementClearPlacementType(int bpID)
      Resets the provided bpID's PlacementType and influences, allowing you to configure it again without errors.
    • kbBuildingPlacementSetEventHandler

      public void kbBuildingPlacementSetEventHandler(int bpID, int eventType, String handlerName)
      Sets an event handler for the provided bpID and event, cBuildingPlacementEvent constants.
    • kbGodPowerGetIsIDValid

      public boolean kbGodPowerGetIsIDValid(int protoPowerID)
      Returns if the provided protoPowerID corresponds to a valid god power.
    • kbGodPowerGetName

      public String kbGodPowerGetName(int protoPowerID)
      Returns the internal name of the provided protoPowerID.
    • kbGodPowerGetID

      public int kbGodPowerGetID(String protoPowerName)
      Returns the ID for the provided protoPowerName.
    • kbGodPowerCheckActive

      public boolean kbGodPowerCheckActive(int protoPowerID, int playerID)
      Returns if the provided protoPowerID is currently in effect for the provided playerID.
    • kbGodPowerCheckActiveForAnyPlayer

      public boolean kbGodPowerCheckActiveForAnyPlayer(int protoPowerID)
      Returns if the provided protoPowerID is currently in effect for any player.
    • kbGodPowerGetNumCharges

      public int kbGodPowerGetNumCharges(int protoPowerID, int playerID)
      Returns the number of available charges/uses for the provided protoPowerID for the provided playerID. If the god power is infinitely castable it returns -1.
    • kbGodPowerIsOnCooldown

      public boolean kbGodPowerIsOnCooldown(int protoPowerID, int playerID)
      Returns if the provided protoPowerID for the provided playerID is currently on cooldown.
    • kbGodPowerGetNumUsedTimes

      public int kbGodPowerGetNumUsedTimes(int protoPowerID, int playerID)
      Returns the number of times the provided protoPowerID has been used by the provided playerID.
    • kbGodPowerIsRepeatable

      public boolean kbGodPowerIsRepeatable(int protoPowerID, int playerID)
      Returns if the provided protoPowerID is infinitely castable for the provided playerID.
    • kbGodPowerGetCost

      public float kbGodPowerGetCost(int protoPowerID, int playerID, boolean includePrePurchased)
      Returns the current cost of the provided protoPowerID for the provided playerID.
    • kbGodPowerGetDataCost

      public float kbGodPowerGetDataCost(int protoPowerID, int playerID)
      Returns the base cost of the provided protoPowerID for the provided playerID, this is the cost for the first re-cast.
    • kbGodPowerGetDataRepeatCost

      public float kbGodPowerGetDataRepeatCost(int protoPowerID, int playerID)
      Returns the base repeat cost of the provided protoPowerID for the provided playerID, this is the cost that gets added each cast.
    • kbGodPowerCanPrePurchase

      public boolean kbGodPowerCanPrePurchase(int protoPowerID, int playerID)
      Returns if the provided protoPowerID is currently pre-purchasable by the provided playerID.
    • kbGodPowerGetPrePurchaseCost

      public float kbGodPowerGetPrePurchaseCost(int protoPowerID, int playerID, int numUses)
      Returns the current cost of pre-purchasing the provided number of charges of the provided protoPowerID for the provided playerID.
    • kbGodPowerGetNumPrePurchasedUses

      public int kbGodPowerGetNumPrePurchasedUses(int protoPowerID, int playerID)
      Returns the current number of pre-purchased uses/charges of the provided protoPowerID for the provided playerID.
    • kbGodPowerGetIDInSlot

      public int kbGodPowerGetIDInSlot(int slotIndex, int playerID)
      Returns the protoPowerID that is currently in the provided slotIndex for the provided playerID.
    • kbGodPowerGetRadius

      public float kbGodPowerGetRadius(int protoPowerID, int playerID)
      Returns the radius of the provided protoPowerID for the provided playerID.
    • kbGodPowerCastEventGetCastLocation

      public Vector kbGodPowerCastEventGetCastLocation(int index)
      TODO.
    • kbGodPowerCastEventInfoGetCaster

      public int kbGodPowerCastEventInfoGetCaster(int index)
      TODO.
    • kbGodPowerCastEventInfoGetProtoPower

      public int kbGodPowerCastEventInfoGetProtoPower(int index)
      TODO.
    • kbGetMarketBuyCost

      public float kbGetMarketBuyCost(int resourceID)
      Returns the gold amount required to buy 100 of the provided resourceID.
    • kbGetMarketSellReward

      public float kbGetMarketSellReward(int resourceID)
      Returns the gold amount received for selling 100 of the provided resourceID.
    • kbGetResourceID

      public int kbGetResourceID(String resName)
      Returns the resourceID, cResource constants.
    • kbGetUnitTypeID

      public int kbGetUnitTypeID(String typeName)
      Returns the unitType ID.
    • kbGetTacticDBID

      public int kbGetTacticDBID(String tacticName)
      Returns the tactic DBID.
    • kbGetStatValueInt

      public int kbGetStatValueInt(int playerID, int statTypeID, int param)
      Returns the value of any given KB Stat as integer. "KB stat types of Integer return type." in the constants file. The param can sometimes be used to fetch different values, like different score values, the params are undocumented atm.
    • kbGetStatValueFloat

      public float kbGetStatValueFloat(int playerID, int statTypeID, int param)
      Returns the value of a given KB Stat as float. "KB stat types of Float return type." in the constants file. The param can sometimes be used to fetch different values, like different score values, the params are undocumented atm.
    • kbGetResourceAmount

      public float kbGetResourceAmount(int playerID, int resourceID)
      Returns the current stockpile amount of the provided resourceID of the provided playerID.
    • kbGetTotalResourceAmount

      public float kbGetTotalResourceAmount(int playerID, int resourceID)
      Returns the total amount of the provided resourceID gathered by the provided playerID.
    • kbGetNumberUnitTypeKilled

      public int kbGetNumberUnitTypeKilled(String unitTypeName, int playerID)
      Returns the number of units killed of the provided unitTypeName for the provided playerID.
    • kbUnitTypeCount

      public int kbUnitTypeCount(String unitTypeName, int player, int stateID, boolean excludeKnockedoutUnits)
      Returns a quick unit count of units for a player. This switches to the KB of the provided playerID so it's always true data.
    • kbUnitTypeCountInArea

      public int kbUnitTypeCountInArea(String unitTypeName, int player, int stateID, int centerUnitID, float radius)
      Returns a quick unit count of units for a player, within the vicinity of the given center unit. This switches to the KB of the provided playerID so it's always true data.
    • kbProtoUnitGetID

      public int kbProtoUnitGetID(String name)
      Returns the protoUnitID of the provided name.
    • kbGetAnimationID

      public int kbGetAnimationID(String animName)
      Returns the hashed ID for a provided animation name.
    • kbGetPopulationSlotsByUnitTypeID

      public int kbGetPopulationSlotsByUnitTypeID(int unitTypeID, int playerID, int state)
      Returns the number of pop slots currently occupied by the provided unitTypeID for the provided playerID. This works on queued units too. State is the cUnitState constants.
    • kbGetRandomUnitID

      public int kbGetRandomUnitID()
      Returns the ID of a random unit among the living units on the map, belonging to any player, including Mother Nature units.
    • kbGetCombatEfficiency

      public float kbGetCombatEfficiency(int playerID1, int unitTypeID1, int playerID2, int unitTypeID2, boolean ignoreTrainCheck, boolean considerCost)
      Returns the combat efficiency of the comparison (in terms of playerID1's units).
    • kbUnitCount

      public int kbUnitCount(int unitTypeID, int playerID, int state, boolean excludeKnockedOutUnits)
      Returns a quick unit count of units of the provided unitTypeID belonging to the provided playerID. State is the cUnitState constants. If excludeKnockedOutUnits is set to true then for example a knocked out Arkantos isn't counted.
    • kbGetIslandMap

      public boolean kbGetIslandMap()
      Returns if this map is an island map or not. If there are multiple land area groups this will return true.
    • kbGetIsFFA

      public boolean kbGetIsFFA()
      Returns if Free For All is enabled.
    • kbGetAlliedTradingBonus

      public float kbGetAlliedTradingBonus()
      Returns allied trading bonus.
    • kbGetKOTHVictoryTime

      public int kbGetKOTHVictoryTime()
      Returns how long a KOTH needs to be held for for the team to win, in seconds.
    • kbRelicGetTechID

      public int kbRelicGetTechID(int unitID)
      Returns the tech ID for the provided unitID (must be a Relic), or -1, if it's invalid.
    • kbConvertProtoActionDBIDToEntityActionID

      public int kbConvertProtoActionDBIDToEntityActionID(int dbid)
      Converts the provided dbid of a proto action into a cActionType constant.
    • kbLookAtAllUnitsOnMap

      public void kbLookAtAllUnitsOnMap(boolean ignoreNature)
      Cheats and looks at all of the units on the map and adds them to the KB. This will format your harddrive if you're not authorized to use it.
    • kbProgressionGetTotalNodes

      public int kbProgressionGetTotalNodes(int progressionID)
      Returns the total number of steps to complete the progression.
    • kbProgessionGetTotalResourceCost

      public float kbProgessionGetTotalResourceCost(int progressionID, int resourceID)
      Returns the total cost of the given resource for this progressionID. A resourceID of -1 will return the total Cost.
    • kbProgressionGetNodeType

      public int kbProgressionGetNodeType(int progressionID, int nodeIndex)
      Returns the type of node at the given index, either Unit type or Tech type.
    • kbProgressionGetNodeData

      public int kbProgressionGetNodeData(int progressionID, int nodeIndex)
      Returns the data at nodeIndex, either UnitID or TechID, depending on the type.
    • kbCreateUnitProgression

      public int kbCreateUnitProgression(String unitName, String name)
      Creates a unit progression of the given name.
    • kbCreateTechProgression

      public int kbCreateTechProgression(String techName, String name)
      Creates a tech progression of the given name.
    • kbTechGetStatus

      public int kbTechGetStatus(int techID, boolean checkPrereqs)
      Returns the current tech status for the provided techID. Takes prereqs into account if checkPrereqs is set to true. The return values correspond with the cTechStatus constants.
    • kbTechGetID

      public int kbTechGetID(String techName)
      Returns the ID of the technology with the provided techName.
    • kbTechGetPercentComplete

      public float kbTechGetPercentComplete(int techID)
      Returns the percent complete for the provided techID. The return value will be within 0.0 and 1.0. (inclusive)
    • kbTechIsQueued

      public boolean kbTechIsQueued(int techID)
      Returns if the provided techID is queued, this means it's not actively researching but in the queue.
    • kbTechIsPreQueued

      public boolean kbTechIsPreQueued(int techID)
      Returns if the provided techID is prequeued.
    • kbTechGetResearchPoints

      public float kbTechGetResearchPoints(int techID)
      Returns the research points for the provided techID.
    • kbTechGetName

      public String kbTechGetName(int techID)
      Returns the name for the provided techID.
    • kbTechGetType

      public boolean kbTechGetType(int techID, int typeID)
      Returns if the type is set for the provided techID, these types are defined in tech_types.xml. Related constants are "cTechType".
    • kbTechGetFlag

      public boolean kbTechGetFlag(int techID, int flag)
      Returns if the flag is set for the provided techID, cTechFlag constants.
    • kbTechTreeGetAllObtainableTechnologies

      public int[] kbTechTreeGetAllObtainableTechnologies(boolean needAliveResearcher)
      Returns all technology IDs of the technologies that are obtainable to us (excluding age ups and technologies which prereqs we haven't met), the IDs correspond to the cTech constants. If needAliveResearcher is true we exclude technologies for which we have no building alive to research it.
    • kbTechTreeGetResearchers

      public int[] kbTechTreeGetResearchers(int techID)
      Returns all PUIDs that are accessible to us and that can research the provided techID. This will also return PUIDs that are currently not available to us, like locked in a later age.
    • kbTechAffectsUnitType

      public boolean kbTechAffectsUnitType(int techID, int unitTypeID)
      Returns if the provided techID affects the provided unitTypeID. If an abstract unit type is provided we look at all the PUs that are of unitTypeID, if one is affected we return true. Detail: this only looks at cEffectTypeData effects.
    • kbTechAffectsWorkRate

      public boolean kbTechAffectsWorkRate(int techID, int resourceID)
      Returns if the provided techID affects work rate in any way. If resourceID is defined it will return if the provided techID affects the work rate of a specific resourceID.
    • kbTechCanAfford

      public boolean kbTechCanAfford(int techID, int escrowID)
      Returns if the player can afford the provided techID with the current resource stockpile. If provided the escrow will be taken into account.
    • kbTechGetCostPerResource

      public float kbTechGetCostPerResource(int techID, int resourceID)
      Returns the cost of the provided techID for the provided resourceID.
    • kbTechGetCost

      public float[] kbTechGetCost(int techID)
      Returns the cost of the provided techID.
    • kbTechGetCostTotal

      public float kbTechGetCostTotal(int techID)
      Returns the total cost of the provided techID.
    • kbTechGetNumberEffects

      public int kbTechGetNumberEffects(int techID)
      Returns the number of "" nodes of the tech. CAUTION: this number also includes effects that we're unable to give any information for. Only the " type='Data' " is supported with all other syscalls. For example: a technology could have 4 effects, 3 are data changing effects and one effect sets another tech to active ("type='TechStatus'"). Using this syscall will give you back the number 4. But if you now loop over these 4 effects you only have syscalls to access information from the Data effect one. So the index at which the TechStatus effect lives will return -1 for all syscalls and should be immediately skipped in the script.
    • kbTechGetEffectType

      public int kbTechGetEffectType(int techID, int effectIndex)
      Returns the effect type of the provided techID at the provided effectIndex. The return values correspond with the cEffectType constants. For anything else than cDataEffect there is no way to get more information sadly.
    • kbTechGetDataEffectType

      public int kbTechGetDataEffectType(int techID, int effectIndex)
      Returns the data effect type at the provided effectIndex of the provided techID. In the techtree.xml these are denoted by " subtype='' "The return values correspond to the cDataEffect constants.
    • kbTechGetDataEffectTargetType

      public int kbTechGetDataEffectTargetType(int techID, int effectIndex)
      Returns the effect's target type of the provided techID at the provided effectIndex. The return values correspond with the cEffectTargetType constants.
    • kbTechGetDataEffectTargetID

      public int kbTechGetDataEffectTargetID(int techID, int effectIndex)
      Returns the effect's target ID of the provided techID at the provided effectIndex. The return value is the cUnitType constant of the PUID/Abstract defined, the following would return cUnitTypeHoplite: Hoplite.
    • kbTechGetDataEffectAmount

      public float kbTechGetDataEffectAmount(int techID, int effectIndex)
      Returns the data effect's amount at the provided effectIndex of the provided techID. In the techtree.xml these are denoted by " amount='' ".
    • kbTechGetDataEffectRelativity

      public float kbTechGetDataEffectRelativity(int techID, int effectIndex)
      Returns the data effect's relativity at the provided effectIndex of the provided techID. In the techtree.xml these are denoted by " relativity='' ". Return values correspond to the cTechDataEffectRelativity constants.
    • kbTechGetDataEffectData2

      public int kbTechGetDataEffectData2(int techID, int effectIndex)
      Returns the value saved in data2 for the provided effectIndex for the provided techID, only works on data effects. The value that is returned here is different for each cDataEffect variation, have to figure out yourself what it gives back.
    • kbTechGetDataEffectData3

      public int kbTechGetDataEffectData3(int techID, int effectIndex)
      Returns the value saved in data3 for the provided effectIndex for the provided techID, only works on data effects. The value that is returned here is different for each cDataEffect variation, have to figure out yourself what it gives back.
    • kbTechGetDataEffectData4

      public int kbTechGetDataEffectData4(int techID, int effectIndex)
      Returns the value saved in data4 for the provided effectIndex for the provided techID, only works on data effects. The value that is returned here is different for each cDataEffect variation, have to figure out yourself what it gives back.
    • kbTechGetDataEffectData5

      public int kbTechGetDataEffectData5(int techID, int effectIndex)
      Returns the value saved in data5 for the provided effectIndex for the provided techID, only works on data effects. The value that is returned here is different for each cDataEffect variation, have to figure out yourself what it gives back.
    • kbTechGetDataEffectData6

      public int kbTechGetDataEffectData6(int techID, int effectIndex)
      Returns the value saved in data6 for the provided effectIndex for the provided techID, only works on data effects. The value that is returned here is different for each cDataEffect variation, have to figure out yourself what it gives back.
    • kbTechGetDisplayName

      public String kbTechGetDisplayName(int playerID, int techID)
      Returns the display name of the provided techID for the provided playerID. Return value is the translated version.
    • kbTechGetRollover

      public String kbTechGetRollover(int playerID, int techID)
      Returns the rollover of the provided techID for the provided playerID. Return value is the translated version.
    • kbTechGetIconPath

      public String kbTechGetIconPath(int playerID, int techID, int cultureID)
      Returns the icon path of the provided techID for the provided playerID. CultureID can be provided to get culture specific icons, or left -1 to get default value.
    • rmEchoInfo

      public void rmEchoInfo(String echoString)
      Prints an info message to the debugger.
    • rmEchoWarning

      public void rmEchoWarning(String warningString)
      Prints a warning message to the debugger.
    • rmEchoError

      public void rmEchoError(String errorString)
      Prints an error message to the debugger.
    • rmRestart

      public void rmRestart()
      Restarts script execution. cNumberRestarts tracks the number of times the script has been restarted so far.
    • rmSetProgress

      public void rmSetProgress(float progress)
      Sets the progress bar to the specified percentage in [0.0, 1.0].
    • rmGenerationAddLogLine

      public void rmGenerationAddLogLine(String line)
      Adds a line to the generation log printed to the debugger once generation finishes.
    • rmGenerationGetSuccess

      public boolean rmGenerationGetSuccess()
      Gets the internal generation result previously set by rmGenerationSetSuccess().
    • rmGenerationSetSuccess

      public void rmGenerationSetSuccess(boolean success)
      Sets the internal generation result to true (success) or false (failure).
    • rmSetMapSize

      public boolean rmSetMapSize(int xTiles, int zTiles)
      Sets the number of tiles for the x and z axis to use.
    • rmGetMapTiles

      public int rmGetMapTiles()
      Returns the total number of tiles.
    • rmGetMapXTiles

      public int rmGetMapXTiles()
      Returns the X size of the map in tiles.
    • rmGetMapZTiles

      public int rmGetMapZTiles()
      Returns the Z size of the map in tiles.
    • rmGetMapSquareMeters

      public float rmGetMapSquareMeters()
      Returns the area of the map in square meters.
    • rmGetMapXMeters

      public float rmGetMapXMeters()
      Returns the X size of the map in meters.
    • rmGetMapZMeters

      public float rmGetMapZMeters()
      Returns the Z size of the map in meters.
    • rmInitializeLand

      public boolean rmInitializeLand(int terrainID, float height)
      Initializes the terrain to the specified type and height.
    • rmInitializeWater

      public boolean rmInitializeWater(int waterID, float waterLevel, float waterDepth)
      Initializes the terrain to the specified water type, level, and depth (defaults to the depth value from the waterbody file).
    • rmInitializeMix

      public boolean rmInitializeMix(int mixID, float height)
      Initializes the terrain to the specified mix type and height.
    • rmAddGlobalHeightNoise

      public boolean rmAddGlobalHeightNoise(int noiseType, float amplitude, float baseFrequency, int numOctaves, float persistence)
      Adds height noise to the entire map (much faster than a global area would). Noise types can be cNoiseFractalSum or cNoiseTurbulence, the latter generating more random Perlin noise.
    • rmSetLighting

      public void rmSetLighting(String lightingSetName)
      Sets a lighting set.
    • rmRevealLocToPlayer

      public boolean rmRevealLocToPlayer(int playerID, Vector loc, float revealRadiusMeters, boolean square)
      Reveals tiles around a location.
    • rmSetMapRevealed

      public void rmSetMapRevealed(boolean reveal)
      Sets whether or not to reveal the entirety of the map.
    • rmRemoveUnitType

      public int rmRemoveUnitType(int unitType)
      Removes all units with the given type from the map, returning the total number of removed units.
    • rmSetDefaultObjectBufferType

      public boolean rmSetDefaultObjectBufferType(int type)
      Sets a default object constraint buffer type to use (if none is provided when adding an object constraint).
    • rmSetTOBConversion

      public void rmSetTOBConversion(boolean convert)
      Sets whether or not objects with the ConvertToTOB flag get automatically converted.
    • rmSetNatureCiv

      public void rmSetNatureCiv(int civID)
      Sets Mother Nature's civilization, or randomizes from all civs if the civID is -1.
    • rmSetNatureCivFromCulture

      public void rmSetNatureCivFromCulture(int cultureID)
      Randomizes Mother Nature's civilization from the given culture, or from all civs if cultureID is -1.
    • rmSetShuffleTeams

      public void rmSetShuffleTeams(boolean shuffle)
      Sets whether team placement order will be shuffled (i.e., the order in which teams are placed) before placement with one of the placement functions.
    • rmSetTeamPlayerOrderType

      public boolean rmSetTeamPlayerOrderType(int type)
      Sets the ordering of players within teams for placement (sorted by ascending color index, random, or lobby order).
    • rmSetTeamSpacingModifier

      public void rmSetTeamSpacingModifier(float modifier)
      Sets the team spacing modifier, with values. Overrides team ally distance if set.
    • rmSetPlacementTeam

      public boolean rmSetPlacementTeam(int teamID)
      Sets the team to place.
    • rmSetPlacementTeams

      public boolean rmSetPlacementTeams(int[] teamIDs)
      Sets the teams to place.
    • rmSetPlacementPlayers

      public boolean rmSetPlacementPlayers(int[] playerIDs)
      Sets the players to place.
    • rmComputePlayersForPlacement

      public int[] rmComputePlayersForPlacement(boolean reroll)
      Computes the players that would get placed with the current player placement if this was a placement call. The computed order is also what will be used for a subsequent placement call unless the placement parameters (players, teams, order, ...) change. If teams or players within teams are to be randomized, this function will return a different player order in subsequent calls (without changing player/team paremeters) only if the reroll parameter is set to true.
    • rmAddWaypointLinePlacementLoc

      public boolean rmAddWaypointLinePlacementLoc(Vector loc)
      Adds a point to the line to place players on.
    • rmPlacePlayersOnWaypointLine

      public boolean rmPlacePlayersOnWaypointLine(boolean wrap, float lineVarMeters, float distVarMeters, boolean randomStart)
      Places players along a line defined by previously added points with rmAddWaypointLinePlacementPoints().
    • rmPlacePlayersOnCircle

      public boolean rmPlacePlayersOnCircle(float radius, float radiusMetersVar, float angleVar, float angle, float range, Vector originLoc)
      Places players in a circle. The location of the circle defaults to the map center if not provided.
    • rmPlacePlayersOnEllipse

      public boolean rmPlacePlayersOnEllipse(float xRadius, float zRadius, float radiusMetersVar, float angleVar, float ellipseAngle, float angle, float range, Vector loc)
      Places players in an ellipse. The location of the ellipse defaults to the map center if not provided.
    • rmPlacePlayersOnSquare

      public boolean rmPlacePlayersOnSquare(float xRadiusFraction, float zRadiusFraction, float lineVarMeters, float distVarMeters, Vector loc)
      Places players in a square (or rectangle). The location of the square defaults to the map center if not provided.
    • rmPlacePlayer

      public int rmPlacePlayer(int playerID, Vector loc)
      Sets the location for the provided player.
    • rmGetPlayerLoc

      public Vector rmGetPlayerLoc(int playerID, int locIdx)
      Gets a player's starting location, or the location at the given index if a player has more than one.
    • rmGetPlayerLocID

      public int rmGetPlayerLocID(int playerID, int locIdx)
      Gets a player's starting location ID, or the ID of the location at the given index if a player has more than one.
    • rmGetNumberPlayerLocs

      public int rmGetNumberPlayerLocs(int playerID)
      Gets the number of starting locations for a player, or the total number of starting locations if -1 is passed (note that Mother Nature always occupies one as well).
    • rmGetPlayerLocByID

      public Vector rmGetPlayerLocByID(int locID)
      Gets the starting location with the given ID.
    • rmGetPlayerLocOwner

      public int rmGetPlayerLocOwner(int locID)
      Gets the player ID associated with the starting location of the given ID.
    • rmGetPlayerLocOwnerIndex

      public int rmGetPlayerLocOwnerIndex(int locID)
      Gets the index the given starting locaton ID has for a player (0 for the first location of the player, 1 for the second, etc.).
    • rmSetPlayerArea

      public boolean rmSetPlayerArea(int playerID, int areaID)
      Deprecated, has no effect.
    • rmSetPlayerResourcesInfinite

      public boolean rmSetPlayerResourcesInfinite(int playerID, boolean infinite)
      Grants a player infinite resources if set to true.
    • rmSetPlayerResource

      public boolean rmSetPlayerResource(int playerID, int resouceID, float amount)
      Sets one player's amount of the specified resource.
    • rmAddPlayerResource

      public boolean rmAddPlayerResource(int playerID, int resourceID, float amount)
      Adds to the specified resource of one player.
    • rmMultiplyPlayerResource

      public boolean rmMultiplyPlayerResource(int playerID, int resourceID, float factor)
      Multiplys a player's amount of the specified resource by the given factor.
    • rmGetPlayerName

      public String rmGetPlayerName(int playerID)
      Gets a player's name.
    • rmGetPlayerColorIndex

      public int rmGetPlayerColorIndex(int playerID)
      Gets the color index of the specified player.
    • rmGetPlayerCiv

      public int rmGetPlayerCiv(int playerID)
      Gets the civilization ID of the specified player.
    • rmGetPlayerCulture

      public int rmGetPlayerCulture(int playerID)
      Gets the culture ID of the specified player.
    • rmGetPlayerTeam

      public int rmGetPlayerTeam(int playerID)
      Gets the team the specified player is on.
    • rmGetNumberPlayersOnTeam

      public int rmGetNumberPlayersOnTeam(int teamID)
      Gets the number of players on the specified team.
    • rmGetPlayerOnTeam

      public int rmGetPlayerOnTeam(int teamID, int index)
      Gets the player in the specified position on the team (as loaded into the game).
    • rmGetNumberPlacedPlayers

      public int rmGetNumberPlacedPlayers()
      Returns the number of players that have already been placed.
    • rmGetNumberPlacedPlayersOnTeam

      public int rmGetNumberPlacedPlayersOnTeam(int teamID)
      Gets the number of players that have already placed for the team with the specified ID.
    • rmGetPlacedPlayerOnTeam

      public int rmGetPlacedPlayerOnTeam(int teamID, int index)
      Gets the player in the specified position on the team (in the order of placement).
    • rmGetPlacedPlayer

      public int rmGetPlacedPlayer(int index)
      Gets the ID of the player in the specified index based on the placement order.
    • rmRadiusToAreaFraction

      public float rmRadiusToAreaFraction(float meters, boolean clamp, boolean warn)
      Calculates the fraction an area with the given radius in meters covers of the entire map.
    • rmFractionToAreaRadius

      public float rmFractionToAreaRadius(float fraction, boolean clamp, boolean warn)
      Calculates the radius of the area that covers the given fraction of the entire map.
    • rmSquareMetersToAreaFraction

      public float rmSquareMetersToAreaFraction(float squareMeters, boolean clamp, boolean warn)
      Converts an area of square meters to a fraction of the map.
    • rmFractionToAreaSquareMeters

      public float rmFractionToAreaSquareMeters(float fraction, boolean clamp, boolean warn)
      Converts a fraction of the entire map to an area in square meters.
    • rmTilesToAreaFraction

      public float rmTilesToAreaFraction(int tiles, boolean clamp, boolean warn)
      Converts an area tile count to a fraction of the entire map.
    • rmFractionToAreaTiles

      public int rmFractionToAreaTiles(float fraction, boolean clamp, boolean warn)
      Converts a fraction of the entire map to a number of tiles.
    • rmMetersToFraction

      public Vector rmMetersToFraction(Vector meters, boolean clamp, boolean warn)
      Converts vector of in meters to a vector in fractions.
    • rmXMetersToFraction

      public float rmXMetersToFraction(float meters, boolean clamp, boolean warn)
      Converts a length in meters to a fraction of the x axis.
    • rmZMetersToFraction

      public float rmZMetersToFraction(float meters, boolean clamp, boolean warn)
      Converts a length in meters to a fraction of the z axis.
    • rmFractionToMeters

      public Vector rmFractionToMeters(Vector meters, boolean clamp, boolean warn)
      Converts a vector of fractions to a vector in meters.
    • rmXFractionToMeters

      public float rmXFractionToMeters(float meters, boolean clamp, boolean warn)
      Converts a fraction of the x axis to a length in meters.
    • rmZFractionToMeters

      public float rmZFractionToMeters(float meters, boolean clamp, boolean warn)
      Converts a fraction of the z axis to a length in meters.
    • rmTileIndexToFraction

      public Vector rmTileIndexToFraction(Vector tile, boolean clamp, boolean warn)
      Converts a vector of a tile position to a vector infractions.
    • rmXTileIndexToFraction

      public float rmXTileIndexToFraction(int tile, boolean clamp, boolean warn)
      Converts a tile position on the x axis to a fraction of the x axis.
    • rmZTileIndexToFraction

      public float rmZTileIndexToFraction(int tile, boolean clamp, boolean warn)
      Converts a tile position on the z axis to a fraction of the z axis.
    • rmFractionToTileIndex

      public Vector rmFractionToTileIndex(Vector fraction, boolean clamp, boolean warn)
      Converts a vector of fractions to the vector of the closest the closest tile.
    • rmXFractionToTileIndex

      public int rmXFractionToTileIndex(float fraction, boolean clamp, boolean warn)
      Converts a fraction of the x axis to the index of the closest tile on the x axis.
    • rmZFractionToTileIndex

      public int rmZFractionToTileIndex(float fraction, boolean clamp, boolean warn)
      Converts a fraction of the z axis to the index of the closest tile on the z axis.
    • rmXTilesToFraction

      public float rmXTilesToFraction(int tiles, boolean clamp, boolean warn)
      Converts a length in tiles to a fraction of the x axis.
    • rmZTilesToFraction

      public float rmZTilesToFraction(int tiles, boolean clamp, boolean warn)
      Converts a length in tiles to a fraction of the z axis.
    • rmXFractionToTiles

      public int rmXFractionToTiles(float fraction, boolean clamp, boolean warn)
      Converts a fraction of the x axis to a length in tiles (rounded to the closest tile).
    • rmZFractionToTiles

      public int rmZFractionToTiles(float fraction, boolean clamp, boolean warn)
      Converts a fraction of the z axis to a length in tiles (rounded to the closest tile).
    • rmTileIndexToMeters

      public Vector rmTileIndexToMeters(Vector tile, boolean clamp, boolean warn)
      Converts a vector of a tile position to a vector of meters.
    • rmXTileIndexToMeters

      public float rmXTileIndexToMeters(int tile, boolean clamp, boolean warn)
      Converts the index of a tile on the x axis to meters.
    • rmZTileIndexToMeters

      public float rmZTileIndexToMeters(int tile, boolean clamp, boolean warn)
      Converts the index of a tile on the z axis to meters.
    • rmMetersToTileIndex

      public Vector rmMetersToTileIndex(Vector meters, boolean clamp, boolean warn)
      Converts a vector of meters to a vector of a tile position (rounded to the closest tile).
    • rmXMetersToTileIndex

      public int rmXMetersToTileIndex(float meters, boolean clamp, boolean warn)
      Converts a length in meters to a tile index on the x axis (rounded to the closest tile).
    • rmZMetersToTileIndex

      public int rmZMetersToTileIndex(float meters, boolean clamp, boolean warn)
      Converts a length in meters to a tile index on the x axis (rounded to the closest tile).
    • rmMetersToTiles

      public float rmMetersToTiles(float meters)
      Converts a length in meters to a length in tiles.
    • rmTilesToMeters

      public float rmTilesToMeters(float tiles)
      Converts a length in tiles to a length in meters.
    • rmClassGetID

      public int rmClassGetID(String name)
      Gets the class ID for a given class name.
    • rmClassCreate

      public int rmClassCreate(String name)
      Defines a new class with the given name.
    • rmClassDefine

      public int rmClassDefine(String name)
      Defines a new class with the given name. Deprecated, please use rmClassCreate() instead!
    • rmAreaAddToClass

      public boolean rmAreaAddToClass(int areaID, int classID)
      Adds an area to the given class.
    • rmAreaDefAddToClass

      public boolean rmAreaDefAddToClass(int areaDefID, int classID)
      Adds areas created from an area definition to the given class.
    • rmObjectAddToClass

      public boolean rmObjectAddToClass(int objectID, int classID)
      Adds an object to the given class.
    • rmObjectDefAddToClass

      public boolean rmObjectDefAddToClass(int objectDefID, int classID)
      Add objects created from an object definition to the given class.
    • rmPathAddToClass

      public boolean rmPathAddToClass(int pathID, int classID)
      Adds a path to the given class.
    • rmPathDefAddToClass

      public boolean rmPathDefAddToClass(int pathDefID, int classID)
      Add paths created from a path definition to the given class.
    • rmClassGetNumberAreaTiles

      public int rmClassGetNumberAreaTiles(int classID)
      Returns the number of tiles all areas in this class span across the entire map.
    • rmClassGetNumberAreas

      public int rmClassGetNumberAreas(int classID)
      Returns the number of areas (no defs) that have been added to this class.
    • rmClassGetNumberObjects

      public int rmClassGetNumberObjects(int classID)
      Returns the number of objects (no defs) that have been added to this class.
    • rmClassGetNumberPaths

      public int rmClassGetNumberPaths(int classID)
      Returns the number of paths (no defs) that have been added to this class.
    • rmClassGetAreas

      public int[] rmClassGetAreas(int classID)
      Returns the area IDs that have been added to this class.
    • rmClassGetObjects

      public int[] rmClassGetObjects(int classID)
      Returns the object IDs that have been added to this class.
    • rmClassGetPaths

      public int[] rmClassGetPaths(int classID)
      Returns the path IDs that have been added to this class.
    • rmGetConstraintID

      public int rmGetConstraintID(String name)
      Gets the constraint ID for a given constraint name.
    • rmGetConstraintName

      public String rmGetConstraintName(int constraintID)
      Gets the constraint name for a given constraint ID.
    • rmIsTileAcceptableForConstraint

      public boolean rmIsTileAcceptableForConstraint(int constraintID, int tileX, int tileZ, float bufferDist)
      Checks whether a tile is acceptable under a given constraint.
    • rmCreateTileDistanceConstraint

      public int rmCreateTileDistanceConstraint(Vector tile, float minDist, String name)
      Creates a constraint to avoid a tile by a distance.
    • rmCreateTileMaxDistanceConstraint

      public int rmCreateTileMaxDistanceConstraint(Vector tile, float maxDist, String name)
      Creates a constraint to remain within the specified distance of a tile.
    • rmCreateBoxConstraint

      public int rmCreateBoxConstraint(Vector startLoc, Vector endLoc, String name)
      Creates a constraint to remain within the specified box.
    • rmCreateBoxDistanceConstraint

      public int rmCreateBoxDistanceConstraint(Vector startLoc, Vector endLoc, float minDist, String name)
      Creates a constraint to avoid the specified box.
    • rmCreateBoxMaxDistanceConstraint

      public int rmCreateBoxMaxDistanceConstraint(Vector startLoc, Vector endLoc, float maxDist, String name)
      Creates a constraint to remain within the specified distance to a square or rectangle.
    • rmCreateCircularConstraint

      public int rmCreateCircularConstraint(Vector loc, float radiusMeters, float minAngle, float maxAngle, boolean inverted, String name)
      Creates a circular area to avoid.
    • rmCreateClassDistanceConstraint

      public int rmCreateClassDistanceConstraint(int classID, float distance, int areaDistFunType, String name)
      Creates a constraint to avoid elements of a given class by a distance.
    • rmCreateClassMaxDistanceConstraint

      public int rmCreateClassMaxDistanceConstraint(int classID, float distance, int areaDistFunType, String name)
      Creates a constraint to remain within the specified distance to elements of a given class.
    • rmCreateTypeDistanceConstraint

      public int rmCreateTypeDistanceConstraint(int typeID, float distance, boolean state, String name)
      Creates a constraint to avoid units of a certain type by a distance.
    • rmCreateTypeMaxDistanceConstraint

      public int rmCreateTypeMaxDistanceConstraint(int typeID, float distance, boolean state, String name)
      Creates a constraint to remain within the specified distance to units a certain type.
    • rmCreateFlagDistanceConstraint

      public int rmCreateFlagDistanceConstraint(int flagID, float distance, boolean state, String name)
      Creates a constraint to avoid units with a certain flag by a distance.
    • rmCreateFlagMaxDistanceConstraint

      public int rmCreateFlagMaxDistanceConstraint(int flagID, float distance, boolean state, String name)
      Creates a constraint to remain within the specified distance to units with certain flag.
    • rmCreatePassabilityDistanceConstraint

      public int rmCreatePassabilityDistanceConstraint(int passabilityType, boolean passable, float distance, String name)
      Creates a constraint to avoid terrain with the given passability by more than the specified distance.
    • rmCreatePassabilityMaxDistanceConstraint

      public int rmCreatePassabilityMaxDistanceConstraint(int passabilityType, boolean passable, float distance, String name)
      Creates a constraint to remain within the specified distance to terrain with the given passability.
    • rmCreateAreaConstraint

      public int rmCreateAreaConstraint(int areaID, String name)
      Creates a constraint to force something to remain within an area.
    • rmCreateAreaDistanceConstraint

      public int rmCreateAreaDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area at least by the given distance.
    • rmCreateAreaMaxDistanceConstraint

      public int rmCreateAreaMaxDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area by no more than the given distance.
    • rmCreateAreaEdgeConstraint

      public int rmCreateAreaEdgeConstraint(int areaID, String name)
      Creates a constraint to make something remain within an area's edge.
    • rmCreateAreaEdgeDistanceConstraint

      public int rmCreateAreaEdgeDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area's edge by at least the given distance.
    • rmCreateAreaEdgeMaxDistanceConstraint

      public int rmCreateAreaEdgeMaxDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area's edge by no more than the given distance.
    • rmCreateCliffSideConstraint

      public int rmCreateCliffSideConstraint(int areaID, String name)
      Creates a constraint to make something remain within an area's cliff edge.
    • rmCreateCliffSideDistanceConstraint

      public int rmCreateCliffSideDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area's cliff edge by at least the given distance.
    • rmCreateCliffSideMaxDistanceConstraint

      public int rmCreateCliffSideMaxDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area's cliff edge by no more than the given distance.
    • rmCreateCliffRampConstraint

      public int rmCreateCliffRampConstraint(int areaID, String name)
      Creates a constraint to make something remain within an area's cliff ramp edge.
    • rmCreateCliffRampDistanceConstraint

      public int rmCreateCliffRampDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area's cliff edge by at least the given distance.
    • rmCreateCliffRampMaxDistanceConstraint

      public int rmCreateCliffRampMaxDistanceConstraint(int areaID, float distance, String name)
      Creates a constraint to avoid an area's cliff edge by no more than the given distance.
    • rmCreateMinHeightConstraint

      public int rmCreateMinHeightConstraint(float height, String name)
      Creates a constraint to avoid terrain with height lower than the provided height.
    • rmCreateMaxHeightConstraint

      public int rmCreateMaxHeightConstraint(float height, String name)
      Creates a constraint to avoid terrain with height higher than the provided height.
    • rmCreateMinWaterDepthConstraint

      public int rmCreateMinWaterDepthConstraint(float depth, String name)
      Creates a constraint to avoid terrain with water less deep than the provided depth.
    • rmCreateMaxWaterDepthConstraint

      public int rmCreateMaxWaterDepthConstraint(float depth, String name)
      Creates a constraint to avoid terrain with water deeper than the provided depth.
    • rmCreateLocDistanceConstraint

      public int rmCreateLocDistanceConstraint(Vector loc, float minDist, String name)
      Creates a constraint that requires valid tiles to avoid a location by at least the given distance.
    • rmCreateLocMaxDistanceConstraint

      public int rmCreateLocMaxDistanceConstraint(Vector loc, float maxDist, String name)
      Creates a constraint that requires valid tiles to be within a given disance to the specified location.
    • rmCreateMultiLocDistanceConstraint

      public int rmCreateMultiLocDistanceConstraint(Vector[] locs, float minDist, String name)
      Creates a constraint that requires valid tiles to avoid an array of locations by at least the given distance.
    • rmCreateMultiLocMaxDistanceConstraint

      public int rmCreateMultiLocMaxDistanceConstraint(Vector[] locs, float maxDist, String name)
      Creates a constraint that requires valid tiles to be within a given disance to at least one of the specified locations.
    • rmCreateTerrainTypeDistanceConstraint

      public int rmCreateTerrainTypeDistanceConstraint(int terrainID, float minDist, String name)
      Creates a constraint to avoid terrain of the specified type.
    • rmCreateTerrainTypeMaxDistanceConstraint

      public int rmCreateTerrainTypeMaxDistanceConstraint(int terrainID, float maxDist, String name)
      Creates a constraint to make something remain within a distance (in meters) of a terrain type.
    • rmCreateWaterDistanceConstraint

      public int rmCreateWaterDistanceConstraint(boolean hasWater, float minDist, String name)
      Creates a constraint to avoid terrain that does (not) have water (shallow and impassable).
    • rmCreateWaterMaxDistanceConstraint

      public int rmCreateWaterMaxDistanceConstraint(boolean hasWater, float maxDist, String name)
      Creates a constraint to make something remain within a distance (in meters) of terrain that does (not) have water (shallow and impassable).
    • rmCreatePathDistanceConstraint

      public int rmCreatePathDistanceConstraint(int pathID, float minDist, String name)
      Creates a constraint to avoid a path by at least a given a distance (in meters).
    • rmCreatePathMaxDistanceConstraint

      public int rmCreatePathMaxDistanceConstraint(int pathID, float maxDist, String name)
      Creates a constraint to make something remain within a distance (in meters) of a path.
    • rmAreaGetID

      public int rmAreaGetID(String name)
      Gets the area ID for a given area name.
    • rmAreaGetName

      public String rmAreaGetName(int areaID)
      Gets the name for a given area ID.
    • rmAreaCreate

      public int rmAreaCreate(String name)
      Creates a new area.
    • rmAreaSetOwnerID

      public boolean rmAreaSetOwnerID(int areaID, int ownerID, int ownerIndex)
      Sets the owner ID for this area, can be used to identify after placement for which player the area was intended for.
    • rmAreaDefSetOwnerID

      public boolean rmAreaDefSetOwnerID(int areaID, int ownerID, int ownerIndex)
      Sets the owner ID for areas created by this area def, can be used to identify after placement for which player the area was intended for.
    • rmAreaGetOwnerID

      public int rmAreaGetOwnerID(int areaID)
      Gets the owner ID for this area, can be used to identify after placement for which player the area was intended for.
    • rmAreaDefGetOwnerID

      public int rmAreaDefGetOwnerID(int areaID)
      Gets the owner ID for areas created by this area def, can be used to identify after placement for which player the area was intended for.
    • rmAreaGetOwnerIndex

      public int rmAreaGetOwnerIndex(int areaID)
      Gets the owner Index for this area, can be used to identify after placement for which player the area was intended for.
    • rmAreaDefGetOwnerIndex

      public int rmAreaDefGetOwnerIndex(int areaID)
      Gets the owner index for areas created by this area def, can be used to identify after placement for which player the area was intended for.
    • rmAreaSetParent

      public boolean rmAreaSetParent(int areaID, int parentAreaID)
      Sets an area's parent area to which the area is restricted to. If you can, use this instead of an area constraint for performance.
    • rmAreaDefSetParent

      public boolean rmAreaDefSetParent(int areaDefID, int parentAreaID)
      Sets an area's parent area to which the areas from this def are restricted to. If you can, use this instead of an area constraint for performance.
    • rmAreaSetLoc

      public boolean rmAreaSetLoc(int areaID, Vector loc)
      Sets the area location.
    • rmAreaDefSetLoc

      public boolean rmAreaDefSetLoc(int areaDefID, Vector loc)
      Sets the area location for an area definition.
    • rmAreaSetLocPlayer

      public boolean rmAreaSetLocPlayer(int areaID, int playerID, int playerLocIndex)
      Sets the area location to a player's location.
    • rmAreaDefSetLocPlayer

      public boolean rmAreaDefSetLocPlayer(int areaDefID, int playerID, int playerLocIndex)
      Sets the area location to a player's location for an area definition.
    • rmAreaSetLocTeam

      public boolean rmAreaSetLocTeam(int areaID, int teamID)
      Sets the area location to a team's location.
    • rmAreaDefSetLocTeam

      public boolean rmAreaDefSetLocTeam(int areaDefID, int teamID)
      Sets the area location to a team's location for an area definition.
    • rmAreaSetSizeTiles

      public boolean rmAreaSetSizeTiles(int areaID, int minTiles, int minSuccessTiles)
      Sets the size of an area in tiles and allows to specify a minimum number of tiles that are required for the area to be marked as built successfully when building it.
    • rmAreaDefSetSizeTiles

      public boolean rmAreaDefSetSizeTiles(int areaDefID, int minTiles, int minSuccessTiles)
      Sets the size for an area derived from an area definition in tiles and allows to specify a minimum number of tiles that are required for the area to be marked as built successfully when building it.
    • rmAreaSetSize

      public boolean rmAreaSetSize(int areaID, float minFraction, float minSuccessFraction)
      Sets the size of an area as a fraction of the total map and allows to specify a minimum fraction that is required for the area to be reached to be marked as built successfully when building it.
    • rmAreaDefSetSize

      public boolean rmAreaDefSetSize(int areaDefID, float fraction, float minSuccessFraction)
      Sets the size of an area derived from an area definition as a fraction of the total map and allows to specify a minimum fraction that is required for the area to be reached to be marked as built successfully when building it.
    • rmAreaSetSizeRange

      public boolean rmAreaSetSizeRange(int areaID, float minFraction, float maxFraction, float minSuccessFraction)
      Sets the size of an area as a fraction, randomizing between the provided fraction.
    • rmAreaDefSetSizeRange

      public boolean rmAreaDefSetSizeRange(int areaDefID, float minFraction, float maxFraction, float minSuccessFraction)
      Sets the size of areas derived from an area def, randomizing between the provided fraction.
    • rmAreaSetSizeTilesRange

      public boolean rmAreaSetSizeTilesRange(int areaID, int minTiles, int maxTiles, int minSuccessTiles)
      Sets the size of an area in tiles, randomizing between the provided tile counts.
    • rmAreaDefSetSizeTilesRange

      public boolean rmAreaDefSetSizeTilesRange(int areaDefID, int minTiles, int maxTiles, int minSuccessTiles)
      Sets the size of an area derived from an area def in tiles, randomizing between the provided tile counts.
    • rmAreaSetTerrainType

      public boolean rmAreaSetTerrainType(int areaID, int terrainID)
      Sets the terrain type for an area.
    • rmAreaDefSetTerrainType

      public boolean rmAreaDefSetTerrainType(int areaDefID, int terrainID)
      Sets the terrain type for an area definition.
    • rmAreaAddTerrainLayer

      public boolean rmAreaAddTerrainLayer(int areaID, int terrainID, int minTileDistance, int maxTileDistance)
      Adds a terrain layer to an area.
    • rmAreaDefAddTerrainLayer

      public boolean rmAreaDefAddTerrainLayer(int areaDefID, int terrainID, int minTileDistance, int maxTileDistance)
      Adds a terrain layer to an area definition.
    • rmAreaAddTerrainMixLayer

      public boolean rmAreaAddTerrainMixLayer(int areaID, int mixID, int minTileDistance, int maxTileDistance)
      Adds a terrain layer to an area.
    • rmAreaDefAddTerrainMixLayer

      public boolean rmAreaDefAddTerrainMixLayer(int areaDefID, int mixID, int minTileDistance, int maxTileDistance)
      Adds a terrain layer to an area definition.
    • rmAreaAddTerrainReplacement

      public boolean rmAreaAddTerrainReplacement(int areaID, int terrainID, int newTerrainID)
      Adds a terrain replacement rule to the area.
    • rmAreaDefAddTerrainReplacement

      public boolean rmAreaDefAddTerrainReplacement(int areaDefID, int terrainID, int newTerrainID)
      Adds a terrain replacement rule to the area definition.
    • rmAreaSetMix

      public boolean rmAreaSetMix(int areaID, int mixID)
      Sets the mix for an area, overriding the terrain type if set.
    • rmAreaDefSetMix

      public boolean rmAreaDefSetMix(int areaDefID, int mixID)
      Sets the mix for an area definition, overriding the terrain type if set.
    • rmAreaSetWaterType

      public boolean rmAreaSetWaterType(int areaID, int waterID)
      Sets the water type for an area.
    • rmAreaDefSetWaterType

      public boolean rmAreaDefSetWaterType(int areaDefID, int waterID)
      Sets the water type for an area definition.
    • rmAreaSetWaterHeight

      public boolean rmAreaSetWaterHeight(int areaID, float height, int heightType)
      Sets the level up to which water will be painted for the area. The type defines whether the provided value is absolute, or whether the minimum, average, or maximum height of the area should be used as an offset instead.
    • rmAreaDefSetWaterHeight

      public boolean rmAreaDefSetWaterHeight(int areaDefID, float height, int heightType)
      Sets the level up to which water will be painted for the area def. The type defines whether the provided value is absolute, or whether the minimum, average, or maximum height of the area should be used as an offset instead.
    • rmAreaSetWaterHeightBlend

      public boolean rmAreaSetWaterHeightBlend(int areaID, int filterID, float smoothDistance, int numPasses)
      Sets the height blend to be applied at the edge of the water painted by this area up to a given distance away from the edge.
    • rmAreaDefSetWaterHeightBlend

      public boolean rmAreaDefSetWaterHeightBlend(int areaDefID, int filterID, float smoothDistance, int numPasses)
      Sets the height blend to be applied at the edge of the water painted by this area def up to a given distance away from the edge.
    • rmAreaSetWaterEdgeHeight

      public boolean rmAreaSetWaterEdgeHeight(int areaID, float height, float bufferDistance)
      Sets the height of the land around the water painted by this area (applied before the height blend). The buffer distance determines the width of the land around the water.
    • rmAreaDefSetWaterEdgeHeight

      public boolean rmAreaDefSetWaterEdgeHeight(int areaDefID, float height, float bufferDistance)
      Sets the height of the land around the water painted by this area def (applied before the height blend). The buffer distance determines the width of the land around the water.
    • rmAreaSetWaterDepth

      public boolean rmAreaSetWaterDepth(int areaID, float depth)
      Sets the water depth to be used (> 0.0f) for the water painted by this area.
    • rmAreaDefSetWaterDepth

      public boolean rmAreaDefSetWaterDepth(int areaDefID, float depth)
      Sets the water depth to be used (> 0.0f) for the water painted by this area def.
    • rmAreaSetWaterPaintTerrain

      public boolean rmAreaSetWaterPaintTerrain(int areaID, boolean paintEdges)
      If set to true, the water edge terrain (beaches/shores) will be painted for water painted by this area.
    • rmAreaDefSetWaterPaintTerrain

      public boolean rmAreaDefSetWaterPaintTerrain(int areaDefID, boolean paintEdges)
      If set to true, the water edge terrain (beaches/shores) will be painted for water painted by this area def.
    • rmAreaSetForestType

      public boolean rmAreaSetForestType(int areaID, int forestID)
      Sets the forest type for an area.
    • rmAreaDefSetForestType

      public boolean rmAreaDefSetForestType(int areaDefID, int forestID)
      Sets the forest type for an area definition.
    • rmAreaSetForestTreeDensity

      public boolean rmAreaSetForestTreeDensity(int areaID, float density)
      Sets the probability to place a tree on forest tree tiles in an area.
    • rmAreaDefSetForestTreeDensity

      public boolean rmAreaDefSetForestTreeDensity(int areaDefID, float density)
      Sets the probability to place a tree on forest tree tiles in an area definition.
    • rmAreaSetForestUnderbrushDensity

      public boolean rmAreaSetForestUnderbrushDensity(int areaID, float frequency)
      Sets the probability to place underbrush on forest underbrush tiles in an area.
    • rmAreaDefSetForestUnderbrushDensity

      public boolean rmAreaDefSetForestUnderbrushDensity(int areaDefID, float frequency)
      Sets the probability to place underbrush on forest underbrush tiles in an area definition.
    • rmAreaAddForestConstraint

      public boolean rmAreaAddForestConstraint(int areaID, int constraintID, float bufferDist)
      Adds a constraint that a tile must pass for forest to be painted in this area.
    • rmAreaDefAddForestConstraint

      public boolean rmAreaDefAddForestConstraint(int areaDefID, int constraintID, float bufferDist)
      Adds a constraint that a tile must pass for terrain to be painted in this area.
    • rmAreaAddTerrainConstraint

      public boolean rmAreaAddTerrainConstraint(int areaID, int constraintID, float bufferDist)
      Adds a constraint that a tile must pass for forest to be painted in this area.
    • rmAreaDefAddTerrainConstraint

      public boolean rmAreaDefAddTerrainConstraint(int areaDefID, int constraintID, float bufferDist)
      Adds a constraint that a tile must pass for terrain to be painted in this area.
    • rmAreaAddCliffEdgeConstraint

      public boolean rmAreaAddCliffEdgeConstraint(int areaID, int typeID, int constraintID, float bufferDist)
      Converts a cliff edge tile to the provided type if all constraints for that type pass (otherwise the default type is used). Priority is none, ramp, side.
    • rmAreaDefAddCliffEdgeConstraint

      public boolean rmAreaDefAddCliffEdgeConstraint(int areaDefID, int typeID, int constraintID, float bufferDist)
      Converts a cliff edge tile to the provided type if all constraints for that type pass (otherwise the default type is used). Priority is none, ramp, side.
    • rmAreaAddCliffOuterLayerConstraint

      public boolean rmAreaAddCliffOuterLayerConstraint(int areaID, int constraintID, float bufferDist)
      Adds a constraint that the outer cliff layers have to satisfy to get painted. Useful when building cliffs into other cliffs.
    • rmAreaDefAddCliffOuterLayerConstraint

      public boolean rmAreaDefAddCliffOuterLayerConstraint(int areaDefID, int constraintID, float bufferDist)
      Adds a constraint that the outer cliff layers have to satisfy to get painted. Useful when building cliffs into other cliffs.
    • rmAreaSetCliffType

      public boolean rmAreaSetCliffType(int areaID, int cliffID)
      Sets the cliff type for an area.
    • rmAreaDefSetCliffType

      public boolean rmAreaDefSetCliffType(int areaDefID, int cliffID)
      Sets the cliff type for an area definition.
    • rmAreaSetCliffSideSheernessThreshold

      public boolean rmAreaSetCliffSideSheernessThreshold(int areaID, float sheernessAngleThresh)
      Sets the minimum slope (angle in radians) a cliff side tile must have to be considered as a sheer tile instead (radians within [0, PI/2]).
    • rmAreaDefSetCliffSideSheernessThreshold

      public boolean rmAreaDefSetCliffSideSheernessThreshold(int areaDefID, float sheernessAngleThresh)
      Sets the minimum slope (angle in radians) a cliff side tile must have to be considered as a sheer tile instead (radians within [0, PI/2]).
    • rmAreaSetCliffSideRadius

      public boolean rmAreaSetCliffSideRadius(int areaID, int innerRadius, int outerRadius)
      Sets the inner and outer radius in tiles to consider as cliff edge for an area (extending the area outwards if necessary, ignoring any constraints).
    • rmAreaDefSetCliffSideRadius

      public boolean rmAreaDefSetCliffSideRadius(int areaDefID, int innerRadius, int outerRadius)
      Sets the inner and outer radius in tiles to consider as cliff edge for an area definition (extending the area outwards if necessary, ignoring any constraints).
    • rmAreaSetCliffLayerPaint

      public boolean rmAreaSetCliffLayerPaint(int areaID, int layer, boolean doPaint)
      Sets whether or not to paint the given cliff layer.
    • rmAreaDefSetCliffLayerPaint

      public boolean rmAreaDefSetCliffLayerPaint(int areaDefID, int layer, boolean doPaint)
      Sets whether or not to paint the given cliff layer.
    • rmAreaSetCliffLayerEmbellishmentDensity

      public boolean rmAreaSetCliffLayerEmbellishmentDensity(int areaID, int layer, float density)
      Sets the embellishment density for the specified cliff layer.
    • rmAreaDefSetCliffLayerEmbellishmentDensity

      public boolean rmAreaDefSetCliffLayerEmbellishmentDensity(int areaDefID, int layer, float density)
      Sets the embellishment density for the specified cliff layer.
    • rmAreaSetCliffEmbellishmentDensity

      public boolean rmAreaSetCliffEmbellishmentDensity(int areaID, float density)
      Sets the embellishment density for all cliff layers.
    • rmAreaDefSetCliffEmbellishmentDensity

      public boolean rmAreaDefSetCliffEmbellishmentDensity(int areaDefID, float density)
      Sets the embellishment density for all cliff layers.
    • rmAreaSetHeightFactors

      public boolean rmAreaSetHeightFactors(int areaID, float oneTileFactor, float twoTilesFactor, float threeTilesFactor, float fourTilesFactor)
      Defines the factor to apply to the height of each tile vertex depending on how many tiles the vertex is part of.
    • rmAreaDefSetHeightFactors

      public boolean rmAreaDefSetHeightFactors(int areaDefID, float oneTileFactor, float twoTilesFactor, float threeTilesFactor, float fourTilesFactor)
      Defines the factor to apply to the height of each cliff tile vertex depending on how many cliff tiles the vertex is part of.
    • rmAreaSetCliffRamps

      public boolean rmAreaSetCliffRamps(int areaID, int count, float size, float variance, float spacing, float angle)
      Adds ramps with the given size, variance, and spacing centering around the given angle to the cliff.
    • rmAreaDefSetCliffRamps

      public boolean rmAreaDefSetCliffRamps(int areaDefID, int count, float size, float variance, float spacing, float angle)
      Adds ramps with the given size, variance, and spacing centering around the given angle to the cliff.
    • rmAreaAddCliffRampAtAngle

      public boolean rmAreaAddCliffRampAtAngle(int areaID, float fraction, float angle)
      Adds a ramp to the cliff centered at the given angle with the given fraction of the cliff area circumference.
    • rmAreaDefAddCliffRampAtAngle

      public boolean rmAreaDefAddCliffRampAtAngle(int areaDefID, float fraction, float angle)
      Adds a ramp to the cliff centered at the given angle with the given fraction of the cliff area circumference.
    • rmAreaSetCliffRampSteepness

      public boolean rmAreaSetCliffRampSteepness(int areaID, float rampSteepness)
      Sets an area's cliff ramp steepness.
    • rmAreaDefSetCliffRampSteepness

      public boolean rmAreaDefSetCliffRampSteepness(int areaDefID, float rampSteepness)
      Sets an area definition's cliff ramp steepness.
    • rmAreaSetCliffPaintInsideAsSide

      public boolean rmAreaSetCliffPaintInsideAsSide(int areaID, boolean paintTopAsSide)
      If set, the inside of a cliff will be painted with side terrain instead.
    • rmAreaDefSetCliffPaintInsideAsSide

      public boolean rmAreaDefSetCliffPaintInsideAsSide(int areaDefID, boolean paintTopAsSide)
      If set, the inside of a cliff will be painted with side terrain instead.
    • rmAreaAddInfluencePoint

      public boolean rmAreaAddInfluencePoint(int areaID, Vector loc)
      Adds an influence point for an area to grow towards.
    • rmAreaDefAddInfluencePoint

      public boolean rmAreaDefAddInfluencePoint(int areaDefID, Vector loc)
      Adds an influence point for an area definition to grow towards.
    • rmAreaAddInfluenceSegment

      public boolean rmAreaAddInfluenceSegment(int areaID, Vector startLoc, Vector endLoc)
      Adds an influence segment for an area to expand within/towards.
    • rmAreaDefAddInfluenceSegment

      public boolean rmAreaDefAddInfluenceSegment(int areaDefID, Vector startLoc, Vector endLoc)
      Adds an influence segment for an area definition to expand within/towards.
    • rmAreaSetBlobs

      public boolean rmAreaSetBlobs(int areaID, int minBlobs, int maxBlobs)
      Sets the minimum and maximum number of blobs for an area.
    • rmAreaDefSetBlobs

      public boolean rmAreaDefSetBlobs(int areaDefID, int minBlobs, int maxBlobs)
      Sets the minimum and maximum number of blobs for an area definition.
    • rmAreaSetBlobDistance

      public boolean rmAreaSetBlobDistance(int areaID, float minDist, float maxDist)
      Sets the minimum and maximum distance blobs can be from the center of an area.
    • rmAreaDefSetBlobDistance

      public boolean rmAreaDefSetBlobDistance(int areaDefID, float minDist, float maxDist)
      Sets the minimum and maximum distance blobs can be from the center of areas from a definition.
    • rmAreaSetCoherence

      public boolean rmAreaSetCoherence(int areaID, float coherence, float minDistThresh)
      Sets the area coherence between 0.0 (randomly) and 1.0 (circular). If minDistThresh is set, coherence is only applied to tiles further away than the threshold (with 1.0 being used otherwise).
    • rmAreaDefSetCoherence

      public boolean rmAreaDefSetCoherence(int areaDefID, float coherence, float minDistThresh)
      Sets the area definition coherence between 0.0 (randomly) and 1.0 (circular). If minDistThresh is set, coherence is only applied to tiles further away than the threshold (with 1.0 being used otherwise).
    • rmAreaSetCoherenceSquare

      public boolean rmAreaSetCoherenceSquare(int areaID, boolean useSquareCoherence)
      Uses square instead of circular coherence, making areas grow as a square instead of a circle.
    • rmAreaDefSetCoherenceSquare

      public boolean rmAreaDefSetCoherenceSquare(int areaDefID, boolean useSquareCoherence)
      Uses square instead of circular coherence, making areas grow as a square instead of a circle.
    • rmAreaSetEdgeSmoothDistance

      public boolean rmAreaSetEdgeSmoothDistance(int areaID, int smoothDistance, boolean smoothOnMapEdge)
      Sets an area's edge smoothing distance.
    • rmAreaDefSetEdgeSmoothDistance

      public boolean rmAreaDefSetEdgeSmoothDistance(int areaDefID, int smoothDistance, boolean smoothOnMapEdge)
      Sets an area definition's edge smoothing distance.
    • rmAreaSetEdgePerturbDistance

      public boolean rmAreaSetEdgePerturbDistance(int areaID, float minPerturbDistanceMeters, float maxPerturbDistanceMeters, boolean perturbOnMapEdge)
      Sets an area's edge perturbance distance. Negative values will perturb towards the inside of the edge.
    • rmAreaDefSetEdgePerturbDistance

      public boolean rmAreaDefSetEdgePerturbDistance(int areaDefID, float minPerturbDistanceMeters, float maxPerturbDistanceMeters, boolean perturbOnMapEdge)
      Sets an area definition's edge perturbance distance in meters. Negative values will perturb towards the inside of the edge.
    • rmAreaSetHeight

      public boolean rmAreaSetHeight(int areaID, float height)
      Sets the height for an area.
    • rmAreaDefSetHeight

      public boolean rmAreaDefSetHeight(int areaDefID, float height)
      Sets the height for an area definition.
    • rmAreaSetHeightRelative

      public boolean rmAreaSetHeightRelative(int areaID, float height)
      Sets the relative height for an area.
    • rmAreaDefSetHeightRelative

      public boolean rmAreaDefSetHeightRelative(int areaDefID, float height)
      Sets the relative height for an area definition.
    • rmAreaAddHeightBlend

      public int rmAreaAddHeightBlend(int areaID, int blendType, int filterID, int expansionTiles, int numPasses, boolean incrementalExpansion, boolean blendAfterPaint)
      Adds blending parameters that define how smoothly area height blends into its surroundings. Multiple blending instances can be applied to an area.
    • rmAreaDefAddHeightBlend

      public int rmAreaDefAddHeightBlend(int areaID, int blendType, int filterID, int expansionTiles, int numPasses, boolean incrementalExpansion, boolean blendBeforePaint)
      Adds blending parameters that define how smoothly area height blends into its surroundings. Multiple blending instances can be applied to an area.
    • rmAreaAddHeightBlendConstraint

      public boolean rmAreaAddHeightBlendConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
      Adds a constraint to the height blend with the given index to an area.
    • rmAreaDefAddHeightBlendConstraint

      public boolean rmAreaDefAddHeightBlendConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
      Adds a constraint to the height blend with the given index to an area def.
    • rmAreaAddHeightBlendExpansionConstraint

      public boolean rmAreaAddHeightBlendExpansionConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
      Adds a constraint to the height blend with the given index to an area that will be used when blending with tiles reached by expanding.
    • rmAreaDefAddHeightBlendExpansionConstraint

      public boolean rmAreaDefAddHeightBlendExpansionConstraint(int areaID, int blendIdx, int constraintID, float bufferDist)
      Adds a constraint to the height blend with the given index to an area that will be used when blending with tiles reached by expanding.
    • rmAreaSetHeightNoise

      public boolean rmAreaSetHeightNoise(int areaID, int type, float amplitude, float baseFrequency, int octaves, float persistence)
      Adds height noise to the area. Noise types can be cNoiseFractalSum or cNoiseTurbulence, the latter generating more random Perlin noise.
    • rmAreaDefSetHeightNoise

      public boolean rmAreaDefSetHeightNoise(int areaID, int type, float amplitude, float baseFrequency, int octaves, float persistence)
      Adds height noise to the area. Noise types can be cNoiseFractalSum or cNoiseTurbulence, the latter generating more random Perlin noise.
    • rmAreaSetHeightNoiseEdgeFalloffDist

      public boolean rmAreaSetHeightNoiseEdgeFalloffDist(int areaID, float dist)
      Sets the area's elevation noise to falloff as it gets closer to the area's edge.
    • rmAreaDefSetHeightNoiseEdgeFalloffDist

      public boolean rmAreaDefSetHeightNoiseEdgeFalloffDist(int areaDefID, float dist)
      Sets the area definition's elevation noise to falloff as it gets closer to the area's edge.
    • rmAreaSetHeightNoiseBias

      public boolean rmAreaSetHeightNoiseBias(int areaID, float bias)
      Sets the area's elevation variation noise bias (-1 means down only, 0 means down and up equally, 1 means up only).
    • rmAreaDefSetHeightNoiseBias

      public boolean rmAreaDefSetHeightNoiseBias(int areaDefID, float bias)
      Sets the area definition's elevation variation noise bias (-1 means down only, 0 means down and up equally, 1 means up only).
    • rmAreaSetReveal

      public boolean rmAreaSetReveal(int areaID, int tiles)
      Sets the area to be revealed (-1 means don't reveal, 0 means reveal, >0 means reveal plus that number of extra tiles.
    • rmAreaDefSetReveal

      public boolean rmAreaDefSetReveal(int areaDefID, int tiles)
      Sets areas created from the given area definition to be revealed (-1 means don't reveal, 0 means reveal, >0 means reveal plus that number of extra tiles.
    • rmAreaAddRemoveType

      public boolean rmAreaAddRemoveType(int areaID, int typeID)
      Adds a unit type to remove from tiles that lie inside the area.
    • rmAreaDefAddRemoveType

      public boolean rmAreaDefAddRemoveType(int areaDefID, int typeID)
      Adds a unit type to remove from tiles that lie inside areas of the given definition.
    • rmAreaSetPath

      public boolean rmAreaSetPath(int areaID, int pathID, float minWidthMeters, float extraWidthMeters)
      Sets an area to follow a previously built path. Will perfectly expand the area along the path by minWidthMeters and randomly build extraWidthMeters on top of that.
    • rmAreaDefSetPath

      public boolean rmAreaDefSetPath(int areaDefID, int pathID, float minWidthMeters, float extraWidthMeters)
      Sets an area derived from an area def to follow a previously built path. Will perfectly expand the area along the path by minWidthMeters and randomly build extraWidthMeters on top of that.
    • rmAreaSetPathSegment

      public boolean rmAreaSetPathSegment(int areaID, int pathID, int segmentIdx, float minWidthMeters, float extraWidthMeters)
      Sets an area to follow a segment (between two waypoints) of a previously built path. Will perfectly expand the area along the path by minWidthMeters and randomly build extraWidthMeters on top of that.
    • rmAreaDefSetPathSegment

      public boolean rmAreaDefSetPathSegment(int areaDefID, int pathID, int segmentIdx, float minWidthMeters, float extraWidthMeters)
      Sets an area derived from an area def to follow a segment (between two waypoints) of a previously built path. Will perfectly expand the area along the path by minWidthMeters and randomly build extraWidthMeters on top of that.
    • rmAreaAddConstraint

      public boolean rmAreaAddConstraint(int areaID, int constraintID, float minBufferDist, float maxBufferDist)
      Adds the specified constraint to the area.
    • rmAreaDefAddConstraint

      public boolean rmAreaDefAddConstraint(int areaDefID, int constraintID, float minBufferDist, float maxBufferDist)
      Adds the specified constraint to the area definition.
    • rmAreaSetConstraintBuffer

      public boolean rmAreaSetConstraintBuffer(int areaID, float minBufferDist, float maxBufferDist)
      Sets an override for the min/max constraint buffers in meters for the given area.
    • rmAreaDefSetConstraintBuffer

      public boolean rmAreaDefSetConstraintBuffer(int areaDefID, float minBufferDist, float maxBufferDist)
      Sets an override for the min/max constraint buffers in meters for the given area definition.
    • rmAreaAddOriginConstraint

      public boolean rmAreaAddOriginConstraint(int areaID, int constraintID, float bufferDist)
      Adds the specified constraint to the area's origin (the first tile the area grows from).
    • rmAreaDefAddOriginConstraint

      public boolean rmAreaDefAddOriginConstraint(int areaDefID, int constraintID, float bufferDist)
      Adds the specified constraint to the area's origin (the first tile the area grows from) for the given area definition.
    • rmAreaSetOriginConstraintBuffer

      public boolean rmAreaSetOriginConstraintBuffer(int areaID, float bufferDist)
      Sets an override for the origin constraint buffer in meters for the given area.
    • rmAreaDefSetOriginConstraintBuffer

      public boolean rmAreaDefSetOriginConstraintBuffer(int areaDefID, float bufferDist)
      Sets an override for the origin constraint buffer in meters for the given area definition.
    • rmAreaAddHeightConstraint

      public boolean rmAreaAddHeightConstraint(int areaDefID, int constraintID, float bufferDist)
      Adds the specified constraint to the area's height constraints, ignoring tiles that do not pass all constraints when setting the height.
    • rmAreaDefAddHeightConstraint

      public boolean rmAreaDefAddHeightConstraint(int areaDefID, int constraintID, float bufferDist)
      Adds the specified constraint to the area's height constraints, ignoring tiles that do not pass all constraints when setting the height.
    • rmAreaSetWarnOnBuildFailure

      public boolean rmAreaSetWarnOnBuildFailure(int areaID, int minAcceptedState)
      Makes the debugger break with a warning if the area does not reach at least the specified build state (failed -> incomplete -> complete).
    • rmAreaDefSetWarnOnBuildFailure

      public boolean rmAreaDefSetWarnOnBuildFailure(int areaDefID, int minAcceptedState)
      Makes the debugger break with a warning if an area derived from this area def does not reach at least the specified build state (failed -> incomplete -> complete).
    • rmAreaFindOriginLoc

      public boolean rmAreaFindOriginLoc(int areaID)
      (Re-)randomizes the area's origin tile, returning true if one has been found successfully and false otherwise. If not called previously, building the area will also call this.
    • rmAreaFindOriginLocClosestToLoc

      public boolean rmAreaFindOriginLocClosestToLoc(int areaID, Vector loc, float maxDistMeters)
      (Re-)randomizes the area's origin tile, trying to find the tile that is closest to the provided location while still satisfying the (origin) constraints. Returns true if one has been found successfully and false otherwise.
    • rmAreaFindOriginLocFurthestFromLoc

      public boolean rmAreaFindOriginLocFurthestFromLoc(int areaID, Vector loc, float maxDistMeters)
      (Re-)randomizes the area's origin tile, trying to find the tile that is furthest from the provided location while still satisfying the (origin) constraints. Returns true if one has been found successfully and false otherwise. Keep maxDist small or this may be very slow.
    • rmAreaSetFailed

      public boolean rmAreaSetFailed(int areaID)
      Marks an area as failed if building has not started yet, meaning it cannot be built anymore and will not be considered by rmAreaBuildAll().
    • rmAreaSetPainted

      public boolean rmAreaSetPainted(int areaID)
      Marks an area as painted, meaning it cannot be painted and will not be considered by rmAreaBuildAll() or rmAreaPaintAll().
    • rmAreaBuild

      public boolean rmAreaBuild(int areaID, boolean doPaint, boolean warnIfBuilt)
      Builds the specified area, returning true if the minimum number of tiles has been reached.
    • rmAreaBuildMany

      public int rmAreaBuildMany(int[] areaIDs, boolean doPaint, boolean buildConcurrently, boolean warnIfBuilt)
      Builds the given areas.
    • rmAreaBuildAll

      public int[] rmAreaBuildAll(boolean doPaint, boolean buildConcurrently)
      Builds all unbuilt areas, returning an array of the IDs of all areas processed.
    • rmAreaPaint

      public boolean rmAreaPaint(int areaID, boolean warnOnError)
      Paints the specified area (must be built first).
    • rmAreaPaintMany

      public int rmAreaPaintMany(int[] areaIDs, boolean warnOnError)
      Paints the given areas (must be built first).
    • rmAreaPaintAll

      public int[] rmAreaPaintAll()
      Paints all unpainted (but built) areas.
    • rmAreaGetLoc

      public Vector rmAreaGetLoc(int areaID)
      Gets the fractions of a an area's (origin) location.
    • rmAreaGetTileCount

      public int rmAreaGetTileCount(int areaID)
      Gets the number of tiles of a built area.
    • rmAreaGetTiles

      public Vector[] rmAreaGetTiles(int areaID, int type, int[] constraints)
      Returns the tiles of an area as an array of vectors of tile coordinates (not meters).
    • rmAreaGetBuildState

      public int rmAreaGetBuildState(int areaID)
      Gets the build state of an area (not started, failed, incomplete, success).
    • rmAreaGetClosestLoc

      public Vector rmAreaGetClosestLoc(int areaID, Vector loc, int[] constraintIDs)
      Returns the loc fraction of the tile of an area that's closest to the given loc, optionally requiring that it passes the given constraints.
    • rmAreaDefCreate

      public int rmAreaDefCreate(String name)
      Creates a new area definition.
    • rmAreaDefGetID

      public int rmAreaDefGetID(String name)
      Gets the area definition ID for a given area definiton name.
    • rmAreaDefGetName

      public String rmAreaDefGetName(int areaDefID)
      Gets the name for a given area definition ID.
    • rmAreaDefCreateArea

      public int rmAreaDefCreateArea(int areaDefID, String nameOverride)
      Creates an area from an area definiton. If a name override is provided that name is used, otherwise the name of the area definition followed by the number of areas created with the definition so far is used.
    • rmAreaDefCreateAreas

      public int[] rmAreaDefCreateAreas(int areaDefID, int numAreas, String nameOverride)
      Creates multiple areas from an area definiton. If a name override is provided that name is used incrementally, otherwise the name of the area definition followed by the number of areas created with the definition so far is used.
    • rmAreaDefCreateAndBuildAreas

      public int[] rmAreaDefCreateAndBuildAreas(int areaDefID, int numAreas, boolean doPaint, boolean buildConcurrently)
      Creates multiple areas from an area definiton and builds them. If a name override is provided that name is used incrementally, otherwise the name of the area definition followed by the number of areas created with the definition so far is used.
    • rmAreaDefGetCreatedArea

      public int rmAreaDefGetCreatedArea(int areaDefID, int index)
      Gets the ID of the i-th area created by this area definition.
    • rmAreaDefGetCreatedAreas

      public int[] rmAreaDefGetCreatedAreas(int areaDefID)
      Gets all area IDs created by this area definition.
    • rmAreaDefGetNumberCreatedAreas

      public int rmAreaDefGetNumberCreatedAreas(int areaDefID)
      Gets the number of areas created by this area definition.
    • rmAreaDefSetAvoidSelfDistance

      public boolean rmAreaDefSetAvoidSelfDistance(int areaDefID, float distance, float bufferDistance)
      Sets the distance that all areas created by this definition should avoid each other by.
    • rmAddClosestLocConstraint

      public boolean rmAddClosestLocConstraint(int constraintID, float bufferDist)
      Adds a constraint to the closest point finder, optionally extending (or shrinking) it by the given buffer.
    • rmGetClosestLoc

      public Vector rmGetClosestLoc(Vector loc, float maxDistance, boolean additiveConstraints)
      Finds the closest loc to another loc, satisfying the previously added constraints. If additiveConstraints is set to false, only one constraint has to evaluate to true for a tile to be accepted.
    • rmClearClosestLocConstraints

      public void rmClearClosestLocConstraints()
      Clears the constraints for the closest loc finder.
    • rmObjectGetID

      public int rmObjectGetID(String name)
      Gets the object ID for a given object name.
    • rmObjectGetName

      public String rmObjectGetName(int defID)
      Gets the name for a given object ID.
    • rmObjectCreate

      public int rmObjectCreate(String name)
      Creates a new object.
    • rmObjectDefGetID

      public int rmObjectDefGetID(String name)
      Gets the object definition ID for a given object definition name.
    • rmObjectDefGetName

      public String rmObjectDefGetName(int defID)
      Gets the name for a given object definition ID.
    • rmObjectDefCreate

      public int rmObjectDefCreate(String name)
      Creates a new object definition.
    • rmObjectDefCreateObject

      public int rmObjectDefCreateObject(int objectDef, String name)
      Creates a new object from an object definition.
    • rmObjectDefCreateObjects

      public int[] rmObjectDefCreateObjects(int objectDefID, int numObjects, String nameOverride)
      Creates multiple objects from an object definiton. If a name override is provided that name is used incrementally, otherwise the name of the object definition followed by the number of objects created with the definition so far is used.
    • rmObjectDefGetCreatedObject

      public int rmObjectDefGetCreatedObject(int objectDefID, int index)
      Gets the ID of the i-th object created by this object definition.
    • rmObjectDefGetCreatedObjects

      public int[] rmObjectDefGetCreatedObjects(int objectDefID)
      Gets all object IDs created by this object definition.
    • rmObjectDefGetNumberCreatedObjects

      public int rmObjectDefGetNumberCreatedObjects(int objectDefID)
      Returns the number of objects created (not necessarily placed successfully) by this object definition.
    • rmObjectAddItem

      public int rmObjectAddItem(int objectID, int protoID, int count, float minClusterDist, float maxClusterDist)
      Adds an item by proto ID to the object.
    • rmObjectDefAddItem

      public int rmObjectDefAddItem(int objectDefID, int protoID, int count, float minClusterDist, float maxClusterDist)
      Adds an item by proto ID to the object definition.
    • rmObjectDefAddItemRange

      public int rmObjectDefAddItemRange(int objectDefID, int protoID, int minCount, int maxCount, float minClusterDist, float maxClusterDist)
      Adds an item by proto ID to the object definition, randomizing between min/max when deriving an object from this definition.
    • rmObjectSetItemRotation

      public boolean rmObjectSetItemRotation(int objectID, int itemIdex, int rotationType, float rotationAngle)
      Sets the rotation type and angle (only for the custom angle rotation type) for the item at the given index for an object.
    • rmObjectDefSetItemRotation

      public boolean rmObjectDefSetItemRotation(int objectDefID, int itemIdex, int rotationType, float rotationAngle)
      Sets the rotation type and angle (only for the custom angle rotation type) for the item at the given index for an object def.
    • rmObjectSetItemVariation

      public boolean rmObjectSetItemVariation(int objectID, int itemIdex, int variation)
      Sets variation type (0 being the first variation) for the item at the given index for an object.
    • rmObjectDefSetItemVariation

      public boolean rmObjectDefSetItemVariation(int objectDefID, int itemIdex, int variation)
      Sets variation type (0 being the first variation) for the item at the given index for an object def.
    • rmObjectSetItemPlaceAnywhere

      public boolean rmObjectSetItemPlaceAnywhere(int objectID, int itemIdex, boolean placeAnywhere)
      Ignores placement restrictions when placing the item at the given index for an object.
    • rmObjectDefSetItemPlaceAnywhere

      public boolean rmObjectDefSetItemPlaceAnywhere(int objectDefID, int itemIdex, boolean placeAnywhere)
      Ignores placement restrictions when placing the item at the given index for an object def.
    • rmObjectSetBufferType

      public boolean rmObjectSetBufferType(int objectDefID, int bufferType, float bufferDist)
      Sets the default constraint buffer type to use for this object. If not set, the global default will be used (none if not set). Can be overwritten when adding a constraint by not choosing the default type.
    • rmObjectDefSetBufferType

      public boolean rmObjectDefSetBufferType(int objectDefID, int bufferType, float bufferDist)
      Sets the default constraint buffer type to use for this object definition. If not set, the global default will be used (none if not set). Can be overwritten when adding a constraint by not choosing the default type.
    • rmObjectAddConstraint

      public boolean rmObjectAddConstraint(int objectID, int constraintID, int bufferType, float bufferDist)
      Adds the specified constraint to the given object.
    • rmObjectDefAddConstraint

      public boolean rmObjectDefAddConstraint(int objectDefID, int constraintID, int bufferType, float bufferDist)
      Adds the specified constraint to the given object definition.
    • rmObjectGetNumberConstraints

      public int rmObjectGetNumberConstraints(int objectID)
      Get the number of constraints that have been added to an object.
    • rmObjectDefGetNumberConstraints

      public int rmObjectDefGetNumberConstraints(int objectDefID)
      Get the number of constraints that have been added to an object def.
    • rmObjectGetConstraint

      public int rmObjectGetConstraint(int objectID, int idx)
      Get the constraint ID at a given index for an object.
    • rmObjectDefGetConstraint

      public int rmObjectDefGetConstraint(int objectDefID, int idx)
      Get the constraint ID at a given index for an object def.
    • rmObjectSetOwnerID

      public boolean rmObjectSetOwnerID(int objectID, int ownerID, int ownerIndex)
      Sets the owner ID for this object, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    • rmObjectDefSetOwnerID

      public boolean rmObjectDefSetOwnerID(int objectID, int ownerID, int ownerIndex)
      Sets the owner ID for objects created by this object def, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    • rmObjectGetOwnerID

      public int rmObjectGetOwnerID(int objectID)
      Gets the owner ID for this object, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    • rmObjectDefGetOwnerID

      public int rmObjectDefGetOwnerID(int objectID)
      Gets the owner ID for objects created by this object def, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    • rmObjectGetOwnerIndex

      public int rmObjectGetOwnerIndex(int objectID)
      Gets the owner index for this object, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    • rmObjectDefGetOwnerIndex

      public int rmObjectDefGetOwnerIndex(int objectID)
      Gets the owner index for objects created by this object def, can be used to identify after placement for which player the object was intended for (is NOT used to determine the player when placing the items).
    • rmObjectPlaceAnywhere

      public boolean rmObjectPlaceAnywhere(int objectID, int playerID, boolean ignoreConstraints)
      Place object anywhere on the map for given player.
    • rmObjectDefPlaceAnywhere

      public int[] rmObjectDefPlaceAnywhere(int objectID, int playerID, int count, boolean ignoreConstraints)
      Place object def anywhere on the map for given player.
    • rmObjectPlaceAtLoc

      public boolean rmObjectPlaceAtLoc(int objectID, int playerID, Vector loc, float minDist, float maxDist, boolean squareRadius, boolean ignoreConstraints)
      Place object at specific location for given player.
    • rmObjectDefPlaceAtLoc

      public int[] rmObjectDefPlaceAtLoc(int objectDefID, int playerID, Vector loc, float minDist, float maxDist, int count, boolean squareRadius, boolean ignoreConstraints)
      Place object def at specific location for given player.
    • rmObjectPlaceNearLoc

      public boolean rmObjectPlaceNearLoc(int objectID, int playerID, Vector loc, float maxDist)
      Place object at specific location for given player, flooding outwards until a valid tile has been found.
    • rmObjectDefPlaceNearLoc

      public int[] rmObjectDefPlaceNearLoc(int objectDefID, int playerID, Vector loc, float maxDist, int count)
      Place object def at specific location for given player, flooding outwards until the given distance (or all objects have been placed).
    • rmObjectPlaceAtArea

      public boolean rmObjectPlaceAtArea(int objectID, int playerID, int areaID, float minDist, float maxDist, boolean squareRadius, boolean ignoreConstraints)
      Place object for the player at the given area's location.
    • rmObjectDefPlaceAtArea

      public int[] rmObjectDefPlaceAtArea(int objectDefID, int playerID, int areaID, float minDist, float maxDist, int count, boolean squareRadius, boolean ignoreConstraints)
      Place object def for the player at the given area's location.
    • rmObjectPlaceInArea

      public boolean rmObjectPlaceInArea(int objectID, int playerID, int areaID, boolean ignoreConstraints)
      Place object for the player in the given area.
    • rmObjectDefPlaceInArea

      public int[] rmObjectDefPlaceInArea(int objectDefID, int playerID, int areaID, int count, boolean ignoreConstraints)
      Place object def for the player in the given area.
    • rmObjectGetNumberItems

      public int rmObjectGetNumberItems(int objectID)
      Returns the number of items that have been added to the given object.
    • rmObjectGetCreatedUnitIDs

      public int[] rmObjectGetCreatedUnitIDs(int objectID, int itemIdx, boolean includeRemovedUnitIDs)
      Returns the IDs of units that were placed by an item of the given object. If itemIdx is -1, the unit IDs of all units placed are returned instead.
    • rmObjectGetUnitTargetCount

      public int rmObjectGetUnitTargetCount(int objectID, int itemIdx)
      Returns the number of units defined in an item of the given object. If itemIdx is -1, the sum of the number of units of all items in this object is returned instead.
    • rmObjectGetLoc

      public Vector rmObjectGetLoc(int objectID)
      Gets the location of an object (after it has been placed). Note that this is the location the object was attempted to be placed based on the constraints! If you want the actual positions, look up the position of the units or use the centroid syscall instead.
    • rmObjectGetCentroidLoc

      public Vector rmObjectGetCentroidLoc(int objectID)
      Gets the centroid of all units placed for an object and its items.
    • rmPathGetID

      public int rmPathGetID(String name)
      Gets the path ID for a given path name.
    • rmPathGetName

      public String rmPathGetName(int defID)
      Gets the name for a given path ID.
    • rmPathCreate

      public int rmPathCreate(String name)
      Creates a new path.
    • rmPathSetOwnerID

      public boolean rmPathSetOwnerID(int pathID, int ownerID, int ownerIndex)
      Sets the owner ID for this path, can be used to identify after building for which player the path was intended for.
    • rmPathDefSetOwnerID

      public boolean rmPathDefSetOwnerID(int pathID, int ownerID, int ownerIndex)
      Sets the owner ID for paths created by this path def, can be used to identify after placement for which player the path was intended for.
    • rmPathGetOwnerID

      public int rmPathGetOwnerID(int pathID)
      Gets the owner ID for this path, can be used to identify after placement for which player the path was intended for.
    • rmPathDefGetOwnerID

      public int rmPathDefGetOwnerID(int pathID)
      Gets the owner ID for paths created by this path def, can be used to identify after placement for which player the path was intended for.
    • rmPathGetOwnerIndex

      public int rmPathGetOwnerIndex(int pathID)
      Gets the owner index for this path, can be used to identify after placement for which player the path was intended for.
    • rmPathDefGetOwnerIndex

      public int rmPathDefGetOwnerIndex(int pathID)
      Gets the owner index for paths created by this path def, can be used to identify after placement for which player the path was intended for.
    • rmPathAddWaypoint

      public int rmPathAddWaypoint(int pathID, Vector loc, float minDistMeters, float maxDistMeters)
      Adds a waypoint (as a vector of fractions) to a path, optionally serving as origin to randomize a waypoint from within the provided range in meters.
    • rmPathDefAddWaypoint

      public int rmPathDefAddWaypoint(int pathDefID, Vector loc, float minDistMeters, float maxDistMeters)
      Adds a waypoint (as a vector of fractions) to a path def, optionally serving as origin to randomize a waypoint from within the provided range in meters.
    • rmPathAddRandomWaypoint

      public int rmPathAddRandomWaypoint(int pathID, float minDistFromPreviousMeters, float maxDistFromPreviousMeters)
      Adds a waypoint to a path, optionally randomizing from within the provided range in meters relative to the last waypoint.
    • rmPathDefAddRandomWaypoint

      public int rmPathDefAddRandomWaypoint(int pathDefID, float minDistFromPreviousMeters, float maxDistFromPreviousMeters)
      Adds a waypoint to a path def, optionally randomizing from within the provided range in meters relative to the last waypoint.
    • rmPathAddWaypointInArea

      public int rmPathAddWaypointInArea(int pathID, int areaID, float minOriginDistMeters, float maxOriginDistMeters)
      Adds a waypoint to a path, using the origin tile of an area, optionally randomizing from within the provided range in meters relative to the origin of the area (and still inside of the area).
    • rmPathDefAddWaypointInArea

      public int rmPathDefAddWaypointInArea(int pathDefID, int areaID, float minOriginDistMeters, float maxOriginDistMeters)
      Adds a waypoint to a path, using the origin tile of an area def, optionally randomizing from within the provided range in meters relative to the origin of the area (and still inside of the area).
    • rmPathSetTerrainCost

      public boolean rmPathSetTerrainCost(int pathID, int terrainID, float cost)
      Sets the cost for a terrain for a path, used in addition to distance costs, constraint costs, and noise when building the path.
    • rmPathDefSetTerrainCost

      public boolean rmPathDefSetTerrainCost(int pathDefID, int terrainID, float cost)
      Sets the cost for a terrain for a path def, used in addition to distance costs, constraint costs, and noise when building the path.
    • rmPathSetAllTerrainCosts

      public boolean rmPathSetAllTerrainCosts(int pathID, float cost)
      Sets the cost for all terrains for a path. Note that this overwrites the cost of other terrains and should thus be used before rmPathSetTerrainCost() if you need it.
    • rmPathDefSetAllTerrainCosts

      public boolean rmPathDefSetAllTerrainCosts(int pathDefID, float cost)
      Sets the cost for all terrains for a path def. Note that this overwrites the cost of other terrains and should thus be used before rmPathSetTerrainCost() if you need it.
    • rmPathSetCostNoise

      public boolean rmPathSetCostNoise(int pathID, float minNoise, float maxNoise)
      Adds a random value in the specified range for each tile for a path, used in addition to terrain costs, distance costs, and constraint costs.
    • rmPathDefSetCostNoise

      public boolean rmPathDefSetCostNoise(int pathDefID, float minNoise, float maxNoise)
      Adds a random value in the specified range for each tile for a path def, used in addition to terrain costs, distance costs, and constraint costs.
    • rmPathSetAllowDiagonals

      public boolean rmPathSetAllowDiagonals(int pathID, boolean allowDiagonals)
      Specifies whether a path is allowed to go diagonally. Note that areas will still always fill the diagonals (L-shape), regardless of this setting.
    • rmPathDefSetAllowDiagonals

      public boolean rmPathDefSetAllowDiagonals(int pathDefID, boolean allowDiagonals)
      Specifies whether paths derived from a path def are allowed to go diagonally. Note that areas will still always fill the diagonals (L-shape), regardless of this setting.
    • rmPathSetIgnoreStartEndConstraints

      public boolean rmPathSetIgnoreStartEndConstraints(int pathID, boolean ignoreStartEndConstraints)
      Specifies whether the start and end tile of a path should ignore constraints or not.
    • rmPathDefSetIgnoreStartEndConstraints

      public boolean rmPathDefSetIgnoreStartEndConstraints(int pathDefID, boolean ignoreStartEndConstraints)
      Specifies whether the start and end tile of a path derived from a path def should ignore constraints or not.
    • rmPathAddWaypointConstraint

      public boolean rmPathAddWaypointConstraint(int pathID, int waypointID, int constraintID, float bufferDist)
      Adds a waypoint constraint to a path which a waypoint has to respect (useful if the waypoint is randomized one way or another).
    • rmPathDefAddWaypointConstraint

      public boolean rmPathDefAddWaypointConstraint(int pathDefID, int waypointID, int constraintID, float bufferDist)
      Adds a waypoint constraint to a path def which a waypoint has to respect (useful if the waypoint is randomized one way or another).
    • rmPathAddConstraint

      public boolean rmPathAddConstraint(int pathID, int constraintID, float cost, float bufferDist)
      Adds a constraint which all tiles of this path have to respect. If the cost is > 0, the constraint becomes soft and the cost is added to the path cost when crossing that tile instead of marking it as impassable if the constraint fails.
    • rmPathDefAddConstraint

      public boolean rmPathDefAddConstraint(int pathDefID, int constraintID, float cost, float bufferDist)
      Adds a constraint which all tiles of a path derived from this path def have to respect. If the cost is > 0, the constraint becomes soft and the cost is added to the path cost when crossing that tile instead of marking it as impassable if the constraint fails.
    • rmPathBuild

      public boolean rmPathBuild(int pathID)
      Builds a path.
    • rmPathGetTiles

      public Vector[] rmPathGetTiles(int pathID)
      Returns all tiles of a path as fractions.
    • rmPathGetWaypoints

      public Vector[] rmPathGetWaypoints(int pathID)
      Returns all waypoints of a path as fractions.
    • rmPathGetNumberSegments

      public int rmPathGetNumberSegments(int pathID)
      Returns the number of segments a path has.
    • rmPathDefCreate

      public int rmPathDefCreate(String name)
      Creates a new path definition.
    • rmPathDefGetID

      public int rmPathDefGetID(String name)
      Gets the path definition ID for a given path definiton name.
    • rmPathDefGetName

      public String rmPathDefGetName(int pathDefID)
      Gets the name for a given path definition ID.
    • rmPathDefCreatePath

      public int rmPathDefCreatePath(int pathDefID, String nameOverride)
      Creates an path from an path definiton. If a name override is provided that name is used, otherwise the name of the path definition followed by the number of paths created with the definition so far is used.
    • rmPathDefCreatePaths

      public int[] rmPathDefCreatePaths(int pathDefID, int numPaths, String nameOverride)
      Creates multiple paths from an path definiton. If a name override is provided that name is used incrementally, otherwise the name of the path definition followed by the number of paths created with the definition so far is used.
    • rmPathDefGetCreatedPath

      public int rmPathDefGetCreatedPath(int pathDefID, int index)
      Gets the ID of the i-th path created by this path definition.
    • rmPathDefGetCreatedPaths

      public int[] rmPathDefGetCreatedPaths(int pathDefID)
      Gets all path IDs created by this path definition.
    • rmPathDefGetNumberCreatedPaths

      public int rmPathDefGetNumberCreatedPaths(int pathDefID)
      Gets the number of paths created by this path definition.
    • rmSplineGetID

      public int rmSplineGetID(String name)
      Gets the spline ID for a given spline name.
    • rmSplineGetName

      public String rmSplineGetName(int defID)
      Gets the name for a given spline ID.
    • rmSplineCreate

      public int rmSplineCreate(String name)
      Creates a new spline with the given name, returning the ID of the created spline.
    • rmSplineAddLoc

      public boolean rmSplineAddLoc(int splineID, Vector loc)
      Adds a loc to the spline.
    • rmSplineInitialize

      public boolean rmSplineInitialize(int splineID)
      Initializes a spline with the points added so that it can be evaluated subsequently.
    • rmSplineEvaluateAt

      public Vector rmSplineEvaluateAt(int splineID, float t)
      Evaluates an initialzed spline at time t in [0.0, 1.0].
    • rmSplineEvaluate

      public Vector[] rmSplineEvaluate(int splineID, int numPoints)
      Evaluates an initialzed spline in (numPoints - 1) equal intervals, resulting in numPoints interpolated points.
    • rmSplineToPaths

      public int[] rmSplineToPaths(int splineID, int numPointsPerSplineSegment, boolean allowDiagonals)
      Creates paths from splines, one between each pair of waypoints, and returns the IDs of the created paths.
    • rmSetPostGenWaterBeautification

      public void rmSetPostGenWaterBeautification(boolean beautifyWater, boolean beautifyWaterTerrain)
      Determines whether waterbodies will be expanded based on their height to fill gaps, and whether water body terrain will be repainted.
    • rmWaterTypeSetFloorTerrain

      public boolean rmWaterTypeSetFloorTerrain(int waterID, int terrainID)
      Sets the floor terrain type to use for the water type with the given ID.
    • rmWaterTypeAddBeachLayer

      public boolean rmWaterTypeAddBeachLayer(int waterID, int terrainID, float distance, float variance)
      Adds a beach layer (towards land) when painting water edges for the provided water type. Distance should increase from layer to layer.
    • rmWaterTypeAddShoreLayer

      public boolean rmWaterTypeAddShoreLayer(int waterID, int terrainID, float distance, float variance)
      Adds a shore layer (towards water) when painting water edges for the provided water type. Distance should increase from layer to layer.
    • rmCustomMixCreate

      public int rmCustomMixCreate(String name)
      Creates a new custom mix.
    • rmCustomMixSetPaintParams

      public boolean rmCustomMixSetPaintParams(int mixID, int mode, float freq, int octaves, float persistence)
      Sets the terrain paint parameters for the custom mix with the given ID.
    • rmCustomMixAddPaintEntry

      public boolean rmCustomMixAddPaintEntry(int mixID, int terrainID, float weight)
      Adds a terrain paint entry for the custom mix with the given ID.
    • rmCustomMixSetObjectParams

      public boolean rmCustomMixSetObjectParams(int mixID, float baseWeight)
      Sets the base weight (weight to not place anything) for a custom mix.
    • rmCustomMixAddObjectEntry

      public boolean rmCustomMixAddObjectEntry(int mixID, int protoID, float weight, float scaleMin, float scaleMax)
      Adds a proto object entry for the custom mix with the given ID.
    • rmCustomForestCreate

      public int rmCustomForestCreate(String name)
      Creates a new custom forest.
    • rmCustomForestSetMix

      public boolean rmCustomForestSetMix(int forestID, int mixID)
      Sets the floor mix for a custom forest.
    • rmCustomForestSetTerrain

      public boolean rmCustomForestSetTerrain(int forestID, int terrainTypeID)
      Sets the terrain type for a custom forest.
    • rmCustomForestSetParams

      public boolean rmCustomForestSetParams(int forestID, float treeDensity, float underbrushDensity)
      Sets the tree and underbrush density parameters for a custom forest.
    • rmCustomForestAddTreeType

      public boolean rmCustomForestAddTreeType(int forestID, int protoID, float weight)
      Adds a tree type to randomize from with the given weight to a custom forest.
    • rmCustomForestAddUnderbrushType

      public boolean rmCustomForestAddUnderbrushType(int forestID, int protoID, float weight)
      Adds an underbrush type to randomize from with the given weight to a custom forest.
    • rmCustomCliffCreate

      public int rmCustomCliffCreate(String name)
      Creates a new custom cliff.
    • rmCustomCliffSetMix

      public boolean rmCustomCliffSetMix(int cliffID, int layerID, int mixID, float objectDensity)
      Sets the cliff mix and object density for one layer of a custom cliff.
    • rmCustomCliffSetTerrain

      public boolean rmCustomCliffSetTerrain(int cliffID, int layerID, int terrainID, float objectDensity)
      Sets the cliff terrain and object density for one layer of a custom cliff.
    • rmCustomCliffAddObject

      public boolean rmCustomCliffAddObject(int cliffID, int layerID, int protoID, float weight)
      Adds a proto and assigns a weight when placing it for one layer of a custom cliff.
    • rmCustomCliffAddObjectToAllLayers

      public boolean rmCustomCliffAddObjectToAllLayers(int cliffID, int protoID, float weight)
      Adds a proto and assigns a weight when placing it for a custom cliff.
    • rmLocGenSetMaxIterations

      public boolean rmLocGenSetMaxIterations(int maxIterations)
      Sets the maximum number of iterations the location generator will run for before giving up.
    • rmLocGenSetDistStrictness

      public boolean rmLocGenSetDistStrictness(float strictnessThresh)
      Sets a threshold (0-1) for a fraction of iterations after which the location generator will start to loosen the set distance for locs to avoid themselves (e.g., 0.1 -> after 10% of the iterations, the generator will start to linearly reduce the avoidance distances). Does NOT affect constraints.
    • rmLocGenCreateRadiusRandomizer

      public int rmLocGenCreateRadiusRandomizer()
      Creates a new radius randomizer.
    • rmLocGenSetRadiusRandomizerRadius

      public boolean rmLocGenSetRadiusRandomizerRadius(int radiusRandomizerID, float minRadius, float maxRadius)
      Sets the min/max radius in meters for a radius randomizer.
    • rmLocGenCreateAngleRandomizer

      public int rmLocGenCreateAngleRandomizer()
      Creates a new angle randomizer.
    • rmLocGenAddAngleRandomizerSectorPriority

      public boolean rmLocGenAddAngleRandomizerSectorPriority(int angleRandomizerID, int startIdx, int endIdx, int priority, int incrementType, boolean isAdditive)
      Prioritizes sectors for an angle randomizer. startIdx/endIdx (inclusive) indicate the start and end of the sector range, going clockwise and starting at 0 degrees for index 0. Each sector is 2PI / cNumberCircleSectors wide. The increment type can be start to end, end to start, inside out, or outside in, and all increments are linear steps of 1. If you want to override existing values for the angle randomizer, pass in false for isAdditive.
    • rmLocGenCreateLoc

      public int rmLocGenCreateLoc()
      Creates a new loc to generate. Note that unlike entities like objects or areas, locs are not persistent beyond rmLocGenReset().
    • rmLocGenSetLocOwner

      public boolean rmLocGenSetLocOwner(int locID, int ownerID, int ownerIndex)
      Sets the owner ID and index (useful if you have multiple player locs) for a loc. Not used during generation, but can be used later on to look up to whom a generated location belongs.
    • rmLocGenSetLocOrigin

      public boolean rmLocGenSetLocOrigin(int locID, Vector loc)
      Sets the origin for a loc. The radius and angle will be used relative to that location when running the location generator.
    • rmLocGenSetLocForwardAngle

      public boolean rmLocGenSetLocForwardAngle(int locID, float forwardAngle)
      Sets the forward angle for a location. Used as an offset on top of the angle randomizer (i.e., you can then think of the angle randomizer to 'point forward' from the start and end index).
    • rmLocGenSetLocAngleParams

      public boolean rmLocGenSetLocAngleParams(int locID, boolean randomizeSide, boolean rotateClockwise)
      Sets additional angle parameters for a location, i.e., whether to randomize the side (relative to where forward is) of angles randomized for this loc, and whether to subtract the randomized angle from the forward angle instead of adding it. Both of these parameters result in the sign of the randomized angle being flipped before added to the forward angle, but only the first one randomizes the outcome. The randomization always happens on top of the (counter) clockwise roation.
    • rmLocGenSetLocAvoidDistance

      public boolean rmLocGenSetLocAvoidDistance(int locID, float avoidDist)
      Sets the avoidance distance of this loc to all other locs that are being generated. If a strictness threshold is set, this distance will get linearly reduced to 0 from the moment the iteration count for the threshold has been reached up to the maximum number of iterations (meaning that in the last iteraton, the distance becomes 0).
    • rmLocGenSetLocRadiusVariance

      public boolean rmLocGenSetLocRadiusVariance(int locID, float radiusVar, boolean isAbsolute)
      Sets a radius variance for this loc, either relative to the randomized radius (as a factor between 0 and 1, 0 meaning no variance) or absolute in meters.
    • rmLocGenSetLocAngleVariance

      public boolean rmLocGenSetLocAngleVariance(int locID, float angleVar, boolean useMeters)
      Sets an angle variance for this loc, either in radians to be added/subtracted from the randomized angle, or in meters from the randomized angle using the randomized radius (i.e., computing the 2 points on the circle with the randomized radius that are angleVar meters away from the randomized angle).
    • rmLocGenSetLocSquarePlacement

      public boolean rmLocGenSetLocSquarePlacement(int locID, boolean squarePlacement)
      Whether to use square placement instead of circular (the circle will be stretched to a square) for this loc.
    • rmLocGenSetLocRadiusRandomizer

      public boolean rmLocGenSetLocRadiusRandomizer(int locID, int radiusRandomizerID)
      Sets the radius randomizer for this loc. If multiple locs share the same radius randomizer, they will all use the same radius for placement. Individual variance is applied on top of this.
    • rmLocGenSetLocAngleRandomizer

      public boolean rmLocGenSetLocAngleRandomizer(int locID, int angleRandomizerID)
      Sets the angle randomizer for this loc. If multiple locs share the same angle randomizer, they will all use the same angle for placement. Individual variance and angle parameters are applied on top of this.
    • rmLocGenAddLocConstraint

      public boolean rmLocGenAddLocConstraint(int locID, int constraintID, float bufferDist)
      Add a constraint to this loc that possible tiles must respect when randomizing the loc.
    • rmLocGenAddLocBinding

      public boolean rmLocGenAddLocBinding(int locID, int otherLocID, float minDist, float maxDist, boolean mutual)
      Binds one loc to another, forcing them to remain within a min/max distance of each other. If mutual is set to true, the binding will be applied for both locs.
    • rmLocGenSetObject

      public boolean rmLocGenSetObject(int locID, int objectID, boolean placeAsNature)
      Sets an object (not a def) to be placed at this loc when calling rmLocGenApply() after generating. Uses the constraints of that object when generating the loc.
    • rmLocGenSetArea

      public boolean rmLocGenSetArea(int locID, int areaID)
      Sets an area (not a def) to be built at this loc when calling rmLocGenApply() after generating. Uses the constraints of that area when generating the loc.
    • rmLocGenSetInArea

      public boolean rmLocGenSetInArea(int locID, int areaID)
      Sets a loc to remain within an area.
    • rmLocGenSetInAreaID

      public boolean rmLocGenSetInAreaID(int locID, int areaID)
      Sets a loc to remain within an area. Deprecated, use rmLocGenSetInArea() instead.
    • rmLocGenGenerate

      public boolean rmLocGenGenerate()
      Runs the location generator, returning true if all added locs were generated before the maximum number of iterations has been exhausted.
    • rmLocGenApply

      public boolean rmLocGenApply(boolean buildAreas, boolean paintAreas)
      Places the objects and builds the areas that have been added to locs, to be run after the locations have been generated.
    • rmLocGenReset

      public boolean rmLocGenReset()
      Resets the location generator, cleaning out all loc data.
    • rmLocGenGetTime

      public float rmLocGenGetTime()
      Returns the time it took to run rmLocGenGenerate().
    • rmLocGenGetNumberLocs

      public int rmLocGenGetNumberLocs()
      Returns the number of locs that have been added to the generator.
    • rmLocGenGetNumberLocsByOwner

      public int rmLocGenGetNumberLocsByOwner(int ownerID)
      Returns the number of locs that have been added for an owner.
    • rmLocGenGetLocIDByOwner

      public int rmLocGenGetLocIDByOwner(int ownerID, int idx)
      Returns the loc ID based on owner ID and index.
    • rmLocGenGetLocOwner

      public int rmLocGenGetLocOwner(int locID)
      Returns the owner ID for a loc ID.
    • rmLocGenGetLocOwnerIndex

      public int rmLocGenGetLocOwnerIndex(int locID)
      Returns the index for a loc ID.
    • rmLocGenGetLocObject

      public int rmLocGenGetLocObject(int locID)
      Returns the object ID for a loc.
    • rmLocGenGetLocArea

      public int rmLocGenGetLocArea(int locID)
      Returns the area ID for a loc.
    • rmLocGenGetLoc

      public Vector rmLocGenGetLoc(int locID)
      Returns the actual location (naming is hard) for a generated loc.
    • rmLocGenGetExhaustion

      public float rmLocGenGetExhaustion()
      Returns the fraction of iterations that was performed during the last run of the location generator relative to the maximum number of iterations.
    • rmWallsSetTypeIndex

      public boolean rmWallsSetTypeIndex(int functionTypeIndex)
      Sets the wall type (remains until unset), indices are as defined in the unit function data.
    • rmWallsPlace

      public boolean rmWallsPlace(int playerID, Vector[] waypoints)
      Places walls at the provided waypoints (in fractions).
    • rmWallsPlaceLine

      public boolean rmWallsPlaceLine(int playerID, Vector startLoc, Vector endLoc)
      Places walls in a line between the two provided waypoints (in fractions).
    • rmWallsPlaceSquare

      public boolean rmWallsPlaceSquare(int playerID, Vector loc, float radiusMeters)
      Places walls in a square around the specified location (in fractions).
    • rmWallsPlaceAroundArea

      public boolean rmWallsPlaceAroundArea(int playerID, int areaID)
      Places walls around the edge of an area.
    • rmTriggerAddScriptLine

      public void rmTriggerAddScriptLine(String line)
      Adds a single line of XS code to the trigtemp.xs trigger script.
    • rmTriggerAddScriptInclude

      public boolean rmTriggerAddScriptInclude(String file)
      Adds an XS trigger script to include to the trigtemp.xs trigger script. The path is relative to the trigger folder (and NOT the RM folder).
    • rmTriggerCreateArmy

      public int rmTriggerCreateArmy(int playerID, String armyName)
      Creates an army for the given player and name.
    • rmTriggerAddUnitsToArmy

      public boolean rmTriggerAddUnitsToArmy(int playerID, int armyID, int objectDefID)
      Adds all objects placed by an object def to the army of a player.
    • rmObjectiveAdd

      public int rmObjectiveAdd(String nameStr, String textStr, String hintStr, boolean isPrimary, boolean isVisible)
      Adds a map objective.
    • rmObjectiveSetTeam

      public void rmObjectiveSetTeam(int objID, int teamID)
      Restricts the objective to the given team.
    • rmObjectiveSetPlayer

      public void rmObjectiveSetPlayer(int objID, int playerID)
      Restricts the objective to the given player.
    • rmSummarySetTitle

      public void rmSummarySetTitle(String titleText)
      Sets the title text to be used in the objectives screen.
    • rmSummarySetGoal

      public void rmSummarySetGoal(String goalText)
      Sets the goal text to be used in the objectives screen.
    • rmSummarySetSpotlightHeader

      public void rmSummarySetSpotlightHeader(String titleText)
      Sets the spotlight title to be used in the objectives/summary screen.
    • rmSummarySetSpotlightText

      public void rmSummarySetSpotlightText(String titleText)
      Sets the spotlight text to be used in the objectives/summary screen.
    • rmSummarySetSpotlightImage

      public void rmSummarySetSpotlightImage(String path)
      Sets the path for the spotlight image to be used in the objectives/summary screen.
    • rmCameraTrackCreate

      public int rmCameraTrackCreate(String trackName, float durationMs)
      Adds a camera track.
    • rmCameraTrackAddWaypoint

      public int rmCameraTrackAddWaypoint(int trackIdx, Vector position, Vector forward, Vector up, Vector right, float fov)
      Adds the provided camera position as a waypoint to the given track index.
    • rmCameraTrackWaypointSetTime

      public void rmCameraTrackWaypointSetTime(int trackIdx, int waypointIdx, float timeMs)
      Sets the time for a provided waypoint index in the given track index.
    • rmCameraTrackWaypointSetTension

      public void rmCameraTrackWaypointSetTension(int trackIdx, int waypointIdx, float tension)
      Sets the tension for a provided waypoint index in the given track index.
    • rmCameraTrackWaypointSetContinuity

      public void rmCameraTrackWaypointSetContinuity(int trackIdx, int waypointIdx, float continuity)
      Sets the continuity for a provided waypoint index in the given track index.
    • rmCameraTrackWaypointSetBias

      public void rmCameraTrackWaypointSetBias(int trackIdx, int waypointIdx, float bias)
      Sets the bias for a provided waypoint index in the given track index.
    • trEcho

      public void trEcho(String text)
      Trigger echo.
    • trCurrentPlayer

      public int trCurrentPlayer()
      returns the current player.
    • trSetCurrentPlayerStatus

      public void trSetCurrentPlayerStatus(boolean active)
      sets the current player as active or inactive.
    • trSetUserControls

      public void trSetUserControls(boolean active)
      sets the player controls on or off.
    • trSetShowCursor

      public void trSetShowCursor(boolean show)
      forces the cursor (mouse pointer) to be shown/hidden.
    • trFadeOutMusic

      public void trFadeOutMusic(float duration)
      Fades out current music over a given duration.
    • trPlayNextMusicTrack

      public void trPlayNextMusicTrack()
      Plays the next song in the music play list.
    • trFadeOutAllSounds

      public void trFadeOutAllSounds(float duration)
      Fades out all sounds over a given duration.
    • trBlockAllSounds

      public void trBlockAllSounds(boolean dialog)
      Blocks all sounds from playing from this point forward.
    • trUnblockAllSounds

      public void trUnblockAllSounds()
      Unblocks all sounds that were previously blocked from playing.
    • trBlockAllAmbientSounds

      public void trBlockAllAmbientSounds()
      blocks all ambient sounds from this point forward
    • trUnBlockAllAmbientSounds

      public void trUnBlockAllAmbientSounds()
      Unblocks all ambient sounds that were previously blocked from playing.
    • trSetDialogueSoundEvent

      public void trSetDialogueSoundEvent(String name)
      Plays dialogue with the specified sound event from this point forward.
    • trClearDialogueSoundEvent

      public void trClearDialogueSoundEvent()
      Plays dialgue with the default sound event from this point forward.
    • trMusicPlay

      public void trMusicPlay(String filename, float duration)
      Plays the music file.
    • trMusicPlayCurrent

      public void trMusicPlayCurrent()
      Plays the current music.
    • trMusicStop

      public void trMusicStop()
      Stops the current music.
    • trMusicSetCurrentMusicSet

      public void trMusicSetCurrentMusicSet(int setID)
      sets the current music set.
    • trMusicSetMood

      public void trMusicSetMood(int moodID, float fadeTimeSeconds)
      Changes the music to mood associated with mood id.
    • trMessageSetText

      public void trMessageSetText(String text, int timeout)
      displays the message text.
    • trObjectivesTracker

      public void trObjectivesTracker(String title, String text, String soundfile, int timeout)
      displays the objectives tracker text.
    • trChatSetStatus

      public void trChatSetStatus(boolean status)
      Changes the chat status.
    • trChatKeepLastMessagesOnScreen

      public void trChatKeepLastMessagesOnScreen(boolean status)
      Sets whether the last messages should always remain visible.
    • trChatClearHudMessages

      public void trChatClearHudMessages()
      Clears the messages visible on screen.
    • trChatSend

      public void trChatSend(int playerID, String message)
      Changes the chat status.
    • trChatSendToPlayer

      public void trChatSendToPlayer(int playerID, int toPlayer, String message)
      Changes the chat status for one specific player.
    • trChatSendSpoofed

      public void trChatSendSpoofed(int playerID, String message)
      Changes the chat status, but does not append player.
    • trChatSendSpoofedToPlayer

      public void trChatSendSpoofedToPlayer(int playerID, int toPlayer, String message)
      Changes the chat status, but does not append player. Goes to specific player.
    • trChatHistoryContains

      public boolean trChatHistoryContains(String text, int playerID)
      Checks whether or not any of the last sent chat messages by a player contain the given text.
    • trGameLoadScenario

      public void trGameLoadScenario(String scenario)
      start a game using scenario.
    • trCampaignBranchChoice

      public void trCampaignBranchChoice(String message, boolean displayPrompt)
      pop up a dialog allowing choice to load a scenario.
    • trEndChallenge

      public void trEndChallenge(boolean bAchievedVictory)
      player completed the challenge. If 'achieved victory' is true, player completed all objectives before the timer elapsed.
    • trCampaignLoseMission

      public void trCampaignLoseMission()
      Sets player as defeated within a campaign mission and displays defeat dialog.
    • trCampaignProgress

      public void trCampaignProgress()
      Completes current scenario within campaign, and advances to next scenario or cinematic.
    • trCampaignProgressChoice

      public void trCampaignProgressChoice()
      Completes current scenario within campaign, and displays prompt to progress to next scenario or return to campaign menu.
    • trTutorialEndChoice

      public void trTutorialEndChoice()
      Completes tutorial, and displays prompt to progress to next campaign or return to main menu.
    • trShowWinPopup

      public void trShowWinPopup(String text, String soundfile, boolean ignoreUserControlsState)
      message and sound.
    • trShowWinLose

      public void trShowWinLose(String text, String soundfile, boolean ignoreUserControlsState)
      message and sound.
    • trShowLosePopup

      public void trShowLosePopup(String text, String soundfile, boolean ignoreUserControlsState)
      message and sound.
    • trWorldSpacePromptArmy

      public void trWorldSpacePromptArmy(String id, String armyName, boolean showColor, String stringID, Vector offset)
      show a world space prompt over a selected army.
    • trWorldSpacePromptArea

      public void trWorldSpacePromptArea(String id, Vector location, String stringID, Vector offset)
      show a world space prompt in selected location.
    • trWorldSpacePrompt

      public void trWorldSpacePrompt(String id, int unitID, boolean showColor, String stringID, Vector offset, String attachPoint)
      show a world space prompt over a selected unit.
    • trWorldSpacePromptHide

      public void trWorldSpacePromptHide(String id)
      hide a world space prompt.
    • trRenderSnow

      public void trRenderSnow(float percent)
      controls snow rendering.
    • trRenderRain

      public void trRenderRain(float percent)
      controls rain rendering.
    • trUIFlashTech

      public void trUIFlashTech(int techID, boolean flash)
      flashes the button of a given technology in command panel UI.
    • trUIFlashTrain

      public void trUIFlashTrain(String protoName, boolean flash)
      flashes the button of a given protoUnit in command panel UI.
    • trUIFlashCommand

      public void trUIFlashCommand(String puCmdName, boolean flash)
      flashes the button of a given protoUnitCommand in command panel UI.
    • trUIFlashAbility

      public void trUIFlashAbility(String puCmdName, boolean flash)
      flashes the button of a given unit ability in command panel UI.
    • trUIFlashAgeUp

      public void trUIFlashAgeUp(boolean flash)
      flashes the age-up button in command panel UI, if applicable.
    • trUIFlashGodPowerAtSlot

      public void trUIFlashGodPowerAtSlot(int slotIdx, boolean flash)
      flashes the god power at a given gp slot.
    • trUIMinimapFlash

      public void trUIMinimapFlash(boolean flash)
      toggles flashing state on Minimap gadget.
    • trUIIdleBannerFlash

      public void trUIIdleBannerFlash(int bannerIndex, boolean flash)
      toggles flashing state on Minimap gadget.
    • trUIVillagerPriorityButtonFlash

      public void trUIVillagerPriorityButtonFlash(int buttonIndex, boolean flash)
      toggles flashing state on a given Villager Priority Dialog button.
    • trUIVillagerPriorityButtonHUDFlash

      public void trUIVillagerPriorityButtonHUDFlash(boolean flash)
      toggles flashing state on HUD Villager Priority Dialog button.
    • trUIPanelVisibility

      public void trUIPanelVisibility(int panelIndex, boolean display)
      toggles visibility for a given HUD panel.
    • trUIGamepadPromptVisibility

      public void trUIGamepadPromptVisibility(int promptIndex, boolean display)
      toggles visibility for a given gamepad prompt.
    • trUIBlockRadialMenu

      public void trUIBlockRadialMenu(int menuIndex, boolean display)
      blocks a given radial menu.
    • trUIBlockMinimapExpansion

      public void trUIBlockMinimapExpansion(boolean blocked)
      blocks the minimap from expanding.
    • trUIHideRadialMenuPromptPanel

      public void trUIHideRadialMenuPromptPanel(boolean hidden)
      hides the radial menu prompt panel.
    • trUIPanelFlash

      public void trUIPanelFlash(int panelIndex, boolean flash)
      toggles flashing state for a given HUD panel.
    • trUIGamepadPromptFlash

      public void trUIGamepadPromptFlash(int promptIndex, boolean flash)
      toggles flashing state for a given gamepad prompt.
    • trUIResourceEntryFlash

      public void trUIResourceEntryFlash(int entryIndex, boolean flash)
      toggles flashing state for a given resource entry in the HUD resoruces panel.
    • trUIFadeToColor

      public void trUIFadeToColor(int r, int g, int b, int duration, int delay, boolean inout, int eventID)
      fade in/out using color specified.
    • trLeaveGame

      public void trLeaveGame()
      Leaves the current game. Most often that means going to the main menu but while in editor playtest it means you go back to the editor.
    • trCampaignStartNew

      public void trCampaignStartNew(String message, String campaignPath)
      shows dialog for advancing to the given campaign
    • trUnforbidProtounit

      public boolean trUnforbidProtounit(int player, String protoname)
      removes protounit from the forbidden list
    • trForbidProtounit

      public boolean trForbidProtounit(int player, String protoname)
      adds protounit to the forbidden list
    • trIsDialogueNotPlaying

      public boolean trIsDialogueNotPlaying()
      returns false if dialogue is currently playing
    • trUnitChangeName

      public void trUnitChangeName(String newName)
      set an override name for a specific unit
    • trChatHistoryClear

      public void trChatHistoryClear()
      forces the chat history to reset
    • trEchoStatValue

      public void trEchoStatValue(int playerID, int statIndex)
      fetch a stat value from the KB and echo to chat
    • trShowChoiceDialog

      public void trShowChoiceDialog(String maintext, String text1, int event1, String text2, int event2)
      displays dialog with 2 choices, and activates a trigger in response
    • trShowChoiceDialogForPlayer

      public void trShowChoiceDialogForPlayer(int playerID, String maintext, String text1, int event1, String text2, int event2)
      displays dialog with 2 choices for a given player, and activates a trigger in response
    • trShowImageDialog

      public void trShowImageDialog(String imagePath, String subtitle)
      displays a custom image in a dialog, with a subtitle
    • trOverlayText

      public void trOverlayText(String rawText, float time, float textSize, int colorR, int colorG, int colorB)
      puts up a big movie-credits style text overlay
    • trShowTextMessage

      public void trShowTextMessage(String noteTitle, String noteText)
      Displays a text box with the specified title and text.
    • trSetCurrentScenarioUserData

      public void trSetCurrentScenarioUserData(int index, int value)
      NOTE: This function is DEPRECATED *** Sets the current scenario user data.
    • trGetScenarioUserData

      public int trGetScenarioUserData(int index, int fallback, String scenarioName)
      NOTE: This function is DEPRECATED *** Gets the scenario user data and returns the default value when it is not present yet. Defaults to the current scenario
    • trUnitGameSelect

      public void trUnitGameSelect(boolean clear)
      selects the given units for the current player
    • trSetFogAndBlackmapMultiplayer

      public void trSetFogAndBlackmapMultiplayer(boolean fog, boolean black)
      turn fog and black map on/off, affecting all players. (no SP check)
    • trPlayerSetVictorious

      public void trPlayerSetVictorious(int playerID)
      sets the given player as victorious for the current game.
    • trPlayerSetWon

      public void trPlayerSetWon(int i, boolean endGame)
      call this when a player has won on the local machine (meaning that this func must be called synchronously on all machines, it will not pass around a command.)
    • trSetVictoryPlayers

      public void trSetVictoryPlayers(int[] playerList)
      sets the provided players as victorious
    • trSoundPlayDialogue

      public void trSoundPlayDialogue(int playerID, String msgStrID, String speakerStrID, String portraitStrID, String sound, int eventID, boolean ignoreOnAbort, int timeoutMs, boolean overrideSoundLength)
      Plays the sound associated with the dialogue.
    • trSoundPlayDialogueTalkingHeads

      public void trSoundPlayDialogueTalkingHeads(int playerID, String msgStrID, String speakerStrID, String portraitLeftSideStrID, String portraitRightSideStrID, boolean speakerIsLeftSide, String sound, int eventID, boolean ignoreEventOnAbort, int eventDelaySeconds)
      Plays the sound associated with the dialogue, using the talking heads version of the UI.
    • trSoundsetPlay

      public void trSoundsetPlay(String soundsetName)
      Plays the sound associated with the given soundset.
    • trSoundsetPlayPlayer

      public void trSoundsetPlayPlayer(int playerID, String soundsetName)
      Plays the sound associated with the given soundset for the given player.
    • trActivateCheat

      public boolean trActivateCheat(int playerID, String command)
      Executes a cheat for the provided player.
    • trEndGame

      public void trEndGame()
      Signal that the game has ended.
    • trRestartScenario

      public void trRestartScenario()
      restarts the scenario
    • trHideScoreboard

      public void trHideScoreboard()
      hides the user's Scoreboard.
    • trWPFDialogOpen

      public boolean trWPFDialogOpen(int wpdDialogID)
      returns true if the given WPF dialog is currently open.
    • trInGamepadMode

      public boolean trInGamepadMode()
      returns true if we're currently in gamepad mode.
    • trInRadialMenuPage

      public boolean trInRadialMenuPage(int radialMenuPageID)
      returns true if the given radial menu page is open.
    • trInInputContext

      public boolean trInInputContext(String inputContext)
      returns true if we're in the given input context.
    • trIsMinimapExpanded

      public boolean trIsMinimapExpanded()
      returns true if the minimap is expanded.
    • trShowHidePopup

      public void trShowHidePopup(int type, boolean display)
      toggles a popup.
    • trCreateUnitNumberGroup

      public void trCreateUnitNumberGroup(int group)
      grouping Units.
    • trSetBuildingChainVisible

      public void trSetBuildingChainVisible(int playerID, boolean visibile, boolean force)
      toggles visibility for Building Chain range.
    • trFormatString

      public String trFormatString(String format, String[] inserts)
      Inserts (loc)strings into (loc)strings.
    • trCounterIncrementManual

      public boolean trCounterIncrementManual(String name, int amount)
      increment the current value of the counter.
    • trCounterDecrementManual

      public boolean trCounterDecrementManual(String name, int amount)
      decrement the current value of the counter.
    • trCounterSetManual

      public boolean trCounterSetManual(String name, int val)
      sets the current value of the given manual counter.
    • trCounterSetManualString

      public boolean trCounterSetManualString(String name, String message)
      changes the string to be displayed on a given string pseudocounter.
    • trCounterAddPlayerName

      public boolean trCounterAddPlayerName(String name, String message, int playerID)
      displays a player name as a counter.
    • trCounterAddString

      public boolean trCounterAddString(String name, String message)
      displays a string as a counter.
    • trCounterSetPlayerName

      public boolean trCounterSetPlayerName(String name, int playerID)
      changes the player name to be displayed on a given player name pseudocounter.
    • trCounterAddTime

      public void trCounterAddTime(String name, int start, int stop, String message, int eventID)
      start a counter that may or may not fire an event.
    • trCounterTimeSetValue

      public void trCounterTimeSetValue(String name, int value)
      forcibly sets the current value of a given counter.
    • trCounterTimeIncrement

      public void trCounterTimeIncrement(String name, int value)
      Increments the current value of a given time counter by the provided value.
    • trCounterTimeDecrement

      public void trCounterTimeDecrement(String name, int value)
      Decrements the current value of a given time counter by the provided value.
    • trCounterAddTimeMs

      public void trCounterAddTimeMs(String name, int start, int stop, String message, int eventID)
      start a counter that may or may not fire an event.
    • trCounterPause

      public void trCounterPause(String name, boolean pause)
      pause a counter.
    • trCounterSetVisibility

      public void trCounterSetVisibility(String name, boolean visible)
      hides or displays a counter.
    • trCounterGetValue

      public int trCounterGetValue(String name)
      returns the current value of the given counter.
    • trCounterAbort

      public void trCounterAbort(String name)
      abort a counter.
    • trSetCounterDisplay

      public void trSetCounterDisplay(String message)
      Creates a counter if one does not exist, and sets it's display text.
    • trSetCounterDisplayWithType

      public void trSetCounterDisplayWithType(String message, int specialCounterType)
      Show a counter with the specified special type ID.
    • trSetUniqueCounterDisplay

      public void trSetUniqueCounterDisplay(String name, String message)
      Creates a counter (even if a display counter already exists), and sets it's display text.
    • trSetUniqueCounterDisplayWithType

      public void trSetUniqueCounterDisplayWithType(String name, String message, int specialCounterType)
      Creates a counter (even if a display counter already exists), and sets it's display text. Also sets counter with the specified special type ID.
    • trCounterSetSpecialType

      public void trCounterSetSpecialType(String name, int value)
      sets the special type of the named counter.
    • trClearCounterDisplay

      public void trClearCounterDisplay()
      TODO.
    • trCounterPersistent

      public void trCounterPersistent(String name, boolean persistent)
      enables or disables persistency for a counter. Persistent counters aren't deleted even after reaching their maximum value.
    • trCounterPlayerSpecific

      public void trCounterPlayerSpecific(String name, boolean playerSpecific, int playerID)
      sets whether or not a given counter should be restricted to specific players, and, if so, assigns the given player to the counter..
    • trCounterAddGenericXS

      public void trCounterAddGenericXS(String name, String msg, String appendMsg, String xsCall, int eventID, int intialVal, int finalVal, boolean finalAsMin, boolean showFinal, boolean reverseCount, boolean startAtZero)
      start an XS-based counter, that may or may not fire an event. The name of this counter is also a QV under the hood that can be adjusted at will. If you attached an xsCall to this counter the QV variable will be updated each frame so doing custom things to it won't have an effect.
    • trGamePause

      public void trGamePause(boolean pause)
      pause or unpause the game.
    • trDelayedRuleActivation

      public void trDelayedRuleActivation(String name, boolean checkForTrigger)
      adds a rule to the runtime to be activated on the next update.
    • trWaypointClear

      public void trWaypointClear()
      Clears the waypoints in the trigger selection system.
    • trWaypointAddPoint

      public void trWaypointAddPoint(Vector v)
      Adds the waypoint into the trigger selection system.
    • trWaypointAddUnitPosition

      public void trWaypointAddUnitPosition(int unitID)
      Adds the unit's position as a waypoint in the trigger selection system.
    • trUnitSelectClear

      public void trUnitSelectClear()
      Clears the units in the trigger selection system.
    • trUnitSelectByID

      public void trUnitSelectByID(int unitID)
      'Selects' the unit in the trigger selection system.
    • trUnitGetPlayerID

      public int trUnitGetPlayerID()
      Returns the playerID of the first selected unit that is valid. Returns -1 if no valid unit is selected.
    • trUnitGetPlayerIDByUnitID

      public int trUnitGetPlayerIDByUnitID(int unitID)
      Returns the playerID of the provided unitID. Returns -1 if the provided unitID is invalid.
    • trPlayerControlsSocket

      public boolean trPlayerControlsSocket(int playerID, int unitID)
      Returns true if the specified player is built on the specified socket.
    • trObjectGettingWorked

      public boolean trObjectGettingWorked(int unitID)
      Returns true if the object is currently being worked.
    • trUnitMoveToPoint

      public boolean trUnitMoveToPoint(float x, float y, float z, int eventID, boolean bAttackMove, boolean bUnitRun, float runSpeedMultiplier)
      Moves the selected unit(s) to the given position.
    • trUnitMoveToUnit

      public boolean trUnitMoveToUnit(int unitID, int eventID, boolean bAttackMove, boolean bUnitRun, float runSpeedMultiplier)
      Moves the selected unit(s) to the spot occupied by the given unit.
    • trSetRevealerActiveState

      public void trSetRevealerActiveState(String revealerName, boolean active)
      Finds the specified revealer and sets it to active or inactive.
    • trCreateRevealer

      public void trCreateRevealer(int playerID, String revealerName, Vector position, float revealerLOS, boolean blackmapOnly)
      Creates a revealer with the given attributes.
    • trUnitMoveFromArea

      public boolean trUnitMoveFromArea(float x, float y, float z, int eventID, boolean bAttackMove, int playerID, String unitType, float radius)
      Moves all matching units near the selected unit(s) to the given position.
    • trUnitBuildUnit

      public boolean trUnitBuildUnit(String protoName, Vector position, Vector forward)
      Selects units and makes the build a unit at specified location.
    • trUnitDoWorkOnUnit

      public boolean trUnitDoWorkOnUnit(int unitID, int eventID)
      Tasks the selected unit(s) to perform work on the given unit.
    • trUnitGarrison

      public boolean trUnitGarrison(int unitID, int eventID)
      Tasks the selected unit(s) to garrision into another unit.
    • trImmediateUnitGarrison

      public boolean trImmediateUnitGarrison(int unitID)
      Instantly garrisons units inside another unit without considering distance.
    • trUnitDistanceToPoint

      public float trUnitDistanceToPoint(float x, float y, float z)
      Returns the shortest distance between the trRT units and the point.
    • trUnitDistanceToUnitID

      public float trUnitDistanceToUnitID(int blockID)
      Returns the shortest distance between the trRT units and the given unit.
    • trUnitRemoveControlAction

      public void trUnitRemoveControlAction()
      Removes the current control action so the next thing can take effect immediately.
    • trUnitSetAnimation

      public boolean trUnitSetAnimation(String animName, int versionIndex, boolean loop, int eventID, boolean destroyOnNextControlAction)
      Sets the cinematic animation version for the selected unit(s).
    • trUnitSetAnimationPath

      public boolean trUnitSetAnimationPath(String animName, String animPath, boolean loop, int eventID, boolean destroyOnNextControlAction)
      Sets the cinematic animation version for the selected unit(s).
    • trUnitAlive

      public boolean trUnitAlive()
      Returns true if all selected units are alive.
    • trUnitDead

      public boolean trUnitDead()
      Returns true if all selected units are dead.
    • trUnitFullyBuilt

      public boolean trUnitFullyBuilt()
      Returns true if all selected units are fully built.
    • trUnitDelete

      public boolean trUnitDelete(boolean remove)
      removes or kills the selected unit(s).
    • trUnitDestroy

      public boolean trUnitDestroy(boolean ejectContained)
      destroys the selected unit(s).
    • trUnitCreate

      public int trUnitCreate(String protoName, float x, float y, float z, int heading, int playerID, boolean skipBirth)
      creates a new unit.
    • trUnitCreateForced

      public int trUnitCreateForced(String protoName, float x, float y, float z, int heading, int playerID, boolean skipBirth)
      creates a new unit, ignoring placement rules.
    • trRelicCreate

      public boolean trRelicCreate(float x, float y, float z, int heading, String relicname)
      creates a new relic from defined relic name.
    • trRelicForce

      public boolean trRelicForce(int unitID, String relicname)
      changes type of selected relic to the given relic name.
    • trUnitGetHeading

      public int trUnitGetHeading(int unitID)
      returns the units heading.
    • trUnitSetHeading

      public boolean trUnitSetHeading(int degrees)
      sets the units heading.
    • trUnitGetPosition

      public Vector trUnitGetPosition(int unitID)
      returns the unit's position.
    • trUnitVisibleToPlayer

      public boolean trUnitVisibleToPlayer()
      returns true if the player can see the selected unit, and it is on screen. Desync sensitive.
    • trUnitHasLOS

      public boolean trUnitHasLOS(int playerID)
      returns true if the player can see the selected unit, otherwise returns false.
    • trUnitConvert

      public void trUnitConvert(int playerID)
      converts the selected units to player.
    • trUnitPercentComplete

      public int trUnitPercentComplete()
      returns the percent complete as 0 to 100
    • trUnitPercentDamaged

      public float trUnitPercentDamaged()
      returns the percent damaged as 0 to 100
    • trUnitTeleport

      public boolean trUnitTeleport(float x, float y, float z)
      moves units from current position to position specified
    • trUnitChangeProtoUnit

      public void trUnitChangeProtoUnit(String protoName, boolean skipBirth, boolean forceFoundation)
      changes the proto unit for a given set of units.
    • trUnitDelayedTransform

      public void trUnitDelayedTransform()
      activates delayed transform (e.g. as used for Roc state change) action within selected units, whenever applicable.
    • trUnitTransformCommand

      public void trUnitTransformCommand()
      performs the transformation defined by the unit's transform command (e.g. heroization, etc.) immediately, whenever applicable.
    • trMarketReset

      public void trMarketReset()
      Resets Market buy and sell prices to default values.
    • trUnitSetGatherPointPosForPlayer

      public void trUnitSetGatherPointPosForPlayer(int playerID, int sourceID, float x, float y, float z)
      Sets the gather point of the unit on this position.
    • trBuildingTimeShiftAtPos

      public boolean trBuildingTimeShiftAtPos(int unitID, float x, float y, float z)
      cast timeshift on this unit at this position.
    • trUnitSetGatherPointUnitForPlayer

      public void trUnitSetGatherPointUnitForPlayer(int playerID, int sourceID, int targetID)
      Sets the gather point of the unit on this unit.
    • trUnitUngarrisonContained

      public void trUnitUngarrisonContained()
      ungarrisons all contained units.
    • trUnitGetNumberManuallySelected

      public int trUnitGetNumberManuallySelected()
      Fetches number of selected units.
    • trAnythingIsSelected

      public boolean trAnythingIsSelected()
      returns true if any unit is selected.
    • trUnitIsSelected

      public boolean trUnitIsSelected()
      returns if the specified unit is selected.
    • trUnitTypeIsSelected

      public boolean trUnitTypeIsSelected(String proto, boolean checkIdle)
      returns if at least one unit of the specified unit type is selected.
    • trUnitTypeIsHovered

      public boolean trUnitTypeIsHovered(String proto)
      returns if the cursor is hovering over the given unit type.
    • trUnitIsOwnedBy

      public boolean trUnitIsOwnedBy(int playerID)
      determines if the selected units are owned by the player specified.
    • trUnitIsNotOwnedBy

      public boolean trUnitIsNotOwnedBy(int playerID)
      determines if the selected units are not owned by the player specified.
    • trUnitSetStance

      public void trUnitSetStance(String stance)
      set the stance for the given set of units.
    • trUnitSetTactic

      public void trUnitSetTactic(int tacticDBID)
      set the tactic for the given set of units.
    • trUnitSetScale

      public void trUnitSetScale(float x, float y, float z)
      sets the scale for the given set of units.
    • trUnitHighlight

      public void trUnitHighlight(float duration, boolean flash)
      does something to highlight the units selected.
    • trProtoUnitHighlight

      public void trProtoUnitHighlight(int playerID, String protoName, float duration, boolean flash)
      highlights all units belonging to the given protounit for a player.
    • trAreaUnitHighlight

      public void trAreaUnitHighlight(int playerID, float duration, String unitType, int centerUnit, float radius)
      highlights all units belonging to the given unitType within the provided area for a player.
    • trAreaUnitTask

      public void trAreaUnitTask(int playerID, int destUnitID, String unitType, int centerUnit, float radius, int event)
      tasks units belonging to the given unitType within the provided area towards a target for a player.
    • trBuildingIsOnCursor

      public boolean trBuildingIsOnCursor(String proto)
      Returns true if the proto unit specified is on the cursor and is a building.
    • trPlayerTribute

      public void trPlayerTribute(int playerID, String resource, int amount, int toPlayerID)
      tributes resources to a player.
    • trPlayerIsDefeated

      public boolean trPlayerIsDefeated(int playerID)
      returns true/false if the player has been defeated.
    • trPlayerIsActive

      public boolean trPlayerIsActive(int playerID)
      returns true/false if the player is active.
    • trPlayerSetDefeated

      public void trPlayerSetDefeated(int i)
      call this when a player is defeated on the local machine (meaning that this func must be called synchronously on all machines, it will not pass around a command.)
    • trPlayerSetDiplomacy

      public void trPlayerSetDiplomacy(int player1, int player2, String status, boolean mutual)
      sets the diplomacy status between players.
    • trPlayerGetDiplomacy

      public String trPlayerGetDiplomacy(int player1, int player2)
      gets the diplomacy status between players.
    • trPlayerModifyLOS

      public void trPlayerModifyLOS(int destPlayer, boolean canSee, int srcPlayer)
      Adds/removes LOS between players.
    • trPlayerSetActive

      public void trPlayerSetActive(int playerID)
      sets the active player.
    • trObjectiveComplete

      public void trObjectiveComplete(int objectiveID, boolean forceComplete, boolean playSound)
      Completes the specified objective. Forces a reoccurring objective complete if forceComplete is true.
    • trObjectiveHide

      public void trObjectiveHide(int objectiveID)
      Hides the specified objective on the UI.
    • trObjectiveShow

      public void trObjectiveShow(int objectiveID, boolean playSound)
      Shows the specified objective on the UI.
    • trSetCommunityObjectivesVisibility

      public void trSetCommunityObjectivesVisibility(boolean show)
      Shows or hides the Global Community Community Event objective display.
    • trPlayerAtPopCap

      public boolean trPlayerAtPopCap(int playerID)
      returns true if player is at pop cap.
    • trEventSetHandler

      public boolean trEventSetHandler(int eventID, String functionName)
      sets a handler function for an event id.
    • trEventFire

      public void trEventFire(int eventID)
      cause an event to occur.
    • trSetUnitIdleProcessing

      public void trSetUnitIdleProcessing(boolean v)
      Sets whether or not units can do their idle processing.
    • trSetObscuredUnits

      public void trSetObscuredUnits(boolean v)
      Sets whether or not units can be drawn obscured or not.
    • trSoundPlayFN

      public void trSoundPlayFN(String filename, int eventID, String subtitle, String portrait)
      Plays the sound associated with the filename.
    • trSoundPlayPaused

      public void trSoundPlayPaused(String filename, String seconds, int eventID, String subtitle, String portrait)
      Plays the sound associated with the filename.
    • trSoundTimer

      public void trSoundTimer(int ms, int eventID)
      trSoundTimer(int32 milliseconds, int32 eventID) creates a high performance sound timer and passes the eventID as data.
    • trTechStatusActive

      public boolean trTechStatusActive(int playerID, int techID)
      returns true if tech is active for player.
    • trTechStatusResearching

      public boolean trTechStatusResearching(int playerID, int techID)
      returns true if tech is being researched for player.
    • trTechStatusCheck

      public boolean trTechStatusCheck(int playerID, int techID, int status)
      returns true if tech's status is techStatus.
    • trPlayerGetVillagerPriority

      public int trPlayerGetVillagerPriority(int playerID)
      gets the villager priority preset for player.
    • trTechSetStatus

      public void trTechSetStatus(int playerID, int techID, int status)
      sets the tech status for the player.
    • trSetFogAndBlackmap

      public void trSetFogAndBlackmap(boolean fog, boolean black)
      turn fog and black map on/off. (SP modes only)
    • trArmySelect

      public void trArmySelect(String parameters)
      selects the units in the army specified.
    • trArmySelectInt

      public void trArmySelectInt(int playerID, int armyID)
      selects the units in the army specified.
    • trArmyDispatch

      public boolean trArmyDispatch(String army, String protoname, int count, float x, float y, float z, int heading, boolean clearExisting, boolean skipBirth)
      creates the units in the army specified.
    • trFormationScale

      public void trFormationScale(float scale)
      scales the formation size of formations in the game.
    • trRateConstruction

      public void trRateConstruction(float rate)
      modify construction rate.
    • trRateTrain

      public void trRateTrain(float rate)
      modify training rate.
    • trRateResearch

      public void trRateResearch(float rate)
      modify research rate.
    • trRatesReset

      public void trRatesReset()
      Resets all the rates to normal (1.0f).
    • trMinimapFlare

      public void trMinimapFlare(int playerID, float duration, Vector pPosition, boolean unused)
      Sends a Minimap flare to a certain player.
    • trCameraShake

      public void trCameraShake(float shakeDuration, float shakeStrength)
      Makes the camera shake.
    • trPlayerResetBlackMap

      public void trPlayerResetBlackMap(int playerID)
      Resets the black map for a given HUMAN player.
    • trPlayerResetBlackMapForAllPlayers

      public void trPlayerResetBlackMapForAllPlayers()
      trPlayerResetBlackMapForAllPlayers(Resets the black map for all HUMAN players.
    • trPlayerKillAllBuildings

      public void trPlayerKillAllBuildings(int playerID)
      Kills all of the buildings of a given player.
    • trPlayerGrantResources

      public void trPlayerGrantResources(int playerID, String resource, int amount)
      advances the campaign.
    • trFakifySelection

      public void trFakifySelection(int fakePlayerIndex)
      Sets the selected unit as having the fake player with the specified index (0-7)
    • trFakifyArmy

      public void trFakifyArmy(String armyName, int fakePlayerIndex)
      Fakifies the army to the specified fake player index.
    • trDefakifySelection

      public void trDefakifySelection()
      Sets the selected unit as not having a fake player.
    • trDefakifyArmy

      public void trDefakifyArmy(String armyName)
      Defakifies the army.
    • trFakifySelectionSubModelByOverrideName

      public void trFakifySelectionSubModelByOverrideName(String overrideName, int fakePlayerIndex)
      Sets named submodels of the selection to fake player with the specified index (0-7)
    • trDefakifySelectionSubModels

      public void trDefakifySelectionSubModels()
      Resets all submodels back to using the player colour of the parent model.
    • trSelectionGetNumber

      public int trSelectionGetNumber()
      Returns how many units you currently have selected.
    • trSelectionGetUnitID

      public int trSelectionGetUnitID(int index)
      Returns the ID of the selected unit.
    • trSetPauseOnAgeUpgrade

      public void trSetPauseOnAgeUpgrade(boolean val)
      TODO.
    • trSetPauseInObjectiveWindow

      public void trSetPauseInObjectiveWindow(boolean val)
      TODO.
    • trRevealEntireMap

      public void trRevealEntireMap()
      shows whole map, similar to how revealed mode works (SP modes only)
    • trDamageUnitPercent

      public void trDamageUnitPercent(float damagePercent)
      does % percent of a unit's total HP in instant typeless damage.
    • trDamageUnit

      public void trDamageUnit(float damageAmt)
      does a specific amount of damage to HP in instant typeless damage.
    • trDamageUnitsInArea

      public void trDamageUnitsInArea(int playerID, String unitTypeName, float range, float dmg)
      All units within dist of the selected ref object that match type take dmg.
    • trQuestVarSet

      public void trQuestVarSet(String varName, float val)
      sets one of the trigger scratch variables
    • trQuestVarCopy

      public void trQuestVarCopy(String destName, String fromName)
      copies value of one of the trigger scratch variables
    • trQuestVarSetFromRand

      public void trQuestVarSetFromRand(String varName, float minVal, float maxVal, boolean round)
      sets one of the trigger scratch variables within a random range
    • trQuestVarSetFromRandUnique

      public void trQuestVarSetFromRandUnique(String varName, float minVal, float maxVal, boolean round)
      sets one of the trigger scratch variables within a random range, while avoiding repeating consecutive values
    • trQuestVarGet

      public float trQuestVarGet(String varName)
      retrieve value of a trigger scratch variable, returns zero if unset
    • trQuestVarEcho

      public void trQuestVarEcho(String varName)
      chats out the value of one of the trigger scratch variables
    • trUnitFaceUnit

      public boolean trUnitFaceUnit(int unitID, int eventID)
      Moves the selected unit(s) to face the given unit.
    • trLetterBox

      public void trLetterBox(boolean on, boolean letterbox)
      Turns letter box mode on or off. Letterbox toggles the black border around the screen while in cinematic mode.
    • trCameraTrackLoad

      public void trCameraTrackLoad(String szName)
      Loads a camera track.
    • trCameraTrackPlay

      public void trCameraTrackPlay(float fDuration, int eventID, boolean blendWithGameCamera, float blendDurationMS)
      plays the current camera track, if blend with game camera is true, it will best fit the strategy camera location at the last waypoint and smooth transition to it.
    • trCinematicIsAborted

      public boolean trCinematicIsAborted()
      returns the abort cinematic status.
    • trCinematicDoAbort

      public void trCinematicDoAbort()
      aborts the cinematic.
    • trCameraTrackPlayPlayer

      public void trCameraTrackPlayPlayer(String camTrackName, int playerID, boolean blendWithGameCamera, float blendDurationMS)
      loads and plays a camera track for a given player, if blend with game camera is true, it will best fit the strategy camera location at the last waypoint and smooth transition to it.
    • trCameraCutPlayer

      public void trCameraCutPlayer(int playerID, Vector pos, Vector dir, Vector up, Vector right)
      puts the camera in the specified location for the given player.
    • trCameraCut

      public void trCameraCut(Vector pos, Vector dir, Vector up, Vector right)
      puts the camera in the specified location.
    • trCameraLockOnUnit

      public void trCameraLockOnUnit(boolean bEnable, int timer, int eventID)
      Orients the camera to the selected unit, and keeps it locked on that unit.
    • trCameraPanWithUnit

      public void trCameraPanWithUnit(boolean bEnable, int eventID)
      Moves the camera in the same direction that a particular unit moves.
    • trCameraLock

      public void trCameraLock(boolean lock)
      Toggles camera movement locking over the current position.
    • trCameraTrackCreate

      public int trCameraTrackCreate(String trackName, float durationMs)
      Adds a camera track.
    • trCameraTrackAddWaypoint

      public int trCameraTrackAddWaypoint(int trackIdx, Vector position, Vector forward, Vector up, Vector right, float fov)
      Adds the provided camera position as a waypoint to the given track index.
    • trCameraTrackWaypointSetTime

      public void trCameraTrackWaypointSetTime(int trackIdx, int waypointIdx, float timeMs)
      Sets the time for a provided waypoint index in the given track index.
    • trCameraTrackWaypointSetTension

      public void trCameraTrackWaypointSetTension(int trackIdx, int waypointIdx, float tension)
      Sets the tension for a provided waypoint index in the given track index.
    • trCameraTrackWaypointSetContinuity

      public void trCameraTrackWaypointSetContinuity(int trackIdx, int waypointIdx, float continuity)
      Sets the continuity for a provided waypoint index in the given track index.
    • trCameraTrackWaypointSetBias

      public void trCameraTrackWaypointSetBias(int trackIdx, int waypointIdx, float bias)
      Sets the bias for a provided waypoint index in the given track index.
    • trSetLighting

      public void trSetLighting(String setName, float fadeTime)
      fades to the specified lighting set over fadetime.
    • trDisableTrigger

      public void trDisableTrigger(int eventID)
      Disables (sets active = false) the trigger specified by the given eventID.
    • trUnitMakeInvulnerable

      public void trUnitMakeInvulnerable(boolean bEnable)
      Makes a unit invulnerable to damage. Turn it off to return the unit to normal.
    • trKillAIPlan

      public void trKillAIPlan(int playerID, String planName)
      No help.
    • trAISetAttackResponseDistance

      public void trAISetAttackResponseDistance(int playerID, float attackResponseDistance)
      Sets the attack response distance for the provided playerID's AI if it has one. This distance controls from what within distance the AI will call other units to help if one of its units gets attacked.
    • trAddArmyToPlan

      public void trAddArmyToPlan(String armyName, String planName)
      Adds the units in the specified army to the specified plan.
    • trSetShadowFarClip

      public void trSetShadowFarClip(boolean enabled, float distance)
      Enable or disables the shadow far clippping plane.
    • trPlayerOverrideArtCulture

      public void trPlayerOverrideArtCulture(int playerID, String culture)
      Overrides the culture used for choosing the player's art.
    • trPlayerRemoveAllUnits

      public void trPlayerRemoveAllUnits(int playerID)
      Removes all of the units of a given player without affecting Player Stats.
    • trObjectiveIncomplete

      public void trObjectiveIncomplete(int objectiveID, boolean playSound)
      Marks a specified objective as incomplete.
    • trDisableUnitDeletion

      public void trDisableUnitDeletion(boolean disable)
      sets whether or not unit and building deletion should be disabled for this scenario.
    • trDisablePopCapNotifications

      public void trDisablePopCapNotifications(boolean disable)
      sets whether or not persistent popcap notifications should be disabled for this scenario.
    • trDisableNotificationSounds

      public void trDisableNotificationSounds(boolean disable)
      sets whether or not notification sounds should be disabled for this scenario.
    • trDisablePowerNotifications

      public void trDisablePowerNotifications(boolean disable)
      sets whether or not power casting notifications should be disabled for this scenario.
    • trDisablePowerTimers

      public void trDisablePowerTimers(boolean disable)
      sets whether or not displaying timers for active powers should be disabled for this scenario.
    • trEnforceAIAssist

      public void trEnforceAIAssist(boolean enable)
      sets whether or not AI assist support should be enforced for this scenario.
    • trDisableConquestCheck

      public void trDisableConquestCheck(boolean disable)
      temporarily disables or re-enables conquest victory check in a scenario that supports it.
    • trSetTeamsLocked

      public void trSetTeamsLocked(boolean locked)
      Toggles locked teams state for this scenario.
    • trExecuteConsoleCommand

      public void trExecuteConsoleCommand(String command)
      Executes the given console command.
    • trConvertUnitsInArea

      public void trConvertUnitsInArea(int srcPlayer, int trgPlayer, String unitTypeName, float range)
      All units within dist of the selected ref object that match type are converted to the target player.
    • trConvertUnitsInAreaLimited

      public void trConvertUnitsInAreaLimited(int centerUnit, int srcPlayer, int trgPlayer, String unitTypeName, float range, int maxUnits)
      Converts to the target player units of a unit type within the provided area up to the given limit.
    • trKillUnitsInArea

      public void trKillUnitsInArea(int playerID, String unitTypeName, float range)
      All units within dist of the selected ref object that match type are killed.
    • trRemoveUnitsInArea

      public void trRemoveUnitsInArea(int playerID, String unitTypeName, float range, boolean ejectContained)
      All units within dist of the selected ref object that match type are killed.
    • trPlayerOverrideCivName

      public void trPlayerOverrideCivName(int playerID, String stringID)
      Overrides the string used for the displayed civilization name.
    • trProtoUnitActionSetEnabled

      public void trProtoUnitActionSetEnabled(String protoUnitName, int playerID, String actionName, boolean enable)
      enables or disables an action for a proto unit.
    • trProtoUnitChangeName

      public void trProtoUnitChangeName(String protoUnitName, int playerID, String nameStrId, String rolloverStrId, String shortRolloverStrId)
      Modify the name and rollover text of a proto unit.
    • trProtoUnitSetIcon

      public void trProtoUnitSetIcon(String protoUnitName, int playerID, String iconPath, String minimapIconPath)
      Modify the icon of a proto unit.
    • trArmyUnitChangeName

      public void trArmyUnitChangeName(String newName, String protoUnitName)
      set an override name for a specific unit in an army
    • trPlayerGetType

      public int trPlayerGetType(int playerID)
      returns whether the given player is a human or a computer/AI player.
    • trUnitHasTarget

      public boolean trUnitHasTarget(boolean actionOnly)
      Returns true if all selected units have an attack target or are attacking.
    • trUnitGetTargetID

      public int trUnitGetTargetID(int srcUnit, boolean actionOnly)
      Returns the attack target for the given unit.
    • trUnitIsAttacking

      public boolean trUnitIsAttacking()
      Returns true if all selected units are attacking.
    • trUnitSetPassiveMode

      public boolean trUnitSetPassiveMode(boolean enable)
      enables or disables Passive Mode for selected Units.
    • trUnitTeleportToUnit

      public boolean trUnitTeleportToUnit(int unitID)
      Teleport the selected unit(s) to the spot occupied by the given unit.
    • trHealUnit

      public void trHealUnit(float healAmt)
      adjust the units' hitpoints by the given value.
    • trHealUnitPercent

      public void trHealUnitPercent(float healPercent)
      heals the selected units by a percentage of their total HP.
    • trHealUnitsInArea

      public void trHealUnitsInArea(int playerID, String unitTypeName, float range, float healAmt)
      All units within dist of the selected ref object have their HPs adjusted by the given value.
    • trModifyProtounitAction

      public void trModifyProtounitAction(String unitTypeName, String protoUnitActionName, int playerID, int puField, float delta, int relativity)
      modifies proto unit action data for this scenario only.
    • trModifyProtounitData

      public void trModifyProtounitData(String unitTypeName, int playerID, int puField, float delta, int relativity)
      modifies proto unit data for this scenario only.
    • trModifyProtounitResource

      public void trModifyProtounitResource(String unitTypeName, String resource, int playerID, int puField, float delta, int relativity)
      modifies proto unit data taking a resource parameter for this scenario only.
    • trModifyProtounitUnitType

      public void trModifyProtounitUnitType(String unitTypeName, String trgUnitTypeName, int playerID, int puField, float delta, int relativity)
      modifies proto unit data taking a unit type parameter for this scenario only.
    • trModifyProtounitActionUnitType

      public void trModifyProtounitActionUnitType(String unitTypeName, String actionName, String unitType, int playerID, int puField, float delta, int relativity)
      modifies proto unit action data taking a unittype parameter for this scenario only.
    • trProtounitAssignAction

      public void trProtounitAssignAction(String unitTypeName, String protoUnitName, String actionName, int playerID)
      assigns an action from the provided proto unit to all units belonging to the given unittype for this scenario only.
    • trProtounitActionSpecialEffect

      public void trProtounitActionSpecialEffect(String unitTypeName, String actionName, int playerID, int effectField, String targetType, int dmgType, float duration, float value)
      modifies proto unit action data by adding a new or adjusting an existing onHitEffect for this scenario only.
    • trProtounitActionSpecialEffectProtoUnit

      public void trProtounitActionSpecialEffectProtoUnit(String unitTypeName, String actionName, int playerID, int effectField, String targetType, String protoUnit, float duration, float value)
      modifies proto unit action data by adding a new or adjusting an existing onHitEffect taking a protoUnit parameter for this scenario only.
    • trProtounitActionSpecialEffectDuration

      public void trProtounitActionSpecialEffectDuration(String unitTypeName, String protoUnitActionName, int playerID, int efectType, String targetType, int damageType, float delta, int relativity)
      modifies the duration of an existing onHitEffect within the given protoAction for this scenario only.
    • trProtounitActionSpecialEffectModifier

      public void trProtounitActionSpecialEffectModifier(String unitTypeName, String actionName, int playerID, int effectField, String targetType, float value, int modifyType, int dmgType)
      modifies proto unit action data by adding a new or adjusting an existing onHitEffect and assigning a new stat modifier to it for this scenario only.
    • trProtounitActionSpecialEffectActive

      public void trProtounitActionSpecialEffectActive(String unitTypeName, String actionName, int playerID, int effectField, String targetType, int dmgType, boolean active)
      modifies proto unit action data by setting a specified existing onHitEffect as active or inactive.
    • trProtoUnitMovementType

      public void trProtoUnitMovementType(String unitTypeName, int playerID, String movementType)
      modifies proto unit movement type for this scenario only.
    • trProtounitAddTrain

      public void trProtounitAddTrain(String protoUnitName, int playerID, String trainPUName, int row, int column)
      assigns a train entry towards the given protoUnit for this scenario only.
    • trProtounitAddTech

      public void trProtounitAddTech(String protoUnitName, int playerID, int techID, int row, int column)
      assigns a tech entry towards the given protoUnit for this scenario only.
    • trProtounitAddCommand

      public void trProtounitAddCommand(String protoUnitName, int playerID, String puCmdName, int row, int column)
      assigns a protoUnitCommand entry towards the given protoUnit for this scenario only.
    • trProtounitRemoveTrain

      public void trProtounitRemoveTrain(String protoUnitName, int playerID, String trainPUName)
      removes a train entry from the given protoUnit for this scenario only.
    • trProtounitRemoveTech

      public void trProtounitRemoveTech(String protoUnitName, int playerID, int techID)
      removes a tech entry from the given protoUnit for this scenario only.
    • trProtounitRemoveCommand

      public void trProtounitRemoveCommand(String protoUnitName, int playerID, String puCmdName)
      removes a protoUnitCommand entry from the given protoUnit for this scenario only.
    • trTechModifyResearchPoints

      public void trTechModifyResearchPoints(int techID, int playerID, float delta, int techRelativity)
      modifies the reseach points of the given technology for this scenario only.
    • trTechModifyCost

      public void trTechModifyCost(int techID, int playerID, int resourceID, float delta, int techRelativity)
      modifies the cost of the given technology for this scenario only.
    • trTechSetStringID

      public void trTechSetStringID(int techID, int playerID, String stringID, int techStringFieldIdx)
      sets a given string field of a technology to the given string ID for this scenario only.
    • trTechReplaceIconByTech

      public void trTechReplaceIconByTech(int techID, int playerID, int iconTechID)
      replaces the icon of a technology for this scenario only.
    • trTechSetIconPath

      public void trTechSetIconPath(int techID, int playerID, String iconPath)
      replaces the icon of a technology for this scenario only.
    • trTechHideEffects

      public void trTechHideEffects(int techID, int playerID, boolean display)
      sets whether or not effects should be hidden in the rollover for the given technology for this scenario only.
    • trLightingSetParamFloat

      public void trLightingSetParamFloat(int paramID, float value)
      sets the given floating point lighting set parameter to the provided value for this scenario only.
    • trLightingSetParamInt

      public void trLightingSetParamInt(int paramID, int value)
      sets the given integer lighting set parameter to the provided value for this scenario only.
    • trLightingSetParamBool

      public void trLightingSetParamBool(int paramID, boolean value)
      sets the given boolean lighting set parameter to the provided value for this scenario only.
    • trLightingSetParamColor

      public void trLightingSetParamColor(int paramID, int r, int g, int b)
      sets the given color lighting set parameter to the provided value for this scenario only.
    • trLightingSetParamColorAttr

      public void trLightingSetParamColorAttr(int paramID, float redAttr, float greenAttr, float blueAttr)
      sets the given color attribute lighting set parameter to the provided value for this scenario only.
    • trPlayerIsDefeatedOrResigned

      public boolean trPlayerIsDefeatedOrResigned(int playerID)
      returns true/false if the player has resigned or has been defeated.
    • trPlayerGetCivilization

      public boolean trPlayerGetCivilization(int playerID, String civilization)
      returns true/false if the player civilization matches the given parameter.
    • trHealUnitsPercentInArea

      public void trHealUnitsPercentInArea(int playerID, String unitTypeName, float range, float healPercent)
      All units within dist of the selected ref object have their HPs adjusted by the given factor.
    • trDamageUnitsPercentInArea

      public void trDamageUnitsPercentInArea(int playerID, String unitTypeName, float range, float healPercent)
      All units within dist of the selected ref object are damaged by the given factor.
    • trSocketIsEmpty

      public boolean trSocketIsEmpty(int unitID)
      Returns true if there isn't a fully-built building occupying the specified socket.
    • trUnitCreateFromSource

      public boolean trUnitCreateFromSource(String protoName, int srcUnitID, int trgUnitID, int playerID)
      creates a new unit.
    • trUnitSetConvertible

      public void trUnitSetConvertible(int playerID, boolean forbid)
      sets forbid conversion accordingly for the selected units towards the given player.
    • trSocketBuild

      public void trSocketBuild(int playerID, int socketID, String protoName)
      Auto-constructs a building over a given socket unit.
    • trPlayerModifyData

      public void trPlayerModifyData(int playerID, int dataField, int attribute, float delta, int relativity)
      modifies player data for this scenario only.
    • trPlayerTimeshiftModifyCost

      public void trPlayerTimeshiftModifyCost(int playerID, String protoName, float delta, int relativity)
      modifies timeshifting cost ratio for a given protoUnit for this scenario only.
    • trPlayerTimeshiftAddEntry

      public void trPlayerTimeshiftAddEntry(int playerID, String protoName, float costRatio, float timeRatio)
      adds a timeshifting entry towards the given protoUnit to a player for this scenario only.
    • trPlayerModifyResourceData

      public void trPlayerModifyResourceData(int playerID, int dataField, int resourceID, float delta, int relativity)
      modifies player data for this scenario only.
    • trUnitCreateFromSourceMulti

      public boolean trUnitCreateFromSourceMulti(String protoName, int srcUnitID, int trgUnitID, int playerID, int count)
      creates multiple units from a source object.
    • trObjectiveFailed

      public void trObjectiveFailed(int objectiveID, boolean playSound)
      Sets the specified objective as failed.
    • trObjectiveCreateMarker

      public void trObjectiveCreateMarker(int objectiveID, String name, Vector markerPos)
      DEPRECATED.
    • trObjectiveRemoveMarker

      public void trObjectiveRemoveMarker(int objectiveID, String name)
      DEPRECATED.
    • trForceShowObjectivePanel

      public void trForceShowObjectivePanel(boolean value)
      Forces the objective panel to always display.
    • trCameraStateView

      public void trCameraStateView(int id, int playerID)
      puts the camera in the location of a saved camera state, for the given player, or for all players, if no player is set.
    • trExecuteOnAI

      public boolean trExecuteOnAI(int playerID, String command)
      Executes a command on the AI player.
    • trTechRemove

      public void trTechRemove(int playerID, String protoUnitName, int techID)
      disables the given tech for the player, and removes it from the UI of the given protoUnit.
    • trGodPowerGrant

      public void trGodPowerGrant(int playerID, String protoPowerName, int numUses, int cooldown, boolean useCost, boolean repeatAtEnd)
      grants X uses of the specified God Power to the player.
    • trGodPowerGrantAtSlot

      public void trGodPowerGrantAtSlot(int playerID, String protoPowerName, int numUses, int position, int cooldown, boolean useCost, boolean repeatAtEnd)
      grants X uses of the specified god power in a specific God Power UI slot.
    • trGodPowerPrePurchase

      public boolean trGodPowerPrePurchase(int playerID, String protoPowerName, int numUses)
      pre-purchases X uses of the specified God Power to the player, if applicable.
    • trGodPowerInvoke

      public void trGodPowerInvoke(int playerID, String protoPowerName, Vector pos1, Vector pos2, boolean ignoreCooldown, boolean setAsQueued)
      invokes the specified God Power.
    • trPlayerKillAllGodPowers

      public void trPlayerKillAllGodPowers(int playerID)
      Kills all of the current God Powers of a player.
    • trPlayerTechTreeEnabledGodPowers

      public void trPlayerTechTreeEnabledGodPowers(int playerID, boolean bEnable)
      Enables/Disables the Tech Tree from granting God Powers to a player. Default=ON.
    • trGodPowerEnableBlocking

      public void trGodPowerEnableBlocking(boolean bEnable)
      Sets whether or not God Power blocking is enabled. Default=ON.
    • trGodPowerSetCost

      public void trGodPowerSetCost(int playerID, String protoPowerName, float initialCost, float repeatCost)
      sets the cost of the specified God Power for the given player.
    • trGodPowerSetUseCount

      public void trGodPowerSetUseCount(int playerID, String protoPowerName, int numUses)
      sets the number of charges of the specified God Power for the given player.
    • trGodPowerSetUsedTimes

      public void trGodPowerSetUsedTimes(int playerID, String protoPowerName, int numUses)
      overrides the number of timesthe specified God Power has been used.
    • trGodPowerSetCooldown

      public void trGodPowerSetCooldown(int playerID, String protoPowerName, int cooldown)
      sets the cooldown of the specified God Power for the given player.
    • trGodPowerRedefine

      public void trGodPowerRedefine(int playerID, String protoPowerName, String iconPath, String displayName, String rollover)
      replaces the icon, and display name and rollover strings of a power for the given player.
    • trUnitPlayerFakifyInArea

      public void trUnitPlayerFakifyInArea(int fakePlayerIndex, int srcPlayerID, String unitTypeName, float range)
      Sets all units within dist of the selected ref object as having the fake player with the specified index (0-7).
    • trUnitMoveFromAreaToUnit

      public boolean trUnitMoveFromAreaToUnit(int unitID, boolean bAttackMove, int playerID, String unitType, float radius)
      Moves all matching units near the selected unit(s) to the given target unit.
    • trPlayerSetName

      public void trPlayerSetName(int playerID, String name)
      Sets the displayed name for the given player.
    • trPlayerSetColor

      public void trPlayerSetColor(int playerID, int playerColorID, int r, int g, int b)
      Sets the player color for the given player.
    • trPlaceFoundation

      public int trPlaceFoundation(String protoName, float x, float y, float z, int heading, int playerID, float pctComplete)
      places a foundation for the given building and returns the ID of the foundation.
    • trSetFoundationComplete

      public boolean trSetFoundationComplete(int unitID, float pctComplete)
      Sets the build progress for an unfinished foundation to the specified percentage.
    • trSocketPlaceFoundation

      public int trSocketPlaceFoundation(int playerID, int socketID, String protoName)
      Places a foundation into this socket unit.
    • trUnitPatrolToPoint

      public boolean trUnitPatrolToPoint(float x, float y, float z, boolean bUnitRun, float runSpeedMultiplier)
      Moves the selected unit(s) to the given position.
    • trGodPowerInvokeAtArmy

      public boolean trGodPowerInvokeAtArmy(int powerPlayerID, String army, String protoPowerName, boolean ignoreCooldown, boolean setAsQueued)
      invokes the specified God Power at the specified army.
    • trGodPowerCancelAll

      public void trGodPowerCancelAll()
      cancels all active god powers.
    • trUnitSetHitpoints

      public void trUnitSetHitpoints(float value)
      set the units' hitpoints to the given value, respecting maximum hitpoints.
    • trArmyDispatchAtUnit

      public boolean trArmyDispatchAtUnit(String army, String protoname, int count, int trgUnitID, int heading, boolean clearExisting, boolean skipBirth)
      creates the units in the army specified at the location of the target unit.
    • trArmyDoWorkOnArmy

      public boolean trArmyDoWorkOnArmy(String srcArmy, String trgArmy, int eventID)
      Tasks the selected army to perform work on the first valid unit within the given arny.
    • trArmyAddUnitTypeInArea

      public boolean trArmyAddUnitTypeInArea(String srcArmy, String unitType, int centerUnit, float radius, boolean clearExisting)
      Assigns units of a unittype within the provided area to the given army.
    • trPlayerAllowStartingUnitsSpawning

      public void trPlayerAllowStartingUnitsSpawning(int playerID, boolean allowSpawning)
      Sets whether or not starting units will be spawned for the given player.
    • trPlayerAllowAgeUpSpawning

      public void trPlayerAllowAgeUpSpawning(int playerID, boolean allowSpawning)
      Sets whether or not units will be spawned through age-up techs.
    • trPlayerAllowBonusUnitSpawning

      public void trPlayerAllowBonusUnitSpawning(int playerID, boolean allowSpawning)
      Sets whether or not units will be spawned through bonus unit spawning mechanic.
    • trPlayerAllowShades

      public void trPlayerAllowShades(int playerID, boolean allow)
      Sets whether or not the given player will be allowed to spawn shades.
    • trPlayerEnablePartisans

      public void trPlayerEnablePartisans(int playerID, boolean allow)
      Sets whether or not partisan spawning will be enabled for the given player.
    • trPlayerEnableTimeshift

      public void trPlayerEnableTimeshift(int playerID, boolean allow)
      Sets whether or not timeshifting will be enabled for the given player.
    • trPlayerEnableBuildingChain

      public void trPlayerEnableBuildingChain(int playerID, boolean enable)
      Sets whether or not the Building Chain system will be enabled for the given player. Only functional if target player civilization has proper building chain data set up.
    • trProtoUnitSetUnitType

      public void trProtoUnitSetUnitType(int playerID, String unitTypeName, String unitTypeName2, boolean set)
      Sets or unsets the given unit type within the given protounit.
    • trUnitSetFlag

      public void trUnitSetFlag(int flagID, boolean set)
      Sets or unsets the provided flagID for the selected unitIDs. Valid flagIDs are cUnitFlag constants.
    • trProtoUnitSetFlag

      public void trProtoUnitSetFlag(int playerID, String srcUnitTypeName, String unitTypeName, boolean set)
      Sets or unsets the given flag within the given protounit.
    • trTownBellUnrung

      public boolean trTownBellUnrung(int unitID)
      returns true if town bell has been recently unrung on the given unit.
    • trTownBellRung

      public boolean trTownBellRung(int unitID)
      returns true if town bell has been recently rung on the given unit.
    • trArmyClear

      public void trArmyClear(String army)
      Clears the given army, removing all unit IDs from army data.
    • trUnitInLush

      public boolean trUnitInLush(int playerID)
      Returns true if all selected units are within terrain lush belonging to the given player.
    • trGenerateLush

      public void trGenerateLush()
      Generates lush for all selected buildings, if owning player supports lush generation.
    • trIsInBuildingChain

      public boolean trIsInBuildingChain(int unitID)
      Returns true if the given unit is a building connected to a valid building chain.
    • trQueueStartingUnits

      public void trQueueStartingUnits(int playerID)
      Queues starting units for player if they have a starting TC.
    • trChangeProtoUnitInArea

      public void trChangeProtoUnitInArea(int playerID, String unitTypeName, float range, String dstProtoName, boolean skipBirth)
      All units within dist of the selected ref object are changed into the given protoUnit.
    • trUnitCancelAllQueued

      public void trUnitCancelAllQueued(int unitID)
      Cancels all queued items for the unit.
    • trUnitReveal

      public void trUnitReveal(int playerID, boolean reveal)
      Reveals the currently selected units to the given player.
    • trUnitSetVeterancyRank

      public void trUnitSetVeterancyRank(int rank)
      Sets the veterancy level for the selected units to the given rank, whenever applicable.
    • trUnitImmobilized

      public boolean trUnitImmobilized()
      Returns true if all selected units are immobilized by a Freeze Action.
    • trGetWorldDifficulty

      public int trGetWorldDifficulty()
      Returns the world difficulty.
    • trUnitModifyResourceInventory

      public void trUnitModifyResourceInventory(int resourceID, float delta, int relativity)
      modifies resource inventory for the selected units.
    • trUnitAddModifier

      public void trUnitAddModifier(int modifyType, int dmgType, float amount, float duration)
      adds modifier for given modify type and parameter, when applicable, to selected units.
    • trUnitAdjustModifier

      public void trUnitAdjustModifier(int modifyType, int dmgType, float delta, int relativity)
      adjust existing modifier for given modify type and parameter, when applicable, to selected units.
    • trUnitSetShading

      public void trUnitSetShading(int shadingType, float opacity)
      assign the given shading type with the set opacity to the selected units.
    • trUnitRotateY

      public boolean trUnitRotateY(int degrees, boolean disableTying)
      rotates the selected units around the Y axis by the given amount of degrees.
    • trUnitRotateX

      public boolean trUnitRotateX(int degrees, boolean disableTying)
      rotates the selected units around the X axis by the given amount of degrees.
    • trUnitRotateZ

      public boolean trUnitRotateZ(int degrees, boolean disableTying)
      rotates the selected units around the Z axis by the given amount of degrees.
    • trUnitSetOrientationForward

      public boolean trUnitSetOrientationForward(int degrees, boolean disableTying)
      rotates the selected units around the Y axis by the given amount of degrees.
    • trUnitSetOrientationUp

      public boolean trUnitSetOrientationUp(int degrees, boolean disableTying)
      rotates the selected units around the X axis by the given amount of degrees.
    • trUnitSetOrientationRight

      public boolean trUnitSetOrientationRight(int degrees, boolean disableTying)
      rotates the selected units around the Z axis by the given amount of degrees.
    • trUnitReposition

      public boolean trUnitReposition(float x, float y, float z, boolean disableTying, boolean immediate)
      sets the position for the selected units to the given absolute coordinates.
    • trUnitRepositionToUnit

      public boolean trUnitRepositionToUnit(int unitID, boolean disableTying, boolean immediate)
      sets the position for the selected units to the coordinates of the given unit.
    • trUnitSetVariation

      public boolean trUnitSetVariation(int variation)
      sets the variation for the selected units to the given value.
    • trUnitMutate

      public void trUnitMutate(String protoName, boolean fullHitpoints)
      transforms selected units into the given protoUnit through PU mutation, maintaining original BUnit pointer.
    • trUnitPerformAction

      public void trUnitPerformAction(String actionName, int targetID, Vector targetPos, boolean bypassCharge)
      performs a given protoAction through the selected units.
    • trUnitApplyEffect

      public void trUnitApplyEffect(int effectID, float duration)
      applys a given effect towards the selected units.
    • trUnitApplyEffectDamage

      public void trUnitApplyEffectDamage(int effectID, float duration, float damage, int dmgType)
      applys a given effect with a damage value towards the selected units.
    • trUnitApplyEffectProtoUnit

      public void trUnitApplyEffectProtoUnit(int effectID, float duration, int playerID, String protoName)
      applys a given effect towards the selected units.
    • trUnitThrow

      public void trUnitThrow(int direction, float distance, int numBounces, float maxHeight, float maxVelocity, float spinPeriod)
      Throws the selected units with the provided parameters.
    • trMapMutateUnits

      public void trMapMutateUnits(String srcUnitType, String trgProtoName, boolean fullHitpoints)
      transforms all units on the map belonging to the given unit type into the set protoUnit through PU mutation, maintaining original BUnit pointer.
    • trPlayerMutateUnits

      public void trPlayerMutateUnits(int playerID, String srcUnitType, String trgProtoName, boolean fullHitpoints)
      transforms all units for a player belonging to the given unit type into the set protoUnit through PU mutation, maintaining original BUnit pointer.
    • trPlayerChangeProtoUnit

      public void trPlayerChangeProtoUnit(int playerID, String srcUnitType, String trgProtoName, boolean skipBirth, boolean forceFoundation)
      transforms all units for a player belonging to the given unit type into the set protoUnit. Does not use PU mutation, and does not maintain original BUnit data.
    • trPaintTerrain

      public void trPaintTerrain(int terrainType, int terrainSubtype, float minX, float minZ, float maxX, float maxZ, boolean updateObstructions)
      paints a rectangular area by the given terrain type and subtype.
    • trPaintTerrainBySubtypeName

      public void trPaintTerrainBySubtypeName(String subtypeName, float x0, float z0, float x1, float z1, boolean updateObstructions)
      paints a rectangular area by the terrain identified by the given terrain subtype UI name.
    • trPaintTerrainCircular

      public void trPaintTerrainCircular(int terrainType, int terrainSubtype, Vector center, float radius, boolean updateObstructions)
      paints a circular area by the given terrain type and subtype.
    • trPaintTerrainCircularBySubtypeName

      public void trPaintTerrainCircularBySubtypeName(String subtypeName, Vector center, float radius, boolean updateObstructions)
      paints a circular area by the terrain identified by the given terrain subtype UI name.
    • trPaintWater

      public void trPaintWater(int waterID, float minX, float minZ, float maxX, float maxZ, boolean circular, boolean updateObstructions)
      paints an area by the water entry identified by the given ID.
    • trPaintWaterRectangular

      public void trPaintWaterRectangular(String waterName, float x0, float z0, float x1, float z1, boolean updateObstructions)
      paints a rectangular area by the water entry identified by the given name.
    • trPaintWaterCircular

      public void trPaintWaterCircular(String waterName, Vector center, float radius, boolean updateObstructions)
      paints a circular area by the water entry identified by the given name.
    • trChangeTerrainHeight

      public void trChangeTerrainHeight(float x0, float z0, float x1, float z1, float height, boolean removeWater)
      sets the terrain elevation for the provided rectangular region.
    • trChangeTerrainHeightCircular

      public void trChangeTerrainHeightCircular(Vector center, float radius, float height, boolean removeWater)
      sets the terrain elevation for the provided circular region.
    • trGetTerrainType

      public int trGetTerrainType(Vector position)
      fetches the terrain type ID for the given map position.
    • trGetTerrainSubtype

      public int trGetTerrainSubtype(Vector position)
      fetches the terrain subtype ID for the given map position.
    • trTerrainAtPosition

      public boolean trTerrainAtPosition(String subTypeName, Vector position)
      checks if the terrain at the given map position matches the expected terrain subtype.
    • trGetWaterType

      public int trGetWaterType(Vector position)
      fetches the water type ID for the given map position.
    • trWaterAtPosition

      public boolean trWaterAtPosition(String waterTypeName, Vector position)
      checks if the water at the given map position matches the expected water type.
    • trGetTerrainHeight

      public float trGetTerrainHeight(Vector position)
      returns the terrain height at the given map position.
    • trPlayerSetCiv

      public void trPlayerSetCiv(int playerID, String civName)
      replaces the civilization for the given player.
    • trGetNextUnitID

      public int trGetNextUnitID()
      returns the ID for the next unit to be allocated.
    • trGetRecentUnits

      public int[] trGetRecentUnits()
      returns an array containing recently created units. If auto-resetting is set, returns units created on the last frame.
    • trResetRecentUnits

      public void trResetRecentUnits()
      resets list of recently-created units.
    • trSetAutoResetRecentUnits

      public void trSetAutoResetRecentUnits(boolean enable)
      sets whether or not the list of recently-created units should be reset at each frame. Set to true by default.
    • trPlayerSetScore

      public void trPlayerSetScore(int playerID, int score)
      overrides the score for a player by the given value.
    • trPlayerAdjustScore

      public void trPlayerAdjustScore(int playerID, int delta)
      adjust the overridden score value for a player by the given delta.
    • trDisableRule

      public void trDisableRule(String ruleName)
      tells the challenge system this rule was activated.
    • trGetSkyboxVariationID

      public int trGetSkyboxVariationID(String skyboxName)
      returns the variation ID for the given skybox.
    • trGetCurrentSkyboxUnitID

      public int trGetCurrentSkyboxUnitID()
      returns the unit ID for the current skybox, if applicable.
    • trRenderSky

      public void trRenderSky(boolean val, String skyName, int orientation, float height, boolean terrainHeight)
      Turn sky rendering on/off and set which sky to use.
    • trUnitNumberSelected

      public int trUnitNumberSelected()
      returns the current number of living units selected by the trigger manager.
    • trTeleportAreaUnitsToTargetArea

      public boolean trTeleportAreaUnitsToTargetArea(int playerID, String unitTypeName, int fromUnitID, float fromUnitRange, int targetUnitID, float targetUnitRange)
      teleport from unit to unit
    • trCounterAddVictory

      public void trCounterAddVictory(String name, int start, int stop, String message, int playerID, int eventID)
      start a counter for player victory, that may or may not fire an event.
    • trCounterAddVictoryMs

      public void trCounterAddVictoryMs(String name, int start, int stop, String message, int playerID, int eventID)
      start a counter for player victory, that may or may not fire an event.
    • trPlaceStartingUnits

      public void trPlaceStartingUnits(int playerID)
      place start units forall TCs instead of placing the first TC
    • trUnitSetShieldPoints

      public void trUnitSetShieldPoints(float value)
      set the units' shield points to the given value, respecting maximum shield points.
    • trUnitShieldPercentDamaged

      public float trUnitShieldPercentDamaged()
      returns the percent damaged for the selected unit's shield as 0 to 100
    • xsDisableRule

      public void xsDisableRule(String ruleName)
      Disables the given rule.
    • xsDisableSelf

      public void xsDisableSelf()
      Disables the current rule.
    • xsEnableRule

      public void xsEnableRule(String ruleName)
      Enables the given rule, sets the last execution time to current time.
    • xsIsRuleEnabled

      public boolean xsIsRuleEnabled(String ruleName)
      Returns true if the rule is enabled.
    • xsSetRulePriority

      public void xsSetRulePriority(String ruleName, int priority)
      Sets the priority of the given rule.
    • xsSetRulePrioritySelf

      public void xsSetRulePrioritySelf(int priority)
      Sets the priority of the current rule.
    • xsSetRuleMinInterval

      public void xsSetRuleMinInterval(String ruleName, int minInterval)
      Sets the min interval of the given rule, in seconds.
    • xsSetRuleMinIntervalMS

      public void xsSetRuleMinIntervalMS(String ruleName, int minIntervalMS)
      Sets the min interval of the given rule, in milliseconds.
    • xsSetRuleMinIntervalSelf

      public void xsSetRuleMinIntervalSelf(int minInterval)
      Sets the min interval of the current rule, in seconds.
    • xsSetRuleMinIntervalSelfMS

      public void xsSetRuleMinIntervalSelfMS(int minIntervalMS)
      Sets the min interval of the current rule, in milliseconds.
    • xsSetRuleMaxInterval

      public void xsSetRuleMaxInterval(String ruleName, int maxInterval)
      Sets the max interval of the given rule, in seconds.
    • xsSetRuleMaxIntervalMS

      public void xsSetRuleMaxIntervalMS(String ruleName, int maxIntervalMS)
      Sets the max interval of the given rule, in milliseconds.
    • xsSetRuleMaxIntervalSelf

      public void xsSetRuleMaxIntervalSelf(int maxInterval)
      Sets the max interval of the current rule, in seconds.
    • xsSetRuleMaxIntervalSelfMS

      public void xsSetRuleMaxIntervalSelfMS(int maxIntervalMS)
      Sets the max interval of the current rule, in milliseconds.
    • xsRuleIgnoreIntervalOnce

      public void xsRuleIgnoreIntervalOnce(String ruleName)
      Ignores the next interval and updates as soon as possible.
    • xsEnableRuleGroup

      public void xsEnableRuleGroup(String ruleGroupName)
      Enables all rule in the given rule group.
    • xsDisableRuleGroup

      public void xsDisableRuleGroup(String ruleGroupName)
      Disables all rules in the given rule group.
    • xsIsRuleGroupEnabled

      public boolean xsIsRuleGroupEnabled(String ruleGroupName)
      Returns true if any rule in the group is enabled.
    • xsRuleGroupIgnoreIntervalOnce

      public void xsRuleGroupIgnoreIntervalOnce(String ruleGroupName)
      Ignores the next interval and updates as soon as possible.
    • xsVectorCreate

      public Vector xsVectorCreate(float x, float y, float z)
      Set the 3 components into a vector, returns the new vector.
    • xsVectorLength

      public float xsVectorLength(Vector v)
      Returns the length of the given vector.
    • xsVectorNormalize

      public Vector xsVectorNormalize(Vector v)
      Returns a normalized copy of the given vector.
    • xsVectorDot

      public float xsVectorDot(Vector v, Vector other)
      Returns the dot product of two vectors.
    • xsVectorCross

      public Vector xsVectorCross(Vector v, Vector other)
      Returns the cross product of two vectors.
    • xsVectorDistance

      public float xsVectorDistance(Vector v, Vector other)
      Returns the distance between two vectors.
    • xsVectorDistanceSqr

      public float xsVectorDistanceSqr(Vector v, Vector other)
      Returns the squared distance between two vectors.
    • xsVectorDistanceXZ

      public float xsVectorDistanceXZ(Vector v, Vector other)
      Returns the distance between two vectors without considering the Y dimension.
    • xsVectorDistanceXZSqr

      public float xsVectorDistanceXZSqr(Vector v, Vector other)
      Returns the squared distance between two vectors without considering the Y dimension.
    • xsVectorDistanceToLine

      public float xsVectorDistanceToLine(Vector v, Vector pointOnLine, Vector dir)
      Returns the distance between a point and a line defined by a point on the line and a direction.
    • xsVectorDistanceToLineSegment

      public float xsVectorDistanceToLineSegment(Vector v, Vector p1, Vector p2)
      Returns the distance between a point and a line defined by two points.
    • xsVectorAngleBetweenVector

      public float xsVectorAngleBetweenVector(Vector v, Vector other)
      Returns the (smaller) angle between two vectors in radians.
    • xsVectorAngleAroundY

      public float xsVectorAngleAroundY(Vector v, Vector offset)
      Returns the angle of a vector around the Y axis in radians. If provided, the offset is used as the center (instead of 0.0/0.0).
    • xsVectorRotateXZ

      public Vector xsVectorRotateXZ(Vector v, float theta, Vector offset)
      Returns a rotated copy of the vector on the XZ plane by a given angle. If provided, the offset is used as the center (instead of 0.0/0.0).
    • xsVectorTranslateXZ

      public Vector xsVectorTranslateXZ(Vector v, float radius, float theta)
      Returns a translated copy of the vector on the XZ plane by the given radius and angle.
    • xsGetContextPlayer

      public int xsGetContextPlayer()
      Returns the current context player ID.
    • xsSetContextPlayer

      public void xsSetContextPlayer(int playerID)
      Sets the current context player ID (DO NOT DO THIS IF YOU DO NOT KNOW WHAT YOU ARE DOING).
    • xsGetTime

      public int xsGetTime()
      Returns the current gametime (in seconds).
    • xsGetTimeMS

      public int xsGetTimeMS()
      Returns the current gametime (in milliseconds).
    • xsStartTimer

      public void xsStartTimer()
      Starts the timer.
    • xsEchoTimerMS

      public void xsEchoTimerMS()
      Prints the time in milliseconds that elapsed since the timer was last started.
    • abs

      public float abs(float x)
      Returns the absolute value of x as a float.
    • round

      public float round(float x)
      Rounds x to the nearest integer and returns it as a float.
    • clamp

      public float clamp(float val, float minVal, float maxVal)
      Clamps a value to the provided interval.
    • min

      public float min(float a, float b)
      Returns the smaller of the two values as a float.
    • max

      public float max(float a, float b)
      Returns the larger of the two values as a float.
    • floor

      public float floor(float x)
      Rounds x down to the next lower integer and returns it as a float.
    • ceil

      public float ceil(float x)
      Rounds x up to the next higher integer and returns it as a float.
    • sqrt

      public float sqrt(float x)
      Returns the square root of x.
    • pow

      public float pow(float x, float y)
      Returns the y-th power of x (x^y).
    • log

      public float log(float x)
      Returns the natural logarithm of x.
    • log2

      public float log2(float x)
      Returns the binary logarithm of x.
    • log10

      public float log10(float x)
      Returns the common logarithm of x.
    • sin

      public float sin(float x)
      Returns the sine of x.
    • cos

      public float cos(float x)
      Returns the cosine of .
    • tan

      public float tan(float x)
      Returns the tangent of x.
    • asin

      public float asin(float x)
      Returns the arcsine of x.
    • acos

      public float acos(float x)
      Returns the arccosine of x.
    • atan

      public float atan(float x)
      Returns the arctangent of x.
    • atan2

      public float atan2(float y, float x)
      Returns the 2-argument arctangent.
    • hypot

      public float hypot(float x, float y)
      Returns the hypothenuse between x and y (i.e., sqrt(x^2 + y^2)).
    • sgn

      public int sgn(float x)
      Returns the signum of x as an integer (1 if x > 0, -1 if x < 0, or 0 if x == 0).
    • degToRad

      public float degToRad(float degrees)
      Converts an angle from degrees to radians.
    • radToDeg

      public float radToDeg(float radians)
      Converts an angle from radians to degrees.
    • xsRandSetSeed

      public void xsRandSetSeed(int seed)
      Sets the seed of the random number generator.
    • xsRandGetSeed

      public int xsRandGetSeed()
      Gets the current seed of the random number generator.
    • xsRandInt

      public int xsRandInt(int min, int max)
      Returns a random integer number in the range (inclusive).
    • xsRandFloat

      public float xsRandFloat(float min, float max)
      Returns a random floating point number in the range (inclusive).
    • xsRandBool

      public boolean xsRandBool(float chanceTrue)
      Returns true with a probability of trueChance in [0.0, 1.0], and false otherwise.
    • xsIntToFloat

      public float xsIntToFloat(int i)
      Casts an int to a float.
    • xsIntToBool

      public boolean xsIntToBool(int i)
      Casts an int to a bool (false if == 0, true otherwise).
    • xsIntToString

      public String xsIntToString(int i)
      Casts an int to a string.
    • xsFloatToInt

      public int xsFloatToInt(float f)
      Casts a float to an int, truncating the fractional part.
    • xsFloatToBool

      public boolean xsFloatToBool(float f)
      Casts a float to a bool (false if == 0.0, true otherwise).
    • xsFloatToString

      public String xsFloatToString(float f)
      Casts a float to a string.
    • xsBoolToInt

      public int xsBoolToInt(boolean b)
      Casts a bool to an int (1 if true, 0 if false).
    • xsBoolToFloat

      public float xsBoolToFloat(boolean b)
      Casts a bool to a float (1.0 if true, 0.0 if false).
    • xsBoolToString

      public String xsBoolToString(boolean b)
      Casts a bool to a string.
    • xsStringToInt

      public int xsStringToInt(String s)
      Parses an integer from a string(returning 0 on invalid input).
    • xsStringToFloat

      public float xsStringToFloat(String s)
      Parses a float from a string(returning 0.0 on invalid input).
    • xsStringToBool

      public boolean xsStringToBool(String s)
      Parses a bool from a string(returning false on invalid input).
    • xsStringLength

      public int xsStringLength(String s)
      Returns the length of a string.
    • xsStringCharAt

      public String xsStringCharAt(String s, int index)
      Returns the character at the given index of a string as a string(or an empty string on invalid index).
    • xsStringFindFirst

      public int xsStringFindFirst(String s, String sub, int startIdx, boolean caseSensitive)
      Returns the index of the first occurrence of a string in another string, searching from the given index. Returns -1 if the substring is not found.
    • xsStringFindLast

      public int xsStringFindLast(String s, String sub, int startIdx, boolean caseSensitive)
      Returns the index of the last occurrence of a string in another string, searching backwards from the given index. Returns -1 if the substring is not found.
    • xsStringContains

      public boolean xsStringContains(String s, String sub, boolean caseSensitive)
      Returns true if the given substring is present in the string, and false otherwise.
    • xsStringStartsWith

      public boolean xsStringStartsWith(String s, String sub, boolean caseSensitive)
      Returns true if the string starts with the given substring, and false otherwise.
    • xsStringEndsWith

      public boolean xsStringEndsWith(String s, String sub, boolean caseSensitive)
      Returns true if the string ends with the given substring, and false otherwise.
    • xsStringSubstring

      public String xsStringSubstring(String s, int startIdx, int endIdx)
      Returns a substring in the range of the given indices (inclusive) for a string.
    • xsStringToLower

      public String xsStringToLower(String s)
      Returns a string in lower case.
    • xsStringToUpper

      public String xsStringToUpper(String s)
      Returns a string in upper case.