lua

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. CivilizationAce

    Runtime error setting data to be persisted

    GameConfiguration.SetValue(key, fMissedChanceTotal)produces the runtime error:function expected instead of nilAnyone know why and how I should proceed please?
  9. CivilizationAce

    Gender changes on upgrade

    I'm creating a new unit type, that like the Scout has only one person. I'd like the following: To have some variety of unit appearance, including gender Upgrade to the same gender I think if the player names a female unit Jane Florence Smith and then upgrades it and gets a guy they may not be...
  10. G

    Mountain Climbing Mod, Failure to Climb & LUA Code - Need Ideas & Help

    So, I've recently posted a small mod that creates a way to exploit and move over mountains in game in a regulated manner. No free-for-all, but only certain unit types can traverse the peaks. Here it is: Mountain Movement & Exploitation Mod. But I need suggestions and new ideas about some...
  11. Infixo

    Num of objects in GameInfo table (solved)

    Is there an easy way to get a number of objects kept in a specific GameInfo table without the use of for loop? I.e. I wanna know how many Civics are in the game, so what to do with GameInfo.Civics?
  12. cromcrom

    [Solved] LUA How to get the list of all available techs ?

    Hi all, I would like to get a table of all techs that are ingame. Not only already researched, but all techs. I guess it involves GameInfo.Technologies, but I can't figure anything more. Thanks in advance.
  13. CivilizationAce

    Are all existing .lua scripts UI related?

    Maybe I'm missing the wood for the trees. I can't find any LUA scripts in the base game that aren't part of the UI. I was hoping to learn to catch an event in the game (player taking a barbarian encampment) and produce an effect on the game (small chance to make a unit) but these aren't going...
  14. Bismuth

    Lua Questions (Units and Messages)

    I'm working on a mod leader and civ, and I've hit a roadblock where I am not able to figure out the lua needed for the traits. The most critical problem I am having is that I cannot figure out how to properly refer to units. I have two functions I can't get working because I am stuck on this. In...
  15. S

    Golden Age points for spreading Religion

    Would this possible with XML/SQL, or does it require LUA? There is a thread discussing a similar topic here: https://forums.civfanatics.com/threads/lua-hook-for-expending-units-like-missionaries-or-settlers.612008/ Is there a way to tie the creation of Golden Age points specifically to the...
  16. cromcrom

    [Solved] Add road or improvment through LUA.

    Hi all, I would like to improve my mod, and give a little random chance that a unit, while moving, will create a road. Are you aware of a way to do this through LUA ? I know there is a "create" for units, but I didn't see anything for roads or improvments, or else. Any ideas please ?
  17. G

    New COLLECTION, EFFECT, REQUIREMENT Types in Recent Patch & new LUA

    The following are the new types included with the most recent patch in GameEffects.xml: COLLECTIONS <Row Type="COLLECTION_ALL_CAPTURED_CITIES" Kind="KIND_COLLECTION"/> <Row Type="COLLECTION_PLAYER_CAPTURED_CITIES" Kind="KIND_COLLECTION"/> <Row...
  18. G

    LUA & SQL - LuaSQLite 3

    Question, in case anyone has already tried this: Is there any way to integrate LuaSQLite 3 into the Lua used by Civ VI? If there were, it would seem that it would be the perfect way to establish on the fly integration between the InScript code and the DebugGameplay.sql database. It would allow...
  19. cromcrom

    Cromcrom lua stuff and questions about terrain features attrition mod

    Crédits: Gedemon LeeS Infixo TheRealHellBlazer Isau Gleb Bazov And all the fine people sharing their knowledge and being helpful or supportive. I don't want to clutter the main LUA thread with my noob questions and bits of codes, so I am opening this thread. Ultimately, I want to create a mod...
  20. G

    Civ VI - LUA Mods - Culture Bombs for Districts & Improvements

    UPDATE #4: Darn! I forgot a snippet of LeeS' code in the Strategic Resource Improvement Culture Bomb, and, for that reason, the function ResourceIsRevealedToPlayer was not working at all. NOW FIXED. Ok, that's it for now! :) IMPORTANT, UPDATE #3: There were errors in the code in the previous...
Back
Top Bottom