Let's start with <any_neighbour_country = { casus_belli = THIS }>. The trigger becomes a new scope; that is, we want to check the right side of the clause as a country trigger. We do already have a type called CountryTrigger in Triggers.txt, so we can just write <Child = { Left = "any_neighbor_country" Right = CountryTrigger" }>. The validator will now act just as if the right side of <any_neighbor_country> was the trigger section of a country event.
Now, for <set_variable>. Here, we need to define another type which can have one <which> and one <value>. Then we can write <Child = { Left = "set_variable" Right = SetVariableClause }>. To define another type, we just put it in the Types clause of the Commands.txt file, just like CountryCommand and Province command.
Code:
SetVariableClause = {
Single = { Left = "which" Right = String }
Single = { Left = "value" Right = Int }
}
<define_advisor> is the same, except for the <type> clause. For a list of advisor types, there is a type called AdvisorType defined in Eu3.gam.txt, so we can write <Single = { Left = "type" Right = AdvisorType }> for that part.
Now, for province_id and its ilk. Their right sides are similar to any_neighbor_country - probably ProvinceTrigger. The left side is slightly different here. We want any land province (or maybe sea provinces as well?), so we cannot simply write the normal <Left = "literal">. Instead, we write <Left = { Type = LandProvince }>. By doing this, the validator will check every child node of a CountryTrigger clause and see if it is a LandProvince. In this way, the <Left = { ... }> clause is just like the <Right = { ... }> clause - you can have things like <Left = { Literal = "blah" Type = LandProvince }> and so on.