Page 1 of 3 123 LastLast
Results 1 to 20 of 48

Thread: Investigation of Empire's script language

  1. #1
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Investigation of Empire's script language

    Well, I decided to create this topic beacuse Empire uses a different script language than Medieval and so far, this language is completely unknown. Anyway, I'm researching that language, and I would post here all the commands that I discover. So far, I have the following ones:

    *The comments are specified by the symbol "--"

    Conditions

    -AdviceJustDisplayed

    -camera_pan

    Triggers: An amount.
    Sample use: camera_pan = 12


    Events

    -if (always followed by a condition)

    -elseif (always followed by a condition)


    -then

    Description: Relates a condition with his command in a "counter".

    -require

    Description: Shows what requires a specified element to work.
    Sample use: local scripting = require "EpisodicScripting"


    Commands (are always preceded by the word "scripting.")

    -game_interface:technology_osmosis_for_playables_enable_culture ()

    Triggers: specify a culture between "dittos".
    Sample use: scripting.game_interface:technology_osmosis_for_playables_enable_culture("european")

    -HighlightComponent

    Description: Tests if this component is shown to player or not.
    Triggers: Component name, true or false.
    Sample use: scripting.HighlightComponent("radar", true)

    I will be updating this post, you can help to contribute with my research. Greetings;

  2. #2
    Hereje's Avatar Artifex
    Join Date
    Sep 2007
    Location
    Barcelona
    Posts
    701

    Default Re: Investigation of Empire's script language

    great mate!

  3. #3
    Pukin's Avatar Foederatus
    Join Date
    Dec 2008
    Location
    Euskadi-Spain
    Posts
    28

    Default Re: Investigation of Empire's script language

    Very good job Popolgio!!
    Thanks!

    Guardianes de Iberia
    El Tercio viejo de Iberia


  4. #4
    Ketzerfreund's Avatar Domesticus
    Join Date
    Nov 2006
    Location
    Berlin, Germany
    Posts
    2,233

    Default Re: Investigation of Empire's script language

    Well, the language as such that Empire uses for it's scripts is not completely unknown. It's LUA.
    "Oh, to be truly happy! To be an imbecile." - Wobbly Headed Bob

  5. #5
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: Investigation of Empire's script language

    Quote Originally Posted by Ketzerfreund View Post
    Well, the language as such that Empire uses for it's scripts is not completely unknown. It's LUA.
    Ok anyway, would be good gather all commands, events and conditions in this post.

  6. #6
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: Investigation of Empire's script language

    Please, I plead to a mod move this topic to modding workshop in ETW general discussion. Thank you very much;

  7. #7
    Ketzerfreund's Avatar Domesticus
    Join Date
    Nov 2006
    Location
    Berlin, Germany
    Posts
    2,233

    Default Re: Investigation of Empire's script language

    You can click the "report" button, if you want your thread moved. There's a little message box popping up then where you can say why and where.
    "Oh, to be truly happy! To be an imbecile." - Wobbly Headed Bob

  8. #8

    Default Re: Investigation of Empire's script language

    Excellent! If we could gather a list of conditions, commands, etc, this would definitely help those who wish to mod. I look forward to future updates.

  9. #9
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Investigation of Empire's script language

    The language is totally not-unknown, it's LuA

    What is unknown however is CA's API, ie what the game is exposing to the lua scripts.

    No thing is everything. Every thing is nothing.

  10. #10
    Choki's Avatar Domesticus
    Join Date
    Jan 2009
    Location
    Argentine
    Posts
    2,231

    Default Re: Investigation of Empire's script language

    VERY GOOD!! + REP FOR YOU.

  11. #11
    Campidoctor
    Join Date
    Sep 2006
    Location
    Cincinnati, OH
    Posts
    1,593

    Default Re: Investigation of Empire's script language

    Hopefully, they'll release all the triggers etc. like they did for Medieval and Rome. You know, when they release all those modding tools.

  12. #12
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: Investigation of Empire's script language

    Quote Originally Posted by alpaca View Post
    The language is totally not-unknown, it's LuA

    What is unknown however is CA's API, ie what the game is exposing to the lua scripts.
    I know, but anyway, I'm copiling the new commands, conditions and events. I think this is unknown so far. And if you want, you can help to compile them.

    Quote Originally Posted by CDMan477 View Post
    Hopefully, they'll release all the triggers etc. like they did for Medieval and Rome. You know, when they release all those modding tools.
    Ok, I didn't know that, then let's wait.

    Anyway, so far this post is the main guide, I think.

  13. #13
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Investigation of Empire's script language

    Alright, this is probably everything that seems to be in the game_interface as declared in EpisodicScripting:

    Code:
    declare_episode_three_victory
    remove_restricted_unit_record
    save_value
    disable_movement_for_ai_under_shroud
    display_turns
    show_shroud
    remove_visibility_trigger
    disable_movement_for_faction
    technology_osmosis_for_playables_enable_culture
    disable_town_spawning
    remove_restricted_building_level_record
    declare_episode_two_victory
    declare_episode_one_victory
    stop_user_input
    disable_elections
    register_instant_movie
    remove_attack_of_opportunity_overrides
    remove_time_trigger
    add_unit_model_overrides
    unveil_black_shroud
    add_custom_battlefield
    remove_custom_battlefield
    episodic_defend
    enable_ui
    grant_faction_handover
    episodic_attack
    add_restricted_unit_record
    enable_auto_generated_missions
    award_experience_level
    optional_extras_for_episodics
    remove_location_trigger
    remove_building_model_override
    add_location_trigger
    add_restricted_building_level_record
    compare_localised_string
    advance_to_next_campaign
    technology_osmosis_for_playables_enable_all
    set_zoom_limit
    set_campaign_ai_force_all_factions_boardering_humans_to_have_invasion_behaviour
    add_building_model_override
    add_settlement_model_override
    add_exclusion_zone
    get_string_label
    new
    is_new_game
    add_time_trigger
    remove_settlement_model_override
    trigger_custom_mission
    disable_movement_for_character
    force_diplomacy
    add_attack_of_opportunity_overrides
    register_movies
    cancel_actions_for
    disable_shopping_for_ai_under_shroud
    load_value
    remove_barrier
    set_map_bounds
    spawn_town_level
    add_visibility_trigger
    set_campaign_ai_force_all_factions_boardering_human_protectorates_to_have_invasion_behaviour
    To get this info, I created the following function and put it into scripting.lua in the campaign folder

    Code:
    function alpaFunction()
    	for value in pairs(getmetatable(scripting.game_interface)) do alpalog:write(value..'\n') end
    	return 'Mwahaha'
    end
    Then I edited the OnWorldCreated function to include
    Code:
    alpalog = io.open('alpalog.txt','wb')
    	status, err = pcall(alpaFunction)
     	alpalog:write(err)
    	alpalog:close()
    This will create a file called alpalog.txt in the ETW directory to which I can write output. The pcall is important to make sure I can display error messages. I'll investigate a bit further what's in the other game components but so far it doesn't look very promising...

    Edit: Inside scripting itself we have these:
    Code:
    InitFeature
    ClearEventCallbacks
    SetCampaign
    _PACKAGE
    OnUICreated
    ClearMessageAutoShowOverrides
    game_interface
    ShowHUD
    HighlightConstructionItem
    EnableFeature
    _NAME
    HighlightRecruitmentItem
    AddEventCallBack
    _M
    OverrideMessageAutoShow
    HighlightComponent
    Conditions
    Code:
    RegionReligionIsStateReligion
    AdjacentRegionRebelling
    BattleEnemyAlliancePercentageOfClassAndCategory
    SlotType
    UnitClass
    BattleResult
    BattlePlayerSailsPercentageDamaged
    FactionIsHuman
    CharacterInOwnFactionLands
    InsurrectionCrushed
    IsPortGarrisoned
    BattlePlayerUnitMountType
    BattlePlayerUnitSpecialAbilitySupported
    UnitTrait
    BattleEnemyAlliancePercentageOfSpecialAbility
    BuildingTypeExistsAtSlot
    BattleEnemyUnitOnLeftFlank
    RegionSlotBuildingTypeCount
    FactionTradeCommodityExists
    FactionTechExists
    RegionSlotEmptyCount
    CharacterIsEnemyCampaign
    TaxLevel
    BattlePlayerShipClass
    LosingMoney
    RegionSlotCount
    CharacterSurname
    IsPlayerTurn
    GovernorTaxLevel
    WorldResourceExists
    IsComponentType
    RegionBuildingFinished
    BattleAllianceNumberOfShips
    FactionTaxLevel
    PercentageUnspentIncome
    BuildingTypeExistsAtSettlement
    BattleEnemyHasMissileSuperiority
    SeaTradeRouteRaided
    BattleType
    CharacterTurnsInEnemyLands
    IsCarryingTroops
    FactionAllyCount
    WouldRebellionInRegionBeRevolution
    CharacterAttribute
    CharacterForename
    BattleEnemyShipOnFire
    RegionPopulationLow
    ResearchQueueIdle
    FortBuildingQueueIdleDespiteCash
    CampaignPercentageOfOwnKilled
    SlotBuildingQueueIdleDespiteCash
    BattlePlayerUnitMovingFast
    BattleEnemyUnitCategory
    InSettlement
    BattlePlayerAlliancePercentageOfUnitCategory
    CharacterInBuildingType
    BattlePlayerShipActionStatus
    RegionFoodShortageEmigration
    IsHomeRegion
    HasUnspecialisedPort
    BattleEnemyUnitSpecialAbilitySupported
    CharacterInRegion
    RegionReligiousEmigration
    CampaignBattleType
    TradeRouteIsEnemy
    IsUnderBlockade
    FactionTreasuryWorldPercentage
    IsChildOf
    CharacterInEnemyLands
    RegionSlotBuildingTypeExists
    UnitFoughtInBattle
    IsFactionLeaderFemale
    WarEndedCharacterFaction
    CharacterCultureType
    RegionWealthDecrease
    FortName
    RegionCultureIsFactionCulture
    BattleEnemyUnitTechnologySupported
    BattleShipIsPlayers
    BattlePlayerDirectionOfMeleeAttack
    ArmyIsLocalCampaign
    CharacterEndedInAmbushPosition
    PlayerFactionIsAttacker
    OnAWarFooting
    RegionRiots
    CharacterTrait
    BattlePlayerDefendingFort
    IsBesieging
    SettlementRoadBuildingQueueIdleDespiteCash
    BattlePlayerUnitEngagedInMelee
    RegionPopulationMaxReached
    TurnNumber
    LandTradeRouteRaided
    RegionTownWealthGrowth
    BattleEnemyShipActionStatus
    IsBuildingInChain
    CharacterType
    OffensiveSiegesWon
    IsTheatreGovernor
    BattlePlayerAlliancePercentageOfMountType
    CharacterFactionHasTechType
    UnitCategory
    RegionBuildableSlotEmpty
    CharacterFactionSubcultureType
    DefensiveSiegesWon
    RegionSlotBuildingCultureExists
    BattleEnemyUnitCurrentFormation
    BattleEnemyAlliancePercentageOfUnitCategory
    SlotIsAlliedCampaign
    EnemyArmyGreaterCombatStrength
    RegionIsLocal
    InPort
    TaxCollectionLimited
    BattlePlayerAlliancePercentageOfUnitClass
    BattleUnitIsAllied
    SettlementIsLocal
    BattlePlayerDirectionOfMissileAttack
    UnitRouted
    CampaignPercentageOfThemCaptured
    CanGenerateHistoricalCharacter
    SupportCostsPercentage
    WarStartedCharacterFaction
    FactionWarWeariness
    BattleIsNavalConflict
    BattleHasCoverBuildings
    BattleIsLandConflict
    RoadsAtMaxLevel
    BattlePlayerAllianceToEnemyAllianceRatio
    RegionResourceExists
    IsBlockading
    FactionGovernmentType
    CommanderFoughtInBattle
    RegionGovernorAttribute
    RegionRebels
    CharacterHasTrait
    BattleAllianceIsPlayers
    TradeRouteLimitReached
    FactionTradeValue
    BattleEnemyAlliancePercentageOfUnitClass
    CharacterDuelWeapon
    BattleEnemyDirectionOfMeleeAttack
    BattlesFought
    BattleUnitIsPlayers
    IsColony
    BattleEnemyAlliancePercentageOfMountType
    RandomPercentCampaign
    CharacterMinisterialPosition
    TradePortsAtMaxLevel
    CommanderTrait
    FactionDestroyedByCharacterFaction
    CharacterFactionName
    TradeRouteIsLocal
    CommanderAncillary
    RegionResourceExploited
    FactionIsLocal
    OffensiveSiegesFought
    BattlePlayerUnitActionStatus
    UnitWonBattle
    FactionCanBuildBuilding
    IsBuildingOfType
    CharacterIsLocalCampaign
    BattleShipSailsPercentageDamage
    FactionHasAllies
    CharacterMPPercentageRemaining
    MissionName
    ParentId
    BattlePlayerUnitDefendingHill
    BattlePlayerUnitSpecialAbilityActive
    SettlementBuildingQueueIdleDespiteCash
    PortBlockadedLocal
    WorldwideAncillaryTypeExists
    TurnsSinceThreadLastAdvanced
    CharacterTurnsAtHome
    CampaignPercentageOfOwnRouted
    BattleEnemyAlliancePercentageCanHide
    NoActionThisTurn
    PortBlockaded
    RegionSlotBuildingCount
    SlotIsLocal
    BattlePlayerAllianceDefendingHill
    RegionHasFoodShortages
    CampaignPercentageOfOwnCaptured
    TargetCharacterIsEnemyCampaign
    FactionTradeValuePercentage
    FactionLeadersTrait
    FactionBuildingExists
    BattlePlayerUnitEngaged
    FactionCashFlow
    ArmyIsAlliedCampaign
    IsMessageType
    BattlePlayerUnitCurrentFormation
    RegionSlotTypeExists
    UnitCultureType
    AdviceJustDisplayed
    AdviceDisplayed
    AdviceThreadProgress
    MapPosition
    BuildingLevelName
    IsTriggerableHistoricalEvent
    BattlePlayerAlliancePercentageOfAmmoType
    CharacterCapturedEnemyShip
    TargetInStrikingRangeOfEnemy
    ResearchTypeUniqueToFaction
    DefensiveSiegesFought
    CharacterInBuildingOfChain
    CharacterNumberOfChildren
    CharacterFactionGeneralCount
    UnitType
    BattlePlayerUnitAmmoType
    ResearchCategory
    BattleAllianceNumberOfUnits
    SettlementFortificationsBuildingQueueIdleDespiteCash
    CharacterWasAttacker
    TargetCharacterIsAlliedCampaign
    TargetArmyGreaterCombatStrength
    CommanderFoughtInMelee
    CharacterFactionAdmiralCount
    IsGarrisoned
    IsUnderSiege
    UnitCrushedInsurrection
    GovernorshipTaxLevel
    CharacterWonDuel
    UnitSufferedCasualties
    UnitOnContinent
    BattleEnemyUnitActionStatus
    FactionwideAncillaryTypeExists
    CharacterFoughtCulture
    BattlePlayerAlliancePercentageOfSpecialAbility
    RegionEconomicGrowthLow
    RegionTaxLevel
    BattleAllianceIsAttacker
    CharacterInTheatre
    CampaignName
    CharacterBuildingConstructed
    CharacterIsAlliedCampaign
    DateInRange
    SlotName
    BattleIsSiegeConflict
    RegionPopulationGrowthLow
    BattlePlayerUnitTechnologySupported
    BattlePlayerAlliancePercentageCanHide
    RegionTaxTownWealthGrowthReduction
    RegionWealthIncrease
    CharacterTurnsAtSea
    FactionSupportCostsPercentage
    CharacterHoldsPost
    UnusedInternationalTradeRoute
    BattlePlayerAlliancePercentageOfClassAndCategory
    BattlePlayerAlliancePercentageOfTechnology
    RegionDemands
    BattleEnemyUnitOnRightFlank
    FactionIsAlliedCampaign
    CharacterRouted
    CampaignPercentageOfThemRouted
    BattlePlayerUnitClass
    RegionClamoursReform
    CharacterInHomeRegion
    BattlePlayerUnitCategory
    CampaignPercentageOfThemKilled
    CampaignPercentageOfUnitCategory
    CharacterWonBattle
    CharacterAbility
    FactionExists
    FactionName
    FactionLeadersAttribute
    FactionPatrioticFervour
    BattleHasCoverWalls
    SettlementName
    FortIsLocal
    IsFactionLeader
    UnitInTheatre
    BattleEnemyUnitClass
    ResearchType
    WorldResourceExploited
    RegionHasUnexportedTrade
    UnitFoughtInMelee
    FactionTreasury
    Events:
    Code:
    MissionCheckAssassination
    BattleUnitUsingWall
    NewSession
    MissionEvaluateResearch
    SavingGame
    CameraMoverFinished
    SlotRoundStart
    UnitCreated
    MissionCheckMakeAlliance
    CharacterSelected
    UnitTurnEnd
    FactionTurnStart
    UnitCompletedBattle
    CharacterDamagedByDisaster
    UICreated
    EspionageAgentApprehended
    BattleCommandingUnitRouts
    AssassinationAttemptSuccess
    MissionCheckMakeTradeAgreement
    VictoryConditionMet
    CampaignArmiesMerge
    MissionNearingExpiry
    HudRefresh
    SlotOpens
    RegionRebels
    BattleUnitDestroysBuilding
    MovementPointsExhausted
    BattleDeploymentPhaseCommenced
    MissionCheckGainMilitaryAccess
    FactionTurnEnd
    FortSelected
    SiegeLifted
    LocationUnveiled
    CharacterTurnEnd
    VictoryConditionFailed
    MissionCheckEngageFaction
    PanelOpenedBattle
    BattleUnitAttacksWalls
    TimeTrigger
    SufferAssassinationAttempt
    evaluate_mission
    MissionCheckDuel
    MissionCheckEngageCharacter
    LoadingGame
    HistoricalCharacters
    RegionIssuesDemands
    BuildingInfoPanelOpenedCampaign
    SlotOccupied
    MissionEvaluateEngageCharacter
    BattleUnitAttacksEnemyUnit
    MissionCheckSpyOnCity
    BattleShipRunAground
    MissionCheckRecruit
    EventMessageOpenedCampaign
    MissionEvaluateAssassination
    AdviceDismissed
    TooltipAdvice
    UIDestroyed
    BattleShipCaughtFire
    SufferSpyingAttempt
    MissionEvaluateEngageFaction
    AdviceIssued
    FactionRoundStart
    FactionGovernmentTypeChanged
    CharacterAttacksAlly
    EventMessageOpenedBattle
    RecruitmentItemIssuedByPlayer
    CharacterCompletedBattle
    n
    SlotSelected
    BattleShipAttacksEnemyShip
    MissionEvaluateMakeAlliance
    CampaignSlotAttacked
    BuildingCardSelected
    CharacterCreated
    BattleUnitCapturesBuilding
    MissionCheckBuild
    MissionEvaluateBuild
    SabotageAttemptSuccess
    PanelOpenedCampaign
    UngarrisonedFort
    BattleShipSailingIntoWind
    DummyEvent
    SettlementOccupied
    BattleUnitUsingBuilding
    WorldCreated
    BattleUnitRouts
    GarrisonResidenceCaptured
    BuildingCompleted
    SettlementSelected
    MissionCancelled
    LocationEntered
    PreBattle
    CharacterPromoted
    RegionRiots
    ResearchCompleted
    MissionIssued
    CampaignSettlementAttacked
    historical_events
    UnitTrained
    UnitSelectedCampaign
    _PACKAGE
    IncomingMessage
    BattleShipMagazineExplosion
    MissionEvaluateSpyOnCity
    TechnologyInfoPanelOpenedCampaign
    HistoricalEvents
    MissionCheckBlockadePort
    MissionEvaluateRecruit
    MissionSucceeded
    LandTradeRouteRaided
    SpyingAttemptSuccess
    SlotTurnStart
    MissionEvaluateGainMilitaryAccess
    CampaignBuildingDamaged
    BattleShipRouts
    DuelFought
    MultiTurnMove
    SeaTradeRouteRaided
    BattleUnitAttacksBuilding
    TradeRouteEstablished
    TradeLinkEstablished
    BattleShipSurrendered
    PanelClosedCampaign
    PanelClosedBattle
    ComponentLClickUp
    BattleConflictPhaseCommenced
    _M
    MissionCheckCaptureCity
    PanelAdviceRequestedCampaign
    PanelAdviceRequestedBattle
    RegionTurnStart
    CharacterTurnStart
    DuelDemanded
    MissionEvaluateBlockadePort
    BattleCommandingShipRouts
    MissionEvaluateMakeTradeAgreement
    MissionEvaluateDuel
    MissionEvaluateCaptureCity
    CharacterInfoPanelOpened
    _NAME
    MissionCheckResearch
    RegionTurnEnd
    MissionFailed
    AdviceSuperseded
    BuildingConstructionIssuedByPlayer
    Effect:
    Code:
    ancillary
    advice
    suspend_contextual_advice
    adjust_treasury
    advance_contextual_advice_thread
    trait
    historical_character
    advance_scripted_advice_thread
    remove_ancillary
    rewind_scripted_advice
    historical_event
    remove_trait
    Last edited by alpaca; March 15, 2009 at 06:50 AM.

    No thing is everything. Every thing is nothing.

  14. #14
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: Investigation of Empire's script language

    Great mate, testing now!

    And of course, +rep.

  15. #15

    Default Re: Investigation of Empire's script language

    Man, I'm not allowed to give rep yet but this surely deserves it

    Excellent thread and good work!

  16. #16
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Investigation of Empire's script language

    I forgot to mention: You don't have to restart the game every time you change the script, restarting the campaign is sufficient. That's possibly the reason for the campaign being outside the packs

    No thing is everything. Every thing is nothing.

  17. #17
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: Investigation of Empire's script language

    I will test some of them tomorrow, I tested today the command for not move in a specified turn, but doesn't works. Does Empire have any log?

    Thanks;

  18. #18
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Investigation of Empire's script language

    Quote Originally Posted by Polpolgio View Post
    I will test some of them tomorrow, I tested today the command for not move in a specified turn, but doesn't works. Does Empire have any log?

    Thanks;
    Couldn't enable it (or rather, changing the preference does nothing) so I guess logging is disabled in the release build.

    No thing is everything. Every thing is nothing.

  19. #19

    Default Re: Investigation of Empire's script language

    In the executable there are a lot of things that look like commands, whether they are for use somehwere in LUA scripts, some command line or in an xml file I don't know.

    For example at 0xf33530 it says:
    Add the region recapture assets desire at a high priority to the named faction.
    cai_force_recapture_behaviour [faction_key]
    cai_force_recapture_behaviour
    cai stands for Campaign AI Manager.
    Last edited by just; March 15, 2009 at 05:52 PM.

  20. #20

    Default Re: Investigation of Empire's script language

    There is a file that lists everything already I recall. Or at the very least it listed every event that an lua script can trap for.

    events.lua

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •