Raised This Month: $ Target: $400
 0% 

Bazooka swirling missles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sepehr
Senior Member
Join Date: Sep 2006
Location: www.aotclan.net
Old 03-02-2010 , 02:23   Bazooka swirling missles
Reply With Quote #1

Well i wanted to make the rockets that are swirling around take place in the center, but still have the swirling effect around the rocket that's shot.
if you haven't taken a close look at the swirling death missle, basically there are rockets at the tip of the swirling motion, and basically what i want to do is make the rockets that are around the swirling effect to come in the the middle of the swirling.

basically, when i shoot the death missle, i want it that the rockets take place in the centre of the swirls, but have the swirling effect.

I'm pretty sure i have to change something here; however i never learned CMATH so i'm not sure how to change the location of the rockets, if anyone would show me how i would do this, i would appreciate it alot

Here is the original Bazooka hero
The CMATH link doesn't work on it.

Code:
public SD_CircleRockets(Ent){
    new NUMBER_OF_ROCKETS = get_cvar_num("Bazooka_sdcount")
    new Float:ROCKET_RADIUS =  get_cvar_float("Bazooka_sdradius")
    new Float:vOrigin[3]
    new Float:vVelocity[3]
    new Float:vEntOrig[3]
    new Float:RotMatrix[3][3]
    new Float:x, Float:y, Float:z, Float:theta
    new i, id, NewEnt
    if (!is_valid_ent(Ent)) return
    Entvars_Get_Vector(Ent, EV_VEC_origin, vOrigin)
    Entvars_Get_Vector(Ent, EV_VEC_velocity, vVelocity)
    id = Entvars_Get_Edict(Ent, EV_ENT_owner)

    RotMatrix[0][0]=vVelocity[0]
    RotMatrix[0][1]=vVelocity[1]
    RotMatrix[0][2]=vVelocity[2]
    RotMatrix[1][0]=-vVelocity[1]
    RotMatrix[1][1]=vVelocity[0]
    RotMatrix[1][2]=0.0
    SD_Normalise(RotMatrix[0])
    SD_Normalise(RotMatrix[1])

    RotMatrix[2][0]=((RotMatrix[0][1])*(RotMatrix[1][2]))-((RotMatrix[0][2])*(RotMatrix[1][1]))
    RotMatrix[2][1]=((RotMatrix[0][2])*(RotMatrix[1][0]))-((RotMatrix[0][0])*(RotMatrix[1][2]))
    RotMatrix[2][2]=((RotMatrix[0][0])*(RotMatrix[1][1]))-((RotMatrix[0][1])*(RotMatrix[1][0]))

    for (i=0; i < NUMBER_OF_ROCKETS; i++){
        theta = (float(i)/float(NUMBER_OF_ROCKETS))*2*PI+fAngleBaz
        x = 0.0
        #if !defined AMX98
        y = floatcos(theta)*ROCKET_RADIUS
        z = floatsin(theta)*ROCKET_RADIUS
        #else
        y = cos(theta)*ROCKET_RADIUS
        z = sin(theta)*ROCKET_RADIUS
        #endif
        vEntOrig[0]=RotMatrix[0][0]*x+RotMatrix[1][0]*y+RotMatrix[2][0]*z
        vEntOrig[1]=RotMatrix[0][1]*x+RotMatrix[1][1]*y+RotMatrix[2][1]*z
        vEntOrig[2]=RotMatrix[0][2]*x+RotMatrix[1][2]*y+RotMatrix[2][2]*z
        vEntOrig[0]+=vOrigin[0]
        vEntOrig[1]+=vOrigin[1]
        vEntOrig[2]+=vOrigin[2]
        NewEnt = SD_CreateRocket(vEntOrig, vVelocity, id)
        Entvars_Set_Int(NewEnt, EV_INT_iuser1, Ent)
        Entvars_Set_Int(NewEnt, EV_INT_iuser2, i)
    }
}
__________________

Last edited by Sepehr; 03-02-2010 at 02:30.
Sepehr is offline
Send a message via MSN to Sepehr
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 03-02-2010 , 03:42   Re: Bazooka swirling missles
Reply With Quote #2

that swirl effect is created by attaching decaying beams to each missile, in order to get the effects to occur further out you would have to create ents an even further radius away from the central missile and attach the beams to those instead. Otherwise you'de have to find a different way of creating the effect. The easiest thing to do is to make the outer missiles invisible so the one missile in the center seems to create the special effect itself, which you would only have to make minor changes in the SD_CreateRocket function to pull it off.
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-02-2010 , 06:47   Re: Bazooka swirling missles
Reply With Quote #3

D you only want to make so that the missiles appear in the center, or do you want the missiles to actually be there and damage if they hit something?
__________________
The Art of War is offline
Sepehr
Senior Member
Join Date: Sep 2006
Location: www.aotclan.net
Old 03-02-2010 , 11:00   Re: Bazooka swirling missles
Reply With Quote #4

i want it like this, when the missle is shot the rockets that are in the circle to come in the middle of the circle with the swirls still taking place without any rockets on the tip of them.
__________________
Sepehr is offline
Send a message via MSN to Sepehr
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-02-2010 , 12:42   Re: Bazooka swirling missles
Reply With Quote #5

Yes but.... xD
Do you want the actual missiles to be out there, doing damage? Or just that it looks that way? Much easier to make the second one I think xD
__________________
The Art of War is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode