View previous topic :: View next topic |
Author |
Message |
RooT

Joined: 07 Sep 2005 Posts: 40
|
Posted: Mon Sep 12, 2005 4:02 am Post subject: ugh for a person that loves coding i hate math... |
|
|
math... failed it 3 times already hah... well some help here may not only improve my mod but help me pass a simple math test wondering if there is any math function asociated with spirals/helix circles or waves. what im looking for is a script that will cause an object to move foward but also spin around a center point. the point is to make a trail fallow this object leaving a spiral pattern. any other way this can be donw would also work so let me know. thanks!
-Root one
<9/11 today, give a thought> _________________ My mod site!
Mod Status:
Turret Defense: 30%
UPS: 45% |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Mon Sep 12, 2005 4:31 am Post subject: |
|
|
I assume you mean to make a trail follow a projectile while spinning round it, to leave a spiral effect like a railgun?
For that, the easiest way is to have to the trail as an entity, with it's owner set to the projectile;
The projectile entity should have an avelocity something like '0 0 300'
The think function of the trail entity should be something like:
void() trail_think =
{
if (!self.owner)
{
remove(self);
return;
}
makevectors(self.owner.angles);
setorigin(self, self.owner.origin + v_right * 10);
particle(self.origin, '0 0 0'. 14, 4);
self.nextthink = time;
};
Of course the particle() line should be changed for whatever trail effect you're after, or if it's a model flag trail effect then obviously you don't need a qc line for it at all.
This is untested of course..... _________________ Apathy Now! |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Mon Sep 12, 2005 6:35 am Post subject: |
|
|
Might not want that to be called every frame  _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Mon Sep 12, 2005 1:50 pm Post subject: |
|
|
Quote: | makevectors(self.owner.angles); |
Quote: | The projectile entity should have an avelocity something like '0 0 300' |
Actually, you can give the trail entity an avelocity instead, if for whatever reason it wouldn't be desirable to make the projectile spin. Or, you might want the projectile spinning in a different way (like a lavaball with avelocity '300 300 500'). Also make sure to set the trail entity's angles when it's fired.
Giving the trail entity avelocity and doing makevectors(self.angles); instead of on self.owner.angles will probably work better for you.
Now instead of calling the particle command, make a model that has nothing in it (a null model) and give it the rocket or grenade trail effect. Other effects to try are the vore trail and wizard trail. With the trail entity set to this special model, the trail will be created automatically, so you won't have to worry about calling the think function every frame (particles can be a real problem if you have too many). _________________ When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work. |
|
Back to top |
|
 |
RooT

Joined: 07 Sep 2005 Posts: 40
|
Posted: Mon Sep 12, 2005 5:47 pm Post subject: thanks |
|
|
actualy yes i was making a railgun hah i guess that spining trail is overused... but thanks ill give this a try, btw another wuestion, how do i get the rail to go through things? movetype_noclip with solid_trigger? just guessing _________________ My mod site!
Mod Status:
Turret Defense: 30%
UPS: 45% |
|
Back to top |
|
 |
|