Index of /moodles/fteqcc

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]README.html2021-03-22 13:29 81K 
[TXT]csqcsysdefs.qc2022-03-04 08:29 186K 
[TXT]fteextensions.qc2022-03-04 08:29 255K 
[   ]linux32-fteqcc2022-03-07 19:53 630K 
[   ]linux64-fteqcc2022-03-07 19:53 743K 
[   ]linuxarmhf-fteqcc2022-03-07 19:53 755K 
[TXT]menusysdefs.qc2022-03-04 08:29 88K 
[TXT]version.txt2022-03-07 19:53 426  
[   ]win32-fteqcc.exe2022-03-07 19:53 549K 
[   ]win32-fteqccgui.exe2022-03-07 19:53 2.0M 
[   ]win64-fteqcc.exe2022-03-07 19:53 598K 
[   ]win64-fteqccgui.exe2022-03-07 19:53 2.0M 

FTEQCC ReadMe

FTEQCC Documentation

➕ QuakeC overview:

QuakeC is a language originally created by iD software for use in in the game Quake.
Vanilla QuakeC is quite a limited language, however with qcc improvements and engine extensions, its less annoying to write and also much more capable.

Modules: FTEQCC supports multiple output targets which provide additional opcodes or change the number of bits used for various offsets. FTEQCC does its best to provide fallback behaviour so that extended syntax can work with the vanilla progs format without mandating new opcodes. An example of this is the array support. However, this is not always possible/practical/desirable to do this.
So if you get errors about unsupported opcodes (or your mod is already FTEQW-only), try '#pragma target FTE', and things should start working again but only in FTEQW (and be a little faster+smaller).
Opcode extensions are generally required for (true) integers, as well as pointers.

➕ Getting started:

The best way to get started is to find an existing qc-only mod (like id1qc.zip), extract the qc source files somewhere like c:\quake\mymod\src\*.qc, shift-right-click the extracted .src file and select open-with and find fteqccgui.exe
Then in fteqccgui press F7 to compile, then press F5 to run (you'll be prompted to locate the exe you want to run as well as you quake directory.
In the engine you can then just load a map.
One common suggestion is to open weapons.qc, find the W_FireRocket function, and to then change the velocity multiplier for really slow moving rockets, just to see that you've made a change. There are many many other things you could do instead, of course. Your mod, your choice.

➕ Command-line:

Many commandline arguments are best migrated to pragmas, or set via fteqccgui's options menu.

non-gui package-related commandline args

➕ Project management:

All QuakeC starts with a single file - aka the .src. This file comes in two forms.
  1. Old style.
  2. First token: treated as equivelent to #output "thetokenhere"
    Other tokens: treated as equivelent to #include "thetokenhere"
    Preprocessor may be used in this file only after the first token.
  3. New style.
  4. First token MUST have a leading #, and is typically #output "filename".
    The rest of the code is treated as a .qc file in its own right, including function defs etc.
    Usually the code will be include a series of #includes in order to pull in any .qc files you wish to compile.

➕ Other Pre-Processor:

➕ Control Statements:

➕ Basic Types:

➕ Complex Types:

➕ Type Modifiers:

➕ Operators:

Operator precedence follows somewhat complex rules that do NOT match C's operator precedence.
As a general rule, QC is more forgiving, at least if you don't expect C precedence, particuarly around the & and | operators.
Operators are listed in rough order of priority.

Unary operators are normally written with the operator before their argument, the exception being post-increment/decrement.

➕ Intrinsics:

➕ Modelgen:

iD software's modelgen and spritegen tools were designed to read special commands directly from qc files, ensuring that data was kept in sync. Those tools are basically irrelevant now, but the qc syntax remains regardless, and has been extended
Model generation commands always start on a new line with a leading $ char.

➕ Compiler Flags:

These are enabled with -Ffoo or disabled with -Fno-foo.
Many (but not all) can also be reconfigured mid-compile, using '#pragma flag [en|dis]able foo'.

➕ Engines:

Different engines support different extensions.
These take the form of added builtins, new fields with special side effects (or even existing fields with new values meaning new stuff), or globals that report additional results or change the behaviour of existing builtins.
Engine extensions can be useful but they can also restrict which engines your mod can run on. You'll need to find the right compromise for your mod yourself.
Most of the common important extensions can be queried at run time. This is done eg as following:
if (cvar("pr_checkextension"))
	if (checkextension("FRIK_FILE"))
		canopenfiles = TRUE;
Note that QuakeC does not normally early-out, so the two if statements must be nested and not replaced with an && operator.
FTEQW (and QSS) have a few builtins that have no formal named extension. These can be queried with eg the following:
if (cvar("pr_checkextension"))
	if (checkextension("FTE_QC_CHECKCOMMAND"))
	{
		if (checkbuiltin(search_getfilemtime))
			cancheckmodificationtimes = TRUE;
		if (checkcommand("cef"))
			canusewebbrowserplugin = TRUE;
	}
Here's a list of the engines with extensive extensions. These files typically contain comments that describe the new stuff either on a per-feature basis or per-extension basis. If you don't understand the description of a feature for one engine then you may find another engine describes it with greater clarity.

➕ FTEQCC Source+Compiling:

NOTE: This section pertains to compiling fteqcc itself, not compiling QC code.

FTEQCC's sourcecode can be found on the fte svn repository (mixed with fte's qcvm in trunk/engine/qclib/).
To compile the (windows-only) gui version (from msys, or cross-compiling from linux):
	svn checkout https://svn.code.sf.net/p/fteqw/code/trunk fteqw-code && cd fteqw-code/engine && make qccgui-scintilla FTE_TARGET=win32
	
To compile the commandline version of fteqcc:
	svn checkout https://svn.code.sf.net/p/fteqw/code/trunk fteqw-code && cd fteqw-code/engine && make qcc-rel
	
The resulting binary can then be found in the fteqw-code/engine/release/ subdir.