TCL Script - Walkthru

F4Browse, CATE, Tacedit, Terrainview & TheaterMaker etc utility related

Moderators: Lone Wolf, Snake Man

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

TCL Script - Walkthru

Post by ranger822 » 2007-09-19 17:14:44

Snakeman and others proficient with TCL.

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 :D

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

TCL Script Documentation -

Post by ranger822 » 2007-09-19 18:13:38

the original document that the link was posted to doesn't work anymore. Snakeman - do you still have the documentation for TCL and could you post that somewhere as a download?

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

TCL Scripts Number Codes

Post by ranger822 » 2007-09-19 18:18:20

There are references in the scripts to various numbers for

brgtype (brigade type) 86, 88 etc
battype (battalion type) 45, 727 etc

Are these randomly chosen numbers or do these correspond to a definite set of numbers that identify a specific type of unit

i.e. batttype 54 = m2a2 mechanize bradley unit? If so, is there a consolidated listing of the types for briade, battalion etc.?

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

TCL Scripts Related?

Post by ranger822 » 2007-09-19 18:27:21

In looking thru the PMC Korea script set it looks like the scripts are related to each other somehow . . . does running one script run the rest, or does one have to run the scripts in a particular sequence or order?

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2007-09-19 20:19:21

Is it possible to post some TCL scripts lines with some commented lines
You should first check Tacedit - TCL corner topic, there is some basic stuff.
For example - lets look at the Create a new Squadron TCL
You looked the wrong file, thats the high tech source Codec wrote, even I dont understand it.
is the Squad(AIRCAV_CH53) the unit name from F4Browser?
No, its the variable name we call from the "other script".
is the Air Cavlary CH-53 just a convenient name or pulled form something?
Convenient name for display/printing/output purposes.
is 425 the FalconID number I.e. CT-100?
I get these confused, but yes; it is the Tacedit CT minus hundred, yeah.
Now what about a detaile explanation of the lines further up?
As I said, forget about them, you were looking at the wrong script. At least if you want to write a squadron placement script, you have no business nosing the high tech script, but instead you should look/write the easy/short script which tells teh high tech one what units to create.
the original document that the link was posted to
What is this link?
battype (battalion type) 45, 727 etc
i.e. batttype 54 = m2a2 mechanize bradley unit? If so, is there a consolidated listing of the types for briade, battalion etc.?
These are the CT or what ever F4Browse unit/batallion/bridage numbers. Also I cant remember if they too were -100 counted.
PMC Korea script set it looks like the scripts are related to each other somehow . . . does running one script run the rest
Yes. TCL line of

Code: Select all

source "D:\\F4Terrain\\tacedit\\create.PMC.Airdefenses.tcl"
Means that we run d:\f4terrain\tacedit\create.pmc.airdefenses.tcl script.

Btw I moved the topic to Tools area.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

TCL Script Documentation -

Post by ranger822 » 2007-09-19 21:51:53

Thanks - - let me study some more . . . just doing some preliminary work try to get a better understanding . . .

regarding the link for documentation - this is the link you posted in the TCL Corner -

http://resource.tcl.tk/resource/doc/manual/

"temporarily unavailable" been like that for a little while now... I was hoping maybe you have a copy stored.

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2007-09-19 22:55:03

Oh that, I have nothing on that one. We just have to google some other TCL site.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

TCL Script Documentation -

Post by ranger822 » 2007-09-20 11:29:38

OKay, I will google, not sure what to look for - the problem is I don't understand quite what the script is doing in the first place. What I could use is a translation of the script into English and how it relates to Falcon; what a script does to specific campaign building elements . . . etc.

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2007-09-20 13:48:08

TCL is the known scripting language, its like Basic or C++ etc, programming language thingy. It has nothing to do with Falcon 4. In Tacedit there is commands you can run from a TCL script.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Closter
Captain
Posts: 154
Joined: 2007-01-07 00:13:42

Post by Closter » 2007-11-12 11:11:51

I don't know if it's the same content that the link above, but I have found these pages useful:

http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html

I am trying to learn enough to understand the already written scripts, perhaps coment them, and try to write one or two... who knows...
Image

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests