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, and ToTPP Lua interaction so that a scenario maker can write basic events functionality and use more complicated functionality written by others. It is also intended to provide enough knowledge about programming and lua to enable the student to use other lua resources to learn more about the language. Questions, comments, and criticisms are all welcome. Post feedback here for the time being. If you're interested in learning Lua "soon" (say, a 50% chance of wanting to do so within the next 6 months) please like this post, so I know to make this project a priority. Lesson 1: "Hello World" Start a new game of Civilization II with a version of the Test of Time Patch Project that includes Lua functionality. Activate Cheat Mode. Press Ctrl+Shift+F3 to open the Lua Console. In the Input Bar at the bottom of the Lua Console type: Code: print("Hello World") And press Enter. Your Console should now look like this: The command print() displays to the console, and this will be useful later for debuging. However, the point of Lua is to interact with the game itself. Therefore, enter the code Code: civ.ui.text("Hello World!") A text box should appear in the game like this: Now, let us make an error in typing a command. We will type C instead of c: Code: Civ.ui.text("Hello World!") An error message is printed in the console, which now looks like this: We can access a previous command and make changes to it by pressing the up arrow in the console command line. Do this, and make 'C' lower case. Press Enter, and the "Hello World" text box should appear. Thus far, we've only got the game to do something by writing a command in the Lua Console. Now, we will write an event. Don't worry about why the event is written this way for now, that will be explained in a later lesson. Code: civ.scen.onActivateUnit(function() civ.ui.text("Hello World!") end) If no error is printed, close the Lua Console (the X in the top left corner). Activate a unit (clicking on it will do). You should get a "Hello World!" text box message. Open the Lua Console again, and enter the following code: Code: civ.scen.onUnitKilled(function() civ.ui.text("Goodbye Cruel World!") end) Now, create 2 warriors, one from a different tribe, and make them fight. You should get a text box like this: This concludes lesson 1.