lua

  1. Scapeh

    Lua Parameters Help

    Hey! I currently have a working mod for razing cities if they are hit by a nuclear weapon, and it works very well, the only issue is, it doesn't work for the AI. This is something that I would like as it would be game changing if it could. A way of "fixing" the issue with the AI nuking the same...
  2. hburak

    New UA - Production Bonus when constructing Factory or Public School

    Hi, I'm creating a new civ, and i want to create an UA that provides produciton bonus when constructing Factory or Public School. Or maybe reducing production cost for factory and public school. (either way ok for me) I think it is not possible with xml. How about Lua ? Basically, i need to...
  3. M

    "DLL - Various Mod Components: Pick'N'Mix Mods" - "Separate GP Counters" Help

    I'm fairly new to LUA and Civ Modding in general, so let me apologize ahead of time if I'm missing something simple here.. I'm using the "Various Mod Components" .dll, along with WHoward's "Pick'N'Mix Mods".. specifically, the "Separate GP Counters" mod. I'm trying to increase the cost of...
  4. G

    How do you edit LUA? Use Notepad++ then switch to ModBuddy?

    There (https://forums.civfanatics.com/threads/modbuddy-extension-better-lua-editor-faster-intellisense.391034/) is a LUA editor improvement for CIV 5 (Visual Studio Shell 2010 or thereabouts), which made modders their day. Someone asked if there is a way to improve the LUA editor for CIV 6...
  5. P

    [TOTPP] Prof. Garfield's Lua Code Thread

    For my current method of code distribution, see this thread instead. I've decided to change the way I 'distribute' the Lua code I've been working on. Until now, I've started a thread for each 'type' of module/library that I've made, with the intention of posting updates to each thread when...
  6. Wobzter

    [BNW] Several questions about whether it's possible with LUA

    Hello, As I'm working out more and more parts of my mod, I'm looking into the following things. Does anyone know if any of the following is possible: (1) Set a city to blockaded (even landlocked cities)? (2) Force a certain amount of citizens in a specific city to a specific type of specialist...
  7. J

    [GS] [Lua] Changing a Player's Name ingame?

    Hi, I was wondering if someone found a PlayerConfigurations:SetPlayerName() equivalent ? (this one doesn't exist) I would like to change a player's name without having to manually change all the labels. PlayerConfigurations:SetHotseatName(text) doesn't work outside of Hotseats.
  8. TheOneHitPupper

    [SOLVED] Help with slavery mechanic

    I'm trying to make a generic notification for the player after an enemy unit is killed and turned into a slave. I have the code necessary for the switch, but don't understand how to tie a notification to it. So far, I can only get it to work when an enemy enslaves the human player's units, which...
  9. Wobzter

    [BNW] [SOLVED] "index global 'Map' (a nil value)" even without mods.

    Hello all, i am trying to work with LUA and I run into the issue as described in the title. For whatever reason I cannot acces the instance "Map". For example, when I do "Map.GetPlot(3,3)" in FireTuner while playing a normal (non-modded!) game, I get the following error: > Map.GetPlot(3,3)...
  10. K

    Can Lua be written differently?

    I've not been wanting to use lua since I came back to Civ 2 modding, I feel dizzy every time I look at it. Cause to take the Napoleon scenario, a lua event looks like this: -- Napoléon administrative bonus if activeUnit.type.name == "Napoléon I" then local...
  11. D

    [GS] World Builder Map Won't Load at Start Up

    Hi, I've been trying to create my own pangaea map because I'm never happy with the one I spawn on. I tried modding a random map but when I try load it (in an actual game, not in the world builder) it won't load and gives the error message "error: one or more of the start up scripts has an...
  12. Red Key

    Lua UI Mod Compatibility

    I need some help understanding how to make UI mods compatible. I use @sukritact 's Simple UI Adjustments and would like to make my mod compatible with it if possible. Simple UI makes some changes to specific functions in CityBannerManager.lua through the use of ReplaceUIScript. I am changing a...
  13. A_Wandering_Man

    Changing UA based on state of war/peace?

    Hi all, So for my next mod I'm looking to make, I want to make the UA have a static part (this will be trivial, as it is part of the existing tables, so will just have to turn it on) and a dynamic part that will rely on switching between two dummy policies. In my previous mod, I used a...
  14. TheOneHitPupper

    Resolution to grant buildings?

    There is no column or table under Resolutions that would grant the player a building once a resolution is passed/repealed. I've tried to make a workaround through lua but can't get it to work. This is what I have so far: local NukeResolution = GameInfoTypes.RESOLUTION_NUCLEAR_NON_PROLIFERATION...
  15. B

    Some basic iterate problems in Lua

    Hi, everyone, I'm a beginner to the Lua with civ5. First, we want to mod something, we need to find it. Now I only know how to find players, but how to find cities, units etc. The outdated wiki doesn't seem to show that. Can you help me?
  16. B

    How to load Lua with modbuddy?

    If I want to write some Lua scripts to my mod with modbuddy. Is there any necessary actions such like 'Add in to actions', or just create new .lua and build project?
  17. jarcast2

    [BNW] Hybrid land-sea trade routes starting from inland cities and passing through coastal cities?

    Hi everyone. After a long break I resumed working on my mod projects, and specifically the Etruscans. I've read that the major inland Etruscan cities built coastal settlements called epineia (harbor in Greek) to use as sea trading hubs like Pyrgi for the city of Caere and Gravisca for Tarquinii...
  18. Knighttime

    Deleting the active unit: Move Pieces mode vs. View Pieces mode

    I'm frustrated by a gameplay issue resulting from Lua events, and wondering if someone out there knows a better way to handle this. I have some code that is called when a unit is activated -- meaning, it is run from the onActivateUnit() trigger -- which evaluates the newly-activated unit and...
  19. J

    [GS] OnGoodyHutReward() Item Reference

    Hi, Maybe someone can move it to the right place/section. In the context of a mod I needed to use the Events.GoodyHutReward: Here is how this function work (UI context): function OnGoodyHutReward(playerID, unitID, itemID, itemID_2) And here is the list of the know IDs (note that some events...
  20. J

    [GS] Game.GetHistoryManager() Object

    Hi, I have found very little on Game.GetHistoryManager() in lua just :GetMomentData(momentID) and :GetAllMomentsData(localPlayerID, MIN_INTEREST_LEVEL) Does anyone have a list of the attribute, I am looking for Set() functions in order to reset some historical moment upon certain circumstances.
Top Bottom