2024-11-25, 04:35 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
Pages: [1]
  Print  
Author Topic: Coding Help (yeah bit out of place here)  (Read 8660 times)
0 Members and 4 Guests are viewing this topic.
OoPpEe
 
Spectre
**
Posts: 42

« on: 2005-07-13, 22:19 »

A mod LoRE and I have been working on is nearing completion (well at least for a public beta), just have to add a few weapons, which are going to be basically a copy and paste job since code wise are very similar to others.

Problem we are having is our Chaingun, we want it to be somewhat like Quake 2's, basically like yours. (Why I posted it here).
I did try asking the Weapons Factory team and Q3F team but didn't get any replies back.
I'm not truely asking for the code, but rather if someone could provide me with the information to do it?
I've just been trying to get the spinup/down to work (doesn't matter if it fires while spinning down, but a plus if it does).

For logic I have this:
if holding fire and chaingun out
if weaponstate is ready
if not weapon spindown
weapon state is spinup
addTime = 3000 (for testing purposes)
return

if addTime is <= 0
if holding fire and weapon is chaingun
weapon state is firing
else if holding fire
weapon fire

if not holding fire and weapon is chaingun
weaponstate is spindown
addTime = 3000 (again testing)
else
weaponstate is ready

===========================================
Once spinup/down is working logic would change:
===========================================
if holding fire and chaingun out
if weaponstate is ready
if not weapon spindown
weapon state is spinup
addTime = 3000 (for testing purposes)
return

if addTime is <= 0
if holding fire and weapon is chaingun
weapon state is firing
every bullet increases rate of fire by "x" (will have to playtest to get the #)
if rate of fire is > 25 (will have to playtest to see if 25 is good)
make rate of fire 25
else if holding fire
weapon fire

if not holding fire and weapon is chaingun
weaponstate is spindown
spindowntime = 20 * bullets fired;
if spindowntime < 100
spindowntime = 100
if spindowntime > 3000 (3 seconds)
spindowntime = 3000
else
weaponstate is ready


Most common result is:
all weapons would fire non stop, and when I attacked (held fire), the chaingun would play the firing animation but not attack, but on mouse release it would fire 1 bullet.

I've since ditched what I had because every tweak I made give other interesting results.
So if someone could point me in the right direction on how to do this or even provide me with an example that would be apprecaited.

Thanks for reading.
« Last Edit: 2005-07-13, 22:32 by OoPpEe » Logged
ConfusedUs
 

Elite (2k+)
**
Posts: 2358

WWW
« Reply #1 on: 2005-07-13, 22:43 »

So you want us to help you steal stuff this time?
Logged
OoPpEe
 
Spectre
**
Posts: 42

« Reply #2 on: 2005-07-13, 22:47 »

Figured that would of been brought up. Who removed the files without any problems?
Hence why I am asking this time around and why I asked to get "pointed in the right direction", meaning not to give me code but rather help me correct my "logic" so when I try to code it, it somewhat works.
« Last Edit: 2005-07-13, 22:49 by OoPpEe » Logged
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8814

WWW
« Reply #3 on: 2005-07-14, 15:10 »

I'm sure you can understand our reservations for helping.  Still, there's nothing you're asking that can't be found out through careful coding and trial and error.  I'm not going to do a step-by-step explanation, but I'll give you this much of a headstart.

The first thing that comes to mind is your compile process.  You are compiling both cgame and game whenever you modify any of the bg_*.* files, right?  That's a common mistake that causes "turbo-firing" is forgetting to compile one or the other when you make changes to bg_pmove.c.  You're also going to find out the hard way that Quake 3 doesn't like timers that run under 50 milliseconds because the server's framerate is 50ms.  Changing the server's framerate through sv_fps is BAD because high server framerates increase ping times and network load, causing more lag overall.  Also, spamming EV_FIREWEAPON and an accompanying impact event every 50 ms causes lag if more than two people are firing at the same time - especially for anyone on a dialup connection.  We tried a chaingun with an increasing fire rate for our .99a build, and it just didn't work well at all, which is why I redesigned it to work more in line with Quake 2, plus the whole authentic nostalgia thing.

My recommendation is to download the Quake 2 source code and see how they did the chaingun, and look at the Team Arena chaingun.  Between the two I'm sure you'll come up with something.  Your logic is on the right track as far as the timers go.  Here's another helpful tip - Q3 shotgun code can do wonders for keeping network lag down for multiple bullet strikes if you decide to send them in the same fire event.
Logged


I fly into the night, on wings of fire burning bright...
Lordbane2110
 
Chton
*******
Posts: 225

« Reply #4 on: 2005-07-14, 19:40 »

any chance on the link for this mod?, as i'd like to give it a go
Logged
OoPpEe
 
Spectre
**
Posts: 42

« Reply #5 on: 2005-07-14, 21:46 »

Phoenix, completly understandable on why you have "reservations for helping".
Thanks for the help, just got the Q2 source and will give it a look, as for looking at the Team Arena chaingun that is the current code I am using Slipgate - Tongue

Lordbane2110, no website yet. I can post a design doc we have.
Public release isn't that far away, we just have to re-model alot of things before we do a release as we are currenly using many mod's models as placeholders. Until we remodel or just make the mod use Q3 default models release won't happen.
Mod is only a 2 man team lol.
Logged
Tabun
Pixel Procrastinator
 

Team Member
Elite (3k+)
******
Posts: 3330

WWW
« Reply #6 on: 2005-07-15, 00:21 »

I've moved this thread to laced neptune, where it belongs Slipgate - Wink
Logged

Tabun ?Morituri Nolumus Mori?
Pages: [1]
  Print  
 
Jump to: