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 =...
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...
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...
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...
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?
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...
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...
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...
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 =...
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...
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!
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...
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...
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...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.