In many programming languages, including Lua, the single equals sign does not mean "is equal to". Conditions can be combined using and and or. "=" mean "less than or equal to" and "greater than or equal to", respectively. The greater than and less than sign mean what you expect. The following are examples of boolean expressions. In most cases, you will be using Boolean expressions that can be true or false depending on the situation. You can use Booleans to evaluate if conditions or loops. If you want to type a normal backslash, type " \\".Īnother data type is the Boolean, which can only have two values: true or false. Note that the backslash ( \) is an "escape character" ( more info here). In Lua, you can join one string to another using the. They behave similarly to the variables in algebra, but can store any kind of data, not just numbers.Īnother simple data type in addition to numbers is the string, which represents text and is defined with quotes. Variables, data types, arithmetic, and logicĪ variable is the name of the place where you store data. You can find many good resources for learning Lua on the page. On the advice of some people who helped proofread this tutorial, I've vastly condensed this section, as it is not the main focus. This section will briefly introduce basic programming concepts using Lua. I recommend frequently referencing the documentation provided in the Aegisub user manual. If you already know Lua, or if you'd rather start writing macros right away and learn Lua as you go, then you can skip to "The Aegisub Environment". If you already know a programming language (HTML doesn’t count), you can skip to "Lua for Experienced Programmers". The next section will cover basic programming concepts for people who have never programmed before. This tutorial should provide a solid starting point, but advanced users will have to do their own research. There are many features of the Lua language and the Aegisub API that I've never used and won't cover. This tutorial is based on my own knowledge and experience. In most cases, these tasks can be automated using macros written in Lua code, and often quite easily. If you’ve worked on an advanced substation alpha script, especially if you’re a typesetter, you’ve probably encountered tasks that are tedious, repetitive, and/or require more calculations than you’re willing to do. This tutorial is meant to serve as a basic guide to creating Lua automations for use in Aegisub. This also allows you to have multiple templates, with a bunch of different effects, and only apply them to specific lines.Creating Lua Automation Scripts for Aegisub This is because Karaoke Templater affects all lines with the same style as the template line, so an easy solution is to change the style of the timed lines. You might notice empty lines got affected too, and generated empty lines with tags. \t: You should know what animated transforms are (if you don’t, you might want to go back and read more on ASS tags), and these ones change \3c to white, then back to black.The one from the first post should do:ĭialogue: 0,0:00:01.00,0:00:05.58,Default,0,0,0, as our first syl, $start will be 0, $mid will be 215 and $end will be 430. So, the first thing to do will be loading a timed line. Since this might not be too descriptive, I think it’s best if we jump right into a simple example, right? To jump right into it, Karaoke Templater is a script that comes included with Aegisub, and interprets code written special lines called templates, and applies those templates to the lines you specify.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |