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
 
Hey, so ... Is there an easy way in QuakeC to determine that the player has seen an entity for the first time? Like, an ammo or health pickup for example? 
 
hmmm not exactly.

you COULD just make a function call that continously runs every frame that checks all entities and marks any items it finds as seen, but that's pretty wasteful and might even cause slow down if there are enough entities in the loop.

Alternatively, you could create a one time, on map load function that builds a new list of only items and then the previously mentioned loop could only iterate through that list.

A simpler, but more manual method would be to just have triggers that mark entities as 'seen'.
This is the method I used in ne_ruins for a few ammo boxes. They are dynamically changed between small or large when the trigger fires on them but only once, so if the player has triggered the check when they had a lot of ammo and the boxes are small, they won't become large boxes later if they revisit the area with low ammo. 
 
Yeah, that's what I wanted to do ... dynamically scale health and ammo to the players needs. But I guess I won't. That sounds like a lot of trouble and really too much work for what it is...

Thanks! 
 
just have a crate you break open to get the item -- you can decide what item to spawn once the crate breaks.

Or have items drop off enemies, and scale the amount based on player's current needs. 
 
just have a crate you break open to get the item -- you can decide what item to spawn once the crate breaks.

Or have items drop off enemies, and scale the amount based on player's current needs. 
Func_fail 
 
 
on your own board, no less!

I prefer using triggers to decide rather than crates because it feels like it creates a better illusion. 
 
the trigger thing seems pretty easy as long as you aren't running out of edicts. Just place one trigger in the previous hallway to spawn the item. 
 
So before I write it, has there ever been an OBJ to MAP convertor written? There had to have been, right? I'd love to use MODO to generate geometry that is downright tedious or impossible in Trenchbroom... 
 
Sharkbanana who can sometimes be found in #qc had a tool for generating q3 .maps that way. I don't know if he wrote it or got it from elsewhere.
it didn't seem to be worth it. too many precision issues or something. tbh, just use misc_model, but then this is q3bsp that I'm talking about, where that sort of thing is possible. 
Willem 
why don't you have the relevant items .think and call checkclient()? That's certainly not too slow for every monster in the level to call ten times a second. 
 
ohh yeah, actually that makes way more sense.
checkclient is pretty quick since it's a built in and uses pvs. 
 
you'll have to filter newly awakened monsters, because they count as clients for one frame to propagate aggro through crowds, but that's simple enough. 
Checkclient 
sounds like a pretty good solution. 
Monster Behaviour 
I have finished the mr.big model, a rocket jumping, and heavy weapon entity.
Looking in the hknight.qc for the magic to give the gun a "spread" fire action, and in the dog_leap routine for the rocket jump.

The heavy weapon now results in such a damage that even its own entities get killed when placed in the same surounding.
I thought there was a line of code in the ogre.qc that provided this behaviour, not killing own enemy.

Also
SV_startsound:not precached.
How to avoid it? 
 
SV_startsound:not precached.
you forgot to precache a sound you're using, check all the sound() function calls for any you missed.

not sure about the self damaging, that could be many things. the most obvious thing to check for me would be that you are passing the right entity for the ignore argument in t_radiusdamage. For example, usually it's self.owner, so make sure you set the missile's .owner field correctly. 
MrBig 
thanks necros. I did check the sounds, but strangly only the second monster's call gives the warning.

For convienence, here 's a testmap for MrBig. The qc is included. 
 
it's the sight sound. that's the only sound that is played outside of the monster's qc file... check ai.qc for the SightSound() method to see which sound is being played. 
Ai.qc 
Searched the qc.file, but what I find is in void() FoundTarget, what I believe as local float rsnd;.

Is that the spot for SV_StartSound<q/>? 
 
madfox, ogre grenades can totally kill nearby monsters, it just has such a small weak explosion compared to player explosives that it rarely ever does (dmg is 40, radius is dmg+20). It's not even strong enough to kill a zombie. 
Unsound Reasoning 
Ah, here's where the confusion is

SV_StartSound is in the engine, don't go looking for that in the QC. The part of the message you need for debugging is where it tells you which sound wasn't precached. If you like, you can then look through the QC for that sound to find out which bit of code is trying to play it. Really though, you don't have to know who wants to play the sound, just precache it in your monster's spawn function so it stops being an error. 
Kanguru Ogre 
@Lun - sure, but this is no ordinary ogre, it is carying an old fashion 8-loop gun and can flush a spread shot of 20 spikes within 20frames.
I lowered it to 8 on 20fr.
That's a lot of damage, see the test file.

@Preach - can't find it in the qc file, precached all sounds. It might be the player's sound is missing but that's loaded in world.qc.
Is there a console command for this tracing not precached? 
Get Server To Recognise That Temp1 Has Been Set By Client? 
Is it possible in quakec for a client to set temp1 via a console command or alias, and have the server see that and act on it? Not having much luck so far.

I have a function that watches temp1 for change and echoes a simple message, and the call for that function is in StartFrame() in world.qc but it isn't picking anything up. 
Holy Security Risk, Batman! 
use impulses or krimzon_sv_parseclientcommand. 
 
Thanks a lot. krimzon_sv_parseclientcommand is exactly what I need :) 
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.