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
Lightmap On In Dedicated Server Mode? 
Is this hard to do from the engine? Could an extension be made so it can be done in QC ? 
Sound Isn't Looped 
A static entity, with a precached sound runs a 11000hz wav in the right order.
Another setup with the same statements remarks the sound wav isn't looped.

I can't remember I looped the first sound. I start Cool, load the sample, save it as looped. Same outcome, not looped.
Audacity the same, saved looped, same error.

What is the cause of this well or not looped sound? 
@Madfox 
I seem to remember once if the sound was in the /ambience folder, it always seemed to loop no matter the type. Try that and repost here. 
No It Doesn't 
 
Integrate 
I had this earlier, but then Cool-150 adjusted the loop function.
Now I even can save the wav. 
Back To Gibs That Stick.... 
Revised the code and got them sticking to ceilings, with occasional bloodshowers, however if the ceiling is sloped, we need to probably check its angle and apply gravity in a "reverse" direction in some cases possibly. How to get the engine to do that, id say is a challenge.

But I went with MOVETYPE_NOCLIP to get it to slide straight down on the wall, and checkbottom works well to break it out of noclip so far. Im using Darkplaces with setmodelrealbox, so the model actually has what I refer to as a "mass" m basicly its not point size anymore...so you can set larger gibs so slide faster for realism. I updated the code here if anyone wants to take a peek or collaborate / add a tweak:

http://collabedit.com/phw6e 
 
Trying to get a brutal quake going? 
Experiment 
yea, Brutal Doom was maybe where I first saw this back when I tried it. Curious how it looks in Quake. So far that code seems to work kinda well, but sloping surfaces need to be addressed. 
Modified 
Updated the code again. Hopefully now it will know when its not in contact with the surface if its moved to a corner while traveling down, which does not rest on a floor. It ought to detach now and become a regular gib. Still need to test it though...yea all this for a Giblet, right ? :) 
 
i'm pretty out of it right now...... but can someone confirm this..?

basically, whenever there's a collision, in your .touch, you will have a normal of whatever the collision was??

i think with maths, you can generate a downward vector with that normal and gravity and set the movement that way with a MOVETYPE_FLY instead of noclip. 
Correct 
I experimented with that a couple of years ago, thought it made sense and it does seem to return the right normal....at least in Darkplaces engine , not sure about others.

When you think of it, the collision code has to be ran to confirm a collision, and since the eng is likely using some kind of tracelines to determine collisions, makes sense they applied the results to trace_plane_normal somehow.

I ran it by Spike a couple years ago, he said he believes traceline is the best way to get the normal , and in some cases I guess so..but so far in my experiments for what I am crudely doing seems to work ok. 
Stick Gibs Update 
Well, my new modified EntitiesTouching() code did not work too well to detect if the gib was no longer in contact with the surface it was sliding down, so I created a new function which seems to do the trick, and updated the code here [
http://collabedit.com/phw6e ]

For now I commented out the .pusher reference as maybe later we can account for moving BSP objects and handle those cases.

Right now seems to mostly work ok except perhaps the sticking ought not rely solely on its velocity , but also its vectoangles of (gib.velocity) with respect to the surface its hitting? So I suppose we could formulate a tolerance where if the angle is perhaps within +/- 15% of the angle the surface normal is at, then we can have it stick, otherwise make it bounce normally.

Anyone have an idea how to start on this ? Feel free to edit the code, the site lets you collaborate. 
Serious Engine Open Source 
The Serious Engine (Serious Sam 1) is on Github https://github.com/Croteam-official/Serious-Engine 
 
so... there's a +/-use... how can we (if possible) use this? 
Checking On Func_togglewall 
There's a bit of hacky code in a func_togglewall and I wanted to understand why it's safe. The togglewall is turned non-solid by directly adding '8000 8000 8000' to its origin by, always putting it outside the maximum coordinate range (at least until some newer engines came along).

This violates one of the normal golden rules of QC, which is to always use the setorigin function to move an entity. Clearly in this case we get away with the trick, and I wanted to check if I understand why:

The purpose of setorigin is to make sure that when an entity is moved, the engine correctly links the entity. My layman's understanding is that linking makes sure that the entity is correctly renderer and collided against. The point for a togglewall is that we neither care if it renders correctly (it's invisible) or that it collides correctly (it's non-solid).

Getting right into the details of the collision stuff, normally entities are linked into particular regions of the map. Regions are an efficiency feature, so the engine can skip testing for collisions between entities far apart in the map. When we skip the call to setorigin the togglewall remains linked to the region it started in, which may be wrong for its new location. But this is OK: things in the region it started in keep checking if they collide with it, but never do because it's so far away. Meanwhile, it's not in the region for its new location, but in theory nothing should be in that region anyway, and we don't need those collisions either.

If the above is correct, then I assume when we reactivate the togglewall to move it back, the original region link is still in place. So we go back to colliding with things in the vicinity, without needing setorigin here either.

Am I somewhere near the mark? I know I've glossed over the case where entities straddle regions, and I'm sure some of the terminology is different. I really just want to be sure why we get away with it here, to check if the same trick is OK in similar circumstances. 
Is There A Way To Load Multiple Progs.dat? 
Like, a mod for weapons,another for monsters, in a single game? FTE or Darkplaces wise...
Is that possible? 
No 
 
@kalango 
yes. it is possible with FTE. whether its practical is a different matter.

the addon* cvars allow you to name addon dat files to load within the ssqc vm. these addons can interact with other dat files with the externset+externvalue builtins, or entirely via fields+new spawn functions.
the catch is that the engine's builtins are only able to understand one set of globals, which means you tend to need to use externvalue(0, "&whatever") to get a pointer to the global from the main progs, along with some preprocessor magic to hide the uglyness of this.
function types are just references in qc, this means that addons can query+replace function 'variables' in other dats in order to hook them to do whatever the addon needs them to do.

(make sure you don't compile your addon.dat files with -O3, as this strips needed string information)


tldr: so yeah, you can do it in fte. whether its actually practical to do so is a different matter. generally its only usable if you can make your addition entirely self-contained. 
 
that is really cool. unfortunately, in order for mods to be truly modular in a way that would work for that, you'd really need to code with that modularity in mind. :( 
Awesome! Ty Spike 
 
Preach 
That was my conclusion as well.

I did a bit of work with these (having them visible and used for other things as well) and decided that the hack is just what it appears to be. The position is never updated just out of laziness rather than for a specific need.

I tested resetting their position to see if it changed something in the map but couldn't notice any difference. But my knowledge is more limited than yours on these matters. 
Preach 
setting force_relink (eg, triggering a teleporter) or reloading a game will force those entities to be relinked in whatever position that they're currently in.
if they're then moved back then they'll be non-solid in their original location.
if neither of those two events happen, then the entity's pvsbits and areanodes won't change, so as long as its reset to the original position it was setmodeled in, it'll be fine.

additionally, fte can trigger relinks from vid_restarts (worldmodel is reloaded, so the old pvs is possibly no longer be valid). I assume other engines might do the same. 
Two Replies In Reverse Order 
setting force_relink (eg, triggering a teleporter) or reloading a game will force those entities to be relinked in whatever position that they're currently in.

I can understand the concern with save games, it seems to me that the hack should fall down there. I tried the following to test it:

1) trigger a togglewall to "become non-solid" i.e. leave the map
2) make a save file
3) load the save file
4) trigger the togglewall again to bring it back into the map

This doesn't exhibit a bug, the wall worked fine - it collided with me, even though it shouldn't be in the correct areanode. Is there a chance that areanodes are calculated with the coordinates "wrapping round", so that the precise distance displaced is saving the day?

The position is never updated just out of laziness rather than for a specific need.

I wondered if the intent might be to avoid "trigger in clipping list" type errors, the kind caused by changing things during a physics update. Potentially a togglewall can be triggered during a touch function. 
 
that's interesting because the func_laser in rubicon2 calls setorigin in its use function, and i don't think it causes any problems. 
Might Be Remembering Wrong 
I'm mostly backing this up with a comment from client.qc

// we can't move people right now, because touch functions are called
// in the middle of C movement code, so set a think time to do it

But I guess I must be misinterpreting it if I'm banning setorigin during a touch function, or else how would a trigger_teleport hope to function?

Is it changing the solid status of an entity which is forbidden then? Is it particular to messing around with a trigger? 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.