VOID Abort()
messagebox 'Msgbox'
{
AddGold(g.player, 100);
//No message will appear when 'Msgbox' is called, and the player will receive 100 gold.
VOID AddBuildingToBuildList(city, buildingType)
if(!city[0].buildqueuelength)
{
//if the city is not building anything, it will put the improvement City Walls into its build queue.
VOID AddCenter(location)
HandleEvent(CreateCity) post
{
//causes a recenter on a city when it has been built.
VOID AddCity(city)
messagebox 'MsgBox'
{
AddCity(my_city);
Text(ID_MY_TEXT);
//allows reference to a city in the text if it is called by a handler or trigger which does not reference the city
VOID AddCityByIndex(owner, index)
AddCityByIndex(g.player, 0);
//adds the current player's first city into the reference
VOID AddEffect(location, namestring, soundID)
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. Use AddCenter(loc) first to center on the location.
VOID AddFeat(featIndex, playerIndex)
VOID AddGold(player, amount)
AddGold(0, 100);
//gives the Barbarians 100 gold.
VOID AddMovement(unit, amount)
AddMovement(unit[0], 200);
//gives the unit an additional 200 movement points, enough to move across 2 grassland tiles or 1 forest tile.
INT AddPops(city, count)
AddPops(city[0], 5);
//increases city[0]'s size by 5
VOID AddUnit(unit)
AddUnit(unit[0]);
//adds unit[0] to the context when it is not already referenced.
VOID AddUnitToBuildList(city, unittype)
AddUnitToBuildList(city[0], UnitDB(UNIT_SETTLER));
//causes city[0] to append a Settler unit to its build queue.
VOID AddWonderToBuildList(city, wonder)
if(city[0].buildqueuelength < 5)
{
//if there are fewer than 5 items in city[0]'s build queue, append Ramayana to the list.
INT AllUnitsCanBeExpelled(location)
// Declare variables
int_t i;
location_t my_loc;
// Initialise these variables
for(i = 0; i < 8; i = i + 1)
{
GetNeighbor(city[0].location, i, my_loc);
if(AllUnitsCanBeExpelled(my_loc))
{
//do stuff
return CONTINUE;
//if all of the enemy units 1 tile away from city[0], do stuff, then break the for loop and continue.
INT ArmyIsValid(army)
VOID AttachRobot(index)
for(i = 0; i <= 4; i = i + 1)
{
//causes players 0 through 4 to be controlled by the AI.
VOID Attract(ldlstr)
Attract("ControlPanelWindow.ControlPanel.TurnButton");
//causes the End Turn button to flash until it is clicked or until StopAttract(ldlstr) is called.
VOID BlankScreen(1 or 0)
VOID BreakAlliance(player)
VOID CantAttackCity(city, onoff)
CantAttackCity(city[0], 1);
//does not allow any attacks on city[0].
VOID CantAttackUnit(unit, onoff)
// Declare variables
int_t i;
unit_t tmpUnit;
for(i = 0; i < player[0].units; i = i + 1)
{
if(tmpUnit.valid && tmpUnit.type == UnitDB(UNIT_SETTLER))
{
//this will loop through all of player[0]'s units; all Settler units will not be attackable.
VOID CantEndTurn(onoff)
CantEndTurn(1);
//does not allow the player to end the turn.
VOID CatchUp()
INT CellOwner(location)
VOID ChangeGlobalRegard(player, delta, explanationID, [duration])
INT Cities(player)
VOID CityCantRiotOrRevolt(city, onoff)
if(player[0].cities < 2)
{
{
if(CityIsValid(tmpCity))
{
//if player[0] has only 1 city, then make the city non-attackable
INT CityCollectingGood(city, good)
if(CityCollectingGood(city[0], GoodDB(TERRAIN_DESERT_GOOD_ONE))
{
//find out whether city[0] is collecting the Glass good
INT CityFoodDelta(city)
INT CityHasBuilding(city, building)[/B]
if(CityHasBuilding(city[0], "IMPROVE_TEMPLE"))
{
//returns 1 if city[0] has a temple
INT CityHasWonder(city, wonder)
if(CityHasWonder(city[0], WonderDB(WONDER_EMPIRE_STATE_BUILDING)))
{
//returns 1 if city[0] has the empire state building
INT CityIsNamed(city, "String")
INT CityIsValid(city)
INT CityNameCompare(city, stringID)
INT CityStarvationTurns(city)
INT CivilizationIndex(civname)
if(PlayerCivilization(g.player) == CivilizationIndex("AMERICANS"))
{
This is especially useful for creating victory conditions for specific civilizations in scenarios. See also PlayerCivilization and GameOver.
VOID ClearBattleFlag(unit)
VOID ClearBuildQueue(city)
city_t tmpCity;
int_t i;
for(i = 0; i < player[0].cities; i = i + 1)
{
if(CityisValid(tmpCity))
{
//clears the build queues of all of player[0]’s cities
VOID ClearOrders(unit)
for(i = 0; i < player[0].units; i = i + 1)
{
if(tmpUnit.valid)
{
//clears the build queues of all of player[0]’s cities
INT CreateCity(owner, nearlocation, distance[, savecity])
//when the first city is created (i.e. I settle a settler)
city_t my_city;
city_t new_city;
HandleEvent(CreateCity) post
{
{
//I want to create a city about 5 tiles from my first city,
//and then save the new city in a variable
CreateCity(player[0], my_city.location, 5, new_city);
INT CreateCoastalCity(owner, nearlocation, distance[, savecity])
VOID CreateUnit(owner, type, nearlocation, distance[, saveunit])
//I want to put (cheat) a defender in my city as soon as I build it
HandleEvent(CreateCity) post
{
VOID DamageUnit(unit, hp)
VOID Deselect()
VOID DestroyBuilding(city, building)
Example:
DestroyBuilding(city[0], BuildingDB(IMPROVE_SILO));
VOID DetachRobot(index)
for(i = 1; i < max_players; i = i + 1)
{
{
//detaches the AI from every player except the Barbarians
VOID DisableChooseResearch()
VOID DisableClose()
VOID DisableMessageClass(int class)
VOID DisableTrigger('trigger_id')
HandleEvent(CreateUnit) 'ExampleTrigger' post
{
//'ExampleTrigger' won't fire again after this handler until it is re-enabled.
HandleEvent(BeginTurn) 'NextTrigger' post
{
DisableTrigger('ExampleTrigger');
INT Distance(point1, point2)
VOID DoFreeSlaves(city)
VOID DontSave()
VOID DoPillageOwnLand(unit)
VOID EnableChooseResearch()
VOID EnableMessageClass(class)
VOID EnableTrigger('trigger_id')
VOID EndTurn()
VOID ExecuteAllOrders()
VOID ExitToDesktop ()
VOID ExitToShell()
VOID Export("filename")
VOID ExtractLocation(location, locationvar)
//I want to save the location to which I moved my unit
location_t my_loc;
HandleEvent(MoveUnits) 'MoveUnit' post
{
//and I only want to run this once
DisableTrigger(‘MoveUnit’);
VOID EyePoint(location (or unit or city))
INT FindCoastalCity(player, cityvar)
//I want to save this city in my variable
city_t my_coastal_city;
HandleEvent(CreateCity) post
{
{
{
DisableTrigger('FindCoastalCity');
}
VOID FinishImprovements(location)
VOID Flood(stage)
VOID ForceTurnDisplay()
INT GameOver(player, reason)
//player[0] wins the game
GameOver(player[0], 1);
INT GetArmyByIndex(player, army, armyVar)
//Find my first army
army_t my_army;
GetArmyByIndex(player[0], 0, my_army);
VOID GetArmyFromUnit(unit, armyVar)
unit_t my_unit;
army_t my_army;
// Get the army containing my first unit
GetUnitByIndex(player[0], 0, my_unit);
// Get the army my_unit is in
GetArmyFromUnit(my_unit, my_army);
INT GetCityByIndex(player, index, cityVar)
INT GetCityByLocation(location, city)
INT GetCurrentRound ()
INT GetCurrentYear ()
INT GetMapHeight ()
INT GetMapWidth ()
INT GetNearestWater (fromLocation, toLocation)
INT GetNeighbor(locationIn, direction, locationOut)
0 North
1 Northeast
2 East
3 Northwest
4 Southeast
5 West
6 Southwest
7 South
Example:
// I want to get the tile North of my first city
HandleEvent(CreateCity) ‘GetCityNorthNeighbor’ post
{
{
// Run this only once
DisableTrigger(‘GetCityNorthNeighbor’);
VOID GetRandomNeighbor(location, newlocation)
INT GetRevolutionLevel()
INT GetRiotLevel()
INT GetStringDBIndex(stringid)
scenarioAuthorStringId = GetStringDBIndex(ID_SCENARIO_AUTHOR);
// Then to use it later,
SetStringByDBIndex(1, scenarioAuthorStringId);
Text(ID_SCENARIO_AUTHOR_MESSAGE);
INT GetUnitByIndex(player, index, unitVar)
INT GetUnitFromArmy(army, index, unit)
INT GetUnitFromCell(location, index, unit)
INT GetUnitsAtLocation (location)
VOID GodMode(onoff)
Toggles god mode (whole map and all units visible) on (onoff=1) or off (onoff=0)
VOID GrantAdvance(player, advance)
INT HasAdvance(player, advance_name)
//check to see if the player has Agriculture
if(!HasAdvance(player[0], AdvanceDB(ADVANCE_AGRICULTURE))
{
GrantAdvance(player[0], AdvanceDB(ADVANCE_AGRICULTURE));
INT HasGood(location)
INT HasRiver(location)
VOID Heal (unit)
VOID Import("filename")
INT IsUnitAtHead (city)
INT IsUnitInBuildList(city, unittype)
INT IsBuildingAtHead(city)
INT IsBuildingInBuildList(city, buildingtype)
INT IsCivilian(unit)
INT IsContinentBiggerThan(location, size)
INT IsFlankingUnit(unit)
INT IsFortress(player, location)
INT IsInZOC(player, location)
INT IsRoad(player, location)
INT IsVeteran(unit)
INT IsWonderAtHead(city)
INT IsWonderInBuildList(city, wonder)
INT IsActiveDefender(unit)
INT IsBombardingUnit(unit)
INT IsCitySelected()
INT IsCounterBombardingUnit(unit)
INT IsHumanPlayer(player)
INT IsPlayerAlive(player)
INT IsUnderseaCity(city)
INT IsUnitSelected()
VOID KillUnitFromBuildList(city, unit)
VOID KillBuildingFromBuildList(city, building)
VOID KillWonderFromBuildList(city, wonder)
VOID Kill()(Messages only)
VOID KillMessages(objectname)
VOID KillUnit(unit)
VOID LibraryAdvance()
VOID LibraryBuilding()
VOID LibraryConcept()
VOID LibraryGovernment()
VOID LibraryTerrain()
VOID LibraryTileImprovement()
VOID LibraryUnit()
VOID LibraryWonder()
VOID LoadGame(name)
VOID MakeLocation(locationvar, x, y)
VOID Message(player, 'message_id')
VOID MessageAll('message_id')
VOID MessageAllBut(player, 'message_id')
VOID MesssageClass(int)
VOID MessageType(message_type)
VOID OpenBuildQueue(city)
VOID OpenCity()
VOID OpenCityTab()
VOID OpenCiv()
VOID OpenCivTab()
VOID OpenDiplomacy()
VOID OpenInfo()
VOID OpenOptions()
VOID OpenScenarioEditor()
VOID OpenScience()
VOID OpenTrade()
VOID OpenUnit()
VOID Ozone()
VOID PlantGood(location)
VOID PlaySound(soundname)
INT PlayerCityCount(player)
INT PlayerCivilization(player)
INT PlayerGold(player)
INT PlayerHasWonder(player, wonder)
INT Preference("pref_name")
VOID QuitToLobby()
INT Random(range)
VOID RemoveAdvance(player, advance)
VOID SaveGame(name)
VOID SelectCity(city)
VOID SelectUnit(unit)
VOID SetAllCitiesVisible(player)
VOID SetGovernment(gov)
VOID SetPreference("pref_name", value)
VOID SetPW(player, pw)
VOID SetResearching(player, what)
VOID SetScience(player, level)
VOID SetString(index, stringid)
SCENARIO_AUTHOR_MESSAGE "This scenario was written by [string.1.name]"
SCENARIO_AUTHOR "Joe Rumsey"
And you put this in a SLIC messagebox:
SetString(1, ID_SCENARIO_AUTHOR);
Text(ID_SCENARIO_AUTHOR_MESSAGE);
The resulting text in the message will be: This scenario was written by Joe Rumsey
VOID SetStringByDBIndex(index, stringindex)
VOID Show()
INT Stacked(location)
VOID StartTimer(index, duration)
VOID StealRandomAdvance()
VOID StealSpecificAdvance()
VOID StopTimer(INT)
VOIDSquaredDistance(location1, location2)
VOID Terraform(location, terrain)
0 TERRAIN_TYPE_FOREST
1 TERRAIN_TYPE_PLAINS
2 TERRAIN_TYPE_TUNDRA
3 TERRAIN_TYPE_GLACIER
4 TERRAIN_TYPE_GRASSLAND
5 TERRAIN_TYPE_DESERT
6 TERRAIN_TYPE_SWAMP
7 TERRAIN_TYPE_JUNGLE
8 TERRAIN_TYPE_MOUNTAIN
9 TERRAIN_TYPE_HILL
10 TERRAIN_TYPE_WATER_SHALLOW
11 TERRAIN_TYPE_WATER_DEEP
12 TERRAIN_TYPE_WATER_VOLCANO
13 TERRAIN_TYPE_SPACE
14 TERRAIN_TYPE_WATER_BEACH
15 TERRAIN_TYPE_WATER_SHELF
16 TERRAIN_TYPE_WATER_TRENCH
17 TERRAIN_TYPE_WATER_RIFT
18 TERRAIN_TYPE_DEAD
19 TERRAIN_TYPE_BROWN_HILL
20 TERRAIN_TYPE_BROWN_MOUNTAIN
21 TERRAIN_TYPE_WHITE_HILL
22 TERRAIN_TYPE_WHITE_MOUNTAIN
23 TERRAIN_TYPE_DEAD_HILL
Mods may allow more terrain type depending on their terrain.txt.
INT TerrainType(location)
VOID Text(stringid)(Messages only)
INT TileHasImprovement(location, imptype)
VOID Title(stringid)(Messages only)
VOID ToggleVeteran(unit, onoff)
INT TradePoints(player)
INT TradePointsInUse(player)
INT TradeRoutes(player)
INT UnitCount(player, type)
INT UnitsInCell(location)
VOID UseDirector()(Messages only)
INT WonderOwner(wonder)
BACK TO MODIFICATION INDEX PAGE