Highlighting and Compiling QCs with ConTEXT: Difference between revisions
m (Spelling) |
m (spelling mistakes) |
||
Line 12: | Line 12: | ||
== How and What == | == How and What == | ||
ConTEXT is a beefed up notepad useful to programmers. One of the handy things it has built-in is a batch system that can be set up to compile files depending on their endings. I told | ConTEXT is a beefed up notepad useful to programmers. One of the handy things it has built-in is a batch system that can be set up to compile files depending on their endings. I told ConTEXT that whenever i have a qc file open and press F9, it should execute studiomdl.exe and the path to the qc file. This compiles the model for you while you are in the editor, and it saves the hassle of keeping a shortcut of studiomdl around. I also prefer it over custom compile tools because of its simplicity, and after writing 50+ qc's I got used to the whole qc format, so I don't really need a tool to make a qc for me. | ||
Another advantage with ConTEXT is it's ability to color code | Another advantage with ConTEXT is it's ability to color code functions and values, witch makes it a lot easier to read the file. | ||
== How to set it up == | == How to set it up == | ||
Line 28: | Line 28: | ||
[[Image:context3.jpg]] | [[Image:context3.jpg]] | ||
Select one of the 4 F# functions, I use | Select one of the 4 F# functions, I use F9. You can basicaly have 4 different batches done on one format. | ||
Execute: This is the path to your studiomdl.exe. | Execute: This is the path to your studiomdl.exe. | ||
*Note if you don't know where it is, type "%sourcesdk%\bin\" in the | *Note if you don't know where it is, type "%sourcesdk%\bin\" in the addressbar of Windows Explore (not Internet Explorer, a folder like my computer, the run option in Windows is also usable). | ||
Parameters: The other important one, this gives the path of the .qc file. Use %n. | Parameters: The other important one, this gives the path of the .qc file. Use %n. | ||
Line 37: | Line 37: | ||
Capture Console: This just echoes the output of studiomdl at the bottom of context instead of a cmd or dos window, handy for spotting errors. | Capture Console: This just echoes the output of studiomdl at the bottom of context instead of a cmd or dos window, handy for spotting errors. | ||
*Note | *Note alternatively you can also have "Pause after execution" instead, that way you will still be able to see the color coding of the errors and warnings. | ||
[[Image:context4.jpg]] | [[Image:context4.jpg]] | ||
Line 46: | Line 46: | ||
[[Image:QCHighlighted.png]] | [[Image:QCHighlighted.png]] | ||
Thats pretty much it, now all you do is open any QC file and press | Thats pretty much it, now all you do is open any QC file and press F9, and it will compile it for you, easy stuff. |
Revision as of 15:06, 1 July 2006
What you need:
Source SDK
- Note that the QC highlighter is still in development. if you find any thing wrong or have sugestion, contact Wolf.
How and What
ConTEXT is a beefed up notepad useful to programmers. One of the handy things it has built-in is a batch system that can be set up to compile files depending on their endings. I told ConTEXT that whenever i have a qc file open and press F9, it should execute studiomdl.exe and the path to the qc file. This compiles the model for you while you are in the editor, and it saves the hassle of keeping a shortcut of studiomdl around. I also prefer it over custom compile tools because of its simplicity, and after writing 50+ qc's I got used to the whole qc format, so I don't really need a tool to make a qc for me. Another advantage with ConTEXT is it's ability to color code functions and values, witch makes it a lot easier to read the file.
How to set it up
First install ConText, then after that is done, open it and go to the Options->Environment Options on the menu bar.
At the top, go to the Execute Keys tab and press Add on the left side.
Type in the QC file ending (no period)
Select one of the 4 F# functions, I use F9. You can basicaly have 4 different batches done on one format.
Execute: This is the path to your studiomdl.exe.
- Note if you don't know where it is, type "%sourcesdk%\bin\" in the addressbar of Windows Explore (not Internet Explorer, a folder like my computer, the run option in Windows is also usable).
Parameters: The other important one, this gives the path of the .qc file. Use %n.
- Note at the bottom of the menu is a discription of what %n and other special parameters does.
Capture Console: This just echoes the output of studiomdl at the bottom of context instead of a cmd or dos window, handy for spotting errors.
- Note alternatively you can also have "Pause after execution" instead, that way you will still be able to see the color coding of the errors and warnings.
Next download the qc higlighter and put it in the highlighter folder where you installed ConText. Now ConText will color the functions, values and operators in the QC. This helps a lot when bug fixing and trying to understanding the QC format.
Thats pretty much it, now all you do is open any QC file and press F9, and it will compile it for you, easy stuff.