[an error occurred while processing this directive] Modification

This is a complete listing of events. Some of these are not safe to use from SLIC. A few are just plain obsolete and don't do anything useful. Events with arguments prefaced by GEA_ cannot be generated from SLIC, but can be triggered on.

How to use events from SLIC:

To add a handler for a named event:
HandlEvent(EventName) 'HandlerName' [pre | post] {
    // Your code here
}
Example:
location_t location_of_death;
// ...
// set location_of_death to some square first
// ...
// This handler will kill every unit that enters a preset location of death
HandleEvent(MoveUnits) 'MyMoveHandler' post {
	if(army[0].location == location_of_death) {
		int_t u;
		for(u = 0; u < army[0].size; u++) {
			  unit_t unit;
			  GetUnitFromArmy(army[0], u, unit);
			  Event:KillUnit(unit, 0, -1);
		}
	}
}

The priority of the handler can be either pre or post. A "pre" handler runs before the in-game code, a "post" handler runs afterwards. Note that for some events, some arguments may contain invalid data by the time a post handler is called. (For example, in a KillUnit post handler, the unit will already be dead).



To generate an event from SLIC:

Event:EventName(arguments)
Example (also see above):
    Event:KillUnit(unit, 0, -1);

Generates a KillUnit event for the specified unit. Note that events always execute ASYNCHRONOUSLY. The event is added to a queue, and is executed only after all events added before it have finished executing. So in the above example, the units do not actually die until after the handler has finished executing.



The complete listing of all events

int_t<player> denotes an integer argument that corresponds to a player. Ints and players are mostly interchangeable in SLIC, they are listed specially here for clarity.
int_t<direction> is a direction argument. The range is from 0-7.
  • MoveOrder(army_t, GEA_Path, location_t, int_t)
    Give a pathed move order to an army
  • MoveToOrder(army_t, int_t<direction>)
    Give a single square move order to an army
  • MovePathOrder(army_t, location_t)
    Give a move order to an army, creates a new path
  • SleepOrder(army_t)
    Put an army to sleep
  • UnloadOrder(army_t, location_t)
    Tell an army to unload its cargo
  • MoveUnloadOrder(army_t, GEA_Path, location_t, int_t)
    Army moves then unloads
  • EntrenchOrder(army_t)
    Entrench an army
  • DetrenchOrder(army_t)
    Detrench an army
  • DisbandArmyOrder(army_t)
    Disband an army
  • GroupOrder(army_t)
    Group other units in the square into the army
  • GroupUnitOrder(army_t, unit_t)
    Group specified unit into the army
  • UngroupOrder(army_t)
    Ungroup an army
  • ParadropOrder(army_t, location_t)
    Drop an army from a plane
  • InvestigateCityOrder(army_t, location_t)
    Army invesigates city
  • NullifyWallsOrder(army_t, location_t)
    Army nullifies walls
  • StealTechnologyOrder(army_t, location_t)
    Army steals technology
  • InciteRevolutionOrder(army_t, location_t)
    Army incites a revolution
  • AssassinateRulerOrder(army_t, location_t)
    Army assasinates a ruler
  • InvestigateReadinessOrder(army_t, location_t)
    Army investigates readiness
  • BombardOrder(army_t, location_t)
    Army bombards
  • FranchiseOrder(army_t, location_t)
    Army franchises
  • SueOrder(army_t, location_t)
    Army sues
  • SueFranchiseOrder(army_t)
    Army sues franchise
  • ExpelOrder(army_t, location_t)
    Army expels
  • EstablishEmbassyOrder(army_t, location_t)
    Army establishes embassy
  • AdvertiseOrder(army_t, location_t)
    Army advertises
  • PlantNukeOrder(army_t, location_t)
    Army plants a nuke
  • SlaveRaidOrder(army_t, location_t)
    Army slave raids
  • EnslaveSettlerOrder(army_t, location_t)
    Army enslaves a settler
  • UndergroundRailwayOrder(army_t, location_t)
    Army frees slaves
  • InciteUprisingOrder(army_t, location_t)
    Army incites slave uprising
  • BioInfectOrder(army_t, location_t)
    Army bio infects
  • PlagueOrder(army_t, location_t)
    Army inflicts a plague
  • NanoInfectOrder(army_t, location_t)
    Army nano infects
  • ConvertCityOrder(army_t, location_t)
    Army converts a city
  • ReformCityOrder(army_t)
    Army reforms a city
  • SellIndulgencesOrder(army_t, location_t)
    Army sells indulgences
  • SoothsayOrder(army_t, location_t)
    Army says sooth. "Sooth!" says Army, "Sooth!"
  • CloakOrder(army_t)
    Army cloaks
  • UncloakOrder(army_t)
    Army uncloaks
  • RustleOrder(army_t, location_t)
    Army rustles
  • CreateParkOrder(army_t, location_t)
    Army creates a park
  • CreateRiftOrder(army_t, location_t)
    Army creates a rift
  • PillageOrder(army_t)
    Army pillages
  • InjoinOrder(army_t, location_t)
    Army injoins
  • UseSpaceLadderOrder(army_t)
    Army climbs a space ladder
  • AirliftOrder(army_t, location_t)
    Army airlifts
  • DescendOrder(army_t)
    Army Descends
  • ThrowPartyOrder(army_t, location_t)
    Army gets down and boogies
  • PirateOrder(army_t)
    Army dons an eyepatch and parrot and plunders a trade route
  • GetExpelledOrder(army_t, location_t, int_t<player>)
    This army gets expelled
  • SettleOrder(army_t)
    This army settles
  • BoardTransportOrder(army_t)
    Move this army into a transport in the same cell.
  • LaunchOrder(army_t, location_t)
    Give a space launch order to this army
  • TargetOrder(army_t, location_t)
    Give a nuclear missile a target
  • ClearTargetOrder(army_t)
    Clear a nuclear missile's target
  • CityRiot(city_t)
    A city riots
  • CalcScores(int_t<player>)
    Recalculate a player's scores
  • CaptureCity(city_t, int_t<player>, int_t)
    Make a city change hands
  • MoveArmy(army_t, int_t<direction>, int_t, int_t, location_t)
    Move an army one square
  • ContactMade(int_t<player>, int_t<player>)
    Contact between two players established
  • ClearOrders(army_t)
    Clear an army's orders
  • FinishAttack(army_t, location_t)
    An army attacks someone
  • FinishMove(army_t, int_t<direction>, location_t, int_t)
    The last stage of an army moving before the MoveUnits event
  • CantMoveYet(army_t, int_t<direction>, location_t)
    Added when an army tries to move but is out of move points
  • MoveUnits(army_t, location_t, location_t)
    An army always moves on this event, no more legality checks at this point
  • MoveIntoTransport(army_t, location_t)
    Move an army into a transport (or several transports)
  • Battle(army_t, location_t)
    An army attacks a location
  • BattleAftermath(army_t, location_t, unit_t, unit_t, int_t<player>, int_t<player>, int_t)
    Clean up the battlefield
  • KillUnit(unit_t, int_t, int_t<player>)
    Kill a unit
  • KillCity(city_t, int_t, int_t<player>)
    Kill a city
  • LaunchUnit(unit_t, location_t)
    Launch this unit into space
  • Reentry(army_t)
    Bring this army back to earth
  • SetTarget(unit_t, city_t)
    Give a nuclear missile (unit) a target
  • ClearTarget(unit_t)
    Clear a nuclear missile's target
  • BeginTurn(int_t<player>, int_t)
    Begin a player's turn
  • WormholeTurn(int_t<player>)
    Begin wormhole turn
  • PlayerPatience(int_t<player>)
    Begin player patience
  • PeaceMovement(int_t<player>)
    Begin player peace movement
  • PollutionTurn(int_t<player>)
    Begin player pollution
  • BeginTurnAllCities(int_t<player>)
    Player event before cities begin turn
  • BeginTurnProduction(int_t<player>)
    Begin player production
  • BeginTurnSupport(int_t<player>)
    Begin player support phase
  • BeginTurnImprovements(int_t<player>)
    Begin player improvements phase
  • BeginTurnAgreements(int_t<player>)
    Begin player diplomatic agreements phase
  • ResetAllMovement(int_t<player>)
    Reset all unit movement points
  • AttemptRevolt(int_t<player>)
    Make cities revolt as needed
  • BeginTurnEndGame(int_t<player>)
    Begin endgame processing phase
  • BeginTurnGovernment(int_t<player>)
    Handle government changes
  • FinishBeginTurn(int_t<player>)
    Last event in player begin turn phase
  • FinishBuildPhase(int_t<player>)
    Cities will have added all their build events when this fires
  • StartMovePhase(int_t<player>)
    Added at the end of the primary cb for FinishBuildPhase
  • ProcessUnitOrders(int_t<player>)
    Added by StartMovePhaseEvent, needed to come later
  • AIFinishBeginTurn(int_t<player>)
    Also from StartMovePhaseEvent
  • UnitBeginTurnVision(unit_t, int_t<player>)
    Begin vision phase for enemy units
  • BeginTurnUnit(unit_t)
    Begin turn for own unit
  • CityTurnPreProduction(city_t)
    Early begin turn phase, before production
  • CityBeginTurn(city_t)
    Main city begin turn event
  • CityBeginTurnVision(city_t, int_t<player>)
    Vision phase for enemy cities
  • BeginTurnArmy(army_t)
    Begin turn for own army
  • BuildUnit(city_t, int_t)
    Add a unit to a city's queue
  • BuildBuilding(city_t, int_t)
    Add a building to a city's queue
  • BuildWonder(city_t, int_t)
    Add a wonder to a city's queue
  • BuildFront(city_t)
    Try to build the first thing in a city's queue
  • CreateUnit(int_t<player>, location_t, city_t, int_t, int_t [, unit_t])
    Create a unit
  • ZeroProduction(city_t)
    Set a city's stored production to 0
  • Settle(army_t [, int_t])
    Found a city with a settler
  • CreateCity(int_t<player>, location_t, int_t, int_t [, city_t])
    Create a city (first int is cause, second int is unit type that settled (-1 if not from unit)
  • CreateImprovement(int_t<player>, location_t, int_t, int_t)
    Start building a terrain improvement
  • ImprovementAddTurn(GEA_Improvement)
    Add a turn to an improvement
  • ImprovementComplete(GEA_Improvement [, location_t] [, int_t<player>] [, int_t])
    An improvement is complete. Location, owner, and type filled in after completion
  • PopToCity(GEA_Pop)
    Move a pop to it's home city
  • PopToField(GEA_Pop, location_t)
    Move a pop to a new location
  • MakePop(city_t [, int_t<player>])
    Create a pop
  • KillPop(city_t)
    Remove a pop
  • CityInfluenceChanged(city_t, int_t)
    Triggered when city influence radius changes (city,delta).
  • GrantAdvance(int_t<player>, int_t, int_t)
    Give a player an advance
  • SendGood(int_t, city_t, city_t)
    Send a good from one city to another
  • TradeBid(int_t<player>, int_t, city_t, city_t)
    Bid on a foreign good
  • KillTradeRoute(GEA_TradeRoute, int_t)
    Kill a trade route
  • SetPiratingArmy(GEA_TradeRoute, army_t)
    Set army pirating trade route
  • CreatedArmy(army_t)
    An empty army was created
  • AddUnitToArmy(unit_t, army_t, int_t)
    Insert a unit into an army
  • FinishUnload(army_t, army_t, location_t)
    Finish the unload process for an army
  • SetUnloadMovement(army_t)
    Take away the army's move points after an unload (Except CanBeachAssault units)
  • SetUnloadMovementUnit(unit_t)
    Take a unit's movement points away after an unload.
  • FinishUprising(city_t, army_t, int_t)
    Finish a slave uprising
  • CleanupUprising(army_t, city_t)
    Really finish a slave uprising
  • GiveMap(int_t<player>, int_t<player>)
    Give map from first player to second player
  • GiveCity(city_t, int_t<player>)
    Give a city to a foreign player
  • SleepUnit(unit_t)
    Put a unit to sleep
  • WakeUnit(unit_t)
    Wake a unit
  • EntrenchUnit(unit_t)
    Entrench a unit
  • DetrenchUnit(unit_t)
    Detrench a unit
  • WakeArmy(army_t)
    Wake all units in an army
  • DisplayInvestigationWindow(unit_t, city_t)
    Display the investigate city window
  • InciteRevolutionUnit(unit_t, city_t)
    Unit incites a revolution
  • SubGold(int_t<player>, int_t)
    Subtract gold from player
  • AddGold(int_t<player>, int_t)
    Add gold to player
  • AssassinateRulerUnit(unit_t, city_t)
    Unit bombs cabinet
  • MakeFranchise(unit_t, city_t, int_t<player>)
    Add a franchise to a city
  • Teleport(army_t, location_t)
    Army teleports
  • PlantNukeUnit(unit_t, city_t)
    Unit planted a nuke
  • SlaveRaidCity(unit_t, city_t)
    Unit raids a city for slaves
  • Lawsuit(army_t, unit_t, location_t)
    Sue an army
  • RemoveFranchise(army_t, unit_t, city_t)
    Sue a franchise
  • ExpelUnits(army_t, location_t)
    Army expelling units
  • NukeCityUnit(unit_t, city_t)
    A unit nukes a city
  • NukeLocationUnit(unit_t, location_t)
    A unit nukes something else
  • NukeCity(city_t, int_t<player>)
    The actual event that nukes a city
  • EnslaveSettler(army_t, unit_t, unit_t)
    Enslave a settler
  • UndergroundRailwayUnit(unit_t, city_t)
    Free slaves from city
  • InciteUprisingUnit(unit_t, city_t)
    Incite a slave uprising
  • EstablishEmbassyUnit(unit_t, city_t)
    Attempt to establish an embassy
  • EstablishEmbassy(int_t<player>, int_t<player>)
    Actually establish an embassy
  • ThrowPartyUnit(unit_t, city_t)
    Attempt to throw a party
  • ThrowParty(int_t<player>, int_t<player>)
    Actually throw a party
  • BioInfectCityUnit(unit_t, city_t)
    Unit infects city
  • BioInfectCity(city_t, int_t<player>)
    City gets infected
  • PlagueCityUnit(unit_t, city_t)
    Unit plagues a city
  • PlagueCity(city_t, int_t<player>)
    City gets plagues
  • NanoInfectCityUnit(unit_t, city_t)
    Unit nanoinfects city
  • NanoInfectCity(city_t, int_t<player>)
    City gets nanoinfected
  • ConvertCityUnit(unit_t, city_t)
    Unit converts city
  • ConvertCity(city_t, int_t<player>, int_t)
    City actually converted
  • ReformCityUnit(unit_t, city_t)
    Unit reforms city
  • UnconvertCity(city_t)
    City is reformed
  • IndulgenceSaleMade(unit_t, city_t)
    Indulgence sale made
  • AddHappyTimer(city_t, int_t, int_t, int_t)
    Cause a timed amount of happiness or unhappiness
  • CreateParkUnit(unit_t, city_t)
    Unit creates a park
  • CreatePark(city_t, int_t<player>)
    City becomes a park
  • CutImprovements(location_t)
    Pillage terrain improvements
  • PillageUnit(unit_t)
    Unit pillages
  • InjoinUnit(unit_t, city_t)
    Unit injoins city
  • InjoinCity(city_t, int_t<player>)
    City is injoined
  • CreateBuilding(city_t, int_t)
    Create a building
  • CreateWonder(city_t, int_t)
    Create a wonder
  • RunCombat(army_t, location_t, int_t<player>, int_t<player>)
    Run one round of combat
  • StartCombat(army_t, location_t)
    Start a battle
  • BuyFront(city_t)
    Rush buy an item in a city
  • SellBuilding(city_t, int_t)
    Sell a building from a city
  • BorderIncursion(int_t<player>, int_t<player>)
    Occurs when army first crosses foreign border.
  • BorderPullout(int_t<player>, int_t<player>)
    Occurs when army leaves foreign border.
  • ComputeMotivations(int_t<player>)
    Determine fears and desires
  • ReactionMotivation(int_t<player>, int_t<player>)
    Find new proposals motivated as reactions to game events
  • FearMotivation(int_t<player>, int_t<player>, int_t)
    Find new proposal for fear motivation
  • DesireMotivation(int_t<player>, int_t<player>, int_t)
    Find new proposal for desire motivation
  • NewProposal(int_t<player>, int_t<player>)
    A new proposal ha sbeen made.
  • Threaten(int_t<player>, int_t<player>)
    A player has been threatened.
  • Counter(int_t<player>, int_t<player>)
    A proposal has been countered.
  • Reject(int_t<player>, int_t<player>)
    A proposal has been rejected.
  • Accept(int_t<player>, int_t<player>)
    A proposal has been accepted.
  • ResponseReady(int_t<player>, int_t<player>)
    Notify world that a diplomatic response is ready
  • NewProposalReady(int_t<player>, int_t<player>)
    Notify world that a new proposal is ready
  • ContinueDiplomacy(int_t<player>, int_t<player>)
    Decide if sender should make a new proposal.
  • ToggleInitiative(int_t<player>, int_t<player>)
    Initiative passes to party currently without initiative.
  • InitStrategicState(int_t<player>)
    Initialize strategic state
  • NextStrategicState(int_t<player>)
    Determine next strategic state
  • InitDiplomaticState(int_t<player>, int_t<player>)
    Initialize Diplomatic state
  • NextDiplomaticState(int_t<player>, int_t<player>)
    Determine next diplomatic state
  • StartNegotiations(int_t<player>)
    After computing motivations, select new proposals
  • BeginScheduler(int_t<player>)
    Match all armies with goals.
  • ProcessMatches(int_t<player>, int_t)
    Perform one pass through match list, executing matches.
  • NewNegotiationEvent(int_t<player>, int_t<player>)
    A new negotiation history event has been added
  • DisbandUnit(unit_t)
    Disband one unit
  • DisbandCity(city_t)
    Disband one city
  • TimerExpired(int_t)
    Triggered when a timer expires.
  • ArmyClicked(army_t)
    Triggered when the user clicks an army with the mouse.
  • ArmySelected(army_t)
    Triggered when the user selects an army.
  • ArmyDeselected(army_t)
    Triggered when the user deselects an army.
  • CityClicked(city_t)
    Triggered when the user clicks a city with the mouse.
  • CitySelected(city_t)
    Triggered when the user selects a city.
  • CityDeselected(city_t)
    Triggered when the user deselects a city.
  • AccomplishFeat(int_t, int_t<player>)
    Someone has accomplished a feat (int = feat DB index)
  • MADLaunch(unit_t)
    A targetted launches towards its target.
  • BuildingRemoved(city_t, int_t)
    Triggered when a building is removed.
  • WonderRemoved(city_t, int_t)
    Triggered when a wonder is removed.
  • NetworkTurnSync(int_t<player>)
    Process the start of a turn for this player
  • EndAIClientTurn(int_t<player>)
    Used in automated testing only
  • EnterAge(int_t<player>, int_t)
    Player enters a new age.
  • KillTile(location_t)
    A map tile dies (turns to polluted)
  • ActivateAllUnits(location_t)
    Detrench/wake all units at location
  • BeginTurnExecute(army_t)
    Call ExecuteOrders on an Army for a begin turn (normally AI only)
  • KillPlayer(int_t<player>, int_t, int_t<player>)
    A player has died (all cities gone)
  • EndTurn(int_t<player>)
    End a player's turn.
  • VictoryMoveOrder(army_t, location_t)
    The move into an attacked square after winning a battle
  • OpenInitialCityInterface(city_t)
    Generated when a city is initialized, after all population is added.


  • BACK TO MODIFICATION INDEX PAGE

    [an error occurred while processing this directive]