Archived

This topic is now archived and is closed to further replies.

loply

Quake3 vec_3t and vec_t structures

Recommended Posts

loply    122
Hi people, I decided to try my hand at the Quake3 source code recently, but I have a few questions. Firstly, I tried modifying the rocket launchers fire_rocket function to fire 6 rocket simultaneously. It prooved simple to loop the function and return multiple rockets with random()ised speeds. However, this launched rockets in a 2D fan shape, so I tried randomizing the vec3_t structure named "dir" which is presumeably the rockets direction. This seemed simple enough, right? for(x=1; x<5; x++) { dir[x] = dir[x] + (random()*0.1); } So I fired my mod up, it seemed to work, but... When you turn, the distrobution of the rockets changes! Face in one direction and all six rockets fan out vertically, face at 90 degrees to that direction and they van our horizontally, face upwards and they dont fan out at all etc etc... Can anybody explain this to me? Also, can anybody tell me how to test my mod without having to wait for qvm`s to compile? Im sick of 3 second changes taking 60 seconds to try out Thanks in advance, -loply.

Share this post


Link to post
Share on other sites
loply    122
Btw, just incase it matters, here are other modifications I made to fire_rocket():

Changed the bolt->s.pos.trType to TR_GRAVITY, changed the call to VectorScale on the bottom few lines to randomize the speed by adding +(random()*600) to it, and the code I added for changing the dir structure was just above the calls to Vector* and below the last bolt-> assignment.

[edited by - loply on May 1, 2002 12:37:21 PM]

Share this post


Link to post
Share on other sites