At this point, though, you might be asking – “how the HECK do I find out what the commands are?” And that, my friend, is why you’re reading this lesson. Commands are the driving force of most any script. In big part, commands make or break what can be done with scripts. Through these commands, we can script a whole lot of stuff! From character spawns, to new effects applied to characters and factions and armies, to quest battles, to unlocking rites, and so on. Commands are used to communicate between the Lua environment and the actual Total War Engine – the base C++ code that defines the majority of the game. Whenever we use commands, we’re treating them like function calls they’re a statement. They function (hah) identically to the functions we’ve already covered some have parameters, some have return values, they all do stuff. Every worthwhile Lua mod on the market has these in it! Anything else just concatenates strings or applies arithmetic or some nonsense.Ī command, at its bearest-bones, is a CA-defined Lua function that does stuff that we can’t see.
The three of these are our introduction to messing with the game itself, and making real change. For today’s lesson, the subject is three-fold: commands, interfaces, and listeners.