Aha
#1358 posted by Preach on 2014/06/19 08:28:31
So it's like the counterpart to the "private fields" trick, which creates a field mappers can't set on your entities by naming the field with a leading underscore...
#1359 posted by Lunaran on 2014/06/19 18:44:26
Quoth for instance uses it to sort out the screen tints for the custom powerups, restore stuffcmds the mapper has applied, and warn you if you load an incompatible save from an earlier version of the mod.
Really?
I've spent a long time thrashing around in qc trying to figure out how to do all of those things.
A big thank you, once again, for keeping the Quoth source closed, so that nobody can learn anything from it until revealed years later on Preach's blog.
#1360 posted by Lunaran on 2014/06/19 19:54:44
Got it working, but I had to use "nosave float" and not "float nosave" like your post says. This is with the latest fteqcc downloaded from the super-secret triptohell moodles directory above.
Yeah, Well
#1361 posted by Preach on 2014/06/19 21:05:36
There aren't any trade secrets in Quoth, if there's any other features people want to understand just shout and I'll put it on the tutorial list. Thanks for the pointer on the keyword order, I'll fix that in the text.
QC Blackbox
#1362 posted by sock on 2014/06/19 22:29:38
There aren't any trade secrets in Quoth, if there's any other features people want to understand just shout
I think you are completely wrong! I have seen CZG, necro, Kinn and metlslime QC files and all of them were amazing sets of code which has made my understanding of QC better. I think you seriously under estimate the value of letting people see a working codebase. Cherry picking examples is all well and good but seeing the whole picture is damn right educational.
For example I would love to see the AI code for a bob from Quoth, I love how they move, shoot and even their crazy death is cool. Another gem I would love to see is the working code for the ladders in Quoth, not text descriptions but actually working QC files.
There are tons of things about Quoth QC that would be awesome to look at and I personally believe the greatest thing you could ever do for this community is let people see what QC tricks you have done.
Hm
#1363 posted by ijed on 2014/06/20 15:40:15
I should probably post the RMQ qc somewhere.
<Most hated project ever yadda yadda go fuck yourself>
Would any of the people the above didn't apply to be interested in seeing it?
There are some gems in there, like Supa's NPC code and the Shambler lightning attack visual improvement.
Exploding zombies and fast zombies were mine, and pretty cool if I do say so myself :>
I think next map (after I release the current one) will have the exploders in it.
For all its faults, RMQ had some wonderful things in the qc.
RJ's
#1365 posted by ijed on 2014/06/20 18:58:45
Map were also incredibly epic...
Maps
#1366 posted by ijed on 2014/06/20 18:58:55
...rj's Maps...
Ugh
#1368 posted by Drew on 2014/06/20 23:08:59
Wish those would get released standalone.
Can Somebody Smart Do This Thing But For Scrags.
That looks flocking amazing!
Using FTEQCC
#1371 posted by necros on 2014/06/21 20:08:06
Why is:
void() frame = [ $f1, self.th_run ] {};
not allowed?
error: Type mismatch on redeclaration of self. void (), should be entity
QC Opcodes
#1372 posted by Preach on 2014/06/21 21:30:53
In short, because the newthink function has to be determined at compile time for the frame definitions to work.
In long: the [frame, newthink] notation in QC is usually described as a shorthand, but it's actually a bit more than that. When QC is compiled it gets turned into opcodes (like java). Most of the opcodes are pretty generic and normal, but for efficiency reasons that made sense in '96 there's a special opcode which does all the basic monster housekeeping:
* it sets the frame
* it sets the new think function
* it sets nextthink to time 0.1
The only way to create something with this opcode is to use the special [] notation, but once you do, you're locked into using the opcode, and it needs to hardcode the function. I suppose in theory a compiler could treat the [] differently - detect when a dynamic expression has been input and in that case skip the opcode optimisation in favour or writing the relevant QC manually. Might break the principle of least surprise though...
#1373 posted by Spike on 2014/06/21 21:40:42
state functions need special handling if only because they're the one place where a variable can be used without prototyping it first.
this means that the qcc is expecting explicitly a function name and not a statement/formula, and is naturally complaining when the name it saw (self) was not in fact a function as required by the opcode.
the .th_run] part of the definition has not been tokenized yet.
#1374 posted by necros on 2014/06/21 22:28:30
thanks, that makes sense. :)
Aiming
#1375 posted by ijed on 2014/06/24 15:03:11
I've got a large enemy that fires twin streams of projectiles from either hand, each being offset quite a bit from the centre to either side.
The point they aim at has a scattered origin, randomising within a small volume to make the fire pattern more interesting.
In a small test map the enemy works fine, but in my main map it occasionally looks like it's the point of origin and not the point of aim that's getting slightly randomised.
Does this sound like an engine precision issue?
#1376 posted by Spike on 2014/06/24 17:22:01
depends how large your projectiles are.
with the vanilla network protocol, origins have 1/8th qu precision.
angles have 1/256th revolution precision
on a large object with offset origins (read: rotating bsp doors), the angular precision can result in significant jerks. this is generally not much of an issue with models though.
if you want to test if its an engine precision thing, try the following engine+cvar settings.
fte: compare sv_bigcoords 0(low/vanilla precision) to 1(16bit angles, 32bit float coords). restart the map for it to take effect.
dp: compare sv_protocol 'quake' (vanilla) to 'dpp7' (16bit angles, 32bit float coords), or whatever it was. not sure what you need to do to actually apply the new setting.
They're Points
#1377 posted by ijed on 2014/06/24 20:16:54
So that pretty much rules that out. I need to debug again.
Thanks for the answer.
#1378 posted by necros on 2014/06/25 04:18:03
you're using makevectors and v_* to do the offsets?
#1379 posted by Spike on 2014/06/25 09:03:54
yeah, makevectors(self.angles) is bad if self.angles_x will ever be anything but 0.
makevectors pitch angle is inverted relative to non-brush models (old id bug).
yes, its inverted relative to vectoangles too.
No Makevectors...
#1380 posted by ijed on 2014/06/25 14:40:14
I got it working eventually in a testmap like I say, without any weirdness. Just in my large BSP2 it seems like the org (point of origin) is behaving like the vec (point of aim).
org1 = self.origin + v_forward * 20 + v_right * 36 + '0 0 24'; //right hand
org2 = self.origin + v_forward * 20 + v_right * -36 + '0 0 24'; //left hand
vec1 = self.enemy.origin + RandomOffset(22) - org1;
vec2 = self.enemy.origin + RandomOffset(22) - org2;
The RandomOffset function just does this:
local vector offset;
offset_x = crandom() * offset_amt;
offset_y = crandom() * offset_amt;
offset_z = crandom() * offset_amt;
return offset;
Am I missing something obvious there or taking something for granted? My coding is built on trial and lots of error, meaning I kn ow nothing of good practices etc. I don't have makevectors anywhere in the qc file actually...
Well There's Yer Problem
#1381 posted by Lunaran on 2014/06/25 16:14:50
makevectors is where v_forward and v_right get populated. if you don't call it on self before doing all that, they'll be left over v_forward and v_right vectors from whatever thing last used them.
Hah, So...
#1382 posted by ijed on 2014/06/25 17:47:22
It was all in my head about it only happening in the larger map.
Will test it out tonight, thanks.
|