lua

  1. TheOneHitPupper

    Resolution to grant buildings?

    There is no column or table under Resolutions that would grant the player a building once a resolution is passed/repealed. I've tried to make a workaround through lua but can't get it to work. This is what I have so far: local NukeResolution = GameInfoTypes.RESOLUTION_NUCLEAR_NON_PROLIFERATION...
  2. B

    Some basic iterate problems in Lua

    Hi, everyone, I'm a beginner to the Lua with civ5. First, we want to mod something, we need to find it. Now I only know how to find players, but how to find cities, units etc. The outdated wiki doesn't seem to show that. Can you help me?
  3. B

    How to load Lua with modbuddy?

    If I want to write some Lua scripts to my mod with modbuddy. Is there any necessary actions such like 'Add in to actions', or just create new .lua and build project?
  4. jarcast2

    [BNW] Hybrid land-sea trade routes starting from inland cities and passing through coastal cities?

    Hi everyone. After a long break I resumed working on my mod projects, and specifically the Etruscans. I've read that the major inland Etruscan cities built coastal settlements called epineia (harbor in Greek) to use as sea trading hubs like Pyrgi for the city of Caere and Gravisca for Tarquinii...
  5. Knighttime

    Deleting the active unit: Move Pieces mode vs. View Pieces mode

    I'm frustrated by a gameplay issue resulting from Lua events, and wondering if someone out there knows a better way to handle this. I have some code that is called when a unit is activated -- meaning, it is run from the onActivateUnit() trigger -- which evaluates the newly-activated unit and...
  6. J

    [GS] OnGoodyHutReward() Item Reference

    Hi, Maybe someone can move it to the right place/section. In the context of a mod I needed to use the Events.GoodyHutReward: Here is how this function work (UI context): function OnGoodyHutReward(playerID, unitID, itemID, itemID_2) And here is the list of the know IDs (note that some events...
  7. J

    [GS] Game.GetHistoryManager() Object

    Hi, I have found very little on Game.GetHistoryManager() in lua just :GetMomentData(momentID) and :GetAllMomentsData(localPlayerID, MIN_INTEREST_LEVEL) Does anyone have a list of the attribute, I am looking for Set() functions in order to reset some historical moment upon certain circumstances.
  8. J

    [GS] One way shared visibility? (Player A sees Player B but B doesn t see A)

    Hi, I am trying to get a sort of one way visibility on a player using lua i.e. like a permanent alliance whereby player A sees player B but player B doesn t player A. I tried to use SetVisibilityOn but it doesn t seem to affect the vision at all ... Any help?
  9. J

    [GS] Checking file size / CRC?

    Hi, I am considering making an anti-cheat system in lua. two questions: a. Is there a lua fucntion to return the size of a particular file ? b. SetProperty() is saving a value but can I ask for a value from another player in MP ? thnaks !
  10. J

    [GS] How to End Turn with lua ?

    Hi, Any idea on how to force a player's turn to end in lua ? either from the gameplay or UI end ? I tried to call Events.EndTurnDirty() but it doesn't seem to work. Best,
  11. KyubeyD3

    Help with Lua scripts not loading

    When I tested the mod I'm making, none of the Lua-based mechanics were working; I checked Lua.log and sure enough, there were errors: [372622.484] InGame: Loading MOD InGameUIAddin __________________________________________________________________________________________ Civ - The...
  12. J

    [Help] Unrevealing a tile

    Hi, Civ has "3 levels of map visibility": 1: Visible 0: Revealed (fog of war) Those two are easy to switch to using RevealAllTiles() or VisibilityCount to 0 or 1 I m interested in the 3rd level: before we reveal the tile when it is covered by the map parchement. I have seen Reveal.HIDDEN in...
  13. J

    [GS] [Help] Combining UI Script and Gameplay script in lua

    Hi, I am working on something relatively simple: allowing a player to change his view to another player by pressing a specifc key. Using a gameplay script I can easily shift a specific player's view using: PlayerManager.SetLocalPlayerAndObserver(i) Using a UI script I can easily trigger a...
  14. J

    Adding Player

    Hi was looking at the Lua Object reference. Any method to add a minor civ using the PlayerManager in lua ?
  15. J

    [lua] Trying to return the continent name from a plot

    Hi guys, I tried to play aroudn with plot:GetContinentType() hoping to get a continent's name (in order to allocate luxuries from a particular continent). I failed. Any idea on how to do that ?
  16. T

    list of barbarian camps

    Hi, I'm looking for a fire tuner panel displaying all existing barbarian camps. A LUA chunk to get the list of all camps would also be very helpful.
  17. J

    [lua] TerrainBuilder.SetTerrainType() map actualisation problem

    Hi, I am running a script during OnGameTurnStarted() using TerrainBuilder.SetTerrainType() to change some of the terrain around the player. The script change the terrain without any problem e.g. Grasslands becoming Plains except the 3D graphics are not updated (they are updated in the...
  18. TheOneHitPupper

    Reveal Map with Dummy Building?

    I'm trying to incorporate a custom league resolution for an overhaul mod I'm working on. The idea of this custom resolution is to act as if all players researched the Satellites tech and the map is revealed accordingly. I see two ways of doing this. 1. Make a dummy tech and set it to hidden...
  19. Thildemar

    Reference UI elements without ID in lua

    Hi Everyone, New to Civ modding and trying to fix the UI for ultrawidescreen. Have a lot of the pieces in place, but running into trouble re-positioning elelemts without an ID. I am mostly using "ContextPtr:LookUpControl("/InGame/Screens/TechTree/")" to set size and offset for elements and...
  20. P

    [TOT] [TOTPP] The Munitions Library

    The Munitions Library is a module that provides some functionality for generating munitions or recruiting units based on a key press when a "spawning" unit is active. Feel free to post requesting extra features or bug fixes, or even to implement extra features or bug fixes. An example of usage...
Back
Top Bottom