lua

  1. T

    [BNW] display remaining moves on unit path

    I always forget how much movement points its going to cost to move in a forest hill, is this doable with lua only? i have no clue how to start. Community Patch has something of the sorts but it seems like there are massive pathfinding changes in the dll as well
  2. T

    [BNW] newbie to lua, what's wrong with this script?

    I'm using whoward's dll. I want to run an action when a great person is born, but it says "attempt to index local iUnit (a number value), isn't this the right way to ask? function TestGiveGPFaith(iPlayer, iUnit, iUnitType, iPlotX, iPlotY) print("unit spotted") if iUnit:IsGreatPerson()...
  3. S

    [BNW] Food & Production from city state trade routes

    Hey, I want to mod a social policy in the patronage tree to give Food and Production from city state trade route. My idea is to use the "TRAIT_GATEWAY_AFRICA" Trait to write my own trait with Food/Production instead of Gold/Culture. Next I need a .lua where every civ gain this trait when the...
  4. Chrisy15

    C15's CMM Troubleshooting Guides

    Archive of Troubleshooting articles written for the Civilization Modding Monthly since although publishing them there allows them to be presented to a wider audience, it's less useful for people searching for answers and for directing questioners. Some of these articles can , or may in some...
  5. clausewitz77

    How to change the name of a civilization during the game?

    I am pretty new to modding, but in Civ5, I had created a mod which changed the names of some civilizations when a new era had started. Let's say, Rome became Italy in the industrial era. I want to do the same in Civ6. I think I found out everything I need, except the most basic: How can I...
  6. S

    Is it possible to change each city yeild independently?

    I'm trying to introduce the next change in my mod: - cities yield per population is decreased greatly, - each district generates a yield of the corresponding type based on city population - you can build any number of districts of the same type for the city, their summed yield should be...
  7. killmeplease

    How to loop a city's buildings?

    city:GetBuildings() returns an object which i cant loop through like player:GetCities() it can say if the city has a particular building -- bs:HasBuilding(idx) but i want to get the full list...
  8. sman1975

    How to Force a Deal?

    Am working on a mod that really needs the ability to force an 'Open Borders' and/or a 'Peace Treaty' (of more than a turn) between two civs. Have researched this a lot, but all roads seem to lead to a dead end. I did find one thing that looked interesting...
  9. F

    Custom district invisible. HELP

    So I've made a replacement district, and everything works fine, but it is invisible! I guess I have to reference some of the models to the district, but how do I add for example the commercial hub model to my district, and is there any way I can make my own? Thanks.
  10. fertiliser

    [BNW] [Bugfixes] [Optimisation] Has it been done before?

    I have a reasonable amount of experience with modding Civ5, but have always avoided the DLL due to compatibility issues. This time around. there's an ambitious project on the horizon. It involves bugfixes and QoL, that may or may not have been done in the past. I'd like to make sure before I...
  11. J

    Did anyone ever want to introduce culture invasion system into Civilization 6?

    I have an idea, but I don't know how to realize it by lua. Could anyone give me some inspiration? Here is what I want to do. Culture and Tourism can increase the amount of loyalty gained from your cities to your cities or other ai's cities respectively. The coefficient of promotion is the ratio...
  12. sman1975

    LUA - Odd text error

    Hello, I'm working on a mod that adds a couple of customized civs. When I use the "GetCivilizationDescription()" method to pull the civ's name, the civ's Leader Name is returned. Same for GetCivilizationShortDescription, as well. I used SQLite Spy to look at the Localization database and see...
  13. F

    Units can move over mountains trait?

    Code: <Terrains> <Update> <Where TerrainType="TERRAIN_GRASS_MOUNTAIN" CivilizationType="CIVILIZATION_FEB_CARTHAGE"/> <Set MovementCost="5" Impassable="0" DefenseModifier="3" /> </Update> <Update> <Where...
  14. F

    Add new and remove old civilizations with ruleset.

    I want to make every base game civ unplayable if the right ruleset is selected (gonna replace them with my own). I've already added a ruleset and a new civilization (it can even be played with the wrong ruleset, though). Please help! Thanks!
  15. F

    Remove civilizations from DLC?

    [DELETED] Please delete [DELETED]
  16. pineappledan

    Modding help - lua for trade routes

    Hi there, I'm working on a compatibility patch for the Canadian civ, and I am getting a crash when using a code for their UA What it does: On move, Internal land trade routes claim tiles The Code: function YorkFactoryExpress(iPlayer, iUnit, iX, iY) local pPlayer = Players[iPlayer]...
  17. S

    Add city modifier based on number of suzerains

    Hello there, I want to create a new leader, and as part of his unique ability, every city shall get +1 food and production for every city state he is the suzerain of. The only modifiers I could find that change a yield based on how many city states you control are...
  18. P

    [TOTPP] Get Started With Lua Events

    Note: I've started (but not got too far) a new version here. This thread is meant to be a resource for learning how to use the Lua functionality of the Test of Time Patch Project. The first 10 posts will (eventually) contain "lessons" which are intended to teach enough about programming, Lua...
  19. washy

    Player:GetNumPolicies() Question

    It´s some way of using Player:GetNumPolicies() to get the number of policies of one special branch or is always the total number of policies?
  20. Protok St

    [Lua] Create Improvement by lua of the map, how to? Solved

    How to create Improvement by lua of the map? There is a LUA's scripts for creating a separate maps. In those we can do like this: plot:SetPlotType(PlotTypes.PLOT_LAND); and this: plot:SetTerrainType(TerrainTypes.TERRAIN_PLAINS); and this...
Top Bottom