lua

  1. M

    Remove Owned Territory

    Hi, I am looking for a way to remove a player owned land after the event SerialEventImprovementDestroyed(). The Improvement creates a 'comptoir' on a resource with a cultural boom of only 1 radius. And the new territory is removed when the improvement is pillaged or canceled.
  2. TheOneHitPupper

    Building nuclear weapons after WC Ban?

    Is there anyway to reenable nuclear weapons if a Civ is embargoed at the World Congress? Specifically thinking rogue states like North Korea would be a real world example. It would be a nice counterweight to barring nations from world trade imo. I'm poking around some of the lua events but I'm...
  3. Pablostuka

    The Spanish Civil War v4 for ToT + ToTPP + Lua - Development Thread [ON HOLD]

    Introduction to SCW v4 I first started designing and creating the Spanish Civil War scenario for Civ2 MGE back in 2002 when I was just a teenager. Back then I reached José Pellón (a.k.a. @Kramsib) in the Spanish Apolyton Site for permission to use his wonderful Iberian Peninsula map. The first...
  4. P

    The Great Lua Library

    This thread is meant to serve two related purposes. The first is to provide a general Q&A thread for Lua and related topics. The second is to provide a link index for questions and their answers, as well as other resources. I'll edit this post periodically to add links to the questions and...
  5. TheOneHitPupper

    City Resistance?

    How would I go about coding Resistance in a city in lua? I have pCity defined, but can't find the proper lua method to implement city resistance there. I am also using the Community Patch DLL, if that helps. The only relevant information I've found are these two links: unhappiness revolt...
  6. B

    Little Python script to help find mod conflicts

    I wrote a little Python script that helps find colliding .lua's in mods. I don't guarantee I got the logic right as my knowledge of Civ modding is limited to the fact that it is done mostly in LUA :). I've just assumed that VP .lua's can be overwritten by .lua's in other mods (that's why their...
  7. S

    [NFP] LUA: Need help accessing combat object attributes

    I am trying to write a small mod that targets the issue with the combat experience of aircraft carriers. I got a mod set up, got the event hook for the combat initialized but the object that the event provides is not really helpful at the moment. Thanks to this event documentation I have an...
  8. F

    Map script based on tectonics lines

    I've made a map script that is based on tectonics lines, here is the algorithm: Put random tectonic lines on the map Put random volcanoes on the map (to-do) Iterate through X iterations and raise the land using averaging of sibling plots Iterate through Y iterations and lower the land using...
  9. F

    How to split lua script in multiple files

    How do you split the lua script in multiple files? I have this file RealisticMap_Tectonics.lua: -- RealisticMap_Tectonics -- Author: lucas -- DateCreated: 6/30/2021 7:34:46 PM -------------------------------------------------------------- include "MapEnums" include "MapUtilities" include...
  10. K

    [TOT] Is it possible to change time units for various acts of a scenario

    Now for reference, I am NOT planning this scenario as it's WAY too ambitious even for my ambitions, but if I did a Worldwar scenario (Harry Turtledove), I'd want to go through the whole saga, which I despised increasingly with every book at the last novel of the original five partners that ended...
  11. H

    [NFP] [RESOLVED] I would like to know the cost of that district when a district is added.

    Before creating other mods, I would like to know the cost of the district's production when a district is added. function OnDistrictAddedToMap( playerID:number, districtID:number, cityID:number, districtX:number, districtY:number, districtType:number, percentComplete:number ) local city =...
  12. C

    Help creating a unique unit ability

    Hi, I'm creating a mod that adds a new Great Person. I want this unit to be able to "construct a wheat farm," that is, set the resource of the tile they're in to wheat and then place a farm on it. In other words, they will be able to instantaneously create an improved wheat tile anywhere a farm...
  13. yepzer

    [BNW] Workers to units and back

    As with Civ4 (old mod, 14 years ago :shifty: ) I wanted the option to change workers to units, and back again.... Swords to Plow shears, wartime call to arms, Worker boom when returning from war - or as I ended up calling it: Call of the Motherland... attached below. Here's my experiences...
  14. Ja Mes

    Adventures in Border Plots

    I've been working on a tool to keep track of hex ownership and adjacency (borders). Suffice to say, I am in need of dire assistance. local tPlotBorders = {} local tIndices = {} local NumOfIndices = 0 local iNumDirections = DirectionTypes.NUM_DIRECTION_TYPES - 1 function PlotsDoBeLikeThat()...
  15. Knighttime

    Medieval Millennium release thread

    Medieval Millennium is an adaptation of Civilization II: Test of Time, based on Western Europe during the one-thousand-year period from A.D. 500 to A.D. 1500. It requires the Test of Time Patch Project (TOTPP) version 0.15.1 and takes advantage of many features that this enables. This is a...
  16. Knighttime

    Medieval Millennium 1.0

    Medieval Millennium is an adaptation of Civilization II: Test of Time, based on Western Europe during the one-thousand-year period from A.D. 500 to A.D. 1500. It requires the Test of Time Patch Project (TOTPP) version 0.15.1 and takes advantage of many features that this enables. In a technical...
  17. Zegangani

    Lua function/code to disable the ability to produce a Unit

    I'm currently working on a Mod that makes Units require multiple resources (for Costs and Maintenance, for example: Unit_A requires 10 Iron, 10 Coal and consumes 1 Niter, and 1 Coal per turn). To get this on a New Table: is not a big Deal. Make the Resources consumed by the Game (via Lua): can...
  18. Zegangani

    Deal Window: Deal with Units?

    I wanted to make the Deal Window to also make Deals with Units (Arms Trade, Historically starting from Early Modern Era) not just Resources, Artefacts... . I've Tryed something out but no results yet. I hoped someone would help me to make this to work! DiplomacyDealView.lua: function...
  19. Zegangani

    [GS] Help to Create a New Table (with Lua?)

    I want to add a new table for Buildings (and maybe also for Units) that would require multiple resources cost and maintenance, ie: Buildings_Requirements (BuildingType, MainResourceType, MainResourceCosts, SecondResourceType, SecondResourceCosts, MaintenanceRecourceType...
  20. M

    Help with calendar lua

    I've tried to add a custom calendar for a scenario I'm making, but it doesn't update in-game. Here's the code: -- Creates a daily calendar to be used in place of the standard monthly/yearly ones -- Global table containing the calendar g_DailyCalendar = {}; -- Change these variables to...
Back
Top Bottom