|
Posted by metlslime on 2007/08/08 04:57:56 |
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. |
|
|
#2664 posted by Qmaster on 2018/08/22 16:25:11
Quakedroid would be about the only reason not to just precache everything.
#2665 posted by Qmaster on 2018/09/01 16:03:55
What does this mean?
if ( (rand()&3)==1
#2666 posted by Spike on 2018/09/01 17:37:25
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.
Sv_move.c
#2667 posted by Qmaster on 2018/09/01 18:14:12
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.
#2668 posted by Spike on 2018/09/01 19:44:28
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.
#2669 posted by Qmaster on 2018/09/02 16:13:50
Its strung out multi-function calling madness yes. Trying to recreate it.
Which Coordinates Do I Use For ReMStud?
#2670 posted by rizzoislandgame on 2018/09/13 21:06:45
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?
Info_camera
#2671 posted by madfox on 2018/09/13 21:27:17
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.
Rotfix
#2672 posted by c0burn on 2018/09/18 01:05:05
https://mega.nz/#!piwDiK5B!Kc90JQEftzSbvCJSANqZNNpg-8yXboPY8rr4JiUCUIk
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.
Thanks!
Qdefmake
#2674 posted by c0burn on 2018/10/15 22:56:33
Download: https://mega.nz/#!B2wTVa6A!RmkzKaD4VHhOX0zpz9QJjqKtwtKiRxEixT0AUMOtBLk
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. http://kristianduske.com/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.
#2675 posted by Qmaster on 2018/10/16 00:26:33
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?
#2676 posted by c0burn on 2018/10/16 00:34:53
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
#2677 posted by Preach on 2018/10/16 08:57:50
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.
#2678 posted by c0burn on 2018/10/16 09:59:23
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
#2679 posted by Lunaran on 2018/10/19 06:16:16
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
#2680 posted by Qmaster on 2018/10/19 13:51:09
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
Etc.
Etc.
SUB_Remove Edicts Piling Up
#2681 posted by Shanjaq on 2018/11/20 06:50:57
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
#2682 posted by Preach on 2018/11/20 20:34:19
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.
#2683 posted by Spike on 2018/11/20 22:47:08
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
#2684 posted by Shanjaq on 2018/11/21 05:54:44
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:
Num.,Time,Class,Name,Model,Think,Touch,Use
1,131.97,player,models/paladin.mdl,player_frames,obj_push,
2,132.16,,,models/flesh2.mdl,ChunkShrink,
...
561,131.96,tsunami,,models/cloud.mdl,ChunkShrink,,
562,131.96,bloodspot,,models/bloodspot.mdl,blood_fall_timer,blood_drop_timer,
563,-1.00,,,,SUB_Remove,,
564,-1.00,,,,SUB_Remove,,
Fte Quake C Dev
#2685 posted by madfox on 2018/11/24 00:20:02
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?
#2686 posted by Qmaster on 2018/11/24 00:31:28
You need to pass inflictor as well:
void (entity attacker, entity inflictor, float damage) th_pain;
#2687 posted by Qmaster on 2018/11/24 00:32:16
Usually just self. This is used to differentiate between the projectile inflictor (e.g. the rocket, self) and the attacker (self.owner).
#2688 posted by Qmaster on 2018/11/24 00:34:41
Just add "(entity attacker, entity inflicter, float damage)" to each monster's pain functuon. Example:
void () ogre_pain = {
becomes
void (entity attacker, entity inflicter, float damage) ogre_pain = {
WAIT WAIT...just attacker and damage. AD adds inflictor.
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|