Is it possible to post some TCL scripts lines with some commented lines before/after each script line to explain as thoroughly as possible to a TCL retard (ME) what the script line is doing? Maybe I am just not looking at them long enough.
For example - lets look at the Create a new Squadron TCL - -
===============================================
# utility proc to create a new squadron with the first global entry:
proc createSquadron { type sqname abnum } {
set newid [unit create $type ]
unit set $newid bflags 3 control [objective get $abnum control] x [objective get $abnum x] y [objective get $abnum y] name $sqname unitflags 32 destx [expr [objective get $abnum x] +1] desty [expr [objective get $abnum y] +1]
return $newid
}
proc MakeSquads { airlist } {
global squadname Squad
set name [lindex $airlist 0]
set airbaseid [lindex $airlist 1]
set squadtypes [lindex $airlist 2]
set result "$name Airbase:"
foreach {count squad} $squadtypes {
set sname [lindex $Squad($squad) 0]
set sid [lindex $Squad($squad) 1]
for { set i 0} {$i < $count} {incr i 1} {
createSquadron $sid $squadname $airbaseid
incr squadname 1
}
append result " $count" "x " $sname
}
printout $result
}
# some global data
set Squad(AIRCAV_CH53) [list "Air Cavalry CH-53" 425]
===============================================
working backwords -
is the Squad(AIRCAV_CH53) the unit name from F4Browser?
is the Air Cavlary CH-53 just a convenient name or pulled form something?
is 425 the FalconID number I.e. CT-100?
Now what about a detaile explanation of the lines further up? Perhaps walking thru what is being done - and what numbers must be input would help me understand the process. At the moment it sort of looks like magic
