Hitbox Assistance?
Started learning QuakeC a couple days ago, and have been doing pretty simple stuff just to get the hang of things. When I say simple things, I mean VERY simple stuff like:
if(self.key_bind4 == TRUE)
{
self.walkframe = 109; //play an animation from the mdl
}
I wanted to know if there was some way for me to add a damaging hitbox to the player when they hit this button and the animation plays. An example would be an animation of the player swinging a bat or something, and a hitbox being created where the bat physically is. I'd appreciate any help!
Abstraction
#3466 posted by Preach on 2024/04/06 15:41:18
Quake is a much more abstract game than that. The hitboxes don't rotate, and the physics is modelling everything as a particle (at best). The Quake axe just traces a straight line a short way down the crosshair line, like a bullet with a 4 foot range. This isn't through lack of imagination or because it produced better gameplay - it's simply the kind of thing the engine is built to do.
With the technical limits set aside, I think there is an argument that first person games favour melee weapons that produce a precise stab of damage rather than a long swing. The problem is the player can freely move their camera between frames of a swing, If they move in the direction of the swing, they might stretch it out further than you intended, either leaving gaps the swing does no damage on, or dealing damage in a huge area of effect. On the other hand if they rotate against the direction of swing, they might inadvertently cause a whiff, or stack multiple hits in one spot.
Missing Texture
#3467 posted by Zantonlan on 2024/05/09 02:01:56
Hello, I'm new to Quake modding, and am currently trying to add a new enemy to the game. I have the enemy modeled, rigged and all that, but when in the game, the texture doesn't show up. It shows up when placing in TrenchBroom, but doesn't show in the game, and the enemy is just black. Is there anything I may be missing? BTW, I've tested it in both QuakeSpasm and FTEQW, in case that was the issue.
Q1.pal
#3468 posted by madfox on 2024/05/11 01:28:47
Are you sure the new model has the Quake1.pal?
Where?
#3469 posted by Zantonlan on 2024/05/11 02:58:52
How and where do I need to put that?
Qmle
#3470 posted by madfox on 2024/05/11 04:15:17
Download qmle, and see how it turns up in the editor.
From there you can vieuw the skin file.
https://renep.home.xs4all.nl/quakeme/
Registercvar FTE
How do I get access to the registercvar function FTE supports doing things in vanilla quakeC sources? There is declaration for the function in fteextensions.qc file but I neither can include it into progs.src nor copy-paste registercvar related stuff to defs.qc as it ends up into errors during compilation
Registercvar Error Message
#3472 posted by Preach on 2024/05/14 09:44:25
What error message do you get if you add the declaration to the bottom of defs.qc?
It says that the function is redefined because there are 2 registercvar prototypes in fteextensions, but if I define only one of them it works.
Creating A Thief/Gloomwood-esque Stealth System For Quake
#3474 posted by rsrsceo on 2024/08/30 09:11:13
I want to create a stealth system for quake, but am unsure of how and where to start. I have a general plan on how to create a rudimentary stealth system, which involved taking the location/light level of the player in the level and connecting it to an awareness system for the monsters. The lower the brightness, the less the awareness. I'm looking to implement this using QuakeC but am unsure of how to get the players brightness levels or lightmap locations for this sort of thing.
And yes, I have played In The Shadows. It's cool, but not the sort of stealth I have in mind.
Light-based AI
#3475 posted by Preach on 2024/08/30 23:32:47
One of the obstacles is that basic Quake engines don't give you a way to detect light levels. You'll need a custom engine that support the DP_QC_GETLIGHT extension (for example Darkplaces).
Once you have that, you can tell the light at a given coordinate. Worth remembering that Quake doesn't actually have a 3D representation of lighting - a model is lit according to the light level of the floor directly below it. That's what the function will give you, so plan accordingly when placing shadow areas in your map.
What you do with the light level is a whole other matter. In basic Quake, AI awareness is an on-off affair - either the monster is entirely ignorant of you or they are actively attacking and have omniscient awareness of exactly where you are. You'd probably want to invent at least two other states of behaviour:
- Monster is not alerted to you yet, but saw something in the shadows they want to investigate
- Monster was alerted but lost sight of you, and now wants to hunt in the area they last saw you
You'll have to add a field to store the monster's alertness level and make it behave differently at each level. One idea to try out is to create two different sequences of walking functions for e.g. patrol and investigating, which can share the same animation frames but pair them with different AI functions.
Another thing to add to the monster is a vector field to store where they think the player is - crucial to keep this updated when they can see the player (including when they see what they suspect to be the player but aren't sure) and equally important to stop updating it when they can't see you.
Once you have this, the refinements can pile on top. Maybe you give some monsters higher intelligence and have them anticipate where you were heading when they're in hunting mode - offset the last-seen location a short distance in the direction you were moving. Perhaps let even let them take another random guess if they arrive and see you aren't where they expected.
"getlight" Command In Darkplaces - How To Use It?
#3476 posted by rsrsceo on 2024/09/01 09:19:32
I'm working on the stealth system as detailed above, and I'm making steady progress. One thing I'm not sure how to do is use the getlight command from Darkplaces in/as a function. Once I get that part figured out, the rest should be smooth sailing. Any and all help is greatly appreciated.
Also, what sort of light values does getlight output, RBG or just a general light level?
Getlight
#3477 posted by Preach on 2024/09/01 22:28:06
Latter question is a quick answer, it's return a vector with RGB components - you can add them together to get an overall light level.
Basic way to access the function
1) Download the DarkPlaces mod from
https://icculus.org/twilight/darkplaces/download.html
2) Look at the QC that comes with the mod and find dpextensions.qc
3) Open dpextensions.qc and search for the code that defines getlight
4) Copy that code and add it to the bottom of your mod's defs.qc file.
You can repeat steps 3 and 4 for each DP extension you would like to use. Or if you prefer the kitchen sink approach, just add the entire dpextensions.qc file to your mod.
Casting An Entity Origin To The Client/Player Origin?
#3478 posted by rsrsceo on 2024/09/14 00:27:55
I'm working on the stealth mod detailed in my previous posts, and I've run into a conundrum that I'm not sure how to solve.
I want to get the players origin whenever they are visible and assign it to an entity that tracks their last visible position. Whenever I try doing this, the entity just gets assigned to [world.origin].
I'm new to QuakeC but am making steady progress, any and all help is appreciated, thanks!
Three Options
#3479 posted by Preach on 2024/09/14 11:20:20
In your design are you planning:
1. To have a global record of the last place any of the players were seen by any of the monsters
2. To have a record on each player of the last place they were seen by any monster
3. To have a record on each monster of the last place they saw their current enemy
Option 1 is different to option 2 when you think about co-op. To be more blunt, option 1 doesn't work very well in co-op.
Game Crashes When Attacking Unaware Monster
#3480 posted by rsrsceo on 2024/09/16 07:46:36
A [self.think] statement seems to be missing from the ai.qc script (or another related script). Whenever I attack an unaware/passive enemy, the level will crash and boot me to the command menu. Does anyone know where the missing [self.think] statement should go for aggro-ing an enemy?
For context, I'm using StealthQuake by RenegadeC as a base for this mod and I've changed up quite a bit of stuff because the base mod pretty much entirely changes up how Quake plays.
Speculation
#3481 posted by Preach on 2024/09/17 08:23:14
Never seen the source code for StealthQuake, but I can explain how a similar crash can happen in vanilla Quake and that might point you in the right direction. Take a look at HuntTarget
void() HuntTarget =
{
self.goalentity = self.enemy;
self.think = self.th_run;
self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
self.nextthink = time + 0.1;
SUB_AttackFinished (1); // wait a while before first attack
};
This function runs when a monster spots a player, and the dangerous line is self.think = self.th_run. The idea is th_run contains a think function bottled up for future use, and HuntTarget finally uncorks it. But if th_run is empty, then you've just scheduled an empty function to run in 0.1 seconds, and a crash is imminent.
Have a look at your code to see if the same transfer from th_run to think is happening when a monster wakes up, or if a similar transfer is happening from a different field. Then make sure that when you create your monster you populate that field with the correct ai function.
|