My current understanding of it :
regX are for storing integers, they're global which is why they're usually used to get the result from calls to other scripts or functions built-in the engine
(try_begin)/(try_end) : basically it's a little like an if statement.
If there is any instruction between the (try_begin) and the (try_end) that fails, it will branch to the next (else_try) or to the (try_end)
(try_begin),
(eq, ":is_unique", 1),
(troop_set_slot, "trp_random_town_sequence", ":cur_town_no", ":random_no"),
(val_add, ":cur_town_no", 1),
(else_try),
(val_add, ":num_iterations", 1),
(try_end),
This could be translated as :
if ":is_unique" equals 1
set troop_slot ":cur_town_no" of troop "trp_random_town_sequence" to ":random_no"
add 1 to ":cur_town_no"
else
add 1 to ":num_iterations"
end of if statement
- ":variable" is a local variable (can't be reused outside of its script/whatever block, becaus it will be 'destroyed')
- "$variable" is a global variable (can be initialised in a script and reused in another script or in a dialog for example)
(assign, ":num_iterations", ":num_towns"),
puts the value of the variable ":num_towns" int the variable ":num_iterations"
For a somewhat exhaustive description of all functions available in the module system, refer to header_operations.py ...
If you've never ever done any programming at all you may want to pick up a book though...