News | Forum | People | FAQ | Links | Search | Register | Log in
Coding Help
This is a counterpart to the "Mapping Help" thread. If you need help with QuakeC coding, or questions about how to do some engine modification, this is the place for you! We've got a few coders here on the forum and hopefully someone knows the answer.
First | Previous | Next | Last
The vanilla source code (version 1.06) can be found at least here:

C0burn had also linked Ultimate Regular Quake Patch's source code to me. It has a lot of fixes/workarounds for problems that may arise with the vanilla code. I borrowed some code from it for one of my maps.

Good luck to your plunge! :) 
Looks like a lot of MP focus in that second link. Thank you! 
Also FWIW: 
For my own purposes I put some QuakeC onto github a while back. There's various places to get these same things, but:

For the original 1.06 QuakeC you can browse it here:

or download a zip of it from here:

For Preach's cleaned-up 1.06 you can browse here:

or download here:

And you can see the differences between them here: 
Eh, one caveat that just occurred to me about those zipfile downloads. If you get the code that way then all the files will use Unix-style line endings. Might cause you issues depending on what text editor you're using. 
The URQP package is neat. I didn't know that that was where the Quake Info Pool fixes ended up. 
Bug Zapping 
I've updated the QuakeWiki with a list of bugs I know about in the 1.06 code.

It's most of the URQP stuff, plus other bits and bobs.

Please amend or ask me to amend if anything is missing! 
What About Solid Fiends? 
Quote from your list:

Rotfish does not become non-solid until the final frame of it's death animation * this is not in line with other monsters, so it is considered a bug

Correct me if I'm wrong, but don't fiends exhibit similar behaviour, too? 
They become non-solid on frame 6/9!

Glancing at some others quickly, hellknight is frame 3, as is the grunt.

I think it should be harmonised. 
Some More Thoughts 
Should we class unused content, such as the death knight grunt sound and unused animations and unused shub sounds, as a "bug"? There's other bits and pieces as well, including unused animations in the knight, soldier and ogre. Can we introduce these in a non gameplay changing manner? Should they be an optional spawnflag/worldspawn flag? 
In the ai.qc i took the ai_run part.

void(float dist) ai_run =
local vector delta;
local float axis;
local float direct, ang_rint, ang_floor, ang_ceil;
local entity spot; //xogre_leak code
movedist = dist;
// see if the enemy is dead
if ( <= 0)
self.enemy = world;
spot = find (world,classname,"monster_xogre");

if ( spot ) {find (world,classname,"monster_xogre");
spot.think = xogre_leak1;
spot.leakentity = self;

and the bastard lays it's blame on me!

Thanks Spike, that was right on target!
Now see if I can switch leak with laughing. 
A Few Other Notes 
Thunderbolt bugs relating to the "three beams"

I assume this bug isn't related to lightning attacks (both thunderbolt and shambler) being able to damage entities through walls? Also, hitchecks with the thunderbolt are kinda weird. (You probably know what I mean with that, but if you don't, just tell me, and I can explain in a reply.)

multiple megahealth rots down too quickly (double rot)

I had learned about this actually, when I tried to make a custom Doom-like health bonus item. My health would rot down super fast after having picked up like ten of those items! @~@ I actually thought that it was a feature, to make supercharged players less OP, or something. :D

targets not fired if the player doesn't take the item (e.g. already has max armour, touching armour should trigger a monster/something, but doesn't)

This is even more so arguable, whether it's a bug or not. I actually prefer it the current way. If I wanted to make 100 % sure about the targets being triggered when touching the item, I'd add a trigger_once brush or something.

(Also there are minor typos here and there in the list.) 
@Johnny Law 
Thanks. I wasn;t aware Preach had a version of his own. I'll most likely use Preach's 106 code when I dive back in. I am using FTEQCCGUI and Notepad++ 
Last year muk0r put together a "clean QC source"... but the readme doesn't say if there is any bugfixes :(

but maybe (i said maybe because i don't know if you want these features) you should start with custents?
It seems to be a mix of all the cool features of the two official mission-packs, like: rotating brushes, earthquakes, particle fields, breakable walls, etc 
Thanks for these links. I am looking at adding some of the custents features for sure. 
I think the "same name texture" crash mentioned on that page is only in GLQuake and derived engines. 
I agree about the item not triggering it's targets if it hasn't been picked up, that is definitely not a bug, it makes total sense for an item to not do anything if the player touches it but can't interact with it for whatever reason, like if their ammo is full or they have full armor or they already have that type of key in their inventory. Not to mention that a vast majority of maps are designed around this mechanic one way or another, like key traps triggering when the player, you know, picks up the key or encounters that get triggered when you pick up a particular weapon or powerup like quad damage

Now if we're talking about keeping the player from picking something up if they already have enough of it that's another story, it would definitely be nice sometimes if some things like ammo or health only gave themselves to you if you actually needed that much, it would definitely help prevent wastefulness by picking them up on accident when you don't really need that much yet 
I agree about the item not triggering it's targets if it hasn't been picked up, that is definitely not a bug, it makes total sense for an item to not do anything if the player touches it but can't interact with it for whatever reason, like if their ammo is full or they have full armor or they already have that type of key in their inventory. Not to mention that a vast majority of maps are designed around this mechanic one way or another, like key traps triggering when the player, you know, picks up the key or encounters that get triggered when you pick up a particular weapon or powerup like quad damage

Now if we're talking about keeping the player from picking something up if they already have enough of it that's another story, it would definitely be nice sometimes if some things like ammo or health only gave themselves to you if you actually needed that much, it would definitely help prevent wastefulness by picking them up on accident when you don't really need that much yet 
Cleaned Up Code 
I should mention that the changes in the cleaned up code are only to eliminate compiler warnings, there aren't any bug fixes or behaviour changes. Just wanted to set the right expectations for it. 
Thanks for the clarification. I am still very much in the copy and paste fingers crossed stage of qc. I believe c0burn wants to release a bug smashed version of the code eventually. That's a great project IMO. 
Result is that a player in fight with an Axe_ogre will get pissed. If player is shot from distance, the ogre won't walk to the player's body. 
the point of doing it in ai_run is that:
a) self is the ogre that should do the widdle. there is absolutely no need to call find (because you can just use self). there is no need to loop etc (each monster will call the function at some point anyway).
however, you really ought to only do that logic if self.classname is actually what you expect. you don't really want scrags trying to widdle.
b) the player that its trying to urinate on is already stored inside self.enemy. This means that you don't need a seperate leakentity field - just use self.enemy! (do note that you'll want to avoid the self.enemy=world line if the ogre is meant to start widdling.) 
Thanks for your answer. Sorry I'm such a noob at coding.
If I use the self argument, how do I make it fit in?

As it is an experimental src, so maybe it is better to show an example
of what I am trying to do.
here's a demo of Qtest

the main problem, the "new" monsters seem too much overpowered (especially vomitus)

noticed a couple of issues, check the demo 
Queer Queen 
Just finished a nice trick to change the serpent into a quaddam.
But don't touch it, cause it lives.., a bit husling with the skin file.

Yes, the src has a MISSILE weaponcode for each monster,
wizard is also much too strong. Number code for weapons won't work. Still beta.

Thanks for the demo, I'll look at it! 
You made your way quiet advanced on hard skill. Spy.
The missing sounds are qc depended.
I turned a bit strayed with the qtest.qc. adding the monsters,
especially the dragons, caused a lot of changes.

I assume the forced demo end had something to do with crashing,
it is still beta version, already glad it runs.

Thanks for taking your time. 
Partial Cross Post 
I am just getting started "cutting and pasting" QuakeC. I followed Preach's revised tutorial on monster spawning here:

I'd like to add a small random delay automatically to each teleporting monster as you can do in Quoth. I am using custents multiple triggers to trigger these delays spawns. Similar to Quoth, it would be nice to have a little variation on the timing if the monsters all share a targetname.

I've tried a few things already, being exceedingly cautious not to mess up this code I can barely comprehend. I'm wondering if anyone would like to give me a hint of how to approach this little addition. 
Add a new function:
void monster_teleport_delay () {
self.think = monster_teleport_go;
self.nextthink =time + self.wait; // or self.delay if you prefer that

Then in your monster_teleport() function change self.use to be monster_teleport_delay; instead of monster_teleport_go.

DISCLAIMER: Untested. 
thank you for the help... I will try this after work this evening! 
Newb question: would this mean I need to add a wait or delay key value to the entities? I don't mind setting it manually but wanted to know if this is how this method works. 
If you don't want to set a wait value manually, instead of using self.wait in that code you can generate a random number between 0 and 1 using random() instead.

Can you see how to adapt the code to use random to create a delay of between 0 and 1 seconds?

How about a delay between 0 and 2 seconds?

What about between 0.5 and 1 seconds? 
Obviously I posted that before reading the other thread. 
No worries thanks for the great tutorials. I am enjoying messing around with QC finally. Next, I am going to try and figure out a silent spawn without the tfog and audio next. I think I can do it. 
Decision Made! 
After trying to implement random timings I felt it better to go with self.delay. More work but more control for the mapper. Thanks everyone! 
Te_lightning, Etc 
void(vector v1, vector v2) te_lightning =
WriteEntity (MSG_BROADCAST, world);
WriteCoord (MSG_BROADCAST, v1_x);
WriteCoord (MSG_BROADCAST, v1_y);
WriteCoord (MSG_BROADCAST, v1_z);
WriteCoord (MSG_BROADCAST, v2_x);
WriteCoord (MSG_BROADCAST, v2_y);
WriteCoord (MSG_BROADCAST, v2_z);

Writing some TE_ helper functions has gotten me curious. WHY is there an entity parameter needed for the lightning, beam, etc? Is it safe to just write world? 
I figured it out. It uses the entity as the start point regardless of the co-ordinates passed. And this is why the lightning beam starts at the origin of the player, regardless of anything else. 
beams last 0.2 seconds. QC respawns them every 0.1 seconds.

the entity argument is just there to avoid the resulting double-beams issue (trying to depend upon precise timing would be too unreliable with network latency etc, hence why they last longer).
Using world would break when you have two players firing beams, although some engines do understand world to mean 'don't replace any beams'.
tbh 99% of the time that entity arg will be self.

ignoring the startpoint and using the player's position is just to smooth things out so that the player doesn't leave the beam behind when moving sideways etc.

note that there's already an engine extension to provide those as builtins (with that name), so beware of potential conflicts if a modder uses *extensions.qc. 
W_FireLightning Start Origin Incorrect On Players? 
original code has

LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30);

(even URQP has it that way)

But i had long changed it to

LightningDamage (org, (trace_endpos + (v_forward * 4)), self, 30);

this is especially obvious when shooting from RL window on DM3 and aiming at someone on the lower bridge.
this is because:

org = self.origin + '0 0 16';
traceline (org, org + v_forward*600, TRUE, self); 
The original is "waist lightning". Darkplaces has specific settings to let you pick which style you prefer, waist or gunpoint. 
That only fixes the position of the bolt VISUALLY, which is what Spike was explaining. The above fixes the tracelines/damage as well. 
ya the original deals damage from the gun but visially it came from the hip
i keep confusing myself that sel.origin is the bottom of the model
where the feet touch the floor 
Trigger_push Project 
Still taking baby steps into QC with very little coding background. Wanted to check with experienced coders. This bit of code makes a trigger_push silent with a spawnflag. It appears to be working fine in game and no errors in FTEQCC but I feel like the syntax is still wrong.

Next steps will be to learn how to toggle it and add custom sounds.


float PUSH_ONCE = 1;
float PUSH_SHHH = 2; //DMS push silently

void() trigger_push_touch =
if (other.classname == "grenade")
other.velocity = self.speed * self.movedir * 10;
else if ( > 0)
other.velocity = self.speed * self.movedir * 10;
if (other.classname == "player")
if (!(self.spawnflags & PUSH_SHHH)) //DMS
if (other.fly_sound < time)
other.fly_sound = time + 1.5;
sound (other, CHAN_AUTO, "ambience/windfly.wav", 1, ATTN_NORM);
if (self.spawnflags & PUSH_ONCE)

/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE
Pushes the player
void() trigger_push =
InitTrigger ();
precache_sound ("ambience/windfly.wav");
self.touch = trigger_push_touch;
if (!self.speed)
self.speed = 1000;

You could also check the spawnflags in the spawn function and only precache the sound if needed. 
Quakedroid would be about the only reason not to just precache everything. 
What does this mean?

if ( (rand()&3)==1 
if ( (rand()&3)==1
rand() returns a number between 0 and RAND_MAX.
&3 truncates all but the lowest 3 bits (so a random number between 0 and 3 inclusive).
==1 gives you a 1-in-4 chance of being true.
and there's no closing bracket, so the entire thing is a syntax error and won't even compile.

of course, rand's randomized bits are generally least reliable in the lower bits, so the above might be quite predictable, but it depends upon the rand implementation. 
Truncatorial bitwise AND. Mkay.

So 25%ish chance in movetogoal to "bump around" using the wall following code if the monster can't step in the direction of its .enemy

I guess that makes (rand()&1) evaluate to 50%ish chance. 
lowest 2 bits, sorry. and yeah, bitwise and.

movetogoal is just all kinds of screwed tbh. its very much an attempt to replicate doom's monsters, but in a way that's 5+ times as expensive due to all the floor checks etc. it can't slide along walls so can't deal with narrow passageways, etc. it works well enough, but its far from ideal. 
Its strung out multi-function calling madness yes. Trying to recreate it. 
Which Coordinates Do I Use For ReMStud? 
So I got the save file and the console output, but I can't seem to find the correct coordinates for putting the camera in one place and a place to view it. What set of coordinates do I use for the 3 sets I'm given from the console output? 
Not sure it is what you're aiming, but in a mapeditor with a viewscreen it is easy to turn the view camera and the info_camera aligned.
Just make sure the arrow of both viewpoints are the same. 

Here is a rotfish fix I knocked up for otp. It fixes the fish count, makes fish gibbable, makes them non-solid straight away when dead, and includes a fixed fish.mdl due to the bugged head size in the death frames.

It's all combined in a pak2.pak so it can be used as an id1 fix if you drop it in there.

Source is included, only fish.qc and monsters.qc have been modified however. 

This is a command line based tool which will read a QuakeC progs.src and all .qc source files listed within, and output a .DEF file compatible with a map editor such as TrenchBroom.

This assumes your QuakeC source files contain /*QUAKED*/ style definitions such as those found in the original id software QuakeC sources, as used by the original QuakeEd. For example, from items.qc in the original source:

/*QUAKED item_armor1 (0 .5 .8) (-16 -16 0) (16 16 32)

This makes the laborious task of hand creating a .DEF file a thing of the past, as long as you include the relevant entries in your QuakeC sources when adding or amending entities. While not as powerful as .FGD files, .DEF files have a place and can be a quick way to add map editor support for your new mod!

Source code is included as a simple .c file, which should build on any C99 compiler. 
Oh!! That's what those hideous comment blocks are. I figured it was just a way for someone to copy and paste it over into some wierd editor definition in case they lost it. It sounds cool but I still don't understand the use case.

What other formats are there other than .def and .fgd? 
The use case is that the original QuakeEd (that id developed and used on NextSTEP to make the original maps) parsed the .qc files and used those definitions to display what entities were available.

The modern use is that all the entries can be stuffed in a .def file and trenchboom (etc) can use them to populate the entity list.

I'm not aware of anything other than .def and .fgd, but maybe there are other formats in use in some of the more esoteric editors. 
Not Convinced 
This makes the laborious task of hand creating a .DEF file a thing of the past, as long as you include the relevant entries in your QuakeC sources when adding or amending entities. While not as powerful as .FGD files, .DEF files have a place and can be a quick way to add map editor support for your new mod!

This is a bit of a tautology - the reason those comment blocks were there was so that ID could write the .def file inline, and then extract it into a single file using a command line tool. The comments don't do anything for the QuakeC processing of the file. You're basically saying you can take all the effort out of writing the .def file, so long as you've already written the .def file. 
Thats true however I think the original QuakeEd read the QC files directly at launch and there never was a tool to pull the definitions out into a .DEF. I may be wrong though. 
That's True 
quakeEd already supported cleanly ignoring anything that wasn't contained in a /*QUAKED */ comment block, and when I discovered I could just point qe3 at lunsp2/src/*.qc instead of maintaining a separate .def file an angel got its wings

(the other clue to this is that the comment blocks start with /*QUAKED in the first place ...) 
Would Be Nice If 
There could be a utility that generates a list of all functions in the qc like so:
Function(float arg1, vector arg2),called 0 times, precache Yes
W_Attack(),called 1 times,
weapon_blaster(), called 0 times, precache Yes
SUB_Remove Edicts Piling Up 
I have a problem with edicts piling up that have no information other than Think = SUB_Remove and Time = -1. I'm not sure where to look in the qc to find what's causing it. Do TE_STREAM_* ents look like this in the edicts dump? 
Code Request 
Hi Shanjaq. TE_STREAM_ things aren't using up your entity slots, "temporary entity" is just a bad name for them. So the problem must be elsewhere.

Think = SUB_Remove and Time = -1

Can you post the full lines of code that these quoted parts come from? It's hard to tell if they're right or wrong from what you posted. 
ent.nextthink <= 0 means the entity will never think, and thus never get removed. use 0.1 instead, or something.

note that the remove builtin will also set nextthink=-1, clear classname+model, but not clear the remove builtin.
those removed ents will be reused later (no sooner than 0.5 secs). so if you're spawning+removing within the same frame then you're going to have at least 0.5 seconds worth of them building up.
qc can still read+write removed ents (unfortunately), but nextent+find+findradius won't find them, and saved games shouldn't list them so I've no idea if this is what's causing them or what - how are you seeing this list of useless ents? 
Edicts Anonymous 
Thanks all for your insights! I'm wondering if there's a leak somewhere in the edict de-allocation, as I sometimes see models/sprites frozen in mid-animation which have no clipping and findradius can't see them. Here is a snippet from edicts.txt after a crash. note the last two, which I'm seeing in the hundreds:

Fte Quake C Dev 
While changing from ftcq to fte dev compiler I found some small errors. And before get passed with an unknown punctuation, I see for all monsters:

warning F307 type mismatch void entity_pain to void (entity_attacker, float dammage) self.th_pain

What is the statement to catch this error? 
You need to pass inflictor as well:

void (entity attacker, entity inflictor, float damage) th_pain; 
Usually just self. This is used to differentiate between the projectile inflictor (e.g. the rocket, self) and the attacker (self.owner). 
Just add "(entity attacker, entity inflicter, float damage)" to each monster's pain functuon. Example:
void () ogre_pain = {

void (entity attacker, entity inflicter, float damage) ogre_pain = {

WAIT WAIT...just attacker and damage. AD adds inflictor. 
Yes, Thanks! 
Most errors are fading, when I changed it in an addon monster, but it still keeps errors.
They're not major but when I try to change athe Vore's pain it loops back to the self.th_pain string. And for Shub's error I can't find a pain function, but SUB_Null.

The error starts in client.qc (line 552) PutClientIntoServerclient.qc at the statement for
self.th_pain = player_pain; 
I had changed my defs.qc into .void(entity attacker, float damage) th.pain!
Me donkey. 
It needs to be that way, so it's the other way around.
I think fte looks for more loose ends than I thought, while it still passes the progs.dat.
Strange that doors.qc with its self_pain error. 
if you just want to silence the warning, you can do:
self.th_pain = (void(entity,float)) foo_notquitepain;
Such casts are generally not recommended as they'll not catch any future changes to your 'foo_notquitepain' function, and you should only ever ADD arguments to the rhs when casting functions (removing/changing args results in the function getting gibberish for the args that were not passed, or passed as the wrong type).
Such explicit casts should always be seen as a claim by the programmer that they know that the result will be safe despite its inconsistencies.

The vanilla qcc just saw function types, and didn't bother to validate the return types nor parameters. whereas fteqcc is somewhat annoying and warns about any inconsistent code that it sees.
Its worth noting that the vanilla qc code is inconsistent but not otherwise buggy. You could fix it purely using casts if you wanted to, but its cleaner to just add the extra args.
And yes, there is some door or trigger or something entity that mixes up touch functions and pain. You can fix that occurrence with a wrapper, but a cast will perform better - not that its significant enough to matter at all. 
Thanks for the info, that keeps me going! 
New Monster Qc 
I'm trying to make a new monster, that shots nails and launches rockets. When I run the qc the monster shoot nails and launches rockets at a low angle, half from bottom.
Also the two actions bump at the same time and I have no idea where to look.

Where is the statement that give more time between the actions? 
Rabbid Fire 
As long as the player is running the relation between missiles and nails is almost even, but when it is tricked into a corner the thing blasts missiles every 0.5 second.

That's no way of surviving, I know it is called Terminator, but unlimited charge is no fight. 
...half from bottom... try changing the offset amount from '0 0 10' in TermMissile to higher amount such as missile.origin = self.origin + '0 0 24'; or try copying the value you used for org in LaunchZhaser if you want the missiles to fore from the same place as zhasers do.

missiles every 0.5 seconds you have melee set to fire missiles. If you stay back away then he will only shoot zhasers.

Maybe if you want more delay add more frames or add an attack_finished check. 
Or do
self.th_missile = sknt_atk1;
self.th_melee = sknt_atka1;
To switch it. 
What do you mean bump? 
The Enforcer.qc has a code for setting the laser
org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';
and as far as I can see the v_foreward sets the space that messures the armlength foreward, and v_right is the distance from the entity to the right sideways.

I'm looking for the space upward, as a terminator that launches from under the belt is a bit odd. In game it is not so pronounced as with testing.

I will try your statements in the hope they lead to a better result. For sofar here is the map as far as I have finished it. The scr file is included. I've played the map myself only, and I think the gamepath isn't realy clear.

Vector Upwards 
Hi madfox, have you tried using v_up? That's the "upward" vector I think you're after. 
Belt Blaster 
@-Qmaster Changing the self.th_melee = atka1; worked for splitting the attack in two different shapes. Although I don't see the reason why self.th_melee = sknt_melee won't work.
It is defined as sknt_melee = sknt_atka1; (?!)

@-Preach : sure, but I can't find the place for the statement.
Whatever I add or change it seems 7up for the compiler.
missile.origin = self.origin + '0 0 10'; is the place to look I think? 
That's The Correct Line 
That's the right line to modify, keep playing with it until you get an effect you like. 
Algebra Dabra 
the only way I can make the missile launch higher is when I exclude
//missile.origin = self.origin - normalize(self.velocity);
missile.nextthink = flytime + time;.
Then the changes seem to have effect, although I get an eyeheight missile launching and ending on
missile.origin = self.origin + v_forward * 8 + v_right * 1 + v_up * 10; 
Changing The Order 
Yeah, that would be the problem. Notice how both lines are setting the value of the same thing - missile.origin. The second line completely overrides the first one, like changing your order in a restaurant - you don't get two meals, you just get the second one. 
Right, Uhm Wrong 
missile.origin = self.origin + v_forward * 8 + v_right * -16 + '0 0 24';
returns a launcher that shoots from the launching point left above the player.

missile.origin = self.origin + v_forward * 8 + v_right * -16 + v_up * 16;
returns a missile that explodes left of the player.

I'm thinking I'm changing the end point of the missile hitting the player. It launches from the right point, but it ends up blind. Also the negative parm comes out strange. It's not left handed? 
In TermHome,
dir = normalize(vtemp - self.origin);

I used the enforcer_laser methode to launch the missile.
This way it is the simpelest way to compile for the wanted use.
The code was from the Orb, and I had a hard job on coding the weapon.

Thanks for the hints!
They were helpfull. 
Rubicon 2 question:

You have IT_NO_WEAPON replacing IT_EXTRA_WEAPON in the code. However, I'm not sure how to implement this in a map. Not seeing a spawnflag or other way to enable it. 
Trace Volume? 
Is there a way to trace a volume similar to traceline? I need to find a volume that is not occupied by players or monsters of any size. maybe something like traceline? 
any decent engine will have a tracebox builtin for things like that.

failing that, you can also exploit quirks of droptofloor or walkmove(typically with FL_FLY?), but these are much more limited and may have additional engine-specific quirks that break your mod (at least in DP). 
Something I wrote before on how you might write a tracebox function using the method Spike suggests. His caveats stand 
Spawning with no weapons works but was never used in any of the maps so I didn't finish the part where an info player start can opt in to it. Right now it's just hard coded so to only happen if mapmame == test.bsp

So you would have to make some quakec change to complete the feature, or just change the hard coded string it's looking for -- or name your map test.bsp :) 
Is there any way to attach colored lights to projectiles or explosions via QC?

I would like to make the vore's ball glow with a purple light, make the tarbaby's explosion blue, this sort of thing...

I'm using quakespasm-spiked btw. 
a trail particle effect with 'lightrgb' and 'lightradius' set should be able to provide coloured dynamic lights, but it might only be with flashblends. I don't think I actually got around to testing it properly.

point effects will additionally need lighttime, and probably want at least one of lightrgbfade+lightradiusfade.

there are additional light properties, but those are specific to rtlights, which are definitely not supported in qss. 
Thanks! I'll try that =D 
What's the most reliable way to detect if the player is on a slippery slope (mostly vertical angle)? I'm using QuakeSpasm-Spiked. 
Slippery Slope 
tracebox(self.origin, self.mins, self.maxs, self.origin-'0 0 1', TRUE, self);
if (trace_fraction < 1 && trace_plane_normal_z < 0.7)

you could instead use traceline, but it would not match the player's physics so well. 
Thanks, but the most difficult thing about it is detecting the exact moment when the player touches/lands on the slope. AFAIK the engine doesn't set FL_ONGROUND for it, and assigning .touch functions to players doesn't work properly. 
Is there a way to achieve something similar to DP's (and Makaqu's) .glow_size in QSS, through QC?

More specifically, negative dynamic lighting with custom radius and intensity, tied to an entity.

I've seen some ways to customize lighting effects in qsextensions.qc, but there's no way to change their properties and make them move around dynamically.

Also, I would like such negative lights to affect only BSP models, without affecting MDL, SPR and particles. 
Out Of The Blue 
moving lights hack, maybe? 
Can't Jump When On Top Of Monsters/explo Boxes 
There was some QuakeC fix posted here, but I can't find it. Can someone repost the fix? 
... that the source code of Quake has a 256*5 char static array whose contents, literally, are:


Do you guys know if this particular array (localmodels) has survived in any of the modern engines, somehow? 
Cl.viewent - Where Is It Loaded? 
Awfully sorry to bring this up, but I have had no luck doing it myself. Where exactly is cl.viewent assigned a specific value? Where in the code do you tell the client which gun model to use? I can´t find any direct assignments to the field, and (unless I´m doing something wrong) I can´t also find a place where the whole cl struct is being copied off somewhere else.

Do you guys know where in the source is cl.viewent being (directly or indirectly) assigned to? 
Someone help Izhido out here.

Also I still request this thread be stickied to make it more useful. 
Quick search indicates that it's happening in V_CalcRefdef() and V_CalcIntermissionRefdef(), both in view.c.

It may or may not be obvious but this represents weapon from the POV of the player and is set based on the client state structure (cl.stats).

The reason "find references" (which you probably used) didn't show you any results is that a pointer to cl.viewent is taken in the V_CalcRefdef() body (view = &cl.viewent;) and later assignments are done on the temporary pointer (e.g. view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
mentioned above).

Hope this is the answer you were looking for. Non-vanilla engines perform some additional operations on cl.viewent but I haven't seen any other model assignment logic in QS so I assume these are the only two places where it happens.

@Thulsa - Thank You! 
It *did* help. Looks like I need to be way more careful about variable assignments in there for future changes. 
I made a monster.A copy of RMQ's flayn monster code,but edited heavily to fit in with regular quake.
I removed the reanimation code,torso splitting code and some functions that weren't in the file.

Now the thing is,I precached the models and I even have them in my progs folder for the mod.
In the requiem engine, "create monster_flayn" works,but and invisible monster spawns.

QSS and MarkV don't even start the e1m1 ENT file with the monster_flayn that replaced all monster_army.

Should I rewrite the code?

Am using progs_dump_devkit_v110, vanilla dump works fine but my mod doesn't load e1m1.ent with the new monster 
Hello, In the Chasm thread, Madfox said he had some trouble getting infighting between Chasm monsters to work. Can somebody with experience in that area help?

The thread is here: 
The main factor is that I used most qc from the quake entities. I have no trouble with the infight, as quake entities usual have that in commen.

When I try to target a monster to a path_corner the game stops with a walk_monster_start error.
A bit strange as the spider just follows its path without problem, and it is the same kind of imported entity.

Also I used a subroutine into the stand function.
This is a hack I found to interfere with the stand function. The Mong soldier looks around, and while he is watching aside it won't attack.
For some reason Faust, who has the same stand function, ony uses half of the frames. It is as if some arithmic cuts out the other half.

void() faust_stand11 =[ $stand11, faust_stand12 ] {ai_stand();};


void() faust_round1 =[ $round1, faust_round2 ] {};

void() faust_round24 =[ $round24, faust_stand13 ] {};


void() faust_stand12 =[ $stand12, faust_check ] {ai_stand();};

// faust_check IS CALLED IN faust_stand12, TO DETERMINE IF HE'LL STAND OR ROUND.
void() faust_check =
if (random() <0.25)
faust_stand12 ();
faust_round1 ();
//end strat_check

In game it uses only untill frame round12, and then switches back to stand13. 
Chasm monsters only have a stand and run function.
So asking them to walk is like asking for a high Q.
Fetched a walk pose and all is well. 
That Is.., 
what is it when one entity starts an infight with another one
and the attacked one doesn't respond? 
why do you need to ask Chasm monsters to walk? just have them run Patrol. 
They need the order of th_stand, th_walk and th_run, otherwide the error walk_monster_start occurs in monster.qc. 
so the Chasm monsters can still Patrol, but they use their run function? 
Animated Poses 
As soon as they end their walk function they use run for chasing.
Most chasm entities have no walk function, spider even has no stand function. In Chasm it waits aside in walk pose. 
Compiling Progs.dat - Very Strange Bug In-game 
Hello everybody

Here it the strange thing...

If compiling an original, unchanged Source Code from Abyss of Pandemonium v2.0 using FTEQCCGUI.exe
there is an ammo counter bug occurs while switching weapons after shhoting.

For example if type "impulse 9" and start shooting from Nailgun, for instance from 200 nails to 188 and then switch to Super Nailgun you will see 189 nails in ammo instead of 188!

If you shoot from Super Nailgun from 188 nails to 182 for example and then switch to Nailgun, you will see 184 nails in your ammo counter instead of 182!

So cycling forward after shooting adds 1 piece of ammo to the weapons which share the same ammo type with the previous one and cycling backwards adds 2 pieces of ammo to the weapons which share the same ammo type with the previous one.

Same problem goes to shotgun weapons, lightning, and rocket/grenade launchers.

Could you guys tell me what may cause this proble and how to eliminate it? 
no idea, but some things to check:

does the big ammo counter on the HUD match the values of the 4 small ammo counts? if not, it may be a problem with setting self.currentammo

otherwise, there are very few places where things like self.nails, self.shells, etc. are set, at least in vanilla code -- but maybe AOP adds some weird new code that has a bug. In that case, search for something like ".ammo_nails =" and see what you can find that looks suspicious 
It's Fixed 
As Seven from said

"It happened during decompilation of the original source.
As you know, the AoP progs.dat was reverse engineered !
FrikQCC´s decompiler made some bad decisions, so..."

He provided me with the "cleaned" source code and now I'm making the patch for AOP v2.0 to make it more enjoyable (like vanilla) Quake.

Thinking of releasing it here, when I'm finished with this. 
Talking Player... 
Hey everyone! Sorry for the dumb question but is this the right place to post regarding QC coding help?

If it is, here's my question:

I've been trying to work out what might be the best way to add more vocalization for the player. Like adding some smack talk (i.e. Duke Nukem). One way I was thinking might be an inverted obituary function? But not entirely sure tbh, is there a better way of doing this? Point in the right direction? 
Pre-Recorded Obituary 
Hi MrC. I'd say you were along the right lines with looking at the obituary function. In my view the place to start is the function which calls the obituary function, which is a function called Killed in combat.qc.

If you look at the function, there's a block which starts

if (self.flags & FL_MONSTER)

I'd add a bit of code inside that block:

if (attacker.classname == "player")
    PlayerRemarkOnKill(attacker, self);

Then your PlayerRemarkOnKill function looks like:

void(entity player, entity monster) PlayerRemarkOnKill =


I'll leave you to play around with what you actually want to do with the remarks. Because the monster entity is passed to the function, you have the option of playing lines that are specific to a particular enemy type. 
Whoa, thanks Preach! Just got it all added and it works perfectly. And good call with checking classnames for specific commentary :) 
QC Frame Function Generator 
Ok, so onto my next conquest... I was curious about frame functions and if there were any little tools out there for generating QC frame functions? I mean, not to sound lazy or anything.

I know there are alternative methods like framegroups but how about calling sounds etc... at specific frames when using this method?

Thanks again and sorry if this is such a basic question, still learning my way around. 
FTE Particles On Sky Boxes... 
(NOTE: Posting here because "getsurfacenearpoint" and "surface" keywords show up in this thread more than anywhere else on the web)

Goal: Specify FTE particles when entity touches the sky on any quake 1 maps inlcuding mission packs.

Background: As we know, the vanilla "pointcontents(self.origin) == CONTENT_SKY" code doesn't work as intended on many original maps. Fortunately, getsurfacenearpoint in FTE works great for getting surface texture names. I've used it for coding quakec entities (bullets, missles, etc) to fly through the sky without exploding or leaving decals. However, I can greatly simplify the code if someone could tell me how to use FTEQW's "clippeddecal" particle parameter.

Question: The help for clippeddecal states, "The two extra args allow you to spawn these decals ONLY on surfaces with matching surfaceflags." What surfaceflags are recognised, and where are they called from? Any examples? FWIW, using getsurfacenearpoint & getsurfacetexture gives "sky1" on original mission maps. 
FTE Particles On Sky Boxes... Exemplar Video 
Here's an exemplar video showing the Lava Nails flying across the sky, from my question above. All effects are FTE particles, except for the bullets through the sky which I had to code in quakec. So, to eliminate the QuakeC coding, I would really like to know if FTE's clippeddecal surfaceflags can be used instead??? 
Why Is There Not A Defrag Mod In Quake 1? 
What are the major differences between the Q1 engine and the Q3 engine?

Are there any differences in physics between vanilla quake 3 and the defrag mod?

Are the certain limitations in the quake 1 engine? 
the QdQstats mod is kind of like that, it has built in timers for speedrunners. I don't know enough about the dfrag mod to answer more. 
How To Do Func_door From Scratch 
Unfortuantely all qc documentation there is, is spread all over the net. Any leads?

btw, long time no see ^^ 
Reimplementation Query 
Hi wakey. I haven't seen a re-implementation of func_door before, and I can think of a few reasons why. Firstly, the code for the func_door is one of the more complex parts of standard Quake, it's certainly a longer .qc file than any of the other brush objects (in fact, it's longer than misc.qc which contains definitions of dozens of different classes). Aside from doing lots of stuff, the bits about e.g. linking doors are complex in themselves.

Often when writing a mod, a good degree of compatibility with existing maps is desirable. It would be tough to ensure the rewritten code had that compatibility - remember that the func_door is a really flexible entity, often used to create platforms and other moving objects. Trying to remain compatible with the core function is one thing, staying compatible with all the unusual use cases is harder.

Lastly, it's worth pointing out that some of the standard functionality of a func_door depends on "library functions" like SUB_CalcMove and SUB_UseTargets. Can a re-implementation assume those still exist, or should it also code those functions from scratch?

Given all of that, I hope you don't mind me asking first why you want to write func_door from scratch? If it was for a Total Conversion where you create a 2D platformer in Quake, then a lot of the concerns above go away, your mod only runs on the maps you make for it, so compatibility isn't an issue. If it's for a more standard Quake mod I worry that it's a lot of writing and testing code for a benefit I can't yet see... 
Yes, total conversion.(though, not a 2D platformer).

Everything else is already coded from scratch, more or less.(roughly following Ender's "quake from scratch" tutorials, to get basic functionality up and running)

The standard door.qc files all have dependencies that are not implemented yet, thus I can't just drop them in like that.

Lastly, as stated by my colleague, the documentation of the DarkPlaces engine is severely lacking(fragmented at best), when compared to the engines I'm used to (e.g. Unity, Godot, or eaven UE4). 
Scratch Tutorials 
The best way for you to get working doors is to add doors.qc, and then fix all the compile errors by pasting the missing functions into the top of doors.qc. Serious advice.

To expand on that a bit: the scratch tutorials are great at what they do. They look at the duties QuakeC has to perform - the things that it's basically impossible to do without, and perform the simplest possible thing to accomplish those duties. It's hard to fit doors into that framework; they aren't essential, and it's unclear what the simplest version of a door is.

The other problem actually really ties into what you're saying about the infrastructure being missing. If you were writing the simplest possible implementation of doors, it's likely you could write a reduced version SUB_CalcMove which does just enough for the doors to function. But that short-sightedness would come back to bite you when you decide later to add trains. It's a catch-22 for the scratch tutorial writer, the simpler you make the current tutorial, the worse a basis for building on you've created.

The thing with infrastructure is that how much of it you need really depends on what your big picture goals for the TC are. If you're only going to include doors in two highly controlled places in your entire game, you probably need less infrastructure that standard Quake - just hard code everything into the mod! On the other hand if you're creating a mappers toolkit complete with detailed customisation of the door acceleration profile, you probably need to build a lot more! 
Thank You Very Much 
it's appreciated, Preach :)

As far as i could get it, the0programmer has chosen an mixed approach, between using standart doors.qc and his own code. Works like a charm.

Now we have yet another challenge to come over: How do ssqc and csqc communicate?
He told me something of "hacks" with stuffcmd and cvar's, now i was asking myself if that is the standart approach or if there is another way?

Basically he wants to grab information of a csqc entity for use in ssqc. 
Although I've never written anything in CSQC, I'd start with getting to grips with
There's a section on sending data to the client and it seems like those methods would be better than stuffcmd.

There's also a worked tutorial at 
Hexen 2 Cutscene Help Needed 
Hello everybody,

I don't know whether the title of this thread is correct.
I currently work on an Hexen II project where I'd like to put some RPG sequences the way Heretic II does.

That is:

1. the view switches to a third person view thanks to a camera_remote (a handy thing we have in H2 which does basically the same as the intermission view, but triggerable mid-map)

2. the view represents the player facing a monster and they interact by talking (with centerprints) or doing something (like one killing the other or running away) by triggering the corresponding animations on the models.

3. the view returns to the player and the adventure goes on.

Has everyone ever tried to do that (would it be thanks to hack or programming)? Succeeded? How?

Thank you in advance for your insights! :-) 
Although HexenII is more advanced then Quake there is a mod called Visions, which has a Capture Camera Kit.

It has about everything you mentioned, but supports only QuakeI. Maybe with a bit tweaking you could port it to HexenII? 
@madfox Sounds promising! Any idea where I could find it?

Yet, just to be sure there is no misunderstanding, because English is not my mother tongue and it's sometimes hard for me to be clear: my actual problem is not the 1. and 3. above because triggered cameras are a native feature in Hexen II.

The real challenge is to tell monsters and the player how to behave during such cutting scenes: tell them to run, to stand idle, to jump or whatever. What I want to do is puppet mastering. Never mind whether it is the actual monsters and player acting in front of the camera or just fake entities reusing their mdl. 
I used this Camera scene Construction Kit in a map to explain a coming event in the game.
It works with scripts from the moment the trigger_camera is touched. The player changes into a moveless point, while the entities can be turned on/off hostile attacking.

There is no way to tell what entities will do, although a func_train or path_info can be used as well as textures on screen.

You can look at it at the map of DarinMcneil visions 
madfox... great link... I never knew about this! One other camera system can be found in the custents mod but it's a bit different because it's a security camera but there are controllable actors in the mod as well. 
Thank you so much for those exciting links! Hope I'll be able to do something nice from it. :-)
You'll hear about it anyway. ;-) 
Demo Examples 
Inky, in the progs tricks you were interested in how demos work. There used to be something of a scene for making Quake demos, especially in the dial-up era of the internet when youtube didn't exist. I was only an interested observer, but if you were interested in finding out more a good place to start would be reading about

In particular, if you look at the sources there are a couple of interviews archived from which go into some detail as to what combination of engine tools, mod-making and live recording were used to produce the demos. 
Dear Preach,

At reading your last paragraph, demos don't seem to be easy stuff and my guess is that anyway I would probably not be able to trigger one mid-game and go back to the action afterwards, like with camera stuff exemplified in the map by Darin Mcneil mentioned above. So learning how to make demos would probably be putting things too far away from actual mapping which I still keep on learning and which already takes me days and days (and days...)

Yet I feel extremely honored by your personalized attention. My project will anyway owe a lot to your map hacks and advice, for sure! Thank you so much for that and for all what you bring to the community, that's so precious for newbies like me! Sorry I didn't notice your kind message sooner (is there a way to be automatically notified when someone posts after you on a thread?) 
I was thinking of pre- or post-level demo cutscenes when I mentioned it (zerstörer is another good example of doing that). In principle though, you could try the following to get a mid-game cutscene from a demo:

1) Save the game to a fixed filename like 'save interdemo.sav' using stuffcmd
2) Follow that with a command to load the demo 'playdemo cutsc001.dem'
3) insert a stuffcmd into the last frame of the demo which runs 'load interdemo.sav' to resume.

Wouldn't work in co-op, and it wouldn't be seamless because the engine would reload the map, but it's an interesting approach. Certainly would shift the burden from perfectly scripting the cutscene in QC to editing a demo. I suspect you can get good results with less effort through the latter... 
Wow, that's tricky! :-)

The cutscenes I have in mind are mainly dialogs with non playing characters (that is non agressive monsters who give pieces of information to the hero thanks to a dialog, show him a passage, etc.) Could a demo do that? That would save a lot of scripting for sure. 
I'd say that's probably simple enough that you could avoid the demo route. Have you looked at the in-map cutscenes you can do with the custents mod? They might be enough for your purposes. If you had 5-6 entities interacting in a scene, each with two or three things to do, and a need for some kind of camera movement, a demo is going to be more manageable. But there's overhead to setting up demos as well, and that's not worth incurring if the action is short and simple. 
What Makes A Monster Go Infight? 
I'm converting some models and have come to strange point one of them resists to go infight.
It keeps on tracing the player untill it is killed.

Strange enough a hit by another monster just makes it to one counter attack, but then it continues the player.
If another monster gets hurt, it starts infight untill the lame one gets killed.

All the others kill eachother infight, so I can't find a trace to where this infight command is to be found. 
in T_Damage, look for self.enemy = attacker;

If your enemies only do one counter attack and then return to attacking the player, something in your code must be setting self.enemy back to the player. 
I can't find self.enemy = attacker; anywhere.

The macro of a grunt is identical to the enforcer.
What happens is that the enforcer will have infight with the grunt.
Grunt with the same qc code won't infight, and leaves after one attack.

Only thing I can make of is that two enforcers won't attack eachother. 
the qc of a grunt is the enforcer.qc. 
I can't find self.enemy = attacker; anywhere.

That would explain why there's no infighting then. Monsters attack their current enemy. So if the enemy is never changed to be their most recent attacker, they won't attack back.

Note that in T_Damage, in standard quake, there is an exception for "soldiers" (e.g. grunts) to allow them to fight each other. Every other class will not fight monsters of the same class. 
That explains a bit of the cause.
I have this T_Damage (self.enemy, self, self, ldmg);

The perticular monster is called monster_grunt, while quake uses monster_army.
Could it miss the statement soldier, not seeing a monster_ grunt for a monster_army? 
#2779 Found It. 
I gave it a Grunt_Check_Attack in Fight.qc.
For most other monsters it is an oppertunity to devide their attacks on long and short range. In this case it won't work for Grunt.
Deleting the files in fight.qc makes it infight again.

Not really clear to me why but it works. 
Sniper Code 
Hello all :-)

I am desperately trying to find what piece of code decides whether a monster is too far away to see the player or not.
Indeed I'd like to implement a flag to enhance some lesser baddies and make them excellent snipers never mind the distance.
Any idea please?

Thanks a lot in advance! :-) 
Attitudes of monsters go to the fight.qc where they are specified to attack on range, distance or default.

So I think your monster should have an anouncement in the fight.qc.

The SoldierCheckAttack has the code to make the knight decide to make a RANGE_FAR, RANGE_MID or RANGE_NEAR attack. 
Would I Get Away With This? 
combat.qc line 189:
// get mad unless of the same class (except for soldiers)
if (self != attacker && attacker != self.enemy)
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_army" ) )

if ( (self.classname != attacker.classname)
|| (self.classname == "monster_grunt" ) ) //
if (self.enemy.classname == "player")
self.oldenemy = self.enemy;
self.enemy = attacker;
FoundTarget ();
For Clearance 
As I compile the progs I don't see any difference in the behaviour of the grunt, so maybe I overviewed a statement. It keeps acting for black sheep and ignores infight. 
Hi madfox,

That's the correct piece of code to change, did you keep it all exactly the same apart from changing monster_army to monster_grunt?

If so, you might need to add some dprint lines in there to try and work out whether the code is running or not when the grunts shoot each other, what classname they have when they enter this section of code, etc... 
Never Try To Beat A Twin 
Thanks for your attention, Preach. Before I turn into one.

I wondered if I could place the statement under the other one, expecting it would work. I guess not, as army will fight a grunt, but grunt won't fight army, nor eachother.

I can hardly believe this error is so consistent. All other monsters I converted have no porblem with infight. For this one I even made all frames and macro the same, but it still excists.

In this file is a try out, don't mind the strange stand / walk scene. It is a rare coinscidence with the same frame group, but altered runout.

How do I place these dprint lines?
Is there a console argument or do I set these statements in the qc? 
In Qc 
it's void dprint (string text).
Plus you need to set the cvar developer to 1. 
ai.qc defs or elsewhere? 
To Be Honest 
i am guessing myself, looked it up once for someone who was new to qc.
In ai.qc there should be an commented out example in t_movetarget, line 147.

It reads dprint //("t_movetarget\n");.
Hope that helps somewhat. 
Thanks for the hint! 
Seeing Double 
Had a look at your zip madfox. The way you formatted your original post, I thought you had deleted the old code and put your new code. But in fact you've left both bits of code in, so it's doing both checks, one after the other. If I add some brackets to make it clearer what's happening:

if (self != attacker && attacker != self.enemy)
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_army" ) )
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_grunt" ) ) // I hope it madfoxed
if (self.enemy.classname == "player")
self.oldenemy = self.enemy;
self.enemy = attacker;
FoundTarget ();

The outside check only allows monster_army to fight with monster_army, and the inner check only allows monster_grunt to fight with monster_grunt. No monster can be both things at once, so it always fails.

Either go back to the original code and replace monster_army with monster_grunt, or create a proper three way check:

if ( (self.classname != attacker.classname)
|| (self.classname == "monster_army" )
|| (self.classname == "monster_grunt" ) )
Black Sheep 
I changed the code for the two monsters, but I fear there is something else going on. The Quake soldier is used as monster_army but there is also a soldier.qc and a grunt.qc.

For sake of a double classname grunt somewhere I changed the montgrunt to mong. Although all parms are thay direction there is a behaviour of a army monster with infight and a mong soldier that gives one counter attack.

I deketed the army in combat for just a mong fighter but it will hardly reackt. Could it be that its painframes are too long, as every time it is attack it looks as if ther is a freeze moment before it just start goosing the player. 
[Hexen II] AC Calculation 

Not sure this is the right place for such a question, I beg you pardon in advance if not.

I am currently mapping for Hexen II and my question is extremely specific to that game. H2 has different kinds of "armor" items the player can grab, each absorbing a specific percentage of damage (actually depending on the player class, the hc code is pretty clear about how it works).

What I don't understand is the "AC" counter displayed in the HUD. This counter is incremented by a certain number of points when an armor item is picked up, but that number doesn't seem to be related to the actual percentage of damage the item can take. It is very puzzling and I have not been able this far to figure out how the HUD counter works.

Is there any chance one of you might have an idea about that???

Thank you so much in advance! :-) 
[Hexen II] AC Calculation: Answer 
Just in case anyone would care, I got my answer here: 
Trenchbroom Commandline 

Like some of you start to know, I map for Hexen II whose entities are sometimes tricky and not as well documented and known as Quake's ones.

That's why I learn a lot from Raven's original maps. The recurring type of question I have been asked to myself is "What is this spawnflag value for? How do they use it in vanilla H2?"

And basically I was launching a textual search on the entire set of .map files by Raven for all the occurrences of the given classname and inspected them one by one until I found one whose spawnflags value contained the desired power of 2 (which is not an easy calculation to work out in one's head). Sounds stupid and monstrously time consuming? It was!

I'm pretty sure you will laugh at me and explain that a far easier solution was available already but well, today I developed my own advanced multi-criteria search tool. It supports regexes and can filter entities by classname, property name and property value (which is searched among powers of 2 if needed). Each matching entity is returned with also its targetname and x y z position within the map.

The cherry on top of the cake would now be that by clicking on a result, Trenchbroom opens the map and moves the camera directly on the entity. Do you know of any command line parameter in Trenchbroom allowing such a thing?

(Sorry my posts are always more verbose than strictly necessary)

Thank you very much in advance! 
A cherry on top of the cherry on top of the cake would even be a command line parameter to open a map with TB and automatically load a pts file in the same action: usual shortcuts to follow the "pts line" would allow to go from one search result to the next instead... 
Worldcraft had a very nice feature called... entity report, I think.

Essentially it listed all entities and allowed you to filter the list by value. It also had basic error checking.

Ideally this would be a per-game thing, allowing the users to edit a .txt file or something to make new error checking parameters.

It's tempting to go into TB dev and help... 
Ressurect/respawn Player In Singleplayer 
Hello again, I guess, this is proper forum to ask (I hope).

In doom forks there is often /budha mode (never have player health go below 1) and /resurrect command (that revives dead player in the spot they died).

During my years of dooming I started using those when quickly analyzing mod maps or doing my own tampering.

For me, they are much better suited for testing than /god.

I am curious about these things:

1. both of these (budha, resurrect) should be attainable with custom modded progs.dat, I believe. Am I right? Is there anything specific in C parts of engines to prevent that (given COOP this should work even with monsters)?

2. can I somehow resurrect with vanilla SP progs.dat? Using `/give h 100` will make my dead player "stand-up", but they cannot move and jump will immediately end level. Am I missing something or this is un-doable in vanilla? 
I'm fairly sure that's un-doable in vanilla.

you can absolutely mod progs.dat to do this though 
here is a quick and dirty proof of concept, no options just respawn in situ with 100 life 
Rubicon 2 has a resurrection cheat — impulse 666. You could look at that code. 
Really Helpful 
Thank you guys this is awesome! 
MapSearch & Inky's Hexen II Mapping Corner 
Hello everybody,

I answer to my own post #2802...
As said, I developed a very handy and powerful command line tool (supporting regexes and spawnflags search) to investigate map files and understand better how those at Raven & iD Software made their maps to learn from their example.

I'd be more than happy if it can be useful to some of you as it was for me :

I would like to take the opportunity to also introduce my newly born website 'Inky's Hexen II Mapping Corner' which has the ambition of becoming a reference for those mapping for Hexen II. Anybody's advice or contribution to make the site grow faster and improve in quality would be most welcome. :-)
Feel also free to backlink it, if you like it, to make it gain some audience and help the small Hexen II mapping community to reinforce its network.

Last, a more direct request to you: has anybody out there the math and programming skills to help me with finding the 'x y z' position of a brush's center of gravity, after the brush definition stored in a map file???

Thank you in advance for your feedback! :) 
QuakeC NOOb Needs Help 
Hello all - long time!

I'm working on a server mod that is a mashup of a few different things:

- Reincarnation base map (old server DM mod from Gen and others)
- Added FrikBots
- Added Map Rotation
- Added Multi-skin support

I had a few things I'd like to try and clean up and desperately need some QC help as I have little clue with that I'm doing.

Here's the things I want to achieve:

#1 - Add custom skins to bots

I have custom player skins working for players (you can cycle through up to 32 skins attached to the player model). FrikBots has 16 different bot profiles, and I'd like set each different bot to use one of the custom skins. How can this be done (like what Omicron Bots did)?

I tried this, but it doesn't work:

self.b_pants = 11;
self.b_shirt = 0;
return "Vincent"; = 1;

Let's take one question at a time. Any idea how I can assign skins to the bots? 
Taking The First Exit 
Hi Mezmorki. On the third line of your code you have

return "Vincent";

The return statement does two things. One is that it specifies the value which will be handed back to the code calling this function. But the other is that it ends the function and returns the value immediately. The code on line 4 which sets the skin is correct, but it never runs because the function exits on line 3.

If you swap the order of those two lines it should start working, but let us know if it doesn't... 
That Worked! 
Awesome - thanks for the help! It all worked fine.

Okay next topic. When players respawn a centerprint message pops up letting them know what skin they have active. I'd like to try and switch this message to an sprint (so it prints in the upper left corner instead of the center).

Here's the code:

// GeN >

player_stand1 ();

if (deathmatch)
spawn_tfog (self.origin + v_forward*20);

spawn_tdeath (self.origin, self);

if((teamplay || (deathmatch & D_HH)) && (self.genteam))
SetTeam(self, self.genteam);

// *************************************************************************
// ** **
// ** M U L T I S K I N 1.1 (start) **
// ** **
// *************************************************************************

if ( == 0) centerprint(self, "Respawning as... Quakeguy"); else
if ( == 1) centerprint(self, "Respawning as... Doomguy"); else
if ( == 2) centerprint(self, "Respawning as... Arnold the Terminator"); else
if ( == 3) centerprint(self, "Respawning as... Arnold the Conan (4)");


// *************************************************************************
// ** **
// ** M U L T I S K I N 1.1 (end) **
// ** **
// *************************************************************************


If I replace "centerprint" with "sprint" it compiles okay, but no messages ever appear.

Any ideas? 
I'd say check that you left the "self" part there - but you'll basically crash the whole server if you get that wrong when using sprint. Can you check to see if the message is getting logged in the console? Sometimes if there's a centerprint and a sprint happening at the same time, the one can wipe out the other. 
Not sure what you mean by "left the self part" in place or not.

A given line could look like this in how I have it:

if ( == 0) sprint(self, "Respawning as... Quakeguy\n"); else

I know most other sprint commands end with "\n" in the line to return?

Could there be something with the timing of respawning triggers that results in a different handling for sprint versus centerprint?

Seems like maybe I;m missing something obvious. 
The message is getting printed to the console if I have the console open when I die. 
You got the self part right, I was worried you might have done something like

if ( == 0) sprint("Respawning as... Quakeguy\n"); else

Is the change to sprint because you are centerprinting something else at the same time? If so, try disabling that for a moment and see if the sprint starts working. 
Dang Engine Issue 
turns out it was a quake engine issue of some sort. I was running and older version of qrack and I tried out a different engine and it worked. Updated Qrack and now it works in that too. :) 
Trigger_changemusic + Saves 
Alright. Thanks to Johnny Lew I have a trigger_changemusic in progs_dump however, I have no idea how to get this to work with savegames. Any guidance?

//thanks to Johnny Lew via changemusic.rar --dumptruck_ds

void() trigger_changemusic_touch =
if (!(other.flags & FL_CLIENT))
if (!self.sounds)
objerror("ERROR: trigger_changemusic needs valid track number in sounds field");
WriteByte(FL_SWIM, self.sounds);
WriteByte(FL_SWIM, self.sounds);
self.touch = SUB_Null;
self.nextthink = (time + 0.1);
self.think = SUB_Remove;

void() trigger_changemusic =
if (SUB_Inhibit ()) // new spawnflags for all entities -- iw
self.touch = trigger_changemusic_touch;
con_logcenterprint 1 is the option to print centerprint messages to console. setting it to 0 obv turns that off.
you mean, you want to remember which music track was playing and restore that when the savegame loads?

Check out rubicon 2 source code, the function LoadSaveGameCallback, the logic to call in StartFrame, and the special variable loadsavegamecallback_done -- this setup allows you to do any necessary work after loading a save game, such as re-triggering client side looping sound effects.

In theory you can save the desired music track in some variable, and then when the game is reloaded, check that variable and re-trigger the music in your own version of LoadSaveGameCallback. 
yep. I was looking through other mods yesterday. I should've known to start with Rubicon 2! thanks. 
More Trigger_changemusic 
I'm posting this for those who come after. It should plug into mods easily. As I was looking over Rubicon 2 code and overheating my pea-brain, Spike posted this on Discord. It works well so far but I need to test in various source ports. This isn't as flexible as what metl posted above but it works for this implementation. NOTE the & and * are correct below

add this to worldspawn in world.qc
world_sounds = &world.sounds; //Spike not read-only yet...

add this to defs.qc
nosave float *world_sounds; //via Spike fun times! nosave=noclobber

add to bottom of triggers.qc
void(float newtrack) changemusic =
*world_sounds = newtrack; //changing the field via a pointer
//world.sounds has now been changed via our pointer, newly connecting players (like those connecting after the game is loaded) will get sent the new cd track's number.

//let everyone currently on the server know.
WriteByte(MSG_ALL, newtrack); //initial track
WriteByte(MSG_ALL, newtrack); //looped track... should generally be set the same as the initial track as most engines ignore it entirely so it might as well be sane for those that care.

//thanks to jleww via changemusic.rar --dumptruck_ds

void() trigger_changemusic_touch =
if (!(other.flags & FL_CLIENT))
self.touch = SUB_Null;
self.nextthink = (time + 0.1);
self.think = SUB_Remove;

void() trigger_changemusic =
if (SUB_Inhibit ()) // new spawnflags for all entities -- iw
if (!self.sounds)
objerror("ERROR: trigger_changemusic needs valid track number in sounds field");
self.touch = trigger_changemusic_touch;
oops I just noticed

if (SUB_Inhibit ()) // new spawnflags for all entities -- iw

that is in progs_dump only - you won't need it elsewhere and it will cause an error on compile 
How Does Size Work? 
Hi everybody,

I'd like to put in some extra-large monsters to make usual lesser threats a far more scary danger.
From what I can see, seems the size is dealt with code looking like that:

setsize (self, '-32 -32 -24', '32 32 40');

where the 2nd and 3rd parameters correspond to VEC_HULL_MIN and VEC_HULL_MAX respectively.

Yet I can't figure out what the term "hull" actually refers to, nor how a size could possibly be "negative" (unless maybe it's lovecraftian non euclidean geometry brought in QuakeC by Shub-Niggurath herself???)

Your help to my comprehension would be extremely appreciated. Thank you a lot in advance ! :-) 
Tale Of Two Halves 
OK, so this is a bit complicated. For almost all purposes, you have exact control over the bounding box of an entity - but the one exception is really, really important!

The normal bounding box is a cuboid which doesn't ever rotate as the entity moves. The two vectors are relative offsets - they say how far the corners of the bounding box should be from the origin of the entity. The negative ones put the lower corner to the left, back and below the origin of the entity, the positive ones specify a position to the right/front/above the origin.

Interesting to note that those parameters mean the origin isn't dead centre of the cuboid, the bottom of the bounding box is 24 units below the origin, but the top is 40 units above it.

One place where the exact bounding box is used is when colliding with...another bounding box. The exact size of the bounding box is also tested to check if traces from e.g. shotguns have hit something.

However, the one place where the bounding box is (sorta) ignored is calculating collisions against BSP objects. To run faster on Pentium 90s, Quake only computes the spaces that three sizes of object can fit around BSP objects:
• point-sized
• man-sized
• shambler-sized
The precomputed spaces are called "hulls". If the bounding box isn't one of those three sizes, the Quake engine picks a "best-fit" from the available hulls. If you want to get consistent collision, you have to pick one of those three sizes, and the constants are there to make that easier. 
My Triviant 
r_drawviewmodel 1 makes a lot clear.

I try to make a monster launch an attack with three projectiles. One straight forward and two sideways parallel to the player. I studied Wiz_StartFast but I can't make the sideways parallel in line. The outside projectile always aims to the player, not aside.

Where should I start? 
Thank You Preach! 
Your explanation is crystal clear and I would not have guessed that alone, thank you so much!

Now just need to find where the reference hulls for Hexen II are defined (I'm mapping for H2) and I'm done. :-) 
Have you tried looking at the Hell Knight code? I think he does what you're asking for - just spread out over multiple frames instead of all at the same time... 
Yes Preach, that makes sense.
It don't has to be a simillar shot, although it would look fine. 
I will ask this for Madfox here:

So in version 2.38 of the chasm mod, the Mong does not react after being hit by a stratos. However, they will infight on rare occasions. But I cannot figure out what these occasions are. I managed to capture a saved game of them infighting, attached below, maybe somebody could take a look at it? This issue is really weird, monsters either infight or don't infight, but not infight rarely.

The saved games are here:

2.38 is here: 
I figured it out, tagged madfox on discord...

The monsters first frame of run animation has a ai_walk in it.... change it to ai_run and it works just fine. 
Hi, everyone im doing my first code for quakec and I need some help

I would like make a 1920's wall lamp, my entity works but i would like instead a common light a flickering one, i use this code but seems doesnt works properly (compiling is ok), any suggestion? Thanks a lot in advance!

My code:
/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
Short wall torch
Default light value is 200
Default style is 7
void() light_wall_lamp =
precache_model ("progs/lamp.mdl");
setmodel (self, "progs/lamp.mdl");
FireAmbient (); = 3;
lightstyle(, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
makestatic (self);

How looks on quake 
If you want to make a custom light style you should give it a new number not already used and place it with the other light style definitions (forgot where — world.qc)?

Then, it seems bad to hard-code the style in the entity spawn function since it prevents a mapper from changing it per instance in the map. You could do a check “if == 0 then = 3” which would let mappers use different styles but also add the convenience of if being automatic for lazy mappers. 
And I forgot, you have to set the entity style in the map editor anyway because it needs to be there for light.exe to set up the light maps correctly.

So just declare the light style in a centralized location with a unique number < 32 and then set it on the light entities in the map editor, and that should be it. 
I will ask two more questions for Madfox regarding the Chasm mod.

In Chasm mod 2.4. when the Faust fires a rocket, there is no explosion. I used to think that this issue is not a big deal, as there are tons of mods with Rocket Ogres and Rocket Grunts, but apparently it is not that simple. Madfox made a video of it here:

You can see there is no explosion.

The second question is that when one of the monster dies, its corpse floats in the air. I have provided two saved games, one with the creature alive, and another with the creature dead.

If somebody could take a look at these two issues it would be great. Thanks!

The chasm mod is found here: 
Your link is dead yhe1 
Code Topic 
Link won't work, updated. 
Have A Question About Something .. 
Can we make quake player automatically move forward by players his own forward direction
Im really getting stuck about it please some one help me ı wısh i could ask a true question... 
// Player Not Fixed 
I don't understand the question.

Do you want to get behind a player to move it foreward,
or do you need a code so you don't have to push a foreward button?

I don't want to offend you, but I really get stuck to understand your question. 
Yes second one i need an auto forward velocity code.i have a trigger and i want to player go forward automaticlally every time when player touch
And thank you 
I forgot to tell that player must go forward automatically by triggers angle and may can jump may be hide his weapon bla bla :) 
Have A Question About Something .. 
Code looks like this..

void() PlayerClimb = //johnfitz
self.velocity = '0 0 160';
///The code that i want goes here
I Get The Question 
but wouldn't it be something equal to void() trigger_monsterjump in trigger.qc? //poor johnfitz 
Have A Question About Something .. 
I wrote a bit you must look previous posts 
İ will glad if you help me 
void() trigger_monsterjump =
if (!self.speed)
self.speed = 200;
if (!self.height)
self.height = 200;
if (self.angles == '0 0 0')
self.angles = '0 360 0';
InitTrigger ();
self.touch = trigger_monsterjump_touch;
Ledge Grab Help 
How can adapt ledge grab feature in actual quake1 server side quake c code 
Ledge Grab Help 
Solved :) 
Saying Hello 
Hello everyone...hmm ledge grabbing in quake?I do not know if it is worth doing research. 
RE #2853 
Its in Slayers Testaments. 
hmm i heard about it but i didn't download and play it i wondered how did they get it 
Question About Adding Leg Model 
I have animated leg model but i dont know how add its can someone help me 
Question About Adding Leg Model 
Having Trouble Compiling Gameplay Edits 
Some changes I wanted to make for a small gameplay mod couldn't be done with the .qc source code, so I tried editing the Quakespasm source code. FTEQCCGUI didn't work, but the CodeBlocks project file they included did.

First problem was that the basedir was being set to my C:\ drive.
I don't know where I'd look to change that, but I can just put QS there temporarily.

After doing that, building and running it through CodeBlocks works just fine. But when I tried putting the built .exe into the temporary location, I get a generic error: "The application was unable to start correctly (0xc000007b)" when running the built .exe.

I don't really know what to do here. I'm jumping through all these hoops to make the death camera angle at 0 instead of 80. Ideally I could do it through FTEQCCGUI so it'd act like a mod instead of an entirely different engine, but like I said I couldn't get it to compile properly FTEQCCGUI (definition errors or expecting brackets, usually).

If someone could help me out, I'd really appreciate it. Like I said, ideally I'd compile these into a mod (like a prog.dat file), but if the only way I can edit the WinQuake derivatives is by making it into an .exe, then I'll do that, I just need to know what I'm missing. Or if there's a better way to do this. 
First, know that quake engine source can only be used to make a new engine, and QuakeC source can only be used to make a new mod. They are completely separate things, you can't use engine source and try to compile it into a mod.

Second, the basedir issue is most likely due to how you are launching the game. If you already have a working quakespasm setup, you should put your engine in the same place (with a different filename of course), and launch it the same way (either with a shortcut with the same options, or with a batch file with the same options.) 
Re: Metlslime 
Ah, alright. So are there ways to edit stuff like the view with the QuakeC source? Like I said in the last post, I'm wanting to change the angle when you're dead from 80 to 0. I looked around and couldn't find anything in the QuakeC source referencing it.

Also to clarify the basedir issue, it would only check for it in my C drive when trying to build and run the engine in CodeBlocks. Dragging the compiled engine into a quakespasm directory gave me the generic error. Unless you meant have the engine source files in the same location as quakespasm. In that case, I have the engine and quakespasm in separate locations. 
I don't know anything about codeblocks, but if you are trying to launch the game from within that, you might need to find a way to set the "working directory" of the executable to your quake directory.

In terms of whether you can do what you want in quakec, I found this in the engine source:

if (cl.stats[STAT_HEALTH] <= 0)
r_refdef.viewangles[ROLL] = 80; // dead view angle

This implies it's hard-coded in the engine, and the way this logic is written, the only way to avoid it is to set player health to a value greater than 0. However that has various side effects like HUD shows a nonzero health, enemies react to you, etc.

New Idea: what if you let the player die, but then set he intermission camera to match the player's current location, but without a roll? (not sure if intermission camera can be abused in this way when the level is not actually completed, but worth a try.) Or do some other 3rd person camera logic to basically disconnect the camera from the dead player? 
Re: Metlslime 
CodeBlocks is a similar editor on the lines of Micorsoft Visual Studio. The issue is I'm only able to run the compiled engine through it. Outside of it with the compiled .exe, I can't get it to run.

That was the code I was referring to wanting to change, but since it's hard-coded in the engine, it's not that big of a deal that I can't change it as a mod. I'll ask around a different thread as far as properly compiling engine changes goes. Only reason I'd do that is for personal use.

As of posting, it's late at night for me, so I'll give the idea a shot in the morning and post my results. In either case, thank you for the help! 
Stuck About Make Think Timers 
I have a trigger and it moves me up
İf a trigger exists Trigger triggers timer when ı interact with it and at the timer ends trigger would be move me other ways so ı need help to code a think timer.ı look timers in quake c 106 codes but ı stuck .help please 
Will Some One Look My Question?? 
Please :( 
Will Some One Look My Question?? 
Please :( 
Hi Robie. 
What's your first language? It's quite a multi-national community on here so if you find someone who speaks it, you could maybe ask them directly and they can translate into English. 
I don't fully understand your question, but:

In quakec, if you want an entity to wait for a certain amount of time, you can set self.nextthink to a time in the future. e.g.

self.nextthink = time + 5; //wait 5 seconds
self.think = DoSomeStuff;

In this example, the entity will wait 5 seconds and then call the function DoSomeStuff 
Say Thanks 
Thank you so much :) 
Say Thanks 
Thank you so much :) 
Answer To Shambler 
My main language is not english but ım using google translate to ask my questions.And shambler ı have a question you too :)
Im trying to show player legs in firs person mode in defined fovs. But how can ı code it in quake c.And ı know ther is quake15 example but ı looked ıt and its so complex uses auto_cvars etc. I dont like this. I need a script that shows player legs when player looks down and not thirdperson mode and ı dont want use auto_cvars like Show_player legs must not change with cvar it must be persistent . 
If Its Possible 

Just a question. It's possible in Quake 1 connect 2 maps and keep dead monster and other stuff already used, when you return for example from map 2 to map 1?

İ guess you want to make connected map system like halflife and persistent entities in may look gold src engine or original hl source code 
For Crowdy 
Yes, exactly!

Ok, its a great idea! ill check original hl source code, thanks a lot, someone knows a mod that impleted this feature? thanks again! 
If I remember correctly, The Demon King lets you move back and forth between maps, with at least some degree of persistence between them.

Don't know if the source was ever made available, though. 
It's a pity, the zip doesnt contain the src... 
I know. :( Well, at least it shows that what you want to do is to some extent possible to do in Quake, right?

The best I can do is this link with the development team's contact details circa 1997. I doubt any of those e-mail addresses are still active, but at least this tells you who worked on the mod. Maybe you can track one of them down and ask if they still have the source? 
One Important Point 
Demon King didn't preserve map state when you returned to levels - you were spawned at the correct entrance but all the monsters were alive again. I remember the forest being particularly nasty in this regard...

For that you'd need to use a system of saving and loading .sav files - but I think that's within the realm of possibility for a QuakeC mod.

What is probably not possible is the Half-Life style continuity within loading zones - where a monster could follow you through the transition between maps. Even if you could somehow compress the info about such a monster in the tiny amount of storage you have for transmission of data between levels, you'd still be stuck if that monster class wasn't precached when the target map was loaded... 
all the monsters were alive again

Are you sure? I'm pretty sure the monsters stayed dead, but weapons, health and ammo would appear again when you went back to a previous level... 
Thanks @threekidsinatrenchcoat And @Preach 
@threekidsinatrenchcoat I have decompiled the code and give me tips for the idea i want to do, thaks a lot!

@Preach, i have tested the demons king mod and the monster remains dead, but needs to be polished, save/load its a good idea too thanks! 
It Works! 
I have copy paste the parts i need from decompiled files, and works! Now i have polish a bit the code,due the monsters in Demon king dissapear and I added the death animation so the corpse remains (sorry for my english)

Now i must try to keep the corpse position

A question, the spawnflag can have a vector variable instead a float ?

Thanks again 
Using Code Without Permission 
I'm happy you got things working, but decompiling and copy & pasting from someone else's code strikes me as ethically questionable at best.

If you're planning to release your project I'd say the right thing to do is to try and find the creator(s) of The Demon King and ask if they're ok with your using their code like this. If you can't find them or if they don't agree, I don't don't think it's right to use their work like this.

Just my two cents. 
Ill Look For Creators 
I have found their names and emails, ill try to find them and ask for it, thanks again 
Changing Default Player Sounds 
Hello, I'm trying to change player death sounds in my map, how is it possible to do? 
The Sound Of Death 
I'm afraid you'd need to create a mod to do that, you can't controls those sounds just from the map.

However, the mod would be very modest. You could either write a QuakeC mod which just involves changing the path from the old sound to the new one in a handful of places. Or your mod could be entirely free of QuakeC, and just have the new sounds saved in your mod folder with the same filenames as the existing sounds have in pak0.pak. 
Second Option 
So, I need to create "sound" folder in my mod directory and put there the new sounds? And that will override default path in the .pak files from id1? 
That's right. The priority for loading resources goes:

1. pak files in the mod directory - highest numbered file being highest priority
2. loose files in the mod directory
3. pak files in id1 - again from highest to lowest number
4. loose files in the id1 directory

Bear in mind that the existing sound files will be in a subdirectory under "sound" - I think death sounds are in "player" but would be best if you checked that in pak0.pak. 
It Worked! 
Thahnk you very much!
Tested it, you need to put sounds with respective filenames in sound/player directory. 
Hi! A Question 
Im trying to compile a map for Hexen II, its the same compiler than quake 1? Which must use for Hexen 2 and where can find it?

Thanks a lot 
Hexen Has Its Own Compiler 
Thanks @madfox 
Hi Madfox, thanks for the support

Ok i have try it with the "compiling gui" but seems it doesnt works...

"Copying Files...
1 archivo(s) copiado(s).
Converting map...
outputfile: rites.bsp
************ ERROR ************
parsing brush
Press any key to continue . . ."

Needs a special line commands parameters?

Thanks again! 
Also With Other Compiler... 
i got this error:

"Converting map...
---- qbsp ----
Project directory: C:\Users\agonagui\Desktop\Temp\Cosas\Hexen2_Dev\Working\
outputfile: rites.bsp
WARNING: brush plane with no normal
*** ERROR: ***
num_entities == MAX_MAP_ENTITIES"

its weird, due this map the same on quake engine works fine but ported to hexen 2 have this issue

any idea? thanks? 
Sorry I Mean "any Idea? Thanks!" 
lol my mistake hehe 
Not Sure 
I once worked with hexen maps, but I used them in the Quark editor. It has a hexen2 input in a way that is easier to work with. After making the right setup it shows which errors are made.

Parsing brush could mean you are not on grid, or that two brushes are overlapping. Also there can be a leak warning. Fact is that when something is wrong the compiler starts giving messages that can be irrilevant.

Max_map_entities for instance means you are using more than 640 en (lights, func and monsters) which I can't imagine.

My idea would be: try Quark 64. I know it is not the best editor there is, but it is one that gives you an entry to hexen2. Use the hexen compiler in the setup and see for yourselve. You'll find out that a hexen map uses another format for entities, because you can't use a quake map layout as a start for a hexem2 map without changing specefic flags that quake uses.

Again, Quark has the specific flags already embedded in the hexen setup. 
Very Grateful For Your Extended Answer 
Hi madfox, thanks a lot, ill check all that you commented, hope it can works, the problem is that i have made initiallly the mod for quake and seems have problems to convert it to hexen 
You'll need to explore the hexen2 code.

Not an easy task, as it took me a long time to understand quake.qc only. 
I'll Do It 
Drugod, you should still give ericw's compilers a try. They work if you add the -hexen2 argument to qbsp. Theyre better than the original compilers cause theres a lot more useful lighting options like sunlight, bounce, wait, delay, etc. Also you dont have to use Quark, Trenchbroom works perfectly fine with the game. 
Enemies Only Getting Hurt/killed By Certain Weapons 
I had an idea where certain enemies could only be killed by specific weapons, but I don't know where I'd look to get that implimented. I somewhat have an idea on how (having the monster check for a classname, then applying damage/killing it if matches), but I don't know the where.

Like let's say I want the Ogre to only be killed by the Rocket Launcher, where would I look to make that happen? 
the shambler currently takes half damage from explosions, if you can find where it does that you can probably expand the concept. 
Damage & Shielding 
I have a code to make the Shield Ogre only get hurt by nails and cells.

After you implement a few lines code into the weapons.qc it's easy to understand how it works.
I will have a look at it and turn it over. 
That took some houres to get together, but..,

here is the model of the EldenOgre, also ShieldOgre I made to acomplish the Q1Test I am remaking for Singleplayer.

Before I packed I made asure I worked with the right source, as shielding is a little tricky. Most of it takes part in the weapons.qc.
This Ogre is shielded for nails and grenades.

To make it a bit easier I added a ShieldCode.txt that clears up the four importance files ie.
This is stated by a "//start/end shieldcode" pointed on the start of the QC.


Thanks to Ijed for the knowhow with QuakeReMake and the map. Thaks Metlslime for the Rubicon.code.
Thanks you little medieval shielded creep, yes! No gunpowder, just pure ancient power! 
#2899 @tddgst 
Did you had a notion how to change only the grenade imuninity? 
Help With Flying Npc 
Another question i have done a crow model, i would like to make it fly, landing on the ground, and randomly start again to fly, but how the hell can i make a flying monsters (as i have definied the crow) land on the floor and make it flyi again ? any suggestions? thanks a lot!! 
The Model Not Landing 
Screenshots #16481, it is a bit wicked to change a walking model into a flying one. 
Maybe Its Not Necessary Change The Flag... 
but can move the model up and down? making landing or flying depending the animation. 
Fly_think Code 
Fly_monster works on a specific height, like scrags. You can make them fly a pattern with path_corners. The bad thing is you can't learn a flying monster walk tricks.

The Fly_think could make a solution. 
If it were me I would try to navigate the entity down until the bounding box resting on the ground, then stop moving the entity, and play a "landing" animation on the model.

Flying creatures always seek the level of their self.enemy, so in Rubicon 2 I used a dummy entity as the enemy, to force the centurions to go up or down based on my desire. You could do something similar to help guide them to points where you want them to land. 
Thanks Guys! 
ill try thanks 
Reminding Crows 
Don't forget to look at the "camonball code" Triball mentioned in the scteenshots toppic # 16479 about the "Fly_Think_Code". 
Check This Guys! 
Hi i have finished the crown, hope you like it

I should polish my code and ill share it if you need it 
They Look Good 
With a little tweaking and sound they make a scary impression. 
yeah looks pretty good! There seems to be an interpolation issue with the movement, do you by any chance have r_lerpmove 0 and r_lerpmodels 1? Generally they should both be set to 1 or both be set to 0. Otherwise, maybe this is an engine bug, i know there's the unsolved problem of falling scraggs looking choppy. 
Thanks Guys!! 
Thanks guys for the quick response and support, let me share with you guys the code, in case you need it feel free to use it. 
I have checked both variables and are setted to 1, anyway thanks for the advice idk this commands!

Is it possible to make a flying monster throw three voreballs at once? 
Preach, this is related to the question that Madfox's asked on 6/22/20, in which the a flying boss in Chasm fires three projectiles. I made a mistake and told Madfox that the monster fire three straight projectiles, but his missiles actually have homing capabilities, so it is like throwing three voreballs at once. If you can give madfox a hand it would be great. 
I felt a bit bad at being flippant before, but your last post hasn't really helped your cause here. You've redirected me without a link to a post from four months ago, which I replied to at the time...

Help me to help you, OK, help me to help you! This is a free service, so you'll get the most out of it by making it as easy as possible to assist you. I'd suggest compiling all of the following into a single post:
a) What are you trying to achieve
b) What you have already tried
c) What you expected to happen
d) What actually happened 
sorry about that preach, I have attached a screenshot of the post I am referring to here:

The picture of the monster is here:

So basically, the three fireballs in the picture should be voreballs instead of straight projectiles. 
They're not going to move diagonally if they're homing. 
Please Stop Trolling Me 
Your screenshot includes madfox's post, my reply, and madfox thanking me for my answer. Until you post a new question with parts a), b), c) and d) I will consider the matter closed. 
I am not trolling with you preach. Madfox asked you the wrong question because I gave him the wrong info. The question was never "to make the Projectile move diagonally" but rather "how to make that monster throw three voreballs" 
a) What are you trying to achieve? answered
b) What have you already tried?
c) What did you expected to happen?
d) What actually happened?
Sorry for the delay, but my emails got bumped after my last experiment with the turntwig.
I could make more poses for it, but daytime life forced me into a nasty sitepath.

At this moment I'm working on the last end boss worm, and this one is more intensive, as it needs more parms as the usual monster.

What the question concerns..,

what have you already tried?
Give a monster a three lavaball attack using the scrag code.
what did you expected to happen?
Three lava balls launched at the same time.
what actually happened?
Easy to avoid the attack.

It seems yhe1 wants to use the vomit attack, that's two times higher than my hat. :P 
By vomit attack you mean "vore attack", right, madfox? I checked in DOS Chasm, the three fireballs are similar to voreballs with homing. 
I just wondered how to repeat this vote ball attack three times to be launched simultaneously. 
Phantom Fear 
Second answer was not true.
I used a modified code to launch a single phantom_shot one frame after another.
After adding a phantom_shot void I made the attack scene:

void() fant_atk2 =[ $atk2, fant_atk3 ] {PhanMissile(1);};
void() fant_atk3 =[ $atk3, fant_atk4 ] {PhanMissile(0);};
void() fant_atk4 =[ $atk4, fant_atk5 ] {PhanMissile(-1);};

The spread shot came from the (1) (0) (-1) addon.

Now I changed the fant_shot into the one a vormit uses to launch a vore ball.
This works as intended.

pro: I have a monster launching three voreballs.
quo: they don't launch at the same time (I don't mind).
They don't spread anymore on the (1)(0)(-1) arg because the voreball code has three statements, that specify their behaviour.

So what the code misses is the statement of the ShallHome statement of the vormit to include a spread shot and (if possibel) at the same time. 
Replace PhanMissile With ShalMissile 
So I Did.., 
I renamed the ShalMissile code to PhanMissile and now there are three vorbal attacks slightly after each other.
Now idea how to launched them at once, nor how to spread them. 
To have three launch in the same frame just call run the code three times.


To have them launch in different places change

missile.origin = self.origin + '0 0 10';


missile.origin = self.origin + '0 0 30';
missile.origin = self.origin + '0 0 -10'; 
I might be a dumbass.., I tried

void() fant_atk2 =[ $atk2, fant_atk3 ] {PhanMissile(); PhanMissile(); PhanMissile();};

but only one voreball appears. 
No that makes 3 voreballs appear at the sane time and in the same place. 
Also ShalMissile. 
I see only one. And for clearance, I rewrote the shalMissile to PhantMissile. This gets a bit hazardeous.
Think I'll just stick with a launch apart way. 
I see only one.

That's because they are all in the exact same position. 
Simple Logic 
So useless as it causes only extra dmg.
Thank for explain. 
Is there a way to quit intermission without a map restart? I was reading engine code and it looks like it's not possible. Once you enter intermission state, you have to restart or load a new map.
...but maybe I'm missing something and there is a way?

ps. through custom progs of course. I know FTE can do this... but I want some general solution 
Alright... so as I though, there is no way. 
Not Really 
One of the problems is that you probably can't send standard clients an "undo intermission" message even if you can get the server on board.

I mean, if all you want to do is put some centerprint text on the screen while the player can't move, you could maybe use cutscene code to "simulate" being in an intermission. But if you want all the scoreboard stuff then I think you're right that there's no way to achieve that in standard quake. 
What are the recommended non-commercial ("free" as in beer) tools for compiling vanilla WinQuake nowadays, without the x86 ASM code?

Is there an updated tutorial anywhere?

While I'd like to take advantage of new features such as multicore support, I also wish to retain as much backwards compatibility as possible (Windows XP support, etc). 
13 posts not shown on this page because they were spam
First | Previous | Next | Last
Post A Reply:
Website copyright © 2002-2020 John Fitzgibbons. All posts are copyright their respective authors.