No announcement yet.

SLIC Function Reference


  • SLIC Function Reference

    By Joe Rumsey
    About the author: CTP Programmer, a.k.a Mr Ogre on the forums

    This is an alphabetical list of every function available in SLIC scripts for Civilization: Call to Power.

    Functions marked with (1.1) were not present until version 1.1.
    Functions marked with (1.2) were not present until version 1.2.
    • VOID Abort()(Messages only)
      Causes the current message to not be displayed. The code code following an Abort() is still executed however.

    • VOID Accept()(Messages only)
      Accepts the diplomatic request associated with this message.

    • VOID AcceptTradeBid()(Messages only)
      Accepts the trade bid associated with this message

    • VOID AcceptTradeOffer(index)(Messages only)
      Accepts the trade offer associated with this message

    • (1.2)VOID AddCenter(location)
      Add a recenter event on location to the animation queue.

    • (1.2)VOID AddEffect(location, namestr, soundid)
      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"). Example:

        AddEffect(unit.1.pos, "SPECEFFECT_NANO", "SOUND_ID_NANO_TERROR");
      Note that if the location is not visible to the onscreen player, this special effect won't be seen.

    • (1.2)VOID AddUnitToBuildList(city, unittype)
      Add the unit type to the end of the city's queue.

    • (1.2)VOID AddBuildingToBuildList(city, buildingtype)
      Add the building type to the end of the city's queue.

    • (1.2)VOID AddWonderToBuildList(city, wonder)
      Add the wonder type to the end of the city's queue.

    • (1.2)VOID AddEndgameToBuildList(city, endgame)
      Add the endgame object to the end of the city's queue.

    • VOID AddCity(builtinwithcity)
      Adds a city to the current context.

    • VOID AddCityByIndex(owner, index)
      Adds the player's nth city to the context.

    • VOID AddExpelOrder(unit, location)
      Tells the unit to expel another unit at the given location (must be adjacent, must be expellable, the unit being given the order must be able to expel units, etc.)

    • (1.2)VOID AddGold(player, amount)
      Give amount gold to player. Negative amounts subtract gold.

    • VOID AddGoods(city)
      Add all the goods in the city's radius to the context.

    • (1.1) VOID AddMovement(unit, amount)
      Give unit an additional amount movement points (will be removed at the end of the turn if not used).

    • VOID AddOrder(unit, location)
      Tell the given unit to execute the order that was previously set in the context. See also SetOrder

    • INT AddPops(city, count)
      Increase the population of the given city by count.

    • VOID AddUnit(unit)
      Add a unit to the context.

    • INT AllUnitsCanBeExpelled(location)
      return true if all of the units at the location can be expelled. Returns false if there are no units there.

    • VOID AttachRobot(index)
      Cause the given player to be taken over by an AI player

    • VOID Attract(ldlname)
      Draw a highlight box around the named UI component.

    • (1.2)VOID BlankScreen(blank)
      If blank is non-zero, set the screen to blacked out, otherwise turn it back on. Used by hotseat and email messages.

    • VOID BreakAgreement(agreement_index)
      Break a diplomatic agreement which is set in the context.

    • VOID BreakAlliance(player)
      Break an alliance between player.1 and and the given player.

    • VOID BreakLeaveOurLands()
      Break a stop trespassing agreement between player.1 and player.2

    • VOID BreakNoPiracy()
      Break a no piracy agreement between player.1 and player.2

    • INT BuildingType(building)
      Return the building database index of the named building (building is a quoted string corresponding to the name in improve.txt)

    • (1.2)VOID CantAttackCity(city, onoff)
      Make the specified city immune to attack/capture if onoff is not 0, set it back to normal if 0.

    • (1.2)VOID CantAttackUnit(unit, onoff)
      Make the specified unit immune to attack if onoff is not 0, set it back to normal if 0.

    • (1.2)VOID CantEndTurn(onoff)
      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.

    • (1.2)VOID CityCantRiotOrRevolt(city, onoff)
      Make the specified city immune to riots and revolts if onoff is not 0, set it back to normal if 0.

    • [B]VOID Caption(caption)

    • VOID CaptureCity(player, city)

    • VOID CaptureRegion(player, region)

    • (1.1) VOID CatchUp()
      Cause the graphics system to synchronize with the game's internal state (fast forward unit moves, for example)

    • VOID ChangeRegardLevel(player1, (delta)level, player2)

    • INT Cities(player)
      Returns the number of cities the player has.

    • INT CitiesRank(player)
      Returns the ranking of the player by number of cities (1 being the highest)

    • INT CityCollectingGood(city, good)
      Return the amount of a particular good being collected in the city (excluding goods being brought in via trade)

    • INT CityHasBuilding(city, building)
      Return true if the city has a building of the given type. building is a quoted string corresponding to the name in improve.txt.

    • (1.2)INT CivilizationIndex(civname)
      Return the database index for the named civilization. Useful for comparing to a player's civilization, for example:

        if(PlayerCivilization(g.player) == CivilizationIndex("AMERICANS")) {
          // the current player is the americans
      This is especially useful for creating victory conditions for specific civilizations in scenarios. See also PlayerCivilization and GameOver

    • VOID ClearBuildQueue(city)
      Remove all items from the build queue of the given city.

    • VOID ClearOrders(unit)
      Clear the unit's army's orders.

    • INT ControlsRegion(player, (ID)region)
      True if the given player is the only player who owns tiles in the region (not necessarily all the tiles in the region)

    • INT CreateCity(owner, nearlocation, distance[, savecity])
      Create a city belonging to owner, at approximately distance tiles away from nearlocation. If a city variable is passed in to savecity, it will contain the newly created city after this function returns.

    • INT CreateCoastalCity(owner, nearlocation, distance[, savecity])
      Same as CreateCity, but always finds a square next to ocean.

    • VOID CreateUnit(owner, type, nearlocation, distance[, saveunit])
      Create a unit of the given type belonging to owner approximately distance tiles from nearlocation. If a unit variable is passed in as saveunit, it will contain the newly create unit after this function returns.

    • (1.2)VOID DamageUnit(unit, hp)
      Subtract hp hit points from unit.

    • VOID DeactivateTutorial()
      Turn off the tutorial.

    • VOID DemandWarFromAllies(demandingplayer, againstplayer)
      Send a diplomatic request demanding that all allies of demanding player declare war on againstplayer.

    • (1.1) VOID Deselect()
      Cause the currently selected unit/city/resource to be deselected.

    • VOID DetachRobot(index)
      Turn the AI off for the given player.

    • VOID DisableChooseResearch()
      The choose research dialog is disabled for the tutorial player.

    • VOID DisableClose()(Messages only)
      Disallow closing this message from the UI.

    • VOID DisableMessageClass(class)
      Cause all messages of the given class to not be displayed.

    • VOID DisableScreensButton()
      Disable the screens button.

    • VOID DisableTileImprovementButton()
      Disable the tile improvements button.

    • VOID DisbleTrigger('trigger_id')
      Disable the named trigger.

    • VOID DoAutoUnload()
      Do not use this.

    • VOID DoCannotAffordMaintenance()
      Does nothing.

    • VOID DoCannotAffordSupport()
      Does nothing.

    • VOID DoCertainRevolution()
      Does nothing.

    • VOID DoCityWillStarve()
      Does nothing.

    • VOID DoFreeSlaves()
      Frees the slaves in city.1. Only works if that city was captured this turn.

    • VOID DoLandInOcean()
      Does nothing.

    • VOID DoOutOfFuel()
      Does nothing.

    • VOID DoPillageOwnLand()
      Causes unit.1 to pillage, even if it belongs to the player who owns the tile it's standing on.

    • VOID DoSellImprovement()
      Does nothing.

    • VOID DoYouWillBreakRoute()
      Does nothing.

    • VOID DontAcceptTradeOffer(index)
      Reject a trade offer.

    • VOID DontSave()(Messages only)
      If this is a tutorial message, don't save it in the tutorial history.

    • VOID Duration(turns)
      Kill this message automatically in n turns.

    • VOID EnableChooseResearch()
      Reenable the choose research dialog for the tutorial player.

    • VOID EnableCloseClass(player, class)
      Enable closing of all messages belonging to class, if it was disabled previously.

    • VOID EnableCloseMessage(player, messagename)
      Enable closing of all messages from the named object.

    • VOID EnableMessageClass(class)
      Enable messages belonging to class.

    • VOID EnableScreensButton()
      Enable the screens button.

    • VOID EnableTileImprovementButton()
      Enable the tile improvements button.

    • VOID EnableTrigger('trigger_id')
      Enable the named trigger.

    • VOID EndTurn()
      End this turn.

    • (1.1) VOID ExecuteAllOrders()
      Cause all units to execute queued up orders.

    • VOID ExitToShell()
      Exit to the main screen.

    • VOID ExtractLocation(location, locationvar)
      Get a location from built in variable and put it in locationvar.

    • VOID EyeDropdown(starting index, builtin variable with list)(Messages only)
      Put a dropdown box on the message.

    • VOID EyePoint(location[, player, messageid])
      Put an eyepoint on the message. If player and messageid are passed, call that message when the eyepoint is clicked.

    • INT FindCoastalCity(player, cityvar)
      Find a city next to the ocean and put it in cityvar. Returns 0 if no coastal cities are found.

    • VOID FinishBuilding(city)
      Finish building a settler that was stopped because building it will disband the city.

    • (1.1) VOID Flood(stage)
      Cause a global flood. Stage specifies the effects, stage 0 is somewhat less drastic than later stages.

    • VOID ForceRegard(ofPlayer, forPlayer, toRegard)
      Force the regard ofPlayer forPlayer toRegard.

    • INT GameOver(player, reason)
      End the game for the given player. reason can be either 1 or 2, 1 meaning the player won, 2 meaning they lost.

    • INT GeographicRank(player)
      The rank of the player according to how much land they own, 1 being the most.

    • (1.2)VOID GetCityByLocation(location, cityvar)
      Fill in a city variable from the city at location.

    • VOID GetMessageClass(player, index)
      Get the class of message #index belonging to player.

    • INT GetNearestWater(location, locationvar)
      Get the location of the nearest ocean square to location, putting the result in locationvar. Also returns the distance in patched version.

    • (1.2)INT GetNeighbor(locationIn, direction, locationOut)
      Given the location variable locationIn, fill in the location of it's neighbor in the specified direction in locationOut. The return value is 1 if successful, 0 if not. (Unsuccessful means you tried to get a neighbor off the edge of the world, E.G past the top on an earth shaped map). Direction is one of:

              0 North
              1 Northeast
              2 East
              3 Northwest
              4 Southeast
              5 West
              6 Southwest
              7 South
              8 Up (into space)
              9 Down (from space to ground)
      No, I don't think the order makes much sense either.

    • VOID GetRandomNeighbor(location, newlocation)
      Get a random square adjacent to location and put it in newlocation.

    • (1.2)INT GetStringDBIndex(stringid)
      Get an integer string id for the named string ID. For example, if you want to store the id of SCENARIO_AUTHOR for later use:

        scenarioAuthorStringId = GetStringDBIndex(ID_SCENARIO_AUTHOR);
      Then to use it later,

        SetStringByDBIndex(1, scenarioAuthorStringId);
    • (1.1) VOID GodMode(onoff)
      Turn God mode on (onoff = 1) or off (onoff = 0) (the equivalent of the Show Map button in the editor).

    • [B]INT GoldRank(player)
      Get the rank of the player in terms of how much gold they have. 1 being the highest rank.

    • INT GoodCount(city, type)
      Count the number of goods of a particular type in the city's radius.

    • INT GoodCountTotal(city)
      Count the number of goods of all types in the city's radius.

    • INT GoodType(good_name)
      Turn a named good into a good index.

    • INT GoodVisibutik(city, type)
      Doesn't work.

    • VOID GrantAdvance(player, advance)
      Give the player the advance specified.

    • INT HasAdvance(player, advance_name)
      Return true if the player has the advance.

    • INT HasPop(owner, location)
      Return true if owner has a worker at location.

    • INT HasRiver(location)
      return true if there's a river at location.

    • INT HasSameGoodAsTraded(player)
      A somewhat confusing function.

    • (1.2)VOID Heal(unit)
      Fully heal the unit.

    • (1.2)INT IsUnitInBuildList(city, unittype)
      Does the city's build queue contain that kind of unit?

    • (1.2)INT IsBuildingInBuildList(city, buildingtype)
      Does the city's build queue contain that type of building?

    • (1.2)INT IsWonderInBuildList(city, wonder)
      Does the city's build queue contain that type of wonder?

    • (1.2)INT IsEndgameInBuildList(city, endgame)
      Does the city's build queue contain that type of end game object?

    • INT IsActiveDefender(unit)
      True if the unit is capable of active defense.

    • INT IsBombardingUnit(unit)
      True if the unit is capable of bombarding.

    • INT IsCitySelected()
      True if the player has a city selected.

    • INT IsCleric(unit)
      True if the unit is a cleric.

    • INT IsContinentBiggerThan(location, size)
      True if the continent at location has at least size squares.

    • INT IsCounterBombardingUnit(unit)
      True if the unit is capable of counter bombarding.

    • INT IsDiplomat(unit)
      True if the unit is a diplomat.

    • INT IsFlankingUnit(unit)

    • INT IsHostile(player1, player2)

    • INT IsHumanPlayer(player)
      True if player is not an AI player.

    • INT IsInRegion(location, (ID)region)
      True if location is within the given region.

    • INT IsInZOC(player, location)
      True if player has Zone of Control over location.

    • INT IsPlayerAlive(player)
      True if player is still in the game.

    • INT IsSecondRowUnit(unit)

    • INT IsSlaver(unit)
      True if the unit is a slaver.

    • INT IsSpaceCity(city)
      True if the city is in space.

    • INT IsSpaceUnit(unit)
      True if the unit is capable of moving in space.

    • INT IsUnderseaCity(city)
      True if the city is in the ocean.

    • INT IsUnitSelected()
      True if the player has a unit selected.

    • INT IsWonderType(wonder, (string)type)
      True if wonder is named type.

    • INT IsWormholeProbe(unit)
      True if the unit is a wormhole probe.

    • (1.2)VOID KillUnitFromBuildList(city, unit)
      Remove all occurances of that type of unit from the city's build queue.

    • (1.2)VOID KillBuildingFromBuildList(city, building)
      Remove the building type from the city's build queue.

    • (1.2)VOID KillWonderFromBuildList(city, wonder)
      Remove the wonder type from the city's build queue.

    • (1.2)VOID KillEndgameFromBuildList(city, endgame)
      Remove the end game object type from the city's build queue.

    • VOID Kill()(Messages only)
      Kills this message, only works inside buttons. (Use Abort() instead outside a button)

    • VOID KillClass(class)
      Kills all messages of the given class.

    • VOID KillEyepointMessage()
      When a message is called from an eyepoint, kill the original message with this function.

    • VOID KillMessages(objectname)
      Kill all messages from the named object.

    • VOID KillUnit(unit)
      Kill the unit.

    • INT KnowledgeRank(player)
      Rank of the player in terms of number of advances.

    • VOID LeaveRegion(player, region)

    • VOID LibraryAdvance(int)
    • VOID LibraryBuilding(int)
    • VOID LibraryConcept(int)
    • VOID LibraryGovernment(int)
    • VOID LibraryTerrain(int)
    • VOID LibraryTileImprovement(int)
    • VOID LibraryUnit([unit|int])
    • VOID LibraryWonder(int)
      All of the above functions open the great library to the appropriate page.

    • VOID LoadGame(name)
      Load the named game. Must have been saved from SLIC with SaveGame.

    • (1.1) VOID MakeLocation(locationvar, x, y, z)
      Set locationvar to (x,y,z)

    • VOID Message(player, 'message_id')

    • [B]Run the messagebox or alertbox named 'message_id' with player as the recipient.

    • VOID MessageAll('message_id')
      Run the messagebox or alertbox named 'message_id' with every player as a recipient.

    • VOID MessageAllBut(player, 'message_id')
      Run the messagebox or alertbox named 'message_id' with everyone but player as a recipient.

    • VOID MessageClass(int)(Messages only)
      Set the current message to the given class.

    • VOID MessageType(message_type)
      Set the icon for the current message.

    • INT MilitaryRank(player)
      The rank for the given player in terms of strength of military units.

    • VOID OpenCity()
      Open the city status screen.

    • VOID OpenCityTab()
      Set the control panel to the city tab.

    • VOID OpenCiv()
      Open the civ status screen.

    • VOID OpenCivTab()
      Set the control panel to the civ tab.

    • VOID OpenDiplomacy()
      Open the diplomacy screen.

    • VOID OpenInfo()
      Open the info screen.

    • VOID OpenLaborTab()
      Open the labor tab.

    • VOID OpenMaxTab()
      Open the max tab.

    • VOID OpenOptions()
      Open the options screen.

    • VOID OpenProductionTab()
      Open the production tab.

    • VOID OpenScience()
      Open the science screen.

    • VOID OpenThroneRoom()
      Open the throne room.

    • VOID OpenTrade()
      Open the trade screen.

    • VOID OpenUnit()
      Open the unit status screen.

    • (1.1) VOID Ozone()
      Cause an ozone depletion event.

    • VOID PlantGood(location)
      Add a special resource at location.

    • VOID PlaySound(soundname)
      Play a sound.

    • INT PlayerCityCount(player)
      Return how many cities the player has.

    • (1.2)INT PlayerCivilization(player)
      Return the database index of the player's civilization (the same number returned by CivilizationIndex)

    • INT PopulationRank(player)
      Rank of the player in terms of total population.

    • (1.1) INT Preference(prefname)
      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.

    • VOID QuitToLobby()
      Quit to the network lobby in a network game.

    • INT Random(range)
      Return a random number from 0 to range.

    • INT RegardLevel(player1, player2)
      Return player 1's regard toward player 2.

    • VOID Reject()
      Reject a diplomatic request from the context.

    • VOID RejectTradeBid()
      Reject a trade bid from the context.

    • VOID Research()

    • VOID SaveGame(name)
      Save a game with the given name.

    • (1.2)VOID SelectCity(city)
      Select the specified city as if the user clicked on it.

    • (1.2)VOID SelectUnit(unit)
      Select the specified unit as if the user clicked on it.

    • VOID SendTradeBid()

    • (1.2)VOID SetActionKey(index, string)
      Set the key for key..pressed to the first character in string. (Or to ctrl + second character if the first character is '^'). To write a trigger that fires when the key is pressed, use the trigger variable key.n.pressed, where n is the index you passed to SetActionKey. E.G.:

         SetActionKey(1, "a");
      trigger 'aKeyPressed' when (key.1.pressed) {
          Message(g.player, "TheAKeyWasPressed");
    • (1.1) VOID SetCity(index, city)
      Set city.index to city. Useful to access the attributes of a city stored in a TypeCity variable. E.G. SetCity(1, myCityVariable) will cause city.1 to be the unit stored in myCityVariable.

    • (1.1) VOID SetCityByIndex(index, player, cityindex)
      Set cityindex to player's cityindexth city. Useful for looping through all of a player's cities for example.

    • VOID SetGovernment(index)(Messages only)
      Set the recipient's government to the given type.

    • (1.1) VOID SetLocation(index, locationvar)
      Set location.index to locationvar.

    • (1.1) VOID SetOrder(index, order)
      Set an order in the context to the given order. (As of patch 1.1, only an index of 1 is actually useful). Once an order has been set, it can be issued to a unit with AddOrder. Order uses an index from below:

             0 UNIT_ORDER_NONE
              1 UNIT_ORDER_MOVE
              2 UNIT_ORDER_PATROL
              4 UNIT_ORDER_ENTRENCH
              5 UNIT_ORDER_SLEEP
              6 UNIT_ORDER_DETRENCH
              7 UNIT_ORDER_UNLOAD
              9 UNIT_ORDER_MOVE_TO
              10 UNIT_ORDER_TELEPORT_TO
              11 UNIT_ORDER_EXPEL_TO
              12 UNIT_ORDER_GROUP
              13 UNIT_ORDER_UNGROUP
              14 UNIT_ORDER_PARADROP
              15 UNIT_ORDER_LAUNCH
              22 UNIT_ORDER_BOMBARD
              23 UNIT_ORDER_SUE
              24 UNIT_ORDER_FRANCHISE
              26 UNIT_ORDER_EXPEL
              29 UNIT_ORDER_PLANT_NUKE
              30 UNIT_ORDER_SLAVE_RAID
              34 UNIT_ORDER_BIO_INFECT
              35 UNIT_ORDER_NANO_INFECT
              36 UNIT_ORDER_CONVERT
              37 UNIT_ORDER_REFORM
              38 UNIT_ORDER_INDULGENCE
              39 UNIT_ORDER_SOOTHSAY
              40 UNIT_ORDER_DEFUSE_MINES
              41 UNIT_ORDER_CLOAK
              42 UNIT_ORDER_UNCLOAK
              43 UNIT_ORDER_RUSTLE
              44 UNIT_ORDER_CREATE_PARK
              45 UNIT_ORDER_CREATE_RIFT
              46 UNIT_ORDER_PILLAGE
              47 UNIT_ORDER_INJOIN
              48 UNIT_ORDER_USE_LADDER
              49 UNIT_ORDER_AIRLIFT
              50 UNIT_ORDER_DESCEND
              51 UNIT_ORDER_THROW_PARTY
              55 UNIT_ORDER_GROUP_UNIT
              56 UNIT_ORDER_DISBAND
              60 UNIT_ORDER_WAKE_UP
              63 UNIT_ORDER_ADVERTISE
              64 UNIT_ORDER_CONDUCT_HIT
    • VOID SetPlayer(index, player)
      Set player. to player.

    • (1.1) INT SetPreference(prefname, value)
      Set the value of a boolean or integer variable to value. E.G. SetPreference("UnitAnim", 1) will turn unit animations on.

    • (1.2)VOID SetPW(player, pw)
      Set the player's public works to pw.

    • VOID SetResearching(player, what)
      Set the player to research what.

    • VOID SetScience(player, level)
      Set the player's science level to level.

    • (1.2)VOID SetString(index, stringid)
      Set string. to the string (from the string database) stringid. For Example, if you these strings in the database:

      SCENARIO_AUTHOR_MESSAGE "This scenario was written by []"
      SCENARIO_AUTHOR "Joe Rumsey"
      And you put this in a SLIC messagebox:

        SetString(1, ID_SCENARIO_AUTHOR);
      The resulting text in the message will be: This scenario was written by Joe Rumsey

    • (1.2)VOID SetStringByDBIndex(index, stringindex)
      Set string. from the integer string id stringindex. See also GetStringDBIndex and SetString

    • VOID SetTimerGranularity(gran)
      Set SLIC's timer mechanism to check timers every gran seconds. 1 second is the best granularity possible. The default is 5 seconds.

    • (1.1) VOID SetUnit(index, unit)
      Set unit.index to unit. Useful to access the attributes of a unit stored in a TypeUnit variable. E.G. SetUnit(1, myUnitVariable) will cause unit.1 to be the unit stored in myUnitVariable.

    • (1.1) VOID SetUnitByIndex(index, player, unitindex)
      Set unit.index to player's unitindexth unit. Useful for looping through all of a player's units for example.

    • VOID Show()
      Open this message immediately instead of showing just an icon.

    • INT SpaceRank(player)
      The rank of this player in terms of space ownership.

    • (1.2)INT Stacked(location)
      Are all of the units at the given location in a single group?

    • VOID StartTimer(index, duration)
      Start timer index, set to expire in duration seconds. trigger 'foo' when (timer.) {...} to tell when this timer has expired.

    • VOID StopTimer(int)
      Stop the given timer.

    • VOID Surrender(player)

    • VOID Terraform(location, terrain)
      Change location into a different terrain type.

              0 TERRAIN_TYPE_FOREST
              1 TERRAIN_TYPE_PLAINS
              2 TERRAIN_TYPE_TUNDRA
              3 TERRAIN_TYPE_GLACIER
              5 TERRAIN_TYPE_DESERT
              6 TERRAIN_TYPE_SWAMP
              7 TERRAIN_TYPE_JUNGLE
              9 TERRAIN_TYPE_HILL
              11 TERRAIN_TYPE_WATER_DEEP
              13 TERRAIN_TYPE_SPACE
              17 TERRAIN_TYPE_WATER_RIFT
              18 TERRAIN_TYPE_DEAD
              19 TERRAIN_TYPE_BROWN_HILL
              21 TERRAIN_TYPE_WHITE_HILL
              23 TERRAIN_TYPE_DEAD_HILL
    • INT TerrainType(location)
      Return the terrain type of the location.

    • VOID Title(stringid)(Messages only)
      Set the title of a message.

    • INT TradePoints(player)
      Return how many caravans the player has.

    • INT TradeRank(player)
      The player's rank in terms of number of trade routes.

    • INT TradeRoutes(player)
      Return how many trade routes the player has.

    • INT UnderseaRank(player)
      The player's rank in terms of undersea cities.

    • (1.2)INT UnitHasUserFlag(unit, flag)
      Returns true if the given unit has a "SET_USER_FLAG " in it's database record. is a number from 1 to 32. They are completely unused by the code, this is the only place they mean anything at all.

    • INT UnitType(unitname)
      Return the DB index of the named unit. The name must be in quotes. E.G. UnitType("UNIT_SETTLER")

    • INT UnitCount(player, type)
      Return a count of how many units of a given type the player has.

    • INT UnitHasFlag(unit, (ID)flag)
      Return true if the given unit has the specified flag (flags are the same as in units.txt. NOTE: a few flags may not work with this function.)

    • INT UnitsInCell(location)
      Return the number of units in the cell.

    • VOID UseDirector()(Messages only)
      Queue this message up via the animation system instead of displaying it immediately. Useful to synchronize messages with other things happening on screen.

    Author: Joe Rumsey
    Date: April 1, 1999
    Last Update: May 10, 1999

      Posting comments is disabled.

    Article Tags


    Latest Articles


      by Harlan
      Get the Full version of this guide with images and unit.txt example

      Here is what I have so far on a file to help explain how to make non-animated unit graphics. I'm going to add some more (such as an additional section on how to make shadows) but this is the basic part. When I post it, I will include a couple of files that will help the user make files easier. For now if you want to try this out, use the text I included earlier in this thread for the text file, and open up one of the cow pictures that comes with the graphics editor patch to start your graphic off from (deleting the cow, of course).
      March 5, 2012, 17:43
      by Celestial_Dawn
      I think I've managed to figure out how the AIPs work. The AIPs certainly have a lot of information about the inner workings of the AI. Read and enjoy. AIP COMMENTS (based on default.aip) Default.aip is the first aip loaded at game start and contains a number of strings which are not found in the other personality aips. If repeated in the other aips, the new values take precedence over the default. // The next line was used in Dark Reign to specify a likelihood that a spy // would be seen... We can use that stuff in Civ3, too int infiltrator_period = 2; No clue. ...
      March 5, 2012, 17:33
      by Celestial_Dawn
      SET_FOOD_OR_PROD.FLI and SET_RESOURCE_DESIRE.FLI COMMENTS For all non-barbarians: 1. If cities = 0-1 and total population is 1, Maximise growth ratio (minimise turns to next pop) Pay as much wages as needed, minimise rations, average workday No PW Minimum workers on production tiles Maximum workers on food tiles Opening game strategy (this means explore more, and don't build roads yet - this is the same for all entries in this FLI so I won't repeat it) ...
      March 5, 2012, 17:27
      by Celestial_Dawn
      BEGINTURN.FLI(S) COMMENTS beginturn.fli is a template that is unused by the game. The settings for the various personalities are: Barbarian settle_dense, science_slow, diplomacybarbarians //Barbarian Cleric settle_dense, science_fast, diplomacypeacebackstab //Religious SciFew settle_loose, science_fast, diplomacypeaceloyal //Agreeable SciMany settle_dense, science_fast, diplomacypeaceloyal //Peaceful Slaver settle_dense, science_fast, diplomacywarbackstab //Slaver WarFew settle_loose, science_slow, diplomacywarloyal //Aggressive WarMany settle_dense, science_slow, diplomacywarbackstab //Militant Note that both science_fast and science_slow are identical, Activision decided to set them all to a fast science rate, but differentiated them according to their research goals - i.e. do you research war branches rather than development brances of the tech tree. I think this approach is just fine....
      March 5, 2012, 17:23
      by Celestial_Dawn
      AIPLOADER.FLI COMMENTS OUTPUT primary_loaded is only in aiploader.fli primary_loaded is to make sure that the AIPs are loaded in the correct order. This is to ensure that survival_mode.aip and citywall.aip are only loaded after the personality aips have first been loaded. Personality AIPs are always loaded on the first turn (turn 0). Otherwise, not relevant...
      February 13, 2012, 19:07
      by Mr Ogre
      How to stagnate growth and technology

      "When you create scenarios, will you be able to stagnate growth? For example, if I wanted to create a Viking scenario would you be able to ensure the tech level remains the same for that time period as opposed to being able to develop nuclear weapons? In Civ 2 that was one of the things that bothered me most. Someone creates a WW2 scenario and it quickly turns into a Desert Storm scenario."
      You can "stagnate" technology through three routes:...
      February 11, 2012, 21:16