Inside3D!
     

This has been Bugging me...

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Sun Jul 04, 2010 3:13 am    Post subject: This has been Bugging me... Reply with quote

Well From redrums Charge code, I made it suitable for Prime. But I was wondering, if The velocity returns when self.charge returns to 0.
Look

/*
================
Blaster Firing
================
*/
Code:
void() W_FireBlaster =
{

   local   entity plasma;
   blaster_flash();
   self.currentammo = self.ammo_blaster = self.ammo_blaster - 0;
   sound (self, CHAN_AUTO, "weapons/guncock.wav", 1, ATTN_NORM);
   self.punchangle_x = -2;

   plasma = spawn ();
   plasma.owner = self;
   plasma.movetype = MOVETYPE_FLYMISSILE;
   plasma.solid = SOLID_BBOX;
   plasma.classname = "missile";
      
// Set the speed of the Plasma

   makevectors (self.v_angle);
   plasma.velocity = aim(self, 1000);
   if (self.charge >= 10)   // Sets the Velocity for When charging the Blaster
      if (self.charge < 20)
        plasma.velocity = plasma.velocity * 4200;
   if (self.charge >= 20)
      if (self.charge < 30)
        plasma.velocity = plasma.velocity * 3700;
   if (self.charge >= 30)
      if (self.charge < 40)
        plasma.velocity = plasma.velocity * 3400;
   if (self.charge >= 40)
      if (self.charge < 50)
        plasma.velocity = plasma.velocity * 3100;
   if (self.charge >= 50)
      if (self.charge < 60)
        plasma.velocity = plasma.velocity * 2800;
   if (self.charge >= 60)
      if (self.charge < 70)
        plasma.velocity = plasma.velocity * 2500;
   if (self.charge >= 70)
        plasma.velocity = plasma.velocity * 2000;
   else
   plasma.velocity = plasma.velocity * 4500;

   plasma.angles = vectoangles(plasma.velocity);
   
   if (self.charge >= 10)   // Sets the Different Damages
      if (self.charge < 20)
        plasma.touch = BlasterTouch1;
   if (self.charge >= 40)
      if (self.charge < 50)
       plasma.touch = BlasterTouch2;
   if (self.charge >= 70)
        plasma.touch = BlasterTouch3;
   else
   plasma.touch = BlasterTouch;
   setmodel (plasma, "progs/blast.spr");
   if (self.charge >= 50 || self.charge >= 70)
   plasma.frame = 0;
   else
   plasma.frame = 2;

   setsize (plasma, '0 0 0', '0 0 0');      
   setorigin (plasma, self.origin + v_forward*10 + '0 0 16');
   
// set missile duration
   plasma.nextthink = time + 5;
   plasma.think = SUB_Remove;
   self.charge = 0;
};


Should I have a seperate code that Givees another entity the same charge as the player? Like it passes the charge level of the player onto the entity, and When the entity gets removed, then entity.charge = 0?

Like once self.charge = 0;, Does the velocity return to else or does it stay the same all the time? I am just wondering. Don't know if you quite understand my question. This is just a quick question, and I will delete this thread once it's answered.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
DukeInstinct



Joined: 10 Jul 2010
Posts: 4
Location: DukeLand

PostPosted: Sun Jul 11, 2010 1:22 am    Post subject: Reply with quote

Your current code is always going to set the plasma.velocity to plasma.velocity * 4500 unless self.charge is more than 70.

You need to rewrite it like this:
Code:
if(self.charge >= 70)
plasma.velocity = plasma.velocity * 2000;
else if (self.charge >= 60)
plasma.velocity = plasma.velocity * 2500;
else if (self.charge >= 50)
plasma.velocity = plasma.velocity * 2800;
else if (self.charge >= 40)
plasma.velocity = plasma.velocity * 3100;
else if (self.charge >= 30)
plasma.velocity = plasma.velocity * 3400;
else if (self.charge >= 20)
plasma.velocity = plasma.velocity * 3700;
else if (self.charge >= 10)
plasma.velocity = plasma.velocity * 4200;
else
plasma.velocity = plasma.velocity * 4500;


Code:
if (self.charge >= 70)
plasma.touch = BlasterTouch3;
else if (self.charge >= 40 && self.charge < 50)
plasma.touch = BlasterTouch2;
else if (self.charge >= 10 && self.charge < 20)
plasma.touch = BlasterTouch1;
else
Plasma.touch = BlasterTouch;

_________________


Coder/3d modeler for UrbanWars
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Sun Jul 11, 2010 2:23 am    Post subject: Reply with quote

beware the sv_maxvelocity cvar too!
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Sun Jul 11, 2010 10:25 pm    Post subject: Reply with quote

What's that cvar do. I am hitting nowhere near Maxvelocity for a Projectile.
_________________
Gosh... debby ryan Is hot. I swear I will mary her...

My project Prime for psp:

http://www.moddb.com/games/primepsp1

We have a website, But are getting a new one.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Mon Jul 12, 2010 5:25 pm    Post subject: Reply with quote

max velocity controls every things velocity you need to raise it. i had an issue with a sniper i was designing once.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group