lua

  1. F

    [vanilla] No cost when disembarking

    Is it possible that units pay no movement cost when embarking and disembarking? Like in civ 6? Thanks
  2. F

    [vanilla] Get the plot the unit is standing on?

    Is it possible to get the position of the unit and check if it is hills? I am trying to make a mod where a special unit is stronger in hills! This is what I have so far... local percentAdded = 25 local norwegianBerserker = "UNIT_BERSERKER" function CheckPlot(iPlayer) local player =...
  3. esosorcdc

    Editing LoadScreen.lua

    I have a lot of units in my mod and I don't want them all to display in the load screen, I just want one entry to show up that represents all of them. Searching the base game files, I see that file LoadScreen.lua (Sid Meier's Civilization VI\Base\Assets\UI\FrontEnd) is what populates the list of...
  4. R

    [BNW] Lua questions about diplomatic opinion modifiers

    I'm trying to write a Lua script that can either eliminate certain diplomatic penalties for a civ, or at least get as close to that as possible by using positive opinion modifiers to try to cancel out the penalties. I have some questions regarding this topic: 1. What's the difference between...
  5. R

    How to detect if a specific Civ is at war?

    I would like to implement an UA that provides bonuses while the Civ that has it is at war--ergo, an UA that places dummy buildings in that player's cities when a war starts involving them, then removes all those dummy buildings once the war ends. Is there an existing LUA function (either from...
  6. I

    How to change improvement yield with Lua?

    I'm making a new improvement, but I want it's behaviour to be a little more complex than the improvements in the game right now. Specifically, I want to make a town whose yield is based off of it's neighbouring tiles' yields. I've done all the XML, but how would I do it in Lua?
  7. M

    [BNW] Custom Civilization Not on Select Civilization Screen (LUA error)

    Trying to get my civilization to load up into the game. However, it does not appear on the Civ Selection screen. I checked my Database log and nothing pertaining to my civilization was there. And then I checked my LUA log and found this: [1865871.328] InstalledPanel: Refreshing Mods...
  8. 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...
  9. 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...
  10. 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 =...
  11. 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...
  12. 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!
  13. 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...
  14. 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.
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
Back
Top Bottom