lua

  1. HorseshoeHermit

    [BNW] [CP] This Lua isn't firing

    Arright, after troubleshooting to close way more parentheses than I care to admit to, I've still got issues with this lua. The file itself is finally grammatically valid, but when the borders expand I don't get the bonus I'm looking for. I can make it give me Floating Gardens, but not the...
  2. TheOneHitPupper

    Need help with custom tile improvement?

    I'm planning to make Czech Hedgehogs into a tile improvement for Civ, but I'm at a loss for the code. I'm trying to give the improvement, once it's fully built, a way to damage enemy armored vehicles/tanks that pass over its tile. I also want it to provide a defense bonus to infantry-type units...
  3. R

    [BNW] Need help with City Capture detection [Lua]

    I want to make a UA that forces the player's unhappiness to 20 unless they capture a city every 30 turns. My problem is that I don't know how to check is pPlayer has captured a city, can you help? function Smash(PlayerID) print("UA") local pPlayer = Players[playerID] local Turn =...
  4. HorseshoeHermit

    [Lua] Can't find my lua file in Content dropdown

    Slaved for many hours writing up my lua file. It's a script intended to run when the save data / playable game state has loaded. I go to the Content tab of the mod properties, try to add the file, and I don't see it. It's just not there. I've already tried renaming it to a brief character...
  5. S

    Modify Unit On Change In State

    Hello, I created an unit and now I want to change it's maintenance cost dynamically. For example, I want the unit's maintenance cost reduce if the unit is sleeping. I know LUA, but I am new to using it with CIV VI Thanks!
  6. MadSysop

    Using timer.performWithDelay inside lua script

    Hi I'm trying to use the timer module (https://docs.coronalabs.com/api/library/timer/performWithDelay.html) inside lua script. I have tried, but failed with error "function expected instead of nil" on the line, where I call "timer.performWithDelay(1000, listener)". Could the timer be restricted...
  7. TheOneHitPupper

    Question about duplicate files?

    Can two mods have two different .xml files named the same thing? Or would there be a conflict? I know that .lua files result in conflicts.
  8. A

    Noob modder new to lua; help please?

    Sorry, I'm really new when it comes to modding and I'm working on a Civilization that has a unique unit that I want to grant production equivalent to a percentage of the combat strength of a unit in each city for each unit it kills. I figured out you had to do something with the...
  9. G

    Live Tuner <CompatibleStates>

    I'm trying to use Firaxis Live Tuner (FLT) to access and process game information and then highlight "interesting" plots. I'm stumped and need help. I've created an FLT panel (code below) in which I define "InGame" and "_TunerResourcePanel" as "CompatitableStates" and identify...
  10. G

    Function for a Live Tuner Panel

    I would like to create a custom function and access it from a live tuner panel. I have created a Lua file and can load it by identifying it as a <LoadStates> item in the ltp file. It initializes variables that I use in the live tuner panel and seems to work as expected. However, when I add a...
  11. G

    Odd PopulateList Function Behavior

    I'm writing an LTP that identifies revealed resources and have encountered behavior that is very perplexing. The behavior occurs when parsing the code in a <PopulateList> element. Below is the code that results in the following message in the Lua Console: (Syntax Error: [string "return...
  12. M

    Proofread my LUA

    Hi everyone, I've recently finished my first LUA code and would be very grateful if someone could proofread it to identify errors and make suggestions. The first provides Great Writer points equal to the number of Landmarks in your territory and the happiness derived from discovered Natural...
  13. Geekob

    WorldBuilder functions not working

    I found some useful functions in worldbuilder lua files but it seems im not able to use them. Its kind of weird since I can run those commands in runtime through firetuner. Lua doesnt throw any error, it just doesnt execute them. Im using ImprovementBuilder also, and it works even outside debug...
  14. Geekob

    [SOLVED] Lua cross-referencing?

    I want to make Utils file for some utility functions, but I cant do that for some reason. I used require("..."), include("..") but nothing seems to work. I included that Utils.lua into LuaScripts, but console is still crying about not knowing the used function. Am I missing something? include...
  15. CivilizationAce

    Is it possible to add Lua code to a window?

    I think that SaveGameMenu.lua, the script for the Save window, could be better. In particular I want the list on the right to start filtering (or I might make it bring the matches to the top) as you type part of the filename. Would I have to overwrite the entire SaveGameMenu.lua or is there a...
  16. CivilizationAce

    How to display Civilization specific production modifier?

    I have a new mod that provides a bonus percentage to production of certain buildings, which brings me to the following: I'd like my bonus percentage to be listed after (or before, I'm not fussy) the "+5% (+0.5) from Amenities" when the user hovers their mouse over the total production amount and...
  17. CivilizationAce

    How to reference localized text in Lua?

    I figure it doesn't make sense to hard code my text and I want to use Game.AddWorldViewText(0, sPopup, iX, iY, 0). However I don't know how to make that second parameter show the text in the appropriate language from the localized text. I searched for Localized in the existing Lua, without...
  18. CivilizationAce

    LOC_LOADING_JOIN_THE_WORLD_STAGE

    I'm getting down to i dotting and t crossing in my latest new civilization mod, and I've run up against a minor annoyance: LOC_LOADING_JOIN_THE_WORLD_STAGE is "joins the world stage", but my civilization name is plural, so I want "join the world stage". I don't know if this can be manipulated...
  19. CivilizationAce

    LUA exhaust unit

    I have added event consumption to my game that creates a new unit. The problem is that I'd rather that the unit can't move until the next turn. One reason for this is because of inconsistency — If the unit is created as the last move of the turn the turn ends without the player getting to move...
  20. Cladoniaceae

    Lua code for National Wonder terrain req

    I'm trying to write a Lua script that will place a certain dummy building only in cities on or near Tundra when they are built, with the ultimate goal of making a National Wonder that requires all cities to be built on or near Tundra. What I have right now is based on a couple of examples put...
Top Bottom