| Abort
|
void
|
|
Causes the current message to not be displayed
|
|
| Accept
|
void
|
|
Accepts the diplomatic request associated with this message
|
|
| AcceptTradeBid
|
void
|
|
Accepts the trade bid associated with this message
|
|
| AcceptTradeOffer
(index)
|
void
|
|
Accept a trade offer
|
|
| AddBuildingToBuildList
(city, buildingtype)
|
void
|
|
Add the building type to the end of the city's queue
|
|
| AddCenter
(location|unit|city|army)
|
void
|
|
Add a recenter event on location to the animation queue
|
Apolyton-thread
|
| AddCity
(builtinwithcity)
|
void
|
|
Adds a city to the current context in which no reference to the city has yet been made.
|
|
| AddCityByIndex
(owner, index)
|
void
|
|
Adds the player's nth city to the context
|
|
| AddEffect
(location, namestr, soundid)
|
void
|
|
Add a special effect at location to the animation queue. namestr is the name from speceffid.txt (E.G. "SPECEFFECT_NUKE"), soundid is the ID from sounds.txt (E.G. "SOUND_D_DEFAULTDEATH").
|
|
| AddEndgameToBuildList
(city, endgame)
|
void
|
|
Add the endgame object to the end of the city's queue
|
|
| AddExpelOrder
(unit, location)
|
void
|
|
Tells the unit to expel another unit at the given location
|
|
| AddFeat
(player, feature)
|
void
|
|
Gives the player the specified feature
|
|
| AddGold
(player, amount)
|
void
|
|
Give amount gold to player. Negative amounts subtract gold
|
|
| AddGoods
(city)
|
void
|
|
Add all the goods in the city's radius to the context
|
|
| AddMessage
|
void
|
|
?
|
|
| AddMovement
(unit, amount)
|
void
|
|
Give unit an additional amount movement points
|
|
| AddOrder
(unit, location)
|
void
|
|
Tell the given unit to execute the order that was previously set in the context
|
|
| AddPops
(city, count)
|
int
|
|
Increase the population of the given city by count
|
|
| AddPW
(int_player, int_amount)
|
void
|
|
Gives int_amount PW to int_player
|
|
| AddSlaves
(city, number, player_victim)
|
void
|
|
Takes number citizens from player_vitim's cities and gives them as slaves to city?
|
|
| AddUnit
(unit)
|
void
|
|
Add a unit to the context
|
|
| AddUnitToBuildList
(city, unittype)
|
void
|
|
Add the unit type to the end of the city's queue
|
Apolyton-thread
|
| AddWonderToBuildList
(city, wonder)
|
void
|
|
Add the wonder type to the end of the city's queue
|
|
| AllUnitsCanBeExpelled
(location)
|
int
|
|
Returns true if all of the units at the location can be expelled
|
|
| ArmyIsValid
(army)
|
int
|
|
Returns true if the army is valid
|
|
| AttachRobot
(index)
|
void
|
|
Cause the given player to be taken over by an AI player
|
Apolyton-thread
|
| Attract
(ldlname)
|
void
|
|
Draw a highlight box around the named UI component
|
|
| AtWarCount
(player)
|
int
|
|
Returns the number of civs that player is at war with
|
|
| AtWarWith
(player1, player2)
|
int
|
|
Returns 1 if war has been declared between player 1 and player 2, 0 otherwise
|
|
| BlankScreen
(blank)
|
void
|
|
If blank is non-zero, set the screen to blacked out, otherwise turn it back on
|
|
| BreakAgreement
(agreement_index)
|
void
|
|
Break a diplomatic agreement which is set in the context - obviously unimplemented in CTP2 AE
|
|
| BreakAlliance
(player)
|
void
|
|
Break an alliance between the current player and the specified player
|
|
| BreakLeaveOurLands
|
void
|
|
Break a stop trespassing agreement between player.1 and player.2
|
|
| BreakNoPiracy
|
void
|
|
Break a no piracy agreement between player.1 and player.2
|
|
| BuildingType
(building)
|
int
|
|
Return the building database index of the named building
|
|
| CanBuySurplus
(???player???)
|
|
|
Mysterious and undocumented function of CTP2 that could not be (re-)implemented in CTP2 AE
|
|
| CancelAgreement
(player1, player2, int-agreement)
|
int
|
|
Same as break agreement?
|
|
| CanFormAlliance
(player, foreigner)
|
int
|
|
Returns 1 if player and foreigner can form an alliance, else 0
|
|
| CantAttackCity
(city, onoff)
|
void
|
|
Make the specified city immune to attack/capture if onoff is not 0, set it back to normal if 0
|
Apolyton-thread
|
| CantAttackUnit
(unit, onoff)
|
void
|
|
Make the specified unit immune to attack if onoff is not 0, set it back to normal if 0
|
|
| CantEndTurn
(onoff)
|
void
|
|
When onoff is 1, set the game in a mode where you cannot end the turn. Calling with onoff to 0 sets things back to normal
|
|
| Caption
(caption)
|
void
|
|
Unimplemented according to the original documentation
|
|
| CaptureCity
(player, city)
|
void
|
|
Unimplemented according to the original documentation - seems to be supposed to increase the player's strategic preference toward capturing the specified city
|
|
| CaptureRegion
(player, region)
|
void
|
|
Unimplemented according to the original documentation - seems to be supposed to increase the player's strategic preference toward capturing the specified region, whatever a region might be
|
|
| CargoCapacity
(unit)
|
int
|
|
Returns the number of additional units the unit can carry
|
|
| CargoSize
(unit)
|
int
|
|
Returns the current number of units the unit is carrying
|
|
| CatchUp
|
void
|
|
Cause the graphics system to synchronize with the game's internal state (fast forward unit moves, for example)
|
|
| CellOwner
(location)
|
int
|
|
Returns the no. of the player who owns the cell, -1 if none does
|
|
| ChangeDiplomaticState
(player1, player2)
|
void
|
|
Actually changes diplomatic state according to consideration (ConsiderDiplomaticState)
|
|
| ChangeGlobalRegard
(player, delta, explain_id[, duration])
|
void
|
|
Change the players global regard by delta
|
|
| ChangeRegardLevel
(player1, (delta)level, player2)
|
void
|
|
Unimplemented according to the original documentation - supposed to change player 1's regard level toward player 2 by (delta)level
|
|
| Cities
(player)
|
int
|
|
Returns the number of cities the player has
|
|
| CitiesRank
(player)
|
int
|
|
Returns the ranking of the player by number of cities (1 being the highest)
|
|
| CityCantRiotOrRevolt
(city, onoff)
|
void
|
|
Make the specified city immune to riots and revolts if onoff is not 0, set it back to normal if 0
|
|
| CityCollectingGood
(city, good)
|
int
|
|
Returns the amount of a particular good being collected in the city
|
|
| CityFoodDelta
(city)
|
int
|
|
Returns the city's net food
|
|
| CityHasBuilding
(city, building)
|
int
|
|
Returns true if the city has a building of the given type
|
|
| CityHasWonder
(city, wonder-int)
|
int
|
|
Returns true if the city has the wonder indexed according to WonderDB
|
|
| CityIsNamed
(city, string)
|
int
|
|
Returns true if the city is named string
|
|
| CityIsValid
(cityvar)
|
int
|
|
Returns true if the city is valid
|
|
| CityNameCompare
(city, string_id)
|
int
|
|
Returns true if the city's name equals the string identified by string_id (e.g. BARBARIAN_CITY_1)
|
|
| CityStarvationTurns
(city)
|
int
|
|
If the city is starving, returns the int number of turns before a city begins to lose population
|
|
| CivilizationIndex
(civname)
|
int
|
|
Return the database index for the named civilization.
|
|
| ClearBattleFlag
(unit)
|
void
|
|
Resets the unit's move points and allows the unit to engage in a battle again during the current turn
|
|
| ClearBuildQueue
(city)
|
void
|
|
Remove all items from the build queue of the given city
|
|
| ClearOrders
(unit)
|
void
|
|
Clear the unit's army's orders
|
|
| ComputeCurrentStrategy
(player)
|
void
|
|
Probably forces the AI to update their strategic state by computing all strategic input (goals, priorities) given before ...
|
|
| ConsiderDiplomaticState
(player1, player2, priority, diplostate, spystr_id, advicestr_id, newsstr_id)
|
void
|
|
Player 1 considers his diplomatic state towards player 2 from DiplomacyDB-index with given priority
|
|
| ConsiderMotivation
(player, priority, type[, player|unit|advance])
|
void
|
|
Makes the player consider a motivation with given priority - type is a MOTIVATION_TYPE (valid values: see source). Certain MOTIVATION_TYPEs require additional parameters: player, advance or unit.
|
|
| ConsiderNewProposal
(player1, player2, priority, first_type, second_type, strid1, strid2, strid3)
|
void
|
|
Makes first player consider sending a proposal of the given type with the given priority to second player - additional parameters may be needed depending on proposal type
|
|
| ConsiderResponse
(player1, player2, priority, response_type[, optional_parameters_see_source])
|
void
|
|
Makes player 1 consider the response indicated by type with the given priority - optional parameters allow for adding of counter proposals or threats
|
|
| ConsiderStrategicState
(player, priority, strategy)
|
void
|
|
Player considers a strategy from StrategyDB with given priority
|
|
| ControlsRegion
(player, ID-region)
|
int
|
|
Returns true if the given player is the only player who owns tiles in the region (not necessarily all the tiles in the region)
|
Apolyton-thread
Apolyton-thread
|
| CreateBuilding
(city, building)
|
void
|
|
Creates a building of the specified type in the city.
|
|
| CreateCity
(owner, nearlocation, distance[, savecity])
|
int
|
|
Create a city belonging to owner, at approximately distance tiles away from nearlocation
|
|
| CreateCoastalCity
(owner, nearlocation, distance[, savecity])
|
int
|
|
Same as CreateCity, but always finds a square next to ocean
|
|
| CreateUnit
(owner, type, nearlocation, distance[, saveunit])
|
void
|
|
Create a unit of the given type belonging to owner approximately distance tiles from nearlocation
|
|
| CreateWonder
(city, wonder)
|
void
|
|
Creates a wonder of the specified type in the city.
|
|
| DamageUnit
(unit, hp)
|
void
|
|
Subtract hp hit points from unit
|
|
| DeactivateTutorial
|
void
|
|
Turn off the tutorial
|
|
| DeclareWar
(player, foreigner)
|
void
|
|
Player declares war upon foreigner
|
|
| DemandWarFromAllies
(demandingplayer, againstplayer)
|
void
|
|
Send a diplomatic request demanding that all allies of demanding player declare war on againstplayer
|
|
| Deselect
|
void
|
|
Cause the currently selected unit/city/resource to be deselected
|
|
| DestroyBuilding
(city, building-int)
|
int
|
|
Destroys the specified building in the specified city
|
|
| DetachRobot
(index)
|
void
|
|
Turn the AI off for the given player
|
Apolyton-thread
|
| DisableChooseResearch
|
void
|
|
Disables the choose research dialog when the advance being researched is acquired
|
|
| DisableClose
|
void
|
|
Disallow closing this message from the UI
|
|
| DisableMessageClass
(class)
|
void
|
|
Cause all messages of the given class to not be displayed
|
|
| DisableScreensButton
|
void
|
|
Disable the screens button - obviously unimplemented in CTP2 AE
|
|
| DisableTileImprovementButton
|
void
|
|
Disable the tile improvements button - obviously unimplemented in CTP2 AE
|
|
| DisableTrigger
('trigger_id')
|
void
|
|
Disables the named trigger
|
|
| Distance
(location1, location2)
|
int
|
|
Returns the distance between location1 and location2
|
|
| DoAutoUnload
|
void
|
|
Do not use this - according to the original documentation
|
|
| DoCannotAffordMaintenance
|
void
|
|
Does nothing
|
|
| DoCannotAffordSupport
|
void
|
|
Does nothing
|
|
| DoCertainRevolution
|
void
|
|
Does nothing
|
|
| DoCityWillStarve
|
void
|
|
Does nothing
|
|
| DoFreeSlaves
(city)
|
void
|
|
Frees the slaves in city
|
|
| DoLandInOcean
|
void
|
|
Does nothing
|
|
| DontAcceptTradeOffer
(index)
|
void
|
|
Reject a trade offer
|
|
| DontSave
|
void
|
|
After the message is closed, it will not be saved in the Message Log
|
|
| DoOutOfFuel
|
void
|
|
Does nothing
|
|
| DoPillageOwnLand
(unit)
|
void
|
|
Pillages the unit’s current square, even if it belongs to the unit’s owner
|
|
| DoSellImprovement
|
void
|
|
Does nothing
|
|
| DoYouWillBreakRoute
|
void
|
|
Does nothing
|
|
| Duration
(turns)
|
void
|
|
Kill this message automatically in n turns
|
|
| EffectiveAtWarCount
(player)
|
int
|
|
Returns the number of civs that player is effectively at war with (effective regard < 100 = HOTWAR_REGARD)
|
|
| EffectiveWarWith
(player1, player2)
|
int
|
|
Returns 1 if first player is effectively at war with second player (effective regard < 100 = HOTWAR_REGARD)
|
|
| EnableChooseResearch
|
void
|
|
Reenables the choose research dialog
|
|
| EnableCloseClass
(player, class)
|
void
|
|
Enable closing of all messages belonging to class, if it was disabled previously
|
|
| EnableCloseMessage
(player, messagename)
|
void
|
|
Enable closing of all messages from the named object
|
|
| EnableMessageClass
(class)
|
void
|
|
Enable messages belonging to class
|
|
| EnableScreensButton
|
void
|
|
Enable the screens button - obviously unimplemented in CTP2 AE
|
|
| EnableTileImprovementButton
|
void
|
|
Enable the tile improvements button - obviously unimplemented in CTP2 AE
|
|
| EnableTrigger
('trigger_id')
|
void
|
|
Enables the named trigger
|
|
| EndTurn
|
void
|
|
Ends this turn
|
|
| ExecuteAllOrders
|
void
|
|
Cause all units to execute queued up orders
|
|
| ExitToDesktop
|
void
|
|
Does what it says
|
|
| ExitToShell
|
void
|
|
Exits to the main screen
|
|
| Export
(filename)
|
void
|
|
Exports a mapfile
|
|
| ExtractLocation
(location, locationvar)
|
void
|
|
Get a location from built in variable and put it in locationvar
|
|
| EyeDropdown
(starting index, builtin variable with list)
|
void
|
|
Put a dropdown box on the message
|
|
| EyePoint
(location|unit|city[, player, messageid])
|
void
|
|
Put an eyepoint on the message.
|
|
| FindCityToExtortFrom
(player, foreigner, max_value, cityvar)
|
int
|
|
unimplemented
|
|
| FindCoastalCity
(player, cityvar)
|
int
|
|
Find a city next to the ocean and put it in cityvar
|
|
| FinishBuilding
(city)
|
void
|
|
Finish building a settler that was stopped because building it will disband the city
|
|
| FinishImprovements
(location)
|
void
|
|
Immediately finish all improvements at the location
|
|
| Flood
(stage)
|
void
|
|
Causes a flood (global warming)
|
|
| ForceRegard
(ofPlayer, forPlayer, toRegard)
|
void
|
|
Force the regard ofPlayer forPlayer toRegard - obviously unimplemented in CTP2 AE
|
|
| ForceTurnDisplay
|
void
|
|
Changes the turn display to number of turns
|
|
| FreeAllSlaves
|
void
|
|
Frees a city's slaves
|
|
| GameOver
(player, reason)
|
int
|
|
End the game for the given player
|
|
| GeographicRank
(player)
|
int
|
|
The rank of the player according to how much land they own, 1 being the most
|
|
| GetAdvanceLevelPercent
(player, foreigner)
|
int
|
|
Returns player's advance level (number of advances he's researched) as a percentage of foreigner's
|
|
| GetAgreementDuration
(player1, player2, int-agreement)
|
int
|
|
Returns the number of turns the first player has had this agreement with the second
|
|
| GetArmyByIndex
(int-player, int-index, armyvar)
|
int
|
|
Returns true if the indexed army of the given player exists and stores it into armyvar
|
|
| GetArmyFromUnit
(unit, armyvar)
|
void
|
|
Finds the army which contains the unit and saves it into armyvar
|
|
| GetAtRiskCitiesValue
(player, foreigner)
|
int
|
|
Returns a number that represents the percentage of player's total value that is threatened by foreigner
|
|
| GetBioWeaponsCount
(player)
|
int
|
|
Returns the number of BioWeapons that player owns
|
|
| GetBorderIncursionBy
(player1, player2)
|
int
|
|
Returns 1 if second player is trespassing on first player
|
|
| GetCityByIndex
(player-int, index-int, cityvar)
|
int
|
|
Returns true if the indexed city of the given player exists and stores it into cityvar
|
|
| GetCityByLocation
(location, cityvar)
|
int
|
|
Returns true if there is a city at the given location and stores it in cityvar
|
|
| GetContinent
(location)
|
int
|
|
Returns the continent ID of the location
|
Apolyton-thread
|
| GetContinentSize
(location)
|
int
|
|
Returns the size of the location's continent, the size of the ocean if it's a water tile
|
|
| GetCounterProposalResult
(sender, receiver, player, type)
|
int
|
|
Like GetNewProposalResult
|
|
| GetCurrentPollutionLevel
|
int
|
|
Returns the current global pollution level
|
|
| GetCurrentRound
|
int
|
|
Returns the current round
|
|
| GetCurrentYear
|
|
|
Returns the current year
|
|
| GetDesiredAdvanceFrom
(player, foreigner, min_cost, max_cost)
|
int
|
|
Returns the AdvanceDB index of the advance player would desire most to buy from foreigner at a price from min_cost up to max_cost ??
|
|
| GetDesireWarWith
(player, foreigner)
|
int
|
|
Returns 1 if player desires war with foreigner, else 0
|
|
| GetEffectiveRegard
(player1, player2)
|
int
|
|
Returns regard adjusted for being at war (how much does first player like second player)
|
|
| GetEmbargo
(player, foreigner)
|
int
|
|
Returns 1 if foreigner has an embargo on player, else 0 (or -1 if no contact ?)
|
|
| GetGoldSurplusPercent
(player)
|
int
|
|
Returns player's current savings as a percentage of what he spends (so >100)
|
|
| GetLastBorderIncursion
(player, foreigner)
|
int
|
|
Returns the turn that foreigner last trespassed on player
|
|
| GetLastColdwarAttack
(player1, player2)
|
int
|
|
Returns the number of turns since second player last coldwar attacked (goals with coldenemy target?) first player (9999 if never)
|
|
| GetLastCounterResponseArg
|
|
|
unimplemented
|
|
| GetLastCounterResponseType
(player, foreigner, first/secondtype)
|
int
|
|
The returned INT is the NewProposalDB index
|
|
| GetLastHotwarAttack
(player1, player2)
|
int
|
|
Returns the number of turns since second player last hotwar attacked (goals with hotenemy target?) first player (9999 if never)
|
|
| GetLastNewProposalArg
|
|
|
unimplemented
|
|
| GetLastNewProposalTone
(player, foreigner)
|
int
|
|
Returns 0 = Magnanimous/Kind, 1 = Friendly/Equal, 2 = Obsequious/Meek, 3 = Naughty/Indignant, 4 = Hostile/Angry
|
|
| GetLastNewProposalType
(player, foreigner, first/second_type)
|
int
|
|
The returned INT is the NewProposalDB index
|
|
| GetLastResponseType
(player, foreigner)
|
int
|
|
Returns 0 = RESPONSE_INVALID, 1 = RESPONSE_REJECT, 2 = RESPONSE_ACCEPT, 3 = RESPONSE_COUNTER, 4 = RESPONSE_THREATEN
|
|
| GetLastThreatResponseArg
|
|
|
unimplemented
|
|
| GetLastThreatResponseType
(player, foreigner)
|
int
|
|
Returns: 1 = THREAT_DESTROY_CITY, 2 = THREAT_TRADE_EMBARGO, 3 = THREAT_DECLARE_WAR
|
|
| GetMapHeight
|
int
|
|
Returns the map height (no. of tiles)
|
|
| GetMapWidth
|
int
|
|
Returns the map width (no. of tiles)
|
|
| GetMessageClass
(player, index)
|
void
|
|
Get the class of message #index belonging to player
|
|
| GetMostAtRiskCity
(player, foreigner, cityvar)
|
int
|
|
Stores the player's most at risk city into cityvar
|
|
| GetNanoWeaponsCount
(player)
|
int
|
|
Returns the number of NanoWeapons that player owns
|
|
| GetNearestWater
(location, locationvar)
|
void
|
|
Get the location of the nearest ocean square to location, putting the result in locationvar
|
Apolyton-thread
|
| GetNeighbor
(locationIn, direction, locationOut)
|
int
|
|
Given the location variable locationIn, fill in the location of it's neighbor in the specified direction in locationOut
|
|
| GetNewProposalPriority
(player, foreigner, proposal-int)
|
int
|
|
Returns the priority for the proposal as determined by the current diplomactic state that player takes toward foreigner
|
|
| GetNewProposalResult
(sender, receiver, player, type)
|
int
|
|
|
|
| GetNextAdvance
(player)
|
int
|
|
Returns the AdvanceDB index of the first advance from the player's AdvanceList_XXX that the player has not yet researched
|
|
| GetNuclearLaunchTarget
(player)
|
int
|
|
Returns the player index of the civ we'd most like to nuke
|
|
| GetNuclearWeaponsCount
(player)
|
int
|
|
Returns the number of NuclearWeapons that player owns
|
|
| GetPersonalityType
(player-int[, personalitytype_int])
|
int
|
|
Returns the personalityDB index of the player's leader
|
|
| GetPiracyIncomeFrom
(player, foreigner)
|
int
|
|
Returns the amount of piracy income that player gets from foreigner
|
|
| GetPollutionLevelPromisedTo
|
|
|
unimplemented
|
|
| GetProjectedScience
(player|city)
|
int
|
|
???
|
|
| GetPublicRegard
(int_player1, int_player2, int_type)
|
int
|
|
Returns player1's public regard toward player2 - the last int is a REGARD_EVENT_TYPE, use REGARD_EVENT_ALL = 7 to get total regard
|
|
| GetRandomNeighbor
(location, newlocation)
|
void
|
|
Get a random square adjacent to location and put it in newlocation
|
|
| GetRelativeStrength
(player1, player2)
|
int
|
|
Returns player1's strength compared to player2 as displayed in the diplomacy manager
|
|
| GetRevolutionLevel
|
int
|
|
Returns the REVOLUTION_LEVEL set in const.txt
|
|
| GetRiotLevel
|
int
|
|
Returns the RIOT_LEVEL set in const.txt
|
|
| GetRoundsToNextDisaster
|
int
|
|
Returns the no. of turns to the next ozone or flood event given the current global pollution-level
|
|
| GetStopResearchingAdvance
(player, foreigner)
|
int
|
|
Returns the stop advance database index, -1 if there is no such advance for whatever reason
|
|
| GetStoredProduction
(city)
|
int
|
|
Returns how much production a city has stored towards building something.
|
|
| GetStringDBIndex
(stringid)
|
void
|
|
Get an integer string id for the named string ID
|
|
| GetTotalValue
(player)
|
int
|
|
Returns the total value (whatever that is) of the player's cities
|
|
| GetTradeFrom
(player1, player2)
|
int
|
|
Returns how much trade (in gold) player 1 got from player 2
|
|
| GetTributeFrom
(player1, player2)
|
void
|
|
Returns how much tribute (in gold) player 1 got from player 2
|
|
| GetTrust
(player1, player2)
|
int
|
|
Returns how much does first player trust second player
|
|
| GetUnitByIndex
(int-player, int-index, unitvar)
|
int
|
|
Returns true if the indexed unit of the given player exists and stores it into unitvar
|
|
| GetUnitFromArmy
(army, int-index, unitvar)
|
int
|
|
Returns true if the army contains a unit given by index (from 0 up to number of units in the army - 1) and stores it into unitvar
|
|
| GetUnitFromCargo
(unit_1, int, unit_2)
|
int
|
|
Returns true if unit_1's int'th cargo unit exists and stores it into unit_2?
|
|
| GetUnitFromCell
(location, int-index, unitvar)
|
int
|
|
Returns true if there is a unit given by index (from 0 up to number of units in the cell -1) at the given location and stores it into unitvar
|
|
| GetUnitsAtLocation
(location)
|
int
|
|
Returns the number of units at the given location
|
|
| GodMode
(onoff)
|
void
|
|
Turn God mode on (onoff = 1) or off (onoff = 0)
|
|
| GoldRank
(player)
|
int
|
|
Get the rank of the player in terms of how much gold they have. 1 being the highest rank
|
|
| GoodCount
(city, type)
|
int
|
|
Returns the number of goods of a particular type in the city's radius
|
|
| GoodCountTotal
(city)
|
int
|
|
Returns the number of goods of all types in the city's radius
|
|
| GoodType
(good_name)
|
int
|
|
Turn a named good into a good index
|
|
| GoodVisibutik
(city, type)
|
int
|
|
Doesn't work
|
|
| GrantAdvance
(player, advance[, reason])
|
void
|
|
Give the player the advance specified
|
|
| HasAdvance
(player, advance_name)
|
int
|
|
Returns true if the player has the advance
|
|
| HasAgreement
(player1, player 2, int)
|
int
|
|
Returns true if player 1 has agreement with player 2 specified by index
|
|
| HasAgreementWithAnyone
(player, agreement-type)
|
int
|
|
Returns true if the player has an agreement of the specified type with anyone
|
|
| HasGood
(location)
|
int
|
|
Returns -1 if there is no good at the location, otherwise a number from 0-3 for the good type
|
Apolyton-thread
|
| HasPop
(owner, location)
|
int
|
|
|
|
| HasRiver
(location)
|
int
|
|
Returns true if there's a river at location
|
|
| HasSameGoodAsTraded
(player)
|
int
|
|
A somewhat confusing function
|
|
| Heal
(unit)
|
void
|
|
Fully heals the specified unit
|
|
| Import
(filename)
|
void
|
|
Imports a mapfile
|
|
| IsActiveDefender
(unit)
|
int
|
|
True if the unit is capable of active defense
|
|
| IsBombardingUnit
(unit)
|
int
|
|
True if the unit is capable of bombarding
|
|
| IsBuildingAtHead
(city)
|
int
|
|
Returns -1 if the city’s build queue has something other than a building at its head, otherwise returns the database index of the building being built
|
|
| IsBuildingInBuildList
(city, buildingtype)
|
int
|
|
Returns true if the city's build queue contains that type of building
|
|
| IsCitySelected
|
int
|
|
Returns true if the player has a city selected
|
|
| IsCivilian
(unit)
|
int
|
|
True if the unit is civilian
|
|
| IsCleric
(unit)
|
int
|
|
True if the unit is a cleric
|
|
| IsContinentBiggerThan
(location, size)
|
int
|
|
True if the continent (or ocean) containing location is bigger than size squares
|
|
| IsCounterBombardingUnit
(unit)
|
int
|
|
True if the unit is capable of counter bombarding
|
|
| IsDiplomat
(unit)
|
int
|
|
True if the unit is a diplomat
|
|
| IsEndgameInBuildList
(city, endgame)
|
int
|
|
Returns true if the city's build queue contains that type of end game object
|
|
| IsFlankingUnit
(unit)
|
int
|
|
True if the unit is a flanking unit
|
|
| IsFortress
(int-player, location)
|
int
|
|
Returns true if the player has a fort at the location
|
|
| IsHostile
(player1, player2)
|
int
|
|
Obsolete
|
|
| IsHumanPlayer
(player)
|
int
|
|
True if player is not an AI player
|
|
| IsInRegion
(location, ID-region)
|
int
|
|
Returns true if location is within the given region
|
Apolyton-thread
Apolyton-thread
|
| IsInZOC
(player, location)
|
int
|
|
True if the location is in the zone of control of player
|
|
| IsOnSameContinent
(location1, location2)
|
int
|
|
Returns true if location1 and location2 are on the same continent
|
|
| IsPlayerAlive
(player)
|
int
|
|
True if player is still in the game
|
|
| IsRoad
(player, location)
|
int
|
|
Returns true if there is a road-like terrain improvement at the given location that belongs to the player
|
|
| IsSecondRowUnit
(unit)
|
int
|
|
Obsolete
|
|
| IsSlaver
(unit)
|
int
|
|
True if the unit is a slaver
|
|
| IsSpaceCity
(city)
|
int
|
|
Retruns true if the city is in space
|
|
| IsSpaceUnit
(unit)
|
int
|
|
True if the unit is capable of moving in space
|
|
| IsUnderseaCity
(city)
|
int
|
|
Returns true if the city is in the ocean
|
|
| IsUnitAtHead
(city)
|
int
|
|
Returns -1 if the city is not currently building a unit, otherwise returns the database index of the unit being built
|
|
| IsUnitInBuildList
(city, unittype)
|
int
|
|
Returns true if the city's build queue contains that kind of unit
|
|
| IsUnitSelected
|
int
|
|
True if the player has a unit selected
|
|
| IsVeteran
(unit)
|
int
|
|
Returns true if the unit has veteran status
|
|
| IsWater
(location)
|
int
|
|
Returns true if the location is a water tile
|
Apolyton-thread
|
| IsWonderAtHead
(city)
|
int
|
|
Returns -1 if the city’s build queue has something other than a wonder at its head, otherwise returns the database index of the wonder being built
|
|
| IsWonderInBuildList
(city, wonder)
|
int
|
|
Returns true if the city's build queue contains that type of wonder
|
|
| IsWonderType
(wonder, string-type)
|
int
|
|
True if wonder is named type
|
|
| IsWormholeProbe
(unit)
|
int
|
|
True if the unit is a wormhole probe
|
|
| Kill
|
void
|
|
Kills this message, only works inside buttons
|
|
| KillBuildingFromBuildList
(city, building)
|
void
|
|
Removes the building type from the city's build queue
|
|
| KillCity
|
void
|
|
Takes away population until the city is dead
|
|
| KillClass
(class)
|
void
|
|
Kills all messages of the given class
|
|
| KillEndgameFromBuildList
(city, endgame)
|
void
|
|
Remove the end game object type from the city's build queue
|
|
| KillEyepointMessage
|
void
|
|
When a message is called from an eyepoint, kill the original message with this function
|
|
| KillMessages
(objectname)
|
void
|
|
Kill all messages from the named object
|
|
| KillUnit
(unit)
|
void
|
|
Kill the unit
|
|
| KillUnitFromBuildList
(city, unit)
|
void
|
|
Removes all occurances of that type of unit from the city's build queue
|
|
| KillWonderFromBuildList
(city, wonder)
|
void
|
|
Removes the wonder type from the city's build queue
|
|
| KnowledgeRank
(player)
|
int
|
|
Rank of the player in terms of number of advances
|
|
| LeaveRegion
(player, region)
|
void
|
|
Unimplemented according to the original documentation - seems to be supposed to increase the player's strategic preference toward leaving the specified region, whatever a region might be
|
|
| Liberate
|
void
|
|
Gives the city to good old barbs
|
|
| LibraryAdvance
(int)
|
void
|
|
Opens the great library to the appropriate page
|
Apolyton-thread
|
| LibraryBuilding
(int)
|
void
|
|
Opens the great library to the appropriate page
|
|
| LibraryConcept
(int)
|
void
|
|
Opens the great library to the appropriate page
|
|
| LibraryGovernment
(int)
|
void
|
|
Opens the great library to the appropriate page
|
|
| LibraryTerrain
(int)
|
void
|
|
Opens the great library to the appropriate page
|
|
| LibraryTileImprovement
(int)
|
void
|
|
Opens the great library to the appropriate page
|
|
| LibraryUnit
([unit][int])
|
void
|
|
Opens the great library to the appropriate page
|
|
| LibraryWonder
(int)
|
void
|
|
Opens the great library to the appropriate page
|
|
| LoadGame
(name)
|
void
|
|
Load the named game
|
|
| LogRegardEvent
(int_player, int_player, regardDelta, regardEvType, ID_string, duration)
|
void
|
|
regardDelta is the amount to increase the first player's regard towards the second by
|
Apolyton-thread
|
| MakeLocation
(locationvar, x, y)
|
void
|
|
Set locationvar to (x,y)
|
|
| MaxCargoSize
(unit)
|
int
|
|
Returns the maximum number of units the unit can carry
|
|
| Message
(player, 'message_id')
|
void
|
|
Run the messagebox or alertbox named 'message_id' with player as the recipient
|
|
| MessageAll
('message_id')
|
void
|
|
Run the messagebox or alertbox named 'message_id' with every player as a recipient
|
|
| MessageAllBut
(player, 'message_id')
|
void
|
|
Run the messagebox or alertbox named 'message_id' with everyone but player as a recipient
|
|
| MessageClass
(int)
|
void
|
|
Set the current message to the given class
|
|
| MessageType
(message_type)
|
void
|
|
Set the icon for the current message
|
|
| MilitaryRank
(player)
|
int
|
|
The rank for the given player in terms of strength of military units
|
|
| MinimizeAction
|
void
|
|
Does something with the message - I have no idea what
|
|
| mod_CanCityBuildBuilding
(city_t theCity, int_t theBuilding)
|
int
|
|
Determines which buildings are buildable under certain conditions (int_t index from BuildingDB)
|
Apolyton-thread
|
| mod_CanCityBuildUnit
(city_t theCity, int_t theUnit)
|
int
|
|
Determines which units are buildable under certain conditions
|
Apolyton-thread
|
| mod_CanCityBuildWonder
(city_t theCity, int_t theWonder)
|
int
|
|
Determines which wonders are buildable under certain conditions (int_t index from WonderDB)
|
Apolyton-thread
|
| mod_CanPlayerHaveAdvance
(player, int)
|
int
|
|
Determines if player can have the advance with db index int
|
Apolyton-thread
|
| mod_CityHappiness
|
int
|
|
Determines cities happiness, somehow
|
Apolyton-thread
|
| mod_UnitAttack
|
int
|
|
|
Apolyton-thread
Apolyton-thread
|
| mod_UnitDefense
|
int
|
|
|
Apolyton-thread
|
| mod_UnitRangedAttack
|
int
|
|
|
Apolyton-thread
|
| NetworkAccept
(player)
|
void
|
|
Not documented by Activision
|
|
| NetworkEject
(player)
|
void
|
|
Not documented by Activision
|
|
| OpenBuildQueue
(city)
|
void
|
|
Opens the buildlist for the specified city
|
|
| OpenCity
|
void
|
|
Open the city status screen
|
|
| OpenCityTab
|
void
|
|
Set the control panel to the city tab - obviously unimplemented in CTP2 AE
|
|
| OpenCiv
|
void
|
|
Open the civ status screen
|
|
| OpenCivTab
|
void
|
|
Set the control panel to the civ tab - obviously unimplemented in CTP2 AE
|
|
| OpenDiplomacy
|
void
|
|
Open the diplomacy screen
|
|
| OpenInfo
|
void
|
|
Open the info screen
|
|
| OpenLaborTab
|
void
|
|
Open the labor tab - obviously unimplemented in CTP2 AE
|
|
| OpenMaxTab
|
void
|
|
Open the max tab - obviously unimplemented in CTP2 AE
|
|
| OpenOptions
|
void
|
|
Open the options screen
|
|
| OpenProductionTab
|
void
|
|
Open the production tab - obviously unimplemented in CTP2 AE
|
|
| OpenScenarioEditor
|
void
|
|
Opens the scenario editor
|
|
| OpenScience
|
void
|
|
Open the science screen
|
|
| OpenThroneRoom
|
void
|
|
Open the throne room
|
|
| OpenTrade
|
void
|
|
Open the trade screen
|
|
| OpenUnit
|
void
|
|
Open the unit status screen
|
|
| Ozone
|
void
|
|
Cause an ozone depletion event
|
|
| PlantGood
(location)
|
void
|
|
Add a special resource at location
|
|
| PlantSpecificGood
(location, int_goodsubtype)
|
void
|
|
Rather than planting a random good, this allows the specification of which good subtype to plant (0 - no good, 1 - *_GOOD_ONE, 2 - *_GOOD_TWO etc. from goods.txt)
|
|
| PlayerCityCount
(player)
|
int
|
|
Returns how many cities the player has
|
|
| PlayerCivilization
(player)
|
int
|
|
Return the database index of the player's civilization (the same number returned by CivilizationIndex)
|
|
| PlayerGold
(player)
|
int
|
|
Returns the amount of the player's current gold reserve
|
|
| PlayerHasWonder
(player, int)
|
int
|
|
Returns true if the player owns the wonder int (index from wonders.txt)
|
|
| PlayerRationsExp
(player)
|
int
|
|
Returns the player's rations expectations according to current government
|
|
| PlayerRationsLevel
(player)
|
int
|
|
Returns the player's actual rations level
|
|
| PlayerWagesExp
(player)
|
int
|
|
Returns the player's wages expectations according to current government
|
|
| PlayerWagesLevel
(player)
|
int
|
|
Returns the player's actual wages level
|
|
| PlayerWorkdayExp
(player)
|
int
|
|
Returns the player's workday expectations according to current government
|
|
| PlayerWorkdayLevel
(player)
|
int
|
|
Returns the player's actual workday level
|
|
| PlaySound
(soundname)
|
void
|
|
Play a sound
|
|
| PopulationRank
(player)
|
int
|
|
Rank of the player in terms of total population
|
|
| Preference
(prefname)
|
int
|
|
Read the value of the given preference (from userprofile.txt/profile.txt). E.G. Preference("Pollution") will return 1 if pollution is enabled for this game, 0 otherwise
|
|
| QuitToLobby
|
void
|
|
Quit to the network lobby in a network game
|
|
| Random
(range)
|
int
|
|
Return a random number from 0 to range
|
Apolyton-thread
|
| RecomputeRegard
(player)
|
void
|
|
Recomputes regard of player towards all other players?
|
|
| RegardLevel
(player1, player2)
|
int
|
|
Return player 1's regard toward player 2
|
|
| Reject
|
void
|
|
Reject a diplomatic request from the context
|
|
| RejectTradeBid
|
void
|
|
Reject a trade bid from the context
|
|
| RemoveAdvance
(player, advance)
|
void
|
|
Remove the advance from the player
|
|
| RemoveGood
(location)
|
void
|
|
Removes any good from the location
|
|
| Research
|
void
|
|
Makes the player start researching an advance - only works in messages where the advance in question is given from the context
|
|
| return
|
|
|
return CONTINUE, return STOP. If return STOP is used in a pre-event handler, it stops the event from being executed
|
Apolyton-thread
|
| RoundGold
(int)
|
int
|
|
Rounds off int to the nearest 100
|
|
| RoundPercentReduction
(int)
|
int
|
|
Rounds off to a nice percentage, 0 <= int <= 100
|
|
| SaveGame
(name)
|
void
|
|
Save a game with the given name
|
|
| SelectCity
(city)
|
void
|
|
Select the specified city as if the user clicked on it
|
|
| SelectUnit
(unit)
|
void
|
|
Select the specified unit as if the user clicked on it
|
|
| SendTradeBid
|
void
|
|
Obsolete according to the original documentation
|
|
| SetActionKey
(index, string)
|
void
|
|
Set the key for key..pressed to the first character in string. (Or to ctrl + second character if the first character is '^')
|
|
| SetAllCitiesVisible
(player)
|
void
|
|
Makes all cities visible to the player
|
|
| SetArmyDetachState
(army, int)
|
void
|
|
???
|
|
| SetCity
(index, city)
|
void
|
|
Set city.index to city
|
|
| SetCityByIndex
(index, player, cityindex)
|
void
|
|
Set cityindex to player's cityindexth city
|
|
| SetCityVisible
(player, string_id)
|
void
|
|
Makes the city identified by string_id (e.g. BARBARIAN_CITY_1) visible to the player
|
|
| SetEmbargo
(player, foreigner, state)
|
void
|
|
Toggle player to have an embargo against foreigner using 1 = on, 0 = off - actually this will threaten to set an embargo
|
|
| SetGovernment
(index)
|
void
|
|
Set the recipient's government to the given type
|
|
| SetLocation
(index, locationvar)
|
void
|
|
Set location.index to locationvar
|
|
| SetNewProposal
(player1, player2, priority, first_type, second_type, strid1, strid2, strid3)
|
void
|
|
As ConsiderNewProposal, probably doesn't make the first player just consider sending the proposal but send it immediately?
|
|
| SetOrder
(index, order)
|
void
|
|
Set an order in the context to the given order
|
|
| SetPlayer
(index, player)
|
void
|
|
Set player. to player
|
|
| SetPreference
(prefname, value)
|
int
|
|
Set the value of a boolean or integer variable to value. E.G. SetPreference("UnitAnim", 1) will turn unit animations on
|
|
| SetPW
(player, pw)
|
void
|
|
Set the player's public works to pw
|
|
| SetResearching
(player, what)
|
void
|
|
Set the player to research what
|
|
| SetResponse
(player1, player2, priority, response_type[, optional_parameters_see_source])
|
void
|
|
As ConsiderResponse (but priority should be set to 0 ?)
|
|
| SetScience
(player, level)
|
void
|
|
Set the player's science level to level
|
Apolyton-thread
|
| SetStrategicState
(player, int)
|
void
|
|
Sets the player's strategic state to the given strategy from StrategyDB - only used at gamestart, ConsiderStrategicState should be used during the game. NOTE: Not implemented in CTP2 AE.
|
|
| SetString
(index, stringid)
|
void
|
|
Set string. to the string (from the string database) stringid
|
|
| SetStringByDBIndex
(index, stringindex)
|
void
|
|
Set string. from the integer string id stringindex
|
|
| SetTimerGranularity
(gran)
|
int
|
|
Set SLIC's timer mechanism to check timers every gran seconds
|
|
| SetTrust
(player1, player2)
|
void
|
|
Sets first player's trust towards second player to int (which normally should be 0 <= int <= 1000)
|
|
| SetUnit
(index, unit)
|
void
|
|
Set unit.index to unit
|
|
| SetUnitByIndex
(index, player, unitindex)
|
void
|
|
Set unit.index to player's unitindexth unit
|
|
| Show
|
void
|
|
Open this message immediately instead of showing just an icon
|
|
| SpaceRank
(player)
|
int
|
|
The rank of this player in terms of space ownership
NOTE: No space in CTP2
|
|
| SquaredDistance
(location1, location2)
|
int
|
|
Returns the squared distance between location1 and location2
|
|
| Stacked
(location)
|
int
|
|
Returns true if all of the units at the given location are in a single group
|
|
| StartTimer
(index, duration)
|
int
|
|
Start timer index, set to expire in duration seconds
|
|
| StealRandomAdvance
|
void
|
|
A spy steals a random advance from a city
|
|
| StealSpecificAdvance
|
void
|
|
A spy steals a specific advance from a city
|
|
| StopAttract
(ldlname)
|
void
|
|
Remove a highlight box around the named UI component
|
|
| StopTimer
(int)
|
int
|
|
Stop the given timer
|
|
| StringCompare
(string1, string2)
|
|
|
Returns true if string1 equals string2
|
|
| Surrender
(player)
|
void
|
|
Unimplemented according to the original documentation
|
|
| TargetNuclearAttack
(player, foreigner, launch_now)
|
void
|
|
Target player's nukes onto foreigner's cities and launch if launch_now = 1
|
|
| Terraform
(location, terrain)
|
void
|
|
Change location into a different terrain type
|
|
| TerrainType
(location)
|
int
|
|
Returns the indexed terrain type of the location
|
|
| TileHasImprovement
(location, int)
|
int
|
|
Returns true if the tile has the improvement specified by TerrainImprovementDB-index
|
|
| Title
(stringid)
|
void
|
|
Set the title of a message
|
|
| ToggleVeteran
(unit, onoff)
|
void
|
|
Switches the unit's veteran status on/off (1 = on, 0 = off).
|
|
| TradePoints
(player)
|
int
|
|
Return how many caravans the player has
|
|
| TradePointsInUse
(player)
|
int
|
|
Gets the number of trade points ('caravans') being used by player
|
|
| TradeRank
(player)
|
int
|
|
The player's rank in terms of number of trade routes
|
|
| TradeRoutes
(player)
|
int
|
|
Return how many trade routes the player has
|
|
| TurnsAtWar
(int_player, int_player)
|
int
|
|
Returns -1 if they've never been at war and otherwise what it says (0 means they are now at war)
|
|
| TurnsSinceLastWar
(player1, player2)
|
int
|
|
Returns the no. of turns since the last war between player 1 and player 2
|
|
| UnderseaRank
(player)
|
int
|
|
The player's rank in terms of undersea cities
|
|
| UnitCount
(player, type)
|
int
|
|
Return a count of how many units of a given type the player has
|
|
| UnitHasFlag
(unit, [ID]flag)
|
int
|
|
unimplemented - was supposed to return true if the given unit has the specified flag
|
|
| UnitHasUserFlag
(unit, flag)
|
int
|
|
Returns true if the given unit has a "SET_USER_FLAG " in it's database record
|
|
| UnitMovementLeft
(unit)
|
int
|
|
Returns the number of movement points left for the unit. 100 = 1 movement point left, 33 = 1 regular road movement left etc.
|
|
| UnitsInCell
(location)
|
int
|
|
Returns the number of units in the cell
|
|
| UnitType
(unitname)
|
int
|
|
Return the DB index of the named unit
|
|
| UseDirector
|
void
|
|
Queue this message up via the animation system instead of displaying it immediately
|
Apolyton-thread
|
| WonderOwner
(wonder)
|
int
|
|
Returns the player who owns the wonder (-1 if no one does)
|
|