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
 
Yes, that's right. That's exactly what I wrote about, but the effects in the new version look very good, and I'd like to keep them. It is a pity if they are not compatible with the frame rate. Then I will have to disable more than half of the new effects and return them as in version 01T. 
Loading Bug? 
I got a bug that's been happening recently; when I load a saved game the models are all incorrect?

but it's seemingly fixed if i restart the map? 
Loading Bug 
Hi Ranger, this is probably a variation on the issue I warned about in post 3532
https://celephais.net/board/view_thread.php?id=60097&start=3532&end=3532

If the save file dates back to an earlier version of the mod, and you've added, removed or reordered a model precache since then, you now have an incompatibility between your mod and your save file. Having a DIFFERENT deterministic precache sequence causes exactly the same problem as a non-deterministic one. It's one of those inconveniences you hit more often as a developer, your save files won't have a long shelf life until the mod is stabilised. 
Effects 
Hi Andrew, I didn't do a great job of explaining where I was coming from. When I read your original post my impression was you believed the problem lay in a change between the version T effectinfo.txt and the version U effectinfo.txt. I admit I might have inferred incorrectly.

The really key message I wanted to send is that the flashlight in version T is not using effectinfo.txt - so you won't be able to locate the key to non-flickering effects there; there's nothing you can port to version U. It also makes it much more likely that the problem really lies in the ENGINE rather than the mod, that custom effects aren't compatible with high frame rates.

If you're into updating the engine then you can focus the effort there. If all you can do is change the mod, then you need to find a workaround for the bug, and that usually entails some kind of compromise. Capping FPS at 72 might be the better trade-off, you'll have to weigh it up. 
Loading Bug 
Actually what was concerning was there were 2-3 times where I reloaded the map or typed "kill" in console and there was still a model error...
I had to boot the map/kill twice to fix it?

...on related note, any reason why don't just list every quake sound & model in the worldspawn in order to avoid precache errors? 
Fps 
is it really noticeable to have any fps above 60-72? 
Precaching 
...on related note, any reason why don't just list every quake sound & model in the worldspawn in order to avoid precache errors?

There's a limit on how many models total you can have precached. In vanilla quake the limit is 254. And every time you add a brush entity to a map, that also consumes a precache slot. In a sense, every model you precache needlessly is one fewer brush model your map makers can use.

Of course, it's worth understanding that Quake is a 1996 game. Computers of that era didn't have the memory to precache all the models - if you look at the original ID1 maps you'll notice that they never have more than 6 or 7 types of monster in a level. This was undoubtedly a concession to memory pressure. More modern engines raise the limit, but they did have to introduce new network protocols to do so - it wasn't a trivial change.

This kind of thing probably applies to sounds as well, but the pressure is a lot lower there. While a map will routinely include a small or medium number of custom brush models, it's rare for it to introduce a single custom sound (the basic Quake mod has no facility for this, it's only possible if your mod adds it). 
Nope Somethings's Defo Up! 
I just saved a fresh load of a map, then loaded it again and the models are messed up? (but they were ok when i first loaded the map...) 
 
I didn't touch the progs.dat between loads... literally just loaded the map, saved, then loaded it again, and the models are messed up 
Ibid 
That sounds like you have the version of the issue I described in my original post, that you are doing something non-deterministic in worldspawn or your spawn functions. Are you using random numbers anywhere to decide whether or not something spawns? Or any branching statement which precaches models on one branch that aren't precached on another? 
Dynamic Looping Sound? 
I'm trying to make a breakable prop play a looping sound, but stops once it's killed and leaves a "corpse"

the sound is precached and has a marker for loops

ambientsound (self.origin, "ambience/thingy.wav", 1.0, ATTN_STATIC);
--works but continues to play once the object is killed, even with a ambientsound (self.origin, "misc/null.wav", 0.0, ATTN_STATIC); added to the self.th_die

self.noise = "ambience/thingy.wav";
sound(self, CHAN_BODY, "ambience/thingy.wav", 1.0, ATTN_STATIC);
--neither of these don't play the sound at all ingame 
Sounding Off 
sound(self, CHAN_BODY, "ambience/thingy.wav", 1.0, ATTN_STATIC);

This is the correct approach, make sure that self is the entity you expect to make the sound, and try different attenuation values. We're back to where we started! To anticipate your next question, in order to stop the sound, the misc/null.wav idea comes in, but it's key to have both the same entity AND the same channel when you do so. 
Seems Not To Work? 
void () thingy =
{
self.solid = SOLID_BBOX;
self.skin = 0;
self.frame = 0;
self.classname = "device";
precache_model ("progs/d.mdl");
precache_model ("progs/d2.mdl");
setmodel (self, "progs/d.mdl");
setsize (self, '-8 -8 -8', '8 8 8');
precache_sound ("misc/glass1.wav");
precache_sound ("ambience/elec1.wav");
self.health = 1;
self.th_die = dDead;
self.takedamage = DAMAGE_YES;

sound(self, CHAN_BODY, "ambience/elec1.wav", 1.0, ATTN_STATIC);
};


void () dDead =
{
self.takedamage = DAMAGE_NO;
self.solid = SOLID_NOT;
self.classname = "device";
sound (self, CHAN_VOICE, "misc/glass1.wav", 1.00, ATTN_NORM);
self.skin = 1;
if (((random () * 10) >= 7))
self.frame = 1;
else
self.frame = 2;
if ((self.health <= -80))
self.frame = 3;

ThrowGib ("progs/glass1.mdl", -60);
ThrowGib ("progs/glass2.mdl", -40);

sound(self, CHAN_BODY, "misc/null.wav", 0.0, ATTN_STATIC);
}; 
 
changed thingy to looping electricity sound elec1, but seems to not work ingame? i don't hear it unless it's "ambientsound"? 
Very Strange? 
Just confirmed that it doesn't work on my side

Seems to only work if i put the sound into its animation frame... but the problem is that it's not playing/looping correctly as the model doesn't have enough frames?

and adding this doesn't work (no sound plays)
self.think = AmbientTestSound;
self.nextthink = time + 10 *random(); 
Distance 
How far away is the player from the entity when AmbientTestSound runs? You're using ATTN_STATIC, which is the shortest distance a sound will travel. It might be a problem if the player isn't there to hear the start of the sound, even if they move into range later in the loop. Playing the sound as part of a spawn function might have a similar problem. 
It's Not The Attn? 
ambientsound (self.origin, "ambience/elec1.wav", 1.0, ATTN_STATIC);

^this causes the sound to play, but then it keeps playing after dead

sound(self, CHAN_BODY, "ambience/elec1.wav", 1.0, ATTN_STATIC);

^nothing plays at all/silent 
Dynamic Looping Sound Not Possible In Quake? 
i just looked through all the qc... i can't find any instance where there's a looping sound played that's not from being placed in the model's anim frame 
Clearly Possible 
Set up a door, trigger it and block it. It generates a looping sound that continues indefinitely. So there's a problem with your set-up, but Quake is completely capable of doing it. 
Not The Same 
that's (eg) self.noise1 = "doors/ddoor2.wav";

not the same as ambientsound or sound 
If Anyone Wants To Know I Figured It Out! 
the object ( with the sound() )needs a think and the sound() needs to be its own func with a think too

strangely this is the only way that it'll work lol 
Few Questions 
1 what controls how fast an anim plays/speed?

2 how do i make other player weapons knockback monsters or monster weapons knockback victims? (i know player explosions knock back already)

3 I'm trying to make monsters see through water with AI.qc trace_inopen && trace_inwater = TRUE, but seems monsters can see through the floor that's under the water? (thus some of my monster faction get angry at enemies located in unreachable areas, "under" the water surface)
can be fixed with code? or engine bug? 
More Replies 
that's (eg) self.noise1 = "doors/ddoor2.wav";

not the same as ambientsound or sound


The code that makes the sounds is

void() door_go_down =
{
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);

It's using sound, like I said. noise2 is just somewhere to note down which sound to use later. Your solution with the think is a way to achieve what I said about delaying the sound until after the spawn function.

1 what controls how fast an anim plays/speed?

The default is 0.1 seconds per frame. You can manually set the nextthink time in each think function with self.nextthink = time + frame duration;

2 how do i make other player weapons knockback monsters or monster weapons knockback victims? (i know player explosions knock back already)

All weapons knock back like explosions, knockback is proportional to damage. Explosions make the effect obvious because they inflict a big burst of damage and cause self damage. But if you play multiplayer you can see how a full-on shotgun boosts you.

The problem with monsters is that they instantly cancel out velocity with their own movement when in contact with the ground. You'd have to pop them up into the air like how dogs and fiends leap. But note that dogs and fiends have a strategy to unstuck themselves if they land in an awkward position. You might need a plan for other monsters, else players may abuse this feature to easily strand them in stuck points.

3 I'm trying to make monsters see through water with AI.qc trace_inopen && trace_inwater = TRUE, but seems monsters can see through the floor that's under the water? (thus some of my monster faction get angry at enemies located in unreachable areas, "under" the water surface)
can be fixed with code? or engine bug?

If you wrote...
if (trace_inopen && trace_inwater)
return TRUE;

..then the bug is entirely of your own making. Work out what you've done, then ask yourself if sometimes less is more. 
 
for the water i just flipped some values of defaults from ID... dunno how it actually works

how do you make them not see through the underwater floor? 
 
about knock back, is there "mass" in quake physics or is every monster as light as the player? 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2025 John Fitzgibbons. All posts are copyright their respective authors.