fteqcc

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby Cinquero » Thu Aug 24, 2006 10:51 am

esteel wrote:I guess this deserves to be posted here:
LordHavoc on Inside3D: Reasons QuakeC is better than C++ for Quake-based games
http://forums.inside3d.com/viewtopic.php?t=474


Well, they forgot one thing -- the most important thing: documentation. I have not found fteqcc command/language/function references until now...

And there are a lot of debugging utilities for standard code... we have none such thing for QuakeC. For me, it is just nonsense. Sorry.
Cinquero
Advanced member
 
Posts: 91
Joined: Wed Jul 19, 2006 11:13 pm

Postby divVerent » Thu Aug 24, 2006 1:30 pm

If you hate it so much, port our code to C++. And slap Spike for not writing documentation. Once from me please, too.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Cinquero » Thu Aug 24, 2006 6:10 pm

divVerent wrote:If you hate it so much, port our code to C++. And slap Spike for not writing documentation. Once from me please, too.


When I will have the time, I'll do. But that may take until retirement :-). And still, if everyone continues to use QC... ;-)
Cinquero
Advanced member
 
Posts: 91
Joined: Wed Jul 19, 2006 11:13 pm

Postby divVerent » Thu Aug 24, 2006 7:21 pm

Cinquero wrote:
divVerent wrote:If you hate it so much, port our code to C++. And slap Spike for not writing documentation. Once from me please, too.


When I will have the time, I'll do.


Which of the two?

Seriously, here some hints about fteqcc features and bugs you won't find on general QC websites (there are some good QC language references on the net)...

  • Do not use the +=, -=, *=, /= operators. They are broken in many cases. Just don't use them.
  • NEVER UNDER ANY CIRCUMSTANCES call the same function twice in the same expression. fteqcc will fuck it up otherwise. Note that this is still better than ID Software's QCC, which fucked up ANY two function calls in one expression.
  • fteqcc feature: arrays. Example:
    Code: Select all
    float array_of_floats[42];
    .float array_of_float_fields[42];
      // NOTE: you can use this as an "array field of float" too, since the compiler allocates space for all 42 fields in each entity.
    // ...
    array_of_floats[23] = 17;
    self.(array_of_float_fields[23]) = 17;
  • However, since arrays are emulated using get/set functions via binary search (QC allows no arrays or pointer arithmetic - there is a VM extension for that which DarkPlaces doesn't implement yet), expect them to be slow, so don't overuse them.
  • Did I mention that they are emulated using functions? In particular this means that you can't use two elements of the same array in one expression, otherwise fteqcc fucks it up.
  • C-style macros do exist, but they have to be one-liners. \ continuation doesn't work.
  • #ifdef exists too.
  • You can declare variables anywhere, however: "float x = 3;" defines x as a CONSTANT according to ID Software's specification. You have to write "float x; x = 3;"
  • However, a fteqcc extension exists to declare preinitialized variables anyway: "var float x = 3;". However, it hasn't been used in Nexuiz yet, so it may be buggy.
  • fteqcc also adds for, continue, break, switch, a weird union/struct construct, goto (yeah), classes (experimental) to QuakeC. See http://wiki.quakesrc.org/index.php/FTEQCC%20Features for examples.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby esteel » Mon Aug 28, 2006 3:34 pm

Not really fteqcc stuff but i found this quakeC link that divVerent posted on irc a few days ago quite good:
http://members.fortunecity.com/kwarenda/qcmanual.html
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Previous

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron