Announcement

Collapse
No announcement yet.

SLIC2-Events

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SLIC2-Events

    This is a complete listing of events. Some of these are not safe to use from SLIC. A few are just plain obsolete and do not 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 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 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)
      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)
      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)
      Recalculate a player's scores
    • CaptureCity(city_t, int_t, int_t)
      Make a city change hands
    • MoveArmy(army_t, int_t, int_t, int_t, location_t)
      Move an army one square
    • ContactMade(int_t, int_t)
      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, location_t, int_t)
      The last stage of an army moving before the MoveUnits event
    • CantMoveYet(army_t, int_t, 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, int_t, int_t)
      Clean up the battlefield
    • KillUnit(unit_t, int_t, int_t)
      Kill a unit
    • KillCity(city_t, int_t, int_t)
      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, int_t)
      Begin a player's turn
    • WormholeTurn(int_t)
      Begin wormhole turn
    • PlayerPatience(int_t)
      Begin player patience
    • PeaceMovement(int_t)
      Begin player peace movement
    • PollutionTurn(int_t)
      Begin player pollution
    • BeginTurnAllCities(int_t)
      Player event before cities begin turn
    • BeginTurnProduction(int_t)
      Begin player production
    • BeginTurnSupport(int_t)
      Begin player support phase
    • BeginTurnImprovements(int_t)
      Begin player improvements phase
    • BeginTurnAgreements(int_t)
      Begin player diplomatic agreements phase
    • ResetAllMovement(int_t)
      Reset all unit movement points
    • AttemptRevolt(int_t)
      Make cities revolt as needed
    • BeginTurnEndGame(int_t)
      Begin endgame processing phase
    • BeginTurnGovernment(int_t)
      Handle government changes
    • FinishBeginTurn(int_t)
      Last event in player begin turn phase
    • FinishBuildPhase(int_t)
      Cities will have added all their build events when this fires
    • StartMovePhase(int_t)
      Added at the end of the primary cb for FinishBuildPhase
    • ProcessUnitOrders(int_t)
      Added by StartMovePhaseEvent, needed to come later
    • AIFinishBeginTurn(int_t)
      Also from StartMovePhaseEvent
    • UnitBeginTurnVision(unit_t, int_t)
      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)
      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, 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, 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, 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] [, 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])
      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, 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, 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, int_t)
      Give map from first player to second player
    • GiveCity(city_t, int_t)
      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, int_t)
      Subtract gold from player
    • AddGold(int_t, int_t)
      Add gold to player
    • AssassinateRulerUnit(unit_t, city_t)
      Unit bombs cabinet
    • MakeFranchise(unit_t, city_t, int_t)
      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)
      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, int_t)
      Actually establish an embassy
    • ThrowPartyUnit(unit_t, city_t)
      Attempt to throw a party
    • ThrowParty(int_t, int_t)
      Actually throw a party
    • BioInfectCityUnit(unit_t, city_t)
      Unit infects city
    • BioInfectCity(city_t, int_t)
      City gets infected
    • PlagueCityUnit(unit_t, city_t)
      Unit plagues a city
    • PlagueCity(city_t, int_t)
      City gets plagues
    • NanoInfectCityUnit(unit_t, city_t)
      Unit nanoinfects city
    • NanoInfectCity(city_t, int_t)
      City gets nanoinfected
    • ConvertCityUnit(unit_t, city_t)
      Unit converts city
    • ConvertCity(city_t, int_t, 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)
      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)
      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, int_t)
      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, int_t)
      Occurs when army first crosses foreign border.
    • BorderPullout(int_t, int_t)
      Occurs when army leaves foreign border.
    • ComputeMotivations(int_t)
      Determine fears and desires
    • ReactionMotivation(int_t, int_t)
      Find new proposals motivated as reactions to game events
    • FearMotivation(int_t, int_t, int_t)
      Find new proposal for fear motivation
    • DesireMotivation(int_t, int_t, int_t)
      Find new proposal for desire motivation
    • NewProposal(int_t, int_t)
      A new proposal ha sbeen made.
    • Threaten(int_t, int_t)
      A player has been threatened.
    • Counter(int_t, int_t)
      A proposal has been countered.
    • Reject(int_t, int_t)
      A proposal has been rejected.
    • Accept(int_t, int_t)
      A proposal has been accepted.
    • ResponseReady(int_t, int_t)
      Notify world that a diplomatic response is ready
    • NewProposalReady(int_t, int_t)
      Notify world that a new proposal is ready
    • ContinueDiplomacy(int_t, int_t)
      Decide if sender should make a new proposal.
    • ToggleInitiative(int_t, int_t)
      Initiative passes to party currently without initiative.
    • InitStrategicState(int_t)
      Initialize strategic state
    • NextStrategicState(int_t)
      Determine next strategic state
    • InitDiplomaticState(int_t, int_t)
      Initialize Diplomatic state
    • NextDiplomaticState(int_t, int_t)
      Determine next diplomatic state
    • StartNegotiations(int_t)
      After computing motivations, select new proposals
    • BeginScheduler(int_t)
      Match all armies with goals.
    • ProcessMatches(int_t, int_t)
      Perform one pass through match list, executing matches.
    • NewNegotiationEvent(int_t, int_t)
      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)
      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)
      Process the start of a turn for this player
    • EndAIClientTurn(int_t)
      Used in automated testing only
    • EnterAge(int_t, 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, int_t, int_t)
      A player has died (all cities gone)
    • EndTurn(int_t)
      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.
    Civ2 military advisor: "No complaints, Sir!"
Working...
X