|
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. |
|
|
#2101 posted by necros on 2016/03/30 04:03:15
i remember having problems with doing setorigin in touch... but i think it only happened with triggers of some kind. sorry, really long ago, forget all the details. :S
#2102 posted by Spike on 2016/03/30 05:34:33
SV_TouchLinks walks through the various triggers in a fairly lazy way. you can relink non-triggers inside trigger touch events, but if you relink any solid_trigger entity there then the loop can end up referring to the wrong entity, potentially resulting in references to null or infinite loops. sometimes you might be lucky and get away with it, it really depends on the ordering.
this can be seen on e2m2 - shoot one button then jump across and you'll touch a trigger that killtargets another trigger, resulting in a crash.
non-triggers touching non-triggers should be safe, as the node-walking is separated from the qc callback, limiting movements to touch only one other solid entity.
because triggers and non-triggers use separate node lists, relinking the player won't hurt the trigger lists, which is how come teleporters never cause any problems.
by relinking, I mean calling setmodel/setsize/setorigin, or alternatively removing an entity.
bug-fixed engines will probably just build a list of the triggers that need touching and *then* trigger the events if the triggers were not removed by a different trigger, thereby avoiding the crash at the risk of dropped touches (if its a player then it'll just get touched next frame anyway, although monsters might not re-trigger it any time soon if they stop walking at that point).
Rcon Tool
Ok, Im needing something that can remotely rcon Quake engines, mainly pq for now. Turns out if you have a server on 2 ports, the rcon commands always wind up heading to port 2600 by default. SO you can use rcon_address and rcon password fine, and even status will show up ok on the non std port but any command telling it to change a setting winds up going to port 26000. SO I found this small app that claims to be able to rcon to Quake servers: [ http://www.codeproject.com/Articles/21885/Send-RCON-Commands-to-Quake-Based-Games ]
They want an email address sand pw so the dl is accessable, so I think any email address will work, it dont seem to send out a verify, then you can just dl the code.
So its C language, and I have had such rotten luck using Visual Studio trying to compile a Quake engine, but since this one was small , decided to try. Turns out I have Visual Studio 10, and it said it needed to convert, which it did, and seemed that it was successful, so I clicked on the proj file, and did a build, and to my amazement, it built an exe in bin/release and also in obj/release. However my excietment was short lived, as the app does run, when you enter a server address and pw and command, it locks up indefinately and has to be shut down in task manager.
Anyone here have some advice on what Im doing wrong or is the code itself just crappy?
Modify Player View Pitch Through QuakeC
Is this possible? I notice an entity member idealpitch but changing it doesn't make a difference.
I'm trying to add gun climb, where firing a weapon makes the player look up.
#2105 posted by necros on 2016/04/17 02:22:15
yup, totally possible. set .fixangle to 1. the player's view will snap to whatever is in .angles.
#2106 posted by Spike on 2016/04/17 04:31:40
nnnnnoooooo!
you can spam fixangles as much as you want. each time will cause the player's view to snap to something that they were not aiming at at the time.
this is especially bad over a network. you simply cannot use it for only pitch or only yaw.
it can be kinda rough even in single player, even a single frame's delay will snap you back to your yaw angle from the previous frame. repeat and your angles are now locked.
there is a .punchangle field that you can use to bias the pitch angle, however, it tends back towards 0 and there's not really anything you can do about that. It WILL judder regardless, especially in QW where you'll probably overcompensate and cause it to go completely haywire.
if you want full control over the camera angles, or the client->server angles, the only place you can reliably do that is clientside. Ie, in csqc. Doing it serverside will just result in fighting with the client, and the lag (even in single player) will prevent you from reconciling.
Okay, so I tried fixangles and the behavior is very unexpected. Spike (is that you, Spoike?) is correct, I've tried it in Quakespasm, Darkplaces, FTEQW and it does snap to something i wasn't aiming at (even after using angles/v_angle = angles/v_angle + 'x y z') in all of them.
punchangle is also cosmetic and doesn't effect gameplay. I'm messing around WriteEntity() now... will let you know how that goes...
Got it i think. After I calculate the new angles, I use WriteByte ( MSG_ONE, 10 ); Now, I dont know if this adjusts v_angle or angle, but hey... it works for now. Here is the code chunk for anyone interested;
ang_x = -8 - random() * 2;
ang_y = random() * 2 - 1;
ang_z = 0;
ang = ang + self.v_angle;
msg_entity = self;
WriteByte ( MSG_ONE, 10 );
WriteAngle( MSG_ONE, ang_x );
WriteAngle( MSG_ONE, ang_y );
WriteAngle( MSG_ONE, ang_z );
I'll throw together a tut soon (hopefully)
Impulse Processing Takes Place After Physics?
I'm wondering why is the W_WeaponFrame() function called in the PlayerPostThink() and not in the PlayerPreThink(), moving it doesn't appear to make a difference. Is it arbitrary? Or, did the developers intend to queue command processing for next frame after all entities had been processed?
I know pre and post run before and after player physics processing (or is it before and after all entities have had their physics processed?), when does the animation tie in to the flow of a single game step? In my own WIP game engine, the flow at every step is:
1) Capture events
2) Process logic/AI for all 'actors'(entities)
3) Animate all actors
4) Run physics on all actors
5) Render everything
Different Weapon Pickup Sounds Crashes Quakespasm
#2110 posted by aDaya on 2016/04/22 14:13:58
For my mod, I made sure that each weapon pickups have their own sounds. Same thing for armors and ammo boxes.
It works without a problem on darkplaces, but picking a weapon in quakespasm stops the current game and displays this:
http://image.noelshack.com/fichiers/2016/16/1461326522-spasm0000.png
Here's my code for armors:
http://pastebin.com/7DywCzPm
My code for ammo boxes:
http://pastebin.com/eKKZUVqu
And finally, my code for weapon pickups:
http://pastebin.com/Mwr4NtnG
As you can see, I used for all of them that "self.noise" trick that allows me to add different sounds for each items.
I find it wierd because picking up ammo boxes with that method in quakespasm doesn't crash it, even though they use the same technique. At first I thought that was because the whole "self.noise" root declaration was put after all the individual weapon pickup lines, while it was put before for the ammo boxes. So I tried to do that for the weapons, but while testing in darkplaces the weapon pickup sounds don't play.
#2111 posted by metlslime on 2016/04/22 20:32:11
you need to precache sounds in the spawn functions, not the touch functions. Your armor and ammo code are doing it correctly. Your weapon code is doing it wrong.
Thanks, It Worked!
#2112 posted by aDaya on 2016/04/22 21:44:59
Source Code For Mission Pack #2? + Other Things
#2113 posted by aDaya on 2016/04/24 21:28:29
I had someone test my first schlossherr map, and he picked-up the MegaHealth item in my map, and because they share the same itemslot, he got the BFG as well.
With this, coupled with the fact that I want 2 extra-items after being done with the BFG, I remembered that mission pack #2 had an items_2 thing that lets you store more items. Thing is, my google-fu is weak and I can't find its sourcecode, even in ModDB. Would anyone be kind enough to link me to it?
Another thing, since I'm adding additional weapons, how can I add extra HUD icons?
One last thing, Back when I was asking questions about my BFG problems regarding the projectile penetrating enemies, I recall someone saying something like "destroy the projectile which makes a new one with the same trajectory as the original projectile", but what's the way to pick up those coordinates and use them?
Source Code For MP2
#2114 posted by Preach on 2016/04/24 23:25:31
I can't seem to find a regular download for the rogue QC either, but I did find a github account with it
https://github.com/bazilio-ua/q1.progs/tree/master/original/rogue/progs
It looks like some modifications have taken place since, but if you track back to the initial commit it's probably how the original files looked. Hopefully...
Another thing, since I'm adding additional weapons, how can I add extra HUD icons?
You only have three options as to how the HUD works. You can have the HUD like it is in vanilla, or the HUD from mission pack one, or the HUD from mission pack two. You can customise the icons themselves, but there is no way of rearranging them or adding more than what the mission packs have. The mission packs got special customisations to the engine code before the source was released, it's not something the QC gives you any ability to change.
Incidentally, items2 was actually introduced in hipnotic, not in rogue, so you want the mission pack 1 source code really!
Had Rogue's QC From The Start
#2115 posted by aDaya on 2016/04/25 00:51:09
Re-looking at it, and I have items2 defined in hip_def.qc (included in progs.def), which begs the question: if it was, then how come I have trouble adding items then? Or should I put my new weapons and items declaration from defs.qc to hip_defs.qc? Or is there something else that I'm missing?
Progs.src
#2116 posted by Preach on 2016/04/25 18:26:05
Two minor ideas. Firstly, make sure that it's being included in the compilation. Take a look at the progs.src file and check that hip_def.qc is in there.
The other think to think about is that you select between the three HUDs on the command line, not in the QC. So make sure you're using -hipnotic or -rogue on your command line when you launch Quake. Also keep in mind that you need the end users of your mod to remember to do that too! I expect lots of people forget with Quoth and don't see the plasma gun icon...
Special Brushes Affiliate? (secret Doors, Platforms, Etc.)
#2118 posted by aDaya on 2016/05/16 14:26:35
I'm asking what it is so I could properly made the BFG orb for my mod not to target them/make the orb explode on impact on them, and also so I can get around bleeding brushes when you hit them.
Translated Article, I Cant Find An English One Right Now.
#2119 posted by mfx on 2016/05/17 21:45:28
#2120 posted by mfx on 2016/05/17 21:47:50
Brush Entities
#2121 posted by Preach on 2016/05/18 00:35:26
I'm asking what it is so I could properly made the BFG orb for my mod not to target them/make the orb explode on impact on them, and also so I can get around bleeding brushes when you hit them.
Clarifying question: You still want the orb to explode when it hits the rest of the world, just not platforms etc? Is there any other exception you want the orb to explode when striking?
I Want It To Explode On Any Brushes, It Usually Goes Through Enemies
#2122 posted by aDaya on 2016/05/18 14:58:26
who get gibbed when hit by the orb, so my guess is that it will go through buttons and doors that need to be shot if I leave it at that.
Speaking of which I still don't know how to remove the orb and THEN create another one with the same XYZ coordinates it got when it was first shot, because leaving at that makes the orb bounce off.
Another thing, I've been trying to clean my weapon cycle code by looking at scourge of armagon's code, but things get more complicated when you have weapons that share the same slot and have different ammo consumption.
My code:
http://pastebin.com/fRKhfLVG
Compilation error message (can't really find what's wrong with the whole oldimpulse thing and all):
http://pastebin.com/cFTRBHVB
Hipnotic's part of the code (just in case):
http://pastebin.com/J7fnWur4
Daya
#2123 posted by Preach on 2016/05/19 18:44:26
I feel more confused after your clarification. At the moment does the orb
1a) explode when it hits the world - yes/no
1b) explode when it hits a door - yes/no
Would you like it to
2a) explode when it hits the world - yes/no
2b) explode when it hits a door - yes/no
Please delete as applicable.
Preach
#2124 posted by aDaya on 2016/05/19 21:09:49
1a yes
1b yes
Actually I just tested in the first map, and while it targets nearby shootable brushes, it kind of makes for a Power Bomb effect like in Metroid, where detonating one would reveal every secret tiles on the screen, so I think it's something I can leave on (still looking for a solution for those "custom explosion sprite doesn't appear" and "how do I make a new orb that shares the XYZ coordinates after removing the original once it collides with an enemy that got gibbed on direct impact?" problems).
Man Daya
#2125 posted by Preach on 2016/05/19 22:46:25
There were four question, I still don't understand what part of your post is what it's currently doing and what part is how you want it to be different.
|
|
1 post not shown on this page because it was spam |
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|