lua

  1. 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?
  2. 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 !
  3. 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,
  4. 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...
  5. 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...
  6. 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...
  7. J

    Adding Player

    Hi was looking at the Lua Object reference. Any method to add a minor civ using the PlayerManager in lua ?
  8. 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 ?
  9. 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.
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. P

    [TOT] [TOTPP] The General Library

    Edit: Go to this thread for updates to the General Library. The General Library is a collection of relatively basic functions with wide potential use. The standard usage will be gen.generalLibraryFunction(input1,input2) The General Library is currently under construction, so go to the last...
  15. AeonsOfTime

    Mod configuration file best practices?

    Hi all, I have a small mod with some configuration settings in a lua script. I would like to move these configuration settings to a separate file, so they can be easily edited without opening the main script. It can be another lua file, an xml file, or whatever other format that can be used...
  16. M

    Trait Start Promotions 2019-06-23

    A simple mod that allows granting a free starting promotion to a civilization’s first warrior (or warriors if you are using a mod that allows starting with more than one warrior). As built it grants Mystic Blade to the first Indonesian warrior, Buffalo Horns to the first Zulu warrior, and Desert...
  17. N

    [GS] Getting AI to use customized builder unit

    I made a builder identical to the vanilla Builder, except he only has 1 build charge. I gift him to players (human and AI) with a lua script. Everything is working fine, except the AI refuses to use the custom Builder unless he is both able to be trained in a city and cheaper than the vanilla...
  18. AzraelZephyrian

    [LUA] Does pUnit:GetPlot() work in Civ VI?

    See title. Feel free to ask me to remove this if I'm wasting space. Also, does "IMPROVEMENT" still exist as a valid type?
  19. americanslon

    Remove button from Action

    I making a mod where a button should show up based on the type of unit is selected. I "borrowed" some code to display the button from another mod: If correct unit is detected it calls two functions First: function CreateHurryProductionButton() hurryProductionIM:DestroyInstances()...
  20. americanslon

    LUA functions returning nil when not expected

    Some code local player = Players[playerId]; local unit = player:GetUnits():FindID(unitId); local plot = Map:GetPlot(unit:GetX(), unit:GetY()); local city = Cities:GetCityInPlot(unit:GetX(), unit:GetY()); This code gets triggered OnUnitSelectionChanged. The unit is currently at a city but no...
Top Bottom